Thursday, 31 January 2013

Faster, higher, stronger

This is Scrutiny v4 checking a very large website. (Integrity 4 and Scrutiny 4 are now both available as release candidates)

The major change is to the engine. You can't see the speed that Integrity is tearing through this site but it's collected 33,000 links and checked 16,000 of them in about 15 mins. And hardly stressing the computer!


I'm dead chuffed with the improvement and also with Scrutiny's new application icon which reflects the fact that it can handle larger sites and process the data more quickly.

Note that in the screenshot Integrity is switched to the settings screen. Both apps will only keep updating the tables of results if they're visible. Constant updating is a big overhead, so switching back to settings screen makes a significant difference.

Monday, 7 January 2013

Making sure your site is fast and why it matters

I've just read this post at CopyBlogger which makes a compelling case for making sure that your web pages load as quickly as possible.

Load speed is a signal used by Google. But just as importantly, very small delays in load speed loses visitors.

Reactivity is free when downloaded from the web and tests your page, breaking it down and showing all the files it finds with load times for each (using a single thread for a more accurate measurement of each).

You'll easily spot bottlenecks - often third-party code or plugins can cause such delays and be difficult to track down.

http://peacockmedia.co.uk/reactivity/

Reactivity is a standalone component of Scrutiny which is a suite of website analysis tools.

http://peacockmedia.co.uk/scrutiny/

Friday, 4 January 2013

BASIC programming and VIC-20 emulation

I enjoy a maths problem. A friend sends me one every Friday.

The type of question determines the best way to go about solving it. I like it best when I can write out the problem as an equation and work out the answer.

Some problems can only be solved (as far as I can see) by 'testing' different numbers. This was the case today and I managed to get the correct answer with a spreadsheet. But with more than one variable, this was a bit of a tedious process.

This is where BASIC programming comes into its own. As a teenager I would have tapped out a few lines of basic into my Vic-20 and had an answer very quickly.

I've tried to solve such problems more recently using C and my usual development environment with various degrees of success.  Those used to writing CLI tools may argue that it's very easy to tap out a few lines of C, compile and run the app and get an output. But I've run into various problems, and no question about it - that's not as easy as this:



Today's problem was about sharing a box of chocolates (we don't know the total number) and one boy ends up with the same number of chocs as the percentage that his brother has. We need to know the smallest numbers for which this can be true. You can see here the two possible answers for numbers up to 100 chocs total. (20 chocs and 5 chocs (20%) out of a box of 25 and 50 chocs each (50%) from a box of 100)

I haven't written a BASIC prog like this for about 30 years, but it all flowed from the fingers very naturally. With a few more minutes of messing about I could have refined it and have a much smaller and more efficient programme.

Two points. First it's awesome to be working in such a small space. You can see that there are 3583 bytes to work in (yes, bytes. That's about 3.5k). The computer had a bit more on board but some is used by the screen. I bought an 8k ram pack for my Vic which seemed a massive amount of space at the time. (it brings to mind this challenge which involves writing a game in 140 characters!)

Second, this kind of programme could be written by a classroom of newbies in the first lesson. I'm well behind the Raspberry Pi project, but I'm not convinced it will inspire new coders like our 8-bit machines did. Switch it on with very little knowledge and within seconds you've filled the screen with your name. With a little more knowledge you'd made a small animation and after that made a simple game. My suggestion is a basic interpreter in the Applications folder of OSX and windows (and Rasp Pi). (As I have now!)