Thursday, August 21, 2008
I want "no training wheels" attached PHP 6
Posted by
code pirate,
on
3:22 PM
Yeah you read that right. With some time before PHP6 comes into the fore, i want PHP6 to be a real path breaker. That means effectively no backward compatibility. PHP5 was slow in adoption just because of this reason. People knew that their applications would work on PHP5, that is why they were in no real hurry to adopt it.
I want the core developers team of PHP to really do some nice things with PHP. For noobies PHP5 should be kept. But with PHP 6 i want them to break new grounds. Like APC (Alternative PHP Cache) should be part of the standard install. I want them to incorporate consistent naming schema for at least in-built functions. That means str_replace => natsort?? kind of naming schema should be made consistent.
I want PHP6 to be more serious about security. It should have features which would make incidence of user oversight things of past. I want the in-built functions in PHP6 to raise exceptions. I want PHP6 to have variable types. I mean i declare a variable to be of type INT and i want PHP6 to raise an error if it is used in string context.
With these changes i can see PHP6 gaining the respectability it deserves. It can move to the area called enterprise platform.
I want the core developers team of PHP to really do some nice things with PHP. For noobies PHP5 should be kept. But with PHP 6 i want them to break new grounds. Like APC (Alternative PHP Cache) should be part of the standard install. I want them to incorporate consistent naming schema for at least in-built functions. That means str_replace => natsort?? kind of naming schema should be made consistent.
I want PHP6 to be more serious about security. It should have features which would make incidence of user oversight things of past. I want the in-built functions in PHP6 to raise exceptions. I want PHP6 to have variable types. I mean i declare a variable to be of type INT and i want PHP6 to raise an error if it is used in string context.
With these changes i can see PHP6 gaining the respectability it deserves. It can move to the area called enterprise platform.
Jquery('MyLife').turnAround();
Posted by
code pirate,
on
2:51 PM
This would summarize my development endeavors in JavaScript Land. I have lately come to love Jquery. So much so anything i do with JavaScript i do it with Jquery. I have also started using the latest Jquery UI. The tabs in JUI is truly amazing and easy to setup. Check out this collection of most popular Jquery plugins.
I am hoping one day we would see one widget system similar to ExtJS but using Jquery. Anyways if you are interested in Jquery, visit the site.
I am hoping one day we would see one widget system similar to ExtJS but using Jquery. Anyways if you are interested in Jquery, visit the site.
Wednesday, February 13, 2008
CSS framework + layout
Posted by
code pirate,
on
3:52 PM
You have heard about development frameworks in php,python etc. Now take a look at a css framework. YAML is the new kid on the block. It comes with its own slick layout designer so that you can create your own custom layout in a jiffy.
What i like about this css framework is that it gives you a clean slate to work with. You dont have to worry about the layout not behaving in IE etc. Kudos to its developers for creating such a nice css framework.
What i like about this css framework is that it gives you a clean slate to work with. You dont have to worry about the layout not behaving in IE etc. Kudos to its developers for creating such a nice css framework.
Friday, February 01, 2008
Monday, January 14, 2008
Minify JS and CSS
Posted by
code pirate,
on
10:54 AM
So you just finished working on your new shiny web 2.0 application/site. It all looks very good until you open it on your friends computer to show off your baby. Its painfully slow!!. Hmm you must be wondering why its taking so much time to load.
The answer may be revealed to you once you see the source of your page. Its all good and dandy that you are using the "mini" version of Javascript frameworks like prototype, jquery, YUI etc. Whats probably slowing down your page is the sheer number of JS and CSS files you are loading on your page.
To mitigate the impact of so many files being loaded in your page you can use this novel idea. Look at this URL for more info. http://code.google.com/p/minify/ Minify.
What minif does is that it lets you load multiple JS and CSS files with one single call. It even caches the file generated so that subsequent requests don't have the overhead of "php" processing. I had some spectacular results with this approach where the sheer number of requests was taking a toll on the page.
The answer may be revealed to you once you see the source of your page. Its all good and dandy that you are using the "mini" version of Javascript frameworks like prototype, jquery, YUI etc. Whats probably slowing down your page is the sheer number of JS and CSS files you are loading on your page.
To mitigate the impact of so many files being loaded in your page you can use this novel idea. Look at this URL for more info. http://code.google.com/p/minify/ Minify.
What minif does is that it lets you load multiple JS and CSS files with one single call. It even caches the file generated so that subsequent requests don't have the overhead of "php" processing. I had some spectacular results with this approach where the sheer number of requests was taking a toll on the page.
Wednesday, May 23, 2007
New development framework for php
Posted by
code pirate,
on
11:43 AM
i have hosted my new dev framework for php on google. Here is the link to that site.
Thursday, February 15, 2007
New PHP development framework
Posted by
code pirate,
on
6:53 PM
Its 2007 and i haven't posted a single entry this year. So what better way than to announce something new!. I have been working on creating my own PHP development framework. Its still in the beta but its started to look good.
I have used off-the-shelf code/scripts/libraries like PEAR to create this framework. I am sure new developers would like it. I would soon post the link to the code. I am currently looking for a site to host my code.
Watch this space!!
I have used off-the-shelf code/scripts/libraries like PEAR to create this framework. I am sure new developers would like it. I would soon post the link to the code. I am currently looking for a site to host my code.
Watch this space!!
Thursday, December 14, 2006
Guide to application development with PHP
Posted by
code pirate,
on
3:56 PM
I know it sounds too ambitious but couldn't help but dig it ;) . Well if you have dipped your toes in PHP and you are comfortable working with PHP this guide is for you. If you are unsatisfied with the current way of structuring your application then this guide might help you.
So lets start with the folder structure. The way you structure your application is crucial. Here is what i have come up with. This structure is only suggestive, you are free to modify it to suit your taste.

