Thursday, February 14, 2008

Cryptorchild

Went and saw Manson on Monday night. It was a blast. Harry posted his review, which I generally agree with, so I'll save you the babbling.

This week at work has been great. Ken gave us a deadline, and that has put me into overdrive. I love deadlines. Maybe it's the effect that school had on me, but I work best with a deadline. Especially a close one. Much has been accomplished. It mostly forced me to just finish up the tables I have instead of looking for ways to refactor. I like the refactoring better, especially since I still have a half dozen things I'd like to tackle, but it's easy to put off the tables themselves without a deadline for them.

I haven't been doing much in the spare time other than play dota, read, or sleep. I need to go back and visit my grandpa and parents this weekend. It has been like three or four weeks, and with grandpa in the hospital lately, that seems like quite a while. I have just been sick and reluctant to visit in case I infect him. I hear he has been moved to a rehab facility that is quite nice, so hopefully things are improving for him now. (He just had some very major open heart surgery at 75.)

Tomorrow is February 15th! Yay!

I'm still on track to hit financial goals for this month and next. I'm still debating on whether I want to work Spring Break week or take it off. I guess I should check with my brother and see if he still wants to road trip. It would be nice to have the extra week's pay, which would buy me another 24" monitor and the video card I want, but a week off is always nice too. The thing is, I only have about 14 weeks left here anyway, so not like I really need a break.

Tuesday, February 05, 2008

Reflection

Work has been interesting the last couple days, as I have spending about half my time learning about Java's reflection capabilities. I have nearly succeeded in completely generalizing the action code for our Struts app here at work, which to me is a victory. For one, it removes the need to ever write/generate it again on new tables. More importantly, it allows us to fix something in one place in the future, instead of once for each table. I say nearly succeeded because I have one minor issue to address, and really a couple things I'd like to find a cleaner way to do.

Word on the street is that Java reflection is slow, etc. But who cares? If this site was going to be used by millions, it might be an issue, but it's not, and we aren't doing any computation with it, just presenting and storing information. I find the task more meaningful because it solves the more general problem.

I think there are really two styles of coding. One of them solves the immediate problem at hand via the direct approach. I use this all the time when writing some script to parse/scrape text or some other task. You build something specific that solves the problem and get it done. The second style doesn't really come about until you find yourself repeating something using the first style.

The first time I wrote a script in ruby to scrape a website, I just used the built in HTTP library, loaded the page, searched it with a regex and spit out my results. Simple, quick, and it worked. However, about the third time I found myself scraping a page, I realized that I was duplicating a lot of code and really wanted a cleaner more general way. Now if I had been a trailblazer, I would have sat down and written a library to parse html with css selector or xpath support and then used it in my scripts. Thankfully, the people who made Hpricot did this for me.

Using the same code in multiple places just seems like a bad thing. This isn't really an earth shattering idea... it's called abstraction and has been the name of the programming game since the beginning 60 years ago. My point is that I find the enjoyable part of what I do is abstracting. Once you have done the straightforward solution, it is no longer challenging. I have done enough websites to be bored with the straightforward task of putting up forms, capturing input, and saving it. The fun for me writing the abstract system to do it all for me. That was why I wrote that generator to begin with. At the time I was cheating by using my knowledge of Ruby to metaprogram in Java. Now I have learned about how Java does it's own metaprogramming, so I'm trying to make my generator (mostly) obsolete too. At some level I can't entirely do it with Java reflection (building the table objects with reflection would just be too slow as far as I can tell), but I have faith that I can still get rid of a few more things. The xsl file will remain, and the DAO and entity objects, and the hibernate mappings, but I think I still have some low hanging fruit to attack.

Completely unrelated to all this, I have several exciting ideas I'd like to work on, but I'm trying to keep my focus on the project at work. I have problems working on two things at once (or on the same day anyway), and I'd like to leave a good impression here. At least I can tinker on the weekends.

Friday, February 01, 2008

Display Technology

