摘要: 今天无意发现一个老外的关于Django的网站,提供各种Django框架,小插件,下了几个试了下,相当不错啊传送门在这http://www.djangopackages.com/ 阅读全文
posted @ 2011-04-19 17:45 牛皮糖NewPtone 阅读(600) 评论(0) 推荐(0) 编辑
摘要: Updated log 1st 2011.8.7 a big project! Project2PercolationinGrids网格渗透Introduction 介绍Imagine a landscape filled with patches of dry grass. A fire has started at one end and it jumps from one patch to another. What is the probability that the fire manages to cross the entire area? Imagine a system co 阅读全文
posted @ 2011-04-19 17:35 牛皮糖NewPtone 阅读(996) 评论(0) 推荐(1) 编辑
摘要: 今天看了下数据结构,想用Python实现冒泡排序,快速排序,插入排序,堆排序。然后突然一想Python的列表有自带的sort()方法啊,比较一下哪个算法更优。 随机生成包含10000个范围(0,65536)的随机数(int),然后我就被打击了... 其中快排写了两种,冒泡也写了两种。 总结: (1)能用for循环的时候,就不要用while循环。请看两种冒泡的执行时间。(2)有时候我们需要在代码简洁和程序效率之间做成平衡。请看两种快排的执行时间。(3)Python自带的sorted()函数和列表的sort()方法已经很强大了,咱没必要这么蛋疼... 阅读全文
posted @ 2011-04-19 17:24 牛皮糖NewPtone 阅读(633) 评论(0) 推荐(0) 编辑
摘要: Untilnowwehaveconsideredonlymonauralsounds,howevertheverysameprinciplesapplytostereophonicsounds.Theadvantageofstereosoundisthatitallowsasoundtobe“positioned”fromlefttoright.Thehumaneardeterminesthepositionofasound,inpart,bytherelativeintensitiesofthesoundintheleftandrightears.Stereosoundshavetw... 阅读全文
posted @ 2011-04-11 16:27 牛皮糖NewPtone 阅读(480) 评论(0) 推荐(0) 编辑
摘要: Project1:SpecificationofAdditionalFunctions 项目1:额外函数说明 Note:allmono→stereofunctionsshouldreturnanewarray,ratherthantryingtoworkin-place. 注意:所有的单声道→多声道函数应该返回一个新数组,而不是在原数组中操作。 equal_scale(freq,amp,dur,sampler=sin_sample) Returnanascendingchromaticscalestartingonfreqwhereeachtoneisdursecondslong... 阅读全文
posted @ 2011-04-05 18:42 牛皮糖NewPtone 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 声音与波形在接触波形声音API之前,具备一些预备知识很重要,这些知识包括物理学、听觉以及声音进出计算机的程序。声音就是振动。当声音改变了鼓膜上空气的压力时,我们就感觉到了声音。麦克风可以感应这些振动,并且将它们转换为电流。同样,电流再经过放大器和扩音器,就又变成了声音。传统上,声音以模拟方式储存(例如录音磁带和唱片),这些振动储存在磁气脉冲或者轮廓凹槽中。当声音转换为电流时,就可以用随时间振动的波形来表示。振动最自然的形式可以用正弦波表示。正弦波有两个参数-振幅(也就是一个周期中的最大振幅)和频率。人们知道振幅就是音量,频率就是音调。一般来说人耳可感受的正弦波的范围是从20Hz(每秒周期)的低 阅读全文
posted @ 2011-04-05 18:38 牛皮糖NewPtone 阅读(1849) 评论(0) 推荐(0) 编辑
摘要: Chapter3Functions函数3.1Functioncalls函数调用Youhavealreadyseenoneexampleofafunctioncall:>>>type("32")<type'str'>Thenameofthefunctionistype,anditdisplaysthetypeofavalueorvariable.Thevalueorvariable,whichiscalledtheargumentofthefunction,hastobeenclosedinparentheses.Itiscomm 阅读全文
posted @ 2011-03-25 11:30 牛皮糖NewPtone 阅读(480) 评论(0) 推荐(0) 编辑
摘要: Advanced Model CheckingGraduate course - Winter Term 10 Lehrstuhl für Informatik 2Schedule TypeTimePlaceStartLecturerV4Mo 15:00 - 16:30505225.10.2010Katoen Tue 8:15 - 9:45AH IVKatoen ?2Wed 17:30 - 19:00601903.11.2010MereacreNews 10.12.2010: Due to a flaw in condition (A4) in the slides, the sli 阅读全文
posted @ 2011-03-24 17:14 牛皮糖NewPtone 阅读(559) 评论(0) 推荐(0) 编辑
摘要: The Software Modeling and Verification Group (MOVES), headed by Prof. Dr. Ir. Joost-Pieter Katoen, is one of the research units in the Department of Computer Science. The research and teaching program of the group is concerned with the study, development and application of formal methods to software 阅读全文
posted @ 2011-03-24 17:07 牛皮糖NewPtone 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 这两个基本上都是在循环的时候用。foriinrange(0,100):printiforiinxrange(0,100):printi这两个输出的结果都是一样的,实际上有很多不同,range会直接生成一个list对象:a=range(0,100)printtype(a)printaprinta[0],a[1]而xrange则不会直接生成一个list,而是每次调用返回其中的一个值a=xrange(0,100)printtype(a)printaprinta[0],a[1]所以xrange做循环的性能比range好,尤其是返回很大的时候!尽量用xrange吧,除非你是要返回一个列表。看看这里:PS 阅读全文
posted @ 2011-03-24 16:23 牛皮糖NewPtone 阅读(11204) 评论(1) 推荐(0) 编辑