Posts

Showing posts from 2004

Holiday Greetings:

I recently received the below Holiday Greeting from a compatriot, and decided to post it. No explanation should be needed: Dear XXX: With the holidays fast approaching and EULAs pretty much a fact of life, please accept -- with no obligation, implied or implicit, on behalf of the wisher or wishee -- my best wishes for an environmentally-conscious, socially-responsible, low-stress, non-addictive, gender-neutral celebration of the winter solstice, practiced within the traditions and/or within the religious or secular belief(s) of your choice and with respect for the traditions and/or religious or secular beliefs of others or for their choice to not practice traditions and/or religious or secular beliefs at all; and for a fiscally-successful, personally-fulfilling, medically-uncomplicated recognition of the onset of what is generally accepted as the new Gregorian calendar year, but with due respect for calendars of other cultures whose contributions to society have helped make America gre

ASP.NET v1.1 Member Management Component Prototype

Checkitout: http://www.asp.net/MemberRoles/memberroles.htm

Server 2003 SP1 Release Candidate available NOW!

Here it is! http://www.microsoft.com/downloads/details.aspx?FamilyID=ae20c29d-5c71-49ce-9091-3aedc9e5979f&DisplayLang=en

Need to Get A HEAD?

Image
This nice little piece was recently posted by David Kline on his blog: Have you ever wanted to know what type of file was being pointed to by a given url before clicking the link?  Maybe you are writing an application that needs to filter out certain types of links.  A web crawler is a good example of an application which needs to do such link filtering (skip links to graphics, audio, zip files, etc). In order to check the type of data pointed to by a url, you are going to need to issue a request to the server.  Normally, this involves receiving the entire page or file at that location.  This can be a time consuming proposition, especially over slow network connections, and defeats the purpose of allowing your application to filter out undesired links. The solution is to issue a request to the server, asking only for the HTTP headers.  This "HEAD" request is small, fast (does not transfer file contents) and provides you with exactly the data your application needs.  While

Web Services Enhancements 2.0 SP2 (WSE 2.0 SP2) Released today

This release fixes some top customer issues and provide a new security token, KerberosToken2, which supports impersonation, windows constrained delegation.  The new token also works well with the web farm scenario. Download WSE2 SP2 from http://msdn.microsoft.com/webservices/building/wse/default.aspx

IsNumeric in C#? Not!

Recently we had another "go around" at the office regarding IsNumeric in C#. We had a forum discussion on this at eggheadcafe.com some time ago, I suggested to use the Microsoft.VisualBasic.Information.IsNumeric method, which can certainly be called from C# or any other .NET language. Two other developers, both of whom I highly respect, have gone quite a bit deeper into this; J. Ambrose Little here and Justin Rogers here . Only Rogers actually made reference to the fact that the VisualBasic method does a significant amount of type-checking under the hood; type-checking that was not included in either of their test suites. The bottom line is this: If I put "$1,079.51" into Ambrose's VisualBasic method, it returns true, because that string, indeed, "IS" numeric. Other methods tried will either incorrectly return false, or will actually hang and not return at all. According to the Microsoft definition of "Numeric", depending on the CultureInfo,

MSMQ 3.0 and Multicast

