Category: Development
-
Getting W3 Cache Working on shared hosting
I wanted to install w3 cache on shared hosting After uploading the plugin to /wp-content/plugins/ and trying to activate it, I got an error asking me to set CHMOD 777 on /wp-content/w3tc I tried running the command given, however it didn’t work. I also tried manually creating the directory, setting 777 on it, and re-activating…
-
C# – String.Concat vs String.Join
I had a quick Google search for a comparison between string.concat and string.join, but I couldn’t find anything. Say you want to construct the sentence “The quick brown fox jumps over the lazy dog” This is comprised of 9 words, 8 spaces. Using string.concat: public void CreateSentanceUsingStringConcat() { string space = ” “; string the…
-
Quartz.net trigger not firing
I’ve used Quartz.net for a little while – more specifically, around 6 months. I started working with it around the end of October 2009. Irrelevant, you may think, but the important thing here is the time. During winter months, the UK runs on GMT (or UTC+0) During these months, (up until 28th March 2010) my…
-
Implementing DataCash 3D Secure with ASP.net
This is an article I’ve been meaning to write for a while now… Mainly, to help others out, who are struggling with the near non-existent documentation provided by Datacash, when trying to plug 3D Secure into my ASP.net application. I’m sure you’re already familiar with what 3D Secure is, so I won’t go in to…
-
Ass-Kissing Blog Comment Spam
Recently, I have been receiving a large amount of a different kind of comment spam on my WordPress blog. In an effort to get around the Akismet spam protection, they have created several variations of the same kind of poor English, brown nosing comments… that effectively mean nothing. The whole point of them, is to…
-
Creating a new post in WordPress using the JoeBlogs library
A few people have recently been asking how the NewPost method works within JoeBlogs First, you need to create an instance of Post. Then, set the following properties: dateCreated Fairly self explanatory, but you should set this to today’s date (or whatever date you wish the post to be set as published) title The title…
-
NVelocity template with decimal to two decimal places
I wanted to be able to output a decimal value from an object in my NVelocity template. For example, the value of the decimal was: 3.40000 to represent 3.4. The end result: Total Order Value: 3.40 GBP I needed to display this as currency format. Sure, I could of used this String.Format method, but that…
-
How to change the language on a Buffalo LinkStation from Japanese to English
I recently had massive problems with my LinkStation and had to flash the firmware on it…. When I finally got it up and running again, my admin screen was in Japanese!! I followed the instructions on the FAQ – http://www.buffalo-technology.com/knowledgebase/users/kb.php?id=10213&category_id=5&sid2 I thought I’d just put a few pics up to illustrate it a little better:…
-
C# Ternary conditional operator – Question mark in an if statement
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;…
-
JoeBlogs – Typo in dummy URL fixed
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 http://www.yourdomain.com/xmlprc.php (if your wordpress blog is installed…
-
Reverse GeoCoding with Google API and C#
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)…
-
Could not load file or assembly ‘ChilkatDotNet2’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
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…
-
Windows Azure Pricing Announced
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…
-
Using JoeBlogs -metaWeblog API Wrapper
Step 1 Download the latest release of JoeBlogs from Codeplex (Click the Downloads tab, and select the latest download) Step 2 Unzip the contents of the downloaded zip file. (I usually copy DLLs I am going to use into a “lib” folder at the root of my solution) Step 3 Add a reference to BOTH…
-
Why Are Interfaces Useful?
Interfaces, usually prefixed by “I” are useful in software engineering, for a number of reasons. Primarily, they allow you to create “pluggable” code. By this, I mean that your code is easier to manage, easier to maintain, easier to change the way certain parts of your application work, without changing the entire way it works.…
-
Missing Files from DotNetNuke 4.9.4 Starter Kit causing error
I downloaded the latest release of the Dot Net Nuke Starter Kit (Version 4.9.4 released on 23rd June 2009) I followed the instructions to install the Visual Studio templates etc… as found here They are a little outdated, but the same process still applies. Upon installing it, loading a new website, I selected the DotNetNuke…
-
Reset IDE settings in Visual Studio 2008
I recently acquired a PC at my new job where there was an existing installation of Visual Studio. This was fine, however it was set up for a VB.net developer. Whilst I do use VB.net, I didn’t want my VS set up this way. I wanted to re-instate that lovely screen you see when you…
-
String.EndsWithAny and StartsWithAny Extension Method
It frustrated me that while String provides the StartsWith and EndWith method, it doesn’t provide an EndWithAny. So, if I wanted to see if a particular string started or ended with any specified string, I would have to create my own method to return a true or false. Whilst this is fine, it’s a little…
-
Base checksum mismatch – A solution for TortoiseSVN users.
I recently had the misfortune to get a Base Checksum Mismatch error, when I tried to check in files to my repository. The problem occurs when the files svn data has become corrupted. There are many solutions to this problem, but here’s how I solved it simply (I only had 2 files that had this…
-
Copying tables across databases with SQL Server
So, you’ve got a requirement to move or copy a table from one database to the other? Including data? Use SELECT INTO. For example, we have a database called “MyDatabase” We also have another database – “MyNewDatabase” MyDatabase contains the table “Customers” – with a bunch of data that we want to preserve. You need…
-
Windows Azure – Firefox & “Port Restricted for Security Reasons”
I’ve been starting to delve into the world of Windows Azure this week. After getting the Azure Samples loaded, I tried running one of them (just by hitting F5 in VS) and, as Firefox is my default browser, got a “Port Restricted For Security Reasons” error. Of course, it worked fine in IE Here is…
-
Fix for Mail Enable – %1 is not a valid Win32 application.
As mentioned in a previous post, I am in the middle of changing my hosting, from a reseller account, to my own VPS. After working closely with eHosting support, I’ve managed to beat into submission the large majority of the features required. One thing however, was the installation of MailEnable Standard (the free one) It…
-
Session_Start event not firing
I’ve been scratching my head about this one for sometime… As I’m sure your aware (or you wouldn’t be reading this) in the Global.asax file, we have the following method: protected void Session_Start(object sender, EventArgs e) { } Placing a breakpoint on this method, I attached the debugger, ran up my application, and the breakpoint…
-
Trimming in SQL Server
If you have imported a large amount of data, or had some rogue users, helpfully putting a space at the beginning and / or end of a string, then this simple update will clear that out: UPDATE TableName SET ColumnName = RTRIM(ColumnName) Of course, if you only want to select the data, you could also:…