Wow... all I can say is that these two videos must be the coolest things I have seen in a long time. The first one is on Head Tracking for VR Displays and the second Automatic Projector Calibration. The implications for such things are crazy.

The projector calibration technology especially excites me. The fact that it works with unmodified projectors (the magic is in the screen and software) is just brilliant for one. More usefully, this would allow for high quality mobile displays... that are lightweight. Imagine having a 30x24 inch screen that is no thicker than a piece of cardboard. A projector would be mounted in the ceiling of each corner of the room. You could then carry the screen anywhere in the room, at any angle, and have a highly visible work surface. Collaborating with others would be a matter of carrying your screen over to them. Add the touch screen technology in another of his videos and you could do away with the mouse all together... and put a keyboard on the screen and you could type without an actual physical keyboard. If something happened to your screen, no problem, it's cheap cardboard with some optical fibers. All the money is in the projector, which is safely mounted elsewhere. Spill water on it, who cares.

I think the VR tech could be built on to finally make useful 3D television. The only real issue left is making it work for multiple viewpoints at once. But even with only one viewpoint, having fully useful 3D without those silly red/blue glasses would be awesome.

This guy is innovating, and man, is he good.

Wednesday, January 30, 2008

Arc

(I tried to post this a few days ago, but blogger was being crabby.)

So Paul Graham released Arc yesterday... or at least a first draft. From reading the tutorial it sounds like a fun little language so far. It definitely addresses a lot of my annoyances with CL (although I'm so rough with CL I'm barely qualified to make a genuine critique). It just seems a lot more Scheme-ish... and I love Scheme, so of course I will like it.

I haven't gotten to sit down and actually hack away at it, but from what little I have played with, I must say that I absolutely adore the [... _ ...] and composition syntax. It just makes lines so much easier to read once you get used to them. To give a trivial example, (keep [odd _] '(1 2 3 4 5)) is so much easier to grok than (keep (fn (x) (odd x)) '(1 2 3 4 5)) or the CL variant which would be something like (filter (lambda (x) (oddp x)) '(1 2 3 4 5)). (All those examples should return a list of only the odd numbers.)

I got very sick last Thursday with a stomach flu and spent most of the day purging via all available means. Friday I was still feverish and weak, but mostly recovered by the next morning. Missing work will be a punch in the wallet, but oh well, not much I could do. I spent most of the time sleeping when I could, so not much got done on anything.

You know, I really enjoy writing code in Lisp-y languages. I'm not entirely sure why. I think it's the succinctness of it. The initial release comes with a blog implementation of only 107 lines. Yes, an entire blog written in 107 lines of code. That is short.

Today was mostly spent tracking down these two very annoying Java bugs. It would be nice if the stack trace was at all useful in tracking stuff down. Sadly, I have to resort to sticking in println statements pretty much every time to figure out where the errors are. Tonight I think it will be time to play with Arc.

Wednesday, January 23, 2008

Sleepy

So last night I got home and napped from 5:45-7:30ish, then was up until roughly 1:30-1:45. At 5:30 this morning, my alarm went off, and I was in the Rec Center working out by 6:25. I feel quite victorious actually waking up early to go be healthy. The only downside is that the showers in the Rec Center are beyond cold.

Actually, the other downside is that I'm not quite adjusted to this waking up early thing either. The sleepy feeling is already hitting me.

Tuesday, January 22, 2008

Dawn

Last night I went to bed at a slightly early, but mostly normal, 11pm. I had incredibly vivid dreams about being in Spain again, only this time I had to go to high school there. They were very strange. The weirdest thing came at 5:15am, when I woke up and just couldn't fall back asleep.

I got up and had a full breakfast and trolled some news sites. Then I got ready and came to work. I actually got here before the building was unlocked, so I drove around on campus a bit to kill time. At 6:55am I was at my desk, already going.

I am not a morning person, so it was very strange to watch the sun come up.

