现在位置: 首页 > toru发表的所有文章
  • 11月
  • 09日
综合 ⁄ 共 67字 评论关闭
一般可能是迭代次数太多,数组开太大,用scanf的时候忘记用地址符,有些测试数据处理不了。 比较特殊的情况是,代码有时候太多了,也会爆。
阅读全文
  • 03月
  • 30日
综合 ⁄ 共 65字 评论关闭
linux设备驱动程序学习笔记.doc 转自:http://my.oschina.net/accesssoul/blog/61401
阅读全文
  • 09月
  • 30日
综合 ⁄ 共 1356字 评论关闭
求 数组里 和为s的所有组合 关键在于去重,但是去重的方式也很简单。 public ArrayList<ArrayList<Integer>> combinationSum(int[] candidates, int target) { if (candidates == null) return null; Arrays.sort(candidates); boolean[] used = new boolean[candidates.length]; ArrayList<Integer> list = new ArrayList<Integer>(); find(0, target, list, candidates, 0, used); return cases; } ArrayList<ArrayList<Integer>> cases = new ArrayList<Ar......
阅读全文
  • 08月
  • 29日
web前端 ⁄ 共 212字 评论关闭
1.将iTween.cs拖到asset中的Plugins文件夹中(如果没有则自己新建) 2.将iTweenPath.cs 拖到asset中的Plugins文件夹中(如果没有则自己新建) 3.将iTweenPathEditor.cs 拖到asset中的Editor中(如果没有则自己新建) 如此便可在javascript中正常调用iTween以及iTweenPath类 否则会出现 “UnityEditor” can not be found 等错误
阅读全文
  • 05月
  • 19日
综合 ⁄ 共 1596字 评论关闭
JSON-taglib是一套JSP标签库用于在JSP代码中输出JSON格式的数据。JSON-taglib利用json:array, json:object和json:property来实现数据格式的转换。 下面是具体用法: Just drop the json-taglib.jar file into the WEB-INF/lib directory of your web-application. Here's a quick example of how the taglib could be used with an AJAX e-commerce shopping cart. Check out the examples or the tutorial for full details of how to use the taglib. 调用方法: <%@ taglib prefix="json" uri="http://www.atg.com/t......
阅读全文
  • 04月
  • 22日
综合 ⁄ 共 1145字 评论关闭
闭包是功能性自包含模块,可以在代码中被传递和使用。与objective-c中的block比较类似。 闭包有三种形式: 1、全局函数 2、嵌套函数 3、闭包表达式是一个利用轻量级语法所写的可以捕获其上下文中变量或常量值的没有名字的闭包 闭包表达式是一种利用简洁语法构建内联闭包的方式。 闭包表达式提供了一些语法优化, 使得撰写闭包变得简单明了。 闭包的一般形式: { (parameters) -> return type in statements } 以swift提供的sort函数为例: 对一个数组进行排序: 普通函数的做法是: let names = ["Chris", "Alex", "Ewa", "Bar......
阅读全文
  • 04月
  • 20日
综合 ⁄ 共 4767字 评论关闭
笔记:本文主要讲述类加载的过程和 jvm 执行一个函数时 jvm 运行时数据区中 java 栈数据交换的详细过程 一、类加载器 首先来看一下java程序的执行过程。                           从这个框图很容易大体上了解java程序工作原理。首先,你写好java代码,保存到硬盘当中。然后你在命令行中输入 [java] view plaincopy javac YourClassName.java   此时,你的java代码就被编译成字节码(.class).如果你是在Eclipse IDE或者其他开发工具中,你保存代码的时候,开发工具已经帮你完成了上述的编译工作,因此你可以......
阅读全文
  • 04月
  • 04日
综合 ⁄ 共 0字 评论关闭
  • 04月
  • 04日
综合 ⁄ 共 130字 评论关闭
将一个imageView对象转换为Bitmap对象,具体方法如下: BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable(); Bitmap bitmap = drawable.getBitmap();
阅读全文
  • 02月
  • 11日
综合 ⁄ 共 2049字 评论关闭
作者:朱冬华 更新时间: 2005-05-11     #include <stdio.h># include<stdlib.h>#define stacksize 100typedef int datatype;typedef struct{   datatype data[stacksize];        int  top;}seqstack;typedef struct node{   datatype  data;   struct node *next;}listnode;typedef listnode *linklist;linklist head;linklist p;int count;linklist creatlist(int n){  linklist head;  listnode *p1,*p2;  int i;  head=(linklist)malloc(sizeof(listnode));  head->next=NULL;   p2=head;  pri......
阅读全文
  • 02月
  • 05日
综合 ⁄ 共 824字 评论关闭
public class Test {     public static void main(String[] args) {         Integer i1 = 100;         Integer i2 = 100;         if(i1 == i2){             System.out.println("==");         }else{             System.out.println("!=");         }                 Integer i3 = 200;         Integer i4 = 200;         if(i3 == i4){             System.out.println("==");         }else{             System.out.println("!=");         }     } } 结果为 == != 原因Integer 类会缓存-128 到 127 之间的整......
阅读全文
  • 12月
  • 11日
综合 ⁄ 共 229字 评论关闭
开始写写博客,做做笔记,学习学习。 //生成数字系列:1 2 1 2 2 4 3 6 5 10 //数列规律:a2a b2b a+b2(a+b) ...... #include <stdio.h> int main() { int a = 1, b = 1, i = 0; while(i != 5) { printf("%d ", a); printf("%d ", a * 2); printf("%d ", b); printf("%d ", b * 2); a += b; b += b; i++; } printf("\r\n"); return 0; } 运行结果如下:
阅读全文