现在位置: 首页 > yurt发表的所有文章
  • 11月
  • 21日
编程语言 ⁄ 共 8558字 评论关闭
非原创,原文转自:http://www.yuanyong.org/blog/cv/cv-code-two Feature Detection and Description General Libraries:  VLFeat – Implementation of various feature descriptors (including SIFT, HOG, and LBP) and covariant feature detectors (including DoG, Hessian, Harris Laplace, Hessian Laplace, Multiscale Hessian, Multiscale Harris). Easy-to-use Matlab interface. See Modern features: Software – Slides providing a demonstration of VLFeat and also links to other software. Check also VLFeat ......
阅读全文
  • 08月
  • 16日
综合 ⁄ 共 1147字 评论关闭
题目链接:uva 11235 - Frequent values 题目大意:给定一个非降序的整数数组,要求计算对于一些询问(i,j),回答ai,ai+1,…,aj中出现最多的数出现的次数。 解题思路:因为序列为非降序的,所以相同的数字肯定是靠在一起的,所以用o(n)的方法处理处每段相同数字的区间。然后对于每次询问: num[i]=num[j]:j−i+1 numi≠numj:max(RMQ(righti+1,reftj−1),max(righti−i+1,j−leftj+1)) #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int maxn = 1e5+5; int N, Q, num[m......
阅读全文
  • 07月
  • 25日
综合 ⁄ 共 1082字 评论关闭
Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1. 思路: 二叉树平衡的条件是左子树平衡且右子树平衡且左右子树的高度相差最多为1。基于这个思路递归处理。 题解: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x)......
阅读全文
  • 02月
  • 22日
综合 ⁄ 共 1375字 评论关闭
一、补码的补码是原码的解释。         假设一个负数 x 用 8 二进制 位表示,则补码 =  2^8 - | x |  ,那么再求补码 = 2^8 - ( 2^8 - | x | ) = 此数的原码  二、int  取值范围 - 2^15 ~ 2^15 - 1 的解释        因为数再计算机里存储是以二进制的补码形式存储的,正数的二进制还是正数所以范围是 0000 0000 0000 0000 ~ 0111 1111 1111 1111 (0 ~ 2^15-1),负数范围为  1000 0000 0000 0000 ~ 1111 1111 1111 1111 (是以补码方式存储的,将其取出符号位然后取反加 1 就得到了其原码 )  - 2^15 ~ -1 。 三、关于计算机采用补码存......
阅读全文
  • 11月
  • 07日
综合 ⁄ 共 4305字 评论关闭
1 TreeSet介绍 TreeSet实现了接口Serializable, Cloneable, Iterable<E>, Collection<E>, NavigableSet<E>, Set<E>, SortedSet<E>。 public class TreeSet<E> extends AbstractSet<E> implements NavigableSet<E>, Cloneable, java.io.Serializable { /** * The backing map. */ private transient NavigableMap<E,Object> m; // Dummy value to associate with an Object in the backing Map private static final Object PRESENT = ne......
阅读全文
  struts2.X心得6--动态方法、通配符、常量案例分析 [java] view plaincopyprint? 1.常量、全局视图的案例分析,主要内容就是在配置文件中添加的常量或全局视图标签以及讲struts.xml参数带过去   外部引进的配置文件struts-constant.xml   <?xml version="1.0" encoding="UTF-8"?>    <!DOCTYPE struts PUBLIC       "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"       "http://struts.apache.org/dtds/struts-2.3.dtd">   <struts>       <!-- 常用的常量介绍,......
阅读全文
  • 05月
  • 23日
综合 ⁄ 共 229字 评论关闭
<i></i>              使文字倾斜, <em></em>    强调标签,也是斜体 <b></b>            使文字加粗 <strong></strong>  特别强调标签 <          &lt >          &gt <xmp></xmp>  原样显示   无序 <ul >            <li></li>      <li></li> </ul>   有序 <ol >            <li></li>      <li></li> </ol>        
阅读全文
  • 05月
  • 19日
综合 ⁄ 共 7545字 评论关闭
前篇关于Spring Batch的文章,讲述了Spring Batch 对CSV文件的读写操作。 本文将通过一个完整的实例,与大家一起讨论运用Spring Batch对XML文件的读写操作。实例流程是从一个XML文件中读取商品信息,经过简单的处理,写入另外一个XML文件中。      工程结构如下图:                              log4j.xml是log处理的配置文件,与本文没有必然联系,再此不做论述。      application.xml文件内容如下: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/bean......
阅读全文
  • 05月
  • 06日
综合 ⁄ 共 506字 评论关闭
1.select d.id,d.outer_code from  dict_depts_source d order by outer_code(查看重复数据) 2.select d.id,d.outer_code,row_number() over(partition by outer_code order by outer_code) row_flag from  dict_depts_source d(标识重复数据) 3.delete from dict_depts_source where id in(select id from(select d.id,d.outer_code,row_number() over(partition by outer_code order by outer_code) row_flag from  dict_depts_source d)twhere t.row_flag > 1)(删除重复数据) 3.select d.id,d.outer_code,row_number() ov......
阅读全文
  • 04月
  • 30日
综合 ⁄ 共 441字 评论关闭
用递归实现对N个元素的排列: template<class  Type> void Perm(Type list[], int k, int m) {     if ( k == m)  // 单元素排列       {             for ( int i = 0; i <= m; i++ )                   cout<<list[i];             cout<<endl;        }       else  // 多元素排列,递归产生排列        {             for ( int i = k; i <= m; i++ )               {                   swap(list[k],list[i];  // 将元素提到前面的位置(相对的第一个位置),逐步往前提                  Perm(list......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 2650字 评论关闭
谱聚类算法(Spectral Clustering) 谱聚类(Spectral Clustering, SC)是一种基于图论的聚类方法——将带权无向图划分为两个或两个以上的最优子图,使子图内部尽量相似,而子图间距离尽量距离较远,以达到常见的聚类的目的。其中的最优是指最优目标函数不同,可以是割边最小分割——如图1的Smallest cut(如后文的Min cut), 也可以是分割规模差不多且割边最小的分割——如图1的Best cut(如后文的Normalized cut)。 图1 谱聚类无向图划分——Smallest cut和Best cut 这样,谱聚类能够识别任意形状的样本空间且收敛于全局最优解,其基本......
阅读全文
  • 01月
  • 09日
综合 ⁄ 共 2589字 评论关闭
Monkey工具 前言: 最近开始研究Android自动化测试方法,对其中的一些工具、方法和框架做了一些简单的整理,其中包括android测试框架、CTS、Monkey、Monkeyrunner、benchmark、其它test tool等等。因接触时间很短,很多地方有不足之处,希望能和大家多多交流。 一、 什么是Monkey Monkey是Android中的一个命令行工具,可以运行在模拟器里或实际设备中。它向系统发送伪随机的用户事件流(如按键输入、触摸屏输入、手势输入等),实现对正在开发的应用程序进行压力测试。Monkey测试是一种为了测试软件的稳定性、健壮性的快速有效的方法......
阅读全文