Monday, May 28, 2012

Article on Genius thought processes

This is interesting and in some ways ... kinda stating the obvious.  Perhaps a more interesting question is not how Geniuses think... but how everyone else thinks; and why. 

Is thought patterns and strategies a spectrum?  Is there some tipping point between unusual thought patterns and everyone else?

Whats at the other end of the spectrum?  Anxiety? Compulsive behaviours?  Stress? Nightmares?
I think its limits.  That is, either self limiting thought patterns ( I can't draw) or looping thought patterns that endlessly cycle (post traumatic stress) recurrent nightmares etc.  I would also toss in issues like peer pressure, social conformity, body image and other "norming" thought processes that limit options and exploration of possibilities.

The spectrum between these two positions is probably "Normal thought"  which is a little bit from column A and a little from Column B.  

I always find this kind of process interesting because it ends up with me asking myself what sort of limits I impose on myself?  Are these limits real or imagined.  Are they still relevant.

Some are biological,  physical limits due to health and fitness, others are cognitive, some may even be maladaptive.... others are social and finally some are due to phsical resources (time and money mostly) and environment.   There may be a couple of other categories ( legal, saftey, future planning, heritage, family, religious.... that I am ignoring right now.)

The question is, can we remove some of these limits?  Are some of them "Improvable"?  Do we need to swap one for another?  Is it simply a case of doing something differently or is there a trade-off? 

Isn't life fun...


Monday, May 21, 2012

When Refactoring smells...

My rule of Software Project fiddling... *cough* refactoring

Eventually, you will get brave enough to make a major change, using an automated tool that will simply and easily stuff your project up.  You will also be between comits to SVN and have hours of little fiddling work that you don't want to loose.  It will seem easier to simply "reverse" the change you have made.  Everything will seem fine.... you will continue making small stupid changes without thoughly testing what you have done... burning the change deeper and deeper into your work stack until its nearly impossible to get back out with the lovely automated tools you used to put it there. 

Try running find and replace to replace x86 with Win32 in a set of project files to fix a stupid inconsistency in Wix, then try to undo it with "ignore caps" option on.... then try to figure out why your projects will suddenly not build and spews errors like bastards.  (Think of the effect of quietly changing the WIN32 pre-processor directive to Win32....)

This raises the question about how the hell can you refactor something that has so many possible variables as a solution with multiple project files, multiple build targets and platforms and integrates with a coupld of flakey external tools... some custom build rules and is in an indeterminate state of upgrade/crossgrade shitgrade from multiple versions of Visual Studio chewing on it over time....

Going home... fuck it all.  Tired of looking at this moldy old pile of fucking code.

BTW the Wix documentation sucks nuts. 

More Custom Build Rule Hacking

I have tried to live with the broken build rule but its making a mess of my builds. I just don't have time to waste nursing each build by hand... AHHHHHHHHHHHH!

So the only thing for it is to fix the freakin build rule.

The symptoms are:

1) The  "Output Directory" property is not being correctly calculated by the build macro (?)  and passed to the command line string which is passed to the HelpNDoc compiler.  I can see this in the output.log.
The big problem is that within the property pages, the command line string seems to be being correctly calculated and looks good.  WTF?

My hypothesis is that the evil lies within the .target file as this seems to manage how the information from the property pages is passed to the build system.

Fiddling with the .XML file.

As a first step I am going to "experiment" with the .xml file just to see what happens.

It looks like some of the categories are not being clearly defined, so I will add a couple of them to see what happens and see how the change-reload-test cycle works.

Unload and Re-load project do not seem to reload the changes?
Unloading and Re-Loading the Solution does not seem to reload the changes?

Time for some serious breaking.

I removed the .xml, .targets, .props files from the project directory just to try to force a failure. Thankfully I got an error.

E:\_dev\PointLightLab4\src\HelpPrj\HelpPrj.vcxproj : error  : The imported project "E:\_dev\PointLightLab4\src\HelpPrj\HelpNDocRule.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.  E:\_dev\PointLightLab4\src\HelpPrj\HelpPrj.vcxproj

So it looks like the .props file is the first to be loaded and parsed. Interesting. Lets add it back and try to reload the project.

Still failing with the same Error?  WTF?  Is it just a spurious error?  Its from an statement in the .vcxproj file... so perhaps I should have a look. 

Found it.  The project seemed to be using the backup copy of the build rule I had in another directory.  Weird that the path in the error was wrong.  It should have been "E:\_dev\PointLightLab4\src\HelpPrj\BuildRule\HelpNDocRule.props" as that as the path in the .vcxproj file. Yet another MS bug?

Ok, we are passed that error. Now the missing .targets file is being correctly detected.

