上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页

2011年6月13日

【笔记】Eclipse and Java for Total Beginners—013

摘要: Lesson 13 – Continue checkOut MethodTest checkOut, checkIn methodsFix compiler error – misplaced {}Add test for maximum booksCreate test for getBooksForPerson() methodRefactoring – extrack method 1 package org.totalbeginner.tutorial; 2 3 import java.util.ArrayList; 4 5 import org.omg.CORBA.PUBLIC_ME 阅读全文

posted @ 2011-06-13 09:50 yf.x 阅读(259) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—012

摘要: Lesson 12 – Create checkOut, checkIn MethodsCreate test for checkOut, checkIn methodsWrite checkout methodIntroduce if / then / else syntaxIntroduce boolean methodWrite checkIn method1. testCheckOut Method Test both the checkOut and checkIn methodsCheck Out a bookCheck Out second bookCheck in a book 阅读全文

posted @ 2011-06-13 08:51 yf.x 阅读(337) 评论(0) 推荐(0)

2011年6月12日

【笔记】Eclipse and Java for Total Beginners—011

摘要: Lesson 11 – Create first methods in MyLibrary classCreate test method for addBook, removeBook methodsCreate addBook, removeBook methods and testCreate addPerson, removePerson methodsIntroduce Eclipse refactoring – move local variable to field 1 package org.totalbeginner.tutorial; 2 3 import java.uti 阅读全文

posted @ 2011-06-12 15:44 yf.x 阅读(321) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—010

摘要: Lesson10 – Start on MyLibrary ClassCreate MyLibrary Test JUnit testCreate testMyLibrary to test MyLibrary constructorCreate MyLibrary constructorIntroduce instanceof operatorIntroduce assertTrue method 1 package org.totalbeginner.tutorial; 2 3 import java.util.ArrayList; 4 5 import junit.framework.T 阅读全文

posted @ 2011-06-12 14:41 yf.x 阅读(267) 评论(0) 推荐(0)

2011年6月11日

【笔记】Eclipse and Java for Total Beginners—009

摘要: Lesson 09 – MyLibrary Class and ArrayListHow can we hold books, etc. in a collection?MyLibrary object to hold Person & Entry objectsIntroduce ArrayList in scrapbookIntroduce Java GenericsMethod chaining使用ArrayList前,要添加java.util. 1 ArrayList<Book> list = new ArrayList<Book>(); 2 3 Boo 阅读全文

posted @ 2011-06-11 21:07 yf.x 阅读(392) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—008

摘要: Lesson 08 – Add Person to Book ClassCreate a relationship between the Book class and the Person classTest getPerson methodCreate JUnit Test Suite1. 本课的任务目前,已创建Person class 和 Book class。需要显示哪个人借了哪本书。要创建Book 和Person之间的关联。仍用test-first方法。2. 步骤 打开BookTest,添加method.创建testGetPerson() method.创建getPerson() m 阅读全文

posted @ 2011-06-11 13:40 yf.x 阅读(298) 评论(0) 推荐(0)

2011年6月10日

【笔记】Eclipse and Java for Total Beginners—007

摘要: Lesson 07 – Create Book ClassCreate BookTest before creating Book classTest Book constructorCreate get and set methods1. 新建一个JUnit test case, name为BookTest, Class under test为空,因为尚未建Book class.2. 建立Book class, 注意目录为src。3. Test-first approach to Book classCreate BookTest class.Create testBook() method 阅读全文

posted @ 2011-06-10 16:38 yf.x 阅读(383) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—006

摘要: Lesson 06 – Using Test-First Development in EclipseUse test-first approach to write the Person toString() methodMethod overridingField Hiding1. toString() methodinherited from Object classreturns a String representation of the objectnormally create for every class2. Test-driven developmentThink abou 阅读全文

posted @ 2011-06-10 15:32 yf.x 阅读(233) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—005

