Archive for January, 2009

C++ Unit Testing Framework

Saturday, January 31st, 2009

I’ve dusted off my C++ unit testing framework as it’s been a bit underfeatured for use on a couple projects I’ve been working on.

The fun part is that it’s the ultimate TDD dogfooding project as I’m oscillating between the tests and the framework itself as it evolves.

Frankly I don’t consider what I’m doing to be re-inventing the wheel. Every C++ unit test framework I’ve tried has thwarted me in some way or another; most frequently in the name of making it easy to add a test via macro-magic.

I just don’t care so much about that. I can type. Besides, the result of having ‘the simplest possible add_test line’ is usually a bunch of crap in the test framework that I just cannot in good conscience abide. Hey, if that’s your goal… awesome. Rock on with your bad self.

If I wanted everything to be a one-liner, I wouldn’t be using C++ in the first place.

My real goal with this is to have a framework that’s as rich as reasonable while using standard C++ (requiring a mature compiler. It’s 2009 for chrissakes, you need to support the language) and keeping the framework to a couple (at most) header files. That’s it. There shouldn’t be anything to getting the framework in to place besides:

#include “testfw.h”

and including your test driver shell.

So we’ll see. It’s ambitious of me to try and simplify this down that far I know. But I’ve only got a couple problems left to solve before I’ll have something worth sharing. HOPEfully I’ll maintain the requisite steam to get that out in a few hours. But I’ve an awful lot to work on today.

It’s going to be a bit before it’s got a nice spit-shine on it. But in the meantime…

UPDATE: 7 hours later I have a reasonable TestSuite class. I’m pretty surprised that there are less than 30 unit tests for it which really cover the thing pretty well. I have yet to add recursive suite support (suite of suites.) And I need to templatize my assert functions, they’re stupid the way they are. But it’s more than serviceable at the moment. Definitely not the worst code I’ve ever written.

I’m spent.

Newspapers on your Computer

Saturday, January 31st, 2009

1981.

Wow.

There’s just too much in there I want to comment on to comment on any of it ;)

(HT: Tammy Bruce)

hmm

Wednesday, January 28th, 2009

Ya know, in this infinitely weird and wonderful world, there are some things I just don’t understand.

Sure sure, there are some things I find too repulsive to grasp, too stupid to believe, etc.  This isn’t one of them.

What I don’t get is why seemingly random people have started following me on twitter.

It doesn’t BOTHER me in the least.  Hey, more power to ‘em.  I’m still in the “is this thing on?” stages of it so hey, whatever blows your skirt up.

But why?  The people I know are people I know I know and that all makes sense (and I’ve usually followed them in kind, though nobody seems to actually… you know… USE the thing, but whatever.)  But I get one or two emails a day saying “soandso’s following you.”

I do get the moment of creepoutedness that you might imagine such a phrase would invoke.  But I just sorta shrug, crinkle my brow and say (usually outloud to the screen) “hey man, whatever, knock yourself out.”

But not understandin’ nuthin’ makes my hed hurt.

A new writer

Wednesday, January 28th, 2009

So there’s a novel coming out in July that I’m more excited about than a certain fragment of my readership (which I’m going to gain after I post this) is likely to believe.

The author is one of the most glib, twisted, hilarious people… there are.

The novel (The Last Bridge) is her first and lately she’s been blogging about the “ohmygodohmygodohmygod…wait what? ohmygod!” process of it all and doing so with remarkable …err… aplomb is the wrong word…

Oh forget it.  Go read… Teri Coyne’s blog,  the flip side…

“Been shoppin?” “No, I’ve been shoppin’”

Tuesday, January 27th, 2009

Haven’t been shoppin’ but I sure as hell haven’t been around here, as you’ve noticed.

I’m really up against the wall on this grand experiment of mine.  My success is getting to be pretty consistent.  But when push comes to shove I’m not “making my numbers.”  It’s a horrible curse, and I may yet be able to pull this off.  But it would be “pulling this off.”

It’s hard being scared when you go to sleep; worrying about money, worrying about your performance, realizing that the only obstacle is your ability to get out of your own way and do the things you know are right.  Add to that the knowledge that there’s something else you love doing but if seemingly the only way you can do it is if you have to sell a bit of your soul.

If I didn’t hate financial IT so much this wouldn’t even be a discussion.  But I’m near pathological about it now.

The big problem at this point (here comes the justification… wait for it… waaaaiiit….) is that my resume looks less focused than a pollack painting.  I’ve been doing programming work I can’t stand for so long that it’s really crippled my marketing power due to a bad case of ADD job hopper syndrome.

A friend of mine is a recruiter and she just shakes her head in disbelief at my resume.  “Mike, you’re great once you get in front of them.  But how the hell do you expect me to get you in front of them?”  Which is true.  I interview pretty well.  I tech out moderately well for my skill set.  But the recruiter’s got a bitch of a sales job.

