Friday, June 29, 2007

Thinking in context of what has come before

Startup News:
"This place is a graveyard of hope - everyone here seems to be trying, and everyone seems to be advising - but nobody seems to be succeeding." - Max Klein
I've started to read YCombo news less and less the last couple of months. Most of the articles are about getting funding, a stage which I'm not quite at yet. And I've noticed a lack of concentration on techs and markets at the fringes. To me, that's where opportunities exist, and that's what you have to pay attention to, even if it's 5 years off.

Most everyone seems to think within the context of what was lately successful. "It's a social network that you can post photos and tag them!"

Granted, it's easier to think of things in terms of what has come before, as there's maybe only seven original things under the sun. (I don't know what the seven are, don't ask me). But there are plenty of interesting things going on in research labs, Rubists, Erlangers, and with designers and media communication majors that make the impossible possible.

I think Joe Kraus has it right. He takes things from the land of the nerds and makes them accessible to lesser nerds.

Deploying backgroundrb

Often times you don't get to control what's on the server. Slave or daemon gem required by backgroundrb might not be on your server. To get around that, I froze the gem in the vendors directory. (ie. unpack the gem)

Then in the backgroundrb script under your script directory, add the following right before require 'backgroundrb_server'
# Load gems
if BACKGROUNDRB_STANDALONE == false
rails_root = BACKGROUNDRB_ROOT
gem_path = "#{rails_root}/vendor/gems/slave-1.2.1"
lib_path = "#{gem_path}/lib"
init_path = File.join(gem_path, "init.rb")
$LOAD_PATH << lib_path

eval(IO.read(init_path), binding, init_path)
end


It'll shoot up some warning, but you can ignore those, or write your own silent_warnings() method.

Wednesday, June 27, 2007

BumpTop 3D Desktop can't beat the search box.



This is a video where the desktop metaphor is taken literally for computers. You have move documents around on the desk as if they were real things, using a physics engine. While, neat, I don't think it's entirely the right way to go. This method is only good if you can see a preview of what the document is at a glance. Therefore, for something like photos, it makes sense. But for documents, you often can't distinguish between documents just from a preview. So unless there is also a smooth zoomable interface, I don't think it would be too useful for documents.

The only reason we sort or organize anything on our desk (or otherwise) is so that we can perform search later on. There is no need to sort if there is a default search box as an interface. Therefore, I think what would really be neat is if the documents sort themselves into rankings, or into groups based on what you typed in a floating search text field.

That said, I can see definitely see applications for this technology for augmented reality though. Being bombarded by virtual screens and documents would make anyone feel overwhelmed. Bumptop physics can help lower the information overload for future augmented reality interfaces.

Stringy string string games

I haven't posted in a bit, because I've actually been productive. To lower productivity, I thought I'd post some fun. These are two flash games that have interesting use of spring modeling in the game. One is Double wires(not Double wives), where you can pretend you're someone like spiderman. And A Walk in the Park features an interesting game mechanic, where you play a pooch and you lug around a guy in a wheelchair. You can use him as anchors to catch crackers underneath platforms.

As a result, both have pretty innovative game play. It use to be that if you were below a platform...well, kiss your 1UP goodbye. But not if you have sticky strings or you're leashed to a guy in a wheelchair!

Thursday, June 21, 2007

Avatars on the Internet

So this morning, I got an odd IM from a person I didn't know saying to check out his/her WeeMee. It had no link. It might be from a camper I don't remember, or more likely, some guerrilla marketing, and I played into their hand.

Regardless, I checked it out and played their Pogo for Panties! game. WeeMees are basically avatars that people (kids) can create, and attach them to their entire online presence, such as AIM, blogs, myspace, skype. The whole site is a social network, where one can create avatars, and play games on the site. Obviously, I'm not their target demographic, and I won't spend that much time on there.

But I've been noticing a trend with avatar creation, that it's getting easier and easier, and there's certain demographics that are doing it. I've noticed there are avatars makers for Maplestory characters that are popping up on forums, as well as those Voki talking avatars.

For avatars to be worth creating, there has to be a world/context in which it fits that makes it worth showing. In second life or on forums, where interaction with others is the reason why they're there, then yes. Avatar is a form of self-expression that others you're interacting with will respond to. On blogs, not so much, since it's what you write not what you look like, that are important on blogs. Same with wikis.

