Wednesday, 19 October 2016

Racism - the biggest evil in society

World is full of variety of people from different race, religion, caste creed. God made the man and man created racism ! However, man forget to consider that there would be good in all races.


The racist fail to recognize that people discriminated may have good minds and skills to make considerable contribution to the progress of society. There can be good scientists, engineers, doctors, army men, social workers etc. In many countries, take for example USA, UK, Canada and Australia, many hate crimes are frequently observer. In spite of the big efforts of these nations to curb racism, still suck crimes are occurring.









To conclude, racism can be eradicated by good education and sincere co-operation of people, media & governments.

Thursday, 5 May 2016

Why use AngularJS

Why use AngularJS when there are several other JS frameworks already there.

AngularJS is an open source MVC framework developed by google.

Quick benefits are:-

1. Two way data binding between the Model and View, i.e. if one change, other is also changed !

2. Dependency injection made a piece of cake.

3. Great importance is given to unit testing

4. MVC architecture.

Do not improvise your website development by using whatever comes in hand to program it,
but use something promising like AngularJS to have better perfomance by writing minimun code !

Tip: use CND link to include angular js in your html source instead of downloading and dumping the js file in your project.

Monday, 2 May 2016

Linux Restart Wifi

Many times is observed wifi cant be restarted esp. on ubuntu.

Here are quick commands to fix this:-

sudo service network-manager stop
sudo rm /var/lib/NetworkManager/NetworkManager.state
sudo service network-manager start


My approach is to create a funciton in .bashrc as

Copy following code and paste it at the end of your bashrc file

network_restart()
{
    sudo service network-manager stop
    sudo rm /var/lib/NetworkManager/NetworkManager.state
    sudo service network-manager start

}

Hope this tip helps you !!!

django quick start tips

Make virtualenv

$ mkvirtualenv -p /usr/bin/python2.7 djprojman


Install Django

    $ pip install Django==1.8.4

    ERROR: No module named MySQLdb
    $ pip install mysql-python

 - checking django version:-

    $ python -c "import django; print(django.get_version())"

 - creating a project

    $ django-admin startproject mysite

    $ python manage.py migrate


 - create an app
    $ python manage.py startapp polls

    $ python manage.py makemigrations work


 - pip installing packages from requirements file:-
    $ pip install -r /path/to/requirements.txt


ADMIN

    create admin
    $ python manage.py createsuperuser

    admin user can have any username - admin, myadmin, abcadmin etc

    change password for any user
    $ python manage.py changepassword admin


UNIT TESTS

    $ python manage.py test --keepdb
    $ python manage.py test papu.tests.test_api_order_statuses --keepdb


MIGRATION

    $ python manage.py migrate --fake
    (if table already exists, do the fake migration)

git quick hacks

This is a bare bones quick hack tutorial for git.


Checking current system configuration

$ git config --list

This will show:-
user.name=ABCSmith
user.email=abcsmith@gmail.com

Setting configuration on current system

git config --global user.name "XYZ John"
git config --global user.email "johnxyz@gmail.com"

Quick tip

To avoid filling password, write the information in .netrc file on Linux and Mac systems, for windows, use cygwin for this.

Sample of .netrc is as follows:-
machine bitbucket.org
    login ABCSmith
    password mypass1234

Checking server url

git remote -v

Branching

- Show list of all branches
  git branch -a

- Create a feature branch named feature1 from development branch

   first checku development branch, then create the feature1 branch.

   git checkout development
   git branch feature1
 
- Create a local branch in develop
    $ git checkout develop
    $ git branch -b develop_navjot develop (will create develop_navjot branch in develop)
    $ git checkout develop_navjot

- Merge the branch locally
    $ git checkout develop
    $ git merge develop_navjot   (will merge develop_navjot into develop)

- Push local branch to remote/server
    $ git checkout develop
    $ git push origin develop_navjot (will push develop_navjot into develop onto remote/server)

UNDOING

 - undo last push

    $ git -f push origin 9fed600afffca7a4df15c84dcdda44b154dc4f8a:master

 - undo last push
    git reset --hard HEAD@{1}
    git push -f

 - undo last Commit
      $ git reset --soft HEAD^
            or
        $ git reset --soft HEAD~1

More Tips

- list all files under version control:-

    git ls-files

 - list all deleted files that are in version control:-

    git ls-files --deleted

 - removed all deleted files in version control from version control:-
    (for git rm)

    git ls-files --deleted | xargs git rm 

 - add all modified files in version control (for git add ...)

    git ls-files --modified | xargs git add

- delete a branch

    git push origin --delete <branchName>

Wednesday, 27 April 2016

IELTS Band 8 letter sample 1

Topic

You are going to another country to study. You would like to do a part-time job while you are studying, as you want to ask a friend who lives there for some help. Write a letter to this friend. In your letter:

  • give details of your study plans
  • explain why you want to get a part-time job
  • suggest how your friend can help you find a job

Letter

Dear Aashish,

I wish this letter finds you in good health and spirits. I am writing this letter to inform you that I have enrolled in a diploma in Computer Science at an accredited institution in Sydney, therefore, I will be departing for Australia next month.

This is an advanced diploma of around 1 year that will enhance my skills in software development and will increase my chances of getting placement in multinational companies. I will have to manage my expenses for education, stay, and food. I know that this is going to be quite expansive and my bank balance is not sufficient. Consequently, I will be planning to do some part time job to assist me financially.

I anticipate that you can definitely help me in getting some promising part time job in Sydney because you have been living there for a couple of years and have a considerably good social network to refer me. I would be pretty comfortable with jobs like gardner, departmental store assistant or waiter, provided the pay is reasonable. You can also suggestion me some popular websites for part time jobs in Sydney, I will apply them from here.

I hope you will devote sometime to find some favourable part time job for me. I would look forward to seeing you soon. Convey my greetings and love to your family.

Best Regards,
ABC

IELTS Band 8 Essay Sample 1

Topic

Is it good for children to start using computers from an early age and spend long hours on them ? Discuss advantages and disadvantages.

Essay

Nowadays, children are exposed to computers at home and school in a considerable amount.
Many child psychologists believe that there are numerous advantages for children to learn computers at the early age while others believe that this can be seriously detrimental to the physical and mental growth of children.

Computers provide several innovative and versatile educational applications that can supplement a child's education in many areas like science, mathematics, geography and so on. A child can learn to do various practical things like document creation, spreadsheets, computer drawing, that will be very helpful in his/her daily life. Many surveys conducted in some developed countries manifest that several successful employees have admitted that they had spent quite a lot of time on computers in their early childhood. Furthermore, it is very beneficial for the development of technical skills in children as operating a computer involves several tasks to be done simultaneously. Therefore, it is very much clear that indulging in computer use for long hours has multiple merits for the mental upliftment of children.

On the other hand, there are some serious drawbacks of exposing children to computers that should be worth considering. When children use the internet on the computer, they are vulnerable to get exposed to adult websites that may have an adverse effect on their psychology. Moreover, too much indulgence can be detrimental to their physical health, for example, radiations emitted by computer screen are very harmful to eyes. Another biggest side effect is alarming rise in obesity levels in early childhood because of lack of physical exercise and excess of sedentary lifestyle caused by computers. Many scientific studies have proven that children who are excessively exposed to computers are less physically active and tends to be overweight in adulthood. In some cases, children have developed severe back pains because of inappropriate sitting posture while working on the computer.

To conclude, there are indispensable advantages of learning computer at the young age, however, it should be under the supervision of parents and over indulgence should be avoided for maintaining good health of children.