A Nickel Bargan: Your Computer’s Memory Is Cheaper Than Your Own
June 18th, 2007My MacBook is becoming dangerously slow. It is cutting into my productivity. With Eclipse and Firefox open, I am unable to really do anything. Programming requires taking notes as I go along. I keep my notes in Backpack. If switching from Eclipse to Firefox takes 30 or more seconds, I lose my train of thought. It is ridiculous.
Do you think that’s petty? A minor inconvenience? I don’t think so. If I were writing a book at a typewriter and something occurred to me, I could reach for a pad of paper and scribble a note, and move on.
Imagine though, I had to ask my dog to run to the other room and fetch my pen and paper. I sit and repeat the note in my head, so I don’t forget. Meanwhile, I track the progress indicator of canine claws on hardwood.
Nothing like that spinning beach ball, or hour glass, or watch, to mesmerize you while you repeat your tiny brainstorm like a mantra.
You switch the focus of a powerful machine to a menial task. Storage. You may have been running full bore on your writing, spreadsheet, programming, and now you’re sitting there repeating to yourself, tell Paul about the lunch, tell Paul about the lunch, tell Paul about the lunch.
Of course, by the time Firefox comes up, I’m thinking neither about work or lunch. Whatever fancy bauble is on the Google start page commands my attention.
Instead of walking up to you with your pen and paper, the dog has returned with a brass band, everyone you forgot to stay in touch with since high-school, and what he claims is a perpetual motion machine.
This is a real productivity killer.
A great many people and things that beg your attention, sprung upon you after a wait just long enough to muddle your train of thought.
Update: I ordered 2GB of memory for my MacBook from crucial.com. At $82.00 it seems like a bargain, down from the $205.00 that it once was. Let’s see how much faster the MacBook becomes.
comments
Sunday Evening in the Marigny
June 17th, 2007Spent the afternoon and evening at Sound Cafe. Tweeting on occasion. Developing a filter for Twitter and RSS. Not in code. An emotional filter. Something along the lines of, looknig Finally, created a forum for Civic Intelligence Camp, that is merely a blog post. Need to simmer on how to organize, but considering how web savvy the key organizers are, might as well practice what I preach. I’m going to go by Bacchanal and see if they’re doing the chef in the courtyard thing so I have something worth Tweeting. Didn’t get all that I wanted done done, but the day is ending. I cannot keep it from ending. Tomorrow, I start fund raising. Need my rest.
Made To Stick
June 17th, 2007I have purchased the No Asshole Rule. I read some of it. It is a good book with a good point. At the heart, when an organization builds itself around prima donnas, the net effect is bad for the organization. I’ve found the blog of the author, Bob Sutton. In his blog, he is recommending Made To Stick by Chip Heath and Dan Heath. I am developing an RSS discipline. I do not want to add Bob’s blog to my list of feeds, and make myself unhappy. Instead, I am going to take the time to write about his blog and the post that caught my attention, while it has my attention.
Robin Malta Murdered
June 14th, 2007Or so it seems. He is the man who cuts my hair. He had a salon called Salon ‘d Malta on Dumaine in the French Quarter, toward the Marigny Triangle. He liked country music, but the people around him did not. “Robin Malta, 43, was found dead in his house at 634 Port St. between Chartres and Royal streets when his sister went to check on him”, from the Times-Picayne.
Planners Network 2007 Conference
June 7th, 2007Last weekend I spoke at the Planners Network 2007 Conference on a panel hosted by Jennifer Ruley. Karen Gadbois, K.C. King, Karen Parsons, Daniel Samuels and I spoke about the recovery from the citizens perspective. One of my favorite bits was when someone asked us what we thought of the UNOP and the response was universally underwhelming. I’m certian that the experience is overbilled in planning circles. I’m quite relieved that we’re on the same page on this matter, that the UNOP was a distraction, a fourth process that was only appreciated for being the final process.
Meet the Press
June 7th, 2007A journalist from a major newspaper called me asking for help on local response on the Jefferson indictment. I did not have a response myself. I sent an email with a lot of CC’s, asking people to give their response directly to the jouranlist. The pitch was, if you want to shape the media’s perception of New Orleans, here is your chance.
This has been generally how I handle a request for something quotable. I forward it. It is the same notion as the web. If you want people to return, send them away.
It worked out well. There were three people who gave a considered response.
Self-Actualization
June 3rd, 2007Is overrated. You would think that I would be over it by now.
Serialization Conundrums
June 2nd, 2007Strata is a B+Tree that I’ve written in Java. It implements Java serialization. Not to store the leaves of the tree, but to store the definition of the tree itself.
BentoStorage.Creator newStorage = new BentoStorage.Creator();
newStorage.setSize(8 + 8);
newStorage.setReader(new MyRecordReader());
newStorage.setWriter(new MyRecordWriter());
Strata.Creator newIndex = new Strata.Creator();
newIndex.setStorage(newStorage.create());
newIndex.setExtractor(new MyFieldExtractor());
Strata strata = newStrata.create();
Bento.Creator newBento = new Bento.Creator();
FileOutputStream outFile = new FileOutputStream(new File("index"));
ObjectOutputStream out = new ObjectOutputStream(outFile);
out.writeObject(strata);
out.close();
Here is how MyReader might be defined.
public final class MyReader
implements BentoStorage.Reader, Serializable
{
private final static int serialVersionID = 20070602L;
public Object read(ByteBuffer bytes)
{
return new MyRecord(bytes.getLong(), bytes.getLong());
}
}
What if I felt like using this from Groovy and taking advantage of closures?
BentoStorage.Creator newStorage = new BentoStorage.Creator();
newStorage.size = 8 + 8
newStorage.writer = { object, bytes ->
bytes.putLong(object.key)
bytes.putLong(object.version)
}
newStorage.reader = { bytes ->
return new MyRecord(bytes.getLong(), bytes.getLong())
}
Strata.Creator newIndex = new Strata.Creator()
newIndex.storage = newStorage.create()
newIndex.listExtractor = { txn, object ->
Person person = txn.heap.get(txn.unmarshaller, object.key)
return [ person.lastName, person.firstName ]
}
Strata index = newIndex.create()
The problem is that Groovy closures cannot be serialized. Now I cannot serialize Strata. This struck me as a setback for Groovy support, and a problem specific to Groovy, until I stubbed my toe on annonymous inner classes.
Strata.Creator newIndex = new Strata.Creator();
newIndex.setStorage(newStorage.create());
newIndex.setExtractor(new FieldExtractor()
{
public Comparable[] getFields(Object txn, Object object)
{
MyRecord record = (MyRecord) object;
MyDatabase database = (MyDatabase) txn;
Person person = database.getHeap()
.get(database.getUnmarshaller(), record.getKey());
return new Comparable[] { person.getLastName(),
person.getFirstName() };
}
});
Strata index = newIndex.create()
Even if I make the anonymous inner class Serializable, perhaps by deriving from an interface that mixes FieldExtractor and Serializable the class that defines the method that builds the Strata must also be serializable. I’m serializing the hidden reference to the containing class. Unnecessary code. Pointless code. Not really part of the data structure.
This must be a conundrum faced any library that could be built using anonymous inner classes.
I wanted my creational pattern to follow the notion of creatation of the object through construction using the Creator classes once. Thereafter, the Strata is serialized and deserialized.
I do not have to get rid of this pattern, but in order to implement it, people will have to avoid the use of anonymous inner classes to define their readers, writers, and extactors. The should always create static classes that implement Serializable.
If they do want to use anonyomous inner classes for readers, writers and extractors, they can simply repeat the creation of the object through construction using the Creator classes. Same goes for the use of Groovy closures.
This muddles an assumption that I had higher in my application stack. I am working on an object database that I call Depot.
The object database I’m building based on Strata stores the Strata B+Tree definitions in a heap. I created a bridge interface for the FieldExtractor, where the object database fishes the object out of the heap, and so only has one parameter, the object found in the heap, and does not pass in the application specific transaction context object.
public class Strata
{
public interface FieldExtractor
{
Comparable[] getFields(Object txn, Object object);
}
}
public class Depot
{
public interface FieldExtractor
{
Comparable[] getFields(Object object);
}
}
I’d written example code to imagine how the API would work. With Strata I’d always made Strata.FieldExtractor static, because it was always so complicated, turning a key into an object. With Depot that was taken care of, so the application only had to crack the object and return the array of @Comparable@S upon which an alterate index would sort a set of objects.
Furthermore, I’d decided that for a desktop application, it would be nice to keep the definition, trees and heap in one file. Not thinking, I’d made so that the initial version of Depot demands that the Depot.FieldExtractor be Serializable. My code examples of how clever I am, to define an index in a few short lines of code, did not work out.
It is not so much a conundrum. I merely need to make this one file format optional. The definition could be deserialized from the one file, or it could simply be rebuilt. It’s an application developers choice. If the application developer choses to make her @Depot.FieldExtractor@S static and serializable, then I can provide a static function that will create a file store for use as a heap, that tucks that definition into a longish header field.
I’m sure you could serialize a compound Swing view after you’ve built it, but you could also build it each time and only serialize the user preference settings, like the position of a window splitter.
If anyone out thinks that I misunderstand the trade off, please let me know. It caught me off gaurd. I was going to trouble the Groovy listserv with some questions, but this understanding came to me while I was getting around to that.
| Next Entries » |



