Hex to UIColor

December 17th, 2009 | Design & Development, Software | No Comments »

Alrighty, just a quick one.
I’ve been looking all over for something that quickly gives me the code for a UIColor when given a HEX colour.
I couldn’t find one so I whipped one up double quick.

http://scratch.johnnypez.com/hex-to-uicolor

Unable to find a $JAVA_HOME at … on Mac OSX

June 30th, 2009 | Design & Development | No Comments »

I recently switched my Java versions from 1.5 to 1.6 and I’ve been hitting some issues with the java path.
I tried setting the environment variable JAVA_HOME=/usr and that worked for some stuff but I still saw this error when running java.
eg:
>java -version
Unable to find a $JAVA_HOME at “/usr”, continuing with system-provided Java

I solved the problem by doing the following.
First I found out where java actually was with:
>ls -l' `which java`
/usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

I noticed a command called java_home in that same directory. Running that command yields the correct java home directory.
>/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

To correctly set the my JAVA_HOME environment variable in future, I added the following to my ~/.profile

export JAVA_HOME=`/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home`

Once you have done this you can restart your terminal window or run >. ~/.profile to reload you profile into the current terminal session.

Simple Tabbed Navigation with CSS

May 9th, 2008 | Design & Development | No Comments »

I had to create some tabbed navigation for a project at work recently. Not anything new really, lots of people implement it in lots of different ways. A colleague recommended a method demonstrated on SimpleBits for creating simplified css tabs however it uses background images to get the tab effect and I don’t like that.

I’d much prefer to use a pure CSS method that doesn’t involve editing an image if I want to make changes. So here I have it, a simple CSS only method of doing tabbed navigation. I’ve tested it in IE6, IE7, FF2, Opera 9 and Safari 3.1, all fine.
Read on »

Broken Build when not using ActiveRecord?

April 3rd, 2008 | Design & Development | 2 Comments »

Just a quickie.

I ran into this problem before, then forgot about it after finding the solution. Then one of my colleagues ran into the same problem today which prompted me to post this.

If you’re rails app doesn’t use ActiveRecord you may find yourself scratching your head wondering why your build fails with ActiveRecord related problems. I obseverd this even though I had turned off ActiveRecord in my environment.rb. CruiseControl.rb still tried to run rake tasks like test:db:purge etc.

The quick and easy solution is to remove database.yml from your config directory. CruiseControl.rb should ignore any database related rake tasks then.

I liked Dashcode

March 28th, 2008 | Design & Development, Software, Technology | No Comments »

I’ve been using Dashcode for the last two weeks or so while creating my Build Status Monitor widget. First impressions are not too bad. As IDE’s go, it does the job. You can write your html, css and javascript, all in one place, there’s a wysiwyg view, that’s all to be expected. To be honest I thought the code view could have done with better syntax highlighting, I found myself yearning for TextMate or Coda at times.

The winning feature for me though was the debugging facility. I found it to be extremely efficient, I’m sure I saved hours as it reliably showed me where the problems were in my code, allowing me to jump in at the offending line. When I’m developing for the web I can’t live without Firebug, when it comes to Dashboard widget development, Dashcode’s debugging abilities were a pleasure to use.

Deploying a widget couldn’t have been simpler. File > Deploy Widget, File > Deploy Widget to Dashboard. I did see one issue where I tried deploying the widget to my Dashboard at work and the widget simply wouldn’t initialise. All I saw was the default widget image. However I deployed the same code at home and the widget worked fine. I’ve installed that same widget in work now and I have no trouble with it now. I can’t figure out what the problem was. Perhaps all I needed was a restart.

Anyway, thats my Dashcode lowdown. I do recommend getting stuck in if you like that sort of thing.

CruiseControl.rb Dashboard Widget

March 27th, 2008 | Design & Development, Technology | 4 Comments »

