Google

February 21, 2009 on 9:07 pm | In Computers, Crazy ideas | No Comments

My simmering indigestion from the articles about Google by Coding Horror and Whimsley caused me to burp up the thought that Google might actually be adjusting their search results to optimize revenue. I posted a quick comment on Coding Horror and wasn’t planning to mull it over any further, but then I realized that Google must be doing this. The only question is: To what extent?

If a site is displayed in the paid section, it is actually quite reasonable that Google does not show that site in the unpaid section. But what if moving a particular unpaid result to page 2 increases the number of clicks on the paid results? Almost nobody bothers to view page 2 of the results, so the result effectively ceases to exist! Even moving a result to the bottom of page 1 would have a huge impact, since many people probably don’t even bother to scroll down.

It would be easy for Google to do this kind of optimization. They have so much traffic that they could bucket test small fractions to look for significant increases in CTR without anybody noticing. So from the outside, this seems impossible to prove. Google is a black box, so who can say whether a particular result belongs on page 1 or page 2? But the thought that a particular site might effectively cease to exist in order to satisfy Google’s hunger for profit is pretty scary…

Update (2/18/10): I just noticed that Google does not filter out sites from the unpaid section if they are listed in the paid section.

Highway Robbery

July 22, 2008 on 9:30 am | In Car, Crazy ideas, Driving in LA | No Comments

Forget rising gas prices. The real crime, at least here in Los Angeles, is that millions of drivers are being forced to pay for expensive, sophisticated electronics in their cars that they never use! What are they being scammed into buying, you ask? The turn signal.

Hero Dice

February 10, 2008 on 11:12 pm | In Crazy ideas, Math / Physics | No Comments

If you’ve ever played Champions (the Hero system), I’m sure you’ve wished you had dice that would always roll low for attack, ensuring you hit, and high for damage, ensuring that your opponent will not get back up. Character Builders, designed for D&D character generation, cannot get the job done because they always roll high, so you’ll never hit :(

I searched the web and only managed to find these instructions for how to make crooked dice. Nobody appears to actually sell such stuff :)

Interestingly, the design I came up with is mentioned by the above link, but it is described as unreliable, presumably because those who wish to steal money by cheating at dice games need their weighted dice to be far less noticeable than what a friendly neighborhood Champions player can get away with. Not that gamers don’t take it just as seriously as gamblers, of course, but frugal, judicious use of adjustable, weighted dice would be very hard to notice.

So, as you’re probably guessed, my design allows the weighting to be adjusted so the dice can be fair or weighted towards either 1 or 6:

  1. Start with a die that has 1 and 6 on opposite faces.
  2. Drill out the core of the die on the 1-6 axis, leaving one of the two faces intact.
  3. Line the inside of the intact face with thin cloth.
  4. Mount a thin guide pin on the drill axis.
  5. Cut a disk to fit the hole in the die. The thickness of the disk should be 1/4 of the depth of the cavity that was drilled.
  6. Drill a hole in the center of the disk so it can slide along the guide pin.
  7. Remount the missing face with an inner lining of thin cloth.

This is the base configuration. It allows the weight to slide back and forth between the 1 and 6, so either can be weighted to make it least likely and the opposing face most likely. The guide pin ensures that the disk slides correctly. The inner cloth lining muffles the sound when the disk moves. The thickness requirement is necessary for latching the disk at either end or in the middle. The hard part is making this secretly configurable.

If the pips are raised, then you can convert the two corners of 3 or the two pairs of corners of 5 into invisible buttons that are the ends of rods running through to spring loaded latches embedded in the opposite face. There are two latches in order to allows the disk to be positioned either at the center or behind 1 or 6:

+-------
        |
        |
       <**
        |
        |
       <**
        |
        |
+-------

If only one latch is opened, the disk can slide between that face and the center. If both latches are opened, the disk can slide from one face to the other.

To avoid detection, you would keep the disk at the center of the die until you were ready to roll. After picking up the die in preparation for the roll, you hold the die with the desired result facing up and push the appropriate pips. After the roll, you pick up the die again, turn it upside down, and push the pips again to re-center the disk.

