Tag Archives: Python

Some pitfalls in Python ~ remove, recursion and sign

This post is the summary of some pitfalls of Python programming I have encountered. May it help:) 1. remove() List’s remove function is used to remove certain item from the list. However, remove function always removes the first item it … Continue reading

Posted in Programming | Tagged | Leave a comment

Pointer in Python

There is no pointers in Python but there are pointers in Python indeed. Among different kinds of pointer implementation in Python, this post demonstrate an elegant way to use pointers, especially object pointers when doing Python OOP. Detailed ‘ctypes’ module … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Jython – Combination of Java and Python

This post is used for final project of CIS610 – Teaching Effectiveness in CIS dept at UO, dedicated to the students with background of CIS122 – Intro to Algorithms and Problem Solving Using Python. Background of Java is not mandatory … Continue reading

Posted in Programming | Tagged , , , , | 1 Comment

NLTK – install nltk for Python2.7 on 64-bit win 7

There are some tricky stuffs if you are planning to install nltk for your Python2.7 (Note, only Python 2.x is supported right now) on 64-bit win7 system. Generally, all these awkward trouble are caused by stupid windows installer, which may … Continue reading

Posted in AI/ML, IDE_Make | Tagged , , , , , | Leave a comment

Python learning – Sieve of Eratosthenes

Get all the information about ‘Sieve of Eratosthenes’ on wikipedia (http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes). This algorithm does tell us there should be some algorithms with better time complexcity or space complexcity. Fun! (pic took from Wikipedia) [daveti@aimlab python]$ cat sea.py #!/bin/env python # … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Python learning – Caesar Cipher

Get all the information about the old, famous and interesing Caesar Cipher (http://en.wikipedia.org/wiki/Caeser_cipher). In this post we will implement the Caeser Cipher Encoder (cce.py), Caeser Cipher Decoder (ccd.py) and Caeser Cipher Brute Force Decipher (ccbfd.py). Have FUN:) (BTW, I have … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Python learning – regular expression

Right now, I am a teaching assistent in University of Oregon (UO) for CIS-122 (Introduction to Programming and Algorithms Using Python). We would like our students to make full use of CScircles of CS department at University of Waterloo (http://cscircles.cemc.uwaterloo.ca/), … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

csve – csv file evolver

Csv file, short for Comma Separated Version file, is usually a easy and common way to record [field:value] in multiple lines with all fields and values separated by comma, which is the basic data file of Microsoft Excel, as well … Continue reading

Posted in Dave's Tools, Programming | Tagged , , | Leave a comment