gist JS

Sunday, November 27, 2005

getting down to work

So, the real purpose of the new machine was to learn about all the cool new web frameworks work. Yeah, I know it sounds a lot like programming in my free time, doesn't it?

1) Write web-app using Spring, Hibernate and either Spring MVC/Spring WebFlow or JSF.
2) A+++ coding practices the whole way, ie Design it in UML & fully TDD. (eep!)

So let's do it to it!

Eclipse SDK 3.1.1
(We'll wait on 3.2 until MyEclipseIDE supports it)

Unzip to c:\Program Files
Now download:

From eclipse.org and extract all of them to Program Files. It's a bit weird, but just make sure that you'll overlay the eclipse directory over the existing eclipse directory so everything lines up and OK the overwrite. It won't hurt anything.

MyEclipse is pretty darn nice for a lot of things although I haven't fleshed it all out yet. Primarily I like it's Hibernate features and the DBExplorer. Oh, and $29 a year is such a soothing price point. I probably struggle along if it cost $60 but for the price I'm all theirs.

Go do the myeclipseide.org download of 4.0.

Then update to 4.1m1 with the directions here.

Fire up MyEclipse and everything's good to go...

Can't do anything without CVS right?
cvsnt- from cvsnt.org is the trick for Windows. Pretty easy to setup too. Only trick is putting your repository in an easily backupable place.

Open the CVS perspective in Eclipse and add the repository. I did a pserver connection although apparently there's some real security issues if you're going over the net. We're not, so bada-boom.

Postgres Database
Now a little postgres vs mysql debate... settling on postgres, mostly since we use it with success at work. More comments here...

Definitely 8.1 ...

First off it conflicts with some SSL dll's from CVSNT. Clicking ok and proceeding... We'll see if that comes back to haunt us. Now we run into a bit of confusion with the users. I've ended up with a windows services user with name postgres, but the randomly generated password has characters I can't even find in charmap.exe. Eek. We'll hopefully not a big deal.

Ok, running pgAdmin III from the start menu and I create a new DB. Darn I wish I remembered more about templates... anyway, template1 and 'go do it', but first I make a new user a\so that we're not doing everything as 'postgres'

Sigh, but now I'd like to use phpPgAdmin. It's darn nice for viewing DB guts. Sadly this means apache and php installs as well. Such is life though, right?

apache's easy, download the most recent here, and do an easy windows install.

php. Make sure to do the zip package/manual install if you're going to use apache. Other wise no love. php-5.1.0-Win32.zip is what you're looking for. Files here.

Extract this to C:\Program Files\ and change the directory to just be PHP.

Read the install and we end up copying php.ini-recommended to just php.ini.
Apache2 looks like it'll do the PHPRC environment variable for us...

Next we add to our apache/conf/httpd.conf file right under the rest of the 'LoadModules'

PHPINIDir "C:/Program Files/PHP"
LoadModule php5_module "C:/Program Files/PHP/php5apache2.dll"
AddType application/x-httpd-php .php

Fire up apache by running cmd, and run apache/bin/apache start, and this should go off no problems.

Back to phpPgAdmin...
Now, we download the phpPgAdmin-4.0 zip, throw it in htdocs, add a little
<Directory "htdocs/phPgAdmin-4.0">

to the httpd.conf file...

goto and....

404. Durnit. Clearly I don't understand apache config yet in the 2 minutes I've devoted to it.

[Sun Nov 27 18:37:14 2005] [error] [client] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/phPgAdmin-4.0

but it does. hmm. ahah! notepad.exe saves the day again shows us:
explorer: C:/Program Files/Apache Group/Apache2/htdocs/phPgAdmin
error.log: C:\Program Files\Apache Group\Apache2\htdocs\phpPgAdmin
silly p's.

now we get:
Your PHP installation does not support PostgreSQL. You need to recompile PHP using the --with-pgsql configure option.

hah! as if we'd even compiled it to start! fine fine, you can say we should slow down and think of these things before we start, but I say bah. Look how far we've got. (and how insecure we presumably are, but... well no but for that one really.)

Back to PHP...
So, back to the php manual install. Which talks about windows extensions here...

And we're off, back to php.ini and it's easy:
change extension_dir = "./" to
extension_dir = "c:/Program Files/PHP/ext/"

and uncomment
like so

restart apache and.... wahoo! at PHP enabled.

Now, login as the 2nd postgres user that we created. I noticed that it said logging in as postgres or admin won't work unless you muck with the .ini more for security reasons. Worksforme.

DB/Eclipse integration
Back to MyEclipse and let's plug her in.
Window->MyEclipse DB Exloperer.
DB Browser->New DB
Driver Libraries->New @ PostgreSQL\8.1\jdbc\postgresql-8.1dev-403.jdbc3.jar
ExampleURL: jdbc:postgresql://localhost:5432/yourDB

Hmm. No love again. Can't login as my DB user. Ahah. Can login as the postgres user. That's unfortunate, but oh well. Looks like we're ready to ORM to our hearts content!

Tomcat. Since we'll surely want it.
Ok, we'll probably want Tomcat too right? Ok download 5.5 whatever. This install's pretty easy up until the 'Admin application'. If you just do what you'd expect, you end up with a big fat "Tomcat's administration web application is no longer
installed by default. Download and install the "admin"
package to use it."

So, off to the web and....

Re[5]: tomcat management and Tomcat Administration
Steve Russell, May 27, 2005 [replies:5]
Hi, I was also unable to find any instructions on how to do this, but I managed to integrate the admin package by doing the following:

1. Unzip jakarta-tomcat-5.5.9-admin.zip & copy conf\ and server\ folders and contents over your own Tomcat conf & server folders (into CATALINA_HOME folder)
2. Copy CATALINA_HOME\server\webapps\admin\admin.xml to CATALINA_HOME\webapps\admin.xml
3. Add a line to CATALINA_HOME\conf\tomcat-users.xml to allow a user to login to the manager & admin modules, e.g.:
4. Restart Tomcat


Which fixes it very nicely thank you Steve. Frankly it confuses me a bit about how Tomcat really works, but hey.

Disregard the above. It works, but as with most things that work even when you don't quite think they should, it's a bad idea. The real problem is that there's a C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\admin directory that's stealing your thunder. All you need to do is wack this guy and it'll stop taking priority over the server\admin directory. Yes!

Back to eclipse, J2EE perspective, servers... add our new tomcat server, which requires going and finding the sdk. Easy enough.

So what do we have now?? Well, we're just about ready to rock. Next up will be design ing the structure in eclipse and then looking at the best ways to instantiate our model in the database and within our spring framework. Hopefully it can go:

UML -> POJO -> Spring Beans -> Hibernate Mapping -> DB tables

We'll see what the state of the tools are, and how much typing this will take....

Wednesday, November 23, 2005

civilization 4

Well, now you've gone and done it. You've wasted another perfectly good 12 hours of your life playing civ 4.

A little background though. I'm not a super gamer. I'm a normal guy. I have friends. I get to work by 9. (ok so 9:15, but if I'm too tired to work before then it's not useful to be there, right?) Let's list a couple hypothetical things that it would be highly unusual for me to do:

  1. Wake up at 7am
  2. Get to work at 11:15
  3. Bail on a cool party
  4. Go to bed at 4:30am
  5. Get to work at 11:30

But this is just what civ4 has made me do. Maybe I should put up a neato little graft of my 'get in to work' time.

Anyway, yes, it certainly has that 'just one more turn' thing. I laughed when I heard that there's now an alarm feature, but perhaps I should look into enabling that.

The game is probably the best yet, although I've just completed one game so far. There's definitely less focus on micromanagement, which seems like a pretty good thing, although it did leave me feeling a bit like I wasn't in total control. Enough of the game mechanics are different that I had no problem letting the AI sort out which tile improvements to build while I bungled around the interface.

One thing that I should mention about the first play is that I just sat down and played, no manual, no tutorial. Thankfully I'll be separated from my computer for the thanksgiving weekend and will have a good bit of time to read el manual cover to cover, but for now, the interrface is pretty friendly.

It may be a while before I even get around to installing Age of Empires, but I'll certainly still fire up doom 3 now and again. It still scares the pants off me, and the glee of playing at just about any res/aliasing/detail mode is pretty nice. Haven't got around to clocking it yet, but it was definitely going so fast I needed to put on the vsync..

Wednesday, November 16, 2005

Young, Assured and Playing Pharmacist to Friends

Young, Assured and Playing Pharmacist to Friends

They ain't joking.

Maybe I'll need some of the drugs mentioned above to stay up late with my fancy new rig on it's way from newegg:

Case: Antec SonataII w/450W PSU
Mother: MSI NF4 K8N NEO4-F
Processor: AMD 64 3800+ Athlon X2
Memory: Corsair D400 ValueSelect 2x512
Video: EVGA NVidia 6800GS
Audio: Audigy 2ZS
DVD: Lite-On DVD
LCD: ViewSonic VA902b Black 19" 8ms LCD Monitor
HD: Seagate Barracuda 7200.8 250GB 3.5" Serial ATA150

Oh, and XP Media Center. I know, I know.

Should be a frickin screamer though. Nothing better than reading all the user comments about the X2. Half of these crazies have it clocked up to 2.4ghz! Youcha. I think I may try to avoid too much smoke pouring out of her for at least the first little bit.

Besides, this is a work computer. Work. Right. And what's that video card for then, eh? Um... Web browsing. Yes. Web browsing. At this rate I should get to the end of the Internet in no time.

Anyway the whole list is based on extremetech.com's Bang For The Buck list. Ok, so not so much 'based on' as ripped straight from.

Seriously though it is for work. Somebody around here's got to figure out web techonologies that have been developed since the turn of the century, and I think it's going to be me. Integrating them into the full production system first go seems unfortunate though, so how about a nice little website project I can throw adsense on and make a little extra cabbage from? Exactly. Oh and yes, I only expect to make about as much as the ads on this blog.

Which is now up to $1.09 thank you very much. Honestly, who clicks on these adds? Besides you of course. You can keep clicking.

Friday, November 11, 2005

times 10.11.05 McClellan malquoted doubleplusungood rectify

Winston examined the four slips of paper which he had unrolled. Each contained a message of only one or two lines, in the abbreviated jargon -- not actually Newspeak, but consisting largely of Newspeak words -- which was used in the Ministry for internal purposes. They ran:

times 10.11.05 McClellan malquoted doubleplusungood rectify

times 17.3.84 bb speech malreported africa rectify

times 19.12.83 forecasts 3 yp 4th quarter 83 misprints verify current issue

times 14.2.84 miniplenty malquoted chocolate rectify

times 3.12.83 reporting bb dayorder doubleplusungood refs unpersons rewrite fullwise upsub antefiling

With a faint feeling of satisfaction Winston laid the first message aside. It was an intricate and responsible job and had better be dealt with last. The other four were routine matters, though the second one would probably mean some tedious wading through lists of figures.

What was need was a simple change of the White House transcript and "That's accurate" could easily become "I don't think that's accurate." The trick would be propogating the change to the Federal News Service...

Fiction 1984

Reality The White House

Day by day and almost minute by minute the past was brought up to date. In this way every prediction made by the Party could be shown by documentary evidence to have been correct, nor was any item of news, or any expression of opinion, which conflicted with the needs of the moment, ever allowed to remain on record. All history was a palimpsest, scraped clean and reinscribed exactly as often as was necessary. In no case would it have been possible, once the deed was done, to prove that any falsification had taken place.


Tuesday, November 08, 2005


While playing the role of a Texas Ranger, Chuck Norris used live ammunition during all shoot outs. When the director explained that he can't do that, he replied, "Of course I can, I'm Chuck Norris," and roundhouse kicked him in the face.

If paper beats rock, and rock beats scissors, what beats all 3 at the same time? Answer: Chuck Norris.

Chuck Norris can make a woman climax by simply pointing at her and saying "booya".

Chuck Norris puts the m's on M&Ms.

When his martial arts prowess fails to resolve a situation, Chuck Norris plays dead. When playing dead doesn't work, he plays zombie.

It is common knowledge that there are three sides to the force: The Light Side, The Dark Side, and Chuck Norris.

Scientists used to believe that a diamond was the world's hardest substance. But then they met Chuck Norris, who gave them a roundhouse kick to the face so hard, and with so much heat and pressure that the scientists turned into artificial Chuck Norrisi.

Chuck Norris carries a messenger bag. If you call it a purse, he pulls a baby out of the bag and throws it at you. The baby will blow up upon impact.

Rather than being birthed like a normal child, Chuck Norris instead decided to punch his way out of his mother's womb. Shortly thereafter he grew a beard.

God offered Chuck Norris the gift to fly, which he swiftly declined for a +500 gain to roundhouse ability.

New Years Eve 1998, Chuck Norris was at a party, when the clock struck twelve, instead of kissing someone, Chuck Norris roundhouse kicked everyone at the party. He then proceeded to roundhouse kick everyone on the street, and the whole city. He has been doing this ever since.

Chuck Norris does not sleep. He waits.

When Chuck Norris was denied a McGriddle at McDonalds because it was 10:35, He roundhouse kicked the store so hard it became a Wendy's.

Chuck Norris drinks napalm to quell his heart burn.

A ducks quack does not echo. Chuck Norris is solely responsible for this phenomenon. When asked why he will simply stare at you grimly.

Chuck Norris was a hidden playable character on Mortal Kombat 2 on the Sega Genesis.

Chuck Norris is known for his modesty but readily admits that he is the 8th wonder of the natural world.

Chuck Norris once tried to defeat Jackie Chan in a game of chess. When Norris lost, he won in life by roundhouse kicking Chan in the side of the face.

Chuck Norris' roundhouse kick is so powerful, it can be seen from outer space by the naked eye.

Chuck Norris doesn't believe in Germany.

Chuck Norris goes to the toilet once a month, if he needs to or not.

Chuck Norris wears a live rattlesnake as a con dom.

Chuck Norris can cut onions without crying.

Chuck Norris burned down an entire forest when he was experimenting with water.

There are in fact 31 letters of the English Alphabet however only Chuck Norris knows what the extra 5 letters are.

Occasionally Chuck Norris will call up the Power Rangers just to say hi.

Chuck Norris has no concept of time, if you go to his house you won't find a single clock. When you ask to leave because it's getting late he stares at you blankly until you sit back down.

If you want a list of Chuck Norris' enemies just check the extinct species list.

Chuck Norris has never blinked in his entire life. Never.

Chuck Norris can believe it's not butter.

Chuck Norris once ate a banana without having to peel it.

If Chuck Norris had a dollar and you had a dollar, Chuck would kick your ass and take your dollar.

When Chuck Norris's wife burned the turkey one Thanksgiving, Chuck said,

"Don't worry about it honey," and went into his backyard. He came back five minutes later with a live turkey, ate it whole, and when he threw it up a few seconds later it was fully cooked and came with cranberry sauce. When his wife asked him how he had done it, he gave her a roundhouse kick to the face and said, "Never question Chuck Norris."

We once had a bachelor party for Chuck Norris. He ate the entire cake before we could tell him there was a stripper in it.

Every piece of furniture in Chuck Norris' house is a Total Gym.

Chuck Norris once shot a German plane down with his finger, by yelling, "Bang!"

In a recent interview, Chuck Norris told Entertainment Tonight co-host Mary Hart that his most memorable role was when he played the third breast on the hooker in "Total Recall".

Chuck Norris once did a back flip off the Great Wall of China.

Chuck Norris doesn't need to swallow when eating food.

Chuck Norris can divide by Zero

Chuck Norris caught all 386 pokemon in just under 2.7 seconds. He says he won't trade any of them for anything.

If Superman and the Flash were to race to the edge of space you know who would win: Chuck Norris.

Ironically, Chuck Norris' hidden talent is invisibility.

Chuck Norris eats Transformer toys in vehicle mode and poops them out transformed into a robot.

In one episode of Fresh Prince of Bel Air, Chuck Norris replaced Carlton for one scene and nobody noticed.

Contrary to popular belief, Chuck Norris was dropped at Hiroshima and Nagasaki.

Chuck Norris broke his own leg, purely for the sake of winning the paralympics.

Chuck Norris is where babies come from.

Chuck Norris owns the greatest Poker Face of all-time. It helped him win the 1983 World Series of Poker despite him holding just a Joker, a Get Out of Jail Free Monopoly card, a 2 of clubs, 7 of spades and a green ..4 card from the game UNO.

If you can see Chuck Norris, he can see you. If you can't see Chuck Norris you may be only seconds away from death.

On the 7th day, God rested. Chuck Norris took over.

Biologically, Chuck Norris is his own step-father.

Chuck Norris invented a language that incorporates karate and roundhouse kicks. So next time Chuck Norris is kicking your ass, don't be offended or hurt, he may be just trying to tell you he likes your hat.

Chuck Norris consumes 87 cans of mayonnaise in a week.

Chuck Norris invented water.

Chuck Norris will never fully be male nor female. Doctors once asked him which he preferred. He gave them an ad for a Total Gym.

Chuck Norris went looking for a bar but couldn't find one. He walked to a vacant lot and sat there. Sure enough within an hour an a half someone constructed a bar around him. He then ordered a shot, drank it, and then burned the place to the ground. Chuck Norris yelled over the roar of the flames, 'Always leave things the way you found em!'"

One time while sparring with wolverine, Chuck Norris accidentally lost his left testicle. You might be familiar with it to this very day by it's technical term: Jupiter.

Contrary to popular belief, Chuck Norris, not the Blue Ringed Octopus of Eastern Australia, is the most venomous creature on Earth. Within 3 minutes of being bitten, a human being experiences the following symptoms: Fever, Blurred Vision, Beard Rash, tightness of the jeans, and the feeling of being repeatedly kicked through a car windshield.

Chuck Norris is Luke Skywalker's father.

Chuck Norris does not use spell check. If he happens to misspell a word, he simply changes the actual spelling of it.

Wednesday, November 02, 2005

movie review: proof

This is a bad movie.

No wait, I can't say that. I can't say that because in Proof, we're using this neato gimmick that the script writing committee came up with to impress us with the amazingly rational minds of our protagonist mathematicians. Instead we must attempt to 'prove' the opposite...

Proof is not a good movie.

1) M_good = ( intriguing plot U characters U dialog U information U intangible goodness )

