现在位置: 首页 > oiling发表的所有文章
  • 07月
  • 25日
综合 ⁄ 共 546字 评论关闭
Same Tree Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. 思路: 递归比较即可。 题解: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: bool isSameTree(TreeNode *p, TreeNode *q) { ......
阅读全文
  • 06月
  • 09日
综合 ⁄ 共 13008字 评论关闭
转自:http://hi.baidu.com/hankcs/blog/item/0c460e19b31cc80c35fa41c1.html CREATESTRUCT结构2009-12-23 14:13VisualC++是一种面向对象的可视化编程工具,它提供的AppWizard能自动生成应用程序的标准框架,大大减轻了编程的工作量。本文主要介绍如下的编程技巧:修改主窗口风格、创建不规则形状窗口、用鼠标单击窗口标题条以外区域移动窗口、使用上下文菜单、使应用程序只能运行一个实例、使应用程序显示为任务条通知区中的图标和显示旋转文本等。 1. 修改主窗口风格AppWizard生成的应用程序框架的主窗口具有缺省的窗口风格,比......
阅读全文
  • 05月
  • 28日
移动开发 ⁄ 共 3214字 评论关闭
FAQ of Fix CTS fail  Q1.Ringtone android.media.cts.RingtoneTest -- testRingtone fail junit.framework.AssertionFailedError at android.media.cts.RingtoneTest.testRingtone(RingtoneTest.java:120) A1.由于项目移植,资源文件未全部移植造成ringtone 资源缺少,修改system.prop 中ro.config.ringtone= Q2.StreamingMediaPlayerTest android.media.cts.StreamingMediaPlayerTest -- testHLS fail Test failed to run to completion. Reason: 'Instrumentation run failed due to 'junit.framework.Asser......
阅读全文
  • 02月
  • 16日
综合 ⁄ 共 2582字 评论关闭
Help Me Escape Time Limit: 2 Seconds      Memory Limit: 32768 KB Background     If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him.     And Cain talked with Abel his brother: and it came to pass, when they were in the field, that Cain rose up against Abel his brother, and slew him.     And the LORD said unto Cain, Where is Abel thy brother? And he said, I know not: Am I my b......
阅读全文
  • 11月
  • 09日
综合 ⁄ 共 564字 评论关闭
1. 安装必备的编译环境   sudo apt-get install bison libc6-dev ed python-setuptools python-dev build-essential sudo easy_install mercurial 2. 用mercurial下载最新go的编译环境   hg clone -r release https://go.googlecode.com/hg/ go 卡住 hg clone -u release https://code.google.com/p/go suck 主要是因为那堵墙 只能手动到https://code.google.com/p/go下载源文件(go1.1.2.src.tar.gz) 3. (go只会默认安装在解压缩的目录下,这就需要在步骤5中设置) cd go/src ./all.bash 4. 当显示测试用例都正确后,表明go......
阅读全文
  • 06月
  • 05日
综合 ⁄ 共 3824字 评论关闭
1.基本概念 IO是主存和外部设备(硬盘、终端和网络等)拷贝数据的过程。IO是操作系统的底层功能实现,底层通过I/O指令进行操作。 所有的语言在运行系统都提供了执行I/O较高级别的工具(C的printf、scanf;java的面向对象封装)。 2.java标准IO回顾 java标准IO类库是IO面向对象的一种抽象。基于本地方法的底层实现,我们无须关注底层实现。如InputStream/OutputStream(字节流)是一次传送一个字节。Reader/Writer(字符流):一次一个字符。 3.NIO简介 NIO是java New IO的简称,在jdk1.4里提供了新的API。sun官方标榜的特性如下: ——为所......
阅读全文
  • 05月
  • 02日
综合 ⁄ 共 2023字 评论关闭
Best Cow Line Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11321   Accepted: 3347 Description FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges. The contest organizers adopted a new registration scheme this year: simply register the initial letter of every cow in the order they will appear (i.e., If FJ takes Bessie, Sylvia, and D......
阅读全文
  • 04月
  • 21日
综合 ⁄ 共 13581字 评论关闭
http://blog.csdn.net/innost/article/details/8246808 目录(?)[+] 随笔之GoldFish Kernel启动过程中arm汇编分析 一  分析 电子版下载地址:进入我的资源就能找到 http://download.csdn.net/detail/innost/4834459 本节介绍Kernel启动。此时Piggy已经将vimlinux解压,BL将执行权限传给了Kernel。 代码在arch/arm/kernel/head.S中。相关代码如下: //将采用C/C++注释语句 /*    .section是GNU ASM的语法。格式如下:     .section name[,"flags"[,@type]]   其中,name是必须的,flags是可选。     "ax"表示:a为section is a......
阅读全文
  • 04月
  • 18日
综合 ⁄ 共 399字 评论关闭
  <action name="addRole" class="roleAction" method="createRole"> <result name="success" type="redirect">listRole.action</result> <result name="error">/fail.jsp</result> <result name="input">/roleAdd.jsp</result> </action> type="redirect"的意思是重定向到另一个action的方法     当type为chain 时,说明是action链,运行完第一个action java文件接着会运行第二个action JAVA 文件,相当于forward(客户端的url不会改变).当type为redirect-action时,说......
阅读全文
  • 03月
  • 22日
综合 ⁄ 共 211字 评论关闭
Lucene的基础概念: apache lucene介绍 Lucene:基于Java的全文检索引擎简介         Lucene3.0.0讲解  由于lucene3.0与之前版本相差较大,所以我特别选出来讲 Lucene3.0改进 Lucene3.0.0 入门实例 Lucene学习总结之一:全文检索的基本原理 Lucene学习总结之二:Lucene的总体架构     相关概念: Apache Solr 介绍(1) 当前几个主要的Lucene中文分词器的比较
阅读全文
  • 01月
  • 21日
综合 ⁄ 共 2827字 评论关闭
Tree 时间限制:1000 ms  |  内存限制:65535 KB 难度:3 描述 Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes.  This is an example of one of her creations:  D / \ / \ B E ......
阅读全文
  • 12月
  • 15日
综合 ⁄ 共 1522字 评论关闭
  我想熟悉Arrays.sort()方法的朋友,无疑肯定是掌握了如何对基本类型的数组进行排如序,而在这里,我想说一下,如何对自定义类对象的数组进行排序? 例如,我定义一个Student类,拥有两个属性,即姓名(String name)和年龄(int age),如果现在我声明了一个Student类的对象数组,那么,如何利用Arrays.sort()方法对这个自定义对象数组加以排序呢? 其实,很简单,只需要做到以下3点即可: 首先,让需要进行排序的自定义类,如Student,去实现Comparable 接口; 其次,重写Comparable接口唯一的方法:int compareTo(Object o......
阅读全文