In completely unrelated news, I read one of the best articles about computer science degrees I have ever seen. I remember being a CS undergrad, wishing that there was more 'real world' and 'applicable' courses. You know, more things like our software engineering class. But now, looking back with good ole 20/20, I can see that the coolest things I learned were Scheme (EECS 662), Operating Systems (EECS 678), and my Kinnersley triplet (EECS 510, 560, and 660). None of these things has direct real world resume value per se, but all of them make me a far better programmer and are far more interesting long-term.

Tuesday, January 15, 2008

A Break

So I took last week off and Kathy and I headed down to Austin for a little vacation. It was nice and relaxing. The weather was great, sunny every day and in the 70s. I finished both Xenocide and Children of the Mind while down in this little cabin on Lake Travis. We ate scrumptious barbeque, saw a great movie, and generally toured all things Austin.

Coming back to the cold was sad, but it had to be done. Unfortunately my Grandpa had a surprise heart attack and general near-death weekend. We went to the hospital in Olathe on Sunday morning expecting to have to pull the plug and watch him go... but after we did that, he actually started getting better. Now he is alert and they are talking about a quadruple bypass surgery and six months of rehabilitation. I hope everything turns out in the end. He has had two heart attacks before this one (in 1979 and 1987), but this really caught us all by surprise.

I have been pretty worthless otherwise. I pretty much didn't touch the internet while in Austin, except to find stuff to do there. Since being back, I've mostly just played dota or watched movies. I've done some general chores/bills/rebates and spent two hours Saturday on the phone with AT&T getting our download speed fixed, but nothing in the area of Lorebroker or the project with Tyler. At least I have been getting things done at work.

Hopefully I'll get back on the ball soon. Only 129 days until my self-imposed summer vacation. It'd be nice to have momentum going into that.

Friday, January 04, 2008

AT&T Dry Loop Finally

So someone was kind enough to reply to my last post about dry loop DSL to inform me that AT&T started offering their Elite service (6.0 mbps down/768kbps up) as a dry loop package on 12/13/07. So I called the number today (1-800-264-0002 for the midwest region) and put in an order to switch my service over. Since dry loop means no taxes or fees on the bill (absolutely none, due to the lack of a land line), that means we'll be saving about $25/mo. Yay!

Wednesday, January 02, 2008

Feliz Año Nuevo

