mostlylucid

scott galloway's personal blog...
posts - 911, comments - 723, trackbacks - 11

My Links

News

Archives

Post Categories

Misc. Coding

.NET

Handy indexes for versioning with RavenDB

Mainly for me to remember this but if you’re using the excellent Versioning bundle for RavenDB then you’ll find you quickly need to work out a way to get the latest version of a document if querying on any field other than ID (I *believe* ID actually only gets the latest one). The little index definitions below do just that (the secome one is just adding another field to the map so I can query by that…useful example)… documentStore.DatabaseCommands.PutIndex("CurrentVersion", ...

posted @ Monday, July 12, 2010 6:59 AM | Feedback (0) | Filed Under [ .NET RavenDB ]

John Lam’s Dev Kit

Kind of a ‘tools’ list but a great post on what John uses on his machine…a few new ones I hadn’t seen which is always nice!

posted @ Monday, September 08, 2008 3:35 PM | Feedback (0) | Filed Under [ .NET Random ]

Premature optimization and user perception...my pet project and CSS Sprites

One of the themes I'm looking at for vNext of ASP.NET is the optimization of sites by reducing the number of server requests required for a single page. A new classic in the area of improving the perceived performance of your sites by reducing the number of server roundtrips is Steven Sounders book 'High Performance Websites'. Steven's book is very small, very readable and probably the best book on anything to do with the web that I've read in years. This book was a huge revelation for me...I spent most of my coding career writing the slickest, highest performing code I could...and frankly...

posted @ Friday, July 11, 2008 7:54 PM | Feedback (1) | Filed Under [ .NET ASP.NET Code Snippets ]

My secret project....NET 3.5 SP1 Beta (well, the release bit)

I should have made this a better post but anyway. Brad Abrams just posted about the .NET 3.5 SP1 Beta release . We've also posted a bunch of new Screencasts covering the new features for ASP.NET in this release, as well as a readme which has some getting started and upgrade information for migrating from the previous release...

posted @ Monday, May 12, 2008 9:53 AM | Feedback (0) | Filed Under [ .NET ASP.NET ]

Grrr...poor use of singletons and a very cool Generic Singleton pattern!

I posted earlier that I'm switching to blogengine.net, as part of this I've been fiddling around with the code (as is my way..I'll contribute back to the source when I've finished). One of my major pet hates is poor use of the singleton pattern, especially as there's a definitive article on the pattern in .NET and how to do it well. It's actually likely that this pattern is overkill in this case and a ReaderWriterLockSlim could be better (though it has it's own problems) . Anyway, on the assumption that a Singleton is the best choice here, let's look at...

posted @ Wednesday, April 30, 2008 10:42 PM | Feedback (7) | Filed Under [ .NET Code Snippets ASP.NET Tips ]

Why do single chances make me nervous...life should come with an undo function...

Spent most of the day not doing what I should've been doing. I have a number of balls in the air at the moment and it feels like I've just added a spinning plate act at the same time...noisy disaster may ensue. Right now I'm working on another Codeplex release, working on a private build of some beta bits for the Insiders, getting our bugs migrated to the right place so we can get cracking on ASP.NET v.Next, getting the notes together for the last meeting (before the next one happens!) as well as getting the Hands-On-Labs ready for this...

posted @ Tuesday, April 15, 2008 10:01 PM | Feedback (0) | Filed Under [ .NET ASP.NET ]

Obsessive Coding, optimal string Reverse...

I love this type of thing, a whole post on optimal string reverse algorithms. I always love this sort of thing, learning huge amounts of detail about fundamental operations (sort of, umm when do you ever reverse strings?). Actually looking at Justin Rogers' blog he has lots of great performance posts...

posted @ Monday, February 04, 2008 9:00 AM | Feedback (1) | Filed Under [ .NET Performance ]

Why do so many people mess up Singletons?

I've written about this a few times now (use the search thingy to find where) but I'm still surprised how many people mess up the Singleton pattern.   For instance take: if (blogSettingsSingleton == null)                 {                     blogSettingsSingleton = new BlogSettings();                 }                 return blogSettingsSingleton;   Looks ok, right? But this is a classic poor pattern when dealing with multi-threaded apps. Why? Look at the initial 'if' statement, and think what happens if multiple treads hit this at the same time...one thread...

posted @ Sunday, January 27, 2008 4:47 PM | Feedback (0) | Filed Under [ .NET Code Snippets Patterns Performance ]

C# null Coalescing operator

Just because I always forget this...the C# null Coalescing operator: Sample below shamelessly stolen from here... MyClass anObject; ... // Variant 1: Using a full if/else clause MyClass anotherObject; if (anObject != null)   anotherObject = anObject; else   anotherObject = new MyClass();   // Variant 2: Using the ?/: conditional operator MyClass anotherObject = anObject != null ? anObject : new MyClass();   // Variant 3: Using the ?? operator MyClass anotherObject = anObject ?? new MyClass();

posted @ Saturday, November 03, 2007 5:07 PM | Feedback (0) | Filed Under [ .NET Code Snippets ]

Crazy busy at work, back soon!

Things have been insane at work over the past few days...back to this soon! Plan to get a nice 'Amazon book suggestion' tool on the site; going to let readers suggest books on various topics by entering an ISBN and then provide the country appropriate URL to buy that book. Still fiddling with the new Amazon web services bits but it's nearly there... See you at the weekend (probably!)

posted @ Wednesday, October 17, 2007 1:44 PM | Feedback (0) | Filed Under [ .NET ASP.NET Random ]

Full .NET Archive

Powered by: