(Trying to) Kick the Caffeine Habit

Posted by seon on Sunday, July 27

I think at one point in time I was routinely drinking close to 1000mgs of caffeine. I remember drinking multiple grande lattes a day (2 shots in a grande vs 3 shots in a venti).

Starbucks Venti Twenty ounces = 415 milligrams caffeine

Based on some of the information in these articles, I believe a majority of my sleep problems are related to my caffeine intake. I am going to try cutting out caffeine intake from Starbucks drinks for a month.

Polyphasic Sleep

I ran across a blog chronicling one person’s 5+ month experiment with polyphasic sleep. I had originally been Googling for information about sleep disorders since I’ve been unable to get a good night’s rest for a longtime (years?) now.

Polyphasic sleep involves taking multiple short sleep periods throughout the day instead of getting all your sleep in one long chunk. A popular form of polyphasic sleep, the Uberman sleep schedule, suggests that you sleep 20-30 minutes six times per day, with equally spaced naps every 4 hours around the clock. This means you’re only sleeping 2-3 hours per day.

One of the upsides is the extra awake time you gain for activities. The major downside is that you will be on a fixed sleep schedule that likely conflicts with the rest of your friends and family. It’s a very interesting set of blog entries to read, and provides a lot of food for thought. I think I’ll stick to improving my monophasic sleep for now.

Liquid Templating 'latest_articles' Collection with limit N

Posted by seon on Friday, July 11

Recently I modified my home template to render only the latest X articles.

I changed this:
1
{% include 'article' with articles %}
... into this:
1
2
{{ site | latest_articles: 5 | assign_to: 'recent_articles' }}
{% include 'article' with recent_articles %}

I am not really satisfied with this markup. Is there a more concise solution that does not involve local variable assignment?

Mule 2.0 + Gigaspaces 6.5 = Pure S*x

Posted by seon on Thursday, July 10

This is probably old news, but I still get excited thinking about all the interesting solutions that are possible now using Mule and Gigaspaces for SOA problems requiring low latency and highly scalable architectures.

Gigaspaces released 6.5 with API integration with Mule 2.0 … this is just plain awesome. You can use Gigaspaces as the transport (e.g. in place of JMS) and quickly get a SBA up and running utilizing the same concepts I used at RHG when we were servicing B2B problems. You also get the advantage of the clustering ability and fault tolerance that comes with Gigaspaces – which is just pure sex – not to mention all the other great features that come with this advanced Javaspaces implementation (i.e. management tools, monitoring tools, data partitioning, performance features like batching).

Gigaspaces would have made a fantastic backend transport and shared data grid in place of ActiveMQ JMS, but at the time it wasn’t as fully integrated with Mule. We would have been able to solve alot of the high availability and clustering concerns regarding single points of failure with the messaging database and JMS brokers. I never felt comfortable with ActiveMQ’s clustering and fail-over features. Configuration seemed a bit fussy and it doesn’t seem to be as easy to scale out as a Gigaspace cluster.

Google's Data Interchange Format Released

Posted by seon on Wednesday, July 09

Google’s awesome, they release some nifty software to the open source community. Here is the link to Google’s Protocol Buffer and more details are available on Google’s Open Source Blog

From what I can tell, it’s a solid format that can replace XML in most scenarios. It’s not as easily human-readable as XML, but then again from experience not many humans are actively reading the XML anyways. The proto format reminds me of a json structure, minus the curly brackets. Also, from skimming the proto java documentation there isn’t support for primitive arrays (at least for java). You should be using List containers instead along with the proto “repeated” scalar.

They include code for data binding source .proto files to C++, Java and Python. This makes it easier to adopt in your next project. I think this is a good data format for internal use, but you’ll probably still have to deal with XML/SOAP and other RPC formats (JSON, etc) on your external interfaces. This would require transforming the internal data format (.proto) into the external format. There is also stub generating code for producing server interfaces that you can drop into your native rpc server implementations. This is pretty cool also.

Hmmm, I see some useful Mule and Camel transformers that could be made to take advantage of this new format. And possibly service adaptors for Mule and Camel too.

Camel + Oracle AQ + AQjmsException JMS-147

Posted by seon on Thursday, June 19

I’ve encountered a typo in the JMS package from Oracle while I was debugging a problem with multicast routing under Camel and Oracle AQ. It seems that Oracle may have slipped up and misnamed the “JMSXRcvTimeStamp” property as “JMSXRecvTimeStamp”. I don’t have access to the source code for the ORacle’s implementation of javax.jms.Message (AQjmsMessage), however I poked through the class file with a hexeditor and found instances of the typo.

According to the Java JMS 1.1 specification, this is a property that is set by the jms provider when a message is dequeued. The spelling of the property is listed as “JMSXRcvTimeStamp” on page 39 of the spec pdf. Oracle Streams Advanced Queuing User’s Guide and Reference 10g Release 2 document referencfes the correctly spelled property in section 11.2.2 however elsewhere in the same document it is incorrectly spelled. I’m pretty sure this is a bug in Oracle’s implementation of the Message interface. The document for Release 11g shows the same errors.

Additionally, I get the feeling that either Camel, Oracle or Spring is incorrectly setting null values for several standard JMS headers and properties when they are not assigned or not present. If null values are allowable under the JMS spec, then Oracle’s AQjmsMessage.setJMSReplyTo(Destination) should accept null parameters without exceptions also. Right now passing a null Destination value to method setJMSReplyTo(Destination) results in this exception:


