<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xml" href="http://localhost:4000/feed.xslt.xml"?><feed xmlns="http://www.w3.org/2005/Atom"><generator uri="http://jekyllrb.com" version="3.3.1">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2018-07-24T18:48:50-04:00</updated><id>http://localhost:4000//</id><title type="html">Chris’ Musings</title><subtitle>Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
</subtitle><entry><title type="html">Musings - Tiny Usability Improvements</title><link href="http://localhost:4000/2013/03/09/musings-tiny-usability-improvements.html" rel="alternate" type="text/html" title="Musings - Tiny Usability Improvements" /><published>2013-03-09T00:00:00-05:00</published><updated>2013-03-09T00:00:00-05:00</updated><id>http://localhost:4000/2013/03/09/musings-tiny-usability-improvements</id><content type="html" xml:base="http://localhost:4000/2013/03/09/musings-tiny-usability-improvements.html">&lt;p&gt;I've been wrapped up in a datacenter move for the past two weeks - migrating old UNIX and ESX hosts from one old company to a fresh, vibrant new company. &amp;nbsp;At home, I'm also busy setting up a new VPN-enabled network and reconfiguring the various routers and switches I have scattered throughout the house. &amp;nbsp;In the process I've had to configure numerous networks. &amp;nbsp;My Mac is a great tool, and the IP interface is many fewer mouse clicks away than on Windows (not to bash Windows, but to single out usability issues). &amp;nbsp;On Windows 7 (Start -&amp;gt; Network Connections -&amp;gt; Right Click -&amp;gt; Properties -&amp;gt; Select Adapter -&amp;gt; Right Click -&amp;gt; Properties -&amp;gt; TCP/IP) - Mac ( Apple Icon -&amp;gt; Settings -&amp;gt; Network -&amp;gt; Adapter ). &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So yes, the Mac is a smidge faster to get to and change. &amp;nbsp;But you know what would be better? &amp;nbsp;If it let me specify IP profiles with preconfigured info so I can save myself the trouble of re-entering &amp;nbsp;data for this switch so I can test that Cisco ASA, but now I have to switch to that switch and test that other Cisco ASA. &amp;nbsp;Or at home, switch to Inside Network (static or DHCP), or the Outside Network (Static IP). &amp;nbsp;Because let's face it, in only one of those cases was DHCP actually available to me (Home router - inside network). &amp;nbsp;And while link-local DHCP is useful after a fashion (169.254.0.0/16), it turns out it's not very useful in actual practice. &amp;nbsp;But considering that I have had to switch between 4 or 5 different network configurations many dozens of times over the past two weeks debugging networking issues, a small change in usability would mean a huge change in savings for me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And this circles back to my previous thoughts of having &amp;quot;competency levels&amp;quot; in our OSes that alter the features available to people, depending on their competency level (duh). &amp;nbsp;If you're a total newb, you get an iPad-like interface (pretty hard to screw up). &amp;nbsp;If you're a moderately experienced individual, you get an interface such as the default today. &amp;nbsp;If you want to kick on the secret &amp;quot;super-user mode&amp;quot; you have to A) find it, B) pass a test (like compute binary numbers or subnet masks - same difference, right - LOL), and you get a richer feature set that's less likely to get in your way, or help you be faster at tasks. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I know that the time invested is possibly not worth it for the fringe of folks who truly are &amp;quot;super-users&amp;quot; and can benefit from features such as this, but there are plenty of us out there - how much time could Apple or Microsoft save by making things just a smidge easy and more powerful for us?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><summary type="html">I've been wrapped up in a datacenter move for the past two weeks - migrating old UNIX and ESX hosts from one old company to a fresh, vibrant new company. &amp;nbsp;At home, I'm also busy setting up a new VPN-enabled network and reconfiguring the various routers and switches I have scattered throughout the house. &amp;nbsp;In the process I've had to configure numerous networks. &amp;nbsp;My Mac is a great tool, and the IP interface is many fewer mouse clicks away than on Windows (not to bash Windows, but to single out usability issues). &amp;nbsp;On Windows 7 (Start -&amp;gt; Network Connections -&amp;gt; Right Click -&amp;gt; Properties -&amp;gt; Select Adapter -&amp;gt; Right Click -&amp;gt; Properties -&amp;gt; TCP/IP) - Mac ( Apple Icon -&amp;gt; Settings -&amp;gt; Network -&amp;gt; Adapter ). &amp;nbsp;
&amp;nbsp;
So yes, the Mac is a smidge faster to get to and change. &amp;nbsp;But you know what would be better? &amp;nbsp;If it let me specify IP profiles with preconfigured info so I can save myself the trouble of re-entering &amp;nbsp;data for this switch so I can test that Cisco ASA, but now I have to switch to that switch and test that other Cisco ASA. &amp;nbsp;Or at home, switch to Inside Network (static or DHCP), or the Outside Network (Static IP). &amp;nbsp;Because let's face it, in only one of those cases was DHCP actually available to me (Home router - inside network). &amp;nbsp;And while link-local DHCP is useful after a fashion (169.254.0.0/16), it turns out it's not very useful in actual practice. &amp;nbsp;But considering that I have had to switch between 4 or 5 different network configurations many dozens of times over the past two weeks debugging networking issues, a small change in usability would mean a huge change in savings for me.&amp;nbsp;
&amp;nbsp;
And this circles back to my previous thoughts of having &amp;quot;competency levels&amp;quot; in our OSes that alter the features available to people, depending on their competency level (duh). &amp;nbsp;If you're a total newb, you get an iPad-like interface (pretty hard to screw up). &amp;nbsp;If you're a moderately experienced individual, you get an interface such as the default today. &amp;nbsp;If you want to kick on the secret &amp;quot;super-user mode&amp;quot; you have to A) find it, B) pass a test (like compute binary numbers or subnet masks - same difference, right - LOL), and you get a richer feature set that's less likely to get in your way, or help you be faster at tasks. &amp;nbsp;
&amp;nbsp;
I know that the time invested is possibly not worth it for the fringe of folks who truly are &amp;quot;super-users&amp;quot; and can benefit from features such as this, but there are plenty of us out there - how much time could Apple or Microsoft save by making things just a smidge easy and more powerful for us?&amp;nbsp;
&amp;nbsp;</summary></entry><entry><title type="html">Beginning UNIX - n+1 Steps to Becoming a Programmer/Admin</title><link href="http://localhost:4000/2013/03/09/beginning-unix-n1-steps-to-becoming-a-programmer-admin.html" rel="alternate" type="text/html" title="Beginning UNIX - n+1 Steps to Becoming a Programmer/Admin" /><published>2013-03-09T00:00:00-05:00</published><updated>2013-03-09T00:00:00-05:00</updated><id>http://localhost:4000/2013/03/09/beginning-unix-n1-steps-to-becoming-a-programmer-admin</id><content type="html" xml:base="http://localhost:4000/2013/03/09/beginning-unix-n1-steps-to-becoming-a-programmer-admin.html">&lt;p&gt;When I began my career, the only hope and help I had was primarily from folks all over the country via dialup BBSes, FiDO Net, and a few strategically located senseis. &amp;nbsp;As I joined the working world, my experience was broadened by having access to think I did not as a high-school student in 1994 - AIX on giant IBM mainframes, WindowsNT, SGIs, etc. &amp;nbsp;Oh, and &amp;quot;Unix Power Tools&amp;quot; and about a 100 more top-notch mentors. &amp;nbsp;But I've longed to write my own roadmap to help folks learn the things I have - to give them the modern tools and tricks that I've spent nearly 20 years honing (sometimes badly and inefficiently). &amp;nbsp;It's also a tool I wish to use to broaden and enrich my own deep understanding of the field I work in. &amp;nbsp;My experience is so broad, that at times I feel as if I am missing significant depth in understanding - someone once said if you cannot explain something to a 6 year old, you truly do not understand that something. &amp;nbsp;My hope with this project is that I will be able to address that shortcoming.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><summary type="html">When I began my career, the only hope and help I had was primarily from folks all over the country via dialup BBSes, FiDO Net, and a few strategically located senseis. &amp;nbsp;As I joined the working world, my experience was broadened by having access to think I did not as a high-school student in 1994 - AIX on giant IBM mainframes, WindowsNT, SGIs, etc. &amp;nbsp;Oh, and &amp;quot;Unix Power Tools&amp;quot; and about a 100 more top-notch mentors. &amp;nbsp;But I've longed to write my own roadmap to help folks learn the things I have - to give them the modern tools and tricks that I've spent nearly 20 years honing (sometimes badly and inefficiently). &amp;nbsp;It's also a tool I wish to use to broaden and enrich my own deep understanding of the field I work in. &amp;nbsp;My experience is so broad, that at times I feel as if I am missing significant depth in understanding - someone once said if you cannot explain something to a 6 year old, you truly do not understand that something. &amp;nbsp;My hope with this project is that I will be able to address that shortcoming.&amp;nbsp;
&amp;nbsp;</summary></entry><entry><title type="html">Datacenter Migration Checklist</title><link href="http://localhost:4000/2013/02/22/datacenter-migration-checklist.html" rel="alternate" type="text/html" title="Datacenter Migration Checklist" /><published>2013-02-22T00:00:00-05:00</published><updated>2013-02-22T00:00:00-05:00</updated><id>http://localhost:4000/2013/02/22/datacenter-migration-checklist</id><content type="html" xml:base="http://localhost:4000/2013/02/22/datacenter-migration-checklist.html">&lt;p&gt;I'm in the midst of yet another great datacenter move, and this one feels like it's been cobbled together from the scraps of chaos with a boatload of confusion and poor planning thrown in. &amp;nbsp;In the midst of all this chaos, so far no one has been injured, but I've been slowed down by not having the proper tools. &amp;nbsp;Since it's been a while since my last DC move, maybe I can be forgiven for some of the following oversights, but below are my observations about how to prepare for these events for those unlucky enough to be doing this for the first time, or are just really rusty!&amp;nbsp;&lt;/p&gt;
&lt;!--break--&gt;
&lt;h2&gt;Tools&lt;/h2&gt;
&lt;ul&gt;
    &lt;li&gt;Screwdrivers (Philips, Flat, Torx, Hex - various sizes, two good assortments and drivers)&amp;nbsp;&lt;/li&gt;
    &lt;li&gt;Ka-bar folding knife &amp;lt;- Do NOT underestimate how much you will be using this&lt;/li&gt;
    &lt;li&gt;Socket set (Metric/SAE - 1/8-1/2&amp;quot;, 3-18mm)&lt;/li&gt;
    &lt;li&gt;Zip-ties - 4-5&amp;quot;, lots and lots.&amp;nbsp;&lt;/li&gt;
    &lt;li&gt;Side-cutters&amp;nbsp;&lt;/li&gt;
    &lt;li&gt;wifi hotspot/dumb switch (Linksys router) + cables.&lt;/li&gt;
    &lt;li&gt;extention core + household power switch&amp;nbsp;&lt;/li&gt;
    &lt;li&gt;DB9 F/F serial console cable&lt;/li&gt;
    &lt;li&gt;Cisco console cable&lt;/li&gt;
    &lt;li&gt;Vice-grips.&lt;/li&gt;
    &lt;li&gt;Flashlight + fresh batteries&lt;/li&gt;
    &lt;li&gt;A few magnets for holding paper to cages.&lt;/li&gt;
    &lt;li&gt;pens/pencils&lt;/li&gt;
    &lt;li&gt;first aid kit&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Strange bits&lt;/h2&gt;
