Recently I worked on a few wordpress themes. It was a great experience and I found it easier to work with WordPress themes as compare to Drupal, Joomla and other CMSes. I was able to map my requirements into WordPress easily and use this a full fledge CMS. Some of the things I liked about WordPress are:
- Open system, good documenation and help available online.
- Hundreds of plugins availability.
- Map pages (or category) directly to their ids/slug as page-7.php or category-development (where 7 is page id and development is category slug).
- Use custom fields for storing custom information. These fields were very helpful and I believe one could use it many different ways while developing a custom theme.
I hope to continue my journey with working on further exciting and complex themes. I also plan to share some tips / code in the future in this regard.
This is just an update regarding my final year project ‘Email Moderation Engine’.
I have been working on this but till now had been mostly doing the documentation and design document as per the university requirement. I hope to start working on the actual project skeleton and code in 2 weeks of this semester. I plan to share my thoughts and code samples here for those who would like to get an idea.
I am also trying to help a few fellow VU students along the way. I hope we all could make it on time and it is accepted.
Those who are interested in discussing / getting any help in this regard, should contact me via my email address (from Contact) or this comments on relevant posts. Please don’t post your questions on other posts on this blog which are irrelevant.
As I discussed earlier that I am taking this as my final year project. So I have prepared and submitted SRS for this and now working on other documents for this as per VU guidelines.
While working on this, I am also helping a few other students via email / skype. I will try to share some of the details of this project here.
Recently I started learning Ruby on Rails. I started studying it for making fixes / changes to an existing RoR project. While studying for this, I had some issues which were obviously related the new syntax and style but overall this was a very pleasant experience.
Now I only wish that I had started a bit earlier with RoR :).
I am studying for MIT from Virtual University Pakistan. When this semester started, I also had to take a final year project, which would span on two semester. VU proposed 4 projects and also encouraged students to submit their custom proposal. I took the opportunity and discussed a possible custom project with my colleagues and friends. We came up with the idea of an Education CRM, which we could develop on top of existing open source software like Sugar CRM and Moodle. Some of the functional requirements, I proposed were:
- Extract customer data from LMS which can be used to effectively manage customers in CRM.
- Use CRM to document interaction with LMS users. Interaction includes activities, leads, opportunities, cases, bugs and reporting.
- Auto-update customer information from LMS in CRM.
- Synchronization of student contact information between the two systems.
- In CRM display the list of enrolled courses for every student along with grades in those courses.
- Customize CRM to make it ‘Education CRM’ (instead of a generic CRM). For example, instead of calling it â€œcustomersâ€, we may want to call them students.
- Auto creation of student account in LMS, when in CRM the lead is â€œconvertedâ€ and the status is changed to â€œStudentâ€ from â€œLead/opportunityâ€.
I was very excited about this and was very confident that I would be able to make this by writing a plugin for Sugar CRM and Moodle but unfortunately this project proposal was rejected. I asked our teachers for the reasons but they didn’t like to comment on rejection. I tried to follow all their rules for submitting project proposal but somehow they didn’t like this idea and rejected it. I still believe this is a very good idea but due to lack of time this year, I won’t be able to give it time. However, I will look forward for this and see whenever I get sometime I will start working on it. If anyone has any further ideas and time to take on this project, I would be glad to help in any capacity I could.
Now I am supposed to work on one of the project they proposed. The four projects they proposed are:
- Production Rejection Assessment System
- Macro Recording System
- Robotic Simulation To Detect Explosive Material
- Email Moderation Engine
I have now selected ‘Email Moderation Engine’ as my final year project. I am now looking for some good partner and will then start working on this. I will try to keep this space updated about this. I hope to learn quite a few things as I would be trying a few new things.
I was looking into Android development. I googled for this and noted it is more popular among the developer communities than the iPhone development. Reason? Android apps could be developed in Java and for iPhone one has to get used to a totally new environment. In my view, it is a huge plus point for Android.
When studying, I noted the best source for beginners would be to study at android development. However, I would also recommend the book Android Application Development: Programming with the Google SDK
. This is an excellent book and would greatly help any one starting Adnroid development.
I have been developing in PHP from the last 4-5 years. Since the introduction of OOP concepts in PHP5, the language is getting matured and more ready for large applications.
While working with large projects, one can not avoid logging for error / debug to later diagnose the issues one might face in production. So beside logging some general information and simple errors which PHP throws and we could get from PHP we could also capture the whole backtrace for the code we are running in such case.
It could be easily incorporated in your application. Follow are some modified examples from PHP’s documentation debug_print_backtrace:
//This is backtrace_include.php
//This function modifies the output which PHP provides for debug_print_backtrace
//by dany dot dylan at gmail dot com
$trace = ob_get_contents();
// Remove first item from backtrace as it's this function which
// is redundant.
$trace = preg_replace ('/^#0\s+' . __FUNCTION__ . "[^\n]*\n/", '', $trace, 1);
// Renumber backtrace items.
$trace = preg_replace ('/^#(\d+)/me', '\'#\' . ($1 - 1)', $trace);
$trace = a();
Save the above file as backtrace_include.php and call in the following file:
//This is backtrace_test.php
This will print the following:
#0 c() called at [/home/www/backtrace_include.php:29]
#1 b() called at [/home/www/backtrace_include.php:24]
#2 a() called at [/home/www/backtrace_include.php:37]
#3 include(/home/www/backtrace_include.php) called at [/home/www/backtrace_test.php:3]
Usually in production websites, we don’t print such trace on screen and log this in a file. We will also log such information only in a situation when an error occurs while executing the code.
While working on a recent project, I had to do some array comparison. I did array comparison by doing the following:
$firstArr = array(2,4,8);
$secondArr = array(2,8,4);
According to my requirements the above two arrays are same but if we compare it in PHP, it would not think so due to the presence of value on different indexes. To solve that, I first sorted and then compared these arrays, which gave me the required result.
//sort the arrays using php's sort function
//compare the arrays
if ( $firstArr === $secondArr)
echo "Yes. They are equal";
echo "No. They are not.";
We were taking mysql backups using a very simple shell script which was using mysqldump as below.
#echo "Starting the script";
# create directory if it doesn't exist
if [ ! -d "$OLDBACKUP" ]; then
# create direcotry
# set file names by appending date to each file
# take db backups
mysqldump -u $USER -p$PASSWD -n -c myDbName >Â $dbName;
# move the file to sql_files directory
mv $dbName $OLDBACKUP
We were keeping old backup files but we knew that we would need to remove the backup files older than two weeks or a month. I was thinking what to do and after some studying I found the following one line, would help us remove files older than x number of days.
find /home/my_backup/sql_files -type f -mtime +15 | xargs rm
Where 15 could be changed to any number of days and it will remove all the files older than that number of days recursively, using this command. This command won’t delete any special files or sub directories.
Sahi helped us automate our web application testing by 60%-70%. Till now I am quite happy with it.