#include
#include
#include
using namespace std;
int fun(int a,int b){
int c = 0;
int d = 1;
stack st;
while(b){
st.push(b & 1);
b >>= 1l;
}
while(!st.empty()){
int t = st.top();
st.p...
分类:
其他 时间:
2015-07-19 18:10:53
收藏:
0 评论:
0 赞:
0 阅读:
127
首先matplotlib是需要numpy先行包支持的,这里,我已经安装了numpy,下面安装matplotlib。安装命令yum install python-matplotlib测试:[root@master bin]# python
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-1...
分类:
编程语言 时间:
2015-07-19 18:10:33
收藏:
0 评论:
0 赞:
0 阅读:
239
796次 55.1% 2000ms 65536K
有一个新的研究显示,人在看见一系列的图片时,如果它们的排列有一定的轴对称性,则会更为觉得赏心悦目。根据这个特性,作为阿里巴巴旗下重要的电子商务交易平台的淘宝,希望了解商品推荐的图片走马灯现在的赏心悦目情况,以便判断是否之后需要做出调整。例如,当价值分别为 1,2,1 的商品图片排列在一起的时候,人们可以看到它的所有非空区间 [1]、[2]...
分类:
其他 时间:
2015-07-19 18:10:23
收藏:
0 评论:
0 赞:
0 阅读:
158
android中的广播用的太多了,今天稍微总结一下。
按注册方式分为两种:1.静态注册广播:
静态注册广播就是在androidManifest.xml文件中注册广播,假设我们要实现这样一个效果,在一个activity上点击按钮,发送一条广播,这条广播弹出一个toast,显示“静态”二字。先看看广播接受者:public class MyBroadcast extends BroadcastRece...
分类:
移动平台 时间:
2015-07-19 18:08:23
收藏:
0 评论:
0 赞:
0 阅读:
128
Android Studio 如何打JAR包在eclipse中我们知道如何将一个项目导出为jar包,供其它项目使用。
在AS中可以通过修改gradle才处理。
我们新建一个项目MakeJar,在项目中新建一个modle-类型为library
如图:app为我们的主工程,librarydemo是我们要将其生成jar包的model.
在librarydemo中加入如下代码:task makeJa...
分类:
移动平台 时间:
2015-07-19 18:08:14
收藏:
0 评论:
0 赞:
0 阅读:
557
之前不久因为公司项目需要接触了一下树莓派这个板卡,但是后来没有继续再用。但这却是是一块很不错的板卡,资源齐全,在网络君的帮助下,短短的几个小时就把板卡的基本软件配置好。网络资源很多我就不一一重复的记录具体的步骤,但见于网络上太多的帖子都是类似的,再次整理一份亲试屡爽的配置资源。
板卡是树莓派2代,B和B+。
【1】第一次使用会启动配置工具:也可以命令行中运行raspi-config来使用这...
分类:
其他 时间:
2015-07-19 18:08:13
收藏:
0 评论:
0 赞:
0 阅读:
243
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.The first integer of each...
分类:
其他 时间:
2015-07-19 18:07:03
收藏:
0 评论:
0 赞:
0 阅读:
186
javaScript中并不存在继承的感念..但是我们可以根据javaScript的原型进行模拟JavaScript的"继承":
1.写两个函数对象,将其中的一个函数赋值给另一个函数对象的原型:
function A(){
this.a = "a";
this.sayA = function(){
alert("this is a.");
}
}
var a = ...
分类:
编程语言 时间:
2015-07-19 18:06:54
收藏:
0 评论:
0 赞:
0 阅读:
184
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers ...
分类:
编程语言 时间:
2015-07-19 18:06:53
收藏:
0 评论:
0 赞:
0 阅读:
640
fd=fopen()是一个系统调用,用于根据文件名打开一个文件,返回该文件的文件描述符,文件打开后进程便可以根据文件描述符fd进行其他操作,比如读,写,关闭等操作。
各个操作系统打开文件的过程是类似的,本文以Unix为例,介绍打开一个文件操作系统所做的工作,正式介绍这个过程之前先简要介绍几个概念。
PCB(process control block)进程控制块,它是一个内核数据结构,相当于一个...
分类:
其他 时间:
2015-07-19 18:05:43
收藏:
0 评论:
0 赞:
0 阅读:
261
不多说,直接上代码:
public void installApk(){
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
//根据实际情况获取apk名称
String name = "test.apk";
File file = new File(Environment.getExternalSto...
分类:
移动平台 时间:
2015-07-19 18:05:33
收藏:
0 评论:
0 赞:
0 阅读:
232
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
For example,
S = "ADOBECODEBANC"
T = "ABC"
Minimum window is "BAN...
分类:
Windows开发 时间:
2015-07-19 18:05:23
收藏:
0 评论:
0 赞:
0 阅读:
314
因为周末在家手头没有虚拟机,所以在windows下单机完成部署要求,并编写bat运行脚本。
1、创建配置文件及相关目录
总的启动脚本如下(startmc.bat):
rem m1
start mongod.exe --config=../config/m1/s1_1
start mongod.exe --config=../config/m1/s1_2
start mongod.e...
分类:
数据库技术 时间:
2015-07-19 18:05:13
收藏:
0 评论:
0 赞:
0 阅读:
470
Java中异常的抽象类是Throwable,在此基础上,派生出两大类:Error和Exception。Error是程序中的严重错误,不应该用try…catch包括。Javadoc的说明如下:
An Error is a subclass of Throwable that indicates serious problems that a reasonable application shoul...
分类:
编程语言 时间:
2015-07-19 18:05:03
收藏:
0 评论:
0 赞:
0 阅读:
289
#include
using namespace std;
bool isOod(int num){
if(num%2==0){
return false;
}else{
return true;
}
}
int calCycleLength(int n){
int len=0;
if(n==1){
return 1;
}else{
if(isOod(n)){
...
分类:
其他 时间:
2015-07-19 18:04:53
收藏:
0 评论:
0 赞:
0 阅读:
96
one recursive approach to solve hdu 1016, list all permutations, solve N-Queens puzzle.
reference: the video of stanford cs106b lecture 10 by Julie Zelenski https://www.youtube.com/watch?v=NdF1QDTRkck...
分类:
移动平台 时间:
2015-07-19 18:04:43
收藏:
0 评论:
0 赞:
0 阅读:
230
其实是个水题,二分图的最大匹配,二分图为两边为坐标x,y,直接匈牙利算法做,邻接表边数老是写错,第三次了!!!...
分类:
其他 时间:
2015-07-19 18:04:33
收藏:
0 评论:
0 赞:
0 阅读:
202
题目链接:https://leetcode.com/problems/reverse-nodes-in-k-group/
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not...
分类:
其他 时间:
2015-07-19 18:04:13
收藏:
0 评论:
0 赞:
0 阅读:
134
线性表的单链表存储结构struct LNode
{
ElemType data;
LNode *next;
};
typedef LNode *LinkList;带有头结点的单链表的12个基本操作void InitList(LinkList &L){
L = (LinkList)malloc(sizeof(LNode));
if (!L)exit(OVERFLOW);...
分类:
其他 时间:
2015-07-19 18:04:03
收藏:
0 评论:
0 赞:
0 阅读:
152
#include//字符串函数头文件
#include//字符函数头文件
#include//malloc等
#include//标准输入输出头文件,包括EOF(=^Z或F6),NULL等
#include//atoi(),exit()
#include//eof()
#include<mat...
分类:
其他 时间:
2015-07-19 18:03:53
收藏:
0 评论:
0 赞:
0 阅读:
239