17 Apr 2009 - permalink
A long but good post on why we are still stuck with the desktop metaphor for most user interfaces. The very problem I’ve addressed when talking about the problem with online data and views to your media files:
Every geek I know shares, to some degree, the notion that the “desktop” metaphor for computers is outdated. What nobody seems to have a solid opinion on is what would take its place.
Brent Simmons sums it up brilliantly:
I don’t know about you, but I know this issue is always in the back of my head. There’s a nagging feeling that we’re doing it wrong, that there are some leaps forward we’re missing, that we’re still stuck in 1984.
3 Apr 2009 - permalink
The new iPhone app Convertbot by Tapbots is just as beautifully designed as their first, Weightbot. The app feels so polished and at home in the iPhone GUI that it just begs for usage. It doesn’t really feel like an app, rather it becomes the device. This is exactly what it means to raise the bar.
2 Apr 2009 - permalink
Thanks to all the comments in the introducing blog post
, a lot of great features have been implemented in the new version 1.4 of my debug bar plugin for Zend Framework.
PHP
- List of included files include Zend Framework files, are sorted alphabetically and shows the total number of files
- Options can be passed as a Zend_Config instance
- Variables panel include the content of $_COOKIE and $_POST globals
- Ability to set custom timers
jQuery
- Updated to version 1.3.2
- Ability to override path to jQuery lib
- Should no longer interfere with other libs like Prototype
HTML
- The output is valid HTML4_STRICT
- Javascript and CSS are injected into the head of the page rather than the body
- The cursor changes to a pointer to indicate clickable areas
Head over to the Scienta ZF Debug Bar page and give it a spin or read the introducing post.
2 Apr 2009 - permalink
I first thought this to be an April Fools story, but the sgi press release confirms that they have indeed been sold to Rackable.
When I was a kid, Silicon Graphics was king of computer generated imagery (along with George Lucas’ Industrial Light & Magic), producing special effects for movies like Jurassic Park and Terminator. They even initiated the defacto standard for describing 3d models, the OpenGL standard.
Good stuff
17 Mar 2009 - permalink
Working on an as of yet unpublished startup, I needed a validator for the Danish CVR numbers issued as part of VAT registration. As the project is written in Zend Framework, I decided to implement the code as an extension of the Zend_Validate_Abstract and share it here.
The validation is based on the specification located at cvr.dk and involves a modulus 11 check on the 8th digit based on a weighted sum of the previous seven. Not particularly interesting but nice to have when working with Danish companies.
<?php
/**
* Scienta Zend Additions
*
* @category Scienta
* @package Scienta_Validate
* @copyright Copyright (c) 2008-2009 Joakim Nygård (http://jokke.dk)
* @version $Id$
*/
/** Zend_Validate_Abstract */
require_once 'Zend/Validate/Abstract.php';
/** Zend_Filter_Digits */
require_once 'Zend/Filter/Digits.php';
/**
* A class for validating Danish CVR numbers based on modulo 11
* @see http://www.cvr.dk/Site/Forms/CMS/DisplayPage.aspx?pageid=60
* @category Scienta
* @package Scienta_Validate
* @copyright Copyright (c) 2008-2009 Joakim Nygård (http://jokke.dk)
*/
class Scienta_Validate_Cvr extends Zend_Validate_Abstract
{
const INVALID = 'cvrInvalid';
const INCORRECT_LENGTH = 'stringLengthNotRight';
const NOT_DIGITS = 'notDigits';
protected $_messageTemplates = array(
self::INVALID => "'%value%' is not a valid CVR number",
self::INCORRECT_LENGTH => "'%value%' does not contain 8 digits",
self::NOT_DIGITS => "'%value%' does not contain only digits",
);
protected $_cvrWeights = array(2, 7, 6, 5, 4, 3, 2);
public function isValid($value)
{
$valueString = (string) $value;
$this->_setValue($valueString);
$filter = new Zend_Filter_Digits();
if ($valueString !== $filter->filter($valueString)) {
$this->_error(self::NOT_DIGITS);
return false;
}
if (8 != strlen($valueString)) {
$this->_error(self::INCORRECT_LENGTH);
return false;
}
$sum = 0;
foreach ($this->_cvrWeights as $i => $weight) {
$sum += $valueString[$i] * $weight;
}
$remainder = $sum % 11;
if($remainder==1){
$this->_error(self::INVALID);
return false;
}
if($remainder==0)
$lastDigit = 0;
else
$lastDigit = 11 - $remainder;
$valid = ($valueString[7] == $lastDigit);
if ($valid) {
return true;
} else {
$this->_error(self::INVALID);
return false;
}
}
}
Save the above to the file library/Scienta/Validate/Cvr.php
with library being the directory containing the Zend framework. The class can then be used to test a number as follows:
$cvrValidator = new Scienta_Validate_Cvr();
if ($cvrValidator->isValid($proposedCvrNumber)) {
...
}
One case where testing is needed might be a Zend_Form, in which case the class is easily added as a validator on the appropriate element.