Okay . . . So this is one of the things i hate the most! And this hated moment of choice arises nearly every time you start doing something new. I really can’t say that i’m good at this but i know some guidelines you should follow when choosing a domain name and some ways to help you to come up with something sane & proper. So lets start with the guidelines.
Read more…
Keep in mind that if you just want to address some URL in a short way then you don’t really need to read this article. You just have to use one of the multitude of services which provide URL mapping to tiny, generated URLs. Some of those services are: http://tinyurl.com/, http://u.nu/, http://bit.ly/. Just use the one you find the sexiest ;)
What i needed was a way to make URLs on my website as short as possible. I had a huge list of numbered entries each of which had it’s own unique ID and a URL looking like this: mywebsite.com/entries/789465479916 . The best way of making the last number part of the URL as short as possible i found is converting the huge decimal number to the base of 62. Why 62? Because we’ve got 62 alphanumerical symbols there (0-9a-zA-Z) !
The first thing i found after some googling is that php actually provides a function named base_convert() which does what i want. BUT! It doesn’t support base of 62 and really huge numbers. A little disappointed i left this function be and resumed my search of the ideal solution! :D
In the comments of base_convert() i found a wonderful comment doing nearly exactly what i want. The only bad thing about it was that it didn’t support bug numbers. So i modified the code to use the bcmath php extension which provides support of huge number calculations. Bellow is the modified code.
Read more…
Categories: IT, Math & Algorithms, PHP Tags: algorithms, base converting, bcmath, big numbers, huge numbers, numbers, PHP, short urls, tiny urls
If you’re a real geek, you might want to make an ssh client… using php, well, this is something that no one will probably ever need to do… but if you’re reading this, maybe it happens so that you need it :)
So, to start with, there is a php extension called libssh2, and it’s really tricky to install it on some server configurations. I’m not going to discuss that part here because it’s purely server administration issue. I will just get to the coding part.
What we want to do here is to create php script that would run from console, will connect to remote ssh server, execute commands, and display output just like every ssh client does. The first problem is – libssh2 documentation on php site really sucks.
Read more…

What if you already use some library that occupies the $ variable and you want to continue using it and jQuery together. What happens in this case if you load jQuery is that it will override the variable to jQuery object and you won’t be able to use your existing library. Possible solutions of this are:
- Reassign jQuery from $ to something like $jq.
- Include jQuery first and after it the other library. After this instead of typing $ you will have to type jQuery. Example: jQuery(‘#mydivId’);
- You can also use the jQuery.noConflict() method to revert the $ to the value it had before jQuery was included in the page.
Read more…
Well, after using jQuery inline form validation plugin for some time the most serious problem with it was that it didn’t allow me to freely customize my UI. If i had a defined design of a form before writing the validation part I always had to alter design so that validation bubbles don’t pop onto something important. Like a “Invalid CAPTCHA code!” poping up on the CAPTCHA image or other stuff like this. Check-boxes are also easy “eaten” by the validation bubbles.
What i’ve written is a simple patch for jQuery inline form validation plugin allowing custom positioning of the validation bubbles. It gives you the possibility to override the default positioning by adding promptPosition attribute to the validated element with a value of any possible positioning pattern supported by the plugin (topLeft, topRight, bottomLeft, centerRight, bottomRight). Read more…

jQuery Inline Form Validation Engine
Recently I’ve been surfing the net in search of a jQuery powered form validation plugin, the best of what I found is the jQuery Inline Form Validation Engine. On the left is a screenshot of plugin’s performance which i find quite good from both programming and design point of views. The screenshot is taken from plugin’s author’s website at http://www.position-absolute.com.
It’s quite easy to implement in your project and consists from just a couple of JS files one ( one of them contains error messages and validation rules and the other validation code itself). Also you have to include a single css file and that’s all. No images required at all.
You can easily add your own custom validation rules and tweak the stuff that’s already present in the code. Everything is pretty simple and requires a basic knowledge of JavaScript.
Read more…
Chapter 2 of “Wheel of Time: the Gathering Storm” is out in audio format. It’s located on Tor’s website and requires a free registration. Here’s a direct link. Tor claims that they have released the chapter to “say thank you” to all the fans but I guess this is more of a marketing move than a “thank you” saying :) Well anyway though this is a marketing move this is one of those rare occasions when marketing interests match the desires of fans. Read more…
The long awaited twelfth book named “the Gathering Storm” is going to be out for sale on October 27th. For now you can read the free and publicly available first chapter of the book located on the publisher’s website. The prologue is available for sale as usual for “Wheel of Time” series books. Read more…

We had an issue today on a server with a high load because of ADODB’s session mechanism using MySQL as session storage engine with MyISAM table engine as advised by the manual of ADODB-session. Our server’s load is: 2500 new session creation every minute with about 17000 concurrent user sessions. A separate dedicated server (Amazon 2.3Ghz dualcore Xeon) was for he sole purpose of storing session data but the machine was not catching up.
So what basically happens here is that the default MyISAM table blows up in a matter of 10-20 minutes because of the tremendous amount of inserts/updates done on the table. Read more…
Recently we’ve spent several days trying to decide which UI JavaScript framework/library to use. Our company is developing a media website with funky design which has a very complex admin panel with lots of crammed together pages. We were going to rewrite the admin CP’s UI from scratch because of it’s slowness and were searching for a solution that would require as small as possible effort to build a functional/comfortable admin panel and require only minor UI customizations. Also the library we use should have made our life easier when doing stuff on the main funky site. Well we couldn’t find a solution which will satisfy both this requirements instead we decided to use ExtJS for the admin CP and JQuery for the main site. The reasons behind this choice are listed bellow:
Read more…