Symmetri Developer Blog

January 30, 2008

Visual Studio woes

General, .NET/C# - By Shourov Bhattacharya

Visual Studio 2008 is officially out and available for download. I have migrated across my latest project, and it no longer compiles - it is riddled with errors in the designer.cs files. These files are automatically generated by Visual Studio to manage the visual designer interfaces for HTML pages that have been a feature of Visual Studio since VS2005. It would not be an exaggeration to say that I hate these designer.cs files. I hate that my IDE should take it upon itself to auto-generate code for me and then hide it in a separate file; that the code it generates is approximately worthless, since I never use the designer anyway; that my project can be held hostage to errors in code that I did not even write or want; and that there is no obvious way for me to decide that I no longer want these files to be generated at all.

Charles Petzold has a great little article over at his site that talks about how Visual Studio “rots the mind”. I agree. I am not some sort of programming Luddite who insists on hand-coding in vi and compiling from the command line. But I do baulk at being told how to structure and design my own software by my programming tools. Visual Studio has become the IDE that now takes more than it gives. It has a lot of great features, but none of them are essential. Open source IDEs such as SharpDevelop are well worth consideration.

January 29, 2008

AForge.NET library for AI

General, .NET/C#, Algorithms - By Shourov Bhattacharya

I have been researching and sketching approaches to implementing ALife and AI applications for a while now, and I can’t believe I never had a good look at this - AForge, an open-source C# library developed for Computer Vision and AI.

I have just downloaded the latest version to browse just minutes ago, and already it looks mouth-watering - neural networks, genetic algorithms, machine learning, image processing … it has already covered more of the AI space than I would have expected (although much of it is sparsely covered, of course - this type of project is always a work in progress).

I am especially interested in the blob counting and filtering algorithms for possible applications with maps. Google maps and satellite images show enough detail to discern buildings and other structures with the naked eye - can an intelligent combination of edge detection, connected component (blob) finding and counting and other algorithms make sense of maps in interesting and useful ways? And can the power of 3D rendering and animation in Flash be used to present that insight in a new and compelling interface?

I hope that as we work in these areas we can provide some answers in the affirmative.

January 22, 2008

Adjust image brightness in C#

.NET/C#, Algorithms - By Shourov Bhattacharya

There are a couple of ways to do this. This method does not use ColorMatrix.


private static System.Drawing.Image _AlterBrightness(System.Drawing.Image bmp, int level)
{
   Graphics graphics = Graphics.FromImage(bmp);
    if (level == 50)
    {
       // do nothing
       return bmp;
    }
   else if (level <50)
    {
       // make it darker
       // Work out how much darker
       int conversion = 250 - (5 * level);
       Pen pDark = new Pen(Color.FromArgb(conversion,0,0,0), bmp.Width*2);
       graphics.DrawLine(pDark,0,0,bmp.Width,bmp.Height);
    }
    else if (level >50)
    {
       // mark it lighter
       // Work out how much lighter.
       int conversion = (5 * (level - 50));
       Pen pLight = new Pen(Color.FromArgb(conversion,255,255,255), bmp.Width*2);
       graphics.DrawLine(pLight,0,0,bmp.Width,bmp.Height);
    }
    graphics.Save();
    graphics.Dispose();
    return bmp;
}

January 16, 2008

searchcube released for testing

General - By Shourov Bhattacharya

searchcube logo

It started off as a personal project to help me learn Flash Actionscript 3 and get a handle on the Sandy 3D Engine, but I found this application interesting (and potentially useful) enough to release it to a wider audience. searchcube is a graphical search engine that presents search results in a compact, visual format. It searches the World Wide Web for websites, videos and images and displays previews of each result on a unique, three-dimensional cube interface.

searchcube uses the Google AJAX Search API. It displays the first thirty-two (32) results for each of websites, videos and images. The maximum total number of results returned is ninety-six (96) results. Where a preview is not available, the search result is not shown.

Website previews are provided by thumbshots.org. Three dimensional rendering is performed using the Sandy 3D Engine Flash library. Animations are performed with the help of the Tweener Actionscript library.

Try searchcube Visual Search Engine

January 15, 2008

Flash can’t window.open in Safari

General - By Shourov Bhattacharya

I am trying to open a new browser window from an embedded Flash application, calling window.open using ExternalInterface. Simple enough, except that it doesn’t work in Safari. After a little while tearing my hair out, I found out that it’s a Safari bug - popups are blocked in this case, even though the Flash is responding to a user initiated event. But I found a lovely, easy solution here - go back to the Flash and use flash.net.navigateToUrl.

January 9, 2008

Management Studio Express

General, SQL Server - By Shourov Bhattacharya

Microsoft SQL Server Management Studio Express (SSMSE) is the free version of the SSMS that has a restricted but more than adequate subset of functionality for managing SQL Server instances. For some reason it isn’t widely publicised and is thus a bit of a secret - a lot of developers still seem to think that you can’t get the Management Studio product without a paid SQL Server license.

Anyway, this page is a good overview of SSMSE and how to use it.

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph