BibleGateway.com Verse Of The Day

Thursday, May 28, 2009

Emergency Startup CD for Windows

BartPE, because sometimes you actually have to run Windows.

If you have Windows and your system did not come with a "rescue", "restore", or "emergency startup" type CD (yes, I'm talking to the cheap bastards at Dell who don't include the Windows CD), then you NEED to follow the instructions at http://www.howtohaven.com/system/live-windows-rescue-cd.shtml. This creates a bootable "BartPE" CD with all the right utilities for fixin' what ails ye.

Do it now! Before you need it, not after. I learned the hard way, and after this past week, I can't sing the praises of BartPE enough. It was a life saver.

My wife's laptop booted to a BSOD when I was trying to VPN in to work. Oh well, a night off....but then it kept doing it, over and over. I couldn't get Windows to start for the life of me.

Since I didn't have a bootable Windows CD, I was left trying to boot FreeDOS from my thumbdrive (using LiveUSB Creator) . I made sure to have a copy of NTFS4DOS installed on there as well, and ran through some exercises where I got a command prompt to manually copy registry files around. That was painful, but it actually worked enough to get the machine to boot into XP. But it was a version of XP that had all sorts of issues, error messages, drivers crashing, no USB support, no CD recording, no network, etc. Without USB, network, or CD burning, I couldn't get our important files off the machine.

Anyway, to make a long story short, the FreeDOS/ntfs4dos route was crappy and painful with no real reward.

The BartPE rocks the house! It boots into a minimal XP interface with all the right utilities for fixing your issues, and USB drives are recognized, so I can copy important files off the machine in case I feel the need to wipe it clean.

I guess I really should do regular backups, but what fun is that? Preventing problems is boring, solving problems is heroic....

Wednesday, April 08, 2009

Google App Engine And Java

I recently posted about my experience playing with the Google App Engine and the Python language, in which I wrote:
For now, the only supported language is Python....I wouldn't mind seeing other languages supported in GAE, though not sure it really matters or if it is worth Google's time, money, and effort to expand support to other languages. I'm sure if they asked 100 developers they would get 100 different answers of what languages should be supported.
Well, just when I was getting used to the idiosyncrasies of the Python language, I went to look something up on http://code.google.com/appengine/ and found that they have an early preview of Java running on the engine. Here's the blog posting.

If I were one of the 100 developers mentioned above, my first answer would have been Java. I signed up as soon as I saw it, but alas, I'm on a waiting list. Looks like I'll be flirting with Python a little longer while I wait for my true love....

The really cool part of getting Java running in the engine is that should bring the other languages that run on the JVM as well, e.g. Scala, Groovy, JRuby, BeanShell, and, yes, even Jython.

Oh the fun!

Tuesday, March 31, 2009

Google App Engine & Python

I finally took the dive into the Google App Engine last week. It's free to get started (up to 10 applications per Google account) and gets my feet wet for this whole "cloud computing" crapfest. Here are my first impressions of Google App Engine and Python. I won't go into my issues with cloud computing in general and all the hype surrounding it, and how it will magically solve all of our scalability and maintenance issues.

I was surprised at how well done the Google App Engine is, and how quickly I could get started. Downloading and installing the local development environment was quick and painless, and walking through the tutorial, I had a very basic "guest book" application written and deployed out in the vast Google cloud for the world to see. The local development server was up and running within minutes of downloading and installing, and making changes to the Python scripts didn't require any redeployment or restarts. Uploading to the Google servers was a matter of running a single script and entering your user id and password. There is even an admin console where you can see stats on your page visits, bandwidth used, performance, etc.

