Wednesday, April 25, 2007

ORA-00600 Error : Basically, you're screwed.

Yesterday we started getting the dreaded 00600 error.  A little googling turns up little more than the fact that this is the rough equivalent of a "kernel panic" error in Oracle, and you're on your own to figure out what caused it.  Yes, you may have invoked a bug in Oracle itself.  Hard to really say.

What I can tell you in our case, if you're looking for clues, is that it showed up specifically when dealing with XmlType fields, and triggers.  I have one trigger on a table that inserts a row (containing XmlType fields) into another table.  That table has a trigger on insert that takes the incoming XML and does a few things to it.  Something in that combination of triggers is causing the value error to happen.  We're currently looking at ways to make them behave nicer with each other, including having the first one do a commit after insert, and having the second one do a trigger on "after insert" instead of 'before insert'.  If I find anything that makes the problem go away and is recreatable, I'll be sure to check back in.

Update #1: For the curious, our problem seems related to the moving around of XmlType fields that are greater than the 4k barrier.  I whittled down my trigger so that it was nothing but a modification to a single XmlType object in the newly inserted row, and could demonstrably show that inserting any value less than 4k worked properly, and any value greater than 4k threw the 00600 error.  I'm not really sure why that limit suddenly bit us, especially since this whole system was working last week and miraculously just stopped, but at least it's some new information. 


Technorati tags: , ,

Thursday, April 19, 2007

Review : Sandisk Sansa e140 1Gig MP3 Player

I grabbed one of these off of Woot! the other day, thinking that I could finally set up an MP3 player for my wife.  The only time she gets to listen to music is in the car, carting around the kids, and it's always a battle when it is whose turn to listen to what music.  Mommy very rarely gets a turn.  So I thought if I could find a simple MP3 player with good capacity and an FM tuner I could dump all of their music together onto the thing, set it on shuffle, and then there'd always be a channel playing where they could just be happy with whatever song came next.

I've had this thing 5 minutes and I can see that it will just barely fit my requirements.  Sure, it's got an SD expansion slot.  But it has no playlist management (so I can't do a "Mommy" list and an "Everything" list for those times when she's not with the kids and would like to listen to just her own stuff).   Big strike, right there.  I might be able to cobble something together by butchering the Album and Genre tags, since it can browse those oddly enough, to do a sort of simulated playlist management at least. 

At first I thought there was no random shuffle option, but I found it.  I can't tell if it just mindlessly shuffles through all music on the disk or if it's smart enough that I'm in a certain genre to do just that genre.  We shall see.

By far the worst feature of this player is the scroll wheel, situated in the upper right corner of the device.  Which finger am I supposed to use with THAT?  It pretty much mandates two handed operation, which if you're used to an ipod is just insane.  If this is supposed to be a device that my wife leaves in the car, I can't see her mucking with that control and driving at the same time.  Unlike an ipod scroll/click wheel, which I do all the time.  Even if you assume two handed operation (it already fits in the palm of one hand, it's not like the thing is Treo sized where you can hold it in one and interact with the other), you'll still find yourself hard pressed to spin the little plastic knob just right without accidentally clicking a button in the process.  The menu button is situated on the right hand side of the player right under the knob in another spot that makes you say "How am I supposed to hit that?"

Other features?  It's incredibly light, I'll give it that.  So light that the word "cheap" crosses your mind, like you'll break it.  It's got an FM receiver built in, but does anybody use those things anymore?

In general, it ain't great for what I wanted it for.  I think I'd hate it if this was my daily player.  But perhaps if I can stick with my original plan to load it to the hilt with all the music I can get my hands on, and muck with the ID3 tags enough that she can have some semblance of management of the thing, it might be fine to leave in the car attached to an FM transmitter and work like a mini jukebox.  If she likes it and wants something she can take with her on walks or to the gym, I'm getting her a Nano.


Technorati tags: , , , ,

Tuesday, April 17, 2007

Joost Beta Invites

Hey all, I just got a handful of Joost Beta invites.  Anybody want them?  Joost, for those that haven't seen it yet, is a new online television-watching application.  It's got a pretty neat viewer, going all full screen and offering easy to manage controls for tracking your favorite channels, programs and so on.  I just have to pay attention to it long enough to find programs I want to follow.  I wonder if there is a "download for later" option, so I can download at night and watch on the train when I have no net access?  I'll have to look into that.  I don't think so, though.  I think it's just streaming.

If you want an invite, send  me an email.  I've only got a couple, so first come first served.

Update:  All invites are distributed.  Thanks for reading!  If I get more, I'll post here again.


Technorati tags: , ,

Thursday, April 05, 2007

Ruby on Rails : Persist an array to the database

I've only needed this trick twice in my Rails life, but both times I had to google for it so I figured I'd post a note to remind myself for next time.

Sometimes you want to store an array as part of your model, and not make it an index into another table.  ActiveRecord allows you to serialize a property to do just that:

class MyStuff < ActiveRecord::Base
  serialize   :things

In your DB schema, you'd want to make "things" a text value.  Then you can do stuff like this and not worry about anything:

stuff =
stuff.things << "laptop"
stuff.things << "ipod"

Done!  Arguably this is a bit of a hack, as the next natural question to ask is "Well isn't there a value in cross referencing all the items that could be in "things"?  Could be.  Depends on the application.  It's nice to know that if you don't want to go down the path of setting up that extension to your model, you've got an easier option. 


Technorati tags: , , ,

Wednesday, April 04, 2007

XSLT and Boolean Element Value Tests

In my most recent project, the engineers spitting out the XML have a bad habit of inconsistently filling in boolean values. I never know if one of my elements is going to have:  y  n  Y  N  yes  no  Yes  No  t  f  T  F  true  false  True   False

So the two functions you need to deal with this are substring() to only look at one character, and some form of lowercase() or tolower() function.  However, xslt 1.0 by itself doesn't have that, but you can get around it using the translate() method.  With translate you have to specify the characters to swap out, much like the unix 'tr' command:  /ABC/abc/ sort of thing.

Luckily we don't have to worry about the entire alphabet here, just a couple of characters.  And while you're at it you can merge the truefalse into yesno as well.  Try this next time you need to test a boolean value:

<xsl:if test="translate(substring(MyElement,1,1),'YNTFtf','ynynyn')='y'>  <!--  Do the true case..... ->

You're taking the first letter (which can be one of y,n,Y,N,t,f,T,F) and translating it into either y or n, depending.  There's nothing in translate that says you can't translate T into y if you really want to!  Notice too that 'yn' is not represented in the first half of what to translate, because those are fine like they are.  But YN translates to yn, TF to yn, and tf to yn.

Or even better you could go back to whoever is producing the XML and tell them to get with the program and pick a boolean scheme and stick with it. :)

Technorati tags: