Thursday, June 01, 2006

A new medium for first adopters.

But back to the point: a long time ago I used to write online to a ton (like 30) of faceless, nameless people who used to laugh and possibly email me about how funny they thought it was. I was just goofing off, I wasn't too concerned about offending anyone if I could make something funny.
I think a lot of first adopters really rallied around blogs. It was like a second home to people. Everyone likes to have communities and places where everyone is respectful, interesting, and "where everyone knows your name." It was kinda like your own secret special place, and a twinge of 'coolness' because it was esoteric.

But inevitably, once a community gets so popular that there becomes an influx of newbies that have no respect for the painstaking community and culture for the medium that had built up over time. The general disrespectfulness of these newbies ends up chasing away the very people that made it special in the first place. Same thing happened on IRC and Usenet that happened in the blogosphere.
Vox is a return to that early time I don't think most people had a chance to experience. The commercialization of blogs has, I think, skewed people's perception of what they can be. To many, if you're not doing 50,000 unique visitors a day you should just throw in the towel, you're a failure. If your funny story about shopping at the Apple store can't be Digg'd or Boingboing'd then what good is it?
I wonder where the next playground of the first adopters will be? Somewhere where they can coalesce, create connections, and encourage each other to dream and to make. Likely, it will be through the introduction of a new media, as demonstrated by historical patterns.

First BBSes, then Usenet, and IRC. Then forums, and then blogs.

What will the new medium be like? I can imagine a couple things (though by no means accurate).

One might be the lowered barrier of making things, something like open source design. People with shared passion of making and creating things will be able to make connections and communicate with each other through making things.

Second might mix the internet and reality, where strangers gather for some cause, whether this cause is deliberate or emergent from the groups' decisions. These decisions might come from people that aren't even there, whose names they don't know.

I'm imagining something like people are able to view the positions of all those that are participating, on a map. Then they're able to vote and come to agree to where to gather, and what the goal is. Then those that are by the site get notified, and can spontaneously partcipate if they wish. Much like flashmobbing, but less deliberate.

Then, the ability for strangers to discuss or exchange what they did might build a community.

However, I can see how something like this could be used for evil, like sending a mob to various sections of streets in guise, where it is meant to block off roads to help a bank robbery or heist.

And yet, it's a neat idea. Emergent cooperation organized by the net that mixes with reality. It's another way for people to interact outside of their defined roles and places in society.

Monday, May 29, 2006

Evolving Design Patterns

I like the idea of cleaning up after yourself as you're coding. I find that I do that more and more, however, I get impatient if I spend most of my time, doing 'cleaning', rather than actual 'cooking'.

There's several tasks that I tend to be doing when I'm coding. Creating, designing, refactoring, debugging, and testing. I probably spend 70% of my time refactoring, debugging, and testing. But this is usually 10% of the fun. Where I find fun is in the creation, but I only get to do that 30% of the time.

Though I feel like refactoring, debugging, and testing (RDT) are necessary for good code, it's like cleaning your room...you have have to develop an OCD pride in having clean code to derive pleasure from it. However, you must always balance it with GETTING STUFF DONE.

It's hard to motivate yourself when nothing's actually being done for too long.

While testing has gotten easier and more automated with unit testing, and dare I say it...fun (to watch it say, you passed!), I feel like there isn't a good handbook yet on evolving design patterns.

Much of the time, I find the design patterns in the GoF book to be overkill. However, you do want to think about the future so you can extend it for flexibility later.

So the language that you're working in should allow the flexibility for you to sketch ideas, and then beef them up with ink later. The problem is, unlike drawing, you don't often know what's the best way to beef things up.

Certain types of solutions to problems have varying degrees of flexibility. For example, if I were to write a lexer/parser, I could just write a big loop line by line with a case statement inside it. But what if there are recursive elements? What about callbacks? There are more flexible architectures of lexers and parsers to handle that. However, no book I've ever seen delves into the topic of how to transform a bare bones lexer/parser into a full fledged lexer/parser.

