PHP 5.3 is here!
The PHP team announced the immediate release of the much anticipated PHP 5.3 This version is a major step forward for PHP which introduces namespaces,native closures, late static bindings and optional garbage collection for cyclic references, jump label (g0to). Also a handful of new extensions have been introduced (ext/phar, ext/intl and ext/fileinfo) and Windows support has been greatly improved.
The full list of changes can be consulted in the ChangeLog.
Now we wait and see how long it takes before people start to move production sites to this version. I anticipate that this will take long time because of possible incompatibilities between existing codebase and the new PHP version. However new projects should be started using PHP 5.3
The State of MySQL
Jeremy Zawodny wrote an excellent article about MySQL called “The State of MySQL“. The article is featured in Linux Magazine and it is a fresh breath of air in the overwhelming amount of information related to the recent acquisition of Sun by Oracle.
Romanian browser usage trends
I’ve recently made a study about the browsers preferred by romanians. I don’t claim this study to be 100% accurate but it can be useful in some situations.
The methodology was simple. I took the browser data for a few of the largest romanian sites listed in Trafic.ro (a web statistics system which provides browser usage data) and i made from those numbers the following chart which covers the period between November 2007 and June 2009
What is clear from this chart is that:
- the days of IE6 as the leading browser are numbered. It may take approximatively 2 months and Firefox 3 market share will pass beyond that of IE6
- IE7 would have been the leading browser but as we see around April 2009 when IE8 appeared IE7’s market share started to fell. IE8 is cannibalizing her older sister.
- Google Chrome is steadily climbing. Now it is around 2% and it gains market share month by month very rapidly (2% is very fast if we take into consideration that Opera is at 4% for about 4 years)
- Opera is stuck at 4% and it does not seem to grow beyond this number in the near future.
- Safari is growing but at a very very small pace
- There are still about a combined 4% of Firefox 1 and Firefox 2 users
One thing is sure. Internet Explorer’s domination is coming to an end. The browser market is very competitive and there are quite a few options to choose from.
What the study doesn’t show but i’m predicting now is that by the end of the year Google Chrome will pass 10% and it will take market share both from IE and Firefox.
Wordpress upgrade under 3 minutes without leaving admin interface
I’ve just upgraded to Wordpress 2.8 (Chet Baker). I think i never experienced such a smooth upgrade to a new version of a web application. When i logged in to the admin interface of my Wordpress it just warned me that there is a new version and i should upgrade. Ok i clicked the warning entered the ftp password and after waiting around 3 minutes Wordpress upgraded my blog to version 2.8. And this without ever leaving my admin backend or using any ftp program or something.
You may say that this is not such a big deal. And i may agree with you if we were talking about a desktop application. But for a web application it is important in my opinion. Wordpress made running a blog a piece of cake and many people with no or little technical skills can run their own blog, upgrade it, install plugins and with version 2.8 they can install themes too without ever leaving their admin panel, without copying files, uploading to ftp and other things that usually discourage people.
Way to go. I’m waiting other CMS providers to take example from Wordpress and come up with a similar solution.
How to use post for JSON instead of jQuery’s getJSON
jQuery has a nice function called getJSON() which performs a GET requests to a url and parses the result to a JSON object. But what if you want to do a POST request instead of a GET request. This is specially useful if you have very long strings that might break the GET request.
jQuery has no postJSON function so you will have to find another way. But there is a solution!
You can use the regular post function: jQuery.post( url, [data], [callback] , [type]) specifing the last parameter [type] to be “json”.
Here is the complete example:
var callback = function (returndata, status) {
//here you can do whatever you want with the returndata object
};
jQuery.post( url, {mydata: mydata, mydata1: mydata1}, callback, "json") ;
You can send any number of parameters to that url. The parameters are marked with italic mydata, mydata1
I hope this helps
Yahoo just lost a friend
Yahoo Messenger is the IM software i use most often, not that i really like it but here everyone is using it. So if i want to talk to someone i have to use it.
Two days ago it asked me if i want it to automatically update itself. I said why not, lets make sure is up to date and i won’t have surprises with some potential security hole or bug in the older version.
But here is what happened. Instead of updating only my Yahoo Messenger application the updater without asking me anything installed Yahoo Toolbar both for Firefox and Internet Explorer. I don’t hate too many things but toolbars are among those things. And i was shocked that Yahoo does such lame things. Install their annoying toolbar under false pretext of updating my messenger app.
I can say this. The toolbars didn’t stayed enough on my computer to take their breath after the install. And Yahoo lost a friend.
If i ever had any sympathy for Yahoo and their business then with this move they wiped it out.
Extension for removing path elements generated by RealURL
The RealURL extension for TYPO3 is a great tool for generating search engine and user friendly urls for your TYPO3 page. But the extension could have some options to customize more the page segments that are beeing generated. The drawbacks are evident: you have no user friendly way to override the generated paths and it is limitated to one pathsegment per page in the rootline.
Last week i discovered an extension that adds some of this missing functionality to TYPO3 & RealURL. The extension is called aoe_realurlpath (Alternative Real URL Path) and it can be found in the extension repository.
This extension allows the user to:
- set the path independently from the position in the pagetree
- override some of the pathsegments
- exclude some of the middle segments
Also it is nice that this extension
- support workspaces
- support multilanguage sites
- detects collisions
I’ve played a little bit with it and i can say that it is a solution for some of the problems and missing features from RealURL. But not all of them.
Wolfram Alpha is impressive. Very impressive
I’ve finally had some time and tested the recently launched and much hyped Wolfram Alpha computational knowledge engine. Make no mistake, this is not a classic search engine. The “computational knowledge engine” phrase really has meaning. If you’re expecting search results similar to those of Google’s then you’re in the wrong place.
But what Wolfram Apha does ? It searches in structured data and displays it in easily readable format, format that differs for different types of data. Be aware that it does not return results from other sites. It just returns answers to your questions formatting it so you can easily read it.
And with over 50000 algorithms and more then 10 trillion rows of data Wolfram Alpha can do a lots of things.
For example i searched for:
- a few place names (cities mainly) and it will return a nice little map with the location and other useful data: paris , comandau
- some geographic stuff: Danube (river), last earthquake in japan (it returns the list with earthquake that you can fine tune), next eclipse in germany (returns the date and infos about the next solar eclipse visible in germany)
- some chemistry: ethane (returns: formula, representation and everything from boiling point to critical pressure)
- some mathematics: pentahedra (returns graphic representation, formulas and much more), volume of a sphere (returns formula for volume)
- some stock exchange information: google (returns stock evolution, prices and more)
- some names: john, maria (returns evolution of name, number of people estimated to be named with them and more)
My conclusion is that Wolfram Alpha is not a Google competitor as many claim it. In fact you can even find links to Google satellite images in the information boxes for place names. This suggest that Wolfram Alpha doesn’t want to compete with Google and Google may appreciate this favor, returning it in some way.
Wolfram Alpha is a fact verifier and it will give you just raw facts, no opinions, no comments. In this way it may have and i believe it will have much more success then last years so called Google killer that just was forgotten (Cuil)
Google Trends forgets about Romania
Romania is a country in Central Europe with a population of 20 million people. Not many people from other parts of the world know where is it exactly. But its on the map and its a country. The country I live in. Not according to Google Trends. When checking today for something on Google Trends i wanted to see how that search term evolved in Romania. But big surprise. Romania is not in the list of countries provided by Google in the filter located in the right top corner. There are many other countries with almost insignificant population and some exotic island not even i (with a degree in geography) heard about until today. That is Bouvet Island. Shame on me, but i did not hear about it. And it seems that its not even a country! Its a dependent area of Norway and has 0 (zero) population. But Google wants to give us search term data for that country but not for Romania with 20 million people in it.
Nice work Google! Hire some geography teacher would ya!
Here is the screen-shot
Typo3 file upload problems
I’ve encountered some problems with the TYPO3 backend’s way of handling files during some work on a picture upload extension. Specifically TYPO3 moves all files you upload to the folder designed as uploadfolder in the field’s TCA setup.
But i do not want this. I want him to leave the files where i put them. Unfortunately replacing the uploadfolder value with an empty string made TYPO3 to store the whole path to the file, something like: var/www/vhosts/example.com/…
This is not good either. I want him to store the relative filepath to the fileadmin folder. I’ve discovered this issue on the TYPO3 bugtracker which provided me the solution. There is also a nice little extension called eM References that enables you to change this behavior.
After you installed the extension practically you need to change in TCA the internal type of the field from ‘file’ to ‘file_references’ and skip the uploadfolder setting entirely. This way the file will be uploaded where you need it and a relative path (a filereference) is stored in the database. No more copying of the file made by TYPO3 in places you didn’t want to.
To ease your work, here is an example configuration for a TCA entry of file_references type
"tx_myext_filereferences" => Array (
"exclude" => 1,
"label" => "LLL:EXT:myext/locallang_db.xml:tt_content.tx_myext_filereferences",
"config" => Array (
"type" => "group",
"internal_type" => "file_references",
"allowed" => $GLOBALS["TYPO3_CONF_VARS"]["GFX"]["imagefile_ext"],
"max_size" => 1000,
"show_thumbs" => 1,
"size" => 3,
"minitems" => 0,
"maxitems" => 10,
)
),
How to make a permanent (301) redirect with PHP
Often we need to redirect permanently a page to a new location and this can be accomplished in many ways. I will discuss today the PHP method because this is the one i most often run into.
So you can make a header redirect with php in the following manner:
<?php
header("Location: /example.php");
?>
But keep in mind that this is a temporary redirect. If you need to make it a permanent (301) redirect then you need to add some additional code.
One method is to add an additional response code to the header redirect:
<?php
header("Location: /example.php",TRUE,301);
?>
The other method is a bit longer:
<?php
header(’HTTP/1.1 301 Moved Permanently’);
header(’Location: http://www.example.com’);
?>
Both these methods do the same thing so its up to you which one to use.
Yahoo closes Geocities this year
I learned that Yahoo plans to shut down Geocities later this year. This is a sad news. Geocities was the place were i hosted my first website back in the year 2000. At that time Geocities was one of the few free choices to host a website and it was a pioneer on the modern web.
Blogs didn’t exist then so people made websites using all kind of editors, everything from Notepad to Microsoft Word. You could find websites on any subject, from collecting stamps to astronomy.
Sure the Geocities offering today is behind many similar services, but shutting it down completely seems a rather radical gesture from Yahoo. Today i no longer use Geocities, but somehow i feel attached to that service and i’m convinced that it is possible to improve it and make it better and more profitable. But i’m not Yahoo’s CEO.
If you ask me to name 3 websites that somehow has influenced my life Geocities would be among those 3.
R. I. P. Geocities
How some people make free software to cost more then commercial software
Free software should be free!
That’s why people choose it instead of commercial software. If you don’t have the means, the passion and the time to develop free software then you better don’t do it or make it commercial software. Because when you call a product free, then people expect it to be really free and they don’t want all kinds of hidden costs.
Yes. Many free programs have hidden costs that you only discover after you have been using the program a time. For example some developers after they get their software to a certain popularity level start to ask for “donations” even to fix bugs in their software. Not to mention that documentation for most of these start with a pledge for donations and for some that is the only thing you can find in the documentation.
This is not fiction, this is happening for real. I started to use some plugins for one of the content management systems i use, only to learn that the developer will not fix the bugs in it unless he is paid for these fixes.
Don’t get me wrong, i know that the developer has to eat and pay the rent but not using these methods. This way even if someone had in mind to donate, it will certainly anger him enough to change his mind. If the user knew from start that this will cost money, maybe he would have choosen a commercial plugin with support included.
If you start to ask money then ask for new developments, feature requests, not for bug fixes! And if you started to ask money then label your software as commercial so you won’t mislead people when they make a choice.
You can run PHP on Google App Engine
It seems that some people figured out how to run PHP on Google App Engine. You may be wondering how this is possible as Google doesn’t support PHP on App Engine. Well its possible because recently Google announced Java as the newest programming language supported by the App Engine. And this made possible to run Quercus which is a 100% Java implementation of the PHP language. So until PHP support is officially added by Google you can play with this approach.
HTML and Javascript code to crash IE6
I’m a declared adversary of IE6. I even wrote about it a while ago. Now i saw that Cats who code wrote an interesting post with the title 6 HTML and Javascript codes to crash IE6.
My favorite is this one : <STYLE>@;/*
These code snippets should be everywhere and people who still use IE6 should blame themselves if their browser crashes on them for using an old, outdated and insecure browser. As i said it, if you love IE then i won’t say to use other browser, just upgrade to latest IE.


