f-log

just another web log

18 Mar 2012 22:17
Just noticed all my "Permanent Link" links were failing. I cannot see where it is introduced but a space is preceding each <a name=" before the numeric for the time and date which is what I use a the unique anchor.
Strangely the browser does not seem to like spaces in anchor references so prefixing the anchor with %20 does not help.
I changed the code around to force a double quote at the beginning of the name attribute value instead of letting another file.
Though neither were generating the space when run in isolation.
18 Mar 2012 22:03
Continuing my TV recipe
So we have downloaded all these lovely information rich tilde delimited text files, what can we do with them ?
Welcome to sqlite Originally I thought this was a library that you included in your own programs that the user was never aware of. It certainly can work like that and was my expected approach to this project.
But the wonderful sqlite has a seemingly innocuous command line application called sqlite3 that can either create an interactive SQL shell that you can execute statements within or simply pipe into or use the second parameter (the first being the database file).
Oh, and how difficult setting up the database file is ...
sqlite3 mynewdatabasefile
That's it! If the database does note exist then it is created (instantly) for you. That statement also starts the interactive shell connected to that database, no users, logins, file formats, it just works.
So I created a quick CREATE TABLE script and piped it into my new database
cat dbscripts/create_channels.sql | sqlite3 databases/tv
that script being standard SQL
create table channel (
Id INTEGER
,"Name" VARCHAR(1024)
,"Selected" VARCHAR(1)
);

sqlite does not need field definitions such as INTEGER and VARCHAR(1) it treats everything as dynamic using your column definition as a suggestion.
Well it's slightly more complicated than that, but bottom line is anything goes, making data input and processing very non-strict and easy.
I will let you imagine the programme table.
The "Selected" column was added so I could avoid sports, foreign language and music channels.
The new recipe post will be exclusively about that process...
15 Mar 2012 20:52
Google have started a developers sign-in that requires entrants to complete a task called Input/Output, which is an Incredible Machine clone.
Slashdot posted about it use and the commenters noted that one you had to have a Google+ account and the it linked your account.
I have a Google+ account but did not want to use it, so I started poking around the JavaScript in the browser.
If you use Chrome or FireBug and search in Experiment.js for LOGGED_IN in the scripts panel and set a break point, refresh the page then in the console enter
LOGGED_IN=true;
the hit continue you are logged in and can play the game.
I also noticed there are some achievements like Chrome Ball that are simple booleans, wonder what I can unlock ??
14 Mar 2012 21:36
Continuing my TV recipe
The name sqlite to me DID mean a database api for using a sql database inside your own developed applications and coming to this project I fully expected to have to do some coding to get anywhere.
But sqlite is a full functional sql database in a file with a command line execution engine making development and then using a SQL based database incredibly easy.
I am using it entirely in bash and bash scripts.
Oh! and as well as being so easy to run commands against there is a firefox sqlite manager that has every function under the sun.
Just load firefox open a command on the menu and open your local database file instant access, very cool !
Now stage 1:Radio Times web API for personal use.
There are two web services we need one to get channels (maps names to ids) and programmes where we get 14 days of single channel.
http://xmltv.radiotimes.com/xmltv/channels.dat
http://xmltv.radiotimes.com/xmltv/CHANNEL_ID.dat
the returned files are not xml but tilde '~' delimited the format of which can be determined from this
http://www.birtles.org.uk/phpbb3/viewtopic.php?f=5&t=245#p943
It is worth pointing out that the returned files also include a disclaimer/licence noting these are for personal use only.
The programme files include some useful columns such as "Film"(true/false), "premiere"(true/false), "genre" as well as "Title", "Description", "Start"(time), "End"(time) Date, plus many more.
This works for me as one of my goals is to avoid missing films.
select [Title],[Genre],[Year],[Name],[Date],[Start Time] from programme P INNER JOIN Channel C ON P.channelId = C.Id where [Date] >= date('now') AND Film='true' ORDER BY [Date]

05 Mar 2012 22:35
Quick follow up from the Windows XP virus incident.
So I booted from the Trinity Rescue Kit CD ISO on a USB stick and was able to run five virus scanners.
Clam AV
F-Prot
BitDefender Scanner
Vexira
Avast
The text based menus were straight forward and had many options for non virus scanning activities, such as resetting a windows password.
Most of the scanners just worked, Avast required a huge GUID that can only be obtained by giving your email address on the website(not got any spam yet).
Vexira had been updated and needed some TLC to getting running, but nothing major.
As these were virus scanners each one checked every file (or at least most files) meaning they ran for many (many) hours.
But it was worth it, found 52 (possibly) infected files and after removing those and rerunning the scans no infected files were found.
Windows does appear to be virus free but it also zapped the entire Start Menu, not even Run survived, but everything works and shortcuts are slowly being added back in.
01 Mar 2012 23:25
Just downloaded 71716 TV programme listings for the next two weeks.
hopefully I can streamline my TV recording to things I want to see and not miss.
Recipe:
Radio Times web API for personal use.
bash for scripting
wget for downloading (should i be using curl?)
sed for text manipulation
sqlite for database

full details coming soon
01 Mar 2012 23:19
Missed out on the pi frenzy after refreshing their page twice daily for the last couple of weeks.
Love to play with a Model B but really do not have the time, nor do I have an HDMI tv or the money to buy a converter.
Still waiting to see if the converters even work for the pi.
http://www.scan.co.uk/products/startech-hdmi2vga-hdmi-to-vga-video-converter-with-audio
http://www.amazon.co.uk/Konig-HDMI-to-VGA-Converter/dp/B0048SKRIK/ref=pd_cp_ce_3
http://www.tvcables.co.uk/cgi-bin/tvcables/hdmi-to-vga-converter.html
loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed

email

root

flog archives


Disclaimer:
This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk
In fact I'm not responsible for anything ever, so there!

[Pay4Foss banner long]