Fix Oracle dot Net…

SAN FRANCISCO - SEPTEMBER 24:  The new Oracle ...

Image by Getty Images via Daylife

…is now up! FixOracle.Net in its first incarnation fixes the type of dodgy Oracle code we’re using on our current project, but since the ‘fixing engine’ is shared between the web site, the winform tool, and the command line tool, when I figure out what casts are missing, I’ll add them too.

In the mean time http://www.fixoracle.net is where you need to go for the absolute best in web design and hot advert-clicking-for-your-friends action.

Well, they’re not going to click themselves.

🙂

Reblog this post [with Zemanta]
Posted in Hackery | Leave a comment

Fixing Oracle’s TableAdapters

Ok, by now you know Oracles table adapters are broken. Just searching on google for a solution turns up a significant number of other people having the same issues. Broken code, bad ODP crashes inside devstudio etc etc etc. Google turns up nothing but bad news when you’re looking for a solution to ease the pain of using .Net and Oracle tools.!

Well, since the fixes are pretty easy to add, I’ve created a little tool to automate the process. Although the fixes are quite simple, they soon mount up when you got more than a couple of TableAdapters that change more than a couple of times during the life of the project. In fact fixing oracle’s bugs starts eating a significant part of your development time, beyond the most trivial projects with one or two adapters. Maybe we should start invoicing them for the time taken to fix their crap code 😉

ok, enough of the idle banter. Since a picture is worth a thousand words here’s a screen grab of the tool to whet your appetite!

orablefixer

Ok, I admit I stole the graphic! Basically this fixes the current crop of problems that the ODT generates when you drag a stored procedure or table to the VS’s Dataset design surface. As an additional ‘fix’ it also makes the Adapters CommandCollection public if you tick the check box.

Making the CommandCollection public means that you don’t have to derive a class from the generated table adapter, or provide another partial class when you want to do things like change the connection string on the fly, or make the commands participate in a transaction.

For those of us unable to use an ORM too or we’re just stuck with Oracle and the default tools for legacy code, this should help a little.

Anyway, I’m going to register a domain for the tool, and provide an online version too, where you upload a source file to fix, and it returns the fixed version. Maybe when there’s a public domain showing how to fix Oracle’s deficiencies, they’ll release a patch for a bug that’s been on metalink for what feels like *eternity*.

Watch out for FixMyOracle.Net coming soon 😉

Posted in General | Leave a comment

The Value of time revisited!

silver copy of a 1930 penny

Image via Wikipedia

After speaking to one of my friends about this, I must point out that my current client *IS* actually switched on enough to correct the situation by providing the best equipment they possibly could. It’s as pleasant change to have people in the chain who do value your time, and are more than willing to help remove any obstacles to you being productive. Although I did mention this in the previous post, it does read rather like they’re not paying attention, which they absolutely are.

My post was really about the real cost of loss of productivity and effectiveness in order to save pennies on equipment, where someone outside your project holds the budget, and thinks you’ll be spending 7.5 hours a day editing word documents and emailing.

Perhaps they should try creating a DocProject with half a dozen assemblies, and see how long it takes before they can use their PC again 😉

I’ve turned this type of semi-rant into a small essay, with references to various sources citing just the kind of point’s I’ve brought up here. I’m in the middle of reformatting it, and removing the names to protect the guilty. When that’s done I’ll post the whole article here for your viewing displeasure!

 

Reblog this post [with Zemanta]
Posted in General | Leave a comment

The value of time.

SyncMaster 152X is Samsung's 15

Image via Wikipedia

I’ll never understand how some people in IT departments don’t grasp the value of a developers time. Its a false economy to provide anything but the absolute fastest PC for a developer. I’m not really sure where the real problem lies. Is it that non-techie people rise to management positions without realising what precisely their reports are doing?

Take the current client. We’re working on incredibly old PC’s – P4’s with 2gb of ram and 40gb.  DevStudio is simply un-useable. I don’t care what the minimum supported spec says, it’s painful. We’ve managed to get some new PC’s ordered, but in most other places its simply not that easy. We still have to justify why we’d like large monitors for example.

Who creates those kinds of obstacles? How they *know* what size monitor I’ll need?

Continue reading

Posted in General | Leave a comment

ODP.Net Part 3

Ok, not really part three but a quick post about how the last two posts arrived at the blog in the wrong order. I can’t be bothered swapping them round so just read from the top down 😉

Posted in General | Leave a comment

Damn you ODP.NET!

This stuff really does tire me out. I’ve spent yet another day battling with Oracle’s data provider instead of doing anything meaningful. I’m calling a stored procedure with an out parameter of a varchar2. I assign an OracleParameter in exactly the same way as the stored procedures , same order and same sizes. everything matches, and I keep getting a ORA-06502 saying that there’s a size mis-match. What gives. I’ve never had this much trouble with SQL server, everything just seems to *work*. Pick up oracle and you seem to spend days battling with crap SDKs, connection problems, and weird things like TNS names junk – after all it would just be TOO complicated to specify this as an IP address in the connection string. <sigh>

