i*****e 发帖数: 68 | 1 Agree with this one. Let the state space be {1,-1,2,-2}. Then the transition
matrix is
0.5 0.5 0.0 0.0
0.0 0.0 0.5 0.5
0.5 0.5 0.0 0.0
0.0 0.0 0.5 0.5
Let's revise the question a little bit:-)
if your previous throw was a head then you get +1 for H, 0 for T on the next
throw.
If your previous throw was a tail then you get 0 for H and -1 for T on the
next throw.
Is the score a Markov Chain? |
|
J*X 发帖数: 302 | 2 Let's say we want two H's.
After the first two throws, we have four different results:
1. HH, we end the game with 2
2. HT, we have start over again
3. TT, we have start over again
4. TH, we have 1/2 chance to finish the game with one more throw. We also
have another 1/2 chance to have another throw and then start over again.
suppose E is the number of expected throws, then the above argument can be
summarized as,
E = 1/4*2 + 1/2*(2+E) + 1/4*(2+1+1/2*E)
solve it. |
|
i****x 发帖数: 17565 | 3 miata档位其实throw的角度很大,主要靠档棍短来减小动作,阻力也较大,手感是咣当
一声猛拉进去的感觉。说实话,手感不算好,进档没有那种叫做cut butter的又有阻力
又能很舒服地推进去的快感。
bmw和mini都是很顺滑,档位掉进去几乎没阻力的感觉,不过throw都比较长,尤其是
bmw。s2000是throw角度超小,进档既顺滑,进去瞬间卡住那一下又清晰。但我的车进
六档阻力明显比其他五档大,不知设计如此还是车老了。除此之外可谓完美。
我还坐在车里试过一些(原地空换挡)。gti类似mini但进档更清晰一点。brz很像
s2000,throw角度似乎还更小一点,感觉非常好。fiat 500也很像s2000,是个惊喜,
不知谁开过。 |
|
|
|
S*********n 发帖数: 4050 | 6 http://www.guardian.co.uk/world/2008/mar/15/tibet.china2
This is an eyewitness account of a foreign resident in Lhasa who took refuge
in a hotel close to the centre of the Tibetan capital yesterday. The city
was gripped by violence after protesters and police clashed
"Oh my God. Oh no. That's crazy. One hundred people are trying to stone one
man. A man was trying to cross the street with his motorcycle - they were
trying to stone him but it's so crowded I can't see whether they got him or
not.
"... 阅读全帖 |
|
|
z*******3 发帖数: 704 | 8 If the game rule does not prohibit throw-matches, the players have the right
to do so in order to maximize their competition interest.
If it does prohibit, then it has to define what is a "throw-match" in an
explicit way. Then the matter is if the behavior of the players can be
considered "match-throwing".
A rule or law should be UNAMBIGUOUS and enforceable, otherwise it cannot be
called rule or law.
nothing |
|
D*********n 发帖数: 279 | 9 http://en.wikipedia.org/wiki/Native_Americans_in_the_United_Sta
Native Americans in the United States
From Wikipedia, the free encyclopedia
Jump to: navigation, search
"American Indian" redirects here. For other indigenous peoples, see
Indigenous peoples of the Americas and other geographic regions. For
Americans from South Asia, see Indian American.
This article may be too long to read and navigate comfortably. Please
consider splitting content into sub-articles and/or condensing it. (January
2... 阅读全帖 |
|
|
|
|
|
|
b********n 发帖数: 38600 | 15 http://dailycaller.com/2014/11/29/farrakhan-on-ferguson-well-te
Nation of Islam leader Louis Farrakhan went on a fiery tirade about Ferguson
on Saturday — threatening that if the demands of protesters aren’t met,
“we’ll tear this goddamn country apart!”
Farrakhan stated in his speech — given at Morgan State University, a black
college located in Baltimore, Md. — that violence was justified in response
to the decision not to indict officer Darren Wilson and peaceful protests
are only in the inter... 阅读全帖 |
|
发帖数: 1 | 16 埃及和叙利亚对以色列进行偷袭后,以色列进行了反击,但是很快就出现补给问题,以
色列国防军的弹药和零部件只有24小时的存量了。
在此情况下,尼克松总统下令对以色列进行大规模补给,首先调用美军在欧洲北约的库
存,同时将美国本土的武器装备越洋直接送往以色列。
这个紧急补给称为Operation Nickel Grass(五分钱救援行动),把Operation Nickel
Grass翻译成五分钱救援行动的典故是这样的:"Nickel Grass应该是来自美空军有些自
我调侃的歌曲Throw a nickel on the grass, save a fighter pilot's ass,这歌曲
源自第一次世界大战飞行员唱的。Throw a nickel on the drum。 Nickel 是美金5分
钱,drum是鼓,为何要throw on the drum,就是以前马戏团卖力表演的差不多时观众
掏出钱丢在鼓上赞助。Operation Nickel Grass就是个援助作战,save 以色列飞行员
的asses。"
由于以色列已经突破埃及苏伊士运河防线进入埃及境内,美军C5战略运输机,... 阅读全帖 |
|
S*********k 发帖数: 507 | 17 原文来源:
http://www.newsday.com/opinion/oped/feldman-playing-to-lose-is-
Playing to lose is smart, not an Olympic scandal
Published: August 9, 2012 9:03 PM
By NOAH FELDMAN, Bloomberg News
Olympic athletes want to win -- we all know that. So why are they being
disqualified for trying to lose? After the badminton scandal that marred the
early days of the games, the latest athlete to be kicked out was Algerian
middle-distance runner Taoufik Makhloufi, who walked off the course in an
800 meters semifin... 阅读全帖 |
|
l****z 发帖数: 29846 | 18 By Dan Gainor
November 22, 2011
Thanksgiving means we should give thanks. Seldom since 9/11 has it been this
obvious that we owe so much thanks to the men and women in blue. Occupiers
abuse, harass and threaten them and the media blame … the police.
So from the NYPD to Oakland PD and every police department in between, our
nation should give an extra special “thank you” to all of those who are on
the frontlines dealing with the fiasco that is Occupy Wall Street. Lord
knows, the Occupiers sur... 阅读全帖 |
|
l****z 发帖数: 29846 | 19 Gilder sees a direct link from attitudes toward Israel, attitudes toward
Jewish excellence, and attitudes toward free enterprise itself.
By Ken Blackwell
November 25, 2011
In these days of Occupy Wall Street demonstrations across the U.S., it’s
important to see what motivates Obama administration policies here and
abroad. Mr. Obama, as a candidate, had to bat away accusations that he was
close, too close, to Rashid Khalidi, a radical Palestinian Arab intellectual
. Candidate Obama then sooth... 阅读全帖 |
|
l****z 发帖数: 29846 | 20 https://www.judicialwatch.org/corrupt-politicians-lists/washingtons-ten-most
-wanted-corrupt-politicians-for-2011/
Judicial Watch, the public interest group that investigates and prosecutes
government corruption, today released its 2011 list of Washington’s “Ten
Most Wanted Corrupt Politicians.” The list, in alphabetical order, includes:
Rep. Spencer Bachus (R-AL)
Former Senator John Ensign (R-NV)
Rep. Alcee Hastings (D-FL)
Attorney General Eric Holder
Rep. Jesse Jackson, Jr. (D-IL)
President Ba... 阅读全帖 |
|
l****z 发帖数: 29846 | 21 How did the prosecution decide on 2nd degree murder charges against
Zimmerman?
by Rick aka Mr. Brutally Honest
When the evidence for that charge is so scant?
Two police reports written the night that George Zimmerman shot Trayvon
Martin said that Zimmerman had a bloody face and nose, according to police
reports made public today.
The reports also note that two witness accounts appear to back up
Zimmerman's version of what happened when they describe a man on his back
with another person wear... 阅读全帖 |
|
b*****d 发帖数: 61690 | 22 New York Times says it made mistake by assigning opinion writer to Kavanaugh
story
The New York Times said Tuesday that it should not have assigned a Times
Magazine writer who had openly criticized Brett Kavanaugh to report a news
story about the Supreme Court nominee.
Emily Bazelon, a New Haven-based staff writer for the magazine, had one of
two bylines on a Times story Monday on a bar fight that Kavanaugh was
involved in while at Yale University. According to a police report, the
Times story s... 阅读全帖 |
|
d********r 发帖数: 211 | 23 2011的highlander还在自动加速啊...
http://www-odi.nhtsa.dot.gov/complaints/results.cfm?type=1&comp
Print
Complaints - Search Results
12 Record(s) Displayed.
Report Date : September 14, 2011 at 03:33 PM
Search Type : VEHICLE
Year : 2011
Make : TOYOTA
Model : HIGHLANDER
Make : TOYOTA Model : HIGHLANDER Year : 2011
Manufacturer : TOYOTA MOTOR CORPORATION
Crash : No Fire : No Number of Injuries: 0
ODI ID Number : 10424698 Number of Deaths: 0
Date of Failure: August 1, 2011
V... 阅读全帖 |
|
I***i 发帖数: 14557 | 24 刚在网上查了,就是throw out bearing,也叫release bearing。长时间才离合不放(
即便是踩到底),这个部件就始终处于磨损状态。长久以往。。。
离合器并不只是那个disc,还有别的部件。半离合状态伤disc,但不要忘了,只要离合
踩下去(不论踩到底与否),throw out bearing就受损。
当然有人会说throw out bearing就是消耗部件。但明明可以把离合抬起来,为什么还
要长时间踩着离合呢? |
|
y********4 发帖数: 1116 | 25 我感觉德车不是可靠性不高,而是维修贵。同样的问题,日车可能十五分钟搞定,德车
要把整个前面拆掉,搞几个小时。而且parts价格也比较贵。这样一来,日车100刀能搞
好的问题,德车要8-900刀。
另外日车的传感器比较不灵敏,不出大问题不会throw code,德车不一样,有一点点不
对劲,比如发动机内部有一些积碳了,就throw code。所以你看很多日车车况其实很差
了,但是没有code,一样可以当作没有问题卖出去。德车就不行了,你不花个两三千块
钱修的好好的,就会一直throw code,搞得人很烦,其实开启了没感觉有什么大问题。
最后,resale value的差距就出来了。 |
|
f****l 发帖数: 5514 | 26 恩,德车在传感器上的确造诣颇深,都可以感测到是不是在做emission test~~~
[在 yangfh2004 (小耗子) 的大作中提到:]
:我感觉德车不是可靠性不高,而是维修贵。同样的问题,日车可能十五分钟搞定,德
车要把整个前面拆掉,搞几个小时。而且parts价格也比较贵。这样一来,日车100刀能
搞好的问题,德车要8-900刀。
:另外日车的传感器比较不灵敏,不出大问题不会throw code,德车不一样,有一点点
不对劲,比如发动机内部有一些积碳了,就throw code。所以你看很多日车车况其实很
差了,但是没有code,一样可以当作没有问题卖出去。德车就不行了,你不花个两三千
块钱修的好好的,就会一直throw code,搞得人很烦,其实开启了没感觉有什么大问题
。最后,resale value的差距就出来了。
:........... |
|
l********k 发帖数: 357 | 27 I told you I have seen such fighting couples several times. they throw
computers, throw dishes, throw knives,... |
|
发帖数: 1 | 28 华裔赌徒邸千(45岁东北人)借钱不还 在美国华人社区流窜诈骗
邸千,一位来自中国大连市的45岁男子,在美国居住了二十多年,因为沉湎赌博而倾家
荡产,妻离子散,于是不停地搬家,到处向人借钱不还,租房欠缴租金,还经常报警诬
陷债主和房东。邸千骗钱的手段之一,就是吹嘘自己的“辉煌历史”,并将一份履历表
作为“道具”。
以下《中国游泳教练工作简历及主要成绩》由邸千同志自己编写,内容的真实性存疑,
未经大连市体育局等单位审核。
中国游泳教练工作简历及主要成绩
姓名:邸千 性别:男 出生年月:1971年2月21日
家庭住址:大连市中山区中南路亿成花园8号楼2单元501室
邮政编码:116001 电话:15322033666
简历:
1979年----1983年哈尔滨市兆麟小学校
1983年----1986年大连市辽宁师范大学附属中学 中学
1986年----1989年大连市辽宁师范大学附属中学 高中
1989年----1993年大连大学师范学院体育系体育教育专业
1993年----2007年大连市体育局体育运动学校游泳教练
2008年----日本神户大学青少年游泳教练员培训班学习
2009年---... 阅读全帖 |
|
s*****o 发帖数: 1540 | 29 我对音响一窍不通,希望大侠推荐300元之下的功放:
http://www.martinlogan.com/pdf/manuals/manual_mlt2.pdf
MLT-2 SPEAKER (front and rear)
System Frequency Response
110–20,000 Hz ± 2db
Sensitivity
88 [email protected] volts/meter
Impedance
8 Ohms compatible
Crossover Frequency
2000Hz
Tweeter Type
1” (2.54 cm) soft dome
Woofer Type
4.5” (11.5 cm) high rigidity poly cone
with extended throw drive assembly
Enclosure Type
Non-resonance asymmetrical
chamber format, sealed
Suitable Amplifier Range
15–100 watts
Power Handling
50 watts
Wei... 阅读全帖 |
|
R***r 发帖数: 120 | 30 try
{
...
throw new Exception(1);
}
catch (Exception ex)
{
...
throw new Exception(2);
}
finally
{
...
throw new Exception(3);
}
最后返回的是finally里的Exception(3),请问catch里的Exception(2)到哪里去了?直
接garbage collection了? |
|
j*****u 发帖数: 1133 | 31 写的比较乱,应该还有更clean的
static bool IsMatch(string str, string pattern)
{
if (str == null)
throw new ArgumentNullException("str");
if (string.IsNullOrEmpty(pattern))
throw new ArgumentException("pattern null or emptry.");
return MatchRec(str, pattern, 0, 0);
}
static bool MatchRec(string str, string pattern, int sIndex, int pIndex)
{
if (pIndex == pattern.Length)
{
return sIndex == str.Length;
}
char p = pattern[pIndex];
bool isStar = pIndex < pa... 阅读全帖 |
|
h****b 发帖数: 157 | 32 class Foo {
public:
void virtual abc() throw(int, double, long);
};
Referring to the sample code above, if a derived class, Bar, overrides
the method abc, which one of the following is an acceptable declaration?
void abc() throw(double, int, long);
void abc();
void abc() throw(string);
选哪个?谢了 |
|
b**********2 发帖数: 1923 | 33 2. Your task is to implement the Reduce function using
templates. The Reduce fn applies a function of two arguments
cumulatively to the items of an STL container, from begin() to end(),
so as to reduce the sequence to a single value. For example,
Reduce(, std::plus()) should
calculate ((((1+2)+3)+4)+5).
class NotEnoughElements : public exception {
public:
virtual const char* what() const throw() {
return “Not enough elements in the
container... 阅读全帖 |
|
c********2 发帖数: 56 | 34 面的是Associate C++ Developer,下面是面试题,光顾着记题了,最后只有56%的通过
率,要到
80%才能ONSITE,算是帮大家做点贡献吧,他家在招人,赶快去投简历
1) #include
using namespace std;
struct A{
A(int value) : m_value(value){}
int m_value;
};
struct B:A {
B(int value):A(value){}
};
int main(){
try {
try{
throw B(5);
}
catch(A a){
a.m_value *=2;
throw;
}
catch(B b){
b.m_value -=2;
throw b;
}
}
catch(A a){
... 阅读全帖 |
|
t*******i 发帖数: 4960 | 35 打的一个草稿,不处理负数
int NextP(int num){
if (num < 0)
throw -1;
char str[11];
itoa(num, str, 10);
if (strlen(str) == 1)
throw -1;
pos = len-1;
while (pos >= 1){
if (str[pos] > str[pos - 1])
break;
pos --;
}
if (pos == 0)
throw -1;
--pos;
int min = findLargerMin(str, pos + 1, len – 1, str[pos]);
swap(str, pos, min);
sort(str, pos + 1, len - 1);
return atoi(str);
} |
|
b******e 发帖数: 3348 | 36 ☆─────────────────────────────────────☆
littlebolt (i love bolt) 于 (Thu Jun 16 14:13:42 2011, 美东) 提到:
签了nda,phone和onsite写一起了
1.把一个字符串转成float,字符串可能是负的一百点三还有个指数E-09这样的
2.反转单链表..
3.给一个整数,求next permutation 就是数字组成一样的 但是比这个数大的最小的一
个数
4.一个很大的文件 怎么去掉duplicate
5. circular sorted array找元素
6.分层打印tree
7.一个字符串,每个字符可以替换成好多其他字符,打印所有可能
8.很简单的一个题,就是会用vector, set, map, pair这些玩意就行了
9.应该还有一个题,不难,但是怎么都想不起来了...
效率很高,拒信很快,move on啦~~
☆─────────────────────────────────────☆
gate (离开之后,再见以前) 于 (Thu Jun 16 14:17:... 阅读全帖 |
|
g**********y 发帖数: 14569 | 37 第一题可以用染色来做,朋友染同色,敌人染异色。把图分成k个相邻子图,用2k种颜
色染完所有点。以后判断朋友敌人就很简单。
public class FriendEnemy {
private int[] color;
public void buildRelationGraph(int N, int[] a, int[] b, int[] relation)
throws Exception {
color = new int[N];
int[][] g = new int[N][N];
for (int i=0; i
if (relation[i] == 0) { // enemy
g[a[i]][b[i]] = -1;
g[b[i]][a[i]] = -1;
}
else { ... 阅读全帖 |
|
a***r 发帖数: 93 | 38 memory O(n)
time O(nlogn)
//~ Given a array,find out if there exist a subarray such its sum is zero
#include
#include
using namespace std;
static void swap(int *p, int i, int j) {
int t=p[i]; p[i]=p[j];p[j]=t;
}
static int partition(int *p,int left,int right) {
int j=left;
for(int i=left;i
if(p[i]
}
swap(p,j,right);
return j;
}
static void binary_sort(int *p, int left, int right) {
if(left>=r... 阅读全帖 |
|
q*****t 发帖数: 3 | 39 import java.util.ArrayList;
import java.util.List;
public class NextLargerNumberWithSameDigits {
public static void main(String[] args) throws Exception {
int a = 1245963;
System.out.println(findnext(a));
a = 698754;
System.out.println(findnext(a));
}
public static int findnext(int a) throws Exception {
List d = new ArrayList();
while (a != 0) {
d.add(a % 10);
a /= 10;
}
Integer[... 阅读全帖 |
|
q*****t 发帖数: 3 | 40 import java.util.ArrayList;
import java.util.List;
public class NextLargerNumberWithSameDigits {
public static void main(String[] args) throws Exception {
int a = 1245963;
System.out.println(findnext(a));
a = 698754;
System.out.println(findnext(a));
}
public static int findnext(int a) throws Exception {
List d = new ArrayList();
while (a != 0) {
d.add(a % 10);
a /= 10;
}
Integer[... 阅读全帖 |
|
w****x 发帖数: 2483 | 41
不知道有没有其他bug
int myatoi(const char* p)
{
assert(p);
int nFlg = 1;
if ('-' == *p)
nFlg = -1;
if ('-' == *p || '+' == *p)
p++;
if ('\0' == *p)
throw CException("Invalid expression");
int nRet = 0;
while('\0' != *p)
{
if (*p < '0' || *p > '9')
throw CException("Invalid character");
int nVal = *p - '0';
int nNew = nRet*10 + nFlg * nVal;
if (nRet != 0 && ((nNew & 0x80000000) != (nRet & 0x80000000)))
... 阅读全帖 |
|
t****s 发帖数: 1 | 42 a Java version for regex match as below, let me know if there is any issue.
boolean isMatch(String s, String p) throws Exception{
if (p==null || p.length()==0)
return s==null || s.length()==0;
return isMatch(s,p,0,0);
}
boolean isMatch(String s, String p, int is, int ip) throws Exception{
if (ip>=p.length())
return s==null || is>=s.length();
if (ip==p.length()-1 || p.charAt(ip+1)!='*'){
if (p.charAt(ip)=='*')
throw new Exception("illegal");
if (is>=s.lengt... 阅读全帖 |
|
w****x 发帖数: 2483 | 43 OVERFLOW的处理相当麻烦, 特别还要注意INT_MIN, INT_MAX的情况, 贴一个我修改了n
遍的代码:
int myatoi(const char* p)
{
assert(p);
//Judge signal
bool bNeg = false;
const char* pCur = p;
if(*pCur == '-' || *pCur == '+')
{
if (*pCur++ == '-')
bNeg = true;
}
//treat the rest as positive numeric number, so for negative number
//it is 2^31, and for positive number it is 2^31
unsigned int uLimit = bNeg ? 0x7FFFFFFF + 1 : 0x7FFFFFFF;
// The reson to use unsigned int rat... 阅读全帖 |
|
w****x 发帖数: 2483 | 44 我使用unsigned int处理INT_MIN绝对值比INT_MAX大的情况,
对于overflow, 我分两步, 一是判断unsigned int有没有overflow,
一个是判断unsigned int没有overflow的情况下int有没有overflow
class CException
{
public:
CException(const char* str) : m_strErr(str) {}
string GetErrInfo() { return m_strErr; }
private:
std::string m_strErr;
};
int myatoi(const char* p)
{
assert(p);
//Judge signal
bool bNeg = false;
const char* pCur = p;
if(*pCur == '-' || *pCur == '+')
{
if (*pCur++ == '-')
bNeg = true... 阅读全帖 |
|
s***0 发帖数: 117 | 45 #include
#include
#include
#include
#include
using namespace std;
class ProcessParen
{
public:
ProcessParen(){};
void processString(string& inString)
{
stack charStack;
for (int i = 0; i< inString.length(); ++i)
{
if(inString[i] == '{')
{
mResult += "{";
charStack.push('{');
}
if(inString[i] == '}')
{
... 阅读全帖 |
|
e******o 发帖数: 757 | 46 from wiki:
The C++ programming language introduces an optional mechanism for checked
exceptions, called exception specifications. By default any function can
throw any exception, but this can be limited by a throw clause added to the
function signature, that specifies which exceptions the function may throw.
是不是不会java就不用管这些java question 了。 |
|
s*******s 发帖数: 1031 | 47 我的代码,用递归做。不一定对 。。
// n1n2n3n4
n1
/
n2
/ \
n3 n4
string getNextTag();
bool isTagStartingNode(string tag);
bool isTagEndNode(string tag);
bool isTagString(string tag)
struct TreeNode {
string value;
TreeNode *left;
TreeNode *right;
TreeNode(string v) : value(v), left(NULL), right(NULL) {}
};
TreeNode *parse(string startTag) {
// no more nodes left
if(str.size() == 0)
retu... 阅读全帖 |
|
W***o 发帖数: 6519 | 48 这个是我CrimeTypeKey的class,生成composite key object:
public class CrimeTypeKey implements Writable, WritableComparable<
CrimeTypeKey>
{
private Text key = new Text();
private IntWritable year = new IntWritable();
public CrimeTypeKey() { }
public CrimeTypeKey(String k, int y)
{
key.set(k);
year.set(y);
}
public static CrimeTypeKey read(DataInput in) throws IOException
{
CrimeTypeKey keytp = new CrimeTypeKey();
keytp.readFields(... 阅读全帖 |
|
t*****a 发帖数: 106 | 49 加mutex是对的,不好意思,看错了。开始想着用while+wait能按顺序输出HHO,发现不
行。写了个code,贴在这
public class H2O {
private Lock lock;
private Semaphore semH;
private Semaphore semO;
H2O()
{
lock=new ReentrantLock();
semH=new Semaphore(0);
semO=new Semaphore(0);
}
public void H() throws InterruptedException
{
semH.release();
semO.acquire();
System.out.println("H");
}
public void O() throws InterruptedException
{
lock.lock();
semH.acquire();
semH.acquire();
lock.unlock();
semO.release();
semO.release();
System.out.println("O");
}
... 阅读全帖 |
|
发帖数: 1 | 50 最近面试的时候,函数带throw Exception。觉得这是除了算法逻辑之外的另外一个考
察点。
我的做法就是在该 throw的地方 throw exception. |
|