Investor buys stake in Guyana forest

This is actually pretty cool in my opinion. Someone actually placeing a cash value on some rainforest is probably a good step in the right direction for the market to actually start realise that they are in a new paradigm. The market is a subset of the environment, the environment is not a resource FOR the market to pillage as it sees fit or when it makes financial sense to do so. Without the environment there is no market …

Canopy Capital is the company, they have ‘bought’ an area of Guyanian forest larger than the island of Mallorca! Actually they haven’t bought anything other than the rights to the carbon stored in the forests trees. After the new set of talks regarding the Kyoto replacement agreement Canopy Capital hopes to sell these rights (a carbon offset basically) at a profit. The really cool thing is that 80 percent of the profit will actually go back to the Iwokrama reserve.

As far as I can tell slapping a market value on something is the only way to get the market to actually pay attention since they can then base their calculation on it and realise that they simply have to do something about climate change before it eats all of their investments and cold hard cash. This is something people like Lester Brown have been saying for years. Its really good to see something actually happening.

Share

LINQ

I’m not sure if I’m missing something here but a couple of hours into looking at LINQ for the first time and I almost instantly butted up against a limitation. What happens if your tables are dynamic? IE: A user of your application can create a table that is of the same structure as something already in your DataContext? At runtime your application will have to use nifty Reflection and a few other techniques in order to include these new tables in some form of dynamic DataContext …

Hmm …

Share

Debugging XAML

This is a really tough one sometimes. I’ve recently had to debug an error that initially seemed a bit odd. Viewing the main window XAML in Visual Studio 2008 or C# Express just gave me the dreaded “Object not set to an instance of an object.” error. Even though Blend rendered the screen without showing any problems. That in itself is not that odd since the two XAML editors operate very differently it seems.

After trying various things to find the bug I eventually opted for removing sections of XAML from the main screen until I ended up with a screen that would render exception free in the C# Express XAML pane. It turned out that the problem was with the style that was being applied to my TreeViewItems. I then set about looking at the XAML Dictionary that I had created in order to provide the custom styling for the Tree View. I couldn’t see any issues with it so I went back up the visual tree to the code in the main window XAML that applied the style. Turns out that I had the style referenced wrong. In stead of using DynamicResource I needed to be using StaticResource. Basically there was no real problem with either the window code or the style code, just the way it was being applied at design time.

Share

Tibet

I can’t believe what is happening over there at the moment. Its just disgraceful. All this heading towards the Olympics as well. In fact I can’t believe China has actually been given the Olympics. They have moved out thousands from their homes and villages only to build unused empty fake cities to make it look more prosperous that it really is. Then this all kicks off. The Chinese government have even had the audacity to say:

Chinese authorities have blamed the Dalai Lama for orchestrating the unrest in an attempt to sabotage this summer’s Beijing Olympics and promote Tibetan independence.

I mean, do they really think people in the west are stupid? We’ve been subjected to enough manipulation and lies in the past to see right through this sort of utter bullshit. The Dalai Lama orchestrating violence??? I just can’t see that happening myself. The exiled Tibetan government are saying that nearly 100 have been killed in the riots and China is saying that just 19 have been killed, one of them a police officer. This is unfortunately what happens when you try to suppress people, they rebel. In real terms Tiananmen Square riots happened not so long ago (19 years) and as far as I’m concerned for anyone in my age group that is still very fresh in the mind. So really its just more of the same from China.

I’m not a sporty person at the best of times and it usually passes by without much attention from me but this time I’m actively boycotting it.

Share

SQL Compact Edition 3.5

Have just started evaluating this for my SampleSort project and so far I’m really impressed. Compared to even SQL Express this has got a ridiculously small footprint (less that 1.8mb) and which makes it really great for embedding in applications and due to its not requiring Administrative rights to install along with an application it makes including it and making it transparent to the end user really neat and tidy on the installation front.

