Alex (SirShurf) Frenkel's Blog

A web log of a PHP professional

Posts Tagged ‘development

Ubuntu 11.10 (Oneiric Ocelot) and MySQL Workbench gpl, fix plus deb repository

with 3 comments

Since the install of Ubuntu 11.10 (Oneiric Ocelot) my MySQL Workbench was mostly unusable. I could not open it normally and Query Browser was not accessible. Finally a few days ago a patch was summited to the MySQL forum, but it was for a self compile version only.

Today I found a debian repository that maintains MySQL Workbench gpl and the fix is already implemented there. In order to update it use next commands:

sudo add-apt-repository ppa:olivier-berten/misc
sudo apt-get update
sudo apt-get install mysql-workbench-gpl

Now we have a debian repository for MySQL Workbench and a version that will work on Ubuntu 11.10 (Oneiric Ocelot)

Advertisements

Written by Alex (Shurf) Frenkel

November 7, 2011 at 9:46 am

jQGrid with Zend Framework Updated

with 9 comments

Recently I had some time to update the fork I have of the jQGrid encapsulation for Zend Framework.

Among the things updated is:
* Support for jQGrid 4.1.
* Support for methods in options.
* 2 new decorators
* New special decorator, a multi select element on grid search.
* Support for advanced search

And many more…
You can locate the code at my GitHub:

If you dont use jQGrid it is an Ajax-enabled JavaScript control that provides solutions for representing and manipulating tabular data on the web.

Written by Alex (Shurf) Frenkel

August 22, 2011 at 7:19 pm

How to use Zend-Framework-PDF-Table-Helper

with 10 comments

Here is the example of how to user ZendFramework PDF-Table-Helper.

You can get the code from GitHub here:

One of the prerequisites is that you mast have the zf_autoloader on and configured since I am relaying on it to auto load files.

first you have to in instantiate the class:

$pdf = new SirShurf_Pdf_TableSet ();

You can instantiate it with a Zend_PDF object and without it, in which case it will be created for you, but if you are instantating with Zend_PDF you have to tell the system on what page you are working (Default is page 0).

Now what you need it to initialise a Table you are going to work with:
$objTableRow = $table->addRow ();

Each table can have his own number of columns and settings.
Each table can have a different number of rows a row can be added using this method:

And as with HTML a row has a number of cells (or columns):
$objTableRow->addCol ( $strCourseId, array (
'bold' => false, 'colspan' => 1, 'align' => 'center'
) );
$objTableRow->addCol ( Labadmin_Models_Static::convertHebrew ( $this->view->translate ( 'LBL_GRADE_FORM_COURSE_ID' ) ), array (
'bold' => false, 'colspan' => 1, 'align' => 'center', 'font' => 'arial.ttf', 'fontBold' => 'arialbd.ttf'
) );

The Cell can have each own definitions as the example here shows, and you can iterate over the data to create it.

And finally you can call render(); in order to render the changes to PDF, or build(‘fileName’) to save the finale PDF to a file.

$pdf->build ( $strGradeFileLocation . $intTimeStamp . ".grade.pdf" );

Written by Alex (Shurf) Frenkel

July 26, 2011 at 3:15 pm

Library to create a tables in Zend Framework PDF

with 2 comments

I had to create a PDF with a tables in a Zend Framework project I am making.

I have searched the web and have not found any library that can be used for this from the box, but I have found on GitHub a start of the library I was needed:
https://github.com/btm6084/Zend_PDF_Helper

Unfortunately the library was incomplete and not maintained, so I contacted the owner and he gave me the permission to take the code and do what I like with it.

So here is my version (working one) of the library that can create tables in PDF using Zend Framework PDF library.

Zend Framework PDF Table Helper

I will write a working example soon and post it here and on GitHub.

Written by Alex (Shurf) Frenkel

July 24, 2011 at 11:04 am

SVN (Subversion) and UTF files…

leave a comment »

Recently I had a strange problem.

One of my SVN hooks was failing and I had to login to the server to run the hook manually. At first I have thought that it’s a simple permission error but when I was running the same hook using the same user it was working.

After some googleing I have found that the SVN hook runs not in the user environment but without it, and in order to simulate it I need to run my hook in the same way.

The command to do it is: “env – ./post-commit”.

In this case I have seen the error and understood it. Since the SVN hook is not runs under the environment, the UTF-8 characters in file names are not visible in SVN Update.

If you have this problem all you need to do is to add next lines to your hook:


export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
export LC_ALL=

That will set your environment for the SVN hook request to work with UTF characters!

Written by Alex (Shurf) Frenkel

May 19, 2011 at 5:26 pm

Posted in IDE, SVN

Tagged with , , ,

Remove .svn files from directory list

with 4 comments

One of my projects had an old .svn files from the ckeditor checkout.

The problem was that there are too many directories to remove it manually so after some searches and tries here is the command to clean this .svn files.

find ./ -name ".svn" | xargs rm -Rf

Have Fun

Written by Alex (Shurf) Frenkel

May 4, 2011 at 4:52 pm

Posted in IDE, Uncategorized

Tagged with , , ,

Lost connection to MySQL server at ‘reading initial communication packet’, system error: 111

leave a comment »

For the past couple of days, for some reason I was unable to connect to the MySQL database on the system I worked, it was not a problem till now, since all I needed was a data grid, but now I had to use workbench.

The error I was getting was: Lost connection to MySQL server at ‘reading initial communication packet’, system error: 111

Well, it took me a couple of hours to gast that but I have finally found the reasone.

Early this week we have changed the bind address of the MySQL server in the my.inf file to be the external address of the system.

What i had to do was to match the address of the bind from localhost to the external one, so the correct command was:

ssh -v -f -N -L 3307:192.168.0.1:3306 user@host.server.com

Written by Alex (Shurf) Frenkel

May 5, 2010 at 9:46 pm

Posted in Uncategorized

Tagged with , ,