Unfortunately, raised pips are quite unusual and are likely to temp others to try pushing them, just for fun. An alternative is to convert an entire face of the die into a pair of buttons, but this makes it harder to conceal because there will be a hairline cracks. A better, though more complex, solution is to use additional pips to implement a locking mechanism for the latches. This way, the pips controlling the latches can only be pushed while another pip is pushed in. The best way that I can think of is for the latch rod to have a bump which is obstructed unless a pip is pushed to remove the obstruction. Imagine these two running orthogonal to each other in 3D, so the bump in the left piece can pass through the U-shape at the right:

   ^
+--|----
        |
        |
       <**
        |
+-|  |-*
   --


This is an awful lot of machinery to put inside a standard size 6 sider, but I’m sure it could be manufactured. I doubt anybody ever will, however, since the market niche is so miniscule.

Annoying Drivers

February 10, 2008 on 9:01 pm | In Car, Crazy ideas, Driving in LA | No Comments

Have you ever wished you could tell the jerk behind you how you really feel about his tailgating, complete lack of courtesy, etc.? You can, with this 10″x2″ LED Scrolling Message Sign. It mounts on your rear window, plugs into the cigarette lighter, and has a remote control so you can easily choose which message to display.

I originally started thinking about it after the person in the other lank honked at me for not skipping my turn at a 2-to-1 lane merge point created by a road construction crew. After seriously considering starting a company to manufacture such a sign, I figured somebody else probably had already done so :) Understandably, but still sadly, the sign I found has a naughty word filter, so it’s useless in Los Angeles!

Nanites

January 6, 2008 on 12:27 am | In Crazy ideas | No Comments

While lying in bed waiting for my daughter to fall asleep, and having just watched Transformers, I begin thinking about nanotechnology. The popular vision is swarms of ridiculously tiny robots running around fixing things on a scale far too small for humans to see. Is this actually possible?

It might be. Propulsion is clearly possible, since amoebas and bacteria with flagella can do it. Storage of instructions for individual robots is also possible, since the nucleus of a cell contains an enormous amount of data encoded in DNA. The behavior of ants and research on swarm robotics suggests that individual robots do not need to exhibit complex behavior; it’s the interaction between large numbers of simple-minded robots that creates complex behavior.

The trick, of course, is to put it all together. How does one build a system that can move around, interact with its environment, and be programmed to behave in a particular way? What behavior should actually be programmed into individual robots to achieve a desired result?

Defeating the Java ResourceBundle cache

January 3, 2008 on 12:37 pm | In Crazy ideas, Programming | 3 Comments

ResourceBundle caching in Java is normally a wonderful optimization. In my case, however, I’m building JSP tags with the logic in Java and the markup in property files, so the ResourceBundle cache forces me to restart JBoss every time I make a markup change. This makes iteration very slow, so I went hunting for a way to defeat the cache. A quick search uncovered this blog entry. Unfortunately, this it out of date, because in newer versions of the JDK, ResourceBundle no longer uses sun.misc.SoftCache. The correct code for flushing the ResourceBundle cache is:

Field field = ResourceBundle.class.getDeclaredField("cacheList");
field.setAccessible(true);
Object cache = field.get(null);
if (sun.misc.SoftCache.class.isAssignableFrom(cache.getClass()))
{
  ((sun.misc.SoftCache) cache).clear();
}
else
{
  ((java.util.concurrent.ConcurrentHashMap) cache).clear();
}

For this to work, you must create a new instance of ResourceBundle after executing this code.

However, this is only half the solution. It only works for property files that are directly included in my exploded war. I have my tag libraries in jars, so I also need to defeat the Java class loader caching mechanism!

Luckily, this is possible. The trick is to derive a class from URLClassLoader which overrides loadClass() to call findClass() and getResource() to call findResource(). This prevents the call to the parent class loader, so only the URL’s (jars and directories) that my class explicitly passes to the URLClassLoader constructor will be searched.

But we’re still not done, because URLClassLoader caches jar files!

Thankfully, URLClassLoader provides a constructor that accepts a custom URLStreamHandlerFactory. This allows me to provide a customized version of URLStreamHandler which constructs URLConnection objects with caching disabled.

After a deep dive in the JDK 1.5 source, the required code turns out to be very simple:

