由买买提看人间百态

topics

全部话题 - 话题: increment
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
n**x
发帖数: 606
1
按照老魏的算法,详见:
http://www.mitbbs.com/article_t0/Programming/31312727.html
我做了如下测试:
- 纯计算.
- 12 core xeon
- 200 concurrent threads(大家都说200个太浪费,我当然没坐过此类应用, 不过我
测了12,24,50,100,结果都差不多,没提高多少)
- one big array: long[20000]
- every thread handles 50,000 interlocked.increment (get random item from
the array and do increment)
- total number of interlocked.increment = 1千万 (10M)
average time spent: 0.2 second.
也就是每秒50M.
L*******e
发帖数: 114
2
I was asked this question during on-site. My answer was pre-increment
because of temp var used in post-increment. However, rethink the question,
there is no definite yes or no answer.
Another similar question is "does inline make program faster?" I was asked
too (just different interviewer)
r****o
发帖数: 1950
3
经常看到increment作动词的用法,但查字典都说是名词。
请问如果increment/decrement可以作动词的话,与increase/decrease有何区别?
f**********w
发帖数: 93
4
来自主题: Programming版 - post increment
from the twiki "An often-cited example is the expression i=i++, which both
assigns i to itself and increments i. The final value of i is ambiguous,
because, depending on the language semantics, the increment may occur before
, after or interleaved with the assignment. The definition of a particular
language might specify one of the possible behaviors or simply say the
behavior is undefined. In C and C++, evaluating such an expression yields
undefined behavior."
Is this true? i=i++ should be expa... 阅读全帖
q*c
发帖数: 9453
5
而且你不能单纯 increment. 每次increment 后还要 compare, 超过了上限要
rollback. 这些都只算一个 transaction.
而且因为有人不断退票, 所以每次都得 compare.
q**j
发帖数: 10612
6
打算用seq.Date来increment 一个data frame的一列日期。但是seq.Date一次只能
increment一个日期。apply函数不能用date类型的input。很为难。请问高手有没有好
办法。多谢了。
s*****n
发帖数: 2174
7
就用seq.Date就可以啊, 为什么不行?
顶多就是稍微做个简单的wrapper而已.
date.increment <- function(date.list, by){
num.days <- unlist(lapply(1:length(date.list),
function(i) seq.Date(from = as.Date(date.list[i]), by = by, length =
2)[2]))
return(as.Date(num.days, origin = "1970-01-01"))
}
date.increment(c("2010-10-01", "2010-10-10"), by = "1 month")
m******0
发帖数: 178
8
来自主题: Faculty版 - NSF funding increment的问题
今年的grant马上到期,funding increment还没下来, annual report两个月前就
approve了。问了PM, 说有可能是有啥overdue report,可是完全没有。大家有没有遇
到这种情况?找谁?怎么处理?多谢!
M**a
发帖数: 848
9
如题。
basic salary $xxx per year (paid in 26 bi-monthly increments).
M**a
发帖数: 848
10
不是啊。。paid in 26 bi-monthly increment???
M**a
发帖数: 848
11
那increment什么意思啊。
就是这次工资3000.
每次发工资涨一点。
年底最后一次工资慢慢涨到4000??
然后总数不变。
l********y
发帖数: 1327
12
来自主题: Fitness版 - HST 小数值increment咋搞?
下了个application叫hst calculator,按照5%的increment计算出来的
r*z
发帖数: 1679
x*s
发帖数: 67
14
"increment" and "decrement" are commonly used in software documentation,
computer science literature and programs as verbs. Such use is also common
in conversations among system/software engineers and programmers. It's not
grammatically correct but widely accepted in computer-related fields. Just
remember not to use them as verbs in other fields or when talking to non-
techies.
D*****r
发帖数: 183
15
急用,或者别的SVM incremental regression
包也行。谢谢
r**e
发帖数: 57
16
来自主题: Database版 - My SQL question: auto increment
有没有什么方法可以让auto increment datatype 前面有个
string seed, 比如:abc1, abc2, .... abc100?
Thanks a lot.
g*****g
发帖数: 34805
17
increment是不行的,你最少也要做InterlockedCompareExchange吧。
另外,网络来的请求,serialization, deserialization都是需要cpu的。
n**x
发帖数: 606
18
就是起100个thread,每个队一个大数字做interlocked.increment。很简单。代码我正
在升级为增强版,看看能不能模拟真实情况。
q******n
发帖数: 1
19
来自主题: Actuary版 - Salary increment
About 2~3 year of experience in industry.
What would be the average salary increment if I move to another company?
D*****r
发帖数: 183
20
【 以下文字转载自 CompSci 讨论区 】
【 原文由 Dreaner 所发表 】
急用,或者别的SVM incremental regression
包也行。谢谢
m******i
发帖数: 834
21
Regulating nanotechnology - incremental approach or new regulatory framework?
nanoquebec 发表于: 2007-6-06 09:17 来源: 纳米科技世界
In 2005, the Project on Emerging Nanotechnologies released a report by Dr. J
. Clarence Davies ( [点击图片可在新窗口打开] [点击图片可在新窗口打开]
Managing the effects of nanotechnology; pdf download, 1 MB) that found that
U.S. legislation was inadequate. Davies concluded that nanotechnology is
difficult to address using existing regulations and a new regulatory
framework was needed in order to tak
c*****m
发帖数: 4817
22
what do you mean "increment 一个data frame的一列日期"?
>a
[1] "2009-05-15" "2009-05-17" "2009-05-19" "2009-05-22" "2009-05-24"
[6] "2009-05-26" "2009-05-28" "2009-05-30" "2009-06-01" "2009-06-03"
> a + 1
[1] "2009-05-16" "2009-05-18" "2009-05-20" "2009-05-23" "2009-05-25"
[6] "2009-05-27" "2009-05-29" "2009-05-31" "2009-06-02" "2009-06-04"
q**j
发帖数: 10612
23
你这个是一天。我想要整齐地increment一个月。input和output是同一天。
l**********n
发帖数: 8443
24
来自主题: Programming版 - scala最烦人的是build太不容易了
Somebody has idea on the following error:
Information:Compilation completed with 1 error and 8 warnings in 2 sec
Information:1 error
Information:8 warnings
Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.
ServerException
Error compiling sbt component 'compiler-interface-2.9.1.final-52.0'
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$
apply$2.apply(AnalyzingCompiler.scala:145)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$
appl... 阅读全帖
z****l
发帖数: 5282
25
☆─────────────────────────────────────☆
memajia (人生何处不相逢) 于 h 提到:
下面就是我拥有且推荐的适合长期持有的卡,它们还有一个共同特点:都是没年费的。我现在还消费不到能validify那个年费的程度。很多名字大家都听烂了,我其实就是穿线,重新包装一下:
1. 通用型(general):
1.1. 无敌神卡——Fidelity Amex(2% on everything):
http://personal.fidelity.com/products/checking/content/amex_rew
点评:优点不用说了,缺点是有些地方不收AMEX,only redeemable in $50 increments. 另某些老手有schwab visa,可惜那已经不能申了,没什么谈的价值。另外,肯定很多新手会焦急的问:什么?!还要开个brokerage account? 我不玩股票!还要"????" dollar的minimum deposi
只说一句,我开了那个fidelity investment account半年多... 阅读全帖
f**d
发帖数: 768
26
来自主题: Neuroscience版 - eBook: From computer to brain
这是一本计算神经科学的优秀著作,全文拷贝这里(图和公式缺),有兴趣的同学可以
阅读
如需要,我可以分享PDF文件(--仅供个人学习,无商业用途)
From Computer to Brain
William W. Lytton
From Computer to Brain
Foundations of Computational Neuroscience
Springer
William W. Lytton, M.D.
Associate Professor, State University of New York, Downstato, Brooklyn, NY
Visiting Associate Professor, University of Wisconsin, Madison
Visiting Associate Professor, Polytechnic University, Brooklyn, NY
Staff Neurologist., Kings County Hospital, Brooklyn, NY
In From Computer to Brain: ... 阅读全帖
Q***5
发帖数: 994
27
来自主题: Mathematics版 - 密率与无穷项等差数列
You can construct such a sequence so that the density is close to 1, but the
increments are either 1 or 2.
For example:
Start from x1= 1
The first 101 increments are all 1: 2,..., 102
Followed by 1 2-increments: 104 (all even)
Then, 1001 1-increments, 105,... 1105
followed by 2 2-increments: 1107, 1109 (all odd)
Then 10001 1-increments
followed by 3 2-increments: (all even)
Then 100001 1-increments
followed by 4 2-increments (all odd)
....
The idea is to make the 2-increment blocks to be
f*******n
发帖数: 12623
28
来自主题: Programming版 - 请问C++返回值和返回引用区别
operator++() is for pre-increment (++x)
operator++(int) is for post-increment (x++)
Because both pre and post are unary operators, there is no way to tell them
apart, so C++ made a special case, and post-increment / post-decrement take
an additional int parameter.
Pre-increment returns a reference, because a pre-increment expression is an
lvalue (you can assign to it or take the address of it, etc.). Post-
increment returns a copy, because a post-increment expression is a rvalue.