Oracle isn’t my Friend.

Posted in General | Leave a comment

Damn you ODP.Net Part 2!

Ok, after spending another 1/2 day battling with the oracle tools for devstudio, i took the plunge and reflected the whole Oracle Data access component. I’m not sure I should be publicly admitting to reverse engineering Larry’s baby but if its the only way I can find out what broken, so be it. They should learn to write working code.

So I dig out reflector and run the ODP.Net assemblies through one of the reflector add-ins that brings it back to something more readable.

On inspection it seems that they’re mixing the domain values for db nulls. the OracleString performs a conversion when the column is null and actual returns the string “null”! Poor? Well I think so.

So, the next step is to look through the designer code that the ODT spits out when you drag a stored procedure onto a data set design surface. It appears to work ok, until you try using any procedure that involves varcar2 out parameters. Then it chokes. Nice.

The problem is it looks like their generated null checks aren’t working correctly. They’re testing the returned objects against NULL, and then if the object isn’t null they’re comparing the objects Value with System:DBNull. This obviously wont work since an they always return an Oracle type and the value throws an exception if the Oracle type is null. Not only that, but their implicit casting in the generated code is broken too, although that seems to be a symptom of their checks for null failing and going on the read the Value in order to cast it to a real .Net type.

The fixes are pretty simple, but it does involve editing the Table Adapters designer .CS file and fixing their ropey code.

I encountered these problems a couple of years ago, and swore never to trust them again, but heh, this is 3 years later, surely they’ve fixed the casting bugs?

Apparently not.

So, if you have the choice stick with SQLServer. For all MS’s flaws they seem to emit bug free code, and they do fix stuff.

<rant over/>

Posted in General | Leave a comment

4 Days in and its all peachy.

Apart from not understanding how to catch trains properly for the first 2days, everything’s going pretty well. The team is switched on, and the work is interesting so its all good 🙂

What I do find a bit puzzling is that other than Sheffield station there’s no way to find out which trains stop at your station, or what time it will arrive. Where there’s more than one train stopping at your destination you have no way of knowing which one will be quicker other than to ask. Even Sheffield’s fancy display board doesn’t show you the arrival times, but it does, however, show you which stations the trains will stop at.

So for instance, although there are trains that go direct from Sheffield to Leeds these can take up to an hour and 40 minutes. However, the cross country trains that start at Plymouth and end in Edinburgh also stop at both Sheffield and Leeds and yet only take 50 minutes. The trouble is you have no way of finding that out other than asking, or being a regular and already knowing!

It all seems a bit odd to me. Anyway, its no longer taking me 3.5 hours to commute! Yay!

As for the work, it does seem there’s more ASP.NET that I expected, but the data that’s driving the site is pretty interesting to work with, and because we’ve got a pretty switched on Oracle developer it’s making my life really easy! He has complete control over the organisation of the data, and if we need something that he hasn’t thought of it’s a simple task to ask him to add it, no politics involved which is a great relief.

T-Mobile Internet

For the T-Mobile internet dongle, apart from the  slightly patchy connections whilst on the train I’ve actually used less than 80mb, which is pretty good really. I was thinking that I’d be going over my tariff limit but on reflection i doubt I’ll even come close.

That 80mb consists of email, some web research and a bit of online development  i.e. uploading files to a couple of my sites. I have noticed that as soon as the connection is made, the tmobile connection manager’s transfer count starts climbing and reaches 160K of transfers, without me actually doing anything. my daughter has borrowed it too, so I was expecting the whole allowance to be used 😉 but she only ended up using 28mb for a whole night of the usual facebook/bebo/tagged rubbish !

So, Good news I dont think I’ll end up going over the limit at all!

 

Reblog this post [with Zemanta]
Posted in General | 4 Comments

It’s All GO!

Bradford's Christmas lights

Image by Neil T via Flickr

Ok, so after after a short break over Christmas, I though I’d better pull my socks up and start looking for a new contract. As everyone returned to work on the 5th of Jan, I wasn’t expecting anywhere near the response I got after posting my CV online! Either my C.V. is absolutely amazing or the IT market is ridiculously understaffed! I’d like to think it was the former, but I suspect it’s the latter! Just over 3 days into the first week and I was getting over 25 calls a day. by Thursday I’m signed up for a 6 month contract in Bradford!

Since trying to get to Bradford by car would be a real PITA , I’ve opted for a more comfortable commute and gone by train. So not only can I get a good hour and half of work done I can actually blog more often too 🙂 Finally might get a chance to write as many articles as I keep promising!

