| ||||||||
| FreeArc may become the next free widespread compressor: http://sourceforge.net/projects/fre Old notes regarding the iteration of collections: http://home.pipeline.com/~hbaker1/Itera This site is growing, it shows how to solve common little programming tasks in many languages: http://www.codecodex.com/wiki/index.p ------------------------ Mathematica is a commercial software, and its syntax is bad if you want to use it to program, but it has lot of capabilities and its visualization features are quite flexible. Lately they have added GUI widgets too, so you can use it to write little interactive applications. Here you can find almost 2300 of such tiny applications with GUI, Wolfram demonstrations project: http://demonstrations.wolfram.com/ Among them you can learn lot of bits of basic computer science and mathematics, it's a mine. Here are some of the ones I have found more interesting: http://demonstrations.wolfram.com/Survi http://demonstrations.wolfram.com/Embry http://demonstrations.wolfram.com/Itera http://demonstrations.wolfram.com/OneTe http://demonstrations.wolfram.com/Passi http://demonstrations.wolfram.com/AreaB http://demonstrations.wolfram.com/Touch http://demonstrations.wolfram.com/Local http://demonstrations.wolfram.com/Textu http://demonstrations.wolfram.com/Image http://demonstrations.wolfram.com/Gabri http://demonstrations.wolfram.com/Prime http://demonstrations.wolfram.com/Canon http://demonstrations.wolfram.com/Intri http://demonstrations.wolfram.com/Subst http://demonstrations.wolfram.com/Doubl http://demonstrations.wolfram.com/Sorti Related: http://blog.wolfram.com/2007/08/the_spa Few of them have made me write similar Python code (it uses my baseconvert, to convert among different bases, and primes_list(n) that gives the first n primes): http://demonstrations.wolfram.com/Binar The Python code: from baseconvert import baseconvert as bc to2 = lambda n: bc(n, outbase=2, outdigits=" #") from primes import primes_list as pri for p in pri(200): print to2(p).rjust(20)This is part of the output, you can see very nice patterns: #
##
# #
###
# ##
## #
# #
# ##
# ###
### #
#####
# # #
# # #
# # ##
# ####
## # #
### ##
#### #
# ##
# ###
# # #
# ####
# # ##
# ## #
## #
## # #
## ###
## # ##
## ## #
### #
#######
# ##
# # #
# # ##
# # # #
# # ###
Other patterns can be seen in the binary representation of the Fibonacci numbers:from comb import fibonacciList as fibs for f in fibs(100): print to2(f).rjust(70)This is part of the output: #
#
##
# #
#
## #
# # #
# #
## ###
# ## #
# #
### # #
# #### #
# ## #
#### ## ##
## #### #
# # ##
# # # # #
## # ## ## #
# # # ## #
# # # # ####
## ######## #
# ## # # #
# # # # # #
### ## # ## #
# ######## # #
More patterns can be found with this simple rule, adding a number to the inverted base-2 representation of itself: http://demonstrations.wolfram.com/Rever from baseconvert import baseconvert as bc
to2 = lambda n: bc(n, outbase=2, outdigits=".#")
n = 16 # 35 59 83 155
for i in xrange(35):
print to2(n)
n += int(bc(n, outbase=2)[::-1], 2)
This the output (if you print more lines you can see more interesting patterns, they become very cyclic later, for n = 16):#.... #...# #...#. ##..## ##..##. #..##..# #..##..#. ###..#.## ##.###..#. #..#.#.##.# #.#..#.#.##. #....#####.## #.##..##.###.. ###.###.#.#..# ##....#..#..... ##...##.##...## ##...##.##...##. #..#.#.#...#.#..# #..#.#..#.##.#..#. ##.############.## ##.############.##. #.#..###########...# #..##.#########.#.##. #.....#########.#.#### #.####..#######.###.... ##..#.########.#.#.##.# ##......#.#####.#....... ##....#...###.###.....## ##....#.....#.#####...##. #..#..#.#####.#.......#..# #..#...##...#...###.#.#..#. ##.###...##.#.##...##.##.## ##.##.####....#.####...#.##. #.#...#..#.##.###..#.####...# #..##...##.#.#.#..##.#..##.##.From such things you can see how much close are the usual cellular automata to the normal integer operations like the sum following a bit inversion... | ||||||||
| comments: Leave a comment |