Milbourne.com
29Nov/100

Mark Milbourne

Posted by Mark Milbourne

Mark, Maria and MaisyWelcome to Milbourne.com.  This site is running WordPress, at the moment anyone can register.  Please contact me if you wish to be an Author.  I'm allowing the immediate Milbourne family members access to the site.

About myself, I'm a Guitarist, Computer programmer who currently lives in Northern California.  I immigrated here from Australia in 2001.

Stack Overflow Flair

Stack Overflow profile for Mark Milbourne at Stack Overflow, Q&A for professional and enthusiast programmers

Post to Twitter

22Dec/110

My Review of Roku 2 XS Streaming Player

Posted by Mark Milbourne

Originally submitted at Roku

Adds an enhanced remote for playing games, plus extra connectivity options.


Loving my Roku

By Mark Milbourne from Walnut Creek on 12/22/2011

 

5out of 5

Pros: Reliability, High quality picture, Easy to use, Easy to set up, Built in Wi-Fi

Best Uses: Primary TV, Holiday Home, Living room

Describe Yourself: Netflix fan, Power User, Early adopter, Technophile

I love that its so small. I have it sitting right next to my TV and no-one notices it.

It'd be awesome if you could connect to a SlingBox with the RoKu.

(legalese)

Post to Twitter

3Oct/110

It’s “Polybrowseristic” not “Browser Agnostic”!

Posted by Mark Milbourne