I did buy a nice little T-Mobile internet dongle too, so I can be connected whilst travelling – T-Mobile seemed like to best deal because of their usage policy. If you happen to go over their limits, there’s no real penalty. Unlike all the other operators which charge over £1 a megabyte! £1 a megabyte! That’s totally ridiculous! If I accidentally went over my limit and watched a day of youtube videos (well ok, you’d have to be pretty brain dead to watch *anything* on youtube) I could end up with a bill of over £1000! . Anyway. after a few days of email / blogging and googling, I’ll post an update on how long my usage cap is likely to last!

Reblog this post [with Zemanta]
Posted in General | Leave a comment

Introducing…

The Munsell color system, showing: a circle of...

Image via Wikipedia

nCode I.T. Limited! Yes, I’ve finally got round to setting up my own limited company. Since it makes more sense from a taxation point of view, and also gives me a platform to launch my own Micro-ISV. Since I’m deeply entrenched in the .Net world at the moment, I thought a bit of word play on the nXXX series of tools (nHibernate, nUnit etc) would have a cool geekiness to it. Anyway, the site basically gives a few details about my skill set & what I’ve been up to, purely for the contracting & outsourcing work, but the final (and as yet unlinked) section will pint to some of the work I’ve been doing outside contracting hours that’s helping me towards the fully fledged Micro-ISV status.

My first commercial product for my Micro-ISV will be a set of Bitmap Effects for .Net 3.5SP1.

This Effect pack will include :

  • Desaturation Effect
    One of the most missed features of WPF is that of greying out interface elements when disabled. when buttons containing bitmap artwork are disabled, the bitmap doesn’t go grey. There are lots of messy kludges and workarounds for this, but this effect addresses that problem completely. As opposed to some of the other available effect this doesn’t just change the element to grey scale it allows you to set a specific saturation level, allowing you to do cool effects like fade out your entire application to grey when it loses focus, kind of like the windows XP shutdown state. Unlike many other average-the-colours type of grey effects this uses the true NTSC colour weights to produce a correct desaturation.
  • Colorize Effect
    This will allow you to change the colour of any element and colorize it any new colour. Colorizing respects the pixels luminance, but changes the colour of each pixel to the new colour you’ve chosen. A simple effect. but very useful for fixing elements to all have the same set of tones.
  • Skin Shade effect
    This is the special one. It allows you to completely re-skin your application (if it is set far enough up the visual tree, i.e. on the top level window) because although it changes the colours, it respects the relationship between them. In other words if you picture the shades used in your application on a colour wheel, they will remain the same relative distances after they’ve changed. This means that if you chose analogous, split compliments, or triadic hues, they will remain that way, but their base hues will be rotated. It sounds much more complex than it actually is! The end result is that as long as your colour set was pleasing to start with, it will remain that way, even after you apply the effect.

Here’s an example of the skin shade effect. Two different ‘skins’ provided by applying the effect right at the top level window. Allowing an almost infinite range of skins is now only 3 lines of XAML away! This is the WPF outlook Hands-On-Lab that the effect has been applied to.

Fancy a rose pink outlook ?

clip_image002

and a fraction of a decimal away are shades of purple.

clip_image002[7]

Notice that although the colours change, the intensity and saturation stay constant. If you have a nice pastel colour set, all you’ll get after applying the effect is more matching pastel colours.

Obviously these effects could be achieved by making sure you set all your element colours to dynamic resources, and then defining lots of resource dictionaries with colour schemes in, then adding an interface to load those schemes. Although this is the traditional way to manage themes (and obviously still has its place) making sure all your elements share the same styles or dynamic resources for colours its a royal pain, and error prone.

Using a single effect like this allows you to define one set of harmonious colours for your application, then get an almost infinite set of harmonious colours at the switch of a floating point value, without ever forgetting to set an elements colour, and also doing away with the resource hit of using dynamic resources for every screen element that you want to change colour.

Another feature of the Bitmap Effects is the ability to selectively apply the effect based on an Opacity value. This allows you to add the bitmap effect to your top level window but still maintain control of which elements actually get affected by the effect right down at the element level.

An example case where you would need this is an application that displays photographs. You really wouldn’t want your grandmothers purple rinse extending across the whole photo just because it was part of the visual tree that the Colorize effect had been applied to! Using a specific value for the Opacity we can exclude elements from the effect. There are samples provided which explain how to do this selective effect application.

All the effects in the library support selective application at the pixel level. Another useful thing this feature allows you to do is maintain a specific colour for your control’s text, and have it excluded from the application of the effects.

I’m currently working on the documentation and samples, but when these bits are done, you can purchase this effects library and get updates, support, and implementation help via the official nCodeFxLib Bitmap Effects site

Enjoy.

Rob

Reblog this post [with Zemanta]
Posted in General | Leave a comment