in

dotnet.org.za

South African .NET Developer Portal

This Blog

Syndication

News


Get Firefox!
<!-- Begin Nedstat Basic code --> <!-- Title: StuartGunter --> <!-- URL: http://dotnet.org.za/stuartg/ --> <!-- End Nedstat Basic code -->

Stuart Gunter

There's too much!
  • Microsoft Update... very nice!

    I'm not one to browse the “regular” pages of the Microsoft site, but I happened to go to the Windows XP home page just to see if there's anything new I'm not aware of yet. Luckily I did! I see that Microsoft has launched “Microsoft Update”... which was talked about at DevDays, for those who didn't attend.

    This is basically the replacement to “Windows Update” and “Office Update”. It provides a full software update service for all Microsoft products installed on your PC (well, most of them I think). This is sooooo much better than having to go to a number of different places to get your software fix (and I mean that in the addiction sense of the word, not the mending sense).

    Well done, guys! This is something I've been waiting for - and I'm sure it'll make our lives a lot easier!

    Go download the new “Microsoft Update” update (ha ha) here: http://www.microsoft.com/technet/prodtechnol/microsoftupdate/default.mspx

    Posted Jun 12 2005, 03:14 PM by stuartg with 1 comment(s)
    Filed under:
  • Windows Messenger... oops!

    I've just tried to uninstall Windows Messenger from my Windows XP computer, but it seems it's impossible to remove it! What the hell?!?! It's a selectable component of Windows XP when you go to add or remove Windows components, but it doesn't actually make a difference! The only real difference is that now I can't control it!

    Since “uninstalling” it, I've received a number of IM messages through Windows Messenger when I'm clearly signed out of MSN Messenger. That sounds correct, right? Well, yes, if I was running both IM applications. But Windows Messenger (which is really crap, if you don't mind me saying) has been removed... or so Windows has led me to believe.

    So how does one uninstall Windows Messenger? I refuse to use it because I think it's really rubbish. I love MSN Messenger, so I use that instead. But it seems now that Windows Messenger keeps me signed in, whenever MSN Messenger is not signed in. So technically I'm seldom offline.

    I just don't know. Maybe I should install Linux at home, and stop bothering with these small frustrations.

    Posted Jun 11 2005, 11:25 PM by stuartg with 5 comment(s)
    Filed under:
  • More on Customer Service and General Incompetence

    I've absolutely had it with South African telecommunications companies! I can't stand how incompetent they are! Yes, I'm generalising... there are a few individuals (which I'm sure can be counted on one hand) who are very good at what they do. But it seems that everyone who has to deal with the customers (i.e. US) is blatantly incompetent!

    Lately I've been wondering why I'm allowing myself to be ripped off by Autopage & Vodacom. So I decided to end the pain and suffering - or at least curb it - by downgrading my contract. I used to use my cellphone for business, but now I'm barely using it at all... while still sitting on a Vodacom Talk 120 contract. Since the cost of cancelling a contract is designed to remove your testicles via your throat, I decided to wait it out, and rather cancel at the end of the 2-year sentence.

    I faxed off the necessary documentation to Autopage (weeks before the date of migration) and was settled in my mind that I would no longer be paying around R400 per month for next-to-nothing. They said they have to receive it by 23rd of the month, in order for the processing to go through. I remember faxing it within the first week of May, to take effect from 1 June. But that's where the joy stops.

    Having fulfilled my obligations, I expected nothing less than for Autopage to fulfil theirs. What a joke! I can't believe I actually thought that would happen! I received my account for June today, and it STILL reflects me being on the Talk 120 and they're STILL charging me R400! WHAT THE ****?!?!?

    I decided to brave the wilderness and call their “help”-line. I think they need help more than I do! The lady informed me that it had not yet been processed, and that she would send an email to the migrations department. I have to call again on Monday morning to find out how they screwed up! I politely asked the lady whether they would reimburse me for the additional R250 (approx) that I've been charged for a contract that I downgraded. But of course she didn't know. The jury's still out on what she DID know!

    So here I sit, with an expensive contract that I don't want, paying a premium I didn't ask for, tied into a contract that I'm wishing I never signed. Every time I deal with Autopage, it makes me loathe them even more. I will DEFINITELY NEVER do any business with them EVER again! I'm baffled how a company built on incompetence has risen so far!

    Posted Jun 10 2005, 06:55 PM by stuartg with 7 comment(s)
    Filed under:
  • Content-based SOAP Routing is cool (and really easy)

    I was playing around last night with content-based SOAP routing, and I didn't realise how easy it was until I actually tried to get something working. I'm guessing it took me around 30 minutes to get a basic demo working, which is really fast, when you consider the massive benefits it can give!

    For anyone that's interested, it's really just a matter of defining your own SoapHttpHandler, and registering it in the web.config file. The SoapHttpHandler class is in the Microsoft.Web.Services2.Messaging namespace (part of the WSE 2.0). Once you've done that, just override the ProcessRequestMessage method, and then code in whatever algorithm you want to handle the routing aspect. It's really that easy! I did a basic sample project that routes a web method call to different web services based on the requestor.

    There are easier ways to do this (purely config file based), but you won't be able to do content-based routing without a little code (from my understanding). I managed to hook this up with about 10 lines of code, and it's completely dynamic from there.

    Anyway... just thought I'd share that.

    Happy programming!

  • Who is to blame for shoddy customer service???

    Beware... ranting ahead:

     

    I've recently been looking at buying a new cellphone, because my current phone is driving me insane. I bought a phone (no brands mentioned), which has since inspired me to never waste my money on another phone by that manufacturer ever again. From now on I will only ever buy Nokia phones, because Nokia are the only ones that seem to understand the concept of usability. Anyway... enough of that tangent, and back onto the topic.

    So I've been going to nearly every cellphone shop in the greater Durban area (ranging from the Pavilion to the Gateway to La Lucia Mall, and the list goes on). The service I've received as a consumer and potential customer has begged the question... who is to blame for the shoddy customer service we receive in SA??? Now, I know this is a worldwide problem, but come to South Africa and you'll see new levels of incompetence and apathy in the retail market (I'm specifically talking about the mobile communications market here).

    The biggest two problems I've had are as follows:

    1. Staff at EVERY cellphone shop know f*ck-all about any phones. In fact, I knew more than every single salesperson on the floor of every single shop.

    2. No cell shop has any working versions of cellphones that you can use to see if you like it. Your satisfaction is limited to feeling the size and weight of the phone... nothing more! I compare this to buying a car without being able to test drive it. You're basically allowed to look at it and see if it'll fit into your garage - but that's it! (read on for their response when I confronted them about this policy)

    So to address each issue, here are my complaints. If you work as a cashier, you need to be able to count, recognise counterfeits, use a till, etc. If you're a manager, you need to be able to understand people, know the specific business knowledge, manage your time, monitor progress, etc. But it seems that if you're a cellphone salesperson, all you need to be able to do is breathe. Not one salesperson that I dealt with had even so much as half a brain! I wanted to know when a new phone model was coming out. Not only did they not know the release date, but they'd never heard of the phone. Come on! The phone is listed on the front page of the Nokia website! How hard can it be to keep up to date with the products you sell!!?!? Then every time you ask about a model number, they answer by changing the model to one that they have! Here's a basic transcript of my phone conversation with one of these incompetent fools:

    Me: "Hi. Do you know when the Nokia 6680 will be released?"
    Salesperson: "You mean the 6670?"
    Me: "No. I mean the 6680."
    Salesperson: "I'm not sure about that, but we do have the 6670 in stock."

    Stupid fool! If I wanted the 6670 I would've asked for it. Stop trying to sell me a very different phone to the one I want!

    Then yesterday I took a trip to the Pavilion (again) to try out a new phone (which I was told they had in stock). The first thing that frustrated me was that the phone was NOT in stock. So I asked the guy if they keep any charged phones for customers to try out. He said no (of course). So I asked why... only to given the response "because". BECAUSE!?!?! Is this guy 5 years old!?! I haven't heard a response like that since I was in primary school! And that came from a kid! Admittedly this salesperson most likely had the IQ of a rotting corpse, but that's no excuse. With the lack of employment in this country, I'd expect them to give the job to someone who at least gives a sh*t! Anyway... moving along... So I gave him the analogy of buying a car without test driving it (see above). Needless to say this was lost on him.

    So now I ask one simple question... is it our fault that we get such sucky customer service in SA? Do we not expect enough from retailers? Do we just bend over and take it like the consumer prisoners that we are?

    Every time I have experiences like this, I seriously consider getting rid of my cellphone altogether. I barely use the thing anyway! The ONLY reason I keep it is because of safety. If you break down at night, you need to be able to contact someone. So the jury will be deliberating on this one until my contract is up for renewal... and hopefully I'm frustrated enough to tell them where they can stick their 24-month rip off!

    Posted Apr 17 2005, 11:50 AM by stuartg with 9 comment(s)
    Filed under:
  • Microsoft Updates

    I'm busy downloading updates for Windows and Office, and realised that this is actually now a monthly routine (despite me checking once a week out of habit). Now, considering all the issues we South Africans have with Internet access, I was wondering whether the thought had been entertained somewhere at Microsoft SA to host a Windows Update Server within South Africa? The way I see it is this...

    Most South Africans cannot afford Telkoms ridiculously overpriced ADSL, or just can't justify spending that kind of money on an Internet connection for home. This means that the vast majority are still using dial-up. Now, let's pretend that they get “optimal speed” from the 56K modem and are downloading at roughly 5KBps (I've yet to hear of anyone averaging higher than this on dial-up). So for these users to download their updates, it would take no less than 46 minutes and 30 seconds (taking the current updates as an example, which are 13,890 KB. Now these are only the Office updates, in case I didn't mention that. They would still need to download the Windows updates.

    Ok, and to be truly fair... I doubt everyone on dial-up will be getting their full 5KB when trying to connect to an overseas site. Then there's the issue of dropped lines, or bad quality connections. And the update sites don't support download managers... so if you download 10MB of the 13MB then your line drops... you're stuffed!

    Even ADSL users battle, because we're limited to a 3GB cap. Once that cap has been used, that's it... say goodbye to any international bandwidth! Now I never use the full 3GB (in fact, I decided to go for 2GB because I don't need more)... but a LOT of people do.

    Surely Microsoft recognises how much this is hampering the local community from updating their products and staying secure (which is what the MS site seems to be drilling into our heads every time we go there)?

    Any comments from the MS guys? I think this would be a really useful service to the South Africans that use MS products.

    It's a complete joke! The UK has their own update site, when they have gigabits upon gigabits upon more gigabits connecting them to the US for practically nothing. They're paying 30 quid for an 8Mb line, while we're paying the double the equivalent for a 192Kb line!

    So where's our update site, I ask!?!?

    [UPDATE: New thought]
    Another thought just popped into my mind (as unbelievable as it may be). If MS SA is not prepared to spend any money hosting this locally, then why not chat to some of the bigger ISP's in SA and get them to host their own Windows Update Server? This would obviously only be available to their customers, but at least the option would be there. Why not get SAIX, IS, MWeb, Storm, etc. to host a Windows Update Server for their clients? Come on... this won't even cost them anything. A few hours to set it up, and it's DONE!

    Posted Apr 16 2005, 10:19 AM by stuartg with 6 comment(s)
    Filed under:
  • C# Open Source Projects

    If you ever wanted to know what C# open source projects exist... check this site out:

    http://csharp-source.net/

  • Don't tell me I've found another bug!!!

    Well… it appears I may have found another bug in .NET. This time related to ASP.NET Web Services and DataSet serialization. I’m not sure if this is actually a bug, but it really does look like one. Perhaps someone from Microsoft could explain to me what’s happening here.

     

    Here’s the scenario:

    I’m sure just about everybody has worked with a DataSet, and most people have also worked with serializing and deserializing them. This is all great in a typical Windows environment where you’re in “complete” control of the serialization / deserialization process. This is great, and works like a charm. The problem comes in when you need to manipulate a DataSet within a web service using a custom SoapExtension.

     

    I have written a custom SoapExtension to do stuff with a DataSet on the web services pipeline, and it has been a bit of a mission to understand exactly what ASP.NET is doing under the hood when reconstructing the return data types from the SOAP Body. For the sake of confidentiality, I’ll simplify what I’m doing with the DataSet and hopefully someone can enlighten me as to what’s actually happening here.

     

    Let’s assume we have a DataSet being returned to the client from a web service. This DataSet has a single table with a single column called “Name”. Whenever the Name column is empty, I want to make it “Unknown”. So I intercept the SoapMessage and do what I need to do. I pick out the specific node that represents the DataSet, deserialize it, and make the necessary changes. When I’m done, I serialize the modified DataSet and overwrite the existing node with my changed DataSet.

     

    The problem now exists with the XML generated by the DataSet serialization process. When this method returns to the client, I am left with an empty DataSet. The schema is fully intact, but there is absolutely no data. Having traced the input and output at various stages, I found the only difference between my changed DataSet and the unchanged DataSet was a single attribute, which I’ve highlighted below:

     

    My Serialized Version:

    <DataSet>

      <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

        <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="en-ZA">

          <xs:complexType>

            <xs:choice maxOccurs="unbounded">

              <xs:element name="MyTable">

                <xs:complexType>

                  <xs:sequence>

                    <xs:element name="Name" type="xs:string" minOccurs="0" />

                  </xs:sequence>

                </xs:complexType>

              </xs:element>

            </xs:choice>

          </xs:complexType>

        </xs:element>

      </xs:schema>

      <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">

        <NewDataSet>

          <MyTable diffgr:id="MyTable1" msdata:rowOrder="0">

            <Name>Stuart Gunter</Name>

          </MyTable>

        </NewDataSet>

      </diffgr:diffgram>

    </DataSet>

     

    Unchanged Version:

    <?xml version="1.0" encoding="Windows-1252"?>

    <DataSet>

      <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

        <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="en-ZA">

          <xs:complexType>

            <xs:choice maxOccurs="unbounded">

              <xs:element name="MyTable">

                <xs:complexType>

                  <xs:sequence>

                    <xs:element name="Name" type="xs:string" minOccurs="0" />

                  </xs:sequence>

                </xs:complexType>

              </xs:element>

            </xs:choice>

          </xs:complexType>

        </xs:element>

      </xs:schema>

      <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">

        <NewDataSet xmlns="">

          <MyTable diffgr:id="MyTable1" msdata:rowOrder="0">

            <Name>Stuart Gunter</Name>

          </MyTable>

        </NewDataSet>

      </diffgr:diffgram>

    </DataSet>

     

     

    From what I can see… this causes problems in the deserialization process in ASP.NET. It appears that this missing namespace attribute prevents ASP.NET from linking the schema to the data. It will receive the full data, but it won’t be able to link the schema to the data because they have different namespaces. The schema (“xs:schema” element) will always have the xmlns attribute (even if it’s empty); whereas the data will only have the xmlns attribute if it’s not empty.

     

    So ultimately, the solution to this problem is to assign a namespace value to the DataSet via the Namespace property on the DataSet. Having done this… it all works fine. It sounds pretty simple, but it’s very frustrating when you’re trying to figure out why the exact same XML will deserialize from a file, but not via the web service.

     

    If this doesn’t make sense to anyone, please let me know. I’ll try make a sample web service and client to demonstrate what’s going on. This is not a trivial issue (in my opinion), and it caused a lot of frustration when it’s not well documented. I searched Google a few times and it seems there’s nothing on the net explaining this problem. It’s unusual that the manual deserialization of a DataSet without this xmlns attribute would work, but not the ASP.NET deserialization. Are these using two different processes? I understand the significance of a namespace, but surely this should be documented somewhere?

     

    So my question is… is this another bug, or is it by design? If it’s by design, please could someone explain it?

     

    Thanks

  • Bug in .NET Framework - SqlTypes

    Haven't blogged in a long time, but thought I'd break the silence with a little bug I found in the .NET Framework 1.1. I stand to be corrected on this, but I think a bug exists in the conversion from SqlDecimal to SqlInt32. To demonstrate, create a WinForms app and add two buttons. Use the following code for their click events:

    private void button1_Click(object sender, System.EventArgs e)
    {
    try
    {
    SqlDecimal sqlDec = new SqlDecimal(decimal.Parse("20,000.50"));
    int intValue = sqlDec.ToSqlInt32().Value;
    MessageBox.Show(intValue.ToString());
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }
    }

    private void button2_Click(object sender, System.EventArgs e)
    {
    try
    {
    SqlDecimal sqlDec = new SqlDecimal(decimal.Parse("20,000.50"));
    decimal dec = sqlDec.Value;
    int intValue = (int)dec;
    MessageBox.Show(intValue.ToString());
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }
    }

    Now, I would expect both of these to return the same value of “20000” in the MessageBox, but they don't! It seems that the SqlDecimal conversion to SqlInt32 completely disregards the decimal point and returns the whole value as an int. In other words “2000.50” will convert to “200050” and “200.5000” will convert to “2005000”. I think this is wrong, as a conversion from SqlDecimal to SqlInt32 should truncate the decimal value to make it a whole number.

    Any thoughts????

    PS... I called Microsoft PSS and was told they don't support free downloads, including the .NET Framework. I've taken this up a few levels and will let you all know what happens!

  • Cruise Photos

    Ok... I got back a while ago, but I've only just had a chance now to upload some photos from the cruise.

    I've also made the difficult decision of changing jobs. I'm leaving GFC in mid-January and will be working at Derivco from 17th. It wasn't the easiest decision to make, because I really enjoy working with the team at GFC... but I think it's the right time to make a change. I'm really looking forward to it!

    Until then, plenty of stuff to keep me occupied... Christmas, New Year, and all that rubbish. I'm also probably buying myself a new notebook in a week. It's an HP nx7010. Pretty nice... 15.4” wide screen, 512MB RAM (which I may upgrade later), 60GB disk, DVD+RW, WiFi, Centrino 1.7Ghz... enough to make me happy.

    Ok... that's all from me for now.

    Posted Dec 20 2004, 10:46 AM by stuartg with 2 comment(s)
    Filed under:
  • Jus' Cruisin'

    I'm off on a bit of a break for the next few days. If anyone needs me, this is where I'll be:

    So for those of you that'll be at work on Monday & Tuesday... just think of me sailing into the sunset (hopefully not in the middle of a cyclone)!

    Posted Dec 10 2004, 09:19 AM by stuartg with 2 comment(s)
    Filed under:
  • Another one lost to Firefox

    I'm generally not one to follow the crowds. I prefer to have a good reason for doing something, which is why I hadn't yet moved across to Firefox. I didn't really see any major issue with using IE, and I don't think it's a bad browser. I still like the browser, and haven't really had any clear problems with it... but I just heard of another security flaw in Internet Explorer 6.

    So I've just installed Firefox, and will only use IE for the rare case where Firefox isn't so grand (i.e. blogging). Until Microsoft can release a completely new version of Internet Explorer that doesn't have as many security holes, I'm just not happy using it. Sorry MS... you've just lost another one to Firefox. I gave IE its fair chance, and it has been proven weak.

    Taking into consideration the amount of confidential and highly sensitive personal data that travels around between browsers and servers, I think it would be a good idea to be as secure as possible. With all the technology that allows you to securely do Internet banking, etc. you're still only as secure as the weakest link in the chain. Unfortunately, Internet Explorer seems to be that link. Now I just have to show everyone else I know that it exists! After all... the biggest group of people that know about Firefox seem to work in the IT industry. This needs to be “marketed” outside of that arena if it's really going to be a force to be reckoned with!

    So I'll be using Firefox from now on. MS... it's time you sorted out IE. Longhorn will be good I'm sure, but maybe you should take a few developers off that and let them sort out IE for a few weeks. Just a suggestion.

    Posted Dec 07 2004, 04:02 PM by stuartg with 3 comment(s)
    Filed under:
  • Awesome little tool: Desktop Sidebar

    For those of you that like this sort of thing... I just found a little utility called Desktop Sidebar that looks very similar to the sidebar available in Longhorn. It's about 9MB to download but from what I've seen so far, it's really really nice! It does all your RSS aggregation and has links for other cool goodies! Check it out!

    Posted Dec 06 2004, 11:59 AM by stuartg with 9 comment(s)
    Filed under:
  • Advanced SQL Reporting Services - Code & Slides from SADeveloper Event

    Sorry this has taken so long. I've finally managed to upload some of the content from our sadeveloper event on “Advanced SQL Reporting Services” - although it's not as well prepared as I would have liked. I'll be spending some time getting this organised and hope to post up a new article on writing delivery & data extensions for SRS. In the meantime, here are some links to the content from our session last Thursday:

    Please note that these are not perfect examples. They're just to get you started on some of the more advanced features of SRS. Writing extensions to SRS is really really easy once you get going, so this is mostly here to get the ball rolling for you. I've based my MSMQ Delivery Provider on the sample that comes with SRS (printer delivery), so you'll see quite a few similarities. Obviously there are better ways to do this. You'll need to configure it correctly if you want to actually use it, but I'd strongly recommend you test anything first. These are not intended to be used, but were more for demo purposes. (Configuration of extensions to SRS will be covered in the article, when I post it up)

    Hope this helps (for those that were asking for the source code). Check back soon for an article on writing extensions for SRS. I'll give a more step-by-step approach to creating these, as well as a different example. I'll start with an article on creating a data processing extension for DB2 (using the Managed Data Provider) - I'm sure that'll be of use to anyone that uses an AS/400 ... or even just DB2 on Windows / Linux.

    Anyway... that's enough for now. If you're very interested in getting the DB2 Data Processing Extension, then post a comment and I'll make it happen quicker.

  • Microsoft Partner Pack for Windows (demonstrating the power behind .NET)

    Microsoft has just released the Partner Pack for Windows, which is a bunch of applications, all ported to managed code in various languages (C#, C++, J#, etc.). Some of them are really useful and it's definitely worth taking a look. I'm sure I'll be a fan of the Post-It app (just a digital version of those little yellow Post-It notes from 3M).

    Take a look... I'm sure you'll see something you like!

    Posted Nov 28 2004, 10:13 PM by stuartg with 2 comment(s)
    Filed under:
More Posts Next page »
Powered by Community Server (Commercial Edition), by Telligent Systems