Friday, 28 December 2007

Guitar Hero III - The Fall of Gondor

I have just had a revelation. I will never be good at video games. ANY
video games. This was just made clear and stark to me during my
attempts at playing Guitar Hero III on the Wii. I will just have to
admit defeat and shout it out loud to the world - I SUCK at this.
Whether this is reflective of my lack of musical ability, or just lack
of hand eye coordination in general is beside the point. I wanted to
kick ass, and instead got the can of whup ass poured and spread all
over me like that time in Thailand when we were on that deserted
island, and this girl... oops...

I tried, Ma, I really tried. I haven't even gone past Easy level.
I've played Hit Me With Your Best Shot and Slow Ride umpteen times,
but I still can't get 100% note coverage. I played Cherub Rock, one of
my ultimate ever rock anthems, over and over and over again, and
eventually managed to get around 48,000. Then my 17-yr. old brother
comes along, who's never heard the song before, plays it for the first
time and gets 42,000. It's just not fair.

I absolutely love these songs on Guitar Hero III: Cherub Rock,
Paranoid, Kool Thing, Cult of Personality, Welcome to the Jungle,
Bulls on Parade. These alone are worth the price of admission. But
they don't seem to love me back. Shouldn't you get extra points if
the guitar controller detects your enormous, all-enveloping,
tingling-through-every-fiber-of-your-being worship of these songs?
Shouldn't a score multiplier apply when it sees that you've had them
on repeat in Winamp for like, forever? That you've annoyed countless
friends (okay, all three of them) when you sang along in the car and
you also *sing the guitar solos*? What, they didn't install that
feature?

It's pre-midlife crisis therapy for those of us who can't afford the
Harley or Ferrari. Pretending to be a golden god, struggling with your
own limitations in the harsh face of anonymity. Maybe you've already
missed the fucking bus. Maybe it's too late to be somebody significant
to anyone but your immediate kin. All you can do is pick up the
plastic Les Paul, shake your hips doing the Axl Rose snake dance, and
get the led out using Star Power.

Wednesday, 26 December 2007

This revolution will be text messaged

This revolution will be text messaged
By Marguerite Reardon

Filipinos have been masters of using text messages to rally political
protesters. So what happened during last month's failed coup d'etat?

http://www.news.com/This-revolution-will-be-text-messaged/2100-1039_3-6222963.html

Monday, 17 December 2007

Nintendo shortages for the 2nd year in a row

I just don't get it. Nintendo should have fixed their supply problems
by now. Or is there really a phenomenal spike in demand that have
caught them unaware? Christmas 2007 already and the shops *still*
don't have enough stock of the Nintendo Wii? Surely they wouldn't be
manufacturing these shortages to fuck with us salivating consumers!

http://www.nytimes.com/2007/12/14/technology/14wii.html

Thursday, 13 December 2007

Today is the first day of the rest of your Gmail life - taking the zero inbox plunge

Finally bit the bullet and decided to start with a clean slate.
Selected the 3000+ messages wallowing in my Gmail inbox for the last 2
years and archived all of them.

Obviously, it's not as radical as it should be, since they're really
*still there* - just not in your face. So if I ever need to remember
that so-and-so sent me a link to their photo album on such a date, I
can possibly look it up. Possibly. All this hinges on the assumption
that I can search for old items if I ever really need to. If the
search terms in my head don't match anything in the message, then it's
effectively disappeared, but taking up precious inbox space.

I held off for such a long time. Kept saying "I'll go through the
unread ones, and read them and tag them." Nah, it was just all too
much. For me, trying to delete old emails is at times like trying to
decide which photos of my baby I should delete. Silly, I know, since
their value is way down on the sliding scale compared to pics of my
first child. I don't know. Maybe it's just my pack rat mentality gone
digital.

Here's to clean inboxes!

Maybe I should start learning those Gmail keyboard shortcuts, while
I'm at it. But would these work cross-browser? Firefox *and* Opera
*and* Safari *and* Camino. (yes, camino is using firefox engine, but
UI is native OSX, so maybe they handle things differently)

<drift />
<meander />


