<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    2006年7月6日

    http://www.csit.fsu.edu/~burkardt/data/data.html
    可以從中找到大部分文件格式的相關信息。例如BMP,Obj等等。

    http://www.csit.fsu.edu/~burkardt/data/obj/obj.html
    介紹OBJ文件格式,關鍵是當中提供了讀寫和轉換OBJ文件的工具建議。

    posted @ 2006-10-31 00:11 cjren 閱讀(272) | 評論 (0)編輯 收藏
     

    ?helloWorldEg.jpg
    就一幅圖,仔細看看和聯想一下,也許會有點得益:-)

    posted @ 2006-07-23 20:14 cjren 閱讀(268) | 評論 (0)編輯 收藏
     
    What do you know The Life Cycle of a Thread?
    threads-states.gif
    Can you say something about the life cycle of a thread, it's creating, starting, running, not runnale, and stopping? If you do want to know about more, please check it out: http://java.sun.com/docs/books/tutorial/essential/threads/lifecycle.html
    posted @ 2006-07-23 20:10 cjren 閱讀(323) | 評論 (0)編輯 收藏
     

    (1)
    The Art of Programming Language
    《計算機程序設計藝術》 清華大學出版社

    (2)
    Introduction to Algorithms, Second Edition
    Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein
    MIT
    《算法導論,影印版》高等教育出版社

    (3)
    Intruduction to The Design and Analysis of Algorithms
    (US)Anany Levitin
    算法設計與分析基礎
    潘彥 譯?
    清華大學出版社

    其實第一本我沒有看過,只是提及算法方面的書籍,這一本好像都應該為人所知道似的。第二本的課程資料可以在mit的open course ware頁面下載。第三本的譯本很不錯,感覺很有點幽默有趣,而且書的結構挺新穎,不至于讓人馬上對算法這東西覺得恐怖和煩悶。推薦第三本。

    posted @ 2006-07-23 19:38 cjren 閱讀(739) | 評論 (0)編輯 收藏
     

    移動 -- 只有GSM,GPRS是GSM的升級版,134-139 手機使用移動的SIM卡???????

    聯通 -- GSM? 130,131,132?????? 手機使用聯通SIM卡
    ?????????-- CDMA 133 (聯通新時空),手機使用UIM卡


    GSM比較簡單。所謂的GSM 900/1800/1900是指GSM手機的工作頻率,分別是中國移動支持的900MHz,1900MHz和美國常用的1900MHz。在國內用支持900MHz和1800MHz的GSM 900/1800雙頻手機就可以了。如果要出國到美國用的,就要用支持1900MHz的三頻手機了。

    CDMA比GSM的通話質量、手機輻射小和保密性方面都好,但是技術!=市場。
    CDMA -- CDMA800
    ?????????? ?-- CDMA 1X 現在聯通CDMA網絡所采取的技術。與真正的CDMA2000相比,CDMA 1x就像我剛才說的,只能支持到153.6kbps的數據速度,因此被稱為是2.5G的技術,還不是真正3G的技術。
    ????????? ? -- CDMA2000 一種3G的標準。


    3G 有三個標準
    ??????????? -- WCDMA 有利于中國移動,設備由歐洲進口,容易升級到WCDMA。這套系統能夠架設在現有的GSM網絡上,對于系統提供商而言可以較輕易地過渡,而GSM系統相當普及的亞洲對這套新技術的接受度預料會相當高。因此W-CDMA具有先天的市場優勢。
    ?
    ???????????? -- CDMA2000 利于聯通,設備由美國進口,容易升級到CDMA2000。目前使用CDMA的地區只有日、韓和北美,所以CDMA2000的支持者不如W-CDMA多。不過CDMA2000的研發技術卻是目前各標準中進度最快的,許多3G手機已經率先面世。

    ???????????? -- TD-SCDMA 中國自己有獨立知識產權的產品。采用這一標準,對于國防等重要領域國民經濟安全有利。據說中國電信和中國網通都在申請移動運營牌照,他們傾向于TDS-CDMA。
    ?????? 至于現在中國采用哪一種現在還沒有定論。畢竟需要市場和企業來最終決定,記住技術優秀的并不代表最終就能勝出。

    posted @ 2006-07-23 19:28 cjren 閱讀(550) | 評論 (0)編輯 收藏
     

    "Computer science is no more about computers than astronomy is about telescopes."

    ????????????????????????????????????????????????? E. W. Dijkstra
    計算機是一個工具,一個人造的工具,人制造工具的目的是什么?協助自己完成生產勞動,或確切地說是完成自己生存和生活的需要。由于需要完成大量的運算而產生的計算機,即使是到現在也局限于信息的處理,包括簡單的運算和信息(數字)的存儲。

    而在學習當中,“sprint,struct”等這些名字聽起來真的很大,而我常問自己“我需要學習它嗎?”。是否不懂它們就不算懂java了呢?我從4月份開始覺得java離自己越來越遠了,因為我上許多的關于java的論壇,看到的極大部分都是討論框架,而我對此沒有什么概念。“需求驅動學習”是我的信條,沒有這個需求,你就沒有學習那相應知識的必要,更沒有動力。也許這是我懶的借口:-) 大概是自己尚且是學生,沒有投身都企業生產當中因此對這些企業開發的知識沒有概念吧。反正覺得現在沒有學這個的必要,誰知道兩年后是否有什么summer or XXname的框架出現呢?

    這個暑假其實自己還是想把握時間看看書的,反正又沒有找到實習工作。例如data structure & algorithm,算法分析這門課沒有學過,真的遺憾,只能自己補補;還有那Developing Games in Java的part 3,當中講的是3d的renderring,而不涉及opengl以及java3d或opengl binding等API,自己還是很有興趣的。而昨天在國外的大學的網站上下載了一個OS課程的lecture notes,正好復習一下操作系統的概念。

    posted @ 2006-07-08 10:25 cjren 閱讀(649) | 評論 (1)編輯 收藏
     
         摘要: 2006-7-7 CP2003 -- Principles of Programming Languages 1997 This course (subject) comes frome http://www.cs.jcu.edu.au/Subjects/cp2003/1997/lecturenotes.html, and you can fin...  閱讀全文
    posted @ 2006-07-07 10:49 cjren 閱讀(614) | 評論 (0)編輯 收藏
     

    上午看某文章時候涉及緩沖區溢出的問題,談到C的棧和堆,有所不懂于是baidu了一下發現論壇上的解釋都較為凌亂,google一下后發現國外大學的Lecture Notes 中有不少的說明,下面簡單的摘錄三段,一是c中的,二是對于java的,三是從os角度看的。

    Stack vs Heap Allocation
    How the memory of the computer is organized for a running program? When a program is loaded into memory, it is organized into three areas of memory, called segments: the text segment, stack segment, and heap segment. The text segment (sometimes also called the code segment) is where the compiled code of the program itself resides. This is the machine language representation of the program steps to be carried out, including all functions making up the program, both user defined and system.

    The remaining two areas of system memory is where storage may be allocated by the compiler for data storage. The stack is where memory is allocated for automatic variables within functions. A stack is a Last In First Out (LIFO) storage device where new storage is allocated and deallocated at only one ``end'', called the Top of the stack. This can be seen in Figure 14.13.?
    ?figure14.13.gif

    When a program begins executing in the function main(), space is allocated on the stack for all variables declared within main(), as seen in Figure 14.13(a). If main() calls a function, func1(), additional storage is allocated for the variables in func1() at the top of the stack as shown in Figure 14.13(b). Notice that the parameters passed by main() to func1() are also stored on the stack. If func1() were to call any additional functions, storage would be allocated at the new Top of stack as seen in the figure. When func1() returns, storage for its local variables is deallocated, and the Top of the stack returns to to position shown in Figure 14.13(c). If main() were to call another function, storage would be allocated for that function at the Top shown in the figure. As can be seen, the memory allocated in the stack area is used and reused during program execution. It should be clear that memory allocated in this area will contain garbage values left over from previous usage.

    The heap segment provides more stable storage of data for a program; memory allocated in the heap remains in existence for the duration of a program. Therefore, global variables (storage class external), and static variables are allocated on the heap. The memory allocated in the heap area, if initialized to zero at program start, remains zero until the program makes use of it. Thus, the heap area need not contain garbage.
    小結:
    Stack: automatic variables within functions
    Heap: global variables (storage class external), and static variables
    ============================
    In java 情況如下
    (1)
    ?The stack is the program memory area, so all your primitive type variables and the memory adress of your objects are written on the stack. It is a fast access valuable memory area.
    The heap is where the VM keeps the objects, and it is a huge amount of memory. When you create an object, the VM puts the object in the HEAP and puts the adress of the object created on the STACK.
    (2)
    ?There are two kinds of memory used in Java. These are called stack memory and heap memory. Stack memory stores primitive types and the addresses of objects. The object values are stored in heap memory. An object reference on the stack is only an address that refers to the place in heap memory where that object is kept.
    ?It is useful to know that these two different kinds of memory exist in Java. Stack memory is the program's memory, and heap memory resides outside of the program.這好像有點跟C的不同(相反)。
    引入一點垃圾回收機制的知識
    ?When you need a new object, Java allocates the required memory. When you are done with an object, the memory is reclaimed for you automatically via Java's garbage collection facility.
    ?Garbage collection runs as a thread in the background, looking for objects that no longer have a usable reference. When it finds them, it destroys them and reclaims the memory.
    ?The implementation of garbage collection varies between Java Virtual Machines. They generally follow the same process, however. First, the garbage collector gets a snapshot of all running threads and all loaded classes. Then, all objects that are referred to by this thread set are marked as current. The process stops when all objects that it is possible to reach have been marked and the rest have been discarded.
    ?In order to help the Virtual Machine, it is a good idea to remove your references to unneeded objects. This is often done by simply setting your reference to null:
    ?Test t = new Test();
    ?t.someAction();
    ?// all done
    ?t = null;
    小結:
    Stack: Primitive data types(primitive types), the addresses of objects(=references).
    Heap:? objects.

    ===============================================
    從系統的角度看 stack(棧)和heap(堆)
    Dynamic Data Structures: The Heap
    A typical personal computer or workstation today has somewhere between 16 and 64 megabytes of RAM installed. Using a technique called virtual memory, the system can swap pieces of memory on and off the machine's hard disk to create an illusion for the CPU that it has much more memory, for example 200 to 500 megabytes. While this illusion is complete as far as the CPU is concerned, it can sometimes slow things down tremendously from the user's perspective. Despite this drawback, virtual memory is an extremely useful technique for "increasing" the amount of RAM in a machine in an inexpensive way. Let's assume for the sake of this discussion that a typical computer has a total memory space of, for example, 50 megabytes (regardless of whether that memory is implemented in real RAM or in virtual memory).
    The operating system on the machine is in charge of the 50-megabyte memory space. The operating system uses the space in several different ways, as shown here:

    ?c-heap.gif
    The operating system and several applications, along with their global variables and stack spaces, all consume portions of memory. When a program completes execution, it releases its memory for reuse by other programs. Note that part of the memory space remains unused at any given time.

    This is, of course, an idealization, but the basic principles are correct. As you can see, memory holds the executable code for the different applications currently running on the machine, along with the executable code for the operating system itself. Each application has certain global variables associated with it. These variables also consume memory. Finally, each application uses an area of memory called the stack, which holds all local variables and parameters used by any function. The stack also remembers the order in which functions are called so that function returns occur correctly. Each time a function is called, its local variables and parameters are "pushed onto" the stack. When the function returns, these locals and parameters are "popped." Because of this, the size of a program's stack fluctuates constantly as the program is running, but it has some maximum size.

    As a program finishes execution, the operating system unloads it, its globals and its stack space from memory. A new program can make use of that space at a later time. In this way, the memory in a computer system is constantly "recycled" and reused by programs as they execute and complete.

    In general, perhaps 50 percent of the computer's total memory space might be unused at any given moment. The operating system owns and manages the unused memory, and it is collectively known as the heap. The heap is extremely important because it is available for use by applications during execution using the C functions malloc (memory allocate) and free. The heap allows programs to allocate memory exactly when they need it during the execution of a program, rather than pre-allocating it with a specifically-sized array declaration.

    posted @ 2006-07-06 17:30 cjren 閱讀(4429) | 評論 (3)編輯 收藏
     


    在嘗試建立自己的可重用package的時候,對package和import語句做了些試驗,記錄結果如下。

    使用說明:
    (1)對于src\com\cjren\util\ClassA.java這個提供給其他類使用的class.
    package com.cjren.util;
    public class ClassA {
    ? ...
    }
    編譯時:
    javac -d . ClassA.java? // -d . 表示了以當前目錄為package語句生成的相對根目錄。
    結果是在ClassA.java所在的目錄下生成了com.cjren.util包,里面含ClassA.class,這個包可以復制剪貼到其他的地方供其他類使用。
    Notes:
    必須使用"-d .",否則ClassA.class并不會放在com.cjren.util包里面,而是生成在和ClassA.java相同的目錄下。


    (2)對于要使用ClassA的ClassB.java.
    import com.cjren.util.ClassA;
    public class ClassB {
    ? ... // use ClassA here
    }

    To compile: javac ClassB.java
    To run:???? 假設com包放在和ClassB.java的當前目錄
    ??????????? java ClassB???????
    ??????????? // or java -cp . ClassB // here use the "-cp ." as the current directory to find the package com.
    ??????????? 假設com包放在D:\Program Files\Java\mypackages下
    ??????????? java -cp D:\Program Files\Java\mypackages ClassB

    Notes:
    錯誤一:
    package com.cjren.util;
    public class ClassA {
    ? ...
    }
    編譯后直接把com.cjren.util包里面的ClassA.class文件拷貝到和ClassB.java相同的目錄下直接使用,
    public class ClassB {
    ? ... // use ClassA here
    }
    To compile: javac ClassB.java
    錯誤信息是
    "ClassB.java:某一行: 無法訪問 ClassA
    ?錯誤的類文件: .\ClassA.class
    ?類文件包含錯誤的類: com.cjren.util.ClassA
    ?請刪除該文件或確保該文件位于正確的類路徑子目錄中。"
    想一想為什么出錯信息是說:“錯誤的類文件: .\ClassA.class, 類文件包含錯誤的類: com.cjren.util.ClassA”呢?因為"錯誤的類文件: .\ClassA.class"當中包含了"錯誤的類: com.cjren.util.ClassA"這個信息,而這個"com.cjren.util.ClassA"是在ClassA.java中的"package com.cjren.util;"語句所造成的。
    正確的做法是把ClassA.class所在的包整個復制粘貼到ClassB.java所在的目錄下,或者在ClassB.java所在的目錄下人為手動的建立com\cjren\util\目錄,然后直接把ClassA.class文件復制粘貼到此。這暗示了代碼生成的包和手動建立的目錄可能是一樣。
    可見,當ClassA.java的源代碼中含"package com.cjren.util;"語句,則生成com.cjren.util包里面的ClassA.class文件里面應該就也包含了自己這個class文件所屬的包信息,所以這個ClassA.class只能放在這個代碼中已經指定的特定包的路徑下使用,而不能把這個ClassA.class獨立出來使用,因為這樣的話將ClassA.class文件屬性中的的包信息不相符。當然當這個ClassA.java沒有顯式地制定package語句信息時候,我懷疑(也覺得應該)是默認在ClassA.class文件當中包含了包的信息就是".",可以理解為默認的加入了"package .;"語句。

    錯誤二:
    public class ClassA {
    ? ...
    }
    編譯后這個ClassA.class文件中含有的包的信息是"."當前目錄就包!
    把這個ClassA.class文件,移到以ClassB.java所在的目錄為當前父目錄的人為手動建立的com\cjren\util目錄下。
    import com.cjren.util.ClassA;
    public class ClassB {
    ? ... // use ClassA here
    }

    To compile: javac ClassB.java
    錯誤信息是
    "ClassB.java:某一行: 無法訪問 com.cjren.swing.ClassA
    ?錯誤的類文件: .\com\cjren\util\ClassA.class
    ?類文件包含錯誤的類: ClassA
    ?請刪除該文件或確保該文件位于正確的類路徑子目錄中。"
    想一想為什么出錯信息是說:“錯誤的類文件: .\com\cjren\util\ClassA.class,類文件包含錯誤的類: ClassA”呢?因為你這個com.cjren.util包中的ClassA.class文件本來所默認的包信息是".",在ClassA.java中并沒有使用"package"語句指定ClassA應該屬于包com\cjren\util這個信息。

    小結:
    在嘗試過程當中發現,
    public class ClassA {
    ? ...
    }

    package com.cjren.util;
    public class ClassA {
    ? ...
    }
    這兩個只差了一個package語句的class文件大小有十幾到幾十k上的區別,這可能進一步證明了.java文件中的package語句會在.class文件中加入相應的包信息,這個包信息決定了這個class被使用時候的方式(是否需要import特定的包)。
    還有一點要注意的是:
    package com.cjren.util;
    public class ClassA {
    ? ...
    }
    之后無論是使用 javac ClassA.java 或者 javac -d . ClassA.java編譯都不會影響ClassA.class文件當中所含有的包信息,這兩種編譯方式所造成的區別在上面的使用說明中已經說過了。


    ?

    posted @ 2006-07-06 09:00 cjren 閱讀(823) | 評論 (3)編輯 收藏
     
    主站蜘蛛池模板: 四虎影视在线看免费观看 | 国产一区二区三区免费在线观看 | 成人毛片手机版免费看| 7777久久亚洲中文字幕蜜桃| 日本高清免费观看| 亚洲福利视频导航| 久久99国产综合精品免费| 日韩亚洲AV无码一区二区不卡| 国内精品久久久久影院免费| 亚洲欧洲免费视频| 成人免费在线看片| 亚洲AV无码无限在线观看不卡| 成人免费福利电影| 黄色a级片免费看| 亚洲伊人色欲综合网| 免费视频精品一区二区三区| 亚洲黄色在线网站| 成年女人毛片免费视频| 99亚洲男女激情在线观看| jlzzjlzz亚洲乱熟在线播放| 久久青草国产免费观看| 亚洲一区二区三区在线网站| 在线视频免费国产成人| 中国一级特黄高清免费的大片中国一级黄色片 | 九一在线完整视频免费观看| 狠狠色伊人亚洲综合成人| 114级毛片免费观看| 亚洲国产成人AV网站| 亚洲无人区一区二区三区| 18禁止看的免费污网站| 看一级毛片免费观看视频| 亚洲欧洲日产国码av系列天堂| 91成人免费在线视频| 九九视频高清视频免费观看| 精品亚洲成a人片在线观看少妇 | 免费观看一区二区三区| 亚洲天堂电影在线观看| 亚洲AV中文无码乱人伦| 精品国产sm捆绑最大网免费站| 狠狠入ady亚洲精品| 夜夜亚洲天天久久|