Time of Update: 2018-12-05
欲速則不達。有時候想急於做好一件事,反而越做不好事情。雖然興趣在這過程中發揮著非常重要的作用,但因為功力還遠沒達到那樣的水平,最終還是會失敗。 在朋友的部落格上,看到他寫的一句話:這輩子,我就會兩件事:這也不會;那也不會。是啊,我會什麼呀?我啥也不會。 有時候,明明知道是錯的,卻還要裝逼,擺出一副“我掌握的就是真理”的架勢,以為這樣才能在別人面前樹立威信,證明自己比別人強。其實效果剛好相反。
Time of Update: 2018-12-05
auto_ptr原始碼,參考The C++ Standard Library/* The following code example is taken from the book * "The C++ Standard Library - A Tutorial and Reference" * by Nicolai M. Josuttis, Addison-Wesley, 1999 * * (C) Copyright Nicolai M. Josuttis 1999. *
Time of Update: 2018-12-05
template <class T>inline const T& min(const T& a, const T& b){return b < a ? b: a;}template <class T,class Compare>inline const T& min(const T& a, const T& b, Compare comp){return comp(b,a)? b: a;}template
Time of Update: 2018-12-05
#include <iostream>#include <cstdio>#include <string>using namespace std;static string HaabMonthName[]={
Time of Update: 2018-12-05
//括弧匹配問題#include <iostream>#include <cstdio>using namespace std;int pseq[22];//接收輸入p-sequenceint harr[22];//輔助數組,統計pseq[i-1]和pseq[i]之間還有多少個'('沒有匹配int wseq[22];//結果w-sequenceint count;int main(){freopen("in.txt","r",stdin);int t; // 1 <
Time of Update: 2018-12-05
#include <iostream>#include <cstdio>#include <vector>#include <algorithm>#include <functional>#include <map>using namespace std;int joseph_m(int k){vector<int> vint,vint_b;int i,j,m;int boys;for(i = 0; i <
Time of Update: 2018-12-05
//大數相乘#include <iostream>#include <string>#include <cstdio>using namespace std;class ans//求s^n{private:string s;int n;int r;//小數點位元private:string result(int n){if(n == 0)return "1";if(n == 1)return s;if(n%2 == 0)return mul(result(n/
Time of Update: 2018-12-05
#include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;string format(string s){int i = 0;for(i = 0; i < s.length(); i++){if(s[i] != '-'){switch(s[i]){case 'A':case 'B':case 'C':s[i] = '
Time of Update: 2018-12-05
Computer Vision Computer Vision Homepage, Carnegie Mellon Universitywww.cs.cmu.edu/~cil/vision.html Annotated Computer Vision
Time of Update: 2018-12-05
#include <iostream>#include <cmath>using namespace std;const float PI = 3.1515926;const int AREA = 50;int year(float x,float y){x = fabs(x);int k = 0;int area;//面積float r;//半徑float dis = sqrt(pow(x,2)+pow(y,2));for(k = 1;; k++){r = sqrt((
Time of Update: 2018-12-05
解題報告: 12345678910111213141 H H 2 | | 3H-O-H-O-H 4 | | 5 H H 6 | | 7H-O-H-O-H 8 | | 9 H H 10 11 12 首先按如上這種方式進行表
Time of Update: 2018-12-05
常規解法(AC):#include <iostream>#include <cstdio>#include <algorithm>using namespace std;const int PCYCLES = 23;const int ECYCLES = 28;const int ICYCLES = 33;const int LCM = PCYCLES*ECYCLES*ICYCLES;//最小公倍數int nextPeak(int p,int e,int i,
Time of Update: 2018-12-05
// utility standard header#pragma once#ifndef _UTILITY_#define _UTILITY_#ifndef RC_INVOKED#include <iosfwd>#ifdef _MSC_VER #pragma pack(push,_CRT_PACKING)//#pragma pack(push, n)先將當前位元組對齊值壓入編譯棧棧頂, 然後再將 n 設為當前值. #pragma
Time of Update: 2018-12-05
利用msmtp可以發送郵件,但是好像只能發送文本,並沒有發送jpg,bmp圖片等類似附件的功能。上百度,google搜尋了下,一般只有msmtp+mutt發送郵件的功能。要在嵌入式下如果只是發送文本,用msmtp應該是足夠了,但是發送jpg,bmp等附件可能不可以(估計需要自己改代碼)!搜尋msmtp代碼中fopen函數,只有如下顯示(其中並不包含開啟附件檔案的操作): 下面介紹下PC上msmtp發送郵件配置:1、產生msmtp:進入msmtp-1.4.23檔案夾:./configuremake
Time of Update: 2018-12-05
用C++調用windows API進行非阻塞TCP通訊,其中一行代碼被我寫成了如下:if (SOCKET_ERROR == (sock, (sockaddr *)&addr, sizeof(addr))){cout << "Bind Failed" << endl;WSACleanup();return
Time of Update: 2018-12-05
下載SDL-1.2.14.tar.gz解壓其中的VisualCE.zip檔案,winrar解壓時候選擇“解壓到當前檔案夾”,目錄如所示:開啟VisualCE檔案夾中的SDL.sln後,由於我使用的vs2008,所以需要轉換工程,點擊轉換就好了。最後工程如下:選擇SDL項目,點擊“產生”,產生SDL.dll,SDL.lib檔案。其中在SDL_sysevent.c會出現編譯出錯:原因是wince中 wince 600 中winuser.h沒有 WM_WINDOWPOSCHANGING(這個網路看的)
Time of Update: 2018-12-05
/* The following code example is taken from the book * "The C++ Standard Library - A Tutorial and Reference" * by Nicolai M. Josuttis, Addison-Wesley, 1999 * * (C) Copyright Nicolai M. Josuttis 1999. * Permission to copy, use, modify, sell and
Time of Update: 2018-12-05
#include <iostream>#include <cstdio>#include <string>#include <map>using namespace std;int numOutOfOrder(string s){if(s.length() == 0)return 0;int sum = 0,count = 0;int i,j;for(i = 0; i < s.length(); i++){count = 0;for(j =
Time of Update: 2018-12-05
//WA 了3次才AC,題目不難,但交的人不多,思想很簡單,直接見代碼#include <iostream>#include <cstdio>#include <vector>#include <algorithm>#include <functional>#include <map>using namespace std;int
Time of Update: 2018-12-05
上周,一個同事試用期沒通過,被勸退離職。公司主要徵求了我的意見,我認為考察一個人主要從三方面來考慮:1、技術水平;2、學習能力(包括對新環境的適應能力);3、對待事物的態度。在職場上混的這幾年,對於公司來說,能招到一個對技術有濃厚興趣的職工非常不容易,大部分人只是把技術當作自己的工作,而非興趣。日複一日,年複一年,他都在做同樣的工作,寫同樣的代碼,永遠都在原地踏步。