Oh boy, we have an official fun day at work tomorrow. Bowling in the
morning then lunch then watching the premier of Darjeeling Limited.
The title just prepares me to be bored. Darjeeling - tea, hmmm...
Could this be another "English Patient" experience? Good grief. Then
early mark and work party in the city from 7 to 11pm. Moulin Rouge
theme. Hope the hotties in marketing and sales all dress up like the
Green Fairy. Or some such sexy variant. The invite suggested at least
wearing black and/or red. Woohoo. My White Stripes tee will be
purfect. Too bad I don't have any black pants though. Maybe I should
wear green and orange, just to be contrarian.

Oh well, time to go.

Sunday, 25 November 2007

Preferential Voting - how does it work?

I finally get it. It only took 16 years, but I've finally spent the
necessary 10 minutes to understand it. A bit sad really.

http://www.abc.net.au/elections/federal/2004/guide/howpreferenceswork.htm

And also found a Ruby implementation of Preferential voting, along
with other systems.

http://rubyvote.rubyforge.org/

Music i want to check out

The Pipettes
Gotye
Feist
Operator Please
Kaki King
Lior
Grinderman
Cat Power
Angus and Julia Stone

the latest Bjork album

Tuesday, 30 October 2007

FasterCSV problem - NoMethodError when trying to call join()

I've been getting this error message:

C:\work\reportscraper\db_uploader>ruby db_uploader.rb --file "Ethos Corporation.xls" > ethos.log

db_uploader.rb:147: undefined method `join' for #<FasterCSV::Row:0x2ea3ab0> (NoMethodError) from c:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.1/lib/faster_csv.rb:65

9:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.1/lib/faster_csv.rb:65

9:in `each'

from db_uploader.rb:145

It's failing on this line:

data.each { |row|

>>> insert_sql = "INSERT INTO [DATA_UPLOADS] VALUES ( #{row.join(',')});"

puts insert_sql
#db.execute(insert_sql)
}


But I don't understand why this fails but the same method call in
another script is working:

def extract_data_from(filename)

data = FasterCSV.readlines(filename, {:col_sep=>"\t"})

end


cmdoptions = get_commandline_options

data = extract_data_from cmdoptions.single_file

puts
data.size


data.each { |row|
puts row.join(',')
}


==============

Just discovered why. Because in the code with the error, I was passing the :headers option.

data = FasterCSV.readlines(filename, {:col_sep=>"\t", :headers=> true})

In the code that was working, I was only specifying the column separator.

data = FasterCSV.readlines(filename, {:col_sep=>"\t"})

Adding this line

puts row.class

confirms this. The first loop was returning a Row while the second was returning an Array.

Just looked at the documentation and it's actually described in the RDoc:

http://fastercsv.rubyforge.org/fr_method_index.html

"This setting causes FasterCSV.shift() to return rows as FasterCSV::Row objects instead of Arrays and FasterCSV.read() to return FasterCSV::Table objects instead of an Array of Arrays."

Monday, 29 October 2007

Beatles reunion coming soon? W00t!



Noticed this ad while reading my mail today. Made me go "hmm...." a little bit, but hey, if they're selling tickets for it, then it must be true!

NOTE TO SELF: update html and make the image look biiiiger.

Wednesday, 3 October 2007

YouTube viewing session



Interesting what I ended up watching and how I got there. (Most recent is at the top, so go through the list from the bottom.)

It all started with me trying to educate my wife about Rage Against The Machine, and how the Sydney Entertainment Centre would have to be one of the worst places to see them, since no one in their right mind really wants to be seated when watching these guys. "WHAT? You don't know who they are? ZOMG! Watch this then... And feel the funk, y'all!"

I love Daft Punk. I really do. Okay, maybe just the first 2 albums. They became popular around the time these new-fangled things called "electronica" and "big beat" were making the rounds. That faded, and then we all started listening to Post-Rock, then New Rock, then that "angular post-punk proto-new wave sound". God knows what they call it this year. At least hip-hop doesn't suffer from the proliferation of labels like this. There may be strains of hip-hop, but no one ever goes and denies that it is hip-hop. But yeah, you say, all these labels just come from music critics, press releases and assorted musical wankers who blog. Fair enough. You never hear the actual artists themselves putting labels on their music. They just tend to say "rock and roll". Okay... so I've just shot down my assertion about rock music in the second sentence of this paragraph.

