|
|
Alan's Type Recorder

| Jul. 22nd, 2004 06:07 pm This LJ is obsolete. I set it up only because I was too busy to learn how to set up my own wiki.
A wiki is a dynamic editable webpage. Actually, livejournal is a kind of wiki, in the sense that it has the same features as a wiki, just laid out with different menu headings.
There are tons and tons of implementations of wikis, messageboards, and blog sites now. You can get one written in java, php, perl, c++, whatever... But I don't want to use a system I don't enjoy coding in, and I've been busy learning python so I can do work in that now.
So, now I have a moinmoin site. This is an open-source Python wiki clone, written by a couple of german uber-geeks. It's really incredible what you can do with it. I don't feel like reading another line of perl, or human-coded HTML again - python and XML are my lingos of choice now.
The cool thing about this site is there's a link to see the recent additions/changes, there is a blog plugin (which is a very simple application, once you have the general framework done). So anyway, I shall soon delete this lj. I have another livejournal, oddiofile which I shall use for tech and non-tech stuff. Cheerio.
And it can do RSS in both directions. Anyway, it's just one of many many out there, but I am finally using one. So I probably won't be using this anymore. Leave a comment | |

| Jun. 24th, 2004 11:33 am Why linus won't touch CVS with a 10 foot pole Wow. Just read why Linus Torvalds won't touch CVS (Concurrent Version System) or any of its derivitives (including Subversion) with a ten-foot Pole. It seems that the centralized nature of CVS has a negative impact on the productivity of distributed development projects, compared to Bitkeeper, the SCS system made to his own specification... Thanks to nessus for pointing that message out.
Since my only other experience was with MS Visual Source-Safe, I found CVS to be miles ahead, and I didn't want to get into any expensive commercial products again.
I was just about to open-source my local project on cvsdude or Tigris.org, but now I am rethinking that idea... Leave a comment | |

| Jun. 16th, 2004 11:29 am Python in a nutshell: Python in a Nutshell - Oreilly publishing.
Page 166 - Match objects.
Whenever you perform a regular expression match, you are returned an object which has every piece of information you could ever want, as well as a callback interface. It's more powerful than any regular expression interface I've ever seen.
page 67 - Generators.
Seems like a rather clever idea - your program can keep calling "yield" instead of return, and it freezes until the next time it is called, at which point it can resume iteration through wahtever it was iterating. Makes writing iterators a snap. It might help me make the c++ comment processor a little more elegant. 1 comment - Leave a comment | |

| May. 25th, 2004 02:22 pm Weird python DOM behavior Trying to learn DOM. Can't quite figure out how this is supposed to work though. I can't change the elements, so I create a new one, grab the old one's children and then call the parents replaceChild method. Seems straightforward, right?
""" a simple test case showing how to replace an element with another while still keeping the child nodes of the replaced element. """ import xml.dom.minidom from xml.dom.minidom import Element, parseString
funXmlString = "<p> a para with <b> bold </b> inside</p>"
funXmlDoc = parseString(funXmlString)
testElement=funXmlDoc.documentElement
print "testElement: " + testElement.toxml()
para = Element("para")
for child in testElement.childNodes:
para.appendChild(child)
print "para after adopting: " + para.toxml()
# For some reason, we lose the entire <b>..</b> part!
# Where did it go?
assert para.toxml() == "<para> a para with <b> bold </b> inside</para>"
funXmlDoc.replaceChild(para, testElement)
print "funXmlDoc after replacement:" + funXmlDoc.toxml();
Here is the output:
testElement: <p> a para with <b> bold </b> inside</p>
para after adopting: <para> a para with inside</para>
Traceback (most recent call last):
File "testdom.py", line 18, in ?
assert para.toxml() == "<para> a para with <b> bold </b> inside</para>"
AssertionError
Leave a comment | |

| May. 2nd, 2004 11:56 am Argument Clinic I've known about python for a long time. One of our smartest systems engineers at Objectivity came up with a Python binding for us in a very short time. Any scripting language that's OO enough to allow you to call C++ objects directly is very cool in my book. To do it in perl? Yuck. Not fun at all. I've heard good things about Python from other people too.
But I've been stuck in java-land for a while. I was convinced that it would help me find work. Now I don't even want work in Java anymore. I hate the language, and none of the Java applications I've used are very high quality. That's because they're all built on top of crap-code. Lots of extra stuff to work around limitations in the language.
Python is a beautiful language. It's so much simpler than other languages, but you can do so much in it!
I'm making slow progress on my own - I'm sure it would be faster if I was working with someone... But anyway, I wrote my first class a couple of days ago. It's called "ArgumentClinic". You're supposed to make monty python references in your code, so that's mine. It's a command-line argument helper-class, which is derived from the built-in list class. Makes your main programs much simpler (for the argument processing, anyway). Kinda like getopt(), which exists in all languages (perl, shell, posix c, and python) but it's not very object-oriented. I wanted a tool that can give me arg processing for each option on a single line of code.
so for example, you can do this:
python mycommand.py -v -o outputfile.txt -s file1.txt file2.txt -p -q file3.txt file4.txt ..
And process these arguments in an order-independent way, with default arguments, creating and initializing your own variables at the same time. It's a little design pattern that demonstrates also how derive from Python 2.3 built-in classes such as "list" which was previously (python 2.1) not possible.
So for example, this statement al = ArgumentList(sys.argv[1:])
# default value=0, but if -v is present, find and remove it from the list. verbose = al.getSwitchArg("-v", 0)
# default value = 0, but if -o is present, find and remove # switch and argument from list, return argument outputfile = al.getSwitchArg("-o", "default-outputfile.txt")
Anyway, you can see the sourcecode here .Current Mood: Bass Communion - Wide Open KillingField
Leave a comment | |

