自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

小浦原的技术专栏

走向编程之路

  • 博客(69)
  • 资源 (16)
  • 收藏
  • 关注

原创 find_appear_once

pair find_appear_once(const int data[],int size) {  int xor_two = 0;  int i;  for (i=0;i    xor_two ^= data[i];  }  ///*  int flag = 0x01;  while ((flag & xor_two) == 0)    flag

2012-07-16 19:51:06 627

原创 PageRank

2012-07-16 15:56:52 516

原创 TCP

2012-06-29 13:47:33 503

原创 _strtok

char* _strtok(char *s, const char *dm){ static char *last; char *tok; const char* pdm=dm; if(s == NULL) s = last; if(s == NULL) return NULL; tok = s; while

2012-05-29 15:54:01 537

原创 IsBalanced

bool IsBalanced(BinaryTreeNode* pRoot, int* pDepth){ if(pRoot == NULL) { *pDepth = 0; return true; } int left, right; if(IsBalanced(pRoot->m_pLeft, &left)

2012-05-21 10:57:40 741

原创 adsort

//ShellSort 希尔排序void ShellSort(int Data[],int n){ int i,j,gap; int temp; gap=n/2; while(gap>0) { for(i=gap;i<n;i++) { temp=Data[i]; j=i-gap; while(j>=0 && temp<D

2012-05-13 10:54:46 581

原创 void CBTInsert(BTNode *tree, BTNode *new_node)

void CBTInsert(BTNode *tree, BTNode *new_node){ int llcnt(0),lrcnt(0),rrcnt(0); BTNode *lch,*rch,*p,*lb; if(tree->lchild==NULL)//insert tree->lchild=new_node; else if(tree->rc

2012-05-01 22:24:51 1251

原创 ConvertBST2DoubleList

void Convert(Node * r,Node * & first,Node * & last){ Node *firstL,*lastL,*firstR,*lastR; if(r==NULL) return; Convert(r->left,firstL,lastL); Convert(r->right,firstR,lastR);

2012-02-22 13:44:17 450

原创 bit_map

unsigned char flags[1000];int getv(int idx){ int i=idx>>3; int j=idx&0x7; //return ((flags[i]&(0x1>j); return ((flags[i]>>j)&0x01);}int setv(int idx){ int i=idx>>3; int

2012-02-22 13:20:04 587

原创 findMaxDistance

int BTNodeDepth(BTNode *b){ int lchilddep,rchilddep; if(b==NULL) return 0; else { lchilddep=BTNodeDepth(b->lchild); rchilddep=BTNodeDepth(b->rchild); r

2012-02-17 20:16:27 718

原创 abc

C++语言: static int dictExpand(dict*ht,unsigned long size) {    dict n; /* the new hashtable */    unsigned long realsize= _dictNextPower(size),i;    /* the size is invalid if it

2012-02-16 11:22:33 547

原创 CreateBTfromPre

BTNode *CreateBTfromPre(char *pre,char *in,int n,int m){ BTNode *s; char *p,*q,*minp; int minpre,minin ,k; if(n<=0) return NULL; minpre=m+1; for(p=in;p<in+n;p++) for(q

2012-02-15 16:52:59 697

原创 insertNew

void insertNew(BTNode *tree, BTNode *new_node){ int llcnt(0),lrcnt(0),rrcnt(0); BTNode *lch,*rch,*p,*lb; if(tree->lchild==NULL)//insert tree->lchild=new_node; else if(tree->rc

2012-02-15 15:46:44 615

原创 CreatBT

BTNode *CreatBT(char *post,char *in,int n,int m){ BTNode *s; char *p,*q,*maxp; int maxpost,maxin ,k; if(n<=0) return NULL; maxpost=-1; for(p=in;p<in+n;p++) for(q=post;q<post+m;q++) if(*p==

2012-02-15 14:31:38 607

原创 find_mid

int find_mid( int *a, int *b, int length){ if (length == 1)//这里应该根据中位数的定义取大小 return a[0]<b[0]?a[0]:b[0]; int i = length/2; if (a[i] == b[i]) return a[i]; else if (a[i

2012-02-15 14:04:34 546

原创 find_seq

int cnt(0);int howmany(0);void find_seq(int A1, int n, int sum){ howmany++; int tmp=(A1+(n-1)/2.0)*n; if(tmp > sum) return; else if(tmp==sum) { cout<<"the seque

2012-02-15 14:01:07 581

原创 Android手机平台的软件管家

看到了 第二届 Google 暑期大学生博客分享大赛 - 2011 Android 成长篇 觉得还是很有意义的,借助这种大赛的形式,在广大用户之间做推广,应该会起到不错的效果。在信息高度发达、Android如日中天的今天,恐怕还少有在校学生没听说过Android吧。现在回想一下首

2011-07-27 11:17:35 1384

原创 Django+Python+GoogleAppEngine+HTML/XHTML+CSS = WEB APP

<br />(自己根据网上的各种资料总结了一个简洁有效的版本,希望能对这方面的新手有帮助)<br />In this tutorial I will show you how to get a simple datastore-backed Django application up and running on the Google App Engine. I will assume that you are somewhat familiar with Django and Python.<br /><

2010-07-11 16:51:00 1232

原创 WSGI

<br />  什么是WSGI?  WSGI is the Web Server Gateway Interface.  It is a specification for web servers and application servers to communicate with web applications (though it can also be used for more than that).  WSGI是Python应用程序或框架和Web服务器之间的一种接口,已经被广泛接受

2010-07-01 22:14:00 560

原创 ORM

<br />什么是ORM?  对象关系映射(ORM)提供了概念性的、易于理解的模型化数据的方法。ORM方法论基于三个核心原则:  简单:以最基本的形式建模数据。  传达性:数据库结构被任何人都能理解的语言文档化。  精确性:基于数据模型创建正确标准化了的结构。  典型地,建模者通过收集来自那些熟悉应用程序但不熟练的数据建模者的人的信息开发信息模型。建模者必须能够用非技术企业专家可以理解的术语在概念层次上与数据结构进行通讯。建模者也必须能以简单的单元分析信息,对样本数据进行处理。ORM专门

2010-07-01 22:11:00 488

原创 Using Django with Appengine

Using Django with AppengineAuthor: Shabda RaajVersion: 1Copyright: This document is released under a Creative Common Attribution license.Contents * About * What will we build * Downloading Django, and Appengine * Getting Help

2010-07-01 21:28:00 788

原创 emacs配置文件之备份(2)

(custom-set-variables  ;; custom-set-variables was added by Custom.  ;; If you edit it by hand, you could mess it up, so be careful.  ;; Your init file should contain only one such instance.  ;; If there is more than one, they won't work right. '

2010-06-29 09:27:00 512

原创 emacs配置文件之备份(1)

<br />(custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work righ

2010-06-12 18:31:00 563

原创 先从Karrigell学起

是的,Karrigell不错的python web应用框架。学习一下。。。

2010-05-29 23:29:00 588

原创 emacs配置文件之备份

(custom-set-variables(column-number-mode t);显示列号;(display-time-mode t)(size-indication-mode t)(transient-mark-mode nil)(global-linum-mode t)(cua-mode nil)(show-paren-mode t nil (p

2010-05-29 23:14:00 1538

原创 More Effective C++ 读书笔记 之 不以多态方式处理数组

最关键的问题是派生类和基类的大小可能不一致。这样两种类型的数组的元素间距(也就是元素大小)就不同。另外,C++标准中规定:通过基类指针删除一个由派生对象构成的数组,其结果未定义。 结论:由于多态和指针算术不能混合运用,而数组对象几乎总是涉及指针的算术运算,所以数组和多态不应混合使用。

2010-05-17 08:27:00 560

原创 More Effective C++ 读书笔记 之 C++转型操作符

取代旧式C的:static_cast改变常量性的:const_cast用于继承体系的:dynamic_cast还有一个:reinterpret_cast,与编译平台有关,常用于转换函数指针类型。 

2010-05-17 08:19:00 482

原创 今天明白了一点模板函数的事情

下面这个代码出错: //test.htemplatevoid fun(T x);   //test.cpp#include "test.h"templatevoid fun(T x){ std::cout<<x<<std::endl;}   //main.cpp#include#include "test.h"int ma

2010-05-17 07:16:00 572

转载 学习GDB[转]

学习使用 GNU GDB Debugger                                              作者:王聪GDB 常用命令参考手册GDB 命令行参数GDB 命令GDB 操作提示GDB 相关手册相关链接 1 GDB 命令行参数启动 GDB:gdb ex

2010-05-13 11:01:00 794

转载 学习GCC[转]

 学习 GNU Compiler Collection                                                   作者:王聪来源:www.zeuux.orgGCC 的使用GCC 常用选项其它 GCC 选项相关书籍相关链接1 GCC的使用GCC 编译过程示意图:用法: g

2010-05-13 10:25:00 561

原创 More Effective C++ 读书笔记 之 区别pointer和reference

reference不能是空,必须有初值。通常在reference和point都适用时,reference有更好的效率(因为reference不需要测试是否为NULL)。当需要指向某个东西而且决不会改指其它东西,或是当实现一个操作符而其语法需求无法由pointer达成时(如operator[]),就应该选择references;任何其他时候,采用pointer.  

2010-05-11 22:04:00 664

原创 emacs配置文件

(custom-set-variables  ;; custom-set-variables was added by Custom.  ;; If you edit it by hand, you could mess it up, so be careful.  ;; Your init file should contain only one such instance.  ;; If th

2010-04-07 09:56:00 965

转载 中国剩余定及由此解决的一个问题

我国古代数学名著《孙子算经》中,记载这样一个问题: “今有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二,问物几何。”用现在的话来说就是:“有一批物品,3个3个地数余2个,5个5个地数余3个,7个7个地数余2个,问这批物品最少有多少个?” 这个问题的解题思路,被称为“孙子问题”、“鬼谷算”、“隔墙算”、“韩信点兵”等等.那么,这个问题怎呢?明朝数学家程大位把这一解法编成四句歌诀:  三人

2010-03-07 10:58:00 1023

原创 C++中数据的精度和格式控制

//精度和格式控制#include#includeusing namespace std;int main(){ float n; cin>>setiosflags(ios::fixed)>>setprecision(2)>>n; cout<<setiosflags(ios::fixed)<<setprecision(2)<<n<<endl; float i=1

2010-02-26 16:12:00 1663

原创 C++中IO流的基本操作

#include#include#include#includeusing namespace std;int main(){ cout<<"hello flush"<<flush; cout<<"hello ends"<<ends; cout<<"hello endl"<<endl; /* //test cin.clear() && c

2010-02-26 16:10:00 1113 1

原创 折半插入排序算法

//折半插入排序算法void BiInsertSort(int *Data,int n){ int i,j,low,high,mid,temp; for(i=1;i<n;i++)//先确定第i个元素应插入的位置 { temp=Data[i]; low=0,high=i-1; while(low<=high) { mid=(low+high)/2;

2010-02-26 16:06:00 891

原创 排序算法之简单排序

//冒泡排序算法void BubbleSort(int *Data,int n) { int i,j,temp; bool exchange; for(i=n-1,exchange=true;i>0 && exchange;i-- ) { for(j=0,exchange=false;j<i;j++) { if(Data[j+1]<Data[j

2010-02-26 16:03:00 784

原创 八皇后问题的C语言实现

问题就不描述了,直接上代码: #includeint chess[8][8]={0};int a[8],b[15],c[15];int sum=0; //统计所有摆法void PutQueen(int n){ int col,i,j; for(col=0;col<8;col++

2010-02-26 15:58:00 17261 4

原创 写个简单的makefile

有如下三个文件,我们以此来写个基本的makefile test.h#ifndef TEST_H_H#define TEST_H_H#include#include#includeclass Test{public: void vector_insert(std::string&); void vector_print();private: s

2010-02-20 12:25:00 761

原创 画线算法的实现

众所周知,VC++中画图算法封装在一个重要的类CDC中。。。基本的像LineTo();MoveTo()等,要说到画线,其实底层的算法也不是很难。。。在这里贴几个代码分享一下!(这里只在MFC的view类OnDraw函数实现)1、DDA(数值微分)法:void CDDALineView::OnDraw(CDC* pDC){ CDDALineDoc* pDoc = G

2010-02-19 21:37:00 3207 2

C++面向对象多线程编程

《C++面向对象多线程编程》共分13章,全面讲解构建多线程架构与增量多线程编程技术。第1章介绍了用于构建面向对象程序的不同类型C++组件,以及如何使用这些组件来构建多线程架构。第2、3、4章简要介绍进程、线程、多任务处理、多线程化、规划以及线程优先权的概念。第5章讨论进程间和线程间通信。第6章讨论线程与进程同步与合作。第6章详细讨论临界区、死锁、数据竞争以及无限延迟方面的主题。第7-10章讲解用于线程同步、线程间通信、进程间通信以及多线程处理的C++组件。第11章讨论C++对象在多线程环境中的行为和交互方式。第12章简单介绍多线程应用程序的测试技术。第13章对全书内容进行扼要地回顾与思考。

2017-07-28

C Primer Plus(第五版)中文版

《C Primer Plus(第5版)(中文版)》共17章。第1、2章学习C语言编程所需的预备知识。第3到15章介绍了C语言的相关知识,包括数据类型、格式化输入输出、运算符、表达式、流程控制语句、函数、数组和指针、字符串操作、内存管理、位操作等等,知识内容都针对C99标准;另外,第10章强化了对指针的讨论,第12章引入了动态内存分配的概念,这些内容更加适合读者的需求。第16章和第17章讨论了C预处理器和C库函数、高级数据表示(数据结构)方面的内容。附录给出了各章后面复习题、编程练习的答案和丰富的C编程参考资料。

2017-07-28

Erlang程序设计(中文版)

本书由Erlang之父Joe Armstrong编写,是毋庸置疑的经典著作。书中兼顾了顺序编程、并发编程和分布式编程,重点介绍如何编写并发和分布式的Erlang程序以及如何在多核CPU上自动加速程序,并深入地讨论了开发Erlang应用中至关重要的文件和网络编程、OTP、ETS和DETS等主题。第2版全新改写,反应了自第1版面世以来Erlang历经的所有变化,添加了大量针对初学者的内容,并在每章后都附上了练习题。

2017-07-28

RESTful Web APIs

《RESTful Web APIs中文版》是针对RESTful API的实用指南,通过展示各种用来创建高可用应用的强大工具,讲解REST的深层原理,以及介绍基于超媒体API的策略,使读者得以在将上述内容融会贯通后,设计出让客户高度满意的RESTful的web API。《RESTful Web APIs中文版》极具权威性与前瞻性,既代表了API领域的最前沿趋势,也覆盖了API领域的最重要实践。 《RESTful Web APIs中文版》适合所有从事Web开发和架构工作的读者阅读参考。

2017-07-28

MySQL技术内幕:InnoDB存储引擎-姜承尧

本书是国内目前唯一的一本关于innodb的著作,由资深mysql专家亲自执笔,中外数据库专家联袂推荐,权威性毋庸置疑。 内容深入,从源代码的角度深度解析了innodb的体系结构、实现原理、工作机制,并给出了大量最佳实践,能帮助你系统而深入地掌握innodb,更重要的是,它能为你设计和管理高性能、高可用的数据库系统提供绝佳的指导。注重实战,全书辅有大量的案例,可操作性极强。 全书首先全景式地介绍了mysql独有的插件式存储引擎,分析了mysql的各种存储引擎的优势和应用环境;接着以innodb的内部实现为切入点,逐一详细讲解了innodb存储引擎内部的各个功能模块,包括innodb存储引擎的体系结构、内存中的数据结构、基于innodb存储引擎的表和页的物理存储、索引与算法、文件、锁、事务、备份,以及innodb的性能调优等重要的知识;最后深入解析了innodb存储引擎的源代码结构,对大家阅读和理解 innodb的源代码有重要的指导意义。 本书适合所有希望构建和管理高性能、高可用性的mysql数据库系统的开发者和dba阅读。

2017-07-28

流畅的Python(Fluent Python)

Learn how to write idiomatic, effective Python code by leveraging its best features. Python's simplicity quickly lets you become productive with it, but this often means you aren’t using everything the language has to offer. By taking you through Python’s key language features and libraries, this practical book shows you how to make your code shorter, faster, and more readable all at the same time—what experts consider Pythonic. Many programmers who learn Python basics fall into the trap of reinventing the wheel because of past experience in other languages, and try to bend the language to patterns that don't really apply to it. Author Luciano Ramalho, a Python Software Foundation member and Python programmer for 15 years, helps you drop your accent from another language so you can code Python fluently. •Learn practical applications of generators for database processing •Rethink some design patterns in a Python context •Examine attribute descriptors and when to use them: the key to ORMs •Explore Pythonic objects: protocols versus interfaces, abstract base classes and multiple inheritance

2017-07-28

cedet

cedet

2012-08-16

Programming Python, 2nd Edition

programming python python 教程 python 学习 python 入门

2011-05-05

Visual C++ MFC入门教程

Visual C++ MFC入门教程, .chm格式, 讲述Visual C+ +/MFC开发的基本知识,文档/视结构,窗体控件的使用和一些基本的网络开发知识。同时指出一些在开发中容易犯的错误和一些注意事项。本教程主要侧重于讲解MFC中各个类的使用和函数功能,同时在重要内容上都带有例程。

2010-02-03

C++函数大全(小型的MSDN)

C++函数大全 小型是MSDN 很不错...

2008-10-15

一个五子棋程序MFC(经典练习程序)

一个五子棋程序 一个五子棋程序 关键是电脑的AI算法. 提供这个大家看看吧... 关键是电脑的AI算法. 很经典嘀一个练习程序...

2008-10-15

The.C.Programming.Language(2Ed)

第二部分 The.C.Programming.Language(2Ed) 英文版 PDF电子书

2008-09-09

The.C.Programming.Language(2Ed)

经典的东西,分享给大家啊 英文版,PDF电子书!!

2008-09-09

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除