Posts Tagged ‘Programming’

finally FINALLY!

Friday, March 13th, 2009

The keyboard/mouse combo built in to my mactop is just enough of a pain in the ass that I never used the damn thing, not really.  Oh I’d keep it running so I could use it as a second monitor while trading (more on that in an incoming post) but I never really used the thing.  

Trackpads just really suck.  Yes, they’re all clever and everything, but they really just don’t get the job done for me.  I need a mouse that has buttons (which are buttons and not “sensitive areas”.  It’s not a woman, it’s an input device.)

So I finally unbolted the video cable from my Dual G4 (remember THAT? no?  You HAVEN’T been reading me for 7 years?  hmmpf.) and plugged it into the side of my mactop, along with my nice spiffy macally keyboard and some mouse I had in a box called “The Mouse” which seems to be made by a company called MacMice.  It sucks by the way.

Mr. Bernstein will likely be pleased to know that what’s motivated me to do this is Tinderbox.  In all my bizarre casting about for an organizational system (both on line and off, electronic and paper) that works for me, knowing I have Tinderbox sitting on a mactop that’s for all intents and purposes functionally useless to me was driving me out of my mind. And, since it doesn’t look like Eastgate is going to get to Tinderbox for Win32 this decade (relax Mark, I’ve been a developer for 30 years I actually DO know how it is) I figured it was time to get to it.

So now I’ve got all these weird key combinations I have to learn all over again (whether or not I ever really knew them to start with is a matter of … eh, no it’s not.  I didn’t.)

But this should work.  I’ve signed up with MacHeist for all their goodies “and stuff” (in joke, not with MacHeist.)  So here we go.

Now I have to cast about for “the right things to have installed.”  TweetDeck is already on here (it makes for a great “2nd monitor” application) though it had some serious stability problems on this platform (whether it was TweetDeck or Adobe Air I neither know nor care.)

It feels good to have set this up.  Due to the wonderful lag in the gaming industry (driven by sensible market forces frankly) I can take working on this machine far more seriously than on my big gaming rig that’s become my primary machine.  The distractions here are at least interesting ones.

Let’s see… where’s that xcode icon…

 

Simple Tricks and Nonsense: A brainstorming post

Wednesday, March 11th, 2009

Blog needs a major overhaul.  I really like the bliki idea (blog/wiki) as it seems the only sensible way of automatically cross linking content such that it remains accessible.  This foolishness of blogging being forceably time linear is as stupid as using cassette tapes for music.

It’s time for me to get back into IT.  Trading isn’t working and, more importantly, I don’t really care about it.  At the end of the day, even if I’ve traded remarkably well the only thing that’s different in the world is the size of my trading account and some femto-modifications to the price of certain instruments as an affect of my involvement.  Money is a necessary motivation and I’ve enjoyed tremendously having lots of it in the past but I’ve never been deluded by it’s value into making it my primary motivation. (Actually, that’s not true. There is a time I chose money over enjoying my job, before I’d had any idea what it was like to have money.  I did make the best decision I could have back then.  Frankly it’s only now, 10+ years later that I’m coming to terms with the fact that I can’t reasonably have expected myself to have made any other choice at the time.)

I say “get back into IT” because while I’ve just started up the job search engines, I’m not married to programming.  It seems to me that this would be a really great time to shift gears a bit.

In a perfect world I’d work on small (time) scale assignments in a hired-gun capacity.  Historically I’ve been far too easy to bore in a noncompelling project.  I’d rather come in with a full head of steam and grind for 6-12 months and leave having done a damn good job.

The Agile/XP Coach job was an interesting experiment because it really shined a light on a great deal of untapped potential.  But it was ultimately doomed to failure as a large-scale teaching job.  Piecemeal and small scale classes, training, pairing and tool creation and setup were wonderful.  When it came time to actually fly half way around the world and do 3 weeks of training, I simply wasn’t ready for it and bowed out, which was unabashedly the right thing to do.

No matter where I land, I simply can’t go through a day without making something any more.  Hell, even in my horrible heroin like addiction to MMOs I spend most of my time “crafting.” But I do very well with small scale quick hit tools and programs.  Everything from protocol ‘breakout box’ taps for testing purposes to banged out html screen scrapers and even mini gui apps that help me get through the day.  I churn these things out all the damn time.  Unfortunately I’ve never been quite focused enough with job responsibilities to be a top tier perl or python scripter in a unixen environment, otherwise there’d be that facet open.

