tag:blogger.com,1999:blog-8089973932589993352023-11-17T01:22:37.104+13:00pyLoverThis blog is not a political blog, the rest of content is about Python Programming.It is also NOT for Python the Snaketoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-808997393258999335.post-38788374240863827432008-06-11T01:06:00.001-11:002008-06-11T01:07:37.508-11:00pythonpython comictoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com2tag:blogger.com,1999:blog-808997393258999335.post-72009864889883446802008-05-27T00:31:00.003-11:002008-05-27T00:55:02.931-11:00How to put SLAX in our pocketWe need (i) USB Drive with or without chain (ii) A pocket whether sleeve or a jeans---------------------------------------------------------------------------------------------------How to put Slax to USB drive or diskSlax for USB is a Slax distribution in TAR format, designed to be unpacked to a writable disk. If you don't know what TAR format is, you may imagine it as a ZIP archive. Extract (too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-62806303694763736732008-05-27T00:15:00.004-11:002008-05-27T00:21:42.504-11:00LINUX in our pocketSlax is a modern, portable, small and fast Linux operating system with a modular approach and outstanding design. Despite its small size, Slax provides a wide collection of pre-installed software for daily use, including a well organised graphical user interface and useful recovery tools for system administrators. The modular approach gives you the ability to include any other software in too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-6957833596995973262008-05-22T13:55:00.001-11:002008-05-22T13:55:37.623-11:00How to install and configure Webalizer on UbuntuOS: Ubuntu 7.04Webalizer is a nice web analysis tool for your server.To install Webalizer open up a terminal and enter the following commands: $ sudo aptitude update $ sudo aptitude install webalizerWebalizer didn't work right away, so I found a fix for it.Edit webalizer.conf with your favorite editor: $ vi /etc/webalizer/webalizer.confFind the following: LogFile /var/log/apache/too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-39996578576439760322008-05-22T13:53:00.000-11:002008-05-22T13:54:22.587-11:00Install Apache2 in ubuntuInstall Apache Web Server on Ubuntu This step-by-step howto shows a basic setup for Apache 2 web server. Apache is installed on Ubuntu 6.06 LTS Dapper, but instructions will probably work on any Ubuntu. This document is a work in progress, initially only required commands are listed without troughout explanations.<!--xhtmlphpterodebug--> © 2006 Tero Karvinen. GNU General Public License, too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-15943777808326370212008-04-30T01:29:00.002-11:002008-04-30T01:38:53.107-11:00Database Manager : SQLiteSpySQLiteSpy is a fast and compact GUI database manager for SQLite. It reads SQLite3 files and executes SQL against them. Its graphical user interface makes it very easy to explore, analyze, and manipulate SQLite3 databases.readmoreA simple SQLite Database with GUI, easy to manage, create and save SQL. Able to retrieve 500,000 rows within 5 minutes.too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-42438655532724755072008-04-23T03:43:00.003-11:002008-04-23T03:57:19.802-11:00SQLite- FetchFetch is a SQlite function, it writes in fetch( ). The purpose of this function is to Return a result record of the queryFor example:fetchall( ) - return all as a tuple for row in cur.fetchall( ): print "name",row[0], "address",row[1] 2. fetchone( ) - return first row for row in cur.fetchone( ): print "............................ 3. too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-33258511774366602512008-04-19T10:36:00.001-11:002008-04-19T10:36:55.039-11:00GoogleTalk on Pythontoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-66237025624299463992008-04-19T10:01:00.000-11:002008-04-19T10:02:07.522-11:00Getting with Python Moduletoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-53143387692714445042008-04-19T09:58:00.001-11:002008-04-19T09:58:46.638-11:00Introduction and Installationtoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-18719127766695283832008-04-19T09:55:00.001-11:002008-04-19T09:57:05.787-11:005 minutes pythontoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-87070684028800233892008-04-19T00:02:00.000-11:002008-04-19T00:17:39.453-11:00How To Create VIEWIn Database, VIEW is a virtual table / derived TABLE.The CREATE VIEW command assigns a name to a pre-packaged SELECT statement. Once the view is created, it can be used in the FROM clause of another SELECT in place of a table name.sql-command ::= CREATE [TEMP | TEMPORARY] VIEW [IF NOT EXISTS] [database-name.] view-name AS select-statementOn the other hand VIEW is a TABLE from MASTER TABLE in too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-42172629269805000752008-04-17T23:54:00.000-11:002008-04-17T23:57:57.005-11:00How to print database into a table using pysqlitefrom pysqlite2 import dbapi2 as sqliteFIELD_MAX_WIDTH = 20TABLE_NAME = 'people'SELECT = 'select * from %s order by age, name_last' % TABLE_NAMEcon = sqlite.connect("mydb")cur = con.cursor()cur.execute(SELECT)# Print a header.for fieldDesc in cur.description: print fieldDesc[0].ljust(FIELD_MAX_WIDTH) ,print # Finish the header with a newline.print '-' * 78# For each row, print the value of eachtoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-32266602377158848512008-04-17T04:41:00.000-11:002008-04-17T04:43:42.520-11:00Find and delete string in text fileimport sys# input a original fileinp = open("december.txt","r")#write to a new fileoutp = open("newDecember.txt","w")#declare globallines = inp.readlines()for line in lines:#find the string if(line.find("asfgsfhhshas")!=-1):## print line#write to a new file sys.stdout.write(line) outp.write(line)inp = open("december.txt","r")badf = open("badDecember.txt","w")goodf = open("goodDecember.txttoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com1tag:blogger.com,1999:blog-808997393258999335.post-89500741947254236442008-04-14T10:08:00.000-11:002008-04-14T10:26:10.529-11:00Working With DatabaseDatabase driven applications account for a large part of all applications ever developed. And they will definitely in the future as well. Most of them are business applications. Companies work with large amount of data and they naturally need software for that. Well, you know, we live in a era called information revolution after all.
Database is a structured collection of data that is stored intoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-85591887575987438552008-04-11T22:21:00.001-11:002008-04-11T22:21:37.341-11:00Executing a Python Source Code FileNote: filename means you must replace the text filename with the name of the file including extension that you are using.C:\Python23 is an example; replace C:\Python23 with the actual drive letter and directory where your Python is installed. Command Line Open a Windows Console. Navigate to the drive and working directory of your choice. Enter one of the following too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-45631747600445084332008-04-11T22:16:00.000-11:002008-04-11T22:18:38.449-11:00Python InterpreterUsing Command PromptThe windows command prompt can be accessed via START/RUN/CMDThe phrase "Enter the command ..." means type the command at the prompt and press the Enter key.C:\Python25 is an example; replace C:\Python25 with the actual drive letter and directory where your Python is installed. Open a Windows Console (a.k.a.. "DOS Window"; "Command Prompt Window") Navigate to too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-52782888827117171462008-04-11T22:14:00.000-11:002008-04-11T22:24:54.540-11:00Python.... what it is ?Python is an interpreted language, even though there is a compile step in the translation from ASCII text source code to binary machine language. However, because the source code is interpreted the compile step occurs each time you execute a Python program, and no compiled machine-readable object file is created.Python is a command line application; on Windows operating systems it runs in a too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-24062322835978933772008-04-08T17:54:00.000-11:002008-04-08T17:56:35.413-11:00variablefirst_string = “This is a string”second_string = “This is another string”>>> first_number = 4second_number = 5>print “The first variables are %s, %s, %d, %d” % (first_string, second_string,first_number, second_number)The first variables are This is a string, This is another string, 4, 5too shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com0tag:blogger.com,1999:blog-808997393258999335.post-79001777749015165352008-04-08T16:51:00.001-11:002008-04-08T16:53:03.885-11:00test! yes it worksminact, rest, thresh, decay, maxact = -0.2, -0.1, 0.0, 0.1, 1.0alpha, gamma, estr = 0.1, 0.1, 0.4units = []pools = []unitbyname = {}class Unit(object): __slots__ = ['name', 'pool', 'extinp', 'activation', 'output', 'exciters', 'newact'] def __init__(self, name, pool): self.name = name self.pool = pool self.reset() self.exciters = [] unitbyname[name] = selftoo shorthttp://www.blogger.com/profile/17447227574510522807noreply@blogger.com1