private static class ResourceURLStreamHandlerFactory
    implements java.net.URLStreamHandlerFactory
{
    public java.net.URLStreamHandler createURLStreamHandler(
        String protocol)
    {
        return new JarResourceURLStreamHandler();
    }
}

private static class JarResourceURLStreamHandler
    extends sun.net.www.protocol.jar.Handler
{
    @Override
    protected java.net.URLConnection openConnection(
        URL     u)
        throws  java.io.IOException
    {
        sun.net.www.protocol.jar.JarURLConnection c =
            new sun.net.www.protocol.jar.JarURLConnection(u, this);
        c.setUseCaches(false);
        return c;
    }
}

Sadly, this is a hack, since sun.* is not public, but it works!

User Surly Interface

May 16, 2007 on 10:58 am | In Computers, Crazy ideas | No Comments

Scrollbars are just not intuitive enough. Scrolling ought to be based on the papyrus scroll idiom instead. Each end winds/unwinds independently and moves as it does so. So, if you want to see a different part of the document, you first wind up one end, then reposition the entire document, and finally unwind the other end.

This actually unifies the concepts of scrolling, window placement, and window sizing. Positioning is already implicit. Sizing is controlled by how much you unwind.

Click Spam

May 16, 2006 on 10:09 am | In Crazy ideas, News | No Comments

It had to happen sooner or later. As reported by JenSense, the SANS Institute has caught a Botnet that was being used to generate bogus clicks on Google AdSense. Personally, I’m surprised by the part of the quote that says …a botnet generates the clicks from a few hundred machines… Clearly, these are still amateurs. The real storm will hit when the Distributed Denial-of-Service (DDOS) folks decide that they can use their massive networks of trojaned machines to make money instead of merely taking down web sites.

Update (June 15): JenSense reported that the network has been shut down. It was 50,000 infected machines! So the future is here already :(

A Wearable Computer

March 19, 2006 on 1:14 am | In Crazy ideas | No Comments

The idea of a wearable computer is not new, but a tiny cell phone has many advantages over a piece of clothing, so I’m not expecting a computer to migrate from my phone to my underwear any time soon.

However, in some situations, a computer that is built into a jacket could be helpful, e.g., if the jacket is part of your work uniform. So here are my thoughts on how it might work…

If a cell phone can contain a computer, then so can a jacket collar. This distributes the weight across the shoulders and puts it in an area that we instictively protect, namely the neck.

The CPU communicates with all peripherals, e.g., the earpiece or a DVD drive, via short-range wireless, e.g., Bluetooth. The CPU communicates with the Internet via a standard cell phone channel. One cool idea would be to have a third channel similar to that provided by a wireless router, i.e., medium range, and use this for peer-to-peer communication, e.g., within a warehouse or to your friend sitting close by. By using an ssl tunnel and only allowing connections from people on a Friends list, this ought to provide a much higher bandwidth connection than that obtainable via a cell phone. The obvious extension is to a full ad-hoc network.

The best input mechanism that I can think of is the flexible computer screens currently under development. These can be rolled up like paper, but provide a 2D array of pixels for displaying images. The display could be stored rolled up around either forearm, with a spring mechanism similar to what is used for keychains. In order to keep the sleeve flexible, only the 120° covering the outer side of the forearm would be rigid. This is the area most in need of protection. The inner forearm, which we naturally protect, would be where the screen would unfold from. Since a handle would be needed to make it easy to pull the screen out, this handle could also contain a set of controls and a stylus could be stored inside the handle, along its axis. The controls would be used for whatever actions need to have shortcuts (additional controls could be placed on the collar), while the stylus would be used to interact with the display when it is pulled out. Communication with the CPU would obviously be via the short-range wireless channel.

By making the screen attach to the spring mechanism via a strip magnet, it would be easy to detach and reattach the screen, thereby allowing the screen to be placed on a table when convenient. When a table is not available, bracing could fold out from the screen’s handle and attach to the corners of the slot from which the screen emerges. This would provide at least some rigidity while using the stylus with the primary support coming from the arm, of course. For this to work, the stylus would have to have a special tip that would interact with the screen without requiring a lot of pressure.

With a special card that could plug into a laptop and communicate with the worn computer via short-range wireless, one could achieve a remote desktop solution, thereby reducing the need for the flexible screen when a normal computer is available.

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^