`
mr.zxing
  • 浏览: 68572 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论
文章列表
  //需要实现SensorEventListener接口 public class LoversChoise extends Activity implements SensorEventListener{ Button clear; //定义sensor管理器 private SensorManager mSensorManager; //震动 private Vibrator vibrator; public void onCreate(Bundle savedInstanceState) ...
1.数据库的设计 尽量把数据库设计的更小的占磁盘空间. 1).尽可能使用更小的整数类型.(mediumint就比int更合适). 2).尽可能的定义字段为not null,除非这个字段需要null. 3).如果没有用到变长字段的话比如varchar,那就采用固定大小的 ...
#include <stdio.h> void insert(int *arr,int len){ int select; for(int i=1;i<len;i++){ select=arr[i]; int j; for(j=i;j>0&arr[j-1]>select;j--){ arr[j] = arr[j-1]; } arr[j] = select; } } int main(){ int arr[]={1,2,4,3,5}; int len=sizeof(arr)/sizeof(in ...
#include <stdio.h> #include <malloc.h> void selectSort(int* sortArr,int len); int main(void) { // int num[]={3,4,2,1,5,8,7,9,6}; int counts; int i=0; printf("input your num numbers:\n"); scanf("%d",&counts); int *num = (int *)malloc(counts*siz ...
#include <stdio.h> #include <malloc.h> void bubbleSort(int* sortArr,int len); int main(void) { // int num[]={3,4,2,1,5,8,7,9,6}; int counts; int i=0; printf("input your num numbers:\n"); scanf("%d",&counts); int *num = (int *)malloc(counts*s ...
安装php扩展curl的时候 [root@localhost curl]# /home/web/php/bin/phpize [root@localhost curl]# ./configure --with-php-config=/home/web/php/bin/php-config 报错如下 checking for cURL in default path... not found configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/c ...

Django 卸载

如果你打算从过去的一个版本升级Django, 你需要先删除老版本的Django之后, 再安装新的版本. 如果你是通过执行命令 ``setup.py install`` 来安装 Django, 卸载的方法很简单, 只要在``site-packages`` 目录下删除 ``django`` 目录就可以了. 如果你使用 Python egg 来安装 Django, 直接删除 Django ``.egg`` 文件, 并且删除 ``easy-install.pth``中的 egg 引用就可以了. 这个文件应当可以在 ``site-packages`` ...
/* * 中文截取,支持gb2312,gbk,utf-8,big5 * * @param string $str 要截取的字串 * @param int $start 截取起始位置 * @param int $length 截取长度 * @param string $charset utf-8|gb2312|gbk|big5 编码 * @param $suffix 是否加尾缀 */ public function csubstr($str, $start=0, $length, $cha ...

UCenter 通信

UCENTER包含表: | uc_admins | | uc_applications | | uc_badwords | | uc_domains | | uc_failedlogins | | uc_feeds | | uc_friends | | uc_mailqueue | | uc_memberfields | | uc_members | | uc_mergemembers | | uc_newpm | | uc_notelist | | uc_pms | | uc_protectedmembers | | uc_settings | | uc_sq ...
在IE中,高度设置成100%,border设置成1,在IE6,7中会自动适应拉长border,在IE8中则不行,需要设置一个属性overflow:auto,这样就可以了
导入 from django.shortcuts import render_to_response   如果模板有多级目录请搜索模板     get_template()中使用子目录    t = get_template('dateapp/current_datetime.html')
在settings.py里添加'django.contrib.flatpages' 到 INSTALLED_APPS 把 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware' 添加到 MIDDLEWARE_CLASSES 找到当前调试用的域名,修改settings.py里SITE_ID的值 在urls.conf最后添加上 (r'', include('django.contrib.flatpages.urls')), 运行 manage.py syncdb
步骤: 1、修改settings.py。在INSTALLED_APPS设置中添加“django.contrib.admin”。 2、运行python manage.py syncdb更新数据库 3、修改urls.py。改为: # Uncomment the next two lines to enable the admin:from django.contrib import admin admin.autodiscover()   # Uncomment this for admin:    (r'^admin/', include('django.contr ...
 启用'django.contrib.admin'后login到admin显示"You don't have permission to edit anything", 查了下文档http://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf,发现admin.autodiscover()这行注释没去掉,再试就可以编辑了。

php 好的编程习惯

    博客分类:
  • php
0 、用单引号代替双引号来包含字符串,这样做会更快一些。因为 PHP 会在双引号包围的字符串中搜寻变量,单引号则不会,注意:只有 echo 能这么做,它是一种可以把多个字符串当作参数的 “ 函数 ” (译注: PHP 手册中说 echo 是语言结构,不是真正的函数,故把函数加上了双引号)。 1 、如果能将类的方法定义成 static ,就尽量定义成 static ,它的速度会提升将近 4 倍。 2
Global site tag (gtag.js) - Google Analytics