Messages - vixay [ switch to compact view ]

Pages: prev1 2 3 4 5 [6] 7 8 9 10 11 ... 28next
26
javascript for now, just because it's one of the ones I learnt recently, and it was absolutely thrilling to discover the fun things it could do, you know the whole dynamic programming thing:)

27
Developer's Corner / Re: Python Language Annoyances
« on: February 09, 2010, 10:06 PM »
I think the issue is like one poster said meta-programming. Like the list below, moving up you move to a higher level of abstraction and higher level of programming. So some of your gripes about hiding details, old syntax ...etc is necessary. The higher you go the less you care about the implementation in the layers below.
English/Ideas/Abstract concepts/thought
Frameworks/Django/...etc
Python/Javascript
C++
C
Assembly
I frankly can't wait until we get to the ' just express an idea, and poof program done' stage :).
What debuggers/compilers/run-time checking do is give feedback on your ideas, about feasibility, errors ...etc, which is what they should continue doing. I'd rather have computers working harder, than people, as resource wise people are more expensive :)

some other valid comparisons were, newbie to programming's introduction to python experience is different, compared to an experienced programmer learning it.

Anyway I just learn python from diveintopython a couple of weeks ago, and since then i've used it to solve a couple of puzzles, and I had fun... The old style program was like this:
##def hours12():
##    #using loops
##    li = []
##    for h in range(1,13):
##        for m in range(60):
##            li.append('%02d%02d' %(h, m))
##    return li
##
##def hours12_b(): # this version is faster
##    #using list comprehension
##    return ['%02d%02d' %(h, m) for h in range(1,13) for m in range(60)]
##
##def duplicates(li):
##    li2 = []
##    for t in li:
##        dup = 0
##        old_d = t[0]
##        for d in t[1:]:
##            if d == old_d:
##                dup += 1
##            elif 0 < dup < 2:
##                dup = 0 #reset duplicate count if non consecutive duplicates found
##            old_d = d
##               
##        if dup >= 2:
##            # print t, dup
##            li2.append(t)
##    #print len(li2)
##    return li2
##
##import re
##repattern = re.compile(r'(\d)\1{2}')
##
##def duplicates_b(li):
##    li2 = []
##    # print 'testing regular expressions for matching duplicates'
##    for el in li:
##        result = repattern.search(el)
##        if result:
##            li2.append(el)
##            # print result.group()
##    #print len(li2)
##    return li2
##
##def duplicates_c(li): #this version is fastest
##    li2 = filter(repattern.search, li)
##    #print len(li2)
##    #return [x.group() for x in li2]
##    return li2
##
##import timeit
##li = hours12_b()
##
##ta = timeit.Timer('digits_in_clock.duplicates(digits_in_clock.li)','import digits_in_clock')
##tb = timeit.Timer('digits_in_clock.duplicates_b(digits_in_clock.li)','import digits_in_clock')
##tc = timeit.Timer('digits_in_clock.duplicates_c(digits_in_clock.li)','import digits_in_clock')
##print 'a dup method', ta.repeat(1,1000)
##print 'b dup method', tb.repeat(1,1000)
##print 'c dup method', tc.repeat(1,1000)
####li2 = duplicates(li)
####print li2
####li2 = duplicates_b(li)
####print li2

and the python way in the end was like this :)
import re
repattern = re.compile(r'(\d)\1{2}')#find a number followed by 2 consecutive duplicates
# the \1 is for first number that we match
li = ['%02d%02d' %(h, m)
      for h in range(1,13)
      for m in range(60)]
li2 = filter(repattern.search, li)
print li2
print len(li2)

Frankly I like the list comprehension idea, and how intuitive and simple python makes it.

28
http://en.wikipedia.org/wiki/Multiseat_configuration
no personal experience but i've been interested in this as well. Basically treating the modern day PCS as MINI computers :)
what i do have setup though is an expensive server with all celeron (5 yrs old) pcs as terminals via RDP. Works well enough.

29
General Software Discussion / Re: Best Python IDE
« on: December 07, 2009, 02:22 AM »
How do i configure pyscripter to use Instant Django?

30
General Software Discussion / Re: Text editor with filtering of lines
« on: November 30, 2009, 08:39 PM »
Or use Notepad++ with TextFX-Plugin:
 (see attachment in previous post)

Cool! I did not know this! I use Notepad++ on a daily basis, now i know how to go about it.
You know I'm beginning to think that all feature rich applications should have a built-in command line that matches and shows features. This way it would make it easy for power users to quickly find advanced features and such.
E.g in excel when you begin typing a function name. Emacs. Ubiquity for firefox? ...etc.
Just the other day i was looking for some advanced feature and i'd be damned if i could remember it, that's why i have to maintain a notes list with all the tricks that i use to refer to when i want to repeat the process.


Pages: prev1 2 3 4 5 [6] 7 8 9 10 11 ... 28next
Go to full version