Howdy!

Welcome to my blog where I write about software development, cycling, and other random nonsense. This is not the only place I write, you can find more words I typed on the Buoyant Data blog, Scribd tech blog, and GitHub.

Perforce On The Road, p4tunnel

The best means of accessing a Perforce repository is over an SSH tunnel, to access my home repository while I'm on the road I use a handy-dandy little script to do a few things:
  • Access Perforce
  • Access P4Web
  • Setup a SOCKS5 proxy

The proxy is more so I can have some semblance of security while on open wireless networks, the rest should be self explanatory.

Anyways, straight from /usr/local/bin, here's my p4tunnel script:
#!/bin/sh

HOST="yourhost.com"
PROXY_PORT="8081"

echo "===> Creating tunnel to ${HOST} with a SOCK5 proxy on port ${PROXY_PORT}"

ssh ${HOST} -L 1666:localhost:1666 -L 8080:localhost:8080 -D ${PROXY_PORT} -C
Read more →

A Review: The Metamorphosis

Imagine yourself awaking to find that you simply aren’t; aren’t yourself that is. Such is the situation that Gregor Samsa, Kafka’s unfortunate “victim” in The Metamorphosis, finds himself in. Gregor awakens one morning from “unsettling dreams” to find that “he” has transformed from a (presumably) twenty-something traveling salesman into a beetle-like vermin. The story of Gregor’s unfortunate predicament begins with the climax, the transformation, and slowly descends from there to Gregor’s ultimate demise. Unlike some of the past philosophers I have read who tend to write essays or prose, Kafka’s insight takes the form of a parable of the conflicts of Gregor Samsa’s internal “self” with his external self and surroundings. This mask of fiction concealing the philosophical musings of the story makes them quite difficult to spot upon initial inspection (in my opinion), making a second read through or browsing of academic articles on the piece if not a necessity, highly recommended.

Kafka’s splitting insight is not for the faint of heart, at the same time that Gregor is lamenting his condition (specifically when he, as the vermin, attempts to get out of bed) he is also pleased with his escape from some of his “human” responsibilities that have shackled him to a miserable existence as a traveling salesman working in a soul-grinding firm paying off a debt owed his employer by his parents. As the story progresses, unbeknownst to Gregor, the reader is shown more to convince them that the family was more akin to vermin than Gregor may have transformed into. In Gregor’s early reflection he cites the importance of his work to help support his family and the necessity of his sacrifice (of freedom) to work in the firm that his parents are indebted to. As time wears on however, and Gregor is incapable of working (contrary to popular belief, vermin don’t sell too many Encyclopedia’s door to door) his father attains a job as a bank-messenger and his family lets out one of the rooms, in the spacious apartment Gregor provided, to three “roomers” indicating that Gregor’s degrading sacrifice at the firm may not have been necessary at all, ergo the Samsas may have been the vermin feeding off of Gregor instead of the inverse.

The issue of food, or rather nourishment, is another interesting theme Kafka adds into the already complex literary-gumbo of The Metamorphosis. The first day of Gregor’s transformation he is offered some of his favorite food by his sister Grete (we can assume she is trying to help cure what is perceived as an illness by Gregor’s family as opposed to the transformation it truly is) to which he refuses and scurries back under the couch to which he oft finds refuge. As the story wears on Grete slowly discovers that Gregor, the new Gregor, prefers what essentially boils down to table-scraps and garbage, but this is still not enough to “nourish” Gregor. He consistently complains (in thought) about a longing for nourishment, a lack of fulfillment of some sort that is finally placated one day when he hears the beautiful violin music Grete has taken to playing for the three “roomers.” This still doesn’t seem to be enough to “nourish” Gregor in the sense that he still longs for something, a certain something that he finds the fateful morning when he exhales his last breath with the rising morning sun (finding contentment, or fulfillment, with death is an interesting point Kafka raises for me after reading a few essays on both Absurdism and Existentialism).

Slowly Gregor becomes more of a curse in the eyes of the rest of the Samsas instead of a son with an inordinate amount of legs. When Gregor dies, it is a release in more than one sense. While Kafka cites most immediately the lifting of the burden from the Samsas’ backs, it is apparent that Gregor has also been relinquished of his conflicts with the firm, his parents, and most importantly, himself; with his death Gregor is finally set free, just as he had hoped to become after repaying his parents’ debt to his employer. While there is some academic discussion on whether the metamorphosis itself relinquished Gregor from some of his bourgeois-responsibilities, it is without a doubt that in his death he finds the freedom for which he had longed. An interesting point was raised in one of the analysis of the piece that pointed out that maybe the parents were truly the “blood-sucking vermin” with regards to the last few pages of The Metamorphosis, when the parents turn to Grete, the daughter, and prepare her to be married off to a good husband, pointing out that with Gregor (the initial host) gone they must switch to a new one, Grete.

