Hiking Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 932 Accepted Submission(s): 483 Special Judge Problem Description There are n soda conveniently labeled by 1,2,-,n. beta, their best friend…
最近在学习shell编程,文中若有错误的地方还望各位批评指正. 先来看一个简单的求和函数 #!/bin/bash #a test about function f_sum 7 8 function f_sum(){ return $(($1+$2)); } f_sum 3 5; total=$(f_sum 3 6); echo $total,$?; 注意几个问题: 1.shell是逐行执行,所以要在函数声明之后才可调用,否则会有错误 2.我们要获得函数的返回值只能通过$?来获得,不可以通过变量拿…
最近在学shell,记录一下. if语句的使用: 1.判断两个参数大小 #!/bin/sh #a test about if statement a=10 b=20 if [ $a -eq $b ];then echo "parameter a is equal to parameter b" elif [ $a -le $b ];then echo "parameter a is less than parameter b" elif [ $a -gt $b ];…
 说明: 两个服务器: 192.168.0.22   A 192.168.0.3     B 数据库备份在A上 数据库在B上 在A上写: exec sp_addlinkedserver   'ITSV2', ' ', 'SQLOLEDB', '服务器地址'    exec sp_addlinkedsrvlogin  'ITSV2', 'false',null, '用户名', '密码'  --SQL语句 insert into BookDB.dbo.T_ID(id)select  FenJian_…
