so a lot's been going on but not a lot's been happening.
to start with; the XML.
from the beginning, i had planned to implement something to generate the XML by very cleverly manipulating strings with bizzare regular expressions. i didn't need it to be perfect or something i could really build on later, i just needed it to work. after the main aspects of goffe made more progress i could incorporate building the XML into java, so just getting reliable XML that would validate against a DTD was all i was concerned with. and i figured doing it through strings would be simple.
the best tool for the job was awk. unfortunately i learned quickly that awk wouldn't separate fields based on whitespace; whenever it found a match, it would collapse all whitespace around it. that collapsed whitespace was the way awk would determine its nesting level, so i was pretty screwed. i fiddled around with it, pretty extensively, such as examining trailing slashes on folders, etc, but no luck.
so i read more on java. well, java sucks for dealing with *NIX conventions, something they are apparently working on for java 7 (i.e. retreiving user, group, permissions, etc). i really don't want to port my code over to java7 any time soon, so now my back burner tool takes on more importance.
enter perl, which while slightly more verbose than awk, could keep the whitespace i needed. after a week of coding, tweaking, and tuning, i got it working through up to 10 levels of nesting, fairly impressive for manipulating 35000 lines of complicated strings, but not good enough. i am considering continuing the endeavor in perl but without using the strings.
then after my presentation i got an unsolicited email from an anonymous code donor, written in python and walking the filesystem directly instead of using strings. first off, whoever sent it to me, thanks. unfortunately, it doesn't work. i dont have time to play with it right now, but it looks like the way it prints its tags prevents it from nesting, period. so there is exactly one file in every folder, which dont actually correspond to real folders. sorry to be the bearer of bad news, but thanks again for the effort.
and last but not least i considered donating to the tree project, and actually sent them an email. well i heard back not long ago, and apparently they still work on it from time to time. i would really like to contribute, as the versitility of tree is pretty remarkable. if i implemented it in tree, it could be very user defineable, i.e. print attributes or elements, trailing slashes for folders, character sets, the list goes on. so, yeah, i'm going to do that. and hopefully it works.
so languages that XML generation will have gone through: sh/awk, perl, java(ish), python, and hopefully it will find its home in C where it rightfully belongs.
in other news, pete has been working on researching the GUI pretty intensely. i will try to get him to come post on here. we are trying to asses how viable it is to use more than one existing GUI to work on the files (one parses and generates JFrame data, one performs operations) versus start almost completely from scratch with a typical browser. hopefully we will make progress on that soon.
-bryan
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Tuesday, November 17, 2009
Thursday, June 25, 2009
status update 6/25/09
after paving over the initial hurdles last week things have gone incredibly smoothly.
functionality has been added bit by bit and code is almost where i hoped it would be by the end of the month.
works:
takes input and opens corresponding xml file
parses XML, builds nodelist and arraylists of contents of root directory
selection of file or folder by index, opening/rebuilding contents of subdirectories
delete and rename functions for in-memory representation
creates and modifies current working path
input validation, exception handling (every bug i've caught but one)
etc.
to be continued:
fix one nagging exception
start writing changes to file
save new XML upon leaving
work on copy, paste functions, etc.
then onto the GUI.
functionality has been added bit by bit and code is almost where i hoped it would be by the end of the month.
works:
takes input and opens corresponding xml file
parses XML, builds nodelist and arraylists of contents of root directory
selection of file or folder by index, opening/rebuilding contents of subdirectories
delete and rename functions for in-memory representation
creates and modifies current working path
input validation, exception handling (every bug i've caught but one)
etc.
to be continued:
fix one nagging exception
start writing changes to file
save new XML upon leaving
work on copy, paste functions, etc.
then onto the GUI.
Subscribe to:
Posts (Atom)