Randomness

July 28, 2007

Rough Draft

As a kid I remember driving down the street when I saw a dog randomly jump out of its window. It bounced and rolled to a stop, probably injured but obviously not dead.

It bothered me enough that I sat down somewhere and decided not to get up until I’d figured it out. Eventually, right before dinner, I came to the conclusion that it wasn’t random. The driver shouldn’t have had his window down because dogs don’t understand the dangers of driving.

If you throw a set of dice do they land randomly? …Doesn’t your hand’s position, sweat, force, twist, etc. really determine what happens? I think so. But that doesn’t prove randomness is a physical impossibility, it simply proves throwing dice isn’t random. …Or isn’t it? Suppose the person throwing the dice doesn’t know the shape of the surface they’re throwing a dice on? From the throwers perspective it would defiantly be random, but I don’t think their perspective changes the cause of the effect. So this is still defiantly not truly random in my book.

Look at the picture of computer generated “random” numbers below. Squint your eyes and you’ll see a pattern formed by the shapes of each letter and their spacing.

This might seem like a random pattern, it certainly doesn’t resemble any common objects. But this pattern isn’t. It’s the effect caused by aligning these particular numbers by their decimal point, sorting them from smallest to largest and spacing them evenly apart. Each of those factors may have been determined by different people, or other computer systems, but ultimately we know the pattern is the effect caused by these factors.

Towards my point, the computer generated “random” numbers aren’t random either. They are usually based on the number of nanoseconds since 1980, than multiplied by many math formulas. Surprised?

Did you know computers can’t even divide properly? It’s true. Actually division brings up an interesting sub-topic: Did you know the idea of having two equal halves of anything is a physical impossibility? Two values can always be measured more accurately and divided more evenly, and no two things (of any kind) are exactly alike. Upon close inspection everything is unique.

People have been fascinated by the idea of randomness throughout history. In ancient times they cast lots to both gamble and tell the future. Today we do the same thing. On the one hand our sciences all acknowledge that nothing is random. On the other hand we use “randomness” as the basis many seemingly rational things.

It seems that there are two small decided groups, those who believe nothing is random and those who believe everything is, while the majority of people tend to think it depends on the subject. …Which makes no sense to me …But then again, who am I? Just some random guy. 😉

So, what exactly does the word Randomness mean?

Princeton defines Randomness as…

Lacking any definite plan or order or purpose; governed by or depending on chance; “a random choice”; “bombs fell at random”; “random movements”. taken haphazardly; “a random choice”

Click here for my source

Wikipedia defines Randomness this way…

In ordinary language, the word random is used to express apparent lack of purpose or cause. This suggests that no matter what the cause of something, its nature is not only unknown but the consequences of its operation are also unknown.

Click here for my source


Why is there such a critical discrepancy between Princeton and Wikipedia? I think there are two reasons; 1) Wikipedia has a big culture with many perspectives. Mathematicians, etc. wouldn’t allow the article to misinform. Mathematicians know randomness hasn’t been quantified. That’s where the theory of probability actually came from. …And yeah, they never figured it out.

I prefer Wikipedia’s definition. Everything seems to serve a purpose. In fact, I can’t find a single thing that doesn’t. Maybe you’ve had better luck?

Advertisements

I’ve seen a million .NET web service client examples that don’t implement security. Here’s one that does. It’s a simple snippet on digest authentication. It’s really simple, and I wish more people would default to using it.

Using digest authentication means the actual values will not be sent for the username and password. Instead the username and password are encrypted using an algorithm (like MD5) and a hash of the two sent over the wire. Nifty huh?

The first thing you need to do is modify your WSE3 policy configuration file. The policy for your web service (in this example mine is MyWebServicePolicy) needs two entries; 1) usernameOverTransportSecurity and 2) requireActionHeader. Your file should look something like this….

<policies
xmlns=http://schemas.microsoft.com/wse/2005/06/policy>
<
extensions>
<
extension
name=usernameOverTransportSecurity
type=Microsoft.Web.Services3.Design.UsernameOverTransportAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 />
<
extension
name=requireActionHeader
type=Microsoft.Web.Services3.Design.RequireActionHeaderAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 />
</
extensions>
<
policy
name=MyWebServicePolicy>
<
usernameOverTransportSecurity />
<
requireActionHeader />
</
policy>
</
policies>

Next you need to add three lines of code to digest and send the username & password…

//Creates the username/password digest token
UsernameToken userToken = new
UsernameToken(“exampleUserName”, “examplePassword”, PasswordOption.SendHashed);

//Creates web service credentials using the token
CredentialSet credentials = new Microsoft.Web.Services3.Security.CredentialSet(userToken);

//Assigns the username/password to the web services proxy
myWebServiceProxy.RequestSoapContext.Credentials.SetCredentials(credentials);

myWebServiceProxy should be the variable for the stub that .NET’s WSE 3 automatically created for your web service. …I think you need to use WSE3 (Web Service Enhancements v3) for this to work properly.

I think digest authentication is the beez-knees, and stupid easy…I’m left wondering why I didn’t always use this technology? …Oh, and while researching this code I ran into a really cool snibit. Some guy (Peter Bromberg) created a nice little example on how to implement digest authetnication in ASP.NET. Click here for Pete’s article…

http://www.eggheadcafe.com/articles/20030701.asp

LOL, wow. This sucks for Stevie. I wish Apple had gone the Nano route with the iPhone. I liked the simple interface. My favorite thing about the Nano is that I didn’t have to look at the screen.

