Adding Google Analytics Account to Chrome Web Store Application

For an useful explanation of how to add Google Analytics Account to your Chrome Web Store application follow these instructions. Note that is a good idea to have a separate account property for your main web site and the chrome hosted application detail page.

Vasil Levski

Yesterday, Feb 18th, was the 139th anniversary from the death of Vasil Levski – the brightest figure in the Bulgarian history. May his name and deeds are remembered forever!
More about him from Wikipedia

Insert processing istruction to Zend View Helper Navigation Sitemap dom object

What if you want to associate a xslt stylesheet to the sitemap generated by Zend_View_Helper_Navigation_Sitemap. I did it by adding a xml-stylesheet processing instruction to the view helper dom object. Here is the code:

class SitemapController extends Zend_Controller_Action
{
public function indexAction ()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender("true");

$pages = array();

// generate the pages array somehow
$someservice = new My_Serivce_PageGenerator();
$pages = $someservice->fetchAllMyWebsitePages();

// generate sitemap xml
$xml = $this->_generateSitemapXml($pages);

$response = $this->getResponse();
$response->setHeader('Cache-Control', 'public', true);
$response->setHeader('Content-Type', 'text/xml', true);
$response->appendBody($xml);

}

private function _generateSitemapXml ($pages)
{

$sitemap = new Zend_View_Helper_Navigation_Sitemap();

$sitemap->setView($this->view);
$sitemap->setUseSitemapValidators(false);
$sitemap->setMinDepth(0);
$sitemap->setMaxDepth(0);

$container = new Zend_Navigation();
$container->addPages($pages);

$sitemap->setContainer($container);


// get the dom object
$dom = $sitemap->getDomSitemap();

// define path to xslt stylesheet
$xslt_file_path = '/sitemap_style.xsl';

// create processing instruction
$xslt = $dom->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="' . $xslt_file_path . '"');

// add it to the dom
$urlset = $dom->getElementsByTagName('urlset');
$dom->insertBefore($xslt, $urlset->item(0));

// instead of using the render method we use this:
$xml = $sitemap->getUseXmlDeclaration() ? $dom->saveXML() : $dom->saveXML($dom->documentElement);

return rtrim($xml, PHP_EOL);


}

}

Apache Http Server, SSL and IIS On Windows XP

Setup:
Windows XP with the following servers installed

Apache 2.2 installed and running
IIS 5.1 Installed and running

Problem:
Whenever I add the following directive to the Apache configuration to enable ssl:
Listen 443 and try to restart Apache, I get the following error:

(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:443

My solution:
1. Stop the IIS server
2. Change the Apache configuration
3. Start Apache http server
4. Start IIS server

Good luck!

RDFa Basic Triple using FOAF

This video provides a glimpse of using RDFa syntax to express a triple using the Friend of a Friend(FOAF) vocabulary. N3 notation is used to explain the Subject Predicate Object format of and RDF triple. The concept of Compact URI’s is also introduced as a way to reduce complexity within a document by providing a unique name for an extensive URI and then using that name each time the URI needs to be referenced.

Managing Test Users in Facebook

Today I found this cool little application to help create and manage test users for facebook application development. It sounded easy to install so I went ahead and downloaded it.
Facebook Test Users Manager

After installation, I came across couple of issues.

The first one was that in the .htaccess file that came along with the project, the developer had this line:


php_value xdebug.profiler_enable 1

I do not have xdebug enabled on my machine so this caused a misconfiguration error. I had to comment it out.

The second issue was that I was getting the following message:


"SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed".

After a google search came up with this fix (instead of disabling the verification):

  1. download mozila.pam file. See this page for more info: http://davidwalsh.name/php-ssl-curl-error
  2. copy file to C:WINDOWS\system32
  3. Add this to $CURL_OPTS array in facebook.php:

CURLOPT_CAINFO => ‘C:WINDOWS\system32\mozilla.pem’

That’s it. I hope it helps somebody

Windows Live Writer Post

Hey this is a blog post from windows live writer. I think it is cool.

Magento for Developers: Part 1 Introduction to Magento

What is Magento? It’s the most powerful online eCommerce platform in the universe and is changing the face of eCommerce forever.

Of course, you already know that. What you may not realize is Magento is also an object-oriented PHP Framework that can be used to develop modern, dynamic web applications that tap into Magento’s powerful eCommerce features.

This is the first in a series of articles in which we’re going to go on a whirlwind tour of Magento’s programming framework features. Don’t worry if you don’t follow everything immediately. As you study the system more everything in this article will start to make sense, and you’ll soon be the envy of your colleagues stuck working with more primitive PHP systems.

Magento “Knowledge Base” Magento for Developers: Part 1 “Introduction to Magento” eCommerce Software for Growth

PHP date.timezone warning fix

OK, Have you gotten this (or similar):
PHP Warning: PHP Startup: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Los_Angeles’ for ‘-8.0/no DST’ instead in Unknown on line 0

I am running PHP 5.3.0 on my Windows XP, and have spent the better part of the day to try to get rid of this warning and finally managed to do it. How, you say?

The breakthrough came after I have read this instructions from the PHP web site Changes in PHP datetime support. Here is part of it:

Since PHP 5.1.0, there has been an extension named date in the PHP core. This is the new implementation of PHP’s datetime support. Although it will attempt to guess your system’s timezone setting, you should set the timezone manually. You can do this in any of three ways:

  • in your php.ini using the date.timezone INI directive
  • ion your system using the TZ environmental variable
  • ifrom your script using the convenience function date_default_timezone_set()

All supported timezones are listed in the PHP Manual.

Notice that you can set your system’s timezone setting using php.ini, set TZ environment variable or from your php script.

The first option did not work for me. The third option does not work for php scripts that are not written by me, so the only option left is to set environment variable TZ. That finally saved the day!
On Windows XP:

  1. go to My Computer
  2. View System Information
  3. Advanced Tab
  4. Environmental Variables
  5. Add New Variable with name ‘TZ’ and value whatever your timezone is. In my case is ‘America/Los_Angeles’.

That’s it. I hope this saves somebody few hours of searching.

Say Hello to the Newest Kindle

Amazon came out with a new smaller 6″ diagonal Kindle. It goes for $259 and has international wireless coverage. Check it out at Amazon.com.

Amazon Kindle

Amazon Kindle

Periodic Table of Visualization Methods

Following this post on Flare Data Visualization library, here is one more entry for visualization. Includes Data , Information, Concept, Strategy, Metaphor and Compound Visualization, Enjoy!

“B.S.” Stands for Business-Speak

Today I have read this very interesting article on the American Management Association web site about the need of communicating clearly and avoid empty words. You can read the business speak article here.

Flare Data Visualization

Flare is an ActionScript library for creating visualizations that run in the Adobe Flash Player. From basic charts and graphs to complex interactive graphics, the toolkit supports data management, visual encoding, animation, and interaction techniques. Even better, flare features a modular design that lets developers create customized visualization techniques without having to reinvent the wheel. View the demos and sample applications to see a few of the visualizations that flare makes it easy to build.

Zend, Microsoft, IBM join forces to simplify cloud-app devlopment for PHP coders | All about Microsoft | ZDNet.com

As this article says all the right buzzwords are part of a newly unveiled Simple API for Cloud Application Services. It’s an open-source initiative that currently includes Zend, Microsoft, IBM, Nirvanix, Rackspace and GoGrid as the founding members. (No Google and no Amazon, however.) Here you can read more : Zend, Microsoft, IBM join forces to simplify cloud-app devlopment for PHP coders | All about Microsoft | ZDNet.com.

A Role-Based Access Control (RBAC) system for PHP

Anyone, that has searched the web for anything related to PHP, sooner or later must have come across the web site of Tony Marston. It is very rich source of ideas and information, and it is worth visiting any time you have a moment to spear. One of the topics that web developers tackle often is the issue of providing accurate and flexible access to the web site users. One way to do this is by using RBAC or Role-Based Access Control system. This system is most ofter implemented with a database, but this is not a requirement. Recently I looked again at one of Tony Marston’s articles about RBAC implementation for PHP and I thought, I share the link with you. I hope it will help or inspire somebody. Enjoy!

Modular applications in ZF 1.8

OK, so you jumped ahead and upgraded to Zend Framework 1.8. What now? One of the new features, that came along with this new release, was the possibility of individual module bootstaping. Or.. does it? If you find the whole thing about module bootstraping confusing, read this blog post and may be it will become a little bit clearer. It was for me. Let us know how you did. Happy coding!

Have you made the jump to Zend Framework 1.8?

Over the weekend I have finally made the jump to 1.8. There, of course, are few changes in this new version, some of the most significant is the introduction of Zend_Application and Zend_Tool. Several blog posts helped me along the way, but I should be honest with you, it took me a good number of hours to assimilate the new “Bootstrap.php” paradigm and move my project to the the new way of doing bootstrapping. If you are starting new project, take a look at this clean writeup. I, however, was not starting a new project and needed something that will accommodate a modular directory structure. A good start was this blog post. I hope this two links will help somebody to make the jump to the new Zend Framework version less painful.

Geography Of Jobs

I have stumbled upon this post and thought it is pretty interesting.

Saving Bulgaria’s Jews: An analysis of social identity and the mobilisation of social solidarity

Interesting read.

Phing

One of the best Phing resources I have come across is the blog of Raphael Stolt. I have used Phing based scripts for backup and code generation, but that is not all you can do with it. As Raphael is showing in its blog, you can use it for unit testing, phplocing (see my post on phploc), refactoring, code sniffing, database generation and so on.