Here is my last little project. It is about one of my favourite robots: Optimus Prime from the Transformers Gen 1. I have tried to make this robot as I think he would be in the real world. I mean, a true truck. As a true truck he is no clear and his parts as truck are the same that his parts like robot. I like to see it as an old used truck.
I don’t want to even think about how long that took to put together.
My secondary mail server (that runs qmail) had a load of email queued up today that I needed to flush. Googling comes back with people saying run qmail with daemontools then you can use on of the nice qmailctl scripts to do a ‘doqueue’. Needless to say I’m not running with daemontools (my primary is), it’s just a secondary server that does *nothing* else and I wanted to keep it nice and simple.
Anyway, I finally found out that sending an ALRM signal to qmail-send works.
I’ve been working on a site that’ll be launching in the new year that contains its share of contemporary web technologies (look, roll your eyes if you want but I managed to avoid the W2 word); it also has its fair share of subtle drop shadows which have to work over a stripy background.
Initially I figured that this wasn’t possible but after being prodded in the right direction by the designer it turns out that it is by using PNGs with alpha transparency. To be fair initially I’d discounted this as an option due to *spit* IE6 and it’s lack of support for them.
WRONG Mr Beale
As it is there is a way to display PNGs with alpha transparency in IE6, which is ironic now that IE7 has been released (which supports this out-of-the-box).
Anyway, I found it so useful that I figured it would’nt hurt to post about it.
1) Make a PNG with alpha transparency: Initially I was following these instructions for creating them in Photoshop which whilst a lengthy process, does work. However after a 2 min chat with same designer (pint = owed++) I was using Image Ready to export slices of items with the drop shadow effect applied, background disabled and PNG24 with transparency ticked under the ‘optimise’ tab. A tad quicker to implement (and much more consistent)
2) Make HTML/CSS work:
Take some dirty, non-semantic and unpure (but working) mark-up to make a vertically stretchy box with a shadow down the right and across the bottom. It’s made by three background slices: top bit (so the shadow doesn’t cut a straight line across the top corner, instead it fades in), middle repeating bit and bottom shadow bit:
[html]
getContent(); ?>
[/html]
Matching CSS:
[css]#defaultContentHolder {
width: 603px;
float: left;
}
#defaultContentTop {
background: url(/images/frontend/background/defaultContentTop.png) top right no-repeat;
width: 603px;
height: 32px;
}
#defaultContentMiddle {
background: url(/images/frontend/background/defaultContentMiddle.png) top right repeat-y;
width: 603px;
}
#defaultContent {
width: 550px;
padding: 20px 20px 20px 20px;
position: relative;
top: -30px;
}
#defaultContentBottom {
background: url(/images/frontend/background/defaultContentBottom.png) top right no-repeat;
width: 603px;
height: 10px;
}[/css]
b) Include the stylesheet but only for browsers less than IE7. Using the following method we can achieve just that AND our code will still validate, which is obviously a pre-requisite.
[html][/html]
Has to be said that I’m still looking for the catch, but I can’t find one. It Just Works.
The Standardista Rebels have established a secret base on the remote domain of squidoo.com. The Dark Lord of the Kludge, Darth Gates has sent web crawlers in search of this base and its commander, Luke Veloso. While Luke is out browsing around the base, he is locked up and his browser is crashed by a Wampa applet.
Meanwhile, back at the base, the hacker-blogger Tantek Solo announces his intention to leave the Rebels to repay the debt he owes to the vile gangster Digg the Hutt (much to the displeasure of Princess Molly). But after Tantek discovers that Luke has not returned from his browsing patrol, he delays his departure and leaves the base to look for him.
I’ve been playing with the AJAX support in Symfony this weekend and I’m blown away by how easy it is.
Today I put together a detailed/summary view switcher for a list of items coming from a database with a (script.aculo.us) fade in/out effect and I didn’t need to write one line of JavaScript. Now that’s what I’m talking about.
Here’s a summary of what I did, with example code:
Everything applies to the ‘list’ action belonging to the ‘bar’ module. The view displays either detailed or summary view for a paginated list of records coming from the database.
In my view file (app/module/templates/listSuccess.php) I add:
[php][/php]
A quick reload and I can see that the libraries have been loaded:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed nulla augue, rhoncus in, ornare ac, vestibulum vitae, turpis. Suspendisse lacinia, odio at ornare suscipit, quam tellus dictum orci, eget egestas nibh sapien in enim. Nulla sed est nec lorem consectetuer adipiscing. Vivamus aliquam est ultricies ipsum. Duis et lacus. Nam venenatis sem sit amet justo. Donec pellentesque sodales felis. Nulla suscipit consequat arcu. Ut mollis turpis sit amet orci. Curabitur mauris massa, euismod eget, fringilla vel, interdum a, justo. Donec sed augue. Donec augue lacus, ullamcorper in, ultrices a, rhoncus sed, diam. Fusce nunc magna, porta eget, varius a, faucibus varius, est. Integer euismod dignissim mi. Aenean accumsan lectus non purus. Quisque ultrices sapien vitae sapien. Etiam tincidunt tellus et odio. Morbi pellentesque. Proin pharetra sem at massa.
[/php]
and the module’s controller looks like:
[php]
class barActions extends autobarActions
{
public function preExecute ()
{
// set a view mode for the bar/list page if one isn't already set
if (!$this->getUser()->hasAttribute(‘viewMode’))
{
$this->getUser()->setAttribute(‘viewMode’, ‘detail’);
}
}
/**
* @desc Called by AJAX when clicking on the [Detail|Summary] view link.
* This allows us to ‘remember’ the view that the user they have chosen
*/
public function executeSetmode()
{
$this->getUser()->setAttribute(‘viewMode’, $this->getRequestParameter(“mode”));
// if javascript is disabled we need to re-direct back to the listing
$this->redirect(“bar”);
}
}
?>[/php]
So when we click on the detail/summary link we want to set a session variable so that the application remembers the view mode. To do this this the template specifies an AJAX call using the link_to_remote() JavaScript helper it then, by using the ‘complete’ parameter, executes the javascript methods. The visual_effect() calls are Symfony’s javascript helpers and they do the script.aculo.us fades between the two content windows, note the chaining. The latter part of the ‘complete’ parameter are additional direct javascript calls to Prototype methods so we can swap the navigation links to remove the link for the active view mode.
Like any self-respecting developer I wanted to ensure that the code would work with scripting turned off. Now this was the only part of the excersise where I had to do a bit of digging. In the excellent Symfony documentation under JavaScript helpers there is mention of the if_javascript() method, e.g.:
[php]
You have JavaScript enabled.
You don’t have JavaScript enabled.
[/php]
This seemed a bit cumbersome to me so after some further digging into the API I noticed the $options_html() array for link_to_remote() . Using this I pass the URL so the href gets populated (normally it’s just a #) and as the last item within ‘complete’ I add a return false; so with JavaScript enabled the link is not followed. Finally in my controller for setmode action I add the redirect. Now, even with javascript disabled, it all works albeit with a page reload.
I’ve still plenty to learn with Symfony but I can see that now I’m over the worst of the learning curve I’m going to start really enjoying it from here on in.
It’s easy to work out, take the formula (that I just made up):
S / ( P x A ) = M
Where: S = Total number of spam emails that you have P = Period that they were collected over A = Num of accounts collected from M = My spam index
I use gmail so this calculation is easy:
S = 11,242 in my spam filter right now
P = 30 days (as it auto deletes after 30 days)
A = 2 (the main gmail account plus my 8+ yr old bealers.com email account)
I’ve updated my svn repository creation script, it now copies and imports the code.
Works for me, etc.
[code]#!/bin/sh
# Darren Beale - siftware.co.uk
# bealers@gmail.com
# Oct 06
# v0.2
# This simple script creates a folder structure
# containing /trunk /tags and /branches. It then places the
# contents of a folder specified by the user into the trunk,
# creates a subversion repository and imports the code.
# Use as you see fit
## change me
SVN_PASSWD_FILE="/etc/subversion/passwd"
SVN_REALM="SIFTWARE"
SVN_SERVER="shrek"
if [ `id -u` != 0 ]; then
echo "You need to be root to run this script"
exit 1;
fi
echo
echo "You now need to enter the FULL path to the source code that you will be importing."
echo "After importing the folder will be renamed but otherwise untouched."
echo "Note: that the *contents* of this folder will be placed into the trunk for the new project."
echo
echo -n "Path: "
read SOURCE_PATH
echo
if [ ! -d $SOURCE_PATH ]; then
echo "That directory does not exist, exiting..."
exit 1;
fi
echo -n "Please enter the name of the repository that you would like to create: ";
read REPOSITORY_NAME
echo
echo "Copying source code"
cd /tmp
mkdir $REPOSITORY_NAME
cd $REPOSITORY_NAME
mkdir trunk tags branches
cd trunk
cp -Rp $SOURCE_PATH/* .
cd /export/svn
chown -R svn:svn $REPOSITORY_NAME
find $REPOSITORY_NAME -type d -exec chmod 2770 {} ;
echo
echo "Importing....."
cd /tmp/$REPOSITORY_NAME
/usr/bin/svn import . file:///export/svn/$REPOSITORY_NAME/
echo
echo "Done."
echo
echo "You can Ctrl-D now, cd to your sandbox and checkout your project by typing:"
echo "svn co svn://$SVN_SERVER/$REPOSITORY_NAME/trunk $REPOSITORY_NAME"
echo
[/code]
In 1997/8 (whenever it was) I got really excited by Flash 3 coming out; I even went to a do at the Islington Design centre (UK/London) where Macromedia pimped it (showing eye4U and Gabocorp, remember them?) and I got a free pen, woo. I played with it for a while, writing a cartoon strip called Craply Animated Man (that I wish I still had) and I wrote some widgets that tried to sequence audio samples, but failed because Flash didn’t work with sounds too well then. I also wrote a few all-flash sites, I even got paid (very well) for one of them.
Anyway, soon after I realised that writing full flash sites was A Very Poor Idea for lots of reasons (one being that I’m a creative retard) and I started doing other things web.
So today I saw this blog post that was coming from an SEO perspective and I really did Laugh Out Loud:
One of the most common questions that I get asked by web designers and web site owners is whether or not they should create all flash websites. The process of making the decision about flash web sites for SEO (search engine optimization) purposes is actually quite difficult, so I took the time to create a flow chart on whether or not you should create an all flash web site.
As you can see, it gets pretty complicated, but hopefully you can apply this flash website flowchart the next time you are trying to decide whether or not you should create a flash web site.
Around three months into being a freelance web developer again and I’m already fed-up with working from home. This is mainly because of the interuptions but also due to the fact that I never seem to leave work. I also have much more work than I can handle so in the next few days I’ll be moving into an office in ‘town’ that is only 10 mins (walk) from home and big enough to take staff too; I’m currently advertising for a full-time HTML resource to help with my rapidly increasing workload plus Cathie, when not looking after the munchkins and getting things together for her Downshifting Book, will be doubling up as a PA/Office manger from there too.
Anyway, moving into an office means I’ve got to go though the pain of paying set-up costs all over again including getting a new workstation for myself (I’ll still need the one at home of course). I then got to thinking that as I’d just bought a brand new IBM Thinkpad could I use that as a desktop replacement instead?
Turns out that the answer is a resounding YES. By buying the pricey IBM Advanced Dock I can:
Take the DVD burner out of the laptop and place it in the ultrabay on the dock, this frees me up to have a second battery
Plug speakers and USB devices in without having to unplug each night
The clincher: it’s got a PCIe port on it; my mind immediately though MORE SCREENS
A bit of Googling and some price comparisons later and it worked out only a bit more expensive to go for the advanced dock, a second battery, a video card and two Dell 24″ LCDs rather than a decent Dell PC and two OK flat screens (the default is of couse two screens on any machine).
So here we are:
They’ll move to the new office with me next week and be on a bigger desk so I’ll be able to use the laptop screen too then. Amazing to think that’s all running from a laptop.
If you’re interested then the exact spec is:
IBM Z60m laptop (UH3FKUK), with 2GB RAM and noteably a Radeon x600 onboard video card
IBM Advanced Dock with the Ultra bay dual layer DVD burner fitted leaving space for a second battery in the laptop where it used to sit
nVidia XFX 7600GS Video card it fits perfectly into the PCIe bay and has dual DVI outputs
Amonsgt the normal deluge of Spam for Penis enlargment techniques, dodgy drugs and girls that want to fzuc!k m3 n0w, I’m getting plenty of emails with the name “Michelle Salazar” in the subject.
Why is this?
I’ve found this artists website: http://michellesalazar.com/ but that’s obviously unrelated. I shall do some more digging and report back.