Therefore, you can take the minimum level of complexity that you need, and be able to refactor it later if you need to.

Andrew Birkett's MethodFinder in Ruby

Found this via RedHanded, but he didn't explain it as well as the original page.

It is a method that lets you find the name of another method given its arguments. Pretty neat what you can do with Ruby.

Sunday, May 28, 2006

Beowulfs @ Home

Lately, I was wondering what to do with the four old computers that are sitting in my parent's basement. I looked online, only found one article from PC mag, and none of them seem very neat or enticing.

It was then that I went back to reading about beowulf clusters, but other than the experience of setting one up, I only have one problem I'd like to solve in parallel, which is the simulation of sexual selection on the genetic algorithm.

But yet, reading about cells yesterday, I'm wondering if it was possible to use parallel computers to take advantage of this dataflow programming paradigm. While I'm doing guesswork here with very little details, at the very least, it seems that one can assign a processor to a number of cells to update within a program. However, it might not be feasible, if the messaging system of cells has a lot of overhead.

This would be something neat to try.

Saturday, May 27, 2006

Rounded corners in CSS

Ahh, yes, the elusive rounded corners in CSS design. A number of people have come up with all sorts of hacks and solutions to rounding corners.

Presented is the 'sliding doors' method, where you segment the window into various divs and put an image in each for a more fluid layout.

However, I feel like ultimately, rendering this is the job of a CSS property and the browser. Isn't there a clipping property in CSS?
div#contents {
clip: rect(10px, 5px, 10px, 5px)
}


Now, I only know of shape being 'rect' in CSS2. Why can't there be other shapes, like, 'round_rect'?

Briefly looking through CSS3 spects on W3C, I didn't see anything at all. Does it make sense or no to implement this in the browser, instead of having CSS designers hack up designs?

PyCells and complex and emergent systems

Through this blog post on "BlueSky" about PyCells, I delved further into this seemingly new (to me) programming paradigm, called Cells, by Kenny Tilton.

It basically takes the concept of a cell in a spreadsheet that get updated automatically to programming where there are a lot of internal data states that are dependent on one another in a chain, or a complex graph of dependencies. Like, the color of a button depends on whether you selected a radio button or not. Or, shut down the motor if the sensor reads above 100 degrees (example given in text).

In only the brief one hour that I've been reading about it, it seems like you make declarative statements about WHAT is chained to what, and the cell system will be able to make deterministic and discrete updates to keeping data internals consistent, so that it eliminates race conditions and deadlocks.

A better explanation of it by a better informed Bill Clementson will help you understand it, in addition to this long explanation of cells by Phillip Eby. While it might sound academic, it's currently under the summer of code 2006 for google, under the python foundation. They're trying to make a port of it from Lisp's CLOS to Python. I wonder if anyone's doing it in Ruby?

However, even if it does really remove deadlocks and race conditions, I imagine other problems will crop up. It seems very analogous to cellular automata, except in this instance, the cells are heterogeneous, and there can be any number of neighbors. I expect that for even simple systems, you can get unintended and complex behavior from them, as most likely, they will be non-linear systems. How can we harness these unintended behaviors to design systems that are more than the sum of its parts? Of all the complex systems literature I've read, they've mostly been descriptive, rather than predictive. I'm not sure how to design emergent systems.

Wednesday, May 24, 2006

How to have multiple Submit Buttons on one form

The Rails Diary | Two Submit Buttons

I was pretty sure that there was someone else out there that might have had the same problems as me when it came to having two submit buttons on one form.

And of course, I found a simple solution.

Tuesday, May 16, 2006

'templates' is a reserved word in Rails

