CategoryDevelopment

C# Ternary conditional operator – Question mark in an if statement

C

I’m all for shortening the amount of code we write, if it makes it more readable. One enhancement I make use of in C# is the ternary conditional operator. Consider the following block of code: string input = "hi"; bool saidHello; if (input = "hello") { saidHello = true; } else { saidHello = false; } In this example, we can see, the saidHello boolean value would be false,  as the input string...

JoeBlogs – Typo in dummy URL fixed

J

I’ve recently had a few comments that the JoeBlogs wrapper wasn’t working – and they were getting an “invalid response” or more specifically “Response XML not valid XML-RPC – missing methodResponse element.” It seems that I had a typo in my comments in JoeBlogs.TestHarness/Program.cs on line 15: //typically (if your wordpress blog is installed in root dir) The problem, is the xmlprc.php – this...

Reverse GeoCoding with Google API and C#

R

I needed to write a function to get a set of co-ordinates from an address, supplied as a string. Using the Google API, I came up with this: First, I created a struct, to represent the lat and lon co-ordinates: public struct Coordinate { private double _latitude; private double _longitude; public Coordinate(double latitude, double longitude) { _latitude = latitude; _longitude = longitude; } public...

Could not load file or assembly ‘ChilkatDotNet2’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

C

Whilst setting up an application to run on my local machine (running Vista 64bit) I encountered this error: Could not load file or assembly ‘ChilkatDotNet2’ or one of its dependencies. An attempt was made to load a program with an incorrect format.   Obviously, the application uses ChilKat components, but it would seem that the version we are using, is only the 32bit version. To...

Windows Azure Pricing Announced

W

Microsoft has finally released their pricing model for the forthcoming Windows Azure Windows Azure: Compute = $0.12 / hour Storage = $0.15 / GB stored / month Storage Transactions = $0.01 / 10K Bandwidth = $0.10 in / $0.15 out / GB SQL Azure: Web Edition – Up to 1 GB relational database = $9.99 Business Edition – Up to 10 GB relational database = $99.99 Bandwidth = $0.10 in / $0.15 out / GB .Net...