How to Enable/Install SyntaxHighlighter in blogspot

1. Log into your blogger account and click the blog you want to operate.
2. Click "Template" label from left column
3. Click "Edit HTML" label.
4. in the opening window, locate close head tag: , and put the following contents before close head tag:

























5. Save template.
6. Put your Script or Code inside the PRE tags and define class with brush name in your blog post.But you have to make sure that the code you are going to put inside the PRE tag has to be escaped, like "<a>" has to be converted to &lt;a&gt;
To do so, you could use this site. Escape html code.

<pre class='brush:[brushname];'>
  <!--Put Your Code Here (must be HTML escaped)-->
 </pre>
7. Always edit your code in HTML view editor. After editing your content in another editor, always paste the edited content in HTML view mode too.

How to Ask an Effective Questions

In a conversation, when completing a research survey, being interviewed for a job or working on a homework assignment, you might find yourself presented with a series of closed-ended or open-ended questions. Close-ended questions are those which can be answered by a simple "yes" or "no," while open-ended questions are those which require more thought and more than a simple one-word answer.

Close-Ended Questions

If you can answer a question with only a "yes" or "no" response, then you are answering a close-ended type of question.

Examples of close-ended questions are:

Are you feeling better today?
May I use the bathroom?
Is the prime rib a special tonight?
Should I date him?
Will you please do me a favour?
Have you already completed your homework?
Is that your final answer?
Were you planning on becoming a fireman?
Should I call her and sort things out?
Is it wrong to want to live on my own at this age?
Shall we make dinner together tonight?
Could I possibly be a messier house guest?
Might I be of service to you ladies this evening?
Did that man walk by the house before?
Can I help you with that?
May I please have a bite of that pie?
Would you like to go to the movies tonight?
Is math your favorite subject?
Does four plus four equal eight?
Is that haunted house really scary?
Will you be going to Grandmother's house for Christmas?
Did Dad make the cake today?
Is there a Mass being held at noon?
Are you pregnant?
Are you happy?
Is he dead?

Close-ended questions should not always be thought of as simple questions that anyone can quickly answer merely because they require a yes or no answer. Close-ended questions can also be very complicated. For example, "Is 1 in binary equal to 1 in counting numbers?" is a close-ended question that not everyone would be able to quickly answer.

Open-Ended Questions

Open-ended questions are ones that require more than one word answers. The answers could come in the form of a list, a few sentences or something longer such as a speech, paragraph or essay.
Here are some examples of open-ended questions:
What were the most important wars fought in the history of the United States?
What are you planning to buy today at the supermarket?
How exactly did the fight between the two of you start?
What is your favorite memory from childhood?
How will you help the company if you are hired to work for us?
What do you plan to do immediately following graduation from college?
What types of decorations do you plan to have for your friend's birthday party?
What was your high school experience like?
How did you and your best friend meet?
What sites do you expect to see on your vacation?
How do you go about booking tickets for a flight?
What were the major effects of World War II for the United States?
How do you go about purchasing a home?
What is it like to live in the capital of Morocco?
What is the quickest way to get to the pet store in town?
Why is it that every time I talk with you, you seem irritated?
In what way do you feel I should present myself?
How do you manage to raise those children alone?
What is the matter with the people in that class?
Where are you going to find the time to write all those letters?
Why can't I come along with you?
What makes the leaves change color?
How exactly does one replace the screen to a cellular phone?
Although open-ended questions require lengthier responses than do close-ended questions, open-ended questions are not always more complicated. For example, asking "What are you planning to buy today at the supermarket?" may simply require the respondent to read off of a list.

When These Questions Are Used

Either type of question can be used in a wide variety of scenarios. However, if you're looking for a guide to liken these types of questions to, you can think of close-ended questions as multiple choice questions on a school exam and open-ended questions as short responses and essay questions on an exam.

Open-ended Questions

Open-ended questions require a response with more depth and a lengthier response. Open-ended questions are also helpful in finding out more about a person or a situation, whether it's during an interview, at a party, or when getting to know a new friend.

Close-ended Questions

Close-ended questions can be answered in only one word or very short phrase. Close-ended questions can also be used in the situations mentioned above, although they have the potential to end the conversation.

