由买买提看人间百态

topics

全部话题 - 话题: tokens
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
y***k
发帖数: 162
1
来自主题: JobHunting版 - 这个题目难度在leetcode里算什么
我assume了L里面是没有duplicate的.如果要考虑有duplicate的话,把set换成hashmap.
public class Solution {
public static void main(String[] args) {
String S = "barfoothefoobarman";
List L = new LinkedList();
L.add("foo");
L.add("bar");
search(S, L);
}

public static List search(String S, List L) {
List result = new LinkedList<>();
int len = L.get(0).length();
HashSet set = new HashSet<>(L);
... 阅读全帖
o*****p
发帖数: 2977
2
初中毕业的文盲挣大钱,含辛茹苦学识渊博的博士硕士成为边缘人!
【转帖把照片丢丢了,鼓励去原帖看,看看文盲暴发户炫富的嘴脸】
http://zhuanlan.zhihu.com/token/19975254
4月1日完结《满满一碗鸡血汤》 - 三十年人生,十三年设计
token胡依林 · 1 个月前
原文连载于问题:为什么现在很多年轻人愿意到北上广深打拼,即使过得异常艰苦,远
离亲人,仍然义无反顾? - 知乎用户的回答 下
由于回答过长。。转入专栏
为什么选择北上广?
如果我留在家乡,可能我现在是个坐办公室看报纸的小职员?网吧的小老板?街头游荡
的烂仔?
作为一个没有家庭背景的初中毕业辍学生,在小城市里并不是靠你努力就行的。随时都
可以预知得到数十年之后落魄的样子。
“大”城市有着独特魅力,这种魅力就是可以让你获得一次公平的机会,一次让人生过
的不一样的机会。不管你喜欢什么,想做什么,在这里都能找到一群和你志同道合的人
。在这里会给一颗不安定的心无限的可能、正是这种未知的充满诱惑和威胁的可能性,
吸引着更多和我一样的人来到这里,将青春挥霍在这里。
过去十多年带给我不仅仅是机遇、成长、喜悦... 阅读全帖
h*******e
发帖数: 1377
3
你写得挺好啊,我之前自己实现 atoi 了~~~ 还有自己写 intToStr了~~~ 看过你的发
现这些都不用啊, 代码由50多行缩到了25行 。正常四则运算的如果不带括号的就直接
一个stack就行, 如果带括号的需要2个stack 一个放 符号,一个放 数字。。带括号的
情况还挺复杂~~ 带括号的我还不会 提笔就写~~ 没怎么练过, 不带括号的倒是简单
一点。
我把我照你的改的也给贴上
class Solution {
public:
int evalRPN(vector &tokens) {
stack numStack;
for(int tokI = 0; tokI < tokens.size(); ++ tokI)
if(tokens[tokI] == "*" || tokens[tokI] == "+" || tokens[tokI] ==
"/" || tokens[tokI] == "-")
{
int val1 = numStac... 阅读全帖
t*******r
发帖数: 22634
4
这其实是个很有意思的问题,让俺这个码了很多年的老蔫码工思考一下哈。
其实我觉得码工的所用的硅谷派实用现代数学思想,其中一大支柱就是 formal
logic。
formal logic 的一个基本点,就是 formal logic 不管东东的任何意义,
只管东东的操作。换言之,formal logic 不管世上任何事物,只管 token 和
operator,以及这伙之间的互殴和群殴,满足某些基本要求(此处省略一百万字)。
比如说,“所有素数的集合”,formal logic 里搞不出这样的 token 以及相应
的 operator。通常码工搞出来的,就是“前N个连续素数集合”,成功避免无限的
问题。
当然,有人可能会,那实数轴上的“区间”咋办?这里面总是有无限个实数了吧。。。
formal logic 说,你丫“区间”不就是俩实数构成的tuple,这样一个 token
么?然后有几个 operator 处理 tuple(区间)这个token,以及与其他
token(单个实数),whatever token 之间的互殴群殴。。。至于有人问这个
区间这个tuple里面有多少个实数,fo... 阅读全帖
t******n
发帖数: 2939
5
☆─────────────────────────────────────☆
l63 (l63) 于 (Fri May 24 02:35:30 2013, 美东) 提到:
唉, 我老今天和女朋友出去给她买礼物, 她是学数学的, 她说她要这天底下所有的东西
. 我说那在你们数学上不就是所有的集合吗? 她说: "可以这么讲." 我老就又说, 那把
这所有的集合都放在一块, 不就组成了一个集合吗? 所以我就给你买一个东西就行了.
她说 "不对, 所有的集合放在一块组成的东西不是集合."
我老就很疑惑, 我说, 怎么能不是集合呢? 我把一些东西拿过来放到一块, 不就是个集
合吗? 她死活都说不对. 我老很不明白, 就问她为什么不对, 她也说不出个所以然.
后来她突然说: "你看, 你那个集合也是集合, 你怎么能把它自己和其他东西拿过来放
到一块, 然后又装到它自己里面呢?" 我老想想是有点道理, 但是还是觉得不对, 为什
么我不能这么做呢?
现在真是困惑, 所有集合搁到一起组成的东西还是集合吗?
愁煞我老, 如果辩不过她, 就不能给她只买一个礼物了呀, 那怎么办?
☆───────... 阅读全帖
w****e
发帖数: 586
6
来自主题: JobHunting版 - 问个Google的面试题
就是经典的token bucket啊,只要存两个数,一个是上次request的timestamp,一个是
当前的token数(浮点数)。
初始化token为50(或者0,取决于面试官要求),上次request的timestamp为开始时间
每次request进来,先用当前时间和上次request时间计算该加多少token,即(
timestamp_now - timestamp_last) * 50, 并且保证token数capped by 50
然后只要token数>=1,就允许这次操作,并token减去1
最后timestamp_last = timestamp_now
一共没几行code,O(1),没有request也不需要弄个timer在那计时加token,反正下个
request进来的时候会先补token
p**o
发帖数: 3409
7
来自主题: Programming版 - 简易计算器优先计算级别怎么算?

Alternatively, you can build your own parse tree from ground up. E.g. (
assuming fully parenthesized),
class BinTree (object):
def __init__ (self, root=None, left=None, right=None):
self.root = root
self.left = left
self.right = right
def insert_left (self, obj=None):
self.left = BinTree(obj, left=self.left)
return self.left
def insert_right (self, obj=None):
self.right = BinTree(obj, right=self.right)
return self.right
def tok... 阅读全帖

发帖数: 1
8
来自主题: Joke版 - 沐猴而冠的智猪
嘿嘿嘿嘿~
Freakonomics
Monkey Business
By STEPHEN J. DUBNER and STEVEN D. LEVITT
Published: June 5, 2005
Keith Chen's Monkey Research
Adam Smith, the founder of classical economics, was certain that humankind's
knack for monetary exchange belonged to humankind alone. ''Nobody ever saw
a dog make a fair and deliberate exchange of one bone for another with
another dog,'' he wrote. ''Nobody ever saw one animal by its gestures and
natural cries signify to another, this is mine, that yours; I am willing ... 阅读全帖
m*p
发帖数: 1331
9
来自主题: Programming版 - 诡异的异常处理
在看一个hadoop 的 codebase,发现有如下实现, 为啥捕捉到异常之后再把逻辑执行
一遍??是hadoop特有的东西么?
private static double[] parseStringToVector(String line, double[]
row) {
try {
StringTokenizer tokenizer = new StringTokenizer(line
, ",");
int size = tokenizer.countTokens();
if (row == null)
row = new double[size];
int i = 0;
while (tokenizer.hasMoreTokens... 阅读全帖
y********n
发帖数: 2063
10
来自主题: TexasHoldem版 - super turbo tourney
token game is strange game, you do not need all the chips to win the token,
and when you know which guy you can steal, then the game becomes so easy. I
formerly allin to steal the chips, actually I find it is unnecessary
recently.
turbo is good for token game, since you do not want to spend a ton of time
on it to triple up your buy in.
There are 10:1 token games also, something like 100buy in 1000$token.
20:1 token game, sth like 500buyin 12000token game.
Sometimes, ftp has 300buyin 5200$token
y********n
发帖数: 2063
11
来自主题: TexasHoldem版 - 看一些有趣的tournament数据
This data is corrupt.
My MTT is not good, I played too much token game.
Lately, I try to stop playing too much token game, especially the 8.8$ buyin
26$ token game, but will play 14$ buyin 55$ token game, since I think my
token skill(MTT token skill) has enhanced a lot. For example, I know which
guy I can steal, regardless of my holding. And how much I need to get the
token, once I reach that amount of chips, I may play very differently.
Because of my schedule, I can not play a ton of MTT, only
t*******r
发帖数: 22634
12
虽然俺灌水比较无厘头,不过俺认真一下回答你这个问题。
如果一个 formal system 是这么建立的:
任何一个符号或者(1)”是一个明确的有限集”,或者(2)“是由明确的有限集
递归生成的”。那么这个 formal system 里面不需要 “从无限集 减去 无限集
得到 有限集” 这样的算子。
所以这样的一个 formal system 不需要你这个“从无穷集筛选”的操作。
对于这个实际例子 “小于 a 的自然数”,在这样的 formal system 里面,并
没有发生把 “大于 a 的所有自然扔掉” 这样一个操作。取而代之的,是下面这样
的操作:
(a)“自然数递归生成至 a 结束”,产生一个 “前N个连续自然数” 的 token。
(这个 token 实际上是个有限集)。
(b)从(a)产生的 token 里面去掉最大的数,产生另一个 token。
(c)test 自然数 x 是不是在(b)产生的 token 里。(operator:in_set())。
更确切的说,"(a)" 其实发生得比上面看起来的更早。"(a)" 需要发生
在你 refer 任何自然数之前。... 阅读全帖
a***e
发帖数: 27968
13
来自主题: Programming版 - 一道多线程的面试题 (转载)
这个应该是类似token ring的协议锁
每个thread建立的时候有个ID,token=ID的时候
检查剩下word的数,word数等于0,token+1,然后自己退出
否则打印,word数-1,然后token+1
token<>ID的时候就等待
这样所有的threads并发
主程序开始清token,建立字串,创建threads
然后token=1启动打印

m
printing
w*******y
发帖数: 60932
14
来自主题: _DealGroup版 - 【$】Chuck E Cheese Coupons EXP 06/15/2011
1) $15.00 - Buy 60 tokens, get 30 free = Total 90 tokens (.17/token)
2) $20.00 - Large 1 Topping Pizza & 50 Game Tokens
3) $6.00 - 2 Regular Soft Drinks & 20 Tokens
4) $9.00 - 3 Regular Soft Drinks & 30 Tokens
Also attached PDF buy 40 get 30 free for $10 ($0.143 per token) Thanks ckv.
YMMV without the expiration date.
y********n
发帖数: 2063
15
来自主题: _TexasHoldem版 - super turbo tourney
token game is strange game, you do not need all the chips to win the token,
and when you know which guy you can steal, then the game becomes so easy. I
formerly allin to steal the chips, actually I find it is unnecessary
recently.
turbo is good for token game, since you do not want to spend a ton of time
on it to triple up your buy in.
There are 10:1 token games also, something like 100buy in 1000$token.
20:1 token game, sth like 500buyin 12000token game.
Sometimes, ftp has 300buyin 5200$token
y********n
发帖数: 2063
16
来自主题: _TexasHoldem版 - 看一些有趣的tournament数据
This data is corrupt.
My MTT is not good, I played too much token game.
Lately, I try to stop playing too much token game, especially the 8.8$ buyin
26$ token game, but will play 14$ buyin 55$ token game, since I think my
token skill(MTT token skill) has enhanced a lot. For example, I know which
guy I can steal, regardless of my holding. And how much I need to get the
token, once I reach that amount of chips, I may play very differently.
Because of my schedule, I can not play a ton of MTT, only
c*****g
发帖数: 21627
17
1. 吃方便面不是因为口味不适应,而是在于maltives的价格实在prohibitively
expensive。习总这种太子党不食人间烟火,自然不知道
2. token collecting本身既没有违反道德,更没有违反法律。
token collecting至少也给maltives当地经济带来收入
3. 退一万步,如果真是那种特别mean的,看谁都不爽都想judge的人。
那么反对token collecting的更好的方式就是索性这些人都不让出国,或者限制
中国公民去maltives的签证(目前的免签是maltives价格虚高的帮手)
而不是鼓励他们吃当地的overpriced海鲜
换句话,明明刀口锋利,就不应该自己把自己当鱼肉送到刀口下
这就好比三亚,三亚的海鲜宰人,所以国内游客现在都少去甚至不去三亚。
这就是一个很好的反馈调节机制。
1. 吃方便面不是因为口味不适应,而是在于maltives的价格实在prohibitively
expensive。习总这种太子党不食人间烟火,自然不知道
2. token collecting本身既没有违反道德,更没有违反法律。
token ... 阅读全帖
b*********n
发帖数: 1258
18
class Node {
public:
int data;
vector child;
}
Node* deserialize(FILE* fin) {
Node* node = 0;
char* token = 0;
if(*(token = readToken(fin))=='['){
node = new Node();
while(*(token = readToken(fin))!=']') {
if(*token=='[') {
fin->seek(-1);
Node* tmp = deserialize(fin);
node->child.push(tmp);
} else if(isLetter(*token)) {
node->child.push(token);
}
... 阅读全帖
c*******7
发帖数: 438
19
来自主题: JobHunting版 - 一个问题, 好难好难?
这类问题就是N个set求找到两个set使其中的共同token数最多。共同点就是某个token
是否在某个set中的lookup时间为O(1)。假设每个set的size为k
两两比较的方法:对于每个set的每个token,在剩余set中查找是否存在。时间复杂度
为O(k*n^2)
逆向index的方法:对于每个token,建立一个index set,放入到一个map里,这一步需
要遍历所有token,O(n*k)。再建立一个n*n的matrix, 遍历一遍前面建立好的index
map,update matrix里面对应的common token count。worst case 也是O(k*n^2),但是
average 应该会比前面的方法好一些。
r******n
发帖数: 170
20
来自主题: JobHunting版 - FB 面经
楼主是按照inorder和preorder reconstruct的方式写的吗? 我现在觉得这种方式比较
容易写的clean,assume 已经把tree load到数组里,不必要写文件IO的操作。
我之前按照leetcode网站的方式写的,serialize 按照inOrder写,遇到null就写#。
这样deserialize 可以写成:
public TreeNode btDeSerialization(String fileName) throws
FileNotFoundException {
Scanner s = new Scanner(new File(fileName)); //default delimiter is
white space
String token = s.next();
if(token.equals("#")) {
return null;
} else {
TreeNode root = new TreeNode(Integer.p... 阅读全帖
D*********G
发帖数: 193
21
前一阵面试,被问到Evaluate Reverse Polish Notation.
做完之后,要求设计一个object来完成不同的符号运算,条件是避免if 或者 switch
去check符号,从而提高速度。
当时觉得肯定是要hmap加函数指针。面试官不是很满意,要求设计一个类实现。
不会,主要问题是hmap里面只能放 父函数,调用的时候都是父函数的function。
我的函数指针的方法如下,请大家指点一下如何能用类实现啊
typedef int(*pf)(int, int);
int my_add(int a, int b){ return a + b; }
int my_sub(int a, int b){ return a - b; }
int my_mul(int a, int b){ return a*b; }
int my_div(int a, int b){ return a / b; }
class Solution {
public:
Solution(){
hmap["+"] = my_add, hmap["-"] = my_sub, hm... 阅读全帖
s***p
发帖数: 31
22
来自主题: Immigration版 - 朝三暮四
从前有一个人养了一群猴子,对它们说:你们只要认真被我耍,我最后会给你们一顶绿帽
子,代表你们自由了.猴子们很开心,每天认真被耍,晚上一起研究谁戴了绿帽子.
过了一段时间,猴子们发现没有几只猴子戴绿帽子,戴了的都是老的走不动的,于是开始
怠工,还告诉其他想来被耍的猴子不要来了.这个人很着急,就说,我的绿帽子有quota的,
每天只有7个token,攒够365个token才能换一个quota.
猴子里面比较聪明的就问,怎么才能拿到一个token.那人说,根据你们加入这个团队的早
晚,我会给你们发token.猴子又问,那每天怎么发呢?
那人说:可能是早上三个,晚上四个,也可能是早上四个,晚上三个.
猴子们就高高兴兴的继续被耍,晚上讨论明天早上是否会发四个token.
终于有一只猴子攒够了365个token,去找那人换绿帽子.那人说,你要等等,我正在对你进
行背景调查,因为我觉得你长得很象500年前的criminal, Evil Dr. Wukong Sun
"说实话,我觉得你们每个猴都有99.99%的嫌疑"那人最后说.
y********n
发帖数: 2063
23
来自主题: TexasHoldem版 - wsop线下比赛的资格要怎么获得啊?
I guess that 1k event is also very tough. Lots of semi-pro, pros, and sharks
there, and big field(I guess 5k+ ppl). Watch that 1k event final table on
TV before, everyone on the final table is good player.
Actually, you can win those 1k token online also, cake, ftp has such token
games.
For example: 26$--->216$token--->2k token. FTP
or shootout games for the token.
FTP has 30$--->2500$ token package games also. 80 seats garantee. KKRUN and
I joined it, but no result.
I think not so many ppl
t*******r
发帖数: 22634
24
码工的 C 程序所属 formal system 里,整数的 token,和浮点数
的 token,不是同一种 token,不能直接上加减乘除 operator,需要先用
另一种 operator,叫 type cast,把一种 token cast 成另一种 token
。。。所以你的问题根本不 valid。。。哈哈。。。
写程序的时候很多时候没写 cast,是因为 implicit cast 的存在。不等于
没有 type cast。
而且整数被零除产生 divide by zero 异常;浮点数被零除没有异常,结果
是 NaN。所以 3/0 和 3.0/0.0 不是一回事。。。也是一个侧面印证不是
一种 token,楼主搞晕了没?


"
xt
发帖数: 17532
25
来自主题: Java版 - Re: Need Emergent help for Java I/O!

Let me give it a try, I never used this before though.
try {
FileInputStream in = new FileInputStream(....);
StreamTokenizer tokenizer = new StreamTokenizer(
new BufferedReader( //this is for performance only.
new InputStreamReader(in), 4096) );
tokenizer.eolIsSignificant(true); //default setting
String token;
int currInt;
while (tokenizer.nextToken()!=StreamTokenizer.TT_EOF) {
token = tokenizer.toString();
try {
currInt = Integer.pars
a*f
发帖数: 1790
26
来自主题: Programming版 - 请教JAX-RS大牛?
REST API用Spring Security按角色限制访问
现在客户端准备上ios native app,
问题是ios app不支持web session based authentication
如果另外走一个OAuth的验证服务,握手协议后拿到临时的token,怎么能告诉web服务
器这个token是有效的,或者怎么让web服务器去验证这个临时token,然后grant
access to the REST APIs?
还有就是token过期后怎么做challenge,重新生成新的token;用户的密码一开始一定
要保存吗?这个是要求:“Successful authentication requires that the Claimant
prove through a secure authentication protocol that he or she controls the
token. Online guessing, replay, session hijacking, and eavesdropping attacks
are resisted. Prot... 阅读全帖
a*f
发帖数: 1790
27
来自主题: Programming版 - 请教JAX-RS大牛?
看到这样一段讨论:"An attacker may generate a bogus token or modify the
token contents (such as the authentication or attribute statements) of an
existing token, causing the resource server to grant inappropriate access to
the client. "
怎样预防这种情形呢?token里面加上时间和IP地址一起散列成本好像有点太高。或者
只加一个IP和一个sequence number? 几分钟后token失效,重新challenge生成新的
token把sequence number增加?还是用时间比较好?还有个问题就是好像这种验证方式
在server端需要特殊处理,传统的Spring Security好像不能支持。
w*******y
发帖数: 60932
28
来自主题: _DealGroup版 - 【$】Chuck E Cheese Coupons EXP 03/30/2011
Chuck E Cheese coupons EXP 03/030/2011
1) $19.99 - Large 1 Topping Pizza, 3 drinks, 45 tokens
2) $29.99 - Large 1 Topping Pizza, 4 drinks, 90 tokens
3) $15.00 - Buy 60 tokens, get 35 free = Total 95 tokens
4) $25.00 - Buy 100 tokens, get 65 free = Total 165 tokens
w*******y
发帖数: 60932
29
来自主题: _DealGroup版 - 【$】Chuck E Cheese Coupons EXP 5/2/2012
1) $22.00 - 2 Largie 1 Topping Pizzas
2) $19.99 - Large 1 Topping Pizza, 2 Soft Drinks and 40 Tokens
3) $39.99 - Large 1 Topping Pizza, 1 Buffalo Wings order, 4 Soft Drinks and
120 Tokens
4) $4.99 - All you can eat Salad Bar
5) $29.99 - Large Cheese Pizza, 4 Soft Drinks and 100 Tokens
6) $25.00 - Buy 100 tokens get 30 Free (total of 130 tokens)
Also attached PDF buy 40 get 30 free for $10 ($0.143 per token) Thanks ckv.
YMMV without the expiration date.
c****s
发帖数: 5892
30
来自主题: Headline版 - 多伦多的TTC让人很无奈(图)
多伦多公车局近来问题不少。最引人批评的是宣布涨价25分之后,并未对可能购买TOKEN之风有所准备,结果临时宣布每次只能出售5个,再过几天又决定全面停售TOKEN,一时之间闹得满城风雨,售票处前排成长队。
解释这次票价大涨,公车局官员指出,因为他们在包括今年在内的3年中都没有涨价,因此提高票价已经势在必行。事实上,公车局今年本来已经决定涨价,因为当时苗大伟还在考虑竞选连任,因此压制了此一涨价设想。到了现在,风云突变,老苗打消了再当4年市长的念头,因此放手让公车局行动,于是有了大幅度的增幅。 问题是,增幅既然这么大,老百姓靠购买TOKEN来保值,应是意料当中的事情,不知当局为什么没有任何准备。那是他们被自己的简单粗暴的推断迷惑住了。
因为在涨价之前,他们放风说,他们做过多次调查,结果是多伦多大部分乘客最关心的是公交服务,而不是票价。只要公车准时舒适,就是涨价他们也能接受。按照他们的说法,就是乘客愿意接受涨价。所以他们可以决定涨25分,而不对如何应付TOKEN购买危机做什么准备。仅此一举,公车局已经造成他们明年的收入损失100万元。如果没有停售TOKEN,他们的损失可以高达500万元。 其实
l*******n
发帖数: 828
a***e
发帖数: 413
32
‘正常的四则式子的运算’是不是用arithmetic expression tree更好做?或者先把它
转换为RPN,再做。Data structure and algorithm 那本书上有解释怎么转换。。。。
。。。。
关于Evaluate Reverse Polish Notation,知道RPN的特点或者说evaluate RPN的算法后
,更像一道细节实现题。
我在OJ上错了就是因为记不清怎么把string变成char,还有没注意isdigit只判断1个符
号,遇到(-4)就没把它当负数了。
int evalRPN(vector &tokens) {

int n = tokens.size();

stack numbers;

for (int i=0; i {
int len = tokens[i].length();
char * tmp = new char [le... 阅读全帖
b*****n
发帖数: 618
33
前段时间骑驴找马终于告一段落,感觉本版的技术贴和面经贴帮助非常之大,也非常感
谢共享资源的各路大牛。希望提供一些信息和个人感受给还在找工的童鞋,有帮助最好
,但是毕竟本人资历尚浅,如果有不对的地方也请轻喷。
背景:
ms毕业不到两年
主要申请公司:
offer:facebook,google,uber,palantir,sumo logic,walmartlab,yahoo,
amazon,apple
reject:dropbox
主要几个包裹:
U: 145k base + 25k股 RSU
F: 150k base + 40k signon + 10%bonus + 260k美元 RSU
W: 165k base + 50k signon + 20%bonus + 35k美元 RSU每年(
这个略复杂,相当于每年35k美元RSU的refresh,但是每次refresh分四年给)
再上各个公司的面经和感受:
Yahoo:
最早面的公司,面的是Flurry Team,Yah... 阅读全帖
m******3
发帖数: 346
34
dropbox的,感觉这家也很难
1. 给一堆file,如何比较有效率的把内容完全相同的file group到一起,file可能非
常大
Onsite:
1. log_hit(), get_last_5mins_hits()那个题目,concurrent怎么搞
[这个应该是用circular window吧,concurrent怎么做呢?]
2. token bucket,假设每x秒提供一个token,然后外面可以申请任意数量的token,如
果token不够就block,要求concurrent情况下,不能有专门的thread产生token,怎样
用最简单的方法实现
3. web crawler,要分析可能的bottleneck,然后转化成concurrent运行的版本,写
runnable代码。
f*******r
发帖数: 976
35
恭喜,都是好包袱!

关键字: 面经
发信站: BBS 未名空间站 (Sat Jun 13 17:27:31 2015, 美东)
前段时间骑驴找马终于告一段落,感觉本版的技术贴和面经贴帮助非常之大,也非常感
谢共享资源的各路大牛。希望提供一些信息和个人感受给还在找工的童鞋,有帮助最好
,但是毕竟本人资历尚浅,如果有不对的地方也请轻喷。
背景:
ms毕业不到两年
主要申请公司:
offer:facebook,google,uber,palantir,sumo logic,walmartlab,yahoo,
amazon,apple
reject:dropbox
主要几个包裹:
U: 145k base + 25k股 RSU
F: 150k base + 40k signon + 10%bonus + 260k美元 RSU
W: 165k base + 50k signon + 20%bonus + 35k美元 RSU每年(
这个略复杂,相当于每年35k美元RSU的refres... 阅读全帖
j****o
发帖数: 442
36
来自主题: Canada版 - 多伦多的TTC真让人很无奈
多伦多公车局近来问题不少。最引人批评的是宣布涨价25分之后,并未对可能购买TOKEN之风有所准备,结果临时宣布每次只能出售5个,再过几天又决定全面停售TOKEN,一时之间闹得满城风雨,售票处前排成长队。
解释这次票价大涨,公车局官员指出,因为他们在包括今年在内的3年中都没有涨价,因此提高票价已经势在必行。事实上,公车局今年本来已经决定涨价,因为当时苗大伟还在考虑竞选连任,因此压制了此一涨价设想。到了现在,风云突变,老苗打消了再当4年市长的念头,因此放手让公车局行动,于是有了大幅度的增幅。 问题是,增幅既然这么大,老百姓靠购买TOKEN来保值,应是意料当中的事情,不知当局为什么没有任何准备。那是他们被自己的简单粗暴的推断迷惑住了。
因为在涨价之前,他们放风说,他们做过多次调查,结果是多伦多大部分乘客最关心的是公交服务,而不是票价。只要公车准时舒适,就是涨价他们也能接受。按照他们的说法,就是乘客愿意接受涨价。所以他们可以决定涨25分,而不对如何应付TOKEN购买危机做什么准备。仅此一举,公车局已经造成他们明年的收入损失100万元。如果没有停售TOKEN,他们的损失可以高达500万元。 其实
y********n
发帖数: 2063
37
来自主题: TexasHoldem版 - 眼泪哗哗的
You have won 2 tokens for that game.
生猛is good.
I played a lot of token games recently.
Monday, I won 4 miniftop Event #12 tokens in 2 hours.
Bubble 3 tokens.
Wish you will win more tokens.
f*****g
发帖数: 15860
38
来自主题: TexasHoldem版 - 无心插柳柳成荫
no, not this token or $26 tokens.
the other "tokens" we talked about are not really "tokens", instead, they're
entries to bigger tournaments, so they're tournament dollars, which can be
converted to cash.
i did similar things when 3 left in these games, i told the other 2 guys
that i didn't want $75 token at all, so i'd raise and then fold to them...
haha.
t******n
发帖数: 2939
39
来自主题: WaterWorld版 - [合集] 素数的数学递归定义的问题
☆─────────────────────────────────────☆
xiongyp (dreamrain) 于 (Fri May 24 08:41:56 2013, 美东) 提到:
我们假设不知道什么叫素数,我们对正整数集合进行如下的定义来定义素数。(这是从
链接上取下来的,也是I63的定义)
(1) 1不是素数 (base case)
(2) a是素数当且仅当a不能被任何小于它的素数整除。
我曾经多次指出,这个定义在用素数定义素数,是不正确的。但看到很多的反驳如下。
1不是素数, 我们考察2,发现小于2的素数集合为空集,于是2为素数。以此再往下递归
,得出所有素数的定义。我想昨天深入讨论此内容的人,都不会反对我的总结吧。关于
"小于2的素数集合为空集"推出"2为素数",因我的不慎,还做出过郑重道歉。
好,我们仿造这种递归定义,来定义偶数。
我们假设不知道什么叫偶数,我们对非负整数集合进行如下的定义来定义偶数。
(1) 0不是偶数 (base case)
(2) a是偶数当且仅当a与任何小于它的偶数之差为2的倍数。
我从base case开始。0不是偶数。我们考察... 阅读全帖
p**o
发帖数: 3409
40
来自主题: Programming版 - 简易计算器优先计算级别怎么算?

You may define the precedence levels for operators. E.g.,
precedence = {
'(': 0, ')': 0,
'+': 1, '-': 1,
'*': 2, '/': 2, '//': 2, '%': 2,
'^': 3, '**': 3,
}
operators = set(precedence.iterkeys())
right_associative_ops = {'^', '**',}
def infix_to_postlist (infix):
""" Simplified Shunting-yard algorithm. E.g.,
30 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3
<==> 30 + ((4 * 2) / ((1 - 5) ^ (2 ^ 3)))
<==> 30 4 2 * 1 5 - 2 3 ^ ^ / +
"""
postlist = []
opstack = ... 阅读全帖
l****r
发帖数: 105
41
来自主题: Programming版 - 求教个quickbooks Oauth的问题
新手,不太懂OAuth
打算在某个云服务器上放一个cron job,用来定时通过quickbooks api取数据,计算,
发给另一个web servive更新。
quickbooks用的是Oauth,需要建立连接时打开一个URL去授权,得到access token什么
的再拿来访问api。
我想问的是:
1,我应该怎么保存app的token,access token才安全,又不影响cron job的程序执行
。现在只想到存在与app相同目录下的文本文件里,或者云服务器的数据库里。
2,token已经是加密过的了,没有必要再加密存储了吧?
3,像这种我已经有quickbooks和目标web service的账户最高权限的情况,OAuth是必
须的么?我理想的状态是用app token直接调用api。我记得ebay好像就是这样的。
4,云服务器端支持php,python,ruby,perl,http,哪种比较好写?我都不会……现
学。有java,C#基础。
先谢了!
h********t
发帖数: 189
42
题有点长, 万分感谢
Assume that we have a group of n+1 people sitting around a round table.
Assume that there is a token circulated along the round table, and a person
can speak only if he/she obtain the token. We assume that the time that a
person can hold the token, once receiving it, is exponentially distributed
with the mean value of x seconds. At the end of this time, the token then
has to be passed in the clockwise or counterclockwise direction with the
same probablility (i.e. 50%) to the neighbori... 阅读全帖
w*******y
发帖数: 60932
43
Coupons Include:
Expires July 9, 2010:
$18.99 - Large 2 Topping Pizza + 4 Soft Drinks + 40 Game Tokens (edit email
address in pdf)
$10.00 - Buy 40 Tokens, Get 60 Free(edit email address in pdf)
$28.99 - Large 2 Topping Pizza + Medium Cheese + 6 Soft Drinks + 30 Game
Tokens(edit email address in pdf)
$25.00 - Buy 100 Tokens Get 100 Free(edit email address in pdf)
Make sure to edit your email address in the editable pdf for the above
coupons.
Expires July 31, 2010:
20 Free Tokens with purchase of
f*****g
发帖数: 15860
44
来自主题: _TexasHoldem版 - 昨晚又达到3点
呵呵,看见俺在旁边一边偷窥一边说小话没?
75的那个俺看了会儿,没什么大不了的,这就是人常说的, if you can't win a (or a
few ) coin flip/race, you can't win a tounament (AK vs. 99)。更有甚者说,at
some point in a tournament, you'll have to win a hand when you're way
behind (like JJ vs. QQ)。
知道为什么说打75的这个SNG,千八百的bankroll不够了吧?也就是说10次20次也未必
能进钱圈一次,即使进了,还得排除5,6名没什么赚头的情况。
full tilt上有个叫holdemkorea的韩国人(不是什么名人或牛B人士),只是pokeryjj和
俺都比较注意到她,因为她很固定,每天上来开7,8桌$8.7 token game(18人,前5名
赢$26 token),赢了以后去打9 SNG的token game(前2名赢$75 token),最后拿这个$75
token去打你这个比赛...你可以看看她的战
n****t
发帖数: 241
45
来自主题: JobHunting版 - PayPal@eBay onsite(失败)题目和经验
一周以前的面试。
1. 应该是一个台湾人,hiring manager
开始问了薪水要求和你的优缺点。
接下来主攻部分简历内容,然后问了C++的virtual function...还有部分C++的语言问
题。。。然后问base abstract class的缺点? 应该是multi inheritance的缺点
接下来一道简单算法题目,长度为n的string stream,只可以用有限的memory, for
example,2k memory buffer...如果分割字符串的token是"#adsf@asdf$",如何只输出字
符串内容而不输出token。
做法:每次输出 2k-strlen(token) 的内容并滤掉 token,然后把最后部分移到buffer
的开头。。。循环直到完成输出。
(自我感觉,这个面的不错)
2. 一个香港小姑娘, engineer
部分简历问题,然后聊了一会儿,
接下来一段coding题目 int strToint_hex(char* )
把 hex string 转成 int.
放水题目,:)
(自我感觉, 应该也还好)
3. 一个小国家来
m*****n
发帖数: 5245
46
☆─────────────────────────────────────☆
netcat (不要大offer) 于 (Sat Aug 11 12:51:38 2007) 提到:
一周以前的面试。
1. 应该是一个台湾人,hiring manager
开始问了薪水要求和你的优缺点。
接下来主攻部分简历内容,然后问了C++的virtual function...还有部分C++的语言问
题。。。然后问base abstract class的缺点? 应该是multi inheritance的缺点
接下来一道简单算法题目,长度为n的string stream,只可以用有限的memory, for
example,2k memory buffer...如果分割字符串的token是"#adsf@asdf$",如何只输出字
符串内容而不输出token。
做法:每次输出 2k-strlen(token) 的内容并滤掉 token,然后把最后部分移到buffer
的开头。。。循环直到完成输出。
(自我感觉,这个面的不错)
2. 一个香港小姑娘, engineer
部分简历问题,然后聊了一会
i**********e
发帖数: 1145
47
来自主题: JobHunting版 - 继续攒人品 报几家面经
可以考虑用 tokenization 吗?(The tokens are separated by a single dot).
确认总共有四个token,然后每一个token再检测是不是0-255的号码。
一些常见面试题的答案与总结 -
http://www.ihas1337code.com
f*******t
发帖数: 7549
48
来自主题: JobHunting版 - 两道F电面题
我刚写的,至少例子都能通过。话说我没觉得递归哪里不好啊。。。
bool is_match(const char* s, const char* p)
{
// invalid input
if(s == NULL || p == NULL || p[0] == '*')
return false;

// both string and pattern terminate synchronously
if(s[0] == 0 && p[0] == 0)
{
return true;
}

// pattern has been used up but string does not reach the end
if(p[0] == 0 && s[0] != 0)
{
return false;
}

// test if there is a '*' after current character
bool anyOccur ... 阅读全帖
f*******t
发帖数: 7549
49
来自主题: JobHunting版 - 两道F电面题
我刚写的,至少例子都能通过。话说我没觉得递归哪里不好啊。。。
bool is_match(const char* s, const char* p)
{
// invalid input
if(s == NULL || p == NULL || p[0] == '*')
return false;

// both string and pattern terminate synchronously
if(s[0] == 0 && p[0] == 0)
{
return true;
}

// pattern has been used up but string does not reach the end
if(p[0] == 0 && s[0] != 0)
{
return false;
}

// test if there is a '*' after current character
bool anyOccur ... 阅读全帖
l*********u
发帖数: 19053
50
来自主题: JobHunting版 - 上一道我以前喜欢出的题目吧
拿到第一个token"."前的数字, 比较得出结果
if 前一步数字相等
loop thru the longest one(having the most token ".")
拿到下一个token""前的数字,没token数字=-1
比较得出结果
end loop
end if
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)