Owner: Bell End URL:http://doogalbellend.blogspot.com Join Date: Sat, 24 Mar 2007 17:04:06 -0500 Rating:0 Site Description: "quite amusing and drastically geeky at the same time" Site statistics:Click here
Words that annoy me 2007-10-10 15:56:00 Spelunking - This word comes from the caving community, the weird guys who like to go down small wet holes at the weekend (fnar, fnar). They may be weird, but their sport is kind of dangerous and possibly exciting. Now the geek community have appropriated the word to describe, er, groping around in new technology or source code. It seems to be a desperate attempt to make IT sound much more interesting than it really is. Look, computing is not cool, get over it. Grok - What is wrong with 'understand'? It's been in the English language for quite some time and everybody (including normal, non-geek people) knows what it means. Also see above. Regards - Email and the web have always seemed pretty informal to me. There was a time in about 1990 when I ended emails with some kind of sign off, but now I find my name is plenty to mark the end of a message. So when I see 'regards' (or worse 'kind regards'), I think that the person sending that message has some kind of problem. In Read more:Words
SonicWall VPN client for Vista released 2007-10-22 17:29:00 My post about the SonicWall Vista
client beta is one of the most popular things on here, lord knows why. Anyway, the final version has been released and it is working perfectly for me. I've not had any problems with Vista complaining about two computers with the same IP address being connected to the network. I realise I'm really tempting fate writing that...
Licensing 2007-10-19 15:28:00 Somebody emailed me asking what the licensing terms were for some code he'd found. I was surprised somebody would bother asking since I tend to assume any code I find on the web is public domain (although I wouldn't dream of stealing somebody's prose - odd how I think of code differently to the written word). But of course this isn't necessarily the case. In fact I believe if no licensing terms are explicitly stated, the code is by default copyright of the author. So to clarify the licensing for anything on this site, any code samples are public domain. Do what the hell you want with them. I do however claim the copyright for the English on here, not because I think it's particularly valuable but because I don't want spammers stealing it for their own sites. Not that a little copyright theft is likely to stop them of course, but I don't want to make it perfectly legal for them either. Whether any of this is legally binding, who knows, but I'm definitely not
Improved Excel-like select all in a DataGrid 2007-10-19 15:15:00 My first attempt at this worked mostly but if the user clicked anywhere in the grid that wasn't a cell, the whole grid would be selected, which wasn't what I was after. So here's an improved version which will only select all when the user clicks in the top left cell. public void SelectAll() { BindingManagerBase bm = BindingContext[DataSource]; for (int i = 0; i < bm.Count; i++) { Select(i); } } protected override void OnClick (EventArgs e) { base.OnClick(e); Point client = PointToClient(Cursor.Position); HitTestInfo hitInfo = HitTest(client); if ((hitInfo.Column == -1) && (hitInfo.Row == -1)) { if (client.X < TableStyles[0].GridColumnStyles[0].Width) if (client.Y < TableStyles[0].PreferredRowHeight) SelectAll(); } } Read more:Excel
The problem with LINQ 2007-10-25 17:30:00 In principle it sounds like a great idea. Rather than having to learn SQL, XPath and whatever other query language you care to mention, just learn LINQ and use it to access any data source you like. That's great and all, if I'm using .NET 3.5 for every single project I work on. And until I am (which I'm guessing will be, er, never), LINQ is actually yet another thing to learn. So now I need to know SQL, XPath and LINQ. Or perhaps not, perhaps to just forget LINQ and stick to the old stuff, since it works and is available on most platforms. When LINQ is available everywhere, then I'll start to think about learning it.
MySQL error messages = crap 2007-10-23 15:01:00 OK, it's an old version of MySQL
(4.0.25 to be precise) but the errormessages
are completely useless. Almost any kind of SQL syntax error shows this helpful message. #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT PubID FROM Pubs ) LIMIT 0, 30' at line 1 Of course the problem is that MySQL 4 doesn't support subqueries (!), apparently MySQL 5 does and perhaps my ISP will upgrade one day...
Using Sharepoint activities in a workflow designer 2007-10-30 16:02:00 If you're hosting the Windows Workflow designer control in your own application (this shows you how to host the control) and you want to use the Sharepointactivities
, these are the files you'll need (these are for Sharepoint Services, I think there are more activities for MOSS 2007). Microsoft.SharePoint.dll Microsoft.SharePoint.Security.dll microsoft.sharepoint.WorkflowActions.dll microsoft.sharepoint.WorkflowActions.intl.dll microsoft.SharePoint.workflowactions.intl.resources.dll I'm not sure of the rules regarding redistribution of these files since I'm only using it for my own personal use. If you're having trouble getting any of these files out of the GAC then read this post which explains how to get them out.
MSDN forums not very useful 2007-10-29 16:11:00 How hard can it be to write some code for a web forum? After all it's a problem that has been solved thousands of times before. Well apparently it's too hard for Microsoft. I've been trying to post to their MSDN forums for the last week and whenever I try to create a new thread or reply to a thread I get the following error message. I've tried clearing out all the crud from IE, with no joy. So I'm forced to kick off a Virtual PC session to post, not very handy. Not only that, when I get an email alert telling me about a reply to my post, the link starts with 'h ttp://forums.micro' so it doesn't fecking work.
A no-op activity 2007-10-29 15:55:00 I'm in the process (no pun intended) of converting one business process XML language to XOML via some XSLT. I'm not really sure how some of the source activities will map to Windows Workflow activities so I'd like a no-op activity for the time being, just so I get the correct layout of the process, without having to nail down all the details. The solution is actually very simple, just use the base Activity class whose Execute method does nothing, simply returning ActivityExecutionStatus.Closed. Although it's not available in the Visual Studio toolbox, Visual Studio copes quite happily with a XOML file that contains an Activity activity.
Web applications aren't the solution to every problem 2007-10-28 16:40:00 I've been working on an ASP.NET website for a while now. For the admin side of things, I've added a few pages for updating the database and such like. There have always been problems with updating the data, which is read in from some text files and then dumped in the database. First there were problems with the size of the data in the files, which was solved initially via the maxRequestLength attribute in web.config. Then the file upload to the web server was still taking a long time so I started to require the data to be uploaded via Remote Desktop or FTP. Then I had problems with the SQL update timing out. This was solved by increasing the value of the executionTimeout attribute in web.config. But after a while even this didn't work and the update failed when the request timed out. I could probably increase the timeout some more or I could use some other technique to get it working, but I eventually came to the conclusion that this just isn't what I should be doing. ASP Read more:every
Pies and Prejudice 2007-11-11 06:29:00 One of the sure signs of getting older is listening to Radio 2, not in some kind of ironic post-modern way but because, of all the options available, it seems like the best one. And if you listen to Radio 2 then it's pretty much required to like Stuart Maconie, since it seems like half their output involves him. Fortunately I fall into that category. The man's funny and it's always good to hear a Northern accent on the radio (even if it has been softened, presumably from too many years living in the South). So when I saw his book 'Pies and Prejudice
- In Search of the North' I was interested. When I read the back cover 'A northerner in exile, stateless and confused' I thought yep that's me and promptly bought it (OK I put it on my Amazon wish list and somebody bought it for me several months later). And it's a great read. He writes like he talks, so if you like his shows you'll like the book. Any Northerner reading it will no doubt be disappointed by his lack of coverage of
Developing custom state activities 2007-11-19 16:10:00 I've banged on before about how extensible Windows Workflow is (assuming you can work out how to extend it), but there is at least one place where it isn't quite as extensible as one would like, state activities
. I was trying to create a custom
state activity that contained a state initialization activity and an event driven activity and various other activities within those. The first problem I encountered was when I inherited from StateActivity. Trying to add any activities at design-time failed. This seems to be down to the state activity designer. One solution would have been to write my own designer class, but this is complicated by the fact that the standard state designer is internal so can't be inherited from. I guess I could have decompiled the code using Reflector and made the required mods in my own code, but that seemed too much like hard work. So I decided to construct the activity in code instead. Then I bumped into the second problem. Adding activities in code is pr
Sharepoint create task workflow error - Not supported exception 2007-11-15 16:41:00 If you've tried to create
tasks in workflows hosted in Sharepoint
using the CreateTask activity you may have come across this error
in the Sharepoint logs. System.NotSupportedException: Specified method is not supported. at Microsoft.SharePoint.Workflow.SPWorkflowTask.SetWorkflowData(SPListItem task, Hashtable newValues, Boolean ignoreReadOnly) at Microsoft.SharePoint.Workflow.SPWinOETaskService.UpdateTaskInternal(Guid taskId, SPWorkflowTaskProperties properties, Boolean fSetWorkflowFinalize, Boolean fCreating, HybridDictionary specialPermissions) at Microsoft.SharePoint.Workflow.SPWinOETaskService.CreateTaskWithContentTypeInternal(Guid taskId, SPWorkflowTaskProperties properties, Boolean useDefaultContentType, SPContentTypeId ctid, HybridDictionary specialPermissions) at Microsoft.SharePoint.Workflow.SPWinOETaskService.... Although saying that, my own searches on the Internet didn't Read more:exception
Boethius's Wheel 2007-11-24 16:39:00 "It's my belief that history is a wheel. 'Inconstancy is my very essence,' says the wheel. Rise up on my spokes if you like but don't complain when you're cast back down into the depths. Good time pass away, but then so do the bad. Mutability is our tragedy, but it's also our hope. The worst of time, like the best, are always passing away." So Boethius wrote about 1500 years ago*. And as far as I can see, it still holds true today, on a personal level and on a national/global level. Gordon Brown may have said "no more boom and bust" but the fact is he always had very little control over the economic cycle. It's human nature to over extend ourselves during the good times, thus driving the boom to unsustainable levels then doing the opposite during the downturn. And it looks to me like the 10 years of boom is just about to come to an end. Interesting times. *I'm not particularly well read, I picked up on this quote when a tramp shouted it at Tony Wilson in "24 Hour Party People".
Buy Nothing Day 2007-11-24 15:39:00 Today was Buy Nothing
Day, which I think is a top idea. I've been aware of this for a few years, but today I only heard about it after I'd popped out to buy some batteries. They are rechargeable so I don't feel too bad about it.
What is click fraud? 2007-11-23 16:09:00 There are plenty of examples of obvious click fraud
, people setting up dubious websites with advertising then using nefarious means to get clicks on those ads, companies clicking on their competitors ads to drive up their competitors' costs. And these kind of examples of fraud are quite possibly detectable by the companies who run the ads. But there seems to be a whole other bunch of other stuff that may also be considered fraudulent, or at the very least not valid clicks. For instance, my daughter can now use Google to search for stuff on the internet but she has no idea of what the difference is between a sponsored ad and a normal search result and since she can't read everything, she just clicks on whatever she feels like. And, until she works out how to use my credit card, she won't be buying any Charlie and Lola gear from one of the sites she visits. Or what about me when I see an ad for some dubious debt company or some get rich quick scheme and I click on the link purely to
Posting errors to a website 2007-11-20 15:23:00 The exception logger I've written is one of the most popular pages on my proper website
but I've never been completely happy with it. I've always wanted to be able to get the details of an unhandled exception from the user of my software to me easily. I added support for sending an email some time ago, but that's never felt like a good solution since the user must configure their SMTP connection before sending off the email. Then I read a website posting suggesting a much better solution, post the error to a website, then email the error to the relevant address from the web server. That way, email only needs to be configured in one place, on the web server. Admittedly if the user isn't hooked up to the internet it won't work, but sending an email via SMTP will also generally fail in that scenario. The exception logger code shows how to do the client-side code, but here it is anyway. private void LogToWebsite(string error) { Uri uri = new Uri("http://www.yourwebsite.co Read more:Posting
What can I do with an LCD screen and a COM port? 2007-11-28 14:55:00 There is something particularly gratifying about writing software that drives other bits of hardware. I guess it's the feeling of controlling something in the real world, rather than just making square boxes do things in the virtual world of PCs. .NET 2 made controlling COM ports easy through the SerialPort class, and there is a library available for controlling the USB ports. Then I saw this article about driving LCD screen
s from .NET, again via the serial port. So now it's all very easy to control hardware from my preferred development environment, I just have to find a useful application to develop. One possibility I've been mulling over for a while is some software to monitor electricity usage. Apparently there are electricity meters out there that will do this for you, showing pretty graphs etc, but the electricity companies aren't keen on installing them. Presumably this is due to the cost and also perhaps because it might encourage people to use less power, which isn't rea Read more:LCD screen
The last CRT 2007-12-02 17:25:00 Some time ago our TV died, trying to switch it on led to a light coming on for a few seconds, then it turned itself off. My guess was the power supply had died or the screen itself had died (for a few days the picture displayed hadn't been the right size).I did think for a second about getting it fixed but then thought it would be as cheap to buy a new TV. After all, the price of TVs has been dropping for a while. And my brother would no doubt be able to fix it, so the TV wouldn't go to waste. But then I actually had a look for a TV and was unable to find any CRT TVs anywhere. I did find some LCD TVs that were pretty cheap but there were a few problems. Most of them were too big to fit into our living room without removing shelving. Not everybody wants a 32"+ screen. Call me a Luddite but the picture quality of LCD screens doesn't seem that good. OK, when high definition TV becomes ubiquitous, the picture quality may be pretty good, but for a 28" screen I don't really need high de
Solving the Vista "Failed to play test tone" sound problem 2007-12-12 16:04:00 It's almost a year since I installed Vista
on my work machine. I sorted out most of the glitches a long time ago but I've not had any sound the whole time, which I kind of learned to live with. I'd pretty much given up trying to fix it, thinking I'd wait for SP1, which I was sure would sort out the problem. So I saw SP1 RC1 was available and installed it and excitedly tried my sound. Still nothing... OK I thought, now is the time to figure out what the problem is. I tried out some of the SysInternals tools to see if they could provide some kind of useful info, basically to see if the audio subsystem was trying to access a registry key or file that didn't exist or it didn't have access to (I'd already decided it probably wasn't a driver problem since a completely different sound card had exactly the same problem). I got nowhere with that so I moved onto my next idea, trying to figure out what was going on in the audio log files. If you change the registry key HKLMSystemCurren
Calling a COM object on a remote machine with no type library 2007-12-20 13:52:00 I'd always assumed to connect to a remote COM object required the client code to reference the type library for the COM object and for the type library to be registered on the client machine as well, but somebody showed me a way of doing this today that appears to avoid the need for either of these. Type type = Type.GetTypeFromCLSID(new Guid("{12345678-1234-1234-1234-123456789012}"), server, true); Object obj = Activator.CreateInstance(type); return (string)obj.GetType().InvokeMember("Method", BindingFlags.InvokeMethod, null, objTest, new object[1]{param});Admittedly it uses reflection, which will probably be slower than a direct call to the interface, but given it's a call over the wire, this probably won't be the slowest part of the call anyway. And it sure makes deployment easier. Read more:Calling
The big BPM lie 2008-03-08 16:12:00 I've been looking at a few Business Process Management tools on and off and I've noticed something that most of them share in common, they like to brag that no coding is required to get your BPM solution in place.Whilst a laudable aim, I doubt very much that it can be met, especially when integration with other products is required. And integration is one of the key ingredients to a successful BPM implementation. The stock answer to integration is the use of web services. And they could be the answer. They are a standard after all, but unfortunately each development platform seem to implement these standards slightly differently. I've had much fun calling web services authored in Perl and Java from .NET. And that was using code, rather than any web service integration abstraction piece pro
Code - Charles Petzold 2008-02-29 15:57:00 If he didn't have a blog, for me Charles
Petzold would just be that guy who wrote the seminal book on Windows programming. But since he does have a blog, I now know he's written lots of other stuff as well. I guess that shows blogs can be pretty powerful advertising tools, and I guess I'm not the first person to say so. Anyway, since I'm regularly reminded of his existence, I'd been thinking of purchasing "Code" for some time (or hoping somebody would buy it for me) and I eventually got round to it. To tell you the truth it wasn't really what I was expecting. Code to me is what I use to write software, but Petzold uses a much wider definition. Code in this book refers to any kind of code from Morse, Braille through telegraphs, onto machine code, ASCII and finally onto programming languages
Zipping files for Windows Explorer 2008-02-18 16:39:00 As part of my automated build process, I wanted to be able to ZIP up files
. For this I used the excellent (and free!) ZipLib, but there a few gotchas if you want your generated ZIP files to be readable by the built-in Windows
compressed folders functionality. First, Windows XP doesn't like the Zip64 format used by default so that needs to turned off. Second, Windows doesn't like the full path to be included in the file names inside your ZIP file. This means the easiest to use ZipFile class can't be used. Finally, if you're planning to ZIP up the contents of a directory, make sure you delete any ZIP file that was created previously, otherwise you'll try and ZIP up the already created ZIP file. All of these caught me out, but this is what I came up with that now seems to work. string fi Read more:Explorer
Storing variables in a XOML workflow 2008-02-12 15:53:00 One problem with XOML only workflows (i.e no code-behind) is the inability to define properties in your top-level workflow to store values that will be used throughout the lifecycle of the workflow, since you haven't got a class in which to define them. Well that's what I thought anyway until I had the idea of creating a custom activity to store these variables. It's all very simple, add the activity to your workflow and set the Value property to whatever you want, then bind it to any other activities that need access to the value. Here's the code public class VariableActivity: Activity { private string value; [Description("The value of the variable")] public string Value { get { return value; } set { this.value = value; } } }
Metastorm book 2008-02-10 16:27:00 If you've ever wanted to read about Metastorm BPM when you haven't got access to a computer, before now there wasn't really anything available. Now my boss and BPM guru Jerome Pearce has written the 'Metastorm BPM Developer's Guide'. So you can now read all about developing processes when you're sat on the loo. Lulu looks like a great website for cheap book publishing, something I hope to be taking advantage of soon. I'll keep you posted.
Who is Edward Phillips? 2008-02-08 16:09:00 Over the last few weeks I've noticed a strange thing in iTunes. Occasionally a shared music library will pop up called 'EdwardPhillips
's Library'. I'm even able to connect to it and listen to music. It's great, he has over 11000 tracks, not all to my taste but still something else to listen to. I did wonder where this new source of music was coming from and tonight I figured it out. I had a look at my router's web interface and noticed a few unknown computers listed in the DHCP active IP table, in fact four computers (although I suspect they aren't all connected right now). ever since I figured out what was causing our wireless issues I've switched back to an insecure wireless network and I've never bothered to filter out MAC addresses this time around. So it looks like people are taking
FeedDemon 2008-02-06 16:39:00 I've been using RSS Bandit for many years. I did check out FeedDemon when I was initially looking for an RSS reader, but was put off by the price. Yeh I'm a tight arse, what was it, about $25 or so? But RSS Bandit was free and good enough for my needs. Anyway, when I found out FeedDemon was going to be free, I decided it was time to look at again. And boy am I glad I did. First, it just works. Whereas RSS Bandit seemed to have a few bugs (the toolbar turning into a big red cross or the app not loading forcing me to delete some XML files) FeedDemon hasn't crashed once. Actually I'd like to see FeedDemon crash, just to see how it handles it (I'm hoping it offers to send the details off so it can be fixed) Second, it's faster. Yes, I love .NET but real proper compiled Delphi code is always q
Why dynamic languages suck 2008-02-01 15:31:00 I had a little bit of JScript that wasn't working as expected. I stared and stared at it... For a very long time... Here it is.var splitDetails = details.split("\t");for (var i=0; i<splitDetails.Length; i++){ // do something} The problem was that the //do something was never getting hit. Life would have been easier with a debugger but this was server-side JScript in Metastorm which doesn't support debugging so I was forced to just stare at it to work out what was wrong.No doubt you're now shouting at your computer "you're a fecking idiot! The problem is obvious!" and perhaps you'd be right. Perhaps I was just having a senior moment, which I think I'm entitled to have at my age. For those of you who haven't spotted the error I'd typed length with an upper-case L.So what happens here? JS
Building C# projects with Windows Workflow 2008-01-30 15:44:00 After reading a post about using WindowsWorkflow
to build an SMTP server, I started thinking of something I could use WF for outside the world of business processes. For a long while I've also been planning on automating my build processes for various projects I've got on the go. I then realised I could combine the two and develop an automated build system with WF. At this point, if you have any experience of automated builds, you're probably thinking "Why the hell don't you use NAnt or MSBuild like any normal person?", which is a fair point. But using WF has a few advantages. First, as far as I'm aware NAnt and MSBuild don't provide a graphical designer for their build projects (I'm quite happy to be proved wrong on this point) whereas I was able to knock together a designer based on t Read more:Building
, Windows Workflow