Of course when I say “no financial” she damn near hangs up on me.

Yeah so that’s that about all that.

I can’t even describe to you how unbelievably frustrating it is to finally see success coming and realize it might just be too late.

Tweet this, bitch

Tuesday, January 27th, 2009

As a trader and an internet junkie I can’t help but have come across stocktwits.  The amount of buzz about this thing has finally pushed me over the edge to start paying attention to my twitter account.  So I finally went and started “following” a few people who were following me, kicked the tires on actually “twitting” from my phone, uploaded a pic (a good inebriated one) and all that there.

So if you’re one of those types of people I’m on twitter as, you guessed it, madwilliamflint (yeah yeah, I know what I said.  mpwilson wasn’t exactly available.)

I can’t begin to imagine what I’m going to twit about (tweet?  god this is worse than the fucking coffee jokes for java.)

I’ll probably need some bizarre blog integration thingie… but in which direction I’ve no idea.

V. Kate had something that seemed to update her facebook status with twitter things but that could’ve been my imagination… so much is lately.

I’ve also been pointed at a really stellar piece of software (how often do you hear me say THAT?) called TweetDeck that’s an adobe air application (frankly I don’t even know wtf that means.  I’m so damn behind.)  It helps you follow and group and filter your twitter subscriptions, so you can maintain a nice console with group updates, etc.  It’s very much the kind of thing I’ve fantasized about writing for rss feeds; sort of a recombinator and filtering. (Frankly because boing boing’s political ramblings make me want to puke.  But their tech stuff is fine.  Nix Cory, gimme Xeni… that sort of thing.)

But if you’re a twitter person, check out TweetDeck.  It’s free as in beer and runs on either platform worth mentioning (take THAT.)

And as always, if you have any recommendations, gimme a holla, yo.

On another note…

eh, that’s another post.

BRRAAIIINNNSSS!

Sunday, January 25th, 2009

Ok, not brains but pizza.

I got slammed with an insane craving for a pepperoni & fresh garlic pie all at once.

I tried just ignoring it but it’s like there a …uhm… little person standing next to and slightly behind me, hands crossed, just staring at me wordlessly who won’t go away until I go get a pizza.

l8r o/

lost my MIND laughing at this

Sunday, January 25th, 2009

But wait! Check the outtakes! They had me in tears.

HT: A commenter over at ace

yeah, pretty much.

Saturday, January 24th, 2009

funny pictures of cats with captions
more animals

AI and projects forgotten

Monday, January 19th, 2009

So I started seeing an analyst a couple weeks ago. That’s good news.

Now, in two 50 minute sessions only so much can happen.

BUT one of the solid effects of having taken definitive steps to right myself (yeah yeah I know “oh, as if you weren’t right enough already” ;) is that on the back burners of my mind, I’ve been playing the recapitulation game with myself. I’ve been looking at notebooks 1/4 full of project ideas, things I wanted to noodle around with, ideas I’ve had from brainstorms to mild humidity. In evaluating which of those I want to turn my attention (albeit fractured) on I keep coming back to the idea of making something smart.

Most people, when they hear “AI” think of two things now (fortunately.) They think of the “indistinguishable from human” goal, and they think of some nebulous promises of software from 10 to 20 years ago. Used to be it was just the terminator that came to mind. Hell, I call it progress.

But what’s important about the progress towards the first type of AI is the APPEARANCE of intelligence. There are hosts of ways, usually involving some kind of fuzzy logic (and I use that term more broadly than it’s technical definition.)

Well I’ve always wanted to poke around in that world. But I never quite knew where to start (ah the failings of having skipped out on my edumacation.)

Corewars frankly is just too hard a place to start. Those people are insane. There are a number of other ‘inspired by’ type frameworks I seem to remember. Design your own tank and let your bot loose to compete with others, etc.

There’s what I’m assuming is the high end and that’s taking video games and building add-on characters (NPCs) that would have complex behaviors like “knowing how to take cover when being shot at” and “running for help.” I’d always heard that those were (with some hackery) able to be built in to certain FPSs. Sounds juicy. But I think starting small would be a better tactic.

Then there was a different category. Sort of an evolutionary petri dish where there was food, obstacles, predators, etc. and the “guys” would have simple little behaviors describing how they’d move towards food, interact with each other, etc. It’s a bit tough to describe if you don’t know what I mean (I’m guessing.) When you run these things it looks like a multi-colored Conway Life field. In the large, you’d be able to watch as patterns and group behaviors seemed to emerge.

I’d had it in my mind to come up with one of these things from scratch, which seems like an awful lot of fun. But I’m going to look around the toobz and see if I can’t find something that’s done most of the up front work.

