An Overview of the new ExtJS 4 Javascript framework

Having worked with ExtJS 3.1, it’s a real pleasure to see them keep pushing forward today with the release of version 4. ExtJS is a great framework for doing specific types of UI, and it takes a minute to wrap your mind around the mainly class system configuration programming style required to get things rolling but once you do, you realize the genius and flexibility behind. So kudos to the Sencha team on this achievement. I’ve looked at the press release and notes and  there is some improvement all around. The’ve added a lot more documentation than with previous releases. The class system has been extended to support dynamic loading, mixins and live dependency calculation. It is also completely sandboxed which for example allows you to run multiple versions of ExtJS within the same page. A major change, not that major if you have been following their work with the Sencha Touch mobile development framework, is the introduction of an MVC application architecture which should help streamline application development and faciliate transitions between team members. Welcomed as well is the addition of SDK tools with support for Javascript code optimization.

Topping the new feature list is the introduction of whole new plugin-free charting package (which Sench uses as an example of the sandboxing mentioned earlier by providing a chart written in ExtJS4 running fine within an ExtJS3 desktop) built on web technologies (SVg and VML). Also, the Grid, which i have used extensively in ExtJS3 is getting a makeover and has been modularized and is now extensible. Some of the extensions used in ExtJS3 and previous versions to enable for example column locking or cell editing are now obsolete as those features are available out of the box. Even better yet, the markup used to render the grid, which turned out to be quite a challenge for me as it was not 508 compatible, is now generated on demand which makes the need for pagination unecessary. TreeGrid has been integrated within the core code and supports all of the normal Grid functionality.

The Data package has been revamped and supports HTML5 localStorage and introduces the new Model class which allows you to accurately model your data layer. I’ve somehow played with its Touch counterpart, and will probably expand on it later, but it consists mainly of Fields, which represent the data fields, a Proxy, which is responsible for loading and saving data from a source, Associations which defines how Models relate to each other, and Validations for validating fields before a save. This very much reminds me of the CakePHP MVC architecture, which itself is based on the RoR model.

I would mention in passing improved support for theming, a new FocusManager class which makes it easier to enable keyboard navigation in your application, which should really help with with accessibility and 508 compliance.

Overall, I think that Sencha is maintaining a good direction with their product and as soon as I find a good project whose requirements fit the features offered by the framework,  it will be on top of my list of possibilities. In the mean time as I am working on some mobile development with Sencha Touch, it will allow be to familiarize myself better with all the new features.

Check out the press release for yourself: http://www.sencha.com/blog/ext-js-4-final/

Advertisements

Deleting a file or folder monitored by TortoiseSVN

If you are trying to delete a file or folder and it won’t let you by saying that it is being used by another process and you are sure that no other visible program has it opened, chances are it is being monitored by TSVNCache.exe, the background process that watches your file system for SVN related files and folders. Killing that process will allow you to delete the file or folder you need. Note that if you want to delete a file that is being versioned you should do it through the SVN delete command and not through Windows as you risk corrupting your working copy. This particular case applies to instances where you want to delete a folder that is no longer being version controlled. If it does not immediately work, then restarting your computer after deleting the SVN folders should do it.

How to easily delete Subversion Folders in Windows

You’ve probably ran into a situation where you needed to just remove Subversion SVN folders from your project, maybe do a new checkout or whatever. I’ve ran into the issue while trying to create a new working copy of a repository i have been working with after getting a :

<pre>Unsupported working copy format
svn: This client is too old to work with working copy 'C:\myproject'; please get a newer Subversion client</pre>