Loading E:\_dev\PointLightLab4\src\HelpPrj\HelpPrj.vcxproj ...
E:\_dev\PointLightLab4\src\HelpPrj\HelpPrj.vcxproj : error  : The imported project "E:\_dev\PointLightLab4\src\HelpPrj\HelpNDocRule.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.  E:\_dev\PointLightLab4\src\HelpPrj\HelpPrj.vcxproj

Replace the .targets file and the project "Reloads" without errors.  I guess the .xml file only gets parsed when I try to open the Property Pages. So its not been missed yet.  Lets test that theory.

Nope.  The property pages work fine without the .xml file being present.  I guess its completely useless?  The properties are certainly being defined without it. 

So I think my hacking needs to focus on the .props and .targets files.

There is a mess of properties for the HelpNDoc build rule defined in the vcxproj file as well I notice. Which makes sense. 

Added a couple of lines to the .vcxproj file.
*.chm,*.pdf, *.html
    *.chm,*.pdf, *.html

As the extensions where only defined for the debug builds for some reason.

Interestingly, when I make changes to the .vcxproj file and have the property pages open in VS, it detects that the file has changed and offers the option to reload it.  Nice! Although the changes I made are not showing up... WTF?

I still cannot figure out where the definitions for the property pages are comming from.  The .xml file is not being loaded at all, so it has to be at some point in the load chain.  Time to backtrack.

It's not in the .sln file.
It's not in the .vcxproj.user file.  (Although that needs some additions for new platform targets I have added)
It's not in old user files.

Somewhere its being cached. Bastard!

Ok, remove everything, unload the solution, close Visual Studio... reopen VS, reload the solution and... TAfuckingDA the custom build stuff has disapeared.  Finally.

Now can I add the .xml file back in? Replace the .xml file in the project directory.

Unloading and Reloading the project does not pick up the settings again. Ok, cycle the whole solution... no joy.  Cycle the whole VS.... and they are back.  OK, so essentially, fucking with the .xml file requires a complete cycle of Visual Studio to see the changes.

Making Progress.

Now to get all the categories defined and named the way I like...

Ok, all the categories are correctly defined in the category section and I have removed the spaces from the names simply from habit.  They now have nice display names too.

So the 's seem pretty straight forward. They are defined in the .xml file, and their "name" attribute is referenced in the .props file with what look like default values. These default values are then over-ridden by any values in the .vcxproj file (in th tag) and additionally over-ridden for each build target /platform (in a tag), again simply by referencing the property names defined in the .xml file. 

First order of business is to explicity set the values in the in the .vcxproj file for all the build targets. 

Try building again...

I'm getting an error about the .props file cannot be imported again. with a line and col reference in from the .vcxproj file.  Ok, looks like I have accidentally imported the file again in the ImportGroups that I copied earlier... wonder why it was there in the first place? Anyway, fixed now.

Now looking at the logs in the intermediate directory... the command line is correct.
And in the output directory?...... WhoooT!  We have output files correctly targeted!

Now, the /silent flag is not acting correctly. Tweak the .vcxproj file and we have success.

Now moving on to improving the custom build rule for HelpNDoc....

Found this reference for the MSBuild Syntax.

And an overview of using and createing build files

Would have been nice to know where these were a while back...

It's only after you have figured out the answers, that you really understand how to ask the question.  Damit.

After some is the final resource.

As usual with forums, your milage will vary considerably....

Thursday, May 17, 2012

Boostrapper error in Visual Studio setup project

Error    4    An error occurred generating a bootstrapper: Unable to finish updating resource for .... blah blah files in setup project.


There is not much to go on with googling for an answer.  Possible solutions abound but hard results are few.

1) Clean all and rebuild... done with no result.
2) Fiddle with the dependencies on the .NET version required and the launch conditions which also specified the .NET version.... tada!  Fixed.  For some reason .NET v2.0 is no longer in the search path ( seems to not be part of the Windows 7 SDK at the moment????

I have upgraded to .NET 4 and Windows Installer 4.5.  I don't need those levels of the framework specificially but I know they are current and should be present on a well maintained machine.  The presence of older versions of the .NET framework is getting a little more risky.

Job done.

Wednesday, May 16, 2012

Custom Build Rules in Visual Studio 2010

Yet another upgrade quirk.  The editor for Custom Build Rules in VS2008 has evaporated.   This is due to the changes in MSBuild... I appreciate that...

I had a coupld of custom build rules in my project and have recently upgraded it all from VS2008 to VS2010 and expected it to "Just work".

This is not good.  Thankfully the folk at CodeSynthesis had already sorted out the build rule for XSD  and supplied a custom build rule that sorted that out.

Now I just need my build rule for HelpNDoc3 and I am back in business.
My problem is that the Upgrade Wizard, while its obviously done a fair job has either revealed some bugs in my old rule ( and faithfully upgraded those bugs) or its just done a shit job... either way, there are some issues that need fixing and no one else I can push the work onto.

So the current process seems to be:

A) Go use the editor in VS2008 to generate the .rule file and then use the migration wizard to transform the rule into the .target, .props and .xml files for VS2010.  Big round trip... lots of moving parts.... but a possibility.

