Time of Update: 2015-09-04
標籤:1. Database configurationCreate a new test user, a new database and a single test table. Your MySQL user must have a password assigned. The driver will fail if you try to connect with an empty password.GRANT ALL PRIVILEGES ON *.*
Time of Update: 2015-09-04
標籤:leetcode pow Implement pow(x, n).實現乘冪運算,給出的提示是Bianry Search。其實就是利用公式xn=xn/2?xn/2?xn%2進行運算。參考代碼:class Solution {private: double power(double x, int n) { if (0 == n) return 1; double v =
Time of Update: 2015-09-04
標籤:訊號槽 qt sigslot 回調 我們從一個具體的問題入手:“現在有一堆按鈕,以及一堆電器,按鈕對它需要控制的對象一無所知,電器也不知道它們開關的具體類型,它們之間的關係可能是一對多,也可能是多對一,並且需要支援動態添加和刪除,應該如何設計這個結構?”這裡有個形象的圖:為了實現組件間的控制,我們很容易想到“回呼函數”,對於C++開發人員,我們肯定不希望一
Time of Update: 2015-09-04
標籤:題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=5327 打表預先處理資料範圍內所有的合格數再查詢即可。 1 #include <cstdio> 2 #include <cstdlib> 3 #include <cstring> 4 #include <algorithm> 5 #include <iostream> 6 #include
Time of Update: 2015-09-04
標籤:題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=5326 找一連串的下屬,可以用遞迴。首先存好直接關係,接著暴搜打表再查即可。 1 #include <cstdio> 2 #include <cstdlib> 3 #include <cstring> 4 #include <algorithm> 5 #include <iostream> 6 #include &
Time of Update: 2015-09-04
標籤:以下是小根堆定義,包括向堆中插入元素,刪除堆中元素,建立新堆,調整堆等函數。typedef int Elemtype;class MinHeap{public: MinHeap() :elem(0), size(0){} void BuildMinHeap(vector<Elemtype> v); void Modify(int i); int Delete(); void Insert(Elemtype e);private:
Time of Update: 2015-09-04
標籤: 1 package 2 { 3 import flash.display.Loader; 4 import flash.display.SimpleButton; 5 import flash.display.Sprite; 6 import flash.events.Event; 7 import flash.events.MouseEvent; 8 import flash.geom.ColorTransform; 9
Time of Update: 2015-09-04
標籤:centos6 install transmission1. 安裝所需的組件:yum -y install gcc gcc-c++ m4 make automake libtool gettextopenssl-devel pkgconfig perl-libwww-perl perl-XML-Parser curlcurl-devel libevent-devel libidn-devel zlib-devel2.
Time of Update: 2015-09-04
標籤:Public Sub Main() ‘ ‘ Add your code here ‘ Dim sbWA As New StringBuilder &
Time of Update: 2015-09-04
標籤:if not %in%==2 goto 2EQU - 等於NEQ - 不等於LSS - 小於LEQ - 小於或等於GTR - 大於GEQ - 大於或等於如:if %in% NEQ 1 goto 2注意文本比較應使用==&&:前面的命令執行成功才執行後面的命令||:前面的命令執行失敗才執行後面的命令&:不管前面的命令執行是否成功都執行後面的命令|:管道運算子,前面命令的輸出作為後面命令的輸入比較子及命令串連符
Time of Update: 2015-09-04
標籤:一種不能刪除檔案的情況分析過程我是root,今有一個檔案夾,A 不能刪除 rm -rf Arm: cannot remove `A‘: Read-only file system1 查看檔案夾以及內部檔案進階屬性,看此檔案或者此檔案夾內部檔案是否有設定了特殊屬性find A -exec lsattr {} \;--------------- ./A/a--------------- ./A/b--------------- ./A/c檔案正常。 2
Time of Update: 2015-09-04
標籤:題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=5365眾所周知,整點是圍不成正三角形正五邊形正六邊形的,所以我們只需暴力出它可以圍成幾個正四邊形。 1 #include <cstdio> 2 #include <cstdlib> 3 #include <cstring> 4 #include <algorithm> 5 #include <iostream> 6 #include &
Time of Update: 2015-09-04
標籤:4.7.3 Canonical LR(1) Parsing TablesWe now give the rules for constructing the LR(1) ACTION and GOTO functions from the sets of LR(1) items. These functions are represented by a table, as before. The only difference is in the values of the
Time of Update: 2015-09-04
標籤:一、淺識RunLoop RunLoop在開發中我們一直在用,但是沒有注意他。要想理解RunLoop,首先我們需要先瞭解一下程式運行機制。 程式運行機制:我們都知道OC是運行時語言,也就是說對象的類型是在程式啟動並執行時候確定的。並調用類與對象相應的方法。但是最終代碼的執行始終是面向過程的。線程也是一樣:一個線程從開始代碼執行,到結束代碼銷毀。app如何?這樣的機制:app從運行開始一直處於待命狀態,接收到事件之後執行操作,操作完成後繼續等待相應,直到程式終止運行。這樣的管理線程執行任務
Time of Update: 2015-09-04
標籤:1、DTD的作用DTD是XML的型,列出了XML中的元素有哪些、元素間的關係、元素可以有哪些內容,元素的屬性也有哪些。DTD實質說明的是元素間的關係,也就是類之間的關係。是一棵樹狀結構的說明,與XML相似。 DTD的職責只負責對文檔的結構進行規範,真正的驗證工作由應用程式執行。所以XML不是一門處理語言,而是一門描述資料的語言。 DTD的關鍵字是物件導向中的Attribute屬性,是對各種類型的一個說明。 DTD是對要描述的XML所有的關鍵字的一個定義,相當於
Time of Update: 2015-09-04
標籤:1,本文翻譯自 http://eclipsesource.com/blogs/2012/06/06/cleaner-code-with-guava-optionals-and-preconditions/,有說的不對的地方,歡迎斧正。 2,我開發軟體的時候,朝著乾淨代碼發展是我的特權,有一段時間,我曾在我幾乎所有的項目中使用Google瓜娃(Google
Time of Update: 2015-09-04
標籤:題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=4497題意:已知GCD(x, y, z) = G,LCM(x, y, z) = L。告訴你G、L,求滿足要求的(x, y, z)有多少組,並且要考慮順序。思路:如果L%G != 0顯然不存在這樣的(x, y, z),相反肯定存在。具體做法就是將L/G分解質因子,得到:L/G = P1^t1 * P2^t2 * ... * Pk^tk,我們來考慮任意一個因子Pi^ti,此時(x/G, y/G,
Time of Update: 2015-09-04
標籤:blank 開源軟體 balance target display 常用的負載平衡開源軟體有: nginx、lvs、keepalived 商業的硬體負載裝置: F5、Netscale 1. LB、LVS介紹LB叢集是load balance 叢集的簡寫,翻譯成中文就是負載平衡叢集 650) this.width=65
Time of Update: 2015-09-04
標籤: 1 import java.util.Scanner; 2 public class Main{ 3 public static void main(String[] args){ 4 Scanner scanner=new Scanner(System.in); 5 int n=scanner.nextInt(); 6 for(int i=n/2;i>=2;i--) 7 { 8
Time of Update: 2015-09-04
標籤:最近在跟著阮一峰的es6系列文章學習es6,在let和const命令這一章中,發現了一些錯誤,特列出一、let不存在變數提升假設let不存在變數提升,那麼在阮一峰的文章中的這段代碼代碼是正確的function do_something() { console.log(foo); // ReferenceError let foo =