Friday, May 08, 2009

How to use Twitter's STAR to auto-retweet

If you've ever thought there should be an easier way to re-tweet a message in twitter well now there is. No longer do you have to copy+paste and prefix "RT: @" to the mesage and then have to worry about cropping it down to under 140 characters.

Thanks to the power of Yahoo Pipes and FriendFeed you can automatically retweet any message you mark with a star (favorite). It's fairly easy.

1. Get a friend feed account if you don't have one. Fortunately it's super easy now-a-days because you can use your twitter login to create a FriendFeed account. So go, get an account.

2. Once you have a FF account make sure you add your twitter service. This is easier than it might seem (and it may have done it automatically if you signed up with twitter. If not just add your twitter account by going to Settings, Add Service, click the twitter icon, enter your twitter username, and bam all done. Honestly, at some point you'll probably want to use friendfeed more than twitter so feel free to add other accounts you want to bring in as well if you're feeling up to it.

3. Now go to this yahoo pipe and put your username in the form then hit the button "Run Pipe" - after that is done right click the "Get as RSS" link and copy that link address.

4. Go back to friend feed and add a "Custom RSS/ATOM feed" service to your account using the RSS address you copied from Yahoo Pipes.

5. Now go to http://friendfeed.com/settings/posting - You might have to authenticate your account so you can post to twitter from here.. Do that. Then click the option "Post my friend feed entries to twitter by default" then pick the option "the services I've selected below" and then pick the one that looks like this: "Custom RSS/Atom (http://pi...)" then hit save settings.

5. Go to twitterfeed.com and setup a feed based on the RSS url you got from pipes. I setup my twitterfeed to poll every 30 minutes and to post up to 5 items per.. I don't retweet that often so it's probably overkill; but you can do whatever suites you.

That's it. Now, whenever you star an item it will be pulled into yahoo pipes, modified a touch to have the RT: @ and then sent to FF which will make sure it is the right length, add a small url to it so people can chat about it at FF, and then send it to twitter as a tweet by you.

Wednesday, May 06, 2009

CruiseControl and 500 Server Errors

Today, for the first time in a few months, I had to interact with my cruise control server again. To be honest, I'm not sure what happened but it stopped working and I had to jump through some hoops to get it all working again.

First I had to uninstall it and install it in a directory that didn't have any spaces in the name. Before it was installed at c:\program files\cruisecontrol - that space was causing a weird JSP error that prevented compilation.

Thus I installed it at c:\cruisecontrol. Of course, I hadn't touched it in so long I had forgotten about my special ant tasks and I had to go find those again (uninstall actually deleted my entire old directory.

However, during the reinstall there was a problem because the old service wasn't removed (maybe because I had it running as me?) So I had to remove the service


sc delete <SERVICE name>


Then I reinstalled again and it worked out OK. Once that was resolved I had to get my projects all checked back out of SVN. I had forgotten that CC comes with a connectfour project by default and so, after I replaced the config.xml with my customized one, I couldn't load the CC dashboard anymore - I had to delete the connectfour project directory and restart the CC service.

Eventually I got it all up and running again and my projects built OK. Now I just have to train 2 other teams on setting up their ColdFusion projects to run tests from an ANT script so that they can take full advantage of CC and MxUnit. I'll be doing that tomorrow.

Then I have to figure out how to get CC to build a .net app; if I can't hopefully I can install CC.net on the same server as CC without any issues. I had hoped to use cc.rb but there are some issues with it on a windows server so that is out of the picture at the moment (due to our needs for building .net apps).

Wednesday, April 29, 2009

Western Digital Passport: Access Denied on Second Computer

My friend Mike recently bought a nice black Western Digital Passport. It's a slick little portable harddrive the problem was it wasn't very portable. Sure he could carry it around, but if he plugged it into a computer other than his it was inaccessible; if you tried to open or explore it gave an "Access Denied" error.

WTF?

Well, it ended up being a fairly simple fix. He updated the permissions on the drive to include the "Everyone" group. For some reason when he first formatted it (NTFS) the only groups that had permission to the drive were his account, "SYSTEM", and "CREATOR OWNER" - but by adding "Everyone" it now works on other windows machines.

So if you're having a problem getting your Passport to work on multiple computers, put it back on the original machine and make sure "Everyone" has "Full Control" access to the drive.

Open "My Computer", right click and pick "Properties" in the context menu. Then select the "Security" tab. Once that is up, click the "Add" button, enter "Everyone" in the field provided, hit "Apply" then "OK".. and voila' you'll be good to go.

Friday, April 24, 2009

When does "0E1234" EQ "00E050" EQ "0"?

You might be thinking never but, as it turns out, you'd be wrong. In CF7 at least this equivalence and many other odd ones can (and will) occur. It is, undoubtedly, kind of crazy and it definitely doesn't make a ton of sense but I'll give you some sample code so you can test it out for yourself. Please try it on CF8 as well and let me know what happens.


<cfparam name="url.idval" default="0" type="numeric" />


<cfset q1 = QueryNew("id,name") />

<cfset QueryAddRow(q1) />
<cfset QuerySetCell(q1,"id","0") />
<cfset QuerySetCell(q1,"name","") />



<cfset QueryAddRow(q1) />
<cfset QuerySetCell(q1,"id","0E1234") />
<cfset QuerySetCell(q1,"name","0E1234") />

<cfset QueryAddRow(q1) />
<cfset QuerySetCell(q1,"id","020302") />
<cfset QuerySetCell(q1,"name","Some Other Row") />


<cfset QueryAddRow(q1) />
<cfset QuerySetCell(q1,"id","00E050") />
<cfset QuerySetCell(q1,"name","00E050") />


<form name="" method="post" action="oe.cfm">
<select name="idval">
<cfoutput query="q1">
<option value="#q1.id#" <cfif q1.id EQ url.idval>SELECTED</cfif>>#q1.name#</option>
</cfoutput>
</select>
<input type="submit" name="btnGo" value="go" />
</form>


If you stick that in a cfml file called oe.cfm and load it you'll notice that all three options with the id "0", "0E1234", and "00E050" are marked as selected. You might be thinking, WTF?

Well, my theory is CF in its' typless glory is treating all of these strings as numbers and, because 0E (or 00E) is scientific notation it is basically treating them all as equivalent to zero (0).

How do you get around this? My simple solution:

<option value="#q1.id#" <cfif "_#q1.id#_" EQ "_#url.idval#_">SELECTED</cfif>>#q1.name#</option>


I wrapped them both in underscores for the purpose of measuring equivalence which forces CF to treat them as strings and voila the expected behavior now occurs.