Sunday, April 28, 2013

Wacom Cintiq 22HD with Ergotron LX arm

I got a Cintiq 22HD for various reasons (after trying the 24HD touch). But I really wanted a more ergotronic drawing position, so I got the Ergotron LX arm. Here is a tutorial I wished I had when I was making the decision.

Here is my final setup for drawing:

How to Setup

Take the Cintiq off the stand and place on a cloth:

Unscrew the mount:
 Notice the black washer:
 Split the mount to take it off the cable:
 Move the cables down:
 And now open your ergotron lx box:

 Mount the Erogotron using the four provided screws:

Mount it on the desk:

 Put the tablet on the desk mount:
 And you are golden:
 I prefer to have to dropped all the way down for added stability:
 Use as dual monitors:

 Later on I decided to remove the extension for even more stability and added desk space:

And we are in business:

Tuesday, April 23, 2013 Error: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies

The complete error statement:
Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The parameter is incorrect.

Happens when your computer freezes while running the debugger. Now every time you run this particular web application you will get this error.

Simply deleting the related files in the following folder:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

Also if you are using .net framework 4 you need to delete all the files in this folder:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

You may need to change your folder Options to view Hidden and Operating System Files. 

Saturday, April 20, 2013

Webstorm Error : XMLHttpRequest cannot load file. Origin null is not allowed by Access-Control-Allow-Origin

This happens because XMLHttpRequest is not allowed by default in any web browser when running off the local file system.

One way around that is to run in a web server but for simple quick scripts that might be an overkill.

Here's how you can run your site in webstorm without a web server: 

There is a simple flag --allow-file-access-from-files you can set in Chrome to overcome this. Go to your settings:
Then Web Browsers and click on Settings button next to chrome:
Put in the flag and get cracking:
Make sure you have all instances of chrome closed before you start a debug session because the command line flag will only work on a fresh launch of the browser.

Update: or you could always use (for webstorm 6+) : http://localhost:63342/Your_Project_Name which is the built-in web server inside WebStorm.

See how to do it here:

Tuesday, April 16, 2013

Visual Studio Tip: Quickly do manual edits to Project file

Sometimes you need to do manual edits to the visual studio project file e.g. when setting up dependent files : .
Here's how I do it inside visual studio. Right click the project and select unload project:

Now right click the unloaded project and select Edit as shown:
Now you can use your Visual Studio editor to make the edits you need:

Saturday, April 13, 2013

What is Firefox ESR? How can you get Firefox Extended Support Release?

Firefox ESR is basically designed to prevent rapid upgrade cycles in browser breaking your software, since you cannot be constantly testing the latest version that comes out (pretty quickly nowadays).
The way they do this is that they simply update the user browser only once a year. With a 12 week overlap between two version so you can test if anything is broken. However, security updates continue throughout the year.

There is no additional difference from the standard desktop browser. Quote : “Firefox ESR is functionally identical to Firefox for desktop,”
So if it works in Firefox. It works in ESR.

The support gets no special treatment from Mozilla. It is via a mailing list: Which is just a group of IT guys like us. The only difference is that everyone is using the same version of browser so if something is broken for one guy due to some browser issue, others can easily test it. You don’t need to ask “which version of Firefox are you using?”

Warning it overwrites the Firefox you currently have installed, since it is exactly the same. My settings and addons e.g. firebug were carried over without issues. Current ESR version (April 2013) is equivalent to Firefox 17 (which was the latest standard version Nov 2012). After you install this all it effectively does is change your update channel to esr:


Wednesday, April 10, 2013

Migrating Javascript to Typescript Tip : Sealed classes

Sealed classes in Javascript are made using the revealing module pattern.
In this case when you migrate the typescript classes all your variables names must suddenly be prefixed with this keyword.
Problem is that this in callbacks is going to be the window object.

So you need to convert functions (being passed as an argument into another function ... i.e. a callback)  that look like:

Into arrow functions:

To make sure that this gets captured properly in the generated Javascript. A quick way to do this is to search for all instances of function since its really not required to use this keyword in typescript classes. 

Tuesday, April 9, 2013

Sketchbook Pro Pencil in ArtRage

By default the pencil that comes with ArtRage seems quite grainy:
The reason is the not the pencil. Its actually the canvas. You can get the sketchbook pro style canvas quite easily in ArtRage. Select Canvas Settings:

Remove all roughness and grain size. Then click New:
Save you file:
And then get cracking:


Monday, April 8, 2013

Typescript interface implementation gotcha

One thing to note when an interface is implemented in typescript is that for each function only the following are checked:
  • Number of parameters
  • The function return type

Based on this the following is perfectly valid code:

However the following is an error as expected.

You can see a discussion regarding the same : 

Sunday, April 7, 2013

Typescript static constructors for classes

Typescript does not currently provide a syntax for C# style static constructors. However you can get the same effect with the pair:
  • A non void static function
  • A static variable assignment used to call that function:

Foot note:  There is a request for a dedicated syntax to be added to typescript here :

e.g. (Non working / Proposed syntax) :