Tuesday, May 26, 2009

Intel VT not in HP nc6400

Just think it time to check out the Windows 7 XP mode out and after wasting 445MB of my monthly internet Quota to discover that my HP nc6400 most priced notebook will not run XP mode.

Windows 7 XP mode requires Intel VT for hardware assisted Acceleration to run. I exactly don’t know whom to blame, Intel or Microsoft or HP.

Intel for failing to include such feature but of course they got processors with these feature present. HP for choosing to use a processor in a business/performance based device like the nc6400 and finally Microsoft. How in the world should this not just be a boost requirement. Other virtualization applications like VMware don’t make this compulsory so why should this be. I could expect that this works but some performance pain if Intel VT missing rather than an outright failure.

I hope this gets fixed in the final release.

Monday, May 25, 2009

Tuple in C# 4.0

Tuple is defined as a Sequence (or ordered list) of finite length. Other definitions exist but I particularly like to see it as such.

I have been craving for this feature ever since seen in Cw(C-Omega). This is particularly useful when you want to return multiple values from a function/method especially when they are not related enough to want to put then in a class or struct. Some developers like myself result to using multiple out parameters. This gets messy for methods that have return type and so inconsistence in returning values from such methods.

   1: var x = DoSomething(out int a, out int b);




The compiler is smart enough to detect when you have unmatched number of arguments





   1: var myTuple = new Tuple<int, int, int>(0, 1); 




or request for a member beyond it's definition





   1: Console.WriteLine(myTuple.Item4); 




Tuples in C# 4.0 lacks the ability to get the Length/ Count/Size value even though the underlying interface ITuple specifies this. I guess the C# team pulled this out to prevent us from seeing or using this as an Array or Collections.



In the Beta 1 Release, I tried getting my hands dirty with this and was shocked on a discovery. Something about an error on the eight argument of a tuple being requeired to be ITuple. I searched online for this and came across an interesting Post about infinite Tuple (Tuple with eight parameters in constructor)






   1: Tuple<int, int, int, int, int, int, int, int> 




http://blog.dynamicprogrammer.com/2009/05/25/TupleANewTypeOnNet40.aspx

Friday, May 22, 2009

Implicitly Type Local Variable & Multiple Declarators

It is perfectly legal in C# to have declarations written this

int x, y;
which with initialized values is
int x= 5, y=6;

Alas, the C# compiler rejects this
var x=5, y=6;

This is because the C# Compiler does not allow multiple declarators on the var keyword. I wondered where this is not allowed and if you ask me so much restrictions on the use of the var keyword (can't use as method return type or method arguments).

A recent mail from Eric Lippert clarifies this. His reasons for why this feature was made illegal was that of removal of confusion. In his own words

object M() {}
string N() {}
var x = M(), y = N();
about fifty percent of people thought that the “obvious” meaning was
object x = M();
string y = N();
That is, the “obvious” meaning is “split the two apart and do them separately”.
About fifty percent thought that the “obvious” meaning was
object x = M(), y = N();
That is, “find the thing that you could replace the ‘var’ with and pretend it was there”.
No matter which we picked, half our users would think that we did it wrong. So we cut that feature.  A “var” declaration can only have one variable declared

Tuesday, May 19, 2009

Visual Studio 2010 and .NET FX 4 Beta 1 ships


The Beta 1 version of Visual Studio 2010 and .Net 4.0 shipped to MSDN download subscribers early yesterday. It can be downloaded here.

I have already downloaded it and the first test performed is co-existence with my VS 2008 and so far no problem yet with the little test I have done on it.

Friday, May 15, 2009

Imagine Cup (Nigeria) '09

The Nigeria final of the Imagine Cup competition ended yesterday with Team X emerging the winner. The competition was quite keen and winnings was just by a slight margin.

I was particularly impressed with Team X for their presentation and having a cool extensible application. The judging criteria allowed extensibility just 10% but the fact that they are the only one with extensible application left a great impression on the judges mind.

In terms of Innovations, the first runner-up team (Team Indwell) has that even though they not handed the plaque.

The winning team still has a lot to do and tie up quite some nuts before the appear in Egypt though. Interestingly, they were the winner at last year's event too. Somebody gotta do that but Team Indwell almost did except they got big ideas but little work done.



Tuesday, April 14, 2009

Lessons on WPF

Ever since the release of WPF, I have had no chance of running a live project on it. I have done quite a lot of mini testing of some of it's cool features but never a live application. 
Recently, a client requested for a small File Generation application in an attempt to drop their current legacy file generation application. These files are later sent to suppliers messages based Ordering systems. 

I quickly seized the opportunity to try out my WPF skills. What first hit me is it's immaturity compared to what can be achieved with WinForms but alas, there are work-arounds like ability to host WinForms which I took advantage of on the Report Viewer and also the Grid control from the WPF toolkit. Did not like the fact that I had to install .Net Framework 3.5 SP1 for this to work. Client do not like the idea of having to make them install this.

Styling the application is light years ahead of what could be achieved on WinForms. Got that done in a giffe and could imagine the amount of owner drawn stuff I had to do in WinForms to achieve the quality of UI.

