码迷,mamicode.com
首页 >  
搜索关键字:Once    ( 2791个结果
C#/.NET Little Wonders: Use Cast() and OfType() to Change Sequence Type(zz)
Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easie...
分类:Web程序   时间:2014-07-16 23:25:24    阅读次数:601
【剑指offer】Q40:数组中出现一次的数
书里面关于分类的判断有些麻烦,通过某一位为0为1来对数组元素进行分类。假如第3位为1,那么也就是元素x & 8 等于或不等于0,所以没必要非的用第几位去判断。 def once(array): reOR = 0 for x in array: reOR ^= x bit1 = firstBit1(reOR) first = 0 second = 0 for x in a...
分类:其他好文   时间:2014-07-03 13:54:06    阅读次数:182
State Design Pattern 状态设计模式
设置好内部状态,然后根据不同的函数作为行为模式,进行状态转换。 有点像Finite Automata算法,两者的思想是一样的。 会Finite Automata,那么这个设计模式就很容易了。 #pragma once #include #include #include #include enum STATES { FULLY_RENTED, WAITING, GOT_A...
分类:其他好文   时间:2014-07-02 16:50:26    阅读次数:225
[leetcode] Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
分类:其他好文   时间:2014-07-02 00:33:49    阅读次数:204
log4net配置和获取ILog实例
名称描述File文件路径,如果RollingStyle为Composite或Date,则这里设置为目录,文件名在DatePattern里设置,其他则这里要有文件名。已经扩展支持虚拟目录RollingStyle创建新文件的方式,可选为Size(按文件大小),Date(按日期),Once(每启动一次创建...
分类:Web程序   时间:2014-07-01 23:59:16    阅读次数:449
《deetom》项目开发历程<五> PHP邮件
邮件类库是从github下载的简单好用; protected function sendEmail($emailAddress,$realname,$token,$title,$do){ include_once APP_ROOT . 'doitphp/modules/phpmaile...
分类:Web程序   时间:2014-07-01 23:30:19    阅读次数:380
LeetCode——Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with...
分类:其他好文   时间:2014-06-30 17:22:13    阅读次数:196
[leetcode] Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
分类:其他好文   时间:2014-06-27 12:30:03    阅读次数:200
Substring with Concatenation of All Words
题目 You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once an...
分类:其他好文   时间:2014-06-27 10:24:26    阅读次数:219
POJ 3624 Charm Bracelet 背包题解
最简单的背包问题了,本题应该除了背包就一个考点了:不能开二维数组。我没开过二维,不过看数据是不可以的。太大了。 做法有两种改进省内存DP: 1 所谓的滚动数组 2 逆向填表 很久没做背包DP,突然觉得这种背包问题很简单了。 下面给出两种解法: 1 calBag()是滚动数组 2 calBag2()是逆向填表 #pragma once #include #inclu...
分类:其他好文   时间:2014-06-27 08:09:43    阅读次数:165
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!