Thursday, March 02, 2006

I personally feel that a good debugger and ability to debug is one of a programmer's best friends.  This includes debugging onto Windows Mobile devices via ActiveSync.

Recently one of my clients got Windows Mobile 2005 on some devices we ordered.  I set about making sure our application would run properly on it. This application happens to communicate over a wireless network with several different pieces of hardware using various proprietery protocols.  I have gotten used to cradling the device, starting a new debug session in Visual Studio and watching bytes flow back and forth over sockets with the wireless connection.  This new gem we received (A Symbol MC9090 with 625mhz Xscale) insisted on shutting down the wireless card whenever the device was cradled.  This makes it hard to communicate with my hardware, which is seperated from the corporate network and on its own WLAN for very good reasons.  Assuming this was a setting I could change, I contacted their support and got the following disheartening response:

  • Microsoft will not allow us to change this functionality.  In short, they will not allow an AS (Activesync) connection simultaneously with a WLAN connection.
  • Also, please note: This cannot be corrected by a GRIP request (custom product request) or any other mechanism.  At the present time if we change this functionality we will fail Logo Certification and therefore not be able to sell the resulting device.
  • I also found some MSDN articles alluding to Microsoft's claims that "some of their Enterprise customers" had asked for this feature for security reasons.  I have trouble imagining what type of customer asked for this change, but so be it.  It seems ludicrous that this is not a developer-overridable item.  There do look to be some hoops one can jump through (if one is very nimble) to get debugging over WiFi to work on CE5 based devices.  I could also ruin my test environment by putting it on the corporate network, or get cozy with platform bulider and try to make an OS image that does what I want just for testing.

    The developer story for Mobile and Embedded systems could still use some work.

    Thursday, March 02, 2006 11:20:42 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Monday, February 20, 2006

    optionsScalper will be giving what is sure to be an interesting presentation on F#.NET at the Wisconsin .NET user's group tomorrow.  optionsScalper has a very serious math background, a scientific mind, and an excellent singing voice.   I like to think of him as someone who's putting the Science back in Computer Science.

    He has piqued my interest in F# so I hope to have it installed and working before the presentation so I can follow along.  I won't attempt to describe F# until I've written some, suffice to say it is a different programming model than the stack-based imperative languages most of us are familiar with and thus presents a paradigm that is much more friendly to certain types of problem solving.

    Monday, February 20, 2006 9:41:10 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Monday, February 13, 2006

    I have a small web site I was looking into converting to ASP.NET 2.0 for various reasons *cough resume cough couh* however due to environmental restrictions (corporate politics, not EPA) I have to use MySQL as the data store, and there is an existing schema which is absolutely nothing like the schema the default ASP providers use.  This provided the perfect excuse to dig into some internals and see about providing some Providers. 

    Why would one go through the trouble of implementing these interfaces?  First, as you'll see, its pretty easy.  Second, by doing this you can still use all the great plumbing for role-based security and the "Login" and "User" family of controls that ship with ASP 2.  By looking through my machine.config I can see that I'll need to create and configure instances of two abstract classes: System.Web.Security.MembershipProvider and System.Web.Security.RoleProvider.   There are some intermediate classes you could choose to inherit from like SqlMembershipProvider that might save you some time but in my case it seemed quick enough to start at the base class.  Intellisense and the compiler will tell you what methods you need to override.  For example, MembershipProvider requires an implementation for ValidateUser such as:

    public override bool ValidateUser(string username, string password)
    {
    bool valid = false;
    EmployeeDataAccess dao = new EmployeeDataAccess();
    Employee e = dao.FindByLoginAndPassword(username, password);
    ...

    Simple enough.  If you decide to do this, you may wish to set some breakpoints in methods like RoleProvider.GetRolesForUser and run through your app. 

    public override string[] GetRolesForUser(string username)
    {
    SecurityDataAccess dao = new SecurityDataAccess();
    List<string> roles = dao.GetRolesForUser(username);
    return roles.ToArray();
    }

    In my case there is a small performance hit for running this method.  ASP calls this method to validate your access to pages, proces any LoginView controls trim asp:Menu items if you have securityTrimming enabled, and user code could always call Page.User.IsUserInRole("");   sliding expiration in the ASP.NET cache is a good idea here.  Finally, you just need to tell your web application to use your custom providers.  Supposing my security data store is called "IDMS" and my classes are named accordingly, here are my web.config settings:

    <membership defaultProvider="IDMSMembershipProvider">

    <providers>

    <add name="IDMSMembershipProvider"

    type="IDMSMembershipProvider"

    requiresQuestionAndAnswer="false"/>

    </providers>

    </membership>

    <roleManager enabled="true" defaultProvider="IDMSRoleProvider">

    <providers >

    <clear/>

    <add name="IDMSRoleProvider" type="IDMSRoleProvider" />

    </providers>

    </roleManager>

    So, as you can see, its easy to implement classes to plug into Asp.NET security.

    Monday, February 13, 2006 9:15:14 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Thursday, February 09, 2006

    http://www.wi-ineta.org/DesktopDefault.aspx?tabid=89

    A former client called me today to ask if I knew anyone with X,Y,Z skills who was looking for a work.  They weren't interested in consultants at this point so I said I didn't off-hand and directed them to the Wisconsin .NET user's group job board at the above URL.  Note that none of these are entry-level jobs that I can tell.  Employers: you are burning the future to stay warm.  You are assuming someone else will do you the favor of training the recent grad and you can scoop them up when they're no longer green.  Everyone else is making the same assumption and the symptom is kids not going into CS related degree programs.  The result is the President noting in his state of the union address that congress needs to let us import "smart folks" for "Jobs that are having trouble being filled here."

    Thursday, February 09, 2006 12:30:47 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Saturday, February 04, 2006

    A lot of developers working with these great modern garbage collected single-inheritance object oriented programming languages on big powerful servers may go their whole career without actually seeing an OutOfMemoryException.  This will happen from time to time on the compact framework and I'm happy to say I typically pay attention to what I'm doing and my hard to track down bug from yesterday is my first OOME.  I have a sync process that merges data into SQL CE 2.  To try to squeeze blood (performance) out of a rock (SQLCE 2.0) it prepares and caches update and insert commands.  Here's a small piece of that code:

    ...            

                System.Data.DataTable schemaTable = dr.GetSchemaTable();

                dbCommand = DataHub.Database.GetCommand(GetUpdateTemplate(ref schemaTable, pk, changeColumn), DataAccessObject.CONNECTION_STRING);
                string columnName;

                SqlCeParameter dbParameter;

                foreach (System.Data.DataRow row in schemaTable.Rows)
                {
                    columnName = (string)row["ColumnName"];
                    int columnSize = (int)row["ColumnSize"];
                    dbParameter = new SqlCeParameter(
                        "@" + columnName,
                        GetSqlDbType(row["ProviderType"].ToString()),
                        columnSize);

                    if (!row.IsNull("NumericPrecision"))
                    {
                        dbParameter.Precision = Convert.ToByte((short)row["NumericPrecision"]);
                    }
                    if (!row.IsNull("NumericScale"))
                    {
                        dbParameter.Scale = Convert.ToByte((short)row["NumericScale"]);
                    }
                    int columnOrdinal = (int)row["ColumnOrdinal"];
                    object pVal = DBNull.Value;
                    try
                    {
                        pVal = dr.GetValue(columnOrdinal);
                        dbParameter.Value = pVal;

    ...

    This worked for a long time until someone decided that a column of type ntext  should be replicated.  The column size for a field of type ntext happens to return something like 580million bytes.   When the code tries to set the parameter value, it finds it can't allocate that much space.  The maximum stack size in the compact framework v1 is 640k (reminds me of MS-DOS low memory, no one will ever need more than 640k); 640kb * 1024b/kb = 655,360bytes, or "not enough" and the OutOfMemoryException is thrown. 

    I feel a little sorry for anyone building a custom sync process using SQL CE.  SQL Mobile is much nicer but does not remove the potential for things like this to happen.  I have a project I'm working on which I'll open-source IF I get it done.  I say if becuase I have occasionally announced some wacky plan here only to be distracted by a shiny object and said project dies on the vine.

    Speaking of stack size optionsScalper was telling me about F# and how .... look, a penny!

    Saturday, February 04, 2006 11:59:35 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [16]  |  Trackback
     Friday, January 27, 2006

    The Few

    The Proud

    The Lucky.

    The Live Messenger Beta Testers.

    Like Scott I managed to get in on the Beta Action for Live Messenger, in my case by signing up on the beta site and waiting for them to send me a download URL.  The folks who know me will tell you I like to chat too much so a new messenger release is a notable event for me.  I like Live Messenger so far, although if you are prone to seizures, dizzyness, or frustration you should turn off the "rollover" feature immediately.  I have yet to try the File Sharing or anything but offline messages. 

    Friday, January 27, 2006 7:20:05 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
     Monday, January 23, 2006

    ... or something like that.

    The week of Xmas 2005 I got a call from my Fearless Leader at SafeNet.  It seems that for 2006 Microsoft has made it quite abit harder to be a true Microsoft Partner, and as such they are going to lose about 80% of their current certified partners.  This sounds good to me, since this might make partnership mean a little more.  However it turns out we are short an MCAD plus one premier certification on staff in order to qualify.  As the person with the Fanciest Title it falls on me to get 4 certs before January 31st.  I have never cared much for certifications, from what I had seen from the MSFT practice questions in the past they seem to cover a lot of stuff I am not likely to use in the real world. 

    So, xmas weekend was out for studying, under pain of death from my family.  The following week was out because I was getting ready for my CF 2 presentation.  By the way I still need to pos the slides/code for that.  The following week I'm not sure what happened.  In order to force myself to study and take the exams I just scheduled 4 tests in close succession on the 18th, 20th, 23rd, and 27th.  A part of me secretly wanted me to fail something to prove that the tests are a meaningful measure of skill.  I did have to read up on the remoting and COM+ stuff for 70-320 but I passed the 1st three easily, I suppose I am an MCAD as of this morning.  On Friday I have to take the Solution Architecture test to prove I am a sufficiently skilled Hand Waver and SafeNet will get to keep its partnership status.  After that I might as well take the BizTalk test to get the illustrious MCSD designation.

    To me, the only reason to take these tests is for partnership points, no client has ever asked me about certifications.  Most of the very skilled people I know locally do not pursue certifications.  I am somewhat hopeful that the Microsoft Certified Architect program will be brutal, and therefore mean something when you pass.

    Monday, January 23, 2006 11:19:20 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
     Monday, January 16, 2006

    As with everything I post here, the following is my opinion and you are welcome to disagree.

     

    IT recruiting is a mess right now in our area.  I feel bad for all the good recruiters and PMs who are trying to find people to staff projects.  I get calls and emails from recruiters regularly and I don’t have anyone to send them.  Of course I’d rather take advantage of the sweet recruiting bonus at SafeNet anyway, but the fact is I just don’t know anyone who is looking.

     

    The ITAA is currently lobbying to remove H-1B visa caps because according to them 859,000 tech jobs are going unfilled every year.  The ITAA is obviously lobbying for cheap labor to drive down yours & my salaries, but there is clearly something going on right now.  No, I don’t think we’re going to see salaries at 1999 levels nor should we, but things are picking up right now.  There is no one to do the work.

     

    Part of the issue right now is that companies are simply not investing in hiring and retaining junior level developers.  Every project I see requires “One senior and 3 mid level” developers.  People don’t become mid-level developers by going to grad school or by doing a single internship one summer: they do it by building systems, initially as junior developers.  Hopefully with some guidance from someone who has already built many systems. 

     

    When I was getting my start, I was lucky enough to have fantastic mentors, people who had the skills and could work with me to make me better.   There was also a company directive stating that it was part of their job to spend that time with me.  If I ever saw one of these guys on the street (my first job was in Madison, a ways from me) I would shake their hand, buy them a drink, and thank them for helping to give me a good start.  In fact, one of the reasons I have tried to pursue more senior level positions in my career is to be able to work with less experienced people: find the ones who “get it”, and spend time with them turning them into the next great developer.

     

    I just don’t see companies making this investment today.  The kids with CS degrees are having trouble finding work because they are not yet mid-to-senior-level.  The kids a few classes younger than them are not going into CS majors because they see these kids having trouble finding work.   A myth starts that “American kids don’t like CS” and we get lobbyists at the soapbox talking about how poor our educational system is.  Good paying jobs + Availability of Jobs = Students in that major.

     

    Companies refuse to hire inexperienced people and then complain that there’s no one out there who’s looking for a job because most people are (wisely) taking decent care of their people.  They need to hire someone for a particular project, meaning they need someone with X,Y,Z skill set already.  “We have a deadline and there is no time to bring someone up to speed on this.”  Their mid and senior level people, the good ones who get stuff done who might also make good mentors, they are already overworked as they try to balance their own work with helping out their supposedly mid-level “peers” who aren’t getting the work done because they don’t “get it”, but were lucky enough to get in before the bubble burst and have a “mid level” title now.  Everyone is running around as though the skies were falling and no one is investing in the next generation of talent.  If you cannot find the talent, you need to seriously consider home-growing the talent that you need.  People will learn your business while they learn your technology.

     

    I will close with this: I do very well at Safenet, so I am not looking for work.  However, the one thing that an employer could do that would show me that they “Get it” would be to offer to pay me a great salary to be a tech lead and mentor of junior developers.  I would certainly send the brightest kids in their direction.  Invest in the next generation of talent, or we are going to have several messes on our hands.

    Monday, January 16, 2006 12:49:48 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [3]  |  Trackback