- 博客(65)
- 资源 (6)
- 收藏
- 关注
原创 django-simple-captcha & jquery validate
1. view.pyfrom django.shortcuts import renderfrom django.http import HttpResponseRedirect, HttpResponseimport jsonfrom django import formsfrom captcha.fields import CaptchaFieldclass Nam
2015-07-07 16:35:27 900
原创 django-simple-captcha refresh & validation
PreparationDownload django-simple-captcha using pip by running: pip install django-simple-captchaAdd captcha to the INSTALLED_APPS in your settings.pyRun python manage.py syncdb (or py
2015-07-06 18:40:34 1284
原创 captital
1. 买卖期货合约来抵消原材料价格变化或外汇波动带来的经营风险,这种做法叫做对冲。(将自己隔离于汇率波动的风险)2. 流动性风险和价格风险,流动性风险是无法买入或卖出的风险,流动性资产是能快速,便捷地转换为资金的资产,bid: 28.50, ask: 28.55, xyz bid:28.55,0.05 = spread,价差,经营流动性风险的交易商被称作scalper or market ma
2015-06-29 10:02:51 3663
原创 debain install scim
1. su input root pwd2. apt-cache search scim apt-get install scim apt-cache search scim-pinyin apt-get install scim-pinyin
2015-06-29 08:55:07 635
原创 yum-axelget setup in centos 6.x
1. https://github.com/crook/yum-axelget/releasesdownload the latest versiontar -zxvf filenamecd filenamepython setup.py install2. problems?no module named setuptools? get it and inst
2015-04-29 14:57:04 759
原创 change centos 6.x 163 source throught windows
1. download .repo filehttp://mirrors.163.com/.help/CentOS6-Base-163.repo2. use winscp enter path /etc/yum.repo.d/3. rename CentOS-Base.repo to any other name like CentOS-Base.repo.origsend C
2015-04-29 10:34:05 659
原创 centos remote control server 6.x
reference: http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-xrdp-remote-desktop-to-centos-6-rhel-6.html#axzz3YUmJrTYJ1.32bits# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i3
2015-04-27 15:13:36 1143
原创 mount local yum source
system: CentOS 6.6two steps:1. mkdir /root/repocp /etc/yum.repos.d/* /root/repo/rm -rf /etc/yum.repos.d/*cp /root/repos/CentOS-Media.repo /etc/yum.repos.d/vim Centos-Media.repochan
2015-04-16 18:27:36 525
原创 centos install rtl8188CUS wlan driver
system: Centos6.6wlan: nw 336v2step 1 insert usb #lsusb -- find your devicestep 2 download driver link1 link2 kernel-devel,gcc is necessary st
2015-04-11 20:18:47 1818
原创 Python - class
c++ & python modula-3a basic class:class ClassName: . . . it will generate a new namespaceclass MyClass: "A simple example class" i = 12345 def f(sel
2015-01-25 16:18:56 745
转载 mysql-function-procedure-iterator
http://www.jbxue.com/db/11545.htmlhttp://bbs.csdn.net/topics/300105063http://blog.csdn.net/panpanxj/article/details/2729791delimiter //;create procedure test_while(in x int)begindeclare c
2015-01-15 11:26:08 573
原创 bfs-dfs-bst
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * };
2015-01-10 15:17:07 472
转载 ubuntu basic terminal commad
http://blog.csdn.net/gaojinshan/article/details/9314435# ctrl + l - 清屏 。 cLear# ctrl + c - 终止命令。 # ctrl + d - 退出 shell,好像也可以表示EOF。 # ctrl + z - 将当前进程置于后台,fg还原。 # ctrl + r - 从命令历史中找 。 R
2015-01-06 22:32:20 597
转载 ubuntu mysql基本命令
http://www.2cto.com/os/201205/132796.html主要是安装&用户登陆:安装MySQL:要安装 MySQL,可以在终端提示符后运行下列命令:sudo apt-get install mysql-server mysql-client #中途会让你输入一次root用户密码sudo apt-get install php5-mysq
2015-01-05 21:32:51 510
翻译 Single Number II——系列题目的翻译
题目:Given an array of integers, every element appears three times except for one. Find that single one.Your algorithm should have a linear runtime complexity. Could you implement it without using e
2015-01-05 15:19:47 1008
原创 Python - syntax errors and exception
1. syntax errors (arrow marks)2. zero division error, name error, type error.3. try except while True: try: x = int(raw_input("Input:"))
2015-01-04 21:21:44 919
原创 二分算法总结
讨论分为3种,第一种是搜索队列中任意我们需求的结果,第三种我们需求队列中有多个返回第一个,第四种未我们搜索队列中有多个返回最后一个元素的index。第一种: 在一行排好序队列a中搜索target,一定有。int binarySearch(int a[],int n, int target){ int start = 0,end = n-1; while(start
2015-01-04 09:42:55 717
原创 Python input and output
1. output a. string b. %=>like printf2. str(make a string) or repr(convert for interpreter) 'the value is x = ' + repr(x) + 'the value is y = ' + repr(y) The repr() of a string adds
2014-12-26 16:32:48 570
原创 Python module
1. module name fibo.__name__ # file fibo.py def f(x): return x*x import fibo fibo.f(10) # module name then function name fl = fibo.f # to make it call like locally
2014-12-26 14:14:12 504
原创 Python data structure
1. append(x) = > a[len(a):] = [x], extend(L) => a[len(a):] = L, insert(i,x) # before i, remove(x) # remove x or return error, pop([i]) # default value is the last element
2014-12-26 09:30:09 1046
原创 Python data type
1. unix ctrl+d,windows ctrl +z or import sys; sys.exit();2. int, float, complex number(real,imag,abs), _ represent last mentioned number, string(\",\n\, r" " \n doesn't work, quotation can cross-re
2014-12-25 14:25:49 604
原创 Ubuntu install a software
Ubuntu安装软件安装三种方法1. apt-get,pkgsrc,Aptitudehttp://www.cnblogs.com/pswzone/archive/2012/04/09/2438885.htmlhttp://www.cnblogs.com/nniixl/archive/2008/05/22/1205202.htmlhttp://www.netbsd.org/docs/
2014-12-23 16:27:38 862
原创 ubuntu getRGB shortcut key
为了快速获取RGB值,本文用QT做了一个小的工具,通过配置可在UBUNTU下快捷获取屏幕某点的RGB值,对图像处理来说还是挺方便的。QT代码如下:getrgb.h#ifndef GETRGB_H#define GETRGB_H#include #include namespace Ui {class MainWindow;}class MainWindow : pu
2014-12-20 17:35:36 713
转载 Ubuntu apt-get 卸载命令
http://www.php100.com/html/webkaifa/Linux/2012/1113/11546.html通过sudo apt-get install xxxx 安装软件后,总是无法卸载干净,这里以Apache 为例,提供方法:首先sudo apt-get remove apache2再sudo apt-get autoremove最近在Ubunt
2014-12-20 10:33:01 4284
转载 ubuntu-tar-express command
http://www.cnblogs.com/siylz/articles/1674984.htmltar-c: 建立压缩档案-x:解压-t:查看内容-r:向压缩归档文件末尾追加文件-u:更新原压缩包中的文件这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个。下面的参数是根据需要在压缩或解压档案时可选的。-z:有gzip属性的-
2014-12-17 15:58:36 589
转载 ubuntu更新firefox浏览器到最新版本
http://os.51cto.com/art/200912/175066.htmUbuntu Firefox浏览器的更新Ubuntu Firefox安装完成后会自动安装一个Ubuntu Firefox浏览器,遗憾的是这个Ubuntu Firefox版本通常较低,例如Ubuntu 9.04会安装Firefox 3.0,不过我们可以想办法下载最新的Firefox覆盖掉老版本Fir
2014-12-17 13:50:50 2103
转载 codeblocks-ubuntu-change theme
参考:http://blog.csdn.net/gzshun/article/details/8294305http://www.cnblogs.com/platero/p/3518850.html1. 导入主题到配置文件sudo gedit ~/.codeblocks/default.conf2. find “colour_sets”,在后添加你所需的主题。例如添
2014-12-15 14:52:49 1654
原创 BST创建
思路:把数字排序,排序后数字列,中间点为父节点,左边部分为左子树,右边为右子树。 假设节点定义为:// Definition for binary treestruct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL),
2014-12-11 10:23:34 837
原创 除法计算-C++-非*,/,%运算
原理: m = x1*2^y1 + x2*2^y2……要点: >优先级比+,-低。顺便插一下优先级图片:只考虑正数情况下:int divide(int x,int y){ if(x < y) return 0; int sum = 0; int te = y<<1; while(x > te) {
2014-12-08 21:22:23 1527
原创 结构体排序-c++
功能是先拍a,若a相等则在其基础上对b进行排序。用的algorithm中sort进行的排序。#include#include#includeusing namespace std;struct test{ int a; int b; test():a(0),b(0){} test(int x,int y=0):a(x),b(y){} set(
2014-12-06 02:38:54 1102
原创 4进制加法-C++实现-分类讨论
思路:1. 分四类讨论2. 得到加和减计算方法3. 前导0删除与符号删除#include#include#includeusing namespace std;// 输入4进制数格式判断bool judge(string a){ int i = 0; if(a[i] == '-' || a[i] == '+') i++; if(a
2014-12-06 02:14:42 1785
原创 类模板MyArray-动态内存
采用一个动态数组存储数据,有插入,追加,删除,删除元素的功能。用链表有点浪费空间,用动态数组又增加了delete 和 new的操作。下面代码采用动态数组的方式。// 定义一个类模板MyArray,具有求数组长度、插入元素、追加元素、删除元素、查找元素的功能,并在main()加以验证。#include templateclass MyArray{private:
2014-12-05 16:21:20 1003
转载 C++类默认生成的四个函数
原文:http://www.myexception.cn/cpp/564396.html序:对于一个空类,编译器默认生成四个成员函数:默认构造函数、析构函数、拷贝构造函数、赋值函数一,默认构造函数 默认构造函数(defaultconstructor)就是在没有显式提供初始化式时调用的构造函数。它由不带参数的构造函数,或者为所有的形参提供默认实参的构造函数定义。如果定义某
2014-12-04 11:19:47 3852 1
原创 C++继承强制转换
1. 派生类对象可以强制转换为基类对象#include using namespace std;class base{public: int a; base(int x=0):a(x){} void print(){cout<<a<<endl;}};class son:public base{public: char y; son(char x)
2014-12-04 10:28:05 1176
原创 函数指针说明
1. 定义typedef int (*fp) (type para1...)2. 使用fp myfp = 0;3. 调用if(myfp){ myfp(...); }问题:编写一个函数,输入n为偶数时,调用函数求1/2+1/4+...+1/n,当输入n为奇数时,调用函数 求1/1+1/3+...+1/n(利用指针函数)#include typedef float (*functi
2014-11-30 17:42:59 520
翻译 Qt-Fortune Client Example-翻译
Demonstrates how to create a client for a network serviceThis example uses QTcpSocket, and is intended to be run alongside the Fortune Server example or the Threaded Fortune Server example.说明如
2014-11-27 19:49:05 1899
转载 ubuntu everpad安装
http://www.68idc.cn/help/server/linux/2014050494599.htmlctrl + alt + t,调出terminator在安装好了git的前提下(Everpad项目在github上开源:https://github.com/nvbn/everpad)输入三行语句sudo add-apt-repository ppa:nvbn
2014-11-27 16:47:03 2488
转载 ubuntu 截图工具-alt+ctrl+A
http://sddhn.blog.163.com/blog/static/128187792013117105617218/ubuntu自带截图工具,可以在terminator中调用。如gnome-screenshot -agnome-screenshot [选项...] 抓取屏幕的图片应用程序选项:-w, –window 抓取窗口,而不是
2014-11-27 16:19:02 830
原创 百度云-bae开放服务平台-网站发布-git
1. 在开发者服务平台注册账号http://developer.baidu.com/2. 选择开发者服务管理http://developer.baidu.com/console#app/project3. 创建工程,修改详情。输入名称,url,php-web,svn/git,这里选git5. 开启扩展服务mysql选择mysql6. git管
2014-11-26 11:12:17 1218
介于sql图书管理系统
2009-12-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人