I'm glad I didn't spend too much time stabbing around in the dark on this one. I had a controller/model named 'templates', but there was a weird error that popped up:
undefined method `assign_variables_from_controller' for #
That's because 'templates' is a reserved word in Rails, so you can't use it for your controller name.

Sunday, May 14, 2006

Finite number of pictures

When you think about it, the number of distinguishable photographs is countable. The human vision system has a limited resolution. Nowadays, five megapixels is hardly distinguishable from a four megapixel image. So that means that each picture is about 5 million pixels for a 5 megapixel picture. Human vision is pretty sensitive to color, but it's limited at about 24-bits, or 16,777,216 colors. So there are 5 million * 16.77 million = 8.285x10^13 distinguishable pictures.

That's a lot of pictures, and it's hard to comprehend how big that number is. The vast majority of these pictures would be noisy-like. But when you think about it, every frame that you've ever seen on your TV, every digital photo you've ever seen on flickr, every image you've seen on your monitor have been a subset of these 8.285x10^13 pictures. And yet, you have not seen the vast majority of these pictures. Some of these are pictures of people you know, people you don't know, places that you've never seen, deserts, planets, stars, aliens on their home planets in their vacations, even. Pictures of the imaginary, of dreams, of the impossible.

Monday, May 08, 2006

Mozilla Sunbird bug, fixed in 12 minutes

My roommate submitted a bug into mozilla's calendaring application, sunbird today, and got the bug fixed in 12 minutes. That's pretty amazing. The fixer asked for a bug trace, and it was as my roommate was submitting it, so he got it in three seconds. That's even more amazing. :)

render_component different from link_to options

This one got me stuck for about an hour. I couldn't figure out why this wasn't calling the method of the component, but it was rendering the view of the component.

render_component :controller => "poll", :action => :show, :id => @event.poll

It ends up that this would be all fine and dandy if it was a call to link_to() rather than render_component even though the nature of the parameters is practically the same. So for render_component(), it should be:

render_component :controller => "poll", :action => "show", :id => @event.poll.id

it needs strings instead of symbols for :action, and it doesn't convert an ActiveRecord object to its id--it needs to be explicitly stated.

No mo' asserting flash in rails

Flash messages in Rails 1.1.2 doesn't seem to work in tests anymore.

I use to have some asserts in the test that go:

assert flash.has_key?(:error), "Flash doesn't have an error message"

But now, flash gets erased before returned to the test. I'm guessing they added an extra stage on top of the method being tested, so it gets cleared before execution gets back to the test.

So, no more testing flash in rails!

Sunday, May 07, 2006

The problem with making things

The problem with making things is that:

The dreamer has the creative idea, but doesn't understand the theoretical principles to make it plausible. Nor do they care as much as they should.

The scientists understand the theoretical principles, but don't understand proper software architecture to retain it in the long run. Nor do they care as much as they should.

The programmers design functional and architectually maintainable software, but can't design a usable interface for everyday people. Nor do they care as much as they should.

The designers design an aesthetically pleasing interface, but they are not the ones that are going to be using it everyday. Nor do they care as much as they should.

The users of the product just want to accomplish their task at hand, but can't stop purchasing things that are hard to use. Nor do they care as much as they should.

The making of everyday objects has become specializations of specializations. Each aspect and stage of a product's birth requires specialized knowledges that are quite discreet from another. However, I still think that one should learn a bit about the process before and after:

Physists should learn good programming and creative imagination.
Programmers should learn complex math and usability design.
Designers should learn good programming and actually use their products.

Tuesday, May 02, 2006

Slingfeed 1.0 beta

Announcing Slingfeed(http://www.slingfeed.com) from 3cglabs. It's something we've been working on that allows you to read blogs and news from feeds all in one place, and you can 'sling' interesting articles to your friends. If you sign up and add my gmail address as a friend, I can sling you interesting articles that I read on my feeds.

Sunday, April 30, 2006

Yay for first link!

Deakialli DocuMental: "Por fin me he enterado del porqu�de las 43 cosas, y no 50, 100 o 1000."

Awesome! I got linked to. It's always cool to remember your firsts. This blog had me on a list of links about a post I wrote about the significance of the number 43. I signed up for technorati, and it's kinda cool. I knew about it before as a search engine, but never really as something that promoted your blog. I should have done it earlier.

Tuesday, April 25, 2006

Leaky Databases

In the programming world, programmers use to have to manage memory. When a programmer created an object in memory, he had to remember to destroy it. If the object was never deleted and the programmer lost the reference to the object, the memory location is effectively unusable for the life of the application. This is because the application can never allocate new objects in that location since it thinks it's already allocated, and the programmer cannot free that memory location because he lost the reference to the object.

Nowadays, there are high level languages that have a garbage collector--basically another running process that detects whether the application is using a particular part of memory or not, and deletes it. (Exception is that Lisp has been around since the 60's and had a garbage collector)

In databases, records in tables refer to other records in other tables. However, due to a misbehaving application, I can see a possibility for these references to be lost or overwritten. Also, common practice in databases is to mark something as deleted, but don't actually delete it.
Thus, you're left with records in the database that might not have any use whatsoever, but is still taking up space.

This is like a "database leak", analogous to a "memory leak." But to my knowledge, no one seems particularly concerned about it. This is probably because hard drive space is cheap and plentiful.

However, I expect that we'll eventually see embedded servers, where even small devices like your cell phone or your microwave can serve up web pages. The storage requirements for these platforms might require a more frugal management of database resources.

Anyone know of database garbage collectors?

Wednesday, April 19, 2006

Firefox has much to fear.

What I say might sound like blasphemy, but I've been pretty dissatisfied with Firefox with their last two releases. Ever since version 1.5, I've had to contend with a massive memory leak, and now, Firefox seems to freeze more often. While the memory leak could be solved with some quick hacks, Firefox seems less stable than it use to be.

I think the pundits are premature in saying that Firefox is an IE killer. If the developers of Firefox don't focus on basic stability and memory leaks so that their application is at least RUNNABLE, instead of just adding features, there's no doubt in my mind that Microsoft will pull through with their IE.

Microsoft has survived this long, mostly because they've made less stupid mistakes and never underestimated the competition.

Tuesday, April 18, 2006

Having something to touch

Despite all things that virtual provides, people still like the concrete, something to touch. Kinkos should offer a service that allows users to publish their blogs via dead-tree format.

I think with the advent of new materials that can change their shape and texture with electronic signals, it'll usher in an age of computing where you can make the virtual quite real and disposable.

Imagine a material that you can alter the shape of through electronic signals. Then, you can change the shape to a spoon, and then later change it to a fork--you can even change it to be a back scratcher. Although that's a very contrived and useless example, it illustrates reuse of physical objects in different functions, and even in different contexts.

Sunday, April 09, 2006

The Tube: Revolutionizing material transport

Wished everything just came and went from your house? Well, this post is about using a single real-life physical delivery system using a network of tubes. Think of the "Sucky" tubes in the movie, "Elf" that delivers post, sewage, water, etc.

If it really can be implemented, then it could be a fairly neat system. Especially potentials in online shopping--the warehouse would send your order automagically (not that it doesn't now).

But in order for this to be effective and "real-time", as the guy is imagining, very very difficult problems need to be solved, namely, how to route real things.

His comparison to IP is only half right. In IP, if there is contention at a router, packets are simply dropped. But you can cannot do that with post, water, and sewage. You'd have to develop some type of mechanical router. Not to be a naysayer, but the current delivery systems are 'good enough' and the barrier would be too high for something like this to see the light, unless there was a specialized niche problem that this system solved in the future.

Friday, March 24, 2006

Face tracking

I was really surprised when I saw this video of Logitech's Orbit MP webcam. It's about $100, and it has impressive face tracking algorithm. I knew that people were making headway in face tracking algorithms, but I didn't think it was this good.

There are now open source tool kits for augmented reality. However, they use a template black and white pattern as a reference platform. It is definitely possible to use people's faces as a tracking platform. Then, you can put statuses above people's heads, like their names. Or in a augmented reality game, their "hit points".