自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

wyx819的专栏

会逐渐更新技术学习文章,对全栈技术感兴趣,如vue.js,spring框架,微服务架构,nosql等

  • 博客(55)
  • 资源 (1)
  • 收藏
  • 关注

原创 对 vue.js 的初步了解

对 vue.js 的初步了解。vue.js框架的定位在官网上已经描述得相当明确:渐进式、自底向上的视图层开发框架,容易,并且方便和其他优质前端库、工具整合,在它基础上能构建复杂的 单页面应用。在 vue.js 的世界里,组件是其一等公民。在五年前大学的 web2.0程序设计的课堂上,首次接触前端编程,还是以 html 标签为基本单位,去构建 web 应用,那时看来一个 web 应用就是由一个个 h...

2018-02-27 12:08:16 390

原创 virtualenv(python虚拟环境)

virtualenv(python虚拟环境)virtualenv是一个工具,可以利用它创建与操作系统python环境相孤立的python运行环境,方便测试和开发依赖包的管理。如何指定虚拟环境的python解析器在同一个操作系统中,可能安装了python2,也可能安装了python3,可以利用以下命令指定虚拟环境中的python解析器。virtualenv -p /usr/bin/python2.7

2017-10-22 22:18:12 1174

原创 进程

进程定义最简单的说法就是一个运行中的程序。一个进程是由什么组成,我们更需要理解的是一个进程的机器状态,也就是一个进程在执行的过程中它可以访问系统中的哪些部分?可以影响系统的什么组件?一个非常明显的组件是内存(memory)。进程只有被操作系统载入到内存中才能执行,程序的指令是放在内存中的,进程读写的数据也是放在内存中。也就是说,进程可以寻址的内存(地址空间)也是进程的一

2015-07-19 00:18:41 734

原创 sockjs-web实时通信协议

sockjs-web实时通讯应用解决方案socksjs目标客户端和服务器端api尽可能简洁,尽量靠近websocket api支持服务端扩展和负载均衡技术传输层应该全面支持跨域通信如果收到代理服务器的限制,传输层能优雅地从一种方式回退到另一种方式尽可能快地建立连接客户端只是纯粹的JavaScript,不需要flash客户端JavaScript必须经过严格的测试服务器端代

2015-06-22 15:12:12 18944

原创 tornado路由(Routing)

url路由tornado代码文档中提到,“A collection of request handlers that make up a web application“。其实更加detail一点的说法应该是,”A collection of request handlers and a url route talbe that make up a web application”。一个web

2015-05-25 08:45:48 21087 2

原创 tornado模板引擎原理

模板编译老师问小明:已经a=1, 求a+1的值。 小明挠挠头,思考后回答:老师,a+1的结果是2。以上是一个非常简单的例子,实际上就是一个模板编译过程。 a=1,实际表示的是一个名称空间(namespace)中的一项,表示该名称空间中的存在一个名称(name),其值为1。在python里面,名称空间可以用一个非常典型的数据结构,字典来表示,其中都是键值对。

2015-05-17 21:00:21 6749

原创 tornado协程(coroutine)原理

tornado中的协程是如何工作的本文将按以下结构进行组织,说明tornado中协程的执行原理协程定义生成器和yield语义Future对象ioloop对象函数装饰器coroutine总结协程定义 Coroutines are computer program components that generalize subroutines for nonpreemptive mult

2015-05-02 01:49:03 38026 13

原创 tornado:异步connect

​在tornado中,当用iostream.connect函数进行异步connect的时候,如果第一次调用connect不成功,那么我们期待它引发异常_ERRNO_INPROGRESS或者_ERRNO_WOULDBLOCK,标记当前正在进行connecting(self._connectiong=True),将connect传入的参数callback,保存到类的成员变量_conne

2015-04-26 13:30:54 2041

原创 分割字符串的比较完美实现(c++,stl)

#include#include#includeusing namespace std;void Tokenize(const string& str, vector& tokens, const string& delimiters){ // Skip delimiters at beginning. string::size_type lastPos = str.find

2013-10-18 00:29:00 3497 3

原创 sicily 1137 河床

//大一大二以前看起来毫无思路的问题,现在积累思考多了,却很容易解决了#include#include#includeusing namespace std;int maxLen(int *a, int start, int end, int k){//special caseif( k==0 ){return 1;}if( k < 0 ){return 0;}if( start == end )

2013-09-18 16:58:09 727

原创 子数组最大和问题

