- 博客(258)
- 资源 (9)
- 收藏
- 关注
原创 DJANGO_SETTINGS_MODULE
在 py manage.py shell 或者 py manage.py makemigrations 时会出现这个错误django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either defi
2015-08-24 10:09:43
1544
原创 ubuntu12.04下安装python3.4
ubuntu12.04下apt-get默认安装python3是3.2版本,因此需要自己更新源来安装python3.4 (目前的最新版本,以后需要更新的版本方法相同) sudo apt-get install python-software-properties #没有这步,下一步会提示add-apt-repository未找到. sudo add-apt-repository ppa:fkr
2015-07-30 21:40:30
1023
原创 KMP算法 -- 字符串模式匹配算法
KMP算法#include #include using namespace std;void getNext( char *T,int *next){ int i,j; i=1; j=0; next[1]=0; while(i<strlen(T)) { if(j==0 || T[i]==T[j]) { i++; j++;
2014-07-13 10:14:25
483
原创 bash 生成N位随机字符串
#!/bin/shfunction usage(){ echo "输出N位随机字符串" echo "$0 N(N<16)"}if [ $# != 1 -o $1 -gt 16 ];then usage exit 1fistrSrc="123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcd
2014-06-30 11:30:44
1080
转载 bash逐行读取文件
方法一,指定换行符读取:#! /bin/bash IFS=" " for LINE in `cat /etc/passwd` do echo $LINE done注意:这里写的是不全面的/当行中有空格时,这个是不能读的,此时要将IFS=`\r` 或者 \r\n 方法二,文件重定向给read
2014-06-12 14:15:33
1828
转载 Awk Tutorial
AwkMon Mar 3 10:25:09 EST 2014Part of the Unix tutorials And then there's My blogTable of ContentsWhy learn AWK?Basic StructureExecuting an AWK scriptWhich shell to use with AW
2014-05-05 10:13:38
1602
转载 Git Push 避免用户名和密码方法
前言 在大家使用github的过程中,一定会碰到这样一种情况,就是每次要push 和pull时总是要输入github的账号和密码,这样不仅浪费了大量的时间且降低了工作效率。在此背景下,本文在网上找了两种方法来避免这种状况,这些成果也是先人提出来的,在此只是做个总结。1.方法一 1.1 创建文件存储GIT用户名和密码在%HOME%目录中,一般为C:\users\
2014-03-30 23:18:46
766
转载 vim使用:自动加载模板
如何在新建一个文档时就有默认的模板内容呢?非常简单的执行以下操作: cd ~ mkdir -p .vim/template vim .vim/template/html.tpl 在html.tpl里随便写一些内容,如: New Document
2014-03-30 22:48:25
751
原创 github 接受pull request
在github上的项目,别人提交pull request之后 如何合并进来呢?1 建立新分支git checkout -b mchenyuxiang-master master //建立并跳转到新分支 mchenyuxiang-master2 pull内容git pull https://github.com/mchenyuxiang/python_study.git
2014-03-30 18:06:45
2000
翻译 Unix Sed Tutorial8 : Multi-Line File Operation with 6 Practical Examples
As part of our on going UNIX sed tutorial series earlier we covered the printing, deletion, substitution, file write, file manipulation commands etc., with the single line in the pattern space.I
2014-03-25 22:27:26
704
原创 gravity 和 layout_gravity的区别
android:gravity 属性是对该view 内容的限定.比如一个button 上面的text. 你可以设置该text 在view的靠左,靠右等位置.该属性就干了这个. android:layout_gravity是用来设置该view相对与起父view 的位置.比如一个button 在linearlayout里,你想把该button放在靠左 靠右等位置就可以通过该属性设置.
2014-03-24 23:07:28
550
转载 Unix Sed Tutorial 7 : Advanced Sed Substitution Examples
This article is part of the on-going Unix Sed Tips and Tricksseries.In our previous sed articles we learned — sed printing, sed deletion, sed substitute , sed file write, and sed multiple comm
2014-03-24 15:21:54
643
转载 Unix Sed Tutorial6 : Append, Insert, Replace, and Count File Lines
This article is part of the on going Unix sed command tutorial series. In our previous articles we learned sed with single commands — printing, deletion, substitute and file write.Sed provides lot
2014-03-24 12:20:16
763
转载 Unix Sed Tutorial 5: How To Execute Multiple Sed Commands
Question: Is it possible for me to combine multiple sed commands? Can I combine two sed commands and execute it as single sed command?Answer: In our previous articles we learned sed with single comm
2014-03-24 11:46:37
615
转载 Unix Sed Tutorial4 : How To Write to a File Using Sed
This article is part of Unix Sed Tutorial series. In previous articles, we discussed about sed print operation , sed delete operation and sed find and replace.In this article, let us review ho
2014-03-24 11:21:07
620
转载 Unix Sed Tutorial 2 : Delete File Lines Using Address and Patterns
In the previous sed tutorial we discussed about Unix sed command basics and printing lines from a file using sed address and patterns.In this article, let us review how to delete lines from a fi
2014-03-24 11:07:32
502
转载 Unix Sed Tutorial 1 : Printing File Lines using Address and Patterns
Let us review how to print file lines using address and patterns in this first part of sed tutorial.We’ll be posting several awesome sed tutorials with examples in the upcoming weeks.Unix
2014-03-24 10:38:37
690
转载 Unix Sed Tutorial3 : Find and Replace Text Inside a File Using RegEx
his article is part of on-going Unix Sed Tutorial series. In previous articles, we discussed about sed print operation andsed delete operation.In this article let us review how to use sed substi
2014-03-23 13:12:41
576
原创 sed学习笔记 -n 只打印匹配行
public@share:~/zhaoyh$ cat input # Instruction Guides1. Linux Sysadmin, Linux Scripting etc.2. Databases - Oracle, mySQL etc.3. Security (Firewall, Network, Online Security etc)4. Storage in
2014-03-23 12:57:04
2247
原创 vim 替换和搜索
命令名称意义/word自当前光标位置向下搜索名字为word的字符串?word自当前光标位置向上搜索名字为word的字符串:n1,n2s/word1/word2/g在n1行与n2行之间搜索名字为word1的字符串,并将其替换为word2:1,$s/word1/word2
2014-03-23 10:24:59
399
转载 android SQLite操作总结
Android数据库 一、关系型数据库SQLIte 每个应用程序都要使用数据,Android应用程序也不例外,Android使用开源的、与操作系统无关的SQL数据库—SQLite。SQLite第一个Alpha版本诞生于2000年5月,它是一款轻量级数据库,它的设计目标是嵌入式的,占用资源非常的低,只需要几百K的内存就够了。SQLite已经被多种软件和产品使用,Mozill
2014-03-20 12:30:11
499
转载 android 文件存储总结
接之前的数据存储访问 Android数据存储和访问文件存储●内部存储●外部存储●资源文件 内部存储Android允许应用程序创建仅能够自身访问的私有文件保存在内部存储器上 /data/data//files支持标准Java的IO类,也提供了简化读写流式文件过程的函数主要2个函数open
2014-03-18 21:52:57
502
转载 LayoutInflate类的使用
1、对于一个没有被载入或者想要动态载入的界面, 都需要使用inflate来载入. 2、对于一个已经载入的Activity, 就可以使用实现了这个Activiyt的的findViewById方法来获得其中的界面元素. 方法: Android里面想要创建一个画面的时候, 初学一般都是新建一个类, 继承Activity基类, 然后在onCreate里面使用setCont
2014-03-18 11:19:00
459
原创 Android入门笔记27 视频播放器
使用SurfaceView 要和mediaplayer结合使用package com.zyh.l015playmovie;import java.io.IOException;import android.media.MediaPlayer;import android.os.Bundle;import android.app.Activity;import android.
2014-03-18 09:52:56
482
转载 java匿名类的替代使用方法
读自: 别把Java当Javascriptandroid开发时有些程序员把onCreate写上千行,匿名类层叠可读性差替代方法有三种:1 本类继承接口,如MainAcitivy继承onClickListener2 子类代替匿名类 设置一个private子类,参数通过构造函数传入3 外部类代替匿名类 对于Adapter这类逻辑简单的类可以用
2014-03-17 15:31:22
737
转载 Android MediaPlayer基本使用方式
1)如何获得MediaPlayer实例: 可以使用直接new的方式: MediaPlayer mp = new MediaPlayer(); 也可以使用create的方式,如:MediaPlayer mp = MediaPlayer.create(this, R.raw.test);//这时就不用调用setDataSource了 2) 如何设置要播放的文件:
2014-03-17 09:41:25
576
转载 Android中的soundpool小结
原文地址 : http://jackyrong.iteye.com/blog/1008476之前只知道android中可以用mediaplayer播放音乐,原来今天才发现 可以用soundpool,用soundpool可以播一些短的反应速度要求高的声音, 比如游戏中的爆破声,而mediaplayer适合播放长点的。 1. SoundPool载入音乐文件使用了独立的线程,不会
2014-03-17 09:30:47
479
GCC3.4.6安装文件
2014-02-24
A FAST AND SECURE ENCRYPTION ALGORITHM FOR MESSAGE COMMUNICATION
2013-05-10
SESC安装文档
2013-04-12
myxrgsu锐捷校园网登陆客户端
2013-04-12
bison2.0源码包
2013-04-12
sesc模拟器 错误修正版
2013-04-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人