time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Susie loves strings. Today she calculates distances between them. As Susie is a small girl after all, her strings contain only digits…
Find The Multiple Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 21851 Accepted: 8984 Special Judge Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only t…
Ultra-QuickSort Time Limit: 7000MS   Memory Limit: 65536K Total Submissions: 48111   Accepted: 17549 Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swappin…
Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 62016 Accepted: 23808 Description Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by wate…
Injector Job的主要功能是根据crawlId在hbase中创建一个表,将将文本中的seed注入表中. (一)命令执行 1.运行命令 [jediael@master local]$ bin/nutch inject seeds/ -crawlId sourcetest InjectorJob: starting at 2015-03-10 14:59:19 InjectorJob: Injecting urlDir: seeds InjectorJob: Using class org.…
Windows7下QT开法环境常见搭配方法有两种. 第一种是:QT Creator+QT SDK: 第二种是:VS+qt-vs-addin+QT SDK: 以上两种均可,所需文件见QT社区,QT下载地址:http://download.qt.io/archive. 第一种,鄙人下载的是:qt-creator-opensource-windows-x86-3.3.0.exe + qt-opensource-windows-x86-mingw491_opengl-5.4.0.exe. 第二种:鄙人下…
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> #include <map> #include <vector> using namespace std; long long num[1000005]; long long fz[1000005]; long long xds[100…
#include <cstdio> #include <iostream> #include <cstring> #include<queue> #include<cmath> using namespace std; const int INF = 0x3fffffff; int g[1005][1005]; int pre[1005]; int m; int bfs(int s,int t) { queue<int>q; q.pu…
说明: (1)日期以年月形式显示:convert(varchar(7),字段名,120) , (2)加一列 (3)自编号: row_number() over(order by 字段名 desc) as RowID row_number() over(partition by 字段1 order by 字段2) as RowID (4)自编号的限制(不可直接在WHERE条件中加) 举例说明: 想要达到的效果:按月统计各工种的前5名(以件数为依据) 初始SQL语句: select sum(Sum_…
(1)Convert 函数 select Convert ( VARCHAR(7),ComeDate,120) as Date ,Count(In_code) as 单数,Sum(SumTrueNum) as 件数 from T_In_Top  where  ComeDate between '2013-01-01' and '2014-08-04' and In_top_State='已完成' and Case_ID=14  and Store_ID=41 group by Convert (…
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: *** -- Create date: 2014-03-27 20:00 -- Description: 采用最新的 row_number() over 技术高效分页方法 -- ============================================= ALTER PRO…
Pie Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 109 Accepted Submission(s): 52   Problem Description My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a…
对链表进行排序,要求时间复杂度为O(n log n) ,不使用额外的空间. 我一开始的想法是借助quicksort的思想,代码如下: # time O(nlog(n)) # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def sortList(self, head): if head is not No…
反转链表:比较简单的问题,可以遍历也可以递归. # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: # @param {ListNode} head # @return {ListNode} def reverseList(self, head): if head!=None: list1=head lis…
 调用系统相机和相册 (iPad,iPhone) 打开相机:(iPad,iPhone) //先设定sourceType为相机,然后判断相机是否可用(ipod)没相机,不可用将sourceType设定为相片库       UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;   //    if (![UIImagePickerController isSourceTypeAv…
1.下载rpm文件并安装 rpm -ivh jdk-7u51-linux-x64.rpm 2.修改/etc/profile文件,增加以下配置 export JAVA_HOME=/usr/java/jdk1.7.0_51 export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH 版权声明:本文为博主原创文章,未经博主允许不得转载.…
一.Java Script 1.由于Solr本身可以返回Json格式的结果,而JavaScript对于处理Json数据具有天然的优势,因此使用JavaScript实现Solr客户端是一个很好的选择. 2.在之前,主要使用SolJS作为solr的客户端,目前主要使用ajax-solr,信息请见:https://github.com/evolvingweb/ajax-solr/wiki/Reuters-tutorial%3A-step-1. 3.以下示例未使用上述所述的客户端,而是使用了ajax的基…
hadoop集群性能低下的常见原因 (一)硬件环境 1.CPU/内存不足,或未充分利用 2.网络原因 3.磁盘原因 (二)map任务原因 1.输入文件中小文件过多,导致多次启动和停止JVM进程.可以设置JVM重用. 2.数据倾斜:大文件且不可分割,导致处理这些文件的map需要很长时间. 3.数据本地化效果差. (三)reduce任务的原因 1.reduce任务数量过大或过小 2.数据倾斜:一部分key的记录数量太大,导致某些reduce执行过慢 3.缓慢的shuffle和排序 (四)hadoop…
1.Shell$ExitCodeException 现象:运行hadoop job时出现如下异常: 14/07/09 14:42:50 INFO mapreduce.Job: Task Id : attempt_1404886826875_0007_m_000000_1, Status : FAILED Exception from container-launch: org.apache.hadoop.util.Shell$ExitCodeException:  org.apache.hado…
1.     概述与概念 C#支持通过多线程并行地执行代码,一个线程有它独立的执行路径,能够与其它的线程同时地运行.一个C#程序开始于一个单线程,这个单线程是被CLR和操作系统(也称为"主线程")自动创建的,并具有多线程创建额外的线程.这里的一个简单的例子及其输出: 除非被指定,否则所有的例子都假定以下命名空间被引用了:      using System;     using System.Threading; 1 2 3 4 5 6 7 8 9 10 11 class Thread…
首先,看一下我的窗体设计: 要插入的Excel表: 编码 名称 联系人 电话 省市 备注 100 100线 张三 12345678910 北京 测试 101 101线 张三 12345678910 上海 测试 102 102线 张三 12345678910 深圳 测试 103 103线 张三 12345678910 广州 测试 104 104线 张三 12345678910 福建 测试 105 105线 张三 12345678910 厦门 测试 106 106线 李四 12345678910 台…
第一部分:编码基础 为什么需要编码:用计算机看得懂的语言(二进制数)表示各种各样的字符. 一.基本概念 ASCII.Unicode.big5.GBK等为字符集,它们只定义了这个字符集内有哪些字符,以及分别用什么数字表示. 而UTF-8与UTF-16则定义了Unicode字符集如何使用计算机看得懂的语言进行传输和保存. 例如: Unicode 字符 U+00A9 = 1010 1001 (版权符号) 在 UTF-8 里的编码为:        11000010 10101001 = 0xC2 0x…
DZY Loves Chessboard time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves chessboard, and he enjoys playing with it. He has a chessboard of n rows and m columns. Some cells of the ches…
Toy Cars time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The proce…
C# 类型 引言 本文之初的目的是讲述设计模式中的 Prototype(原型)模式,但是如果想较清楚地弄明白这个模式,需要了解对象克隆(Object Clone),Clone其实也就是对象复制.复制又分为了浅度复制(Shallow Copy)和深度复制(Deep Copy),浅度复制 和 深度复制又是以 如何复制引用类型成员来划分的.由此又引出了 引用类型和 值类型,以及相关的对象判等.装箱.拆箱等基础知识. 于是我干脆新起一篇,从最基础的类型开始自底向上写起了.我仅仅想将对于这个主题的理解表述…
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…
Task schedule Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1909 Accepted Submission(s): 658 Problem Description 有一台机器,并且给你这台机器的工作表,工作表上有n个任务,机器在ti时间执行第i个任务,1秒即可完成1个任务. 有m个询问,每个询问有一个数字q,表示如果在q时间…
DZY Loves Chemistry time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY loves chemistry, and he enjoys mixing chemicals. DZY has n chemicals, and m pairs of them will react. He wants to pou…
说明: 我在做wms进销存软件时,发现一个问题:一张入库单(T_OutIn_BoxTop),入库扫描时要分成多箱,箱号(BoxTop_No)可以是数字也可以是字符串,所以箱号只能是字符串类型的,问题来了,如何进行排序呢? 具体如下: 排序时:CAST(Box_No AS INT) sql语句: SELECT  * FROM T_OutIn_BoxTop WHERE MainTop_ID =17722  ORDER BY CAST(Box_No AS INT)  ASC 版权声明:本文为博主原创文…
string str1 = "C#操作字符串<几种常见方式>如下"; string str2 = "C#操作字符串";     //比较字符串 Compare,Equal             //1,compare,int 1             string.Compare(str1, str2);             str1.CompareTo(str2);             //2,equal,bool true        …