上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 84 下一页

2013年12月11日

Python 学习入门(20)—— 循环

摘要: 1. for 循环for循环需要预先设定好循环的次数(n),然后执行隶属于for的语句n次。基本构造是for 元素 in 序列: statement举例来说,我们编辑一个叫forDemo.py的文件for a in [3,4.4,'life']: print a这个循环就是每次从表[3,4.4,'life'] 中取出一个元素(回忆:表是一种序列),然后将这个元素赋值给a,之后执行隶属于for的操作(print)。介绍一个新的python函数range(),来帮助你建立表。idx = range(5)print idx可以看到idx是[0,1,2,3,4]这个函数 阅读全文

posted @ 2013-12-11 12:42 love so much 阅读(476) 评论(0) 推荐(0)

一种根据URL参数条件动态生成URL的方法

摘要: 最近做了一个产品列表页类似于搜索列表页, 功能比较简单,比搜索页复杂的逻辑在于,生成各个查询条件的URL。我们的链接如下:http://xxx.xxx.xxx/product/list.html?spm=0.0.0.0.fCULEV&noHistoryApi=1&q=洗衣机&start_price=1300&end_price=2300&ppath=6560:98950,2814486;570:24403,2085950&sort=sort-fid&fid=3486一些特点如下:比如品牌部分:1:三洋的链接中,要在ppath现有的基础上去 阅读全文

posted @ 2013-12-11 12:39 love so much 阅读(2032) 评论(0) 推荐(0)

【慎思堂】之JS牛腩总结

摘要: 一 JS基础1-定义Javascript是一种脚本语言/描述语言,是一种解释性语言。用于开发交互式web网页,使得网页和用户之间实现了一种实时性的、动态的、交互性的关系,使网页包含更多活跃的元素和更加精彩的内容。主要用于:表单验证2-特点:基于对象的语言简单性:基干Java基本语句和控制流之上的简单而紧凑的设计;其次它的变量类型是采然弱类型,并未使用严格的数据类型。安全性:它不允许访问本地硬盘,并不将数据存入到服务器上,不允许对网络文档进行修改和册滁,只能通过浏览器实现信息浏览或动态交互.从而有效地防止数据的丢失。动态性的:采用事件驱动机制,可以直接对用户或客户输入做出相应,无须经过Web服务 阅读全文

posted @ 2013-12-11 12:35 love so much 阅读(284) 评论(0) 推荐(0)

Codeforces Round #214 (Div. 2) C. Dima and Salad (背包变形)

摘要: C. Dima and Saladtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima, Inna and Seryozha have gathered in a room. That's right, someone's got to go. To cheer Seryozha up and inspire him to have a walk, Inna decided to cook something.Dima a 阅读全文

posted @ 2013-12-11 12:31 love so much 阅读(369) 评论(0) 推荐(0)

(Relax 数论1.6)POJ 1061 青蛙的约会(扩展的欧几里得公式)

摘要: /* * POJ_1061.cpp * * Created on: 2013年11月19日 * Author: Administrator */#include #include using namespace std;typedef long long ll;/** * 扩展的欧几里得计算d=gcd(a,b)=ax+by的整系数x,y */ll exgcd(ll a,ll b,ll& x ,ll& y){ if(b == 0){ x = 1; y = 0; return a; } ll t = exgcd(b,a%b,y,x); y -= a/b*x; return t;}. 阅读全文

posted @ 2013-12-11 12:27 love so much 阅读(232) 评论(0) 推荐(0)

poj 1018 Communication System 枚举 VS 贪心

摘要: Communication SystemTime Limit:1000MSMemory Limit:10000KTotal Submissions:21631Accepted:7689Description We have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices. For each device, we are free to choose from several manufactur 阅读全文

posted @ 2013-12-11 12:23 love so much 阅读(176) 评论(0) 推荐(0)

我治大学生抄作业毛病的办法——兼答丁又专老师

摘要: 通过新浪博客,一名同行 丁又专老师评论《 关于抄不抄作业的讨论》一文时,向我提出问题: 请教贺老师一个问题:平时作业不计入成绩,那么是可以避免“抄袭”的现象,“辅以其他环节,学生选择不做,不丢分,感到丢人,于是去学,自然就会做了,不用抄了。 ”,能够更详细的讲讲吗? 其实,撰文写写我和我的学生与抄作业陋习作斗争的想法已经有很久了,也就乘此机会展开说说。 就在这个周日,我和儿子锻炼。一位朋友见着了儿子,短短几分钟之内居然关切地说了好几次关于“上高中把孩子累的”之类的话。我知道她的女儿是成天喊累的,赶紧和她普及一下不要频繁地用言语主导孩子的情绪。意料之中,几句话牵出了女儿凡事不让她陪同的... 阅读全文

posted @ 2013-12-11 12:20 love so much 阅读(498) 评论(0) 推荐(0)

poj3080Blue Jeans(在m个串中找到这m个串的 最长连续公共子序列)

摘要: Description The Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth was populated. As an IBM researcher, you have been tasked with writing a program that will find comm... 阅读全文

posted @ 2013-12-11 12:16 love so much 阅读(300) 评论(0) 推荐(0)

[置顶] android关机闹钟设计思路

摘要: 1: 首先需要硬件支持,支持alarm中断触发开机,目前高通平台几乎都支持; 2:关机前需要在rtc-xxx.c中做到enable_irq_wake,和不disable alarm功能(默认开机后alarm功能就会打开,通常关机时qct会关闭该功能避免alarm触发乱开机); 3: 在AlarmManagerService.java当set请求来自闹钟时改变type类型,alarm_dev.c接收到后记下timespec(注意:闹钟app只会将距离当前时间最近的闹钟set下来),重新还原type类型,当闹钟app全部关闭时需要设0下来; 4:在rtc-xxx.c中shutdowm... 阅读全文

posted @ 2013-12-11 12:12 love so much 阅读(1067) 评论(0) 推荐(0)

unix ourhdr.h myerr.h

摘要: //在学UNIX环境高级编程时把下面两个头文件与源文件放在同一个文件下就可以正常编译了,我的是在ubuntu 12.04环境下,第一个程序编译和运行成功了,希望对大家有帮助(我已经根据网上的资料修改好两个头文件) /* Our own header, to be included *after* all standard system headers */ //ourhdr.h #ifndef__ourhdr_h #define__ourhdr_h #include/* required for some of our prototypes */ #include/* for conve... 阅读全文

posted @ 2013-12-11 12:09 love so much 阅读(472) 评论(0) 推荐(0)

上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 84 下一页

导航