1:窗体首次加载时最大化 (1):主窗体 this.WindowState = FormWindowState.Maximized; //窗体显示中间部分,不显示窗体名称和最小化.最大化.关闭按钮             this.FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; (2):子窗体 设置父窗体的属性:IsMdiContainer=True Form f = ne…
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…
a problem where OO seems more natural to me, implementing a utility class not instantiable. how to prevent instantiation, thanks to http://stackoverflow.com/questions/10558393/prevent-instantiation-of-an-object-outside-its-factory-method/10558404#105…
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…
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…
The Happy Worm Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 4698 Accepted: 1047 Description The Happy Worm lives in an m*n rectangular field. There are k stones placed in certain locations of the field. (Each square of the field is eit…
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…
#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<cstring> using namespace std; bool map[505][505]; int n, k; bool vis[505]; int linker[505]; void sscanf() { int x, y; scanf("%d%d",&n,&k); for(int i=1;i<=k;i++) { scanf("%d%d",&x,&am…
#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…
主函数: package com.mywork; import java.awt.Color; import java.awt.Image; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; public class Main{ public static void main(String args[]){ JFrame f = new JFrame("ImageShow&quo…
说明: (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 (…
SQL语句: A,B为两个字段,A为开始时间,B为结束时间,ss为秒. SELECT datediff(ss,A,B)  FROM Table 详细:http://www.w3school.com.cn/sql/func_datediff.asp 版权声明:本文为博主原创文章,未经博主允许不得转载.…
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go -- ============================================= -- Author: *** -- Create date: 2014-03-27 20:00 -- Description: 采用最新的 row_number() over 技术高效分页方法 -- ============================================= ALTER PRO…
对链表进行排序,要求时间复杂度为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…
 调用系统相机和相册 (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的基…
以前对WinForm窗体显示和窗体间传值了解不是很清楚  最近做了一些WinForm项目,把用到的相关知识整理如下  A.WinForm中窗体显示  显示窗体可以有以下2种方法:  Form.ShowDialog方法 (窗体显示为模式窗体)  Form.Show方法 (窗体显示为无模式窗体)  两者具体区别如下:  1.在调用Form.Show方法后,Show方法后面的代码会立即执行  2.在调用Form.ShowDialog方法后,直到关闭对话框后,才执行此方法后面的代码  3.当窗体显示为模…
http网络库是集XML解析,Json解析,网络图片下载,plist解析,数据流请求操作,上传,下载,缓存等网络众多功能于一身的强大的类库.最新版本支持session,xctool单元测试.网络获取数据一直是手机软件的重中之重,如果处理的不好,会造成很差的用户体验.随着ASIHTTPRequest的停止更新,更换网络库是必然的事情,AFNetworking就是很好的替代品.而且都是轻量级,不要担心加入太多库会多软件性能有影响. 1.为什么用第三方网络库?先说如果不用网络库,我曾有一次觉得什么都用…
hadoop集群性能低下的常见原因 (一)硬件环境 1.CPU/内存不足,或未充分利用 2.网络原因 3.磁盘原因 (二)map任务原因 1.输入文件中小文件过多,导致多次启动和停止JVM进程.可以设置JVM重用. 2.数据倾斜:大文件且不可分割,导致处理这些文件的map需要很长时间. 3.数据本地化效果差. (三)reduce任务的原因 1.reduce任务数量过大或过小 2.数据倾斜:一部分key的记录数量太大,导致某些reduce执行过慢 3.缓慢的shuffle和排序 (四)hadoop…
目的:获取项目路径下所有文件夹的名称,并绑定到Combobox控件下: 显示要求:此文件夹名称和他的子文件名称的集合: Combobox控件名称:cmbFile 图示: 代码实现: //项目路径 string strabcfile = System.Windows.Forms.Application.StartupPath; //全部路径 string strfile = System.Windows.Forms.Application.StartupPath + "\\Reports"…
说明:(1)如果对分页的感兴趣的话,可以看一下我传的存储过程("SQL 存储过程 分页")               (2)分页,第一页.上一页,下一页.最后一页只调用点击(click)事件即可;如果想要实用性的好的话,txtNowPage,需              要调用3个事件,点击事件(click).离开事件(leave).目标按下事件(keypress). 效果图: 代码实现如下: public void DataBind() {             #region…
界面显示: 加密: 解密: 代码实现: public string EncryptString(string str)         {             #region 加密程序             char[] Base64Code = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',…
截图: 代码实现:(导出txt按钮事件) using System.IO; using System.Data.OleDb; private void btnOutTxt_Click(object sender, EventArgs e) {             #region 导出TXT             int idid = 0;//定义一个变量,测试用户是否选择要导出的记录的复选框             string LuJing = "D:\\入库导出TXT";  …
使用互斥体Mutex类型 导入命名空间 using System.Threading; //声明互斥体 Mutex mutex = new Mutex(false, "ThisShouldOnlyRunOnce"); //判断互斥体是否使用中 , false); if (!Running) Application.Run(new Form1()); else MessageBox.Show("应用程序已经启动!"); 版权声明:本文为博主原创文章,未经博主允许不得转…
来CSDN开博客的目的有两个: 其一是因为CSDN的代码输出,看过一些博文,觉得这里的代码输出真的很漂亮: 其二则是因为,感觉自己印象笔记用久了之后,渐渐地几乎不再自己写些东西了,习惯了方便的剪藏插件,遇到好文,直接剪藏,快捷是快捷了,总是觉得缺了点儿什么.没了自己写点儿东西,梳理一下的过程,看完用过之后,留下的几分是自己的呢?所以决定搬家到这里,以后的博文尽量多谢原创,梳理自己的所得. 很尴尬的是印象笔记没办法搬家到CSDN,一篇一篇的移太累了(有人有好的方法还请不吝赐教)... 版权声明:本…
一.什么是正则表达式 正则表达式,又称正规表示法,是对字符串操作的一种逻辑公式.正则表达式可以检测给定的字符串是否符合我们定义的逻辑,也可以从字符串中获取我们想要的特定部分.它可以迅速地用极简单的方式达到字符串的复杂控制. 二.正则表达式的语法 看一个过滤纯数字的例子 - (BOOL)validateNumber:(NSString *) textString { NSString* number=@"^[0-9]+$"; NSPredicate *numberPre = [NSPre…