10 2015 档案

摘要:Negative Indexes(负索引) Getting Sublists with Slices • spam[2] is a list with an index (one integer).• spam[1:4] is a list with a slice (two integers). 阅读全文
posted @ 2015-10-29 10:06 Master HaKu 阅读(286) 评论(0) 推荐(0) 编辑
摘要:MapTest.cpp#include #include #include #include #include "MapTest.h"using namespace std;void MapTest::simpleEnumeration(){ map coll { { "tim... 阅读全文
posted @ 2015-10-28 14:15 Master HaKu 阅读(151) 评论(0) 推荐(0) 编辑
摘要:RuntimeCmp.hpp#include using namespace std;// type for runtime sorting criterionclass RuntimeCmp {public: enum cmp_mode { normal, reverse };private... 阅读全文
posted @ 2015-10-26 11:08 Master HaKu 阅读(357) 评论(0) 推荐(0) 编辑
摘要:1. 简单的if/else条件判断 judge_flow.py 运行结果: Please input name: davidInvalid user! Please input name: masterHello MasterPlease input password: aaaWrong passw 阅读全文
posted @ 2015-10-24 14:50 Master HaKu 阅读(359) 评论(0) 推荐(0) 编辑
摘要:MultiSet根据特定排序准则,自动将元素排序。MultiSet允许元素重复。一些常规操作:MultiSetTest.cpp#include #include #include #include #include #include "MultiSetTest.h"using namespace s... 阅读全文
posted @ 2015-10-22 09:55 Master HaKu 阅读(233) 评论(0) 推荐(0) 编辑
摘要:Set根据特定排序准则,自动将元素排序。Set不允许元素重复。一些常规操作:SetTest.cpp#include #include #include #include #include #include "SetTest.h"using namespace std;void SetTest::op... 阅读全文
posted @ 2015-10-21 20:56 Master HaKu 阅读(233) 评论(0) 推荐(0) 编辑
摘要:1. 什么是视图控制器(View Controller)简单来说,视图控制器用来管理你所有的视图。他们是你的视图和模型的粘合剂。如果你做过MVC的Web项目,我想你应该不会对它感到陌生。2. 视图控制器的声明周期MethodDescriptionloadView 创建并返回一个视图控制器的视图vi... 阅读全文
posted @ 2015-10-21 10:42 Master HaKu 阅读(194) 评论(0) 推荐(0) 编辑
摘要:forward list是一个行为受限的list, 不能走回头路。它只提供前向迭代器, 而不提供双向迭代器。eg:rbegin(), rend(), crbegin(), crend()这些都不提供。它不提供size()成员函数。没有指向最末元素的anchor, 因此不提供back(), push_... 阅读全文
posted @ 2015-10-19 15:10 Master HaKu 阅读(278) 评论(0) 推荐(0) 编辑
摘要:List内部结构完全不同于array, vector, deque。它提供了两个pointer,指向第一个和最后一个元素。不支持随机访问元素,因此要访问第n个元素必须爬过n - 1个元素。在任何位置上执行元素的插入和删除操作都很快。因此会有一些属于list的特殊类型操作,比如merge, splic... 阅读全文
posted @ 2015-10-16 10:41 Master HaKu 阅读(155) 评论(0) 推荐(0) 编辑
摘要:Deque和Vector类似,只不过deque头尾都开放,能够在头尾进行快速插入和删除操作DequeTest.cpp#include #include #include #include #include #include "DequeTest.h"using namespace std;void ... 阅读全文
posted @ 2015-10-14 10:13 Master HaKu 阅读(142) 评论(0) 推荐(0) 编辑
摘要:VectorTest.cpp#include #include #include #include #include #include "VectorTest.h"using namespace std;void VectorTest::simpleOperation(){ // create... 阅读全文
posted @ 2015-10-13 10:20 Master HaKu 阅读(294) 评论(0) 推荐(0) 编辑
摘要:Array是C++ 11给STL新增加的容器ArrayTest.cpp#include #include #include #include #include "../../Core/print.hpp"#include "ArrayTest.h"using namespace std;void A... 阅读全文
posted @ 2015-10-12 16:40 Master HaKu 阅读(185) 评论(0) 推荐(0) 编辑
摘要:服务端:hello_server.c#include #include #include #include #include #include void error_handling(char *message);int main(int argc, char *argv[]){ int se... 阅读全文
posted @ 2015-10-08 14:10 Master HaKu 阅读(14892) 评论(0) 推荐(0) 编辑
摘要:A lambda expression is an unnamed block of code (or an unnamed function) with a list of formal parameters and abody.Java8中的lambda表达式不同于C#,使用的是->eg:// ... 阅读全文
posted @ 2015-10-06 14:18 Master HaKu 阅读(279) 评论(0) 推荐(0) 编辑
摘要:给程序加上控制台菜单menu.pyimport sysfrom notebook import Notebook, Noteclass Menu: '''Display a menu and respond to choices when run.''' def __init__(sel... 阅读全文
posted @ 2015-10-05 11:50 Master HaKu 阅读(651) 评论(0) 推荐(0) 编辑
摘要:notebook.pyimport datetimelast_id = 0class Note: '''Represent a note in the notebook. Match against a string in searches and store tags for each... 阅读全文
posted @ 2015-10-05 10:26 Master HaKu 阅读(881) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示