Archive

Stark Industries - Entrance into Madness

This is going to be my first non technical series. I really want to illustrate some insanely frustrating, almost funny (if it wasn’t so maddening) experiences. If you guys have ever read The Daily WTF, this is my personal experience with some WTF’s.

After graduation I took a job at… we will call it Stark Industries. I spent nearly 6 months waiting for my security clearance. During this time I read documentation, did code reviews, and watched A LOT of YouTube. Continue reading ‘Stark Industries - Entrance into Madness’

Javascript2 Generics - The dot, explained

There was a link on Ajaxian a while ago about Javascript2 and Generics. Everyone was either up in arms that Javascript2 was going to implement generics in the first place or that the syntax was weird with the dot in there. I am of the second camp. I did some research and discovered a little more information on why this decision was made. Take a look at the javascript generics syntax discussion:

  • Angle brackets are hard to parse because they are not normally used as brackets and because ECMAScript does not clearly delineate “type” context expressions from “other” expressions.
    • For annotations we can perhaps fix the parsing problem by introducing syntactic constraints on type expressions.
    • With parameterized function types, we will need unbounded lookahead: one can’t disambiguate until one sees the closing angle bracket. This complicates the parser substantially.

So, the reason this syntax was chosen is to ease parser developer’s lives.  The primary reason being that the parser cannot tell whether a < is the start of a parametrized definition or if it is just a less-than-sign.  This is why they tentatively decided on prefixing the dot on there.  I suppose I understand this, especially with a type un-safe language like Javascript.  I am still hoping they choose to make the parser developer’s lives more difficult so my life can be easier :-).

If you read on in the discussion someone states that they might choose to drop the dot later.  (fingers crossed)  Honestly though, if I get a decent Javascript IDE out of these language changes then I am fine with the dot.

MySQL Stored Procedure Performance Tricks

In our application at ControlPath, we have a pretty complex permission system. Well, imagine a permission system based off of a cyclical graph of 30,000 nodes with multiple levels of inheritance rules and you just begin to scratch the surface. I recently rewrote the permission rebuild caching system into recursive stored procedures. This improved performance from 45 minutes… to 45 seconds. There are a bunch of tricks I employed to get this kind of speedup, but today I am going to share 2 of the simplest ones with you… Continue reading ‘MySQL Stored Procedure Performance Tricks’

ExtJS - QueryStore & Store Query Language

This is purely conceptual at this point but I would love to have this feature. It would be similar to TrimQuery but be based on Ext Stores. I would love to be able to do this:

[-]View Code JAVASCRIPT
var joinedStore = new Ext.data.QueryStore({
  query:
    "SELECT p1.name as parentName, p2.name as childName,
            IF(p1.id=1,'parent','child') as relationshipType "+
    "FROM relationship r "+
    "JOIN people p1 ON (r.parentId = p1.id) "+
    "JOIN people p2 ON (r.childId = p2.id) "+
    "WHERE p1.id = 1 OR p2.id = 1"
});

[Edit]

Let me preface this with the fact that this is NOT server side SQL. This SQL never gets sent to the server. This is a very simple client side implementation that is only used for joining together data from multiple stores into an intermediary store which is useful for displaying grids that don’t match your server side data model.  It saves you from having to create one-off data providers for these grids and having to migrate changes to your other stores by hand.

[/Edit]

Continue reading ‘ExtJS - QueryStore & Store Query Language’

ExtJS State Management bug - (patch enclosed)

The ExtJS statemanager is broken, at least in version 2.1. Do not use it. The problem is that all components save their state even if stateful is set to false… which causes some interesting issues.

Continue reading ‘ExtJS State Management bug - (patch enclosed)’

Bigger isn’t always better for MySQL

Fairly recently, I did some performance tuning on our MySQL servers and discovered some very interesting things.  The previous “DBA” had the mantra of “set the value higher and it will go faster.”  We are running some pretty beefy hardware so I can definitely see where this logic would come in to play.  I became concerned when my little laptop with a default MySQL installation was getting better performance than our 8 gig of Ram, dual processor quad core monster server.

Continue reading ‘Bigger isn’t always better for MySQL’

ExtJS Performance - Event Listener Cleanup

Its a pretty simple code snippet but the overarching topic, performance (especially in ExtJS), can be complicated and developers really need to be cognizant of performance impacts.  Especially so when its running on the client which you have no control over the performance specs of the machine.

There has long been the problem in Ext with the issue of cleaning up event listeners after the listening component has been destroyed.  Until now, developers have had to code custom destructors to handle this cleanup.

Continue reading ‘ExtJS Performance - Event Listener Cleanup’

A blog… Finally!

I have been wanting to write a blog for quite a long time… it can’t be that hard right!?

My blog will be primarily focused on technical subjects revolving around web development and design.  Currently, I am working heavily with Java, MySQL, and ExtJS so my posts will mostly revolve around those subjects.  I am going to try and stay away from the beginner tutorial type things and stick with more advanced topics.  There is enough of that out there already.

Take a look at the “About Me” page so you can get a better idea of… well… yes… me.  (Sorry, I am really not that interesting)