Tuesday, July 14, 2015

How to check or verify if atleast one of the form radio buttons were selected?

This page keeps collecting feedback from a user for 5 times and then responds with a thank you message. This example using jQuery + forms is mainly written to expand it to a series of questions to be posed to a user and collect feedback about them from the user in a compact way.


Include the jQuery reference:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script  type='text/javascript'>
        var count=1;

And then write the repeat function that does the trick to slide over a set of questions. Here only one question is repeating but you can extend it to other purposes.


        function submitform()
        {
                //alert(count);
                //alert("Inside submitform");
                if(count==5)
                {
                         $('#formid').html("Thank you!");
                }
                else
                {
                        //alert("Inside the submitform");
                        count=count+1;
                        $('#formid').html("<form action=\"submitform()\" method=\"post\" id=\"reportform\"> <label><input type=\"radio\" name=\"report\" value=\"customer\" /> Customers</label><br /><label><input type=\"radio\" name=\"report\" value=\"item\" /> Items Sold</label><br /><label><input type=\"radio\" name=\"report\" value=\"department\" /> Sales Departments</label><br /><label><input type=\"radio\" name=\"report\" value=\"person\" /> Sales People</label><br /><input type=\"button\" name=\"reportsubmit\" value=\"Submit\" onClick=\"verifyText(this.form)\" /> </form>");
                }
        }
</script>

</head>
<body>

Now the body section starts.. You can show the user whatever you want. Here I am asking the same question. Once you click the submit it verified is atleast one of the radio buttons is selected. If selected, then repeat if not, stay on the same page.

<div id="formid">
<form action="submitform()" method="post" id="reportform">
    <label><input type="radio" name="report" value="customer" /> Customers</label><br />
    <label><input type="radio" name="report" value="item" /> Items Sold</label><br />
    <label><input type="radio" name="report" value="department" /> Sales Departments</label><br />
    <label><input type="radio" name="report" value="person" /> Sales People</label><br />
    <input type="button" name="reportsubmit" value="Submit" onClick="verifyText(this.form)" />
</form>
</div>

This is the verify section:

<script>
function verifyText (form) {
        var checked = form.querySelector('input:checked');
        var value = checked ? checked.value : null;
        alert(value);
        if(value!=null)
                submitform();

}


</script>


Thursday, July 2, 2015

[Latex][MikTex][windows] Fixing the error that mathtools.sty package is not found

These are the steps I took on windows OS to fix the package error in MikTex.

Go to the console and type "cmd"

Now go to the directory where MikTex was installed on your machine.

>> cd C:\Program Files (x86)\MiKTeX 2.9

>> cd miktex\bin

And then with the administrator settings open the package console using this command:

>> mpm_mfc_admin

This prompts a gui where you can see different packages available. Simply search for the "mathtools" package and install it by clicking + symbol on the top-left side of this GUI. Hope this helps!


Tuesday, May 19, 2015

[Latex] Installing packages like mathtools, enumitem, etc on Windows 8 using MikTek 2.9

You can directly download a .sty file and refer it in your .tex file but not always this works as sometimes a single package may require other sub-packages to be installed.

Inorder to install a new package using MikTex on Windows 8, it is very simple. Here are the steps:

1. Search for cmd in the applications search option
2. And right click this option and choose 'Run as administrator'
3. Then go to the folder where MikTex 2.9 is installed. For me it is: 'C:\Program Files (x86)\MikTex 2.9'
4. Further go to the subdirectory: 'C:\Program Files (x86)\MiKTeX 2.9\miktex\bin'
5. Once you are in this folder, type the command mpm_mfc_admin on command prompt which pops out a MikTex Package Manager console showing the different packages available.
6. From here choose whatever package you want to install by selecting that and pressing the '+' option on the top.

Thats all folks! 

How to dump a .sql file into mysql database

There are different ways you can dump a .sql file into a mysql database. But here is a quick way to do this.

Assume that you want to load the file "datafile.sql" into database named "alldata" Simply use these commands:

>> mysql

>> use alldata;

>> source datafile.sql;

>> show tables; //Displays all the tables dumped into this database. 

Wednesday, April 8, 2015

Convert a byte array to Hexadecimal string in Java

Use the DatatypeConverter liibrary that can be imported as:

>> import javax.xml.bind.DatatypeConverter;

And then lets say certificate.getSignature() is returning a byte array, use these commands:

>> byte[] sign = certificate.getSignature();
>> String hexasign = DatatypeConverter.printHexBinary(sign);
>> System.out.println("Signature on the Certificate: "+hexasign+"\n");

