Security Vulnerability in the Bootstrap Gem

Here is the relevant GitHub issue. They were so sneaky. The posted a ruby gem, but with some sneaky additions. This was not posted on Github. They were hoping that nobody would notice. But someone did. In order to pull this off, you’d have to be a fairly sophisticated rubyist, with a good understanding of rack, and some basic security knowledge exploits. They must have some time on their hands to pursue such nefarious ends.

Read More

Prawn Table - Hello World Example

Prawn is my go-to pdf generator, when using a Ruby on Rails application. I wanted to create a table in prawn, and having no idea how to do so, stumbled upon an article on-line on how to do this. Without it, I would have been lost.

Read More

Beautifying your Ruby Code Automatically via Sublime Text 3 (Ruby on Rails)

Nothing could be more paramount, in the writing of code, than to make it understandable and legible. You will be greatly assisted in the latter task, if you employ a beautifier, that styles everything automatically for you. If you are using Sublime Text 3 as your text editor, then you can employ the “BeautifyRuby” package to help automatically indent and style your rails templates.

Read More

Getting DataTables to Work (Rails)

My personal cliff notes in getting this up and running ASAP (without worrying about AJAX or server-side processing). That come come later. I suppose it’s a problem that you want to have.

Read More

Accessing AutoCAD Path and Directory Names (AutoCAD .net API)

A code snippet to show you how to get at some common path / directories. I tend to use the methods of combining, because occassionally, AutoCAD’s current drawing path is not it’s current drawing path (when for example you use the Database.Filename property of the .net API) - but instead, what is returned is a path deep in the bowels of Window’s temp directory comes up. And that’s obviously the wrong value. So a hack I tend to use is to combine the drawing name (excluding the path) and the directory of where the drawing currently resides, and to combine the two using a System.IO.Paths.Combine(...) method (you’ll have to pass in the appropriate parameters of course) to come to the desired answer.

Read More

Add if Layer is Missing (AutoCAD .net API)

A very handy method. Often detailers will ask for something to be placed on a particular layer. But since they are using a 100 different drawing templates without any consistency nor standards, the onus is on you to impose that standard on them. So you’d have to check for a layer and add it if it doesn’t already exist. Anyways, that’s enough griping: here is the code:

Read More

Setting up BatchProcessing With AcCoreConsole and ScriptPro (AutoCAD .net)

_config.yml

This can be difficult and extremely frustrating if you get it wrong, because AcCoreConsole is not the most user friendly interface out there – but, it is extremely fast. If AutoDesk combines AcCoreConsole with some kind of super fast in memory cache like Redis then operations will be an order of magnitude faster; and even better than that would be if the.NET API is changed to incorporate the smart GraphQL query specifications that I am pretty sure will leave behand Restful APIs in its wake. I digress.

Read More

7 VS Hacks to Help you Debug

I can’t say it any better than what’s said here. It’s masterfully explained and brilliantly clear with .gifs to illustrate the concept. Would highly recommend you take a look, especially if you are writing complex multi-threaded applications.

Read More

What is a layout control?

You might not know this but I have a part time job, at the golf shop. One of my duties involves: stacking the shelves full of products.

Read More

.NET API vs COM Interop API (AutoCAD Programming)

There seems to be a lot of confusion with folks about the difference between using the AutoCAD .net API vs the COM Interop API. They both hope to do the same things, but via different ways. Given a choice, I’d always recommend using the .net API because it is much more powerful. Or if you are familiar with C++ then go for ObjectARX API which gives you immense power. You may think that using .net API obviates the need to manage resources - but you’d be wrong: the .net API is simply a wrapper to the underlying unmanaged types. You have to explicitly use transactions or you have to otherwise explicitly dispose of objects after you’ve finished using them. Nevertheless, the .net API is still very good to use in certain instances.

Read More

Transformed BlockReferences (AutoCAD .net API)

So you’ve inserted a block reference into the model space. Very good. And you’ve decided to rotate it and move it around. Again: very good. Now you wish to programmatically place more block references, similarly rotated, but perhaps spaced some distance apart. How are you going to do this.

Read More

Finding a duck type (OOP)

I see this problem all too often in stack overflow: a situation where folks check for the type of a class in an if statement, and then respond accordingly. Rather than repeating myself a million times, I thought it much easier just to write a post on the subject (DRY FTW!). Anyways, this type of code (pun intended) smacks of a duck type not being identified and utilised.

Read More

Liskov Substitution Violations (OOP)

Imagine you have two classes. A parent and a child class. The child inheritance from the parent. Therefore the child should be able to do everything that a parent does and possibly more.

Read More

Tekla Properties Class – Open Source ( c# - Tekla Open API)

In a post a few weeks back I was griping about the limitations of Tekla. Ideally I’d want to resort to enums to get access to a particular property. But Tekla forces you to use strings directly to query for the property you are after. This is a minor inconvenience. So I devoted three hours of my life in the service of the public to ensure that nobody suffers anymore.

Read More

How to create a master word document

Did you folks know that this was possible: you can have a master word document and have sub documents linked to it. I can’t say it any better than they say it here: so i’ll just post the link.

Read More