Thursday, May 28, 2009

Friday, May 22, 2009

When Would You Use GUIDs As Primary Keys?

Here's a question which I'm sure comes up in the odd interview or developer water cooler debate:

There's many answers, but the quick win is: "When using a de-centralised database."

Thursday, May 21, 2009

One Post To Bind Them All: Security, Antivirus And Firewalls

Thought I would create a single post for keeping a log of all security 'best-of' links, (hopefully) updating and bringing it to the top when necessary...

First, lists:
Next, articles:
Blog entries and expert advice articles:
Finally, direct downloads:
Commercial anti-virus applications, most with free, online utilities:
If you have other links/advice, please leave comments...

LifeHacker, Stuff You Didn't Know And Links

The latest from LifeHacker - VLC changes you probably didn't know about and how to stay safe from Google:

Tuesday, May 19, 2009

Scared? RTFM! Be Informed And Don't Kill!

People should be more informed. That might be easy to say in an information age when there is too much information (or "info"; go figure) to cope with (see the existence of Twitter as proof of information curbing) sensibly. Reading articles is, believe it or not, the better way to stay informed simply because glib and media hungry headlines are the quick start for selling papers and page hits.

If you don't believe me, check out Cracked's latest: http://www.cracked.com/blog/dont-listen-to-jenny-mccarthy

I completely agree with the article. If the media were to treat their content with respect they would title appropriately - and don't tell me that a good title is hard to generate from any story. If CNN and FOX can broadcast the thinly veiled rubbish they headline as even news-worthy (see just about any Hate By Numbers on Cracked.com for evidence.

Explorer Improvements

Wednesday, May 13, 2009

London To Brighton Bike Ride For British Heart Foundation

As the 58 mile bike ride from Clapham Common to Brighton Pier on the 21st of June draws ever nearer, again, I would like to remind everyone that if you're not taking part you can still participate by sponsoring me...
I really appreciate all sponsorship and though I am not taking special requests I do promise to do my best and get there as fast as I possibly can.

This year I'll essentially be racing my brother, whose only mode of transport is his bike, so for me, whose typical mode of transport is the train, this is a challenge! I don't know how he'd fare in the dojo, though.

If you do want to take part, please visit BHF's website where, for the first year ever, you can sign up online:

Get Rid Of Spam! Temporary Inbox Heaven!

So, with the demise of Temporary Inbox I went searching for some new site which offer completely dynamically assigned email addresses. These are basically mail servers which accept any email sent to their list of domains, store them for a given period, not always keeping attachments, and then delete them. This means that any address is always valid, for example bubble@mailinator2.com or eriguiegb@mailinator.net are both valid emails. Also, checking their inboxes is as simple as going to the host site and entering the email address you want to check.


Of course!

Tuesday, May 12, 2009

T-SQL "WITH NOLOCK"

Ignoring the locks SQL places on tables during transactions can be useful, but be careful:

LifeHacker Daily And Recycle Bin On Task Bar

Ok, so I was reading today's LifeHacker articles and here's a thought which never occured to me before: (Windows 7 has) A recycle bin icon on the taskbar for dropping things straight to it without being able to see the desktop:
Now, if you're like me and put things in the bin by hitting delete, this won't impress you too much. However, there are a lot of people out there, mostly ex-Apple and GUI-obsessed users, who "drop to delete". This is for them. And those who can't be bothered to use the keyboard(?)

I'm also adding a right-nav link to Wiggins' Hacks & Tricks tag page:
Now the dailies...

Monday, May 11, 2009

chrome-ui://

Google's Chrome browser has a lot of hidden stuff. Some things I've found are:
And here's some other easter eggs:

Web Design Prototyping

Found this from twitter, allowing you to prototype website design:

Thursday, May 07, 2009

Ballpoint Pen Art

Ran across this on StumbleUpon.com and just had to post it because this artist really has talent:

Wednesday, May 06, 2009

Brüno