This happened because i checked out the project with an older copy of Subclipse, and probably did an update with the latest version of Tortoise SVN i had installed. Googling around the remedy seems to be to check out a fresh copy of the project using the older client, removing the older SVN folders from the unsupported working copy and then overwriting the fresh working copy with the SVN folder free unsupported working copy, effectively preserving your edits, while being able to check them back in. To delete the SVN folder from the unsupported copy, create a registry file as such in a text editor, run it and click Yes to add it to your registry.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@="Delete SVN Folders"
[HKEY_CLASSES_ROOT\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""

Alternative in case the above script does not work for you:

Windows XP

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@="Delete SVN Folders"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"@ECHO OFF && TITLE Removing SVN Folders in %1 &&
COLOR F0 && ECHO Searching for .svn folders recursively in %1 &&
FOR /r \"%1\" %%f IN (.svn) DO ( RD /s /q \"%%f\" && ECHO Deleting %%f... )\""

Windows Vista/7

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@=”Delete SVN Folders”
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@=”cmd.exe /c \”TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \”%1\” %%f IN (.svn) DO RD /s /q \”%%f\” \”"

When done, in Windows XP you should be able to delete all SVN folders in a folder by right clicking on the folder and selecting “Delete SVN Folders”.

References:

http://www.toxiccoma.com/random/recursively-delete-all-svn-folders-in-windows

http://www.iamatechie.com/remove-all-svn-folders-in-windows-xp-vista/

Zend Framework: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication

Setting a new project that uses Zend Framework in Zend Studio I ran into an issue trying to launch the app. I got an this error;


Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file' in C:\wamp\frameworks\ZendFramework-1.7.8\library\Zend\Db\Adapter\Pdo\Abstract.php on line<em>143</em>

It turns out, the version of Zend I am running is 1.7, which is coded against an earlier version of PHP and when i installed WAMP i installed the latest version which came with PHP 5.3 which uses a new “mysqlnd” driver, thus the error. I guess at this point the choice is either to install an older version of WAMP or to reset the password for the database user as suggested in the bug description.

WAMP Apache Error: “You don’t have permission to access / on this server”

Installing and setting up WAMP is a breeze on Windows, but you are bound to run into issues. I’ve encountered a peculiar one this weekend while trying to run a PHP application I am working on. I had XAMPP already running on my machine, and to avoid having both WAMP and XAMPP lauching by side, i decided to switch all my projects to running on the Apache server provided by WAMP. To do so, i needed to set up a Virtual Host to point to the directory previously holding the projects i had running under XAMPP. I modified my httpd.conf this way:


#Uncommented the line loading the Virtual Host configuration file

Include conf/extra/httpd-vhosts.conf

Then in the httpd-vhosts.conf file.

<pre>#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#

<Directory "C:\Dev\Workspace">
  Order Deny,Allow
  Allow from all
  AllowOverride all
</Directory>

<VirtualHost *:80>
    ServerAdmin aboukone@aboukone.com
    DocumentRoot "C:\Dev\Workspace"
    ServerName localhost.dev
</VirtualHost></pre>

With the configuration set up that way, I lost all access to my localhost when starting WAMP. I could access all the projects in the C:\Dev\Workspace folder, but not the ones in the C:\wamp\www standard folder. I could still access phpmyadmin web interface but nothing in the www folder, even a simple html file. Trying to access for example the WAMP index page (www/index.php) would get me:

<h1>Forbidden</h1>
You don't have permission to access / on this server.

I tried messing with the settings in the httpd.conf for the DocumentRoot at C:\www\wamp folder to Allow All, minding that this is unsafe on a live web server :

<pre><Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow all
</Directory></pre>

but got a:


The requested URL / was not found on this server.

error from Apache. A clue about going on to fix this came from commenting out the VirtualHost configuration line again in httpd.conf. That done, I was back in business with my www folder being visible again as well as all the projects within. It seemed that the VirtualHosts configurations were overriding the default Server configuration in httpd.conf. I then added the following code in httpd-vhosts.conf and both my C:\Dev\Workspace and C:\wamp\www folder were again “visible” and I was able to access projects in both locations:

<pre><Directory "C:\Dev\Workspace">
  Order Deny,Allow
  Allow from all
  AllowOverride all
</Directory>

<VirtualHost *:80>
    ServerAdmin aboukone@aboukone.com
    DocumentRoot "C:\Dev\Workspace"
    ServerName localhost.dev
</VirtualHost>
#Added this configuration for the WAMP www folder
<VirtualHost *:80>
    ServerAdmin aboukone@aboukone.com
    DocumentRoot "C:\wamp\www"
    ServerName localhost
</VirtualHost></pre>

Hope it helps!