Hi readers!

I’m not sure if I mentioned that I’m pretty active on Twitter, with over 750 followers currently, and I just added a link to my Twitter account on the sidebar to the right for convenience if say you want to follow me, @maximz2005. Also, you can now subscribe to new posts on this blog by just following @absolutely2noth. As you can expect, new posts will automatically be tweeted via the blog rss feed and will be delivered to your twtinbox! Ooh that’s a new word! w00t!

Thanks!

-Maximz2005


Hi everyone! Today, I’m pondering whether to switch my current blog theme to Vigilance, from my current monochrome theme Unsleepable, but the thing is, I like both of them! So it is up to you readers to decide – which would be more user-friendly or usuable for reading? Please help me out in the poll below! Thanks a bunch!


Early in the morning tomorrow, I’m getting on a flight to Seattle, WA, for a conference at Microsoft with my relative, and I’m travelling as the guest. Yayz! Well, I’m hefting my laptop, iTouch, Nikon D80 (with some cool gear), and more over there, and I shall be posting updates about my trip via Twitter, will be posting picts thru my Flickr stream and to TwitPic as well. I might even post some updates to this blog! Yay! Well see you later!

-Maximz2005


You may or may not have heard of GUP, but it is used in numerous programming projects for updating purposes. GUP is an acronym for Generic Updater, and it was originally developed for NotePad++, one of my favorite text editors. As you can guess, by “generic”, the developers mean that you can use GUP in basically any project where you need to install updates for your application.

GUP works in a very simple way. GUP.exe is a native Windows application that reads parameters such as current version, update url, and display messages from an XML file (some parameters can also be passed in thru the command line for ease-of-use), and then uses CURL to retrieve an XML response from a small script that you must place on your server that reports the latest version and its download url. However, in the documentation and examples, only PHP code is provided. As you quite well know, I prefer ASP.NET to PHP because I am very familiar with C# coding. Thus, I was on my own to creating some C# code that accomplishes this goal.

Below, you can see what I came up with. It basically uses Request.QueryString[string name] to retrieve parameters and Response.Write() to output the XML. Easy, I know, but I’m just not used to dealing with XML outputting so that it is compatible with the parsing libraries that GUP is using. It turns out that my simple implementation works!


protected void Page_Load(object sender, EventArgs e)
{
//Exceptions mean that no parameters provided, so don't return anything.
double LatestVersion = 1.01;
string DownloadURL = "http://dev.maximz.com/dl/testing.exe";
string CurVersionStr = "";
double CurrentVersion = 0;
bool Success = false;

try
{
CurVersionStr = Request.QueryString["version"].ToString();
if (CurVersionStr == null)
{
throw new ApplicationException();
}
else if (CurVersionStr.Trim() == "")
{
throw new ApplicationException();
}
else
{
CurrentVersion = double.Parse(CurVersionStr);
if (CurrentVersion < = 0)                     {                         throw new ApplicationException("");                     }                     Success = true;                 }             }             catch             {                 Response.Write("");             }             if (Success)             {                 if (CurrentVersion >= LatestVersion)
{
Response.Write("< ?xml version=\"1.0\"?>no");

}
else
{
Response.Write("< ?xml version=\"1.0\"?>yes"+ LatestVersion.ToString() +""+DownloadURL+"");

}

}

}

I look forward to using GUP for my projects, as I’ve been looking for such an updater solution for some time! [GUP homepage, Sourceforge project page]


 While being one of the most least discussed topics in architecture and design, but arguably one of the most important ones, public restrooms are HARD to design, because they must be “user-friendly”. Yet, what is user-friendliness for a public restroom? Let’s not discuss the design of the toilets themselves – however the other infrastructure can be manipulated to the user’s content. Read on!


 Plain and simple, I detest Internet Explorer. Why, some may ask? Internet Explorer is a retarded browser whose proprietary graphic rendering engine sucks, whose scripting engine fails, whose security does not exist AT ALL, and much much more. Thus, I don’t use IE, and I haven’t used it since a very very long time ago. I switched to Firefox when I realized how sucky IE is, and then when Google Chrome began as an open source developer project I signed up and started using it. But still, even if you don’t use Internet Explorer, it is responsible for many things in Windows, as it is directly tied-in to Internet Options and Connections.

Two days ago, I was writing an application that scraps a web database into SQL Server, when suddenly, Google Chrome, Visual Studio, and numerous other programs stopped connecting to the internet. The only major ones that still worked were Firefox and Google Talk. At first, I blamed my full CPU and thought that my computer was just crashing, but when the problem continued the next day, I knew something was up. As I noticed that the problem was spread out over many different programs, I knew that it had something to do with the internet settings that the default socket uses – Internet Explorer. Also, many people have had this problem, as reported on the internet. The fix is just as elusive as the culprit itself.

