现在位置: 首页 > dark613发表的所有文章
  • 11月
  • 23日
综合 ⁄ 共 5130字 评论关闭
  From Wikipedia, the free encyclopedia Jump to: navigation, search Dynamic loading is a mechanism by which a computer program can, at runtime, load a library (or other binary) into memory, retrieve the addresses of functions and variables contained in the library, execute those functions or access those variables, and unload the library from memory. Unlike static linking and delayed loading, this mechanism allows a computer program to startup in the absence of these libraries, to discov......
阅读全文
  • 03月
  • 13日
综合 ⁄ 共 333字 评论关闭
python和C++/Java不一样,没有主函数一说,也就是说python语句执行不是从所谓的主函数main开始的。 当运行单个python文件时,如运行a.py,这个时候a的一个属性__name__是__main__。 当调用某个python文件时,如b.py调用a.py,这个时候a的属性__name__是模块名a。 a = 3 def change(): global a a = 10 return a print a, change(), a if __name__ == "__main__": print a, change(), a 执行结果是: 3 10 10 10 10 10 从上面的结果可以看出,在执行if后面的语句之前,print a, change(), a已经执行过了,也就......
阅读全文
  • 09月
  • 20日
综合 ⁄ 共 3937字 评论关闭
高级场景处理 使用Sprite Kit涉及到操纵场景树的内容来让内容在屏幕上的动起来。通常情况下,动作是该系统的核心。然而,通过直接地挂接到(hooking into)场景处理,你可以创建动作不能单独完成的其他行为。要做到这一点,你需要学习: ·      场景如何处理动画 ·      如何在场景处理过程中添加自己的行为 场景如何处理动画帧 在传统视图系统中,视图内容渲染一次后,然后只有当模型(model)的内容发生变化时才会再次渲染。这种模式对于视图非常适用,因为在实践中,大多数视图内容是静态的。另一方面,Sprite Kit是明确为动......
阅读全文
  • 08月
  • 13日
综合 ⁄ 共 8171字 评论关闭
J2EE 开发人员使用数据访问对象(Data Access Object DAO)设计模式,以便将低级别的数据访问逻辑与高级别的业务逻辑分离。实现 DAO 模式涉及比编写数据访问代码更多的内容。在本文中,Java 开发人员 Sean C. Sullivan 讨论了 DAO 编程中三个常常被忽略的方面:事务界定、异常处理和日志记录。 在过去 18 个月中,我参加了一个由有才华的软件工程师组成的小组,构建定制的、基于 Web 的供应链管理应用程序。我们的应用程序访问范围广泛的持久性数据,包括配送状态、供应链衡量(metrics)、库存、货运发票、项目管理数据和用户信息。......
阅读全文
  • 05月
  • 21日
综合 ⁄ 共 3265字 评论关闭
一、Map的遍历   import java.util.HashMap; import java.util.Iterator; import java.util.Map; /**  * Map的遍历,这个遍历比较特殊,有技巧  *  * @author leizhimin 2009-7-22 15:15:34  */ public class TestMap {          public static void main(String[] args) {                  Map<String, String> map = new HashMap<String, String>();                  map.put("1" , "a" );                  map.put("2" , "b" );                  map.put("3" , "c" );                  //最简洁、最通用的......
阅读全文
  • 05月
  • 02日
综合 ⁄ 共 802字 评论关闭
蛇形填数(二) 时间限制:2000 ms  |  内存限制:65535 KB 难度:3 描述 1 2 3 4 5 12 13 14 6 11 15 7 10 8 9 跟蛇形填数一样,只是填数要求按照三角形填。注意每组数据之间用空行隔开 输入 第一行有一个N,表示N组测试数据 接下来每组数据包括一个数字X,表示三角形的边长,0< X <1000 输出 输出之后填好之后的图 样例输入 2 5 4 样例输出 1 2 3 4 5 12 13 14 6 11 15 7 10 8 9 1 2 3 4 9 10 5 8 6 7 //和蛇〈一〉的思路一致,预判下一步,控制好边界  #include<cstdio> #include......
阅读全文
  • 05月
  • 02日
综合 ⁄ 共 1586字 评论关闭
带权二分图最大匹配模板O(n^3) const int maxn=31; const int inf=maxint/2; int w[maxn][maxn],x[maxn],y[maxn]; int prev_x[maxn],prev_y[maxn],son_y[maxn],slack[maxn],par[maxn]; int lx,ly,pop; int n,k,m; int mold[310],mnew[310],num_old,num_new; char _old[10010],_new[10010],tmp[10]; void adjust(int v) { son_y[v]=prev_y[v]; if (prev_x[son_y[v]]!=-2) adjust(prev_x[son_y[v]]); } bool find(int v) { int i; for (i=0; i<pop; i++) if (prev_y[i]==-1) { if (slack[i]>x[v]+y[i]-w[v][i]......
阅读全文
  • 02月
  • 14日
综合 ⁄ 共 1468字 评论关闭
认识eval()方法 eval()是js Functions里面的一个方法。和其他很多解释性语言一样,JavaScript同样可以解释运行由JavaScript源代码组成的字符串,并产生一个值。JavaScript通过全局函数eval()来完成这个工作。eval()可以计算某个字符串,并执行其中的javascript代码。 eval()的用法 eval()方法只有一个参数,而且它只接受字符串作为这个参数,如果这个参数不是字符串,那么它将直接返回这个函数。如果该参数是一个函数,它会把字符串当成JavaScript代码进行编译,如果编译失败则抛出一个语法错误异常。如果编译成功,则开始执行这......
阅读全文
  • 01月
  • 23日
综合 ⁄ 共 4081字 评论关闭
/*NSString 常用方法 */         NSString *str0 = @"第一个字符串";         NSString *str1 = [[NSString alloc]initWithString:str0];         NSLog(@"str1 = %@", str1);                  NSString *str2 = [[NSString alloc]initWithFormat:@"第二个字符串"];                  NSLog(@"第%d个字符串 %@", 2, str2);         [str1 release];         [str2 release];                  NSString *name1 = @"宽宽";         NSString *name2 = @"王子洁";                  NSString *pari = [[NSString alloc]init......
阅读全文
  • 01月
  • 20日
综合 ⁄ 共 1058字 评论关闭
文章目录 Description Input Output Sample Input Sample Output 题目链接:http://acm.cist.bnu.edu.cn/contest/contest_problem_show.php?cpid=1777 C: 约数的个数 Time Limit: 6000 ms     Case Time Limit: 2000 ms     Memory Limit: 65535 KBSubmit: 158     Accepted: 24 Description 如果一个整数a能够整除整数b,那么a叫做b的约数。现在有N(1 <= N <= 100,000)个整数,对于其中的每一个数,请找出它在其余N - 1个整数中有多少个约数。 Input 输入数据的......
阅读全文
  • 01月
  • 17日
综合 ⁄ 共 189字 评论关闭
最近要搞android的动态插件,先记录下相关的资料 1.apk动态执行代码:       http://blog.csdn.net/singwhatiwanna/article/details/22597587 2.apk插件资源加载及activity生命周期的管理: http://blog.csdn.net/singwhatiwanna/article/details/23387079
阅读全文
  • 01月
  • 09日
综合 ⁄ 共 2412字 评论关闭
FLAG_ACTIVITY_BROUGHT_TO_FRONT This flag is not normally set by application code, but set for you by the system for the singleTask mode activity. FLAG_ACTIVITY_CLEAR_TOP 砍掉本任务栈里在被启动Activity之上的所有Activity。For example, consider a task consisting of the activities: A, B, C, D. If D calls startActivity() with an Intent that resolves to the component of activity B, then C and D will be finished and B receive the given Intent, resulting in the stack now being: A, B. 此时如......
阅读全文