<2005 December>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

On this page...

Search

Links

Member of...


ASP Insiders

MVP Visual Developer ASP/ASP.NET

Enter CodeZone

Blog Categories

Microsoft

Blogroll

Deutsche Resourcen

Management

Sign In
 

#  Tuesday, 06 December 2005

Verity Stob has a new home (mentioned her book in my blog entry PDC05: The Books). That her column would go online on Reg rag premises was to be expected as announced here, however, I didn't quite expect El Reg to launch a developer site.

Categories: Newsbites
Tuesday, 06 December 2005 09:56:49 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 05 December 2005

Today, a member of our German .NET community asked if it is possible to programmatically query the Google page rank. He had seen it done in PHP (here on the Google Community site), but didn't have time / PHP skills to translate it. All I found on a rather shallow search was PullRank, which I'd describe as non-fit for server use.

So I decided to set out to convert the PHP sample. Being PHP-challenged myself, I decided to give the PHP to ASP.NET Migration Assistant a shot. Whoha! That converted code is the most convoluted contraption to be called code I have seen - ever. I tried to get it to run, but failed because the conversion left me with some loose ends.

Instead of giving in, I contacted Christian Wenz to lend me a hand because he has some PHP experience. He thankfully hosted an "annotated" version of the PHP script so I could look at the output of various stages to test my solution with known-good values. That was most helpful.

Instead of doing a Web site demo application with everything intertwined, I split up the project into two - GPRDotNet being a DLL assembly project you can reference in any type of .NET application (Windows Forms, Web Forms, you name it), as well as a simple Web frontend to demo the usage: DemoSite.

Querying the page rank is really simple - the following snippet is the code from the "Check PageRank" button event handler:

protected void doCheckPageRank_Click(object sender, EventArgs e)
{
  GooglePageRank pr = new GooglePageRank();

  string url = webSiteUrl.Text;

  try
  {
    string rank = pr.GetRank(url);
    thePageRank.Text = rank;
  }
  catch (Exception ex)
  {
    // this is rather chatty (telling the end user everything *IS* a bad idea)
    thePageRank.Text = "Requesting the page rank failed. Reason: " + ex.ToString();
  }
}

I want to emphasize that the code for the GooglePageRank class is a rather quick & dirty port of the PHP code and that it does not contain the necessary error handling you would expect for a server-side library. After all, it is just a proof of concept for our community.

Finally, here is the source code: PageRank.zip (26.89 KB)

If you find errors, please leave a blog comment so others know about improvements. Thanks!

Categories: .NET | 2 Ohhhh | ASP.NET | C# | Community | this | Use the source Luke
Monday, 05 December 2005 19:03:00 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Sunday, 27 November 2005

Next week, I will be in Rosenheim, Germany for the ADC 2005. I'll be teaching the Visual Studio 2005 Team System Hands-on workshop (Tuesday as well as Friday), plus doing two talks during the main conference: IIS 7 and ASP.NET 2.0 Health Monitoring. See you there!

Sunday, 27 November 2005 23:01:00 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 17 November 2005

Wired is running a story by Bruce Schneier: Real Story of the Rogue Rootkit. Spot on.

Categories: Security
Thursday, 17 November 2005 19:07:38 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 16 November 2005

Lunch breaks always tend to end up being cut short by stupid ideas, today by my insistence to use My (from Visual Basic) in C#. To get up to speed on My, I suggest looking at Development with My in the MSDN library. The class diagram graphic will come in handy later on.

Step 1 is to reference the Microsoft.VisualBasic.dll assembly:

Next, we need a couple of includes:

using Microsoft.VisualBasic.ApplicationServices;
using Microsoft.VisualBasic.CompilerServices;
using Microsoft.VisualBasic.Devices;
using Microsoft.VisualBasic.FileIO;
using Microsoft.VisualBasic.Logging;

Why those and not Microsoft.VisualBasic.MyServices? Well, My is just an amalgamation of various classes that live in those namespaces: Computer, Audio, ... All the stuff you saw in the class diagram in the article Development with My.

Basically, you now have the functionality provided by My, but not as nicely grouped with a My object as in Visual Basic. To achieve this, have a look at the article C# My Services by Gildeoni Santos, it sports a download for wrapping My. As the code (at the time of this writing) is based on Beta 1 bits, you will have to put in the correct namespace references and pull the My prefix on all class names.

Categories: .NET | C#
Wednesday, 16 November 2005 13:10:40 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 14 November 2005