Some people said that reinstalling Internet Explorer would do the trick, yet this had no effect. While scrambling over the interwebz looking for a fix, I remembered that the HTTP proxy Fiddler automatically works with most programs including Internet Explorer, Google Chrome, Visual Studio, and more, but with Firefox it doesn’t. To successfully debug out of Firefox, you have to go into the Settings and set it to use a special proxy for Fiddler, which would mean using the default socket! This is when I realized that the whole problem was related to a proxy server mix-up. I quickly jumped into the Connections tab in Internet Options, hit LAN settings, and voila! The “Use proxy server…” checkbox was selected, with no values in the textboxes for the configuration of said proxy! After unchecking the proxy server checkbox and checking “Automatically configure settings…”, everything began to work.

Which brings me to ask, why would some program that I never use suddenly think that my internet connection has changed? Did it think I had some problems conecting so a proxy server must be required? This bug is just retarded in my opinion, as the connection changes for no reason whatsoever when you don’t even ask it to change! Really, Microsoft’s IE programmers are morons, if they have bugs like this, not to mention this bug. Geez, Microsoft – you’re abusing your power!


I’ve always wanted to experiment with creating “sessions” on websites to mimic real users browsing and using a site, and I’ve finally gotten around to a project that involves this: my goal is to “wrap” an online database that is queried through a series of HTML forms, returns a map, and then allows you to open a popup with an HTML table outlining all the points displayed on the map. A formidable challenge, indeed, but in the awesome language of C#, no big deal.

To successfully establish a user session with a website, you must preserve the correct authentication and session cookies. The web database was built using ASP.NET, so I needed to make sure that I had an ASP.NET Session ID. One of the best ways to find out where cookies are sent to you is using an HTTP proxy to analyze requests and responses. The program of choice is called Fiddler, developed by Microsoft. (You can get the latest version at http://fiddler2.com/.) Unfortunately, I was forced to use Firefox to track packets because the old (straight out of 1997) interface  recognizes the new and revolutionary browser Google Chrome as being Safari 1.3 (how sad), and doesn’t allow you to use their database. and you must set special proxy settings in Firefox for Fiddler to function correctly. After visiting the site and filling out the series of HTML forms, I could see how the report page was functioning – it was using the ASP.NET Session ID along with referrer HTTP header attributes to  find the parameters of my original query and retrieve information from the database.

That might sound like an easy interface to hack, but the cookies are deceptive as you don’t exactly know when they are set. Fortunately, after scouring the internet for an hour or so, I happened to find out about the CookieContainer datatype (HttpWebRequest.CookieContainer). All you have to do to create a cookie “jar” that carries over from one HTTP session to another is writing the following code:

CookieContainer cookieJar = new CookieContainer();

var request = (HttpWebRequest)HttpWebRequest.Create("http://www.google.com");
request.CookieContainer = cookieJar;

Now you can access the cookies by looping through the CookieContainer in a simple foreach statement. To apply this cookie container to your next HttpWebRequest, all you have to do is:

 request.CookieContainer = cookieJar;

Yay!!!


If you’re a .NET developer, admit it: you’ve at least once felt curious about how the underlying APIs behind the .NET Framework are coded, how certain functions are implemented, or whether one core function is more efficient that another. Well, this is where the trusty program named .NET Reflector comes in. As the title suggests, Reflector uses .NET reflection and ILDASM processing. It is the decompiler of the .NET world, and allows you to view source code of DLLs or executables in multiple languages (including C#, VB, C++, Delphi, IL, and more) with ease. It is very interesting to examine how the brilliant programmers at Microsoft sculpted the inner workings of the programming framework that drives many applications today. With this tool, you can accomplish just that and much much more. The Reflector was originally created by Lutz Roeder, but has been acquired by Red Gate Software. The program is free for all to download and use, and it can even Reflect upon itself! Now that is true irony. You can snag a copy over at the Red Gate site.


Today, the layout on the homepage of the popular private file sharing service Drop.io was altered and redesigned. The new interface has a more concise aesthetic with graphical excellence. Some of the options have been relocated, but no major changes in wording have been made. The rest of the site remains the same, and other applets, such as Tweet.io and Present.io, have not been affected. However, the new design may appear “squished” to some, but we will see how the large user base of this site responds.


ThinkGeek has updated the warfare category of their catalog with a new USB-powered missile launcher. Its perks: it has a built-in laser to guide the missiles, it has a very powerful software frontend, and most importantly, it offers an API!!! Finally, developers can terrorize others by coding applications that make use of the firing capibilties of the launcher. The API is built in .NET, so using it is a blast – a sample application is included, complete with raw C# code. And just because of said API, I am willing to slop down 40 bucks for this widget. You can find out more about the product and download the API for free on the product page.  It’ll be interesting to run the DLL through .NET Reflector, and if I find anything intriguing about the way it’s built, I’ll post it here. Have fun terrorizing people! :)




Calendar of Blog Posts

July 2009
S M T W T F S
« Jun    
 1234
567891011
12131415161718
19202122232425
262728293031  

My Del.Icio.Us Bookmarks

Blog Categories

Blog Stats

  • 2,869 hits