Perhaps there will be a new form of the web that allows avatars to run about in a 'room' where they can do things together, like play soccer or tag, or draw collaborative pieces. And to go from room to room, you simply go from page to page. In a web like that, there will be room for avatars.

Thursday, June 14, 2007

"MySQL server has gone away" on textdrive

Debugging is always hard, because you have to understand what's going on. In this day and age of leaky abstractions, there's just always more and more to know. This is why I think concepts are important. If you know concepts, you can more readily figure out details.

So I had a quizzing error last weekend that I was scratching my head over for about two days. This was mainly because I was getting the errors from backgroundrb. It would just hang with no exceptions reported. As it turns out, there's a bug in Backgroundrb 0.2.1, the latest version.

Thanks to Mathais on the Backgroundrb mailing list, my problem was exactly as he describes. I monkey patched it and the backgroundrb server log started spewing errors out. It was about MySQL servers going away.

After reading about why MySQL goes away at all, I figured out that one needs to check MySQL's interactive_timeout setting. The database will drop the connection to it from the client (in this case, the web app), if there has been no activity for at least that amount of time. By default, it is set to four hours. On the server I put the app on, however, it is set to 10 minutes.

There were a couple solutions to this. One could be, as I posted before, to retry the connection. The other is a setting that I found in Rails.
ActiveRecord::Base.verification_timeout = 570
I put this in the environment.rb file under config to keep the connection to the database alive. I set the timeout to be under the interactive_timeout, so that Rails will keep telling the MySQL server that it's still around.

I don't know if this is exactly a good idea, since on a shared server, that means everyone will be holding on to connections they're not using. I'm not sure what the performance implications are for a long standing connection is, if there is any. But for now, it seems like it's working.

TED | Talks | Jeff Bezos: After the gold rush, there's innovation ahead (video)

TED | Talks | Jeff Bezos: After the gold rush, there's innovation ahead (video)

Jeff Bezos, the guy that came up with Amazon, is probably on spot with how it's the beginning of the innovation on the Internet. But if history is any indication, people that come after this won't be remembered until a new paradigm or market is built on top of the Internet.

I can't exactly imagine what's possible with the rising technologies. Human-centered interfaces (or the complete disappearance of interfaces), tools that predict your behavior using AI techniques, an emerging theory of the brain, nanotechnology for intelligent materials, materials that change shape, programming genetic materials of living cells, personal fabrication, wireless power, open source hardware, social management agents, and instant information anywhere in the world at any time.

Sometimes, when I look at what I'm working on, it gets me a little depressed to see how rudimentary (by today's standards) is. But I get excited when I see where it is going, and how it carries the future with it.

Thursday, June 07, 2007

Using ensure in yielding methods

I never really ever find too many occasion to use 'ensure'. It's a Ruby keyword that you can use for blocks of code that ensures, no matter what happens, exceptions or not, the code will be run when the block is finished. And then a quickie that I found in the rails core:
  def silence_warnings
old_verbose, $VERBOSE = $VERBOSE, nil
yield
ensure
$VERBOSE = old_verbose
end
It does something simple, just silences the warnings for a particular block of code. On first glance, I would have just written it without the 'ensure'. However, that won't work for yielded blocks that call return or if exceptions are thrown in it, I think. This way, no matter what happens in the block, it will always restore the state that it changed.

Wednesday, June 06, 2007

Avoiding the SUDO police with Capistrano


When deploying on a shared host, often times, you won't be able to sudo anything. I was originally thinking that I had to override the cleanup task in cappy, but a quick look in google found: Avoiding the SUDO police with Capistrano. You can simply "set :use_sudo, false" in your deploy.rb. Tip!

Surface computing and building your own hardware

Microsoft Announces Surface Computer

Microsoft recently announced their surface computing platform. It's where you get to manipulate objects with your hand on a screen. I think after Minority Report, everyone wanted something where you could manipulate virtual objects. Since there, there's been a realization of that. But few of us had the imagination/drive/ability to actually do something about it.