2) M_proof ( lame plot U rapist hero U 1-trick pony dialog U prime numbers = neato! U nope )

3) M_proof U M_g = null

4) thus Proof != good


1) Define M_good as the set of Movies that are Good.
This can be expressed as the Union of:

  • intriguing plot
  • >1 character of interest
  • Snappy dialog that actually works
  • Dissemination of information that merits interest
  • Some movies work anyway, right? We need to be complete.

2) Define M_proof as the set of Proof, the movie.
This can be expressed as the Union of:

  • Wait, she's the smart woman mathematician of lore? No PhD required to see this coming. And no, you can't just jiggle time around trying to confuse me and substitute this for plot. Memento was good. I know. You're not Memento.
  • Her, I can take or leave. Dudley or whatever the hell? I'm going to call the cops if he gets near her again. Dude, see the girl that winces every time you try to kiss her and is too socially awkward to throw you the hell out? Yeah, her father died today too, so stop boning her, k?
  • Now I might be wrong, but I think she misquotes her father in the beginning while dis-'proving' his theory that she can't be crazy. He says crazy people don't ask themselves if they're crazy, not that they can't say they're crazy if asked. Fine, nitpicky, but you don't go proving without precision. Send her back to ass-u-me.
  • Research on this movie consisted of about 5 minutes on Wikipedia, or 3 minutes googling "fun math fact" AND prime. What did she prove again?
  • Negative. Although I did like the ending credits. It looked like multi-cultural day at Northwestern.

3) The union of the two sets is the null set.
4) Go watch Wallace & Gromit.