SyntaxHighlighter

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!

MSSQL ISNUMERIC - Is it?

I didn't realise that ISNUMERIC('123 £') returns 1 - did you? If you didn't either then I'd suggest you read this article Why doesn't ISNUMERIC work correctly? by Jeff Moden on SQLServerCentral.com.

Taken from the article, the easiest test is to use a regular expression:

SELECT *
FROM mytable
WHERE mytable.mycolumn NOT LIKE '%[^0-9]%'

There is also a useful function he has written that could prove to be handy.

Thanks Jeff. Think I'd better re-trace some steps to make sure scripts using ISNUMERIC are a bit tighter!

Friday, 26 November 2010

Rant: VB.NET and Arrays

I can't take it any longer and I have to air my serious frustration with VB.NET and the way it makes you handle arrays - aarrrggghhh!

In all the languages I have come across and know it is only VB that declares arrays wrongly. There's no possible reason why an array declared with 3 elements should have 4. it's stupid!

Dim myArray(1) As String
myArray(0) = "1"  'Most languages would stop here - not VB!
myArray(1) = "2"

This is hard for me to accept - it so annoys me :@ But, don't cut off the hand that feeds the mouth and all that rubbish. So I keep quiet and truck on...

The bullet in the head came recently when I wanted to resize an array. So being a good boy I used the Array.Resize method. This is what caused the rant...VB has double standards!

I wanted to add an element to myArray(1) to make it myArray(2). So on the basis of the Dim statement I did:

Array.Resize(myArray, 2)

FAIL! You have to do:

Array.Resize(myArray, 3)

VB - make your frigging mind up!!
I know, I know...I should use an ArrayList, but I was dealing with someone else's code so was stuck with stupid VB arrays - grrr!

MSSQL Reporting Services: Invalid Object Name on Temporary Table

I had an Invalid Object Name error when I was using a temporary table inside a stored procedure when I was reporting services. It ran fine in management studio but errored in the report designer wizard.

Fixed it by using the SET FMTONLY OFF command. Happy days :)

Thursday, 25 November 2010

MySQL Reset / Reseed Indentity Column

So, there I was refreshing all the data in a MySQL dev database and the TRUNCATE statement wasn't resetting the identity column. Bummer. Hey ho, was probably something to do with the table format. But I couldn't be arsed to mess about with that so used the ALTER TABLE statement to do it instead:

ALTER TABLE `my_table_name` AUTO_INCREMENT = 1;

I needed to set the identity back to 1, but use whatever number you need it to be set to.

Tuesday, 23 November 2010

HeidiSQL: MySQL Client


Just started using a nifty MySQL client for Windows called HeidiSQL. I haven't long been using it anger, so I can't say whether I am 100% happy with it yet. I've used it a reasonable amount and so far it has been ace.

It's free to use and you can donate if you like.

Wednesday, 17 November 2010

Monitor High CPU Usage in SQL Server

Been having a situation with a client of mine recently where the SQL Server has been thrashing the CPU and ultimately killing it. And what comes through this morning in the SQLServerCentral.com newsletter but an article Geoff Albin wrote on how to monitor high CPU usage in SQL Server.
Sweet :)

Tuesday, 16 November 2010

PHP File / Page Names Containing Only Numbers

Just had a pretty cunning one where having moved a site to a new server running PHP version 5.3.3 pages/files that were named with only numbers (e.g. 123.php) raised a 500 internal server error page.

This had clearly not been a problem on the previous Windows (IIS) server running PHP 5.2, but was on this one. Now whether or not this was a PHP version difference or a server difference, I don't know.

I fixed it by renaming the file to contain at least 1 letter. So it is now named 123a.php.

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)