For now, my job search is on autopilot, dice, monster, hotjobs, a couple really great recruiters (yes, they’re out there.  There are a couple who didn’t get their job by failing the ethics exam to be used car salesmen.)

I want something a little different though.  Something that plays to my strengths, but seems to me to be a fairly odd niche.

On To!

I KNEW I should’ve gone the extra mile

Wednesday, March 11th, 2009

Last year I spent a fair amount of energy importing my old posts from other blogs into here.  It totalled a little over 3000 posts spanning 6 years.

I still see incoming references to old uccu urls.  It wouldn’t have been SUCH a nightmare to accomidate that.

The way to do it would’ve been:

- Tag the old posts with the old post id and ‘uccu’

- Add a rewrite rule to the magic whatchamacallit file that would redirect all the /uccu/*html links to a cgi.

- Add a cgi that redirects to a WordPress searche for the post number from the intended url and ‘uccu’.

- Tada!

But I didn’t tag the uccu posts.  After seeing what happened when I tagged the old radio userland posts (massive proliferation of tags and an OldRadioBlog tag) I thought differently.

Well that was wrong.

Now I’ve got people who are getting cached google results coming in to this site and landing on the homepage, which is almost certainly the last thing they want.

Yeah.  Looks like it’s time to do some site work.

C++ STL container of templated class objects failing?

Monday, February 16th, 2009

Check this out:

 1: template <class T_>
 2: class SimpleTemplated
 3: {
 4: public:
 5:   T_ i;
 6: };
 7:
 8: template <class T_>
 9: class Container
10: {
11: public:
12:   typedef SimpleTemplated<T_> Composite;
13:   typedef std::list<Composite> Collection;
14:   Collection l;
15:   void run()
16:   {
17:     Collection::iterator iter;
18:   }
19: };

Here’s the pretty colorized version

Line 17 fails compilation (g++, cygwin, vista) saying

scrapyard.cpp: In member function 'void Container<T_>::run()':
scrapyard.cpp:17: error: expected `;' before 'iter'
make: *** [scrapyard.o] Error 1

Anyone? ANYone?

If I change line 12 from:

12:   typedef SimpleTemplated<T_> Composite;

to

12:   typedef std::string Composite;

it works fine of course.

It’s not a direct issue with the stl collection class either. I’ve also tried vector, as well as attempting creation of const_iterator and size_type, all with the same result.

Something about the SimpleTemplated template class is preventing me from declaring a var of a type defined within the containing collection class instantiation.

Pulling my hair out. (This is what happens when I come back to c++ after a year or two off and try something like this first thing. *ugh*)

Back again

Wednesday, February 4th, 2009

It’s clearly time again for me to set up a little agent process server machine on my wee little network here.

Watching twitter has caused all kinds of old ideas to re-sprout, and they’re things that would be quite beneficial to my trading as well.

Twitter seems almost like the command line to the internet. There seem to be as many bots out there as there are people. Things that search, reflect, etc. Weirdly coded commands provide a whole metalanguage in twitterland. Fortunately I feel fine getting excited about it because none of it is the slightest bit new.

But I’d love to have something that put a page together with panels of links (ALMOST like frames) as people who I’m following post them. Of course, html frames is a pretty crude way to do it… but it would sure work.

There are the better part of a dozen more of those kicking around inside my brainskull, but that’s the only one I’ll drop for now.

Now I just need to go find my mac mini and bolt it to the backplane under my desk that my cables are all zip-tied to.

l8r o/

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.

GUI C++ TDD

Sunday, December 14th, 2008

Mocking out native gui control classes for testing is a righteous pain in my ass.

I’m just sayin’ yo.

Fits and Starts

Sunday, December 7th, 2008

By looking at my last half dozen posts it oughta be clear that I’ve got something in the pipe. It’s not going to set the world on fire, but it is going to put a stone on the ground I can stand on to help me reach the torch.

But I find it nigh imPOSSIBLE to write software when it’s light out.

It’s always been true.

I try all the environmental tricks. I put on the Buddha Bar playlist (great for working to.)

But now matter what I try it’s as though I’m uberADD during the day. I’ve been forcing the issue this weekend, which is tough. But I have to get this application to the DogfoodStage soon or it simply won’t have enough momentum behind it and it’ll be relegated to the boneyard like so much else.

C++ TDD ROFLMAO

Saturday, December 6th, 2008

When doing TestDrivenDevelopment with your own homebrew xUnit test framework that uses extensive exception handling for test failures, don’t flip out when, while running the test app in the debugger, the debugger breaks a nail screaming about thrown exceptions.

Then definitely do NOT spend a half hour looking for errors in the library code.

I’m just sayin’ yo.

Well it’s good for a yuck anyway.

I’m glad I’m working on this project. My chops are clearly still there, but I’ve forgotten so much of the plain old stupid shit that just happens.

I don’t know how far I’m going to get on this project over this weekend, since I’m at least as likely as not to see something shiny. So I’m not going to start pumping it up yet.

default CType bad in gui but not console?

Friday, December 5th, 2008

I’ve been cruising along developing this app in Borland’s C++ Builder when I ran into the strangest stumbling block.

When I open an ofstream in the test application like so:

std::ofstream outFile(”foo.bar”);

everything works just duckiliciously.

However, when I execute the same line of code within the context of a gui app’s menu save event trigger, I get a huge explosion.

Over the last 45 minutes I’ve been back and forth, tracing it through and I’ve come down to a problem with the locale. the getloc() method in std::ios_base (which is just returning a dereferenced _Ploc) is crapping out all over the place, as if the default _Ctype doesn’t exist in the context of the gui app.

Is there some kind of standard library initialization that’s going on in the console app that isn’t going on in the gui? I’ve been pouring over the build and link options and everything SEEMS ok. But I have to be missing something.

“Oh yeah, development’s going great. I mean, aside from the fact that I can’t get it to SAVE” doesn’t work.

As a goof, here’s the stack:

std::ios_base::getloc(this=:0012FB48)
std::basic_ios >::widen(this=:0012FB48, _Byte=’ ‘)
std::basic_ios >::init(this=:0012FB48, _Strbuf=:0012FAF0, _Isstd=false)
std::basic_ostream >::basic_ostream >(this=:0012FAE8, _Strbuf=:0012FAF0, _Isstd=false)
std::basic_ofstream >::basic_ofstream >(this=:0012FAE8, _Filename=:004071F6, _Mode=2, _Prot=438)

UPDATE: Well I’ll never run in to this problem again, so I’ll put the answer here just in case I’m wrong about that too.

The call to the std::ofstream constructor in the gui app was taking place inside a dependent library that had options incompatible with the gui application itself, but not with the console application. So in one case it was using the correct (read: matched) ctype and locale information and in the other case it wasn’t.

Pulling it out of the library (where frankly it didn’t really belong anyway, I was prematurely optimizing) into the main project worked just duckiliciously.

I’ll bet you all were really worried huh?

HugeHonkinConsole

Thursday, December 4th, 2008

This is going to be the working homepage going forward for the HugeHonkinConsole project.

The HHC project is a pie in the sky project I’d brainstormed back in the day. The original post (which is a bit dreamy in it’s scope) is here.

The idea is that I want a central information resource that is primarily a server based application which is very active in aggregating different types of information which then digests and represents it in an easy to consume format.

There are an awful lot of additional facets, but that’s the one I’m focused on now. I’ve started (again) building a prototype based on a simple RSS reader and I’m adding some abstractions to it so that it can support a bunch of disparate data formats.

We’ll see.

WordPress Plugin Clash

Sunday, November 23rd, 2008

I’ve got to tackle the clashing of my two WordPressPlugin scripts.  On one hand, there’s the simple regular expression issue of mixing render-time processing transforms that create href tags out of plain text (nesting them is really icky.)

But what I had NOT anticipated is the fact that php or WordPress (I’m not sure which) imports the plug-ins into the same namespace, so I’ve either got to give everything retarded prefixes, ‘class’ify the code for namespace partitioning, or use a common library (taking the plugins away from OneFilePerScript land, which I don’t like at all.)

Merging the two plugins is not an option, even though it’s the simplest technical solution available.  The difference between the two at this point is really about three lines of code.

I suppose that simple fact dictates the solution.

Ickypoo.

My favorite piece of code

Saturday, November 22nd, 2008

(note:  WordPress chokes on the shebang, so consider it implied.)

while :
do

make clean
echo
make test
echo
echo
echo “…resting…”
echo
echo
sleep 5

done

That little block of nonsense has changed (improved) the way I write software more than any single other thing.

This is another post

Tuesday, November 11th, 2008

It links to the previous post “This is a post” just by virtue of the fact that I put that title in quotes in the edit box in WordPress.

This is a piece of functionality I miss from Radio Userland.

This is a post

Tuesday, November 11th, 2008

This post will be linked to by the next post by merely putting the name of this post in quotes.

It’s a test of my new wiki-ish wordpress plugin.

Scripting Language IDEs?

Tuesday, October 28th, 2008

Lately I’m finding myself doing an awful lot of large scripting projects lately in a variety of languages. PHP, Perl, Python and a smidge of Ruby as I try to figure out WTF the deal is.

I’m generally an XEmacs based programmer but I’ve got to say, I’m becoming spoiled by a lot of the advanced integrated features in modern compiled-language IDEs. The funky searching, code folding, refactoring, plug-in …err… ’stuff’ that’s in Eclipse, Visual Studio, Borland’s IDEs, IntelliJ, etc.

Any ideas? I might try and re-evaluate the Komodo IDE.

But maybe there are enough Eclipse plugins to make that worth trying. I don’t know though, eclipse is a bit big to wrap my head around casually.

Writers have the cleanest closets

Friday, October 24th, 2008

Not the emptiest, mind you. That’s different.

RadioUserland had a feature I really loved. Well… it had several (and it’s craptasticular language wasn’t one of them.)

If you typed “a phrase in quotes” it would look through all of your blog post titles for that phrase. If it found it, it would automagically turn the quoted phrase into a link.

I was shopping around for a WordPressWiki plugin and came up with something called “Blicki” which doesn’t work and hasn’t worked in some number of versions. But I figured, how damn hard can php be?

It didn’t really have much that would help and a lot of the library functions it relied on in the WordPress codebase either aren’t there or don’t behave quite the same.

After about an hour and a half I have the thing done. With the comment header it’s 66 lines from and not so bad if I do say so myself; especially considering that it’s a first php effort.

I’m going to use it as a basis for expanding in to a full blown wiki plugin, so I’m not planning on dumping it out into the world at large in it’s v0.1 state.

But if anyone’s interested in it in the meantime, lemme know. I don’t see any reason not to shoot the file over.

A unified platform

Monday, October 20th, 2008

Having a bunch of time to myself causes the thought engines to start up again.

My life is, not to put too fine a point on it, a disorganized mess.  That’s ok, it’s largely to be expected given my complete laxity this calendar year.  But my dissatisfaction with it has gotten me back up towards a critical mass that I usually associate with being dramatically overcaffeinated (pssh, as though such a state could exist *twitch*.)

Last night I spent about a half hour (doesn’t sound like a lot of time, but…) with a pad of post-its and a blotter pad (big 17″ wide desk pad.)  I was just brainstorming a bunch of life organization things “apartment clean” “baking” ” get laundry” “learn russian” etc.  and as always, once I got going, I ran out of space pretty quick.

But one thing I kept coming back to is this idea that pervades organizational systems all over, and that’s a calendar/tickler file to keep track of scheduled tasks, events, and deadlines so you don’t have to.

I thought I’d give it another shot so I started looking around the internet for calendaring software I could live with.  So far I’ve got Sunbird, the mozilla one as the “least bad.”  I tried “Lightning” the add-on to Thunderbird (I use the Mozilla “Eudora” codebase for email, which is actually Thunderbird with some tweaks) and it doesn’t really work so well.  Sunbird is passable, but it’s exceptionally mediocre.

Having everything online is cute (for solutions like Google Calendar), but I don’t want to have to connect to the internet every time I want to get an update a mobile device.  I could see using it as a backup, but not a primary point of reference.

Outlook is right out, primarily because of it’s unreasonably heavy weight process footprint and perfectly opaque persistance format.

I keep coming to this horrible notion that I’m going to have to write something.

a bit of blather

Friday, September 5th, 2008

I’ve gotta say, I’ve been growing increasingly frustrated and malcontented with myself lately. One of the unintended consequences of working for myself trading is that I’m not really doing much creatively any more. At least when I was programming, before the xp coach switch, I was contributing cycles of my brain to a project. Sure it was a dull project, but there were more than a couple interesting problems that required some thinking that wasn’t altogether straightforward.

On the trading side, I’m finally getting to a point where I have some reliable success ratios. But even at it’s most sophisticated it seems to boil down to “See that? When that happens, and this is doing this, and that thing over there looks like that or like this, then hit that button and you’ll get free bacon.”

Now I like free bacon at least as much as the next guy. But the interesting part of trading is figuring out what all the things are to look for so that you know when the button would turn green. It’s mildly interesting. It’s certainly challenging. But what it’s nothing close to is creative. Honing the process consists of adding rules so that you can be more and more sure that you’ll get bacon.

Then, over time, your bacon works with you to help you get more bacon with each “gimme bacon” button press.

Yay bacon.

Strewn throughout my apartment are books about programming, the headiest most creative thing I can think of. On my various hard drives are millions of lines of code that have come out of my head over the last 15 years. Sure, most of it is schlock that I could reproduce in remarkably short order. But there’s some good stuff in there.

I’ve got journals, notebooks and textfiles full of ideas plots and plans for all the great things I was going to do and write.

And every once in a while I say “oh fuck it” and I close down the trading software and open xemacs (remember xemacs? I wonder how Sacha’s book is coming) and I stare at the blinking cursor…then go run through HL2 or Crysis either on “freaky nobody survives this difficulty” mode or “bouncing a bunch of tennis balls on the keyboard would finish these games in an hour” mode; and I yawn through them.

I’ve gotten so far out of the creativity habit that I don’t even post here any more. Not really.

Sure, this is an exception. But eyeball the word count. It’s really quite an astronomical exception of late.

I didn’t want this to happen even though I watched it as it did, and did nothing.

Now I could end there, put my wrist to my forehead and mourn how hard it all is, but it’s not. It just takes a bit of determination. The easiest thing to motivate against is adversity. Unfortunately that doesn’t really work so well when I’m in a comfort zone. Things are going pretty well by anyone’s reasonable estimation. It’s just not good enough. (I’m not known for my reasonable self-expectations; a trait which backfires rather spectacularly.)

There are a couple of approaches I can take I think

(sidebar: anyone out there have a eee pc and notice that keys sometimes double-strike? I get duplicate letters and symbols every once in a while.)

I can set aside scheduled time for doing stuff. That doesn’t sound like a bad idea. My trading success is biased to the first hour or two the market is open in a way that even I can’t ignore. Scheduling noon to 3 in the afternoon to do other stuff sounds like it might be fruitful. Also on the table is taking one day a week off with the same purpose.

I do feel like I need a project or three to get going on. There are a couple applications I’ve been meaning to write and some toy type code I’ve wanted to explore. (The imminent release of Spore has got me thinking about playing around with AI again. Nothing terribly complicated. I just want to see what I can do.

There’s also the hardware projects. The arduino orb was something I’d had almost fully wired, but then lost steam.

See, one significant problem is that I don’t KNOW anybody who does any of these things. Sure, I could go hang on #joiito again (and probably should… I can’t believe I’m saying this: “for my sanity”.) But I need to sit in a room (bar) and get myself all worked up in to a froth about creating, building, writing.

Perhaps meetup.com is a decent place to start? There’s the MakeNYC guys too. But I don’t know if they meet with any frequency.

A plan. I need a plan.

Because I know what happens: The inertia of creativity will drive me very far, once it gets rolling. But I need help with it.

And, as expected, I get to (what I hope is) the bottom of this post and I start thinking about how much I wish “meetup.com” would auto-link and “MakeNYC” would link to a google search as it’s what amazon refers to as “statistically improbable.” And how “statistically improbable” should search the site for a previous post of the same title if it’s there, and auto-link it the way Radio Userland did.

I wish I had all the old “Universal Church of Cosmic Uncertainty” posts up here instead of just the old 0108194 posts.

See what happens? ;-)

well that’s interesting

Monday, June 23rd, 2008

ya know, beinghaving been a fledgling Extreme Programming coach for the better part of nine months, one of the thing I was really sure of was that ifwhen I stopped, that I’d be engaged in all the funky tools and practices. xUnit, resharper, Fit and FitNesse, eclipse, etc.

But frankly? I came across some rss subscriptions and came out with an audible “yucchh” noise.

couldn’t possibly care less.