星期日, 5月 02, 2010

【OpenGl】俄羅斯方塊....


【OpenGl】第一個無聊的遊戲。
【顯示中文】實在是很麻煩。
【FREETYPE2】提供的函數,完成了顯示中文。
【當初】沒看到FT_Glyph object must be released with FT_Done_Glyph,花很多時間再查記憶體。
【記憶體】在GET FT_Glyph,之後要記得 FT_Done_Glyph,不然記憶體就慢慢的增加。
【下載】下載點


星期日, 4月 25, 2010

【opengl】glut 中 在 wingw ,msys 建立環境


折騰很久,本來都是用 ubuntu 去編譯,
想說換來 windows ,發現問題實在是一堆,
找了GOOGLE : http://code.google.com/p/msys-cn/
這個 似乎都整合好了,也有GLUT SDL freeType ...等的套件
真是太棒了,這樣就可以把在UBUNTU上寫的make了.

某些問題:glut.h 裡面似乎發生問題,
之後 註解掉typedef unsigned short wchar_t;
問題就解決了,也不曉得為什麼。
在g++ 裡面引入iostream 會發生問題,
最後在 include前面加入:
#ifdef __STRICT_ANSI__
#undef __STRICT_ANSI__
#endif
就不會error 了 .....XD。


星期四, 4月 08, 2010

【網路空間設定】

最近作專題,需要用到一些在PHP.INI 裡面設定路徑,
然而 空間是免費的所以很多都沒有辦法條....


ini_set("display_errors",1);//可以顯示錯誤

set_include_path( "/...../pear_data/PEAR");//裡面填 需要用的路徑


星期六, 4月 03, 2010

【fancybox】AJAX來進行POST傳送

html 裡面的href 在網址的最後面
 放入#1 意思就是 $_POST['selector'] = 1

【html】
<a href="http://.../SummaryView/#1" class="adinfo2">
title="摘要"&gt;顯示摘要</a>
</code>

【JS】
<script type="text/javascript">
...
$(".adinfo2").fancybox({
ajax : {
  type: "POST"
}
});
....
</script>


【PHP】
//使用 selector 接收
echo $_POST['selector'];
?>




星期一, 3月 29, 2010

字型大小blogger

在 http://mingray.blogspot.com/2009/08/blogger.html
看到可以加入 調整字型的工具!!
效果很棒!!!

星期三, 12月 02, 2009

matlab 2009 12/03 w01


% program file w1_20091203.m
clear all;
close all;
x_n = [2 1 1/2 1/4];
nx = [-1 0 1 2];
h_n = [1 1 1 1 ];
nh = [0 1 2 3];
y_n = conv(x_n,h_n);
y_n2 = conv(h_n,x_n);

n0 = nx(1) + nh(1);
N = length(nx)+length(nh)-1;
n = n0:n0 + N-1;

subplot(211);
stem(n,y_n,'b');
grid;

subplot(212);
stem(n,y_n2,'r');
grid;

matlab 2009 12/03 w01


% program file w1_20091203.m
clear all;
close all;
n_x = [2 1 1/2 1/4];
nx = [-1 0 1 2];
h_n = [1 1 1 1 ];
nh = [0 1 2 3];
y_n = conv(n_x,h_n);

n0 = nx(1) + nh(1);
N = length(nx)+length(nh)-1;
n = n0:n0 + N-1;

subplot(111);
stem(n,y_n,'b');
grid;