Running OpenGL on Visual Studio 2005

Posted in C&C++ on July 14, 2007 by linuxprogram

I’ve been learning OpenGL for a little while and I got sample codes to analyze sometimes. In some cases, I got errors like “Can not open file GLUT.h”, “Can not open file GLUT32.lib”..and stuff like this. First I thought I was because of the corruption of my VS libraries and wanna fix it up. After searching around, I realized that neither XP nor VS2005 come with Glut with them. And to save the world on this occasion, you have to do the following:

1. Get the newest version of GLUT here: GLUT 3.7.6 for Windows.

2.

File  Location
glut32.dll C:\WINDOWS\system\  (or system32)
glut32.lib C:\Program Files\Microsoft Visual Studio 2005\VC\PlatformSDK\Lib
glut.h C:\Program Files\Microsoft Visual Studio 2005\VC\PlatformSDK\Include\gl

3. Make sure your Visual C++ project links in the GLUT/gl/glu libraries. This can be difficult to find. In Visual Studio 2003.NET, I think this is located in:

  • Menu: “Project -> (your-project-name) Properties”
  • Tab: “Configuration Properties -> Linker -> Input”
  • Under “Additional Dependancies”, add “glut32.lib opengl32.lib glu32.lib”

** Sharing of programs that uses glut32 must includes glut32.dll also**

考试的日子

Posted in Uncategorized on April 24, 2007 by linuxprogram

今天好像没有什么好写,除了终于考完了Software Engeering, 还有酣畅淋漓的打了一场篮球。

SwEngin 我也算是很准备了些吧。跟几个同学复习,并且因为考试的case 有handout 出来,所以看起来有理有序。不管最后会拿什么grade出来,我都会觉得自己很对得起自己。

之后的一个星期,就是要准备OS, MicroC 和Data Acquisition了。OS可以拿一天,microC需要三天,DataAc 也要三天。OS的past year papers 很是烂,senior们给的solution有些直接死掉,有些因为不好回答干脆跷掉。microC却是因为换了板子,直接没有了past year paper.

晚上的时候,闷的很。身体最近又不是很好。本来想去游泳的,结果太阳公公终于没有睁开睡眼。没有办法,只好篮球,结果竟也是舒畅的很。

明天上午,有邮件hall里面有水果吃,哈哈,一定要去。

JS Photoshop Workshow

Posted in Uncategorized on April 19, 2007 by linuxprogram

读完了An Introduction To GCC

Posted in Computer, Life on April 16, 2007 by SunQ

花了两天时间,今天下午终于读完了An Introduction To GCC(ANTG).

ANTG 是一个GCC入门的小Manual,当然,有时间没事作的话,读一读GCC Complete Manual更好,不过我是没有时间了,还是把她束之作Reference好罢。

ANTG 的特点就是短小精悍,行例简单确切。每个方面都有行例,引申介绍。让人读完之后感觉虽然只是掌握最基本的技能,不能完全掌握GCC相关,但对未知有判断之感觉与寻究之方向。

CheerS!!

明天有PE HC803的考试,祝自已好运!!

Forward Into Hall Of Fame

Posted in Computer, Life on April 16, 2007 by SunQ

计算机界的名人堂。
让人景仰的同时, 散发不尽妩媚般的诱惑。
当年项公,刘竖看始皇帝出巡时怕也是这样的所想吧。

试用CTex

Posted in Computer on April 14, 2007 by SunQ

CTex 是国人版的Latex, 其完整版整合了 LaTex, MikTex, GSView 等工具,并加入了CCT和CJK以对中文支持. 下边是一篇小的练习,内容是罗素自传的序言。

%%%% Source Code
%%%% By 詹森列

\documentclass{article}
\title{What I Have Lived For
\thanks{Whoever I need to thanks}}
\author{Bertrand Russell
\thanks{whoever i need to thanks again}}
\date{GodKnowsWhen, HeWroteIt}

\begin{document}

\maketitle

Three Passions, simple but overwhelmingly strong, have governed my life: the
longing for love, the search for knowledge, and unbearable pity for the
suffering of mankind. Three passions, like great winds, have blown me hither
and thither, in a wayward course, over a deep ocean of anguish, reaching to the
very verge of despair.

\vspace{0.3cm}

I have sought love, first, because it brings ecstasy – ecstasy so great that I
would often have sacrificed all the rest of life for a few hours of this joy. I
have sought for it, next, because it relieves loneliness – that terrible
loneliness in which one shivering consciousness looks over the rim of the
world, into the code unfathomable lifeless abyss. I have sought it, finally,
because in the union of love I have seen, in a mystic miniature, the
prefiguring vision of the heaven that saints and poets have imagined. This is
what I sought, and though it might seem too good for human life, this is what -
at last – I have found.

\vspace{0.3cm}

With equal passion I have sought knowledge. I have wished to understand the
hearts of men. I have wished to know why the stars shine. and I have tried to
apprehend the Pythagorean power by which number holds sway above the flux. A
little of this, but not much I have achieved.

\vspace{0.3cm}

Love and knowledge, so far as they were possible, led upward toward the
heavens. But always pity brought me back to earth. Echoes of cries of pain
reverberate in my heart. Children in famine, victims tortured by oppressors,
helpless old people a hated burden to their sons, and the whole world of
loneliness, poverty, and pain make a mockery of what human life should be. I
long to alleviate the evil, but I cannot, and I too suffer.

\vspace{0.3cm}

This has been my life. I have found it worth living, and would gladly live it
again if the chance were offered me.

\end{document}
%%%% End Source

下边是生成的pdf文件:
luosu.pdf

Polymorphism

Posted in Java on October 22, 2006 by linuxprogram

from usenet:

Interface AorB {…}
public class ObjectA implements AorB {
    public AorB load() {
        if (needB()) {
            return new ObjectB(this);
        }else {
            return this;
        }
    }
    private boolean needB() {}
}

public class ObjectB implements AorB {
    private ObjectA a;
    ObjectB(ObjectA a) {
        this.a = a;
    }
}

how to excute a linux shell command in java

Posted in Java on October 22, 2006 by linuxprogram

quoted from: http://bbs.chinaunix.net/viewthread.php?tid=841011&extra=page%3D4

/* test.java */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class test
{
    public static void main(String[] args)
    {
        String lsString = null;
        Process process = null;
        try
        {
            process = Runtime.getRuntime().exec(“ls”);
            BufferedReader bufferedReader = new
                BufferedReader(new InputStreamReader(process.getInputStream()));
            while ((lsString = bufferedReader.readLine()) != null)
            {
                System.out.println(lsString);
            }
            try
            {
                process.waitFor();
            }
            catch (InterruptedException e)
            {
                e.printStackTrace();
            }
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
    }
} // end test.java