Time of Update: 2016-09-07
標籤:現在有很多可用的技術允許你建立被不同用戶端所消費的服務,這些用戶端可能是Web應用程式、Windows應用程式和行動裝置 App等。服務可以支援http協議或者其他協議。接下來的討論僅限於ASP.NET Web API和WCF。WCF(Windows Communication Foundation),使用WCF你可以構建安全可靠的服務,並且實現跨平台繼承和平滑地互動。Web API,一個用於構建HTTP服務的架構。現在我們每天都在使用手機、平板、apps以及各種不同類型的服務,Web
Time of Update: 2016-09-07
標籤:主入口表單的後台代碼using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace winform唯一彈窗{ public partial class Form1 : Form
Time of Update: 2016-09-08
標籤: 動態擷取UILabel的bounds在使用UILabel存放字串時,經常需要擷取label的長寬資料,本文列出了部分常用的計算方法。 1.擷取寬度,擷取字串不折行單行顯示時所需要的長度 CGSize labelBounds = [str sizeWithFont:font constrainedToSize:CGSizeMake(MAXFLOAT,
Time of Update: 2016-09-08
標籤:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return whether the stack is empty.Notes:You must
Time of Update: 2016-09-08
標籤:1、什麼是傳統工程 單工程 MVC 架構 控制層通過調用服務層完成商務邏輯處理 業務層調用持久層進程資料操作2、什麼是分布式工程 將傳統項目的單工程結構,拆分成多工程 一般會有這幾個工程: 父工程:定義了項目中所需的所有第三方依賴關係,如果用 Maven,其結果為 pom 工具類工程:定義了工程中的一些工具類方法,其結果為 jar Web 工程:Action 和 web 檔案(js、html、css 等) Service 介面工程和 Service 實現工程 Dao 介面工程和 Dao
Time of Update: 2016-09-08
標籤:參考:http://blog.csdn.net/joyhen/article/details/21631833 方法1: 該方法不同於ajax,因為script標籤不受同源策略的限制。前端和後台需要約定一個接收參數, 然後返回一段js代碼。 後端php代碼:<?php$callback = $_GET[‘callback‘];$json =
Time of Update: 2016-09-08
標籤:在使用gcc/g++ 編譯器時我們希望指向一些庫是使用靜態連結方式. 另外的一些是動態方式.我以boost 為例.如果我們要使用靜態庫則是這樣的:# g++ main.cpp -lpthread /usr/lib64/libboost_thread.a /usr/lib64/libboost_system.a 靜態庫直接寫路徑. 動態前面加-l 這樣也可以實現. 但有沒有更好的辦法呢.
Time of Update: 2016-09-07
標籤:問題: 把 文本字串"[1, 2, 3, 4, 5]" 轉換成一個數組。 答案:val x = "[1, 2, 3, 4, 5]"val y =x slice(1, x.length-1) replace(",","") split(" ")var y1= x slice(1, x.length-1) replace(",","") split(" ") map(_.toInt)y1: Array[Int] = Array(1, 2, 3, 4, 5)或者寫成var
Time of Update: 2016-09-07
標籤:1.今天在看高階函數,其實currying的一個函數中,有那個arguments.callee,表示不見過,查了查。arguments.callee 在哪一個函數中運行,它就代表哪個函數。 一般用在匿名函數中。在匿名函數中有時會需要自己調用自己,但是由於是匿名函數,沒有名子,無名可調。這時就可以用arguments.callee來代替匿名的函數 var currying = function ( fn ) { var args = []; return
Time of Update: 2016-09-08
標籤:1)node類型nodeName(what node) and nodeValue(always null)node父子之間可以用childNodes來表示 firstChild,childNode[a],lastChild兄弟結點,可以用nextsiBiling,previousSibling在什麼點前面插入地加 a.insertBefore(c,b);node的替換a.replaceChild(c,b);node的移除a.remove(b)複製cloneNode(
Time of Update: 2016-09-07
標籤:QueryInfo dataInfo = new QueryInfo(); dataInfo.CustomSQL = $@" select t1.name name,t1.url url from sys_menu t1 start with t1.parent_id = (
Time of Update: 2016-09-07
標籤:題目:已知先序和中序的數組,求輸出後序輸出結果。思路:根據先序和中序去建一棵二叉樹然後後序遍曆二叉樹#include<iostream>#include<string>#include<vector>#include<algorithm>using namespace std;struct node{ int value; struct node* left; struct node* right; node(int
Time of Update: 2016-09-07
標籤:題目描述: 輸入正整數n,把整數1,2...n組成一個環,使得相鄰兩個數和為素數。輸出時從整數1開始逆時針排列並且不能重複; 例樣輸入: 6 例樣輸出: 1 4 3 2 5 6 1 6 5 2 3 4方法1:(產生測試法,會逾時)#include <bits/stdc++.h>#define MAXN 100using namespace std;int isp[MAXN], a[MAXN];void
Time of Update: 2016-09-07
標籤:反選擇執行個體代碼如下:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title></title></head><body> <input type="button" value="全選" />
Time of Update: 2016-09-07
標籤:編輯當前行在日常開發中難免會對一個對話方塊進行編輯、修改方面的操作,範例程式碼如下:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title></title></head><body> <input type="button" />
Time of Update: 2016-09-07
標籤:斐波拉契 一隻青蛙一次可以跳上 1 級台階,也可以跳上2 級。求該青蛙跳上一個n 級的台階總共有多少種跳法假設,一級台階,有f(1)種方法,二級有f(2)種,以此類推,n級有f(n)種方法。可以看出,f(1)=1;f(2)=2。那麼,假設n級台階,那麼第一步就有兩種情況,跳一步,跟跳兩步。情況一:跳一步,那麼接下去的就是f(n-1);情況二:跳兩步,那麼接下去的就是f(n-2)。所以總數是f(n)=f(n-1)+f(n-2)。public int
Time of Update: 2016-09-07
標籤:2段提交Note left of Coordinator: Voting phaseCoordinator->Cohort1: queryCoordinator->Cohort2: queryCohort1-->Coordinator: yes/noNote right of Cohort1: prepare/abortCohort2-->Coordinator: yes/noNote right of Cohort2: prepare/abortNote
Time of Update: 2016-09-07
標籤:給定一個0-1串s,長度為n,下標從0開始,求一個位置k,滿足0<=k<=n, 並且子串s[0..k - 1]中的0的個數與子串s[k..n - 1]中1的個數相等。 注意:(1) 如果k = 0, s[0..k - 1]視為空白串(2) 如果k = n, s[k..n - 1]視為空白串(3) 如果存在多個k值,輸處任何一個都可以(4) 如果不存在這樣的k值,請輸出-1 想了一會,發現沒有-1的情況的,就是個坑,假設0- k-1有x個1,k,n-1有y個1,那麼0-
Time of Update: 2016-09-07
標籤:轉載請註明出處:http://blog.csdn.net/ns_code/article/details/25028525 劍指offer上的第五題,在九度OJ上測試通過。 時間限制:1 秒記憶體限制:128
Time of Update: 2016-09-07
標籤:public class first{public static void main(String args[]){ String asd = "helloworld"; String asf = "hello world love"; System.out.println(asd.contains("hello"));//判斷“hello”是否存在