As ever searching the Microsoft site for information can be a huge task in itself but during my searching I found a really useful document that dedicated itself to a discussion based around your selection of database engine for you application. It concentrates on putting forward different arguments pro and con between SQLCE or SQL Express. When considering these two solutions for local database storage this is a harder decision than you might think. If you decide to embed SQL Express (a harder task than SQLCE) your looking at bloating your applications install by 60mb … not a trivial amount of data on top of your applications code base. You can find this document at the link below … well worth a read …

Choosing Between SQLCE 2005 and SQLEE 2005

Share

Expression Blend

Hmm … this is potentially one of the nicest tools to come out of the Microsoft camp in living memory. Its got some seriously nice work flows inside it, a nice interface and a lot of power under the hood. But like any v1 Microsoft product I think its hit the market a tad early.

I’ve seen it doing some really odd things so far. Like controls in WPF assets I’m designing being rendered ABOVE the Blend interface! Even when there is apparently no ZIndex shenanigans going on in the XAML code.

I’m also convinced that Blend is using some kind of intermediate cache of the actual solution rather than working on the solution directly. It seems to operate drastically different to Visual Studio when it comes to the XAML elements of WPF. Some things that Visual Studio refuses to render in its XAML pane render without any hitches in the Blend interface. Combine that with the sheer difficulty of quickly debugging XAML and your into a whole world of pain.

Still Blend is a fantastic tool and make manipulating XAML a real pleasure most of the time and I know that Blend 2 is only going to make this an even more enjoyable process.

Share

C# Express 2008

Since my beta trial version of Visual Studio 2008 is in its death throws I took the plunge and have switched to using C# Express 2008 and I must say that I’m seriously impressed with what Microsoft have essentially given to me in order to carry on development of my SampleSort project. I haven’t yet encountered anything that that I desperately need that C# Express doesn’t include. Thumbs up Microsoft!!

Share

Learning C# / .NET

I’m on a steady road of learning first the basics of this new (to me) technology. Coming from a FoxPro background this has been a massive change of direction and I’ve come to realise just how ‘loose’ FoxPro is as a development language / environment. FoxPro is really great at some things (obviously primarily as a desktop database language) its very easy syntax and loosely typed language are very easy to get going with but it does lack some of the raw power and solid structure of using something like C# and .NET.

One thing I’m noticing is that if your learning a new aspect of something and its proving hard to integrate into your C# code it could mean that you need to look at something again ‘further up the code chain’. If you have good code set up well from the outset it does appear to be fairly easy to integrate new features. Or it could be that you’ve just missed one valuable meaning from a sentence somewhere in the examples your looking at. Basically, if your having to go around the houses to get your new code shoehorned into the code you already have you should probably do a little code review before moving on.

What prompted me to write this post was that I have just gone through the process of implementing some serialization (damn, I hate the Americanisms in .NET!). I’m using a custom Type which I’m using in two ways one is just a fire and forget scenario and one needs to be persisted on the host machine. The strongly typed nature of C# and .NET made implementing the Serialization on the persisted data a breeze! Mind you I should hold fire on that since I’m yet to full test the code. Even though the compiler doesn’t complain that doesn’t mean its going to actually WORK!

Back to it …

EDIT! – OK, I’m pretty chuffed with myself. Its the first time I’ve attempted to perform object Serialization and my code worked first time! Hmm … now to try the Deserialization!

Share

WPF, 3D, Windows XP Anti Aliasing

Well today yielded one interesting new thing about WPF 3D content and how Windows XP is setup in relation to utilising the 3D classes in the new .NET 3.5 Framework. The new 3D features that are part of what was WinFX are native to Windows Vista which actually ships with all the new sparkly WPF stuff out of the box but for Windows XP things are still a way off yet.

Or so you might think …

Today I discovered that there are options for getting Windows XP to utilise some Anti Aliasing features which makes the 3D content of WPF apps really crisp and how you know you want them. At the moment I’m working on a WPF application for my employer and we are making heavy use of 3D charting components for displaying KPI information in the UI. Most of the time when you see screen shots of these new spangly WPF controls on the marketing information (designed purely to reel you in as a new customer) the charts and wotnot look all super smooth and crisp and lovely and almost edible. Well, not under XP they don’t. Under XP they actually look rather unappealing and show off all the pixels in their squarey loveliness.

