Monday, September 27, 2010

Quantum Physics. A hiding to nothing.

Imagine a computer program that wanted to analyse itself to the most fundamental level. By knowing its own source code, then relating that to the instructions created by the compiler, a level of insight might be gained.
A more complex program might be able to deduce the structure of registers and maybe even something about the internal workings of the processor and make a fairly good guess at deeper aspects of the system.
Unfortunately, a quantum analysis of a "bit" within a word cannot reveal the structure of a transistor or the type of substrate upon which the transistor is constructed.
Quarks, Leptons and Bosons all make up the base classes of our universe. However, even though we may be able to analyse them. How can we be aware of the "transistors" upon which they are expressed?

Saturday, September 04, 2010

Splash

Odd, how inspiration can come from the most mundane sources. I was looking at the screen savers on a Windows XP box the other day and realised that the screen saver with the OpenGL "tambourine" onto which something drops, causing a splash could be the model for the formation of Saturn's rings.
One could imagine that a liquid body such as a gas giant planet could ring like a bell with shock waves that travelled all around the planet and back to the point of origin such that a splash of planet material might be ejected back into space.
A little angular momentum due to spin and the planet moving on it's course around the sun would spread the ejected material along it's orbit enough to create a ring.
I appeal to Sony for 32 Playstation 3 boxes so I can number crunch the math and write a paper.


Thursday, July 29, 2010

Visual Studio tests and punctuation in project paths

A modern file system is a friendly thing. We can use all manner of characters, such as punctuation, in the file and folder names. This makes the path easier to read an provides a nicer experience for those of us that appreciate good grammar on our desktops.

I, for example, often name folders for myself or for clients so a folder named "Bob's stuff" or "Dave's projects" would not be uncommon.

If however you associate unit test suites with these projects an exception will be thrown by the test execution system complaining about illegal characters in the path.

To avoid this, and because I did not want to be forced to rename directories that had other relationships in then, I discovered that the use of the good old DOS subst command could provide a drive letter for the offending folder and allow tests to run.

It should be noted that this problem no longer exists in Visual Studio 2010 but for anyone still running on 2008 this little trick can be a life saver.



Monday, July 26, 2010

Manhattan bar charts

The term "Manhattan" used in reference to 3D bar charts has been around for a number of years. Since 1996 in fact when I coined the title for the 3D charts I wrote for Stingray Software's Objective Chart product. Sadly, Stingray was swallowed up by Rogue Wave and the chart product died shortly after. I know that Rogue Wave still sell it but it's C++ code that is a decade old and thoroughly out of date these days.
Anyway, I'd just like to thank the likes of Nevron and DevExpress for using the title. It brings me good memories.


Sunday, July 25, 2010

The Jazz saga continues...

My Honda Jazz (Honda Fit un the U.S.A) has always been frugal with its fuel consumption and I always wondered just how far one could drive when the little "Empty" light on the fuel guage lit up. Well, this weekend I tested it by driving my usual hypermiling style but when the fuel light came on, I just kept on driving.

In the end the Jazz maintained 4.5 litres per 100 kilometers and drove 188 klicks, that's 116 miles in old money, before it spluttered to a halt. Honda-RESPECT!

Sunday, June 27, 2010

Still pleased with Brinkster

I have had a web site hosting agreement with Brinkster for many years now. They have continued to improve their systems over the years and I have just finished a couple of days of changes to make my bobpowell.net site a bit more modern and easy to update.
I must say that using the new Brinkster file manager is a joy and it works quickly and reliably while updating the files that need changing.
Even though I use GoDaddy for my various other sites, I will keep Brinkster for my "mission critical" site because they are just brilliant!

Thursday, June 24, 2010

Is Amazon's associates program utterly useless?

I have had an associate program ID for several years and despite having many thousands of hits per day on my site I never -ever- make a cent from the associates program.

Google pays for clicks and I regularly get cheques from them, which I must admit I don't cash. (They probably really owe me several thousand bucks... ) but as far as I am concerned, Amazon is no good at all.

I guess anyone who visits my site has already got all the books they need.

Sunday, June 13, 2010

More Honda Jazz miles per gallon results

