blog.morf.cz

Broken theme after upgrade

by morf on Apr.06, 2010, under Blog

Sorry this theme is temporary broken after last upgrade. Ill fix it sooner or later.

VN:F [1.8.7_1070]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
Leave a Comment more...

Dilbert strikes back

by morf on Jan.19, 2010, under Blog, Comics

VN:F [1.8.7_1070]
Rating: 8.0/10 (1 vote cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
Leave a Comment :, more...

Urban Terror and Pulseaudio – Solution

by morf on Jan.11, 2010, under Blog, Linux

If you playing Urban Terror under Ubuntu or another linux using Pulseaudio, you can easily get tired by problems with sound in game. The solution is really easy – just install this package: libsdl1.2debian-pulseaudio (aptitude install libsdl1.2debian-pulseaudio) and everything works like a charm.

Jestli hrajete Urban Terror pod Ubuntu nebo jiným linuxem používajícím Pulseaudio, snad vás můžou unavit problém se zvukem ve hře. Řešení je velice jednoduché – jenom nainstalujte balíček libsdl1.2debian-pulseaudio (aptitude install libsdl1.2debian-pulseaudio) a všechno funguje jako po másle.

VN:F [1.8.7_1070]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
1 Comment :, , more...

Drupal 7 – return of the king?

by morf on Jan.03, 2010, under Blog, News

It’s been a while since i heard rumors about upcomming release of Drupal – Drupal 7. Lately i decided to make some research about this new version, and surprisingly i was pleased from what i saw. It looks like they did lot of work on Drupal for next release. We check some of them now.

First of all its eyecandy new GUI, which is really tasty, i hope all of you will enjoy the new admin theme with toolbar and cool overlay. I just hope Drupal developers know what they are doing, and Drupal will not slow down on the client (browser) side because of lot of javascript animations and stuff. But it looks pretty light so far.

Also Drupal 7 will bring lot of top modules into the core, like: cck, views, pathauto, and enhanced image support, or administration Toolbar (formerly known as admin menu, which is one of most popular modules at all).

You can setup and try Drupal 7 yourself by visiting Drupal 7.x-dev page, and download Drupal 7 development package. Using this package in production Environment is strongly not recommended. For those who don’t wanna install, but just try, i found Drupal 7 sandbox, where you can play, but play nice…

Here is set of installation screenshots which you can use as installation guide. Anyway installation is pretty user friendly. The requirements for installation changed a bit, you have to create directories: sites/default/files sites/default/private/files sites/default/private/temp , then copy sites/default/default.settings.php to sites/default/settings.php and set all of them to be writable by web server.

Another important thing is Drupal 7 will require PHP 5.2+ only, according this post. This will bring better performance and better funcionality based on sqlite, date, simlexml and other php 5 funcions. Drupal community giving their best into UI improvements and because of that, they started Drupal 7 User Experience Project, IMHO nice example of really openning development to public.

VN:F [1.8.7_1070]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
Leave a Comment :, , , , , more...

Anti-Marijuana Lobby in Media World?

by morf on Jan.02, 2010, under Blog

VN:F [1.8.7_1070]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
Leave a Comment :, more...

How many Sugar is in Coca Cola

by morf on Dec.29, 2009, under Blog

VN:F [1.8.7_1070]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.7_1070]
Rating: -1 (from 1 vote)
1 Comment :, , more...

Zend Framework Custom Dojo (Dijit) Helpers

by morf on Dec.26, 2009, under Blog

Implementing custom Dojo or Dijit into the Zend Framework View Helper is pretty simple. Lately i need this feature for Menu and MenuItem Dijits. I will provide you an example how to do it yourself for another Dijits. This example should work with other Dijits as well (i tried Dialog, DropDownButton, Menu, MenuBar, MenuItem, TitlePane, ToolBar, Tooltip Dialog, and Tree so far).

Ok let’s show the code. You have to create custom Dijit Zend_View_Helper by extending Zend_Dojo_View_Helper_DijitContainer class. Don’t forget to alter: DocBlock, $_dijit, $_module, and direct function (eg. menu() or menuItem() ) and function DocBlock.

