现在位置: 首页 > Uncodadvasend发表的所有文章
  • 05月
  • 22日
综合 ⁄ 共 764字 评论关闭
import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Method; public class ReflectTest {    public static void main(String[] args) throws Exception {   Class clazz = Class.forName("TaskProvidePropsList");//这里的类名是全名。。有包的话要加上包名   Object obj = clazz.newInstance();   Field[] fields = clazz.getDeclaredFields();   //写数据   for(Field f : fields) {    PropertyDescriptor pd = new PropertyDescriptor(f.getName(), clazz);    Method wM =......
阅读全文
  • 10月
  • 12日
综合 ⁄ 共 1441字 评论关闭
HDU Aragorn's Story 题目链接 树抛入门裸题,这题是区间修改单点查询,于是套树状数组就OK了 代码: #include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespace std; const int N = 50005; inline int lowbit(int x) {return x&(-x);} int dep[N], fa[N], son[N], sz[N], top[N], id[N], idx; vector<int> g[N]; int bit[N]; int n, m, p, val[N]; void dfs1(int u, int f, int d) { dep[u] = d; sz[u] = 1; fa[u] = f; son[u] = 0; for ......
阅读全文
  • 08月
  • 07日
综合 ⁄ 共 3694字 评论关闭
  迄今为止,您已经用 Groovy 输出了许多次 “Hello World”,已经操作了集合,用闭包在集合上迭代,也定义了您自己的闭包。做所有这些工作时,甚至还没有讨论那个对 Java 开发人员来说至关重要的概念 — 类。 当然,您已经在这个教程中使用过类了:您编写的最后几个示例就是在不同类的 main() 方法中。而且,您已经知道,在 Groovy 中可以像在 Java 代码中一样定义类。惟一的区别是,不需要使用 public 修改符,而且还可以省略方法参数的类型。这一节将介绍使用 Groovy 类能够进行的其他所有操作。 Song 类 我们先从用 Groovy 定义......
阅读全文
  • 07月
  • 29日
综合 ⁄ 共 364字 评论关闭
- (void)viewDidLoad { [super viewDidLoad]; MyClass *myc = [[MyClass alloc] init]; NSLog(@"在刚实例化的时候:"); NSLog(@"myc.retainCount = %d",myc.retainCount); NSLog(@"myc:%@",myc); NSLog(@"\n"); [self doSomething:myc]; } - (void)doSomething:(MyClass *)myClass { NSLog(@"被当作参数传递后:"); NSLog(@"myc.retainCount = %d",myClass.retainCount); NSLog(@"myc:%@",myClass); } 输出结果: 事实证明,函数参数是通过assign的形式传入函数体内供函数调用的。
阅读全文
  • 05月
  • 04日
综合 ⁄ 共 1333字 评论关闭
 http://hupy.javaeye.com/blog/453908 http://hi.baidu.com/jabber/blog/item/978e9125c668f76534a80fab.html MySQL 分表分数据库服务器的一种方案HSCALE, 基于MySQL proxy 2008-06-14 01:34 在大型的应用中,我们经常碰到MySQL的表数据需要无限扩充的情形。我们通常有以下一些解决方案,但是现成的方案都不是完美的。 比如,MySQL master/slave: 只适合大量读的情形,未必适合海量数据。MySQL cluster: 提供的可能不是大家想要那种功能。MySQL proxy: MySQL master/slave配合MySQL 5.1 partition: 只是将一个表存储上逻辑......
阅读全文
  • 04月
  • 13日
综合 ⁄ 共 22375字 评论关闭
转自:http://blog.csdn.net/shirdrn/article/details/7105539 MongoDB是一个NoSQL数据库系统:一个数据库可以包含多个集合(Collection),每个集合对应于关系数据库中的表;而每个集合中可以存储一组由列标识的记录,列是可以自由定义的,非常灵活,由一组列标识的实体的集合对应于关系数据库表中的行。下面通过熟悉MongoDB的基本管理命令,来了解MongoDB提供的DBMS的基本功能和行为。 MongoDB命令帮助系统 在安装MongoDB后,启动服务器进程(mongod),可以通过在客户端命令mongo实现对MongoDB的管理和监控。看一下Mong......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 3402字 评论关闭
分类: 数据结构   可持续化线段树。 我是看这个看懂的http://hi.baidu.com/wyl8899/item/e00796a9cb2df73d020a4d68 可持续化线段树,主要思想就是利用历史信息,减少时间和内存花销。 比方有两棵线段树,但是他们只有一个节点信息不同。仔细一想,在这两颗线段树上,对应的 [l,r]节点  只有log(n)个节点不同。那么,除了不同的节点,其他节点信息,他们完全可以共用。 关于这题解法,我就复制别人的话了(  好懒啊 o(╯□╰)o ) 考虑把权值离散化,然后用线段树解决问题。 对于一个询问(x,y,k),如果已经把a[x]..a[y]建成了一......
阅读全文
  • 04月
  • 10日
综合 ⁄ 共 261字 评论关闭
UE编辑器设置成了移动窗口,当有多个页面的时候,切换很麻烦,想要将UltraEdit设置 为tab页签显示, 视图--->视图/列表--->打开文件标签。 看到后面加个.bak后缀的文件有时真的很烦,而且还容易搞混,下面的方法可以解除这种烦恼。版本不同可以会有些差别。 英文版按照如下顺序设置: Menu: Advanced --> Confiugration --> File Handling --> Backup --> Select No Backup option 中文版按照如下顺序设置:高级--> 配置 --> 文件处理 --> 备份,选择右侧的不备份即可
阅读全文
  • 04月
  • 08日
综合 ⁄ 共 1906字 评论关闭
--:sys1.create tablespace adduser_own datafile '/opt/oracle/oradata/adduser01.dbf' size 10m;2.create temporary tablespace adduser_own_tmp tempfile '/opt/oracle/oradata/adduser_tmp01.tmp' size 100m;3.create user adduser_own identified by adduser_own default tablespace adduser_own temporary tablespace adduser_own_tmp;4.create user adduser identified by adduser default tablespace admin temporary tablespace adduser_own_tmp;5.grant obj_own_user to adduser_own;  grant obj_use_user to adduser;6.......
阅读全文
  • 03月
  • 31日
综合 ⁄ 共 828字 评论关闭
Length of Last Word Given a string s consists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is defined as a character sequence consists of non-space characters only. For example, Given s = "Hello World", return 5. 思路: 一些想法:首先可以用strlen走一遍字符串,直到碰到\0结束符号,然后从字符串的最后一个非空格字符向前回退,直到碰到空格或者字符串的开头。这样最坏情况下时间复......
阅读全文
  • 03月
  • 31日
综合 ⁄ 共 1035字 评论关闭
Distinct Subsequences Given a string S and a string T, count the number of distinct subsequences ofT in S. A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie,"ACE" is a subsequence of "ABCDE" while "AEC" is not). Here is an example:S = "rabbbit", T = "rabbit" Return 3. 思路: 如果搜索解空间肯定超时。那么考虑用动态规划填表来做。例如题......
阅读全文
  • 02月
  • 17日
综合 ⁄ 共 1371字 评论关闭
try {             Thread.sleep(10);                          Toast.makeText(getApplicationContext(),                     "睡醒了",                     Toast.LENGTH_LONG).show();         } catch (InterruptedException e1) {                      e1.printStackTrace();         }         new Thread(new Runnable() {                          @Override             public void run() {                                  try {                                          Toast.makeText(getApplicationContex......
阅读全文