Tough to know how to google this stuff. I’m probably going to have to play the “Wikipedia Free Association” game to find concrete resources.

UPDATE: Happens every time I claim something’s hard to find. Zooland and ALife’s link page

Meh. oh, nevermind. There’s just too much out there. It’s positively discouraging.

Now HERE’S something funny for you civilians

Monday, January 19th, 2009

There’s a game, Fallout 3. It has a wonderful “past future” post-apocalyptic setting. Think golden age 50’s visions of the future…gone sour.

So it’s some indeterminate time in the future, the world’s been pretty much blown up and you were raised in a huge underground shelter.

You eventually encounter a radio station being broadcast with some plot line, “news” and a wonderful play list that most people who’ve read this far will double take.

Having had quite enough programming and FX research for an evening I started playing and after about an hour I quit so I could go dig up some info on the music. I found the list just now over on BeefJack (*shrug*)

Check this out (the videos I linked to on youtube are for the most part stills or clips from the game, so they’re a little …well… icky):

Now, there are a couple missing from that list, but it’s a damn good start.

These things are really getting better.

UPDATE: Among the missing:

Easy Living - Billie Holiday

Let’s Go Sunning I don’t know who this is yet. Gimme a break, it’s 2:45 in the morning.

(I’ll populate these links and flesh this out for a bit, as I’m inspired.)

Quote of the …well… next 4 years

Monday, January 19th, 2009

“I predict future happiness for Americans if they can prevent the government from wasting the labors of the people under the pretense of taking care of them.” Thomas Jefferson

The Internet: A force so great it can only be used for good or evil

Saturday, January 17th, 2009

Came across this, needed to share.

Beware the darkened halls of tvtropes.org

HA! That’s it! Right There! Pronoun trouble

Saturday, January 17th, 2009

Genius.

Does bring back a wistful memory and series of regrets.

VistaShellReplacment

Friday, January 16th, 2009

I’m getting all hacky again and that usually coincides with a deep dissatisfaction with Windows.

Since I’m trading and gaming about 100 hours a week (ratio kept private to protect the guilty) switching to Linux isn’t really an option.

Plus, no matter what the geeks say, the video/audio codecs on linux suck righteous ass so, unless it’s a pure dev box (not soon) it just ain’t happening.

However, back in the days of 98, you could replace the whole look and feel by replacing most of the explorer interface with something else.  The options (lightstep comes to mind first, though there were DOZENS) were amazing.  Really wonderful stuff.

But this crap has been so kiosked and locked down since then that I wonder if a full blown shell replacement is even possible any more.

I’m going to go do some more poking around, but in the meantime… anybody know of any Vista Shell Replacements?

(public service announcement: Replacing your shell is (or was) a damn invasive thing to do. Used to be you could bork your operating system pretty bad if you mucked it up.)

UPDATE: Figures…
Google Search

Commercial:
Talisman Desktop
Eye Candy Look

As In Beer:
Emerge Desktop
LiteStep: This was the Granddaddy of them all. Tough to find references as to whether it’ll work on Vista or not.

If I’m not careful, this is goin’ STRAIGHT to my head

Friday, January 16th, 2009

7 consecutive up days at the market.

Yesterday I had an inSANE day. Not an insanely GREAT day mind you. I was up… err… a lot in cash and I made a trade based on a newsletter recommendation (a very good newsletter with a rather remarkable success ratio lately) and the market turned around and that one trade looked to erase more than my gains for the day.

An email alert for the newsletter came out saying “dump it at a loss, this market’s just not letting up.” But by the time I got the email it had already improved a little from that point. So I put a protective order on so that if it got worse it would automatically go, then I struggled to endure massive fluctuations.

That trade ended to the bad, erasing more than half of my gains. But I was able to save a bunch by judicious panic stricken manipulation of my exit point. So THAT I’m pretty chuffed about.

Then today I had a small trade that I called beautifully. It wasn’t a huge gain, but it was quite healthy. My entry point was well reasoned (a relatively new notion in my trading :p) and while my exit was a little frenetic, it obeyed my trading rules which makes it a success. The fact that the issue (Wells Fargo) went the other way as soon as I exited the position had me doing the happy dance for about an hour, feeling very good about myself :)