I had seen simple demonstrations of this type of interface at malls, where a projector and a camera would use occlusion to calculate interactions with the objects. But it was kinda like having a stub to manipulate objects--you couldn't pick them up and manipulate it. Microsoft's surface computer seems to have done away with that, and added a sense of interaction between real objects and the virtual ones in the surface of the desktop--so one can load photos, simply by dragging the photo 'into' the camera.

As for multitouch sensing aspect of surface computing, it's not the first. The idea has been around since the 80's, if not earlier. However, the first demonstration that permeated the web was Jeff Han's demo at TED. Multitouch-sensors weren't available commerically, so you'd have to be able to build your own. According to Jeff in the talk, he said it was low cost and scalable. It makes me suspect that many EEs could have built it. But we didn't.
"People that love software want to build their own hardware." - Alan Kay
I use to think that this quote was only applicable in the days when software was much closer in abstraction to hardware; when people were writing in assembler and C. Nowadays, the only people that seem to do that are embedded programmers, and having done embedded programming for sensor networks, I can say it's not half as fun as web or application programming. Having to manage memory, or build your own malloc wasn't fun, to say the least. It was kinda having to time the spark plugs in your engine to go, instead of just pushing on the gas pedal.

However, I've taken a new view to the quote. When I think about all software, they all process information in some way. The input has to come from somewhere, and the output has to go somewhere to realize the bits in some form. However, the inputs are limited by what humans are willing to enter, and more importantly in this post, what kinds of hardware that will collect this data.

I can't wait until clothes keep track of themselves and match themselves. Technically, it's possible now to write the software, but one would have to enter the information by hand so that the computer can do the tracking and matching. But if there was hardware for clothes to serve this information, then it expands the space of information for software to operate on.

In this light, I can see where the quote is applicable. To expand the reach of software to access information that is only currently available in the physical world, you'll have to be willing to build hardware.

Tuesday, June 05, 2007

Capistrano tasks for BackgrounDRb — Bryan’s Bytes

Capistrano tasks for BackgrounDRb — Bryan’s Bytes

Here's a good little snippet I found for running BackgroundRb through Capistrano. Not much commentary from me, other than hurray~ I had wondered about why it wasn't working. I didn't know nohup existed as a command--I've always used the trailing '&'. Goes to show you that a little background goes a long way.

Monday, June 04, 2007

Twittering as a platform

Amazon is posting their deals on twitter. I'm not quite sure that people would want deal ads on their cell phones all the time...

I'm kind of amazed, as are other people in the naysayer category have been, that Twitter had taken off as it has. At its basic form, it's just passing back and forth messages, a problem seemingly solved by email decades ago. However, twitter obvious is not a question of the underlying technology, but rather, how it is presented to and used by people. It's gotten people use to the idea of instant self-expression, no matter how inane--for better or worse. I would have chalked it up for sensors to monitor and log ourselves, but twitter demonstrated that people will report or say anything if there's an audience. Perhaps trolls have already paved the way in this regard.

That said, I think it's easy to write Twitter off as a fad, since the world's largest collection of quips doesn't quite seem to make the world a better place. My guess is that there's probably value in Twitter, but only when it's married with other sorts of data or text processing. Just off the top of my head, geospatial data and emotion detection algorithm on twitter data could generate a heat map of how people are feeling place to place, or time to time. I imagine advertisers would find this information valuable, since they can set up targeted advertising when people are statistically most vulnerable to impulse buying at a certain time or place.

If twitter can manage an API or platform to support this sort of thing, they'll be around for a while, I think. If not, well, at least we'd have the largest collection of quips for the archaeologists of the 22nd century.

Photosynth: stitching photos in 3D

Photosynth presentation | Venture Itch

I think this is a bit of old news, since I wasn't running windows XP in order to view the demo at their website. For the last 10 years or so, I've always thought that computer vision has been still trapped in the realm of research labs. But things are starting to bear fruit. Image registration (lining up images) isn't an easy task, since lighting, shape, perspective all have to be taken into account. It becomes especially from difficult if you have to do it from 3 space, as is done in the demo. However, it seems like everything's preprocessed, so it looks fast.

I don't think it's a far stretch to say that you can also register people's faces, so you can find all the images with your face in it, taken from different perspectives.

I also wouldn't be surprised that all the tagging of people going on in facebook photos is training a classifier to recognize and register people's faces.

The ones that push innovation and create new markets are the ones that open up possibilities, and show others what was previously thought impossible.

