- I favorited a @YouTube video from @BattleStrats http://t.co/Aleae8W Battlefield – Battlefield 3: 64 Player Mult #
- Shared: no. 430 – @kellysdf http://t.co/PDiw14L #
- New note : headjs.com – speedup and simplify javascript and css http://t.co/IZjX6NZ #
- I favorited a @YouTube video http://t.co/YbnXF00 Unlimited Detail Real-Time Rendering Technology Preview 201 #
- I favorited a @YouTube video http://t.co/d02jvHi 2CELLOS Cover Nirvana Classic "Smells Like Teen Spirit" Liv #
- Shared: EAC managed to repair one of the Vasiliko turbines http://t.co/XJBIVFs #
- Shared: Alex King: oEmbed Gist Plugin for WordPress http://t.co/oDkPZbv #
- My old blog post about Markov chains gets unusually high traffic today. What's that all about? http://t.co/z5dnMWE #
- Shared: Updated KVM ISOs http://t.co/bpAm7QY #
- We just got a power cut in the office. It's been a while since we had those. #limassol #cyprus #
- New note : Regex Tutorial – Unicode Characters and Properties http://t.co/iNHxtVo #
- G+: If GoDaddy website could waterboard me, it would. http://t.co/3H4VT16 #
- Split Family Faces – http://t.co/3CiANDk #
- I'm at The Ship Inn w/ @alex_mamchenkov http://t.co/7997vOd #
- Shared: Kamil Páral: Git Tip of the Day – splitting changes into several patches http://t.co/XVSvJoV #
- Movenpick ice cream. You have to try it. (@ Ζορπας) http://t.co/z4V41wg #
Year: 2011
Trailer : Senna
Here is a trailer for a biographical documentary of a legendary Formula 1 driver Ayrton Senna.
[youtube=http://www.youtube.com/watch?v=HrbJPsPtTyU]
PHP regular expression to match English/Latin characters only
Today at work I came across a task which turned out to be much easier and simpler than I originally thought it would. We have have a site with some user registration forms. The site is translated into a number of languages, but due to the regulatory procedures, we have to force users to input their registration details in English only. Using Latin characters, numbers, and punctuation.
I’ve refreshed my knowledge of Unicode and PCRE. And then I came up with the following method which seems to do the job just fine.
/** * Check that given string only uses Latin characters, digits, and punctuation * * @param string $string String to validate * @return boolean True if Latin only, false otherwise */ public function validateLatin($string) { $result = false; if (preg_match("/^[\w\d\s.,-]*$/", $string)) { $result = true; } return $result; }
In other words, just a standard regular expression with no Unicode trickery. The ‘/u’ modifier would cause this to totally malfunction and match everything. Good to know.
Should your employees work from home?
Mindflash.com has this infographic to help you make up your mind on whether your employees should work from home or not. Click the image to see the larger version.
Constructive lies
Being a pathological liar myself, I often hear people saying how bad lies are and how lies are only making things worse. Of course, there are counter examples of telling a lie to prevent hurting people and such. But there weren’t so many examples of constructive, useful lies. Here is one such example of lies used by an educator to assist students with a boring course.
The topic of Corporate Finance/Capital Markets is, even within the world of the Dismal Science, (Economics) an exceptionally dry and boring subject matter, encumbered by complex mathematic models and obscure economic theory.
What made Dr. K memorable was a gimmick he employed that began with his introduction at the beginning of his first class:
“Now I know some of you have already heard of me, but for the benefit of those who are unfamiliar, let me explain how I teach. Between today until the class right before finals, it is my intention to work into each of my lectures … one lie. Your job, as students, among other things, is to try and catch me in the Lie of the Day.”
Read the whole story – it’s pretty fascinating.