上一页 1 ··· 204 205 206 207 208 209 210 211 212 ··· 300 下一页
2013年8月16日

Android编程心得-设计一个可重用的自定义Dialog

摘要: 我们在实际开发过程中,会遇到一个问题,我们的Dialog如果使用一般的方法进行设置调用出来,会有很多的重复代码,如何将Dialog按照自己的思路设计呢,并让其可重用呢,下面我来介绍一下我的方法首先,设计Dialog的布局文件,代码如下,大家可以按照自己想要的方式设计适合自身APP的UI。 重点来了,我们设计完布局文件后,接下来就是要编写自定义Dialog的逻辑了,这里需要注意的... 阅读全文
posted @ 2013-08-16 19:41 you Richer 阅读(249) 评论(0) 推荐(0)

hdu 1026 Ignatius and the Princess I【优先队列+BFS】

摘要: 链接: http://acm.hdu.edu.cn/showproblem.php?pid=1026 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=29096#problem/D Ignatius and the Princess I Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10006Accepted Submission(s): 300... 阅读全文
posted @ 2013-08-16 19:39 you Richer 阅读(231) 评论(0) 推荐(0)

POJ 3261 Milk Patterns(后缀数组+二分答案+离散化)

摘要: 题意:给定一个字符串,求至少出现k 次的最长重复子串,这k 个子串可以重叠。分析:经典的后缀数组求解题:先二分答案,然后将后缀分成若干组。这里要判断的是有没有一个组的符合要求的后缀个数(height[i] >= mid)不小于k。如果有,那么存在 k 个相同的子串满足条件,否则不存在。#include #include #include #include using namespace std;#define N 22222#define M 1111111#define INF 0x7FFFFFFF/****后缀数组模版****/#define F(x)((x)/3+((x)%3==1 阅读全文
posted @ 2013-08-16 19:37 you Richer 阅读(172) 评论(0) 推荐(0)

poj1920 Towers of Hanoi

摘要: 关于汉诺塔的递归,记住一个结论是,转移n个盘子至少需要2^n-1步 #include#include#include#include#include#includeusing namespace std;int two[100005],pos[100005];int main(){ int n,nn[5],i,j,ans,now,end,mid,a; two[0]=1; for(i=1;i0) { if(end!=now) { ans=(ans+two[n-1])%1000000; ... 阅读全文
posted @ 2013-08-16 19:32 you Richer 阅读(196) 评论(0) 推荐(0)

Hadoop: the definitive guide 第三版 拾遗 第十章 之Pig

摘要: 概述: Pig的安装很简单,注意一下几点:1、设置系统环境变量: export PIG_HOME=.../pig-x.y.zexport PATH=$PATH:$PIG_HOME/bin设置完成后使用pig -help进行验证一下。2、两种mode:local mode:访问本地文件系统,进入shell时使用命令:pig -x localMapReduce mode:pig将查询翻译为MapReduce作业,然后在hadoop集群上执行。此时,进入shell时的命令为:pig -x mapreduce 或者pighadoop@master:/usr/local/hadoop/conf$ pig 阅读全文
posted @ 2013-08-16 19:30 you Richer 阅读(304) 评论(0) 推荐(0)

[置顶] 自定义java Annotation快速入门与提高

摘要: 我们先来看看一个简单的注解类定义import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented public. 阅读全文
posted @ 2013-08-16 19:28 you Richer 阅读(225) 评论(0) 推荐(0)

UVA 10020 Minimal coverage(贪心 + 区间覆盖问题)

摘要: Minimal coverageThe ProblemGiven several segments of line (int the X axis) with coordinates [Li,Ri]. You are to choose the minimal amount of them, such they would completely cover the segment [0,M].The InputThe first line is the number of test cases, followed by a blank line.Each test case in the in 阅读全文
posted @ 2013-08-16 19:26 you Richer 阅读(256) 评论(0) 推荐(0)

JavaScript 中的日期和时间

摘要: 前言本篇的介绍涵盖以下部分:1. 时间标准指的是什么?UCT和GMT 的概念、关联和区别? 2. 时间表示标准有哪些?3. JS 中时间的处理日期时间标准日期的标准就不多说了 -- 公元纪年 是为纪念犹太人耶稣(基督)的诞生。他诞生的那一年为公元1年,诞生之前的年份称为“公元前n年”简单来说,时间的标准就是以什么时间为起点开始计时。对于年份来说,举例来说,如果不使用公元纪年法,估计全世界交流起来就困难重重了(新中国54年,估计很把很多老外整晕)时间标准其实挺多的。 原子时 · 协调世界时(UTC) · 格林尼治平时(GMT) · 地球时(TT) · 力学 阅读全文
posted @ 2013-08-16 19:23 you Richer 阅读(402) 评论(0) 推荐(0)

HDU 4679 String

摘要: String Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 695Accepted Submission(s): 254 Problem Description Given 3 strings A, B, C, find the longest string D which satisfy the following rules: a) D is the subsequence of A b) D is the su... 阅读全文
posted @ 2013-08-16 19:21 you Richer 阅读(134) 评论(0) 推荐(0)

poj2947

摘要: 高斯消元法模版题,但套模版没用。。先回顾一下线性代数的知识。若要求解如下方程: 首先,其系数矩阵为 然后,其增广矩阵为: 然后若要求解这个方程,首先将第一行第一个元素化为1,即:第一行乘以1/3。 然后将第二、三行减去第一行五倍: 扯淡了不是。。太麻烦了。。。额,我不会告诉你我用matlab做的。。a = [3,2,4; 5, 3, 1; 10, 2,2]; b = [10;1;3]; x = inv(a) * b;x = a\b;然后这个方程的解是-0.2059 -0.2500 2.7794。。。好了废话少说。题目是要求建立一个方程组: (mat[1][1]*x[1] + mat[1][.. 阅读全文
posted @ 2013-08-16 19:19 you Richer 阅读(295) 评论(0) 推荐(0)
上一页 1 ··· 204 205 206 207 208 209 210 211 212 ··· 300 下一页