B) Hand edit (hack blindly at..) the three files and try to figure out what you are up to by looking at the malnourished references and examples included with VS2010. Big round trip to test, lots of unknowns,  ( there will be PAIN)

C) Hope like hell someone else has already done the work and documented it.

Not much to go on but its something.

Hack'n time....

The .XML file

This file defines the property editor interface for use in the solution explorer.  After spreading it out in my favorite xml editor and doing some reading, it seems fairly straight forward. 

This file uses the XAML schema for WinFX.  I dont think VS is using the info in the file as real xaml; its simply structured data that happens to be using the schema for parsing purposes.

If we follow the namespace breadcrumbs I find: which seems more meaningful as to the content than UI xaml which this file clearly does not contain.    This gives me enough clues to take some guesses at the structure of the data in this file but no fucking idea about the logical effect of adding or removing elements from this file. Where does that info exist I wonder?

Here are some clues:

The .props file

This file seems to contain default values for some of the properties defined in the .xml file above.  (Why have them in a seperate file?)

There are some clues on this at  

and here

The .targets file

This file contains a whole lot of shit.  Mostly it defines the output for the build file.  Logically this defines how the property values from the editor are mapped into the actual build script.  Looks hideous and nasty and will be damn hard to debug simply due to the length of the round trip and difficulty of getting useful/meaningful error messages from the build system.

The .VCXPROJ file

This file contains (along with everything else) the actual values for the properties as applied to the file item.  These are the values at the bottom of the property inheritance chain.  (See the link above under the .props file heading for more info on property sheet evaluation orders)

Looks like you can do some fairly tricky stunts in the property pages via inline function calls:

I have no use for these at the moment.

Friday, May 11, 2012

Download pain from Microsoft

I have spent the past two days trying to get a copy of the DirectX SDK from Microsoft in some form.  There is nothing else to do except call it broken.

After multiple restarts, alternate mechanisms, web searches, bitching in forums and twiddling with settings, I am throwing in the fucking towel.

I firmly think this is to do with some catastrophic weirdness in the CDN network.  Becasue after testing it in various ways, there seems to be a partial cache of whatever I have downloaded somewhere in the system... as it picks up from that same point, no matter what machine I start the download on.

Honestly, its been flakey as hell.  After the initial rush, it usually settles down at about 10-20kBs per second.  Which I could deal with as thats the sort of speed I get for everything at home, however the downloads just die.  They don't say they die... but they still quit and the browser thinks its fine.  The file is incomplete so it doesnt work.  The download is finished, so it can't be re-started.  More time wasted.

Should I try a download manager with a restart capacity?  Should I just get it as a torrent somewhere?

I have used the web installer to get the Windows SDK but because it has stopped and started so many times and fails silently ( while claiming to have finished) I just do not trust what its downloaded.

Just to be bloody minded, I have re-started the SDK download.... and watched it jump past the first 100 odd meg then drop down to a seady ~29kBs.  Not shoddy but not what I expected.

I am comming to the conclusion that either Microsoft has decided to throtle the shit out of their network, or something flakey is happening in their caching system.

If you look over the MS forums, there are repeated incidents of this kind of problem being reported with little seeming response.

Sep 2011

All the addresses I trace resolve back to Akamai servers in Sydney with virtually a hard link to aarnet which should give me a multi-megabit link straight through.  But I am still seeing a few kilobits per second.

Damit... just had another attempt drop out in Firefox.  Now there is only one DL manager session running.  All my hopes are pinned on it.

Tuesday, May 8, 2012

Go Algorithms


Software professional code of ethics... chortle

This is an interesting article... in spite of itself.  The author makes some interesting points about the futility of the exercise.  Simply because, I feel, they have wandered into the fantasy land of "higher purpose" type ideals. 

I think that any statement of ethics should firstly come from a realistic place. 

1) Look after yourself first.  ( I think self interest must be the basis for any healthy belief structure... but thats me)
2) Manage your clients expectations. 
3) Communicate only as much as your clients will find useful.
4) Design the system so its cheap to change.
5) Design a staged development and implementation cycle so neither yourself or the client has any unpleasant suprises.
6) Establish a fixed price quote for each stage before the work starts and put in place a payment schedule.  (Rolling costs are just a scam.)
7) Manage your motivation. (Celebrate regularly)
8) Write good documentation. 
9) Never trust your client.
10) Accept that everything changes.  Your work is ephemerial.  Nothing you do matters in the long run. Try not to get too attached.

