28 Oct 2011

HTML5 tags in IE for Dynamic Content (Ajax)

Today I came across the problem for HTML5 tags (nav, header, section etc) which is not working IE version less than 9. I used html5shim to recognize HTML5 tags, But my actual problem was for dynamic content, the dynamic content ( returned by ajax call) which contains HTML5 tags is not rendering by IE properly , and  we used HTML5 tags lot of places ,So replacing all tag is tedious , Finally  I found the a script innershiv which solved my issue.

Usage:

In header include the scripts

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" ></script>
<![endif]-->
<script type="text/javascript" src="/js/innershiv.js"></script>

For Dynamic content, pass content to innerShiv method

var s = document.createElement("div");
s.appendChild(innerShiv("<section>Happy section loves CSS. (:</section>"));
document.body.appendChild(s);

Like above code we can use the same for jquery ajax calls, pass extra parameter boolean false while using in jquery to avoid mess up in some situation.
 $.ajax({
                  url: 'test.php',
                  dataType: "html",    
                  type: "POST",
                  success: function(html){
               
                    $('#test').append(innerShiv(html,false));

                  }
            });

9 Sep 2011

Play framework.

The Play framework is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Play is a perfect companion to agile software development
http://www.playframework.org/

Feature I like in Play:
1) Auto reload - reloading the changes automatically, no restart
1) Jobs – get stuff done in the background
2) Templating – intuitive and productive
3) URL mappings and redirects – so easy that it is scary
4) Testing – halfway enforced for better adoption
5) Quick turnaround – happier and productive devs

Play framework can easily inlcude scala  module .

http://scala.playframework.org/

9 Sep 2011

Deploy Django CMS with Chef

Chef, a configuration management tool, is increasingly popular in the Django community. Many people have yet to take the plunge, and are still managing production systems exclusively through tools like Fabric or Buildout.

http://www.opscode.com/blog/2011/05/23/deploy-django-cms-with-chef/

26 Aug 2011

Ubuntu - Postgresql Locale setting , perl: warning: Setting locale failed.

Are you facing below issue while accessing postgrsql database?

Issue stack trace:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_MESSAGES = "en_IN.UTF-8",
    LANG = "en_US"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Solution:

1) run below command
    sudo locale-gen en_US.UTF-8

2) Add below line in /etc/environment file

    LANG=en_US.UTF-8
    LC_ALL=en_US.UTF-8

24 Aug 2011

Install multiple Django version using virtualenvwrapper in ubuntu

Hi guys, Are you finding difficulties to install multiple django version and switch between them easily? Here is the way.

We can achieve this by using virtualenv and virtualenvwrapper. virtualenv allows you  to set up multiple isolated Python environments and virtualenvwrapper allows create and manage multiple virtualenv seamlessly.Here is the simple steps to setup

1) Install virtualenv and virtualenvwrapper

    sudo pip install virtualenv virtualenvwrapper
2) Create virtual env directory 

   mkdir ~/.virtualenvs
3) Set enviromental path in .bashrc file

vi .bashrc, add below lines to end of the file.

VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.6
export WORKON_HOME=$HOME/.virtualenvs
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
source /usr/local/bin/virtualenvwrapper.sh

4) Close your terminal and open new one. Create virtual environment

 mkvirtualenv env1

After the above step you see the terminal something like

(env1)shabeer@shabeer-Vostro-1400:~$

Congrates.. Our virutual enviroment is ready and we can now install our Django version under env1,

5) (env1)shabeer@shabeer-Vostro-1400:~$ wget http://www.djangoproject.com/download/1.3/tarball/
6) (env1)shabeer@shabeer-Vostro-1400:~$ tar -zxvf Django-1.3.tar.gz
7) (env1)shabeer@shabeer-Vostro-1400:~$ cd Django-1.3
8) (env1)shabeer@shabeer-Vostro-1400:~$ python setup.py install
Above step will install django 1.3 under  virtual enviroment env1, and we can access it only by env1.

9) If you want work on django 1.2.5, create another virtual enviroment

mkvirtualenv env2, after this command and promt will be like this

(env2)shabeer@shabeer-Vostro-1400:~$

10) Download Django 1.2.5 and follow step 6 to 8.

(env2)shabeer@shabeer-Vostro-1400:~$wget  http://www.djangoproject.com/download/1.2.5/tarball/

11) If you want to switch to env1 , run below command

(env2)shabeer@shabeer-Vostro-1400:~$ workon env1

Using above command we can easily switch environment.

Done! Thanks.

11 Aug 2011

count number of files in a directory using linux command

1) Count number of files in under current directory not includes subdirectory

ls -f | wc -l

1) Count number of files in under current directory includes subdirectory

find . -type f | wc -l

3) Count number of files in under current directory with pattern matches

find . -type f | grep *.mp3 | wc -l  (count all mp3 files)

find . -type f | grep test*  | wc -l  (count all  files which starts with test)

21 Jun 2011

nokia

 

Nokia N9.

21 Jun 2011

ICANN introduce gTLDs

ICANN(Internet Corporation for Assigned Names and Numbers) introduce generic TLDS(gLTD). It opens the floodgates on domain name suffixes. It will be big change in domain and internet system. After this user can use any extension like abc.india ,shabeer.ayar or apple.google !!!!!!!!!

ICANN has opened the internet’s naming system to unleash the global human imagination.Today’s decision respects the rights of group to create new top level domain in any language or script. We hopes this allows the domain name system to better serve all of mankind,

Rod Beckstorm,President and Chief executive officer of ICANN

ICANN will start global communication program to tell the world about this drastic change in internet.Under this plan new gTLDs application accepts from Jan 2012.

Resources:

http://www.icann.org/en/news/releases/release-20jun11-en.pdf

19 Jun 2011

Faster search with Google

Google introduced new and faster ways to search using your voice, an image or Instant Pages.

click here for details

19 Jun 2011

Hello

Hello Everyone, I am setting this as my personnel blog. I plan for this to be platform to post random stuff. I hope you will enjoy whatever I’m going to post -:).

Ayar Shabeer's Space

Technical Consultant, Double Spring , Bangalore.
Expertise in Java/J2ee and Python/Django.

Contributors

shabeer ayar