Skip to content

Progress!

I have decided (thanks to the CSS course I am currently on) to once again rejuvenate my blogging. This should be the last post on http://sheepeatingtaz.co.uk/blog as I’m fed up of cross posting to my own site! The new django-powered blog is at http://blog.sheepeatingtaz.co.uk

This means I can focus on learning more about django, and also implement all the CSS-goodness I have been learning rather than relying on Wordpress and it’s abundance of tools to do it for me.

If you subscribe to a planet where you get this post – I’m trying to contact the planet admins to switch my feed over, but not having much luck at the moment – I will continue to persevere!

Programming desktop apps in python and glade

I have started having a play around with quickly (https://launchpad.net/quickly) today. I have always wanted to have a go at GUI programming — I’m OK at scripting and ‘web’ programming, but the only desktop GUI work I have done has been on windows in Access/VBA :S
Doing the basics seems fine, but I’m jumping straight in at the deep end! The situation I have at the moment is I have my Main window, and on opening it it opens a login window. What I am struggling with is passing data back to the main window from the login window.
So… does anyone know of any tutorials for python with glade? Everything google throws at me seems to be different to the way that quickly sets up the project, and makes them hard to follow. Is the quickly way standard? Should I abandon quickly, and go with one of the tutorials and start again from scratch?

Tagged , ,

Daddy’s Little Girl

(16:55:18) Lisa Garton: lolkm, gggggg
(16:55:41) Lisa Garton: xxxxxxxxxxxxxxx
(16:55:42) Lisa Garton: x
(16:55:48) Lisa Garton: ;0rd
(16:55:50) Lisa Garton: z\
(16:55:53) Steve Garton: cat or baby?
(16:55:58) Lisa Garton: /;09
(16:56:09) Lisa Garton: h baby
(16:56:28) Lisa Garton: 000]]]]]]]]]]]]]]===========

MySQL Help

I need some help with a query in MySQL. I can’t believe that no one has ever needed it before, but google is failing me.

I have a table with the following columns: ID | User | ...few more in here... | Timestamp

I need a query that returns data in the following way


User | Date1 | Date2 | Date3 | ... | Total
User1| 4 | 5 | 4 | ... | 13

i.e. There needs to be a total for each Date, with that date as the column header.

In case it helps make it any clearer, I have a similar query that takes entries from the last week and groups them by weekday:

select
       User as name,
       sum(if(dayofweek(Timestamp) = 1, 1, 0)) as sun,
       sum(if(dayofweek(Timestamp) = 2, 1, 0)) as mon,
       sum(if(dayofweek(Timestamp) = 3, 1, 0)) as tue,
       sum(if(dayofweek(Timestamp) = 4, 1, 0)) as wed,
       sum(if(dayofweek(Timestamp) = 5, 1, 0)) as thr,
       sum(if(dayofweek(Timestamp) = 6, 1, 0)) as fri,
       sum(if(dayofweek(Timestamp) = 7, 1, 0)) as sat,
       count(ID) as total
     from
       Table
     where
       date(Timestamp) >= date_sub(now(), INTERVAL 8 DAY) and
       Timestamp < date_format(now(), '%Y-%m-%d')
     group by
       User
     order by
       User

Now, this method is fine when you have a finite number of columns (days of the week), but I need it to be dynamic and take a couple of parameter (it's used in a php script) as the date range.

HELP?!?!

Holiday

So, I’m currently on holiday in a static caravan on Mablethorpe. It’s sort of an appetizer of a holiday before we go to Florida for a fortnight to see Lisa’s brother. There’s a couple of reasons for this holiday, one is to see how Hannah behaves staying away from home (early results are very promising – she doesn’t appear where she goes to sleep, as long as she gets fed!) The seond reason is that we really, really needed a break! We normally go to Spain, or the balearics, or somewhere equally sunny for a week at the beginning of September but this year we (specifically me) didn’t fancy flying with Hannah being only 3 months at the time.

So, initial impressions of the caravan are that it is nice. We’ve got a Gold level caravan, which is the highest this park offers (others in the chain off platinum) . To be honest, it’s just the right size. It’s like staying in a detached self catering apartment, which is brilliant when you have a nearly 5 month old how may cry at any point!

We had a nice day out in skegness yesterday, despite me having to run about 8 miles to put some more money in the car park, and then forgetting to take the car keys with me! Today we are going out for breakfast, then a walk to the bombing range/beach before making use of the free swimming pool before meeting my mum and dad in cleethorpes, Nd maybe all going out for tea. We have to check out by 10 in the morning, so not sure what we’ll do for the rest of the day.

I also need to take more photos, we haven’t really taken many of Hannah recently, and we forget how quickly she’s changing.