I hated skipping back and forth to CruiseControl.rb at work to keep an eye on various builds so I’ve put this widget together to make life a little easier. The Builds Status Monitor Dashboard widget takes the build rss feed and displays the current build status. Does what it says on the tin.

Screenshot:

Build Status Monitor Screenshot

Download:
Click here to download the Build Status Monitor. Just unzip and install, minimum requirements MacOS 10.4.x. This is my first Dashboard widget so some of the code is a bit untidy. I’ve tried to keep the look and feel clean. Please let me know if you have any problems or suggestions.

Maintaining Scope in Javascript Callbacks

March 14th, 2008 | Design & Development | No Comments »

As a web developer I can’t avoid using Javascript. Not that I would want to or anything. I love Javascript. I’m happy enough with my JS coding skills but there was one thing that always found a way to leave me scratching my head. Callbacks!

I had no problem with the concept of callbacks, but something was missing. I always had trouble maintaining scope in callback methods. I haven’t had to pay too much attention to the problem until today as jQuery has met the majority of my Javascript needs to date. Anyway after a quick search I found the solution, which is so easy I deserve a kick in the ass. Read on »

Jaxer.Web.post and XMLRPC

March 13th, 2008 | Design & Development | 1 Comment »

I've been playing around a little with Jaxer lately. I really like the ease of Cross Domain javascript calls. Just a quick note though. I've been testing the Jaxer.Web.post call against the wordpress XMLRPC.
I kept getting responses saying that the the server only accepted POST requests. But I was using Jaxer.web.post.
So I scratched my head for a while. And then some.
Eventually I figured that the body of the post request was not being set. Then I discovered that Jaxer.Web.post defaults it's content type header to "application/x-www-form-urlencoded" which, as far as I know, passes the data in a querystring format and not in the post body. The simple fix was to change the content type to "text/xml" like so :

JAVASCRIPT:
  1. Jaxer.Web.post(url,body,{contentType: "text/xml"});

The call worked perfectly after that.

Problem Testing ActiveResource with Mocks in Rails

February 29th, 2008 | Design & Development | 5 Comments »

A note for those who are using ActiveResource.

I ran into a bit of a problem the other day, not with using the HttpMock class itself. Mocks work pretty well in ActiveResouce. The problem came about when I tried to not use HttpMock. I almost tore my hair out but eventually a simple solution came. Thanks to Jason for the shoulder surfing effect. Read on »

A sarcastic slow clap for Adobe CS3 developers please.

February 19th, 2008 | Design & Development, Technology | 3 Comments »

I'd like to thank Adobe CS3 developers for my source of utter frustration last night and this morning.

Last friday I did a clean install OSX 10.5.2 on my iMac. When presented with the choice of two filesystems, HFS+ Journaled, or HFS+ Journaled, Case-Sensitve. I chose the case-sensitive option because I am a web developer, I deal with linux OS's all the time, I'm used to it. It makes sense. How was I supposed to know that 3 days later, when I begin to install Adobe CS3, the installer would drop out immediately with an error.

"the file system of the OS volume is not supported"

I found this on their support area : http://kb.adobe.com/selfservice/viewContent.do?externalId=kb400587&sliceId=2

What? Why? I'll tell you why, because those CS3 developers are the laziest damn developers I've heard of. A problem like this is completely ridiculous. I can't begin to comprehend how Adobe developers could blatently ignore some basic common sense coding practice and cause so much grief.

Adobe doesn't care that they have caused this issue. They know about it alright, it hasn't just surfaced with CS3 it's been around for a while. I've read that CS2 would go through the install on case sensitive systems and then give problems when it couldn't find files as you started apps in the suite. Well at least I might have had an opportunity to fix those issues if CS3 would go through the install. But no, this was their fix. Rather than just address their sloppy coding and fix the filenames referenced. The installer refuses to continue.

The only real solution seems to be reformat, don't use case sensitivity next time.

Nice one Adobe. Stand up and take a bow.