Saturday, June 02, 2007

COMET meets mod_mailbox

COMET meets mod_mailbox is an interesting (new to me, anyway) way to think about asynchronous push of data from server to client. I have tried my hand at using periodic calls from the client javascript to the server for information, and it's a load on the server, even when there's nothing going on. And it certainly doesn't make it seem as responsive for chat-like web applications.

Many people have done it before, it's an old technique. I've seen in in the Dojo toolkit, as well as some others...but I still haven't really seen a nice standalone solution that you can plug in. Ie. I haven't gotten off my butt to write it in javascript so that it can be nicely package...hoping someone else will.

Thursday, May 31, 2007

The 3 body problem in Erlang

The three body problem is a simulation of the paths objects with mass in space would take, if all three had gravity effects on each other. With two bodies, the problem can be solved analytically, as done by Kepler. But with three bodies, the paths are chaotic. If you just hit play on the last link, and watch for a minute, you'll see what I mean. And that's the easy version of the problem, since the two suns are fixed. If they were three bodies of comparable masses, then it'd be even harder.

From Ezra: http://ezrakilty.net/research/2006/02/3body_problem_in_erlang.html
The first conceptual problem I hit was the question of synchronization. In order for the sim to be a decent finite approximation to the continuous world of physics, we need to break it into discrete time steps, each of which depends on the previous time step (at least, that's the only way I know of to get a fair approximation). This means that each particle can't just crunch away at it's own speed, working as fast as it can to calculate its position at various times. Easily the particles could grow out of sync with one another, making an inaccurate physical model.
I hadn't thought about this, but I think Ezra is right. In terms of simulation of the 3 body problem, if the correct calculation in the future depends on current calculations, and the current calculations depend on each other, you need to make sure that the calculations are 'in step'.

This calls into question my thought before that asynchronous simulations would work, since whenever the messages arrive, that's when they arrive and process them. In a decentralized simulation of termites gathering wood chips, I imagine an asynchronous simulation would suffice. It doesn't really matter what exact paths the termites take, but rather, the end result of that chaos. But in a gravity simulation, asynchronous simulation doesn't seem to work, because what you're interested in is the actual paths.

If the calculations of all other threads must be synchronous or in lockstep, it would seem like it would give an upper bound to how fast the simulation can go, even in a multi-threaded environment. Since the calculations will be wrong, the further into the future you calculate with slightly incorrect values, what kind of useful computations can you do if you don't have all the initial conditions in your formula?

The only thing I can think of is if you had different sets of three threads--one for each mass--processing the simulation at different simulation times, you can reduce the processing load for the trailing set of threads. So say you had a leading set of threads that operated on simulation time of t + n always. That leading set can narrow the scope of possible answers. Since it knows it's operating on a chaotic system, it knows that what the error is given a certain lead time of n. Therefore, it should be able to limit the upper and lower bound of the possible right answers. Then, the trailing set of threads that operate on simulation time of t, only has to adjust the error, which hopefully is less computationally intensive.

Wednesday, May 30, 2007

Google Gears Lets Developers Take Apps Offline

Google Gears Lets Developers Take Apps Offline

This is certainly newsworthy. Google announced Gears, which is something that you install on your desktop to be able to operate online applications offline. I remember about 3 to 5 years ago when Google said, no, we're not interested in desktop, because it's not what we're good at. We're doing search.

If anything I think they learned from Netscape's mistake in the past. Marc Andersen, the founder of Netscape, announced that, as a startup, they were taking on Microsoft, and was going to beat it to the ground. Of course, when you use strong words like that, you're going to get Bill Gate's attention, and it's always dangerous to wake a sleeping dragon, when you're not bigger yourself.

Despite the ever growing ubiquity of wireless connections and connectivity all around, I think there's still a place for offline applications. This sort of thing to me, isn't really about being able to do your work on planes, though it's certainly useful for that. To me, this is about caching results that the user might possibly want to see/do next, so that the user experience is fast and responsive without possible network latency. While AJAX is fast, and tolerable for most things, I imagine that there will be some applications that can make good use of this type of offline caching mechanism, so that what was impossible before is now possible.

Of course, caching is irrelevant when the bandwidth is high, but you will either find yourself 1) in places where bandwidth is lower or 2) the bandwidth requirement for your dataset is higher than what you currently have. Mapping applications come to mind as benefiting a lot from caching mechanisms. And if bandwidth jumps up, that makes caching in mapping applications obsolete, there will be other datasets that will be too large to stream in the future. I can only imagine classifiers or their training data sets being one example, as well as a record of the user's digital life.

