Time of Update: 2018-12-04
在網上找了好久,發現各種的版本,現在將其總結於此,方便人們的查看,順便可以提提意見,看看到底是那個和那個···· 第一種說法:[R G B] -> [Y Cb Cr]轉換-------------------------(R,G, B 都是 8bit unsigned) Y = 0.299*R + 0.587*G + 0.114*B (亮度)Cb = - 0.1687*R - 0.3313*G + 0.5 *B + 128Cr = 0.5 *R - 0.4187*G -
Time of Update: 2018-12-04
class Date{public:Date(const char* date = "jxd");Date(const Date& date);Date operator()(const char* date);Date& operator=(const Date& date);~Date();friend bool operator==(const Date& date1, const Date& date2);friend istream&
Time of Update: 2018-12-04
實現一個“大小寫不敏感”的string類:ci_string s( "AbCdE" );assert( s == "abcde" );// 1. 大小寫不敏感assert( s == "ABCDE" );// 1. 大小寫不敏感assert( strcmp( s.c_str(), "AbCdE" ) == 0 ); // 2. 保留大小寫狀態assert( strcmp( s.c_str(), "abcde" ) != 0 ); // 2.
Time of Update: 2018-12-04
1> 使用alloc、new、copy族(如mutableCopy)建立的對象,要使用release/autorelease。使用retain的對象,同樣處理。沒有使用這四者的,不能用release/autorelease。// 必須releaseTestClass *ptr = [[TestClass alloc] init];...[ptr release];// 不用releaseNSString *str;str = [NSString
Time of Update: 2018-12-04
Static member class - 靜態成員類,就是類聲明中包含“static”關鍵字的內部類。下面的樣本定義了四種“靜態成員類”:public class Outer { // 1/4 - public許可權 public static class Inner1 { public Inner1() { staticMethod();//OK! Static member inner class can access static
Time of Update: 2018-12-04
從網上下載 xen 3.3.1 的源碼包。[root@whb yum.repos.d ]# mkdir /var /ftp/upload[root@whb yum.repos.d ]# cd /var /ftp/upload/[root@whb upload]# export http_proxy =59.72.109.7:56789[root@whb upload]# wget http://bits.xensource.com/oss-xen/release/3.3.1/xen-3.3.1.
Time of Update: 2018-12-04
題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=1312題目很好懂,只搜尋能到達的地方,統計數量,啥也不做。很坑爹的地方是,行列輸入是反的!AC代碼:31MS 364K,空間還可以最佳化,直接不用開visit數組,直接把訪問後的點置為障礙即可。#include <iostream>#include <string>#include <cstdio>#include <cmath>#include
Time of Update: 2018-12-04
題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=1728深搜思路:記錄4個方向和拐彎次數,若拐彎3次,則必須是當前點和終點在一條直線才滿足要求,否則剪掉,這樣也逾時,坑爹,之前連連看那個題就是用這種方法也能過,z這次的資料有點強,100*100了,所以深搜不行,不過這思路倒不錯。代碼:#include <iostream>#include <cmath>#include <string>#include
Time of Update: 2018-12-04
http://blog.csdn.net/whuqin/article/details/67328981.建立域(虛擬機器):包括Volume和描述硬體設定的xml//前端與節點建立串連Connect conn=new Connect("qemu+ssh://root@192.168.69/system",false);//根據xml描述建立新虛擬機器並啟動SAXReader reader = new SAXReader();Document docu =reader.read(new
Time of Update: 2018-12-04
題目:http://acm.hdu.edu.cn/showproblem.php?pid=1677類似於求最長下降子序列的個數,此題可以用動態規劃來解,不過我用簡單的搜素來做,可惜逾時,先上代碼再最佳化。#include <iostream>#include <cmath>#include <string>#include <algorithm>#include <vector>using namespace std;struct
Time of Update: 2018-12-04
#======================================# Sprite_Vision 地圖視野# 作者: viktor# 原創指令碼。僅供討論使用,不可以用於商用。轉載請註明出處/暫時不對指令碼進行更多的解釋了。# 設定視野方法:使用地表徵圖記,原則是地表徵圖記越大,高度越高。## 最低的地面:0# 牆:比下方的地面高1# 豎直牆的頂部:比下方的牆高1# 高地:與在高地下側的豎直牆頂部高度相同。這樣在高地上可以看到下面的東西#
Time of Update: 2018-12-04
http://wiki.ubuntu.org.cnUbuntu 的中文wiki ,下面的連結是有關KVM的部分http://wiki.ubuntu.org.cn/index.php?title=Kvm%E6%95%99%E7%A8%8B&variant=zh-cn http://forum.ubuntu.org.cn/viewtopic.php?p=964496ubuntu的中文論壇寫了很多比較簡單的建立管理KVM虛擬機器的命令 http://www.php-oa.com/2010/02
Time of Update: 2018-12-04
題目連結:http://www.msra.cn/Articles/ArticleItem.aspx?Guid=4c86d636-04bb-4ad9-b0bc-4c3496d18021#.給出c++實現的簡單代碼:#include <iostream>#include <cstdio>using namespace std;const unsigned char fullmark=255; //11111111 const unsigned char
Time of Update: 2018-12-04
#include <string> #include <stdio.h> #include <cmath> #include <iostream>
Time of Update: 2018-12-04
“24點遊戲是一種使用撲克牌來進行的益智類遊戲,遊戲內容是:從一副撲克牌中抽去大小王剩下52張,任意抽取4張牌,把牌面上的數(A代表1)運用加、減、乘、除和括弧進行運算得出24。每張牌都必須使用一次,但不能重複使用。 有些組合有不同種演算法,例如要用2,4,6,12四張牌組合成24點,可以有如下幾種組合方法: 2 + 4 + 6 + 12 = 24 4 × 6 ÷ 2 + 12 = 24 12 ÷ 4 × (6 + 2) = 24 當然,也有些組合算不出24,如1、1、1、1 和 6、7、8
Time of Update: 2018-12-04
第二部分,frontpage+access資料庫中查詢資料今天接著上一節進行frontpage+access的資料庫的查詢功能。第一部,用frontpage開啟上次做好的網站,然後添加一個網頁,叫做“學號查詢連絡人.asp”第二部,點擊跳到當前的網頁頁面,然後游標要在當前的視窗,選擇插入—資料庫----結果直接下一步,然後選擇其它選項,條件,進入設定,這裡的資料庫就是上一次我們添加的那個資料庫了啊。點擊條件後跳出如下的框框,選擇添加按鈕進行需要查詢的條件。點擊添加後跳出如下的對話方塊,我們可以選
Time of Update: 2018-12-04
題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=2563深搜回溯逾時,於是可恥的打了個表,0MS AC了。。#include<iostream>#include<cstdio>#include<cmath>#include<fstream>using namespace std;int ans[21]={0,3,7,17,41,99,239,577,1393,3363,8119,19601,47321,
Time of Update: 2018-12-04
水題一道:#include <cstdio>#include <cstring>#include <string>#include <iostream>using namespace std;int gcd(int a,int b){ if(a<b)return gcd(b,a); if(b==0)return a; return gcd(b,a%b); }bool can(int a,int b,int c) {
Time of Update: 2018-12-04
使用tcp方式串連libvirtdLibvirt是一個軟體集合,便於使用者管理虛擬機器和其他虛擬化功能,比如儲存和網路介面管理等等。這些軟體包括一個API庫、一個daemon(libvirtd)和一個命令列工具(virsh)。Libvirt的主要目標是:提供一種單一的方式管理多種不同的虛擬化提供方式和hypervisor。只要遠程伺服器運行了libvirtd,libvirt的用戶端就可以串連到伺服器。使用最簡單的SSH方式,只要擁有SSH串連到伺服器的許可權,就可以無需配置:qemu+ssh:/
Time of Update: 2018-12-04
如何用libvirt遠端管理虛擬機器? 要用libvirt串連到超級管理程式,我們需要一個URI,這個URI配合virsh和virt-viewer命令使用,後面可以跟一些可選項,virt-viewer可以調用一些連結參數,例如:virsh -c qemu:///system