The All Your FOAF toy indexing tool has been rewritten in Ruby. The original was a standalone short Perl script that showed how a Web of RDF documents can be explored using pretty simple code. The Ruby re-write uses the RubyRDF library, and has a nicer architecture.
See ayf.rb for the main code, myScutter.rb for an example crawler that uses it, and who.rb for a 25 line demo script that shows a custom crawler-based app (sample output).
This shows one of the attractions of Ruby as a scripting language. You can have one page hacks (like my original Perl script, ayf.pl) and migrate them smoothly into more reasonable chunks of OO-ish code. The result of rewriting this in Ruby (and using a proper RDF library) is that scripts such as who.rb are easier to create and extend, since all you have to do is write a snippet of code that gets called when each RDF document has been parsed.
This is of course still pretty basic. A better RDF Web indexer would need better facilities for controlling link-following behaviour, caching etc., and needs to be hooked up to persistent RDF storage systems. But hopefully it'll show the fundamental simplicity behind some of this stuff...
Posted by danbri at December 12, 2002 01:54 PMSeth Roby graduated in May of 2003 with a double major in English and Computer Science, the Macintosh part of a three-person Macintosh, Linux, and Windows graduating triumvirate.
Posted by: Andrew on January 20, 2004 07:21 AMThis back and forth is an important concept to understand in C programming, especially on the Mac's RISC architecture. Almost every variable you work with can be represented in 32 bits of memory: thirty-two 1s and 0s define the data that a simple variable can hold. There are exceptions, like on the new 64-bit G5s and in the 128-bit world of AltiVec
Posted by: Josias on January 20, 2004 07:21 AMBut some variables are immortal. These variables are declared outside of blocks, outside of functions. Since they don't have a block to exist in they are called global variables (as opposed to local variables), because they exist in all blocks, everywhere, and they never go out of scope. Although powerful, these kinds of variables are generally frowned upon because they encourage bad program design.
Posted by: Ellen on January 20, 2004 07:22 AMBeing able to understand that basic idea opens up a vast amount of power that can be used and abused, and we're going to look at a few of the better ways to deal with it in this article.
Posted by: Roger on January 20, 2004 07:22 AMTo address this issue, we turn to the second place to put variables, which is called the Heap. If you think of the Stack as a high-rise apartment building somewhere, variables as tenets and each level building atop the one before it, then the Heap is the suburban sprawl, every citizen finding a space for herself, each lot a different size and locations that can't be readily predictable. For all the simplicity offered by the Stack, the Heap seems positively chaotic, but the reality is that each just obeys its own rules.
Posted by: Wymond on January 20, 2004 07:22 AMWhen the machine compiles your code, however, it does a little bit of translation. At run time, the computer sees nothing but 1s and 0s, which is all the computer ever sees: a continuous string of binary numbers that it can interpret in various ways.
Posted by: Theodosius on January 20, 2004 07:22 AMThis is another function provided for dealing with the heap. After you've created some space in the Heap, it's yours until you let go of it. When your program is done using it, you have to explicitly tell the computer that you don't need it anymore or the computer will save it for your future use (or until your program quits, when it knows you won't be needing the memory anymore). The call to simply tells the computer that you had this space, but you're done and the memory can be freed for use by something else later on.
Posted by: Catherine on January 20, 2004 07:22 AMInside each stack frame is a slew of useful information. It tells the computer what code is currently executing, where to go next, where to go in the case a return statement is found, and a whole lot of other things that are incredible useful to the computer, but not very useful to you most of the time. One of the things that is useful to you is the part of the frame that keeps track of all the variables you're using. So the first place for a variable to live is on the Stack. This is a very nice place to live, in that all the creation and destruction of space is handled for you as Stack Frames are created and destroyed. You seldom have to worry about making space for the variables on the stack. The only problem is that the variables here only live as long as the stack frame does, which is to say the length of the function those variables are declared in. This is often a fine situation, but when you need to store information for longer than a single function, you are instantly out of luck.
Posted by: Warham on January 20, 2004 07:22 AMThis back and forth is an important concept to understand in C programming, especially on the Mac's RISC architecture. Almost every variable you work with can be represented in 32 bits of memory: thirty-two 1s and 0s define the data that a simple variable can hold. There are exceptions, like on the new 64-bit G5s and in the 128-bit world of AltiVec
Posted by: Janikin on January 20, 2004 07:23 AMWhen compared to the Stack, the Heap is a simple thing to understand. All the memory that's left over is "in the Heap" (excepting some special cases and some reserve). There is little structure, but in return for this freedom of movement you must create and destroy any boundaries you need. And it is always possible that the heap might simply not have enough space for you.
Posted by: Valentine on January 20, 2004 07:23 AMsms sprüche
Posted by: handylogos on January 22, 2004 01:30 PMwin $100,000
Posted by: play online golf on January 23, 2004 08:03 AMnice site
Posted by: philadelphia hotel on January 23, 2004 08:03 AMnice site
Posted by: escorts on January 23, 2004 08:04 AMexcellent
Posted by: online casino on January 23, 2004 08:04 AM