Tuesday, November 20, 2012

Javascript to detect Arabic characters

http://stackoverflow.com/questions/4446244/how-to-check-if-any-arabic-character-exists-in-the-string-javascript
(Other related links are in Diigo)

function hasArabic(character)
{
var arabic = /[\u0600-\u06FF]/; // http://stackoverflow.com/questions/4446244/how-to-check-if-any-arabic-character-exists-in-the-string-javascript
return (arabic.test(character));
}

function hasEnglish(s)
{
var english = /[a-zA-Z]/;
return english.test(s);
}

function hasNumbers(s)
{
var numbers = /[0-9]/;
return numbers.test(s);
}

Sunday, November 4, 2012

Important difference between 'function statements' and 'function expressions' in Javascript

EXAMPLE 1 - select the "RESULT" tab to execute the code
When the below code runs, "Yes" is printed, but not "No".
The reason is - before the code runs, "function statements" are interpreted and added to the execution stack/context, but the same is not done for "function expressions"
(Book - JavaScript Succinctly, Pg 102)

Therefore, the order in which functions are invoked & defined, becomes important when using "function expressions"
(Have to read more about this)


EXAMPLE  2 - using jQuery - $(document).ready()
Click on "RESULT" to see the result

Saturday, November 3, 2012

To enable .Net 3.5, 3.0,2.5 in Windows 8

http://helpdeskgeek.com/windows-8/install-net-framework-3-5-3-0-2-0-on-windows-8/

Excerpt:

"With Windows 8, .NET Framework 4.5 comes installed by default. Since .NET 4.5 is an in-place upgrade of 4.0, you can automatically run any applications that are geared towards .NET Framework 4.5 or 4.0. That’s fine, but what if you need to run programs that require older versions of .NET Framework? What’s the lowest version you can run?

In Windows 8, .NET 3.5, 3.0 and 2.5 come with the OS, you just have to enable it. This is really nice because you don’t have to go and download .NET 3.5 from the Microsoft website. In this post, I’ll show you how to enable the older versions of the .NET Framework in Windows 8......."

Facebook - developer links

Followers

Blog Archive