I will say the experience was great and itching to redo some of my cool WinForms apps in WPF but won't unless a client is gonna pay for it :)

Wednesday, March 25, 2009

ResolverOne - IronPython Spreadsheet



   I met Michael Foord (the kind of guy that runs Windows on MacPro. He also wrote a book IronPython in Action still in print by Manning ) recently and he was so passionate about what he's been doing in the IronPython  Space. He has this cool programmable spreadsheet application dubbed ResolverOne . Believe me, this will make you never want to touch VBA. 

A  similar implementation was demoed at Mix09 by John Lam (the IronRuby guy) with Silverlight 3 - this I learnt came with deep multimedia capability and can run out of the browser sandbox to run on the GPU.  ResolverOne is a pretty cool implementation of spreadsheet and I am yet to imagine the bound of it's limitation. You could actually do anything imaginable about spreadsheet. I have revved this since the summit and still amazed how easy to import any existing python library and use user custom functions/libraries. 

Monday, March 02, 2009

MVP Summit Update!

Arrived at the Seattle on March 1, after a very long flight and airport waiting. Checking my Lagos local time, I realized I had been awake for over 29 hours. That's crazy. My head was heavy, I was quick-tempered too.

Finally checked in to The Westin Hotel around 1am Seattle local time. Replied mails and other web stuff for another hour and went to Bed.

My room mate is a great guy - Joel Hebert. He happens to be a ASP/ASP.Net MVP and that was cool and can you believe it, he already has a solution hosted on Microsoft Azure. I find that very cool too.

The next morning (March 1st) was rather dull at first, woke up around 8am and showered quickly. Went to the Washington State CC for registration and had breakfast just around there and attended the MVP2MVP Sessions.

Quite a lot of brilliant presentations from the guys which I will discuss later in my blog post after the event and lots of pictures too.

Monday, February 23, 2009

Gearing up for the Summit!

Gearing up for the upcoming MVP Summit! Cool that I will be able to attend this year's edition. Almost always saddled with so much around this time of year that I will have to bust plans of attending at the last minute! Breaking up the ginx this year! I should hope that's a good sign.

This year is particularly different, not only my decision to attend crippled by saddled workload, also the global financial crisis is dealing a good blow and the unexplainable diving of the Nigerian Naira against the USD. But I still gotta attend all the same.

So much I am hoping to gain this year apart from the Great View of Seattle from Top floors of The Westin Seattle. Another great opportunity to relate with the C# team apart from the mail relationship at Private Newsgroup and the C# Insiders and much more.

I am also hoping to meet the Channel 9 Team (probably they may feature me in one of their videos). and much more ..

Thursday, February 05, 2009

.Net and Java Inteoperability

I recently was saddled with the task of developing a component for a Telecoms (GSM) company. This is a company that has huge investment in Java-based applications on Sun Solaris boxes. The requirement of the component warrants a need to connect my ASP.Net based application to an existing connection pooling java-based socket application.

Immediately, interoperability comes to mind. Which is best? Some of the thots that came to mind are

- Use JNBridge (license cost)
- use a message based intermediary (MSMQ - requires modification of Java component which not allowed)
There is a whole lot of options in this space which I will not want to go into in this blog

- IKVM.Net (read all about this but not sure it works)

Other constraint is I had budget constraint that knocks off JNBridge and also not allowed to modify the service component as some other production applications depends on it. Whick left me with IKVM.Net.

First, I wrote a Java client application that uses this service, compiled and tested it well, then I use IKVM to generate a .Net dll off this java class file and Voila!, task got done!. It's no trouble getting this into my ASP.Net bin folder.


> javac SVClient
> ikvmc SVClient -target:library


Refer to IKVM.Net tutorial

The great thing about IKVM is that it works without any dependency to the original java class file. It's a complete conversion of the java code.

I got curious a bit and opened the dll in Red Gate's .Net Reflector and learned a lot on what underlying code.

Wednesday, February 04, 2009

Google Cloud

Spent half the entire day cranking at a Silverlight application and just when I got fedup with work for the entire day, I decided to get my hands dirty with the Google App Engine alt="Powered by Google App Engine" />. I have read quite a bit about it but scared of investing in a learning curve coupled with the fact that I am not going to be writing a c# code.

It is python! thats something I love too though I have experience in IronPython just then I stumbled on this you-tube video and it's a cool starter. Simply follow the installation instruction provided by Google and with that video you are set for an Hello World experience.

Thursday, January 29, 2009

Back to work!

Compliments of the new year! Just getting back to work after weeks of vacation with family that unavoidable ate up the whole January for me.

So great to be back home and wonders if I still remember a what a Hello World program in C# may look like (lol! won't get that bad).

Wednesday, November 26, 2008

Replace NewLine in TSQL

It's quite frustrating how tiny task become so time-consuming and worrisome. Never would have imagined this hard to do. 

