June 2006 - Posts

From the Peculiar Ideas Departament: Compilr

Say you're away from home and just have to compile some lines of code to prove a theory, how do you do? Easy: browse to http://www.caller.me.uk/Compilr/, type or paste your lines and the code is compiled in a far and away server. It sounds like a strange proposition to me, but who knows, may be there are reams of programmers with Internet access that don't have a compiler at hand... Where's the money in the site? Advertising of course (Google is now generating some really weird spawn.) For the time being, they offer you C#, VB.NET, C, and Fortran compilers. Come to think of it, if they offer a few exotic languages like Lisp, Prolog, or APL, I may very well give it a try...

Kerberos, NTLM, PKI, SSL, roles, AzMan, DACL, impersonation, etc. in .NET

You would imagine that topics like authentication (who you are) and authorization (what you are allowed to do), should be by now: a) solved and easily explained; b) standardized. In truth, the latter is a little more truth than the former, but at any rate if you want to understand these subjects you face a real alphabet soup and an entangled concept diversity, with each such concept apparently entitled to a tome by itself. Being 2006, authentication and authorization are still complex and not well understood topics, and, as a consequence, more than a few systems re-invent (poorly and weakly) the wheel.

Well, this article, even though a little bit long, explains in a pretty detailed and decent way many of these concepts. Furthermore, it shows how to implement standard authorization and authentication solutions with the .NET Framework. Recommended reading.

Posted by Edgar Sánchez with no comments
Filed under: ,

ADO.NET provider for Postgresql

This is not really news as the driver has been available since April: Npgsql is an ADO.NET data provider written in C# that enables any .NET application to work with Postgresql 7.x and 8.x. You can download the provider from here.

Posted by Edgar Sánchez with 6 comment(s)
Filed under: , , ,

.NET in Linux (and something about numerical analysis)

Every few months news emerge about the Mono project: spearheaded by Miguel de Icaza in order to have a Linux .NET implementation that would allow to more easily create Windows like applications in Linux, Mono has managed to implement a good C# compiler, most of the BCL (ADO.NET included) and a pretty reasonable ASP.NET 1.1, but it has failed to have a production-level Windows Forms implementation (they are moving ahead, but Microsoft goes much faster.) A couple of years ago I got enthusiastic about Mono, but now I see (sadly) that it's stalling (even though it was acquired by Novell, or may be exactly because of that [;)]).

While visiting the Mono site I found (again) dnAnalytics, an open source project trying to implement a standard set of numerical methods libraries (stuff like matrix manipulation, differential equations, etc.) in C#. It runs OK in Mono and also in the official .NET (although it doesn't use the new abilities in .NET 2.0), it could be of use for those of you working on numerical analysis.

Beta version of Ruby.NET compiler just released

I just got an e-mail announcing the "preliminary Beta release of the Gardens Point Ruby.NET compiler" (what's that? an alpha? an untested beta?) One part of the announcement caught my eye, though:

Our implementation is not yet fully complete, but it is the only Ruby compiler that we know of for either the .NET or JVM platforms that is able to pass all 871 tests in the samples/test.rb installation test suite of Ruby 1.8.2.

So, go grab your preliminary Beta here.

Posted by Edgar Sánchez with no comments
Filed under: ,

Complete Visual Studio Team System shortcut keys listing

Reading this blog entry, I remembered of the times when my younger brother Alex was the capo of PowerBuilder 6: just to impress you, he would put the mouse in his shirt pocket and then banged through the IDE just with the keyboard with amazing speed and dexterity. Well, it so happens that you can do the same with Visual Studio, only that we are so spoiled by the mouse that we never learnt how to drive VS without one. Almost a year ago, Jeff Atwood wrote a VS macro that generates a nice Web page with all the keyboard shortcuts available, I installed the macro, run it, and uploaded the shortcuts page ready for you to download and check here (the link is in Spanish, don't worry, just press the Download button.) So, any unexpected and useful shortcut there?

What Every Dev Must Know About Multithreaded Apps

Pay attention to this few lines of code:

class Calculator {
    private static int m_TotalCount;

    public void DailyCut(int
        m_TotalCount = 0;
(m_TotalCount != 0 && m_TotalCount < limit)
            // some process

    // other methods

Let's focus in just one of the several silly things of the sample: after setting m_TotalCount to 0, we immediately check whether m_TotalCount is different from zero, which will never be true, so the process inside the loop will never be executed. Obvious, right?

Now, what would you do if you find out that the process, however infrequently, does get executed? A bug in .NET? Bill Gates? Well, far more plausible is that we are facing a concurrency problem: if several execution threads run through the Calculator class, then may be some method inside thread Y changes the value of m_TotalCount, right when thread X is between the assignment and the while, improbable but possible.

This is an example of the bad things that can happen in multi-threaded environments, that's why it is recommended that we rookies better stay away from these waters, but at the same time multi-threaded programming offers several tempting advantages and, besides, with the generalization of multi-core and multi-process machines, it's going to be an unavoidable fact of life. That's why we better learn the ways and means of multi-threading and a good starting point is this nice article by Van Morrison that won an Excellence Award from the Society for Technical Communication. A very short and recommended reading.

TechEd 2006 *live* presentations

TechEd 2006 started yesterday (and I finally didn't make it). Oh well, thanks to the Internet we can be up-to-date and much closer than not-being-there, for example we can watch the keynote delivered on Sunday afternoon and some other "home made" videos recorded in situ. We can also watch a webcasts series to be done live at TechEd from June 12 to June 16. See you at the Virtual TechEd!

.NET Framework 3.0

Today, as Ecuador was beating Poland in the World Cup (way to go Ecuador!), Somasegar was announcing that what was previously known as WinFX (WCF, WPF, WF) plus other technologies like WCS (formerly Infocard) are an integral part of .NET Framework 3.0. Furthermore, *all* these components will be available for Vista, 2003 Server, and XP. I think it's time we download Beta 2.

While in the subject, my +1 to the idea that Indigo, Avalon, Infocard are far better names than WCF, WPF, WCS, etc.

Posted by Edgar Sánchez with 3 comment(s)
Filed under: , , , , , , ,

live.com image search

This may be really old news, but I just found out that you can search images in live.com like so:

And, obviously, I know other search engines have similar abilities depuis long temps. Do you know any other live.com shortcuts?

Posted by Edgar Sánchez with 1 comment(s)
Filed under:
More Posts Next page »