Unlike most stories, there are no likable characters in The Metamorphosis, as Gregor continues to act more and more like the “vermin” he has transformed into and his parents react negatively to their son’s predicament, the reader is left without solace. Although Gregor eventually attains the freedom he had so desired, he is still a poor choice for the “hero” of Kafka’s work. That is not to say however, that there are no identifiable characters; Gregor typifies a lot of the internal struggle most found themselves in, in the whirlwind of capitalist growth in the early 20th century along with the lessening of the importance of the individual; both very fundamental conflicts most (including Kafka) found/find themselves in, especially in western culture. Simultaneously many can identify with the denial the Samsas find themselves in with their disgust of the vermin that comes to inhabit Gregor’s room. The Metamorphosis is widely regarded as one of, if not the, most important pieces of literature Kafka ever had published, but is a difficult pill to swallow and at the same time a worthwhile exposure of the conflict that Kafka, and many others, have struggled with.

I highly recommend, if you have not already read The Metamorphosis, purchasing the “Bantam Classics” version of The Metamorphosis which includes over one hundred pages of critical essays and academic discussions on Kafka’s masterpiece. Translator (and PhD) Stanley Corngold made a fantastic selection of analytic essays on the story ranging from incisive psychological analysis of Gregor’s transformation to the oedipal conflict and reversal of roles between the father and son that constantly lurks beneath the surface. Dutifully reading all of the explanatory notes on the text as well as the critical essays that Corngold included in the book drive the point firmly into place, Kafka was a brilliant writer and, like his tragic heroes, was a tormented individual who may have found solace in the escape that his death (from tuberculosis) ultimately offered him.
Read more →

Soldiers of Fortune

I am watching this show on "the long war [on terror]" ("Our childrens' childrens' war") which is covering private contracting firms that are working with the military, specifically Blackwater USA which is seriously one of the scariest companies I've read about in a while. I'm not a fan of our ever growing federal government, but turns out they're dutifully employing mercenaries in a war on an already questionable moral foundation? Fun.

There is no question that we're involved in a global war of ideologies, but we're walking a fine line between that and a crusade, and mercenaries only sweeten the pot.
Read more →

Teeny-tiny Updates

If you look at the sidebar, you might notice a new "Twitter" column has been added, which I intend on using to keep a good aggregated feed of the unethical blogger users' twitters. I have also added a new category "Literature" which I hope I'll be able to populate soon enough with book reviews, and other miscellaneous bits of criticism and commentary.

I've noticed a few registered users that haven't commented or blogged about anything yet, which I hope they will remedy soon enough as I'd really like to sucker more folks into using the site or "blogging unethically" (har, har).
Read more →

BarCamp Austin, Again

It seems that I might be going to BarCamp Austin2 this next weekend. I'll be presenting on "the importance of webservices" or something about as exciting. I'm still working on my presentation (ick) and I'm going to try to incorporate as many useless buzzwords, pot-shots at George W. Bush, and cult movie references as possible. I'm not sure how it's going to be, at least 41% more exciting than my last BarCamp presentation on Cocoa hacking and why everybody should, but still 12% less turtle-neck than a Steve Jobs keynote. I'll be sure to post my slides and hopefully a video or audio of the presentation later, but we'll see if I can make a presentation worth posting first.
Read more →

The Visual Basic Stigma

I recently recommended to a client that a project they were looking to have done in Visual Basic should be done in C#, but I found that it wasn't as easy as I thought it would be to articulate *why* I was recommending that. The easy answer was because I'm a C programmer at heart and C# is what I'm into these days, but given that the bulk of my professional experience in the last 4-years has been in Visual Basic, and that both C# and current versions of VB are fairly interchangeable for someone familiar with both, that reasoning seemed a bit weak.

I came across this article on programming in Visual Basic and it really rings true to me. I don't enjoy programming in VB quite as much, but at the end of the day I'll look back and realize that it made almost no difference to me at all. I have the same embarrassment about programming in VB that the author talks about on occasion, and I have the same thing with Windows programming in general in comparison to C on Unix-like systems.

