`
云之遥
  • 浏览: 7796 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
1. 得到list大小 <#if proList?size gt 0>

mysql 基本操作

    博客分类:
  • db
1. 表操作 1.1创建表 create table user ( `id` int auto_increment not null comment 'id', `class_id` int comment '班级id', `name` varchar not null comment '学生姓名', primary key `id` ) 1.2修改表名 alter table user rename to my_user; 2. 字段操作 2.1添加字段 alter table user add e_mail varchar comment '邮箱'; 2.2修改字段 a ...

mac nginx 安装

1. 在官网下载源文件 在http://nginx.org/en/download.html下载nginx 2. 解压缩 tar -xzf nginx-1.2.5.tar.gz 3. 进入解压后文件目录,修改操作权限 chmod a+rwx 4. 生成安装配置 ./configure --without-http_rewrite_module 5. make安装 make install 6. 在/etc/profile中加入nginx目录 export PATH=/usr/local/nginx/sbin:$PATH 7. 完成 which nginx

运算技巧

1.m % n ,当 n 为 2 的幂的时候,可以用如下运算代替: m & (n - 1) 效率非常高,理论纯数学,可以自己验证。
1. 给出一个二维数组,例子如下: {{2, 3, 4}, {11, 12, 5}, {10, 13, 6}, {9, 8, 7}}; 要求按照顺时针螺旋式输出,结果如下: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 怎样实现? 网上搜到的题目。实现代码如下: http://zhang-saiyong.iteye.com/blog/1680142 扩展:如果数组长度不一致怎样实现..
package algorithm; public class ArrayHelix { public static Integer[][] doubleArray = new Integer[][]{{2, 3, 4}, {11, 12, 5}, {10, 13, 6}, {9, 8, 7}}; public static void example() { char[] dire = {'E', 'S', 'W', 'N'}; char p = dire[ ...
1. 使用O(n)时间复杂度求最大子序列问题。 比如数组{1, -2, 3, 10, -4, 7, 2, -5} 最大子序列为 {3,10,-4,7,2} ----------------- 我昨天实现了下: http://zhang-saiyong.iteye.com/blog/1674650
package algorithm; /** * o(n)得到最大子序列问题 * @author sai * */ public class MaxSubSequence { public static Integer[] sequence = {10, -2, 3, 10, -4, 7, 2, -5}; public static void main(String[] args) { maxSub(); } public static Integer[] maxSub() { int left = 0; int righ ...
Global site tag (gtag.js) - Google Analytics