Sunday, December 30, 2007

Word + Blogger + HTML = Bad idea!

A quick post-post: The previous post was written in Microsoft Word 2007, and published through the same. I spent more time fixing layout errors and HTML stuff than writing :-(

How to make the compiler do your work

Before Christmas I spent a few weeks on a school project in computer science. The choice of technology was up to us, and I naturally took the safe path of .NET and C#. I used Visual Studio 2008 as IDE, as it had just come out, and I wanted to try it out. I also wanted to test C# 3.0, which the new IDE of course facilitated. Later I came to think that my team and I wanted to have the solution running on a web server, so the examiners would be able to see the actual prototype working. As I didn't have any options for running the prototype on a .NET 3.5 server, I had no choice but to make the solution .NET 3.0 compatible. This is no big thing in Visual Studio 2008 – you just change the target framework and recompile. Naturally a lot of compiler errors emerged. But to my surprise, they were all related to references to .NET 3.5 specific assemblies, and not my actual code! This got me thinking, and investigating.

I used "simple properties", which is an easier way of writing simple properties with no get/set logic, other than setting a backing field's value or returning it, a lot. When you write them in C#, it looks like this:

Simple properties

What happens when above is built is that the compiler generates the get_Id() and set_Id(int value) methods as before, but then also generates a backing field that reverse engineered looks something like this:

Backing field

The funny thing is the naming of the generated field. Note the < and > symbols; they are used in order to avoid C# code accessing the field! If I try to get access to the field from a C# method, I will get a compiler error, as < and > are not allowed in the context.

The full property will look like this after being compiled:

Compiled property


I never thought of this, but as all the features of C# 3.0 are "syntactic sugar" changing the target framework while keeping the C# 3.0 compiler, I can have all the features, even though everything is compiled to C# 2.0! Great!

Oh, and by the way: Note the [CompilerGenerated] attribute. I want all of my compiled code to have that!

Wednesday, October 24, 2007

The web, and what will happen to it

I've received a comment on a previous post, and when I began answering it, I found that I might as well make it a full post.

NewsBlaze says that in reality there is a large majority of surfers on the web that is using Internet Explorer. And by looking at statistics, he's right.

What I was hinting at was more a researchers stand – trying to acknowledge the present, but focus more on how to improve the state of things. As we all know the number of devices that enables us to be online has increased dramatically, and continues to do so. Judging by the massive awareness and demand for these devices, and my own experiences, there has been a huge demand for some sort of hardware, other than a computer, that could run “advanced” applications such as e-mail clients and calendars. And the need for syncronization between all theses devices is growing with the change.
But then comes the notion of the “never-ending-network”©, meaning we can be online everywhere. If everywhere we are, we are able to connect to some sort of network, or in another way be online, what do we need apps and sync for? Shouldn't we rather use web apps to provide us with the information we need? If (when) we get to this point, it's essential that every web site/application displays and behaves the same across all devices, computers, projectors and event printable medias.
Implementing the above is quite a challenge, but I'm sure there will be soend a lot of time on it in the future. Especially now that Adobe is working on this new range of breathtaking application frameworks engines, including Flash (ActionScript 3.0), Flex, LiveCycle and AIR (Adobe Integrated Runtime). And now that Microsoft has joined the battle for RIA's (Rich Internet Applications) with the release of Silverlight. And now the comming of Web 3.0 is being discussed. I sincerely hope that the above mentioned technologies will mature over the next couple of years, and then take over! By saying they need to mature, I mean that they still have a lot of issues, regarding the very topic of this post – clean website structure/markup – which need to be solved. But that is another post, maybe some oher day...


Anyway, NewsBlaze, I hope you can follow my chain of thought. I'm a firm believer that we will see a situation similar to my “never-ending-network”© theory, and just want to start thinking about it, and having other people thinking about it.

Friday, September 28, 2007

Javascript repository

I've decided to document and share the standard javascript functions, I use for my web development.
I've only just decided it, so for now there are only a few files ready - but the repository will gradually expand...

You can find it here:
http://www.blizan.com/repository/javascript/

Friday, September 07, 2007

How did I not see that?

I had a nice experience today. I have been developing a website that uses the native ASP.NET 2.0 provider model. To save time I've just installed the default provider implementations for the MembershipProvider and RoleProvider and am using them.

So now I am in the process of creating an administration-system for the entire website, including the providers, and found myself having an insane bug/error. I had two users in my database, myself and a test person (Hans Hansen). When I updated the users everything was fine, unless I wanted to change the users' roles. If I was editing my own user it worked. If I wanted to edit Hans Hansen, however, the app crashed. The error message was something like: "Cannot update user name ''" (empty user name).

Now, I am pretty sure the user name isn't empty, so I began debugging. After about 2 hours of hopeless looking through code (even the ASP.NET provider stored procedures!), and plenty of theories about the origin of the error (including one or two angry thoughts to Microsoft), I developed a theory. What if the user name was required to be minimum 3 chars? Hans Hansens ("hh") was only two, but my own ("mgj") was three, and for the latter everything worked! Well, I changed "hh" to "hah", and suddenly everything worked! So now I'm thinking, that Microsoft is behind the error, and begin looking quite deeply into their stored procedures looking for the unwanted feature.

After another hour down there, I coincidentally passed the [aspnet_UsersInRoles] table, and lost my jaw. I had finally found the problem. In the aspnet_UsersInRoles table, a previous test user had not been deleted. And he happened to have the same username as Hans Hansen ("hh").

So, in the words of Sting, "I hate to say it, but it's probably me"


Note to self: Make sure test environment isn't corrupted, before pointing fingers!

Thursday, August 16, 2007

iPhone compatible websites

Eric Meyer has a great post on website compatibility and the classic "This site is optimized for ..." comment.
http://meyerweb.com/eric/thoughts/2007/08/08/the-veterans-charge/

And I think every word he writes is correct. Escpecially nowadays where more and more browsers, for Mac, PC and a large number of other devices, are beginning to cling on to the market. The "browser-wars" is still flaming hot, and the Internet Explorer army is not as strong as it used to be.

But I would like to further extend Eric's post, and say that even though you can view a website optimized for something weird on other browsers it isn't always that pretty. And sometimes a layout can be so buggy, that you have trouble getting the information you're looking for. And that's wrong too!
The Internet is for sharing information with everyone, not the people with the same browser as you. Therefore, I say, Webdesigners/developers: Please make the effort to create websites for more than your own browser!

Tuesday, August 07, 2007

The replacement has been found

Okay, so the aoa.dk domain name has been sold, as I mentioned earlier, and the new domain name to take it's place has been found: www.AoA.nu

Not a very drastic change but still a change...

Be sure to check out the relics section - that's where we're putting all the classic stuff. A lot is already out there, and more will come as we dig deeper into our hard drives in search of fun stuff that previously has been a part of out aoa.dk website.

I also have some more news, but you'll have to wait for that a bit longer...

Wednesday, August 01, 2007

”The Torben Nielsen affair” or ”How aoa.dk suddenly was something else”

Well – I hadn't thought about this ever happening, but it did. We've sold the domain "aoa.dk".

We bought the domain, the infamous MC T and myself, a long time ago, when AoA still wasn't too big to hang out with "The Sailors". Since then, a lot of things came to life there. Of course there has always been some sort of band website there, hardly informative, but damn pretty! Furthermore, the domain has suffered the fate of the following selected list of websites and applications:

  • AoA Fan Crib (a website for fans of AoA)
  • AoA Empire (the place from which everything stems)
  • Ravage's official website (at ravage.aoa.dk)
  • Forum and booking system for "Bjarnes kantine"
  • Poker show down
  • The well-known "OC-event" for VIP's
  • The "Konflikt" flash picture art book

And a lot of small stuff, not woth wasting time on.

I still have most of these things on my local machine, and I promise I will put all of it online, as soon as I get the chance...


 

The lucky new owner is a man known as "Torben Nielsen", who, with a friend i believe, are establishing some online community. Looking forward to see what that develops into. His price was hard to decline, so we let it go. Knowing that we would always have the memories of aoa.dk as a place of good music, friendship, everything important to everyone. Remember: We're here for the beer.


 

Anyway, AoA isn't dead, and we will bounce back with a new domain soon! So stay tuned – it might be radical, or it might not...

Thursday, July 26, 2007

Request.What?

I've experienced some confusion about the various Request properties that holds information about the current location. For example, what is the difference between Request.Path and Request.RawUrl? Well, if you're like me, check out the table in the pdf document below, which gives sample output data for a website that runs on the VS 2005 development server (Cassini). This website is locally placed at "C:\Websites\Website1" on the server.


The table can be found here: Request properties.pdf


Hope it's useful!

Saturday, July 21, 2007

What is a boy to do?

Well, I'm back from the wild (Roskilde Festival and scout camp) and have just gotten used to a keyboard again.

I haven't been wasting my time since I got back however. I've been reading the Microsoft BizTalk Server 2006 white paper, and found it quite interesting at first. But then it suddenly hit me. How am I going to gain experience with a technology I can't even install?

First the short story about BizTalk server. It's an application that can integrate various business apps, such as ERP or CRM products. The problem is, I have no applications to integrate! The way I see it, I can only gain experience with BizTalk by coming across it in some company at random.

But anyway, I'll read the paper to end, and have it in the bag, just in case. Next I'm going to get acquainted with Sharepoint I think. It's a looong summer holiday :-)

Thursday, May 31, 2007

XSLT is definetly the way to go

Lately I've been working on a project for at customer, when I was able to get away from all the things happening at CBS.
The project is a very complex website, build on top of the open source CMS and web site framework, umbraco.
The important thing here is, that umbraco relies heavily on XSLT for formating and rendering custom modules. It's been a while since I've had the opportunity to develop things with XSLT, anyway, I almost forgot just how nice it is... In little time, I made a functional dropdown navigation, a vertical navigation tree, a list of media from umbraco, a sitemap, breadcrumbs and a dynamic title-tag for the HTML page.

Lovely :-)

Wednesday, May 16, 2007

Preparing a career

Lately I've been registering profiles at several jobsites. I've been thinking that I will soon need som sort of job, and have therefore been keeping an eye out for openings in newspapers and on the Internet.

Some of the places I've created a profile:
http://www.linkedin.com/in/madsgodvin
http://www.kommunikationsforum.dk/Mads-Godvin-Jensen
http://www.it-jobbank.dk/ShowProfile.aspx?ProfileId=50141314

I'm mostly looking for consulting jobs. If you know of anyone looking for professional help regaring web- and/or software development, please let me know!

Monday, April 23, 2007

Something about ID3 tags

I've been wanting to research ID3 tagging of MP3 files, and have spent some time trying to read the tags using C# - without luck :-(

The streams I'm reading always seem to be flawed in some way. Well I've found an example where you use the shell32.dll Windows native library to read the tags. I'm looking forward to trying this out to see if it's me thats wrong ;-)

http://www.codeproject.com/csharp/ShellID3TagReader.asp

Sunday, April 15, 2007

Could not load file or assembly

I've started developing a website for a client, and have made some extensions for Umbraco CMS, which I'm using as platform for the whole thing. Then suddenly, while working, my machine crashed totally, leaving me with no choice but to turn it off the bad way – ie. holding down the power button.

When the computer had started again, I tried running the site at 'localhost' again, but got this error message:

Could not load file or assembly 'Blizan.Tools' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

Not knowing how to fix it, I found a few solutions via Google, but they where quite extensive. One forum said I needed to reinstall the entire .NET framework!

But then I had an idea, and it worked: Delete all the files in the "Temporary ASP.NET files" folder (C:\Windows\Microsoft.NET\Framework\%version%\Temporary ASP.NET files\root\)


Now I'm a happy working man :-)

Sunday, April 01, 2007

Testing Word 2007

Apparently Word 2007 has a "Publish to blog" feature, and of course I have to try it out ;-)

Interesting things to look at:

  • The HTML Word produces
  • Blogger support
  • The publishing process


 

So far I have only tried registering a blogger account in Word and writing som text (this text!)...

Friday, February 23, 2007

Mac and PC - a world of trouble

Now how can you ever have to operating systems collaborate when their founders act like this:

http://www.current.tv/pods/supernews/PD05440

Btw. "Finder" doesn't really talk like that.. In fact it doesn't ever talk as far as I know....


Update: The link was pointing at the wrong film...

Thursday, January 11, 2007

It will Zune be over...

Hellow


At the local bar a while a go, the most exciting thing that happened was talking to an "old schoolmate" about an interview with Steve Ballmer of Microsoft about the Zune MP3 player. He made me promise I'd post a link to the interview and then I forgot all about it.

Today, however, I was reminded, so here it goes:
http://news.com.com/1606-2_3-6129533.html?tag=cnetfd.mt


Try closing your eyes the first time you see it, and tell me if it's a man or woman that's conducting the interview ;-)


Other fresh and exciting things: My exams for the first semester are per today at 13 o'clock over! No more managerial economics for me...