现在位置: 首页 > zyj1385发表的所有文章
  • 04月
  • 05日
综合 ⁄ 共 1824字 评论关闭
学习二叉排序树时写的代码。 二叉排序树是一颗动态,是在动态的过程中生成的,不是一成不变的。 特点是:根节点左边的比根节点的值小,右边的值比根节点大,平均查找复杂度为O(log2*n); 用二维指针来建树,注意new node(),返回的是结构体指针。 #include <iostream> #include <cstdlib> #include <cstdio> #include <string> #include <cstring> #include <cmath> #include <vector> #include <queue> #include <algorithm> #include <map> #include <......
阅读全文
  • 03月
  • 30日
综合 ⁄ 共 851字 评论关闭
汇编指令CLI/STI   CLI禁止中断发生 STL允许中断发生        这两个指令只能在内核模式下执行,不可以在用户模式下执行;而且在内核模式下执行时,应该尽可能快的恢复中断,因为CLI会禁用硬件中断,若长时间禁止中断会影响其他动作的执行(如移动鼠标等等),系统就会变得不稳定。在标志寄存器中中断标志清零的情况下,可以以“int  ××”的形式调用软中断。        程序员可以改变段地址和偏移地址,但是在这个过程中如果需要改变段寄存器SS和SP必须禁止中断,当改变完成后再恢复中断(也就是说在cli指令后需要有与其配对的s......
阅读全文
  • 05月
  • 28日
综合 ⁄ 共 45字 评论关闭
Java 的 compareTo想等的时候返回0,搞成返回1了,这个错误找了半天才找出来 坑爹啊
阅读全文
  • 05月
  • 11日
综合 ⁄ 共 10018字 评论关闭
http://www.devdiv.com/android/docs/resources/articles/on-screen-inputs.html   因google总被墙. http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html One of the major new features we are introducing in Android 1.5 is our Input Method Framework (IMF), which allows developers on-screen input methods such as software keyboards. This article will provide an overview of what Android input method editors (IMEs) are, and what an application developer needs to do ......
阅读全文
  • 05月
  • 02日
综合 ⁄ 共 2020字 评论关闭
 B. Appleman and Card Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Appleman has n cards. Each card has an uppercase letter written on it. Toastman must choose k cards from Appleman's cards. Then Appleman should give Toastman some coins depending on the chosen cards. Formally, for each Toastman's card i you should calculate how much Toastman's cards have the letter equal to letter on ith, then sum up all ......
阅读全文
  • 04月
  • 04日
综合 ⁄ 共 314字 评论关闭
自动关机掉的是./frameworks/base/services/java/com/android/server/ShutdownActivity.java: Intent intent = new Intent(Intent.ACTION_REQUEST_SHUTDOWN); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  intent.putExtra("android.intent.extra.KEY_CONFIRM", false); startActivity(intent); Intent.ACTION_REQUEST_SHUTDOWN是Intent里面一个隐藏的action。
阅读全文
  • 02月
  • 16日
综合 ⁄ 共 3876字 评论关闭
http://emuch.net/bbs/viewthread.php?tid=2634085&fpage=2   本世纪初,美国物理学会(American Institute of Physics)和IEEE计算机社团 (IEEE Computer Society)的一本联合刊物《科学与工程中的计算》发表了由田纳西大学的Jack Dongarra和橡树岭国家实验室的Francis Sullivan 联名撰写的“世纪十大算法”一文,该文“试图整理出在20世纪对科学和工程领域的发展产生最大影响力的十大算法”。作者苦于“任何选择都将是充满争议的, 因为实在是没有最好的算法”,他们只好用编年顺序依次列出了这十项算法领域人类智慧的巅峰之作——给出......
阅读全文
  • 12月
  • 24日
综合 ⁄ 共 599字 评论关闭
今天安装在linux上安装了phpunit,使用的时候遇到了这个情况 $:/usr/bin$ phpunit PHP Warning:  require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38 PHP Fatal error:  require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/phpunit on line 38 在网上查了下,是phpunit的一个bug,然后有人提供了一个workaround: sudo apt-get remove phpunitsudo pear channe......
阅读全文
  • 12月
  • 12日
综合 ⁄ 共 3字 评论关闭
     
阅读全文
  • 12月
  • 10日
综合 ⁄ 共 2400字 评论关闭
1.栈的顺序表示与实现 /* * $filename: MyArrayStack.java,v $ * $Date: 2014-3-11 $ * Copyright (C) ZhengHaibo, Inc. All rights reserved. * This software is Made by Zhenghaibo. */ package edu.njupt.zhb; /* *@author: ZhengHaibo *web: http://blog.csdn.net/nuptboyzhb *mail: zhb931706659@126.com *2014-3-11 Nanjing,njupt,China */ /** * 使用数组方式实现栈 * @author Administrator * */ public class MyArrayStack { final int INIT_LEN = 10;//初始化长度 final int INCREAMENT_LE......
阅读全文
  • 11月
  • 16日
综合 ⁄ 共 119字 评论关闭
必要条件:子树之间不可以相互干扰,如果本来是相互干扰的,                    那么我们必须添加变量使得他们不相互干扰。 树形动态规划通常从叶节点(边界)开始逐步向上一层的节点(即父节点)进行状态方程的转移,直到根节点。 常见类型:树形分组背包
阅读全文
  • 11月
  • 15日
综合 ⁄ 共 7422字 评论关闭
Inverted Index Summarizations Pattern Description 反向索引模式在MapReduce分析中经常作为一个例子。我们将会讨论我们要创建的term跟标识符之间映射的一般情况。   Intent 根据数据集生成索引,用于快速搜索或数据的富集能力。 Motivation 根据关键词索引大数据非常方便,搜索能追踪term找到包含指定值的记录。创建索引需要之前进行额外的处理,花时间去做这项工作能有效减少我们寻找东西的时间。   搜索引擎为了提高搜索性能创建索引。设想键入一个关键词,让引擎去互联网抓取信息并创建一个页面的列表返回给你。这样的查询会......
阅读全文