Anyway, back to Daft Punk. I just realised last night what an utter fool I was for not getting those tickets to their upcoming appearance here in Sydney. Bugger. Bollocks. Fikifikifiki. Woof woof to the doof doof. Aaaaaargh. I was looking up their live performances on YouTube and they're pretty awesome. Not life changing, but enough to make you dance so hard that you'd fall down. I remember actually dancing to Around The World in front of the stereo over and over again. Of course, only after checking that there was no one home!

I, for one, welcome our new (old) robot overlords.

Wednesday, 19 September 2007

Buildr: Using ruby to build java.. hmmm...

http://blog.labnotes.org/2007/05/03/buildr-or-when-ruby-is-faster-than-java/

http://buildr.rubyforge.org/

I've just started getting comfortable with using Maven, and
appreciating all the goodies that cam be used from it, then this comes
along... I wonder how much traction they'll get though, considering
the number of people already using Maven. I guess Ant didn't
disappear when Maven came along, so Maven probably won't disappear
with the appearance of Buildr.

Tuesday, 18 September 2007

Pardon the splatter, I just had my mind blown again...



DJ Sara (8 yrs old) and DJ Ryusei (5 yrs old) tearing it up on the turntable. I wonder if there's a DMC Junior competition somewhere.

Friday, 14 September 2007

Converting a DOS text file into Unix format

I was working on a config file in Ubuntu that had those nasty ^M
carriage returns at the end, and dos2unix doesn't seem to be around
anymore. So came across this info in Wikipedia:

http://en.wikipedia.org/wiki/Newline


The same tasks can be performed with sed, or in Perl if the platform
has a Perl interpreter:

sed -e 's/$/\r/' inputfile > outputfile # UNIX to
DOS (adding CRs)

sed -e 's/\r$//' inputfile > outputfile # DOS to
UNIX (removing CRs)

perl -p -e 's/(\r\n|\n|\r)/\r\n/g' inputfile > outputfile # Convert to DOS

perl -p -e 's/(\r\n|\n|\r)/\n/g' inputfile > outputfile # Convert to UNIX

perl -p -e 's/(\r\n|\n|\r)/\r/g' inputfile > outputfile # Convert to old Mac


It's probably the first time I've used sed!

Fixed: Maven 2 plugin problems with Bamboo/ Hudson + Tomcat setup on Windows

I've been tasked with setting up a continuous integration system at
work, and I've been evaluating - or trying to at least run - these
packages:

- Continuum
- Hudson
- Bamboo


I've yet to try these out:

- Luntbuild
- Cruisecontrol

From the looks of things, I proably should have tried out other two
before the other ones, given the lack of success I've had so far. :(

After a few emails exchanged with Atlassian Support re: Bamboo, I've
fixed a problem I was having with Bamboo and Hudson on my PC. I was
running them under Tomcat, which was installed as a Windows service.
My Ant builds were working fine, but my Maven2 builds were failing,
and would constantly complain that the 'maven-clean-plugin' was
missing, with errors like this:

Bamboo:

12-Sep-2007 16:48:01 [INFO]
----------------------------------------------------------------------------
12-Sep-2007 16:48:01 [INFO] Building AppFuse Core Application
12-Sep-2007 16:48:01 [INFO] task-segment: [clean, test]
12-Sep-2007 16:48:01 [INFO]
----------------------------------------------------------------------------
12-Sep-2007 16:48:01 [INFO] artifact
org.apache.maven.plugins:maven-clean-plugin: checking for updates from
appfuse
12-Sep-2007 16:48:02 [WARNING] repository metadata for: 'artifact
org.apache.maven.plugins:maven-clean-plugin' could not be retrieved
from repository: appfuse due to an error: Error transferring file
12-Sep-2007 16:48:02 [INFO] Repository 'appfuse' will be blacklisted
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
12-Sep-2007 16:48:03 [ERROR] BUILD ERROR
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
12-Sep-2007 16:48:03 [INFO] The plugin
'org.apache.maven.plugins:maven-clean-plugin' does not exist or no
valid version could be found
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
12-Sep-2007 16:48:03 [INFO] For more information, run Maven with the -e switch
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
12-Sep-2007 16:48:03 [INFO] Total time: 1 second
12-Sep-2007 16:48:03 [INFO] Finished at: Wed Sep 12 16:48:03 EST 2007
12-Sep-2007 16:48:03 [INFO] Final Memory: 1M/?4M
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------

