I Made This: Color Extractor

Preview of Color Extractor Check this out if you're bored or love color porn: cx.jonhartmann.com. It runs fully in your client, extracting color palettes from the image using the Canvas. The palette is selected based on color density and an amazing color bucketing system that I'd love to claim as my own.

 

Writing jQuery Widgets

This blog is far too quiet. I'm still doing coding. Lots of it in fact, but I'm also doing presentations to the other developers on a regular basis about new topics and tests, so I'm not generating lots of documents for external consumption. Except for this presentation.

This is pretty much a reskinning of info from the jQuery website; The Home Depot isn't actively using Widgets so its not going to be of use internally for a while.

Hit "Download" below to download a PPTX presentation covering the basics of jQuery Widget development.

 

StarupBus Alumni Team: SkillMeUp

For those of you that don't know, I'm participating in StartupBus this week, in the Alumni competition. My team, SkillMeUp has finished pitching for the semi-semi-finals at the amazing Rackspace facility in San Antonio, and we're feeling confident that we're going to go big over the next few days.

I know that we wouldn't have done as well without the additional developer resources provided by Elance; they were able to keep up the pace while we slept and brought skills to the team to which wouldn't have otherwise had access. SkillMeUp shows you the next step in pursuing the career of your dreams and helps you get there, and so I also want to thank Tecnologico De Monterrey for helping us bridge the gap as we establish partnerships with companies that provide training to those who are pursuing their career goals.

Also a shout out to my team: Will Mitchell and Kyle Eschenroeder, Kevin Stotz, and Romiro Fidalgo who came all the way from Mexico. We're going to rock this, and make bank.

And no, none of them paid me to say this... our sponsers and my team mates really are that cool.

 

Google's new Research Bar is nifty

I have to say, the research sidebar is very useful; Google is really trying to give Docs some powerful differentiators, and I'd say this is one.

 

Utility Function: StructMerge

If all you need to do is merge two simple structs, then StructAppend() is a great function to get you there, but if you have complex structs (meaning structs that contain structs) you may be wanting to find a solution that does a deep merge:

<cffunction name="StructMerge" access="public" output="false" returntype="struct">
    <cfargument name="Struct1" type="struct" required="true" />
    <cfargument name="Struct2" type="struct" required="true" />
    <cfargument name="Overwrite" type="boolean" required="false" default="true" />
    
    <!--- Loop Keys --->
    <cfloop collection="#Arguments.Struct2#" item="Local.Key">
        <!--- Find if the new key from Struct2 Exists in Struct1 --->
        <cfif StructKeyExists(Arguments.Struct1, Local.Key)>
            <!--- If they are both structs, we need to merge those structs, too --->
            <cfif IsStruct(Arguments.Struct1[Local.Key]) AND IsStruct(Arguments.Struct2[Local.Key])>
                <!--- Recursively call StructMerge to merge those structs --->
                <cfset StructMerge(Arguments.Struct1[Local.Key], Arguments.Struct2[Local.Key], Arguments.Overwrite) />
            <!--- We already checked that the key existed, now we just check if we can overwrite it --->
            <cfelseif Arguments.Overwrite>
                <cfset Arguments.Struct1[Local.Key] = Arguments.Struct2[Local.Key] />
            <!--- The unused case here is if Overwrite is false, in which case Struct1 is not changed --->
            </cfif>
        <!--- If it doesn't exist, you're free to merge --->
        <cfelse>
            <cfset Arguments.Struct1[Local.Key] = Arguments.Struct2[Local.Key] />
        </cfif>
    </cfloop>
    
    <cfreturn Arguments.Struct1 />
</cffunction>

This code merges all sub structures as well as the core one. I'd also say it would be an easy adjustment to merge arrays and other data types if necessary. I'm not sure if CF10 will be adding something like this or not, but I know for CF9.0.1 I needed it.

 

This is a nice little design article on spacing and typography

This is a nice little design article on spacing and typography; its often hard to explain to a client or a non-designer why spacing and subtle shading makes such a huge difference, but I think its quite obvious when you look at the starting example and the end result.

 

More Entries

Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me on LinkedIn.