Saw the preview showing of Brüno last night, Kingston Odeon, and can definately say that if you didn't like Borat you'll hate Brüno!

Started well, got good and ended disturbingly :) The **** helicopter is not to be believed, especially when it then says, "Brüno". After that, the most memorable quote has to be, "Have a good life" and hardest to watch is either the whipping scene at the swingers party or the gay sex in the cage fighting cage - especially when the flying chair narrowly misses both their heads!

All in all, very funny movie that is an ideal follow up to Brüno, just finer tuned :)

Some fun for you:

Nasty Future Food.


Nice. I Like You.


http://www.booooooom.com/2008/12/01/project-5-submissions-part-7/


Tuesday, May 05, 2009

Paging In T-SQL (SQL 2005)

Needing some paging ability for pre-XSLt operations (to keep it all database-side and avoid the hard work in C#) I found this neat little post which helped me create some very compact and efficient paging T-SQL:

LifeHacker and Best Utilities

Latest from LifeHacker, preceded by some awesome utilities links:
And now the awesome recent:
And my latest tools downloads:

Friday, May 01, 2009

Alternate Row Colouring In XSLt

So, trying to get rows coloured alternately in an HTML table is easy in .NET, just a styling option, but in XSLt it's a little harder. Check out this post for an easy solution:

Ctrl+Left Shift Vs. Ctrl+Right Shift = Chrome Justifying

I've been battling with Google Chrome for a while because it keeps messing about with my text entry on web forms. The text justification just goes wrong after I do a certain key combination and until today it completely baffled me.

Finally solved it: Ctrl + left Shift = Left justify. Ctrl + right Shift = Right justify.

I don't really understand this even existing as an option, but I also seem to remember reading about it, thinking it was a good idea and turning it on. Now I can't remember how to turn it off, but as soon as I find out I'll post it here! Grrr.

Posting Code On Blogger/BlogSpot.com

I've been trying to post code to my blog for ages. Sometimes I suck it and just hand craft all the little symbols which need manipulation, but today I was trying to post a shedload of XSLt and there ain't no way I'm going through that by hand!

So, a quick google about and here is a couple of really good links:
Having said that, LiveWriter is pretty good at posting code and is my preferred weapon of choice.

[EDIT] Ah yes, the problem with LiveWriter is that it won't install on Windows Server 2003, as won't the other Live applications.

Date Formatting In XSLt

I wanted a date to be changed, essentially a string containing a date time. See my previous post for some good XSLt links, but here's my solution:
<xsl:call-template name="FormatDate">
<xsl:with-param name="DateTimeParam" select="@InvoiceDate"/>
</xsl:call-template>

<xsl:template name="FormatDate">
<!-- expecting datetime example: 2009-04-20T00:00:00 -->
<xsl:param name="DateTimeParam" />


<!-- reformat date param to be easier to use -->
<xsl:variable name="DateTime">
<xsl:value-of select="substring($DateTimeParam,1,10)"/>
</xsl:variable>

<!-- new date format January 20, 2007 -->
<xsl:variable name="year">
<xsl:value-of select="substring-before($DateTime,'-')" />
</xsl:variable>
<xsl:variable name="mo-temp">
<xsl:value-of select="substring-after($DateTime,'-')" />
</xsl:variable>
<xsl:variable name="mo">
<xsl:value-of select="substring-before($mo-temp,'-')" />
</xsl:variable>
<xsl:variable name="day">
<xsl:value-of select="substring-after($mo-temp,'-')" />
</xsl:variable>

<xsl:if test="(string-length($day) &lt; 2)">
<xsl:value-of select="0"/>
</xsl:if>
<xsl:value-of select="$day"/>
<xsl:value-of select="' '"/>
<xsl:choose>
<xsl:when test="$mo = '1' or $mo = '01'">Jan</xsl:when>
<xsl:when test="$mo = '2' or $mo = '02'">Feb</xsl:when>
<xsl:when test="$mo = '3' or $mo = '03'">Mar</xsl:when>
<xsl:when test="$mo = '4' or $mo = '04'">Apr</xsl:when>
<xsl:when test="$mo = '5' or $mo = '05'">May</xsl:when>
<xsl:when test="$mo = '6' or $mo = '06'">Jun</xsl:when>
<xsl:when test="$mo = '7' or $mo = '07'">Jul</xsl:when>
<xsl:when test="$mo = '8' or $mo = '08'">Aug</xsl:when>
<xsl:when test="$mo = '9' or $mo = '09'">Sep</xsl:when>
<xsl:when test="$mo = '10'">Oct</xsl:when>
<xsl:when test="$mo = '11'">Nov</xsl:when>
<xsl:when test="$mo = '12'">Dec</xsl:when>
</xsl:choose>
<xsl:value-of select="' '"/>
<xsl:value-of select="$year"/>
</xsl:template>

How To Count Elements In XSLt

In looking to count the number of instances of an XML element I was looking about for a piece of XSLT. Every example I came across had the xsl 'number' element within the 'for-each' element, which meant that the XSLT had to parse the element I was counting first. I didn't want to have a 'for-each' involved at all, but eventually I was in luck, and it's much easier that using a 'number' element:

<xsl:value-of select="count(elementname)" />

I was directed to this solution by experts-exchange: http://www.experts-exchange.com/Web/Web_Languages/XML/Q_21294193.html

However, if you do want to perform counting operations, this is an excellent starting point: http://www.w3schools.com/Xsl/el_number.asp

And for more general XSLt references:
I highly recommend D. Pawson's site as it is basically a massive list of examples and explanations for just about everything anyone would ever want to do in XSLt.

Also, of course, the http://www.developer.com/xml/article.php/3383961 article will tell you everything you need to know about traversing XML - especially useful if you are writing code which needs to build, navigate or parse XML.

Latest Links For Today... Awesomeness Abounds!

LifeHacker this friday... first the serious stuff:

Thursday, April 30, 2009

Instant Messaging Tools

Wow, I seriously underestimated the number of instant messaging applications out there. I've been using MSN Messenger for a long time (hasn't everyone?) and now I work on Windows Std Server 2003 I can't - the two are incompatible, as is iTunes/WS2k3. So, I went looking for a replacement which might run on WinSrv2k3, and a quick google of "instant messenger comparison" brought me to this neat link:
Having said that, of course, there are plenty of tools, APIs etc out there to let you build your own instant messaging application - including an MSN Messenger app!...