Thursday, May 15, 2014

How to install Amazon awscli on your ubuntu machine

It is very easy to interact with Amazon S3 or ec2 (in general, Amazon aws services) from your command line interface. Amazon provided this useful setup which makes our things more easy now!!


All you have to do is to run a set of commands and you are all set to make connections to your S3 account. Note that these instructions are only for Ubuntu machine which are almost similar to the other linux versions.

1. You first have to install python (version >= 2.6.5).

2.  Download this file get-pip.py (If its not downloading you can visit this page: https://bootstrap.pypa.io/get-pip.py)

3. After downloading it, execute this command that installs all the setup tools:

>> sudo python get-pip.py

4.  After installing the setup tools, you have to install pip which is a python package installer. Execute these commands:

>> sudo apt-get install python-pip

5. Now install the awscli using pip by executing this command:

>> pip install awscli

6. Now all the installations are done. Verify if this got installed properly using this command:

>> aws help

7. Now we have to configure this system by providing security credentials. Execute:

>> aws configure

8. This asks you to enter your access key, secret key, region, etc. Provide all the necessary information and you are all set!

Hope you will find this useful. For more information, you can check this website: https://aws.amazon.com/cli/


Monday, December 30, 2013

How to compute the most frequently occuring element in a list in python

In python there is a module named "collections" which has some specialized functions that can be used as an alternative to dict, list, etc.

There is a tool called Counter which performs operations like tallying the number of occurrences of objects in a list, etc. Here is how you can make use of this to compute the mode or most frequently occurring element in a list.

%First import the Counter tool from the collections module
>>> from collections import Counter

%Built a counter for a list. This list can be of numbers or strings. For example, if I consider a list of numbers
>>> info = Counter([1, 2, 1, 1, 1, 2])

%To know the frequencies of each element, you can call the most_common function with no arguments. This will return a list of elements attached with their frequencies in descending order.
>>>  info.most_common()
[(1, 4), (2, 2)]

%If you want to know what is the top element with highest frequency, you can send in the argument '1'
>>> info.most_common(1)
[(1, 4)]             %Here 1 is the element and 4 is the frequency of '1'

You can access these elements like this:
>>> info.most_common(1)[0][0]
1
>>> info.most_common(1)[0][1]
4

%If you want to know the top 2 elements with their frequency, you can send argument '2'
>>> info.most_common(2)
[(1, 4), (2, 2)]

To compute the size of the unique elements, you can say:
>>> len(info)
2

Similar operations on a list of strings:

>>> info = Counter(["a","b","c","a","b","c","a","a"])

>>> info.most_common()
[('a', 4), ('c', 2), ('b', 2)]
>>> info.most_common(1)
[('a', 4)]
>>> info.most_common(2)
[('a', 4), ('c', 2)]
>>> info.most_common(3)
[('a', 4), ('c', 2), ('b', 2)]

%The interesting thing is, even if you pass the argument which is greater than the length of the counter, it won't give any segmentation fault. So, it is suggested to put a check on the length of the counter.

>>> info.most_common(4)
[('a', 4), ('c', 2), ('b', 2)]

>>> len(info)
3

Hope this is useful.

Monday, December 16, 2013

Inspiring email by Prof. Alexander Coward

One of my colleagues shared this link with me which has the full transcript of Prof. Alexander Coward's email. Personally, it really encouraged me to share this with others who want to personally get more motivated as I was after reading through this email.

Dear All,

As some of you may have heard, there is some strike activity taking place on campus tomorrow.

I want to let you know that I will not be striking, which means that I will be, so-to-speak, crossing a picket line. Moreover, I know that two of your GSIs have decided to strike, but because I happen to be free in the afternoon when they teach, and because I enjoy teaching smaller classes from time to time and I haven’t had a chance to in a while, I’ll be covering those sections. If you were planning to see me at office hours tomorrow afternoon, then feel free to come to one of the sections I’ll be covering. I will be in Stephens 230c from 2:10 to 4pm, Cory Hall 285 from 4:10pm to 5pm, and Evans Hall 6 from 5:10pm-6pm.
The reason for me taking this decision is extremely simple: We have 7 class days left until the end of the course. Despite the fact that we’ve made good time and are likely to finish the syllabus with a few lectures in hand for review, class hours are valuable and your education is too important to just cancel a class if we don’t have to. Whatever the alleged injustices are that are being protested about tomorrow, it is clear that you are not responsible for those things, whatever they are, and I do not think you should be denied an education because of someone else’s fight that you are not responsible for. I say this with no disrespect whatsoever to the two GSIs who have decided to strike. Societies where people stand up for what they believe in are generally better than societies where people do not, sometimes dramatically so. Further, I cannot discount the possibility that I may be in the wrong on this and they may be right. I have certainly been on the wrong side of political judgements before and I’m sure I will be again. However from a practical point of view I’ve made my decision and you should all turn up to class and discussion tomorrow as normal.
Beyond practical matters, I think it’s also worth reflecting a little on the broader relationship between politics and your education, and I think I have some important things to share on this topic that may be helpful to you.

I do this with some trepidation. Normally I try to avoid talking about politics with my students and also my professional colleagues because people have a wide variety of views, sometimes held with great conviction and feeling. If I was to get into a political disagreement with one of you or one of my colleagues, it might get in the way of or distract us from the central mission we have of working together to give you a great education.

However sometimes political events reach into our lives without our invitation or control, and we have no choice but to engage with each other about politics. Many times in history it has done so with far more violence and disruption than a strike, and it is wise to be psychologically prepared for this fact.
If I’ve learned one thing about politics since I was your age, it is this: Politics, like most things in life worth thinking about, including mathematics, is very big, very complicated, and very interconnected. I’ve lived and worked in four countries on four continents, all with societies set up differently both politically and socially. I’ve discovered that there is no unique or obviously best way of setting up society. For every decision and judgement you reach, there are people who benefit and people who lose out. It’s the same with the way I teach my classes. I know that for every decision I make about how to teach you there are some of you who benefit and there are others who would do better if I did things differently. There is no way of getting around that. Every judgement you make in life is a question of balancing different interests and ideals. Reasonable good people can disagree on political questions like whether to strike or not, and they can disagree about far more contentious topics also.

All this may sound like speaking in platitudes. However it is a point worth making to all of you because you are so young. One of the nice things about being young is that your thinking can be very clear and your mind not so cluttered up with memories and experiences. This clarity can give you a lot of conviction, but it can also lead you astray because you might not yet appreciate just how complicated the world is. As you get older you tend to accumulate life experiences to learn from, and this is the source of wisdom, but the trouble is that the lessons we glean from life do not all point in the same direction. Sometimes it is hard to tease the correct learning from the experiences life throws at us.

So what are we to do with the fact that when we are young we lack a lot of the perspective we need to make definitive judgements about what is right, but that as we get older our judgements tend to be informed by our experiences, and these experiences guide us in contradictory ways, both between different people and within the same person?

I don’t know.

However one thing I do know is that you are not going to be able to avoid making these kinds of judgements, just as I cannot avoid making a judgment about whether to strike or not. Like it or not, I have to make a political choice, and I have to talk to you about it. For me, the choice not to strike is quite easy, but for you the kinds of judgements and choices you are going to face in your lives are going to be far from easy; they are going to be of a complexity and importance that will rival that faced by any previous generation. To an extent that you may not yet appreciate, the world is changing incredibly quickly. In just a decade, since I was your age, the internet and telecommunications has truly transformed the way we live, not just in rich countries but around the world. When I was an undergraduate, if I wanted to check my email I went to a little room in the basement to use a computer, and if I wanted to learn something I went to a library. The kinds of breakthroughs we are seeing in biotechnology remind me of the way people were talking about electricity in 1900. Of course I don’t know - nobody knows - but my guess is that biotechnology in the 21st century could be similarly transformative to the way the full power of electricity only hit prime-time in the 20th century. The recent controversy about the NSA has shown that the role of information technology on society can be, or at least might become, double edged. There is climate change, another controversial and difficult topic, the exact impact of which we do not yet know. These are just a few of the challenges we can see, and we should remember that history has a habit of throwing curve balls at each generation that nobody saw coming. And among all this tumult, our search for common human peace and happiness on some level becomes more difficult, though no less important. A previous generation dodged the bullet of nuclear armageddon when things looked bleak, but for your generation the bullets are coming thicker and faster than ever before. The potential all of you in your generation are going to have for both good and harm is tremendous.

I suspect many of you have heard sentiments along these lines before. However I also suspect that many of you will think something in response along the lines of `I know all that, but these things are for someone else to figure out, not me.’
That is a mistake.

One of the things you can lose track of when you attend a top tier university like Berkeley is just how exceptional and amazing you really are. I’m blown away every time I talk to you. The way you ask penetrating questions, the way you improved so much between midterm 1 and 2, the way you challenge me to be a better teacher, it just knocks my socks off. You really are amazing. I’ve taught students all over the world, and I’ve never seen a group of students so talented. I’m not just talking about some of you. I’m talking about all of you. It’s a privilege to be your professor. Sadly, however, I know many of you don’t feel that way. The difficulty you all face is that as you look around at all your fellow students, it’s easy to have your eye drawn by people doing better than you. Or rather, I should say people who look like they’re doing better than you. In reality the true extent of how much people are learning can be difficult to measure. Sometimes failures and adversity are better preparations for long term success than effortless progress.

Why am I telling you all this?

I’m telling you this because you all need to know that there is not some great pool of amazing people in some other place who are going to shape the way our species navigates the coming decades. The simple fact is that, like it or not, technology is going to change the way we live in the future, and you’re going to have to solve some very hard problems, as well as figure out how best to use new technology for good, while at the same time facing human dangers that have haunted humanity throughout history.

Part of the work of your generation is going to be technological, using scientific ideas to serve the interests of society, and part of the work is going to be fundamentally human, tied inexorably with qualities of the human condition - human emotion - that dominate the whole of history. These things are not separate, but are inexorably linked, and you are in a better place to understand that connection than me.

I can’t tell you what your particular role should be in the new realities of the 21st century. It’s up to you to decide if you want to make the focus of your life technological, focused on new innovations to drive society forward, or essentially human, focused on the age-old struggles of trying to get along, work together, and find happiness, or some combination of the two.

However I can tell you this:

Whatever you decide to do with your life, it’s going to be really, really complicated.

Science and technology is complicated. History and politics is complicated. People are complicated. Figuring out how to be happy, and do simple things like take care of our kids and maintain friendships and relationships, is complicated.
In order for you to navigate the increasing complexity of the 21st century you need a world-class education, and thankfully you have an opportunity to get one. I don’t just mean the education you get in class, but I mean the education you get in everything you do, every book you read, every conversation you have, every thought you think.

You need to optimize your life for learning.

You need to live and breath your education.

You need to be *obsessed* with your education.

Do not fall into the trap of thinking that because you are surrounded by so many dazzlingly smart fellow students that means you’re no good. Nothing could be further from the truth.

And do not fall into the trap of thinking that you focusing on your education is a selfish thing. It’s not a selfish thing. It’s the most noble thing you could do.
Society is investing in you so that you can help solve the many challenges we are going to face in the coming decades, from profound technological challenges to helping people with the age old search for human happiness and meaning. 
That is why I am not canceling class tomorrow. Your education is really really important, not just to you, but in a far broader and wider reaching way than I think any of you have yet to fully appreciate. 

See you tomorrow,

 Alexander

Taken from: http://alumni.berkeley.edu/california-magazine/just-in/2013-11-21/cal-lecturers-email-students-goes-viral-why-i-am-not

Tuesday, November 12, 2013

How to import functions in another file to your current file in python

If you are working on a code (sample.py) that uses functions of another file (simpleops.py) in the same directory, you can simply call "import simpleops" and then use the functions in that file as "simpleops.()" as shown in the below example.

Example: 

Your current program (sample.py) :

#!/usr/bin/env python
import simpleops

print simpleops.sum(5,3)
print simpleops.mult(5,3)



If the another file is in different directory compared to your current file, then you should first import its directory path and then import the file like: "sys.path.insert(0, FILEPATH) import simpleops" as shown in the below example. Note that the value '0' in sys.path.insert means it first searches the modules in the current directory first from the program has been called. 

Example: 

Your current program (sample.py):

#!/usr/bin/env python
import sys
sys.path.insert(0, FILEPATH)
import simpleops

print simpleops.sum(5,3)
print simpleops.mult(5,3)



For example lets say, your sample code (simpleops.py) looks like this:

#!/usr/bin/env python

def mult(a,b):
        return(a*b)

def sum(a,b):
        return(a+b)


Monday, November 11, 2013

How to install maven on linux?

Step-1: Download the maven binary package from http://maven.apache.org/download.cgi

Step-2: Extract the tar file: tar -xvzf apache-maven-3.1.1-bin.tar.gz

Step-3: Create a folder in /usr/local with the name apache-maven and extract the above tar file in this directory which gives the file structure as: /usr/local/apache-maven/apache-maven-3.1.1

Step-4: Set your path variables as below:
export M2_HOME=/usr/local/apache-maven/apache-maven-3.1.1
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

Step-5: To check if maven is successfully installed: mvn --version


Monday, October 7, 2013

How to create new user on linux for mysql

First login as 'root' on your linux machine.

Go to mysql terminal and use these commands to create a new user.

mysql> create user ''@'localhost' identified by '';

mysql> grant all privileges on  * . * to ''@'localhost';

mysql> flush privileges;

Now go back to your console and login using the created username and password using this command:

$mysql -u -p

Thats all!! And you are good to use this username and password and work on databases.

Friday, September 20, 2013

How to install updates from console on linux

There are two options to install updates.

1. Using yum
2. GUI

It is very simple if you have already yum installed on your machine.

$ yum update

It should automatically install all the updates of different software on your machine. 

Using GUI, it is very simple process. Just follow the instructions on GUI.

Wednesday, September 18, 2013

Problem with tagger and chunkers of NLTK on linux

I installed NLTK using the commands which were found here: http://nltk.org/install.html

Everything got installed successfully. So when I started using this nltk package like this:

python
>>> import nltk
>>> text = nltk.word_tokenize("And now for something completely different")
>>> text
['And', 'now', 'for', 'something', 'completely', 'different']

But when I try to tag these tokens, there are some errors as shown below.

>>>  nltk.pos_tag(text)
  File "", line 1
    nltk.pos_tag(text)
    ^
IndentationError: unexpected indent
>>> nltk.pos_tag(text)
Traceback (most recent call last):
  File "", line 1, in
  File "/usr/lib/python2.6/site-packages/nltk/tag/__init__.py", line 99, in pos_tag
    tagger = load(_POS_TAGGER)
  File "/usr/lib/python2.6/site-packages/nltk/data.py", line 605, in load
    resource_val = pickle.load(_open(resource_url))
  File "/usr/lib/python2.6/site-packages/nltk/data.py", line 686, in _open
    return find(path).open()
  File "/usr/lib/python2.6/site-packages/nltk/data.py", line 467, in find
    raise LookupError(resource_not_found)
LookupError:
**********************************************************************
  Resource 'taggers/maxent_treebank_pos_tagger/english.pickle' not
  found.  Please use the NLTK Downloader to obtain the resource:
  >>> nltk.download()
  Searched in:
    - '/root/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
**********************************************************************


The way you can fix it is: Run this command which downloads the tagger:
>>> nltk.download('maxent_treebank_pos_tagger')

It downloads this package to some directory on your machine. For me it downloaded here: /root/nltk_data...

And all the system related files with regard to NLTK are in this directory: /usr/lib/python2.6/site-packages/nltk
So, I created a new directory called 'taggers' and copy this 'maxent_treebank_pos_tagger' to this new directory named: /usr/lib/python2.6//site-packages/nltk/taggers/

Now when you run this command:
>>> tagged = nltk.pos_tag(tokens)
[('At', 'IN'), ('eight', 'CD'), ("o'clock", 'JJ'), ('on', 'IN'), ('Thursday', 'NNP'), ('morning', 'NN')]

Similarly when you try to do this:
>>> entities = nltk.chunk.ne_chunk(tagged)
You will see similar results that you have to download chunker and corpora, follow the similar procedure and execute these two commands:

>>> nltk.download('maxent_ne_chunker')
>>> nltk.download('words')

This can help you install the chunkers package and when you execute this command, you can get the parse tree
>>> entities = nltk.chunk.ne_chunk(tagged)
>>> entities
Tree('S', [('At', 'IN'), ('eight', 'CD'), ("o'clock", 'JJ'), ('on', 'IN'), ('Thursday', 'NNP'), ('morning', 'NN'), Tree('PERSON', [('Arthur', 'NNP')]), ('did', 'VBD'), ("n't", 'RB'), ('feel', 'VB'), ('very', 'RB'), ('good', 'JJ'), ('.', '.')])

Hope this helps!


Thursday, September 5, 2013

Install/add network printer to your system list in linux through command line

Initially check if CUPS (Common Unix Printing System) daemon is running or not using this command:

$$ /etc/init.d/cups status

You will see something like this on your terminal:

$$ cupsd (pid ****) is running...

If the daemon is not running, then start the daemon using these commands:

$$ /etc/init.d/cups start
$$ chkconfig cups on

To add the network printer, use this command:

$$ lpadmin -p Printer_name -E -v socket://


To set a default printer:

$$ lpadmin -d  Printer_name

To check the printer status and see if printer is in ready mode:

$$ lpq

 You see something like this when your printer is ready and there are no entries:

$$ Printer_name  is ready
$$ no entries

To check the printers installed on your machine, you can use this command:

$$ lpstat -p -d

If you want to delete a printer on your machine:

$$ lpadmin -x Printer_name




**part of this has been taken from http://sumitgoel.me

Wednesday, June 26, 2013

Applying for F-1 US visa from India

This post is intended to share my experience with those who are applying for F-1 visa to pursue education in the United States of America. Please note that this post is based on my OWN personal experience ONLY. Please follow the US-traveldocs (http://www.ustraveldocs.com/in/) website for the correct information.

There are many good websites online which gives a very detailed information about applying to F-1 visa. Here is how I applied for the visa.

Step-1: Receive i-20 from the university of your choice

Step-2: Pay SEVIS fee online (save this payment confirmation slip)

Step-3: Fill up DS-160 form online (My visa interview is in Hyderabad. So, no need for me to upload my photograph online. I went to OFC for a separate photo and fingerprint collection.)

Step-4: Take appointment for OFC and visa interview on ustraveldocs website

Step-5: At OFC: Take these documents along with you: passport, appointment confirmation, DS-160 confirmation. (Good to take i-20 as well but not required. I was not asked to show i-20)

You will be given a token number and asked to be seated. When your token number shows up, they will take your photograph and collect your finger prints (all fingers). They may ask you why you are going to the States.

Step-6: At the US consulate for visa interview: Take all the required documents which may include: passport, appointment confirmation, DS-160, SEVIS receipt, i-20, admission letter, GRE scorecard, TOEFL scorecard, funding letters (if no funding then bank loan documents that support you financially), transcripts, degree certificates, etc. And proceed for the interview.

Good luck for all the aspirants who want to pursue education in the US!

Tuesday, May 28, 2013

How to plot multiple graphs (scatter plots or histograms) on a same window in R?

Recently I have been working with R and bumped into different interesting facts of R. Here is how you can plot multiple graphs in the same window.

Your variable is x is a dependent variable on independent variables a, b, c and d. For example,

 a <- rnorm(100)
 b <- rnorm(100)
 c <- rnorm(100)
 d <- rnorm(100)


x <- a+b+c+d

If you want to understand how x is dependent upon each of these variables, you can make a scatter plot. If you want to see all these four dependency graphs on a same plot, you can use layout function in R.

Execute these commands..

M <- matrix(c(1:4), byrow=TRUE, nrow=2)
> layout(M)
> plot(x, a)
> plot(x, b)
> plot(x, c)
> plot(x, d)

Its that easy!

If you want to plot two histograms on a same plot, heres how you can do!


> hist1 <- hist(rnorm(500,3))
> hist2 <- hist(rnorm(500,5)) #500 random numbers centered around 5
> plot( hist1, col=rgb(0,0,1,1/4), xlim=c(0,10))  # first histogram
> plot( hist2, col=rgb(1,0,0,1/4), xlim=c(0,10), add=T)  # second histogram


Sunday, October 23, 2011

Learnings from the book of James

The main idea of this post is to share with you my reflections on the book of James and how it taught me few most important lessons. In our sunday school at Church, we studied the book of James and today we were reflecting on what each one of us have learnt through this study.

First of all, I want to write the things which were given in the prologue of this book in my study bible.

1. Putting faith into action through words and deeds.
2. Submitting to God under God's care.
3. Prayer needs to be a priority in our lives.

For me I found the book of James as a great instructory blessing. The words written are very simple and gives a clear instruction on how to be our walk with Christ as a Christian in everyday life. Few verses have become my favorites.

"Abraham believed God, and it was credited to him as righteousness"

It taught me that having no faith in God is a sin. Also, believing God brings blessing into our lives. Trust in him makes us righteous. Abraham was called God's friend. How amazing it is to be a friend of God - who is the almighty!

"Everyone should be quick to listen, slow to speak and slow to become angry,"

It taught me to be more patient to listen than to speak quickly. I feel that there is a great gain in listening. It makes the other person happy that we are giving him/her attention to what she is speaking and also, we can learn and improve our understanding about different things. Also, the verse says slow to become angry. In this modern world, I feel it is one of the toughest things. But surrendering ourselves to God and lean on him will help us able to follow HIS instructions through HIS word.

"God opposes the proud but gives grace to the humble"

This teaches us to be humble to gain the grace of God in our lives. Also, as we see in the book of Proverbs, "pride walketh before fall", if the grace of God is not in our lives, our lives will be shattered and meaningless.

"Is anyone in trouble? He should pray"

Gives us an instruction that prayer is an important tool to face the troubles of everyday life. Taught me the importance of prayer to survive in this competent world.

Hope these verses are a blessing to you too.

Thanks,
A sinner saved by grace.

Thursday, January 27, 2011

Tips on Time Management and Writing E-mails

Found it interesting!

Tips on Time Management and Writing E-mails


IN GRADUATE STUDY FOR THE 21ST CENTURY (Palgrave Macmillan, 2005),
Gregory Colon Semenza notes that “poor time management and inadequate organization skills” often create the major barrier to a successful graduate school experience. To help you manage your time and your work materials, we’ve summarized some of his suggestions.

DATE BOOKS may be out of date (or style) but...it’s important to have something that will help you keep track of your appointments and deadlines. Here’s a great tip: create a one- page weekly TO-DO listing of your deadlines, appointments and tasks, and post it somewhere that’s
easily accessible.

USE YOUR COMPUTER AS AN ORGANIZATIONAL TOOL. Create a folder for each area of your work: research, teaching, coursework and your academic portfolio. In your research folder, begin developing your list of references and keep copies of any papers you’ve written for any seminar you’ve taken. Bookmark important websites and electronic databases like Academic Search Premier available on the UNL Libraries resources page. In your teaching folder, keep copies of your syllabi and lesson plans for every course you teach. Begin developing your teaching statement and save each draft (you never know when you’ll want to return to an earlier
version). Save future job search materials like your CV and other documentation materials in your academic portfolio folder. The time you put into organizing these materials now will save you a great deal of time later.

ESTABLISH A ROUTINE. As much as possible try to follow a regular daily schedule so that by the time you are ready to write your dissertation your work habits will be well established. Doing so will allow you to coordinate your activities with those of your adviser, graduate
colleagues, and family and friends, and will alleviate the feeling that someone is always demanding your time.

PRIORITIZE. PRIORITIZE. PRIORITIZE. In graduate school, you need to be very protective of your research and writing time. It doesn’t matter when you set aside time to write or plan your next teaching lecture. It DOES matter that you recognize that these tasks are more important than some of your other tasks, like checking e-mail. Save the more mundane tasks for low energy times. If you’re a doctoral or master’s student who is expected to complete a thesis, spend the bulk of your day on research-related activities. And learn to say “no” — to friends, family, maybe even your graduate adviserJ. Managing your time in one area of your professional life will help you do it in other areas, too.

Having said that, BE REASONABLE ABOUT WHAT YOU CAN DO AND WHEN. If you have to work at night or on weekends, try to choose a time thatminimizes disruptions of your personal and family time.

USE HOLIDAY BREAKS TO FOCUS ON RESEARCH. Stay near the university during the summer. If you stay on campus and spend time on your research and writing, you’ll have a much better chance of finishing in a timely manner.

MAINTAIN SOME SORT OF DAILY PHYSICAL ACTIVITY during graduate school. Exercise can help you structure your day and release stress, contributes to greater confidence, keeps you healthy and clears a space in your mind for those “aha” moments that help you break through barriers in your thinking. Hobbies are good, too. Go to a UNL basketball game. Attend a
show at the Lied Center. Learn to knit (yes, there are health benefits to knitting). Like people who exercise regularly, people who take time to enjoy their favorite hobbies tend to experience less stress.

BEGIN WORKING ON YOUR CURRICULUM VITAE NOW. By building your vita early in your graduate career, you’ll be able to track your accomplishments while noting the gaps in your experience.

FIVE QUICK TIPS FOR WRITING EFFECTIVE E-MAILS

E-MAIL IS AN INCREASINGLY PREFERRED TOOL FOR COMMUNICATION between students and faculty. When communicating with your professors via e-mail, it’s important to remember that many faculty view an e-mail message as a letter that was delivered quickly rather than a quick conversation. Here are a few tips to keep in mind when writing e-mail
messages to your professors.

USE APPROPRIATE SALUTATIONS AND TITLES.
Like letters, e-mails should begin with a proper salutation. If “Dear
Dr. Smith” seems too formal, begin your message with “Hello Dr. Smith,” but avoid the kinds of casual greetings you would use with friends (e.g., “Hey”) or no greeting at all. When in doubt about using Dr. or the professor’s first name, use Dr.; the faculty member will let you know when it’s okay to use his or her first name.

IDENTIFY YOURSELF.
Faculty interact with a large number of students every semester. At the beginning of your message, refer to the class you’re taking with the faculty member or how the faculty member knows you, especially when you’re contacting someone who doesn’t know you very well. Conclude your message with more than just your first name. Provide your full name and NUID number.

AVOID TEXT ACRONYMS.
If you’re responding to e-mails on a Blackberry or smart phone, it’s
tempting to abbreviate or shorten words and phrases (e.g., u instead of you). However, abbreviations are easy to misinterpret or may be completely misunderstood.

BEWARE OF YOUR TONE.
Perhaps the most difficult part of writing an e-mail is achieving the right tone. If you’re writing an especially sensitive e-mail, let your final draft sit overnight and reread it before sending to make sure the message is appropriate. You also can ask a colleague or friend to read your message and offer feedback about how the message might be perceived. Remember, e-mail creates a permanent record of your communication that you have no control over after you click the send button. So if you’re worried about the tone of your e-mail, you might want to skip the message altogether and ask for a meeting with the faculty member.

KEEP IT SIMPLE.
Long e-mails with too many questions can get confusing. If your message is more than one or two paragraphs, rethink the purpose of the message. You may want to start with the most important question or topic. A lengthy e-mail may be a signal that the subject warrants a meeting rather than a written communication. E-mail communication is an important part of building positive relationships with your professors. It’s always worthwhile to take the time to make sure your messages are clear and appropriate.

RESOURCES
Jerz, D. & Bauer, J. (2000, December 12). Writing effective e- mail: Top
10 tips. Retrieved October 7, 2010 from
http://jerz.setonhill.edu/writing/etext/e-mail.htm#message. Toth, E.
(2009, April 28). Don’t e-mail me this way. The Chronicle of Higher
Education. Retrieved October 8, 2010, from
http://chronicle.com/article/Dont-E-Mail-Me-This- Way/44818/.

Wednesday, December 29, 2010

I was carried

From morning I was just humming Roma Waterman's tune... beautiful lyrics describing the love of Jesus who always carries us in his arms...

If you ask me how I'm feeling
I broke to pieces
Now I'm healing
If you wonder
How I get through
Something stronger than me and you
As I look back I keep smiling
Coz through the heartache I kept fighting
I'm not perfect, some days I fall
I don't give up through it all

There has been a kiss of grace on
my weary tearstained face
And I cannot walk away
From this truth I know

I was carried in the arms of a stronger man
I was lifted by the angel's gentle hand
I was rescued from the eye of a raging storm
I was given wings to fly over it all
There's no other way to say it
Oh I was carried

I had given, life had taken
Till I had nothing but my aching
But in the desert, a river flowed
Until freedom had all I owned
There has been a kiss of grace on
my weary tearstained face
And I cannot walk away
From this truth I know

I was carried in the arms of a stronger man
I was lifted by the angel's gentle hand
I was rescued from the eye of a raging storm
I was given wings to fly over it all
There's no other way to say it
Oh I was carried....

Monday, September 27, 2010

My fav chapter from Bible - Psalm 34.

1 I will extol the LORD at all times;
his praise will always be on my lips.

2 My soul will boast in the LORD;
let the afflicted hear and rejoice.

3 Glorify the LORD with me;
let us exalt his name together.

4 I sought the LORD, and he answered me;
he delivered me from all my fears.

5 Those who look to him are radiant;
their faces are never covered with shame.

6 This poor man called, and the LORD heard him;
he saved him out of all his troubles.

7 The angel of the LORD encamps around those who fear him,
and he delivers them.

8 Taste and see that the LORD is good;
blessed is the man who takes refuge in him.

9 Fear the LORD, you his saints,
for those who fear him lack nothing.

10 The lions may grow weak and hungry,
but those who seek the LORD lack no good thing.

11 Come, my children, listen to me;
I will teach you the fear of the LORD.

12 Whoever of you loves life
and desires to see many good days,

13 keep your tongue from evil
and your lips from speaking lies.

14 Turn from evil and do good;
seek peace and pursue it.

15 The eyes of the LORD are on the righteous
and his ears are attentive to their cry;

16 the face of the LORD is against those who do evil,
to cut off the memory of them from the earth.

17 The righteous cry out, and the LORD hears them;
he delivers them from all their troubles.

18 The LORD is close to the brokenhearted
and saves those who are crushed in spirit.

19 A righteous man may have many troubles,
but the LORD delivers him from them all;

20 he protects all his bones,
not one of them will be broken.

21 Evil will slay the wicked;
the foes of the righteous will be condemned.

22 The LORD redeems his servants;
no one will be condemned who takes refuge in him.