摘要: Lesson 05 – JUnit Testing ContinuedTest Person class – part 2Create test methods for constructor, getName, and getMaximumBooksStatic methods 这里的assertEquals是Static method.当其在所属的Class内部时,可略写Class。 1 package org.totalbeginner.tutorial; 2 3 import org.totoalbeginner.tutorial.Person; 4 5 import junit.fr 阅读全文

posted @ 2011-06-10 09:25 yf.x 阅读(262) 评论(1) 推荐(1)

2011年6月9日

【笔记】Eclipse and Java for Total Beginners—004

摘要: Lesson 04 – JUnit Testing in Eclipse, Part 1Create test source folderCreate Person Test classRun first JUnit test1. Scrapbook的优/缺点Great for exploring new Java classes and trying commmands.Does not let you automate testing2. Unit Testing的特点Automated testing of all methodsVery valuable when making cha 阅读全文

posted @ 2011-06-09 17:45 yf.x 阅读(357) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—003

摘要: Lesson 03 – Use Eclipse ScrapbookIntroduce Eclipse ScrapbookIntroduce Java expressions, statementsDiscuss Java packagesCreate Person Object in Scrapbook1. 打开Scrapbook RC project / New / other / Java / Java Run/Debug / Scrapbook.page / Next / MyScrapbook (name) / Finish.2. Scrapbook的作用 Scrapbook allo 阅读全文

posted @ 2011-06-09 15:36 yf.x 阅读(257) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—002

摘要: Lesson 02 – Add Methods To ClassIntroduce Eclipse Views and PerspectivesIntroduce Eclipse user interface – drag / drop, cnntext menus, helpAdd get and set methods to Person class1. 自动提示或补充标识符。 英文版的系统用Ctrl+Space, 中文版的系统用Alt+/。2. Parameters and Fields.3. this this = the current object4. Class members 阅读全文

posted @ 2011-06-09 14:51 yf.x 阅读(268) 评论(0) 推荐(0)

【笔记】Eclipse and Java for Total Beginners—001