http://yoursite.com/app/index.php?action=login
The index page catches the "action" parameter and loads the login.php file and depending upon the current state plus extra variables performs some action.
Lets get an overview of the index.php file
So lets start with the folder structure. The way you structure your application is crucial. Here is what i have come up with. This structure is only suggestive, you are free to modify it to suit your taste.

- Classes: Store all your classes and helper code here.
- Conf: This holds your configuration files needed for your application.
- Cron: Holds all files which needs to run as cron job.
- Includes: Store all your function files here.
- Js: Javascript code plus any helper code like WYSIWYG editor etc.
- Locale: Create folders for every language you plan to support and create language files which you can call depending upon the configuration settings.
- Pages: All the pages which perform some directly visible action are stored here. Rest can be stored in the helper sub-directory.
- Setup: Some scripts which can generate configuration files plus some SQL files needed for your application.
- Style: All CSS + Images, can be organised using themes folder.
- Templates: Divided in two sections. Forms stores all the form templates and layout stores what else layout templates.
- Tmp: Store temporary files or stuff which is not private. You can use this folder to store cached files in your site as well.
http://yoursite.com/app/index.php?action=login
The index page catches the "action" parameter and loads the login.php file and depending upon the current state plus extra variables performs some action.
Lets get an overview of the index.php file
require_once( DIRNAME(__FILE__) .'/includes/app_init.php');This line invokes the file which does all the initiation stuff, like loading the configuration file, loading the framework, loading the default template, defining some variables etc.
Tuesday, December 12, 2006
Sphinx mysql fulltext searching
Posted by
code pirate,
on
3:41 PM
A few months back i posted about a novel way of indexing data in your MySQL database. There is a small update on this as the developer has launched a dedicated site for that and also includes some API docs and help text. If you are frustrated with MySQL taking forever to index your data i suggest you take a look at this.
Friday, November 17, 2006
XML sucks
Posted by
code pirate,
on
7:09 PM
Well if you are a programmer you have to read this. Its awesome, it brought smile to my dry lips. What can i say "pure genius". Excerpts from the article.
And each language could be heard to mumble as it tromped and tromped and tromped, with complete and utter glee:
Have to parse XML, eh? Have to have an XML API, eh? Have to work with SOAP and XML-RPC and RSS and RDF, eh?
Well parse this, you little markup asshole.
The End.
Creating stunning graphs in php using artichow library
Posted by
code pirate,
on
5:13 PM
Those of you who are looking for a good library package to create visually appealing graphs or charts using GD library and wish some package was there which was GPL'ed then look no far. Artichow graph library is the perfect candidate which fits this description. While i like Jpgraph but the fact that its not GPL'ed makes me crib.
Since the library is in French i suggest you use Google translator to navigate the site.
Since the library is in French i suggest you use Google translator to navigate the site.
Using GNU Netcat to access your POP3 mail account
Posted by
code pirate,
on
4:47 PM
This summary is not available. Please
click here to view the post.
Thursday, November 09, 2006
Spooky blog
Posted by
code pirate,
on
5:20 PM
Well this blog made an interesting read. I was in the process of killing some time and stumbled here looking for Orkut creator. This girl sure has a thing for everything spooky. But it is well worth the time, i am going to bookmark it and will try to check it out from time to time.
Tuesday, November 07, 2006
Converting Youtube flash videos to MPEG and extracting audio
Posted by
code pirate,
on
10:26 PM
Recently i was asked (rather commanded ;) ) by my friend to search for her favorite song. Well this song is by Jennifer Paige ("beautiful" OST Autumn in New York). I searched realy hard but could not find it. Then Finally i found a video on Youtube. Apparently this song was used as the background score of that video. So my mission was to get the audio-track from this video.
First of all you need to grab the video from youtube. Make sure you save it with .FLV extension. Now you are ready to go.
First of all you need to grab the video from youtube. Make sure you save it with .FLV extension. Now you are ready to go.
- Convert this flash video to mpeg format.
ffmpeg -i video.flv -ab 56 -ar 22050 -b 500 -s 320x240 test.mpg (check out google for more options) - Extract Audio from this MPEG video
ffmpeg -i test.mpg -vn test.wav Convert this WAV(PCM audio) to MP3 format
toolame test.wav test.mp3
Monday, November 06, 2006
A new type of captcha
Posted by
code pirate,
on
4:29 PM
Those of you who came late, a CAPTCHA stands for “Completely Automated Public Turing test to tell Computers and Humans Apart“ . Basicaly the system asks you to read an image and input the words exactly as written on it, before it lets you perform the desired operation. While i think no doubt it would slow down the spammers, but i have seen some people who claim to have the ability to read a captcha.
While going through this site i wondered is it possible to combine the idea of captcha with the human habit of reading a word partially. For example if we want the user to enter the word "glass" we can make the captcha to read "galss". Only a human being can infer that it is indeed the english word "glass".
While going through this site i wondered is it possible to combine the idea of captcha with the human habit of reading a word partially. For example if we want the user to enter the word "glass" we can make the captcha to read "galss". Only a human being can infer that it is indeed the english word "glass".
Wednesday, November 01, 2006
Tabs galore: CSS tabs for you
Posted by
code pirate,
on
11:11 AM
Attention all you CSS lovers, get your free CSS tabs here. This one is from exploding boy, whatever that means ;) Well i have been facinated by css tabs myself because they make your site look much more professional than random links thrown here and there. Also if you are making some kind of an Web based application then its crucial that you create a logical navigation. Grouping similar functionality is best achieved with tabs.
The tabs on the above site uses images for that polished look. Though nothing is wrong with that but i think i like the pure css tabs more with no images used. And the best example i can think of can be found here. I have used them on more than one occasions and find them quite good. More links to other tabs can be found here.
Also one more css site worth visiting is this one. I learned quite a lot about css from this site; thanks paul. You can learn some css techniques here and pick up some layouts too.
The tabs on the above site uses images for that polished look. Though nothing is wrong with that but i think i like the pure css tabs more with no images used. And the best example i can think of can be found here. I have used them on more than one occasions and find them quite good. More links to other tabs can be found here.
Also one more css site worth visiting is this one. I learned quite a lot about css from this site; thanks paul. You can learn some css techniques here and pick up some layouts too.
Ubuntu 6.10 Edgy Eft released
Posted by
code pirate,
on
10:38 AM
It seems i am late on this, but wtf. I have been on ubuntu for almost 6 months now. Well not actually ubuntu but xubuntu. Since my PC is an old one, i am not able to use the latest KDE. So i installed XFCE as my desktop manager, its light and it works(TM) . The latest version of ubuntu promises to be much more polished and efficient.
From the site i can see that it has a lot of new features, like the newer init system. It seems upgrading it is not advised but some people have reported that it went ok for them. I think i would do a full install instead of the upgradation because i have experimented heavily with my current version and i just need to take a backup of my home dir and htdocs directory and i am good to go.
Now some caveats, from what i have read it seems the newer ubuntu has replaced bash with dash as their default shell. Some people are complaining about this issue and we have to just wait and watch for the repercussions.
From the site i can see that it has a lot of new features, like the newer init system. It seems upgrading it is not advised but some people have reported that it went ok for them. I think i would do a full install instead of the upgradation because i have experimented heavily with my current version and i just need to take a backup of my home dir and htdocs directory and i am good to go.
Now some caveats, from what i have read it seems the newer ubuntu has replaced bash with dash as their default shell. Some people are complaining about this issue and we have to just wait and watch for the repercussions.
Friday, October 20, 2006
I love Wine
Posted by
code pirate,
on
11:09 AM
Before you jump to any conclusion, let me clarify things a bit. The wine i am talking about is the wine program (Wine is not emulator) and it does leaves a good taste in your mouth. I was reading up on running wine on linux and i thought maybe it is a good idea afterall. While the installation was a no-brainer (I am on ubuntu and synaptic rocks!) and to install some app you need to find the setup file and open it with wine program.
In ubuntu, a new context menu item is added and i can right click on a "set.exe" file and select "run with wine". Anyways i could see it was emulating "c:\\program files\" and maybe there is some hidden registry file too. Well all in all it was intelligent enough to place a link to that app on my desktop. The first app i installed was 'gtalk' but it didnt work out that good. It was missing the buttons and i could only see the text boxes. Maybe i would look into them when i get more time. Then i tried Ultraedit editor and it did install good. Heres a screenshot to that!
Ok so it did go smooth, now i am on my way to install winamp and some other apps i liked on Windoze. Now you would be tempted to ask why did i install ultraedit instead of using linux editors like kate or bluefish. The thing is i like kate but it is not as refined as ultraedit. And even if this sounds lame i like it so you who cares if its a windoze app.
Cheers
In ubuntu, a new context menu item is added and i can right click on a "set.exe" file and select "run with wine". Anyways i could see it was emulating "c:\\program files\" and maybe there is some hidden registry file too. Well all in all it was intelligent enough to place a link to that app on my desktop. The first app i installed was 'gtalk' but it didnt work out that good. It was missing the buttons and i could only see the text boxes. Maybe i would look into them when i get more time. Then i tried Ultraedit editor and it did install good. Heres a screenshot to that!

