摘要:
前言Ext JS 3 和 Ext JS 4中都有提供日期选择的组件(当然早期版本也有)。但是有一些日期选择的需求是要看到星期,就是日期中的哪一天是这一年的第几周。遗憾的是Ext js 并没有提供这样的配置。(针对Ext js 4来说,理想的相法是在Ext.picker.Date有一个 类似showWeek这样的配置项)现有的解法到网络上去看看基于Ext js 的解法:有找到两个http://enikao.net/extjs/weeknumber/weeknumber.html和http://www.lubber.de/extjs/datepickerplus/第一种解法在IE上work, 在其 阅读全文
摘要:
1. install latest emacs xz -d emacs-24.3.tar.xz tar xvf emacs-24.3.tar ./configure make make install #need root 2. install Steve Purcell's emacs config git clone https://github.com/purcell/emacs.d.git rm -rf .emacs.d/ emacs mv emacs.d/ .emacs.d/ emacs # first time will download related module 3. 阅读全文
摘要:
在cocos2d-x的开发过程中有些时候也是需要用到双击的事件处理,那么由于在cocos2d-x中没有实现对双击的事件的处理,那么我们就需要自己用代码实现。下面介绍两种方式实现双击事件的处理。 (一)方法一第一种方法就是利用两次touch之间的时间间隔来判定是单击或者是双击,一般来说,双击,两次touch之间的时间间隔为250ms~300ms(毫秒)。所以利用这个条件就可以对双击进行判断处理了。注意到由于要获取两次touch之间的touch时间,而且是以毫秒为单位,所以需要用到下面这个方法://获取系统的毫秒时间long millisecondNow(){ struct cc_time... 阅读全文
摘要:
1.客户端网页代码检测用户名是否唯一 用户名: 密码: 确认密码: E-mail: 值得注意的是此处核心代码://cre... 阅读全文
摘要:
Oracle的操作系统身份认证oraclelogin数据库远程登录authenticationos sqlnet.authentication_services=(NTS),在$ORACLE_HOME/network/admin/sqlnet.ora中NTS特指的是windows系统,或者设为all,这两种情况都允许操作系统认证。如果在unix下如果没有设置sqlnet.authentication_services,默认就是操作系统认证!或者设为all也允许操作系统认证。 参数SQLNET.AUTHENTICATION_SERVICES= (NONE,NTS)表明用户连接Oracle服务器时 阅读全文
摘要:
1,模板定义:若一个程序的功能是对某种特定的数据类型进行处理,则将所处理的数据类型说明为参数,就可以把这个程序改写为模板。 C++ 程序由类和函数组成, 所以 C++ 的模板也分为类模板和函数模板。上面这个定义有点官方的味道,我自己的理解,其实模板也可以顾名思义,就是一个“模板”,将很多相似的东西模板化使其归为同一类,这样可以大大的简化代码量,而且使用也比较方便。2,模板函数既然模板有函数模板和类模板,那么我们就分开说这两个模板,首先先说简单点的-----函数模板。函数模板定义,我在网上看到一个更好的对模板的总结,就顺手借点共享给大家,他是这样说的:函数模板的一般定义形式:template . 阅读全文
摘要:
#include #include #include #include #include using namespace std;struct vv{ char s[20]; int id;}v[10005];int cnt=0;int cmp(struct vv x,struct vv y){ return strlen(x.s) test; int num=strlen(s); test.clear(); for(int i=0;i<cnt;i++) { if(!strcmp(s,v[i].s)) {printf("%s is corr... 阅读全文
摘要:
这个题也很裸了……不多说。#include #include #include #include using namespace std;#define N 20010int s[N], f[N], n, root;vector g[N];void getroot(int now, int fa) { int u; s[now] = 1; f[now] = 0; for (int i=0; i<g[now].size(); i++) if ((u=g[now][i]) != fa) { getroot(u, now); ... 阅读全文
摘要:
博弈。。。/*博弈对于当前人来说,如果完成自己的操作后,若mat[n][m]==0,则自己是胜者。因为 如果mat其他位置不存在1了,肯定自己胜;如果存在1,则让下一位去反转那个1.*/#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long int64;//typedef __int64 int64;typedef pair PII;#define MP(a,b) make_pair((a),(b)) const i 阅读全文
摘要:
参考文献:http://www.autonlab.org/tutorials/gaussbc12.pdf python代码如下:import numpy as npfrom sklearn.utils import array2dfrom sklearn.utils.extmath import logsumexpimport randomimport matplotlib.pylab as pltclass GaussianBayes: def __init__(self): pass def train(self, x, y): n_samples,... 阅读全文