Ya know, the “most important thing” about trading changes for me every 20 to 30 seconds, as you might imagine. But there are only three things you need to get good at in order to be able to do this successfully:

  1. Develop a trade plan: What are you buying and when. Under what conditions are you exiting the trade (to the good and if you’re wrong.)
  2. Trade that plan. This is so very very much harder than it sounds. No, there’s not a gun to my head with Halle Berry blowing me but there are a number of things that make it pretty damn tough to concentrate.
  3. Change your rules when necessary. “When necessary” is easily defined if you’ve obeyed the first two. It’s when you’ve obeyed the first two, the trade breaks, and there’s a reasonable adjustment that would have prevented it that is reasonable to have seen up front. Look, the WFC trade I mentioned from this morning turned “against me” after I sold…for a little while, then it turned back around and went 3x farther in the direction I had on. But my trade was intended to be a 3-5, maybe 10 minute trade. I wasn’t looking to catch the hour long trend. Maybe I should have. But that’s a different evaluation. I couldn’t reasonably have seen that happening on the time frame I trade. That trade is a different thing altogether. So this was a success.

I have a couple additional rules that keep me as close to sane as I’m likely to get:

Never make the same trade twice in a row.

A successful or failed trade slams me emotionally. I used to succumb to this hideous impulse to either run back and do it again or “get my money back.”  Neither of which are particularly constructive impulses.  My rule forces me to shut down the chart for a ticker that I’ve just traded.  It forces me to step back treat every trade as an individual thing.  This was an incredibly expensive lession.

Decide up front how much draw down you’re going to accept:

This would be nice if I could follow it better than I do.  Let’s say you buy a bunch of FOOBAR at $100 having a well thought out thesis that it’s going to go to $110.  You buy and it hits $99.  RED BAR RED BAR.  You start sweating.  $98… oh crap… maybe I botched this one up… $95.. uhm…uhm… SELL!  Phew, that could’ve been bad…. $98..$99…$100…$102…$106… SHIT SHIT SHIT SHIT SHIT!

I can’t count the number of times I’ve stomped around my apartment screaming on the phone to my endlessly tolerant friend, “BUT I WAS RIGHT!”  As if the market gave a crap.

Things correct, the price moves breathe.  Nothing goes up or down without stopping to ask directions and frequently retracing it’s steps.  Make sure you’re wrong before you decide you’re wrong.  Decide up front how much you’re going to endure.  You can place orders up that will automatically dump the position if it goes too far.  That way you remove emotion from the trigger.  If you were wrong about how much to endure at least you TRADED THE PLAN, and you an adjust your rules and have a better plan next time.  That’s VITAL.

There was more but I’d only intended to have a “woohoo I’m doing good!” post, not an expository blather about trading technique.  Maybe I’ll come back to it.

*shrug*

ooh, shiney!

Damn that was good

Friday, January 16th, 2009

Sometimes a Royale with Cheese really is exactly what I want.

OHiTO

Friday, January 16th, 2009

Like I’ve said; sometimes it’s the titles ;)

And Maybe If I Get a Divorce, I’ll Be Twenty Again

Manager to peon: I’m so confused, maybe if I start smoking dope again things will make sense.

Washington
via Overheard in the Office, Jan 16, 2009

Weekday Update

Wednesday, January 14th, 2009

Ok, so I haven’t been around much, I know. Posting the odd YouTube link here and there does not a blog make. No no, this isn’t a breakup talk.

I started “seeing a professional” finally a week and a half ago and I’ve already had those couple early frustrating conversations where I’m forced to chow down on some cold crow. I’m appreciative of the process and honest enough with myself that I recognize it as a positive if humbling experience. Frankly I’m pretty excited about it, scary as it is.

I’m getting better at sensible trading … sloooowwwllly. I’ve got 4 up days in a row, which is a pretty nice run. Even now, before noon (as I write this) I’m deliciously outstripping my target numbers.

Last Saturday I went to a friend’s yearly New Year’s party which is always a blast. It’s way the hell out on the North Fork of Lon Guyland so the ride was quite an event. I hitched along with a couple friends who rent a car for the trip. Being wine people they stop at 4 or so wineries along the way. So I was just sorta tagging along, trying desperately to hold off on tasting. So I only ended up with about a case of wine :-/ ( ;D )

But for someone to help me drink it.

I really need a better foundation of financial stability before I think about that. Now, somewhere in my head there’s a little red flag that says “you’re dodging something” but I can’t really find a solid fault in the logic so I have to stick with it.

Gut feelings can LEAD you to the truth, but they aren’t true in and of themselves.

So yeah, things are good, getting better. I’ve got a couple projects I’m putting serious time in to. Frankly I’m also playing WoW and EvE and enjoying both immensely. They’re both causing me much less consternation than usual. But then I think that’s more because everything else is also.

More later, undoubtedly.

o/

Youtube Links?

Friday, January 9th, 2009

I keep getting that wonky bullshit whenever I use an embedded YouTube link. But I don’t seem to see it on any other WP blogs.

The embed posts ok, but there’s always html cruft surrounding it.

What gives, anyone know?

UPDATE: Yeah. Figured it out. It was my WordPressWikiPlugin. It was wikifying words in href tags. whups.