I also thought the wikipedia article comparing VB and C# had a pretty interesting section on the VB and C# programming cultures. I know that my first project in VB6 was terrible. I had a fairly strong C on Unix programming mindset and even though the concepts should have been the same it took me a long time to figure out how to adapt what I knew about programming "The Right Way" to that environment. I can't honestly say for certain that was the fault of VB, it may have been my unfamiliarity with doing graphical user interfaces, but to this day it still feels more natural to follow good programming practice in C#.

Speaking of that first VB program, I'm inclined to agree that, given enough time I will think my old code was crap when I look back ...
Read more →

I'm Shocked

I'm shocked that anything as simple as a music download site offering popular music (not major label stuff, but still some high profile artists) in unprotected mp3 files could be done so poorly. Seriously, how crappy must that system be if they have to force a .wma extension onto the mp3s? If they have a non-ActiveX download setup what's the deal with Mac downloads? How hard is it to have a properly descriptive error message for Mac users?

I can't even come up with words to describe how poorly they've done this. Has nobody involved with this mess ever actually thought of testing the site?
Read more →

Completely Off-topic

I try to separate my political leanings from my work, especially when it comes to blogging, etc, but this is too much. The House passed non-binding resolution on Iraq which is the latest in the long list of completely neutered actions by our legislative branch.

It's not a question of "supporting the troops" or "protecting the children" or "stopping terrorism" if you don't have the spine to keep the executive branch in check (what a quaint idea) resign so we can find somebody who isn't an absolute coward. Regardless of which side you lean towards politically, any executive branch that's given carte blanche is dangerous.
Read more →

Twitterbot Basic HTTP Authentication Errors

As some of you may have noticed, the Twitterbot seems to always fail to authenticate properly against twitter's basic HTTP authentication prompt when run from Mono 1.2.3 on Mac OS X. This was neither an error in twitter's webservice (I have been running my bots from a FreeBSD machine with Mono 1.1.13 for some time now) nor in the Twitterbot code itself, but rather a regression in the System.Net.Configuration namespace, I'll let "kangaroo" (the developer who found and fixed the bug) explain:

13:03 <@kangaroo> ok its falling in to DoPreAuth
13:04 <@kangaroo> Authorization auth = AuthenticationManager.PreAuthenticate (this, creds);
13:04 <@kangaroo> thats returning null
14:04 <@kangaroo> got a patch for you
14:04 < rtyler> to compile into mono or my app?
14:05 <@kangaroo> http://monoport.com/1821
14:05 <@kangaroo> mono
14:05 <@kangaroo> you need a new System.dll


The patch should make it into the next bug-fix release of Mono (1.2.3.2) and should allow you to once again run Twitterbot on Mac OS X, otherwise you might want to try another machine, or step back a few point releases if it's that critical to have you Twitterbot running.
Read more →

Terminally ill

There's really not a decent explanation for this, other than Terminal.app went bonkers. I've seen this happen before to some extent if you have an NSWindow that has transparent background, but a partial background drawing like here is something completely new.

This sort of weird nonsense only happens to me.

If the video link isn't showing up in the RSS feed, here it is for you.
Read more →

Internal Server Error

You may have noticed recently (hopefully not) this site kicking back a simple, plain-text error: An internal server error occurred. Please try again later

The root of this issue was some scripts inside Drupal simply taking too long and timing out, which I believe, has been resolved by enabling e-accelerator in the site's .htaccess file. I'm hoping that has killed the errors, if it hasn't feel free to drop me a line at tyler@bleepsoft.com and let me know the site is broke again :)

Special thanks to Dave at GeekISP of course for being accommodating with my silly complaints.
Read more →

I ain't Shipley, but PmpMyApp

Ever since coming across the (draft) specification for NAT-PMP I've been almost in love with the absurdly simple NAT port mapping protocol. The unfortunate downside is that NAT-PMP isn't well supported except on Airport base stations, one of which I recently acquired, so as is customary when I welcome a new device into my apartment, I had to write some code for it. I hate to sound like a fan-boy, but like Bonjour, Stuart Cheshire's other baby, NAT-PMP is sickeningly simple. A series of straight-forward UDP packets is all that is needed for a local (inside the NAT) device to create a mapping on the NAT device itself.