摘要: 偶然搜到Mark Dexter的这个免费视频(http://eclipsetutorial.sourceforge.net/totalbeginner.html)。够傻瓜,够直观。慢慢习之。Lesson 01 – Create Your First Java ClassCreate Java project in EclipseCreate Java package Introduce classes and objects, naming conventionsWrite a simple Java class (Person)Create Java project in Eclipse . 阅读全文

posted @ 2011-06-09 10:57 yf.x 阅读(389) 评论(0) 推荐(0)

2011年6月8日

【笔记】Stanford OpenCourse—CS106A:Programming Methodology—005

摘要: ch04 Programming Exercise1. 1 /** 2 * File: Ex4_1.java 3 * ---------------- 4 * This program is to generate the lyrics . 5 * 6 * @author Administrator 7 * 8 */ 9 import acm.program.*;10 11 public class Ex4_1 extends ConsoleProgram {12 13 public void run() {14 15 for (int i=n; i>0; i--){16 println 阅读全文

posted @ 2011-06-08 21:06 yf.x 阅读(632) 评论(0) 推荐(0)

2011年6月2日

【笔记】Stanford OpenCourse—CS106A:Programming Methodology—004

摘要: 一切又从helloworld开始 到这节,就和Karel byebye了。为了快速、方便,引入了acm.jar这个东东。课上,教程里都没说太多关于这个东东的使用前的准备工作。在打谱(对着教程敲代码)时,似乎无从下手,helloworld怎么创建呢? 先看eclipse的Help菜单里的Tutorial,果然是从helloworld开始,细看,代码,不对啊,没用什么acm.program.*或是acm.graphics.*。放狗一搜,原来Tutorial用的标准Java代码。要像教程那样玩,必须导入acm.jar. 这样,就搜到了ACM Java Task Force(http://jtf.ac 阅读全文

posted @ 2011-06-02 16:50 yf.x 阅读(1143) 评论(0) 推荐(0)

2011年6月1日

【笔记】Stanford OpenCourse—CS106A:Programming Methodology—003

摘要: Section Handout让Karel把地图的内圈布满方块,起始和完成后的效果如图 思路:很简单,先移到起始点(2,2),然后开始放方块就OK了。至于放方块就要考虑每行或列的最后一个位置不放,而且为了简化代码,能循环。每放置一行或列需要回到下一行或列的起始点(也就是上行或列的最后1个方块的位置),当然,这时Karel要做好开始放方块的准备,即面向新的行或列。代码: 1 * File: StoneMasonKarel.java 2 */ 3 4 import stanford.karel.*; 5 6 public class StoneMasonKarel extends SuperKar 阅读全文

posted @ 2011-06-01 22:20 yf.x 阅读(624) 评论(0) 推荐(0)

2011年5月31日

【笔记】Stanford OpenCourse—CS106A:Programming Methodology—002

摘要: Problem solving in Karel DecompositionThe Idea of an algorithm1. 翻山越岭的Karl Karl爬山,不管是百步梯还是千步梯,类似图1 图 1这个范例主要学习将问题分解成一个个简单的模块,化繁为简,逐步求精。思路:1> Karel来到山脚下(爬山当然要先到山边,没有自驾车,没有景区bus,没有。。。,只有2条腿;)。2> 开始爬山,就是上楼梯,下楼梯;3> 离开(爬山结束,该干嘛干嘛去,反正不能堵了山门干收费的勾当)。1>和3>好说,Karel够单一,认准一个方向(east)直走,碰到墙就停下。2> 阅读全文

posted @ 2011-05-31 23:45 yf.x 阅读(971) 评论(0) 推荐(0)

2011年5月30日

【笔记】Stanford OpenCourse—CS106A:Programming Methodology—001

摘要: Karel the robot learns javach1-ch31. you’ll get to pratice using the eclipse editor and the debugger from the very begining of the course.2. problem solving is the essence of programming, the rules are just a minor concern along the way.3. by starting with Karel, you can concentrate on solving probl 阅读全文

posted @ 2011-05-30 17:35 yf.x 阅读(1343) 评论(0) 推荐(1)

2011年5月14日

【原创】基于Altera DE2的数字实验—001_3 (DE2)(Digital Logical)(Verilog)

摘要: Project 3 本实验实现一个定时器。KEY3可以启动和停止计时。KEY0复位(计数停止)。基本思路就是利用Project 2的分频时钟100Hz驱动十进制的计数器,将4个十进制的计数器串联,那么在HEX3-2上显示的数字就以S递增。本实验包含以下内容:1. 顶层模块的设计。2. 单稳态脉冲的生成。3. 编译报告。设计1. 顶层模块(1)设置状态变量和计数器 (2)设计一个4个数字的行波进位十进制计数器 (3)将计数结果显示在7-segment上 (4)使用选通时钟控制计数器 (5)使用单稳触发复位信号。 (6)用KEY3和KEY0控制状态 (7)把state和reset信号显示在绿色le 阅读全文

posted @ 2011-05-14 16:59 yf.x 阅读(1234) 评论(0) 推荐(0)

2011年5月13日

【原创】基于Altera DE2的数字实验—001_2 (DE2)(Digital Logical)(Verilog)

摘要: Project 2 本实验主要是练习计数器,以及利用计数器分频。本实验包含以下内容:1. 时钟分频2. 十进制计数器3. 十六进制计数器4. Quartus II的编译报告设计1. 时钟分频 把DE2上的50MHz的时钟分成以下7种: 在顶层模块(diglab2)里我们把上述分频得到的7个时钟组成的数组叫做myclock。 分频所得的时钟可映射到外部I/O接口,以备他用: 把1Hz-10KHz的时钟接到绿色LED.观察.只有1Hz和10Hz的可辨. 本实验分频的思路很简单,先把50MHz的时钟用50分频分成1MHz,然后再用10分频递推分频,直到1Hz.有点像行波进位加法器的思路,同样,性能应 阅读全文

posted @ 2011-05-13 21:13 yf.x 阅读(2278) 评论(6) 推荐(2)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页

导航