SyntaxHighlighter

Thursday, 19 May 2011

Compacting a Microsoft Virtual PC (VPC) Hard Disk

Depending on how busy your VPC installation is, it can grow massively beyond the size it really needs to be, so periodically it is very useful to compact it.

So here is an MSDN blog on how to compact a virtual PC image.

Wednesday, 20 April 2011

Format of the initialization string does not conform to specification starting at index

When I recently moved a site from the dev location to the live location, I got presented with Format of the initialization string does not conform to specification starting at index when trying to make a database connection.


This obviously wasn't happening on the live and the connection string, which was in the Web.Config file, was correct. I was using SQL authentication and the password had both semi-colons (;) and ampersands (&) in it. I wasn't sure which character was causing the problem. As I was able to, I changed the password for the user (removing the ;&). All worked a treat then :)

Tuesday, 19 April 2011

Test a POP3 Connection (Telnet)

I often find myself needing to be able to check a username and password combination for somebodies email connection (normally because they have forgotten their password - again!). A really quick and easy way to do this is using telnet. Here's the easiest way to do it, from the DOS/command prompt:

> telnet mail.mydomain.com
> user my_user_name
> pass my_password


At this point, if all is good, you will have made a successful connection. Show all messages as a list using:

> list

If you want to see the contents of a specific mail then use:

> retr mail_item_number

If you leave the connection with no activity then it close the connection itself, but preferably use:

> quit

There are some more telnet commands here. Also, if you using an IP address, you may well have to use a port number (usually 110). e.g. 123.123.123.123 110

Thursday, 7 April 2011

Could not establish trust relationship for the SSL/TLS secure channel with authority

I recently had this error (Could not establish trust relationship for the SSL/TLS secure channel with authority) when trying to make a remote call from a C# web app. I hunted around and came across this article on thejoyofcode.com.

ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(
    delegate
    {
        return true;
    }
);

So I used the suggested code to bypass the certificate verification, but got a trust level permission error. In order to get round that I modified the Web.Config file to have the trust level set to Full.

Just for the record, this is a quick and dirty hack while I sort out what the actual problem is ;)

Wednesday, 6 April 2011

Free File Recovery

We've all been there - deleted a file we shouldn't have - oops! Well, thanks to this article on LifeHacker we can take a big sigh of relief and use MiniTool Power Data Recovery.


It's free for personal use and chargeable otherwise.

Thursday, 31 March 2011

Microsoft Image Composite Editor

I came across the Microsoft Image Composite Editor courtesy of @bbcclick. It allows you to very easily put together large landscape images. It was quite happy to take these 3 images:


And turn them into this:



It does all the alignment and colour standardising itself - happy days :) It can do other stuff too and I would argue that the join lines are impossible to see.

Here's another:


Friday, 18 March 2011

Changing the RAM/Memory Setting in Microsoft VPC

I recently added a shed load more memory to my lappy (thanks Orca), so I finally got round to increasing the memory on the various VPCs I use. So I did the usual of going to the settings, but the memory slider (to choose how much you want to assign) was not there. Not disabled. Not there at all!

In the end I removed the VPC (I didn't physically delete it, just removed it) and added it again, using the wizard. Hey presto, just like magic, I could change it again.

It's a bit like the old "have you turned it off and on again?"...

Monday, 28 February 2011

I Forgot What Access Was Like...

I haven't used MS Access for a fair while now. There was a time when I used to have use it loads. Thankfully not so much now. The more the years have gone on the more the glorified filing system has got annoying. I remember the good old days of 97 when it did what it said on the tin and didn't try to be too clever for it's own good.

I have had the unfortunate opportunity of using it again today in anger. What a ball-ache! That much of a ball-ache that I decided to blog while I, once again, wait for this update query to run (which would take a matter of seconds in SQL Server). 20 minutes in and I'm slightly bored!

That coupled with my previously stated hatred of IIf, that got right on my tits! So another annoyance to add to that is that you can only have up to 6 nested IIf statements - great! I needed 36. Switch was no good either - that only goes up to 15 (at least in the query editor anyway).

So regular crashes and constant "not an updateable query" messages later - I'm still waiting... Roll on tomorrow so I can get back to a real database and a proper programming language!

Friday, 4 February 2011

Blogger App on Android

Finally here! An android app for Blogger >> http://market.android.com/details?id=com.google.android.apps.blogger

So in honour of it here is a post using it.

Biggest issue far is that there is no formatting - not even basic stuff. But I'm sure that will come...and existing posts aren't available to view.

Thursday, 3 February 2011

If You Can Think Of It, It Will Happen!

Just had a really good one :)

If there's a faint possibility that a parameter for a routine might change, I whack it in the config. Now doing what I do means I work with a lot of different types of coders some good (not many) and some bad (surprising how many!). Anyway, one particular guy is one of those why would they ever want to do that or what's the point, that'll never happen types of guys. Fine - if he wants to do as little possible then that's fine. But. And it's a big but.

Today, the remote mail server they use for emailing from within their web applications has been changed and no longer allows remote mails to sent. Oops!
So all smug I say "just swap the mail server address that you'll have used in your config to use localhost - everybody's happy"
Him - guess what it was...drum roll..."like that's gonna happen, they're all hard coded, gonna take ages to swap all them!"
Me (raising my eyebrows with a small lips twist): "oh well..."

