利用Django开发网站,可以设计出非常优美的url规则,如果url的匹配规则(包含正则表达式)组织得比较好,view的结构就会比较清晰,比较容易维护。
最简单的形式
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^articles/2003/$', 'news.views.sp...
分类:
其他好文 时间:
2014-05-08 04:31:30
阅读次数:
508
我之前一直采用的是System.exit(0);
今天看到有人说这个方法不太好,这是J2SE里的方法,他主要是通过终止正在运行的JAVA虚拟机,导致程序终止。
推荐以下方法:
1.杀死本进程:
android.os.Process.killProcess(android.os.Process.myPid());
2.强制关闭与该包有关的一切活动(杀死其他进程):
ActivityMan...
分类:
移动开发 时间:
2014-05-08 04:30:28
阅读次数:
368
Flex读取txt文件中的内容
自动生成的文件
LoadTxt-app.xml:
<!-- Adobe AIR Application Descriptor File Template.
Specifies parameters for identifying, installing, and launching AIR applications.
xmlns - ...
分类:
其他好文 时间:
2014-05-08 03:58:40
阅读次数:
261
package org.mark.file;
import java.io.File;
/**
* File类的基本操作之读出全部文件夹路径
* 如果给定一个目录,要求将此目录中的全部文件都列出来
* 使用递归
*/
public class TestChare {
/**
* @param args
*/
public static void main(String[]...
分类:
其他好文 时间:
2014-05-08 03:53:29
阅读次数:
259
一、specialpermissionsforexecutables1.specialpermissionsforexecutables:-suid:commandrunwithpermissionsoftheownerofthecommand,notexecutorofthecommand-sgid:commandrunswithgroupaffiliationofthegroupofthecommandeg:file:usergroupothersuidsgid二、specialpermissio..
分类:
系统相关 时间:
2014-05-08 03:04:17
阅读次数:
574
文件系统管理重新创建文件系统会损坏原有文件。创建某个分区上的文件系统使用mkfs:makefilesystem-tFSTYPE指定文件系统类型mkfs命令比较特殊[root@www~]#whichmkfs.ext2/sbin/mkfs.ext2[root@www~]#ls-l/sbin/mkfs.ext2-rwxr-xr-x3rootroot47312Sep42009/sbin/mkfs.ext2所以:..
分类:
系统相关 时间:
2014-05-08 02:33:29
阅读次数:
406
Flex读取txt文件中的内容
1、具体错误如下
2、错误原因
读取文件不存在
var file:File = new File(File.applicationDirectory.nativePath+"/phone.txt");
3、解决办法
将文件导入进去...
分类:
其他好文 时间:
2014-05-08 02:13:59
阅读次数:
236
两种解法。
我想到的是最大的矩形,中间一定有个最矮的某个单位矩形,所以用两个数组记录任何一个单位矩形histogram[i]左右两边第一个比它小的单位矩形的序号,这里找的时候用DP加速。
#include
using namespace std;
//the histogram stored from left to right
long histogram[100001]...
分类:
其他好文 时间:
2014-05-08 01:59:37
阅读次数:
443
1.创建新的字符串 1 public class T004 { 2 public static
void main(String[] args){ 3 System.out.println(replaceBlank("we are happy")); 4
} 5 ...
分类:
编程语言 时间:
2014-05-08 01:08:18
阅读次数:
364
以上有待大家商榷给出分数值,并且等待后续项目进展给出改进以及补漏。
分类:
其他好文 时间:
2014-05-08 00:48:40
阅读次数:
271