Javascript crc32 that matches PHP crc32 and works well with unicode

Many programmers including me are using hashes to solve different problems, and when we are using hash function in web application we want client-side and server-sire values of hash for the same value to match. So, trying to solve this problem for javascript implementation of CRC32 algorithm and PHP implementation of the same algorithm I got this article and the code that I have included to the article.

HTML5: Selected image preview jQuery plugin

HTML 5 provides lot of different ways to improve user experience of our websites. Recently I worked on a couple of websites where it was important to provide different variations of image previews with html & javascript. There were simple image previews, multiple image preview and images as background previews. Sure I had to create some javascript module that would be simple to customize for my needs. Today I am publishing this code, so feel free to change it and provide your feedback.


Read complete article: HTML5: Selected image preview jQuery plugin

Google Chrome session cookie expiration issue/feature - your personal data is insecure now!

Not long ago I was happy that modern and standards complaint browsers are gaining the market and hoped that web programming will become more and more happy and interesting job with HTML5 and three major web browsers compete with aproximately equal shares. But Google Chrome developers have not allowed me to be happy for a long time. They generating new bugs and naming them features. Some of that "features" making me really sad.

Read complete article: Google Chrome session cookie expiration issue/feature - your personal data is insecure now!

Google Crome bug: related positioning & rounded corners. Simple solution.

A couple of days ago I had to solve/handle the Google Chrome issue with the rounded corners in a scrolled area. First I have not even believed that something like that is possible with such a popular browser, but however had to find a solution. So, in my artile I am describibg such a solution in hope that this will save somebody little time and expecting a feedback if I have made something stupid.

Read complete article: Google Crome bug: related positioning & rounded corners. Simple solution.

PHP MySQL incremental backup/restore implementation (script download)

I have published two small scripts that allows to create and restore data from mysql database filtered by date, so I can define this as incremental backup. Article describes the backup/restore scripts configuration. The scripts themselves can be downloaded from the GitHub, links are available at the end of the article.

Read complete article: PHP MySQL incremental backup/restore implementation (download the script)

Javascript: How to check dependencies and load missed libraries. JQuery example.

Today I want to provide quite simple code that helps to check and load required libraries. I have met this problem while creating some code that should be delivered to different sites and I am not sure what libraries are loaded there and what are not. So, I decided to check and load dependencies from the script.

Read complete article: Javascript: How to check dependencies and load missed libraries. JQuery example.

Random value selection from array based on weight

Today I decided to publish small article and code describing weighted random values generation or better to say selects values from the array randobly based on weight values. actaully algorithms are widely known and I am just publishing javascript implementation of one of them, I think one of the best ones.

Read complete article: Random value selection from array based on weight

Erlang SSL server example

Today I decided to prepare and publish simple example of SSLsockets usages. As in my previous articles about TCP & UDP sockets I decided to write simple echo server that just returns the pacage it gets. Okay, I do not whant to waist your time and suggest just to go to the article.

Erlang: UDP socket usage example with gen_udp

UDP is a widely used protocol and Erlang is a great platform for different network application different kinds. Today I decided to publish small UDP echo server example. I know that UDP socket usage is very simple in Erlang, but I think somebody will find this code usefull.

Using MySQL PHP: select random row based on weight

Article describes algorithm of random row selection based on weight, so some rows will be selected more often than other. Article includes sample codes, so I hope will bу helpful to somebody.
Do not hesitate to leave comments if you have ideas how to improve the algorithm.

Using MySQL: select random row, but fast

Random rows selection may be slow and there are several commonly used solutions to solve this problm could be googled. In my article I am trying to review a few algorithms and to describe benefits and limitations of them.
Let me know if I have missed some good algorithm.

Using MySQL: ways to improve speed

As I have mentioned in one of my previous articles I am slightly disappointed in MySQL prepared statements, so I decided to look to theold and proven ways to improve the speed of the MySQL interaction. But what is even more impressive this approach allows even reduce hardware utilization.
This article describes SQL only and does not include PHP or erlang implementations, I hope publish some code soon.

Read complete article: Using MySQL: ways to improve speed

PHP MySQL prepared statement vs SQL statement

