Time of Update: 2013-11-08
..兩個指標+字元hashstring minWindow(string S, string T) { // Start typing your C/C++ solution below // DO NOT write int main() function int nT = T.size(); int nS = S.size(); int needToFind[256] = {0};
Time of Update: 2013-11-08
$(function(){ var myLayout =$("body").layout( { applyDefaultStyles: true,//應用預設樣式 scrollToBookmarkOnLoad:false,//頁載入時滾動到標籤
Time of Update: 2013-11-08
Essential Python Lib 本節主要介紹Python用於大資料分析常用的各類庫。 Numpy Python下專用的數值計算標準模組庫,包括: 1、一個強大的N維數組對象Array; 2、比較成熟的(廣播)函數庫; &
Time of Update: 2013-11-08
Project Source Download: http://download.csdn.net/detail/mostone/6360007 public partial class FormMain : Form { Bitmap bmpZoom = null; Bitmap bmpSrc = null; public FormMain() { InitializeComponent();
Time of Update: 2013-11-08
1. 除法運算式(gcd法求最大公約數)//給你一個除法運算式:X1/X2/X3/X4……/Xk//通過添加括弧,問能否得到整數//分析可得,只有X2是不能做分子的。題目就轉化為求一個分數能否為整數#include<iostream>#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>using namespace std;int x[100];int
Time of Update: 2013-11-08
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;#define N 101#define INF 0xfffffffint mpt[N][N];int dp[N][N];int n,k;int dir[4][2]={0,1,1,0,0,-1,-1,0};int dfs(int x,int y){ int max=0; if(dp[x][y]>0
Time of Update: 2013-11-08
, insert and merge in as ., insert and merge in as . overlaps with ./** * Definition for an interval. * struct Interval { * int start; * int end; * Interval() : start(0), end(0) {} * Interval(
Time of Update: 2013-11-08
#include<stdio.h>#include<string.h>#define N 1001#include<algorithm>using namespace std;struct node{ int x,y,z;}dot[N];int sum[N];int cmp(node a,node b){ if(a.x>b.x)return 1; else if(a.x==b.x){
Time of Update: 2013-11-08
1. Map2. HashMap 1. 添加元素 import java.util.HashMap;import java.util.Map;public class MapDemo { public static void main(String[] args) { /* 定義了一個Map集合,鍵和值的類型都是String */ Map<String, String> map =
Time of Update: 2013-11-08
存在缺陷的代碼:public class DataPropertyIdAndNameRepositoryImpl{ /** 發布標誌 */ private volatile boolean publishFlag; public Integer getStandardId(int dataId, String propertyName) { if (!publishFlag) {
Time of Update: 2013-11-08
package com.home;public class Testdll {// 聲明所調用的庫名稱static {System.loadLibrary("hello");}// 對將要調用的方法做本地聲明,native關鍵字不可少public native static int get();public native static void set(int i);public static void main(String[] args) {Testdll test =
Time of Update: 2013-11-08
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>using namespace std;const int maxn=1e3+9;const double inf=1e11,epx=0.00001;int n;double rx,ry,d;double x[maxn],y[maxn];double cal(double x1,double
Time of Update: 2013-11-08
很久沒有從頭搭建Struts2的環境了。最近,認真實踐了單元測試Struts2、Spring等Java項目。 今天特意寫的是單元測試Struts2的Action,遇到了不少問題,果然是實踐出真知啊。 從搭建環境、寫代碼到寫這篇文章,一共花了90分鐘。 特別說明:本文是原創,搭建環境、寫代碼、運行,都是實踐並且正確的。 本文是靠譜的,而非簡單的複製-粘貼。 1.建立工程,加入相關jar包。 struts.core等struts自己的jar包 spring-core-3.
Time of Update: 2013-11-08
uniq命令檔案經過處理後在它的輸出檔案中可能會出現重複的行。例如:使用cat命令將兩個檔案合并後,再使用sort命令排序,就可能會出現重複的行。這時可以使用uniq命令將這些重複行從輸出檔案中刪除,只留下每條記錄的唯一樣本和出現次數。需要注意以下兩點:參數用法 uniq [選項] [檔案]-c 顯示輸出中,在每行行首加上本行在檔案中出現的次數-d 只顯示重複行-u
Time of Update: 2013-11-08
深搜即可,相當於在全排列裡找個滿足條件的import java.util.*;public class text{public static int[] num=new int[1001];public static void dfs(int count,int sum,int now,int n){if(sum>n)return;if(sum==n){System.out.printf("%d=",n);for(int i=0;i<count-1;i+&
Time of Update: 2013-11-08
,一旦建立就不能改變。對於已經存在String對象我們要去修改都是要可變對象,改變的時候,直接在原地址後面修改。public class testString{public static void main(String args[]){String str = new String(); long start = System.currentTimeMillis();final int times = 1000;for(int i=0;
Time of Update: 2013-11-08
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>#include <vector>#define pii pair<int,LL>using namespace std;typedef long long LL;const int N = 100005;struct Trie {
Time of Update: 2013-11-08
這次的題吊了...其實思路很清楚,但是為了更好的輸出,我想了將近3小時。這遠遠沒有達到華為的要求呀...唉...僅以此題來祭奠我被打擊的自信心。有沒有大神可以提供更好的方法,或則把我的哪個代碼修改一下....讓他更好的輸出。題目描述:大家注意測試資料不要太大,不然會悲劇.... //分析:該題是一個求一個序列相加但是前數小雨後數的要求序列。實際上任何一個數都可以看成n = 1+(n-1) n =
Time of Update: 2013-11-08
在開發軟體的過程中,遇到一個樹形結構的問題,如:
Time of Update: 2013-11-08
一篇講解node.js事件迴圈的文章。原文出處:點擊跳轉!在瞭解node.js之前你首先需要瞭解的一個基本的論點是:I/O是“昂貴”的。因此對於當前的編程技術而言,最大的浪費來自於等待I/O的完成。下面列出了改善該問題的幾種方式,其中的某個可以協助你提高效能:同步:在某一時刻,一次只處理一個請求。但這種情況下,任何一個請求都會“耽誤”(阻塞)所有其他的請求。fork一個新進程:對於每個請求,你啟動一個新的進程來處理。這種情況下,無法達到很好的擴充,上百個串連就意味著上百個進程的存在。fork()