z**k 发帖数: 378 | 1 > system.time({
+ x <- 1
+ for (i in 1:10000)
+ x[i] <- i
+ })
user system elapsed
0.36 0.00 0.36
>
>
> system.time({
+ x <- numeric(10000)
+ for (i in 1:10000)
+ x[i] <- i
+ })
user system elapsed
0.03 0.00 0.03
> |
|
p********y 发帖数: 5141 | 2 02/06/2013 Tata Steelman Olympic Distance Triathlon
1.5km swim; 40km bike; 10km run.
--------------------------------------------------------
前言
比赛结果目前还没有看到,但是可以确定的是,我是最后一名!:'(
唯一可以安慰自己的就是,我坚持完赛了。。。=(
又是比赛前不到一周spontaneously地sign up了这个比赛,算是为两周之后的半铁预演
。我想这次预演的效果真的达到了,不止是身体上的,更重要的是心理上的。
---------------------------------------------------------
前言的前言
去年9月,骨折尚在康复中的企鹅一冲动就sign up了一个半铁比赛。其实这个世界上的
半铁比赛有很多很多,我附近的就有不少,谁知道,偏偏就选中了Macca都承认的世界
上最tough的这个半铁。。。想要让脚踝恢复到受伤以前比我想象中难得多。因为拄拐
等原因,肌肉萎缩,韧带缩短。恢复训练之后,有急于求成... 阅读全帖 |
|
s**d 发帖数: 190 | 3 转一篇文章。
Ten Things Everyone Should Know About Time
by Sean
“Time” is the most used noun in the English language, yet it remains a
mystery. We’ve just completed an amazingly intense and rewarding
multidisciplinary conference on the nature of time, and my brain is swimming
with ideas and new questions. Rather than trying a summary (the talks will
be online soon), here’s my stab at a top ten list partly inspired by our
discussions: the things everyone should know about time. [Update: all of
these ar... 阅读全帖 |
|
b****r 发帖数: 2555 | 4 ☆─────────────────────────────────────☆
voidness (先有没有) 于 (Thu Sep 1 20:10:49 2011, 美东) 提到:
这个问题有点闹心。
什么叫一秒?是一小时的1/3600,一天24小时,一年365天。
可见时间是由地球绕日头决定的。
那我要问:外星球呢?年和天一定不同于地球,因此会有不同
的时间概念。
这也解释了为什么天上一天地上一年的神话,根本就不是同一
时间系统,不一定是什么相对论的问题。
还有,在蚂蚁看来,人的一秒像它们的一分钟,你认为蚂蚁活得短,
那乌龟还认为人活得太短了呢。动作越慢的动物,相对时间活得更长。
时间不是绝对的,是你的感觉而已。
再往深了说,时间是不存在的,是因为你感知了周围变化才有时间
的概念,一旦什么都不变了,时间就停止了,呵呵,但愿你能理解。
总之,干什么事慢点,长寿,但别停干事,至少要喘气,好让时间走。
☆─────────────────────────────────────☆
Wanerbei (玩儿呗) 于 (Thu Sep 1 20:13:11 2011, ... 阅读全帖 |
|
F*****t 发帖数: 2580 | 5 Appleman的书说得很清楚是3933人中损失1150人,接近30%的损失。从7月5号接战到7月
22号,24师的总损失也是30%。
http://www.history.army.mil/books/korea/20-2-1/sn11.htm
“When all the men who escaped from Taejon had rejoined their units, a count
showed 1,150 casualties out of 3,933 of the U.S. 24th Division forces
engaged there on 19-20 July-nearly 30 percent. Of these casualties, 48 were
known dead, 228 wounded, and 874 missing in action. Most of the last were
presumed killed and this was borne out by subsequent information. Among the
rifl... 阅读全帖 |
|
c***r 发帖数: 4631 | 6 不知道这样的东西算书么, 1772 BCE的样子。刻的内容如下:
CODE OF LAWS
1. If any one ensnare another, putting a ban upon him, but he can not prove
it, then he that ensnared him shall be put to death.
2. If any one bring an accusation against a man, and the accused go to the
river and leap into the river, if he sink in the river his accuser shall
take possession of his house. But if the river prove that the accused is not
guilty, and he escape unhurt, then he who had brought the accusation shall
be put to death, while he... 阅读全帖 |
|
w*p 发帖数: 16484 | 7 难道花街要用三哥当替罪羊?
Former Goldman Sachs Board Member Arrested for Insider Trading
The federal government's biggest insider trading case has ensnared its most
prominent executive yet. Rajat Gupta, formerly a board member at Goldman
Sachs and Proctor & Gamble, surrendered to the FBI this morning to face
criminal charges.
The 62-year-old executive, who visited the White House in 2009 for the state
dinner honoring India, faces one count of conspiracy to commit securities
fraud and five counts of securiti... 阅读全帖 |
|
b********n 发帖数: 38600 | 8 http://www.nytimes.com/2013/02/12/world/asia/zhuang-zedong-winn
Zhuang Zedong, Skilled in China Foreign Relations and Ping-Pong, Dies at 72
In 1971, at the world table tennis championships in Japan, an American
player mistakenly boarded a bus carrying the Chinese team. The team had been
told not to talk to Westerners, and an awkward silence descended. Ten
minutes elapsed. Then the best player in China stood, greeted the American
and offered him a gift, a scarf. |
|
w*********r 发帖数: 42116 | 9 帮不会英文的老将写的请愿书。赶紧去白宫请愿,也耽误了。不去就是装B。
Twenty four years have elapsed since the June 4th Massacre when the Chinese
army inflicted massive and inhumane atrocities on Chinese people. Yet, the
Chinese government still has not officially acknowledged and apologized for
these atrocities.
Instead, the Chinese government condemned the protests as a "
counterrevolutionary riot", and has prohibited all forms of discussion or
remembrance of the events within China. Chen Xitong, mayor of Bejing, said
in 1989 ... 阅读全帖 |
|
w*********r 发帖数: 42116 | 10 Twenty four years have elapsed since the June 4th Massacre when the Chinese
army inflicted massive and inhumane atrocities on Chinese people. Yet, the
Chinese government still has not officially acknowledged and apologized for
these atrocities.
Instead, the Chinese government condemned the protests as a "
counterrevolutionary riot", and has prohibited all forms of discussion or
remembrance of the events within China. Chen Xitong, mayor of Bejing, said
in 1989 that "there was no Tiananmen Massac... 阅读全帖 |
|
g**1 发帖数: 10330 | 11 http://news.xinhuanet.com/english/world/2014-03/12/c_133180336.
Thai navy continues to search Andaman Sea for missing Malaysian airliner
English.news.cn 2014-03-12 12:15:48 More
BANGKOK, March 12 (Xinhua) -- The Thai navy's search and rescue mission in
the Andaman Sea for a Malaysia Airlines plane gone missing since last
Saturday has elapsed into a third day on Wednesday but found nothing as yet.
Third Navy Region commander Vice Adm. Tarathorn Kachitsuwan said on
Wednesday the navy's H... 阅读全帖 |
|
a***k 发帖数: 1038 | 12 【 以下文字转载自 paladin 讨论区 】
发信人: atack (小军号), 信区: paladin
标 题: 红死病 by 杰克.伦敦
发信站: BBS 未名空间站 (Sat Oct 11 07:40:15 2014, 美东)
I
The way led along upon what had once been the embankment of a railroad. But
no train had run upon it for many years. The forest on either side swelled
up the slopes of the embankment and crested across it in a green wave of
trees and bushes. The trail was as narrow as a man's body, and was no more
than a wild-animal runway.
Occasionally, a piece of rusty iron, showing through ... 阅读全帖 |
|
发帖数: 1 | 13 Facebook Page: Help Our Sister Li Ouyang to Fight for Justice
Website: https://www.facebook.com/help.li.fight.for.justice/
Notice: Fundraising Campaign for Help Our Sister Li Ouyang to Fight for
Justice starts globally. Supporters, donors, and philanthropists, whether my
university alumni or not, whether in China, Canada, U.S.A., or other parts
of the world, are welcome to ask relevant questions and choose any of the
following ways to help with my lawsuit relevant expenses, which involve the
pri... 阅读全帖 |
|
发帖数: 1 | 14 THE RECONSTRUCTION OF HANKOW
China's Commercial And Industrial Capital.
From The Far Eastern Review.
Ever since the fateful fire which destroyed the Chinese city of Hankow
during the Revolution of 1911-12 it has been generally known that the
Chinese Government has been desirous of rebuilding the city upon modern
lines and making other improvements in the vicinity compatible with the
importance of such a flourishing commercial and industrial center. It was,
therefore, not surprising when it ... 阅读全帖 |
|
发帖数: 1 | 15 THE RECONSTRUCTION OF HANKOW
China's Commercial And Industrial Capital.
From The Far Eastern Review.
Ever since the fateful fire which destroyed the Chinese city of Hankow
during the Revolution of 1911-12 it has been generally known that the
Chinese Government has been desirous of rebuilding the city upon modern
lines and making other improvements in the vicinity compatible with the
importance of such a flourishing commercial and industrial center. It was,
therefore, not surprising when it ... 阅读全帖 |
|
发帖数: 1 | 16 Stone Cold Word
Longboat Key, Florida4m ago
AG Barr investigating a missing Twinkie is a joke.
So I am reading all these comments laughing and calling out "conspiracy
theories". It's easy to "throw shade"..... getting "shade to stick" is
another story.
I know this. A high profile prisoner, who supposedly tried to kill
himself just two weeks ago, this guy could not get near a 6 inch piece of
thread. Now that's not a "conspiracy theory".
The "shade slingers" want us to believe that this ego ... 阅读全帖 |
|
a******1 发帖数: 1031 | 17 你不是英语no longer undervalued么 可以读一读英国的规则
Since the Fixed-term Parliaments Act was passed, the House of Commons has
twice decided that an earlier general election should be held: in 2017 and
in 2019.
The Fixed-term Parliaments Act 2011 provides for general elections to be
held on the first Thursday in May every five years. There are two provisions
that trigger an election other than at five-year intervals:
A motion of no confidence is passed in Her Majesty's Government by a simple
majority and 14 d... 阅读全帖 |
|
l****z 发帖数: 29846 | 18 By Bonnie Rochman Monday, August 8, 2011
That Facebook is hugely distracting is hardly stop-the-presses kind of news,
but parents might be dismayed to learn that the social-media site can
hobble learning and make kids less healthy and more depressed.
Research has found that students in middle school, high school and college
who checked Facebook at least once during a 15-minute study period got lower
grades. Other studies have discovered that teens who use Facebook tend to
have more narcissistic ... 阅读全帖 |
|
l****z 发帖数: 29846 | 19 by Rick aka Mr. Brutally Honest
John Hayward is dealing with the Paul Ryan is a liar meme being propagated
by the Obama administration and their willing accomplices in the media:
... both of the key factual points made by Paul Ryan are true: Obama
promised the plant would remain PaulRyanopen if he were placed in charge of
the government, but it didn’t last a year beyond the beginning of his
Administration. If you want to be extremely rigid in your analysis of Ryan
’s remarks, you could say ... 阅读全帖 |
|
c****x 发帖数: 6601 | 20 H1B EXT被废看来是没跑了。
--------------------------------------------
《川普政府取消h1b延期是假新闻?必须要通过议会?几点补充分析》
原创 2018-01-07 北大飞
http://mp.weixin.qq.com/s/E7GQ10sldDJn-1A3BibxNg
1. 消息源是可靠媒体 2. 有人把两条法条弄混了。
前几天本公众号有关川普政府策划取消140后h1b延期一事的文章引起了广泛重视。其阅
读量超过10万。可见这一话题与在美国生活的华人朋友切身利益十分相关。从自己利益
出发,我们必须密切关注有关事项的进展,做出最有利于自己的选择。
但文章发出后,很多明显是川普一派的人马纷纷进行洗地,想方设法论证并无此事,或
者事情并不那么严重。为防止朋友们被这些说法误导,在这里集中进行一下辨析。
说法一:这个消息各“主流媒体”没有报道,来自于一些小报,所以是谣言,是编造
辨析:这一消息来源是McClatchy公司的驻DC新闻社McClatchyDC【1】,该社以报道政
治新闻为主。虽然规模不如三大报纸或cnn/nbc等大有线台,却是一... 阅读全帖 |
|
c****x 发帖数: 6601 | 21 【 以下文字转载自 EB23 讨论区 】
发信人: cccpwx (我今生没有别的希望,只希望能多日几个女人), 信区: EB23
标 题: H1B EXT被废看来是没跑了。
发信站: BBS 未名空间站 (Sun Jan 7 18:27:51 2018, 美东)
《川普政府取消h1b延期是假新闻?必须要通过议会?几点补充分析》
原创 2018-01-07 北大飞
http://mp.weixin.qq.com/s/E7GQ10sldDJn-1A3BibxNg
1. 消息源是可靠媒体 2. 有人把两条法条弄混了。
前几天本公众号有关川普政府策划取消140后h1b延期一事的文章引起了广泛重视。其阅
读量超过10万。可见这一话题与在美国生活的华人朋友切身利益十分相关。从自己利益
出发,我们必须密切关注有关事项的进展,做出最有利于自己的选择。
但文章发出后,很多明显是川普一派的人马纷纷进行洗地,想方设法论证并无此事,或
者事情并不那么严重。为防止朋友们被这些说法误导,在这里集中进行一下辨析。
说法一:这个消息各“主流媒体”没有报道,来自于一些小报,所以是谣言,是编造
辨析:这一消息来源是... 阅读全帖 |
|
t*****0 发帖数: 264 | 22 发信人: wokaowokao (GaN), 信区: Automobile
标 题: 我的上庭经历+所用文件
发信站: BBS 未名空间站 (Tue Feb 10 16:00:47 2009)
去年8月25号晚上,从家里去学校的路上被抓,40的路,条子说我开了54.二话不说,一张
ticket,我一看,还是我们学校的警察,nnd,下手真狠.条子是迎面开来的
然后就去法院要求上庭,初定是11月底吧,一共要去两次,前一次递交motion,第二次
trial
谁知道我把日子记错了,递交motion那次忘记去了.第二天再去,说只能重新安排时间.于
是motion递交排到1月27号,今天trial.我对本州的speedy trial不是狠了解.由于上一
次也是我的失误,没能按原有排期,所以我也不指望靠speedy trial的trick了.
1月27号,坐在大厅里面溜溜的等了几个小时,无聊透顶,自己翻看着打官司的书.老爸非
要陪着去看看,也是无聊的坐了半天.倒是前台坐着的一个貌似intern的小姑娘clerk,她
忙完自己的活,拖着腮帮百无聊赖的在prosecutor的位子上发呆,让我觉得大厅... 阅读全帖 |
|
|
f**c 发帖数: 791 | 24 juts received ticket in mail. saw the video online :((
$85, 2 points, 2 additional insurance points
保险会长多少?any suggestion? thx |
|
a********s 发帖数: 2356 | 25 哪个州啊,拍照的一般不会扣点的,因为不知道是谁开车 |
|
f****y 发帖数: 2196 | 26 上次我0.43s, 加州, 盛惠$464 :) |
|
f**c 发帖数: 791 | 27 NJ.
But the ticket is issued to me with name and address...:( |
|
|
f**c 发帖数: 791 | 29 不好意思:点数是上网自己查的,信中有这么一句话:
in no case shall motor vehicle points or automobile insurance eligibility
points pirsuant to section 26 blah blah be assessed against any person for a
violation occurring under the provisions of this act
是不是交罚款就行了,看来是自己下自己了 |
|
W*******g 发帖数: 458 | 30 一共收到两封citation
第一封citation到的时候上面说:
"violation was not committed in my presence. The above is decleared on
information and belief and is based on photographic evidence.
I declare under penalty of perjury under the laws of the state of california
. The foregoing is true and correct."
Declarant:Frank Noey
我完完全全的糊涂了,frank是谁(不是我的名字)?上面这段declaration 是啥意思?
被拍照的是我和我的车。。。签名这段declaration的frank是警察,先假定我无罪?
然后过了两天又来了一封citation, 说我闯了红灯,要罚480,有上驾校的option...
当时是晚上快10点,街上都没有车辆和行人。我的车速42迈(限速40迈),citation上
还有一些指标:... 阅读全帖 |
|
y*****d 发帖数: 4451 | 31 My annotation of the follows:
1.没大毛病
2.1080p时候视角受限,而720P只能读取前后车的license plate,旁边的车不可以:这
个人是警察?
3.这个人看不懂中文说明书
4.文件格式不好,而且如果打着火后马上就熄火before这个记录仪开始video,这种情
况下系统会进入bug状态
5.GS600有GPS记录,那个我查了,有十几秒video gap between clips
Expect Chinese quality engineering, September 30, 2011
By Steely Blue (Darien, IL, USA) - See all my reviews
Amazon Verified Purchase(What's this?)
This review is from: DOD F900LHD Full HD Car Black Box DVR Camera 1080P LCD
(Electronics)
Pros:
-It works. It supports loop recording, au... 阅读全帖 |
|
S*********s 发帖数: 1963 | 32 GAP是refundable的,而且价格估计跟贷款年数有关,lz说不定贷的是四五年的款才这
么贵。
我的GAP条款写着:
you have the right to cancel at any time and to request a refund, if no
benefit has been provided under this agreement. ...We will refund the
purchase price pro-rata based on the elapsed time from the agreement
effective date to the cancellation date. |
|
b********s 发帖数: 1415 | 33 Your insurance policy transfers exactly as is to the new car. If you only
have Liability coverage with minimum limits for your old car, you'll only
have Liability with minimum limits for your new one — until you notify your
insurance company to change them. If you're financing your vehicle, banks
won't loan you money for the car without adding at least Comprehensive and
Collision coverage to your policy first. So, in this case, you may need to
add coverage to your policy before you can complete ... 阅读全帖 |
|
j*****e 发帖数: 11116 | 34 只出来2w bonus,写信去amex问,回复如下:
I am afraid; your account is not eligible for the 45,000 bonus points offer.
We request you to provide us the promotion code and all the additional
details regarding the offer. You will find this code either on your mail or
email which you might have received regarding the offer.
Once we receive the offer code which is an alpha numeric code or you may
find the bonus id which is four digit codes (numeric), it will help me in
locating the promotion for you. I would be th... 阅读全帖 |
|
f**y 发帖数: 692 | 35 from paypal service:
Your funds are pending - please process this order
You received a payment from XXXX.
This money is being temporarily held in your pending balance. It will be
held for up to 21 days. While it's being held, it won't be available for
withdrawal.
We'll move the money to your available balance after 21 days as long as your
buyer hasn't reported a problem. It may be available sooner if we can
confirm that the item was delivered and 3 days elapse or, if this is an eBay
item, your b... 阅读全帖 |
|
g*r 发帖数: 2116 | 36 好像还没有三个月 不过听说有的人过了快一年还要file claim的
For seller orders made on the Amazon.com website for physical goods, you
must wait 3 calendar days past the maximum estimated delivery date for an
order OR 30 days from the order date, whichever is sooner.
If your order fails to arrive, you then have 60 days to file an A-to-Z claim
.
If you receive your item and it is damaged, defective, or materially
different, you must contact the seller within fourteen (14) days of receipt
to request return information.
For ... 阅读全帖 |
|
y*******o 发帖数: 6632 | 37 If you receive your item and it is damaged, defective, or materially
different, you must contact the third-party seller within fourteen (14) days
of receipt to request return information.
For third-party seller orders made on the Amazon.com website for eligible
services, you must wait until your scheduled delivery time has elapsed to
file an A-to-Z claim.
Note: If your item becomes defective more than 30 days past the shipment
date and it is under warranty, you must contact the manufacturer for ... 阅读全帖 |
|
m***x 发帖数: 788 | 38 Impact of Domestic Violence on Children
https://www.childwelfare.gov/pubs/factsheets/domestic_violence/impact.cfm
A growing body of literature shows that children who have been exposed to
domestic violence are more likely than their peers to experience a wide
range of difficulties. These difficulties fall into three main categories:
Behavioral, social, and emotional problems. Children in families
experiencing domestic violence are more likely than other children to
exhibit aggressive and ant... 阅读全帖 |
|
d***r 发帖数: 865 | 39 Shell gift card FAQ:
Fee:
An inactivity fee of $1.75 per month will be applied to any balance on the
card if 12 months elapse during which the card is not used to make a
purchase.
If purchased directly from some certain states, there is no inactivity fee.
To avoid fee:
Make a small purchase in the 12th month to extend the no fee period
Check balance:
1-800-300-8113
To use the card with small balance:
Always pay inside, you can prepaid with multiple cards.
Troubleshooting:
If problem occurs at pu |
|
o**y 发帖数: 1084 | 40 the announcement on the card (shell) back which i bought couple days ago is shown
below.
An inactivity fee of $1.75/per mon. will be applied to any balance on the
card if 12 months elapse during which the card is not used to make a
purchase (except for cards sold in AR,CA,CT,DE,HI,IA,LA,MA,MD,ME,MT,ND,NJ,NM
,NV,OH,OK,RI,TN,VT,WA,WV, and as otherwise prohibited by law.) |
|
T*********e 发帖数: 9208 | 41 ok, you are right. you have to have some justifications to withdraw earnings
without paying tax and penalty.
Distributions
Direct contributions may be withdrawn at any time.[1] Eligible (tax and pena
lty free) distributions of earnings must fulfill two requirements. First, th
e seasoning period of five years must have elapsed, and secondly a justifica
tion must exist such as retirement or disability. The simplest justification
is reaching 59.5 years of age, at which point qualified withdrawals m... 阅读全帖 |
|
d****s 发帖数: 174 | 42 我也在学习。可以在treasurydirect买。http://www.treasurydirect.gov/indiv/research/indepth/ibonds/res_ibonds_iratesandterms.htm
利率计算如下:
FV = PV × {[1 + (CR ÷ 2)] (m÷6)}
Where:
FV (future value) = redemption value on the
accrual date rounded to the nearest cent
without consideration of penalty.
PV (present value) = redemption value at the
beginning of the semiannual rate period
calculated without consideration of penalty.
For bonds that are older than five
years, PV will equal the redemption value
at the star... 阅读全帖 |
|
U*****R 发帖数: 60 | 43 ·how to evaluate search engine results (enum all metrics you can think of,
e.g., recall and click)
1. efficiency. How quick. Elapsed indexing time,...
2. effectiveness. How accurate. Compare the ranking produced by search
engine with the one by relevance judgement (user relevance and topical
relevance). Recall and Precision
3. Query logging. How human interact with search engine.
The following document is fairly complete.
http://www.pearsonhighered.com/croft1epreview/pdf/chap8.pdf |
|
S*******0 发帖数: 198 | 44 Web development职位,不是很大的公司,先发邮件来做题,第一次碰到。
刚刚做完,过会发我的sample答案上来
1. Describe a deadlock. What causes it? What are the effects?
2. Consider class Car with method getMake() -> String. Write a function to
retrieve all Toyotas from the following data structure:
ArrayList cars
3. List the bugs/problems in the following code snippets:
a. select * from claim where diagnosis_id in (739.1) and where patient_id in
(select patient_id from patient where name is ‘SMITH’)
b.with a as (select * from claim)
s... 阅读全帖 |
|
S**I 发帖数: 15689 | 45 Her beauty will depreciate and IT WSN's income probably will keep growing as
time elapses, so even both are top 1%, it would be a bad investment for IT
WSN. :) |
|
s****a 发帖数: 4 | 46 一个朋友今天收到OPT被拒的信,很着急,学校的人说不清楚他这样的情况可否reopen
,了解的朋友请给我留言,或者如果认识有这方面经验的律师也可以留给我联系方式,
多谢 (P.S. 他在MA)
他被拒的理由是USCIS收到学校确认申请签字I20的时间超过I20 issue date的30天,具
体如下:
“You must file the Form I-765 with USCIS within 30 days of the data the
Designate School Official (DSO) entered the recommendation for OPT into your
SEVIS record. You applied for OPT on September28, 2012. At the time of
filing your Form I-765, more than 30 days had elapsed since your DSO entered
the recommendation for OPT into your SEVIS record.... 阅读全帖 |
|
t****a 发帖数: 1212 | 47 第三题很有趣,偶来给个clojure的解
基本思路是
1. 对T做预处理,构建graph,同时,记录每个字符a-z所出现的位置
2. 由于S长度<100,数量却很大(100M),意味着有很多重复,使用memoize function会
大大减少计算量
下面的程序在1/1000大小的S数据集上运行需要1.7秒。观察了一下时间和数据集大小趋
势,在完整数据集上几分钟内也可以产生结果
(def alphabet (map char (range (int \a) (inc (int \z)))))
(def T (vec (take 10000000 (repeatedly #(rand-nth alphabet)))))
(def S (take 100000 (repeatedly (fn [] (take (inc (int (* (rand) 100))) (
repeatedly #(rand-nth alphabet)))))))
(def T-ix (group-by #(T %) (range (count T))))
(def T-map (let [pairs (dist... 阅读全帖 |
|
t****a 发帖数: 1212 | 48 第三题很有趣,偶来给个clojure的解
基本思路是
1. 对T做预处理,构建graph,同时,记录每个字符a-z所出现的位置
2. 由于S长度<100,数量却很大(100M),意味着有很多重复,使用memoize function会
大大减少计算量
下面的程序在1/1000大小的S数据集上运行需要1.7秒。观察了一下时间和数据集大小趋
势,在完整数据集上几分钟内也可以产生结果
(def alphabet (map char (range (int \a) (inc (int \z)))))
(def T (vec (take 10000000 (repeatedly #(rand-nth alphabet)))))
(def S (take 100000 (repeatedly (fn [] (take (inc (int (* (rand) 100))) (
repeatedly #(rand-nth alphabet)))))))
(def T-ix (group-by #(T %) (range (count T))))
(def T-map (let [pairs (dist... 阅读全帖 |
|
b*****o 发帖数: 715 | 49 那还是贴code吧,我算出来是140240。 code很没有效率,要算半分钟~
//////////////////////////////////
import fractions
import time
N = 3
M = 3
def notCollinear(i, j):
a, b = map(lambda x: (x / N, x % N), (i,j))
if abs(fractions.gcd(a[0] - b[0], a[1] - b[1])) > 1:
return False
return True
def adjoin(S):
return reduce(lambda x, y: x + y, S)
def nextRound(pw):
return adjoin(map(lambda x: [x + [i] for i in xrange(N * M)
if not i in x and notCollinear(i,x[-1])], pw))
def findAll():
pw = [[[i] for i in xrang... 阅读全帖 |
|
u*****m 发帖数: 26 | 50 针对于下面的LCA posting的方式,大家是如何make a record of the posting period
的?
Optional One: Posting of the Hard Copy Labor Condition Application
Please make two extra photocopies of the attached Labor Condition
Application form certified by DOL. The Labor Condition Application must be
placed in two (2) conspicuous locations at the place(s) of employment (i.e.
place(s) where the beneficiary will be working). The appropriate locations
for the postings include where wage and hour or occupational safety and
he... 阅读全帖 |
|