Implementace vlastních Dojo nebo Dijit pomocí Zend Framework View Helper je pěkně jednoduché. Nedávo jsem potřeboval tuto vlastnost pro Dijit Menu a MenuItem. Poskytnu vám příklad jak to můžete udělat sami pro jiné Dijit. Tento příklad by měl fungovat pro ostatní Dijity bez problémů (zkoušel jsem Dialog, DropDownButton, Menu, MenuBar, MenuItem, TitlePane, ToolBar, Tooltip Dialog, a Tree zatím).

Ok následuje ukázka kódu. Budete muset vytvořit vlastní Zend_View_Helper rozšířením (extend) třídy Zend_Dojo_View_Helper_DijitContainer. Nezapomeňte změnit: DocBlock, $_dijit, $_module, a funkci pro přímé voláním (např. menu() nebo menuItem()) a DocBlock funkce.


Sorry Code Highlight is broken … :-(


Omlouvám se ale zvýraznění kódu je mimo provoz … :-(

/**
 * Dijit Menu Implementation
 * @author morf
 * @version
 */

/**
 * Menu helper
 *
 * @uses viewHelper Zend_View_Helper
 */
class Zend_View_Helper_Menu extends Zend_Dojo_View_Helper_DijitContainer
{
 /**
 * Dijit being used
 * @var string
 */
 protected $_dijit  = 'dijit.Menu';

 /**
 * Dojo module to use
 * @var string
 */
 protected $_module = 'dijit.Menu';

 /**
 * dijit.Menu
 *
 * @param  string $id
 * @param  string $content
 * @param  array $params  Parameters to use for dijit creation
 * @param  array $attribs HTML attributes
 * @return string
 */
 public function menu($id = null, $content = '', array $params = array(), array $attribs = array()) {
 if (0 === func_num_args()) {
 return $this;
 }

 return $this->_createLayoutContainer($id, $content, $params, $attribs);
 }
}
/**
 * Dijit MenuItem Implementation
 * @author morf
 * @version
 */

/**
 * MenuItem helper
 *
 * @uses viewHelper Zend_View_Helper
 */
class Zend_View_Helper_MenuItem extends Zend_Dojo_View_Helper_DijitContainer
{
 /**
 * Dijit being used
 * @var string
 */
 protected $_dijit  = 'dijit.MenuItem';

 /**
 * Dojo module to use
 * @var string
 */
 protected $_module = 'dijit.MenuItem';

 /**
 * dijit.MenuItem
 *
 * @param  string $id
 * @param  string $content
 * @param  array $params  Parameters to use for dijit creation
 * @param  array $attribs HTML attributes
 * @return string
 */
 public function menuItem($id = null, $content = '', array $params = array(), array $attribs = array()) {
 if (0 === func_num_args()) {
 return $this;
 }

 return $this->_createLayoutContainer($id, $content, $params, $attribs);
 }
}
/**
 * Usecase:
 */
 $this->menu()->captureStart(
 'hosting-nav-menu',
 array(),
 array(
 'style' => 'width: 100%',
 )
 );

 echo $this->menuItem(
 'hosting-nav-menu-programm',
 'Programms',
 array(),
 array()
 );

 echo $this->menuItem(
 'hosting-nav-menu-service',
 'Services',
 array(),
 array()
 );

 echo $this->menuItem(
 'hosting-nav-menu-ad',
 'Ads',
 array(),
 array()
 );

 echo $this->menu()->captureEnd('hosting-nav-menu');

Now you can download working example application here.

VN:F [1.8.7_1070]
Rating: 10.0/10 (1 vote cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
2 Comments :, , , , more...

Magento WYSIWYG editor (painless)

by morf on Dec.13, 2009, under Blog

How you surely noticed, Magento Cmmerce doesn’t contain in default state any WYSIWYG editor. This feature you can hardly implement yourself with help of Magento Community Wiki, but frankly your trying will not be satisfied by success.

Luckily is here Fontis WYSIWYG Editor, which implement most used WYSIWYG editors as: TInyMCE, and FCKeditor. The rest of painfull implementation of WYSIWYG handle Magento Downloader, i hope you know how to work with it :-)

Jak jste si určitě všimli, Magento Commerce neobsahuje ve výchozím stavu žádný WYSIWYG editor. Tuto funkci můžete buď pracně implementovat sami pomocí po různu sehnaných návodů od Magento Community Wiki, ale upřímně Vaše snaha nejspíše nebude korunovaná úplným úspěchem.

Naštěstí je zde Fontis WYSIWYG Editor, který implementuje nejpoužívanější WYSIWYG editory jako jsou: TinyMCE, a FCKeditor. Zbytek bezbolestného nasazení WYSIWYGu zajistí Magento Downloader, doufám, že s ním umíte pracovat :-)

VN:F [1.8.7_1070]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
Leave a Comment :, , more...

Usefull Eclipse plugins

by morf on Dec.12, 2009, under Blog

Recently i needed some enhancement for Eclipse, which i find pretty usefful for common work with Eclipse. It is Eclipse Git (JGit / EGit), which implements versioning system Git. Second plugin is eclipse-fullscreen plugin, because Eclipse doesn’t support fullscreen mode. (WTF?)

Eclipse Git have own page at Eclipse.org which can be used to install remotely from internet, eclipse-fullscreen plugin should by extracted to directory plugins in root directory of Eclipse. Good news is, both plug-ins works without any problem in Zend Studio too.

Nedávno jsem pro Eclipse potřeboval vylepšení, která shledávám celkem užitečná pro běžnou práci s Eclipse. Jsou to Eclipse Git (JGit / EGit), jehož pomocí je možné používat systém ke správě verzí Git. Druhým pluginem je eclipse-fullscreen plugin, protože světe div se Eclipse nepodporuje fullscreen mode. Jak je to možné?

Eclipse Git má vlastní stránku na Eclipse.org pomocí, které je možné ho nainstalovat vzdáleně přes internet, eclipse-fullscreen stačí rozbalit do adresáře plugins v hlavním adresáři Eclipse. Dobrou zprávou také je, že oba tyto pluginy fungují bez problémů i se Zend Studiem.

VN:F [1.8.7_1070]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
Leave a Comment :, , more...

Post Affiliate Pro 4 and eAccelerator

by morf on Dec.08, 2009, under Blog

Před několika dny jsem instaloval PAP 4 pro jednoho z mých klientů, všechno šlo jako po másle, ale to pouze do okamžiku než jsem zapnul trackování. V ten okamžik se PAP skripty zacyklily a to tak, že apache tread se neukončil a žral 100% CPU, a tot se opakovalo při každém dalším trackovaném kliku. Po chvíli jsem se rozhodl vyzkoušet vypínat PHP moduly jeden po druhém, nejdřív APC Cache, potom eAccelerator… a bingo, byl to eAccelerator.

Podle toho support postu – nemůže používat eAccelerator s Post Affiliate Pro. Dobrá, prostě jsem vypnul eAccelerator modul. Ale dnes jsem chtěl odladit tuto chybu na svojí pracovní stanici, ale byl jsem ještě víc překvapený, když všechno fungovalo bez chybičky… Nejsem si ještě jistý co si o tom myslet, ale vypadá to že jenom něketeré systémy nebo verze jsou ovlivněné – eAccelerator 0.9.5.2 @ x64 CentOS – Fail, eAccelerator 0.9.6-rc1 Ubuntu i386 OK… (oba stroje PHP 5.x, MySQL 5.x, Apache 2.x).

Few days ago i installed PAP 4 for one of my clients, everything works just fine, since i enabled click tracking. Then one of PAP scripts cycled out and keep Apache process running eating almost 100% CPU, another click tracked, another zombie eating my processor spawned. After while i tried disable php modules one by one, first APC cache, then eAccelerator… and bingo, eAccelerator it was.

According this support post – you can’t use eAccelerator with Post Affiliate Pro, OK. I just shut the module off. But today i want debug this error on my workstation, but i was even more suprised when everything works like a charm… I really don’t know what to thing about this yet, but it looks like only some systems are affected – eAccelerator 0.9.5.2 @ x64 CentOs – Fail , eAccelerator 0.9.6-rc1 Ubuntu i386 Ok… (PHP5.x , MySQL 5.x, Apache 2.x).

VN:F [1.8.7_1070]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.7_1070]
Rating: 0 (from 0 votes)
Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!