The Darkside

Shedding light on things and stuff

 
  Home :: Contact :: Syndication  :: Login
  83 Posts :: 0 Stories :: 57 Comments :: 2 Trackbacks

Ads

 

Donate via PayPal...

...if you feel the site helped.

Archives

Post Categories

Open Source Projects

Other Blogs

General

Articles that I couldn't categorise, but have to do with development-related things

This is just a quick tip that you can use to restart ReSharper in Visual Studio (without restarting the IDE) if it becomes unresponsive. In my case, it just disappears from view and the majority of my shortcuts stop working. Open the immediate window, either through the menu “Debug->Windows->Immediate” or using the keyboard shortcut “Ctl-Alt-I”. Type in: >ReSharper_Suspend press enter, and then >ReSharper_Resume You must type the “>” first to be able to enter commands in the immediate window.   Some other notes: You can use...


I’ve been contemplating the fact that Reflector is no longer a free tool, and paying the $35 (USD) for the tool. I’ll be honest: paying for software has never been an issue for me. I even use SQL Prompt from RedGate. I write software, and need to get paid for it, for a living. But… The fact that RedGate said that they would continue offering Reflector for free and did an about turn on it has riled me a tad. They haven’t even offered existing users a “this-is-the-final-free-version-and-will-never-get-updated” option. Sad. I went through the suggestions from this...


I’ve been searching for a good regular expression to validate a string representation of a GUID, and even though there are 17 results on RegExLib.com and 73000+ on Google, I’ve not found one that matches the start and end braces correctly. Every single one I’ve found (without exaggerating, I read over 60 posts while looking)either matches a GUID without the braces, or those that match on a string including the braces allow for either only the first or last to be present. ^(?<-BRACE>\{)?[a-fA-F\d]{8}-(?:[a-fA-F\d]{4}-){3}[a-fA-F\d]{12}(?<-BRACE>\})?(?(BRACE)^.)$ On a side note: The project I’m doing maintenance on is VS2008/.Net 3.5. If...


A colleague asked me this morning if I already had a code snippet that compressed and decompressed byte arrays that he could make use of. He needed it to compress a variable before passing it as an argument to a WCF call, and decompress in the service itself. I’ve never made use of the System.IO.Compression namespace (I’d always used SharpZipLib), so I thought this would be a quick and useful experiment. After referencing the local MSDN and then the customary 30 second google, I decided I’d make my own, better, wheel :) I’m still convinced it’s less verbose than...


It’s been ages since I posted anything. The following code has had me tied up for the past few months :) : this.Children.Add(new Child("Sebastian", new Date(2010, 1, 8)); Just to get going again, here’s a simple tip. I’ve just completed installing Visual Studio 2010, and the first thing that struck me was that there was still no way to change the theme. (And this mild OCD thing that I may or may not have means that everything must look the same and be neat). I found this extension...


I was asked by a colleague about how I might go about shuffling a deck of cards in C#. I found a few takes on this general problem on Google, and make no mistake: this has been covered by numerous persons over the last 80 years according to some of the research I found. So, yes, this is mostly likely a Wheel Version 2.0 piece of code, but here it is and hopefully it’ll be useful to someone. Firstly, you need to decide on a Random Number Generator. If you’re just interested in solving this card-shuffling problem as part...


If you get an error message along the lines of “Saving changes is not permitted. The changes you have made…”, it’s actually an option that can be toggled. Go to Tools->Options->Designers->Table and Database Designers and toggle the “Prevent saving changes..” option.


Rant() { Stop reading here if you’re looking for something technical :) I’ve recently started interviewing candidates for what I would describe as a mid-level developer, skilled in ASP.Net/C#. This brought back memories of much the same exercise I went through last year when looking for a med-to-senior level developer. So to summarise how I think that went, I’ll paraphrase some questions and answers that have stuck with me: Q: Does C# support multiple inheritance? A: I’ve never really needed to use inheritance, so I haven’t paid much attention to...


Here's a portion of a screen shot I took earlier yesterday evening: The portion I've highlighted must surely have been a copy-and-paste mistake, as it's totally out of context. More to the point, shouldn't this should have been: (a) proof read by the author (b) proof read by an editor They can argue about who's fault it is :) This started me thinking (again) about issues like this in my line of work. Make no mistake - back in software development land we also have snafu's that slip out into production - like a message box displaying debug information that wasn't commented out before a build. If found...


This is a mini-rant about usability, with a workaround – so excuse me if this isn’t quite in the same vane as my usual posts. I’m pretty sticky about how my file names should be formatted when WMP rips a CD, my preference being: Track Number – Artist – Album – Song Title.ext WMP gives you the option of selecting/arranging fields in any number of ways, and gives you some predefined options for the separator. One of them is the dash, which I have selected, and then I use my trusty Total Commander to do...


This is just a tip for anyone using GeneratorStudio or any other code generator for their ActiveRecord classes (or any other classes, for that matter). I generally have my templates set up to generate my files with the name "<TABLENAME>.Generated.cs" or something similar. In addition to this naming convention, I also make sure that my generated classes are marked as partial classes, and then I do all custom code, like additional "Find" methods methods, etc, in files named "<TABLENAME>.cs". This way, when you need to regenerate anything, you can be comfortable with overwriting all the classes that are...


Generator Studio is a code generation tool that allows you to set up templates using the Velocity Template Language, and then generates files based on your source database structure. It will be continually updated with new features and templates, to keep checking back if you're interested.


I've recently needed to test an app on Windows XP that makes use of Windows Authentication for the application as well as for the Sql connection string, with different application functionality assigned to Windows users, and the various permissions that are set in Sql. Short of having to log in and out with every different user (which wasn't going to happen), I wasn't sure how this was going to happen, until I remembered the "runsas" DOS command. Here is how to use it...


The Visual Studio IDE has an very extensible framework, allowing developers to tap into the inner goings-on of just about anything imaginable that the IDE can do. The attached code provides two features: Stopping a build on the first error and logging the total solution build time.


This is a really quick method to do a find and replace in VS2008 to replace your get/set properties to the new syntax, using regular expressions. You can even use this for C#2.0 targetted projects, the main requirement is the VS2008 (or msbuild.exe from framework 3.5).


A look at a list of problem domains that may need to be seen to when trying to convert an existing solution, that only supports a English, to mutli-language behemoth.


A really nifty feature that is supported by IE6/IE7 is the SearchURL registry "hacks" that allow you to use a mnemonic for URL's. It also supports the ability to substitute a specific escape sequences with another value as well as include escaping for characters that may be substituted. The article includes a sample of the registry edits you will need to make.


A short discussion on some of my findings while investigating the "bugs-per-lines-of-code" phenomenon