- 博客(146)
- 资源 (3)
- 收藏
- 关注
转载 Theano安装
deep learning 真滴很头疼,从网上找到了theano的安装方法,转载了过来,谢谢原作者!! 最近研究deep learning,于是装个Theano库,结果今天折腾了好半天,由于安装的python版本比较高(3.3版),网上一些简易的安装方法就不行了,折腾好久,终于发现一种比较简单的安装方法。http://python-distribute.org/distri
2014-08-08 21:27:29
772
原创 git使用
Git版本库:基本流程:(github上传文件基本流程)1.touch README.md2.git init3.git add README.md4.git commit -m "first commit"//添加远程仓库5.git remote add origin https://github.com/cmathx/learngit.git//
2014-06-27 15:30:39
625
原创 vim中配置OpenGL
一.首先从linux环境下开始入手配置,所使用的系统是ubuntu1.首先安装build-essential软件包,sudo apt-get install build-essentiallinux操作系统上面开发程序,光有了gcc 是不行的,它还需要一个build-essential软件包,作用是提供编译程序必须软件包的列表信息。 也就是说编译程序有了这个软件包,它才知道 头文件在哪
2014-02-27 13:37:44
1325
原创 vim学习心得
尝试使用vim有一段时间了,现在总结下有关于vim的学习vim作为程序员的编辑神器,可以提供编辑文本的效率,我觉得主要表现在以下几点:1. 众多的快捷键,使得几乎可以回到terminal的时代,减少鼠标的参与。毕竟鼠标提供的相关功能有限,然与快捷键如果能娴熟使用,速度能显著提高,何况快捷键可以提供众多的功能,使得一些复杂的操作只要一些按键操作就可以完成。2. 丰富的plugin,用于可
2014-02-21 20:48:54
2804
原创 SGI STL内存配置器Allocator
STL配置器(allocator)头文件与基本的函数主要为以下三个头文件:stl_constructor.h,stl_alloc.h,stl_uninitialized.h构造和析构工具:construct()和destroy()这两个函数的实现位于stl_construct.h,用来实现对象的构造和析构construct()和destroy()被实现为全局函数 #ifnd
2014-01-24 22:15:03
993
原创 cmake学习资料整理
相关网址:cmake学习笔记一:http://blog.csdn.net/dbzhang800/article/details/6314073几个简单的实例入门cmake学习笔记二:http://blog.csdn.net/dbzhang800/article/details/6329068介绍cmake的相关语法和命令使用cmake学习笔记三:http://blog.cs
2013-11-27 20:03:54
1462
原创 STL之hash_map总结
一.需要加载的头头文件和命名空间第一种用法:(SGI STL中,linux中g++采用此种STL标准)#include using namespace __gnu_cxx;已经定义的hash Function:struct hashstruct hashstruct hash struct hash struct hashstruct has
2013-10-27 10:31:40
1315
原创 STL—map之总结
一.map的原型1.maptemplate class map {...}2.multimaptemplate class multimap {...}由此可以看出我们可以根据需要自定义compare Function二.自定义compare Function2.1重载2.1.1以成员函数方式去重载inline bool
2013-10-27 10:25:58
693
原创 1057. Stack
题目限定数的范围N关键点:构建树状数组可以求解前n个数的和由此push和pop时要维护树状数组,当需要求解median时,使用二分法由此总的算法复杂度为O(N*logN+N*logn*logN)=O(N*logN*logN)// 1057. Stack (30).cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #in
2013-10-14 23:41:39
629
原创 poj2299
// poj2299逆序对_树状数组.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;const int N = 500003;typedef struct Node{ int value; int no; int tag;}Node;Node node[N],
2013-10-14 21:11:29
655
原创 1068. Find More Coins
01背包问题(1)排序数据为降序(2)背包处理// 1068. Find More Coins.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include #include using namespace std;#define max(a, b) ((a) > (b) ? (a) :
2013-10-10 19:59:52
1178
原创 1067. Sort with Swap(0,*)
好弱啊,这个题目折腾了好久。构造hash表用来维护各个元素所在的位置,利用map维护一颗红黑树来保存还未确定的元素的位置。(1)用0不断的跟其他元素交换,每次交换都会保证一个元素在正确的位置。(2)交换的过程中可能使得元素0到第0个位置,此时用0与某个还未在正确位置的元素交换。循环(1)(2)直至所有元素都在正确的位置。出现(2)这种情况的最大次数可能N,因为出现一次这种情况,
2013-10-10 19:52:37
792
原创 1065. A+B and C (64bit)
这题挺有意思的// 1065. A+B and C (64bit).cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include using namespace std;int main(){ long long a, b, c; int n; cin >> n; for(int i = 1; i <= n; i++){ c
2013-10-10 19:42:51
1102
原创 5-05. QQ帐户的申请与登陆STL
STL map的使用(红黑树)// QQ帐户的申请与登陆.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;map cmap;int _tmain(int argc, _TCHAR* argv[]){ int n; scanf("%d", &
2013-07-07 17:21:04
785
原创 1060. Are They Equal
// 1060_Are_They_Equal.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include const int N = 303;void simplifyFloatNum(int n, char *str, int *dig, int
2013-07-07 16:44:37
728
原创 1059. Prime Factors
筛素数法,分解因式// 1059_Prime_Factors.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include const int N = 31650;bool prime[N];void selectPrime(){ prime
2013-07-07 16:43:58
798
原创 MFC中的四大类宏
DECLARE_DYNAMIC和IMPLEMENT_DYNAMIC(运行时类型识别宏)DECLARE_DYNCREATE和IMPLEMENT_DYNCREATE(动态生成宏)DECLARE_SERIAL和IMPLEMENT_SERIAL(永续生存宏)DECLARE_MESSAGE_MAP和BEGIN_MESSAGE_MAP,ON_COMMAND,END_MESS
2013-06-03 09:09:35
991
原创 深入浅出MFC学习笔记:MFC六大关键技术仿真之MFC程序的初始化过程
MFC程序的初始化过程参考文献:深入浅出MFC-侯捷下面交代主要的类:下面列出主要的类和一些重要的函数:程序的流程如下:总结起来如下:
2013-06-03 08:46:04
1025
原创 深入浅出MFC学习笔记:MFC六大关键技术仿真之消息映射和消息流动
消息映射参考文献:深入浅出MFC-侯捷定义数据结构:数据结构图解:(头文件中消息映射的实现部分DECLARE_MESSAGE_MAP)实现文件中消息映射的实现部分(BEGIN_MESSAGE_MAP,ON_COMMAND,END_MESSAGE_MAP)因此各类可以进行如下声明:最终会形成一个消息流动网络
2013-06-02 22:52:10
850
原创 深入浅出MFC学习笔记:MFC六大关键技术仿真之永续生存
永续生存MFC中很重要的一个模块:负责实现资料的读写过程,即数据该怎么去保存到硬盘中和从硬盘中取出来。参考文献:深入浅出MFC-侯捷对象导向有一个术语:Persistence,有了此机制之后,对象就能永续保存。MFC有一套Serialize机制,目的在于把档名的选择,文件的开关,缓冲区的建立,资料的读写,萃取运算子(>>)和嵌入运算子(文档的写过程,只要把其中的成员变量依次写进
2013-06-02 19:34:16
963
原创 深入浅出MFC学习笔记:MFC六大关键技术仿真之动态生成
动态生成参考文献:深入浅出MFC-侯捷开始着手剖析动态生成的实现有了类别型录网,就可以开始着手解决棘手的动态生成问题。动态生成的困难点在于你没有办法在程序执行期间,根据动态获得的一个类别名称(通常是读档),要求程序产生一个对象。如果我们能够把类别的大小记录在类别型录中,把构造函数(CruntimeClass::CreatObject)也记录在类别型录中,当程序在执行期间获得一个类别名称
2013-06-01 09:41:21
767
原创 深入浅出MFC学习笔记:MFC六大关键技术仿真之RTTI运行时类型识别
RTTI(运行时类型识别) 参考文献:深入浅出MFC-侯捷怎样去构造类别型录网?一、定义数据结构:其中pFirstClass指针属于痊愈变量,所以它应该以static修饰之。而且我们最终希望达到以下这样子的效果:构造成如下的类别型录 二、具体做法:1.在头文件和cpp文件中放入两个神奇的宏: (1)DECLARE宏的定义
2013-05-31 21:20:24
946
原创 动态规划之矩阵链乘法
学习算法导论:对于矩阵A(2,3)*B(3,5)其运算次数为2*3*5;对于矩阵A(2,3)*B(3,5)*C(5,4)存在两种运算结合顺序,运算次数分别为2*3*5+2*5*4=70以及3*5*4+2*3*4=84,显然运算次数不同。给定一系列矩阵A1A2A3...An,由于矩阵乘法符合结合律,所以不同的结合顺序,运算效率完全不同,求出运算效率最高的结合顺序。枚举法:假设
2013-05-22 13:44:11
1969
原创 1057. Stack
一.浙大机试:stack,动态维护一个栈中的中位数。时间限制:10ms,命令行cmd的条数N引入red-black Tree,由于red-black Tree的insert,delete,search操作时间均为O(lgn),从而可由此下手开始解决。代码如下:繁琐的地方在于怎么利用两颗红黑树动态维护前(n+1)/2个数和后(n+1)/2个数// 1057. Stack.cpp : 定义控制台应
2013-05-17 10:17:22
827
原创 socket 单步调试正确,F5调试错误,运行也错误的解决方案
引用icansaymyabc的话语:解决方案如下socket程序是与操作系统紧密相关的,它异步调用了各种系统资源。你的问题我见得多了,实质上就是在socket的异步操作尚未得到应答之前你的单线程工作流已经把socket对象销毁了。单步调试之所以成功是因为你在每一个语句执行完后给了很大的停顿,使得socket对象在被销毁前有机会干完工作。解决办法1:把你的源程序每个语句之后加一条
2013-04-16 23:53:39
1234
原创 1056. Mice and Rice
好奇怪的表达方式,这道题的英文给跪了第三行的序列居然是给出依次要进行比较的老鼠的标号。11 325 18 0 46 37 3 19 22 57 56 106 0 8 7 10 5 9 1 4 2 3先比较第6,0,8号老鼠,此为第一组,7,10,5为第二组,后面类推...机试这样子考察英文// 1056. Mice and Rice.cpp: 主项目文件。#in
2013-03-27 21:55:03
1194
原创 题目1494:Dota
学习完全背包// 题目1494:Dota.cpp: 主项目文件。#include "stdafx.h"#include #include #define max(a,b) a>b?a:bconst int N=203;int value[N],volumn[N];const int M=1003;int dp[M];int main(){ int n,m,to
2013-03-24 23:02:46
578
原创 1051. Pop Sequence
// 1051. Pop Sequence.cpp: 主项目文件。#include "stdafx.h"#include #include using namespace std;stack S;int stackMaxSize,arrMaxSize;void readRemain(int rem){ int temp; for(int i=0;i<rem;i++) s
2013-03-24 20:01:22
476
原创 1037. Magic Coupon
Two arrays:NC[],NP[]Supposed that two points (l1 and r1)start from the head and the tail of the array of NC seperately,in a similar way,exists two points(l2 and r2)points to the the head and end of
2013-03-15 12:26:47
492
原创 1019. General Palindromic Number
// 1019. General Palindromic Number.cpp: 主项目文件。#include "stdafx.h"#include bool isPalindromic(int *arr, int length){ for(int i=0,j=length-1;i<=j;i++,j--){ if(arr[i]!=arr[j]) return false;
2013-03-15 11:20:52
529
原创 1012. The Best Rank
// 1012. The Best Rank.cpp: 主项目文件。#include "stdafx.h"#include #include #include using std::sort;const int N=10003;typedef struct Stu{ char id[8]; int A,C,M,E; int rank[4];}Stu;Stu stu[N]
2013-03-15 10:37:31
634
原创 1011. World Cup Betting
// 1011. World Cup Betting.cpp: 主项目文件。#include "stdafx.h"#include char getKey(int pos){ if(pos==0) return 'W'; else if(pos==1) return 'T'; else return 'L';}int main(){ double res=1.0;
2013-03-15 09:22:05
674
原创 1008. Elevator
// 1008. Elevator.cpp: 主项目文件。#include "stdafx.h"#include int main(){ int n; scanf("%d",&n); int sum=sum=5*n,pre=0; for(int i=0;i<n;i++){ int temp; scanf("%d",&temp); if(temp>pre)
2013-03-15 09:05:25
713
原创 1031. Hello World for U
// 1031. Hello World for U.cpp: 主项目文件。#include "stdafx.h"#include #include int main(){ int n1,n2; const int N=83; char ss[N][N],str[N]; for(int i=0;i<N;i++) for(int j=0;j<N;j++) ss[
2013-03-14 23:46:05
560
原创 题目1347:孤岛连通工程
http://ac.jobdu.com/problem.php?pid=1347用getchar读取数据居然可以少这么多,比起scanf整整少了320ms并查集优化:(1)路径压缩我们找到最久远的祖先时“顺便”把它的子孙直接连接到它上面int findSet(int x){ if(fa[x]==-1) return x; int ret=findSet(fa[x])
2013-03-14 18:42:30
548
原创 1034. Head of a Gang
study disjoint-set data stucture:the key of solving this problem is the strategy to set and compute every equivalence class‘s member numbers.// 1034. Head of a Gang.cpp: 主项目文件。#include "stdafx.h"
2013-03-14 17:13:57
768
原创 1032:Sharing
To find the first common node on the two link list;// 题目1468:Sharing.cpp: 主项目文件。//#include "stdafx.h"#include #include using namespace std;const int N=100003;typedef struct Node{ int ad
2013-03-14 10:17:00
917
原创 1033. To Fill or Not to Fill
cars refueling problem:with greedy algorithmgo tohttp://blog.csdn.net/newner/article/details/8637065
2013-03-14 10:13:01
708
原创 1025. PAT Ranking
//sort// 1025. PAT Ranking.cpp: 主项目文件。#include "stdafx.h"#include #include #include using namespace std;const int N=30003;struct Info{ char id[14]; int score; int belongs,vRank; int rank;
2013-03-14 10:08:02
732
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人