This post describes a recent project I completed to display caller id information for incoming calls on my computers. The project uses a BT Caller Display 50 connected via an optoisolating bridge to an arduino with an ethernet shield. When an incoming call is received the telephone number is transmitted via MQTT to a python client on any computer I happen to be using at the time. This project is a great example of someone putting great effort into being lazy, the caller id data is alredy displayed on my phone but the phone generally resides in the next room so this avoids me needing to run for stupid cold callers. Initially I’d wanted to do this project just using the arduino, which may have been possible but using the CD50 makes it a huge amount easier.
Creating sitemaps is a bit of a hassle for any site bigger than a couple of pages, especially where a database is involved. While working on a recent project I created a library for codeigniter which allows the simple creation of sitemaps either by manually adding pages which might be appropriate for a blog, or allowing the library to scan controllers and adding all pages defined by methods. Common search engines can also be notified.
A simple example of it in use is shown below:
//if you're using sparks
$this->load->spark('codeigniter-sitemaps/0.0.1')
$this->load->library('sitemaps');
//assuming a hypothetical posts_model
$posts = $this->posts_model->get_posts();
foreach ($posts AS $post)
{
$item = array(
"loc" => site_url("blog/" . $post->slug),
"lastmod" => date("c", strtotime($post->last_modified)),
"changefreq" => "hourly",
"priority" => "0.8"
);
$this->sitemaps->add_item($item);
}
// file name may change due to compression
$file_name = $this->sitemaps->build("sitemap_blog.xml");
$reponses = $this->sitemaps->ping(site_url($file_name));
When prototyping circuits I often use a breadboard and an FTDI cable which usually leaves some kind of hacky looking unstable connection using wires stuck into the FTDI cable female header connector. This arrangement often leads to failiure as the wires fall out. After much searching I’ve managed to locate a solution to allow neat connection of a female header to the breadboard.
Recently I’ve been experimenting with using webcams in the browser with Javascript, while I was browsing Google on related topics I came across an interesting video on youtube. As I couldn’t find any code for how the demo had been created I decided to create my own (see below). The idea of streaming video from a phone to a server via a websocket had occurred to me before I viewed this video but I dismissed it as impractical, an opinion which has only been reinforced after testing it myself.
This is the video that gave me the inspiration (my code replicates this exactly so I didn’t see the need to recreate the video too), the only difference is I used linux all round rather than windows:
A little project I’m working on requires the use or websockets in Opera Mobile, I’d read they were supported but when I tried it just threw an exception, then I discovered you have to enable them in the config:
Browse to opera:config in opera mobile
Open the User Prefs section
Check the enable websockets box
Scroll right to the bottom of the page and select save
Formatting menus with appropriate CSS classes to define their state is messy and cumbersome at best, especially when not using a CMS, but something that is very much required to make websites usable. As a regular user of codeigniter it’s something I’ve been searching for a solution for (before bothering to roll my own) and fortunately I found a great solution: Steal the menu library from FuelCMS, full documentation here.
In this post I will give a simple example of generating the menu below using the FuelCMS Menu Class in Codeigniter.
Since first considering web camera applications during my MSc thesis I’ve be fascinated by different uses and application of webcams on the web. I believe outside of skype they are a very under utilised tool for both communication and interaction and despite their long existence I believe there is still a very long way to go in what they can do.
In this post I intend to summarise recent developments surrounding using a webcam within web applications and go on to discuss current implementations available for using a webcam with javascript.
For all my day to day development work, be it in php, html, js and even when I branch out into Java or C/C++, I use Netbeans as my IDE of choice. I first got into it when coding Java at university but since then I’ve moved into mainly working on PHP web apps and it has proved to be, in my opinion, the best PHP IDE available. In this post I’m going to highlight a couple of customisations I’ve made to make it’s use easier.
For the past couple of years I’ve used Netbeans on Ubuntu, previously I used Visual Studio on Windows but then I was developing C++ Applications. When I moved to Ubuntu I looked for a new IDE to patronise, I’ve never really got on with VIM or emacs.
For a good while I’ve been meaning to get around to backing up my data properly. I’ve always had an external hard disk on which I backed up my important data periodically but that only covers the most basic of situations. If my house burnt down, or more likely somebody broke into my house,even just a power surge, I could conceivably loose both my real copy and the backup. From this I decided the only sensible way was to explore an offsite backup solution to use in addition to local backups. I’ve also been spurred on after buying an SSD and being unconvinced about their reliability. Indeed since starting to write this post my new SSD was recalled by corsair…
In this post I’ll describe what I backup and the online services and software I used.