ontublog.blogspot.com
Trix & Graphix: Customizing the Unix prompt
http://ontublog.blogspot.com/2011/01/customizing-unix-prompt.html
Computing and plotting tips for GNU users. Customizing the Unix prompt. This is a very fast post about the prompt (basically this is an auto-remainder for myself xD). The appearance of the prompt in an Unix terminal is determined by the environment variable PS1. You can (you have to) modify it if you want to change the prompt. It is easy to take a look at the current value of variable: just type in an open terminal. And here is it. The prompt that I'm currently using is this one:. Is the user and w.
ontublog.blogspot.com
Trix & Graphix: Two tips to create comments in programs edited thorough VIM
http://ontublog.blogspot.com/2011/02/two-tips-to-create-comments-in-programs.html
Computing and plotting tips for GNU users. Two tips to create comments in programs edited thorough VIM. Here are a couple of simple tips to help you in the hard task of programming in VIM (the hard task is to write the code, not to do it in VIM, of course :) ). Inserting 50 symbols to create a header. Normaly it is a good idea to remark something within a program using comments. It's just something like. HERE GO IMPORTANT VARIABLES! And you will get a hundred symbols "#". In every line you want to commen...
pythonstarter.blogspot.com
Python basics for newbies: June 2010
http://pythonstarter.blogspot.com/2010_06_01_archive.html
Python basics for newbies. Python basics with practical examples. Sunday, June 27, 2010. Simple python file lookup function for newbie. Config file ' ip-mapping.txt. Is a file of the following format:. 200:172.17.4.12,172.17.4.14,172.17.4.10. 205:172.17.4.14,172.17.4.14,172.17.4.11. 210:172.17.4.12,172.17.4.18,172.17.4.18. 208:172.17.4.11,172.17.4.10,172.17.4.19. Required: Create a simple python function which will accept an 'id' and will return 'ip1' from the list of ips. Print config ' file not present'.
pythonstarter.blogspot.com
Python basics for newbies: Python merge line with line above
http://pythonstarter.blogspot.com/2011/01/python-merge-line-with-line-above.html
Python basics for newbies. Python basics with practical examples. Friday, January 7, 2011. Python merge line with line above. Join the lines which startswith : with the previous line. Ie required output is:. The python script to achieve this:. Data=open("file.txt").read().split(" n"). For i,line in enumerate(data):. Print ' n'.join(data),. The solution using UNIX Awk can be found here. More about python enumerate function can be found here. Mentioned below is a small example on python enumerate function.
pythonstarter.blogspot.com
Python basics for newbies: September 2009
http://pythonstarter.blogspot.com/2009_09_01_archive.html
Python basics for newbies. Python basics with practical examples. Thursday, September 24, 2009. Python string methods for case conversion. Few important python string methods for case conversion. Return a copy of the string with uppercase characters converted to lowercase and vice versa. Return a copy of the string converted to uppercase. Return a titlecased version of the string: words start with uppercase characters, all remaining cased characters are lowercase. St="This is the Best". This is the best'.
pythonstarter.blogspot.com
Python basics for newbies: Python - print section of file using line number
http://pythonstarter.blogspot.com/2009/10/python-print-section-of-file-using-line.html
Python basics for newbies. Python basics with practical examples. Saturday, October 31, 2009. Python - print section of file using line number. Eg Print the section of input file 'input.txt' between line number 22 and 89. Using python enumerate function sequence numbers:. For i,line in enumerate(open("file.txt") :. If i = 21 and i 89 :. And if you want to write the section to a new file say '/tmp/fileA'. Fp = open("/tmp/fileA","w"). For i,line in enumerate(open("file.txt") :. If i = 21 and i 89 :. Python...
ontublog.blogspot.com
Trix & Graphix: September 2009
http://ontublog.blogspot.com/2009_09_01_archive.html
Computing and plotting tips for GNU users. Complex axis in Gnuplot. This post is to show the great flexibility of gnuplot regarding axis format. I'm going to explain some commands to get the next graph:. Yeah, I know, may be it's the most ugly and pointless plot ever. Nevertheless, it's a complex one, and it's not easy to get. That's the point ;-). First of all, it's important to note that every plot has 4 different and independent axis called x. Command, like for example. The same for ytics. Once you kn...
ontublog.blogspot.com
Trix & Graphix: February 2011
http://ontublog.blogspot.com/2011_02_01_archive.html
Computing and plotting tips for GNU users. Two tips to create comments in programs edited thorough VIM. Here are a couple of simple tips to help you in the hard task of programming in VIM (the hard task is to write the code, not to do it in VIM, of course :) ). Inserting 50 symbols to create a header. Normaly it is a good idea to remark something within a program using comments. It's just something like. HERE GO IMPORTANT VARIABLES! And you will get a hundred symbols "#". In every line you want to commen...
ontublog.blogspot.com
Trix & Graphix: Reading a file until it ends
http://ontublog.blogspot.com/2010/06/it-is-commont-task-that-you-have-to.html
Computing and plotting tips for GNU users. Reading a file until it ends. In fortran, you have to use the option iostat when you use the read function. By doing so, there is an integer variable (ierr in the example below) that contains the output code of the last read action. If it is different to 0, it means that the end of the files has been reached (or something even worse). I think the example is self explanatory. Integer : i, ierr, number. Open(unit=10,file='filein.asc',status='old',action='read').
pythonstarter.blogspot.com
Python basics for newbies: December 2009
http://pythonstarter.blogspot.com/2009_12_01_archive.html
Python basics for newbies. Python basics with practical examples. Tuesday, December 22, 2009. Python convert string to tuple and list. Let's check the use of python 'tuple' and 'list' in-built functions. It returns a 'tuple' whose items are the same and in the same order as iterable‘s items. iterable may be a sequence, a container that supports iteration, or an iterator object. Tuple('xyz') returns ('x', 'y', 'z') and tuple([1, 2, 3]) returns (1, 2, 3). For line in open("file.txt"):. Posted by Jadu Saikia.
SOCIAL ENGAGEMENT