| Apr. 24th, 2004 04:18 pm XUL - Luxor Another interesting framework for building GUI/web apps I came across in my search is Luxor, a framework developed by someone who also takes great efforts to use the best tool for the job - XML for layout of GUI, and python for scripting, and Java because, well, there is this huge library of stuff you can reuse in Java.
http://luxor-xul.sourceforge.net/talk/vanx-jul-2002/slides.html
Ah, it's so hard to choose... Leave a comment | |

| Apr. 24th, 2004 02:52 am What I read about today...
My knowledge of Ant is decent but not great (yet). I just discovered
that there is an import tag, which should help me a lot in
modularizing my ant build scripts. Ant was definitely not usable or modular enough in version 1.5.
Bruce Eckel thinks that Ant is a total mess, and we shouldn't be scripting in XML, and build scripts should be generated anyway. He's got a point. But maybe he hasn't used the import statement yet. His approach is a little different from Maven,
but Maven is more of an extension on top of Ant, rather than a replacement.
I'm java-blocked though. Every time I sit down to code, I'm overwhelmed by all the competing but similar APIs out there. My friend Dan sent me a link to
xpetstore the reimlementation of the petstore application using all open-source Java tools (as opposed to the sun version, which uses different APIs). Argh. This divergence makes me sad. But if I was going to do anything in Java, I think I'd start with this application.
Java 1.4 really sucks. Java never had multiple inheritance, but there are situations where it sure would come in handy! But because of that, we have all these complicated pre processors for Java. It's an incomplete language. Here is an interesting hack - aspect oriented programming - it addresses a bunch of shortcomings in the Java language which have been addressed in JDK 1.5 (as well as QT for C++).
Which reminds me - for those of you interested in Java, JDK 1.5, Sun's latest java offering is really quite brilliant - it's such a pity that they didn't have these features in the compiler years ago.
When it gets out of beta, Java will have meta-data, generic types (like c++ templates), variable arguments, enums, autoboxing and unboxing between between primitive (int) and object-oriented (Integer) types. It's really impressive. What a shame JDK 1.5 didn't come out ages ago - now we have all this horrible old Java code. eeeeewwwww.....
I get so overwhelmed at all the different directions I can go as I contemplate building a new system in Java. Basically, you gotta start off modifying an existing *system* - the tricky part is getting the components installed, once you have that, you customize it. I've spent a lot of time wrangling with Eclipse, but relatively little work done (although for XML/Relax-NG development it is really the cats pajamas).
Sometimes I think why do I want to reuse any messy JDK 1.4 code? So much of it was written to get around the stupid limitations of the language. If I can choose a new language to learn, why not use a prettier more elegant language. One that supports metadata and multiple inheritance right from the start. C++ is a hack on top of C, and QT is a hack on top of C++.
Thinking more about nessus suggestion that I just scrap Java and go for Python is an OO scripting language which is supposed to replace Perl. A lot of old die hards have to die first before that will happen, but Python has a lot of promise. So I started researching, looking for a good back-end framework for developing web applications in Python, because that's really the thing I would be otherwise doing in Java. I still need to make sure the components I need are there. So, which one to use? There's Zope, a very impressive web development/content management framework, with built-in storageability of XML, Objects, and Relational links. If I start using that, I would really like to work with someone else on it so I can ask questions and discuss it. Anyone else into Zope?
Another approach is Roadkill,
a way to embed Python inside web pages. Might be simpler - I might use that first since I'm learning the language. But for some reason I'm drawn to Zope. I need to read up on it more first...
It's even possible to write custom build tasks in Python instead of Java. And apparently it's quite easy to call
Java and C++ methods from Python - it seems to be the "grand controller" of scripting languages.
I'm already using Jedit which has a built-in jython interpreter, so I don't stick with my favorite editor. I guess I am ready to go.
Leave a comment | |

| Apr. 21st, 2004 12:31 am XSLT issue. Todo: Figure out how to get XSLT to generate JSP tags from my docbook customization layer. Currently, it outputs the JSP strings as literal characters.
I started a discussion thread on the
Docbook Mailing list, but I have not resolved the issue yet.
Once this is done, I will be able to include JSP code from my docbooks, which will put up dynamic content in the middle of these pre-generated web pages. That should be pretty cool. Leave a comment | |

| Apr. 19th, 2004 01:22 am jboss configuration? Anyone know how to make JBOSS process .html files like it processes .jsp files on the server-side? I want to stick some JSP tags in some HTML files which are generated from docbook and it seems that Jboss is only doing that with .jsp files at the moment....
PS: Just downloaded the Jboss IDE for Eclipse - looking forward to trying it out soon! Time to learn about xdocklets! Leave a comment | |

| Apr. 18th, 2004 12:00 am Open Source dev communities There are so many open-source development communities, the trick is to know which ones make reusable bug-free components, that are tested and used by a lot of other people. Those are the ones that might save you time.
Everybody knows (or should know) about http://sourceforge.net/, and if you don't, you should. It's the largest host of open-source tools that you'll find on the net. Here is a french site http://forge.objectweb.org/ that develops a J2EE plugin for Eclipse. I haven't really tried it yet, but it's on my bookmarks list so I will one of these days. http://www.java.net/index.html is the open-source community hosted by sun.com - many of the standard APIs started out as open-source projects here. http://www.gnu.org/directory/ is a pretty good directory of free software, funded by UNESCO. IBM is jumping into the game too, with their developer works site. http://www-136.ibm.com/developerworks/opensource/ More here when I think of them... Leave a comment | |

Back a Page
|
|