by pthok
3. April 2013 22:40
The last Mythbusters* episode I watched tested the Monty Hall Paradox. The last time it was popular in mainstream was on the game show Let's Make a Deal. Essentially, contestants are presented with three doors. Behind one door is a BRAND NEW CAR!!! and behind the other two are goats (the non-prize). The objective is to pick a door. Then the host will open one of the other two doors that does not contain the car. The contestant is then given the option to switch to the other unopened door or stick with their original door.
It's been widely accepted that switching will always increase your chances of winning the car. But in true Mythbusters fashion, Adam and Jamie re-created the game show and recruited a bunch of people to participate in an effort to test this theory. Each participant picks an initial door, then one of the other doors would be opened and the participant would decide if he/she wanted to switch or stick. This worked well but it was time consuming and there were a limited number of people. So they tried another method.
The two built a system that allowed them to test the scenarios quicker. It had two sections, with 3 doors each. Jamie was the participant on one section and Adam, the other. To test if switching is better, Jaime would always stick and Adam would always switch. They did this 100 times with the car being behind a different door each time.

At the end of the 100 rounds, Adam, the switcher, won the car many more times than Jamie did. About twice as much.
Being the eternal skeptic, I decided to test it out myself. For the sake of transparency, I JSFiddled it so you can see the logic. The code creates 3 doors and 2 players. In each round, it randomly selects one of the doors as the winning door. Then both player 1 and player 2 randomly select a door. Player 1 always stays and player 2 always switches. Everytime a player ends with a door with the prize, she gets a point. If you run the code with...say...10,000 round, you can see player 2 always has about twice as many points.
Still don't understand why this is? Neither did I..until I watched this video.
*I love the show and the people on their team are my heroes. Some of the myths they take on are just an incredible undertaking...like the "Dropped vs. Fired Bullet" myth.
by pthok
19. November 2012 17:26
Often times in the past, I try to delete a file or folder only to be presented with a message kindly reminding me that I can’t delete because it has been locked by another application. So I find the program that has the file open and close it. That’s fine with me because I understand the kernel needs to protect the file to maintain stability.
Today, I ran into something new and irksome. Bear with me as I retrace my steps. I was in Visual Studio 2010 and packaged an Azure deployment project. VS creates the app.publish folder and puts the actual deployment package and configuration files in it. So far so good. I make my way over to the Windows Azure Management with my shiny new files. I upload my files and several minutes later, my site is updated and happy.
But as life goes, before I have time to bask in my awesomeness, another change to the site comes down the pipeline. No problem. Just rinse and repeat. Make change, compile, package…PACKAGE FAIL!? Hmm..VS is telling me it can’t delete the app.publish folder because it’s not empty. Ok, I’ll help it out. I go to delete the two files inside and...FILE ACCESS DENIED!? “You require permission from the computer’s administrator to make changes to this file.” But….I…am….administrator… As far as my PC is concerned, I’m king of the castle…master of the manor.
After bashing the Try Again button repeatedly, I try something else. I go to the file’s properties and the Security tab presents me with “You must have Read permission to view the properties of this object”. Really? I can’t even open the file? So I try it and sure enough, I get an Error dialog: “Cannot open…”. Back to Properties, Security Tab and clicked Advanced. “Owner: Unable to display current owner.” Maybe that’s the issue, it’s confused about who owns it. Being the responsible owner, I click the Change button to claim it. It responds with “You do not have permission to view this object’s security properties, even as an administrative user.” At this point I’m at a loss for words. My computer has gone mad!
One last attempt. Open a command prompt window as Administrator, navigate to app.publish and delete. Nope. That didn’t work either.
Ok, time to restart. I start to close my windows…Notepad, SSMS, IE….hmm…the last time the file was accessed was with IE to upload to Azure. There’s no way IE locked the file. Could it? After killing the IE process, I go back to VS to package again. SUCCESS! But what the heck just happened. When did IE start locking files? This never happened before? But I did just upgrade to Windows 8 and IE 10. I did some quick sleuthing online to see if anyone else had the same issue but found done. I tried to repro with Firefox and Chrome but either of them were as deviant. My only guess is IE 10 (or at least the Azure Management site) somehow uses HTML 5 upload or local storage in a funky way. And by funky, I really mean ridiculously annoying.
by pthok
9. July 2012 23:30
We can probably all agree that jQuery is pretty awesome. It makes writing client side code a piece of cake and there are tons of plugins to do what you need or at least to get you started. But with all the plugins, comes more code you need to debug if you need to tweak or modify the plugin. Recently, I used a plugin that converted a bunch of check boxes to a multi-select dropdownlist. In the background it added several new DOM elements to the page and attached events. I needed to intercept a click event but I didn't know which of the many elements it was attached to.
Luckily I found Visual Event created by the fine people at SpryMedia. Visual Event is a piece of JavaScript you drag to your browser's bookmark bar. When you want to see the events on the page, simply click the Visual Event on your bookmark bar and it'll overlay markers next to the elements. Mouse over the markers and info about the event pops up. A pretty awesome tool for a pretty awesome framework*.
*Visual Events works with other frameworks as well. But I have an affinity towards jQuery :)
by pthok
11. June 2012 01:04
Well, here I am again. I find myself back at Exsilio after a 3 year hiatus to see what else is out there in the professional world of software development. I’m lucky enough to live in Irvine, CA. It’s what some people might call a hub for tech. Not as well known as Silicon Valley but still quite active. I’ve been a developer for 10 years and in that decade, I’ve worked at several companies. Some of them were short term contract positions and others spanned years. In Irvine, if you’re a .NET developer worth half your salt, you should have no trouble finding work. But making it past the interviews is just half the struggle.
Only a month ago, I was part of a team at a large company. I’ve only been there for a few months but was already feeling empty as I sat down in my cubicle every morning. Don’t get me wrong, it’s a great company that takes care of their employees and the people there are top notch. But what I was doing there wasn’t fulfilling. I started to think about my career and what I wanted from it. I had thought I wanted to work at an enterprise size company with an enterprise level system and all the niceties that came with it…predictable hours, long standing established software frameworks, and clearly defined teams and roles. It turns out the projects, pace and culture wasn’t for me. I thought back to all the places I had been and where I had thrived…not just worked or succeeded, but thrived as a developer and person.
Now I’m going to try to not make this sound like I’m marketing Exsilio. Because let’s face it, developers usually do not make good marketers. But the truth is, working at Exsilio 3 years ago was the most challenging and rewarding position I’ve held. Sure there were time when the hours were crazy and the deadlines were crazier. When the system spec was non-existent but the product was due anyways. Through all the insanity, the gluing force that made it manageable, nay, that made it even fun, was the team. If you’ve been a working professional long enough, you’d know that the people you work with make an enormous impact on your level of satisfaction in the workplace. The reason I asked to come back to Exsilio were two fold; the types of projects and more importantly the culture and people. It’s refreshing to work in an environment with people that are passionate about what they do. How do I know they they’re passionate? It’s not that they talk code all day or wear gear from ThinkGeek. It’s because when things get tough, when things aren’t fun anymore, they still work their butts off to get the best product possible out there. Again, I don’t want to sound like I’m drinking the Kool-Aid but the people here are exceptional. This is why Bryan mentions it and Anthony mentions it. And I’m glad they acknowledge it because they are our bosses…and if they didn’t then…well…the great people would not stay and I probably would not be writing this entry.
So, what have we learned here? Probably nothing from this blog. But I’ve learned a ton from working at Exsilio, then leaving, then coming back. I’m now excited again to come to work, to see what challenges lie ahead, and to see what we accomplish as a team.