Monday, May 7, 2012

My personal gravity theory

Let me preface this by saying that its uninformed speculation having no pretence at reality... just not allowed to yell at the tv anymore.... oh and I have a headache.   

It's obvious that if gravity can deflect light, then gravity must have more energy than light.  Since light is a wave that sometimes acts like a particle, it would seem rational that gravity is a wave of such high frequency that it folds back on itself creating an attractor rather than a repulsor as energy is returned inward rather than being projected outward but still being able to interesect with other bodies to cause attraction.  It also suggests that gravity of a quantum particle interacts with the gravity waves of nearby particles and distorts them creating a greater gravity field than the sum of the parts.... since gravity can be distored by a spinning super conductor.... that means that light should also be effected, if they exist in the same set of dimensions. However it would be much more interesting if they existed in slightly different dimensions. But what if a sub atomic particle had some or more gravity units (call them gravitons if you must) ..... gotta wonder if they are all in phase.  Or is it a constant shaped field?   Or are we all just a bunch of different flavored constantly colapsing tiny tiny fields that are so fast they create a standing wave at a point in space time.... since the universe is cooling down, that means that each collapsing field looses a tiny bit of energy in some transformation.... totally makes sense in my head.... kind of like the way a giant soap bubble wobbles though all sorts of unstable shapes until it reaches stability as a sphere.  Think of the surface of the bubble as a multi-dimensional wave with some bits being in and others out at any point in time... some bits a pulling inward while others are being thrown outward and rebounding. Then think of all the tiny little bubbles intersecting and overlapping at the edges....  and since they are just energy, they bubbles distort each other and combine together to create a field effect greater than any single bubble, which must be a multiple or exponential relationship because of the massive size of a gravity field but still have an exponential falloff over distance. 

The other possibility is that the gravitational field of a sub atomic particle is not compressable.  So even through the particle is within a compact and compressed state, the field energy is squeezed out. And becomes part of an orbiting fields of waves that are constantly trying to return to their source while being deflected by each other.  This creates a constant field around the mass, of waves that interact and create interference patterns in each other (because they are the same frequency) and because they are constantly collapsing inward and exerting an outward pressure through the shape of their waveform, they create a self sustaining wave that is endlessly collapsing.

This would explain why, when you smash some atoms together in a super collider, there are no gravitons to detect.  You have simply interupted a standing wave in such a way that it cannot re-form fast enough to be self sustaining, However, if you look at the traces from a super collider, it looks like inward curling tracks that form a hyperbolic spiral, which suggests that the fragments are collapsing and rotating toward a local orign at an accellerating pace.  Where does the energy to accellerate come from? Why do the particles rotate inward rather than continuing on more or less linear paths away from the explosion? Is it simply a single disrupted wave fragmented into many smaller ones collapsing toward new stable states?

Decay Rate of Learned Skills

This is an interesting piece of research that illustrates something I have always wondered about.  How long do skills last once I "learn" them? 

If this is a repeatable measure or even close ( as I suspect it is for most "normal" skills) then it suggests that its only material you have learned or practiced in the past month and a half that define what you are "good at".  All your other skills have decayed or are decaying to some level of uselessness.

So the question becomes, how many skills can you practice and "keep sharp" in a rolling six week period?  Is this period fixed for everyone? Fixed for an individual? Are there ways to "fit more in" so they can be practised more quickly? (Simulation and training packs for individuals?)

Keep in mind that the figure of six weeks includes decay time; after 8 weeks the benefit of the learning was completely gone.

Makes you wonder about the value of formal education. 

6th Sense... Scam Radar?

I have received too many scam emails.  Being attuned to scams and having read and disected hundreds, I am almost hyper-sensitive to them.  This has flowed over into my dealing with all sorts of other communication.

I have passed into the realm of the elete bullshit detectors.  Everything from poorly written advertorials, through to bias journalism, spun political monologues.  It may not help that I am raising small children who are inventing new ways to finess the truth every day.  

I think this has some very difficult results as I am so sensitve to social engineering attacks that conversations with peopel trying to get me to do something reasonable often trigger my scam detector.  I can barely carry a conversation with a salesperson in a shop without undermining all their bullshit. 

I have a feeling this makes me even more difficult to live with.... who knows.

Domesticating Skype

Skype Version

Skype has been really irritating me by hanging around on the task bar even when its not signed in. I want it hiding in the tray like it used to.

To make matters worse, the advanced options are not accessible, so I can't use the old option of forcing it not to do the irritating behaviour.

Finally, I got motivated enough ( or passed the irritation threshold...) to do something about it.

Using the compatibility hack described on this page will force it back into pre-windows 7 behaviour. Worked like a charm.