Archive for the ‘Mono/.Net’ Category

Missing MySQL’s REPLACE (aka MERGE) in PostgreSQL

Thursday, July 13th, 2006

When Synthesys first decided to go with PostgreSQL as the database for a large web application, I was very excited to get away from our usual reliance on MySQL and move to a real database platform.

Once we figured out the whole MySQL auto_increment vs. PostgreSQL SERIAL, the first thing we really missed in PostgreSQL was the REPLACE statement. I understand why its missing, and it is kind of a hack of a SQL statement (its not in a SQL standard).

Turns out in the SQL 2003 Standard there is a statement similar to REPLACE called MERGE. Despite PostgreSQL’s excellent support for standards, they have not implemented MERGE. I would guess it has something to do with the ambiguity of the statement.

At any rate I still love working with PostgreSQL, and for what its worth Npgsql is an excellent PostgreSQL connector for Mono/.Net. (Even in RC/Beta state)

Microsoft Creates SourceForge 2.0?

Tuesday, May 23rd, 2006

CodePlex.comI just read on OSNews.com that Microsoft created a site called CodePlex which appears to be identical to SourceForge.net. Evidently the point of CodePlex is to host and manage open source projects (as well as Microsoft’s shared source projects). CodePlex has a Wiki which looks like it will eventually contain useful information, but its pretty sparse right now.

For example, I can’t find what version control system it uses. The Wiki references some Team Explorer Client application which can be used to connect to CodePlex projects, but I’ll leave that up to someone else to play with.

This is obviously a direct competitor to SourceForge, which I must admit needs competitors, but who’s going to use this site besides Microsoft? From what I can tell its going to try and force you to use Microsoft tools and technologies at every turn.

My guess is that this will just house a bunch of Microsoft’s shared source projects as well as a few other projects from Microsoft partners and MVPs. I can’t imagine any self-respecting open source project actually migrating to a Microsoft controlled project management system.

(And what’s with the name? Reminds me a lot of Googleplex, which I’m sure makes Steve Ballmer happy.)

More ASP.Net 2.0 features missing from Mono 1.1.13.4

Wednesday, March 8th, 2006

After stripping out the SiteMap Provider, Membership Provider, and Role Provider, I discovered a few more ASP.Net 2.0 features that are missing from Mono 1.1.13.4:

  1. System.Web.UI.WebControls.BulletedList:Render is not implemented. That seems like an easy place for me to learn Mono hacking! We’ll see what happens…
  2. meta:resourcekey attributes aren’t recognized which seems strange to me since usually open source projects have excellent I18N and L10N support.
  3. And another showstopper: Mono/XSP2 doesn’t seem to support automatically loading/compiling files from App_Code. I kind of suspected this was some magic on Visual Studio’s part, but hopefully its something Mono can still implement.

“Fun” with ASP.Net 2.0 in Mono 1.1.13.4

Wednesday, March 8th, 2006

I tried to get the ASP.Net 2.0 project we’re working on at Synthesys running on Mono. The server runs Debian Linux Etch, and I use the following packages (some of them are preview packages):

  • mono (and related libraries) 1.1.13.4-0pre6
  • mono-xsp2 (and mono-xsp2-base) 1.1.13-1

xsp2 works beautifully, and seems to print out nice debugging information either in the browser on or the server when exceptions are thrown. Unfortunately exceptions are thrown a lot. Here are some of the differences between Microsoft’s and Mono’s ASP.Net 2.0 implementations that I ran into:

  1. Mono does not support Culture="Auto" (or “auto”). Switching to Culture="en-US" works, but isn’t desirable.
  2. CodeFile paths must be absolute from the root of your project. We had a MasterPages folder with a file that specified a CodeFile in the same folder with CodeFile="nameOfCodeFile.cs", but Mono wanted it to be CodeFile="MasterPages/nameOfCodeFile.cs".
  3. Mono seemed to want only integers for measurements in ASP.Net tag attributes that only accept pixel measurements. So “10px” needed to be just “10″. I’m not sure precisely which attributes this applies to as I just changed them all. (I know it does not apply to font sizes.)
  4. Mono 1.1.13 does not contain a definition for Page.Title, only Page.Header.Title. This appears to be fixed in the trunk.
  5. Page.Theme and Page.StyleSheetTheme aren’t supported in 1.1.13, but my new hero, Chris Toshok, just added them.
  6. So far not to bad, but now for the show stopper: my custom SiteMap implementation. A quick glance at Mono’s Class Status page shows SiteMap related classes to be almost done, but I still get the following exception:
    System.NullReferenceException: Object reference not set to an instance of an object
    in <0x0008d> System.Web.SiteMap:Init ()
    in <0x00007> System.Web.SiteMap:get_Provider ()
    in <0x0000a> System.Web.SiteMap:get_CurrentNode ()
    in <0x0000d> MasterPages_default:Page_Load (System.Object sender, System.EventArgs e)
    in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
    in <0x00117> System.Web.UI.Control:OnLoad (System.EventArgs e)
    in <0x00112> System.Web.UI.Control:LoadRecursive ()
    in <0x00161> System.Web.UI.Control:LoadRecursive ()
    in <0x001c4> System.Web.UI.Page:InternalProcessRequest ()
    in <0x000a7> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext context)

I have high hopes that the next release of Mono will improve ASP.Net 2.0 support considerably. Hopefully I can start helping submit bug reports and testing new features as well!

First CIS199 Class

Tuesday, January 24th, 2006

I’m teaching CIS199 Programming and Data Structures II as an adjunct professor at Greenville College this semester.  If you remember, I taught CIS210 Programming and Data Structures I last semester (Fall ‘05).

Now I know what you’re thinking:  Why is a P&DS II a 199 course while P&DS I is a 210 course?  You would probably also ask why CIS199 is only worth 3 credits while 210 was worth 4 (and in the past CIS211 has been worth 4).  Truth is I have no idea, and when I asked I was told this is just how it has to be.  My only guess is that the changes had to be made due to the small class size.

I’m teaching using C# again which I feel is an excellent language for both instructional and professional use.  It has tons of features, is cross platform thanks to Mono, and there are a number of great free IDEs for it.

Last semester I forced my students to use SharpDevelop 1.1, but since Microsoft Visual Studio Express Edition has been released for free, we may switch.  Using an IDE that does as much for you as Visual Studio may be taboo for Computer Science courses, but its very tempting because it really is such a nice IDE.  We’ll see if I fold or not.

My students are complete geniuses.  One of them is busy trying to rotate a square around a sphere in WinForms.  He’s implemented proper vertical and horizontal rotations, but trying to combine the two eventually skews the square.  Unfortunately I am absolutely no help to him when it comes to the math.

The Day I pwned Mono

Thursday, January 19th, 2006

I just spotted a bug in a patch submitted to the mono-devel-list that I just joined yesterday. It was a simple typo, but a bug nonetheless.

So, when do I get syndicated on Monologue?