Something that has been bothering me lately is the use of the term "Browser agnostic" to refer to a website that works on all Internet browsers, that being it doesn't matter which browser you use.  My problem is two fold, first I'm certain that websites (especially mine) do not run on Navigator 7.2 (Go look up the browser wars if you don't know what this is).  Which means that we do not work with all browsers.  Its the 'All' that I have a problem with.  Its the ultimate setup, and over generalized statement.  Anyone hearing that description can say, "ah ha!! Did you try it on Konqueror? No? Well, I caught you out! Liar!".

Secondly, since its stealing the word from a religious context, we could interperet its meaning to be:

My website doesn't believe the existence of your browser, but believes there is a browser out there that it will work with.

Well that's definitely not true, I don't have to believe a browser exists, I'm using one right now.  But maybe on second thought, it could be the illusion of a browser.  Maybe its just different flashing lights to deceive me.  But either way I'm sure my website doesn't believe anything....its inanimate.  Although sometimes I think its deliberately creating bugs for me to find.

So this brings me to the question, so how do I refer to a website that works on most browsers?  Well, I came up with this word:

Polybrowseristic

Stealing the word poly to mean many, and browseristic to refer to something that works on a Internet browser.  So I'm happy to describe my websites as polybrowseristic.  They work with all the browsers I tested them with.

So now we could take the next logical step.

Monobrowseristic: A website that only works with one browser.

I'm certain some of the stuff comes out of Microsoft is IE Monobrowseristic.  I'm not sure if Monobrowseristic should apply to one version or multiple versions.  For the sake of an augment, lets say it is.  Then we could say

Iebrowseristic: A website that only works with IE.  But all relevant versions of IE.

Similarly for other browsers, but it starts to be become tongue twisters.

I'm looking forward to the next conference where one of the presenters drops the word, polybrowseristic, to make themselves seem cool.  Big smiley face.

 

Post to Twitter

26Apr/110

Clearing a hung build in TeamCity

Posted by Mark Milbourne

tc

We recently had a build that was hung on TeamCity.  When we cancelled it, the build just stayed around saying it was cancelling.  After googling for the solution, I couldn't find one.  So this is what I did to clear it.

Go into team city and find the directory and machine that the build is on (assuming you're using multiple build agents).  It will be something like C:\TeamCity\buildAgent\work\dc426554e8b0f33.   Stop the Build Agent on that machine,

  • net stop "TeamCity Build Agent Service"
  • Delete the offending dir.
  • net start "TeamCity Build Agent Service"

Then go to the webserver machine and do this;

  • net stop "TeamCity Web Server"
  • net start "TeamCity Web Server"

I hope this helps someone.

Post to Twitter

11Apr/110

string.Format and curly brackets throwing “Input string was not in a correct format.”

Posted by Mark Milbourne

csharplogo

I just fell into what seems a newbie C# programming pitfall, so I thought I'd document it for someone else's learning pleasure.

Using string.Format() to create a string (ala printf), I was hit by the exception "Input string was not in a correct format." Here's an example of the problem;

string.Format("{0}/{id}", "controller");

While its may seem obvious that its the second curly braces, it does seem silly that it doesn't figure this out correctly. Here's the solution;

string.Format("{0}/{{id}}", "controller");

Which now does look silly, but it works.

Enjoy.

Post to Twitter

15Jan/110

Interview Question #1

Posted by Mark Milbourne

Today I came accross an awesome interview question for programmers.

Problem

Given this psuedo C like code;

if "operation"
    printf("Hello");
else
    printf("World");

What "condition" would cause it to output "HelloWorld"?

C Solution

if (0 == printf("Hello"))
  printf("Hello");
else
  printf("World");

C# Solution

if ((new string[] { "Hello" }).All<string>(delegate(string n) { Console.Write(n); return false; }))
{
    Console.Write("Hello");
}
else
{
    Console.Write("World");
}

JAVA Solution

Graciously from Jack Dunham (the Java man);

if (new Object() 
  {@Override public boolean equals(Object foo) { System.out.print("hello ");return false;}}
  .equals("hello ")) {
System.out.print("hello ");
} else {
System.out.print("World");
}

Post to Twitter

2Jan/110

Drush – Out of Memory

Posted by Mark Milbourne

So this weekend I tried to push some new changes to my staging website.  The site, musiciansub.com, is running Drupal so you basically need to run Drush to do any form of updates.  Anyways, I logged onto the server and tried to do a drush update, and I recieved this error:

Fatal error: Out of memory (allocated 22806528) (tried to allocate 30720 bytes) in /home/musici12/staging.musiciansub.com/sites/all/modules/date/date_api.module on line 105
Drush command could not be completed.

After digging around the net I found many references to PHP memory limits.  Where most people have fixed this error by simply setting the PHP.ini for Drush to use, or simply added ini_set to the drush.php file.  Here are some links;

None of these worked for me.  I always hit the 22806528 limit no matter what.  This is roughly 20M, which is really small.

The Solution

My problem was the Fork Bomb protection (http://en.wikipedia.org/wiki/Fork_bomb) that some hosting providers setup.  The basic defense is to restrict your Bash (or whatever) shell to a very limited set of resources so that its difficult to bring down the server.  In my case the memory limits.

After requesting that my hosting provider disable the fork bomb on my VPS, I'm back to being able to update my site.

I hope this helps someone, I wasted a few midnight hours trying to figure this out.

Post to Twitter

20Dec/100

Installing a Seagate Momentus in my Sony VAIO

Posted by Mark Milbourne

You'd think that installing a new hard drive would be a simple thing, well read on.   I have the Windows 7 Ultimate edition installed on my VAIO laptop already, so I decided to use the System Recovery tools that come with the Ulitimate edition (I knew that extra cost of getting the Ulitimate edition would pay off).  Plus I really didn't want to buy Norton Ghost.  I have disgust for them with their crappy Norton 360 product.

After backing up the entire C: drive on to my 1.5 Tb USB drive using the instructions from here: http://www.sevenforums.com/tutorials/663-backup-complete-computer-create-image-backup.html and few hours later.

I created the backup and the CD to do the recovery.  Then I shutdown the laptop to install the new drive.

Here's a big tip when changing hardware on a laptop, disconnect the battery.  I don't know exactly why, but everyone seems to do it.

After getting the back plate off then removing all the screws to get the drive bay out of the laptop, I removed the old drives  (2 Striped 160Mb to be exact).  Installing the new drive was easy.  Everything went in ok and we're good to go.

Then I tried to boot off the CD I made.  Well now things get interesting.  It boots up and complains that;

"System Recovery Option is not compatible with the version of windows you are trying to repair"

Ok, road block number one.  So I grabbed my original Windows 7 disk and booted off of it.  Tried the Restore again and the same thing.  Block number two.

Next, I tried to do an install of a blank Windows7 OS.  Then it wouldn't let me install on the unformatted drive space. Things are getting annoying now.  Looking at the drive partitions I noticed that the first partition on the drive was labelled EFS.  So I Googled it: http://en.wikipedia.org/wiki/EFI_System_partition Looks like something to do with Mac machines.   Holding my breath I deleted the EFS partition.  Now some joy, I was able to create a new partition and Windows7 was happy to start the install.

After going through the install and entering in the Product Key.  I unchecked the register automatically checkbox.  I don't want it to register, since I've already done this.   It asked to connect to my Wifi, I didn't allow this either.  This means that Windows can not connect to Microsoft and no virus' can get me.

Now the desktop is up and running. So far so good for this new harddrive, things are running really fast.  But now I need to get my original System image back on here.   I inserted the System Restore CD into the DVD drive I created earlier, and booted off it.   Watch the screen, the "Boot off CD, DVD" goes by real fast.  I missed it twice.

Using the Method 2 described here: http://www.sevenforums.com/tutorials/668-system-recovery-options.html I proceeded to reimage the system back to what it was.  It warns this may take hours, so off to enjoy some NetFlix.


Several hours later, with the progress indicator slowly creeping across it finally finished.  I rebooted and it worked great.   I had to reboot twice, and Norton 360 had a problem but it fixed itself.

The new hard drive is working great, and is a lot faster than I expected.  My laptop is back to running quick again.  Mission accomplished.

Post to Twitter

12Dec/102

Wifi thermostat

Posted by Mark Milbourne

My girlfriend always complained when we'd go up to our cabin at Tahoe during the winter because it was so cold inside. So I thought I'd install a wifi thermostat. Where we could adjust the temperature before we got there, so it'd be nice and warm on arrival.

The thermostat I chose was the Intwine IECT-210.  The installation instructions for the unit was fairly good.  Having installed a thermostat before it wasn't new to me.  Setting up the WiFi was a little tricky, you need to download a utility from their website to do it.  The GUI for this utility is very rudimentary, even for an software engineer like myself, I found it hard to use.  The error messages were difficult to understand.  Connecting the wifi module to my laptop was easy.  I was unable to get the WEP-64 to work with my AT&T wifi router.  The utilitiy kept forcing me to enter the WEP password in all 4 entry fields before it would setup the module (connected via USB).  After switching my router to a different Encryption method (WPA) I was able to get it to work.

Installing the unit on the wall was really easy.  The instructions helped a lot.  However, after about 12 hours the batteries in the unit when completely flat.  After more carefully reading the installation guide, it turns out the the thermostat needs to be connected to power when using the wifi module.  Since the wall heater I had it connected to didn't have a "C" power output, I had to go and buy a 12V transformer.  Now the fun part begins.  To connect the transformer I had to cut off the end of the transformers cable, strip the ends then in connect them into the C and RH inputs on the thermostat.  I had to temporarily rig up an extension cable to the thermostat to power the transformer.  I need to make a trip to the hardware store to get some more cable so that I can route it to the closest powerpoint.  Not to happy about that but, at least the thermostat is working now.

To access the thermostat remotely you have two options.  An iPhone app and the website.   I found the website to be fully featured, but it seemed to be buggy as programming the temp times of day didn't quite work right.   But all in all it was ok.  The iPhone app was a let down, it isn't fully featured.  So you can't fully control the thermostat using it.   But it does satisfy our original requirement.  You can change the temp of the themostat remotely.

All in all I'm happy with the thermostat.  I'm not sure how the lay person would have a chance of setting it up.

https://www.gointwine.com

Post to Twitter

9Dec/100

IE8 HTTPS and Proxy?

Posted by Mark Milbourne

We recently came accross an issue on a website we were working on where IE8 wasn't allowing content to be downloaded.  It seems that we needed to add "Proxy:" as a header.  This seems like a bug, but at least we have a work around.  This only happens when the connection is using https.

The Proxy RFC is defined in here:

  1. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
  2. http://en.wikipedia.org/wiki/List_of_HTTP_header_fields

Post to Twitter

Filed under: Programming No Comments