Archive of August 2008
11:28 AM | 0 CommentsIt is always a simple matter to drag the people along, whether it is a democracy or a fascist dictatorship or a Parliament or a Communist dictatorship. …voice or no voice, the people can always be brought to the bidding of the leaders. That is easy. All you have to do is to tell them they are being attacked, and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country.
PHP vs. Python Revisited
After some thought, I’ve decided that I won’t switch back to PHP. I’ve realized that the major roadblocks I’ve been running into recently have all been related to the way plugins hook into the braindump core. In fact, I’ve been spinning my wheels for months with issues related to braindump’s extensibility. Switching back to PHP will solve the two problems listed in the previous post (because of how PHP includes source code into one big namespace and sends stdout to the web) but I’ll inevitably run into more problems with extensibility in the future — trying to think ahead and allow for all the possible things a plugin might want to implement is just a huge time suck.
So Python isn’t my problem — my problem is language-independent and therefore wouldn’t be fixed by switching back to PHP (phew, didn’t want to have to do that). My problem — what’s prevented me from implementing any major new functionality in months — is that I’m spinning my wheels in thoughts about extensibility instead of actually implementing new functionality. Now extensibility and modularity are great, but doing them well just takes so much time and thought, as well as a well-defined idea of what the core should be: its boundaries, its implementation, etc. I don’t have this good of an idea yet, and I won’t for a long time. As the project page says, the purpose of braindump is to experiment; it’s not meant to be a polished product for mainstream use. Furthermore, even if I did build braindump to be polished and extensible, no one would write plugins. Let’s face it, I only know of one person ever even downloading and installing it.
So, I might as well stop spinning my wheels in extensibility issues and get moving! Some things I want to do:
- view and edit data from multiple pages in a table
- import metadata about iTunes songs from iTunes XML export files (already implemented in the PHP version)
- more comparison operators — right now there’s just ‘is’. I want ‘>’ and ‘<’ for numbers, maybe regular expression matching, maybe ‘before’ and ‘after’ for dates and even ‘north of’ ‘south of’ (etc) and ‘within x miles of’ for locations
- visualizations
- Google Maps
- SIMILE timeline
- Graphs/Charts (probably with the Google Chart API
- interface enhancements (autocompletion, etc) — making the interface as powerful and intuitive as possible
…and I’m sure I’ll think of more. I’m excited about this new mindset. Hopefully it’ll help me make cool stuff faster.
10:16 PM | 0 CommentsPHP vs. Python
I’m running into a lot of problems with my python port of braindump — things that were easy with PHP are slowing me down a lot. I’m considering switching back. Here’s my brainstorm: (more for me than anyone else)
problems I’m having with python:
- importing
- importing plugins was solved, but importing modules from mako is another nightmare because it imports them from mako’s runtime namespace.
- finding the file and managing the namespace is so easy in PHP!!
- plugins
- instead of just printing to stdout, they have to do a context.write(). god knows how and when I’ll get the context object
- hosting
- won’t run on GAE because graphstore reads & writes with pure SQL!
- PHP hosting is so damn easy!!
- HTTP stuff
- cookies, sessions, GET/POST vars, headers all built into PHP; need some python framework
- static files are a breeze because they’re right there next to the PHP — don’t need to pass through the program or anything and can be gzipped and stuff with the server
reasons why I switched:
- libraries!
- diff match patch
- diff not needed cuz don’t really do revisioning; maybe fuzzy match for search/autocompletion…
- montylingua, wordnet, conceptnet
- remains to be seen how these would be integrated. besides, python scripts could always download, process, and upload with XML-RPC…
- PHP pretty much has everything I need anyway
- templating (Twig), YAML, JSON, XML-RPC, XMPP, strtotime, textile, syntax highlighting, image manipulation, etc
- diff match patch
- language itself
- python syntax is undeniably better. I’ll miss list comprehensions, no semicolons, and whitespace instead of curly braces… but PHP is good enough.
- the PHP console never really worked for me…
- standaloneness
- ideally, you would download braindump, unzip it, start it up with
python braindump.py, and go to http://localhost:8080/. In reality, you would have toeasy_installmako and cherrypy and stuff, but that’s still easier than installing a PHP-enabled web server
- ideally, you would download braindump, unzip it, start it up with
- ground-up design of web architecture
- WSGI, FastCGI etc all designed, not built up ad hoc like PHP
- PHP was meant to just be embedded; MVC and routing and stuff are just done with (but the hacks work)
what I’ll do if I switch back to PHP
- integrate Twig. I don’t think I can go back to living without a templating engine. they’re so nice.
- de-kludgify my framework’s whole routing system
- restructure the directories to make more sense
- work on graph.php
- make it into a class that is instantiated (
new Graph('path/to/database.sqlite');) - implement filtering with multiple conditions
- use pure SQL instead of going through my kludgy object-oriented database library? exception/null handling less complicated…
- make it into a class that is instantiated (
It will be hosted on the cloud and accessible across all devices. It will place more emphasis on social interaction, social filtering, and collective intelligence. It will provide a very powerful and extensible data model with support for both unstructured and arbitrarily structured information.
— Nova Spivack (who is the man) on the Future of the Desktop. The current desktop leaves a lot to be desired, and watching it integrate with the web will be awesome.
Kiva
A microlending site: lend entrepreneurs in Africa just the little they need to get off the ground. Microlending was already a good idea; making a site is going to really get things moving!
09:11 PM | 0 CommentsThat is to say, the genealogy of Web logs points not to the world of letters but to the early history of museums — to the “cabinet of wonders,” or Wunderkammer, that marked the scientific landscape of Renaissance modernity: a random collection of strange, compelling objects, typically compiled and owned by a learned, well-off gentleman. A set of ostrich feathers, a few rare shells, a South Pacific coral carving, a mummified mermaid — the Wunderkammer mingled fact and legend promiscuously, reflecting European civilization’s dazed and wondering attempts to assimilate the glut of physical data that science and exploration were then unleashing.
— from Portrait Of The Blogger as a Young Man, an early (2000) mediation on what a blog is. Pretty on-target for me, at least.
From why the lucky stiff‘s Shoes tutorial. How does he support himself, writing open source hacks and making crazy websites and cutout dioramas all day?
12:06 PM | 0 Commentslink (Via ReadWriteWeb) Freebase is really slick, and this new Parallax interface is really powerful. I like the integration with Google Maps and the Simile Timeline. Sometimes it looks like braindump will just become a self-hosted version of freebase. Oh well.
02:25 PM | 0 CommentsGoogle’s chipper, corny videos annoy me. Why can’t they just quietly be awesome?
09:52 PM | 0 CommentsI would like to bring to people something like happiness. I would like to discover a method so that if I want it to rain, it will start right away to rain. If one of my friends is ill, I’d like to play a certain song and he will be cured; when he’d be broke, I’d bring out a different song and immediately he’d receive all the money he needed.
— John Coltrane via Wikipedia. It’s interesting how Coltrane saw music as a tool — although he never cured anyone with a song, he was one of the most influential musicians ever.
Braindump 0.3
So I finally got around to zipping and uploading the PHP trunk. It’s actually a really big advance from 0.2, and the first python version, 0.4, probably won’t add much to it and will use the same general code structure. Improvements from 0.2:
- Edit page metadata and descriptions inline with Jeditable instead of a separate edit page
- Simple, effective Graph API instead of overly complicated and buggy object-relational mapper (see this post)
- access the Graph API over XML-RPC
- Filter page list based on criteria (“color is red”, “artist is the beatles”) — this is a central promise of braindump; finally got around to implementing it…
- Export entire braindump or just a list of certain criteria into a YAML file. Imported with the Import plugin.
- Plugin architecture. Comes with:
- Import — import the contents of a YAML export file
- Table View — view data as a table
- Facts — view all the information in braindump in sentence form
- Textile — textilize page descriptions
- iTunes Import — import songs, artists, albums, and playlists from an iTunes XML (plist) export file
- Opensearch — add braindump to your Firefox search box (the little blue aura)
- ATOM feeds for page lists — either all pages or only those with certain criteria
- Alternate formats for pages: YAML, JSON, and RDF
- Simplified URL structure
- Overall cleaner and smarter code
So there it is, the last PHP release. A couple problems that I don’t feel like fixing, but it’s fairly solid. Coming up: 0.4, in Python! w00t
01:19 PM | 0 CommentsThe Blank Slate
For the past year or so, off-and-on, I’ve been reading The Blank Slate by Stephen Pinker. It’s really, really good. Pinker’s central thesis is that incorrect theories of human nature are at the root of many of society’s most pressing problems, and that we can move forward by basing our policies and behaviors on a new theory of human nature derived from scientific investigation, rather than armchair philosophy. To flesh out this argument, Pinker must move through some of the most controversial territory there is, but he consistently makes the journey with refreshing rationality and intellectual honesty, and a complete lack of mud-slinging.
Although he steers clear of the God vs. Science debate, Pinker makes it clear that the Judeo-Christian theory of human nature (dominant in this country and much of the world) is outdated and incorrect, and that we need to move past it. That’s old news to most intellectuals, but Pinker also pans the Enlightenment view, commonly held among intellectuals, that at birth the human mind is a “blank slate” to be written upon. (the book’s title is not an endorsement of this view, but an example of “The Modern Denial of Human Nature”, which is the book’s subtitle) Pinker then charts a course through the Nature vs. Nurture debate using the findings of evolutionary psychology, behavioral genetics, neuroscience, and cognitive science (“bridges between biology and culture” and “the new sciences of human nature”, he calls them) to place the line somewhere between the two extremes: all people have the same innate mechanisms, which allow them to learn an infinite number of different things and behave in an infinite number of different ways.
He then shows how this new theory of human nature, grounded in science (and therefore not beyond question and disprovement, as are the religious theories) can help us make progress on the most difficult issues of our society, such as politics, violence, abortion, stem cells, and education.
I’m not done yet — the book is so packed with big ideas and interesting research that it’ll be a long time until I’ve fully digested it. But I won’t miss the rest, and I’ll probably turn to it when the presidential campaign and war and American society become too much — the book’s rationality, intellectual honesty, and complete lack of mud-slinging on the issues that matter is just what the doctor ordered — for me, for this country and for this world.
12:09 PM | 0 CommentsThe only remedies against race and prejudice are enlightenment and education. This is a slow and painstaking process.
— Albert Einstein
Common sense is the collection of prejudices acquired by age eighteen.
— Albert Einstein