So the new year is here, like every year (don't think too hard about that). Woohoo... I guess.

I never make New Year's resolutions, and I don't intend to start that now. I have been very productive so far. Granted, a lot of that productive energy has been devoted to making decks, sorting stuff, paying bills, and just general ilk... but a good chunk of it has also been spent on making my silly code generator at work even better. It pretty much will set up an entire table (in basic form) with a single command. That probably shaves a couple hours of work off each table. Not bad.

Today also happens to be Jys' birthday... que lo cumplas feliz! I look forward to sushi tonight.

Thursday, December 27, 2007

Oh The Cards

My four day weekend for Christmas went well this year. While most of it was spent running to family/social events, I did spend a lot of quality time sorting cards and making decks. Also bought a whole slew of cards for Bob and I last night. While I already thought of one thing I forgot to put on my list, this purchase will lead to yet more decks, which is happy.

My cards are almost entirely sorted at this point. I think I have about 400 more creatures to go through, which I will finish tonight. It already feels nice to be able to look in an exact spot to see if I have a card. I can still go through them by hand for ideas, but all of my deck building is done by computer searches anyway, so being able to locate cards quickly is really handy.

Tomorrow is another pay day, and this is the one devoted to clearing out the balance on my Chase card before the 0% interest period ends, so not much excitement to be had. I did get to revise my monthly savings goals upwards though, due to the increased saving I can do with my 0% until 2009 Citi card.

Of course, I might have to revise them back down again if I do splurge on that video card and monitor. I am thinking right now that I'll hold off for a bit until they come down in price. It's not like I am dying for a second monitor at home, since I have two at work, where I spend more of my time. I think I would like to achieve that eventually though. Maybe after I get down to Texas this summer.

Friday, December 21, 2007

ruby ftw

So today I got paid (at my Java job) to write Ruby. It was quite productive. Made massive improvements to my code generating stuff with Allan today. Solved numerous issues it was having and we nailed down several other bugs in the Java portion of the app dealing with date handling.

I probably should have written this thing in Java, since this place is supposedly a Java shop, and whoever gets the file after me might not know Ruby enough to be able to change it. Then again, Ruby is downright easy to understand and I kept the idioms simple. Actually, thats a lie now that I think about it. I do some things like using here documents, C style inline conditionals, parallel assignments, block passing, and map function abuse, but it's almost hard to write in Ruby without taking advantage of such sugar.

At least I resisted the desire to write a macro for this one thing that kept repeating. Figured no reason to get too crazy.

Tonight is dedicated to Lisping, as Tyler is coming over tomorrow to work on stuff. Hopefully tomorrow will be a likewise productive day.

Thursday, December 20, 2007

The Best Programmer in the World

Read this rather insightful post from the ancient past (circa 2004) amusingly titled Why I'm The Best Programmer In The World by Jeff Atwood. It really spoke volumes about something I have been trying to put my finger on about my profession... and really his whole blog is really really insightful.

Not sure why I really post it here, as the 1.5 to 2 readers I have probably don't give a crap about programming, but I promise there is no code in that link, just good insight into the people that do it.

Today was a burn out day. Hopefully tomorrow will be better.

Wednesday, December 19, 2007

Java's Worst Enemy

Just read this awesome post by Steve Yegge about code bloat. Be warned: his post is really really long. (But worth the time.)

It ends up turning into an anti-Java rant, but I am fine with that. I remember when Tyler and I wrote Satupoly in Java during EECS 448 and at the time it just seemed like the best programming language ever. It had a ton of libraries to do what we wanted, and was really well documented. The tools for it were all free.

I can't argue with the plethora of libraries, but looking back now, I am kind of ashamed to have liked it so much. I think the reason it worked so well for us is because we hadn't tasted the dynamic language syntactically-sugared kool-aid yet... and because we didn't bother to follow any design patterns (other than good old MVC).

It could also be that Java has just changed a lot over the years. This was 2003 after all. I look at the code in front of me at work, and just see miles of bloat. I have been spoiled by Ruby's method_missing, thanks to which I haven't had to write out a billion getters and setters in a long time. I'm really spoiled by dynamic typing, which just seems so much more flexible and less whiny to me than static typing is. Add to that my love of passing around anonymous functions as data (thanks a lot Scheme and Javascript!) and closures, and Java is really becoming tiresome.

It's just strange now, to view with such derision something I loved so much back then. It's not just the code for this project either. I have tried to refactor it and DRY it up, but it's just really hard to get much out of it. You have to have getters and setters. You have to have big constructors. You have to have silly Hibernate xml files and implement all the CRUD in a frenzy of copy and pasted methods. Just trying to push standardized CRUD down into an abstract base class was a nightmare. Where is my macro to build these methods and add them to the object on the fly? All this explicit casting is going to break my brain. Why do I have to use objects just to hold enumerable options to pass to yet other objects? It doesn't feel like coding anymore, it feels like trying to make a movie by assembling a puzzle for each frame on the reel.

I don't think any language is really objectively better than another, let alone that one of them is the best. I do, however, think that, subjectively, Java is really excruciating... for me.

Oh, and I failed last night on doing something not-behind-the-scenes. I did however hack together a really neat HAML plugin that I hope to show off once I add some more features. It literally made my night when it worked.

Tuesday, December 18, 2007

Endless Coding

Yeah, I program a lot.

Today I had some fun in Javascript, generated Java with Ruby, and refactored Java code itself. I must say, I have always enjoyed programming in general, but this daily mishmash of several languages is the greatest mental workout in the world. It's not necessarily hard so much... it's just very mentally stimulating.

Tonight I get to go home and work more with Ruby and Javascript. Not entirely sure which feature I will choose to tackle on my list, but I'd like it to be something that isn't entirely behind-the-scenes for once. Last night's feature of choice was a Firefox search plugin, which is only semi-behind-the-scenes.

I have been moderately annoyed by haml too. It's really hard to write a decent block of javascript inside a haml template because it keeps wanting to interpret it (or the indentation). I have an idea though, which I am going to try tonight. I'll have to get back to you on whether it works. I really hope it does, as it would massively clean up my code. (Very massively. Yes, very.)

Anyway, it's about time to get out of here.

Thursday, December 13, 2007

Limitless Potential

I must say, the fan remixes (called Limitless Potential) of Year Zero might be even better than Y34RZ3R0R3M1X3D (the official remixes). I'm particularly in love with Capital G (Streetlab Mix).

Tomorrow is payday, and this payday is even better than most, because it all goes into savings. That means I am now only $9000 short of my goal. Unfortunately, this is the last time I'll get to save anything for about a month, as the next paycheck is dedicated to rent and my Chase card. Oh well, I should just barely make my end of the year goal.

Speaking of paychecks, I did a dangerous thing the other day. While I definitely plan on having a summer vacation this year, I figured up that if I had a least a token job next fall (couple days a week at Borders ftw), I could stretch my underemployed-become-the-best-programmer-ever period for well over a year and a half. At that point, I hope to either have hit a home run with one of my projects, or be back in grad school charging into that PhD mire. Either way, that means this might be my last cubicle job for a long time.

I could definitely live with that.

Wednesday, December 12, 2007

Ice Storm

So the supposedly world-ending ice storm didn't really pan out. It basically got just icy enough to make the trees look cool and the sidewalk slippery. I'm kind of disappointed. Who doesn't like a couple days of simulated apocalypse?

Man I miss my coke. On the other hand, Ceylon Tea is the win.

So I have been utterly worthless these last three days or so. Haven't really done anything, productive or not. Last night I came home and fell asleep at 8. The night before I wasted on a few games of dota and who knows what else. Sunday I just didn't feel like doing anything. Thankfully I woke up at 2pm that day, so there wasn't too much time to waste doing nothing. In my defense, the reason I woke up at 2 was because I stayed up until 9am working on Lorebroker.

Hopefully tonight I'll feel a little more useful.

Tuesday, December 11, 2007

Quote

For some reason this quote really struck me. Maybe it won't have the same effect for you out of context, but I think it's insightful.

"[A]ll human systems are gamed, for reasons rooted deeply in psychology, and great skill is displayed in the gaming because game theory has so much potential. That's what's wrong with the workman's comp system in California. Gaming has been raised to an art form. In the course of gaming the system, people learn to be crooked. Is this good for civilization? Is it good for economic performance? Hell no. The people who design easily–gameable systems belong in the lowest circle of hell." - Charlie Munger
Wonder how he feels about politicians?

Thursday, December 06, 2007

Nieve!

(That means 'Snow!')

So I knew that we would have some crappy weather this weekend, but I definitely didn't expect Mother Nature to lead off with snow. While I generally hate all cold weather (anything below 80 is cold), I couldn't help but enjoy the snow while walking to lunch. But I think that was mostly because the whole visual experience meshed really well with disc 2 of And All That Could Have Been.

I tried to get to sleep at a decent time last night, because I was supposed to have a meeting this morning at 9am and I wanted to actually get here on time. Unfortunately I couldn't actually sleep and ended up working on Lorebroker again until 1am. I didn't accomplish anything in the way of new features, but I got the three Urza sets loaded into the database. The apostrophe in their names had led to failure in the past, only I had never noticed.

I also wrote a script to normalize the card types into three separate fields (supertype, type, and subtype). While I got that done, I didn't get anything changed to take advantage of them, so didn't bother uploading it. In the process I learned that disabling ferret index updating when doing mass db manipulation like that can cut update time by a factor of 10. (Enough so that it's worth disabling and just doing a complete index rebuild.)

Between work and Lorebroker I am programming about 16 hours a day. Granted, it's not like I am furiously churning out code that whole time (a surprisingly large part of my day is spent staring at a legal pad and thinking out my next move), but I am definitely in a chair the whole time. It's amazing how my legs feel tired after sitting so much. I definitely can't wait till spring semester so I can go work out at the Rec Center after work. Now that the project with Tyler is starting up, I'll be working on three big things and writing in seven different languages (if you count html, css, and sql as 'languages' ... which might be a bit of a stretch).

Oh well. After spending several years being a worthless bum, it's nice to exercise the mind a bit again.

Wednesday, December 05, 2007

Strange Night

Last night was strange, but generally good.

I got home and sorted my green creatures. (Yeah, I still haven't finished the sorting. All those new cards I bought distracted me.) Then watched a bit of TV. Then started working on some ideas I had for the jQuery UI Dialog library I am using. After submitting two patches to them, it was 12:30 and time for bed.

The strange part was how incredibly awake I was. It took me quite a while to fall asleep (probably 20 mins, versus the normal instant-I-hit-the-pillow), and I woke up probably every 30 mins all night. And not just that quasi-alert-then-back-asleep type of waking... I'm talking full awareness.

Most of it was probably the wind, which was blowing at a steady 35mph and gusting to 50mph all night. Our bedroom is on the northwest corner of the apartment, which is exactly the direction from which the wind was blowing. It was loud and the lid on the bathroom fan exhaust kept clanging. At about 4:30am it got so loud that I went to check the weather, just in case we had some kind of freak unheard-of December tornado.

Of course, being so awake at 4:30am led to me working on Lorebroker a bit more, but I managed to pull away after only 40 mins. The rest of the night (all three hours of it) was equally wakeful.

The really weird part is how rested I feel. I haven't had coffee in two days and I just feel very alert. It's kind of nice.

Tuesday, December 04, 2007

jQuery is fun

So I spent a deliciously nerdy weekend working with jQuery and the new jRails plugin that transparently inserts it in place of Prototype/Scriptaculous. The framework itself is much smaller (by about half), and it is a dream to write in, since the syntax is downright simple. It actually kind of reminds me of my original love of Scheme. I just have a thing for simple (yet flexible and powerful) syntax. It looks nice, and just Feels Right™.

The UI elements show particular promise, but seem to have a ways to go. For one, the release versions are way behind the latest development versions, and the dev versions are definitely what the demos on the jQuery UI site uses. This is only really a problem because the dev versions aren't packaged for you, so you have to run around grabbing files if you want to use them. There is also enough difference between the release and dev versions that the docs (which are up with dev versions) are often unhelpful if you are trying to use the release code.

Whew. So basically I learned to just go find the bleeding edge stuff, and ignore the 1.0 code.

There also seem to be a lot of IE related issues. When I tried to open Lorebroker using IE7, I got some strange Operation Aborted error, with basically no graceful failure from which I can debug. It literally acts like the website is down or something. Not entirely sure how to tackle that, short of just giving IE the finger and ignoring it for now. Why can't Microsoft make anything work?

In work related news, I was thinking about the overall goal of this project we are working on, and it seems like we'd save an awful lot of time just using Rails for it. They made it pretty clear to me that they are a Java shop though, so not much hope for that. However, today as I was pondering, I remembered our early efforts to make a page builder at my last job. This project would be much simpler to do, and there is no need to get fancy and make a meta-circular editor, so I think I might work on writing a bit of code generation stuff to automate a lot of what I am doing. Any reduction of copy and paste would be swell.

That has been an ongoing process all week (reduction of copy and paste). I have always been against anything that felt kludgy, and copying and pasting code so you can change class names and database columns seems kludgy to the max. I've already abstracted a bunch of the DAO operations and shortened a few other files, but when it comes to the xsl files, they really need to be generated. Thankfully, they are fairly simple, so I have lots of hope for easy success.

I tell you what... I really miss macros right now. Darn Java.