help.net


Musing on .Net

News

Windows Phone Apps

FotoBank


FotoIreland

Windows 8 Apps




hit counters






Open source CMS


My blog

Irish blogs

Locations of visitors to this page Get Chitika eMiniMalls

.Net useful

Blogs I read

PocketPC

SQL

Usability

April 2003 - Posts

Fragmented disk

I develop my projects on a brand new high specs laptop that I have since one month.

Finding it now very slow, I checked it with Norton Speed Disk, and guess what, 72 % of fragmented data !!

For me this is a record. It seems that most of the fragmented files are MSDN or Visula cache stuff.

I wonder what I am going to discover on my production server ;-)
Posted: Apr 30 2003, 10:01 AM by help.net | with no comments
Filed under:
Default button

I was looking for a solution to this issue:

How to assign a button to the Enter key ?

Well thanks to usergroup list, this one come very handy.

http://www.metabuilders.com/Tools/DefaultButtons.aspx

Posted: Apr 30 2003, 09:39 AM by help.net | with no comments
Filed under:
Cookies... Eat me

Just another note on cookies, about the way to delete them.

Because you can't have access obviously to the user disk to delete your cookie, you have to do something like this:

Response.Cookies("MyCookie").Expires = DateTime.Now.AddDays(-30)

Great, it works but not immediatly. So I suggest that you write again the cookie with empty values to really empty the cookie before it disappear.

I had to do that because the clipboard function I use is a panel visible or not.

So if I delete the cookie, and the user make visible the clipboard very quickly, the cookies values are still there. Emptied it solved the problem, well for me.


Posted: Apr 29 2003, 11:35 PM by help.net | with no comments
Filed under: ,
Mmmm ... Cookies


To be honest, I didn't used really cookies on a project since a very long time, but in Scoilnet, the education portal I am building for the Irish government,
here we go, I need it.
I had to implement a neat feature to let users, mostly teachers, keeping in a 'clipboard' some resources(HTML documents) for a certain period of time.

And indeed retrieve the content of their clipboard when they need it, today or in 10 days. Add to these requirements that they don't login to access the site, and., correct me if I am wrong, cookies ready to cook !

I remember vaguely that cookies implementation before was a piece of cake (sorry I couldn't missed this one;-)), so because .Net rocks, it would be easy.
Not so easy, indeed. It took me few hours to figure out how to make this working properly.

I discovered that when you write some values to a cookie, you need to check if the cookie exist to avoid an exception error.

Great, but when you write something like if request.cookies("Mycookie") is nothing then... you enter in a mysterious world.

To be more explicit, you have with .Net 2 types of cookies, the session one, and the persistent one. The first disappear when the user do the same, and the second stay on the user disk. The difference is just a tiny property Expires. If you pass to this an expiration date, it's persistent, otherwise not.

The problem, is when you do a test to check that the cookie is there, .Net for a reason which elude me, create the cookie, but with a null expiration date.

Yes you just guessed it, it's a session cookie. And now everything you can write in your cookie after that are not written to the disk, believe me I spend sometime to discover this.

In some scenario, it could be worse, if you use a watch in VS.Net, you create again this fugitive cookie.
The incoming (Request) cookie carries an Expires date of DateTime.MinValue, regardless of the date attached to the cookie on the client system.

Read this clever article on CodeProject to know more about this problem and a solution.

So my little solution is this one, I admit unclean, but unfortunatly not too much time. I am sure someone has a better explanation, but cookies and .Net are not the best ingredients for a good recipe.

' MyNewValue contain the name of the file the user want to add to the clipboard

Try

'// I use HasKeys to check that the cookie has some subvalues

If Request.Cookies("MyCookie").HasKeys then

Dim Myfilename as string = Request.Cookies("Mycookie")("filename").toString
Response.Cookies("MyCookie").Value = "clip"
Response.Cookies("MyCookie").Expires = DateTime.Now.AddDays(45)
Response.Cookies("MyCookie").Values.Add("filename", MyFileName & "@@" & MyNewValue)

Else

Strangely I was hoping that HasKeys will throw an exception if the cookie doesn't exist that's why I used the Try Catch, but sometime it does,
sometime not, and I am not yet sure why. This is why I add this Else repeating the same code. Unclean but it works !

Response.Cookies("MyCookie").Value = "clip"
Response.Cookies("MyCookie").Expires = DateTime.Now.AddDays(45)
Response.Cookies("MyCookie").Values.Add("filename", MyFileName)

End if

Catch ex as Exception

Response.Cookies("MyCookie").Value = "clip"
Response.Cookies("MyCookie").Expires = DateTime.Now.AddDays(45)
Response.Cookies("MyCookie").Values.Add("filename", MyFileName)

End Try


To read the cookie values, I just have to split the value from the cookie and write the result by a label for example:

Dim MyFileList as string() = Request.Cookies("Mycookie")("filename").Split("@@")

Posted: Apr 29 2003, 11:21 PM by help.net | with no comments
Filed under:
GeoBlog


Hey Christophe, this Geoblog stuff is pretty cool.

I just wonder what's going to happen in case of success. It could be a little bit messy all this blogs popup from everywhere.

But it's really a feature to learn about the real world linked to the superficial world of Internet !

I like this idea of global Cafe du Commerce, with everybody talking about everything.

Come on Scott, I am sure this will be on the next update.

Oh God I like blogging :-))

UPDATE:

Oh better than better, I just found another bloke who blog here in Ireland.

Amazing, almost my neighbour. Well kind of, he's in Cork. But this tool, man, is really top of the top.

Because It's a Flash world map, you can also zoom in. Useful to separate closer dots on the map.

I know, I am still a kid who never grew up, but hey whatever !

Posted: Apr 28 2003, 09:49 PM by help.net | with no comments
Filed under:
En attendant Bill

Julie replied to my comment on Bill blog:

So Paschal. If you refer to Bill Gates as God, then who are you referring to here as Jesus?

Nice one Julie. Of course I can say Scott for opening our can of blogs, but it was more something like Jeez !
Posted: Apr 28 2003, 09:41 PM by help.net | with no comments
Filed under:
Apple enter the music business

 

So that's it Apple move in the music business, after Microsoft few months ago who announced some interest with Hollywood ! Not sure about the 200 000 songs origin, but it could be coming from Vivendi Music bought by Apple. Anyway no mention of that on their site.

The iTunes Music Store

Read on Techdirt:


In one of the worst kept secrets coming out of Apple in years, today they
announced their own downloadable music service, with deals with each of the major record labels so that they have 200,000 songs to offer at $0.99/song. My initial reaction is that this is a step closer, but it's still not there yet. This is really a "me too" music downloading system, patterned on previous (failed) attempts to do the same thing with only minor improvements. First, the number of songs isn't nearly high enough (though, of course, that will improve), and the price is still too high. What the service does right is let people move the songs to an iPod (which you would expect, of course) and let people burn songs to a CD as many times as they want. The service is currently limited to Apple machines, but that will change with time. The bigger issue is that this absolutely takes away the benefits of offering music online. First, music sharing applications let people discuss, sample, share, and discover new music. Forcing people to pay $1/song doesn't encourage me to explore new music at all. Second, by making a distributed peer-to-peer system, distribution costs are dropped to next to nothing. So, this is a nice step for the music industry, but it's still missing the point. People are coming out saying that this will change the music industry - but I don't see that just yet. The only real "innovation" here (and it's incremental) is that you can burn the songs you download to CD.

The other new stuff is the Ipod 30 Gb

 

Posted: Apr 28 2003, 09:28 PM by help.net | with no comments
Filed under:
Web deployment

My project Scoilnet start now to be big, and I am confronted now with deployment issues.

I setup the firewall to let only port 80 connections accepted, so obviously I can't use any FTP upload.

I would like now to deploy only certain files and not as I am doing now, all the project.

I found the deployment with VS very handy, but is it possible to copy only certain files ?

I know already I can exclude from my project the files I don't want to copy, but now that seems impossible regarding the size of the solution.

Any idea about an add-in to do that ?
En attendant Bill

 


Jesus, God is blogging !

 

 

 

Posted: Apr 28 2003, 07:08 PM by help.net | with 1 comment(s)
Filed under:
wbloggar
Roy, to write your blogs which one you prefer , this one or this one ;-))
Posted: Apr 28 2003, 04:36 PM by help.net | with 1 comment(s)
Filed under:
More Posts Next page »