&lt;ul&gt;
    &lt;li&gt;C14 to NEMA 5-15R adapters ( or your local household equivalent - most PDUs s don't have standard 120/250 wiring any more)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Serial Console&lt;/h2&gt;
&lt;p class=&quot;rteindent1&quot;&gt;Cisco: &amp;nbsp;&amp;nbsp;&lt;br /&gt;
HP: &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;
Sparc:&amp;nbsp;&amp;nbsp;&lt;br /&gt;
AIX:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;WIP.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;HP LAN fixes:&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;IP Interfaces: &amp;nbsp;lanscan&amp;nbsp;&lt;/p&gt;
&lt;p&gt;/etc/rc.config.d/netconf&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;/etc/rc.config.d/namesvrs&lt;/p&gt;
&lt;p&gt;NIS_CLIENT=0/1 (off/on)&lt;/p&gt;</content><summary type="html">I'm in the midst of yet another great datacenter move, and this one feels like it's been cobbled together from the scraps of chaos with a boatload of confusion and poor planning thrown in. &amp;nbsp;In the midst of all this chaos, so far no one has been injured, but I've been slowed down by not having the proper tools. &amp;nbsp;Since it's been a while since my last DC move, maybe I can be forgiven for some of the following oversights, but below are my observations about how to prepare for these events for those unlucky enough to be doing this for the first time, or are just really rusty!&amp;nbsp;

Tools

    Screwdrivers (Philips, Flat, Torx, Hex - various sizes, two good assortments and drivers)&amp;nbsp;
    Ka-bar folding knife &amp;lt;- Do NOT underestimate how much you will be using this
    Socket set (Metric/SAE - 1/8-1/2&amp;quot;, 3-18mm)
    Zip-ties - 4-5&amp;quot;, lots and lots.&amp;nbsp;
    Side-cutters&amp;nbsp;
    wifi hotspot/dumb switch (Linksys router) + cables.
    extention core + household power switch&amp;nbsp;
    DB9 F/F serial console cable
    Cisco console cable
    Vice-grips.
    Flashlight + fresh batteries
    A few magnets for holding paper to cages.
    pens/pencils
    first aid kit

Strange bits

    C14 to NEMA 5-15R adapters ( or your local household equivalent - most PDUs s don't have standard 120/250 wiring any more)

Serial Console
Cisco: &amp;nbsp;&amp;nbsp;
HP: &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
Sparc:&amp;nbsp;&amp;nbsp;
AIX:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
WIP.&amp;nbsp;
&amp;nbsp;
HP LAN fixes:&amp;nbsp;&amp;nbsp;
IP Interfaces: &amp;nbsp;lanscan&amp;nbsp;
/etc/rc.config.d/netconf
&amp;nbsp;
/etc/rc.config.d/namesvrs
NIS_CLIENT=0/1 (off/on)</summary></entry><entry><title type="html">Source Control Facepalm!</title><link href="http://localhost:4000/2012/08/15/source-control-facepalm.html" rel="alternate" type="text/html" title="Source Control Facepalm! " /><published>2012-08-15T00:00:00-04:00</published><updated>2012-08-15T00:00:00-04:00</updated><id>http://localhost:4000/2012/08/15/source-control-facepalm</id><content type="html" xml:base="http://localhost:4000/2012/08/15/source-control-facepalm.html">&lt;p&gt;So there I&amp;nbsp;was, leaving work on a Friday for a week-long respite from the rat race (haha!) and I was faced with cleaning up and saving work I had just slaved over. &amp;nbsp;I finally had my app doing what I wanted, and I was working on making it look pretty, and I was also faced with rushing out to meet up with someone for a few pints. &amp;nbsp;Well, the one thing&amp;nbsp;I DIDN'T&amp;nbsp;do was a git push - even though I&amp;nbsp;looked at it for a while before I&amp;nbsp;left and thought about it. &amp;nbsp; Well, for some reason the git plugin in Eclipse didn't remember my remotes, and so I would have to enter all the remote data by hand. &amp;nbsp;I&amp;nbsp;gave it a pass, hit Hibernate, and ran off for fun in the sun.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Go figure, when I&amp;nbsp;returned to work this past Monday, my hard drive was dead. &amp;nbsp;I had all of my email saved on either the Exchange server or the network home drive, some of my data on Dropbox (safe) - but my project was toast - no backup of the machine itself. &amp;nbsp;For a simple little operation, I&amp;nbsp;could have saved myself a weeks worth of rework. &amp;nbsp;Working git-remotes and a simple git-push - all that would have saved me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I'm not a newbie to data loss prevention - in a previous job I mastered it as the network backup admin. We never lost data under my reign as master of NetBackup (Shudder). &amp;nbsp;But yet as a user I still fall prey to assuming that my technology is 100% reliable. While this isn't a travesty, this was only a hobby project mind you, it's a good reminder that one can never be too vigilant about their data, and that with a tool like git, where backup is almost TOO easy, it behooves one to make sure one uses those features as often as possible.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Lesson learned.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><summary type="html">So there I&amp;nbsp;was, leaving work on a Friday for a week-long respite from the rat race (haha!) and I was faced with cleaning up and saving work I had just slaved over. &amp;nbsp;I finally had my app doing what I wanted, and I was working on making it look pretty, and I was also faced with rushing out to meet up with someone for a few pints. &amp;nbsp;Well, the one thing&amp;nbsp;I DIDN'T&amp;nbsp;do was a git push - even though I&amp;nbsp;looked at it for a while before I&amp;nbsp;left and thought about it. &amp;nbsp; Well, for some reason the git plugin in Eclipse didn't remember my remotes, and so I would have to enter all the remote data by hand. &amp;nbsp;I&amp;nbsp;gave it a pass, hit Hibernate, and ran off for fun in the sun.&amp;nbsp;
&amp;nbsp;
Go figure, when I&amp;nbsp;returned to work this past Monday, my hard drive was dead. &amp;nbsp;I had all of my email saved on either the Exchange server or the network home drive, some of my data on Dropbox (safe) - but my project was toast - no backup of the machine itself. &amp;nbsp;For a simple little operation, I&amp;nbsp;could have saved myself a weeks worth of rework. &amp;nbsp;Working git-remotes and a simple git-push - all that would have saved me.&amp;nbsp;
&amp;nbsp;
I'm not a newbie to data loss prevention - in a previous job I mastered it as the network backup admin. We never lost data under my reign as master of NetBackup (Shudder). &amp;nbsp;But yet as a user I still fall prey to assuming that my technology is 100% reliable. While this isn't a travesty, this was only a hobby project mind you, it's a good reminder that one can never be too vigilant about their data, and that with a tool like git, where backup is almost TOO easy, it behooves one to make sure one uses those features as often as possible.&amp;nbsp;

&amp;nbsp;
Lesson learned.&amp;nbsp;
&amp;nbsp;</summary></entry><entry><title type="html">*More* Unit Testing Cassandra with Maven</title><link href="http://localhost:4000/2012/07/17/more-unit-testing-cassandra-with-maven.html" rel="alternate" type="text/html" title="*More* Unit Testing Cassandra with Maven " /><published>2012-07-17T00:00:00-04:00</published><updated>2012-07-17T00:00:00-04:00</updated><id>http://localhost:4000/2012/07/17/more-unit-testing-cassandra-with-maven</id><content type="html" xml:base="http://localhost:4000/2012/07/17/more-unit-testing-cassandra-with-maven.html">&lt;p&gt;Nearly two years ago (wow) I&amp;nbsp;wrote about unit testing with Maven/Cassandra in &lt;a href=&quot;http://www.darthcoder.com/drupal/?q=node/41&quot;&gt;Unit testing Cassandra with Maven&lt;/a&gt;.&amp;nbsp; Well, the project I was working on got a little sidetracked, but I&amp;nbsp;came back to it with a vengeance this month to try and bring it to completion.&amp;nbsp; I moved development hosts, and ran into a few small issues with how I&amp;nbsp;set up the build environment (great for getting ready for a continuous integration setup).&amp;nbsp; At the same time, I&amp;nbsp;thought I'd bring myself up to date from Cassandra 0.7 to 1.1.2.&amp;nbsp; That's where all the trouble began!&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;First things first - version control. &amp;nbsp;I'm an avid git user - github is my second home for all my code. &amp;nbsp;Suffice it to say that I neglected to branch my trunk for this. &amp;nbsp;Not only was I hoping the upgrade would be painless, I was looking to implement some features this past weekend as well, not just upgrade my Cassandra versions. &amp;nbsp;Well, that went south really quick, and I wasn't allowed to work on other things until I fixed this upgrade issue. &amp;nbsp;All because I failed to issue:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;quot;git checkout -b cassie-1.1-upgrade&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I could make all my destructive changes in that branch, and continue working on other features/bugs in my project in other branches. &amp;nbsp;But because I broke my branch - not only wouldn't my unit tests pass, but mostly it wouldn't compile at all - I couldn't work productively on anything else. &amp;nbsp;So note folks - for major destructive work like this, ALWAYS branch. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next phase of this project was updating the dependencies.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;org.apache.cassandra:cassandra-all:1.1.2&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;org.apache.cassandra:cassandra-thrift:1.1.2&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;org.apache.thrift:libthrift:0.8.0&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;me.prettyprint:hector-core:1.0-5&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That took care of the Cassandra dependencies for my project. &amp;nbsp;But an interesting thing happened - EmbeddedServerHelper no longer obeyed the KeySpace definitions in cassandra.yaml - in order to load my schema I had to come up with another option. &amp;nbsp;Thanks to the maven-failsafe-plugin, and the cassandra-maven-plugin, I can fork each of my unit tests and get a newly scrubbed/loaded/initialized schema to run my testcases against. &amp;nbsp;This clearing is important, by running this way, so far I've yet to lose any data in my two-tier test-cases (Integration tests, not so much at the moment). &amp;nbsp;So having an easy to use, easily document schema that could be loaded upon first server startup - that was huge - and now it was missing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[ more to come ]&lt;/p&gt;</content><summary type="html">Nearly two years ago (wow) I&amp;nbsp;wrote about unit testing with Maven/Cassandra in Unit testing Cassandra with Maven.&amp;nbsp; Well, the project I was working on got a little sidetracked, but I&amp;nbsp;came back to it with a vengeance this month to try and bring it to completion.&amp;nbsp; I moved development hosts, and ran into a few small issues with how I&amp;nbsp;set up the build environment (great for getting ready for a continuous integration setup).&amp;nbsp; At the same time, I&amp;nbsp;thought I'd bring myself up to date from Cassandra 0.7 to 1.1.2.&amp;nbsp; That's where all the trouble began!&amp;nbsp;&amp;nbsp;

First things first - version control. &amp;nbsp;I'm an avid git user - github is my second home for all my code. &amp;nbsp;Suffice it to say that I neglected to branch my trunk for this. &amp;nbsp;Not only was I hoping the upgrade would be painless, I was looking to implement some features this past weekend as well, not just upgrade my Cassandra versions. &amp;nbsp;Well, that went south really quick, and I wasn't allowed to work on other things until I fixed this upgrade issue. &amp;nbsp;All because I failed to issue:&amp;nbsp;
&amp;nbsp;
&amp;nbsp; &amp;quot;git checkout -b cassie-1.1-upgrade&amp;quot;&amp;nbsp;
&amp;nbsp;
I could make all my destructive changes in that branch, and continue working on other features/bugs in my project in other branches. &amp;nbsp;But because I broke my branch - not only wouldn't my unit tests pass, but mostly it wouldn't compile at all - I couldn't work productively on anything else. &amp;nbsp;So note folks - for major destructive work like this, ALWAYS branch. &amp;nbsp;
&amp;nbsp;
The next phase of this project was updating the dependencies.
&amp;nbsp; &amp;nbsp;org.apache.cassandra:cassandra-all:1.1.2
&amp;nbsp; &amp;nbsp;org.apache.cassandra:cassandra-thrift:1.1.2
&amp;nbsp; &amp;nbsp;org.apache.thrift:libthrift:0.8.0
&amp;nbsp; &amp;nbsp;me.prettyprint:hector-core:1.0-5
&amp;nbsp;
That took care of the Cassandra dependencies for my project. &amp;nbsp;But an interesting thing happened - EmbeddedServerHelper no longer obeyed the KeySpace definitions in cassandra.yaml - in order to load my schema I had to come up with another option. &amp;nbsp;Thanks to the maven-failsafe-plugin, and the cassandra-maven-plugin, I can fork each of my unit tests and get a newly scrubbed/loaded/initialized schema to run my testcases against. &amp;nbsp;This clearing is important, by running this way, so far I've yet to lose any data in my two-tier test-cases (Integration tests, not so much at the moment). &amp;nbsp;So having an easy to use, easily document schema that could be loaded upon first server startup - that was huge - and now it was missing.&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
[ more to come ]</summary></entry><entry><title type="html">The Wonders of Github</title><link href="http://localhost:4000/2012/04/02/the-wonders-of-github.html" rel="alternate" type="text/html" title="The Wonders of Github " /><published>2012-04-02T00:00:00-04:00</published><updated>2012-04-02T00:00:00-04:00</updated><id>http://localhost:4000/2012/04/02/the-wonders-of-github</id><content type="html" xml:base="http://localhost:4000/2012/04/02/the-wonders-of-github.html">&lt;p&gt;I'm currently working on a java project with a number of friends - my first real group project with Java. &amp;nbsp;Part of the problem with what we're doing is that a number of the open-source libraries we're using do not have local maven repositories. &amp;nbsp;I'm a firm believer in what maven brings to the table in terms of dependency management - so I've created a number of my own. &amp;nbsp;I could put them on my own website, but I'm looking to migrate away from managing my own forge, which is currrently based on indefero. &amp;nbsp;Github is one of the two major elephants in the room (the other being gitorious), so I've put them there. &amp;nbsp;I think a lot of people trust github (a lot more than darthcoder.com) - so I think I've made a good choice. &amp;nbsp;Ideally, these files would make it into maven central somehow, but until then I can offer my repos.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/ckaminski/swt-maven-repo&quot;&gt;Eclipse SWT&lt;/a&gt;&amp;nbsp;-&amp;nbsp;https://github.com/ckaminski/swt-maven-repo &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/ckaminski/jgrapht-maven-repo&quot;&gt;JGraphT&lt;/a&gt;&amp;nbsp;-&amp;nbsp;https://github.com/ckaminski/jgrapht-maven-repo&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><summary type="html">I'm currently working on a java project with a number of friends - my first real group project with Java. &amp;nbsp;Part of the problem with what we're doing is that a number of the open-source libraries we're using do not have local maven repositories. &amp;nbsp;I'm a firm believer in what maven brings to the table in terms of dependency management - so I've created a number of my own. &amp;nbsp;I could put them on my own website, but I'm looking to migrate away from managing my own forge, which is currrently based on indefero. &amp;nbsp;Github is one of the two major elephants in the room (the other being gitorious), so I've put them there. &amp;nbsp;I think a lot of people trust github (a lot more than darthcoder.com) - so I think I've made a good choice. &amp;nbsp;Ideally, these files would make it into maven central somehow, but until then I can offer my repos.&amp;nbsp;
&amp;nbsp;
Eclipse SWT&amp;nbsp;-&amp;nbsp;https://github.com/ckaminski/swt-maven-repo &amp;nbsp;
JGraphT&amp;nbsp;-&amp;nbsp;https://github.com/ckaminski/jgrapht-maven-repo
&amp;nbsp;</summary></entry><entry><title type="html">Today’s computer pet peeves…</title><link href="http://localhost:4000/2012/02/17/todays-computer-pet-peeves.html" rel="alternate" type="text/html" title="Today's computer pet peeves... " /><published>2012-02-17T00:00:00-05:00</published><updated>2012-02-17T00:00:00-05:00</updated><id>http://localhost:4000/2012/02/17/todays-computer-pet-peeves</id><content type="html" xml:base="http://localhost:4000/2012/02/17/todays-computer-pet-peeves.html">&lt;p&gt;I know I've probably complained about this at some point in time, but I'm continually amazed at how poorly Outlook does email.&amp;nbsp; I can't save embedded attachments (images, for example) unless I first cut and paste them into an external program.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, I HATE splash screens.&amp;nbsp; Especially ones that stack themselves on top of the z-order and won't go away.&amp;nbsp; Eclipse does this right - it starts and will let you float it to the background, but even that isn't optimal.&amp;nbsp; What if I have an active desktop, with widgets, or I&amp;nbsp;need documents and folders behind the unmovable splash screen?&amp;nbsp;&amp;nbsp;This new program I'm trying today, Spicebird, is the exact type of bad offender I&amp;nbsp;hate.&amp;nbsp; It puts itself on top of all other active windows, and wont' let you move it around.&amp;nbsp; Splash screens need to be relegated to the dustbin of history, just like Windows 95, that abortion of an OS that spawned them.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><summary type="html">I know I've probably complained about this at some point in time, but I'm continually amazed at how poorly Outlook does email.&amp;nbsp; I can't save embedded attachments (images, for example) unless I first cut and paste them into an external program.
&amp;nbsp;
Also, I HATE splash screens.&amp;nbsp; Especially ones that stack themselves on top of the z-order and won't go away.&amp;nbsp; Eclipse does this right - it starts and will let you float it to the background, but even that isn't optimal.&amp;nbsp; What if I have an active desktop, with widgets, or I&amp;nbsp;need documents and folders behind the unmovable splash screen?&amp;nbsp;&amp;nbsp;This new program I'm trying today, Spicebird, is the exact type of bad offender I&amp;nbsp;hate.&amp;nbsp; It puts itself on top of all other active windows, and wont' let you move it around.&amp;nbsp; Splash screens need to be relegated to the dustbin of history, just like Windows 95, that abortion of an OS that spawned them.
&amp;nbsp;
&amp;nbsp;</summary></entry><entry><title type="html">Rebooting the Cloud??</title><link href="http://localhost:4000/2011/07/18/rebooting-the-cloud.html" rel="alternate" type="text/html" title="Rebooting the Cloud??" /><published>2011-07-18T00:00:00-04:00</published><updated>2011-07-18T00:00:00-04:00</updated><id>http://localhost:4000/2011/07/18/rebooting-the-cloud</id><content type="html" xml:base="http://localhost:4000/2011/07/18/rebooting-the-cloud.html">&lt;p&gt;&amp;nbsp;I'm chewing through my email here at work, and I see a notice that our Cloud platform (built on ESX/Surgient) is going down for upgrades this weekend, a nearly 24 hour outage of the platform. &amp;nbsp;It got me to thinking - when does Amazon Web Services or Google App Engine ever shut down their cloud?&amp;nbsp;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;People who know me well know that I really hate technology. &amp;nbsp;Not that I'm a luddite, but that most technology is actually crap - poorly engineered, prone to failure, difficult to fix. &amp;nbsp;I'm in the midst of building a webapp with a Lua plugin for Adobe Lightroom, and I will have to deal with the fact that a user may install my plugin, and never update it. &amp;nbsp;I may have to service version 1 of my plugin forever. &amp;nbsp;My web service is the type that needs to be robust - taking the whole cloud of servers down to upgrade just isn't in the cards. &amp;nbsp;I have to build my data model to be resilient - I can't change it midstream, and I can't do massive database upgrades that allow me to take the system offline for a day at a time. &amp;nbsp;I must plan for cases where I can only upgrade components of my infrastructure at a time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Things I must be able to tell about my infrastructure:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. what I'm running and it's versions.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. health of what I'm running&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. status of any dependencies.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Because truth be told, I must write my software and my app as if the Cloud can't be rebooted. &amp;nbsp;And the fact that my day job requires this on a constant basis is borderline criminal - we should hold our software vendors to higher standards. &amp;nbsp;I shouldn't put 100% of my cloud users out of commission, when I might be able to limit it to a fraction - or none at all.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><summary type="html">&amp;nbsp;I'm chewing through my email here at work, and I see a notice that our Cloud platform (built on ESX/Surgient) is going down for upgrades this weekend, a nearly 24 hour outage of the platform. &amp;nbsp;It got me to thinking - when does Amazon Web Services or Google App Engine ever shut down their cloud?&amp;nbsp;

People who know me well know that I really hate technology. &amp;nbsp;Not that I'm a luddite, but that most technology is actually crap - poorly engineered, prone to failure, difficult to fix. &amp;nbsp;I'm in the midst of building a webapp with a Lua plugin for Adobe Lightroom, and I will have to deal with the fact that a user may install my plugin, and never update it. &amp;nbsp;I may have to service version 1 of my plugin forever. &amp;nbsp;My web service is the type that needs to be robust - taking the whole cloud of servers down to upgrade just isn't in the cards. &amp;nbsp;I have to build my data model to be resilient - I can't change it midstream, and I can't do massive database upgrades that allow me to take the system offline for a day at a time. &amp;nbsp;I must plan for cases where I can only upgrade components of my infrastructure at a time.&amp;nbsp;
Things I must be able to tell about my infrastructure:&amp;nbsp;
1. what I'm running and it's versions.&amp;nbsp;
2. health of what I'm running&amp;nbsp;
3. status of any dependencies.&amp;nbsp;
&amp;nbsp;
Because truth be told, I must write my software and my app as if the Cloud can't be rebooted. &amp;nbsp;And the fact that my day job requires this on a constant basis is borderline criminal - we should hold our software vendors to higher standards. &amp;nbsp;I shouldn't put 100% of my cloud users out of commission, when I might be able to limit it to a fraction - or none at all.&amp;nbsp;
&amp;nbsp;
&amp;nbsp;</summary></entry><entry><title type="html">Java in the Cloud - A rebuttal to TheRegister</title><link href="http://localhost:4000/2011/06/30/java-in-the-cloud-a-rebuttal-to-theregister.html" rel="alternate" type="text/html" title="Java in the Cloud - A rebuttal to TheRegister" /><published>2011-06-30T00:00:00-04:00</published><updated>2011-06-30T00:00:00-04:00</updated><id>http://localhost:4000/2011/06/30/java-in-the-cloud-a-rebuttal-to-theregister</id><content type="html" xml:base="http://localhost:4000/2011/06/30/java-in-the-cloud-a-rebuttal-to-theregister.html">&lt;p&gt;&amp;nbsp;In an article written on the Register entitled &amp;quot;&lt;a href=&quot;http://www.theregister.co.uk/2011/06/30/java_misses_the_point_under_oracle/&quot;&gt;Oracle's Java plan trapped in last century&lt;/a&gt;&amp;quot;,&amp;nbsp;Matt Stephens&amp;nbsp;makes the comment:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;The one feature that genuinely is vital for Java to succeed in the cloud has been pushed back yet again. Lambda functions (essentially closures) are now set to appear in Java 8 (yes, 8) - though I'll believe it when I see it.&amp;quot;&lt;/p&gt;
&lt;p&gt;I whole heartedly disagree. &amp;nbsp;I believe enterprise Java in the cloud is here (witness Google App Engine). &amp;nbsp;I feel that there is a key feature that needs to become available to make Java better in the cloud. &amp;nbsp;&amp;nbsp;JSR 121 - Application Isolation API.&lt;/p&gt;</content><summary type="html">&amp;nbsp;In an article written on the Register entitled &amp;quot;Oracle's Java plan trapped in last century&amp;quot;,&amp;nbsp;Matt Stephens&amp;nbsp;makes the comment:&amp;nbsp;
&amp;quot;The one feature that genuinely is vital for Java to succeed in the cloud has been pushed back yet again. Lambda functions (essentially closures) are now set to appear in Java 8 (yes, 8) - though I'll believe it when I see it.&amp;quot;
I whole heartedly disagree. &amp;nbsp;I believe enterprise Java in the cloud is here (witness Google App Engine). &amp;nbsp;I feel that there is a key feature that needs to become available to make Java better in the cloud. &amp;nbsp;&amp;nbsp;JSR 121 - Application Isolation API.</summary></entry><entry><title type="html">Lazy Ways - Using Aspectj with Restlet Resources</title><link href="http://localhost:4000/2011/06/17/lazy-ways-using-aspectj-with-restlet-resources.html" rel="alternate" type="text/html" title="Lazy Ways - Using Aspectj with Restlet Resources" /><published>2011-06-17T00:00:00-04:00</published><updated>2011-06-17T00:00:00-04:00</updated><id>http://localhost:4000/2011/06/17/lazy-ways-using-aspectj-with-restlet-resources</id><content type="html" xml:base="http://localhost:4000/2011/06/17/lazy-ways-using-aspectj-with-restlet-resources.html">&lt;p&gt;&amp;nbsp;I'll say it - I'm Lazy. &amp;nbsp;I'll say it again, just in case you missed it the first time - &lt;strong&gt;I'M LAZY!!! &amp;nbsp;&lt;/strong&gt;Not in the sense you might mean, but in the DRY fashion. &amp;nbsp;DRY, for the uninitiated is Don't Repeat Yourself - a coders mantra that you never write imperfectly twice (even if it's quicker to do) what&amp;nbsp;you can spend a smidge more time on and write perfectly once! &amp;nbsp;In that vein, when working with Restlet, there are instances where you write code like:&lt;/p&gt;
&lt;p&gt;getRequest().getAttributes().get(&amp;quot;valuename&amp;quot;) &amp;nbsp;&lt;/p&gt;
&lt;p&gt;While not an issue in and of themselves, this gets tedious, and I might have to do it multiple times in a RESTlet (supporting 4 methods). &amp;nbsp;So I decided to use a little runtime annotation on instance fields with a parameter name mapping. &amp;nbsp; My annotation looks like so:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;package org.example.webresources;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;import java.lang.annotation.*;&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;@Retention(RetentionPolicy.RUNTIME)&amp;nbsp;&lt;br /&gt;
@Target ({ElementType.FIELD, ElementType.METHOD })&lt;br /&gt;
@Inherited&lt;br /&gt;
public @interface RestletResourceVariable {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;String name();&amp;nbsp;&lt;br /&gt;
}&lt;/p&gt;
&lt;div class=&quot;rteindent1&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then the parameters my resource supports are codified at the top of the class definition, and are ensured to be the same across all the REST methods. &amp;nbsp;Wait, wait. &amp;nbsp;Just using annotations doesn't confer this capability to my class, WTF? &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Well, to perform &amp;nbsp;a little magic, I call in the powerful AspectJ and wield it's mighty capabilities to do compile-time weaving to intercept calls and modify my instance variables in my ServerResources from the Requests passed in. &amp;nbsp;My aspect creates targets called pointcuts that are the descriptions of where my &amp;quot;before&amp;quot; interceptor functions are going to be attached - in this case the methods in my ServerResources that are annotation with @Delete, @Get, @Post and @Put method annotations. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;package&amp;nbsp;org.example.webresources;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;import java.lang.annotation.Annotation;&lt;br /&gt;
import java.lang.reflect.Field;&lt;br /&gt;
import org.aspectj.lang.Signature;&lt;br /&gt;
import org.restlet.*;&lt;br /&gt;
import org.restlet.resource.ServerResource;&lt;br /&gt;
import org.slf4j.*;&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;public aspect RestletResourceVariableAspect {&amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;static Logger logger = LoggerFactory.getLogger(RestletResourceVariableAspect.class);&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;pointcut RESTMethods() :&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;execution( @org.restlet.resource.Delete * org.example.webresources..*(..) ) ||&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;execution( @org.restlet.resource.Get &amp;nbsp; &amp;nbsp;*&amp;nbsp;&lt;/span&gt;org.example&lt;span class=&quot;Apple-style-span&quot;&gt;.webresources..*(..) ) ||&amp;nbsp;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;execution( @org.restlet.resource.Post &amp;nbsp; *&amp;nbsp;&lt;/span&gt;org.example&lt;span class=&quot;Apple-style-span&quot;&gt;.webresources..*(..) ) ||&amp;nbsp;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;execution( @org.restlet.resource.Put &amp;nbsp; &amp;nbsp;*&amp;nbsp;&lt;/span&gt;org.example&lt;span class=&quot;Apple-style-span&quot;&gt;.webresources..*(..) )&amp;nbsp;&lt;/span&gt;;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;before(): RESTMethods() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;Signature sig = thisJoinPoint.getSignature();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;Object target = thisJoinPoint.getTarget();&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;Class&amp;lt;?&amp;gt; c = target.getClass();&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;Field[] fields = c.getDeclaredFields() ;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;for ( Field field : fields ) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;Annotation[] annotations = field.getDeclaredAnnotations();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;for(Annotation annotation : annotations){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;				&lt;/span&gt;if(annotation instanceof RestletResourceVariable){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;RestletResourceVariable myAnnotation = (RestletResourceVariable) annotation;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;// get matching name from request variables.&amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;String reqVarName = myAnnotation.name();&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;// set request instance var to request var.&amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;ServerResource sres = (ServerResource)target;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;Request req = sres.getRequest();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;String reqVarVal = (String)req.getAttributes().get(reqVarName);&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;try {&amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;				&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;logger.info(&amp;quot;On Class &amp;quot; + c.getName() + &amp;quot; Field &amp;quot; +&amp;nbsp;&amp;nbsp;reqVarName + &amp;quot; value : &amp;quot; + reqVarVal );&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field.set(target, reqVarVal);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; } catch ( IllegalAccessException ex ) {&amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;logger.info( ex.toString() );&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;			&lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;		&lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This aspect iterates through the fields on ServerResource, finds any that are annotated with my custom @RequestResourceVariable&amp;nbsp;annotation. &amp;nbsp;It then finds the request input attribute that matches the annotation name() property and stored that value in the ServerResource's instance variable. &amp;nbsp;Then my @Get, @Post methods get the same variable - I don't have to take a chance that multiple methods are going to get difference variable/parameter names due to typos or failure to use a class Constant to document. &amp;nbsp;Mistakes are eliminated, simple coding errors. &amp;nbsp; And my code becomes self-documenting. &amp;nbsp;The parameter names are typed to the annotation. &amp;nbsp;The annotation is tied to the instance variable and the instance variable is pinned to the actual value passed in the Request object.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;public class QuestionResource extends ServerResource {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;static Logger logger = LoggerFactory.getLogger(QuestionResource.class);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;@RestletResourceVariable(name=&amp;quot;questionId&amp;quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;public String questionId;&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;@Get(&amp;quot;json&amp;quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public JsonRepresentation doGet() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;logger.info(&amp;quot;QuestionResource::doGet() {}.&amp;quot;, questionId);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;QuestionRepository qr = new QuestionRepository();&amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;Question question = qr.getById(&amp;quot;en&amp;quot;, questionId);&lt;/p&gt;
&lt;p class=&quot;rteindent1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Transparently.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Granted, there was effort involved in setting this up and making work properly (though as I think about it, I know there's a bug to fix - what if the @RequestResourceVariable annotation doesn't have a name property, it should default to the instance variable name). &amp;nbsp;But if there hadn't have been the niggling runtime @Retention I forgot to add (4 hours) and the familiarity with AspectJ that I needed to re-acquaint myself with (4 hours) - what would have been a day-long job would have been a half-hours work, and saved me countless bugs. &amp;nbsp;I only have to debug this Aspect once. &amp;nbsp;I have to debug all my request variable access code in every method I write. &amp;nbsp;Now I let the computer write correct code for me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That's being Lazy the Hard Way.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><summary type="html">&amp;nbsp;I'll say it - I'm Lazy. &amp;nbsp;I'll say it again, just in case you missed it the first time - I'M LAZY!!! &amp;nbsp;Not in the sense you might mean, but in the DRY fashion. &amp;nbsp;DRY, for the uninitiated is Don't Repeat Yourself - a coders mantra that you never write imperfectly twice (even if it's quicker to do) what&amp;nbsp;you can spend a smidge more time on and write perfectly once! &amp;nbsp;In that vein, when working with Restlet, there are instances where you write code like:
getRequest().getAttributes().get(&amp;quot;valuename&amp;quot;) &amp;nbsp;
While not an issue in and of themselves, this gets tedious, and I might have to do it multiple times in a RESTlet (supporting 4 methods). &amp;nbsp;So I decided to use a little runtime annotation on instance fields with a parameter name mapping. &amp;nbsp; My annotation looks like so:&amp;nbsp;
&amp;nbsp;
package org.example.webresources;
import java.lang.annotation.*;&amp;nbsp;
@Retention(RetentionPolicy.RUNTIME)&amp;nbsp;
@Target ({ElementType.FIELD, ElementType.METHOD })
@Inherited
public @interface RestletResourceVariable {
	String name();&amp;nbsp;
}

&amp;nbsp;
&amp;nbsp;
Then the parameters my resource supports are codified at the top of the class definition, and are ensured to be the same across all the REST methods. &amp;nbsp;Wait, wait. &amp;nbsp;Just using annotations doesn't confer this capability to my class, WTF? &amp;nbsp;&amp;nbsp;
Well, to perform &amp;nbsp;a little magic, I call in the powerful AspectJ and wield it's mighty capabilities to do compile-time weaving to intercept calls and modify my instance variables in my ServerResources from the Requests passed in. &amp;nbsp;My aspect creates targets called pointcuts that are the descriptions of where my &amp;quot;before&amp;quot; interceptor functions are going to be attached - in this case the methods in my ServerResources that are annotation with @Delete, @Get, @Post and @Put method annotations. &amp;nbsp;
&amp;nbsp;
package&amp;nbsp;org.example.webresources;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import org.aspectj.lang.Signature;
import org.restlet.*;
import org.restlet.resource.ServerResource;
import org.slf4j.*;&amp;nbsp;
public aspect RestletResourceVariableAspect {&amp;nbsp;
	static Logger logger = LoggerFactory.getLogger(RestletResourceVariableAspect.class);&amp;nbsp;
	pointcut RESTMethods() :
		execution( @org.restlet.resource.Delete * org.example.webresources..*(..) ) ||
		execution( @org.restlet.resource.Get &amp;nbsp; &amp;nbsp;*&amp;nbsp;org.example.webresources..*(..) ) ||&amp;nbsp;
		execution( @org.restlet.resource.Post &amp;nbsp; *&amp;nbsp;org.example.webresources..*(..) ) ||&amp;nbsp;
		execution( @org.restlet.resource.Put &amp;nbsp; &amp;nbsp;*&amp;nbsp;org.example.webresources..*(..) )&amp;nbsp;;
	before(): RESTMethods() {
		Signature sig = thisJoinPoint.getSignature();
		Object target = thisJoinPoint.getTarget();
		Class&amp;lt;?&amp;gt; c = target.getClass();		
		Field[] fields = c.getDeclaredFields() ;
		for ( Field field : fields ) {
			Annotation[] annotations = field.getDeclaredAnnotations();
			for(Annotation annotation : annotations){
				if(annotation instanceof RestletResourceVariable){
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;RestletResourceVariable myAnnotation = (RestletResourceVariable) annotation;
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;// get matching name from request variables.&amp;nbsp;
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;String reqVarName = myAnnotation.name();&amp;nbsp;			 &amp;nbsp; &amp;nbsp;	
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;// set request instance var to request var.&amp;nbsp;
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;ServerResource sres = (ServerResource)target;
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;Request req = sres.getRequest();
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;String reqVarVal = (String)req.getAttributes().get(reqVarName);
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;try {&amp;nbsp;
				 &amp;nbsp; &amp;nbsp;	logger.info(&amp;quot;On Class &amp;quot; + c.getName() + &amp;quot; Field &amp;quot; +&amp;nbsp;&amp;nbsp;reqVarName + &amp;quot; value : &amp;quot; + reqVarVal );
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; field.set(target, reqVarVal);
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp; } catch ( IllegalAccessException ex ) {&amp;nbsp;
			 &amp;nbsp; &amp;nbsp;		logger.info( ex.toString() );
			 &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;}
			&amp;nbsp; &amp;nbsp; }
			}
		}
	}
}
&amp;nbsp;
This aspect iterates through the fields on ServerResource, finds any that are annotated with my custom @RequestResourceVariable&amp;nbsp;annotation. &amp;nbsp;It then finds the request input attribute that matches the annotation name() property and stored that value in the ServerResource's instance variable. &amp;nbsp;Then my @Get, @Post methods get the same variable - I don't have to take a chance that multiple methods are going to get difference variable/parameter names due to typos or failure to use a class Constant to document. &amp;nbsp;Mistakes are eliminated, simple coding errors. &amp;nbsp; And my code becomes self-documenting. &amp;nbsp;The parameter names are typed to the annotation. &amp;nbsp;The annotation is tied to the instance variable and the instance variable is pinned to the actual value passed in the Request object.
&amp;nbsp;
public class QuestionResource extends ServerResource {
	static Logger logger = LoggerFactory.getLogger(QuestionResource.class);	
	@RestletResourceVariable(name=&amp;quot;questionId&amp;quot;)
	public String questionId;&amp;nbsp;
	@Get(&amp;quot;json&amp;quot;)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public JsonRepresentation doGet() {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	&amp;nbsp; &amp;nbsp;&amp;nbsp;logger.info(&amp;quot;QuestionResource::doGet() {}.&amp;quot;, questionId);
&amp;nbsp; &amp;nbsp; 	&amp;nbsp; &amp;nbsp;&amp;nbsp;QuestionRepository qr = new QuestionRepository();&amp;nbsp;
&amp;nbsp; &amp;nbsp; 	&amp;nbsp; &amp;nbsp;&amp;nbsp;Question question = qr.getById(&amp;quot;en&amp;quot;, questionId);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
}
&amp;nbsp;
&amp;nbsp;
Transparently.&amp;nbsp;
Granted, there was effort involved in setting this up and making work properly (though as I think about it, I know there's a bug to fix - what if the @RequestResourceVariable annotation doesn't have a name property, it should default to the instance variable name). &amp;nbsp;But if there hadn't have been the niggling runtime @Retention I forgot to add (4 hours) and the familiarity with AspectJ that I needed to re-acquaint myself with (4 hours) - what would have been a day-long job would have been a half-hours work, and saved me countless bugs. &amp;nbsp;I only have to debug this Aspect once. &amp;nbsp;I have to debug all my request variable access code in every method I write. &amp;nbsp;Now I let the computer write correct code for me.&amp;nbsp;
That's being Lazy the Hard Way.&amp;nbsp;
&amp;nbsp;</summary></entry></feed>