Amazing what you can learn when you RTFM, ya know? From the Message Queueing in Windowx XP: New Features : MSMQ 3.0 in Windows XP extends the regular MSMQ programming model from one-to-one to one-to-many. The traditional MSMQ model allows a single message to be sent to a single queue. However, the one-to-many messaging model enables clients to send the same message to multiple recipient queues. MSMQ 3.0 offers multiple ways to implement this model: " Real-time messaging multicast " Distribution lists and multiple-element format names In MSMQ 3.0, one-to-many mechanisms provide the application developer with the fundamental tools required to build sophisticated publish and subscribe systems. These kinds of systems are useful for addressing reliable information dissemination scenarios. Real-Time Messaging Multicast MSMQ 3.0 provides a mechanism to send messages on top of IP multicast. Specifically, MSMQ 3.0 uses the Pragmatic General Multicast (PGM) protocol (see http://www

Another Believer! (EXEC sp_name param, 'param') -Not!

Vis-a-vis my last number on why not to use "Exec spname paramvalue" etc. -- my friend figured out that all the places he was doing new SqlDataAdapter("exec mysp 1,5 'hello'"); are open to SQL injection attack (he thought they were immune to it). Why? Simple- if an attacker can get access to the SQL string they can just add ";DELETE TABLENAME". DOH! So now he is happily rewriting everything to use SqlHelper and turning all those inline text strings into object[] parms={1,5,'hello'}; object arrays. You see that? You are only dumb when you think you know everything....

ADO.NET and SQL Server Optimization

Recently a compatriot and I got into this diatribe over the use of CommandType.Text and "EXEC spName param, param, ..." to make SQL Server stored procedure calls. I had chimed in on his answer to a poster who was having difficulty with a sproc call, and he suggested "you don't need to use the Command Object" and proceeded to show an illustration like the above. Even after I had provided some pretty good background material on why this is not a good idea, he continued to hammer on little pieces of the subject, in effect missing the big picture. There have been many times I've been corrected. As I've grown older (and hopefully wiser) I've learned to put my ego in my back pocket and thank the person for the education. And you? I guess what I am trying to say is this; you have two MVPs who didn't know about this. The only reason I found out about it is because I was lucky enough to attend Tech-Ed 2004 and sit in Gert Drapers' presentation. So

SWIG - Creating Managed Wrappers

Today I discovered SWIG - which makes writing managed C# wrappers for unmanaged C++ libraries and DLLs hugely easier. I am in the process of studying managed C++ wrapper code, "It Just Works" and P/Invoke to handle some needs related to exporting methods from telephony board APIs. Although I haven't gotten very deep into it, one look at all the C# code SWIG generated from a single imported *.h header file has me convinced!

To Deficit - or Not To Deficit? (Don't believe everything you hear):

Image
One of the biggest Bush-bashers during the 2004 Presidential Campaign was the "Huge Deficits" that Pres Dubya recklessly ran up, right? Not! Drops in revenues and increases in outlays occur automatically during a cyclical downturn and then reverse themselves during a cyclical upturn. There is also a "cyclically adjusted deficit". The cyclically adjusted surplus or deficit is calculated to show the underlying outcome of the federal budget when those automatic movements are removed. Policy actions by the Congress and the President, such as tax or spending legislation, create changes in the total budget surplus or deficit that are distinct from the automatic cyclical movements. The cyclically adjusted surplus or deficit includes the effects of those legislated changes. The CBO calculates a different measure, the standardized-budget surplus or deficit, that attempts to remove those factors as well as the effects of the business cycle. As a result, the standardized-bu

Did the Republicans have a Gamma Ray Burst?

or was it just crappy exit polling? At any rate, the popular vote was representative of the largest voter turnout in American history, and George Soros is probably looking for a monastery he can move into. If I sound partisan, it's because I have become so, with America becoming so incredibly polarized. Now maybe the Bush-hating left wing elite media establishment will shut up f or the next four years and we can get on with business! These people have become so arrogant over the years, they have really become out of touch with mainstream America, as the election has proven. And the exit polls - boy that's just a whole 'nuther issue entirely ! Q: What is 50,000 Liberals at the Canadian Border? A: A good start....

Telephone Pet Peeve

Don't you just LOVE these people that leave answering machine messages like they are gonna give you the history of the world, or something? I do most of my business work with my cell phone, leaving the main phone free for the Significant Other. Calls come in all the time when she's out, and since that phone is just off my office and I don't bother answering it, I get to hear all the dumb messages people leave. I mean, "Hello, this is who I am , this is why I am calling, and here's my phone number", right? Oh, NO! They gotta tell you everything and take up 10 minutes of time with all their B.S., when all that can ever happen is you are either gonna call them back or not, right?

Oct 2005 CTP Woes for VS.NET 2005

Well, I went ahead and installed the Oct 2004 CTP's of SQL Server 2005 and VS.NET 2005. SQL went great. VS.NET - not so great. Two main problems (one fixed, one in Product Feedback pending review from Redmond): 1) The ASPNET_ADMIN.EXE Registry entries were not updated by the install, so the service failed on boot. Reason? Simple - they were still pointing to an exe located in the 2.0.40901 folder, and the new correct version folder is 2.0.40903. So, manually changed the registry entries and everything is fine. 2) Installation of the Virtual PC (VPC) Network driver failed on first install. Second time around, it appeared to take, but when you go to debug a Compact Framework app in the emulator, you get a nasty popup to the effect that its not installed. Tried every fix out there including Amit Chopra's blog stuff (From MS - see link above) and no dice. Boo - Hoo! I did have EVC++ installed and Chopra indicated that could be a possible cause, but its not installed now

RE: Microsoft Delivers a New Visual Studio 2005 Beta

Microsoft recently released a new "community technology preview" (CTP) beta build of Visual Studio 2005 "Whidbey," as numerous Microsoft bloggers have noted. It includes "edit and continue" support for Visual C#. [Via Microsoft Watch from Mary Jo Foley ] So how many times do we need to reinstall this to get to first base? I think I'll pass for now. Eh, on second thought, maybe I'll just download the bits and get around to it...

Test Blog from Bloggar

This is bloggar talking!

Presidential Debates and Communications

O'Reilly had a communications specialist on tonite, the night after the first Presidential debate. She reminded me of something very interesting about human communication (they were talking about how Dubya was looking annoyed, etc. when Kerry was running him down): Communications is: 55 % Body Language 38 % Tone of Voice 7 % words Your body language and tone of voice account for NINETY THREE PERCENT of what you communicate. Your words - what you are actually saying - only 7%. Think about it.

Crap! Another hurricane

hard to concentrate on your work when everybody wants to put on the Weather Channel and be entertained.

Circular References, Memory Leaks, and other Baddies

In a garbage collected environment such as .NET, it is possible to unwittingly leave objects in a state where the garbage man will be "on vacation". One way to check on this kind of stuff is with profiling products such as the Scitech .NET Memory Profiler: http://www.scitech.se/memprofiler/ Ian Griffiths has a well - written, concise piece on this subject here: http://www.interact-sw.co.uk/iangblog/2004/07/07/circulareventrefs One of the issues we found with this is when you have a lot of controls on a UserControl or form and you unwind it, thinking you have gotten rid of everything. Except, you may have not done so - event handler delegate calls may still hold a reference to their target. We found this to be especially noticeable on controls derived from RichTextBox - a control with a lot of Interop going on under the hood and notoriously "Buggy" to boot. The problem is solved with a neat little method we call in the Dispose Block , "

SQLite ADO.NET Provider and Compact Framework

Well, I spent a fruitless afternoon fiddling with SQLite 3.0.4, 3.0.5 and the Finisar SQLite ADO.NET provider. The provider works great for SQLite 3.0.X but there are serious issues with getting it to work ON the Compact Framework due to the marshaling deficiencies with C-style DLLs in CF. Bottom line is, even though the provider has a .NETCF solution and test app, they'll compile fine - but they will always throw a System.MissingMethodException on the sqlite_open call. This, after downloading the C source and recompiling my own SQLite3.dll library, to no avail! Finally, a look at the Sqlite WinCE site shows the proof: "SQLite 3XXX has serious issues!" Yeah, so does SQLite 2.8 too, if you want a 100% CF - based DBMS solution. Disappointed, --Pete

Eh! SP2

Geez. They are making it into some sort of opening nite gala or something.
An interesting C# managed-code wrapper for BITS (Background Intelligent Transfer) Eddie Tse: BITS C# Wrapper
I dunno if blogging is a good thing or not.