Had a situation where records gathered from an application will serve as input to a large application. The data first had to be cleaned (glad I got Sql server tools). This was done in seconds. On export to CSV, it was discovered that one of the fields (address field) had newline inputed in it causing wraping of the record as new line in the exported CSV.

Of course I was quick to type

update xxxxx set CustAddress = Replace(CustAddress, char(13), '')

Alas, no change. Kept getting same reponse. Even len(CustAddress ) = Replace(CustAddress, char(13), ''). 

Search for this issue on the net and could not find a direct linking article of blog reporting this scenerio. 

I finally got the answer from an article on Simple-talk by Robyn Page and Phil Factor

update xxxx set custaddress = REPLACE(custaddress, COALESCE(char(13) + char(10),'[^-a-z'']'), '')

Quite some other stunt in the article too.

Friday, November 21, 2008

MSFT's Application Architecture Guide 2.0 Beta 2

Microsoft Patterns & Practice team has recently released the beta 2 of the Application Architecture Guide 2.0 offering significant changes from Beta 1 among which are

Technology matrixes for choosing technologies like Presentation, Data Access, Workflow, and Integration technologies. 
New Agile Architecture Method 
Tuned and pruned the recommendations across the entire guide. 
Restructured the guide for simpler parts 


Read more about the changes at J.D. Meier's blog

Thursday, November 20, 2008

Microsoft Expression Web Inline Styles

I like to agree that Microsoft Expression Web is a great tool to use. I instantly saw the need to need for such tool to complement Visual Studio and considering that it's has less memory footprint tool and I can get my tortoise- performing notebook (Never seem to get a machine fast enough -HP Compaq nc6400)  to deliver working on a web page faster.  It is also very cool with css and I consider tracing image very "slick". 

I am particularly irritated with the fact that the designer generates only inline-styles. I experienced this with silence in version 1 and this persisted in version 2. Even if the element being moved around in the designer already has a class attribute, one notices that an inline style is created for the element and have to manually copy and merge the changes with what is the external style.

Is there a mode like this in this because I really cannot imagine the designer of this tool missing out on this kind of cool feature.

Wednesday, November 19, 2008

ASP.Net Textbox watermark

I don't like to do javascript! Asked myself several times over the past years why my javascript has been so poor even it has several syntax semblance to C# and other languages with same cancer of the semi-colons ;).

What I have been able to identify a reason for dislike is the poor IDE support for javascript. Visual Studio brought quite a bit of cool supports and features but not enough for an aging brain like mine to pick up. However, rising to the challenge and had to do a textbox watermark. 

I had done this before with a sample from Stan (a friend - Great Chap) but can't seem to find the source anymore nor Stan himself and also done this with ASP.Net Ajax but the client do not want Ajax feature, nor is ready to pay more for that so I had to revert to my plain-old javascript in ASP.Net and this is what I came up with.


App_Code
public static void WatermarkHelper(TextBox textBox, bool isPostBack, string defaultText)
    {
        textBox.Attributes.Add("onfocus", isPostBack ? "" : "WatermarkFocus(this, '" + defaultText + "');");
        textBox.Attributes.Add("onblur", isPostBack ? "" : "WatermarkBlur(this, '" + defaultText + "');");

        textBox.Attributes.Add("class", isPostBack ? "normal" : "watermark");
        textBox.Text = defaultText;
    }

Page_Load
Util.WatermarkHelper(plsperacreText, IsPostBack, "Enter Code");

Javascript
function WatermarkFocus(element, defaultText) {

            if (element.value == defaultText) {
                element.className = "normal";
                element.value = "";
            }
        }

        function WatermarkBlur(element, defaultText) {
           

            if (element.value == defaultText || element.value.length == 0) {
                element.className = "watermark";
                element.value = defaultText;
            }
            else
                element.className = "normal";
        }


CSS
.watermark
{  
/* sure u can add a lot more */
   color: DarkGray;
}

.normal
{
}


And that does it

Monday, November 17, 2008

e-Commerce Development

I really do not like to do websites. In fact, I used to hate to do one and though I develop quite a bit of web-based business applications with C# and ASP.Net, website development seems not what I'd like to do.

Recently, I had to take a full e-Commerce website using ZNode and LinkPoint payment gateway from First Data. ZNode is pretty interesting and intend to do a service site using this. I did not particularly like Linkpoint. The documentaion on it's setup and integration to applications is quite lame and I waste quite a bit of time trying to figute it out.

This has prevented me from the scheduled task for this week of revving the PDC 2008 conference content. 

Wednesday, November 12, 2008

PDC 2008



Just returning back to serious work after PDC 2008 at Los Angeles. Had lots of fun with co-developers. The technology show-cased were cool and got new insights too. My utmost interest is with Azure. I am yet to start drilling through my 160GB hard disk given to us but will do soon and pump lots more content about my accomplishments here. Hang on ...



Check out more pix of the event at PDC 2008

Back to Blogging here

I guess I will have to return to blogging here. Inthril that host my blog for a while has been having problems and so I could not log in.

It's been a while I blogged. Been clogged down with lots of task and thinking and having done a lot. I Need to showcase quite a bit ot what's going on in my head.