Thursday, December 18, 2008

Need some more shows!

Here is my list for the next month and I am already finding some great acts! Let me know if you are going or have any other good shows in the Ohio, Michigan, and Illinois area let me know

21 Janurary Cursive Columbus, OH
30 Janurary Jeff Tweedy Solo Friday ANN ARBOR, MI
11 February Los Campesinos Columbus, Oh

Thursday, December 11, 2008

Retrieving XML declaration Information Using SAX

So the other day I was notified that for a project that uses SAX I would need to maintain Encoding information it the XML Declaration. This seemed pretty straight forward, however, it really wasn't and in fact I am not sure why one or two things are done. So to try to save others the hassle here is how I did it...

Just so you know I am doing this with the org.xml.sax.helpers.XMLReaderFactory and XmlReader so if you are using a different parser this may be a little different.

First off if you are like me you were calling the XmlReader.parse method and passing it an input location. This will not work because it overrides the encoding with whatever the InputLocation's encoding. This means we have to go ahead and use the other override which takes a string in the form of a URI.

If you are like me you think EASY! and pass it the file path, this will not work you need to require a Java.net uri in the following way

String uri = new File(*filepath*).toURI().toString()

Now we have a proper uri and we are ready to parse just like normal. After it starts though we need to find a way to get the information about the declaration we do this by capturing the Locater. A Locater, according to Sun, is an "Interface for associating a SAX event with a document location." So the document's properties are essentially stored there. Here is how you get it, this is in the handler class...

Locator locator
...
public void setDocumentLocator(Locator locator){
this.locator = locator
}

And of course just to add a little wrinkle to things retrieving the encoding and XML version were Only added in SAX v2.0 and we can't access the information till we are inside the document. So we need to add the following to the handler class...

Integer elementDepth = 0
...
public void startElement(String uri, String name,
String qName, Attributes atts) {
if (elementDepth++ == 0) {
if (locator != null) {
if (locator instanceof Locator2) {
Locator2 loc = (Locator2) locator;
println loc.getXMLVersion();
println loc.getEncoding();
}
}
}
...
}

And as you can see now you are able to access the encoding and version information!!!!!

Feel free to comment if this helped you or if you know of a better way to do this!

Wednesday, August 13, 2008

Check out Silver Jews

Going to be a great show

ex members include Stephen Malkmus!!!!!!!!!!!

Show is at MILO on the 28th of August. This is a VERY rare oppertunity to see a GREAT band in a cool venue.

Check them out or check out a video

Tuesday, August 12, 2008

Welcome one and all

Hello everyone,

My name is Jackie and I am a 26yr old Computer Programmer. This means that I spend WAY too much time online randomly searching for nothingness. I live in a fringe (my girlfriend would call it suburban but it is more like the Lincoln Park) of Columbus and love art and music.

Being, IMHO, one of the most up-and-coming art communities on the planet, has caused me to develop a love hate relationship with this city. I love the culture, SOME of the groups of people, and how easy it is to make (or in my case spend) money but I hate the winter weather, the suburban mindset, and the lack of diverse natural wonders (Beaches on the ocean, mountains, etc).

I really see potential in Columbus, and that is probably my favorite part of it. The music here is great with alternative bands like The Cheater Slicks, Earwig, and Aether(Sorry guys I don't know how to do the little AE thing)to great Blues act like the AMAZING Willies Willie Pooch and Willie Pheonix, and if you reach a little (only a little) Ohio can claim the Pixies, Breeders, and The Black Keys, not too shabby at all. Also Chicago is only a short 6 hours away, opening up great venues like the double door, vic, and Kingston Mines.

What about art? Well considering my girlfriend is an aspiring Independent artist in the area I am a little biased, however, short of maybe Chicago this IS the spot for indie art in the mid-west. There is a higher concentration of indie galleries in Columbus then I have found in much larger cities, and the city does a great job of supporting it.

I guess there is a reason Columbus is still growing while other Ohio cities die out, America get ready for your next big city,

CBUS USA!

Thanks for stopping by!