Code and API's for developing with Microsoft's MSN Messenger service, found via:http://www.google.com/search?rlz=1C1GGLS_en-GBGB299GB309&sourceid=chrome&ie=UTF-8&q=c%23+msn ...
A number of these utilise the DotMSN API:
Also, dubiously, there is this, which I am just not sure about yet, perhaps it's a goldmine, perhaps a landmine: http://www.wonderhowto.com/how-to-hack-msn-web-cam/

Word Of The Day: Magnanimous

http://dictionary.reference.com/browse/magnanimous

mag⋅nan⋅i⋅mous   [mag-nan-uh-muhs]

–adjective

1. generous in forgiving an insult or injury; free from petty resentfulness or vindictiveness: to be magnanimous toward one's enemies.
2. high-minded; noble: a just and magnanimous ruler.
3. proceeding from or revealing generosity or nobility of mind, character, etc.: a magnanimous gesture of forgiveness.

Wednesday, April 29, 2009

Reading Code As A Learning Tool

Scott Hanselman has been posting code snippets for a while on:
http://www.hanselman.com/blog/TheWeeklySourceCode41SearchingCodeSharingCodeAndReadingCodeAndComments.aspx

I think this is a pretty good way to get used to other styles, understanding and developing an inate ability to become flexible when required to produce code interfacing with other systems.

Also, as Scott points out, is the Google Code Search, where you can highlight code placed on your own site to the Google search engine: http://www.google.com/codesearch