To exhibit this functionality, I've created a sample application that uses a tiny little library I built to create and destroy mappings on the NAT-PMP enabled device. The application is called "PmpMyApp" and can be found on GitHub

The code contained in pmpmapper.c has three basic functions that perform the functionalities that NAT-PMP provides, and are aptly named as well:
struct sockaddr_in *pmp_get_public();
pmp_map_response_t *pmp_create_map(uint8_t type, uint16_t privateport, uint16_t publicport, uint32_t lifetime);
pmp_map_response_t *pmp_destroy_map(uint8_t type, uint16_t privateport);


The pmp_get_public() function returns a pointer to a sockaddr_in that contains the external IP address of the NAT device. The pmp_create_map() function does the heavy-lifting, in that it will create the actual mapping (and the deletion too, with a zero lifetime) and will tell the NAT device to persist the mapping for the number of seconds specified with the lifetime argument. The code is commented so it should be very easy to get a feel for how to use the pmpmapper functions, a good place to start is by examining how it's used in the PmpMyApp source. (Note: All of the PmpMyApp code is BSD licensed)
Read more →

Tiring

I am not certain if forgetfulness is a side effect of working too much, or general stress, but I spent about a minute looking around for my keys before finding them still sitting in the lock on my front door.

Whoops.
Read more →

Mono Winforms Update

The pre-release version of Mono 1.2.3 handles the painting events properly, so it appears that FTGL# actually works on Mono, at least on Windows.

Thanks to the kind folks in #mono-winforms for taking a look at this for me.
Read more →

Kernel Panics Do Weird Things

With the arrival of my new Airport Extreme base station came two new ways I can kernel panic my machine. So I now have 1, 2, 3 ways, three ways to panic my machine, ah-ah-ah-ahhhhh.Besides the usual enjoyment of seeing this wonderful image, you can experience some weird things when your OS X machine reboots.

In the attached video, I found that my mouse was in a perpetual state of scrolling down. Not a quick scroll either, a nice leisurely one, the kind you take on the beach, a nice leisurely scroll down in every window with a scrollbar in the entire operating system. Gak.
Read more →

Mono, Winforms, Tao, and Me

I finally got around to testing FTGL# with Mono on Windows. Didn't require any modification, but there's one oddity ...


C:\Documents and Settings\stephen\My Documents\work\FTGLSharp\sample\bin\Debug>"FTGLSharp Demo.exe"
Opening Font File C:\Windows\Fonts\arial.ttf
Setting 24pt, 72dpi
Done font initialization
sap.ftgl.MainForm, Text: FTGL.OnActivated() called
sap.ftgl.demo.demoControl.forceRefresh()
sap.ftgl.demo.demoControl.OnPaint() called
sap.ftgl.MainForm, Text: FTGL.OnActivated() called
sap.ftgl.demo.demoControl.forceRefresh()
sap.ftgl.demo.demoControl.OnPaint() called

C:\Documents and Settings\stephen\My Documents\work\FTGLSharp\sample\bin\Debug>mono "FTGLSharp Demo.exe"
Opening Font File C:\Windows\Fonts\arial.ttf
Setting 24pt, 72dpi
Done font initialization
sap.ftgl.MainForm, Text: FTGL.OnActivated() called
sap.ftgl.demo.demoControl.forceRefresh()
sap.ftgl.MainForm, Text: FTGL.OnActivated() called
sap.ftgl.demo.demoControl.forceRefresh()


I don't know yet if it's Mono or Me (I'm usually missing some detail ...) but OnPaint() isn't happening when it should if I fill my control with another control
Read more →

Absolute Frustration

Time-Warner (again) had an outage this morning, and it has somehow left my Linksys WRT54G absolutely incapable of routing properly.

From the router administration page, I can ping public servers. From inside the network, I can ping ping local machines. I can properly resolve hostnames, I just can't ping anything on the public internet, from inside the network. My router has become absolutely dysfunctional as anything but a simple switch.

I'm only lamenting that I don't know of a taller building from which to hurl this miserable piece of shit from.
Read more →

Webservices with Dumbarton

While I have been know to gripe about WebServicesCore, there are however options now when developing service-oriented applications. Introducing, Dumbarton; Dumbarton is basically a ObjC-C# bridge that makes use of the Mono embedded API to allow you to utilize C# code from within your Cocoa application. Personally, I think writing SOAP consumption code in C# using Mono or .NET is far nicer than trying to write something using C/Objective-C via WebServicesCore, so this is my "favorite" option. The word favorite being in quotes as unfortunately Dumbarton is a bit complex to use and bundle for a smaller Cocoa application.

Dumbarton is however an option, so I wrote up a quick example that makes use of a currency exchange rate webservice via xmethods.com and essentially rehashes the proverbial "Currency Converter" sample project with an up to date exchange rate. I've pushed the project to GitHub in case you want to check out the whole project.

the nitty gritty


Mostly because I'm a lazy developer (who isn't?) I used the standard "wsdl" executable that you can find in .NET or Mono to generate the necessary stub class for providing the last intermediary layer between our desktop application. The method that's generated (synchronous) that we'll write our wrapper for is:
public System.Single getRate(string country1, string country2);
which will handle the actual webservice invocations which we'll write a small Dumbarton wrapper for. Interacting with SOAP webservices in .NET/Mono is quite simple however, so it'd be trivial to take an existing set of generated stubs and modify them, or simply write all the code from scratch.

The Dumbarton wrapper provides the neccessary "boot strapping" for a bridged object between Cocoa and Mono and also "acts" as the bridged object for the C# class. For example, our Dumbarton wrapper class is called CurrencyConverter which is a subclass of DBMonoObjectRepresentation, and in the wrapper method we call:
[self invokeMethod:"getRate" withNumArgs:2,str1,str2];
which will invoke the C# method getRate(string,string) and return a MonoObject pointer. The bridged methods will return a MonoObject pointer which you can either unbox with the DB_UNBOX_* macros provided in the DBBoxing.h file, or you can invoke methods on that object like CurrencyConverter does with:
(MonoString *)(DBMonoObjectInvoke(rateObj,"ToString",0,NULL))
in order to return a string, or another MonoObject pointer to use. Overall it's really simple to use once you have all the ducks in a row, such as llinking against the Mono.framework and the Dumbarton.framework properly, and you load them into the DBMonoEnvironment appropriately.

notes on CurrencyConverter


I bundled a Dumbarton.framework build that I had handy inside the Subversion repository, but I have linked this against the Mono 1.2.3-preview that I have installed on my machine, so I recommend you checkuot the latest Dumbarton from Subversion (svn co svn://svn.myrealbox.com/source/trunk/Dumbarton) and install the latest stable version of Mono (1.2.2). If you feel like trying out the preview, you can grab the Mono 1.2.3 preview installer to link your custom Dumbarton build against. Something to note however, is the Installation Path in the Dumbarton Xcode project is set to /Library/Frameworks currently, so if you want to link against it and bundle it inside your application bundle you'll need to update that to @executable_path/../Frameworks and then bundle it in the same fashion you would with Growl or Sparkle. You will also need to setup a copy files or a build script phase to handle your bundling of the DLLs inside the application bundle as well. Distributing an application that uses Mono and Dumbarton is a bit stickier, as you have to pick and choose which libraries to bundle, etc, check out this thread from the mono-osx list.

the springer final thought


Depending on your familiarity with developing with C# in either Mono or .NET, Dumbarton may be a great option for utilize existing .NET code for webservices, write cross-platform webservices code, or just avoid the pains of WebServicesCore; it can also be another frustrating stop on the avenue of SOAPy pains if you misunderstand how Dumbarton or C# works. It's currently on my ever lengthening todo list to start documenting far more of what you can do with Dumbarton, but hopefully the examples distributed with the source, along with CurrencyConverter provide a good starting point for those who feel crazy enough to try it out.

As a side note, I have 8.6444 pound in my wallet right now.
Read more →

I'm on another podcast

Steve Scott of Late Night Cocoa asked me a couple weeks ago if I wanted to come on and talk about BuildFactory and continuous integration, and then that slowly morphed into talking about webservices and Dumbarton as he noticed I posted some WebServicesCore gripes. We got to chatting a bit about why Mac developers don't seem to "appreciate" webservices as much as those in the .NET world, etc and eventually got together to record Web Services with R. Tyler Ballance.

If you've not checked out Late Night Cocoa, I highly recommend it, it's already shaping up to be a good (technical) podcast about Mac development (the Core Data with Marcus Zarra interview was fantastic, a hard one to follow). If nothing else I hope most developers can use my interview to get a better feel for what's available in the growing webservices (2.0!) landscape. A more active discussion about the strengths and weaknesses in the Cocoa frameworks can do nothing but make the Mac development community stronger, check it out!
Read more →