Only fill this in if you're a spammer huh? Your name :
Your email :
Your message :

Category: Techno Babble

Jun
16th
2008

Do you captcha your target audience?

Posted in : Techno Babble

Seeing is believing

In the past I've ranted about "webmasters" and their total failure when it comes to designing websites that are accessible to everyone on the web, and Scott and myself have had many a conversation on the same subject, especially that favourite of "webmasters" called CAPTCHA's. Not only are they 100% pointless because they can be easily broken but they require that humans jump through hoops to prove that they are a human and are impossible for people with certain conditions to solve .... such as dyslexics :

Ask Oxford wrote :

dyslexia

/disleksia/

noun a disorder involving difficulty in learning to read or interpret words, letters, and other symbols.
— DERIVATIVES dyslexic adjective & noun.
— ORIGIN from Greek lexis "speech" ( apparently by confusion of Greek legein "to speak" and Latin legere "to read" ).

Why pick Dyslexics?

I single out Dyslexics in particular because I happened to be chatting with Tilqi on IRC about accessibility and the mentality of most "webmasters", the edited version of the conversation went a little like this :

<tilqi> i insist on the impossibility of an absolute globalization / standarization or whatever you call it
<yabba_hh> whilst people think that, you remain correct
<tilqi> when so much obstacle about it
<yabba_hh> the obstacles are 100% man made ;)
<tilqi> i agree the need of it, but like many other things it is both vital and impossible
<tilqi> and you are not very comprimising today (:
<yabba_hh> lol, I'm not compromising on any day when this is the subject, I believe in it passionately ;)
<tilqi> yea but it's like 'world peace' , lol it even sounds funny anymore.. you know it must be established but you can not and never will
<yabba_hh> but you know that it is the right thing ;)
<yabba_hh> accessibility is the same "right thing", and is far more achievable ;)
<yabba_hh> it's only getting "more impossible" because current "webmasters" are making it that way ;)
<tilqi> i mean may be you can do it confiscating all the computers and re distribute and 'locked' computers with firefox installed :P
<yabba_hh> lol, you need to change the mentality of the coders, not the capabilities of computers ;)
<yabba_hh> I have zero problem with using flash / js ... but things *must* work without both
<tilqi> yea but they mostly *dont*
<tilqi> sector leader websites
<yabba_hh> then that's a failure of coding
<tilqi> all the portals in the world
<tilqi> and nba.com uefa.com etc etc
<tilqi> all use flash %90
<yabba_hh> the fact that they use all this stuff doesn't make it right, it's crap coding and excludes a large percentage of web users
<tilqi> there are countries below %90-99 literacy percantage still
<tilqi> and i am not talking about African countries ;)
<yabba_hh> pretty sure that UK is below 90% literacy
<yabba_hh> and that's without taking into account blind people and dyslexics

There must be Dyslexic sites surely?

That sparked off a google search, where I found this site beingdyslexic.co.uk, not that it was that hard to find, it was the top result in a google search for "dyslexic forum". They have a really cool quote on their home page :

beingdyslexic.co.uk wrote :

At Being Dyslexic with have a strong sense of community built upon the ethos that dyslexia is a gift.

Becuase dyslexia has a right brain dominance, this allows you to see every day activities from a slightly different angle. Dyslexics tend to be more creative and inspirational than your average joe.

Our brains are amazing. Try to learn stratagies that help you overcome any day-to-day problems, this will then allow you to explore the world in our unique but amazing way.

Now these people sound like they really know what they're talking about huh? Sooooo you'd expect that their forums, out of all of the forums in the world would be as dyslexic friendly as possible right? Well they pretty much are, low on images, high on text content and lots of other dyslexic members that are eager to help and share, assuming they can register of course. If you click that link and then agree to their terms and conditions and proceed to the next page, guess what you get to see? That's right a bloody CAPTCHA. Misunderstanding your target audience when you run most sites is bad enough, but whoever made the decision to implement a captcha on a dyslexics site should be put against a wall and shot for total stupidity :|

If you use captchas on your own site, whether they're targeted at visually impaired people or not, then I'd advise you put them in the bin where they belong, not only are they a complete waste of time they lock a lot of the web away from people who do not have the ability to complete them ... ohhh, and before anybody mutters anything about audio captchas, don't, there should be no hoops for humans to jump through just to be able to use the web, period.

¥

1577 views and only 13 comments
Top ways you found my blog
Jun
2nd
2008

Opening the blogrums

Posted in : Techno Babble

It's like a forum, but it's a blog

