Saturday, July 28, 2012

Virtual box fails after OSX Mountain Lion upgrade

I just knew it would be trouble.

The lengthy upgrade to OSX 10.8 upset VirtualBox.
This is what greeted me on the restart.

So now what.
I knew I had an old version (4.1.4). And I knew deep down that upgrading wouldn't help.

I needn't have been so pessimistic because all I needed to do, was use the uninstall script.
Unlike other apps where an uninstall can be simply moving the app to the trash, with VirtualBox you run the script in the bottom right hand corner of the instal windows.

You might have a problem with the script with some errors in the terminal wind - caused by open files or some such. The easiest thing to do is restart OSX and don't run an VirtualBox versions. Then run the Uninstall tool. Then go and install VirtualBox.

Simplifying the solution

When solving something, designing a solution or building an interface. We should start by remembering Occam's razor. This is succinctly stated by Einstein as:

"Everything should be made as simple as possible, but not simpler." - Albert Einstein

But this is a bit elegant, sexy and abstract perhaps. Steve Jobs wrote the following that is a bit more concrete and :

“When you first start off trying to solve a problem, the first solutions you come up with are very complex, and most people stop there. But if you keep going, and live with the problem and peel more layers of the onion off, you can often times arrive at some very elegant and simple solutions. Most people just don’t put in the time or energy to get there.” - Steve Jobs

What is really helpful to those in the team that want the little addition to improve the solution.

“Sometimes a design decision is what you don’t put in, as opposed to what you put in.”- John Gruber

I was prompted to write this blog following a chat I had with a colleague and reading Shawn Blanc's posting

Thursday, July 26, 2012

Question the norm in the dev team

 Apologies but it's a bit pompous of me using Einstein in the same post as my work, but here goes.

"Concepts that have proven useful in ordering things easily achieve such authority over us that we forget their earthly origins and accept them as unalterable givens." - Albert Einstein. 

It seems to me that software development generates a lot of acronyms and methods all providing the definitive in wisdom. As you get longer in the tooth you get cynical and question these saviours. Einstein was on a totally different level of course but the principle is worth thinking about in the development team.

Wednesday, July 4, 2012

First Order Logic

This stuff is great fun.
There are a number of differeing styles of notation and my logic, how I still think, started in electronics and then early Computer Science lessons so I might be a bit wrong in places. It's something I enjoy and I hope to apply it more.

A Predicate

A predicate is a statement that is TRUE or FALSE
An example could be:
A dog is a mammal.
A dog is a fish.
Both of the above are predicates but the second one is false.

We can write those in psudo computer speak as:
Both of the above would return a Boolean.

Symbols we use all the time

→ - Implies

¬ - Not

These two are quantifiers, for obvious reasons 
∃ - There exists. This means that there is one or more, there is at least one value that makes the predicate true.
∀- For all


This stuff is basic, but interesting if you've not seen it before.
(1) ¬(a and b) = ¬a or ¬b
(2) ¬(a or b) = ¬a and ¬b

(1) Not (a and b), is the same as (not a) or (not b)
(2) Not(a or b) is the same as saying,  (not a) and (not b)

In electronics we used to use "+" for OR, "." for AND and a bar across the letter for NOT.
_   _
a + b  Not a OR Not b  

a + b Not (a or b)

We used to say "break the bar change the sign" to remember the following:
 ___   _ _
 a.b = a+b
 ___   _ _
 a+b = a.b

Not sure if that's of any use but it's true none the less.  DeMorgan's Theorem.

We can use them thus:

If someone says that something is ¬(a and b) 
then to prove them wrong, we have to prove  ¬a or it is ¬b

Two more

(1) This is nearly, or pretty obvious I think: 

If we know that a implies b,
a→b and we know a, then we also know b

(2) This one probably isn't so obvious:
If we know that a implies b,
a→b and we know it is ¬b, then we also know ¬a
Notice that the two rules have a reversal. The first one is Modus Ponens and the second is Modus Tollens. We don't really need to know that but it's posh.

Using modus Ponens:
If we know the creature is a Dog, then we know it is a mammal.
Dog(creature) → Mammal(Creature) 
Using Modus Tollens,
If we know the creature is not a dog, then we know it is not a mammal
¬Mammal(Creature), therefore ¬Dog(Creature)

There are two more, similar

a → b = ¬b → a
¬(a→b) = a and ¬b

Using first order logic to define a Prime number

prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.

We can write two predicates:
Divisible(a, b) - the integer a is divisible by b.
Greater(a, b) - the integer a is greater than b.

So we can create a predicate for Prime numbers.
Prime(n) returns true if n is a prime, otherwise false if it is not.

Prime(n) = ∀i Greater(i,1) → ¬Divisible(n, i)
Prime(n) = ∀i Greater(i,1) and ¬Divisible(n, i)
The above says, n is a prime number
if for all numbers, i, i is Greater than 1, and n is not divisible by i


Just for interest. here's the Prolog code to check if a number is a prime number

Example:  isprime(3).


      N is Y*Y, 

      N =< X, 
      X mod Y =:= 0.


      Y < X, 
      Y1 is Y+1, 

     Y is 2, 
     X > 1, 

Sunday, July 1, 2012

Hick's Law - A Design principle

"The time required to locate and use an option increases as the number of options increases."
Basil Fawlty: Next contestant, Mrs. Sybil Fawlty from Torquay. Specialist subject - the bleeding obvious.

I'm not sure how useful this principle is on its own but I am reminded of it because of a piece of software I have had the great misfortune to come across recently. I don't have to use it but I feel very sorry for the people that do. An absolute horror of a piece of software. 

I am reminded that although it enables users to do stuff, it doesn't make it easy, and it certainly doesn't generate any delight. Those are what we should be looking for now in our applications.

Oh the software: iMIS.
What is it with the "i"? 
Why do they do that?
There is nothing remotely "i" about their system.

For my mind it's Hick's law that makes Pages so much better than MS Word.