HUDSON:

[struts2-starter] $ C:\javatools\maven-2.0.6\bin\mvn.bat package
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Struts 2 Starter
[INFO] task-segment: [package]
[INFO] ----------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin:
checking for updates from central
[WARNING] repository metadata for: 'artifact
org.apache.maven.plugins:maven-resources-plugin' could not be
retrieved from repository: central due to an error: Error transferring
file
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-resources-plugin'
does not exist or no valid version could be found


I had already come across an issue raised for Hudson concerning this,
but didn't completely figure out what it meant:

https://hudson.dev.java.net/issues/show_bug.cgi?id=470

"The current workaround is to have hudson run under a new user with
its own .m2 directory and have whichever profiles are necessary
activated by default. That way, the profiles are picked up as part of
the alignWithUserInstallation mechanism in the embedder."

Atlassian support was able to replicate the error I was getting by
running the Bamboo standalone running under the SYSTEM directory, and
asked me to check if Tomcat was running as SYSTEM, which it was, as I
that is the default when you install Tomcat as a Windows service.
Ah, of course! <lightbulb moment>

When these packages do their continous integration, Bamboo and Hudson
are calling outside the web application to an external batch file. So
when Maven gets run by Bamboo or Hudson, Maven will run as *that*
user, which in this case is the SYSTEM user. I guess SYSTEM user will
try to get its settings from C:\Documents and Settings\Default User\
and not my own user account with the correct maven settings.

So the solution was to go into Services, look for "Apache Tomcat" then
in the "Log On As" column, get it to run as a user with the correct
Maven settings.

Now I don't know if I would have gotten this problem if I was running
under Linux. I think I would still have, because if Tomcat was running
under the user "tomcat", but my maven settings were under a
"autobuild" directory, it would be the same scenario, and the fix
would be to run Tomcat - or whatever app server you're using - under
the "autobuild" account.

Friday, 7 September 2007

Unable to mount .dmg files in OS X - "Device not configured" error. How to fix it.

I had downloaded some DMG files to install some software and kept
getting these error messages:

Unable to attach "Foo.dmg" - Device not configured.

It was happening for more than one .dmg file, and I'm sure the
download was not corrupted.

At first, I tried using the Disk Utility, thinking it was related to
disk permissions, but the option wasn't present when I selected the
DMG. Clicking on "Verify disk" didn't help either, and resulted in the
same error "Device not configured".

Tried the instructions below and they worked.

1. Go into terminal

2. type

su [username that has admin rights]

you will be asked for your admin password.

