April 2011

ExtJs 4 -Vertically stacked side-by-side multiple charts

Web 2.0: 

ExtJs 4 was released yesterday and the reason I am pretty excited about this new ExtJs version is Charting. I have been using HighCharts with ExtJs till now. Although HighCharts work and look great, there isn't a standard adapter/bridge provided by either ExtJs or HighCharts team to make them work together seamlessly.

ExtJs 4 - Running docs over IIS in Windows

I have already been using ExtJs 4.0-Beta3 for the last couple of weeks. And an hour earlier, I occasionally went to the Sencha site to check one of my posts on the forums. And the surprise was waiting there. ExtJs 4 had been launched today.

I immediately downloaded the release version for ExtJs 4 and updated the latest build to one of my projects where I was using ExtJs 4 Beta 3. Separately, I configured the accompanying docs to run over IIS 7 on my Windows 7 machine.

Serializing/Deserializing .Net's native RSA Public/Private keys

Okay, here's the second consecutive blog post on serializing/deserializing RSA public/private keys, this time generated by the native RSACryptoServiceProvider available in .Net (the previous post available here related to serializing keys generated by open-source Bounty Castle library).

Serializing/Deserializing RSA Public/Private keys generated using Bouncy Castle library

.Net provides a good Cryptographic framework in the System.Security.Cryptography namepsace. But I have sometimes found it lacking for my needs (and non-intuitive at some other times).

Yesterday I needed to generate a RSA Public-Private key pair in a client-server communication, where the server generates the key pair and sends off the public key to the client, which the client subsequently uses to encrypt data being sent to the server. The server stores the Private key in the database used later to decrypt data received from the client and then send the encrypted response to it.

Google Chrome: Cannot read property '_commandLineAPI' of undefined error

Web 2.0: 

I was having problems debugging my javascript code in Google Chrome browser the other day. I was not able to use the Chrome Developer Tools' Console while stepping through a particular method (let's say "myProblematicMethod") in the javascript code, and was always getting the following error whenever I typed anything into the Console:

 

Drupal - true "Save Draft" functionality for node forms by overriding node form validation

Let me clarify staright away that the code below has been tested successfully against Drupal 6 only. But I believe it should work with Drupal 7 also with minor changes (if any required). Okay now, let's come to the point.

Drupal - node form validation methods in hook_form_alter should be set using #after_build to always execute on form submission

Last week, I was trying to add a custom validation method for node form of a particular content type in Drupal. My initial approach was as naive as specifying my custom validation method in hook_form_alter, something like the following:

 

{syntaxhighlighter brush: php;fontsize: 100; first-line: 1; }function mymodule_form_alter(&$form, &$form_state, $form_id) { switch($form_id) { case 'artist_node_form': $form['#validate'][] = '_mymodule_custom validation'; break; } }{/syntaxhighlighter}

Html - Using Buttons for selecting files to be uploaded

Well, you know the good old <input type="file" /> widget in html, the one used for selecting files to be uploaded on a web page, right.

The problem with this widget is its limited support for styling and scripting compared to other html tags (probably due to security concerns). You cannot style or specify text for the "Browse" button for this widget, for example.