Ivan Porto Carrero

IO(thoughts) flatMap (_.propagandize)

14

Feb
2006

After One Month of Being Banned From Pc

I have been suffering from tendonitis and I found the time was come to take a break. So did my doctor who told me no pc for one month.. Well this has just been horrible because on top of not using a pc I was also banned from writing. In fact it was better to just not use or move my right hand completely.

Uhm, I failed ;-) The writing no problemo I hardly ever write on a piece of paper (Save the trees !!!). The not using my right hand, well i interpreted unless you absolutely have to, because even now I still can’t roll a cigarette with only my left (bad) hand.
The not using a pc .. let’s say : Hello Dragon Natural Speaking. That’s the name of my new friend :)  It took a while before it recognized my english, I’m suffering from a bad accent, somewhere between German and Dutch I’m told.

But programming C# or Javascript with natural speaking is not what you want to do, so my pc usage was limited to writing English mails and having English chats or skyping to some the friends.

Anyway I’m back in action now and am not planning to take a break for some time to come.

 

08

Jan
2006

Can’t Remember the Connection String ?

There is a website out there that remembers them for you. I’ve used them on multiple occasions because my memory for these things seems to be in need of a reboot

Anyway here’s the url : http://www.connectionstrings.com/

07

Jan
2006

Compressing Your ASP.NET 2.0 Pages

After installing Dasblog I had problems with the compression module of Ben Lowery.
In .NET 1.1 I had exactly the same problems.  No output was generated to the browser.

I dissected his code and found that it could be greatly simplified, so i decided to rewrite it to a .NET 2.0 version.

The first thing that needed to be done was rewrite the configuration, next get rid of all the inherited streams that were there for no reason in my opinion but to add some headers to the stream. I decided to hook them, the headers, up after I was sure that everything was compressed ok.

In the blowery module you can provide paths in the web.config that need to be excluded and this works well as long as your app is running on a virtual directory and not on a website. If your page is www.foo.com/default2.aspx that needs to be excluded his parser returns efault2.aspx so I changed that to work properly as well.

I’ve provided a zip with this post that contains the module, which you can use freely as long as you leave the copyright notice intact. If you have any questions do not hesitate to ask.

HttpCompress.zip (34.48 KB)

05

Jan
2006

Switched Blogs Today

I changed blogs today. My new blog can be found at http://www.flanders.co.nz/blog

Together with the blog I also built a new site.. The only thing that is left to do for me is to migrate the posts from geeks to the new one.
This blog will allow me to post zip files with projects to go with the posts about coding that I do.

I really love .NET 2.0 everything goes pretty quickly. To build my new site I spent about 14 hours that is for designing, lay-out in masterpages, sql database and content input. The site is bilingual so when dutch people hit my site they get almost everything in dutch and the rest of the world gets it in english.

 

04

Jan
2006

Webresource.axd. How Do I Use It ???

Ever since I got my hands on .NET 2.0 I noticed the handler webresource.axd which seemed to provide a similar function as what I was using handlers for. 

I used handlers in .NET 1.1 and before today also in .NET 2.0 to handle my javascript and css that I need in controls I developped.
I mark them before compiling as embedded resource and then later on read them out via reflection and they get served up by the browser.

I probably don’t have to explain that (as long as your parameters don’t change) this scripts get cached by the browser so they will only be downloaded once and re-used afterwards.

Well in asp.NET 2.0 there is a feature that uses webresource.axd to handle all kinds of embedded resources (images, pages, etc…)

Nikhil Kothari has a post on how to use them in his blog, and I just copy pasted the text below.

Using Web Resources
Imagine I am writing an HtmlEditor control and I want to use a stock bold button icon. Here’s what I’d do:

  1. Embed “Bold.gif” as a resource with the same name into my control’s assembly.

  2. Mark it as Web-accessible via the attribute:
        [assembly: WebResource("Bold.gif", ContentType.ImageGif)]

  3. Use the GetWebResourceUrl() method on Page to get a URL that can be rendered out to the client.
        boldButton.ImageUrl = Page.GetWebResourceUrl(typeof(HtmlEditor), "Bold.gif");

This results in a URL of the form:
    WebResource.axd?a=MyControls&r;=Bold.gif&t;=632059604175183419

04

Jan
2006

WebDav Exchange …

I live in new zealand.

I can successfully create appointments in exchange using webDAV.  But I can only create them in the timezone Z if I change the timezone to Y (which is mine) I always get bad request.

Do I say ok.. so not during string conversion but I just calculate the offset and add that to the date and create the appointment then that should be ok. Also not !!!

My conversion function is very basic but i didn’t find a way to get it properly formatted in .NET so this is my way. The function below ends with “Y“ and this doesn’t work, when I end it on Z it does work. Any suggestions ?

All sorted now.. instead of passing on the timezone I should replace the Y with the offset of the timezone to +13:00 in the new zealand case.

string

formatDate(DateTime input){

return input.ToString(“yyyy-MM-ddTHH:mm:ss.fffzzz”);
}

**** 

04

Jan
2006

Run vs 2k5 Webserver From Everywhere

The built in webserver from Visual Studio 2005 is great for locally quickviewing asp.net websites.
I always thought it was a pitty that I had to start visual studio for it.

Today I came accross a blog of a guy who wrote a small shell extension so you can right-click any folder and choose run asp.net 2.0 website from the context menu. It will run the webserver on that folder. How easy do you want it ?

Read more about it here :
http://weblogs.asp.net/rmclaws/archive/2005/10/25/428422.aspx
http://weblogs.asp.net/rmclaws/archive/2005/10/26/428600.aspx

Download here :
http://www.interscapeusa.com/downloads/download.aspx?file=WebServerHere_v1.msi

04

Jan
2006

Rss Parsing

As mentioned earlier in this blog, I am building a rss program together with http://datafreakz.blogspot.com

Right now we have about 100000 feeds from this feeds I had before the weekend about 5000 that failed. Now most of these feeds were valid rss although my google sidebar doesn’t parse a lot of them either.

Then I’ve noticed that lots of people never took the time to read the specifications and dump whatever they like in an rss feed.
Furthermore there are a lot of people including w3c and ms that put stylesheets in their xml.  Up until last week (because I had a parser that seemed to parse a lot of it already), I was one of these people that thought that just using the System.Xml.XmlReader would be enough and that I would get everything on the first pass through my xml.

Now after the weekend I’ve figured out that it takes 3 passes, that is 3 different ways to get the xml in my program to parse almost everything. The next problem that shows up are feeds that do exist, but their hosts are pretty slow in resolving the domains etc.. so I will be needing some retry mechanism.  The idea behind our system is that we want to be able to parse every valid feed from the internet.

I’ve got the different encodings sorted now.

One of the feeds that bounces the first time :

http://presscenter.org/repository/rss/nl/Ext_102110_5.xml

And this one doesn’t want to parse yet :

http://www.musicalfan.be/rssfeed.xml

probably because of its description field in a few posts.  but I do read feeds with html in them that is what I find so strange.. I don’t know why this one doesn’t want to parse.. for now. ;-)

Always I will appreciate ideas…. I can’t show you my code for my parsers but it is based on the xml reader class, too which you pass an encoded textreader. at least the first try parser.  I parse more feeds than Rss.NET and I parse more than rssbandit or rssfeeder.net But I want to be able to say that I parse about 99,99% of the feeds out there.
I don’t want to use serialisation because of the performance overhead.. If you need to parse 100 000 - 300 000 feeds every bit counts ;)  And once we open up for the general public it will be even more feeds.

When everything will be finished online.. probably I will be providing a vs2k5 add in and outlook add in.

04

Jan
2006

MS Antispyware Doesn’t Do Its Job

I had a discussion with my friend Miel (Coolz0r) about spyware and their scanners for it. 6 months ago I did a test of several anti-spyware programs and MS antispyware became the winner. It found the most spyware and what I liked most about it was that it provide everything that Ad-aware and Spybot supplied all together. This and the spynet option.  But in 6 months a lot can change and now I have whenU on my machine together with some other heavy duty spyware.  More on the reasons for this you can find in the link below

_

http://blog.coolz0r.com/posted/microsoft-antispy-downgrades-claria-apps.html

_

So the search for a good, free spyware cleaner goes on … I’ll post more when I’ve found one.  If anybody has a recommendation please let me know, because spyware me-no-like.

To top