I took my daughter to her horse riding exam today. A round trip of 367.6 kilometres. The reported litres per 100 kilometres was 4.2. This must have been a good 4.2 because it was still at that level after the drive back through the 'burbs to home so I reckon more like 4.1-4.2.
So, for a total of 228.416 miles, the fuel consumption was 15.43 litres or 3.396 imperial gallons.

This makes my fuel consumption 67.2 miles per gallon!

Saturday, June 12, 2010

GetTemplateChild vs FindName

While creating a WPF control I searched for GetTemplateChild only to find that the help file says "Do not use. Use FindName instead".

Well, being a good developer used to following advice, I did just that and my control stopped working immediately.

I think in reality the help file should say use FindName unless you're trying to find a PART in your own custom control then you should definitely use GetTemplateChild.

Thursday, June 03, 2010

Comments on this blog

I was unaware but the comment system on this blog seems to have been usurped by one which asks you to register by adding the email addresses of ten friends. Sorry about that. I will change it the first opportunity I get.


Thursday, May 06, 2010

Where's my flying car?

Is a modern day complaint. Where are the sci-fi devices that the futurologists of the last century promised us?
Well, the telephone in my pocket holds more information than two million Sinclair Spectrum computers. It holds the text equivalent of fifty thousand 500 page novels.
To be honest. The idea that I could carry the entire library of Alexandria in my shirt pocket is way more impressive than something as brute-force as a flying car.

Monday, May 03, 2010

Grandad

Grand-child #3, Jasper Powell born May 1st 2010
The dynasty grows!

Technical hitch might be good?

So, what happens when a digger cuts your telephone cable and chops off your DSL?

Obviously, you tether your iPhone to the 3G network and share it from your trusty Mac to all the PC's in the house!

Given that I am more than 6 klicks from the DSLAM and my DSL sucks (see previous posts) I wonder if it isn't worth leaving things that way?

Monday, April 26, 2010

Hawking has finally lost the plot!

Stephen Hawking might be a brilliant mathematician, he might understand the cosmos enough to be able to visualise what goes on inside a black hole but the evidence of todays announcement shows that he shouldn't be allowed to give an opinion without some idiot filters in place.
His declaration of the existence of alien life and it's possible or probable hostility is so incredibly irresponsible that it beggars belief that someone hasn't pulled the plug on his voice box!.
Firstly, the world is full of people who will be gullible enough to listen to this rubbish. The press has splurged it in the papers and on the web and to anyone who might take Hawking as an authority on such matters could imagine that we are in imminent danger of invasion from an awful alien menace bent on stealing our metals and impregnating our women.
Secondly, there are so many reasons why what he suggests is complete hogwash that anyone with a modicum of sense would see that this is nothing more than the ramblings of a chap who doesn't get out enough!
Just ask yourself this. If dangerous alien races are so common and interstellar travel is so easy why are we not overrun by aliens? The fact is that its really really hard to travel from star to star and no one would do it without vast incentives.
This leads us to what might incentivise aliens to come all the way here to rob us. What could they want? Water?, air? metal?, oils and hydrocarbons?, diamonds?, gold?
All of these things are available in truly vast quantities right out there in space. What's more, they are cheaper to obtain if they dont have to mine the stuff and drag it up out of a gravity well too!
When you cut to the chase and think of the only things that aliens might want from us they boil down to two things. Creativity and manpower.
They won't need our knowledge of physics because they would already know more than us just by the fact that they could get here. The only other creativity would be our literature and art which might hold a great price on the interstellar market.
If they only want us for our manpower then that too would be a good thing because the human race needs to break the bounds of the earth just to get a sniff at the aforementioned vast resources that are out there for the taking but as idiot governments run by idiot risk averse lawyers are shutting down space programs right and left these days then its likely that the best we can hope for is to hitch a ride with the Vogons. If they stole the whole human race to use as slaves we would eventually escape in small numbers and breed enough to fill the galaxy on the back of their technology. BRING IT ON!!

Monday, March 15, 2010

User controls suck.

