Musings of a Software Engineer

The gentle ramblings of a bored software engineer


Max upload for eShop

Wordpress MU

Wordpress MU

I’ve been looking at setting up an eshop on one of my wordpress accounts and for the downloadable content page for eshop it shows that there is a max upload size.  After alot of hunting around and googling (which I thought might have been easier to find!)

Turns out it was quick an easy find when you know where it is :-) .  To change the max upload size that is listed in the eShop options is for wordpress mu go to the mu site admin section.  In the options section there is a max upload size and also a max blog size as well.  Changing these options changes the listed upload size on the eShop option page, but of course there is still the possible limit on the upload from the php.ini file.  This can sometimes be set by using a .htaccess file.

  • Share/Bookmark
No Comments

Regular Expression

Its been a while since I’ve ventured into regular expressions, and I always seem to find it a nightmare when I come back to it.  But I’ve found a great tutorial which gives a really good overview of each of the magic commands  / syntax that you can use when performing the matching:

http://gnosis.cx/publish/programming/regular_expressions.html

epfw testcase=validation/invalid-chars/epval-invalid-chars-bind36.xml trace_leve
l=3
  • Share/Bookmark
No Comments

Subversion making a tag using the revision number

Subversion logo

Subversion logo

I’m a user of a subversion server on a day to day basis and its probably the best free code repository that is out there.  It is fantastic to use and really simple to update and manage using things like Tortoise SVN.

But today I released that our repository had not been tagged to ensure that we could extract at certain levels easily.  I had a google and it looks like from windows its not easy to do the tag unless you have the working repository complete checked out.  When the size of the respository is probably 100MB and I do not usually have it all checked out its not good.

So after a bit more googling and thankfully I have a linux machine I have access to I found the command that makes creating tags really simply by running a single command that uses the servers own copy and creates the tag without checking out anything.


svn copy -r <revision> https://myrepro/project/trunk https://myrepro/project/tags/mytag -m "My Tag"

There must be a tool that can run this command on windows but I did not see one obviously.

  • Share/Bookmark
No Comments

Wordpress pages hit internal server error

Wordpress MU

Wordpress MU

When I was making the move to wordpress mu one of the strangess things that i encountered was a problem with pages and looking at full page articles.  When every I click on the links I would get an 500 internal server error returned.  Since the way that wordpress mu works it has to rewrite the url quite abit to understand what pages to actually get under the covers, for example:

http://phoenix.adamcoulthard.co.uk/blogs/2009/12/08/wordpress-page-hit-internal-server-error

is not an actual page on the server it gets rewritten to something that the server can handle under the covers.  I think alot of the problems were occuring because of the way that I had installed wordpress mu (at least this is what I think).  I had installed wordpress mu into a directory on the webserver rather than putting it into the root directory.  So when it created the .htaccess file with file rewrite information it added a base rewrite of that directory.  So if I installed it into wordpressmu/ then its rewrite base would have been /wordpressmu/ in the htaccess file.

After alot of googling with very little luck and attempting to use the write logging again with no luck, I started to think about what that rewrite base would mean to the system.  So I had a cPanel setup of *.adamcoulthard.co.uk pointing at /html/wordpressmu/ meaning that all the sites had to go to the wordpressmu folder straight away.  So if the rewrite base was adding on /wordpressmu/ then it would mean that it was going to be trying to navigate to /wordpressmu/wordpressmu/…. leading to the internal server error (I would have expected a 404 not found but nevermind).

So what I did was set the base to being just / and that solved the problems of loading the articles.

  • Share/Bookmark
No Comments

Where have the images gone?

Wordpress MU

Wordpress MU

After the upgrade to Wordpress MU for some reason I “lost” all of my images from this blog, oddly the other blog did not have this problem which was very strange!  After abit of digging I noticed that the url’s being returned for the images had /uploads/ in them rather than /files/ I assumed that the old blog was setup slightly different that caused this problem.

The simplest way to fix this was to manually edit all the posts to ensure that they were correct, rather than using the wordpress admin pages I decide to use phpmyadmin again because it was so much easier to edit them all in one go rather than having to navigate pages.

Now all the images are working as I would have expected with is fantastic :-) .

  • Share/Bookmark
No Comments

Wordpress MU

Wordpress MU

Wordpress MU

As you have probably noticed the site has been bouncing up and down over the last couple of days.  I got an email from my hosting provider to say that I had run out of space on my hosting account.  I had two installs of wordpress on it and wanted to add another but without the space (my hosting provider has upped my limit).

So after abit of searching I tried to use wp-hive which is suppose to be able to use the same installed wordpress code.  I gave it abit of a whirl but at that time it did not provide what I needed, ie the ability to easily move my two old wordpress sites into a central one.  After abit more googling and reading around I thought I should probably try the proper version of wordpress mulit user (WPMU) environment, this runs wordpress.com itself and a number of other high profile blogging sites.

The install of WPMU as for a normal wordpress install was really smooth and worked first time.  I suppose the biggest choice that I had to make when installing was whether to use subdomains or subdirectories.  Initially I thought subdomains so installed it, running through the rest of the install I then hit on whether I could actually update my hosting account to point to the subdomains to the correct location.  So I switched to subdirectories (using a great article).

Using the import I attempted to convert this blog first into the WPMU environment and then switched the subdomain pointer that I already had to point to WPMU.  Sadly this didnt work (still not 100% sure why but I suspect it was something on the URL rewriting), so I had to find a way to do the subdomains with my host.

