Monday, February 25, 2008

Status of various things:

So, I've got the graph all set up, now I just need to re-dump the SWF so I can have a transparent line and points of a different color, so it actually looks like a scatter-plot.

Open Flash Charts is pretty buggy and under-documented, but I guess that's why it's free. Shame that it's not got the big enough following for people to actually make commits to it though.

I've figured out a way to serialize my data for the tag recognition. I just have to set up a vendor folder with an init.rb in it to do the includes, and then I'll just Marshall.dump(data) into a text field in the db. Trivial process for getting it back out, and doing a lot of the serialization myself takes some of the rails processing power out of it - I trust my own implementations a lot more than Rails' at this point.

The only thing left to do after that is to clean up how comments are displayed and generated, and then to create a tagging page for 'learning mode.' I still don't know how I'm going to implement LSI yet, but I'll figure out a way to make it work.

Monday, February 11, 2008

OpenCalais

Not to be confused with 'open Cialis'

http://opencalais.com/page/documentation

Ahh, the joy of having lots of work to do and having everyone already have done it for you.

Thursday, February 7, 2008

Completehero.com

So I just heard back from Completehero.com regarding a letter I sent them about maybe piggy-backing on their site. Unfortunately, they can't host user-submitted content, however, they say they'll happily work out some sort of cross linking.

This, however, means I'll need to either work on some design or find someone else who will. I'll also need to buy some hosting - which as far as I can tell for something that'll support a rails application is like 10 bucks a month.

It's also a damn good excuse to get my own web hosting, which I've been threatening to do for a good while now anyway. It'd be a good place to host the little scraps of code that I've written, as well as a CV. I'll have to buy some space later on this week, and do some design work in studio.

Speaking of studio, I've managed to get the first 'iteration' of the website done: a system that allows user-submitted posts, comments, and gives each tag a random x, y value. Total time invested: 1 Hour, 10 minutes. And most of that was looking for documentation. Goddamn, I love Rails.

The next system is going to be something stupid easy: implementing the LSI libraries to try to parse the text and tag it. The easiest way, I think, is going to be to create another model for 'tags' that's just a set of binary flags... then hook the baynes filter to it and make a category for each character trait of a hero. I'll probably end up hacking apart the code so that it replaces references to flat files to a database query - the problem is, I don't want to hammer my database 50 fucking times for each post. I'll get the chance to hold off on that until I actually crack into the source and figure out how it works.

Wednesday, February 6, 2008

Ruby pass by Reference

As part of my pragmatic programming experience, I've been learning and falling in love with Ruby.

However, I'm also quickly being won over to the very disciplined approach to programming that the RESOLVE-C++ discipline brings to the table. I'm not ready to make the full-fledged jump to C++ just yet, but it would be very nice to add some of the concepts that make that discipline very efficient into Ruby.

One thing I hate about Ruby is that it doesn't support pass by reference. For example:


def foo(bar)
bar += 1
end



Returns the value of bar + 1, as expected. However, outside of that block, bar still equals it's initial value, since Ruby has just copied the value into the subroutine, executed, and then returned it.

However, if we write it like this:


def foo(bar)
bar += 1
binding
end



Then we have a method that returns a set of bindings... fundamentally useless, until we pair it with the eval command:


mybar = 1
mybar = eval("bar", foo(mybar))
mybar.should == 2



We're basically asking the interpreter to return the value of R in the context of foo(mybar)... which as we discussed, now returns a set of bindings. So, instead of bar being a variable out of scope, it's right there as the value of the parameter mybar + 1.

If you want to implement a method that uses this hacked pass-by-reference, you can just return bindings. But, if you wanted to only have this functionality some of the time, you can just copy the code to a new method of similar name with an appended _binds that returns the bindings.

Monday, February 4, 2008

On Heroes

My first post to Vir Ex Anthropos: Hero From Humanity

It would behoove me to first describe my goals for this project:

1) To explore the idea of what it means to become a hero.
2) To act as a development journal to my 'hero indexing' application that will be discussed shortly.

Due to the two-fold nature of the project, discussion will most likely alter between technical exposition and prose, between right-brain poetry and left-brain poetry.

Were I an ancient Greek, I would now invoke a muse. As I am a modern Christian, I will invoke a modern translation of an ancient passage: Humanists and Atheists, vouchsafe I have left my soapbox in my other, more private journal.

Hebrews 11:32And what more shall I say? I do not have time to tell about Gideon, Barak, Samson, Jephthah, David, Samuel and the prophets, 33who through faith conquered kingdoms, administered justice, and gained what was promised; who shut the mouths of lions, 34quenched the fury of the flames, and escaped the edge of the sword; whose weakness was turned to strength; and who became powerful in battle and routed foreign armies. 35Women received back their dead, raised to life again. Others were tortured and refused to be released, so that they might gain a better resurrection. 36Some faced jeers and flogging, while still others were chained and put in prison. 37They were stoned; they were sawed in two; they were put to death by the sword. They went about in sheepskins and goatskins, destitute, persecuted and mistreated— 38the world was not worthy of them.

What then of heroes? Those who by faith, in God and in His promises, stood as on rocks in the desert, who both turned aside the blades of swords and were slain, who both died and lived... The author of Hebrews has not time to tell of their stories, and now do I. But the incredible thing about this passage, in context, is that the author insists that all can aspire to these qualities. All can grasp hold of his immortality, all can put aside the temporal and the failing to put on eternity, and walk in victory. And, though I have not the time nor the diction nor the meter to describe their exploits, the watching world does.

And has.

And, should my project have it's way, the watching world will: and as Hebrews 13 goes on to preach didactically: it will not forget those who were imprisoned, or jailed, or persecuted for their stand on faith and on heroism and on courage. Their humility and their sacrifice.

My project will be a collaborative effort by any who have the time to take fingers to keys and spill their hearts on behalf of those too noble to aggrandize self by spilling their own. The world will tell tales of the exploits of heroes, mothers and fathers, brothers and sisters, firemen and doctors. They will tell stories of heroes. And the world will listen.

And my part will be to develop a system to process these stories, to collect them and to index them, to link them, to show that we all tell of a story of, to borrow from Campbell, a Hero with a Thousand Faces - and perhaps, with luck, and dedication, we will all see the development of a new sort of hero, not one born of ancient myth and bards, but of modern day Man and Woman.

We will see a hero in the very face of mankind.