I like that the Google users and authentication is pretty much built in, as well as the simple "webapp" MVC framework, and that you can use any pure Python library or framework you want to use (as long as there aren't any extensions written in C). The data access layer and GQL query language is interesting -- one big free-form data store where you aren't dealing with individual tables so much as just defining your entities in your code's data structures, and reading and writing from them as if they are tables.

For now, the only supported language is Python, which I have never dealt with. That really wasn't much of a hurdle since the syntax is pretty straight forward and easy to learn. I wouldn't mind seeing other languages supported in GAE, though not sure it really matters or if it is worth Google's time, money, and effort to expand support to other languages. I'm sure if they asked 100 developers they would get 100 different answers of what languages should be supported.

I'm a little more ambivalent toward Python. I didn't dislike it, but it just didn't grab me by the balls and make me exclaim it's superiority either. I can say I'm not a fan of the whole "indentation exception" crap. As a guy with more of a C and Java background, I like my curly brackets instead of relying on indentation levels, which remind me too much of COBOL, yuck!

Anyway, here's my trivial little application. It's all "tutorial-ware", straight out of the book with a few CSS enhancements and a simple "about" page. It's not useful, but not bad considering how little time it took to write.

Next step.... write something useful. I definitely want to get into this more and add it to my development toolbox.

So Tempting....

Eleven turkeys recently found themselves really lucky they weren't in season....

Tuesday, March 03, 2009

An Overzealous SEAM Validation

I am using the Jboss SEAM framework for the project I am currently working on. The first thing that really bit me was a validation on single character fields that seems a bit "too stringent". I'm sure I'm not the first to run into this. In fact it may be fixed by now in a newer version of SEAM, but figured it's worth a post anyways.

When you use Jboss Developer Studio (JBDS) to reverse engineer your database (I imagine the seam-gen tools do the same since JBDS uses them), the getter method on the EJB looks something like this...

@Column(name = "DEFAULT_REMAP_IND", length = 1)
@Length(max = 1)
public Character getDefaultRemapInd() {
return this.defaultRemapInd;
}
Looks fine, looks reasonable. Single character fields are often used for flags or indicators, as this one above is -- it's a simple Y/N field. So in my XHTML I use a radio button control instead of a free form text field.

<h:selectOneRadio id="defaultRemapInd" value="#{ocamCustTypeDfltHome.instance.defaultRemapInd}" required="true">
<f:selectItem itemValue="Y" itemLabel="Yes" />
<f:selectItem itemValue="N" itemLabel="No" />
<a:support event="onblur" reRender="defaultRemapIndDecoration"/>
</h:selectOneRadio>

The SEAM framework will use that @Length annotation to perform some field validations for you automagically, which is pretty cool as it can be a real time-saver. But the funny thing is that when this "max length of 1" validation fires, you get the lovely message shown in this partial screen shot ....

Not sure how to get a single character with a length greater than 0 but less than 1, but I do know that the easiest thing to do in this case is remove the @Length annotation for that field. I had to do that for a few different tables. Luckily they were all flags that could be replaced with radio buttons, but in the case where you had to allow free input, you might have to get more creative (you can always put a max length on the input text field).

For reference, I am using Jboss 4.2.2, SEAM 1.2GA, Jboss's EJB3 implementation (which is Hibernate under the hood), XHTML and Facelets for the views. Like I said, this might be fixed in a later release of SEAM.

Tuesday, February 17, 2009

A Lesson In Tracking

I took my daughters for a walk in the woods behind our house Sunday. In the patches of snow and mud, I showed them various animal tracks and we worked on identifying deer, foxes, raccoons, etc. I showed them "deer beans", which they had a lot of fun finding and pointing out. We even kicked up 3 deer as we came around the creek bend.

When we turned to come back, I explained that we should be able to find the tracks we made on the way in, and follow them to get back the same way we came in. I told them this was called 'tracking'. To this, Raina responded with Sid the Sloth's line from the "Ice Age" movie -- "I see a tree, I eat a leaf, that's my tracking."

I love the way kids will pick up what you are telling them, and make associations to stuff they already know. I also love that they show an interest in the outdoors, at least for now. They will probably "turn into girls" at some point, and not want to hunt, fish, camp, etc., so I am enjoying it while I can.

Tuesday, January 20, 2009

My RAZR Woes

My Motorola RAZR v3m phone I have had for a year and half suddenly started acting strange last week. I noticed every time I went to use it, it was turned off, but the battery had a full charge. Then I started paying more attention, and noticed that it would suddenly lose all signal and the screen would go all white for split second and come back, but then the keypad seemed to be frozen -- I couldn't get it to do anything. From there, it would either turn itself off or "reboot" itself (went back to main screen and was OK for a while.

Also, while trying to save pictures in anticipation of the phone either being replaced or flashed, the phone would completely lock up when I inserted the micro-SD card. I had been using this same micro-SD card for almost a year with no issue. Another thing I noticed was now all my contacts show a group of a single, solid "block" character instead of "family", "work", etc.

The phone has not been wet and has not been dropped or otherwise abused. The battery is holding it's charge just fine. The strangest part is that we haved the same model phones at work for our on-call phones. My group's on-call phone started having the same symptoms around the same time mine did. And now I am hearing of at least one other group here having the same issues with their RAZR. From that, I concluded this has to be a more widespread problem, but the lady at the Verizon store refused to even look into it. The phone is out of warranty, so wouldn't do any troubleshooting -- just the offer to buy a new one or wait a month until my contract is eligible to upgrade.

If I were more paranoid and prone to believing conspiracy theories, I might think Motorola put in some sort of "upgrade timer" to break right around the time people are eligible to upgrade their phones. It's probably more likely that there is a Zune-type "leap second" bug in the firmware.

Model: v3m
s/w: NEWC_01.09.02
Date code: 1407

Friday, October 17, 2008

A Website For Everything

I don't care what you're looking for, there's a website for just about everything and anything. Case in point, http://www.monkeys-for-sale.com. The internet's not just for porn anymore.

Monday, September 29, 2008

The Chicken Nest Boxes Are Finally Done

The chicken nest boxes Are finally done.....and just in time! As I was working on the finishing touches, I went out to give the birds some fresh water and found a a brown egg on the ground.

Below is a photo of the completed nest box right inside the coop. It's a double-seater, which should be plenty since I only have 4 hens left. I put a hook on the bottom to hand the waterer from as well. I'm hoping the water won't get as nasty if it's hanging instead of sitting on the ground.
The design is fairly basic -- 2 nests with a perch on the front and a hinged top to ease egg gathering. I built the whole thing from various wood I had laying around the barn: some 2x3's, 2x2's, 1x12's, and a half-sheet of plywood. The only thing I purchased especially for this box was the set of hinges.

Below is a picture of the nearly completed nest box in my workshop. Here I'm demonstrating the hinged top and making sure the sizing is right -- notice the Blue Araucana hanging out in there trying tofigure out what's going on.
Once I moved this into the coop, I placed a small smooth rock in one side hoping it would look enough like an egg to let them know what the thing is for.

Yesterday I went in to check, and the rock was moved aside, and a nice brown egg was laying there.

Overall I would have to say I am pleased with the nest box. It took longer to build than I was hoping, but that's mostly because other things kept coming up. I could have purchased pre-built nest boxes, but what fun is that? This was a lot of fun to build, and finding my first egg in there made it all worthwhile.

Wednesday, September 17, 2008

You've Got Mail


Just a silly dude I drew while coloring with my daughter the other day. Sometimes you gotta break out the crayons....

Thursday, September 04, 2008

Error 2 (net::ERR_FAILED): Unknown error.

Well, so much for Google Chrome, at home at least. I installed at work yesterday (XP Pro) and used it all day. Started to kind of like it, albeit some features I am used to are not there, yet. (See yesterday's post for my first impressions.)

But once I got home and installed it on my laptop (XP home), every page I go to gives me an error saying the webpage is not available. Firefox and IE work fine, my firewall settings are to allow Chrome to access, everythign looks good. I reinstalled with no luck, I disabled my firewall, no luck.

So I installed on my desktop (XP as well), and same thing. I can get to the main Google page but cannot search. I got to Microsoft's homepage, but can't go anywhere from there. Same thing, where Firefox and IE work fine.

Several issues we posted on Google Code site for this error so it's not just in my imagination, here are a few samples (search for error msg, there were about 10-12 when I posted this)....
I guess it is a beta, so instead of whining I will just stop using it until the next version comes out.

This webpage is not available.

The webpage at http://www.google.com/chrome might be temporarily down or it may have moved permanently to a new web address.

More information on this error

Below is the original error message

Error 2 (net::ERR_FAILED): Unknown error.

Wednesday, September 03, 2008

Google Chrome versus Hype


Well, everybody in the online world seems to be writing about Google Chrome browser. Lots of hype, both good and bad. It's going to kill of Firefox and Internet Explorer, it's the final nail in the coffin for Microsoft, it's buggy, it's evil, it's great, it's just a beta, it's the next big thing, it will fizzle out and nobody will care about it, etc.

Well, I jumped on the bandwagon. I am currently using it to write this post. I used it off and on throughout the day alongside Firefox and Explorer. Here are my thoughts, as if anybody asked....
  • It has some nice features, some of which are admittedly borrowed from other browsers. They are nice, but not enough to make me switch, not nice enough to make Microsoft tremble in fear.
  • It is lacking some features of other browsers that I have come to rely on, and for that reason it's not "replacing" my other browsers any time soon (or ever).
    • Viewing XML and XSL files -- they show up blank or with some text here and there. Basically it tries to treat them like HTML and ignores most of the tags.
    • Sidebar - I have been using sidebar for the menu panel of my Bookmarks Launcher+ app. (shameless plug)
    • RSS support, e.g. Firefox's live bookmarks feature
    • Plugins, especially 'Firebug'.
  • It seems pretty zippy, but speed wasn't an issue with my other browsers, so not sure this one will make it "win".
  • Some of the stuff was a little odd to get used to at first, e.g. lack of menu bar or title bar,lack of bookmarks menu (unless you check the "Always show bookmarks bar" option under the wrench icon.
  • The "New Tab" window is kind of neat once you get used to it -- the lack of bookmarks menu above is actually right there when you open a new tab, along side thumbnails of most often visited sites, and a list of recently closed tabs, and ability to search your history.
  • Read some reports of the back button not working. It's been working for me. Even still, it is a beta, there will be bugs.
  • I like the idea of each tab being a separate process in case one gets hung up. I have had that problem a lot with Firefox, especially when trying to open PDF's or long loading pages. To that end, the Task Manager window and the info for nerds link is kind of cool.
My impression, it's a browser. Pure and simple. For some reason Google felt the need to reinvent the browser with lots of mature fully featured browsers already out there.

Chrome isn't bad, but it's not worth all the hype either. It will be interesting to see if it carves out a small niche, takes huge chunks of market share, or just fizzles out comepletly. My guess if either niche or fizzle at this point.

Monday, August 18, 2008

Simple JSP To List Java JVM Environment

Here's a simple JSP to list out all the JVM environment keys and values. Very simple, but occasionally useful. For example, a few weeks ago I needed to see which SSL keystore (javax.net.ssl.trustStore) our test servers were using.

I'm sure every Java developer has written similar code at some point, so I won't claim it's original, unique, or ingenious. But if you find it useful, go ahead and use it instead of writing another.


Wednesday, July 16, 2008

Making Your JVM Trust Those SSL Certificates

Guess I should follow-up with a "part 2" on yesterday's post about saving off SSL certificates. The whole point of me going through the exercise was that one of the web services we consume is SSL and the certificate expired. The new certificate was self-signed, so our Java code threw exceptions saying a trusted certificate was not found.

So the second step for me was to import them so my JVM(s) would recognize the certificate as "trusted".

To get your JVM to trust the certificate, you import it into your keystore using the keytool executable (found in your JDK bin directory):
[jboss@j2apptest01 bin]$ ./keytool -import -alias SomeWebserviceName -file ~/SomeCertificateFileName.CER
If the keystore does not exist yet, the tool will prompt you to enter a keystore password. Remember that password, as you will need to use it to import new certificates or export or view current ones.

It will then display all the keys and other info about the certificate and ask you to confirm that you really want to import. You will want to verify the keys match up to what you think you are importing, of course. Then type "yes" and it should tell you the certificate was added.

After that, our calls to the web service started to ork again, like magic.

Tuesday, July 15, 2008

Saving SSL Certificates From A Website

These instructions saved by butt recently, so I have to post so I don't lose them. I was able to figure out how to save the certificate OK, I just didn't know how to get the actual *.CER file so I could import to my JVM's keystore. I didn't know about the Windows app "certmgr.msc"... http://balajiramesh.wordpress.com/2007/12/28/save-ssl-certificate-to-cer-file/

Tuesday, June 17, 2008

Redneck Father's Day 2008

Ahhh, Father's Day. If I were a Dad from one of those stupid sit-coms, it would be all about ugly neckties, tired cliche's, and some witty one-liners. But, no, I'm a Wayne County Dad. We roll a little differently out here.

My father's day gift? 250 rounds of 9mm ammo. Perfect!
I have to give credit to my sister-in-law Jen for taking the picture. She got it just as I shot so there is a smoke cloud coming out the barrel, the action is still cycling, and if you look where I circled, the casing is flying through the air.

The day starts off like any other Sunday, with a lovely breakfast (Paula made the eggs and bacon, Raina made me toast--and lot's of it), and then going to church. Then we go to Uncle Greg's house for some brunch.

Then home so my brother-in-law and family could come over. He brought some clays, his 12 gauge and his 9mm. I brought out my XD-9 and Paula's 20 gauge Benelli. I'd say we probably only went through a few boxes of shotgun shells, but probably at least 300 rounds of 9mm.

Then we came back to house to eat grilled deer meat and slow roasted prime rib, and had some beers.

Many rounds of ammo were fired in the making of this Father's Day, and there was no shortage of meat either. Let me show you where to put that ugly necktie!

Tuesday, June 10, 2008

Three Baby Geese

Here's a picture of our 3 baby geese (about 2-1/2 weeks old) in the coop. Not sure what kind of geese they are yet. We also have 3 ducklings (I think 2 are Khaki Campbelss and the other I think may be a Cayuga, but not sure yet on either) and about 10-11 chickens (not sure of the types yet).

Sunday, May 18, 2008

Jboss SQL Deployer

I whipped up a fairly simple SQL deployer for Jboss this past week. It is currently fairly limited, but also very straight forward and should be easy to maintain.

It consists of a class implementing java.lang.Runnable (a Thread) that wakes up every 20 seconds or so and scans a directory for any new SQL files. Of course there is also a class implementing java.io.FileFilter to look for just SQL scripts. To turn this into a JMX service, I wrote a simple BeanShell wrapper to drop into the deploy directory.

Once a SQL file is found, the code assumes the first line will contain the DataSource JNDI name, so it knows what database to connect to. Then it currently assumes the rest of the file is one query. The query results are formatted and dumped to STDOUT.

To make this truly useful, I will have to make it accept updates as well as queries, and parse the file looking for multiple SQL statements instead of assuming it is just one. Other than those limitations, it works great with the few tests I have done so far. I have been testing under Jboss 4.0.3, but this should work with any version of Jboss with the BSHDeployer.

SqlFileScanner.java


SqlFileFilter.java



sqldeployer.bsh



Why would you use this? That's always a good question to ask, and this time I have an answer besides "because you can".
  • Running ad hoc queries right from your app server, using the same Jboss DataSource bindings your applications are using, and from the same server your apps are running, can be very helpful in troubleshooting issues.
  • Let's say you use Realms instead of username/password in the DataSource XML descriptor, for security reasons. Now you can troubleshoot database issues as that user even without knowing the DB username and password.
  • Set up simple reporting jobs without needing an Oracle client installed on the machine -- run them right from Jboss.
Conslusion
I think I may create a new open source project to house this as well as all the other Java "odds and ends" I have written over the years, like some of the code generators, MQ tools, servlet filters, JSP tags, etc. The hardest part will probably be coming up with a meaningful project name -- who wants to download and install "RobbsRandomJavaCrap.jar"?

Tuesday, May 13, 2008

The Wait Is Over

We applied for our pistol permits a few weeks ago, and finally got them this past Saturday. It took 2 days shy of 3 weeks from the time we turned the applications in to the time they arrived in the mail. That's the great thing about Wayne County. Just a few miles west, in Monroe County, it takes anywhere from 6 months to a year to get your permit. Our sister-in-law applied over 2 months ago. She's still waiting.

So the first two days of having our Springfield XD-9, we fired about 170 rounds of ammo through it. That thing is really fun to shoot, but it could start to get expensive when you tear through a magazine in about 30-40 seconds.

I'm loving the XD. I like the extra safety features like the grip safety and split trigger, the cocked indicator and the chambered round indicator. And on the range, the gun shoots very nicely-- comfortable to grip, low recoil, fast follow-up shots, no jamming or misfires. The XD is also extremely easy to take down and put back together without any tools. And while a lot of handguns have a reversible magazine release, the XD simply has a magazine release on both sides -- no need to change anything. It also has a built-in accessory rail for tactical flashlights or laser sights if you so choose.

The XD came with a plastic carrying case, holster, 2 magazines, a speed loader, magazine holster that holds 2 magazines, cleaning brush, and a gun lock. Gander Mountain threw in another gun lock and a "gun sock".

My decision came down between the Springfield XD or the Beretta PX4 Storm, and I can honestly say I don't regret my decision at all. The Beretta is a nice gun, but if I were to buy another handgun, I would get another XD in a heartbeat.

Monday, May 12, 2008

Homesteader's Delight

We ordered our chickens over the weekend from Murray McMurray, after having some poor luck getting birds locally this year. Instead of just getting chickens, we opted for the Homesteader's Delight, which is described as such:
If you are a small land holder and would like a small number of birds but a great variety, this is the assortment you've been waiting for. We will send you 10 Brown Egg Laying Chickens (female), 2 Ducklings (straight run), 2 Goslings (straight run), and 2 Turkeys (straight run). Our choice of variety of all the above.
The variety should be interesting. They should be arriving the week of May 19th. Time to get that coop cleaned out!