由买买提看人间百态

topics

全部话题 - 话题: delimiter
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)
c******r
发帖数: 225
1
来自主题: JobHunting版 - 问10个老题
3. read n lines of random numbers(space as delimiter) from a file, lines
with same numbers are treated as duplicated lines, regardless of the order.
check and print non-duplicate lines. performance time analysis.
sort the n line based on the # of numbers in each line o(nlgn)
only lines that have the same # of numbers will be compared
suppose we have a set of m lines of length k
for each line in line_set:
sort numbers in each line ~ o(klgk)
then build a hashmap as a helper data structure
for al... 阅读全帖
k***t
发帖数: 276
2
来自主题: JobHunting版 - L二电面据,附面经
谢谢。See //// inline...
===================================================
//1.2
// -, ., number
bool isNumber (char *in, int n) {
//这个n不需要吧?
///// agree, realized but didn't bother to change it.
bool isSign=false, isDot=false;
//isSign not used?
//// realized later but forgot to remove.
// skip spaces/tab in the beginning of the string
int first = 0;
if (!in) return false;
// how about in=""?
//// no special handling is needed.
while (in && in[first] && (in[first]==' ' || in[... 阅读全帖
g****e
发帖数: 172
3
来自主题: JobHunting版 - 一道程序题
You
scanning
frequent
shoppers
cards.
Your
cash
register
logs
all
transactions
to
a
pipe-‐delimited

("|")
flat
text
file
in
the
following
format:

customer_name|product_category|item_description|cost


An
Pedro|groceries|apple|1.42
Nitin|tobacco|cigarettes|15.00
Susie|groceries|cereal|5.50
Susie|groceries|milk|4.75
Susie|tobacco|cigarettes|15.00
Susie|fuel|gasoline|44.90
Pedro|fuel|... 阅读全帖
q*i
发帖数: 78
4
来自主题: JobHunting版 - 请教一个C++的题目
why not use "):(" as delimiter

like:
l****c
发帖数: 782
5
You are working at a grocery store and you are asked to track customers'
purchasing habits by scanning frequent shoppers cards. Your cash register
logs all transactions to a pipe--‐delimited ("|") flat text file in the
following format: customer_name|product_category|item_description|cost
An example log file is:
Pedro|groceries|apple|1.42
Nitin|tobacco|cigarettes|15.00
Susie|groceries|cereal|5.50
Susie|groceries|milk|4.75
Susie|tobacco|cigarettes|15.00
Susie|fuel|gasoline|44.90
Pedro|fuel|propa... 阅读全帖
e****e
发帖数: 418
6
来自主题: JobHunting版 - A电面一题 基本已挂
IMHO, if we can make one double quote never appear in csv, then we can use
it as 分隔符.
Since Java uses escape like i.e. System.out.print( "\"" ) -> "
When writing into csv, we replace " with \" to make every " appeared in
string become \", so no single " will be in cvs.
It can be done by String method .replace( "\"", "\\\"" )
i.e. a"b -> a\"b
" -> \"
i.e.
tree:
1
" 3
csv
1
\", ", 3 ( The second element is delimiter.)
When deserializing, replace \" back to ".
e****e
发帖数: 418
7
来自主题: JobHunting版 - A电面一题 基本已挂
Breadth First Traversal. Don't need to save the line number. It's more like
the print by level with a delimiter inserted.

use
saved
e****e
发帖数: 418
8
来自主题: JobHunting版 - A电面一题 基本已挂
read the my previous post on this thread.
The delimiter is ".
k**8
发帖数: 186
9
来自主题: JobHunting版 - Epic 笔试面经
两部分
1. 介绍一种新语言,给你说语法,让你做逻辑题,n选1。不难,但要细心。20道题,
一个小时好像。
2. 四个编程题。解决实际问题那种,不是纯数据结构/算法类型的题。举个例子:
Work on a string manage program. Two rules in the program:
1. case of all (a,e,i,o,u) in a string will be toggled, converting uppercase
to lowercase and vice versa. 2. all consonants will be converted to lower
case if the character is not at the end of a word, but all consonants at the
end of the words will be converted to uppercase. Words in a string are
delimited by spaces. Prompt the user for a string... 阅读全帖
c******5
发帖数: 84
10
Detecting Cycles
Description:
Given a sequence, write a program to detect cycles within it.
Input sample:
A file containing a sequence of numbers (space delimited). The file can have
multiple such lines. e.g
2 0 6 3 1 6 3 1 6 3 1
Ensure to account for numbers that have more than one digit eg. 12. If there
is no sequence, ignore that line.
Output sample:
Print to stdout the first sequence you find in each line. Ensure that there
are no trailing empty spaces on each line you print. e.g.
6 3 1
Any... 阅读全帖
x*****0
发帖数: 452
11
来自主题: JobHunting版 - 两道最近onsite算法题
(1)
The game of Mingo involves a 100x100 board with unique positive whole
numbers in the range from 1 to 1,000,000 randomly distributed in the cells.
Unique numbers are "called" one at a time and the goal is to have a "Mingo",
which is an entire row or column of cells with numbers that have been
called. One might also form a diagonal from corner to corner with numbers
that have been called. Given a square array of 100x100 positive whole
numbers and a list of "called" numbers, write an algorithm ... 阅读全帖
l***i
发帖数: 1309
12
来自主题: JobHunting版 - 新鲜的L一面
max production subarray
1. we can see the array as subarrays delimited by 0, and each of those
subarrays can be processed indepdent of each other.
2. For each subarray without 0, if the count of negative elements is even,
then the value of this subarray is the product of all elements. If the count
of negative elements is odd, then we need to throw away one negative
element, this one is either the leftmost negative element, or the rightmost
negative element.
input: int A[], int N;
// assume empty... 阅读全帖
r*********n
发帖数: 4553
13
来自主题: JobHunting版 - Twitter电面经
他的意思是
ifstream in("file.name", ios::binary|ios::in|ios::ate);
然后in的streampos指向文件末尾,你可以定义一个int stepsize,然后
in.seekg(-stepsize, ios::cur)
in.read(char_array, stepsize),然后再去parse char_array,用"\n"作为delimiter
。当然你可能把一个word拆开成两半,所以还要handle一下这种边界情况。
p*****2
发帖数: 21240
14
来自主题: JobHunting版 - Twitter电面经

delimiter
这个跟我想的差不多。
p****e
发帖数: 3548
15
来自主题: JobHunting版 - 小公司面经
用什么做delimiter....
output的你分配了内存了么
想想其实就是考你文件系统设计
把buffer考虑成磁盘
w********g
发帖数: 106
16
来自主题: JobHunting版 - 小公司面经
都考虑了。
input.size是已知的,所以不必考虑delimiter。
output已事先分配好了。
buffer是事先给定的char数组,必须往这里buffer。
w****k
发帖数: 6244
17
来自主题: JobHunting版 - how to parse json to csv , using python?
import csv
with open('out.csv', 'wb') as f:
writer = csv.writer(f, delimiter=',',quotechar='"',quoting=csv.QUOTE_
ALL)
for item in dic.get("mem"):
writer.writerow([item.get('id'), item.get('host')])
h******6
发帖数: 2697
18
来自主题: JobHunting版 - 报个vmware电面攒人品
俩题,第二个比较简单,就是写个string的split(String s, char delimiter)
第一个我之前没听说过 但是版上大牛可能听说过了 两个数组,里面的数字都是0 to n
-1 and no duplicate. 使用swapWithZero把第二个变成第一个一模一样的 这个
swapWithZero只能跟数值为0的来swap
搜了下 就是这个 http://cs.stackexchange.com/questions/13930/rearrange-an-array-using-swap-with-0
b*******d
发帖数: 750
19
来自主题: JobHunting版 - 一个code challenge
一个公司发的。感觉不容易。
-------------------------
Save Humanity(30points)
Oh!! The mankind is in trouble again.This time its a deadly disease
spreading with rate never seen before. Efficient detectors for the virus
responsible is the need of hour. You being the lead at Central Hospital need
to find a fast and reliable way to detect the 'foot-prints' of virus DNA in
that of patient.
The DNA of patient as well as of virus consist of lower case letters. Since
the data collected is raw there might be some err... 阅读全帖
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... 阅读全帖
f*******w
发帖数: 1243
21
背景:EE 非名校PhD 无线通信方向,预计夏天毕业,两次实习经历(12年Broadcom,
13年Amazon)
2月的时候发现时间紧迫,开始锁定SDE的目标狂投简历……真正意义上的海投,大大小
小有近百家吧,基本没有找人refer。偶尔在版上看到有人帮忙refer的时候也会问一下
,不过好像都被简历拒了- -
所有面经放上……
Bloomberg:
02/21 电面阿三,没有写具体code,都是说思路
Why bloomberg?
Mention and describe one of your projects. What is your role on this project?
Polymorphism in C++, how to implement virtual functions (vtable), different
types of polymorphisms (dynamic/static).
Two sum (with or without extra memory)
Kth node to the last (Linked List)
Implement m... 阅读全帖
a**********0
发帖数: 422
22
来自主题: JobHunting版 - 发个我总结的unix常用命令
The Unix Commands
其实就是攒了一下网上的资料
# Create a new tar archive.
# the folder dirname/ is compressed into archive_name.tar
tar cvf archive_name.tar dirname/
# Extract from an existing tar archive
tar xvf archive_name.tar
# View an existing tar archive
tar tvf archive_name.tar
# Search for a given string in a file (case in-sensitive search).
grep -i "the" demo_file
# Print the matched line, along with the 3 lines after it.
grep -A 3 -i "example" demo_text
# Search for a given string in all files recur... 阅读全帖
l***i
发帖数: 1309
23
来自主题: JobHunting版 - 面试做题总结
对于面试做题,很多同学关心的是我做了多少真题,leetcode刷了多少遍,还有用特定
的programming language刷。个人感觉面试做题其实不完全是你写的code能不能
compile,能不能过所有的testcase,面试是一个跟人交流的过程,对方是在考虑这个
candidate是不是能跟自己,还有自己的team合作。一个什么都不问,听完题目, 甚至
题目都没有听完就开始敲code,或者在白板上开写的candidate绝对不是一个好的
candidate。一个好的面试过程应该是能让对方知道你的thinking process,你写code
的习惯,还有你跟teammate沟通的能力。有人说只要我写出bugfree对方能不让我过么
,这个还真不一定。一个是很难背熟150题,另外一个是如果面试官认真准备过他的题
,总能找到一些办法让你做一些extension。
下面是我总结的做题流程,抛个砖。
1. draw a picture
2. understand the problem, ask any questions if the problem is not clear. I... 阅读全帖
l******9
发帖数: 579
24
I need to access read a csv file located in a server from python 3.2 on win7.
The file name is
csv_file =
file_loc = '\serverName.myCompanyName.com\mypath\Files\myfile.csv'
with open(file_loc , 'r') as csv_file # error !!!
csv_reader = csv.reader(csv_file, delimiter=',')
error:
IOError: [Errno 2] No such file or directory: '\serverName.myCompanyName
.com\mypath\Files\myfile.csv'
But, I can access the folder and open the file from win 7 .
Thanks
f*******r
发帖数: 976
25
来自主题: JobHunting版 - 问一道airbnb的面试题
题目就是external sort的思想。统计单词的次数,明显用map。注意文
件很大,要用long,以免溢出。
在你读文件并且增加这个map时,内存不够用,这是你要把临时结果写入临时文件。你
可以设计一个threshold,比如1 billion,当map的size达到这个值时,你就把map和临
时文件merge到另一个临时文件里。最后再把这个文件rename到原来的临时文件。再把
map清空,继续读原文件直到结束。 C++代码如下:
// Split the string into words that consists of a..z and A..Z.
void split(const string &s, vector &res) {
int beg = -1;
for (int i = 0, e = s.size(); i < e; ++i) {
if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z')) {
if (beg == ... 阅读全帖
b**********5
发帖数: 7881
26
来自主题: JobHunting版 - Cloudera 面经 (电面 + onsite)
calculate average using pig:
assuming input.txt is something like 'n' delimited
1.0
2.0
3.0
myinput = LOAD 'input.txt' as (A:double); // (1.0)(2.0)(3.0)
grouped = GROUP myinput ALL; // (all: {(1.0)(2.0)(3.0)})
avg = FOREACH grouped GENERATE AVG(grouped.myinput);
l**p
发帖数: 569
27
你可以这么找:
1.Log on to your Scottrade account and Click on the My Account Tab
and select Account History and Transactions.
2.Select a Start Date and End Date for the report.
3.Select Comma Delimited (CSV) in the Download File drop down box and then
click the GO button.
4.A popup window will appear. Left-Click on Trade History Records
5.Select Save.
After this, open your file with Excel and sort your data according to "Date"
so that old trades goes first.
y********g
发帖数: 311
28
我无法从SCOTTRADE下载TRANSACTION HISTORY. 按您以前贴子的步骤,
after "3. Select Comma Delimited (CSV) in the Download File Drop down box
and then click the GO button”,无法找到:“a popup window.” 所以无法“Left
-Click on Trade history records and save".
How to resolve this problem?
Thanks a lot.
d*2
发帖数: 2053
29
来自主题: SanFrancisco版 - Education departments go wild for the iPad(ZZ)
果子股票还有的涨啊
http://delimiter.com.au/2010/09/22/education-departments-go-wild-for-the-ipad/
Schools and universities right around Australia had jumped headfirst into
trials of Apple’s hyped iPad tablet as they rush to discover exactly what
the device’s use will be in the educational field — sometimes with the
support of their overarching education departments, and sometimes without.
Western Australia’s Department of Education and Training revealed this week
that some schools in the state were displ
g**t
发帖数: 1872
30
来自主题: SanFrancisco版 - 工程师们看过来
你不用写什么程式,只要用cut和paste就可以了。
查查manpage吧,大概是:
cut -d '^VI' -f 3,4 file2 | paste file1 -
假设你的delimiter是tab。
e****e
发帖数: 3450
31
来自主题: SanFrancisco版 - 工程师们看过来
shows: cut: bad delimiter

shell
t*******r
发帖数: 22634
32
我查了一下:
有关的 Statue 是 29 U.S. 213(a)(15):
http://www.law.cornell.edu/uscode/text/29/213
29 U.S. Code § 213 - Exemptions
(a) Minimum wage and maximum hour requirements
The provisions of sections 206 (except subsection (d) in the case of
paragraph (1) of this subsection) and 207 of this title shall not
apply with respect to—
...
(15) any employee employed on a casual basis in domestic service
employment to provide babysitting services or any employee employed
in domestic service employment to provid... 阅读全帖
t*******r
发帖数: 22634
33
这个看具体情况,如果是早产儿啥的(当然看早多少,可能要医生证明),
应该没事。
29 USC 213(a)(15) (以及相关 CFR)里定义了:只要是 infirmity,
算成 companionship,一路开绿灯给 exempt 掉。
前面有某大妈拿早产儿智障儿跟普通健康儿类比,来争论。看清楚了,USC
(是 Statue 级别的)里面白纸黑字写明白了要区别对待的:
(babysitting 要求 “casual basis” 才能符合,companionship
没有该限制。这个 “casual basis”,CFR 里花了很多口舌)。
http://www.law.cornell.edu/uscode/text/29/213
29 U.S. Code § 213 - Exemptions
(a) Minimum wage and maximum hour requirements
The provisions of sections 206 (except subsection (d)
in the case of paragraph (1) of this subsect... 阅读全帖
b*********a
发帖数: 1145
34
Will running on concrete increase my risk of injury?
Sami Siva/The Globe and Mail
New research contradicts earlier studies that say we adapt our running
stride so that hard and soft surfaces administer roughly the same shock to
the body
Share with friends
CloseEmail Please enter a valid e-mail address
Please enter a comma delimited list of valid e-mail addresses
Other ways of sharing:Tweet this on TwitterShare on FacebookAdd to
DeliciousSubmit post to Digg.comSeed this post at Newsvine
Print
p***r
发帖数: 4859
35
☆─────────────────────────────────────☆
bushiathena (athena) 于 (Sun Jul 11 14:37:11 2010, 美东) 提到:
小绿最后受伤,似乎是跟她路跑有关,让我再次想起那个跑硬路面是否伤关节的问题,
找了点reference:
http://www.ncbi.nlm.nih.gov/pubmed/10433420?dopt=Abstract
http://www.ncbi.nlm.nih.gov/pubmed/12048328?dopt=Abstract
是不是说,路面的确有软硬之分,但是如果running form可以做相应调整,可以使得对
关节的shock程度基本没有太大变化?请王欢喜来分析一下。
☆─────────────────────────────────────☆
whxhm1 (whxhm) 于 (Sun Jul 11 14:38:28 2010, 美东) 提到:
Yes, I make adjustments when I run on concrete these day... 阅读全帖
b*s
发帖数: 82482
36
来自主题: LeisureTime版 -
中间哪里差一个delimiter

Toooooooooooooooooooooooooooooooooooooooold!
b*s
发帖数: 82482
37
来自主题: LeisureTime版 - [神游八荒]:芝加哥一瞥(2)
没有适当delimiter,没有领会……

我Email里明明包含了id名。。。
b*s
发帖数: 82482
38
来自主题: LeisureTime版 - 假期番外:证照齐全
o就是universal delimiter啊
这个难度小多了,多么容易识别

这和吐火罗文是一个道理。
b*s
发帖数: 82482
39
来自主题: LeisureTime版 - [神游八荒] 远方会故人 之二
还有分段,标点
因为句读之不识,惑之不解
句读是我的弱项。好在英文有空格这个有力的delimiter

你怎么老盯着分段啊标点啊
看东西那么解构
b*s
发帖数: 82482
40
来自主题: LeisureTime版 - [神游八荒] 远方会故人 之二
还有分段,标点
因为句读之不识,惑之不解
句读是我的弱项。好在英文有空格这个有力的delimiter

你怎么老盯着分段啊标点啊
看东西那么解构
b*s
发帖数: 82482
41
来自主题: LeisureTime版 - 这么着不行
说明了delimiter,例如空格符的必要性。

东四是地名,十条是胡同的编号。
p********a
发帖数: 5352
42
来自主题: EnglishChat版 - 次序颠倒了怎么说?
Our client sent me some data and I found two fields 次序反了. Then I said
the sequence of the two variables were swapped. Is that right? I just don't
feel right.
Is there anything wrong with the following comments? or is there any way to
organize it better?
"There are commas in the member’s address lines. We can’t tell if it is
the comma in the address or the comma as the CSV file delimiter."
Thanks
p*x
发帖数: 533
43
来自主题: EnglishChat版 - 次序颠倒了怎么说?
1)the order of the two variables is (mistakenly) reversed.
2)have you ever seen a comma in a legal/valid email address?
technically, your guess of delimiter makes sense.

t
to
p******n
发帖数: 633
44
来自主题: EnglishChat版 - what does demark mean?
demark=delimite=to fix or define the limits of.
But this is very strange. So I am confused.
s*****a
发帖数: 2735
45
谢water 和 wuyi。
我的问题可能不在textscan,应该是loop上太菜了(原谅我是新手,哈哈)
我还是考虑吧文件贴出来,请认识的帮看看,run run。
data file:
https://www.dropbox.com/s/83nd46ny7gunyhv/data.csv
test code:
https://www.dropbox.com/s/vvzfw6uhhgkekbd/test.m
————————————————————————————————————-
test code copy:(我两个方法都出错了,虽然能够正常读入)
%% input 1
fid_t = fopen(...
'C:\**\data.csv', ... % <------------- address
'r');
while ~feof(fid_t)
temp1 = fgetl(fid_t);
temp2 = regexprep(temp1, '"', '');
line = csv2cell(temp2);

if strcmp(... 阅读全帖
A*********u
发帖数: 8976
46
我那dollar sign前面有个冒号
遇到delimiter会停的,不是一定读到200 :)

刚看见,谢谢意见!
这个办法我试过,不行,这样读数据打乱了安排,如果address字段中中间,把后面的
字段长度都读进去了,格式就乱了。
昨天晚上罗尼在古典版给的意见比较简洁好使,只在data proc 开始的时候设置
address的最长字段长度(不设置的话默认是8),然后读具体数据的时候还用我原来的
读取方式就可以了。
奇怪的是,我以前的读取方式,读英文字段多长的字节都没有问题,就是读中文字段,
超过8给就不读了。。。
f******x
发帖数: 2260
47
来自主题: RUC版 - 问问学信息的
说点我这门外汉的管窥之见吧.
Excel里面的统计功能都是做好了的, 你能输入的公式比较少, 而且图形丑陋, 用来制作
方块的表格是非常拿手的说. EXCEL的表格数据可以被其他数据库IMPORT进去,
譬如说ACCESS就可以直接引用EXCEL表格. 但是多数的原始数据好象都是用TXT文件存的,
格式好象是什么ASII, CSV, TAD DELIMITED等等, 无非就是用数字和符号来存,
而不象EXCEL文件一定还有大量其它信息.
SAS作为一种统计软件一个强项我认为就是数据处理的. 当然, 很多数据库软件我没有用
过, 象ZHX说的SQL SERVER, 我只知道SQL好象是BASIC一样的语言.
不同的行业用的统计软件都不一样, 象SAS好象多用于医疗类的数据进行组与组之间的对
比. GUASS就是用于经济类的宏观数据分析. 这些统计软件比EXCEL, ACCESS方便之处, 就
是把很多东西都做在里面了. 譬如要回归的话, 就是LS Y X1 X2什么的. 然后系统就光几
光几吐出一堆数据, 你需要的大多数都在里面, 还有更多的是不需要的. EXCEL能做到的,
统计软件一
p*******n
发帖数: 4824
48
好像缺省情况下,mac, unix, windows都不同。在mac下面,编辑文件的时候,有没有
办法指定行分隔符和unix的风格一
致?就是加\n?
主要是在用texshop的时候,有时候在linux下编辑,然后cvs merge的时候因为行分隔
符不一致导致结果不正常。。。
谢谢
l******o
发帖数: 2649
n******7
发帖数: 12463
50
yes, tab delimited
我是个人用。用mac是因为它是unix类的系统,做事情方便。linux的商业支持太差了,
所以这次试试
osx。
对于mac外型什么的,其实我不感冒,而且对大部分机型都是镜面屏很不喜欢。
另外,oo的界面在osx下比linux下还是好看不少的
首页 上页 1 2 3 4 5 6 7 下页 末页 (共7页)