Someone's Gonna Get It, Links, LifeHacker And Gizmodo

Oops: http://gizmodo.com/5231972/best-buy-sells-customer-a-large-brick-in-place-of-a-macbook-pro-literally

Today's Gizmodo favourites:

Word Of The Day: Erudite

http://dictionary.reference.com/browse/erudite

er⋅u⋅dite   [er-yoo-dahyt, er-oo-]

–adjective

characterized by great knowledge; learned or scholarly: an erudite professor; an erudite commentary

Tuesday, April 28, 2009

Splitting Strings in T-SQL

[EDIT] A very good collection of solutions:

From an ex-colleague (with some alteration):

Create Procedure ReturnStringAsTable
(
@REQUEST VARCHAR(500),
@dividingChr VARCHAR(1) = ','
)
AS
BEGIN
DECLARE @CURRENT_TABLE VARCHAR(200);
DECLARE @INDEX_TO INT;
DECLARE @INDEX_FROM INT;

DEClARE @DATASETINDEX TABLE(ID INT IDENTITY(1,1),[NAME] VARCHAR(200))

SET @INDEX_FROM=0;

SET @INDEX_TO= CHARINDEX(@dividingChr,@REQUEST,@INDEX_FROM);
SET @INDEX_TO= CASE WHEN @INDEX_TO <=0 THEN LEN(@REQUEST)+1 ELSE @INDEX_TO end;

WHILE @INDEX_FROM <>
BEGIN

SET @CURRENT_TABLE=RTRIM(LTRIM(SUBSTRING(@REQUEST,@INDEX_FROM,@INDEX_TO-@INDEX_FROM)))
IF LEN(@CURRENT_TABLE)>2
BEGIN
INSERT INTO @DATASETINDEX([NAME]) VALUES(@CURRENT_TABLE);
EXEC ('SELECT * FROM ' + @CURRENT_TABLE)
END

SET @INDEX_FROM = @INDEX_TO+1

SET @INDEX_TO= CHARINDEX(',',@REQUEST,@INDEX_FROM);
SET @INDEX_TO = CASE WHEN @INDEX_TO > @INDEX_FROM THEN @INDEX_TO ELSE LEN(@REQUEST)+1 END;
END

INSERT INTO @DATASETINDEX([NAME]) VALUES('INDEX_TABLE');

SELECT * FROM @DATASETINDEX
END




CREATE FUNCTION Split(
@IDValues as varchar(500),
@Delimeter as varchar(1)
)

RETURNS @tValues TABLE(IDAux INT)

AS

BEGIN

DECLARE @I AS INT, @Aux AS INT
SET @I = 1
SET @Aux = 1

WHILE @I <= LEN(@IDValues)

BEGIN
IF SUBSTRING(@IDValues,@I,1)= @Delimeter
BEGIN
INSERT INTO @tValues (IDAux) VALUES (CAST(SUBSTRING(@IDValues,@Aux,(@I-@Aux))AS INT))

SET @Aux = @i + 1
END

SET @i = @i + 1
END

RETURN

END

GO

--examples with differents delimeters

select * from Split('1058,1059,1060,1062,',',')
select * from Split('1058|1059|1060|1062|','|')
select * from Split('1058;1059;1060;1062;',';')

Capoeira

Swine Flu, Terabyte Holographic Discs And More...

Gizmodo and LifeHacker...

Monday, April 27, 2009

Windows Mobile Video Blogging

I want to be able to stream video direct from my Windows Mobile HTC camera, but until I find (or build) a mobile app to let me do that, I'll have to make do with the ideas in this cool little post:
And an update, it is possible, but only with Nokia and iPhone:
Just discovered service Qik which provides live video streaming apps for a hell of a lot of mobile phones so I signed up, installed and am up and running! A revolution in blogging!

Check out the mobile links for the sites I found!

Nooooo.....

