Owner: selinap URL:http://selinap.com Join Date: Thu, 27 Mar 2008 10:56:11 -0500 Rating:0 Site Description: Computer programming: Python, PhP, LaTeX and anything about computer Site statistics:Click here
Compiling LaTeX on Windows: An alternative method 2007-07-22 20:12:00 The usual method
to compile latex is by using "latex" command, and if the latex file contains bibliography, it will be a very tedious and repetitive job.To produce a dvi file:latex yourfile.texbibtex yourfile.texlatex yourfile.texlatex yourfile.texTo produce a pdf file:pdflatex yourfile.texbibtex yourfile.texpdflatex yourfile.texpdflatex yourfile.texHowever, for the windows user, with miktex, there is an alternative that could simplify all those tasks - the texify.To produce a dvi filetexify yourfile.texTo produce a dvi file and clean all the auxilary filestexify -c yourfile.texTo produce a pdf file (to clean all the auxilary files, just add -c as above)texify -p yourfile.texTo produce a dvi file and run the default viewer (add -p for pdf)texify yourfile.tex --run-viewer
Read more:Windows
LaTeX example - creating a lecture note 2007-07-08 05:41:00 This LaTeX example will create an automatic exercises numbering as well as the problems in each exercise.\documentclass[a4paper,12pt]{book}\newcounter{exercisenum}[section]\renewcommand{\theexercisenum}{\arabic{exercisenum}}\newenvironment{exercise}{\stepcounter{exercisenum}\vspace{1pc}\par\noindent\textbf{Exercise \thesection.\theexercisenum}\par\begin{flushleft}}{\end{flushleft}}\newcounter{problemnum}[exercisenum]\renewcommand{\theproblemnum}{\arabic{problemnum}}\newcommand{\problem}{\stepcounter{problemnum}\theproblemnum. }\newcounter{secondproblemnum}[problemnum]\renewcommand{\thesecondproblemnum}{\alph{secondproblemnum}}\newcommand{\secondproblem}{\stepcounter{secondproblemnum}\thesecondproblemnum) }\begin{document}\chapter{Introduction}\section{Function}\begin{exercise}\begin{tabula Read more:lecture
Backup folders with 7-zip command line 2007-05-23 20:24:00 The 7-zip command
line can be used to do a multiple folders backup. The good thing with 7-zip is that it support many compression method such as bzip2, gzip, zip and of course 7z.Here are steps for doing a backup on multiple folders on Windows: Download the 7-zip Command Line Version from Extract the content of the zip file to a temporary folder. Copy 7za.exe to your system folder (for example C:\Windows\System32\ for Windows XP).Create a folder for your backup, for example C:\backup. Create a text file in the C:\backup folder and name it backup.txt. List the full path of the folders that will be backup, each on a new line. Create a batch file in C:\backup folder and name it backup.bat. In the backup.bat file, type 7za u backup -up1q3r2x1y2z1w2 @backup.txtTo back up, just double click t
Password protect Word 2007 2008-04-07 03:24:00 To password protect a Microsoft Word 2007 file,Click on the Microsoft Office Button.Click Save As.Click Tools.Click General Options.Enter the password to open or modify (one or both).Click OK.When prompted, retype your passwords to confirm them, and click OK.Click Save.
Read more:Password
Python: Conditional Statement with lambda 2008-04-06 15:29:00 Let say that we have a conditional statement:In Python
, we can write it in three ways:>>> f = lambda x: x > 2 and (x + 1) or 0or>>> f = lambda x: 0 if x <= 2 else (x + 1)or>>> f = lambda x: [x + 1, 0][x<=2]However, if the number of conditions if more than 2, it is best to use the first method.For example, consider this conditional statement:The Python code is like below:>>> f = lambda x: (x>=5 and x+1) or ( (x < 5 and x > 2) and 3) or 0We read it as:if x >= 5, f(x) = x + 1else, if x > 2 and x
Toyota Vios 2008 2008-04-09 11:32:00 This is the new Toyota
Vios 2008. The new Vios comes in three models: 1.5 E, 1.5 G and the new 1.5 S, with 1,497 displacement cc . The pictures on the left are the 1.5 S version.This version use the same engine as the previous model, which is 1NZ-FE. 1NZ-FE engine could produce max. output of 80kW (109PS) at 6,000 rpm with max. torque of 141Nm (14.4kg-m) at 4,200 rpm.The 1NZ-FE is a 1.5 L (1497 cm³) conventional Otto cycle variant of the 1NZ-FXE. It has the same bore and stroke, but the compression ratio is lowered to 10.5:1, and it features VVT-i.The transmission is 4-Speed automatic with Super ECT and Gate Shifter. The standard gear ratio is:1st : 2.847 2nd : 1.552 3rd : 1.000 4th : 0.700 Rev : 2.343
Run Web Applications on Google's infrastructure 2008-04-09 07:18:00 Google had finally release the preview release of its "Google App Engine".So, what is Google App Engine? Google App Engine is a Google infrastructure which allow us to run Web application. However, with Google App Engine, there is no need to maintain servers. We just need to upload Web application to it.According to Google, we can have a free appspot.com domain. The free account can served up to 500Mb of persistent storage. Moreover, Google also claims that the free account will also have enough CPU and bandwidth for about 5 million page views a month.Good news for Python developer, Google App Engine was build on most of the standard Python programming language.For more information, please go to
Read more:Applications
, Google
How to embed source code in a blog 2008-04-08 11:06:00 To embed
source code inside a blog, like in the picture above, I use a css box like below:.code { font-family: 'Courier New', Courier, monospace; white-space: pre; line-height: 1.4em; margin: 1em 0; border: 1px dashed #aaa8a8; padding: 0.5em 0 0.3em 0.5em; font-size: 100%; color: #000; overflow: auto; max-width: 100%; /*max-height: 400px;*/}To use it just call the class named 'code' using div.<div class='code'>The source code goes here!</div>The tab will be preserved.In order to limit the h
Disclosure Policy 2007-05-23 01:43:00 This policy is valid from 07 April 2008This blog is a personal blog written and edited by me. This blog accepts forms of cash advertising, sponsorship, paid insertions or other forms of compensation.The compensation received will never influence the content, topics or posts made in this blog. All advertising is in the form of advertisements generated by a third party ad network. Those advertisements will be identified as paid advertisements.The owner(s) of this blog is not compensated to provide opinion on products, services, websites and various other topics. The views and opinions expressed on this blog are purely the blog owners. If we claim or appear to be experts on a certain topic or product or service area, we will only endorse products or services that we believe, based on our expe Read more:Disclosure
, Policy
Add all the natural numbers below 1000 that are multiples of 3 or 5 2008-04-09 19:27:00 Problem #1 of Project EulerAdd all the natural numbers below 1000 that are multiples of 3 or 5.Analysis:Sequence of multiple of 3: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, ..., 999Sequence of multiple of 5: 5, 10, 15, 20, 25, 30, ..., 995So, the sum is 3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 + ... + 999Take note that we have to remove the duplicate of 15, 30, 45, ..., 990Method # 1: using PythonAll the natural numbers below 1000 that are multiples of 3 or 5, are divisible by either 3 or 5. Hence, we need to add the numbers that are only divisible by 3 or 5. That is very easy in Python. Using the % operator will give use the remainder of the division.For example, 4%2 = 0, 4%3 = 1.Therefore, in order to ad the number that is divisible by 3 or 5, we have to check for the remainder. We will only add the
Multiply two 3 digits numbers in your head 2008-04-20 21:21:19 This tutorial will show how do multiplication of two three digits numbers from right to left.
Consider 234 × 456.
Step 1: Multiply
the last digits. Write 2, carry 4.
Step 2: Cross multiply the one and the tenth, and add them together. We get 53. Add the 4 that we carry to 53. We get 57. Write [...]
Easy Multiplication I 2008-04-15 19:27:00 This technique of multiplication will do the multiplication from right to left. Let’s look at an example.
Step 1: Multiply the last digits.
Step 2: Cross multiply both sets of numbers and add them together.
Step 3: Finally, multiply the left digits.
addthis_url = 'http%3A%2F%2Fselinap.com%2F2008%2F04%2Feasy-multiplication-i%2F';
addthis_title = [...]
View Microsoft Office 2007 Files 2008-04-15 03:16:00 To view or print a Microsoft
Office 2007 file, on a PC without Microsoft Office 2007, just download the viewer from Microsoft. The viewer will allow you to view and print those files, and can even open password protected Word, Excel or PowerPoint files. However, you cannot edit those files.
Here are the download links:Word Viewer [...]
Add all the natural numbers below 1000 that are multiples of 3 or 5 2008-04-14 21:38:00 Problem #1 of Project Euler
Add all the natural numbers below 1000 that are multiples of 3 or 5.
Analysis:
Sequence of multiple of 3: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, …, 999
Sequence of multiple of 5: 5, 10, 15, 20, 25, 30, …, 995
So, the sum is 3 + 5 + 6 + [...]
Password protect Word 2007 2008-04-14 21:35:00 To password protect a Microsoft Word 2007 file,
Click on the Microsoft Office Button.
Click Save As.
Click Tools.
Click General Options.
Enter the password to open or modify (one or both).
Click OK.
When prompted, retype your passwords to confirm them, and click OK.
Click Save.
addthis_url = 'http%3A%2F%2Fselinap.com%2F2008%2F04%2Fpassword-protect-word-2007%2F';
addthis_title = 'Password
+protect+Word+2007';
addthis_pub [...]
How to embed source code in a blog 2008-04-14 21:35:00 To embed
source code inside blogger blog, like in the picture above, I use a css box like below:
1
2
3
4
5
6
7
8
9
10
11
12
13
.code {
font-family: ‘Courier New’, Courier, monospace;
white-space: pre;
line-height: 1.4em;
margin: 1em 0;
border: 1px dashed #aaa8a8;
padding: [...]
Python: Conditional Statement with lambda 2008-04-14 21:34:00 Suppose that we have a conditional statement:In Python
, we can write it in three ways:
1
f = lambda x: x > 2 and (x + 1) or 0
or
1
f = lambda x: 0 if x <= 2 else (x + 1)
or
1
f = lambda x: [x + 1, 0][x <= 2]
However, if the number of conditions if more [...]
Python: Parse Apache log to sqlite database 2008-04-14 21:34:00 This Python
script was written for a friend in Australia, for part of his Ph.D project. The script will parse the Apache
server log into sqlite3 database.
Apache server log like this
1
23.13.171.152 - - [26/Sep/2007:21:20:36 +0800] "GET /forum/Themes/BlueStory/images/bbc/ftp://ftp.gif HTTP/1.1" 200 191 " "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"
could be parse to an [...]
Check your blog load time 2008-04-14 21:33:00 The form below could be used to determine a blog load time.Enter your domain name in the text box, for example selinap.blogspot.com:
.
addthis_url = 'http%3A%2F%2Fselinap.com%2F2008%2F04%2Fcheck-your-blog-load-time%2F';
addthis_title = 'Check
+your+blog+load+time';
addthis_pub = '';
Box multiplication 2008-04-21 19:57:21 The box multiplication technique is suitable for people that has problem with numbers, since it will organized all the number in place.
Example 1: 13 × 23 = 293
First, draw a box for each number. Divide each box diagonally, with a straight line. Then multiply diagonally to the right. For example, 3 × 2 = [...]
Insert figures to LaTeX 2008-04-21 04:15:04 LaTeX is a good tool for creating articles or books. However, when it comes to inserting figures, it is a very cumbersome process. This tutorial will show the steps for producing LaTeX documents with figures. For the purpose of this tutorial, we will use a graph from an excel document.
Step 1: Highlight (left click) [...]
Wordpress xmlrpc.php error 404 2008-04-22 04:13:04 A Weblog Client is a desktop software that you can use to post to your Wordpress
blog from your PC without the use of Web browser, via xmlrpc.php. By using a Weblog client, you are able to write posts offline and save dafts. However, some Web hosting provider block the access to xmlrpc.php, due to [...] Read more:error
How to backup WordPress data 2008-04-24 22:30:33 Backup is a process of duplicating data, so that it could be used to restore the original after a data loss event. This tutorial will show how to backup
your WordPress posts, pages, comments, custom fields, categories, and tags easily, using WordPress eXtended RSS (WXR).
To backup:
Step 1: Login to your WordPress Control Panel.
Step 2: Click [...]
Box multiplication 2008-04-22 11:57:21 The box multiplication technique is suitable for people that has problem with numbers, since it will organized all the number in place.
Example 1:
13 × 23 = 299 First, draw a box for each number. Divide each box diagonally, with a straight line. Then multiply diagonally to the right. For example, 3 × 2 = [...]
Wordpress xmlrpc.php error 404 2008-04-22 04:13:04 A Weblog Client is a desktop software that you can use to post to your Wordpress
blog from your PC without the use of Web browser, via xmlrpc.php. By using a Weblog client, you are able to write posts offline and save dafts. However, some Web hosting provider block the access to xmlrpc.php, due to [...] Read more:error
Multiply two 3 digits numbers in your head 2008-04-21 05:21:19 This tutorial will show how do multiplication of two three digits numbers from right to left. Consider 234 × 456.
Step 1: Multiply
the last digits. Write 2, carry 4.
Step 2: Cross multiply the one and the tenth, and add them together. We get 53. Add the 4 that we carry to 53. We [...]
Insert figures to LaTeX 2008-04-21 04:15:04 LaTeX is a good tool for creating articles or books. However, when it comes to inserting figures, it is a very cumbersome process. This tutorial will show the steps for producing LaTeX documents with figures. For the purpose of this tutorial, we will use a graph from an excel document.
Step 1: Highlight (left click) the [...]
Easy Multiplication I 2008-04-15 19:27:00 This technique of multiplication will do the multiplication from right to left. Let’s look at an example. 23 x 12 = 276
Step 1: Multiply the last digits.
Step 2: Cross multiply both sets of numbers and add them together.
Step 3: Finally, multiply the left digits.