Update: I didn't mention this, but I think it makes even more sense for mobile devices, per this opengardens post on it.

Tuesday, May 29, 2007

Internet retailer connects with TextPayMe - Puget Sound Business Journal (Seattle):

Internet retailer connects with TextPayMe - Puget Sound Business Journal (Seattle):

This is a bit of interesting news to me. Originally, I was wondering where textpayme was going to get its traction. Amazon apparently is the answer. While mobile payments is an idea that's not new, and is currently implemented in Japan and other Asian countries, it still doesn't have much traction in the states.

I'm a bit amazed at what's possible through the limited common cell phone interface. Mobile phones are gaining in power, and lots of people anticipate that something's around the corner, but no one knows on which platform, and what's going to be built on top of it. Others are more dismissive, saying that mobile phones are underpowered devices that have limited interface, and therefore not exciting to develop on, compared to the web and desktop.

I think they forget that many said the same about web applications when they first started in the 90's. Web applications back then were clunky at best, and didn't boast a responsiveness until two years ago, when google maps came out.

In addition, mobile devices aren't just small desktops. They have characteristics that are unique to the platform. They are always on, considered personal devices, always on a person, always connected, has sensors on it, and knows its location. While mobile video and music currently offered by the carriers is nice, I don't think it quite hits the spot yet. The mobile application that plays to the platform's strengths will be the one that hits it.

Google maps street view released~

2140 Taylor St, San Francisco, CA 94133 - Google Maps

Google just released street views in SF. You can see the street corners of the city as if you were actually there. That's kinda amazing. At this point, they have enough man power to go and scour a city I suppose...or they bought this information from another company (or the whole company itself) that was doing this. I like how the street arrows tell you which way is north when you're panning around.

I think the potential for this is in augmented reality for mobile devices. I would not be surprised if Google either released a mobile phone or a mobile phone application that allowed you to do the panning in real-time, all the while telling you which way is north, as well as where the nearest gas-station/food/store is.

What I think they'll miss is the potential for social information such as, where your friends are all gathering. I'd chalk it up to Loopt or Facebook to see the potential for that.

Thursday, May 24, 2007

Upgrading backgroundrb

When upgrading to backgroundrb 0.2.x, make sure you delete the old ./script/backgroundrb directory. Also make sure that backgroundrb.yml is renamed/deleted. After installing, run "rake backgroundrb:setup" to generate the appropriate setup files.

If you get something like
"LoadError: no such file to load -- slave"

Make sure you have the gems, slave 1.1.0+ and daemon 1.0.2+ installed.

Then, according to the mailing list, if you get:
"ERROR: there is already one or more instance(s) of the program running"

Make sure you delete the old log/backgroundrb.pid . Thing should work after this.

Exploring: reCAPTCHA: A new way to fight spam

Exploring: reCAPTCHA: A new way to fight spam

This particular piece of news has been floating around lately. It's a CAPTCHA service that also uses the CAPTCHA information entered by users to teach computers how to digitize books.

It's so freakin' obvious, I slapped myself on the forehead. I even advocated and watched Luis Von Ahn's videos on human computation, and didn't think about it. Anyway, it seems a little bit odd, though, using a technique that computers can't solve to teach computers how to read--hence solve CAPTCHAs. Not knowing enough details--I wonder if the success of reCAPTCHA will call for the demise of the CAPTCHA.

The usual concerns of cheating were rampant on reddit comments. "What if people just put in random stuff? Then you'll have a computer that spew out crap when digitizing books." If his lecture on the ESP game was any indication, he has a number of ways to fight it (not to mention he specializes in online cheating also). In the ESP game, he counteracts cheating by giving the player a couple ones he knows the answers to and sees how much they're off. Also, he keeps track of the statistics for each image as well as throwing away results randomly. It's a little hard to see how he'll track individual users--other than through their IP--but otherwise, one can feasibly use the same methods for reCAPTCHA.