1 //exercise 2.2 2 package secondchapterexercise1; 3 4 public class first01 { 5 6 public static void main(String[] args) { 7 // TODO Au...
分类:
编程语言 时间:
2014-11-12 22:39:26
阅读次数:
333
EXERCISE 36Designing and DebuggingRules for If- Statements1. Every if- statement must have an else.2. If this else should never be run because it does...
分类:
编程语言 时间:
2014-10-30 16:47:05
阅读次数:
166
/* Exercise: Loops and Functions #43 */package main import ( "fmt" "math") func Sqrt(x float64) float64 { z := float64(2.) s := float64(0)...
分类:
其他好文 时间:
2014-10-29 01:48:06
阅读次数:
282
package mainimport ( "io" "os" "strings" "fmt")type rot13Reader struct { r io.Reader}func (rot13 rot13Reader)Read(p []byte) (n int, err...
分类:
其他好文 时间:
2014-10-29 01:39:56
阅读次数:
231
Remember the picture generator you wrote earlier? Let's write another one, but this time it will return an implementation ofimage.Imageinstead of a sl...
分类:
其他好文 时间:
2014-10-29 00:02:52
阅读次数:
394
Implement the following types and define ServeHTTP methods on them. Register them to handle specific paths in your web server.type String stringtype S...
分类:
Web程序 时间:
2014-10-28 23:51:10
阅读次数:
222
Copy yourSqrtfunction from the earlier exercises and modify it to return anerrorvalue.Sqrtshould return a non-nil error value when given a negative nu...
分类:
其他好文 时间:
2014-10-28 21:22:45
阅读次数:
155
class Parent(object): def __init__(self, **kwargs): if kwargs.has_key('age'): self.__age = kwargs['age'] if kwargs.has_key...
分类:
其他好文 时间:
2014-10-28 11:58:51
阅读次数:
146
Let's explore Go's built-in support for complex numbers via thecomplex64andcomplex128types. For cube roots, Newton's method amounts to repeating:Find ...
分类:
其他好文 时间:
2014-10-28 08:10:08
阅读次数:
184
Let's have some fun with functions.Implement afibonaccifunction that returns a function (a closure) that returns successive fibonacci numbers.package ...
分类:
其他好文 时间:
2014-10-28 00:37:06
阅读次数:
129