More googling some time later I found a little trick for cpanel, that in the subdomain pointing its possible to use * as a subdomain and if the host has done the hardwork already in apache (or what ever is being used) all should work.  So I switched WPMU back to being subdomains and setup the blog correctly and everything seemed great!!!

Sadly I hit a few errors as you can probably see if you are reading this in the next day or so all the photos appear to have vanished from the blog! I also hit another couple of problems that I will blog in later blog posts so that they are easier to find for people searching.

  • Share/Bookmark
No Comments

Mass deleting in WordPress

PhpMyAdmin

PhpMyAdmin

What a nightmare… I’ve not really been paying much attention to the 100s of spam comments that I was getting so they had built up to a large amount.  So today I thought I would finally sort them out by just deleting all comments.  I think there was only one good comment anyway.

So I went to the standard Wordpress admin section and looked at the comments section, so I can view 20 at a time which means only being able to delete 20 at a time.  Surely there must be a better way!  The better way is phpMyAdmin, opening that up from my cpanel enabled me to quickly and easily delete all the rubbish comments that I had.

It does seem old that the wordpress admin section does not have a good spam filter built in.  At least then it might be possible to go to the Comments page and go delete all possible spam messages, similar to how an email client works.  At least that might help alittle towards the management of wordpress.  If I understood wordpress code myself / had the time I might think about doing it :-) .

  • Share/Bookmark
No Comments

Where does time go?

Wow its amazing I setup this blog with the intention of posting things to it every week at least once a week.  I think the last time I posted something was about 3 months ago!!! where does the time go.  Well I’m determinded to turn this around in december and attempt to keep an hour free each week to ensure that I do post something each week.  Kind of new Christmas resolution!

  • Share/Bookmark
No Comments

Where are all the cash machines…

Bank Logos

Bank Logos

I think I probably need to get out more, two posts about cash machines.

We were out in London a couple of weeks ago and had got to that point of the day needing some more money.  So you would like trying to find a cash machine would be simple.  Well if you know the area you are in then its probably easy, so we thought lets give the iPhone a work out and search for atm in google maps.  Well it turned out there were no cash machines (according to google maps) for 3 / 4 miles.  Not very helpful, let down by technology number one.

So after wondering around for alittle while we found a machine that was near a tube station, but sadly it had run out of money.  So off in search of another cash machine, we asked the person in a shop and they said that there was on in the tube station.  Great, run down into the tube and take one look at the machine and go mmmm that looks completely knackered.  The screen had some lovely obvious error message on the screen, not quite the blue screen of death that you can see on cash machines.

So after thinking that was it I attempted one last attempt to search for a bank this time on the iPhone, success there was a HSBC near by.  So using the maps and the compass (first time I’d used them together) and was able to navigate to the bank meaning we could get our cash.

Its rare to see a cash machine completely broken in the way above with strange messages.  Usually they just have not working on the screen.  The only other one I’ve seen broken had a great Windows NT blue screen of death on it.

  • Share/Bookmark
No Comments

User Interfaces

Bank Logos

Bank Logos

Wow its like buses I don’t post for two weeks and then two come along at once.  There might even be three if I have to rant again about spam comments on blogs (yes I’m still getting hundreds a day!).

Anyway…. user interfaces, it seems to be a thing that computer scientists are not very good at (well at least some anyway).  You either get the Apple’s of this world (iPod / iPhone / Mac) which are simple but powerful interfaces that are really easy to use or you get others of this world that are not so good.  I’m not going to name and shame anyone in particular at this point but I am going to tell you of an experience I had at the weekend.

So I had a cheque to deposit into my bank account and I’ve used a fantastic piece of technology that allows you to deposit the cheque using a slightly adapted ATM.  Using your cash card as normal but selecting the deposit check, you are asked to insert it into the machine (like put in notes when paying for things).  It then scans the image and works out the amount that is being deposited, all sounds great and its worked everytime I’ve used it before.  But typically when I’m in a rush to be somewhere in the next 10 minutes the technology lets me down.  So up on the screen comes a nice little image of the cheque and the amount to deposit is £0.00!!! bugger I thought.  Ah but there is an amend button, great I thought I’ll press the amend button and enter the true amount.  So I press the amend button and nothing happens… so I press it again assuming that it didnt register the click.  Still nothing, so being a computer scientist I thought oh stupid  programmer at the other end has forgotten to program this bit!  So i pressed the cancel button and stood in the queue to do it with a person.

When I got to the person she said to me had I tried the machine to cash the cheque I said yes but it was unable to scan it and came up with £0.00.  She said oh you can press the amend button and so I said yes but then it didnt do anything.  She said oh yeah once you press amend you just enter the amount there is no message!!!! Now maybe because it was early on a Saturday morning but doesnt this seem stupid!

About 10 minutes later I was explain to my other half why it had taken me so long to cash the cheque and I found myself saying I’m not surprised computer scientists are never very good when it comes to interfaces.  I did wonder what I expected to see, something like a new screen maybe asking for the amended amount or either a message once the amend button was pressed saying please enter the new amount.  Maybe that was asking for to much I’m not quite sure but it did sound like the lady behind the desk had answered that question quite a few times before!

I’m not going to mention the bank in question because that is probably unfair, when the technology works I think its brilliant and a great way of getting through more people.  But it did seem like they were missing the usability testing on the functionality when it was being developed.

  • Share/Bookmark
No Comments