I got this error today when I was importing a CSV file in MYSQL using phpMyAdmin. This error can be with SQL importing as well. It appears because of some (let’s say description) field needs to extend its length. After searching a lot on web, I found I would need to edit my.cnf file variable ‘max_allowed_packet’ to maximum bytes. If you are doing this on your local machine or VPS you can edit file directly. but there is another nicer way to do that. Continue reading “SQL/CSV importing error: Got a packet bigger than ‘max_allowed_packet’ bytes”
At 20th August,I got confirmation about Final Evaluations that I have Passed and I am Google Summer of Coder 2010 now. I am very very happy and my University (they featured me at their website and at notice board as well) and my Family is also delighted as well. Sorry for delayed in this post, Actually I had exam at 25th August and then I had to submit a term paper of Software Requirements Engineering. I submitted term paper after 2 weeks of due date and thanks to my teacher who accepted it finally.
Over the last week, I had managed to make the EPS Schema working. So, finally PDF,SVG,DIA and EPS Schema’s are working fine while MS Visio needs more time and I was running short of time. I would be continue working with it though this is the main point of GSoC.
GSoC polished me in true ways toward the Open Source development and I really loved working in this great program. I have planned to work on my own Open Source Software, you will hear soon at my blog. Taking part in Google Summer of Code was FUN and I really learned a lot of things from PMA. I have got all the money from Google 🙂 and waiting for t-shirt and Google certificate now.
My Code have been merged into the main repository of the PMA and I have uploaded it to the Google Project Hosting. So, anyone who wants to see what I coded can download the code (listed as Adnan_Mughal.tar.gz) and download the development version of PMA and play with the Export Relation Schema stuff. You would really love the work and use it in your projects demonstration. It would be helpful for students as well who need to present the structure of their databases.
Last week of coding have been finished and I found VERY interesting things while working on EPS and MS Visio XML Schema’s.
EPS Schema Export
As you know I had installed xampp in Ubuntu. So, I could install PS PECL Extension to code EPS files. But damn, I got stuck while PECL INSTALL PS package in xampp. I tried again a lot of forums/tutorials to get that working in xampp and put a lot of time on these issues. I also contacted PECL developer mailing lists and they suggested me to remove xampp and install lamp on ubuntu. So, I removed xampp and installed lamp but again I got the errors again while compiling PS PECL at Ubuntu. Someone at PECL developer mailing list suggested me a key point and here it is
apt-get install libgd2-xpm-dev
pecl install ps
Actually, PS library have dependency to isntall libgd2 first and then install PS but PS package doesn’t have this dependency listed at their website. After having such issues I finally got PS PECL installed in lampp and I started to code EPS schema. Remember, my main concern to use PS PECL was to calculate the width of the string in EPS. but when I generated a test Post script file I noticed some Interesting things.
First let me tell what is EPS:
An EPS file is a PostScript file which follows the DSC and which follows a couple of other rules. These rules can be summarized as follows:
PS PECL is actually generates a post script file not Encapsulated Post Script file. This is what I noticed that PS lib is not what I required or wanted and what I was messing with it around from previous couple of weeks to get it working 🙁 I misunderstood or guess that PS Lib will solve the problem I have.
So, I reversed myself and continue working with manually creating EPS files using Commands by following the above mentioned points. Though there are some limitations according to my knowledge but I have done my best and I will continue to work on it in future too.
MS Visio XML Schema
Generating Visio XML .VDX is really a challenging task and due to a limited time I left after messing with EPS. I would not be able to completely implemented it and get it 100% working. But I have done as much as I could do so far.
Visio XML needs a lot of study of XML Schema’s of Visio 2003 and 2006. I also consulted visio forums and visio MVP’s to know more about the XML generation of Visio XML outside of VISIO IDE tool. I gathered a lot of information and stuff but It needs more time to get it complete. The main reason is VISIO save the files in XML .VDX but it creates a lot of XML that we need ages to know. So, to create files outside of Visio and using php langauge we need complete knowledge of XML Schema of Visio which I have started exploring. I will keep in touch with these schema’s and would give time as much as possible to cover it in future.
There were lots of obstacles on my way to get some things working perfectly and I didn’t got success but this leads me to road of success !!
This week was very disappointed for me because my health was broken and 5 hours of work took more than 4 days to complete 🙁
I had decided to go with manually creating EPS files by using POST SCRIPT commands. I had started very good but when I had to calculate the width of string I got stuck there and I realized that I must need to use PS Extension  to calculate the width of string. But there was no DLL for my wamp installation. So, I had two options. Create DLL or use the Linux and install PS Extension  and then use it. I am a windows user. So, I decided to install Ubuntu in my Virtual Machine.
I tried to install Ubuntu 101 times at my laptop and on my pc as well but I didn’t got success at all. After being mad with its installation I downloaded the ISO image of Ubuntu again from their website and burned it on CD and then install it again. Luckily, It has been installed at my laptop in Virtual Machine and now I will code EPS Schema using PS Extension  after installing.
while I was frustrated with the installation of Ubuntu. I also tried to create DLL myself by using compilers of VC++ 2005 and 2008 version as well. But It took a lot of time in installation and configuration and again no success. I consulted a lot of forums but nothing 🙁
So, I am now working with Visio XML generation plus installing the xampp in Ubuntu now. I will try my best to finish both these two Schema’s till next Sunday.
9th week is gone and I explored XML for MS Visio Schema, EPS Schema format and issues for making PDF, SVG and Dia Exports downloadable. I had coded pdf,svg and dia exports that these will be prompted for download. It was working on my local wamp installation but not on demo server. Unfortunately that issue is still not resolved and after putting a lot of time on it I forget it and moved on.
For EPS schema, I found php extension pslib but unfortunately its DLL is not available. Though I can use this extension with Linux environment but I decided to use hand coded lib for Encapsulated Post Script files. Lots of information notes are available here http://www.tailrecursive.org/postscript/eps.html about Post Script documents plus programming commands. So, I am going to code it from Monday.
For MS Visio Schema, I consulted MSDN and will code the library class for generating its XML schema like I did for SVG Schema.
Hope for best !!
Hi, I am very delighted that I have passed the mid term evaluations of my project. So far, I have done PDF, SVG and DIA export relations schema’s. SVG and DIA export is done by using  extension of php. It was not easy to use that library because there was not much support tutorials or documentation available even at . But I worked hard on it to make it work finally.  gives us a superb support when we have to write/generate long length XML files. Continue reading “Google Summer of Code: Mid Term Evaluations”
During the 6th week of Google Summer of Code, I finally completed the structure of Relation Schema and PDF is successfully working now with the new OOP structure of Relation Schema. SVG Schema structure is also ready to implement now. Dia structure is also inline .. I documented some classes and renamed the methods/code according to PEAR standard naming conventions. I tried my best to do the best documentation. However, If I left anything I will ready to fix it.
I got welcome package from Google and very happy for their gifts + specially designed payment card. They actually motivated me to write more Open Source code. I am learning a lot during this Project.
In next week – I will try my best to implement the Dia and Svg Relational Schema Exports. So, I could ready for mid term evaluations.
5th Week is over and I have committed what I have done so far. Following is the demo server URL
where you can see it in action. PDF is working fine with rewrite of some of its structure. while SVG is in process. waiting to hear the structural comments about my code from my mentor. In this weekend , I am exploring the DIA’s XML. so, I could finally make all these 3 Export Schema’s in action till the mid-terms. I am putting my days and night to achieve it.
3rd week of the coding period has been ended and I am feeling a bit comfortable now that I will be able to make the SVG and PDF Export with a better classes structure in next coming week. But I have my mid term exam at 15th June , So I will try my best to achieve it.
I explored SVG (Scalable Vector Graphics) . It’s elements that are used to draw the images etc .. There are two great references from where I studied about SVG .. w3schools and another is a book of Cristian Darie on PHP and AJAX
I also explored a lot the pdf_schema.php containing the classes for Drawing Tables,Relations and etc ..
I created a userSchema Class that will handle the front end HTML manipulation. It contains creating a page and the selection of type of relations i.e foreign key or internal relations, scratchboard and select the type of export relations section with options ..
In this week, I have finally started getting my hands over with REAL OOP in php. I have developed a class structure named Abstract Factory Pattern that will be more enhanced as I move forward.
Currently, the class structure includes an Abstract Relation Schema Class which will be the extended by PDF,DIA,VISIO,SVG and EPS Schema classes. There is a User Schema Class that contains almost all the User Interface elements.
well, I am not yet able to implement the PDF Export in this class structure yet. But I am sure, In next week. I will be able to do so. I have pushed export_branch in my git repo at repo.or.cz
I learned a lot in this week, Thanks to Google Summer of Code and phpMyAdmin !