Here's my Sleepycat Hello World
import com.sleepycat.je.Cursor; import com.sleepycat.je.Database; import com.sleepycat.je.DatabaseEntry; import com.sleepycat.je.DatabaseConfig; import com.sleepycat.je.DatabaseException; import com.sleepycat.je.Environment; import com.sleepycat.je.EnvironmentConfig; import com.sleepycat.je.LockMode; import com.sleepycat.je.OperationStatus; import java.io.File; public class HelloBdb { public static void main(String[] args) throws Exception { String key = args[0]; String value = args[1]; File dir = new File("db"); dir.mkdirs(); Environment env = new Environment(dir, new EnvironmentConfig()); Database database = env.openDatabase(null, "foobar", new DatabaseConfig()); database.put(null, new DatabaseEntry(key.getBytes()), new DatabaseEntry(value.getBytes())); DatabaseEntry foundKey = new DatabaseEntry(); DatabaseEntry foundData = new DatabaseEntry(); Cursor cursor = database.openCursor(null, null); while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS) { String keyString = new String(foundKey.getData()); String dataString = new String(foundData.getData()); System.out.println("Key | Data : " + keyString + " | " + dataString + ""); } cursor.close(); database.close(); env.close(); } }
Of course, the real fun will be running this in a multi-threaded environment and the concurrency issues therein. With Hello World done, it's time to move on to see what else needs to be added to the cookbook.
( Apr 12 2005, 08:57:09 PM PDT ) PermalinkHere's the roster:
With all of the phones these days supporting crude digital video features, it seems like just a matter of time before vblogging comes of age. Er, hold the phone, Google is archiving video clips now. In the meantime, I'm imagining James T. Kirk rambling philosophically to his blog about a recently visited corner of a previously uncharted galaxy and posting video mashups of interstellar foibles.
( Apr 05 2005, 07:55:31 AM PDT ) Permalink
This is what I'm not going to be doing to learn Japanese: Kanji Quiz Toilet Paper This is an extremely extraordinary item, toilet paper with the power to teach! For those who prefer to "sit in the library" this great paper can provide... hours (?) of fun and prepare them for that pop quiz in Japanese class the next morning. Three different methods of learning are provided "multiple choice", "reading", and "philosophical fill-in-the-blank". Written in a soft blue color on white. A superb item for anyone interested in studying Japanese, it's really cool on many different levels.- eBay blurb where this was offered for $4.80 |
|
Clearly Yahoo!360 demonstrates Yahoo!'s competency: building a relationship with its users. All of the web mail, 'My Yahoo!' and 'Yahoo! Groups' user features are basically good personalized outward looking experiences with (more or less) single sign-on. Contrast this with Google's user features: the disconnected islands of GMail, Orkut and Blogger each have separate identities and user populations.
360 adds to Y!'s feature set social networking, blogging and integrates with (some) other Y! features seamlessly. I anticipate seeing Flickr and other innovative features making their way into this soon enough. So it's transforming from a personalized outward looking platform to one for personalized networking. Google's core competency seems to be stuck at "sooner or later, we're indexing everything" -- not that that's a bad thing. Unlocking the world's accumulated knowledge is cool.
So while I don't know if I agree that Yahoo! has overtaken Google, they're both clearly magnifying what they're good at lately. And I'm sure the Googlers aren't sitting still, they've got some smarty pants people there. In the meantime, Yahoo! clearly knows mores about providing a platform for people.
( Mar 31 2005, 12:36:39 PM PST ) Permalink
I am the ripperMore human than human
Man a locomotion
Mind love american
Style
I'm looking forward to subscribing to a tag to follow specific types of events and seeing what EVDB does to identify important events.
( Mar 29 2005, 09:04:27 PM PST ) PermalinkThere was almost a Homebrew Computer Club feel (not that I was there but I can imagine the ambient excitement and ferment) to the mix of people who turned for RoboGames 2005. This is the event formerly known as robolympics and it was heaps 'o fun!
In a future time Children will work together To build a giant cyborg Robot Parade Robot Parade Wave the flags that the robots made Robot Parade Robot Parade Robots obey what the children say There's electric cars There's electric trains Here comes a robot with electric brains Robot Parade Robot Parade Wave the flags that the robots made Robot Parade Robot Parade Robots obey what the children say |
Boy versus Robot The boy has a better CPU but the robot has a blue samurai sword that lights up! |
|
I took a few pictures. This is the kind of endeavor I could imagine sucking up all of my time. For now, I'm content to take an aloof armchair interest in robotics. |
The comment about Technorati's robots.txt is correct. There are no rules there for the tag pages there but in the tag pages themselves have instructed the googlebot with nofollow, this is in the markup:
<meta name="robots" content="index,nofollow" />This won't stop tag spam that's just trying to get accidental clickthroughs (i.e. we know we have some more work to do) but it will deny google juice rewards (which is what they really want). ( Mar 27 2005, 06:17:23 PM PST ) Permalink
The recent interest Technorati has taken in web spam has perhaps inspired the divine. Note the recent appearance of http://jesus-the-lord.blogspot.com/ but linking to it without nofollow is most certainly a sin.
nofollow jesus spamIt seemed pretty straight forward going into the project that I'm working on:
For instance, if Tomcat is serving on the HTTP tier edit server.xml and make sure the URIEncoding attribute (absent by default) is set for the connector.<Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" />The same holds true for letting Apache do the HTTP dirty work and connecting with mod_jk<Connector port="8009" enableLookups="false" redirectPort="8443" debug="0" URIEncoding="UTF-8" protocol="AJP/1.3" />And, by the way, if you have static content served by an Apache server, you probably want this as wellAddDefaultCharset utf-8
Manually dealing with the ASCII escaping is a nuisance. If the conversion can't be transparent, at least automate it.
In the case of MySQL, changing the JDBC URLs from thisjdbc:mysql://localhost/fubarto thisjdbc:mysql://localhost/fubar?useUnicode=true&characterEncoding=UTF-8made a world of difference.
If the charset isn't set to UTF-8 when it really is, you could be confusing the client. This can set in a servlet, in a JSP and IIRC the struts-config.xml allows you to set it declaritively. You want to set the Content-type before writing to the response object's PrintWriter. Apparently if you have multibyte characters in your JSP page components, you need to set the pageEncoding i.e. in the JSP file itself, something like this:<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8 %>Though my whole motivation for using Java on this project was to have page components have only markup and display code; all of the lanugage is abstracted. Anyway, I'm preferring Velocity over JSP these days.
In my experience, doing thisrequest.setCharacterEncoding("UTF-8");before getting the parameter values is not reliable (could be Tomcat bugs though). However, this appears to be a fairly standard idiomString formValue = new String(request.getParameter("formParam").getBytes("ISO8859_1") /* bytes */, "UTF-8");
I just took my trusty old swiss army watch out of my pocket, I shoved it in there on the way out the door this morning and have had nary a chance to adorn my wrist with it all day. And now it's too late. Where goes the time?
( Feb 14 2005, 09:24:56 PM PST ) PermalinkThe third item refers to allocating more resources (typically, people) to projects. The idea is that if you're resource starved (short handed) you need to reduce scope and/or the schedule (sacrifice speed) to compensate. If you increase scope, either the schedule slips or costs increase (or both). Of course, throwing more resources at the problem is often counter-productive.
There's another triangle associated with software development:
So if low quality is crap, perhaps there's a mathematic expression here
SPEED - AUTOMATED TESTING = CRAP...and perhaps it's even transitive: high quality + automated testing = speed.
Speaking of which, it must be time for more coffee.
( Jan 27 2005, 10:11:18 AM PST ) PermalinkThere's now a Firefox plugin that adds a "Technorati Engine" to the pulldown list. Sweet!
( Jan 23 2005, 09:45:08 AM PST ) PermalinkSo I've empathized and enjoyed recent readings of other's mishaps. Not in celebration perhaps in feeling the bonds of shared trauma.
Of course, you could just laugh about it. Or post to your blog about it. Or both. So far, from what I've stumbled across, this is the funniest of the bunch.
10:11 pm: So far so good. Things are checking out, but we're wearing tinfoil hats. A few annoying LJ users, but nothing that's not fixable. We're going to be buying a bunch of weed on Monday so that, if this happens again, we'll just be too baked to care.This weekend's disastrophe for me is relatively mild: sore throat and congestion. So I'm drinking tea. And laughing about it. And posting to my blog. ( Jan 22 2005, 08:42:19 PM PST ) Permalink