- 浏览: 80087 次
最新评论
-
wodentt:
....为什么楼主都英文的博客
用java解决百度之星移动火柴的问题 part 1 -
wensonzhou86:
思路明确,代码清晰,通俗易懂
visit 淘宝面试题:如何充分利用多核CPU,计算很大的List中所有整数的和 -
carydeepbreathing:
代码比较干净
visit 淘宝面试题:如何充分利用多核CPU,计算很大的List中所有整数的和 -
meiowei:
yangguo 写道i don't think it is a ...
用java解决百度之星移动火柴的问题 part 2 -
yangguo:
i don't think it is a good way ...
用java解决百度之星移动火柴的问题 part 2
文章列表
The test cases are divided into 3 classes.
The first one is just a pinpoint test class that contains some corner cases:
java 代码
package glassball;
import junit.framework.TestCase;
import java.util.List;
/**
* Testcases for path.
*/
public cl ...
- 2007-05-13 03:42
- 浏览 1537
- 评论(0)
The next step is to find the actually path of floors that we are going through to find the breaking floor. Here is the code to do that.
java 代码
package glassball;
import java.util.List;
import java.util.ArrayList;
/**
* For a given building and balls, fi ...
- 2007-05-13 03:33
- 浏览 1095
- 评论(0)
Here is the code following the logic from the previous post:
java 代码
package glassball;
import java.util.List;
import java.util.ArrayList;
/**
* Google interview question
*/
public class GlassBallPuzzle
{
// first index is on ...
- 2007-05-13 03:02
- 浏览 1110
- 评论(0)
Here is the question:
原题: 有一个100层高的大厦,你手中有两个相同的玻璃围棋子。从这个大厦的某一层扔下围棋子就会碎,用你手中的这两个玻璃围棋子,找出一个最优的策略,来得知那个临界层面。
I copied and pasted the above since I can't ...
- 2007-05-12 04:43
- 浏览 1209
- 评论(0)
OCP: Open for extension, close for modification(black box)
SRP: Single responsibility Principle(do one thing, and do one thing well).
DIP: Dependency Inversion Principle(depend on abstraction, not on implementation)
ISP: Interface Segregation Principle (narrow interfaces)
Law of Demeter: Don’t ta ...
Code references:
http://finance-old.bi.no/~bernt/ (C++)
http://quantlib.org/ (C++)
http://www.mathfinance.org/FF/cpplib.html (Java & JavaScript)
http://www.numa.com/
Executables:
http://www.snowgold.com/download/downopt.html
http://www.mathtools.net/MATLAB/Finance_and_Economics/index.html
Tuto ...
- 2007-04-11 02:19
- 浏览 1687
- 评论(1)
Unknown:
The concepts and practice of mathematical finance
Derivatives: Models on Models
Brownian Motion and Stochastic Calculus
Implementing Derivative Model
Modeling:
Modeling Derivatives in C++
C++ design patterns and derivatives pricing
The complete guide to option pricing formulas
Monte carlo ...
- 2007-04-10 23:41
- 浏览 1412
- 评论(0)
Analysis Patterns
Domain Driven Design Tackling Complexity
Refactoring
- 2007-03-24 10:24
- 浏览 1058
- 评论(0)
Thinking in Java
Effective Java
Java Puzzlers Traps Pitfalls and Corner Cases
Java Pitfalls
More Java Pitfalls
Hardcore Java
Java IO
Java NIO
Java Network Programming
Concurrent Programming in Java
Interdisciplinary Computing in Java Programming Language
- 2007-03-17 10:46
- 浏览 1207
- 评论(0)
Effective Enterprise Java
Enterprise Integration Patterns
Expert One-on-One J2EE Design and Development
Professional Java Development with the Spring Framework
J2EE Best Practices
- 2007-03-17 10:27
- 浏览 1266
- 评论(0)
The discussion started with Martin's post:
http://www.martinfowler.com/bliki/AnemicDomainModel.html.
The common reasons I've seen why we have anemic model are:
Most cases are simple db-to-web, with little domain logic.
Books are misleading, people are ignorant. It's hard to find a proper e ...
- 2007-03-04 12:44
- 浏览 1065
- 评论(0)
Constantly, we need to define enums. In Java 1.5, there is also a keyword. However, in JDK 1.4, we are out of the luck and have to come up something to simulate enums.
The motivation for enums is to avoid hardcoding same constants everywhere because it makes maintanence a nightmare, hard to track wh ...
- 2007-03-04 05:59
- 浏览 1792
- 评论(0)
The Utils class is composed of some common methods:
java 代码
package solve;
import scale.Ball;
import scale.Scale;
import java.util.Iterator;
import java.util.Set;
/**
* utility class, shared common methods.
*/
public class ...
- 2007-02-27 05:54
- 浏览 1117
- 评论(0)
In the 1-ball case, if the status flag is already set, then we don't need to weight anymore. Otherwise, we need to find a good ball to compare.
java 代码
package solve;
import scale.Ball;
import scale.Scale;
import java.util.Set;
/**
* 1-ball c ...
- 2007-02-27 05:50
- 浏览 1506
- 评论(0)