呢?
u*********r
发帖数: 1181
29
来自主题: Investment版 - 关于 401K 的选项
公司的fidelity 里面有这几个选项,请问 那些是受18000 限制哪些是 受54000限制。
谢谢,想confirm一下。
Contribution Amount
EMPLOYEE PRE-TAX
Current Election 16.00 %
Desired Election %
(1.00% to 50.00% in increments of 0.50%)
EMPLOYEE ROTH
Current Election 0.00 %
Desired Election %
(1.00% to 50.00% in increments of 0.50%)
EMPLOYEE AFTER-TAX
Current Election 0.00 %
Desired Election %
(1.00% to 25.00% in increments of 0.50%)
Other Contributions
EMPLOYEE PRE-TAX-BONUS
Current Election 30.00 %
Desired Elect... 阅读全帖
h******8
发帖数: 55
30
来自主题: JobHunting版 - 贡献两道google面试题
my solution:
Since you need to return the counts of clicks in the past minute at any time
, the idea of resetting the counter every minute won’t work here.
It is easy to see that this is an event-driven model. Basically we have two
kinds of events here. Once a web click happens at time t, we need to
increment the counter. At time t+1, the event expires, and we need to
decrement the counter. The value of the counter is a stair-case function,
with discontinuous being the events.
Basically we need ... 阅读全帖
r****l
发帖数: 32
31
this is a coding question for senior java developer. If you can do it,
send answer to my mitbbs mailbox. i will fit in you an interview.
Online Auction Coding Sample Instructions
Implement a solution to the following problem using the latest released
version of Java. Your project should include unit tests using the open
source JUnit framework. The program should be an object-oriented API and
should not include a user interface of any kind. There is no need to
provide any form of data persistence... 阅读全帖
d********w
发帖数: 363
32
来自主题: JobHunting版 - [a9面经] print x,y,z
嗯,我写个2层循环的,你写个递归的吧;)
set> sol(float increment)
{
if (increment <=0 )
return null;

int res = (int)(1/increment);
if (abs(res * increment -1 ) > 0.000001)
return null;

set> triplets;
vector triplet(3);
for (int i =0; i <= 1; i+= increment) {
int total_left = 1 - i;
triplet[0] = i;
for (int j=0; j<=total_left; j+=increment) {
triplet[1] = j;
triplet[2] = tot... 阅读全帖
l*********y
发帖数: 142
33
来自主题: JobHunting版 - 攒人品之facebook电面面经
#include
#include
#include
#include
#include
#include
#include
using namespace std;
class Counter {
public :
Counter() {
counter = 0;
}
void increment() {
counter++;
}
void decrement() {
counter --;
}
int getValue() {
return counter;
}
private:
int counter;
};
class COWString {
public:
COWString() {
pointer = NULL;
rc = new Counter();
}... 阅读全帖
q****e
发帖数: 410
34
2018年初,在网上和微信有一篇“北大飞”同学写的文章流传,题目是《川普政府反移
民再出狠招,大刀向H-1B们的头上砍去》。我作为北大校友,目前在美国做移民律师,
读了“北大飞”的文章以后,发现里面有若干错误。几天后,又看到“北大飞”同学自
己在后续文章中提到,他的这篇文章“引起了广泛重视,其阅读量超过10万”。更严重
的是,他在题为《对川普政府取消H-1B签证延期的深度解读,前景不容乐观》的后续文
章里面对于当前生效的美国法律(具体来说是关于H-1B延期的条款)做出了错误解读,
可能会误导很多人。因此,我认为有必要澄清“北大飞”这两篇文章中的错误,包括似
是而非和不完整不明确的地方。
先说最重要的,也是大家关心的,对于AC21法律里面的Section 106(a),(b)的解读。
“AC21”,即“American Competitiveness in the Twenty-first Century Act of
2000”,是美国第106届国会在2000年10月17日通过的法律,对美国移民法(Immigration
and Nationality Act)的一些条款做出了修改。具... 阅读全帖
f**s
发帖数: 968
35
来自主题: PhotoGear版 - 5D3 参数
Specifications
Type
Digital, AF/AE single-lens reflex, camera
Recording Media
CF Cards (Type I); Compatible with UDMA CF cards; SD, SDHC, and SDXC Memory
Cards
Image Format
Approx. 36 mm x 24mm (35mm Full-frame)
Compatible Lenses
Canon EF Lenses (excluding EF-S Lenses)
Lens Mount
Canon EF mount
Image Sensor
Type
High-sensitivity, high-resolution, large single-plate CMOS sensor
Pixels
Effective pixels: Approx. 22.3 megapixels
Total Pixels
Total pixels: 23.4 megapixels
Aspect Ratio
3:2 (Horizontal... 阅读全帖
z****e
发帖数: 2024
36
来自主题: Programming版 - 一个multithreading 问题
class Count {
enum { SZ = 100 };
int n[SZ];
public:
void increment() {
for(int i = 0; i < SZ; i++)
n[i]++;
}
};
class Incrementer : public Runnable {
Count* count;
public:
Incrementer(Count* c) : count(c) {}
void run() {
for(int n = 100; n > 0; n--) {
Thread::sleep(250);
count->increment();
}
}
};
int main() {
Count count;
Thread t0(new Incrementer(&count));
Thread t1(new Incrementer(&count));
}
以上代码产生
segmentation fault!
我不是很懂,据说是count被销毁了
k***t
发帖数: 276
37
写个Least Recently Used Cache的Class好像是几家公司常见题。
有没有面试可用的精简一些的Sample Code?
或哪个大拿给写一个范本。谢了。
还有,copy-on-write的string class。
我这里贡献一个smart pointer class。Code来自http://www.codeproject.com/KB/cpp/SmartPointers.aspx
class RC
{
private:
int count; // Reference count
public:
void AddRef()
{
// Increment the reference count
count++;
}
int Release()
{
// Decrement the reference count and
// return the reference count.
return --count;
... 阅读全帖
d********w
发帖数: 363
38
来自主题: JobHunting版 - [a9面经] print x,y,z
扩展到n个数,
set> sol(float increment, int dim) {
set> triplets;
sol(1, increment, dim, new vector(), triplets);
return triplets;
}
void sol(float total, float increment, int dim, vector triplet, set<
vector> triplets) {
if (dim == 0) {
triplets.insert(triplet);
return ;
}
for (int i =0; i <= total; i+= increment) {
triplet.append(i);
sol(total - i, increment, dim -1, triplet, triplets);
... 阅读全帖
z****p
发帖数: 18
39
来自主题: JobHunting版 - 贡献一个G家电面

c
1. assuming the list is very very long (almost infinite)
2. when a new call to "increment", we look at the last digit:
--if the last digit is between 0 and 8 (with prob 9/10), we are done with 1
operation (change of the last digit)
--if the last digit is 9, we change it to 0, which takes one operation, and
then recursively call "increment" on the prefix (the sublist with the last
digit removed).
--since the prefix is very very long, incrementing it has the same
complexity as incrementing the ... 阅读全帖
b*****r
发帖数: 2065
40
来自主题: Stock版 - 高盛FOMC前的市场观点
https://360.gs.com/research/portal/research/econcommentary/?action=viewpage&
st=1&d=16792280&isRouted=true
Goldman Sachs Research
Global Markets Daily: Market views muted ahead of the FOMC
Published 05:12 AM Wed Mar 19 2014
----------------------------------------------------------------------------
----
•The FOMC is now meeting for the first time with Janet Yellen as Chair.
•Our US team expects the FOMC to deliver an accommodative message...
•…alongside a continued tapering o... 阅读全帖
m****0
发帖数: 30
41
来自主题: CS版 - ++ a faster or a++ faster in C?
Totally wrong!
This is c and c++ -- high level programming language.
In fact, for some programming language, there is no difference between pre-
increment and post-increment. However, in c++, when you learn operator
overloading, you will see the difference.
A typical implementation of post-increment is like this:
SomeType SomeType::operator++(int)
{
SomeType temp(*this); // save current object
operator++(); // increment internal state using pre-increment
return temp; /
x**8
发帖数: 4844
42
就说这个goto吧,公司很多假高手到处吹goto不能用,那是newbie的错误用法。看看
linux kernel的code, gcc的code里有多少goto, 大把大把地用。
还有就是这个pre-increment和post-increment, 在速度上是会有差别的,虽然现在gcc
优化很厉害,在加上各种语言里针对pre-increment的特殊优化,以及现代Desktop机的
巨大cache,有时pre-increment甚至会比post-increment更快。但是,C作为一种语言不
是只为某种architecture服务的,在不同情况下(尤其是嵌入系统中)区别很大的。

exception
F******n
发帖数: 160
43
In that case, it is not a trivial problem, but it could be done by applying
the incremental SVD algorithm.
This efficient/adaptive algorithm was originally given by a guy (Matthew)
from Mitsubishi research lab. You can easily google that paper.
The main point relevant to the LS regression:
b = (X'X)^(-1) (X'y) (1)
is that, matrix inversion (X'X)^(-1) is essentially an SVD problem. As your
new data come in, you should sort of have an updated X and y, and
consequently an updated X'X. In abov... 阅读全帖
e******x
发帖数: 184
44
1. An integer stored in a list, 245 -> [245]. Do increament: Increment([2, 4
, 5]) = [2, 4 6]
2. Also do an increment for a list, but this time increment means give the
next permutation of the list. Like Increment([2, 4, 5]) = [2, 5, 4]. You
need to traverse all the permutations but you can decide the order.
3. give you a string and a list, e.g. zxasbascasbsdafa & [a,b,c]. Find the
shortest substring containing all the elements in the list.
要不是之前记下来了,肯定忘了现在。。
c********r
发帖数: 649
45
来自主题: EB23版 - AGREE Act
http://hotair.com/archives/2011/11/17/rubio-coons-agree-act-oba
Rubio-Coons AGREE Act: Obama’s nightmare?
posted at 10:25 am on November 17, 2011 by Ed Morrissey
On its face, the bill crafted by Senators Marco Rubio (R-FL) and Chris Coons
(D-DE) looks modest enough. The aptly-named AGREE (American Growth,
Recovery, Empowerment, and Entrepreneurship) Act takes parts of job-growth
proposals from both sides of the aisle with wide bipartisan support and
rolls them into one proposal. The two elimin... 阅读全帖
n*********2
发帖数: 357
46
Most people are NOT Chomsky. There is only one Chomsky in the world and
anybody else who claims Chomsky is simply false.
HCI indeed has a point. Most CS people are doing minor/incremental
improvements. Doing minor/incremental improvements in practice-oriented
systems & programming languages is very likely more meaningful than doing
minor/incremental improvement in theory.
The real questions is how to do meaningful minor/incremental improvements in
system and programming language. That is the rea... 阅读全帖
n*********2
发帖数: 357
47
Most people are NOT Chomsky. There is only one Chomsky in the world and
anybody else who claims Chomsky is simply false.
HCI indeed has a point. Most CS people are doing minor/incremental
improvements. Doing minor/incremental improvements in practice-oriented
systems & programming languages is very likely more meaningful than doing
minor/incremental improvement in theory.
The real questions is how to do meaningful minor/incremental improvements in
system and programming language. That is the rea... 阅读全帖
c*****m
发帖数: 1160
48
是一个5年旧的C++项目,一年前被移到VC2010里面,在Debug模式下很正常,所以现在
release 出去都是debug版本。
但是选择到Release下面编译就出错,出错的信息是:
Error 1 error LNK2019: unresolved external symbol __strdate_s
referenced in function "int __cdecl _strdate_s<32>(char (&)[32])" (??$_
strdate_s@$0CA@@@YAHAAY0CA@D@Z) C:\src\DebugLog.obj Perf
等500个类似错误。
出错信息所指的是 _strdate_、_strtime_s、strcat_s、sprintf_s等链接失败。这些
都是标准库函数啊,有include time.ht, string等,编译都已经通过了的。
我已经比较了在Debu状态下和Release状态下的link的参数:
Debug下:
/OUT:"C:\src\Debug \Perf.dll" /INCREMENTAL ... 阅读全帖
k**********g
发帖数: 989
49
来自主题: Programming版 - 看了一下C#的async await

In the past, multicore programming focuses on fully utilizing CPU. This can
be seen in the High-Performance Computing (HPC) benchmark rankings.
This approach neglects an issue that is ubiquitous: Most "processes" (
including computations, communications, and I/O) do not generate (yield) a
block of "result" of size N at once. Instead, almost all real-world
processes yield results incrementally.
To visualize, one can imagine this at a microscopic timing level:
After spending 500 microseconds of i... 阅读全帖
p****s
发帖数: 293
50
请大家帮忙看看这段话是什么意思?
Company has a 500000 line of credit secured by inventory and account
receivable. Takedowns must be in increments of 50000. Interest is 12% per
annum and is payable on the 1st day of the month following. Assume all
takedowns occur on the 15th day of the month. Repayments must also occur in
50000 increments on the 15th day of the month.
“Takedowns must be in increments of 50000.”“Repayments must also occur in
50000 increments on the 15th day of the month.这两句话什么意思?是每个月都
必须偿还50000吗?
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)