So I feel really good about that :) A classic example of if you can think of it, it will happen syndrome.

Monday, 31 January 2011

PHP: String StartsWith / EndsWith

In case you need the PHP equivalent to the .NET String.StartsWith and String.EndsWith, here they are:


public static function StringStartsWith($string, $search) {
 $ret = false;
 if (strlen($string) >= strlen($search)) {
  $ret = (substr($string, 0, strlen($search)) == $search);
 }
 return $ret;
}

public static function StringEndsWith($string, $search) {
 $string = strrev($string);
 $search = strrev($search);
 return Utils::StringStartsWith($string,$search);
}

Hope it helps :)

Select Multiple Emails in GMail / Google Apps Mail

I found it quite annoying when there were a lot of emails that I needed to delete in GMail. Turns out you can select multiple emails by checking the first item in the list, pressing the shift key and checking the last item in the list - hey presto :)

Friday, 28 January 2011

MSSQL ISDATE - Is It?

Another is it type one from MSSQL, but this time ISDATE. SQLServerCentral.com article by Kameswari Aravindh very kindly makes us aware that ISDATE('1973') returns a true response. So long as the number is between 1753 and 9999, it's a valid year and therefore a valid date.

Bear it in mind!! ;)

Wednesday, 19 January 2011

Kinect Not Exclusive to Microsoft

Quite an interesting article about the makers of Kinect cleverly not giving Microsoft exclusivity to the device! Will be very interesting to see what is going to happen...

Friday, 14 January 2011

Eclipse: Exclude SVN Folders in Project Explorer

If you like me you don't use the SVN tools that are built into Eclipse and you wan to exclude the .svn or _svn folders from the project explorer, do the following:

  1. Right click the project root node > Build Path > Configure Build Path...
  2. Click the Excluded node on the tree in the Properties pop-up and click Edit...
  3. Click to Add... an exclusion pattern
  4. Type in _svn/** and click OK
  5. Do the same and this time add **/_svn/**
  6. Click OK in Properties pop-up
  7. Sorted!

Obviously I have used _ in the example. Swap that for a . if needed ;)

Android: Remove Words From Dictionary

Just a quicky and quite an obvious one really, but in case you need to remove unwanted words from your android custom dictionary, do the following:

Go to Settings > Language & Keyboard > Touch Input > User Dictionary

Press the Menu button and choose Delete. You'll then be shown the same list with a delete button on the right. Select the words to be deleted and click OK when you're done.

Happy days :)

Thursday, 13 January 2011

Rant: VB.NET and IIf

Yes - another rant about VB. I really do dislike it the more I use it and I've been using it for too long! This time it's IIf that's getting on my wick!

Why can't VB have the "normal" inline If like real programming languages
x = (a == b ? 1 : 2) and not this stupid IIf function?

The problem I have (and I'm sure everybody else who VBs has), is that IIf is a function and therefore evaluates it's parameters first. Which then means this:

x = IIf(String.IsNullOrEmpty(textbox.Text), Nothing, Double.Parse(textbox.Text))

fails and has to be changed to this:

x = Nothing
If Not String.IsNullOrEmpty(textbox.Text) Then
    x = Double.Parse(textbox.Text)
End If

OK, I know I can change it round a bit to make fit one line a bit more, but that's not the point. Come on MS, give us a real inline if...

Grrr!!

Saturday, 11 December 2010

Generate Bulk Data

Came across this little puppy the other day to generate bulk data. It's pretty sweet, you can specify what you want and can modify the format of the output.

Good work guys!

Wednesday, 1 December 2010

QR Codes in .NET

I really like the idea of QR codes. I can see so many ways of using them - they excite me ;)

This guy is knocking out a sweet little .NET library to create/encode and decode qr codes. It's open source and ready to go.

This is a nice quick and easy QR code builder that will create a code for you in the meantime and you could use runtime from a site/app you work on.

TechyGypo is a Twit(ter)

Thought I'd sign up myself up a twitter account. @techygypo it is!

Labels

.net (7) ajax (1) android (7) apache (1) asp.net (3) asus (2) blogger (2) blogspot (3) c# (16) compact framework (2) cron (1) css (1) data (1) data recovery (2) dns (1) eclipse (1) encryption (1) excel (1) font (1) ftp (1) gmail (5) google (4) gopro (1) html (1) iis (3) internet explorer IE (1) iphone (1) javascript (3) kinect (1) linux (1) macro (1) mail (9) mercurial (1) microsoft (3) microsoft office (3) monitoring (1) mootools (1) ms access (1) mssql (13) mysql (2) open source (1) openvpn (1) pear (2) permissions (1) php (12) plesk (4) proxy (1) qr codes (1) rant (4) reflection (3) regex (1) replication (1) reporting services (5) security (2) signalr (1) sql (11) sqlce (1) sqlexpress (1) ssis (1) ssl (1) stuff (1) svn (2) syntax (1) tablet (2) telnet (3) tools (1) twitter (1) unix (3) vb script (3) vb.net (9) vba (1) visual studio (2) vpc (2) vpn (1) windows (4) woff (1) xbox 360 (1)