Finally, I've mostly integrated the old blogrum code with InnerVisions .... I've even started a tutorial on how to add a blogrum to your own b2evolution blog .... don't get excited though, it's nowhere near finished and I'm not in any great rush ;). There's still a fair amount of work to do with it before it's anywhere near the end result I have in mind, and the skins a tad shagged in IE6, but I'll be re-skinning it as soon as I've got all the code working and testing, so either put up with it or switch to a browser that it does work in ;)

I've decided that I can't be arsed importing all the current blogrums posts/comments/users, it's more hassle than it's worth so I'll just leave the current version where it is and shut down the ability to post/comment there. I also haven't redone the ability to create a new post from the frontend, I'll work on that when I get more free time. For the moment it's only linked in my drop down menus as I'd need to redo the header graphic to add it to the menu buttons, and I'm liable to go for a whole new skin if I have to go to that effort anyway ;)

Anyway, feel free to have a play, and let me know if you find any bugs/quirks ;)

¥

969 views and only one comment
Apr
13th
2008

Bourne to Bash

Posted in : Techno Babble

Not all shells are on a beach

I decided to have a play with Bash this weekend as I'd been asked if I could come up with a backup process that was simple enough for the average joe blogs to configure to suit their needs. The script needed to be able to do daily/weekly/monthly backups of selected databases and files/folders and store them on a different server, as a nice touch it also emails the user to let them know that the backup had been done and which databases/files/folders had been included. As well as doing the backups it also keeps the latest 3 in a grandfather/father/son rotation which gives the user 9 potential backups which they can recover from.

As I haven't had a shedload of experience in using bash I spent a fair amount of time hunting round the web looking for clues as to how to do some bits and bats so I thought I'd share some snippets as some of them took a fair amount of searching for/solving and you never know, it may just help someone else in the future ..... probably me :p

Code:

#!/usr/bin/env bash
#
# Read a named file into a variable
#
 
# read "file_you_want" into $variable_name
contents=$(<foo.txt)
 
echo "${contents}"
 
#
# Read a variable file into a variable
#
 
# set $variable_name = "file_you_want"
my_file='/path/foo.txt'
 
# read file $variable_name into $variable_name
contents=$(<"${my_file}")
 
echo "${contents}"

Code:

#!/usr/bin/env bash
#
# Convert windows line endings to linux line endings
#
 
# set $variable_name = "file_you_want_to_convert"
filename='/path/foo.txt'
 
# remove all \r and save the output to $variable_name.linux
tr -d '\r' < ${filename} > ${filename}.linux
 
# remove original file
rm ${filename} -f
 
# rename $variable_name.linux to $variable_name
mv ${filename}.linux ${filename}

Code:

#!/usr/bin/env bash
#
# check if a process is already running
#
 
# name of the process to check for
# add [] around the first letter to stop the "grep process" from showing
check_process='[f]oo'
 
if ps aux | grep -q "${check_process}"
  then
    echo 'running'
  else
    echo 'not running'
fi

Code:

#!/usr/bin/env bash
#
# switch between 2 directories
#
 
# switch to directory 1
cd /path/foo/
 
# show current directory
pwd
 
# switch to directory 2 and "remember" previous directory
pushd /path/bar/
 
# show current directory
pwd
 
# switch back to directory 1
popd
 
# show current directory
pwd
 
# alternative method
 
# switch to directory 1
cd /path/foo/
 
# show current directory
pwd
 
# switch to directory 2 and "remember" previous directory
pushd /path/bar/
 
# show current directory
pwd
 
# switch back to directory 1
pushd
 
# show current directory
pwd
 
# switch back to directory 2
pushd
 
# show current directory
pwd

Code:

#!/usr/bin/env bash
#
# send an email using echo
#
 
echo 'your email content' | mail -s 'your email subject' email_1@domain.com email_2@domain.com
 
#
# send an email using a file as content
#
 
mail -s 'your email subject' email_1@domain.com email_2@domain.com < email_content.txt
 
#
# send an email using a variable file for content
#
 
# set $variable_name = "file_you_want_to_use_as_content"
email_body='/path/foo.txt'
 
mail -s 'your email subject' email_1@domain.com email_2@domain.com < ${email_body}
 
#
# send an email using a file and replace "%placeholders%" with variables
#
 
# set $variable_name = "file_you_want_to_use_as_content"
email_body='/path/foo.txt'
 
# set $variable_name = "replacement_value"
foo='bar'
 
# replace the placeholders and email the results
# replaces %placeholder% with $foo
sed -e "s!%placeholder%!${foo}!;" ${email_body}" | mail -s 'your email subject' email_1@domain.com email_2@domain.com

Code:

#!/usr/bin/env bash
#
# find the directory your script lives in
#
 
foo= `dirname $0`
echo $foo

¥

