Posts

Showing posts from 2013

Setup Pretty Permalinks in WordPress

I recently received a Raspberry Pi for my birthday and on my to-do list was to turn it into a web server and host a blog on it. Using Pretty Permalinks Setting up the web server proved to be fairly easy and so was the installation of WordPress. However, I wanted to use the Pretty Permalinks  feature, so my url's would look clean and readable. I enabled pretty permalinks in the admin and set the correct permissions on the .htaccess file $ sudo chmod -v 666 .htaccess I thought this would be all i needed, however when i clicked on a blog post all i got was a 404 page not found error.

Nokia Maps rendering issue using IE8 & Twitter Bootstrap

Image
Today at work we had the problem where a standard Nokia map, with a pointer would not render the map images, the overlay controls where there, such as the zoom and view type etc, but it would just show a white background. See image below: Nokia Maps not rendering correctly in Internet Explorer 8 As you can probably guess, this only becomes a problem when using Internet Explorer 8 or lower. Since there isn't really a good spread of knowledge on Google when it comes to Nokia maps. We needed to fix this one ourselves. The Solution To cut a long story short, we were using the Twitter Bootstrap HTML5 framework and the problem was down to this bit of CSS in bootstrap.css img { width: auto\9; height: auto; max-width: 100%; vertical-align: middle; border: 0; -ms-interpolation-mode: bicubic; } The max-width: 100% was the culprit, I believe this is used by the Bootstrap responsive element to resize images when the viewport changes. Using the following conditional

Error Using Python Requests Library - TypeError: 'dict' object is not callable

A recent task at work was to generate a Python class that could be used by developers to interact with our API. One of the methods in that class was to do a curl call to our API. For this i used the very nice Requests Library  and since our API returns output in JSON, i used the: r.json()  function to return the output. This worked fine on my Mac, but when this was tested on a Windows machine it returned the following error: line 68, in doCurl    print r.json()  TypeError: 'dict' object is not callable The solution, or so I thought was to use:   r.json As documented in the Love Python blog article. This worked wonders for the Windows machine, but as a consequence, it made my Mac spit out the following: <bound method Response.json of <Response [200]>> Since Python is not one of my strongest languages, (I've only been learning it for a few days!) I have no solution as to why this is happening and how to fix it. In the end I settled for us

PayPal OAuth Intergration - IDSW_333 - there may be missing request parameters or this site is not approved to use

At work today I was tasked with setting up a Login with PayPay type of app, where, instead of filling out a registration form, you just login with an existing account, you've probably seen this type of thing with Facebook and Twitter, well the PayPal one is just the same. However when it came to passing the user over to PayPal to login, i received the following error message: IDSW_333 - there may be missing request parameters or this site is not approved to use After checking all my parameters, I could find nothing wrong. A Quick Google search found people have had the same problem, but it was mostly to do with using OpenId 1.0/2.0 and having to use OAuth 2.0 / Open ID Connect instead. This was never a problem for me since I was already using OAuth 2.0. The Solution In order to fix the annoying error message I simply deleted my existing app and created a new one, making sure I updated my App ID and App Secret in my program. This worked first time and allowed

Generating Best Selling Items with Amazon Product Advertising API

As part of a side project that I have been working on in my spare time, I've created a website called Deal Hammer  which can be used to search the depths of Amazon for discounted items and free super saver delivery etc. One of the features i wanted to add to my site was to be able to pull a list of the best selling items back from the API. Now with the Amazon Product Advertising API, there is, as some of you will know, no option or quick way to pull back these items. You could head over to the affiliate site and use their tool to generate a custom link with your associates tag to 1 specific item (repeat for how ever many items you want link for) and update them every week or so, but that defeats the point of making a dynamic website, plus it would be a massive time waster also! Another option is to use their RSS feed and parse the XML, which works quite well, but you don't really have much control over the data you display, the issue i found was that Amazon brought back a

Introduction

Hello and welcome to what will hopefully be a blog full of helpful and handy web / programming based posts. During my time as a web developer, I've searched through google countless times trying to find answer to issues i might have had whilst programming. For the majority of it I've found what I've been after, but for all those other times I've had to figure it out myself and it's those times that i want to blog about, so that hopefully someone who has the same problem as me, will be able to find my blog posts which will hopefully point them in the right direction!