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".

Friday, March 17, 2006

Incorrect predictions

One thing that really gets on my nerves is when people are dismissive.
"The wireless music box has no imaginable commercial value. Who would pay for a message sent to no one in particular?" -- Associates of David Sarnoff responding to the latter's call for investment in the radio in 1921.
Hindsight makes these predictions seems ridiculous, especially when taken out of context of the times and what was known as "common sense" or "what any educated person would know." Unfortunately, people have only have their own experiences and expertise to draw upon. The model and framework by which we can evaluate and make sense of something new is by what we know.
"Heavier-than-air flying machines are impossible." -- Lord Kelvin, British mathematician and physicist, president of the British Royal Society, 1895.
"X-rays will prove to be a hoax." -- Lord Kelvin, President of the Royal Society, 1883.
"There is nothing new to be discovered in physics now; All that remains is more and more precise measurement." -- Lord Kelvin, speaking to the British Association for the Advancement of Science, 1900.
"Radio has no future." -- Lord Kelvin, Scottish mathematician and physicist, former president of the Royal Society, 1897.
Lord Kelvin was a major contributor to physics and engineering. I mean, he has a unit of temperature named after him. It's just that he operated on the framework that he knew of. It's very very hard to jump out of what you know and start all over. But some people just don't event try.

"

Tuesday, March 14, 2006

Sketchup redos what's old

It seems like much of the time, when something old is well done already, someone comes along and makes it new. Sketchup, at a preliminary glance is what one would use instead of CAD. It allows you to build and create 3D objects fairly easily and intuitively, as if you were manipulating it in space with your hands.

It recently got aquired by Google. So speculation is amok as to what this means for Google's overall strategy. Personally, I think Google is big enough, like Microsoft, and Sun, to have their hands in everything. However, they seem to have a better track record than Sun so far when it comes to making their products work well as a thematic and cohesive whole.

The previous aquisitions that haven't yet made a showing on Googles' product lists are the things related to real-world computing. Things such as mobile socialization and traffic information haven't yet surfaced. In addition, a friend of mine was approached by Google for a job in haptics (force feedback in robotic surgery). When looking at their job listings briefly, they do also invest in bioengineering and chemical fields.

What will Google use SketchUp for? No one knows. But I know this: that the easier people can create information--whether it's written word, images, sounds, etc--the more that type of information is going to proliferate. If it's really easy to post entries to a blog, many blogs will spring up. If it's really easy to take photos, many photo sharing sites will spring up. If it's really easy to make 3D objects with SketchUp, the more object manufacturing sites will spring up. Thus positioned, Google can continue to offer services which filter and organize that information; and that will contribute to this advertising revenue. But now, it seems to be in the position to also encourage people to create that information.

Monday, March 13, 2006

Phone form factor

I'd been saying for two years now that phones should have its buttons up top and the screen below it, since most people cradle their phones in their palms. In order to type on a phone like the RAZR, you'd need to balance it in with your fingertips.

Finally, Wildseed has the first phone I've seen with this form factor. Admittingly, it looks a little bit odd, since it looks like it was bent quizzingly. But it should fit better from a usability point of view. Form over function!

Sunday, March 12, 2006

T-Mobile Free Wi-Fi Weekends, Awareness

T-Mobile Free Wi-Fi Weekends, Awareness

Free Wi-Fi for tmobile users on the weekends!

Friday, March 10, 2006

Matrix Photos in an Ikea Kitchen

IKEA | DREAM KITCHENS FOR EVERYONE is a flash site that uses Matrix-like action shots to introduce all angles of a kitchen to would-be buyers.

Not that I'm particularly interested in kitchens, but it does get me thinking about 3D photos. I think the way IKEA flash designers did it was that they had a studio with two or three dozen cameras set up in a semi-circle. And then they took an action shot all at once. Then, they use flash to stitch together the pictures so that it would look like you're traversing in space, while time is frozen.

I remember my dad buying a 4 lens camera a long time ago. If I'm not mistaken, it's a crude plenoptic camera. A real plenoptic camera has one lens, and has a microarray of lenses. Anyway, my dad's camera took four photographs at once, so that when you go to develop it, you can get an actual sense of depth in the pictures. Or rather, it looked like people cut 4 layers of photos together, and put it in a hologram of sorts. The film was expensive to develop, and I think we only had a couple developed.

However, with digital technology, I think it is wholly possible with just one lens. Given that a lens can change focus fast enough, you can generate images that have different depth images. I haven't read his paper, but that's what Ren Ng's Light Field Array camera seems to do. It can focus on different planes, AFTER you take the picture. There's also Ramesh Raskar's Line drawing camera. It uses four flashes and uses the shadows in the flashes to create line drawings and videos.

However, unlike matrix photos, there's seems to be no information captured by a CCD array about the backside of an object when you take a picture of it.

And yet, I wonder. The reason why we can see anything at all is because light is reflected off that object. Sometimes, light bounces off multiple objects before it reaches our eyes. And yet, we only have information about the last object that the light bounced off of. I don't know enough about optics (maybe it's time to learn), but could it be possible that the light that reaches our eyes/camera still has information about all objects it has bounced off of? Unless the object is a mirror, light will scatter off of the object, so we will probably get partial information. However, if we were able to collect a bunch of partial information from different sources, it might be possible to piece together the partial information for a cohesive picture of the backside of an object, not unlike how network coding pieces packets together at the sink.

So if light still carried information about an object after the object has scattered it, and if we can detect it, I'm guessing it's possible to take matrix photos from a single vantage point.

Monday, March 06, 2006

Internet Appliances

Interaction Ivrea: Gallery: Fluidtime

I've long thought that Laundry machines should be the first appliances to use the internet. I always forget that I have my clothes in the wash, and that I need to move them into the dryer. This was especially the case with living in the dorms. I wished my laundry machine would text message me when things were done. Now, I hear that there are people doing this (yay!), and that some college dorms have it.

What are some of the other things in the house that would be more useful with an internet connection? A toliet paper dispenser with an RSS feed and a toaster that can toast the weather on your bread are some that come to mind. If it moves in that direction, I imagine that either devices will get far too complicated, or that the design and use of everyday things will reign in the rampant featuritis that afficts those that make consumer electronics.

There are a couple things that have to happen before something like this is a reality. Home network is already cheap, but ethernet wiring in the house is not yet ubiquitous. Thanks to wireless routers, however, this will be a possibility, but will also raise the cost of these appliances.

Personal devices, such as cell phones, will have to have the ability to easily share meta information about its owner to these appliances. This will make it much more appealing for users to use internet appliances...it will be catered towards them.