...
分类:
其他好文 时间:
2015-01-19 15:49:56
阅读次数:
165
New UI-布局之GridLayout(网格布局)详解
——转载请注明出处:coder-pig,欢迎转载,请勿用于商业用途!
本节引言:
今天要介绍的布局是Android 4.0以后引入的一个新的布局,和前面所学的TableLayout(表格布局)
有点类似,不过他有很多前者没有的东西,也更加好用,
1)可以自己设置布局中组件的排列方式
2)可以自定义网格布局有多少行,多少列
3)可以直接设置组件位于某行某列
4)可以设置组件横跨几行或者几列
另外,除了上述内容外,本节还会给大家使用gridLayout...
分类:
其他好文 时间:
2015-01-19 15:49:07
阅读次数:
215
如何拼接两个vector
在C++中很多功能不像Python中那么方便,比如说要拼接两个vector,在C++中就需要自己实现。但是vector有一个非常好的函数可以简便的实现该功能,那就是insert函数。
#include
#include
using namespace std;
vector combine(vector &a, vector &b)
{
vec...
分类:
其他好文 时间:
2015-01-19 15:49:31
阅读次数:
197
给一个区间,求该区间内 质因子个数等于k的数 的个数。
暴力预处理一下啦
#include
#include
using namespace std;
const int maxn=10000010;
bool pri[maxn];
int cnt[maxn];
void init()
{
memset(pri,1,sizeof pri);
memset(cnt,0,s...
分类:
其他好文 时间:
2015-01-19 15:47:37
阅读次数:
179
公司业务需要对接了一次圆通速递物流查询接口 API 值为yto.Marketing.WaybillTrace
圆通要求用post方式传参数,所以简单写了如下一个例子:...
分类:
其他好文 时间:
2015-01-19 15:46:09
阅读次数:
329
Docker官方论坛中回复最多的一个帖子“在数据容器内升级数据”...
分类:
其他好文 时间:
2015-01-19 15:48:06
阅读次数:
122
Description
Message Decoding
Some message encoding schemes require that an encoded message be sent in two parts. The first part, called the header, contains the character...
分类:
其他好文 时间:
2015-01-19 15:47:44
阅读次数:
149
题目大意:有n只狼,每只狼有一个自己攻击的属性,还有一个属性就是可以给左边和右边的狼提高攻击力。这个左边的意思是如果离得最近的那个死了,攻击力加给离得左边没死的最近的一个。
思路:一开始以为贪心可解,但是显然想简单了啊。后来知道了是区间dp,dp[i][j]代表在区间i到j内的最小伤害数。关键是划分区间,我们让设k为区间内最后死的那匹狼,那么区间内就有状态转移公式:dp[i][j] = min(...
分类:
其他好文 时间:
2015-01-19 15:45:48
阅读次数:
244
Since you crave state-of-the-art technology, you've just purchased a phone with a great new feature: autocomplete! Your phone's version of autocomplete has some pros and cons. On the one hand, it's ve...
分类:
其他好文 时间:
2015-01-19 15:45:02
阅读次数:
180
Activiti5 是由 Alfresco 软件在 2010 年 5 月 17 日发布的业务流程管理( BPM) 框架,它是覆盖了业务流程管理、工作流、服务协作等领域的一个开源的、灵活的、易扩展的可执行流程语言框架。 Activiti 基于 Apache 许可的开源 BPM 平台,创始人 Tom Baeyens 是 JBoss jBPM 的项目架构师,和JBPM4 API相识程度高达60%。Tom...
分类:
其他好文 时间:
2015-01-19 15:45:24
阅读次数:
316
背景
在一个MFC ActiveX的项目工程中用到了zlib相关的文件压缩程序,这些程序是c语言编写的,在用vs2012编译时提示一下错误:
预编译头文件来自编译器的早期版本,或者预编译头为 C++ 而在 C 中使用它(或相反)。
特查找解决方法,记录下来。
解决办法
当 Visual C++ 项目启用了预编译头 (Precompiled header) 功能时,如果项目中同...
分类:
其他好文 时间:
2015-01-19 15:42:51
阅读次数:
176
Yesterday, we bought a Alaskan Malamute. He is so cute. We both love and cherish him. But today, he had poor spiritual status because he was ill. B...
分类:
其他好文 时间:
2015-01-19 15:39:58
阅读次数:
176
题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1588吐下槽,不得不说ZOJ好坑,模版题做了一个多小时。题意:* 给出一个无向图,输入n(表示n个定点,1~n), m(m条边,有重边),* (2 dfn[u](u,v)为树...
分类:
其他好文 时间:
2015-01-19 15:41:23
阅读次数:
224
Design and implement a TwoSum class. It should support the following operations:addandfind.add- Add the number to an internal data structure.find- Fin...
分类:
其他好文 时间:
2015-01-19 15:39:47
阅读次数:
195
Given a sorted array of floats, find the index of the number closest to x: Example: {1.2, 2.5, 9.3} x = 5, return 1#include#include#include using name...
分类:
其他好文 时间:
2015-01-19 15:39:44
阅读次数:
160
C++学习心得1.把C++当成一门新的语言学习;2.看《Thinking In C++》;3.看《The C++ Programming Language》和《Inside The C++ Object Model》,不要因为他们很难而我们自己是初学者所以就不看;4.不要被VC、BCB、BC、MC、...
分类:
其他好文 时间:
2015-01-19 15:38:01
阅读次数:
168
How are you与How are you doing,有何不同呢?貌似没有不同……回答都是"Fine, thank you, and you?"有区别的是How do you do?这个的回答是How do you do?ref:http://english.stackexchange.com...
分类:
其他好文 时间:
2015-01-19 15:39:23
阅读次数:
135