I have always wanted a nice clean way to build form validators based on any kind of rule i would choose, however most of the times I stumbled upon a simple problem: How to get the cursor position inside a text-field? It’s easy in Mozilla, but what about IE?
The challenge was weird, but I finally got a way around, starting an idea here.
What I’ve done is I used Prototype to extend the Form Element Methods and simply add a version of selectionStart and selectionEnd for IE. After that, I just put them to work in a nice input wrapper class.
Read more

Regular ExpressionsQuick quide to regular expressions in JavaScript

1. The form of an expression:
var a = /dog/gim
//dog = the expression to match, g = search all matches, i = case insensitive, m=multiple line
The cool thing is that /dog/ is an object, so you can, for example, do something like /dog/.test(something)
Read more

Continuing the series about Database Sharding, I’m going to to talk about the software/hardware architecture. This post started from an excellent read, MySQL Database Scale-out and Replication for High Growth Businesses.

MySQL logo

The first order of business is MySQL replication. Replication is needed to offer redundancy and to distribute even further the load on the system. In a typicall shard environment, the database is split among multiple servers, with data being unique to each server. If one of the servers goes down, all that data will become unavailable, and even though the system will continue working, parts of some scenarios will fail. This is where replication comes to stage.
Read more

Advertisements