目录 CocoaPods是什么? 如何下载和安装CocoaPods? 如何使用CocoaPods? 场景1:利用CocoaPods,在项目中导入AFNetworking类库 场景2:如何正确编译运行一个包含CocoPods类库的项目 CocoaPods是什么? 当你开发iOS应用时,会经常使用到很多第三方开源类库,比如JSONKit,AFNetWorking等等.可能某个类库又用到其他类库,所以要使用它,必须得另外下载其他类库,而其他类库又用到其他类库,"子子孙孙无穷尽也",这也许是比…
操作系统:Win7 64bit Oracle: 10.2.0.1.0 很久没有使用EM了,打开一看,居然报错了,出现java.lang.Exception: Exception in sending Request :: null错误 除了主目录菜单之外,其他的菜单点击之后都会跳转到重新登录的页面-- 解决方案:找到下面的文件 $ORACLE_HOME\db_1\$HOSTNAME\sysman\config\emd.properties 其中的agentTZRegion缺省是GMT,改为本机的…
Balanced Game Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 297    Accepted Submission(s): 265 Problem Description Rock-paper-scissors is a zero-sum hand game usually played between two peopl…
谨以此纪念去年在学海争锋上的演讲. ---------------------------------------------------- 基于ArcGIS for Server的服务部署分析 ---------------------------------------------- 1.基于ArcGIS for Server的服务部署分析 2.内容简介 3.ArcGIS for Server简介 4.关于ARCGIS for server,我不知道在大家的学习中是否有所涉猎,首先来看一下A…
kiki's game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/10000 K (Java/Others) Total Submission(s): 8127 Accepted Submission(s): 4833 Problem Description Recently kiki has nothing to do. While she is bored, an idea appears in his mind,…
H - Solve this interesting problem Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5323 Appoint description:  System Crawler  (2015-07-28) Description Have you learned something about segment tr…
函数:一段具有某些特定功能的代码段. 使用函数的严格规定: 1.函数声明 2.函数定义 3.函数调用 函数声明:告知系统编译器该系统的函数名,函数参数,参数类型,参数个数,参数顺序等等,以便函数调用时对其进行校验. 格式:函数返回值类型修饰符  函数名(参数); 一般推荐复制 声明一般放在.h文件中 函数定义: 也叫函数的实现,也就是函数的功能代码 格式: 函数返回值类型修饰符 函数名(参数){ 代码实现.... } 定义一般放在.m文件中 如果定义在了main上边,则可以省略函数声明,如果定义…
MZL's Border Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 909 Accepted Submission(s): 297 Problem Description As is known to all, MZL is an extraordinarily lovely girl. One day, MZL was playing…
Have you learned something about segment tree? If not, don't worry, I will explain it for you.  Segment Tree is a kind of binary tree, it can be defined as this:  - For each node u in Segment Tree, u has two values: $L_u$ and $R_u$.  - If $L_u = R_u$…
C语言中结构体作为函数参数,有两种方式:传值和传址. 1.传值时结构体参数会被拷贝一份,在函数体内修改结构体参数成员的值实际上是修改调用参数的一个临时拷贝的成员的值,这不会影响到调用参数.在这种情况下,涉及到结构体参数的拷贝,程序空间及时间效率都会受到影响. 例子: typedef struct tagSTUDENT{ char name[20]; int age; }STUDENT; void fun(STUDENT stu) { printf("stu.name=%s,stu.age=%d/…
strtok函数是cstring文件中的函数 strtok函数是cstring文件中的函数 其功能是截断字符串 原型为:char *strtok(char s[],const char *delin); s[]是要截断的字符串,delin是用来截断的字符串.每次调用成功后则返回分割出片段的指针. 例如,strtok("aaa,sa",",");第一次执行就会返回','之前的aaa #include<iostream> #include<cstrin…
函数指针:指向函数的指针变量. 函数名相当于首地址. 函数指针定义:返回值类型  (*函数指针变量名)(参数类型1,参数类型2,....)=初始值 函数指针类型:返回值类型  (*)(参数类型1,参数类型2,....)=初始值 如:int  (*)(int int)  表示返回值是int类型,参数有两个,都为int类型的指针变量类型 void sayHello(){ printf("你好!!! \n"); } void (*p)()=NULL;   //表示返回值为空,无参数的,函数指…
1.js中函数表达式的定义 表达式(expression)JavaScript中的一个短语,javascript会将其计算(evaluate)出一个结果.程序中的常量是一个最简单的表达式.变量名也是一种简单的表达式,它的值就是赋值给变量的值.复杂表达式是由简单表达式组成. --摘自<javascript权威指南> 一个经典的函数表达式的定义方法: //函数表达式的声明,表达式的值就是这个新定义的函数 var expressFunc = function(){}; 函数名称是函数声明语句必须得部…
a typical variant of LCS algo. the key point here is, the dp[][] array contains enough message to determine the LCS, not only the length, but all of LCS candidate, we can backtrack to find all of LCS. for backtrack, one criteria is dp[i-1][j]==dp[i][…
use fgets, and remove the potential '\n' in the string's last postion. (main point) remove redundancy there must be a stack, at first sight, you need a stack of type myNode, but think deeper, matrix multiplication is valid only if A.c=B.r, then the n…
the algorithm of three version below is essentially the same, namely, Kadane's algorithm, which is of O(n) complexity. https://en.wikipedia.org/wiki/Maximum_subarray_problem the evolution of the implementations is to remove redundancy and do what is…
Shuffle'm Up Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7529 Accepted: 3466 Description A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of pok…
Encoding Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 32145 Accepted Submission(s): 14263 Problem Description Given a string containing only 'A' - 'Z', we could encode it using the following me…
A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 31177 Accepted Submission(s): 9988 Problem Description Given two integers n and m, count the number of pairs of integers (a…
Safecracker Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10165 Accepted Submission(s): 5213 Problem Description === Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein saf…
Elevator Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 51396 Accepted Submission(s): 28377 Problem Description The highest building in our city has only one elevator. A request list is made up w…
bit masking is very common on the lower level code. #include <cstdio> #include <algorithm> #define MAXSIZE 205 char line[MAXSIZE]; int main() { //freopen("input.txt","r",stdin); int x,y, dir; // (dir&3) 0,1,2,3 -- right…
参考链接:http://www.cnblogs.com/xd502djj/archive/2010/09/22/1832912.html 学过C++的人都知道在类Base中加了Virtual关键字的函数就是虚拟函数(例如函数print),于是在Base的派生类Derived中就可以通过重写虚拟函数来实现对基类虚拟函数的覆盖.当基类Base的指针point指向派生类Derived的对象时,对point的print函数的调用实际上是调用了Derived的print函数而不是Base的print函数.…
目录: [C#小知识]C#中一些易混淆概念总结--------数据类型存储位置,方法调用,out和ref参数的使用 继上篇对一些C#概念问题进行细节的剖析以后,收获颇多.以前,读书的时候,一句话一掠而过,但是现在再去重读的时候,每句话发现都包含大量的信息.这一篇继续总结自己的学习笔记,给大家深度的剖析一些概念性问题,有助于大家对C#的理解. --------------------------------------------------分割线-------------------------…
(一)备份namenode的元数据 namenode中的元数据非常重要,如丢失或者损坏,则整个系统无法使用.因此应该经常对元数据进行备份,最好是异地备份. 1.将元数据复制到远程站点 (1)以下代码将secondary namenode中的元数据复制到一个时间命名的目录下,然后通过scp命令远程发送到其它机器 #!/bin/bash export dirname=/mnt/tmphadoop/dfs/namesecondary/current/`date +%y%m%d%H` if [ ! -d…
#include<stdio.h> #include<string.h> #define max(x,y) x>y?x:y struct apple { int c; int w; }app[1001]; int main() { int i,n,v,j; while(scanf("%d%d",&n,&v)&&(n||v)) { int sum[1001]={0}; for(i=0;i<n;++i) scanf(&qu…