Rails & Server Side Push for Flash
August 29th, 2008
Check it out for yourself, pretty slick stuff, push for a SWF or AJAX. Taken from the Juggernaut website: “The Juggernaut plugin for Ruby on Rails aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client. In other words your app can have a real time connection to the server with the advantage of instant updates. Although the obvious use of this is for chat, the most exciting prospect is collaborative cms and wikis.” I can think of a few more uses as well! Check it out
Slick javascript animation effects: Gruppler's Effect Demos
August 19th, 2008
Via Destruct-o-bot-5000, if you haven’t seen these effects you need to check them out. Very slick stuff, although running them at the same time can be a bit taxing on the Ol’ CPU. Read
Macports: Tools for developers
August 8th, 2008
So, I wrote an article on what Macports is but, what tools are out there for web developers? Well one I have used in the past is Siege to steal the quote from what Siege is I’ll just blatantly plagiarize the author’s website: Siege is an http regression testing and benchmarking utility. It was designed to let web developers measure the performance of their code under duress, to see how it will stand up to load on the internet. Siege supports basic authentication, cookies, HTTP and HTTPS protocols. It allows the user hit a web server with a configurable number of concurrent simulated users. Those users place the webserver “under siege.”
So to install Siege it couldn’t be easier: “sudo port install siege”. Now, you might think that your machine could generate tons of requests and flood a site with traffic but, unless you are on some ridiculous MacPro quad CPU Goliath then you probably can’t generate a ton of simultaneous requests.
Another tool I have used to do command line conversion of mp3 files is SoX (sound exchange) and Lame. Both can be installed using Macports. So get out there and start using the terminal!
Installing Command Line Tools on the Mac Using Macports
August 6th, 2008
Chances are if you have used any other nix OS then you have used a package manager to install software. Some package managers on nix: yum, aptitude, rpm, and there is fink for the mac which mainly targets open source software. Now I have never used fink, just because I first found Macports and although people complain about the speed of Macports I have never found it to be an issue. So yesterday I needed to add wget to my mac so I could easily download some files via the command line. With macports its easy, you just have to run one command: “sudo port install wget”, first you might want to make sure you have the application name right by running “port search wget”. That returns a list of programs that match your phrase and they you can run the install.
The nice thing about Macports is that it installs everything to /opt/local so that if you upgrade your OS or Apple comes out with a patch that might change things in one of your common /bin directories then everything is safe and sound and still unscathed in /opt/local.
Now apparently there is a bug in the installer that took me awhile to get past, it is supposed to be fixed in the next release but, to get around it if you get the error about running the post-flight script then go here Macports Support Issue 4 and run that script, then run “sudo port selfupdate” and you should be up and running fine.
So for the most part, you won’t have to download and compile things manually on your Mac unless of course you want to run the bleeding edge release. Happy package management. Tomorrow, some useful tools on Macports for web developers.
Love or Hate Mac's, one thing they got right - Bonjour.
August 5th, 2008
So I spent about an hour setting up a new printer on my parents two windows boxes last night, It was a fancy schmancy network printer that even had WiFi built into it. So After the drivers were installed (its an HP by the way) I try to just go to the network settings on the computer and point the “add printer network printer” at it. No dice, I fiddle with it for about 10-15 mins and nothing, it won’t see the printer or if it does it asks me for a password to access it (apparently it was trying to access the card readers on the printer, bizarre).
So of course I end up looking through the manual and finally give in and load up the CD that came with the printer and there is a network setup program that you have to run from the CD. That really didn’t make much since to me but, it did work at least.
So enter my mac this morning, fire up the pinter prefrerence pane and of course when I click add printer there is the printer. Why is it so easy? Bonjour. Bonjour is a service discovery protocol that goes way back in the Apple OS. It makes it stupid simple to setup any network device and I wish that every OS on the planet had Bonjour integrated into it. Imagine how much less time we (us computer guru’s who support our family’s PC’s) would spend trying to troubleshoot add a silly printer connection.
You can read more about Bonjour and even add it to your Windows box (something I probably should have done) here: Read via Apple
Kiteboarding Lesson 2
August 4th, 2008
Lesson 2 == tired, sore, and in love. We’ll I can’t say I didn’t see this one coming, I mean what is not to love about combining practically all the things I love and do on the water into one sport. Surfing: check, Wakeboarding: check, Skimboarding: check, Harnessing the power of nature: check. The first thing to note about this lesson was that it was a bit intimidating. You have a 14 meter kite attached to your body and after a few minutes taxiing out to the surf you hang on to your instructor who does “body drags” (no board just let the kite pull you through the water) with you hanging onto their harness. Lots of waves in the face and ongoing instruction while He flies the kite and you try to pay attention in the surf.
Next its my turn, few minutes flying the kite on land (making sure I am comfortable with a kite that is twice the surface area of the previous lesson). You feel it pull, and man does it, the impression it leaves is that this kite will take you wherever it wants to go. That is while on land, in the water its a whole different feeling. So I wade into the water, lie down and begin my own body drags, getting used to steering the kite with one hand while holding your opposite hand in the water to create some resistance. Kite stays up, I learn how to “upwind” or move myself and the kite back toward the beach while hopefully gaining some ground toward the opposite direction that the wind is blowing. This skill is essential for picking up your board when it comes off your foot or not getting a mile down the beach and having to huff it back with all your gear.
So 30-45 mins later after a bunch of body drags and feeling comfortable flying the kite one handed its time to take the board on a body drag. Now this doesn’t sound too difficult but, to my surprise you add one more thing into the mix (trying to keep the board on a plane while flying the kite) and suddenly your brain practically has a conniption fit trying to handle the two tasks at the same time and both become very difficult. I got the hang of this and it was an important lesson. At first I thought “body dragging is easy, this will be too”. I think my instructor knew that and this is where your first test of truly managing all the gear comes into play and first pass (heading downwind was easy) coming back upwind I just couldn’t get my left arm to hold the board right.
So back on land again, took a small break, trying to catch my breath (arms and chest getting a major workout). Instructor took the kite out and showed off (doing airs, ripping it, etc). Comes back in and asks me if I am ready to give it a go with trying to get up and actually riding the board. We go over the launch position how to power up the kite for the launch etc. He asks me if I’m ready, I’m not, but I lie and say why not! So I get out there and strap in, try to power up the kite and didn’t give it enough juice, try two more times and I get the feeling of getting out of the water but, didn’t pay attention to where the kite was and fly the kite “out of the wind window”.
Fourth time: surreal bliss. I’m up, tracking along keeping the kite in the air and heading out to sea, I’m clipping along for about 100 yards and I start thinking about trying to turn the kite and head back to the beach. I go over one small swell and then a larger one, boom, lose my balance and eat it head first into the waves. Board is behind me about 30 feet and I’m trying to get back to it, proving very difficult and I didn’t body drag far enough to upwind back to the board. Instructor makes the swim out and rescues the board while I body drag back to the beach. Tide was ripping in hard and we head back past the sand bar (which is now covered up) and onto the beach for another break. Success, feels good, time to order some gear!
Last night won an auction on eBay for some last year model gear (one kite) need to win a board and a buy a harness, and I am set. Its going to be a fun rest of the summer and fall.
Vmware Fusion 2 Beta 2
August 1st, 2008
Incase you missed it VMWare Fusion 2 Beta 2 is out (out yesterday). Seems like there are some nice tweaks and that resuming / suspending is even faster than beta 1. Also, sound is working again for me. I tested out playing a movie through netflix’s online viewer and the playback was very nice. I’ll give another update after some use.
Life Outside the Box - Kiteboarding
August 1st, 2008
So I just created a new section of my blog: “Life Outside the Box” where I am going to start putting some stuff that really has nothing to do with anything with the other sections of the site. Well duh, you might say. Anyway, so I have taken up a new hobby, well to be more specific its not really a hobby. Hobby’s to me don’t involve moving at a high rate of speed, flying through the air, and massive consequences for a screwup. I am about to take lesson 2 of 3 with a kiteboarding instructor this afternoon. Now to explain what kiteboarding is… well I’ll let youtube speak for myself in this one:
So its also interesting to note that there are all these big name internet guru’s kiting out in silicon valley (founders of google etc), not that just seeing the video alone isn’t enough to get you started. So anyone else out there kiteboarding? I first caught the bug down in south florida watching these kiters blow by windsurfers and launch to great heights. I mean isn’t this a surfers dream? When the waves suck and are all washed out and choppy you can still ride!
Next week I’ll give an update on my first water lesson no board this time but, I should get dragged around in the water for awhile just to improve my proficiency in relaunching the kite and what to do in case the thing won’t relaunch after a crash in the water. Totally looking forward to it!
On the road to 100 consecutive pushups
August 1st, 2008
I stumbled on this yesterday, take the challenge! Seriously, I know I know sitting in front of the computer all day long really exercises your mind and all but, take care of your body! My brother-in-law and myself are putting this plan in effect starting today. So if you don’t have a wii-fit you can join in on the fun. Visit HundredPushups.com for your customized chart.
Via destruct-o-bot 5000 (a co-worker at a client site) – Microsoft is giving away downloadable evaluation versions of windows xp and vista prebuilt with IE 6, 7 & 8 installed on each VM instance. I know what is the big deal, its an eval version, well supposedly when these expire they will make the next round available and so on and so forth. For those of you that use VMWare / VMWareFusion (myself included) it will automagically convert these VM’s to compatible ones. So Go download them already and make sure your site works in all these IE flava’s. So go get em!
Xray the CSS of any Website
July 23rd, 2008
This just came across the wire (my wire that is) hot way to view a site’s css definitions inline: XRAY: look beneath the skin
Using onMissingMethod to create get/set methods
July 16th, 2008
If you create a lot of objects to store data in and are constantly creating get/set methods to handle the setting of those properties then, this will probably save you some time. Its a nice trick not to have to write all that code anymore (or even have to maintain that code if you use some sort of code generator).
Here is our component:
<!---
Author: Steve Ross http://blog.stevensross.com
Disclaimer: Free to use and distribute, please leave in the credit!
--->
<cfcomponent output="false" displayname="Simple on Missing Method Example" hint="Will let you do custom getters and setters w/o writing the code">
<cffunction name="OnMissingMethod" returnType="any" access="public" output="true" hint="Handles getters and setters">
<cfargument name="MissingMethodName" type="string" required="true" hint="The name of the missing method">
<cfargument name="MissingMethodArguments" type="struct" required="true" hint="The arguments passed in to the missing method">
<cfif LCase(arguments.MissingMethodName) CONTAINS "get">
<cfreturn getValue(replace(arguments.MissingMethodName, "get", ""))/>
<cfelseif LCase(arguments.MissingMethodName) CONTAINS "set">
<cfif StructKeyExists(arguments.MissingMethodArguments, "2")>
<cfelse>
<cfset setValue(replace(arguments.MissingMethodName, "set", ""), arguments.MissingMethodArguments)/>
</cfif>
</cfif>
</cffunction>
<cffunction name="setValue" returnType="void" access="private" output="true" hint="internal setter method" >
<cfargument name="name" type="string" required="true" hint="name of property to set">
<cfargument name="value" type="any" required="true" hint="value of property">
<cfset this[arguments.name] = arguments.value.1 />
</cffunction>
<cffunction name="getValue" returnType="any" access="private" output="true" hint="internal getter method" >
<cfargument name="name" type="string" required="true" hint="name of property to set">
<cfif StructKeyExists(this, arguments.name)>
<cfreturn this[arguments.name]>
<cfelse>
<cfreturn ""/>
</cfif>
</cffunction>
</cfcomponent>
I’m not really going to go into how this works, put simply all I am doing is a string replace to get the name and then I’m taking the argument and putting it as the data for that variable. Then when you call the getter I’m just striping out the word ‘get’ and finding your data. Now if you haven’t set the data we return empty string.
So save the above example and call it “Simple.cfc”
Create another CFM file in the same directory and call it “test.cfm”
Now you can see this work by putting this code in test.cfm:
<cfset testObj = CreateObject("Component", "Simple")/>
<cfset testStruct = {foo='bar'}/>
<cfset testObj.setTestStruct(testStruct)/>
<h4>We call the testObj.getTestStruct() Method</h4>
<cfdump var="#testObj.getTestStruct()#">
<h4>Notice the "testStruct" property</h4>
<cfdump var="#testObj#" label="dumping the entire object">
A more practical example:
<cfset User = CreateObject("Component", "Simple")/>
<cfset User.setFirstName('Steven')/>
<cfset User.setLastName('Ross')/>
<cfset tmpInfo = {password='dont do it', id='XXX'}/>
<cfset User.setInfo(tmpInfo)/>
<cfdump var="#User#" label="dumping the entire object">
Hope this helps someone out on what you can do with MissingMethod in ColdFusion 8
Amazing data visualization
July 16th, 2008
Nothing to type… just go see it. Wow. Make sure you click play (be patient, its worth it).
To steal two things from my co-worker Dan Skaggs (the term army proof for one) and the other is Buildix Super simple install of Subversion, Trac, Mingle, and Cruise Control.
Doubt me? On Ubuntu its as easy as “sudo apt-get install Buildix” done. Yep Done. I haven’t tried it yet but, check it out. Trust me it will save you time as I recently setup Trac and SVN the manual way.
Enjoy!
VMware Fusion 2 Beta, First Impressions
June 5th, 2008
My first impressions of the latest version of VMware Fusion 2 are great. Its really the simplicity of things where Fusion 2 shines. Cut and paste no longer requires that I switch keys between CMD and CTRL on the mac. Making working with my VM much more seamless (at least this is my experience with Windows XP Pro). Not sure if that works on all operating systems. The suspend / restore functionality is much much faster now too. That saves a lot of time when you need it. I’m sure if I had plenty of memory to spare this wouldn’t be that big of a deal but, since I am on a Core Duo box and I can only run 2GB then it makes a big difference not having to wait so long to free up some memory. Fusion also supports multiple monitors, built in camera and bluetooth now on my Macbook Pro.
Here are a few issues I have run into, spaces support seems a bit buggy when running in Unity mode. It would also be nice if that when you run things in Unity that the icons that you can cmd-tab to would somehow have a mark that they are your VM and not any of your regular mac apps. Hopefully they will work out these bugs in the beta phase.
I’ve only been using it for about a day and a half so as I run into new features I’ll be sure to post them.