#include#include#includeusing namespace std;/*maxSum[i] = max(maxSum[i-1], a[i], sum[j, i])*/int maxSumOfSubarray(int a[], int n){ int maxSum , t; maxSum = t = a[0]; for( int i = 1; i < n

2013-09-15 16:29:34 456

原创 二分查找的几个用法

#includeusing namespace std;bool binary_search(int *a, int n, int x){ int left = 0, right = n-1; int mid; while( left <= right ) { int mid = left + (right - left) / 2; if( a[mid] == x )

2013-09-14 21:44:37 582

原创 1004. I Conduit!

#include#include#include#include#includeusing namespace std;const double MAX=999999;struct point{ double x; double y;};struct segment{ point p1; point p2; double k; double b;};voi

2013-03-03 12:14:21 735

原创 siciy 1003. Hit or Miss

#include#include#include#includeusing namespace std;int main(int argc, char *argv[]){ int t; scanf("%d",&t); for( int k = 1; k<=t ; k++) { int current_count[10]; int last_remove[10]; i

2013-02-28 13:02:08 412

原创 1048 Inverso

// Problem#: 1048// Submission#: 1829258// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by

2012-12-27 14:35:49 526

原创 Scily 1011. Lenny's Lucky Lotto

#include #include #includeusing namespace std;long N,m;long long dp[11][2001];int main(){ memset(dp,0,sizeof(dp)); /*init the array*/ for( int j = 1; j<=2000 ; j++ ) { d

2012-12-27 00:16:36 480

原创 1002. Anti-prime Sequences