I should confess - I am already using MySQL prepared statements for some time, but very rarely and mainly because they can make certain scripts more readable. As many of us I have read a lot of articles about coolness of prepared statements and that I should use them because of security and speed improvements. Finally my сuriosity won and I decided to test prepared statements against ordinary SQL statements myself. Friendly speaking I was impressed by the results I got....

Read complete article: PHP MySQL prepared statement vs SQL statement

Scaling MySQL database with partitioning & subpartitioning

Many of us sooner or later have to scale our web applications. When we are talking about scalability we are always talking about the data and data storage. There are many options for data storage nowdays as relational databases, key-value storages and document oriented storages , but great part of web applications are using MySQL relational database as the main data storage maibly because of its flexebility. This article describes one of the MySQL scaling approaches - partitioning.

Read complete article: Scaling MySQL database with partitioning & subpartitioning

Twitter & facebook bookmarklets update

Today I am just want o anounce a bug fix update of Twitter and Facebook bokkmarklets. To explain a little to the people who are not using them yet. This bookmarklets allowing to select the texts on any web page and post it to the selected social network - twitter or facebook relatively.


Erlang: How to integrate C with Erlang program example or Erlang NIFs (Native Implemented Functions) usage

Erlang NIF (Native Code Functions) example. Basically article shows how to connect the library written in C and compiled with GNU gcc to the erlang code. That is very important when speed optimisation is required for some Erlang code piece. Example is very basic and just shows types conversion between two languages.


Read complete article: Erlang: How to integrate C with Erlang program example or Erlang NIFs (Native Implemented Functions) usage

PHP 5.4 prominent updates. Like php file uploads & mysql query result

A few days ago I have looked through the changes that were applied to PHP in its last  release of PHP 5.4 and was impressed by them. I think that small version number change brought the changes that could be compared to the ones that added real OOP to PHP language. So, I decided to review briefly some of them. Hope somebody will find this article interesting....


Javascript hash functions to convert string into integer hash.

A collection of hash functions implemented in Javascript. Functions are useful for browser-side string processing, but as far as server side scripting in Javascript becoming more and more popular, these functions may be helpful for server side scripting too. if you just want to have a good hash function, and cannot wait, djb2 is one of the best string hash functions i know.


Select text on any site and tweet - enhanced twitter bookmarklet

have started using tublr some time ago and really love its bookmarklet features (and actually the service itself too). So, I decided to implement bookmarklet that implements at least one of the features I like - ability to tweet selected text.

Read complete article: Select text on any site & tweet - enhanced twitter bookmarklet



Simple way to post selection to Facebook - enhanced Facebook bookmarklet

Just looked to standard Facebook bookmarklet and found that it does not allow to select some text and share it with friends. As I would like to be able to do this and as far as I have already implemented similar twitter bookmarklet, I decided to create and publish Facebook one too.


Read complete article: Post selection to Facebook - enhanced Facebook bookmarklet


Erlang geocoding wrapper for Google Geocoding service (Google Maps v3)

I have just published an article in my blog about accessing Google geocoding service from Erlang and published wrapper module for Google geocoding cervice on GitHub. It is based on Google Maps V3 cervice, as Google Maps v2 is going to be depricated soon.

PHP geocoding class with Google Maps API v3


All of us know this very useful service of Google Maps. And lot of programmers already triev Google Maps API v3. Somebody even met the problem with the limit of the geo coding requests per time period. In some case server-side scrip can help to solve the problem. If the number of the locations is less than 12.000 (monthly limit of requests per IP), you can do geocoding server side and save the results to the database. If your application requires more geocoding requests than you should implement some sort of client-side geo coding strategy. This will use IPs of your site visitors.
As usual I have prepared some code. Right now that is php class that implements server-side strategy of geocoding as a wrapper for the http requests to Google Maps service.

Read complete article: PHP geocoding with Google Maps API v3

MySQL master-slave and master-master replication

Simple step by step instructions for MySQL master-slave and master-master replication setup with some security conciderations. This article was written to reflect some changes that took place in the latest versions of MySQL database server.

Read complete article: MySQL master-slave and master-master replication. Setup instructions.

Erlang string to IP coversion and IP to string conversion

Today I had to convert string to IP for one of my Erlang modyles. Preaty simple operation, but I decided to describe this in my blog.

You can read the article here: String to IP tuple and tuple to IP address

Sorry, I have moved my blog to my own blogging platform, so you can rad all the articles there.