Since starting looking at WPF and using some of the new controls (company will remain un-named for obvious reasons) I have become increasingly concerned with how this aliasing would effect peoples perceptions of the software we are producing and frankly it just bugged the hell out me that XP was somehow needlessly crippled in this regard.

Well, today I found the fix and it doesn’t land at the feet of your super agile 4billion megabyte SLI bridged mammoth video card. I’m using a 2.6Ghz Quad core Xeon based machine at work which comes equipped with a very capable nVidia Quadro FX570 graphics card stuffed with 256Mb of dedicated video RAM installed. This card should be able to handle pretty much anything but the insane games at their highest video demands. Either way, more than enough to render a 3 segment 3D chart displayed in a WPF applications UI.

I had played around with the nVidia control panel trying to get things looking a bit smarter but that had so far failed in creating the whizzy looking charts I had been promised. SO … drum roll please …

We need to delve into the bowels of the XP installation and add some registry keys! Basically the upshot is that its related to the XDDM format video drivers that are used my XP and older Vista format drivers. Microsoft say that adding these keys into a Windows XP registry can initiate some stability problems but after making this change to my development machine and working with 3D content most of the day I haven’t even seen a whisper of a glitch or a problem. Interestingly adding these registry keys AND switching on the nVidia Anti Aliasing cased WPF 2D content to be rendered WORSE whilst the registry keys made the 3D content look head and shoulders better. SO leave your video card settings alone and add these keys if you dare.

We are investigating this issue more thoroughly at work and we may even offer the option of turning this on during the installation of our application on Windows XP machines (with a caveat of course). I’m actually fully of the belief that provided you have a decent video card that can support DirectX 9 and a stable install of XP you shouldn’t have any problems. Anyway … you can download the .reg key files for Vista and XP/Server2K3 using the link below.

Just one thing to do before you go all gooey and download and install these keys. Check your version of DirectX by going to [Start][Run] and typing “dxdiag” this is utility that provides a summary of your current DirectX setup. Then you really should check that your card can do DirectX 9 and then download and install the updates and drivers if you are on anything other than DirectX 9. Then make a backup of your registry just to be on the safe side.

Windows XP / Vista Anti Aliasing Registry Keys

Share

C# Regular Expressions

I’ve recently found the need to really optimise some C# code using regular expressions instead of using multiple statements to tidy up strings before processing the contents of those strings. Regular Expressions can really take some getting used too and certainly require time to really master to any degree. What is a Regular Expression? Here is a line of C# that will illustrate how to remove all the numbers held within a string:

[source:c-sharp]Regex regEx = new Regex(“[0-9]”);
stringtoclean = regEx.Replace(stringtoclean, “”);
[/source]

During my brief look into using Regular Expressions I found a really neat tool called Expresso which is free to download and you can grab it here:

http://www.ultrapico.com/Expresso.htm

Share

Mole v4.2 for Visual Studio

This is a great visualizer for using with Visual Studio to help debugging and so on.  This is vital for the projects I’m currently working on in Windows Presentation Foundation (WPF).  I’ve been trying on and off over the last couple of weeks to get Snoop working and have completely failed in that task (I am not alone I might add) so I started looking around and found the Mole!

Get it here!

http://karlshifflett.wordpress.com/mole-for-visual-studio/

Share

Data Pimping

A leading expert on computer surveillance has raised serious doubts over the legality of deals by BT, Virgin Media and Carphone Warehouse to sell their customers’ web browsing data to Phorm, a new online advertising company.

So there you have it … I the bastard multinationals making yet more cash off the little man. I despise it deeply!

Phorm’s system works by reading the contents of web pages you visit, to build up a profile of your interests on your computer. It then uses this information to target you with appropriate categories of advertising when you later visit a website that is a member of the Open Internet Exchange (OIX), its publisher and advertiser network. Phorm has announced that The Guardian, Financial Times and MySpace have all signed up to let it serve the targeted ads to their users.

You can read the complete article here.

Data pimping: surveillance expert raises illegal wiretap worries

Share