You need: Visual Studio 2005, IIS 6.0 and Visual Studio 2005 Web Deployment Projects (Beta Preview). Of course, the .NET Framework 2.0 should be installed.

The site has one simple page: Convert.aspx (C#, separate code file):

As you can see, this page is being run with the ASP.NET Development Web Server. Also works fine with IIS 6.0.

Next, let's add a deployment project to our Web project:

Build it, and in IIS, create a new application and map it to the Debug directory. Execute the page:

Oopsie, what the hell happened here? The answer can be found by digging into the Temporary ASP.NET Files directory:

Let's have a look at the generated vs precompiled assemblies in ILDasm:

So what's the difference? Well, it happens that by default on-demand compilation and precompilation behave differently in the way the pages (page classes) are stitched together. In one case we have a quasi-random name, and in the other we have the class name as it was set in our Convert.aspx - Convert. And this rather obviously clashes with System.Convert (I have a certain talent on picking about the single problematic name).

Why is the Convert name retained? Look in Property Tabs for the deployment project:

By default "Allow this precompiled site to be updatable" is checked - which after all is very useful. But not in this specific case where my Convert class clashes with System.Convert...

Categories: 2 Ohhhh | ASP.NET | Visual Studio
Monday, 14 November 2005 14:59:58 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 

In my blog entry Crashing Visual Studio 2005 for Fun I described how to crash Visual Studio 2005. Scott Guthrie followed up, and since then I was in permanent contact with team members. After some research, it turned out that it (a) was seemingly reproducible only on my machine, and (b) likely a tooltip issue.

What is going? Well, my machine is equipped with a Matrox P750 and has three monitors attached, spanning a single 3840x1024 "display". This strechted single display is managed by Matrox PowerDesk-HF, and it comes with a couple of desktop settings to make applications play nice on three physical monitors. One of those options is "Prevent tooltip spanning in strechted mode":

What does this option do? Imagine that I have an application full screen on the middle monitor - without that option turned on, tooltips "overflow" to the monitor to the right (you only see the background image in this screenshot, but that is the 3rd monitor):

Now guess what - once I turn that option on, VS05 crashes the way I described in my previous blog entry. It took me a couple of reboots, configuration from scratch and quite some testing to finally figure out the root cause for this crash.

Categories: 2 Ohhhh | ASP.NET | this | Visual Studio
Monday, 14 November 2005 13:23:40 (W. Europe Standard Time, UTC+01:00)  #    Comments [2]

 



#  Sunday, 13 November 2005

This week I got started and I implemented a C# to VB.NET conversion. Today, I added VB.NET to C#, as well as C# / VB.NET to Boo. You can find the new converter at this URL:

http://developer.sharpdevelop.net/codeconvert.net/

In addition to the "usual" Web interface, I also added a Web Service. This enables you to remotely exploit the code conversion features of #develop. For example, in a Windows Forms application:

It behaves exactly the same way as the online converter. To get you started, the following download contains both the executable (in the bin/release folder) as well as the source code for the application shown in this screenshot. Have fun, and please don't forget to report conversion errors so we can improve the underlying NRefactory!

CodeConvertServiceClient.zip (38.57 KB)

Sunday, 13 November 2005 21:11:00 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Saturday, 12 November 2005

When I saw this "interior design" store named Avalon in Valle Gran Rey, La Gomera, I had to take a photo:

Quite fitting for Windows Presentation Foundation :-)

Categories: this
Saturday, 12 November 2005 17:17:12 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 10 November 2005

I just finished a Web-based C# to VB.NET converter for .NET 2.0. It took me about half an hour and 20 lines of code. How come? Well, Daniel (#develop 2.0 PM) did a video on NRefactory, which is at the heart of #develop's parsing infrastructure. I took some of his demo code plus some of #develop's internal code converter, and put it into a ASP.NET 2.0 page. Presto, that easy if you can stand on the shoulders of giants.

Oh, and I actually put it online, here is the link: C# to VB.NET converter (you can find the source code for a simpler VB.NET implementation of the converter here).

Categories: .NET | 2 Ohhhh | ASP.NET | C#
Thursday, 10 November 2005 20:22:24 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



© Copyright 2017 Christoph Wille

newtelligence dasBlog 2.3.9074.18820
Subscribe to this weblog's RSS feed with SharpReader, Radio Userland, NewsGator or any other aggregator listening on port 5335 by clicking this button.   RSS 2.0|Atom 1.0  Send mail to the author(s)

 
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.