C++ ~ cin to array and output use vector, for_each

#include <iostream>
#include <vector>
#include <algorithm>


int inputNumber = 1 ;
vector<int> inputArray;
while(inputNumber != 0)
{
cin>>inputNumber;
inputArray.push_back(inputNumber);
}
for_each (inputArray.begin(), inputArray.end(), myfunction);



reference
http://www.cplusplus.com/reference/algorithm/for_each/

http://stackoverflow.com/questions/3807163/stdcin-in-an-array

C++ ~ stringstream sample

void saveToTxt(stringstream& ss){
FILE *p = NULL;
char *file = "I:\\Hello.txt";

const std::string tmp = ss.str();
const char* cstr = tmp.c_str();

size_t len = 0;
p = fopen(file, "w");
if (p== NULL) {
cout <<"Error in opening a file.."< }

len = strlen(cstr);
fwrite(cstr, len, 1, p);
fclose(p);
cout<<"\nWritten Successfuly in the file.\n";

}



stringstream ss;
ss << "caaaaaaaaaaaaaa\n";
saveToTxt(ss);

C++ ~ stringstream write to file

stringstream ss;
ss << "ggggggggggg\n";

const std::string tmp = ss.str();
const char* cstr = tmp.c_str();

FILE *p = NULL;
char *file = "I:\\Hello.txt";

size_t len = 0;
p = fopen(file, "w");
if (p== NULL) {
cout <<"Error in opening a file..";
}

len = strlen(cstr);
fwrite(cstr, len, 1, p);
fclose(p);
cout<<"\nWritten Successfuly in the file.\n";

C++ ~ stringstream

#include <sstream>

stringstream ss;

string name="Tom";

ss<<"Hello "<<name<<endl;


cout<<ss.str();


reference
http://hatsukiakio.blogspot.tw/2009/04/c-stringstream.html

Seventeen 3



第37台車

通常我做一台車都會在一個禮拜內

一天摸個幾小時

可是這台車..........

過程竟然超過三個月

燈愣..........Photobucket


37會想做Seventeen第3代, 可能也跟37這數字有關

當初命名Seventeen是因為那台是我第17台車

XD

這台車定位是FR

有了定位就開始想造型紙上畫畫, 想不到第一張圖就變成這台車的梗

那時候一看就覺得~~~~靠~~~超殺的~~~~車頭就長這樣吧

XDDXXD





車體的變化就比較多了= =

過程手繪的






用3dsmax做變成這樣



屁屁


3dsmax


車尾車窗中間那一條是整個被拿掉了 .....

我在modeling過程也會一邊想像這樣弄好不好看~~~後來是覺得搞剛又不好看就簡簡單單就好XD




至於製作過程會拉這麼長

可能真的太忙了.......導致沒fu去把車體完成

當初輪胎是在圖書館做好的說

6月多的事情

就一直拖到10月要底了才開始弄= =

車體花了4天約20多小時去做


還有這台車有兩種版本

第一種就是剛出爐做好的版本~~~結果被ptt的Car版很多鄉民說車頭太長了吧

靠XD

當初做也是有覺得車頭超長的~~~~~可是就覺得拉這麼長超爽的~~~超屌

可是事實上.......真的太長太長了= =

所以有第二種版本, 後來修改好長度又再算一批圖出來

確實是好了一點.........不然一開始真的超長= =


以下就放一推圖~~~個人蠻喜歡屁屁的角度說XD

































Animation





以前的版本
Seventeen 2
http://bittyferrari.blogspot.tw/2009/09/seventeen-2-2.html

Seventeen
http://bittyferrari.blogspot.tw/2008/08/bitty-seventeen-photo-plenty.html

Unity ~ make model animation loop

function Start() {
animation.wrapMode = WrapMode.Loop;
animation.Play();
}


http://answers.unity3d.com/questions/26362/simple-question-about-animation.html

Unity ~ build Android crashes after splash

這問題發生在用Unity輸出apk到android安裝

出現開頭畫面完就直接跳出來.....

似乎是因為我用crack的關係XD


因為輸出android要到pro才行

free版沒有所以我才去找crack = =

想不到卻因為這樣才一直輸出不了apk

害我卡超久.....shiiiiiiiiiiit...........


總之安裝unity進去register的時候選Pro Trial就可以了


這樣確實可以輸出apk了

總比crack後輸出出來只能看開頭畫面好...

reference
http://answers.unity3d.com/questions/221871/android-game-crashes-after-splash-screen.html

After some searching, it appears this message shows up when the Unity application file / .exe gets modified out of its expected version information, meaning you have patched Unity, I'm assuming, in an attempt to hack it.

Sorry, but no help for you there bud. Go buy a license.


PHP ~ phpQuery foreach example

$groups = pq('.type8 tr:gt(0)');
foreach($groups as $group){
$x = pq($group)->find('td:eq(1)')->text();
print $x.', ';
}


reference
http://stackoverflow.com/questions/5994022/phpquery-get-the-values-from-each-td

PHP ~ class.upload.php upload origin image when image lower than resize x,y

$handle -> image_x = 800;
$handle -> image_y = 800;
$handle -> image_ratio = true;
$handle -> image_resize = true;
$handle -> image_ratio_no_zoom_in = true;
$handle -> image_ratio_no_zoom_out = false;

reference
http://www.verot.net/php_class_upload_docs.htm

Ubuntu ~ edit php.ini

sudo pico /etc/php5/apache2/php.ini


reference
http://ubuntuforums.org/showthread.php?t=853642