Ok so it did go smooth, now i am on my way to install winamp and some other apps i liked on Windoze. Now you would be tempted to ask why did i install ultraedit instead of using linux editors like kate or bluefish. The thing is i like kate but it is not as refined as ultraedit. And even if this sounds lame i like it so you who cares if its a windoze app.
Cheers
Wednesday, October 18, 2006
OpenSource Basecamp replacement
Posted by
code pirate,
on
2:56 PM
Those of you who are looking for a replacement to basecamp project management tool can check out ActiveCollab. Though its not as feature rich (currently) as basecamp but i am sure it will develop into a worthy competitor.
Installing activecollab on your own server means your data is in your hands (both literaly and otherwise :) ) and also u can set up as many projects as you wish. The only roadblock i can see is the requirement of both PHP5 and MySQL with innodb support.
Installing activecollab on your own server means your data is in your hands (both literaly and otherwise :) ) and also u can set up as many projects as you wish. The only roadblock i can see is the requirement of both PHP5 and MySQL with innodb support.
Balle balle band baaja time
Posted by
code pirate,
on
10:14 AM
Yup its true. Its marriage season now in india. Unfortunately its not me who is getting married, one of my best friends (sumit) is getting married. In a few days (15 days to be exact) time he will loose his bachelorhood and join the ranks of married ones ;) .
So lets see how it works out for him, I mean girls are always carping the fact that guys shy away from commitment, but this guy seems to be too prepared for that. I wish him all the luck in his married life!!
So lets see how it works out for him, I mean girls are always carping the fact that guys shy away from commitment, but this guy seems to be too prepared for that. I wish him all the luck in his married life!!
Subscribe to:
Posts
(
Atom
)