I have rcently had occasion to go back to developing windows forms wigets and have reaffirmed my opinion that the UserControl model is a huge mistake for anything other than a one-off solution to a simple problem.
There are many problems with the model. First, the principle of polymorphism in a UserControl is utterly destroyed by the use of events within the user control. As soon as a UC has an initializecomponent that has event subscriptions then it is impossible to derive from the UC in any meaningful way because certain behaviours are set in stone and may not later be modified.
Another problem is the lazy way aggregation of function is treated by developers who utterly miss the boat with simple principles. An example being a job I'm working on now to replace a UC that is designed to emulate the function of a combobox with a datagrid in the dropdown.
This type of aggregation is uneccesary when we go back to the base functionality of the combobox and use the system of messages and overrides to create a real combobox that hosts something other than a lame listbox in the dropdown.
Even when dealing with Windows Forms the immediate reflex seems to be look at as high a level solution as possible and to ignore the underlying elegance of the system.

Sunday, March 14, 2010

The mobile programmer

I am currently sitting in the back of my Land Rover waiting for my daughter who is riding in a show jumping competition.

I have an old UPS which I have silenced by ripping out the beeper, a car battery and my iPhone connected to my laptop.

I am currently getting better internet than I get at home. (See my previous post on how France Telecom is the worst provider in the world)

I should do this more often.

Tuesday, March 02, 2010

Hypermiling

Earlier in this blog I mentioned my Homda Jazz car and the fuel consumption figures attainable from the petrol fuelled motor.
In my recent trips made over the 300 kilometers between my work in Paris and Brittany where I manage a small property development company I have been using some easy to learn techniques to improve milage.
First, I try to accelerate gently and to get into top gear as soon as road speed permits the engine to work smoothly. On the Jazz this can be as slow as 40 KmH on the flat.
Secondly, I try to drive without using brakes. This means guessing distances and momentum to allow me to roll to a stop or to slow in traffic naturally.
Thirdly I coast where possible. Downhill is free! Coasting in neutral to save the clutch too.
Fourthly, I switch off the engine where possible. When coasting I switch off and restart just by selecting fifth gear. At lights I hit the key to start.
Lastly I check tyre pressures and keep them set right. I think that overinflating would damage tyres enough to offset the savings of careful driving.
As a consequence on a run this weekend I obtained 4.5 litres per 100 kilometers. I fit the drive in the time predicted by the GPS. Not slowly and hitting the limit on motorway stretches. That means 62.77 milled per gallon from a petrol engined non hybrid family car.

Saturday, February 20, 2010

Is it a pattern?

I have noticed a trend in application design, one which I suppose became obvious some years ago when I really became interested in the use of reflection and the advantages of metadata in the form of attributes used at design time.

I was busy with a project for a financial sector client and had to come up with applications that were able to edit really complex data types but do it in a way that was easy for a developer to reuse in an application. At the time I was doing a lot of .Net design time work so my awareness of attributes such as TypeConverterAttribute and EditorAttribute came in handy. I also developed my own attributes to be used in presentation layer stuff and found that the idea of creating a tiny helper class that was instantiated when required, used and let go again was a recurruing theme. For example, when properties are read for databinding, the TypeConverter for the data type will be invoked and I found that I applied the same model to many other things in my applications.

Now I see the same trend in WPF for example when its so simple to write a tiny bit of code which is instantiated in the static resources and used to provide useful calculation, binding or conversion routines. As an application designer and, as I see this as a pattern, I wonder if there is really room for a formal "Granular instance" pattern and if it becomes worthy of mention.

Friday, February 12, 2010

Styles and storyboards in code


Today I have been playing wit some WPF to emulate the idea of the Mac dock in a scrollview that shows pictures.
I thought I would use a mixture of XAML and code to create storyboards that expand an image when the mouse is over it and reduces it again once it leaves.
For this I created a single style, programmatcally filling the EntryAction and ExitActiion for the trigger.
This all worked fine until I tried to cope with a resize. First I noticed that my effects ran slower as I resized. Obviously I had added and compounded the storyboards such that there were many being triggered at once. Upon trying to remove them I found that animations get "Sealed" and can no longer be changed. As this is interesting I think i'll do a wee article on it.
I had a discussion with a friend the other day who said that WPF still seems to be difficult for use in desktop line of business apps. My current investigation is in some way related to that idea because I think that with judicious use of code and XAML much more is possible.



Wednesday, February 10, 2010

Climate madness

I swear I just saw a glacier shoot past my window and take the roof off the house next door!