/* * ===================================================================================== * *       Filename:  1002.cpp * *    Description:   * *        Version:  1.0 *        Created

2012-09-11 14:28:40 373

原创 2014. Dairy Queen

//利用母函数求排列组合//母函数详解见 http://www.wutianqi.com/?p=596#include#include#includeusing namespace std;int main(int argc, char *argv[]){ int t; cin>>t; int a[2000]; int b[2000]; int n;

2011-12-09 22:55:28 907

原创 2499. 平方数

/* * ===================================================================================== * * Filename: 1.cpp * * Description: * * Version: 1.0 * Created: 2011年11月

2011-11-13 13:24:45 761

原创 1721. Gray code[Special judge]

#include#include#includeusing namespace std;void gray(int a[16],int n){ printf("%d",a[0]); for( int i=1; i<n ; i++ ) { if( (a[i]+a[i-1])%2==0 ) { printf("%c",'0'); }

2011-11-08 20:01:51 487

原创 1298. 数制转换

#include#include#includeusing namespace std;void change(long n){ string str; int tmp=0; int num; while( n/3!=0 ) { num=n%3+tmp; if( num==2 ) { tmp=1; str='-'+str

2011-11-08 18:25:29 548

原创 1150. 简单魔板[Special judge]

#include#include#include#includeusing namespace std;int factoral[]={1,1,2,6,24,120,720,5040,40320};//0到8的阶乘struct statue{ long data;//记录当前的状态,技巧是将一个数组转换成整数 string path;//记录路径};

2011-11-07 20:00:29 641

原创 uva-850-Crypt Kicker II

/* * ===================================================================================== * *       Filename:  y.cpp * *    Description:   * *        Version:  1.0 *        Created:

2011-11-02 09:09:57 627

原创 虚函数后加const

<br />    如果基类的虚函数后加const,派生类相应的函数没有加const,那么虚函数没有起到相应的作用,如果派生类相应的函数也加const,虚函数机制又发挥相应的作用了。但里面的原因是什么呢,也不清楚。

2011-05-15 00:10:00 3133 4

原创 php全局变量

<br />       php的全局变量不像c++,或c,全局范围的变量定义和赋值,一般情况下,不会影响到函数体内对该变量名除了赋值操作以外的任何操作。如<br /><html><head></head><body><?php$a=2;function test(){ echo $a;}test();?></body></html><br />用global 关键字在函数体内对该变量名进行修饰,这会有相应的输出<br />如<br /><html>

2011-05-10 17:46:00 491

原创 private 访问继承

<br />#include <iostream>using namespace std;class A{ public: int get() { return a; } A(){}; int set(int b) { a=b; return 0; } private: int a;};class B:private A{ public: using A::get; using B::s

2011-05-08 22:56:00 385

原创 2011. Nine Digits

<br />#include <algorithm>#include <iostream>#include <queue>using namespace std;class Node{ public: int a[3][3]; int sum; Node(int s,int array[3][3]) { sum=s; for(int i=0;i<=2;i++) for(int j=0;j<=2;j++)

2011-05-08 13:47:00 688

原创 1035. DNA matching

<br />/* * ===================================================================================== * * Filename: DNA.cpp * * Description: * * Version: 1.0 * Created: 2011-5-7 18:57:28 * Revision: none *

2011-05-07 20:14:00 544

原创 1093. Air Express

<br />#include <iostream>#include <algorithm>using namespace std;int main(){ int wr[4]; int rate[4]; int count=0; while(cin>>wr[0]) { cin>>rate[0]; cin>>wr[1]>>rate[1]; cin>>wr[2]>>rate[2]; cin>>rate[3]; wr[3]=1

2011-05-07 18:46:00 822

原创 1158. Pick numbers

<br />#include <iostream>#include <queue>using namespace std;int row,clo;struct node{ int x; int y; int sum;};int dx[]={0,1};int dy[]={1,0};bool check(int a,int b){ if(a>=1&&a<=row&&b>=1&&b<=clo){ return true; } else ret

2011-05-06 20:55:00 742

原创 创建一个新的函数对象

<br />#include <iostream>#include <iterator>#include <algorithm>#include <functional>#include <vector>using namespace std;class R:unary_function<double,double>{ public: result_type operator()(argument_type i) { return ((result_

2011-05-05 12:18:00 445

原创 istream_iterator和ostream_iterator的简单使用

<br />#include <iostream>#include <vector>#include <iterator>using namespace std;int main()//少了个void;{ istream_iterator<int> input(cin); int n1,n2; n1 = *input; input++; n2 = *input; cout<<n1<<","<<n2<<endl; ostream_iterator<int> ou

2011-05-04 18:32:00 495

原创 insert_iterator 类的简单使用

<br />      insert_iterator的构造函数有两个参数,其中一个是要插入数据的容器,另一个是要插入数据的初始位置,是容器的一个迭代器,insert_iterator类主要利用了容器的insert函数,实现插入的功能,这一功能是通过赋值操作来实现的。简单代码实现如下<br />#include <iostream>#include <vector>#include <iterator>using namespace std;int main(){ vector

2011-05-04 14:29:00 3252 1

原创 一个很好的但又很简单的队列

<br />摘自http://www.cnblogs.com/weichsel/archive/2010/09/14/1826300.html<br />#include <iostream> //简单的队列实现using namespace std; template<class T>class PStack { struct LINK { T* data; LINK* next; LINK(T* v, LINK* lk): data(v

2011-05-03 21:35:00 356

原创 将读取数据库中的数据显示在表格之中

<br /><html><head></head><body><?php$c=mysql_connect("localhost","root","");if ($c) { echo "connect database successfully!"."<br />"; mysql_select_db("family",$c); $result="select * from f"; $k=mysql_query($result); echo "<table b

2011-05-03 19:29:00 938

原创 静态数据成员和静态成员函数

<br />   1. 静态成员函数有以下特点:    可以通过class::function方式调用,不用生成实例   不能访问非静态的成员变量   静态成员函数是类的一部分,而非对象的一部分。   非静态成员函数调用时还隐式的传进一个this指针,静态成员函数不传this指针。静态成员函数一般情况下只能访问静态成员变量,因为不接受隐含的this指针。   另外作为类的静态成员函数,不用声明对象,便可直接调用,例如类A的静态成员函数fun();   A::fun();   <br />      摘自CS

2011-05-03 13:36:00 754

原创 insert函数理解

<br />         inserter不是一个功能函数,它只是一个配接器罢了。 其作用就是在内部帮你调用Container.insert( position, value ); 如果不提供container,无法调用insert.   <br />       头文件#include<iterator>.<br />

2011-05-03 11:17:00 2038

原创 通过表单将数据插入数据库

<br />form.php<br /><html><head></head><body> <form action="connect.php" method="post" target="connect.php">姓名:<input type="text" name="name" /><br />生日:<input type="text" name="born" /><br />年龄: <input type="text" name="age" /><br /><input

2011-05-02 15:53:00 5065

原创 1201. 01000001

<br />高精度的加法,但是纳米了很久,其实是一道很简单的题<br />/* * ===================================================================================== * * Filename: k.cpp * * Description: * * Version: 1.0 * Created: 2011-5-1 16:46:28

2011-05-01 17:46:00 966 1

原创 php_mysql

 php对mysql数据库的简单操作

2011-04-30 16:35:00 437

空空如也

空空如也

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

TA关注的人

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