A little bit of web design

January 16th, 2010

I was looking at Mark’s my365 page as he’s also doing a daily photo project, and rather liked his presentation on there.

So last night I put my mind to developing a few lines of code to try to put something similar together. So a bit of Perl code to parse the XML from the RSS feed (yes it’s technical, but fun in a geeky way) from my flickr oneaday feed and I was able to put together a web page of my own which automagically updates whenever I add a photo to the oneaday set on my iPhoto album on my mac (which synchronises with flickr).

Suzy helped me out today with the CSS for laying out the page and in the end this tutorial on floats was also very helpful to end up with my oneaday gallery.

I’l probably tidy it up a little in the future, but it’s not bad for a few hours of work, especially when I consider how long it is since I coded in Perl and php. Definitely a worthwhile exercise, it helps to keep the coding muscles in trim, and I’m teaching web development tools in a couple of weeks.

IRC in aber

September 25th, 2008

Especially for freshers…

There is a technology called Internet Relay Chat, which for many years was one of the few ways of interacting with your friends and colleagues around the world on the internet. Now we have lots of IM clients and protocols, but the cool kids all still use IRC.

There is a long and colourful history behind IRC at Aberystwyth, but to summarise (you can read the gory details in other places) bitternet is dead.

IRC is alive and well at irc.aberwiki.org.

Get yourself onto a Sun machine, start up a terminal window and type the following…
$irc
*** Connecting to port 6667 of server change.this.to.a.server
*** Unable to connect to port 6667 of server change.this.to.a.server: Unknown
+host
*** Use /SERVER to connect to a server
/server irc.aberwiki.org
… lots of joining stuff here…
/join #fresher
… stuff…
Hello I am a newbie

You may find yourself in a quiet empty channel, or it might have other folks around. If you feel really brave you might want to try joining #aber, but beware, here be dragons and *shudder* graduates of the department. You need to have a well developed sense of humour to survive for long on #aber, but it is worth the effort getting to know the regulars.

You may want at some point to graduate to another client with different features, but before using scripts, beware they may get you kicked or banned.

Also, get aquainted with http://www.aberwiki.org/ it is a fount of useful (and pretty useless) information.

Enjoy, and see you around

Richard

Chip and pin just as fallible as old system?

January 8th, 2008

A Guardian article about how chip and pin is not really any more secure than the old system, and the only change is that banks are now not paying claims, instead blaming the card owner for giving their cards and pins out. Their argument – you can’t copy these chips!

The article raises some important security concerns. Also, do you believe that reported card crime is down, now that you don’t report it to the police, the bank does that for you after they decide if it’s worth reporting?

And rather than make another post, I just have to link to this article about airport and airline security, and how completely absurd the whole thing is.
Personally, I fell that they’ve already won, by getting us to allow our government to take away civil liberties, whilst most of the voting public either encourage it, or just lay down and take it.
One of the comments near the top of the page, made by a pilot who is also subject to these security checks puts it quite succinctly:

Let’s think about something. I am in my pilot uniform and going through security and about to fly an aircraft and passengers from point A to B. I and my co-pilot will be sealed in the cockpit in front of a security door that cannot be opened from the outside. I will have in my hands the only “lethal” weapon used on 9/11, – the control yoke. So just what is it the TSA is checking me for? A gun? A knife? What? If I had been recuited by ‘the bad guys’ do I need to carry ANYTHING lethal? Of course not! Therefore, I should not have to go through security at all!

Made me laugh out loud!

October 10th, 2007

I’d not come across xkcd until someone showed me the comic today!

It’s just too good not to look at:
Exploits of a mom

Model-View-Controller song lyrics

October 9th, 2007

Model-View-Controller lyrics

I’m reposting them here – the song appears to have a habit of disappearing, and these lyrics are too good to lose:

Model, View, Controller
Lyrics and music by James Dempsey.

Model View, Model View, Model View Controller
MVC's the paradigm for factoring your code,
into functional segments so your brain does not explode.
To achieve reusability you gotta keep those boundaries clean,
Model on the one side, View on the other, the Controller's in between.

Model View � It's got three layers like Oreos do.
Model View creamy Controller

Model objects represent your applications raison d'�tre.
Custom classes that contain data logic and et cetra.
You create custom classes in your app's problem domain,
then you can choose to reuse them with all the views,
but the model objects stay the same.

You can model a throttle in a manifold,
Model level two year old.
Model a bottle of fine Chardonnay.
Model all the twaddle stuff people say.
Model the coddle in a boiling eggs.
Model the waddle in Hexley's legs.

One, two, three, four.
Model View � You can model all the models that pose for GQ.
Model View Controller

View objects tend to be controls that view and edit,
Cocoa's got a lot of those, well written to its credit.
Take an NSTextView, hand it any old Unicode string,
the user interacts with it, it can hold most anything.
But the view don't knows about the Model:
That string could be a phone number or the words of Aristotle.
Keep the coupling loose and so achieve a massive level of reuse.

Model View � All rendered very nicely in Aqua blue
Model View Controller

You're probably wondering now.
You're probably wondering how,
the data flows between Model and View.
The Controller has to mediate,
between each layer's changing state,
to synchronize the data of the two.
It pulls and pushes every changed value.
Yeah.

Model View � mad props to the smalltalk crew!
for Model View Controller

Model View � it's pronouced Oh Oh not Uh Uh
Model View Controller

There's a bit more on this story,
a few more miles upon this road,
well nobody seems to get much glory
writing controller code.
Well the model is mission critical
and gorgeous is the view,
But I'm not being lazy, but sometimes it's just crazy
how much code i write is just glue.
And it wouldn't be so tragic,
but the code ain't doing magic:
it's just moving values through.
And I wish I had a dime
for every single time
I set a TextField's stringValue.

Model View � how we're gonna deep�six all that glue
Model View Controller

Controller's know the Model and View very
uahh � intimately
They often are hardcoding
which is very verboten for reusability.
But now you can connect any value you select
to any view property.
And I think you'll start binding,
then you'll be finding less code in your source tree.
Yeah I know I was astounded,
that's not even a rhyme.

But I think it bares repeating
all the code you won't be needing,
when you hook it up in IB.

Model View � it even handles multiple selections too
Model View Controller

Model View � hope I get my G5 before you
Model View Controller

Yeah, yeah, yeah. Yeah.

Excel 2007, 65,535 displays as 100,000 and testing

September 29th, 2007

From Risks:

According to a *NY Times* blog (Pogue’s Posts), Excel 2007 for Windows doesn’t cope properly when multiplying two numbers that should yield 65535 (http://pogue.blogs.nytimes.com/2007/09/27/a-big-excel-boo-boo/).
Instead, it gets 100,000.

For a very nice explanation and discussion of its relevance, see Joel Spolsky, Joel on Software blog http://joelonsoftware.com/items/2007/09/26b.html

Have a look at Joel’s blog, and pay especial attention to the talk about testing – the fact that the bug appears to be in the presentation layer, and the testing is probably going to take results from before the presentation layer kicks in.

One more thing occurs to me. If there is this sort of bug that happens on 12 out of 18446744073709551616 possible cases, and it has only just been found, how many more are out there?

Stop telling me about bum_tnoo7@hotmail.com

September 17th, 2007

Please people, stop telling me that bum_tnoo7@hotmail.com (or bu_tnoo7) is a hacker and I shouldn’t add him to my facebook account.

It’s already wasted far too much bandwidth, the message itself that is forwarded is technically rubbish, and you yourself are being used by the “virus” as the propagation mechanism.

Oh, and before I get a load of comments on “how do you know”, “what makes you an expert” – I teach a course on hacking to the Masters courses, and if you don’t believe me, then do some research yourself – http://www.sophos.com/security/hoaxes/facebook_hacker.html

Important

If you receive this or a similar message, please do not forward it to your friends and colleagues. Forwarding unsolicited chain letters wastes time and bandwidth.

How has the user experience changed in 20 years?

June 16th, 2007

Reading Risks Digest this morning I came across a link to an article comparing a 1986 Mac Plus and a 2007 AMD Dual core. The question posed was how has the massive increase in computing power has changed the speed at which the most commonly performed tasks are performed.

“The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry…”– Henry Petroski

Of course, some of you might already have guessed the outcome, and some might not agree with the tests as presented, but the fact is that the tests actually look pretty fair when you consider what most office workers do with their PCs.

Anyway you can read the article for yourself here on hubpages

CS259 students read this!

June 14th, 2007

I’ve been beating CS259 about this sort of thing for more years than I care to remember, but it’s always good to have someone else putting it all so succinctly.

Take it away Josiah Cole

(thanks Claire)

iCal web publishing

February 13th, 2007

iCal is a great application, but there are some things about it that bug me.

Apple really want you to pay money for their .mac service, and as such if you want to publish your calendars, it’s either that or set up WebDAV. Now I run my own server, and I could probably install WebDAV, but I’m really not that inclined to, so I decided to use a more portable way to publish my iCal files on the web server, and do it automatically in the background.

I was chatting with James today about the solution that I use that pushes the calendar from this laptop, which I regard as the “master” up to the web server, which runs PHP iCalendar. Of course, I use iSync to synchronise with my mobile phone, and I can make appointments on the phone and they will be imported into iCal at next sync, then to be pushed up onto the web at the next update.

But how to send the file to the web server? Personally I love ssh and especially when I have public key authentication set up properly so I don’t need to type my passwords, so I thought that it would seem sensible to use scp to push the files – I already have a hole in the university firewall for ssh into the box, so it will work from anywhere in the world, even without using VPN to connect to the University network.

So I dusted off my slightly rusty Perl skills and started lookiing at the files that iCal produces. I should probably explain that I used Sunbird for a while, but it was just too buggy to be used as a day-to-day application, so I switched to iCal.

So I now have a perl script which runs from my crontab every 15 minutes, and finds the title of the iCal file from inside the file, because iCal uses a unique name for each file, which is not very user friendly. It then compares each file title with a list of calendars to upload to the server and uses scp to copy the file onto the web server.

It’s currently pretty messy, still has a load of commented out debug code, and really needs a tidy up and a little more intelligence adding, but it works, and works well.

You can’t just copy this into a directory and run it – you really have to understand Perl to be able to customise it for your own use, but please feel free to use it as a starting point for your own development, and if you find it useful, please drop me a line.

You can find the perl program file, and my example data file in this directory.


Bad Behavior has blocked 130 access attempts in the last 7 days.