Here are examples of close-ended questions in these types of situations:
Would you like vanilla ice cream?
Have you ever met Joe before?
Where did you go to college?
What is your best quality?
Are you happy?
Do you enjoy your car?
Does your brother have the same interests as you?
Do you have a pet?
Do you like animals?
When is your birthday?
Do you like rain?
Now, here's some examples of these close-ended questions turned into open-ended questions - to keep the conversation going:
What is your favorite flavor of ice cream and why?
How did you meet Joe?
What do you feel was most beneficial about your college experience?
How can your top qualities help our company to thrive and grow?
What are some of the things that bring you the most joy?
Why did you decide to purchase a Volvo?
What interests do you and your brother share, and which interests do you not share?
Do you have a pet and what is your pet like?
Do you like animals and why?
When is your birthday and how do you like to celebrate?
Do you like rain and what do you usually do during rain storms?
From these examples, it is clear that close-ended questions are used to elicit a short, quick response, while open-ended questions are gateways into conversations.

Credit to: this site.

Text Analysis with Topic Models for the Humanities and Social Sciences

Text Analysis with Topic Models for the Humanities and Social Sciences (TAToM) consists of a series of tutorials covering basic procedures in quantitative text analysis. The tutorials cover the preparation of a text corpus for analysis and the exploration of a collection of texts using topic models and machine learning. These tutorials cover basic as well as somewhat advanced procedures and make extensive use of the Python programming language to organize, analyze, and visualize data. For more detail go to their website.

A good article on email writing in English

Although emails are often seen as less formal than printed business letters, in the business world you cannot afford to let your language appear to be informal. Email may be faster and more efficient, but your client or business partner will not easily forgive correspondence that is too casual. Not to fear! Read on to discover simple secrets that will add a high level of professionalism to your English emails.

Begin with a greeting



It's important to always open your email with a greeting, such as "Dear Lillian,". Depending on the formality of your relationship, you may want to use their family name as opposed to their given name, i.e. "Dear Mrs. Price,". If the relationship is more casual, you can simply say, "Hi Kelly," If you’re contacting a company, not an individual, you may write "To Whom It May Concern:"

Thank the recipient



If you are replying to a client's inquiry, you should begin with a line of thanks. For example, if someone has a question about your company, you can say, "Thank you for contacting ABC Company." If someone has replied to one of your emails, be sure to say, "Thank you for your prompt reply." or "Thanks for getting back to me." If you can find any way to thank the reader, then do. It will put him or her at ease, and it will make you appear more courteous.

State your purpose



If, however, you are initiating the email communication, it may be impossible to include a line of thanks. Instead, begin by stating your purpose. For example, "I am writing to enquire about …" or "I am writing in reference to …" It's important to make your purpose clear early on in the email, and then move into the main text of your email. Remember to pay careful attention to grammar, spelling and punctuation, and to avoid run-on sentences by keeping your sentences short and clear.

Closing remarks



Before you end your email, it's polite to thank your reader one more time as well as add some courteous closing remarks. You might start with "Thank you for your patience and cooperation." or "Thank you for your consideration." and then follow up with, "If you have any questions or concerns, don't hesitate to let me know." and "I look forward to hearing from you."

End with a closing



The last step is to include an appropriate closing with your name. "Best regards," "Sincerely," and "Thank you," are all professional. It's a good idea to avoid closings such as "Best wishes," or "Cheers," as these are best used in casual, personal emails. Finally, before you hit the send button, review and spell check your email one more time to make sure it's truly perfect!

Originally published and Credit to: https://www.englishtown.com/community/Channels/article.aspx?articleName=184-email

Network issue after Ubuntu Virtual Machine was copied from one computer to another

The problem is caused because Ubuntu ties ethernet devices to MAC addresses. When you generate a new UUID, the MAC address changes, Ubuntu doesn't know where to find the interface because the eth0 device that is loaded by the driver differs in MAC address from the device listed in the configuration.

Here are two simple commands to fix the problem:
# remove 70-persistent-cd.rules
sudo rm /etc/udev/rules.d/70-persistent-cd.rules
#reboot
sudo reboot
# do the following
\---- Start Script -
macaddr=`ifconfig -a | grep "HWaddr" | cut -d " " -f 11`
echo "eth0 mac $macaddr arp 1" > /etc/iftab
\---- End Script
ifconfig eth0 up
dhclient eth0
Sometimes, you may only need the last two steps.

Configure Tomcat 7 Two way SSL Authentication

Software: 1. Functional EJBCA PKI (Do not have one? You could use keytool instead. Follow the 2nd section of this post for configuration). 2. Apache Tomcat 7.0.52 ***Section I: To complete the configuration,you have to have your CA root certificate (LeopardRootCA.pem as example). That will be used to sign all client certificates and server certificates. By default Tomcat uses the certificate trust store provided with JDK which can be found in $JAVA_HOME/jre/lib/security/cacerts. Here I am going to create a new certificate trust store in my configuration. 1. Create Key store for Tomcat
keytool -genkeypair -alias tomcat-server -keystore /opt/apache-tomcat-7.0.52/conf/keystore.jks
Enter keystore password: apache123
Re-enter new password: apache123
What is your first and last name?
[Unknown]: Use FQDN of your server
What is the name of your organizational unit?
[Unknown]: Center Research Cancer
What is the name of your organization?
[Unknown]: SHH
What is the name of your City or Locality?
[Unknown]: CityName
What is the name of your State or Province?
[Unknown]: StateName
What is the two-letter country code for this unit?
[Unknown]: US
Is CN=FQDN, OU=Center Research Cancer, O=SHH, L=CityName, ST=StateName, C=US correct?
[no]: yes

