码迷,mamicode.com
首页 >  
搜索关键字:first firstordefault    ( 14152个结果
Ruby 一些经常使用的细节
1.try 永远不会抛出异常 在 没有的时候 返回 nilprovince_id = Province.find_by_name(prov).try(:id)2.find(:first, :condotions) 方法 不言而与mobile_info = MobileInfo.find(:first...
分类:其他好文   时间:2014-11-08 20:50:27    阅读次数:246
STL Sort Algorithm
这个星期看了侯捷先生《STL 源码剖析》算法部分,基本看完了,其中算法比较多,我就重点下Sort在SGI STL中的实现。 1. sort 函数的实现是这样的: template inline void sort(RandomIAccessIterator first , RandomAccessIterator last> { if ( first != last) {...
分类:其他好文   时间:2014-11-08 18:18:19    阅读次数:239
Cocos2d-x Physics 3 - 掉落的头像
添加一个精灵, 让它从高处落下boolHelloWorld::init(){ ////////////////////////////// // 1. super init first if ( !Layer::init() ) { return false; } #if CC_ENABLE_BOX...
分类:其他好文   时间:2014-11-08 18:01:19    阅读次数:192
《代码大全》读后感
最近买了几本经典编程书,有《head first 设计模式》《人月神话》《程序员修炼之道》《代码大全》,《代码大全》是第二本看完的。     看的期间不断有所悟,书中多处让我惊讶「原来是这样子」。不过由于工作之余时间有限,这本大著看了快两个月才完了,现在仅凭印象把之前悟到的写下来,算是总结。     如果要用一句话概括《代码大全》的话,我以为是「为人写代码,而不是机...
分类:其他好文   时间:2014-11-08 16:47:54    阅读次数:187
EntityFramework动态创建模型:System.Reflection.Emit + Code First
动态创建EntityFramework模型并且创建数据库使用System.Reflection.Emit+CodeFirstmodel创建以下的一个实体类和DbContext并且创建数据库: 1 using System; 2 3 public class Blog 4 5 { 6 7 pri...
分类:其他好文   时间:2014-11-08 16:35:16    阅读次数:196
OpenCASCADE BRep vs. OpenNURBS BRep
Abstract. BRep short for Boundary Representation. First give the definition of the BRep, then compare the BRep mode between OpenCASCADE and OpenNURBS....
分类:其他好文   时间:2014-11-08 13:21:09    阅读次数:531
Leetcode-Pascal's Triangle
Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,...
分类:其他好文   时间:2014-11-08 10:23:23    阅读次数:194
UVA 10815 Andy's First Dictionary(字符处理)
Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinking up all the wo...
分类:其他好文   时间:2014-11-08 07:06:02    阅读次数:214
Head First JavaScript:正则表达式的使用
这是在表单与验证章节讲述的知识,根据不同的实例由浅入深的讨论了正则表达式,很具实用性。正则表达式是一种用于匹配文本字符串的字符模式。通常用于对表单的输入数据(如:车牌,电话,邮编,邮箱等)进行验证。正则表达式的字符类型分为元字符和限定字符。元字符包括:. 匹配任何字符(换行符除外)\d 匹配...
分类:编程语言   时间:2014-11-08 00:43:23    阅读次数:218
From Concept to Iterator_traits
template Iterator find(Iterator first, Iterator last, const T& value){ while(first!=last&& *first!=value) ++first; return first;}上面是 C++ 中一个普通的...
分类:其他好文   时间:2014-11-07 23:19:34    阅读次数:325
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!