3. Then run these commands. (I don't know what they do but they worked)

sudo kextunload -c com.apple.AppleDiskImageController

sudo kextload -b com.apple.AppleDiskImageController

4. Now try to mount those .dmg files.

Addendum: It's still not fixed. Now I'm just getting a new error message - "no mountable file systems". Oh great.

Do I believe in Free Markets? Why Sure I do!

http://www.theonion.com/content/news/u_s_to_give_every_iraqi_3_544_91

Tuesday, 4 September 2007

Set up Tomcat to redirect HTTP requests to HTTPS

We had JIRA installed and using the built-in Tomcat app server,
accepting both HTTP and HTTPS requests. We wanted to restrict it so
that all JIRA access was only via SSL. The config changes were pretty
simple.
1. Change Tomcat's server.xml.
Edit the non-SSL <Connector> entry listening on port 80 and add or
edit the redirectPort atribute to point to the port on which the SSL
<Connector> is listening. By default, the redirectPort was pointing
to port 443.
Was:
<Connector port="80"
enableLookups="false" redirectPort="8443"
maxThreads="100" minSpareThreads="100" maxSpareThreads="100"/>

Changed to:
<Connector port="80"
enableLookups="false" redirectPort="443"
maxThreads="100" minSpareThreads="100" maxSpareThreads="100"/>
Because the SSL entry was:


2. In the Tomcat web.xml file the following <security-constraint> has
to be added within the <web-app> element. This new element must be
added after the <servlet-mapping> element:

<!-- SSL settings. only allow HTTPS access to JIRA -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

Friday, 31 August 2007

Why does Artifactory detect your Maven settings.xml

I've been given the job of setting up a build environment at work, and
one of the things I'm setting up is a local Maven repository, and to
have an easy way of maintaining it. I'm testing out Artifactory
(http://www.jfrog.org/sites/artifactory/latest/), and I've come across
what seems to be a bug. In the Config instructions, it only mentions
artifactory.config.xml. There is no mention of any config files
outside the Artifactory install directory.

It seems that if you install Artifactory on a machine that already has
Maven installed on it, it will use the settings.xml for that Maven
installation. This however means that if there are any errors in that
local settings.xml - ie, invalid XML, etc - then Artifactory will not
run.

A few of the things I tried that didn't work:

- delete [ARTIFACTORY_HOME]/data directory
- renamed old Artifactory directory and reinstalled from zip file
- cleaned out C:/Temp

In the console output I noticed this error:

Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: in comment
after two dashes (--) next character must be > not - (position: START_TAG seen .
..</nonProxyHosts>\r\n---... @15:4)
at org.codehaus.plexus.util.xml.pull.MXParser.parseComment(MXParser.java
:2334)
at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl(MXParser.java:117
4)
at org.codehaus.plexus.util.xml.pull.MXParser.next(MXParser.java:1090)
at org.apache.maven.settings.io.xpp3.SettingsXpp3Reader.parseSettings(Se
ttingsXpp3Reader.java:1325)
at org.apache.maven.settings.io.xpp3.SettingsXpp3Reader.read(SettingsXpp
3Reader.java:1637)
at org.apache.maven.settings.io.xpp3.SettingsXpp3Reader.read(SettingsXpp
3Reader.java:1648)

Which would indicate something wrong with an XML config file. I had
settings.xml open and I remembered I'd had this problem before with
XML files.

I removed the dashes in the XML comment, restarted Artifactory, and
w000t, it was working again.

Wednesday, 29 August 2007

Is it too much to expect examples to work as described?

Tried creating and running a sample app in AppFuse:

http://appfuse.org/display/APF/AppFuse+QuickStart


Yes, set up MySQL 5 on my PC, have Maven and the JDK installed.

Then created two examples:

mvn archetype:create -DarchetypeGroupId=org.appfuse
-DarchetypeArtifactId=appfuse-modular-struts
-DremoteRepositories=http://static.appfuse.org/repository
-DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app
-DartifactId=simplecrud


mvn archetype:create -DarchetypeGroupId=org.appfuse
-DarchetypeArtifactId=appfuse-modular-tapestry
-DremoteRepositories=http://static.appfuse.org/repository
-DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app
-DartifactId=tapestry-mod-crud

Then tried to run "mvn integration-test" on each of them.

Both are failing at this point:

[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[delete] Deleting: C:\work\tapestry-mod-crud\web\target\webtest-data\web-test
s-result.xml
[echo] Testing 'tapestry-mod-crud-webapp-1.0-SNAPSHOT' with locale 'en'

Login:
log4j:WARN No appenders could be found for logger (com.canoo.webtest.ant.TestSte
pSequence).
log4j:WARN Please initialize the log4j system properly.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: The following error occurred while executing this line:
C:\work\tapestry-mod-crud\web\src\test\resources\web-tests.xml:27: Canoo Webtest
: R_1454.
Test failed.
Test step steps (C:\work\tapestry-mod-crud\web\src\test\resources\web-tests.xml:
29: ) null failed with message "Step[invoke "get Login Page" (1/6)]: HTTP error
502, at: invoke"
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39 seconds
[INFO] Finished at: Wed Aug 29 18:33:37 EST 2007
[INFO] Final Memory: 22M/44M
[INFO] ------------------------------------------------------------------------


AAARGH.

My co-worker seems to have a sample app set up and running correctly,
but most likely he's not going through the integration tests, or
didn't create the modular projects.