- 博客(20)
- 资源 (16)
- 问答 (2)
- 收藏
- 关注
原创 django model save:quantize result has too many digits for current context
原因可能是django的model中的字段与数据库没有保持一致。 如数据库已经将decimal改成int,而model里没有进行对应的修改仍然保持decimal就会出现这个错误。当然,这个错误肯定有其他原因,这里只是记录一下本人遇到的。
2016-11-28 14:16:01 1567
原创 点击button标签会导致提交form
button的type 属性,IE的默认是 “button”,非IE默认是 “submit”。 如果想不提交需要指定type为”button”。<form> <button type="button">button</button><!--不提交form--> <button type="submit">button</button><!--提交form--> <butto
2016-11-25 17:17:19 11917 1
原创 以Java为基础重新设计一门语言
a = 10;//等价于Integer a=new Integer(10),等价于Integer a=10,编译器会自定将整数类型转成Integer,小数类型转成Float//等价于User a=new User()
2016-11-16 21:41:41 720 1
原创 俺又来批评Python了
Python中的字符串拼接要特别小心,因为拼接时只支持字符串类型和字符串类型的拼接,不会自动转换。 不像Java,不管用int还是Integer都会自动转成String。JavaSystem.out.println("str"+new Integer(10)+200+30d);//打印://str1020030.0Pythonprint "str"+10;#打印:#TypeError: c
2016-11-14 11:02:37 475
原创 我只是想使用一下微软在线文档
因为在Linux上作开发,想使用微软提供的在线Office: https://products.office.com/zh-cn/office-online/documents-spreadsheets-presentations-office-online https://office.live.com/start/Word.aspx https://office.live.com/star
2016-11-10 16:00:35 2957
原创 Python三元表达式
Python没有三元表达式的写法,但有和三元表达式类似的if写法: 三元表达式ifs="ok"v="yes" if s=="ok" else "no"print v嵌套三元表达式ifs="ok"s2="tzc"v="yes" if s=="ok" else ("yes" if s2=="tzc" else "no")print v备注: 正常三元表达式写法:String s="ok";
2016-11-10 12:29:16 3324
转载 深入理解javascript构造函数和原型对象
原文地址:http://www.jb51.net/article/55539.htm 本文章与原文相比有细微的改动,去除了多余的无用的文字和图片。常用的几种对象创建模式使用new关键字创建var gf = new Object();gf.name = "tangwei";gf.bar = "c++";gf.sayWhat = function() { console.log(this.n
2016-11-07 15:37:52 366
原创 Linux修改.bashrc
.bashrc文件在/home/用户名/.bashrc里, 利用.bashrc文件,可以修改PS1。 PS1则是用来控制命令行窗口前面那一段显示的字符。 这是我的PS1设置:export PS1="[\u@\h \W]\$ "查看PS1:echo PS1我PS1在命令行显示效果:[zhichao@localhost /]$ [zhichao@localhos
2016-11-07 14:31:37 3073
原创 查看git命令中文解释
命令行输入gitgit helpgit help -a即可得到以下信息:用法:git [--version] [--help] [-C <path>] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | --
2016-11-05 10:20:26 1629
原创 Java使用代理进行网络连接
需求是这样的:一、界面上要有这样几种代理类型可以选。1.HTTP代理 2.Socks代理 3.不使用代理(直连) 4.使用浏览器设置(浏览器也是HTTP、Socks、直连三种)。可参考QQ登录设置里的代理能,其实跟qq的代理功能是一样的。二、测试使用所填写的代理配置信息是否可连接三、记录用户上次选择的代理配置,默认使用用户上次使用的代理配置进行网络连接。程序运行环境是WindowsXP、Win
2016-11-04 10:34:13 4683
原创 Python多线程和线程锁测试
测试1代码:#coding=utf-8import threadingfrom time import sleepthreadLock = threading.Lock()def handle1(name,count): getlock=threadLock.acquire() print str(name)+"获取锁成功?"+str(getlock) for i in r
2016-11-03 22:15:35 677
原创 处理URL编码与解码
太简单了。。。 url编码:urllib.quote(url)url解码:urllib.unquote(url)完整示例:#coding=utf-8import urlliburl = 'http://www.xxx.com/?name=老王'print urllib.quote(url)encoded_url=urllib.quote(url)print urllib.unquote(encod
2016-11-03 19:38:42 1234 1
原创 论#coding=utf-8的位置
1.必须要在第一行或者第二行。 2.必须要在可执行代码和中文注释的前面。 3.如果页面没有中文,那么它只是一个普通注释,位置任意都行。对的写法:#coding=utf-8#为未为print "test"#coding=utf-8print "test"#为未为错的写法:v=1#coding=utf-8#为未为print "test"print "test"#coding=utf
2016-11-03 15:54:57 4814
原创 Commands out of sync; you can't run this command now
sql="update tb1 set xxx=vvv where id=nnn;update tb2 set xxx=www where id=kkk;"cursor.execute(sql)然后就会报这个错误:Commands out of sync; you can't run this command now解决: 将execute换成executemany,传入参数数组。 切记exe
2016-11-02 20:53:42 1167
原创 Yum安装时提示保护多库版本
yum install zlib错误: Multilib version problems found. This often means that the root cause is something else and multilib version checking is just pointing out that there is a problem. Eg.:
2016-11-02 12:20:35 18754
原创 Linux使用SSH远程连接Linux
ssh 用户名@ip或域名 -p 端口不写-p默认22端口ssh 用户名@ip或域名 栗子:ssh [email protected] -p 22Are you sure you want to continue connecting (yes/no)? yes输入yes使用密钥登录以下内容我自己没用到也没实验过,只是觉得写的好:首先生成密钥,在任意目录下输入命令:ssh-keygen -t
2016-11-02 09:47:42 1805
原创 Python使用with时本猿犯了一个错误
以下这段代码导致压缩包内的图片不完整,重新解压后发现文件大小比原文件小一点点。 但是导致图片无法打开,我也是由图片打不开这个bug一步一步找到是没关流的原因。 这个问题很严重,找了半天才知道是文件流没有关闭导致。for d in tableData: imageFile = urllib2.urlopen(d["image"]) img_name=str(partId)+"_"+
2016-11-01 22:06:24 877
原创 Ajax跨域
先分享两篇非常棒的文章: http://www.ruanyifeng.com/blog/2016/04/same-origin-policy.html http://www.ruanyifeng.com/blog/2016/04/cors.html跨域问题是浏览器同源策略所致,要解决跨域问题,先弄明白什么是同源政策。同源策略:同源策略(Same origin policy)是一...
2016-11-01 11:28:42 378
视频转MP4工具,jar文件,需要配置jdk方可运行
2024-03-13
图片转文字OCR免费jar
2022-07-22
使用jaudiotagger修改歌曲信息(支持mp3和m4a)
2022-07-19
ZendStudio-13.6.1-win32.win32.x86_64.7z
2020-06-22
eclipse.zip
2020-06-22
获取超级管理员权限.7z
2020-06-22
windows7开启telnet出现错误后手动开启telnet
2020-06-22
python资料合集
2018-07-31
多个中文技术文档chm压缩包
2018-07-31
Swing俄罗斯方块
2015-06-03
Java2dDemo
2014-07-08
如何才能看懂别人写的位运算代码?
2015-03-04
这段代码的输出结果能不能给解释解释?
2014-06-05
TA创建的收藏夹 TA关注的收藏夹
TA关注的人