Joe Lanman

Web design and development when not playing computer games

Straightening images in Inkscape

December 18, 2010

Inkscape is one of the most successful and usable open-source applications around – it’s a drawing app, useful for designing icons and logos, or laying out posters and leaflets. I used it to design my pocket calendar cards.

I fired it up recently to design a leaflet for my Mum’s guest house, featuring lots of photos of the local area. I’d previously rotated them to some jaunty angles and needed to straighten them up. I couldn’t find anything in the interface to do this (boo) but then remembered that one great feature of Inkscape is that it stores the state of the document as an editable SVG file. Even if there wasn’t a way to remove the rotations in the interface, I could do it by editing the data directly (hooray!), it’s a sort of View Source for illustration/page layout.

  1. Open the Edit menu, select XML Editor
  2. Select the image you’d like to straighten on the page
  3. In the XML Editor, click Transform attribute, and click the Delete Attribute button above

Boom – straight images.

Obviously, it would be nice to have a button to do this (maybe there is – feel free to let me know in the comments), but I like that the use of an open image format, and the tools to edit the data directly allows me to achieve what I need to do. Do you have any Inkscape tips?

No Comments

Transferring TFL cycle routes to Android

September 5, 2010

Transport for London have recently started offering a very handy cycle journey planner on their site, great – but it’d be much more handy in interactive form on my Android phone. Here’s a quick guide on how to do that:

1) Plan your route, then click upload to GPS device (top right). This will give you a GPX file to download.

2) Download RMaps – this is what we’re going to use to view the route on Android, and its a fantastic map app to have anyway, its main advantage over Google Maps being it can cache maps offline for you – if you happen to be hiking out of mobile range for instance.

3) Transfer your GPX file to your phone. I used the Android Dropbox app, but you could just use USB, or a couple of floppies.

4) Open the route with RMaps – in RMaps, press Menu ->More -> Tracks. Now press Menu again -> Import, and select your GPX file. The route name should now appear on the screen, tap it to get a tick – it is now displayed on the map screen.

5) And you’re done – press Back until you see the map screen – if you zoom in you should see your route highlighted in purple.

3 Comments

Prototyping with jsFiddle.net

July 4, 2010

I’m a big fan of applications that do a simple thing well; jsFiddle.net is an innovative environment to work on HTML, CSS and JavaScript in the browser. Coded by Piotr Zalewa and designed by Oskar Krawczyk, it’s a tool I’ve found really useful for me and my team – the simple four-pane layout is brilliantly suited to front-end development:
(more…)

8 Comments

Usable multiple-selection with checkbox lists and jQuery

March 21, 2009

There are two out-of-the-box methods for multiple selection in HTML: checkboxes and the <select> tag. Neither are perfect – I’ll be discussing why, and proposing a sort of mashup of the best aspects of both, using jQuery.

(more…)

7 Comments

Uploading images and making thumbnails with web.py and PIL

September 27, 2008

I ran into an issue today while trying to implement image uploads. It’s a very basic implementation: taking files from a POST request, copying them to a local folder, and then making thumbnails of them.

I started with the file upload tutorial in the web.py cookbook.

The problem I was getting was that the Python Image library (PIL) was failing to make the thumbnails, with the error ‘image file is truncated’.

(more…)

1 Comment

Passing variables from a child template to a parent in Mako

September 17, 2008

After looking at Web.py’s own templating system, and considering Cheetah, I’ve ended up going with Mako for now. So far I’ve found it very straightforward, with some powerful-looking features to expand into in the future.

One of the great features is template inheritance – but I hit an issue recently with passing a variable from a child template to a parent. It’s not immediately obvious how to do this, but I found the answer on the Mako Google Groups archive (link here):

Child:


<%inherit file="meta.html"/>

<%def name="vars()">

	<% return (meta.id,) %>

</%def>

Parent:


<% (id,) = self.vars() %>

On a side note, I found out today that two of the Python libraries I’m using, Mako and SQLAlchemy, were coded by the same guy – Michael Bayer. Clever chap – not only are the libraries pretty impressive, but they are both well documented and he regularly contributes to the mailing lists for both projects. And he doesn’t even have a big internet head like some developers – though I tracked his blog down here:

http://techspot.zzzeek.org/

No Comments

Making a copy of a SQLAlchemy object

September 15, 2008

Should that be ‘a’ or ‘an’ SQLAlchemy object?

My current CMS project is based on creating templates in the back-end, and then using these to produce ‘inherited’ objects with the same attributes.

multiplicity

I quickly found that it’s surprisingly tricky to grab a template object using SQLAlchemy, and copy it into a similar, but separate, entity. Using the Python ‘copy’ function confuses SQLAlchemy – when you try to save it, it thinks it is merely a representation of the original (template) object.

Here’s how I create separate ‘clones’ from my template objects, defining a function on the object itself:

(more…)

No Comments

Having cake and also eating it: Compiz and dual-head on an ATI HD 2600

August 15, 2008

dual head photo

Only a day after complaining about my ATI card running under Ubuntu, I seem to have a solved a lot of the issues. Slightly embarrassing. To recap – my system is set up like this:

HP 8510p laptop with an ATI HD 2600 mobility card running Ubuntu 8.04 with a 1680×1050 screen, often connected to an external monitor (same resolution).

My ideal setup would be like this:

  • ‘Big desktop’ mode when plugged into an external monitor, allowing windows to be dragged between screens.
  • When the monitor is unplugged, to continue working on the laptop screen, without restarting Xorg.
  • Compiz-fusion providing ‘expose’ functionality amongst other things.
  • Generally not having crashes would be nice.

(more…)

1 Comment

The past is a foreign country

They do things in Windows there.*

So I’m making a valiant effort to move to Linux, and stay in Linux.  I like how easy it is to install development stuff (servers, compilers, libraries) and I like the ethos of open source software. I installed Ubuntu a few months ago, and again on my new HP laptop. Everything is snappy and responsive, but I have had a few problems…

(more…)

No Comments

Python-style startswith and endswith string functions in Javascript

July 10, 2008

The Python language has useful string methods to search for prefixes and suffixes:


my_string.startswith('pre')

The same thing can be achieved in Javascript using the rather powerful search and replace methods.

(more…)

1 Comment

buy Endep where buy cheap Amitriptyline line buy Amitriptyline no visa without rx buy no online rx Donepezil buy Amitriptyline discount Amitriptyline online no prescription Amitriptyline buy on line buy Donepezil and Endep uk Endep Endep no prescription Endep capsule buy Endep pills where can i buy Endep without prescription buy Endep where purchase Endep buy Endep no prescriptions purchase generic Endep online buy Endep fed ex where buy Endep buy Anafranil pay cod Aricept drug cheap Aricept usa generic Aricept cost buy cheap generic Aricept online Aricept no prescription overnight buy cheap Nizoral on line Nizoral without prescription buy Nizoral diet pill buy cheap Nizoral online free consult Nizoral non prescription for next day delivery buy Nizoral online no prescription cheap Nizoral online buy cheap generic Nizoral buy Nizoral mastercard buy discount Lisinopril online order no online rx Lisinopril buy cheap generic Arimidex Arimidex canadian pharmacy order no online rx Arimidex Arimidex buy Abilify order online buy Abilify usa buy Abilify on line without a rx buy Finpecia without prescription to ship overnight Finpecia xr buy online cheap best buy Amitriptyline Amitriptyline from india is it safe next day fedex shipping for Famvir Buy Famvir without a Discount Famvir order Famvir purchase online Famvir without prescription purchase Famvir over the counter cod overnight Famvir fedex shipping buy Amitriptyline legally no rx cod Fluoxetine purchase Fluoxetine online buy Fluoxetine 20 mg buy Fluoxetine no perscription cod Fluoxetine cheap mexican generic Fluoxetine online buy cheap Fluoxetine without prescription Fluoxetine capsule buy no online rx Prozac order no online rx Fluoxetine where to purchase generic Famvir online without a rx Lisinopril bestellen purchase Famvir no visa online without prescription buy in Anafranil uk Anafranil capsule buy cod Anafranil where to buy Anafranil by cod buy Anafranil without a perscription buy Anafranil with american express buy Anafranil cheap buy Nizoral online no rx Lisinopril buy Lisinopril overnight us delivery no prescription Lisinopril purchase online prescription Lisinopril without buying Lisinopril online without rx maxalt online prescription no prescription Maxalt with fedex buy no perscription Maxalt buy Maxalt online pills purchase Maxalt overnight Maxalt online buy saturday delivery buy Maxalt online no prescription Lisinopril online purchase purchase Lisinopril no prescription cheap maxalt overnight no script mastercard accepted arimidex without prescription or membership no perscription arimidex order online Aricept without prescription overnight Aricept c.o.d purchase online Aricept without rx purchase Aricept online without script Aricept uk sales Amitriptyline no prior script buy Accutane 40 mg without a rx overnight delivery Accutane 40 mg 40mg buy Accutane 40 mg in india purchase Accutane 40 mg money purchase online us pharmacy 40 mg Accutane fedex 40 mg Accutane overnight without a prescription purchase Amitriptyline pay pal without rx buy Amitriptyline with american express purchase Accutane 40 mg on line no rx buy generic Accutane 40 mg canada buy brand Accutane 40 mg buy Accutane 40 mg without a perscription purchase 40 mg Accutane without a rx online 40 mg Accutane online no perscription fedex

WP SlimStat

site tracking with Asynchronous Google Analytics plugin for Multisite by WordPress Expert at Web Design Jakarta.