Enter key password for 
(RETURN if same as keystore password): apache123
Re-enter new password: apache123
2. Create certificate request for Tomcat server:
keytool -certreq -alias tomcat-server -file FQDN.csr -keystore /opt/apache-tomcat-7.0.52/conf/keystore.jks
3. Sign the request in EJBCA: Copy signed certificate, FQDN.pem, file to current working path. 4. Import signed server certificate into Tomcat: Before importing signed server certificate into Tomca,t you might need to import your CA root certificate into Tomcat first or you might see the following error: "keytool error: java.lang.Exception: Failed to establish chain from reply.".
keytool -importcert -alias leopardrootca -file LeopardRootCA.pem -keystore /opt/apache-tomcat-7.0.52/conf/keystore.jks
4.1 import signed server certificate
keytool -importcert -alias tomcat-server -file FQDN.pem -keystore /opt/apache-tomcat-7.0.52/conf/keystore.jks
5. Create Trust store for tomcat and put yout CA root certificate into it:
keytool -import -keystore cacerts.jks -storepass changeit -alias leopardrootca -file leopardrootCA.pem
6. Configure Tomcat conf/server.xml by uncommenting the following section and edit 7. start Tomcat
bin/startup.sh
8. Create client certificate using the same root CA in EJBCA and import it into Firefox. ***Section II: Using keytool as example 1. create keyp air for rootCA
openssl genrsa -out rootCA.key 1024
2.create root certificate
openssl req -new -x509 -days 3650 -key rootCA.key -out rootCA.crt
3. create necessary folder for openssl
mkdir -p demoCA/newcerts
touch demoCA/index.txt
echo '01' > demoCA/serial
4. create server certificate keypair
openssl genrsa -out localhost.key 2048
5. create server certificate singing request file
openssl req -new -key localhost.key -out localhost.csr
6. sing the server CSR using CA
openssl ca -keyfile rootCA.key -cert rootCA.crt -policy policy_anything -out localhost.crt -infiles localhost.csr
7. create client certificate keypair
openssl genrsa -out client.key 2048
8. create client certificate singing request
openssl req -new -key client.key -out client.csr
9. sing client CSR use CA
openssl ca -keyfile rootCA.key -cert rootCA.crt -out client.crt -policy policy_anything -infiles client.csr
10. convert created server and client certificate into pk12 type:
openssl pkcs12 -export -in localhost.crt -inkey localhost.key -out localhost.p12 -name sercer ##password: sercer
openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12 -name client
#password: client
11.create tomcat keystore
keytool -importkeystore -deststorepass changeit -destkeypass changeit -destkeystore keystore.jks -srckeystore localhost.p12 -srcstoretype PKCS12 -alias sercer #pass is sercer
12. configure tomcat server.xml file 13.
keytool -import -keystore cacerts.jks -storepass changeit -alias rootca -file rootCA.crt

Upgrade PostgreSQL from 9.1 to 9.3 on Ubuntu

At the time of writing, you could not install postgreSQL 9.3 on Ubuntu using apt-get. Here is simple instruction of updating postgreSQL on Ubuntu to v9.3
#install dependency
sudo apt-get update
sudo apt-get -y install python-software-properties
#add repository
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
#setuop repository
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
#install
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3
#upgrade
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
\q #logout from database
service postgresql stop
/usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O " -c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o " -c config_file=/etc/postgresql/9.1/main/postgresql.conf"
exit # logout postgresql back to previous user
sudo apt-get remove postgresql-9.1
sudo vim /etc/postgresql/9.3/main/postgresql.conf # find old port of 5433 and change it to 5432
sudo service postgresql restart
Issues you may encounter: when you run the real update command above (/usr/lib/postgresql/9.3/bin/pg_upgrade...), you may notice failure and show error of "Problem of connection to database failed: fe_sendauth: no password supplied " The solution would be modify pg_hba.conf of two data directories in trust mode (NO PASSWORD) authentication then re-run pg_upgrade command. Example, # Database administrative login by Unix domain socket local all postgres trust

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...