Tags: bash, snippets
632 views and only 2 comments
Mar
23rd
2008

I'm an Ubuntu expert

Posted in : Techno Babble

My wall and forehead are getting married

Considering the number of times I've had to re-install ubuntu recently I should be a bloody expert! .... I've learnt not to play with X .... he gets pissed off real easily :| ..... Saying that, and with shedloads of help from Afwas, I've managed to get it installed with the majority of the software that I need to be able to play on the web, although I was devastated when I couldn't install IE6,7,8beta.....urm, well any IE version really...... the good news is, it would appear that my pc really CAN move files around without having the unsafest pile of crap since ......urm ........ sliced bread? .... is sliced bread unsafe? ..... I suppose you could always cut yourself with the knife while slicing it?

Anyway, I've mostly managed to install all the shit I need on a day to day basis ...... but I might need to reinstall, so this is just to remind me of stuff ;)

  1. xampp : just so I can run a localhost. This forum thread is invaluable ( HOWTO: Setup easy web development environment (XAMPP) ), but grab the latest version ( 1.6.6 or summat, at the time of writing ), and my desktop file was in a different place, ohh and I had to change the symlink a tad .... but if you're looking for xamppp then you probably know how to cure all that crap huh? ;)
  2. cvs client : so I can break the core next time FG pisses off gallivanting around USA and pretending it's work :| .... gcvs from synaptic update thing handles that
  3. kopette : so I can get harassed by all the arses I have in my yahoo list ( hi guys ... and gals :D ) ..... weirdly that's another that's available via the synaptic thing ;)
  4. x-chat : so I can get harassed in irc as well :| .... spookily it's another one available through synaptic ,,,, damn ... it's taking me ages to find a piece of software I can't afford :D
  5. scite : editor thing for code ..... but I really need to find summat that fits my needs better ... mind you, it's probably just me not knowing what to tell it? "scite : I need an editor that can work on remote servers" ( any suggestions that don't involve a fish will be greatly appreciated )
  6. VirtualBox OSE : so I can run windows in a subservient manner ;) .... not actually done this yet, but looks promising ... ohhh, and it's also available from that synaptic geezer that seems to have an endless supply of software that fits my wallet ;)

Sounds great huh?

So, now that all y'all think I'm a bloody genius .... which I am of course :| ...... I should point out that even my dad can run linux, and he's like "really old" and shit. I've still got a fair few things that I'm missing ... like my second screen working, and a decent ssh client that can hold multiple sessions in tabs .... and I must setup all my email accounts, although the lack of spam whilst they're not setup is damn attractive ... ohhh and I must change the desktop background, the swirly modern art brown thing really isn't to my tastes.

...but, has my production improved by using linux?

Stupid bloody question really, of course it hasn't improved, I've spent the best part of a couple of days just trying to avoid another re-install ..... it's all X's fault .... so I've done bugger all work! ...... mind you, it IS the weekend so maybe I shouldn't feel ...... urm ..... you know, that feeling you get when yer meant to be doing stuff but instead you just piss off an play? ... anyway, I'm not feeling that.

/me wanders off to find a yen sign that I can copy+paste cos I haven't worked out a way to type "¥" from the keyboard yet :S

¥

2620 views and only 8 comments
Mar
20th
2008

Playing with a blogrum

Posted in : Techno Babble, Skins, Hacks, Plugins & Widgets

Convincing Evo that it's a forum

On the grounds that it's often easier to show something than try explaining it .....go visit the blogrum. Before you ask, no it's not ready for release yet, I need to sort out some permissions stuff to do with comments and tidy up the code and css ..... cos it's a tad messy in there ..... and then it's gonna take a mammoth post to explain what it can do, how, where, why and when. The good news is that it's pretty much just a trick skin with a couple of plugins thrown in, although I have a few more plugins in the works to make it work even more like a forum.

Registration is open, so if you want to have a play then feel free, although guest users can comment in the chatter blogrum so if all you want to do is spam me then there's no need to even register ;)

¥

Tags: blogrum
1326 views and only 2 comments
Feb
24th
2008

Magento anybody?

Posted in : Techno Babble

Add dash of XML....

I've been a smidge quiet lately because we're in the middle of re-skinning an old OS-Commerce store. As always we started by creating a shiny new dev sub-domain for it to live on so we don't break the live site ..... problem number 1, OS-Commerce requires register globals to be enabled before it can run .... wtf? Not a chance that's going to happen on our server, not even a dev site! .... so, joy of joys we now need to find another e-commerce solution as well as skin it!

After wandering around the demo areas for a few other e-commerce solutions and listening to suggestions from other people we eventually ended up picking Magento Commerce ..... cool, decision made, time to go to work.

