Windows 7 includes a neat feature called God Mode. Although the name is a bit of overkill, the feature is handy because it offers an easy way to access all Windows settings from a single folder.
To use God Mode:
- Create a new folder with the following name: GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}. You can change the name “God Mode.” However, the period and numbers must remain as is.
- Once you rename the folder, the folder icon will change to resemble a Control Panel.
- Double click the folder. A window will appear, which looks similar to the Control Panel, with dozens of options.
From: http://www.lockergnome.com/windows/2010/06/02/windows-7s-god-mode/
As a Microsoft Money user, I’ve recently discovered the need to convert CSV files into OFX files. My bank, the Nationwide Building Society, ended support for Microsoft Money online services in October 2009. You can still download your statements as CSV files, but Microsoft Money is not able to import them. After a spot of Googling, I stumbled across MT2OFX. So far, it seems to have been able to convert my statements without any trouble, although I have only been using it for a short time.
You can find it at the following website:
http://www.xs4all.nl/~csmale/mt2ofx/en/
Having Googled unsuccessfully for the settings needed to use wvdial or a Solwise 3G router with O2 Pay-As-You-Go Mobile Broadband, I thought I would share the correct settings here. In order to connect you need the following details:
APN: m-bb.o2.co.uk
Username: o2bb
Password: password
The URL to visit to buy credit is:
https://mobilebroadbandaccess.o2.co.uk/
Happy surfing!
If you are a mobile broadband user you will notice that your image quality is degraded by UMTS. Firefox can overcome this problem by virtue of the Modify Headers plugin. Essentially you need to add two headers to your outgoing request:
Pragma: no-cache
Cache-Control: no-cache
The same effect can be achieved for Internet Explorer and other Windows applications by running Privoxy and adding the following rule to the actions file:
{+add-header{Pragma: no-cache}\
+add-header{Cache-Control: no-cache}}
/
More details here: http://sourceforge.net/tracker/index.php?func=detail&aid=2913535&group_id=11118&atid=211118
So the good news is that Tesco Internet Phone have started letting people use SIP to access their service. This means that I can now set up the second line on my PAP2 to connect to it. All well and good until I tried to access my voicemail by dialling *123.
It turns out the dial plan on the PAP2 is set to only allow 2 digit numbers following the * symbol (mostly used as command codes to the PAP2 itself).
The default dial plan reads:
(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)
but to allow calling *123 it needs to be adjusted to:
(*xxx|[123469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)
After contacting their customer services it also turns out that the current version of the onscreen TIP will not work properly with Windows Vista. In order to retrieve your voicemail when running on Vista you need an updated version, available here:
http://www.tescointernetphone.com/images/tescoip-3.3.2.8126-live-setup.exe
At long last I have figured out how to get floating presents down from the sky in Animal Crossing on the GameCube. In the later version, “Animal Crossing: Wild World” for the DS, you can use a slingshot to pop the balloons the presents are attached to. Alas, in the original version on the cube there is no slingshot. The answer is infuriatingly simple (and logical if you think about it)… all you do is follow the present until it floats directly over a tree, and then shake the tree. Voila!
Despite much Googling, I haven’t been able to find a ready made shopping cart for the CodeIgniter PHP framework. Unfortunately one of my current projects requires such a thing, so I decided to roll my own. Starting from the code here: http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart, I made a few changes to fit the CodeIgniter way of doing things.
The revised version looks like this:
<?php
// Based on http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart
class Cart extends Controller {
function Cart()
{
parent::Controller();
$this->load->library('session');
$this->load->helper('url');
}
function index()
{
$cart = $this->session->userdata('cart');
if ($cart) {
$items = explode(',',$cart);
$contents = array();
foreach ($items as $item) {
$contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1;
}
}
if ($contents)
{
$id_list = '';
foreach(array_keys($contents) as $val)
$id_list .= $this->db->escape($val) .',';
$id_list = substr($id_list,0,len($id_list) - 1);
$query_string = "SELECT * FROM stock_table WHERE id IN(".$id_list.")";
$query = $this->db->query($query_string);
f ($query->num_rows() > 0)
{
$basket = array();
foreach ($query->result() as $row)
{
$basket[] = array('id' => $row->id, 'caption' => $row->caption, 'price' => $row->price,
'qty' => $contents[$row->id], 'total' => $contents[$row->id] * $row->price);
}
}
}
$data = array();
if ($basket)
{
$data['basket'] = $basket;
$grand_total = 0;
foreach($basket as $item)
$grand_total += $item[total];
$data['grand_total'] = sprintf("%01.2f", $grand_total);
}
else
$data['grand_total'] = sprintf("%01.2f", 0);
$data['page'] = 'cart_view';
$data['title'] = "Your basket";
$this->load->view('template/container',$data);
}
function add_item($item_id='')
{
$cart = $this->session->userdata('cart');
if ($cart) {
$cart .= ','.$item_id;
} else {
$cart = $item_id;
}
$this->session->set_userdata(array('cart' =>
$cart));
redirect('/cart/', 'refresh');
}
function delete_item($item_id='')
{
$cart = $this->session->userdata('cart');
if ($cart) {
$items = explode(',',$cart);
$newcart = '';
foreach ($items as $item) {
if ($item_id != $item) {
if ($newcart != '') {
$newcart .= ','.$item;
} else {
$newcart = $item;
}
}
}
$cart = $newcart;
}
$this->session->set_userdata(array('cart' =>
$cart));
redirect('/cart/', 'refresh');
}
function delete_all()
{
$this->session->unset_userdata('cart');
redirect('/cart/', 'refresh');
}
function update_cart()
{
if ($cart) {
$newcart = '';
foreach ($_POST as $key=>$value) {
if (stristr($key,'qty')) {
$id = str_replace('qty','',$key);
$items = ($newcart != '') ? explode(',',$newcart) : explode(',',$cart);
$newcart = '';
foreach ($items as $item) {
if ($item_id != $item) {
if ($newcart != '') {
$newcart .= ','.$item;
} else {
$newcart = $item;
}
}
}
for ($i=1;$i<=$value;$i++) {
if ($newcart != '') {
$newcart .= ','.$id;
} else {
$newcart = $id;
}
}
}
}
}
$this->session->set_userdata(array('cart' =>
$newcart));
redirect('/cart/', 'refresh');
}
function checkout()
{
}
}
The associated view looks like this:
<p>Basket Total: £<?=$grand_total?></p>
<?php
if (isset($basket))
{
?>
<form method="post" id="cart-form" action="<?=site_url().'update_cart'?>">
<table>
<tr><td>ID:</td><td>Desc:</td><td>Price:</td><td>Quantity:</td><td>Total:</td><td>Delete?</td></tr>
<?php
foreach ($basket as $val)
{
?>
<tr><td><?=$val['id']?></td><td><?=$val['caption']?></td><td><?=$val['price']?></td>
<td><input type="text" name="qty'<?=$val['id']?>'" value="<?=$val['qty']?>" size="3" maxlength="3" /></td>
<td><?=$val['total']?></td><td><a href="<?=site_url().'delete_item/'.$val['id']?>">[x]</a></td></tr>
<?php
}
?>
</table>
<input type="submit" name="submit" value="Update Cart" />
</form>
<p><a href="<?=site_url().'delete_all'?>">Empty Cart</a></p>
<p><a href="<?=site_url().'checkout'?>">Checkout</a></p>
<?php
}
else
{
?>
<p>Your shopping basket is empty.</p>
<?php
}
?>
The code also assumes a database “stock_table” with the following structure:
--
-- Table structure for table `stock_table`
--
CREATE TABLE IF NOT EXISTS `stock_table` (
`id` int(10) unsigned NOT NULL auto_increment,
`caption` varchar(20) NOT NULL,
`quantity` int(10) NOT NULL default '0',
`price` float NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
This code has yet to be put to the test in a production environment, so use it entirely at your own risk. You will also notice that the checkout function has not been completed. This is a project for another day, and it’s worth looking at the CodeIgniter PayPal library http://codeigniter.com/wiki/PayPal_Lib/ to help you.
After a brief return to Windows XP (surely it can’t have been that terrible… oh yes it was), I am now back on Hardy Heron once again. For those few essential Windows apps that I can’t live without I’ve recreate a VM in VirtualBox. All fine and dandy, except all of my host’s USB devices were showing as “unavailable”. Strange indeed. The host could access them perfectly well, but not the guest VM.
After a quick Google, I found the answer on this page:
http://ubuntuforums.org/archive/index.php/t-541195.html
Basically, I had to set up a “usbfs” group, add myself to it, and then create an entry in /etc/fstab that read:
# 1001 is the USB group ID
none /proc/bus/usb usbfs devgid=1001,devmode=664 0 0
Hey presto, USB device can now be connected to the VM. Bizarrely, this didn’t need to be done the last time I had a flirtation with Hardy.
*** UPDATE ***
VirtualBox 2.2 doesn’t actually need you to do this. All you need to do is add yourself to the vboxusers group.
Worldwide Pinhole Photography Day 2009 will be celebrated around the world on Sunday April 26th. If you’ve never pinholed, check out the Worldwide Pinhole Photography Day site for a workshop near you.
Pinhole! Pinhole! Pinhole! « Flickr Blog.
I’ve already ordered a pinhole camera kit from sogifted.co.uk in preparation. http://www.sogifted.co.uk/photography-pinhole-camera-p-551.html. Not quite sure what to expect, but it all sounds kinda fun.
Following on from my saga of the overheating Acer Power 2000, I decided to go back to running Ubuntu Hardy Heron and only run Windows XP in Virtual Box for the few bits and pieces I couldn’t run using Wine or CrossOver Office. This move worked out pretty good, except for problems I was having getting GWT’s hosted mode browser to show the project I was working on. The console launched, the browser launched, and then nothing. No error message. Nothing. A compilation with the shell script worked fine, but it’s a real pain to have to recompile a project just to check the look and feel.
First I thought it could be because I was using GWT-Ext. The solution they give is to include the javascript files in your module instead of the HTML page.
http://gwt-ext.com/forum/viewtopic.php?f=9&t=2277
Alas, it didn’t help.
Then I stumbled across the solution here:
http://markmail.org/message/4kpni2fnicj4hykt
Basically, I keep all of my source code on a removable USB hard drive. The hard drive is formatted with FAT 32. In order for the hosted mode browser to work, you need to edit /etc/fstab to mount the drive with slightly different parameters.
I thought this would be worth a try, so I created a fstab entry:
/dev/sdb1 /media/Elements vfat rw,nosuid,nodev,noatime,uhelper=hal,flush,uid=1000,utf8,shortname=mixed,umask=077,usefree
Et Voila! The hosted mode browser works absolutely fine.