Programming Archives

  1. LDBL_MAX -1.#QNAN0e+000 with MinGW?

    I have tried to run this with both eclipse(CDT)+MinGW and Cygwin+GCC [code lang=”c”] int main() { puts("The range of "); printf("tlong double is [%Le, %Le]∪[%Le, %Le]n", -LDBL_MAX, -LDBL_MIN, LDBL_MIN, LDBL_MAX); return EXIT_SUCCESS; } [/code] but got different results: In eclipse(CDT)+MinGW The range of long double is [-1.#QNAN0e+000, 3.237810e-319]∪[6.953674e-310, 0.000000e+000] In Cygwin+GCC The range of long Continue reading...

  2. Java simulation for Brownian motion

    Here is the Java program written by me to simulate the Brownian motion. In this prac, I tried to use double buffering to improve the performances, but actually it is triple buffering. That’s because the JPane has already implemented the double buffering, so plus mine own copy of buffer to store the background coordinate system Continue reading...

  3. repaint(), paint() and update()

    Many Java programmers are befuddled by the three methods repaint(), paint(Graphics), and update(Graphics). This is because they are designed to work in a wide variety of circumstances, and they interact in a non-obvious fashion. This happens in several contexts in Java, but GUIs are the most obvious. The designers of Java wanted Java programs to Continue reading...

  4. Gui Guan’s Laboratory

    Gui Guan’s Laboratory There’s more than one way to do it http://lab.guiguan.net 发现Bluehost的服务器环境非常适合在学校和家里来测试PHP脚本,呵呵。同时为了更好的学习Internet Computing,弄了一个自己的实验室,有点Google’s Lab的感觉,但是差远老:P lol 当你点击进入之后,便是我完成的IC的第二次作业啦(默认用户名:user 密码:password)。以下是这次作业的一些要点: sticky form input validation POST SESSION mail (待续…) Continue reading...

  5. FAQ about Java import

    1. Q: Does importing all classes in a package make my object file (.class or .jar) larger? A: No, import only tells the compiler where to look for symbols. 2. Q: Is it less efficient to import all classes than only the classes I need? A: No. The search for names is very efficient so Continue reading...