Saturday, 24 December 2011

pythonchallenge3

http://www.pythonchallenge.com/pc/def/equality.html

the first ch is small
next three chs is bigger
comiing a smaill one
three bigger one go after
finall there has small one




data=open('c:/Python27/level3.txt')
smallLetter=""
lines=data.readlines()
print 'lines:',len(lines)
i=0
while i < len(lines):
    #print 'i:',i,'len:',len(lines[i])
    a=0
    while a+9< len(lines[i]):
        #print 'lines[',i,'][',a,']:',lines[i][a]
        if lines[i][a].islower() and lines[i][a+1:a+4].isupper()and lines[i][a+4].islower()and lines[i][a+5:a+8].isupper()and lines[i][a+8].islower():
            smallLetter=smallLetter+lines[i][a+4]
            print 'i',i,'a:',a+4
        a =a+1
       
    i=i+1
print 'smallLetter:',smallLetter,len(smallLetter)




============
 b= re.search(r'[^A-Z][A-Z][A-Z][A-Z][a-z][A-Z][A-Z][A-Z][^A-Z]',testline,re.M)

Sunday, 13 November 2011

Wednesday, 26 October 2011

Term III Week3 Note

eye lip 16*8 a litter bit bigger then concept.
deleted half and half
deleted 2 row from top center
cut eye-lip curve base on side view
freez
duplicate up to down
add more edge at connection part
import up lip always ferder up lower lip
adjust the coner of the eye
rotated lower lip

rotated 15 degreed

nubrs curve
creat mouth shape
blend
(12 cyclinder )6 edge for lip porfile
snap to curv
exture
polyexecute face
divitions12
Twist
Taper Curve
smooth
adjust mouth curve

pythonchallenge2

http://www.pythonchallenge.com/pc/def/ocr.html

I need study more about Python.
because I solved this by using non-coding way.

Sunday, 23 October 2011

pythonchallenge1

http://www.pythonchallenge.com/pc/def/map.html

I know

Not a smart way but i did
import string
for i in range(len(oStr)):
for a in range(len(string.ascii_lowercase)):
if a<=23:
if oStr[i:i+1] == string.ascii_lowercase[a]:
oNewStr = oNewStr[:i]+string.ascii_lowercase[a+2]+oStr[i+1:]
else:
if oStr[i:i+1] == string.ascii_lowercase[a]:
oNewStr = oNewStr[:i]+string.ascii_lowercase[a-24]+oStr[i+1:]


"i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url."

==============12/25===================
here is the way to using string.maketrans()
follow the example, and here is my code.
text="g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."
intab = "abcdefghijklmnopqrstuvwxyz" #string.ascii_lowercase,
outtab = "cdefghijklmnopqrstuvwxyzab"#string.ascii_lowercase[2:]+string.ascii_lowercase[:2]
from string import maketrans
trantab = maketrans(intab, outtab)#
print text.translate(trantab);





pythonchallenge0


========================================
'It is Vbscript

oMother = 2
oMulitNumber = 38

function oCount (mot,num)
'for i = 1 to num
oCount = mot^num
'next
end function
answer = oCount (oMother,oMulitNumber)

logmessage answer

Friday, 21 October 2011

Term III Week2 Note





12 edge cycle for finger
fit the size with concept
think: fiinger nile
http://goldennumber.net/hand.htm
think how withe
making four fake fingers
group plawn and finger
scale it with concept
make base shape plawn first
slice 4 edge in pawn
then more 4 edges for one finger
delete up to down 3 rows polygon which will connect to finger
finding form of hand
make sure there has geo between two fingers