lautr.com

Hannes Blog for Development and Stuff besides

new-google-buzz-logo

14. April 2010
von Hannes
1 Kommentar

google Buzz This Button made by google finally arrives and it goes just fine with his friends

Google does finally provide a google Buzz Button isn’t that good News? As usual you can go with a small and a Large Layout just like facebook and tweetmeme:

social buttons

They sure go along together, and well, to be honest if you look around the web you will see more and more pages focusing on these Kind of Buttons instead of using services that provide 40 Social Bookmark Services for the User to choose like seitzeichen, and in my Opinion – thats a good thing. Non the less – its not a perfect solution tweetmeme will include a iFrame in your page while all three of theme need to include a javascript file and google&facebook have non-default attributes for there a elements.

13. April 2010
von Hannes
Keine Kommentare

redicoulous internet explorer 9 testdrive page

I didn’t even know there was a (early) Version of IE9, mostly because i really don’t care but i read about it at the blog of razak. First he is absolutely right about the HTML5 Elements, none of the provided examples really works as an Example of HTMl5 use for me (none of the HTML5 Examples even has a HTML5 Header).

Also the “Speed Demos”  are just so….weird especially the first and last one. The SunSpider Page shows different Ranks in the Graphical Chart and the Text List bellow.

But the best part is the 55/100 Acid Test Result, i mean come on , how can they highlight such a bad result so much?!

Well, check it out and have a good laugh yourself.

25. März 2010
von Hannes
Keine Kommentare

colorzilla alternative (since it doesn’t work under my 64bit ubuntu)

Well, i really like colorzilla, unfortunally it doesn’t work anymore under my 64 bit ubuntu, this seems to be a common problem, but none from the suggested solutions works on my system.

So i looked for alternatives, it would look like there is no really firefox add on alternative, but i found 2 nice colorpickers on OS base gpick and gcolor.

Gcolor

can be installed over apt-get so just use:

sudo aptitude install gcolor2

to install it, its a rather simple tool, but does what it has to do.

Gpick

Gpick is clearly the more sophisticated tool, you can select colors by using <space> so you don’t have to click on the eyedropper icon every time, it can store several colors and has some nice color palate features build in. You can download the deb (and other installers) here.

My conclusion is that i would still prefer colorzilla, but for the moment i’ll go with with Gpick, it is a little bit more complicated as Gcolor2  but i think working with it is a little bit faster.

24. März 2010
von Hannes
Keine Kommentare

zend framework xmlrpc two element structure

Well, i just had a lot of Fun with xmlrpc two element structure, first the request failed completely – i figured out i had to disable the skip system lookup because the other server couldn’t handle it.

$client = new Zend_XmlRpc_Client('http://www.example.com/xmlrpc.php');
$client->setSkipSystemLookup(true);

Now i had the Problem that zend reduced my request from two levels to one level and so the server couln’t interpret it anymore, for example:

<struct>
<params>
<param><value>
<struct>
<member>
<name>lowerBound</name>
<value><int>18</int></value>
</member>
<member>
<name>upperBound</name>
<value><int>139</int></value>
</member>
</struct>
</value></param>
</params>

became

<params>
<param>
<value><int>18</int></value>
</param>
<param>
<value><int>139</int></value>
</param>
</params>

the Solution is simple, but took my a while, instead of giving him an array like

$response = $client->call('ra.order',array('lowerBound' => 18,'upperBound' => 139));

the array must be wrapped in another array

$response = $client->call('ra.order',array(array('lowerBound' => 18,'upperBound' => 139)));

i wish i knew why… well maybe i don’t…

24. März 2010
von Hannes
Keine Kommentare

Zend Framework Tidy (HTML) View Helper

In a recent Project i have to deal with some external content which has a good quality when it comes to the content itself, but unfortunately the html markup is rather poor, so i decided to include tidy to clean it up, and out of convenience make it in a view helper:

/var/www/zend-framework/project-name/application/views/helpers/Tidy.php :

class Zend_View_Helper_Tidy extends Zend_View_Helper_Abstract
{
    private $_config = array();

    public function __construct(){
        $this->_config["show-body-only"]=true;
        $this->_config["wrap"]=0;
        $this->_config["wrap-attributes"]=0;
        $this->_config["preserve-entities"]=1;
        $this->_config["output-xhtml"]=1;
        $this->_config["new-inline-tags"]='go';
        $this->_config['fix-bad-comments']='no';
        $this->_config['hide-comments']='no';
        $this->_config['drop-empty-paras']='yes';
    }
    public function tidy($html,$charset = 'utf8'){
        return tidy_repair_string($html,$this->_config,$charset);
    }
}

/var/www/zend-framework/project-name/application/views/scripts/output.phtml :

<?= $this->tidy($html); ?>

its an rather simple script and could probably have some version checking (tidy use variates from version to version when it comes to setting the char type so make sure which version you have installed).

A reference to all tidy options can be found here.