Did I mention XML yet?

So, I got handed this shiny new software and a picture of the proposed skin with "let me know when you've sorted all the code out" ... and into the deep end I dived ....... I wish like hell I hadn't ... I have NEVER seen so many files required for a skin in all my life!! ..... seriously, I didn't even bother to count them, mainly because I have trouble with 3 digit numbers, but also because I get bored easily .... but, how hard could it be right? ....... wrong! As well as having more files than a blonde can count before either the boredom threshold or upper number cap is hit, they also have this reaaaaaally "flexible" approach to skinning where everything is controlled by XML files, and some other files.

This one controls the catalogue, note, this is just for viewing the catalogue, there's another for customers, and one for checkout .... ohhh and another for sales, and one for searching the catalogue ...... etc

XML:

<?xml version="1.0"?>
<!−−
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* @category   design_default
* @package    Mage
* @copyright  Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*/
 
Supported layout update handles (action):
- catalog_product_gallery
- catalog_product_compare_index
 
Supported layout update handles (special):
- default
- catalog_category_default
- catalog_category_layered
- catalog_product_view
 
−−>
<layout version="0.1.0">
 
<!−−
Default layout, loads most of the pages
−−>
 
    <default>
 
        <!−− Mage_Catalog −−>
        <reference name="top.menu">
            <block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>
        </reference>
        <reference name="right">
            <block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
                <action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>
                <action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (800) DEMO-NUMBER.</alt></action>
                <action method="setLinkUrl"><url>checkout/cart</url></action>
            </block>
        </reference>
        <reference name="right">
            <block type="core/template" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
            <block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml"/>
        </reference>
        <reference name="footer_links">
            <action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Site Map</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title><prepare>true</prepare></action>
        </reference>
 
    </default>
 
 
<!−−
Category default layout
−−>
 
    <catalog_category_default>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list"></block>
            </block>
        </reference>
    </catalog_category_default>
 
<!−−
Category layered navigation layout
−−>
 
    <catalog_category_layered>
        <reference name="left">
            <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
        </reference>
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list"></block>
            </block>
        </reference>
    </catalog_category_layered>
 
<!−−
Compare products page
−−>
 
    <catalog_product_compare_index>
        <!−− Mage_Catalog −−>
        <reference name="root">
            <action method="setTemplate"><template>page/one-column.phtml</template></action>
        </reference>
        <reference name="head">
            <action method="addJs"><script>scriptaculous/scriptaculous.js</script></action>
            <action method="addJs"><script>varien/product.js</script></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_compare_list" name="catalog.compare.list" template="catalog/product/compare/list.phtml"/>
        </reference>
    </catalog_product_compare_index>
 
    <customer_account_index>
 
        <reference name="right">
            <action method="unsetChild"><name>catalog_compare_sidebar</name></action>
        </reference>
    </customer_account_index>
 
<!−−
Product view
−−>
 
    <catalog_product_view>
        <!−− Mage_Catalog −−>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </reference>
        <reference name="head">
            <action method="addJs"><script>varien/product.js</script></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
                <block type="catalog/product_view_super_config" name="product.info.config" as="super_config" template="catalog/product/view/super/config.phtml"/>
                <block type="catalog/product_view_super_group" name="product.info.group" as="super_group" template="catalog/product/view/super/group.phtml"/>
                <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml"/>
                <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
            </block>
        </reference>
        <reference name="right">
            <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
        </reference>
 
    </catalog_product_view>
<!−−
Product send to friend
−−>
<catalog_product_send>
        <!−− Mage_Catalog −−>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </reference>
        <reference name="head">
            <action method="addJs"><script>varien/product.js</script></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_send" name="product.send" template="catalog/product/send.phtml">
            </block>
        </reference>
    </catalog_product_send>
 
<!−−
Product additional images gallery popup
−−>
 
    <catalog_product_gallery>
        <!−− Mage_Catalog −−>
        <reference name="root">
            <action method="setTemplate"><template>page/one-column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_gallery" name="catalog_product_gallery" template="catalog/product/gallery.phtml"/>
        </reference>
    </catalog_product_gallery>
 
<!−−
Site Map block
−−>
    <catalog_seo_sitemap_category>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
              <block type="catalog/seo_sitemap_container" name="seo.container" template="catalog/seo/sitemap/container.phtml"/>
        </reference>
    </catalog_seo_sitemap_category>
    <catalog_seo_sitemap_product>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
              <block type="catalog/seo_sitemap_container" name="seo.container" template="catalog/seo/sitemap/container.phtml"/>
        </reference>
    </catalog_seo_sitemap_product>
<!−−
Catalog search terms block
−−>
    <catalog_seo_searchterm_popular>