Window location hash difference in FF3 and Opera

I was working on the back button support and bookmarkability of one of my galleries and by accident i have noticed there is a slight difference in behavior.

I wanted to change the url to differnet page but preserving the hash at the same time.

I wanted to jump on some event from page

Comparing APC and Memcache as local PHP content cache.

When you build PHP applications you need cache storage to keep your calculated data in. There are quite a few options and use case decides which solution is better.

I knew that APC is faster than memcached as there is much less overhead but I wanted to see how memcached would compare to APC user cache.

How to make Eclipse with PDT work faster

If your Eclipse is permanently stalling, you cant get your job done, all you see it this annoying beachball then its time to tune it up. There is not too much you can do about it but there are still a few tricks that help.

here they are

How to change wordpress frontend language, update translations or translate themes

Wordpress is a very nice blogging solution but does not really allow to create and publish multilingual blogs out of the box. The good news is that it allows you to set the language for frontend so that users see localized messages.

Writing wordpress posts in your chosen language is one thing but then you make sure buttons, error messages and other labels are translated. This is where gettext and translation files step in.

Review - SISSP Exam Guide Fourth Edition - Chapters 6-7

I personally liked the chapter about physical security. I have not heard about some of the ideas described there and I must say its quite interesting. I am happy I kept on reading so far as this part was quite cool.

Authors describe what are the high level factors of physical security. They describe how different types of physical security elements work for example keys, magnetic cards, chip cards, as well as construction elements. Its even hard to describe but I really liked that chapter.

How to include different jquery versions based on Drupal theme

Drupal is awesome but from time to time you have to modify something to get what you need.

I love latest jquery and I always have my own custom made frontent user facing theme so I thought it would be cool to include latest jquery in my custom made theme and keep the 1.3.2 version that is compatible with drupal in garland theme.

After doing so I can have all the features working like drag and drop, file uploads etc in my administration account and I can use latest coolest jquery plugins on my frontend.

How to remove www prefix from domain with mod rewrite for drupal and cakePHP

It is a bad idea to leave multiple domain names serving the same content as web crawlers will lower your rankings.

To get better SEO positioning you should rewrite url to make them point to the same url with 301 permanent redirects.

How to rewrite urls to remove www prefix

You need to create .htaccess file or edit existing one and add a section:

   RewriteEngine On
   RewriteCond %{HTTP_HOST} !^artur\.ejsmont\.org$ [NC]
   RewriteRule ^(.*)$$1 [R=301,L]

It will redirect (302 permanent client redirect) from all domain names different than in this case.

Degradation of PHP job titles

Lately I see it on almost every CV we get. Everyone is a PHP consultant, Web Architect, Web UI Expert and god knows what!

In PHP world its quite obvious but not as annoying as in Java community. Almost every single Java candidate we get writes in his resume with terms like: Architect, Enterprise Consultant, Principal Architect, Solution Architect, Senior Enterprise Architect …. oh my god I want to shoot myself.

Then there is a list of JSR specifications or some other nonsense with every box checked as expert or whatever. You ask the guy in for a interview and he does not even know what is a compound index in the database. I mean come on. Why there are no Software Engineers any more?

PHP magic method YourClassName::__toString() has to return a string value

There is nothing worse than a PHP Fatal Error :-) Your script terminates immediately and user sees 500 error page (or blank screen if you don't have one).

A nice fatal error i found recently has to do with __toString methods. Apparently there is a exact type check and __toString method in PHP has to return string. If you return something else it will cause exception to be thrown. Even if it would be casted otherwise like if( 1 == '1' ), in toString it has to be real string type.

Unfortunately for us we had some calls to other methods and one of them did not cast to string for integer values. There was no try catch block either so it boubbled up all the way to the top of the stack and caused script to die horribly : -)

Why are setters and getters bad for Object Oriented design

I have had this discussion like a dozen times already so I thought I could write it all down.

In many cases it is not that big deal. The problem is that people seem to be blind and ignore the fact that accessors can cause design issues. Its more about principles and overall rules. You wont get swine flu and die if you keep on using getters and setters. So don't panic! But your code may be cooler and more coherent if you stop for a minute and consider should they be there.

Syndicate content

About the author

Artur Ejsmont

Hi, my name is Artur Ejsmont,
welcome to my blog. I am a passionate software engineer living in Sydney and working for Yahoo!

Web Scalability for Startup Engineers

If you are into technology, you can order my book Web Scalability for Startup Engineers on Amazon. I would love to hear what are your thoughts so please feel free to drop me a line or leave a comment.

Follow my RSS