That’s something I like about TV. You’re unaware of the interface. We look at the screen when we use TV, but we rarely look at the remote itself. Its simple enough we memorize the interface quickly and then use it without thinking.

Traditional cell phones like the Nokia 8260 (picture left) were super easy to use. And they were small with long lasting batteries.

Back then phones had to be simple because users weren’t technical. I’m convinced cell phones have become MORE difficult to use as phones over time. And I don’t know why somebody doesn’t just go back to the 8260 type model. Functionality first!

 

…Since publishing this article I have learned Apple actually sold 270,000. Only 146,000 could be activated. The activation issue was Cingular’s fault. Still, these are amazingly low sales numbers. They’d expected 500K to 1M.

Why would you ever want to bypass certification verification? …Well, maybe if you’re testing a web service that’s under development and you don’t own a valid certificate yet like me.

It took a while to figure this out. I was convinced it would be something simple, and it was…

The code below implements a custom certificate validation method that does nothing. You could customize the TrustAllCertificatesCallback method to execute your own meaningful validation, my example simply validates every request. Notice my nifty TODO comment? I wrote this as a temporary fix and I was a little paranoid I’d forget to take this line out.

I’ve only tested this with WSE3 (Microsoft Web Service Enhancements v3) on the client side talking to a Java implementation of Axis2 on the server side. …But this should work with WSE3/.Net on whatever.

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>

        [STAThread]
        static void Main()
        {
            // TODO: REMOVE THIS LINE BEFORE GOING INTO PRODUCTION!!!
            ServicePointManager.ServerCertificateValidationCallback =
                TrustAllCertificatesCallback;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

        public static bool TrustAllCertificatesCallback(
            object sender, X509Certificate cert,
            X509Chain chain, SslPolicyErrors errors)
        {
            return true;
        }
    }

I’m doing something to fight AIDS, Muscular Dystrophy every day. I’m mapping the human genome, deciphering protein structures, etc. How you might ask? With my trusty World Community Grid Agent.

The World Community Grid is a huge super-computer made up of 600,000+ laptops, PCs and servers worldwide, all crunching away online. It’s similar to the SETI@Home project, only instead of looking for aliens we’re fighting evil viruses and figuring out what makes us tick.

What’s really sad is that SETI@Home is more popular. …And it’s a lot less efficient. The SETI@Home project wastes CPU cycles on flashy graphics. The World Community Grid is all business. Here’s what it looks like…

Normally this runs behind the scenes so the CPU can focus on fighting AIDS, etc. However, if you click Information button you can see what it’s doing…

Isn’t that super? I love it! You can also pick which projects you want to contribute to online via your account settings…

…So, why not click here and install this wonderful program today! If everybody did this just imagine what could happen.

http://www.worldcommunitygrid.org/

Oh, and special thanks to Salvatore Previti (one of my blog readers) for telling me about this. You rock!

Ever notice how “Full Screen” isn’t really full screen in FireGerbil (FireFox). …Oh, and I just discovered that if you press F11 too quickly or you’ll lockup the View menu…WTF!? Why do you people like FireGerbil?!?! What is your malfunction?

See, I was just surfing the corporate mail site. It doesn’t support IE7 so I had to resort to FireGerbil. The mail site looks like Outlook, so I hit F11 for full screen. …To my horror and amazement this ugly single-tabbed nav bar drop down…

IE7 doesn’t do that. It really does full screen. You see nothing but the webpage. It’s really sweet and simple.

And in case you were wondering, IE does have a nav bar in full screen mode. It’s just smarter and better looking (which kindof summarizes the differences between FireGerbil2 and IE7). If you move your mouse to the top of the screen a sexy nav window pops down. It then disappears instantly when you move your mouse away. This is what it looks like…

…And did you notice how the IE full screen experience supports multiple tabs by default? That’s nice. I wish FireGerbil did that. I thought FireGerbil was supposed to be really good at the multiple tab thang? Well, I guess not.

FireFox does allow you to bring the tabs up through a configuration change, or via hotkey. …But I have enough hotkeys and tweaks in my life right now. I like simple software that accurately anticipates my whim.

I bet the new FireGerbil slogan will be, “FireGerbil: It’s better than Safari!” …And I’ll bet millions of American’s will still be more than willing to chant it.

…Sometimes I think calling people sheep is being cruel to sheep.

iPhone

June 13, 2007

“I’m waiting to see what happens to the others before I drink the Cool-Aid.” – Me on the iPhone

I have a feeling the iPhone will crash and burn, and here’s why…

  1. Nobody has been able to demo the keyboard without making mistakes.

    I’ve done a little bit of sales work myself, that guy must have practiced using the keyboard A LOT before the show. Previous mistakes had already caused many people to question the keyboard.  “…it works great if you trust the keyboard…” – Jobs.

  2. People won’t want to surf the Internet using their phone instead of their laptop.

    Holding up a phone and squinting to see the LCD isn’t fun, and data plans are expensive.

  3. Gesturing is cool, but after the thrill wears off it might become a chore.

    Honestly, why hasn’t anyone mentioned this? There’s a reason we use keyboards instead of touch-screens. …The keyboard is faster.

  4. The fancy graphics are nice at first, but after the thrill wears off the animations might seem time-consuming.

    What I liked about the iPod was that navigation was REALLY-FREAKIN-SIMPLE. All those other media players had more complicated, better looking GUIs. And I think iPod’s ugly little scrolling UI won for a reason.

Well we’ll see. I wanted to get these predictions blogged before the iPhone is released so I can revisit this when/if it flops.

….And if the iPhone isn’t a flop I’ll buy at least two.