July 15th, 2010
No Comments
This list is partly to remind myself what essential apps need to be reinstalled after a system wipe.
But it does have me thinking, what do other web developers use on a daily basis?
Web browsers:
- Google Chrome
- FireFox
- IE
- Opera
- Safari
FireFox addons:
- Adblock Plus
- British English Dictionary
- ColorZilla
- Dummy Lipsum
- Firebug
- Html Validator
- Web Developer
- Xmarks
Code editing:
- PhpEd
- Eclipse PDT
- TextPad
- vim
Code tools:
- SQLyog
- WinMerge
System tools:
- PuTTY
- Vbox
- Synergy
- TightVNC
File tools:
- FileZilla
- DropBox
- Jungle Disk Workgroup Edition
- WinZip
- WinRar
- 7-Zip
Graphical manipulation:
- Paint.NET
- Adobe CS
- jRuler
“Productivity” apps:
- MS Office
- Google Apps Sync
- Foxit Reader
Communication:
- Skype
- Zoom phone adapter (use the Vista 64bit driver to get this working on 64bit Windows 7)
- X-Chat
CD/DVD tools:
- CDex
- DeepBurner
Audio/Visual:
- Spotify
- iTunes
- VLC
Dock gadgets:
- Digital Clock
- GMail Counter
Time off:
- Steam
—
Ace on DHBiT pointed me at http://ninite.com/, how very useful. Will make use of it next time
July 4th, 2010
No Comments
Requirement: pre-filter products by customer group name to product attribute.
I was looking for the “proper” way of filtering items by multiple custom attribute settings, but couldn’t find out how.
So, the following is a brief explanation of how I’ve got this running in Magento 1.4.1.
There are two ways of editing core code in Magento.
- Wrong: edit files directly in
app/code/core/Mage
- Right: extend modules and keep them in
app/code/local/MyDevCompany
If you’re in a hurry, you might edit core files directly and then later copy the altered code out into correctly extended module files.
For most of my Magento work, this is the route I have taken: get it working in the core then extend it once I’m sure I’m messing with the correct file/method. Just be sure to copy the code out at some point before upgrading the core!
This is how I have extended _getProductCollection() in app/code/core/Mage/Catalog/Block/Product/List.php – the method which generates the product list when viewing a category.
The extended file would be saved to app/code/local/MyDevCompany/Catalog/Block/Product/List.php
<?php
class MyDevCompany_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
{
function _getProductCollection()
{
// ... snipped - be sure to copy correctly from the original source file ... //
$this->_productCollection = $layer->getProductCollection();
// fetch the list of schools and their associated IDs
$_product = Mage::getModel('catalog/product');
$_attributes = Mage::getResourceModel('eav/entity_attribute_collection')
->setEntityTypeFilter($_product->getResource()->getTypeId())
->addFieldToFilter('attribute_code', 'stv_school');
$_attribute = $_attributes->getFirstItem()->setEntity($_product->getResource());
$stv_schools = $_attribute->getSource()->getAllOptions(false);
$schools = array();
foreach ($stv_schools as $stv_school)
{
$schools[$stv_school['label']] = $stv_school['value'];
}
// Filter by school name and non specific items
$allowedSchools = array($schools["Non specific"]);
$customer_groupID = Mage::getSingleton('customer/session')->isLoggedIn() ? Mage::getSingleton('customer/session')->getCustomerGroupId() : null;
if ($customer_groupID !== null)
{
$groupName = Mage::getSingleton('customer/group')->load($customer_groupID)->getData('customer_group_code');
$allowedSchools[] = $schools[$groupName];
}
$this->_productCollection->addAttributeToFilter('stv_school', $allowedSchools);
$this->prepareSortableFieldsByCategory($layer->getCurrentCategory());
// ... snipped - be sure to copy correctly from the original source file ... //
}
}
Reason I have used such a long and ugly method: addAttributeToFilter() will only play ball with attribute value IDs.
By fetching possible attribute value text and IDs, flipping the data, we can successfully filter by human readable text.
Further reading on how to set up a module for extension, see http://www.magentocommerce.com/wiki/groups/174/changing_and_customizing_magento_code
June 24th, 2010
No Comments
I originally blogged about this on my other site lazygnome.net but that was simply a quick place to record it.
I present to you a very quick and handy way of replicating PHP’s trim() function in JS:
function ws_trim(value)
{
return value.replace(/(^\s+|\s+$)/g, '');
}
There it is, simple and usable.
I don’t claim to be original with this code. I’m sure that others have done exactly the same themselves. But it surprises me that JS doesn’t come with such a text manipulation method by default.
http://www.lazygnome.net/diary/594
May 21st, 2010
4 Comments
Installed Ubuntu 10.04 from ISO onto a blank virtual box machine.
All worked well for a while, until I recently did an aptitude safe-upgrade.
The next time I booted the system, mysql failed to start and refused to do so when I issued: sudo service mysql start
It would just hang there.
Tracked the issue down to this bug. How I maged to get get it to work:
In a terminal: sudo /usr/sbin/mysqld
In another terminial:
sudo service mysql start
sudo service mysql stop
sudo killall mysqld
Now mysql will start and stop on the system as it should.
[nb: this is a rough artical, I will flesh it out when I have more time]
[edit 27-05-2010: this is not a permanent fix and requires to be executed after every system start. Looking forward to a fix on this...]
[edit 22-06-2010: see Ryan's comment to fix this issue. I hope this helps others
]
March 25th, 2010
1 Comment
Just a quicky…
Using the guide from here, I’ve managed to use the ‘net connection of my Nexus One with my Eee PC running Ubuntu Netbook Remix.
Speed tests…
Nexus One using Wi-Fi and home cable:

Nexus One using 3G in the Telford & Wrekin region:

March 17th, 2010
No Comments
The documentation on http://prototypejs.org/api/element/writeAttribute is a wee bit scarce. So here’s a quick one on usage.
To add an attribute:
$('foo').writeAttribute('title', 'bar');
To remove an attribute:
$('foo').writeAttribute('title', null);
To enable all disabled form elements (in a form with the id ‘container’):
$('container').select('[disabled="disabled"]').each(function(e) {
$(e).writeAttribute('disabled', null);
});
February 12th, 2010
2 Comments
The MySQL PASSWORD() function has started giving a different value on a client’s live server compared to local development servers.
This has resulted in end users not being able to log in when PASSWORD() is used to compare the stored and entered passwords.
Why this has happened I have no idea. Any thoughts?
dev
mysql> SELECT PASSWORD('foobar');
+-------------------------------------------+
| PASSWORD('foobar') |
+-------------------------------------------+
| *9B500343BC52E2911172EB52AE5CF4847604C6E5 |
+-------------------------------------------+
1 row in set (0.00 sec)
live
mysql> select password('foobar');
+-------------------------------------------+
| password('foobar') |
+-------------------------------------------+
| *9061D7B8DA0D4523AD448B53D80C2B551EDF8CD1 |
+-------------------------------------------+
1 row in set (0.00 sec)
November 23rd, 2009
No Comments
When something really note worthy happens, I usually don’t go longer than a few days without knowing.
But, for some reason, I just learnt about something that happened 19 March 2008.
Only by reading this comic in this book did I learn of Arthur C. Clarke‘s passing. This is particularly shocking as Arthur C. Clarke was the main author of the books I read in my childhood.
You’d have thought that it would have been bigger news. Maybe I just live under a rock.
Buy the book, read the comics, follow the might of Hijinks Ensue.
November 11th, 2009
2 Comments
This is on myrant.net rather than my other blog on lazygnome.net as it wasn’t as quick and easy as I’d have liked to set up. So, in a way, a very tiny rant with a lot of helpful content (I hope).
Inspiration for this article came from following Popey’s setup instructions with Ubuntu 9.10 alpha.
- Download Ubuntu 9.10 32bit desktop ISO: http://www.ubuntu.com/getubuntu/download
- a) if you have an external CD drive, burn the ISO to a CD.
b) if you have a USB flash drive: download and install UNetbootin from http://unetbootin.sourceforge.net/. This is available for Windows and Linux. Use this util. to ‘burn’ the ISO to your USB flash drive.
- a) if you have an external CD drive, put the ubuntu CD into the drive.
b) if you have a USB flash drive, plug it into the Revo (Any USB port seems to work).
- Power on the Revo and hit f12 to enter the boot menu.
- Select CD or USB depending on your install medium.
- Select Default, or wait and it’ll select it for you.
- The Ubuntu desktop will eventually load.
- Have a play, or click ‘Install Ubuntu 9.10′.
- On step 4, partitioning, I chose to use the entire disk. If you don’t want to ditch the shipped OS, choose another option.
- Set up a username/password then choose if you want to log in automatically. Normally, I wouldn’t set this, but as it’s going to be a media centre, you might as well have it log in automatically.
- Step 6 will allow you to check you have set the options you want. Once you are happy, continue the install and go make a cuppa tea, do the washing, feed the cat, read a book; as this will take some time.
- Reboot the machine once installation has finished.
- When the desktop is usable, run the Update Manager – at the time of writing, there were 86 packages to be updated.
- Click on Restricted drivers available and activate the NVidia accelerated graphics driver.
- From this point, follow Popey’s install instructions.
- Whilst following Alan’s instructions, I had to grab 3 debs from Jaunty (rather than his stated 1). These are:
http://packages.ubuntu.com/jaunty/i386/liblzo1/download
- http://packages.ubuntu.com/jaunty/i386/libdirectfb-1.0-0/download
http://packages.ubuntu.com/jaunty/i386/libkrb53/download
By this point, Boxee is accessible via the Sound & Video menu.
Next task, for me, is to get an external enclosure for my internal blu-ray drive (still waiting for decent blu-ray support in linux).
November 9th, 2009
No Comments
[this is a bit of a random rant, excuse me whilst I ramble]
Every year, the sale of fireworks seems to come earlier and earlier.
In the UK, we used to use them on the 5th November (or the closest weekend). Now they seem to be in use from the 30th October to mid November. And then over the whole Christmas period.
When in the right hands, they can be great fun. But as people have more and more access to them, the fun becomes less.
My thoughts:
- The sale of fireworks should be licensed in the same manner as the sale of alcohol.
- The purchase of fireworks should be more tightly controlled. Get them out of the supermarkets and corner-shops for a start.
- The use of fireworks should also be licensed. This would restrict displays to organised events and not 14 year old kids throwing fireworks down the street, or scaring fish.
I don’t want to be kill joy, but explosives need to be treated with respect.
Maybe I’m getting old and jumpy. I love the look of a good display. I don’t like having to fish the cat out from underneath the bed.