Monday, September 25, 2006

Wandering Off

I tend to wander. Be it in downtown Beijing or just reading a book.

I'm still reading Java for Artists. I made it a couple of pages in several hours. Here's a rundown of the journey.

Chapter 3 talks about the Spiral Development Cycle.


The same 3 steps (plan, code, test) are repeated to build and maintain forward progress. And although the code and testing have peristent artifacts (the code itself), the plan steps are layed out in tables in the book. Somewhere along the line I decided I wanted to be abkle to do everything in text files (Starting from scratch). I'd like continue this process after I'm done with the book, but how can I create structured data in a text file? XML. Damn it! Now I have to go read up on XML again. How many times does this make now? Use it or lose it. A google search on XML turns up a favorite site of mine (w3schools.com). Of Course, I can't just read about XML (since alone it won't really meet my needs). This leads me to tutorials on XML, XPath, XSLT and XSL-FO (that's a new one to me).

I probably shouldn't be watching tv while I'm doing all of this...

So now I'm working on the XML and XSL that I hope will make up my plan list. Java? Yeah, I'll get back to that eventually. At the moment I can't even get the XSL to properly transform the XML. I am Clearly a masochist.

Here's the xml to this point:


<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="RobotRat.xsl"?>

<dev_plan xmlns="http://brian.donoho.com/xml/">
<name>RobotRat</name>
<prog_lang>Java</prog_lang>
<step id="1" phase="1">
<design_consideration>
Program Structure
</design_consideration>
<design_decision>
One class will contain all the functionality
</design_decision>
</step>

<step id="2" phase="1">
<design_consideration>
Creating the Java application class
</design_consideration>
<design_decision>
The class name will be RobotRat. It will contain a “public static void main(String[] args){ }” method.
</design_decision>
</step>

<step id="3" phase="1">
<design_consideration>
constructor method
</design_consideration>
<design_decision>
Write a class constructor that will print a short message to the screen when a RobotRat object is created.
</design_decision>
</step>

<step id="" phase="">
<design_consideration>
</design_consideration>
<design_decision>
</design_decision>
</step>

<step id="" phase="">
<design_consideration>
</design_consideration>
<design_decision>
</design_decision>
</step>

</dev_plan>


And the xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<body>
<h2><xsl:value-of select="dev_plan/name" /> Dev Plan</h2>
<table border="1">
<tr>
<th>Check-Off</th>
<th>Design Consideration</th>
<th>Design Decision</th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<xsl:for-each select="dev_plan/step">
<tr>
<td></td>
<td><xsl:value-of select="design_consideration" /></td>
<td><xsl:value-of select="design_decision" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>


After hours of trial and error. I find that removing the xmlns attribute from the dev_plan element makes everything work. Do I go and figure out why it was breaking things or do I move on with what I should be doing? ROFLOL

Before I get back to figuring out what went wrong with the xml, I should mention that I took another side trip to figure out / remember how display code on a web page. Doing a google search for displaying HTML code brought me to the xmp tag which I'd never heard of, but didn't work for me (meaning, just throwing it around the raw code didn't work). Finally I found an online tool to Display HTML sample code. Thank You Christopher Brewer ^_^

After being left unfulfilled by the explaination of XML Namespaces at w3schools (first time for everything), I found this article at xml.com. Interesting, but I still don't quite get it. Several variations on the xml still result in it not making it through the xsl. I know how to make it work, but I want to understand what's going on when it's not working. After reading Ronald Bourret's XML Namespaces FAQ I understand namespaces themselves a bit more, and get the impression that mine is declared properly, but not why the xsl "breaks".

After doing a search for "XML Namespaces breaks xslt xsl transform" I found a link to a thread that explains the problem and the solution (I didn't want). It looks like my options are to remove the default namespace from my xml doc OR prefix everything in both documents.
After a few more unsuccessful tests and in the interst of continuing my java studies I will remove the default xmlns attribute. Fortunitely this R&D won't be wasted as I will be visiting XML in a later study session.

Labels: , ,

Friday, July 14, 2006

Stuff I'd like to be doing

I find myself FULL of ideas and possibilities to of point of being debilitated by the options.  Sounds like an excuse to me... What better way to get started on something than to write it down.  I SUCK at writing things down.  My life would be monumentally different if I wrote stuff down.  It would be different, and better, if I wrote things down and followed up on them (which is why I gave up on writing things down).  Time to try again.

! F34R teh DR4F7

I hate doing things more than once.  No, I think it'd be more accurate to say I want to do things perfectly the first time.  The problem is, occasionally pull this off, thus reinforcing a BAD habit.  Trial and error is a good thing.  That's probably one of the things I like about programming.  (I actually enjoy debugging).  There's a contract between you and the compiler.  You tell it what you want is makes sure you're requests are clear.  Or something like that.  Point is, the feedback can be clear and instantaneous. And even when it's not, google makes it easy to hunt down the most mysterious of error messages.  Was I going somewhere with all of this?  Oh yeah <channeling Gir> Many ideas have not been put to action because I don't think I can pull them off without painful trial and error.  I could say I was a bit traumatized at an early age by my dad's insistence that my homework be perfect (as in nothing erased) to the point of removing the erasers from my pencils and making me start over if something required erasing or it wasn't "legible".  But that'd just be an excuse.  At this point, my choices are mine.  Right?

I would LOVE to do a web comic.  As much as I'd like to make others laugh, it's primary reason would be as a form of expression.  I've got a tablet PC and all the tools I need to get started, but it's been over 10 years since I've really drawn.  I kinda suck now.  So many ideas going unexpressed.  Slowly killing me inside.... :p

I'm also afraid that my expressions will be crap (even at their best).  I'm a strong proponent of "If you've got nothing good to say STFU"  When it comes down to it, I guess what I really want is to find others like me by expressing who I am and making some friends.  Maybe it's do a bit easier than the reverse.

Career Options - All the things I'm moderately qualified to do.

Developer (Web or otherwise)
Masseur (acupressure)
Trainer

Why does conscious thought destroy he fruits of my creativity?!?  a.k.a Why The Fuck do I forget what I want to write as soon as I go to write it down??  GYAAAA!!!!!

eh. whatever.

Labels:

Monday, January 23, 2006

Lifehacker

While reading "Hackers and Painters" it occured to me that I might be a life hacker... In months past I've gone through different modes of self-labeling and such, but at the same time I realized that I regularly read a blog entitled lifehacker and wonder if they came up with the name in a similar way.

I refrain from writing as often as I'd like because I usually encounter the same frustration. I can get the thoughts and ideas in my head into the words on the page fast enough. Maybe I should just practice more, unfortunately that means a lot of crap entries while getting there :p I hate crap entries.

Oh, and the first chapter of Hackers and Painters if Fo0k1N AWESOME!11!

Labels: