mostlylucid

scott galloway's personal blog...
posts - 916, comments - 758, trackbacks - 11

My Links

News

Archives

Post Categories

Misc. Coding

January 2004 Entries

Is cheering on Viruses like cheering on Terrorists? Umm...not even close!

Read this on Cameron Reilly's blog: This says a lot about the intelligence of some of the folks on Slashdot. Are they having a joke? Perhaps. But cheering on a virus is kind of like cheering on a terrorist. Now I'm sorry, this is such a dumb statement, for me it's the equivalent of saying 'killing a cockroach is kind of like killing your mother' - the hype and over dramitisation of viruses in the media of late has really annoyed me.If you have a commercial virus checker (or even a free one like AVG Free), you will NOT have had any problems...

posted @ Saturday, January 31, 2004 12:02 PM | Feedback (0) | Filed Under [ Links ]

Motivation...

I fully admit I am a moody sod...I don't know how / why it happens but occasionally I have real difficulty getting motivated to actually get working. So, what do you do to motivate yourself to get coding (especially making syntactic / other 'cosmetic' changes to existing apps)?How do you get over the 'bump' between statring a project and really getting productive on it?Oh, and VS.NET is really pissing me off right now, why is it that it occasionally can't go into the 'Designer' mode of an html page - griping about the class being 'abstract' - which is especially...

posted @ Friday, January 30, 2004 2:18 PM | Feedback (0) | Filed Under [ Random ]

Very small tip...ViewState enabled properties

This really is a very quick tip...I think I got it from Fritz Onion's excellent Essential ASP.NET with Examples is C# (which I really recommend incidentally!). If you want to store a property which should persist using ViewState, you can save yourself a lot of typing and get (IMHO) cleaner code using this method:public int Test{get{if(ViewState["Test"] != null)return (int)ViewState["Test"];elsereturn 0;}set{ViewState["Test"] = value;}}So, there you go...short but hopefully useful - this is how I tend to work now...it also allows me to switch to session / cache persistence when necessary by just changing the little accessors...

posted @ Friday, January 30, 2004 2:11 PM | Feedback (0) | Filed Under [ Books Code Snippets ]

Me 1.1

Sorry I've been a bit quiet over the past few days...as I mentioned on Tuesday, I had a checkup at the Diabetic clinic on Tuesday...umm...well...let's just say it didn't go well - oddly an all pizza diet and no physical activity is not good for you! So, I've joined a gym (for those who know me, sorry for the shock...no choice). So, I'm currently trying to remember how to swim (haven't swam for about 6 years). Oh, also trying to get used to being in a room full of naked men (I'm not homosexual, so I find no particular thrill...

posted @ Thursday, January 29, 2004 8:22 PM | Feedback (0) |

Bugs in .NET !

Just noticed this on Stefano Demiliani's blog, lots and lots of bugs, some of them pretty interesting! I don't know just how 'verified' lots of them actually are:An interesting idea of Dejan Jelovic. This page represents a registry of known .NET bugs. You can use it to see if the strange thing you are seeing is a known bug, or to report a new bug that you just found. Known .NET Bugs IDDescriptionProbability*Severity*Fixed1Form refuses to close If a form A contains control B that contains control C that contains control D, and D is removed while it has the focus, the...

posted @ Tuesday, January 27, 2004 9:01 AM | Feedback (0) |

Good article on Codeproject - those wierd little images used to stop automated form submission

This would be pretty useful integrated into .TEXT - kill the problem of 'Comments Spamming' pretty instantly. The article also contained a link to The Captcha Project - which makes for pretty interesting reading,

posted @ Tuesday, January 27, 2004 2:02 AM | Feedback (0) |

Interesting...could this be the tiniest way to use Visual Studio.NET on the move

Just noticed this, not due for a few months yet - the OQO Personal Computer, not overly powered (a Transmeta 1GHZ processor, 256MB Ram and 20GB hard drive). But this might JUST provide a way to have a full Windows XP experience on the move (Pocket PC just doesn't cut it for me, and right now, lugging a TabletPC around just makes you look like a wanker). Anyway, here's a pic - looks pretty neat! Here's the link to the full specs

posted @ Tuesday, January 27, 2004 1:48 AM | Feedback (0) |

Trouble sleeping again...so links to a few 'interesting' articles & sites

I think I'm going through one of my bi-annual mid-life crises again. I really should be sleeping, I have a hospital appointment in the morning (just a diabetic clinic followup thing - 10 minutes and a lecture about my diet...great fun - and eerily similar to an ex-girlfriend). Anyway, whilst awake, I've been having a look at some articles around the web (so technically, keeping me awake has been looking at some articles around the web, but stop complaining - you might find some of them useful!)... One of the least talked about enhancements to Whidbey is the stuff they're...

posted @ Tuesday, January 27, 2004 1:34 AM | Feedback (0) |

Web Service Compression - really nice implementation of a Web Service Extension (with sample)

I've posted about this topic a few times, it's really nice to see that someone has finally given a practical, free method of doing this. This implementation uses WS-E to do this, meaning that you add an attirbute to both the client and server portions of your web service - and there you have it, a compressed SOAP message!If you're using Web Services and transmitting any non-trivial amount of Data, I really do recommend that you use compression on the SOAP message (especially if you're sending DataSets, those buggers are huge when serialized - of course you can minimize them in...

posted @ Saturday, January 24, 2004 2:32 PM | Feedback (0) | Filed Under [ .NET Performance ]

Aggressive Begging...the ASP.NET way

Now, I don't mean to be mean here; but on occasion (not mentioning any names for fear of being butchered), there's people who basically demand that I help them do their job. Let me explain; I hang out a bit in a few forums and newsgroups, as well as requests sent directly though this blog - now these are generally 'normal' requests for information / assistance on some specific aspect of a project with which someone is having a bit of trouble and needs a hand - fine, I have no problem with this, I spend quite a bit of...

posted @ Friday, January 23, 2004 10:00 PM | Feedback (0) | Filed Under [ Long & Rambling ]

.NET Passport on Windows Server 2003

There's an odd issue when you try to use Passport on Windows Server 2003 - basically, the default 'Secure Level' of Passport is 10, unfortunately if you don't use SSL this means Passport won't work correctly for you. In .NET this manifests itself as the Passport scarab showing you as logged in but if you try Context.Identity.User.IsAuthenticated, it'll always return 'false'. Now, I know what you're thinking, just change it to '0'...umm...nope, the default Passport Administration tool installed with Windows Server 2003 won't let you change this...and you can't (well not in any way that I've found so far) upgrade to...

posted @ Thursday, January 22, 2004 10:39 PM | Feedback (0) |

New Application Block - Authorization and Profile Block

This looks to be very useful indeed. Found it on the Devhawk blog. Here's some blurb from the page:Summary: If you are involved in designing and developing applications, you probably need to control how users interact with your applications on a case-by-case basis. For example, administrators, managers, and employees may need varying levels of access to your applications, and in some cases an individual user may have different roles in different applications. It is a significant challenge to enable this flexibility, particularly in situations where administrators maintain account information in different authorities and user databases.The Authorization and Profile Application Block...

posted @ Thursday, January 22, 2004 9:57 PM | Feedback (0) |

I knew it - finally proof that 'slepping on it' helps solve problems!

Just thought this was pretty interesting - from Slashdot:An anonymous reader writes "CBC news reports that the effectiveness of 'sleeping on it' when faced with a difficult task may have more than just anecdotal roots. 66 students were trained to perform a calculation on an eight digit number using two simple rules which would take seven steps to complete. A different method existed to perform the same calculation 'almost instantly', but was not shown to the students. After eight hours, where half the students were allowed to sleep and the other half remained awake, 60% of the rested and 22%...

posted @ Thursday, January 22, 2004 5:16 PM | Feedback (0) |

Another article in the offing...hopefully...if I get round to it...Member methods versus OnItemDataBound for nested Data List controls

A very common question in the ASP.NET Forumsis "How do I nest one Repeater (or DataList or DataGrid) inside of another?"; well, my usual stock answer used to be to use the OnItemDataBound event then use a FindControl() to find the Repeater inside the template and set it's datasource to the child view - then just DataBind...Recently though, I've gone against this - based in part on a bit in a book by Farhan Muhammad and Matt Milner (can't find the link to the exact book, but this one is pretty useful too), essentially, it involves using a member method....

posted @ Thursday, January 22, 2004 11:19 AM | Feedback (0) | Filed Under [ ASP.NET Performance ]

Free Snow Patrol track with Winamp 5.0 download!

Just noticed that Winamp is giving away a free copy of Spitting Games by Snow Patrol, so you just download the bunde! I bought the Snow Patrol album, Final Straw when it was first released a few months ago - looks like it's now getting re-released with a couple of extra tracks (no idea if this includes the US version, but you can get it on import from Amazon). I really rate this album - recommended!I should add that this is a limited play (60 days) wma - good quality though and a pretty good song!

posted @ Thursday, January 22, 2004 3:15 AM | Feedback (0) |

More on my Load Testing fun...

Well, still at it (20 hours after starting - yes, the time on this post is correct!). Really fustrating mostly, but one of those times coding where hours and hours of pain (literally in this case - flu and splitting headaches were involved) were followed by a sudden dawning then a solution.Well, I've learnt more about Load Testing and SQL Server performance today than I had in the previous 2 years, lessons I've learnt:SQL Profiler is god's own tool (not in any nasty sordid way, in a good way) - use it, love it! If you're running a load test,...

posted @ Wednesday, January 21, 2004 1:57 AM | Feedback (0) | Filed Under [ ASP.NET Performance ]

The agony of load testing - my head hurts (though the two may not be related)

Deadlocks...I hates the little buggers!Just spent the day trying to fix an 'issue' with a site I developed for a client. This is slightly annoying as it's a 'theoretical' issue. Essentially, the client has chosen to do something that I never normally do, load test the edit pages of the site.Unfortunately, this site has an odd editing system - it uses the concept of a 'common' tables to hold all items no matter what type of item they are (so it holds all the common properties, with the distinct properties being held in different tables). This design gives me a...

posted @ Tuesday, January 20, 2004 7:16 PM | Feedback (0) |

More in my 'my ADSL sucks' series

So annoying...many nights at around midnight, my connection just seems to freeze. Helpfully, my provider says 'well just restart your router'...hmm...so, I apologise if you're having problems connecting, it's even more fustrating for me!

posted @ Tuesday, January 20, 2004 9:15 AM | Feedback (0) |

Testing BlogJet - really cool tool to post to your blog from your desktop!

I have downloaded and installed an interesting application - BlogJet. It's a Windows-client for my blog tool (as well as some for other tools).Actually, it was not me who wrote this text: when I launched BlogJet for the first time, it's edit window already contained this text and the program asked me to click Post and Publish button to post this text to my blog in order to test the connection (yes, and the text above is not mine too! :-)... So, I did.Now I'm gonna learn all that cool features of BlogJet (don't ask me, there are too much - go...

posted @ Monday, January 19, 2004 7:04 PM | Feedback (0) |

Pure ASP.NET file upload...I have my doubts...

OK, maybe someone 'in the know' can settle this, is it possible to upload large files efficiently purely using ASP.NET? I've been following a thread in the ASP.NET forums about providing a method to do this using HttpHandlers / Modules to do this. What confuses me though is, is there any point to this? As I understand it, IIS will cache a Request stream before passing it, in it's entirety, to ASP.NET. If this is true then there's no way to efficiently upload files in ASP.NET - since the whole file would need to be held in memory before upload -...

posted @ Monday, January 19, 2004 6:59 PM | Feedback (0) | Filed Under [ ASP.NET ]

Another busy weekend - and using Dynamically loaded user controls the easy way

Well, spent the weekend working again - had a sudden stroke of inspiration about a work project, much refactoring later, I have a more stable and flexible implementation.I may write about this in more detail at a later date, got some pretty cool stuff going with Page templates etc...Until then, just a reminder about the most useful thing on the planet when using Dynamically loaded user controls - Denis Bauer's DynamicControlsPlaceholder. I've posted a link to this control a few times now, but I can't overemphasize how much faffing around it can save.Another reminder, if you want to load controls...

posted @ Monday, January 19, 2004 12:21 AM | Feedback (0) | Filed Under [ ASP.NET ]

Code Complete 2

Code Complete by Steve McConnell is, in my opinion (and many others), the best book ever about the art and discipline of coding. Basically, it's just the bible of how to design and build quality software. So, I'm really looking forward to Code Complete 2 (link is to a draft manuscript of the book) - if you've never heard of this book or read it, do yourself a favour, set aside a few hours and read the draft - then buy the book when it comes out in June.As a measure of just how good the original is - it was...

posted @ Wednesday, January 14, 2004 4:00 PM | Feedback (0) | Filed Under [ Books Links ]

Wow, use HTC within Mozilla!

This comment to my moan about this is VERY cool: I think I've solved your problem! I've successfully developed a Mozilla wrapper for Microsoft's HTC files. It is encapsulated in a single XBL binding, so is exremely portable. The binding is small (4k) and contains compressed JavaScript code which loads the behavior and applies the interface. The interfaces of some objects have been extended to allow further cross-browser compatibility. I've only just finished this development. So you are the first to here about it (apart from a few bored friends). I would be delighted if you would take a look and feed...

posted @ Wednesday, January 14, 2004 1:15 PM | Feedback (3) | Filed Under [ Links Random ]

An article I really have to write - oh the woes of being lazy...just why the hell does everyone use DataGrids?

One thing that really puzzles me in the ASP.NET forums (apart from having to be moderated...which is a whole other story) is that practically everyone seems hell-bent on using the DataGrid. Why? What am I missing; I VERY rarely need to use a DataGrid, a Repeater is perfectly adequate for most of my needs - failing that a DataList is just fine. So come on perople, what's so hot about the DataGrid? Incidentally, I've been meaning to complete an article on this subject...I really have to get on with writing more articles - if only to give myself something to...

posted @ Tuesday, January 13, 2004 4:31 PM | Feedback (0) | Filed Under [ ASP.NET ]

Stuff on compressing .TEXT RSS feeds from Jeff Julian

Pretty useful if you don't have the ability to use IIS compression (or choose not to) - Jeff Julian has released a 'plugin' for .TEXT which enables you to compress the RSS feeds produced by .TEXT 0.95 - which is very useful, most of my traffic for instance comes from the RSS feeds (I get around 200 HTML compared with 1800 RSS views per day). This uses the HttpCompression module by Ben Lowery, which is in itself a brilliant way to enable compression. Ben also links to a MS hotfix rollup package which fixes an issue with HttpModules and Server.Transfer - am...

posted @ Sunday, January 11, 2004 1:25 PM | Feedback (0) | Filed Under [ .TEXT ASP.NET ]

How not to spend a weekend

I spent this weekend doing some 'product investigation' for a pitch we're preparing - which basically means that ensuring what we're saying in a pitch actually matches up with the product's capabilities. Not much fun, but has given me some ideas for future posts, oh and a future project...details to follow (don't want to queer the pitch by posting too much about it now). Anyway, my friend this weekend has been the marvellous Strong Roast Guatemala from Whittards (UK high street coffee suppliers) - lovely, smooth, chocolatey coffee ideal for espresso.

posted @ Sunday, January 11, 2004 1:14 PM | Feedback (0) | Filed Under [ Random ]

Playing with MS CMS...

Well, I spent the weekend 'playing' with Microsoft's Content Management Server 2002 - well, it's better than the 2001 version, principally because it feels more like a 'proper' .NET enabled application. Still feels a bit incomplete though - there's way too much swapping between apps involved when you're working with it - a Visual Studio Server Manager would be great for this thing - even proper MMC would be a boon. Still, pretty interesting - anyone have any info on the future version?

posted @ Sunday, January 11, 2004 1:02 PM | Feedback (0) | Filed Under [ Random ]

Another in the 'things I didn't know but really should've done" - you can disable Client Side validation with client-side script...

OK umm, actually quite embarassed about this one...I just discovered this was possible...so I can emit a bit of Javascript which lets me disable validation on a control when some condition is met here's this bit from MSDN: Client-Side APIs Some additional scenarios are enabled by functions that can be called from your client-side script. Table 4. Functions called from client-side script Name Description ValidatorValidate(val) Takes a client-validator as input. Makes the validator check its input and update its display. ValidatorEnable(val, enable) Takes a client-validator and a Boolean value. Enables or disables a client validator. Being disabled will stop it from evaluating and it will always appear valid. ValidatorHookupControl(control, val) Takes...

posted @ Thursday, January 08, 2004 11:42 AM | Feedback (0) | Filed Under [ ASP.NET ]

Stupid, stupid ADSL

Sorry, ADSL is playing up again, please keep trying if you're having problems...

posted @ Wednesday, January 07, 2004 10:15 PM | Feedback (0) |

Well, can't sleep yet again...the questions which flit through my mind in the long hours of sleeplessness

I've been frequenting the ASP.NET forums of late, great resource but not without it's problems. As a supposed 'communities expert' I thought I'd stick my oar in...as usual! The poster rating system...hmm..I really don't like this one bit, being assigned a status (e.g., top 25 poster) solely based on the number of posts does nothing to encourage quality, rather it encourages swarf and provides no indication to users as to the probable 'quality' of posters answers Moderation, I was recently stung with this one in the stuff I posted yesterday - the foreach debacle - essentially the bloke I was replying to...

posted @ Wednesday, January 07, 2004 3:39 AM | Feedback (0) | Filed Under [ ASP.NET Long & Rambling ]

Mars today wallpaper...

Though I'd quickly knock this up - wallpaper from the Mars Probes page. Get it here (1600x1200)

posted @ Tuesday, January 06, 2004 6:45 PM | Feedback (0) | Filed Under [ Random ]

Getting involved in dumb arguments...of when 'for' and 'foreach' can lead to idiocy...

I do have a tendency to get involved in pointless arguments in the ASP.NET Forums...a good example is this one, arguing about the performance of 'foreach' versus 'for'...any opinions from here - the crux of my argument is that for() will in general perform better than foreach() - because the generated IL simply does far less in most cases (I am aware of some optimisations which reduce the benefit for very simple collections).

posted @ Tuesday, January 06, 2004 2:55 PM | Feedback (0) | Filed Under [ .NET ASP.NET ]

Isn't it ironic

Just looking back through some old posts, I started this blog on my own URL (so not on ASP.NET weblogs) so I could post whatever I wanted...strange thing is, this blog is more focussed on .NET specific information than most of the ones there now...

posted @ Tuesday, January 06, 2004 10:27 AM | Feedback (0) | Filed Under [ Random ]

Even more on ViewState...well, my pet peeve on ASP.NET really...

I've been giving some more thought to the ViewState stuff I mentioned earlier. It actually brings up something which I find most annoying about ASP.NET - and this is not a political point! Why exactly can't 'ordinary' users see the source for ASP.NET, so far as I'm aware, no equivalent of Rotor exists for ASP.NET. I'm guessing that certain MVPs can access this source though the Shared Source initiative - the rest of us have to rely on things like Reflector to poke around (imagine how useful it would be to be able to attach a debugger to the ASP.NET source!).The argument which I guess...

posted @ Tuesday, January 06, 2004 9:50 AM | Feedback (0) | Filed Under [ .NET ASP.NET ]

Really interesting sample on ViewState preservation for non-visible controls

Nice sample and methodology from Robert Downey (obvious joke omitted), shows some really interesting (to me at least) insights into the workings of ViewState (you may be noticing a pattern here :-))

posted @ Monday, January 05, 2004 2:01 PM | Feedback (0) | Filed Under [ .NET ASP.NET ]

Great article on Eggheadcafe.com on ultra-compact binary serialization of DataSets

Was having a look at this article by Peter A. Bromberg Ph.D. (don't know if that's his given name ;-)) over at Eggheadcafe.com, I always found it a bit annoying that DataSets serialized to XML only. Using the incredibly cool CompactFormatter, combined with the old favourite SharpZipLib, he's able to squish a DataSet down to just 4.6% of it's original size - now that's a pretty useful reduction!Why is it useful - well when you're sending a DataSet over a webservice, it's likely that most of your latency will be caused by the physical transmission of data...the less data, the...

posted @ Monday, January 05, 2004 11:55 AM | Feedback (1) | Filed Under [ .NET ASP.NET ]

Can't sleep...and looking for a new aggregator

Well, I'm suffering from post new year sleeping pattern - I basically become nocturnal over the Christmas and New Year (Hogmanay) holidays, have to start work in 8 hours...not good! Anyway, while I am sitting here awake (there's a show on about Turkish Harems; not as tittilating as it sounds, very political), thought I'd embark on a hunt for an new RSS aggregator. I've been using Feeddemon during the Beta period, it's very nice, pretty interface etc...however it doesn't support CommentAPI and I'm not sure I want to pay $29.95 when there's comparable free products.I've now installed RSSBandit, it's pretty nice...

posted @ Monday, January 05, 2004 2:28 AM | Feedback (0) | Filed Under [ Random ]

More on my journey into the wonderful world of ASP.NET 1.x ViewState

I wrote in a previous post that I was planning to have a poke around with ViewState, extending the stuff I've done on compression into encryption and signing etc...well there's good and bad news for this plan. It looks like (oddly) that the MAC and encryption stuff is actually handled in the LosWriter class; an internal class used by LosFormatter to actually do the object serialization...it uses the following code to do this (thanks once more to the indispensible Reflector) : internal void CompleteTransforms(TextWriter output, bool enableMac, byte[] macKey) { int num1; byte[] array1; string text1; char[] array2; string text2; num1 = 0; if (this._recyclable) { this._byteBuffer = ((byte[]) LosWriter._byteBufferAllocator.GetBuffer()); if...

posted @ Monday, January 05, 2004 1:22 AM | Feedback (0) | Filed Under [ .NET ASP.NET Code Snippets ]

More on BZip2

In a previous post, I mentioned I used BZip2 for my compression - mainly because, it's simple, offers the best XML compression for a generic algorithm - IMHO, i.e., not one designed specifically for XML compression like XMill - which if anyone knows a C# or Java implementation of - please let me know.Anyway, you can get BZip2 (with a number of others) in the excellent SharpZipLib library. I really lament the lack of specific support for compression within the .NET framework, I mean the J# stuff has it in the java.util.zip namespace, would it really be so difficult to include this...

posted @ Saturday, January 03, 2004 10:43 PM | Feedback (0) | Filed Under [ .NET Random ]

ViewState compression using BZip2...latest prototype...

Just a first stab at this, uses some classes I used in another project (I'll attribute the compression code later...I believe I got it from the Sharpziplib stuff - with some modifications - I'll stick the comment headers back in to comply with the Licensing stuff later - right now consider it an example only) the actual code to compress the viewstate is VERY simple: using System; using System.Web.UI; using System.IO; namespace ViewStateCompression { /// /// Summary description for CompressedVSBasePage. /// public class CompressedVSBasePage :System.Web.UI.Page { ...

posted @ Saturday, January 03, 2004 7:26 PM | Feedback (13) | Filed Under [ .NET ASP.NET Code Snippets ]

Well, I'm back...and comments on some books...

Had a nice, relaxing holiday, read a few books, I can recommend Charles Petzold's Code and kind of recommend Homer, Sussman and Howard's Introducing ASP.NET 2.0 - I say 'kind of' because I found it really patchy in the writing style...but then I've never liked one of the authors' styles (not Rob's :-)). Code is a pretty unique book, goes right from morse code, through binary arithmetic, electronics and right on to microprocessors and finally code - ties it all together in a way that my CS classes never did, not very easy going but very interesting and informative! Introducing ASP.NET 2.0 gives coverage...

posted @ Saturday, January 03, 2004 3:04 PM | Feedback (0) | Filed Under [ Books Random Whidbey ]

Powered by: