- 博客(98)
- 资源 (13)
- 收藏
- 关注
原创 算法导论 经典算法实现 quicksort
#include using namespace std;//int Partition(int A[], int p,int r){ int x = A[r]; int i = p - 1; for(int j = p; j<r; j++){ if (A[j] <= x){ i = i + 1; swap(A[i],A[j]); } } swap(A
2017-09-29 13:30:00
322
原创 关于ubuntu的环境变量
关于ubuntu的一些环境变量的设置以下几个文件均对环境变量有过影响 * /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置. * /etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取. * ~/.bash_p
2017-03-21 11:20:54
374
原创 汇编语言一些常用变量
汇编语言里 eax, ebx, ecx, edx, esi, edi, ebp, esp 等近期在学习计算机体系结构安全方向,不得不使用汇编代码, 对于经常使用的一些常见汇编代码给予一定的解释。(稍后,再继续添加) eax, ebx, ecx, edx, esi, edi, ebp, esp等都是X86 汇编语言中CPU上的通用寄存器的名称,是32位的寄存器。如果用C语言来解释,可以把这些寄存器当
2017-03-20 16:58:33
1089
原创 centos将普通用户设置sudo权限
centos将普通用户设置sudo权限linux下一只使用su成为root用户进行操作是非常危险的,最好是在需要root权限的时候用root,其他时候使用普通的用户权限,这里简单简介在centos下如何让普通用户可以通过sudo命令使用root的权限执行相关的命令。一般情况下,centos安装后会有一个普通的用户,你会发现此事无法使用sudo命令,解决的方法是: su输入root密码进入ro
2017-03-05 22:41:44
887
原创 leetcode two sum
题目 class Solution(object): def twoSum(self, nums, target): “”” :type nums: List[int] :type target: int :rtype: List[int] “”” for i in range(l
2017-03-01 13:40:51
260
原创 如何在一个机器上针对不同的项目需求使用不同的pyhon版本和包
关于如何在一个机器上针对不同的项目需求使用不同的pyhon版本和包推荐使用virtualenv它可以做到:一不污染本机的环境 ,二:有时候在本机安装的时候需要超级权限问题安装的过程非常简单,使用pip即可 pip install virtualenv 如果是使用的python3版本的话 pip3 install virtualenv使用过程可以查看 教程
2017-03-01 13:22:02
355
原创 #关于在heroku部署django 项目时,使用postgresql数据使用
关于在heroku部署django 项目时,使用postgresql数据使用配置数据库Heroku以扩展的方式支持Postgres数据库,只是有些限制而已,正如前面所说。这里我们就使用Postgres数据库,这也意味着,你需要在你的Web应用源代码中添加相应的数据库路径,这个我们待会再说。使用下面的命令配置数据库:alan@alan-pc:~/git-for-fun/$ heroku
2017-03-01 13:05:15
1110
1
原创 python vim编辑器配置文件
#!/bin/bashecho "install simple_vim_setting"echo "---------------------------------"echo "install supporting tools.."if which apt-get >/dev/null; then sudo apt-get install -y vim ctags xclip a
2016-08-13 18:02:22
425
转载 在UBUNTU 10.04下安装GTK 2.20.1。
我利用此方法成功在UBUNTU 10.04下安装GTK 2.20.1。一、安装 1、安装gcc/g++/gdb/make 等基本编程工具$sudo apt-get install build-essential 2、安装 libgtk2.0-dev libglib2.0-dev 等开发相关的库文件$sudo apt-get install gnome
2015-09-28 22:22:20
413
原创 linux系统下载:Ubuntu 14.10 ISO 正式版镜像文件
GO TO THIS WEBSITE;http://www.osetc.com/archives/978.html
2015-08-13 20:19:25
11000
原创 linux apt-get 之LAMP架设
打开终端:1.sudo apt-get install tasksel2.sudo tasksel install lamp-server之后搞定
2015-08-08 21:14:05
358
翻译 About Longest Palindromic Substring
LeetCode 上牛人写的非常的详细,大家都学习一下吧原文:http://articles.leetcode.com/2011/11/longest-palindromic-substring-part-i.htmlGiven a string S, find the longest palindromic substring in S.This interest
2015-05-18 13:10:00
470
原创 关于 ++i 比i++ 快
在运算符重载中,++被重载前置和后置的粒子如下:CDemo CDemo::operator++(){ n++;return *this;}//前置CDemo CDemo::operator++(int k){ CDemo tmp(*this); n++; return tmp;} 后置的“++“要多生成一个局部的对象t
2015-04-28 18:44:25
694
原创 数据结构_单链表
#include #include #include #include using namespace std;typedef int ElemType;typedef struct LNode{ ElemType data; struct LNode *next;}LNode,*LinkList;int GetElem_L(LinkList L,int i,Ele
2015-04-28 09:03:36
325
原创 数据结构_折半查找
#include #include #include using namespace std;#include typedef int ElemType;typedef struct Node{ int id; ElemType data;}A;A a[100];bool cmp(A a,A b){ return a.data<b.data;}
2015-04-26 15:12:47
503
原创 数据结构_线性表
#include #include #include using namespace std;#define LIST_INIT_SIZE 100#define LISTINCREMENT 10typedef int ElemType;typedef struct{ ElemType *elem; //线性表的基地址 int length; //当前长度
2015-04-25 21:11:05
298
原创 数据结构_快速排序算法
#include //#include using namespace std;/*方法一:int Partion(int a[],int low,int high){ int pivotkey=a[low]; while(low<high) { while(low=pivotkey) { --high;
2015-04-25 18:59:04
384
翻译 消除VC 中的 Browser Info 警告
编译 Warning:“Compiler option 'Generate Browser Info' inconsistent with precompiled header;current command-line option will override that defined in the precompiled header”。并且没有运行出来的程序:解决方法:
2015-03-20 22:17:24
896
原创 mfc编程时相让鼠标的坐标显示在状态栏上
在CXXview 类中添加OnMouseMove鼠标映射函数在函数中添加以下代码:void CPointView::OnMouseMove(UINT nFlags, CPoint point) {// TODO: Add your message handler code here and/or call default CString str; str.Format
2015-03-20 22:13:44
547
原创 多边形画圆 vc6.0+opengl
#include #include void Drawing();void Init();void Display();void Reshape(int,int);void DrawNGon(float,float,float,int,float=90,bool=false);void main(int argc,char **argv){ glutInit(&argc,ar
2014-11-29 18:00:34
1400
原创 hdu 2114
Calculate S(n)Time Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7961 Accepted Submission(s): 2923Problem DescriptionCalculate
2014-10-29 18:28:14
420
原创 hdu 2063
过山车Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11491 Accepted Submission(s): 5056Problem DescriptionRPG girls今天和大家一起去游乐场玩
2014-10-28 20:40:37
368
原创 HDU 1228(简单的字符处理)
A + BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12190 Accepted Submission(s): 7130Problem Description读入两个小于100的正整数A和B,计算
2014-10-27 16:58:16
325
原创 HDU 1556(树状数组)
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9755 Accepted Submission(s): 5020Problem DescriptionN个气球排成一排,从左
2014-10-27 16:53:15
311
原创 HDU 1267(简单的动态规划)
下沙的沙子有几粒?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2844 Accepted Submission(s): 1491Problem Description2005年11月份,我们学校参加
2014-10-27 16:48:05
547
原创 HDU 1051(贪心)
Wooden SticksTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12179 Accepted Submission(s): 5050Problem DescriptionThere is a
2014-10-27 16:42:06
310
原创 HDU 1042 (大数)
N!Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 56027 Accepted Submission(s): 15904Problem DescriptionGiven an integer N(0
2014-10-27 16:37:29
320
原创 hdu 1789
Doing Homework againTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6879 Accepted Submission(s): 4097Problem DescriptionIgnat
2014-10-27 16:34:49
312
原创 hdu 1850(妮姆博奕)
Being a Good Boy in Spring FestivalTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4832 Accepted Submission(s): 2887Problem Descr
2014-10-22 14:52:57
706
原创 hdu 1847(博弈)
Good Luck in CET-4 Everybody!Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5489 Accepted Submission(s): 3531Problem Description
2014-10-22 14:41:37
344
原创 HDU 1849(尼姆博弈)
Rabbit and GrassTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2200 Accepted Submission(s): 1669Problem Description大学时光是浪漫的,
2014-10-22 14:35:09
346
原创 hdu 1846 (博弈)
Brave GameTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6808 Accepted Submission(s): 4580Problem Description十年前读大学的时候,中国每年都
2014-10-22 14:34:21
368
原创 HDU 1848 (SG)
Fibonacci again and againTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5365 Accepted Submission(s): 2250Problem Description
2014-10-22 14:30:37
398
原创 Hdu 2079 (母函数应用)
选课时间(题目已修改,注意读题)Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2962 Accepted Submission(s): 2322Problem Description又到了选课的时间了
2014-10-21 20:48:48
394
原创 HDU 1250(JAVA版)
Hat's FibonacciTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7854 Accepted Submission(s): 2551Problem DescriptionA Fibonacc
2014-10-20 16:49:31
400
原创 HDU 1250
Hat's FibonacciTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7847 Accepted Submission(s): 2549Problem DescriptionA Fibonacc
2014-10-19 22:02:28
327
原创 opengl bezier曲线的实现
#include #include #include #include #include using namespace std;struct Point{ int x,y;};Point pt[4],bz[11];vector vpt;bool bDraw;int nInput;void CalcBZPoints(){ float a0,a1,a2
2014-10-18 12:35:07
596
原创 codeblocks + opengl DDA算法
直线的DDA算法#include #include #include #include #include #include int getValue(){ //scanf("%d %d %d %d",&x1,&y1,&x2,&y2); int k; scanf("%d",&k); return k;}void MyInit(){
2014-09-20 21:54:13
503
原创 poj 1258
Agri-NetTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 40639 Accepted: 16578DescriptionFarmer John has been elected mayor of his town! One of his campa
2014-09-16 12:58:10
438
原创 poj 2485
HighwaysTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 22691 Accepted: 10459DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately,
2014-09-16 12:30:40
391
linux0.01版源码和中文教材
2015-08-13
《数据结构与算法(C++版)实验和课程设计教程》实例源代码
2015-05-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人