oracle.jms.AQjmsException: JMS-147: Invalid ReplyTo destination type, or use of reserved `JMSReplyTo agent name, or serialization error with AQjmsDestination org.springframework.jms.UncategorizedJms

Here is the post I created in the Camel users forum relating to this issue.

Here is the JIRA issue I created for camel-jms: https://issues.apache.org/activemq/browse/CAMEL-618

Woot! I beat out 1845 people!

Posted by seon on Thursday, June 12

I survived the first round and got a ticket to a weekly 1M final. The final tournament starts this coming Saturday. I can choose from 3 different time/schedules (morning, afternoon, evening) and fight for a free entry into the WSOP!

PokerStars Tournament #91110049, No Limit Hold'em
Freeroll Super Satellite
1895 players
Target Tournament #84389994
50 tickets to the target tournament

Tournament started - 2008/06/12 - 00:05:00 (ET)

Dear [snip],

You finished the tournament in 1st place.

This qualifies you for a seat in Tournament #84389994.
A ticket to this tournament was issued in your name. You can use this ticket
to register.
See Tournament #84389994 Lobby for further details.

Pokerstars is running these freerolls daily – once an hour every day until June 27th. You can read about it here http://www.pokerstars.net/poker/promotions/giveaway/

Fun fun!

Update
Knocked out towards the middle of the tournament. My stack was about 7BB and the table was loose as hell. Pushed with pocket 9s and unfortunately met a slow roller who limped with pocket As. Gotta try again next week! :)

Guitar Hero Gods

Posted by seon on Tuesday, April 08

I can’t beat this guy at Guitar Hero and neither can you. Trust me, Dark Wing is just that good – pure perfection. Watch his hands fly across the buttons… but wait, what is that GREEN button?! Cheater? You decide!

Blackjack and Poker Room Tips for Vegas 2008 1 balloon

Posted by seon on Monday, March 31
On my last trip to Vegas, I noticed that most casinos had the H17 rule for 6+ deck Blackjack games. It seems like a very minor rule but it does give a slight edge to the house. I found a website that gives you the lowdown on what the H17 rule means to you and how you should play your cards to maximize your odds.
Modifications to Basic Playing Strategy for Soft 17 Rule

Single Deck

Hit soft 18 against ace

If double after pair splitting is allowed, split a pair of 9’s against an ace

If surrender is allowed, surrender hard 15 against an ace and hard 17 against an ace.

Double Deck

Double down on soft 14 against 4

Double down on soft 18 against 2

Double down on soft 19 against 6

If surrender is allowed, surrender hard 15 against dealer ace.

4, 6 or 8 Decks

Double down on 11 against an ace

Double down on soft 17 against 2

If surrender is allowed, surrender hard 15 against ace, hard 17 against ace, and a pair of 8’s against dealer ace.

Check out The Soft 17 Rule in Blackjack for the inside scoop and tips for your next (read: September 2008!) trip to Vegas.

For the poker fans among us, I like to read the AllVegasPoker blog and review site for the inside news on the poker rooms in Las Vegas.

CDex Configuration for Encoding with Nero AAC Codec 3 balloon

Posted by seon on Tuesday, March 18

Until recently I’ve been ripping my CD collection to MP3 files. But I recently discovered that Nero opened their reference quality implementation MPEG-4 (or AAC) audio codec to the public (last year!). This is great because the AAC format actually compresses quite nicely and sounds great too. In my opinion Nero’s AAC audio codec produces music files that rival or exceed most (all?) open-source AAC codecs.

I couldn’t find any guides for configuring CDex to rip and tag into the AAC format so I’ve copied down the steps I used. Hope this helps others looking to get started with AACs and the CDex audio ripper.

    CDex + AAC + MusicBrainz = .w4a Goodness
  1. Extract Nero AAC to New Folder
    Download the AAC codec and extract all the files. Copy all the files inside \win32 into the new folder C:\nero_aac.
  2. Create New Batch File
    Download encode.bat movie it to C:\nero_aac\encode.bat. CDex will invoke encode.bat which in turn will execute the AAC encoder and the AAC tagger.

    Here are the two commands inside encode.bat:

    1
    2
    
    c:\nero_aac\neroAacEnc_SSE.exe -q 0.8 -if %1 -of %2
    c:\nero_aac\neroAacTag.exe %2 -meta:artist=%3 -meta:album=%4 -meta:track=%5 -meta:totaltracks=%6 -meta:title=%7 -meta:genre=%8 -meta:year=%9

    The first line executes an SSE optimized(?) encoder. This should be safe for most of us, but you can substitute it with neroAacEnc.exe. The parameter -q sets the VBR quality. I’ve set it to 0.8 but it can be a floating number from 0.0 up to 1.0 (max. bit rate and larger file size) I could not tell the difference between 0.5 and 1.0 during some informal testing. The second line performs the metadata tagging.

    To get a list of the various metadata tags that are available, execute the tagger with the option -list-standard-meta.

    1
    2
    3
    4
    5
    6
    
    c:\nero_aac\neroAacTag.exe -list-standard-meta
    
    List of standard Nero Digital metadata field names:
        title  artist  year  album  genre  track  totaltracks  disc  totaldiscs  url  copyright  comment  lyrics  credits  rating  label  composer  isrc  mood  tempo
    
    End of metadata field name list.
  3. Start CDex and press F4 for options.
    CDex Encoder Options
      Click on the Encoder tab and set the following options.
    • Encoder -> External Encoder
    • Encoder Path -> C:\nero_aac\encode.bat
    • Parameter string -> %1 %2 "%a" "%b" "%tn" "%tt" "%t" "%g" "%y"
    • File Extension -> m4a
    • On-the-fly Encoding -> unchecked
    • Send WAV header to stdin -> unchecked
    CDex Generic Options
      Click on the Generic tab and disable ID3 tagging.
    • ID3 Tag Version -> None

  4. Rip your MP3s as usual and you should find fresh hot m4a files waiting in your target folder. Winamp can play these without a problem. Coincidentally, I use the m4a extension versus the mp4 extension in order to allow iTunes and iPods to read the same files with minimal hassle.
  5. CDex Configuration Profiles
    (optional) Save these new settings to a profile named aac. I also keep separate profiles for mp3s and flacs.
  6. (optional) Post process each set of m4a’s using MusicBrainz PicardTagger to scrub the metadata. I prefer to lookup CD information using MusicBrainz, and fall back to using freedb2.org as a backup. PicardTagger makes it a cinch to remove and cleanup weird capitalizations and characters in the song filename and attributes.

    MusicBrainz creates and assigns a unique PUID to every song. A PUID is a digital fingerprint created through analyzing the audio properties of the song itself; every song has it’s own unique fingerprint. PUIDs can be used to identify a song correctly, even if the filename and ID3 information is missing or incorrect.

Cheers!

Kids Don't Lie and Girls Don't Fart

Posted by seon on Saturday, March 15

Kids lie early, often, and for all sorts of reasons—to avoid punishment, to bond with friends, to gain a sense of control. But now there’s a singular theory for one way this habit develops: They are just copying their parents.

News flash! Kid’s are lying to their parents! This is a great article that goes into depth about possibly how children learn to lie. Yea nothing new when the article tells me all kids lie to their parents – even the honor students. However the ability to tell a convincing lie is an advanced skill and an early tell-tale sign of intelligence in your 2 year old. Forget about classical music in the womb, you should just pipe tapes of Nixon to the little future Harvard graduate in the womb. That’ll teach him a thing or two.

Cows and Their Exploits

Posted by seon on Saturday, March 15

The Cult of the Dead Cow (cDc) recently released Goolag which in simplest terms is a mass exploit scanner. Their Goolag specifications page has more information and makes for a pretty entertaining read. Though they are humorous, this tool is pretty serious stuff for identifying exploits on a remote host. I could easily find a use for this in my workplace; this could be one of many tools used to audit a website before it is placed into production. It’s better to scan and catch the security holes on your own, before an unknown attacker does it for you.

On a completely unrelated note, I had run across a means of using Google to locate and display live images from video cameras all around the world. This was several months ago and I had said to myself and friends that this would make for a great screensaver – a mosaic of live images from random web cameras from around the world. Well, looks like someone went and implemented it. Check out surveillancesaver which has versions for both Windows and OSX.

Lucky You

Posted by seon on Monday, February 18

I played at Binion’s poker room on a recent trip to Vegas. The downtown casino was the location for some scenes in the recent movie Lucky You starring Eric Bana and Drew Barrymore.

The Vegas trip was really fantastic. Several hundred extra value meals were lost and a great many more were won. The best day by far was winning BIG at the craps table. CK would say having her picture taken with Wilmer Valderrama was the highlight of that day (flurry!). A close second for me was being dealt a spade royal flush in the Luxor poker room and easily winning the 150 dollar hourly high hand jackpot. Woo! Overall the best gambling fun was had inside the Mandalay Bay casino. The blackjack was great there, and so was the poker room. I didn’t get to visit the Peppermint Patty ;) – maybe we’ll try that again next time.

Bellagio and Venetian had nice poker rooms. I played in the Bellagio’s “poker sweat shop”; the heat from all the bodies and the constant background noise of chip shuffling was the first thing I noticed. The Bellagio also served some really pretty Strawberry Julius. Mandalay Bay was my favorite room though. Nice and clean and well run. At the aged Binion’s poker room I got in on some of the tightest and well played rounds of poker. Binion’s also gets the distinction of the only casino with a dealer that would openly discuss (guess) my live hand. Luxor has an easy going jackpot in their poker room with hourly payouts to the highest hand. Unfortunately, I would have gotten close to a grand if I hit my monster hand at some other room, like Mandalay. All in all, I would go back to Mandalay Bay over and over again.

This was the best Vegas trip yet. I have other fun stories to tell too (ask me about grumpy Phil Ivey). We had lots of fun with our friends J & H and I personally can’t wait to go back again soon.

MPAA Resorts to Rootkits for Revenue

Posted by seon on Thursday, December 06

Turns out the MPAA is trying to install backdoors on students’ computers that monitor and relay information back to the MPAA. Fortunately, people have taken notice and some have even issued a DMCA takedown notice against them. There is alot of irony in this situation and it really highlights the MPAA’s greed and willful ignorance of copyright laws which do not benefit their organization directly.

RESTful Services Presentation @JavaZone Norway

Posted by seon on Tuesday, September 18

Dan Diephouse (formerly of XFire, now with MuleSource) gave a presentation recently at JavaZone Norway and the PDF and MP3 are now available here.

I haven’t listened to the MP3 but the PDF had some good tidbits and gave some insight into Dan’s approach regarding RESTful services in an SOA environment. He doesn’t go into enough detail for my tastes (I like to see as much nitty gritty detail as possible) but it’s more than just a rehash of management-techno-speak so I appreciated it. There are some sections which are pretty basic (like explanation of SSL). There is also some good information about transactions and why we should approach them differently knowing some technical constraints in the HTTP protocol and stateless web communications. He briefly touches upon security issues also. All in all I wish he went into more detail, but it’s all good; another contribution to the RESTful services discussion and it’s pros/cons.

Update
Dan’s website mentioned in the PDF doesn’t seem to work (http://www.netzooidicom.com/blog).

Prank Wars Recap

Posted by seon on Monday, September 17

The boys at CollegeHumor have been escalating their pranks for the better part of this year (since February) and the latest prank (number 6) happened just last week. If you haven’t been keeping up you can watch them in order here starting from the first to the last.

I wonder how other people feel about these pranks. The first two were pretty innocent and drew some good laughs from me. The later ones were funny but also drew some groans of sympathy pain; Streeter and Amir are escalating the war very rapidly. Amir’s latest prank has set a precedent by introducing a second “victim.”; Sharon (Streeter’s GF) has is an innocent casualty of war. Where is the epilogue to this latest skirmish!? This might be better than reality TV.