#include<GL/glut.h>#define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES);\ glVertex2f((x1),(y1)); glVertex2f((x2),(y2)); glEnd()void init(){ glClearColor(0.0, 0.0, 0.0, 0.0); glShadeModel(GL_FLAT);}void display(void){ int i; glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 1.0, 1.0); glEnable(GL_LINE Read More
posted @ 2011-06-03 14:50 zendPger Views(1805) Comments(0) Diggs(0) Edit
private function fetchUrl($url){ $curl_hand = curl_init($url); curl_setopt($curl_hand,CURLOPT_RETURNTRANSFER,true); $curl_Data = curl_exec($curl_hand); if($curl_Data === false) { $this->showErrorInfo(new Exception()); } curl_close($curl_hand); return $curl_Data;} /* * 功能: 获取通过给定的正则表达式匹配的结果. * 参数: Read More
posted @ 2011-05-31 13:29 zendPger Views(339) Comments(0) Diggs(0) Edit
1 #include<GL/glut.h> 2 3 static GLfloat spin = 0.0; 4 5 void init(void) 6 { 7 glClearColor(0.0, 0.0, 0.0, 0.0); 8 glShadeModel(GL_FLAT); 9 }10 11 void display(void)12 {13 glClear(GL_COLOR_BUFFER_BIT);14 glPushMatrix();15 glRotatef(spin, 0.0, 0.0, 1.0);16 glColor3f(0.2, 0.5, 0.9);17 glRectf(-3 Read More
posted @ 2011-05-31 11:06 zendPger Views(161) Comments(0) Diggs(0) Edit
#import <UIKit/UIKit.h>@interface Button_FunViewController : UIViewController { IBOutlet UILabel *statusText; //输出口}@property (nonatomic,retain) IBOutlet UILabel *statusText;-(IBAction)buttonPress:(id)sender;//传递到操作方法中的参数是调用它的控件或对象@end Read More
posted @ 2011-05-28 15:21 zendPger Views(481) Comments(0) Diggs(0) Edit
使用这个命令打开seahorse的程序界面:~$ seahorse&删掉default文件夹 Read More
posted @ 2011-05-25 18:52 zendPger Views(1124) Comments(0) Diggs(0) Edit
考虑到前不久在这儿测试Wordpress主题的惨痛经历,俺决定自己建一个web平台来先在本机测试本来想在openSUSE中安装,但想想apt-get这几键俺按得比较多,就先在Ubuntu中下手 按照 Unofficial Ubuntu 6.06 (Dapper Drake) Linux Starter Guide的步骤来一、安装Apache2 sudo apt-get install apache2 然后在Firefox中打开: http://localhost/ 提示成功二、安装PHP5 sudo apt-get install php5 sudo apt-get install libap Read More
posted @ 2011-05-25 14:26 zendPger Views(187) Comments(0) Diggs(0) Edit
创建某个特定的类对象之前,Objective-c编译器需要一些有关该类的信息(就像c编译器在调用一个定义在调用位置之后的函数时需要通过一个函数原型获取函数的信息一样)。特别地,它必须知道类的数据成员和它提供的特性。可以使用@interface指令把这种信息传递给编译器.@interface name:NSObject{ float var; //实例变量}-(void) print:(float) var;//函数原型@endobj-的接口跟其他语言不太一样.在csharp中接口只用来定义一组行为规范.obj-c中,接口用来像编译器提供类的信息,同时也定义一组类的行为规范。 Read More
posted @ 2011-05-24 09:16 zendPger Views(312) Comments(0) Diggs(0) Edit
1 #import <Foundation/Foundation.h> 2 3 int a,b,c;//静态变量 4 5 int main (int argc, const char * argv[]) 6 { 7 8 NSLog(@"BOOL type size:%d",sizeof(BOOL));//typedef signed char BOOL 9 10 if(FALSE == 0)//#define FALSE 011 {12 NSLog(@"FALSE == 0 FALSE is %d",FALSE);13 }14 else15 Read More
posted @ 2011-05-21 14:18 zendPger Views(1552) Comments(0) Diggs(0) Edit
<?php class PublicOperating { /* * 打印此成员函数执行过程中发生的错误信息 */ protected function showErrorInfo($ex) { echo '<div style="border:2px solid red;background-color:#DAF1FA"><div style="background-color:green;color:yellow;text-align:center">Error Message</div><di Read More
posted @ 2011-05-20 15:59 zendPger Views(174) Comments(0) Diggs(0) Edit
2 * malloc: 3 * 根据指定的参数分配一个连续的内存块, 4 * 成功返回指针内存块的指针(void *),失败返回NULL. 5 * void *指针的由来: 6 * malloc是如何知道你请求的内存需存储的int,float还是struct呢? 7 * 它并不知道,所以malloc返回一个void *.正缘于这个原因,标准表示 8 * 一个void*指针可以转换为任何其他类型的指针. 9 * 10 * 11 */ 12 #include<stdio.h> 13 #include<stdlib.h> 14 15 #define NUM_INT 25 16 Read More
posted @ 2011-05-20 10:54 zendPger Views(208) Comments(0) Diggs(0) Edit