Latest LifeHacker And Gizmodo Links: Anti-Malware, Tetris Buildings And Geekiness

LifeHacker:

Saturday, April 25, 2009

Bill Hicks "Lost" Segment from Letterman

Well, I always mourned the fact that I didn't recognise Bill when he was on The Word, that I never got a chance to see him play or that I returned a CD, received by accident, to Amazon of his live show. Apparently, David Letterman regrets things too; And well he should, as this piece is truly amazing, though much will have been re-used elsewhere - Lettermen finally decided to show Bill's set from his controversially cut show in October, 1993.

I really have never had respect for Letterman, but this raises the bar, though I can never quite get rid of the creeping discomfort I always feel when I see him interview someone, as though his inate Americanism is half a step away from massive, embarressing faux par.

Check Bill's site out here: http://www.billhicks.com/index.html


Rest In Piece and fucking Rock On Bill.

Friday, April 24, 2009

A very cool list...

This little flickr entry lists some amazing uses of google maps and earth, I just had to blog:

Latest LifeHacker Links

Some really awesome links here from LifeHacker today:

Oh God The Horror

What do you do when the virus breaks out and zombies start munching your friend's head? Damned if I know, but fortunately, big brains have been working on the issue - presumably to keep themselves at thir respectable size...
All found via:

Thursday, April 23, 2009

Friday, April 17, 2009

Workstation UnLock

For a long time now, I've been looking for a way to unlock a Windows computer programmatically. I'd like to be able to write a service, for example, which can unlock the machine and log in a user, rather than a session (which has no visible affect on the running screen), but simply logging back in the current user would suffice. Frankly, anything would do. There are many uses for this type of code, but my initial thrust was to develop a bluetooth app for my Windows Mobile device which would log me back into my machine when I walk back into range - a simple device detection app on the host machine; doesn't even have to communicate.

So far, I have been greeted with false starts, low-level C++ code (which, for me, never developed to full-fledged Windows coding) and basically tonnes of code which never claimed to work properly.

So, here I am going to log my efforts and record links to resources which might, probably won't, but might prove useful at some point:

Small Post About MVC

Looks like there's some movement in the ASP.NET MVC market, finally, so lets get some links up:
Some MVC resources:

Friday, April 10, 2009

P2P What I/You Need To Know

Ok, first off: If articles like this http://lifehacker.com/371653/caught-downloading-copyrighted-materialnow-what or this http://gizmodo.com/5066280/almost-half-of-net-traffic-is-not+so+legal-p2p-and-itll-really-take-off-soon scare you, you should probably stop right here, uninstall whatever P2P software you have and signup for online Blockbuster or something (there are better services, not to mention the online ones!) because actually downloading potentially illegal files will scare the socks off you. That's not to say it's scary, difficult or even illegal - if done RIGHT.

Secondly, I'm not advocating sharing illegal files. I pretty much subscribe to this 'manifesto', if you will: http://i.gizmodo.com/5202399/a-pirates-code-of-conduct-for-bittorrent. Personally, I do not intend to break copyright laws, rip-off artists or content producers and I certainly intend to actively help struggling industries, like the British movie industry, because I want movie makers like Simon Pegg and Ricky Gervais to keep me entertained. If the niche, intelligent and truly original creators are supported we will be kept wallowing in Shakespearian quality media for a long time to come!

Having read recently the following articles on LifeHacker and Gizmodo:
I thought it would be appropriate to bone up on some P2P security and best practices. Not that I do P2P, of course. Having said that, it would be nice if the content providers out there were to realise that if they provide customers (ie: potential customers/file-sharers) with what they want they would instantly become loved and extremely rich and probably immediately end the global crisis (new jobs, lots of new customers, new shows - all would be possible tomorrow.)

For starters, on the subject of P2P file sharing, there is the whole security thing, which LifeHacker and Gizmodo have neatly covered in a reader friendly way:
Amongst those articles, you'll find useful links for things such as:
And finally, good information comes in all forms, and on the internet this means the best way to find up-to-date links. I like tagged articles on well circulated sites, for example:

Wednesday, April 01, 2009

More Augmented Reality

Found these links and just need to make sure I can find them again. Some C# code for augmented reality projects, most based on C++ though...

Online File Storage Services

I've been looking for online file storage sites. I intend to expand on this, but for now, here is what I've found:

Big name assumed reliable sites (multi-discipline):

More Gizmodo Favourites

Just some more favourites design to entertain, enlighten and enjoy...
First, the best of the best:
And now the favourites:

Tuesday, March 31, 2009

Friday, March 27, 2009

PC Upgrade Update

So this morning I finally got around to installing the 2GB RAM to replace the two 512MB sticks in my DELL Vostro. Everything seems to be running fine, no problems booting back up and the Crucial memory scanner seems to be telling me the RAM is installed just fine. One problem, XP Pro is only showing 3.25GB in System Properties. It's ok, though, I knew this would happen as XP can only recognise 3-3.5GB.

This I might have to step up to Vista ... ulp.

[EDIT:30/02/2009] Prompted by an anonymous comment on this post, I felt it wise to expand on my endevours, or at least provide some more information. Anon is indeed correct that 32 bit OS's are limited (as far as Windows goes) in accessing RAM...

Thursday, March 26, 2009

Wednesday, March 25, 2009

The Browser Wars Rage On

http://www.dearie6.com/

Yep, a lot of people hate IE6. I do too, but I don't have to work with it - that's for front-enders, or the "UX team". For those who are interested, the current browser usage:


Scary, eh? It was only September 2007 that IE6 was knocked off the top spot , but it's still hanging strong in third place. Why? Well, there are a lot of opinions and statistics will only get you so far. My opinion being that too many people are comfortable with it and don't know what a Web Browser actually is. Sounds crazy, but I often run into people asking how to use (insert website name here) as a product, as if it's installed on their computer - totally unaware that it isn't. The most common assumption (in my experience) that web-based email is only available on the home computer.

The issue there is lack of understanding driven by interest. As time passes this will dissipate and the general awareness of internet-based, or cloud-based, technology improves.

Another favourite statistic of mine is screen resolutions. A lot of managers request and designers still work to 800x600. I do not understand this. At all. Everyone, for years now, has been obsessed with bigger and better: TV's, cars, monitors, memory, money, etc. But...


So lets cater to the majority people, it's not hard, in fact it's easier. And the next time I see a page design where the content you actually wanted only takes a 1/4 column and 1/3 height of the page I swear I'll throw the machine out the window.

For developers out there, here's a interesting statistic:


I'm a C#'er, so it's encouraging and depressing in equal measure for me!

Rube Goldberg. I'm just going a little crazy this morning.




Monday, March 23, 2009

Sports drinks and regular exercise

I've joined a gym and in an effort to discover what really is good for me, in an of Average Joe kind of way, I looked up 'electrolyte'. This is something I've heard a lot of people mention is important in the body, something you lose when exercising and in 2010 the astronauts hated the taste of the eletrolyte replenishment drink. Anyway...

Links:
  • Electrolytes are solutions of acids or salts
  • They help the body conduct motor control electrical signals
  • Electrolytes are gradually lost during exercise
  • Only intense and extended exercise requires extra electrolyte replishment
  • Extreme exercise without replishment may result in overhydration
Ok, so lesson 1 here is that when you go to the gym or dojo (as is my preference) you won't need anything other than water, simply because your body is not losing enough electrolyte solution to need something like lucosade or gatorade. They are overkill and the extra sugar you're getting might be doing your teeth more damage than your body will otherwise gains in benefits elsewhere.

If you are involved, for example, in an Iron Man, Ultramarathon or even (as I will be) the London To Brighton Bike Ride for The British Heart Foundation you will need supplement drinks. If, however, you are simply "down the gym during lunch" (as I will be, also) you won't need anything more than water.