由买买提看人间百态

topics

全部话题 - 话题: realloc
1 2 3 4 5 下页 末页 (共5页)
r*********n
发帖数: 4553
1
S.M.A.R.T里面Reallocated Sector Count的数值已经有200多,超过treshold好多,在
hdtunepro里面这一项数值后面有个感叹号(但是还是没有坏道),但是在everest里面
却显示Value is normal,这是不是意味着硬盘就要挂了?
最近硬盘有时候会停止响应,导致系统死机,重启系统以后主板根本就识别不了硬盘,
就好像没有安装硬盘,直接跳过硬盘寻找其他驱动。但是非常诡异的是,过一段时间,
比如一天,然后硬盘又好了,又可以进系统了。是不是因为硬盘自动恢复了。
Google一下,貌似大多数人说已经无救了,但是有些人又说低级格式化有可以把
Reallocated Sector Count的数值重置为零。
s*****k
发帖数: 604
2
来自主题: Programming版 - 不用STL, C++里怎么realloc?
比如一个object array, 要再加长点,
C里面用realloc,但是realloc不调用构造函数
p****x
发帖数: 4260
3
☆─────────────────────────────────────☆
nebula (二话不说ben一个先) 于 (Mon Mar 10 13:55:02 2008) 提到:
google一把,还是有点糊涂
reallocate好像是在不同信用卡之间转credit limit,转后信用卡都不关
conslidate好像是把不同信用卡整合成一张,所以最后只剩一张,其他都关掉了
upgrade 和 convert 好像是一张卡换成另一张卡
不知道对不对,有没有行家出来科普一下?谢谢
☆─────────────────────────────────────☆
nebula (二话不说ben一个先) 于 (Mon Mar 10 19:01:08 2008) 提到:
没人感兴趣吗?自己顶一下

☆─────────────────────────────────────☆
phynix (饱乐) 于 (Mon Mar 10 19:25:13 2008) 提到:
u can say it again.
☆─────────────────────────
j****t
发帖数: 2996
4
chase后来又可以reallocation,能不成CITI坏账太多,怕了?
r*********n
发帖数: 4553
5
其实麻烦的是,虽然在保修期内,但是拿去给别人检查,又可以用,害怕不给换新的..
......到底能不能用reallocated sector count作为硬件损坏的凭证呢?
E***e
发帖数: 3430
6
之前intel的也出来两个reallocation
但是一直也就两个了没再变
c*****t
发帖数: 1879
7
来自主题: Programming版 - 不用STL, C++里怎么realloc?
Can't use realloc, because if resizing isn't successful, the old
memory would be freed before you have any chances calling dtors.
So, you will just have to use malloc/new to create a new memory
space, and then call placement new with copy constructor on each
and individual array element.
You can read std::vector code yourself to see how that gets
implemented.
a****l
发帖数: 8211
8
来自主题: Programming版 - 不用STL, C++里怎么realloc?
the idea of realloc is against the physical design of digital computers, so
it is something you should avoid using in the first place.
i**********r
发帖数: 36
9
来自主题: Unix版 - [转载] help about C: realloc
【 以下文字转载自 Linux 讨论区 】
【 原文由 interstellar 所发表 】
does anyone know of reported bugs of the C function realloc in linux?
when i use this function, it works for the first few data sets,
then the program reports - segmentation error - and crashes.
I ran into such situations several times. And every time, i did tell
the program to free the memory. i have to use a tmp array to first remember
the old dynamic array, then malloc a new size and copy back the old values.
this is kind of stupid, are there any
s**g
发帖数: 709
10
EB3C的律师说决定very weakly reasoned。 我们正在讨论下一步的策略, 是否在60天
内上诉。先向大家通报一下,大家有意见和建议,请发电邮至:e********[email protected]
I. INTRODUCTION
This matter comes before the court on Defendants’ motion to dismiss (Dkt. #
23).The court has considered the parties’ briefing and supporting evidence
, and has heard from the parties at oral argument. For the reasons explained
below, the court GRANTS the motion (Dkt. # 23).
II. BACKGROUND
Plaintiffs are individuals from China who are seeking to acquire permanent
resident status ... 阅读全帖
g****g
发帖数: 1828
11
来自主题: WaterWorld版 - vector
SGI Logo
vector

Category: containers Component type: type
Description
A vector is a Sequence that supports random access to elements, constant
time insertion and removal of elements at the end, and linear time insertion
and removal of elements at the beginning or in the middle. The number of
elements in a vector may vary dynamically; memory management is automatic.
Vector is the simplest of the STL container classes, and in many cases the
most efficient.
Example
vector V;
... 阅读全帖
c*****n
发帖数: 96
12
来自主题: JobHunting版 - fb面试题【转】
char* readLine(){
static char[BUFSIZE] buf;
static char* ptr = buf;
static int bufSize = 0;
int outputSize = 0;
char *output = NULL;

while (1){
int pos = getNewLinePos(ptr, bufSize);
if (pos > 0){
// found new line char in the buffer
output = realloc(output, outputSize+pos+1); // one extra char for '
\0'
// TODO: check realloc return value
memcpy (output + outputSize, ptr, pos);
output[outputSize + pos] = '\0';
... 阅读全帖
h*****g
发帖数: 312
13
来自主题: JobHunting版 - fb面试题【转】
多谢你的解答 觉得 //1 处的outputSize 应该时刻更新吧?
char* readLine(){
static char[BUFSIZE] buf;
static char* ptr = buf;
static int bufSize = 0;
int outputSize = 0;
char *output = NULL;

while (1){
int pos = getNewLinePos(ptr, bufSize);
if (pos > 0){
// found new line char in the buffer
output = realloc(output, outputSize+pos+1); // one extra char for '
\0'
// TODO: check realloc return value
memcpy (output + outputSize, ptr, pos);
outpu... 阅读全帖
l*******e
发帖数: 3584
14
有这么多的警告,看来还是要小心一些。

查了一下相关解释,记在这吧,这块盘的错误还是很严重的,不能正常用了。
一般同一型号的硬盘SMART个数是相同的,但是同一硬盘厂不同时期出的硬盘SMART个数
是不同的。
虽然关键属性因品牌不同有差别,但有一项属性是所有品牌都有的。这就是05项
Reallocated Sectors Count,它的作用是记录重映射扇区个数。硬盘都具备一定的修
复功能,当出现不稳定的扇区,硬盘Firmware里的程序会把不稳定扇区的数据转移到同
样容量的备用扇区里面,并屏蔽掉不稳定扇区,实现坏道替换。这种硬盘底层的操作在
操作系统里不留痕 迹,他会在S.M.A.R.T属性的05项做下记录。05项的当前值显示备用
扇区的多少。新盘出厂时,备用扇区最多,随着使用中坏扇区的出现,备用扇区的减少
,当前值逐渐降低, 各品牌的硬盘备用扇区数量是不同的, 05项阈值(THRESHOLD)
控制上也不一样。希捷硬 盘的阈值是36,西数硬盘的阈值是140。
相对关键属性来说,资料属性的作用不是太大,但是也可以通过资料属性发现一些问题
,要注意关键属性重点看当前值,而资料属性重点在... 阅读全帖
W*****B
发帖数: 4796
15
The power game behind high school students
Taiwan high school students assembled in the legislative yuan to protest the
recent proposal made by Ministry of Education on 7/28. The proposal is to
revise course content over explanation of local history during WWII and the
transition period from Japanese occupation to the government of Republic of
China in 1945. In particularly, it mentioned the mass sexual crimes of
Japanese military drafting more than 2,000 Taiwanese women as sexual slaves
at that... 阅读全帖
d**z
发帖数: 3577
16
来自主题: Military版 - Important Hedge Fund Trends For 2016
Important Hedge Fund Trends For 2016 And Beyond
1. Reduction of expected returns for a diversified Hedge Fund portfolio.
Hedge fund performance is driven by a combination of alpha (manager skill)
and beta (market driven return). From 2009 to the beginning of last year, as
both the fixed income and equity markets experienced strong bull markets,
beta had been a tail wind for hedge fund performance that rewarded managers
with net long market exposure. Over this time period, investors’ return
exp... 阅读全帖
G**Y
发帖数: 33224
17
来自主题: Military版 - zz: Where do Rubio’s delegates go?
ANNE LI 10:28 PM
Where do Rubio’s delegates go?
Are they released and free to vote for whomever they choose? Nope, that
would be too easy. What happens to a departed candidate’s delegates depends
on the delegate’s state, and those details are fuzzy and complicated.
For example, Rubio’s seven now-released delegates from Kentucky must
convene in a meeting with bound delegates in which they will vote in a
secret ballot to reallocate Rubio’s delegates to another candidate. Some
states release delega... 阅读全帖
T**********e
发帖数: 29576
18
两党参议员对废除visa lottery没什么意见,但每年5w名额不能减, 转移到非洲和拉
美国家,这样CBC和主党议员就on board了。
The diversity visa lottery would be eliminated, and those 50,000 visas would
be reallocated. When President Trump started going after the “visa lottery
” after a failed terrorist attack in New York, it made a certain amount of
sense: Republicans had been railing for a while against the idea of handing
visas out by lottery instead of merit. Many Democrats are willing to give
that up if those visas are used for other things th... 阅读全帖
d*w
发帖数: 384
19
来自主题: Investment版 - Reinvest Capital Gain的疑惑
asset reallocation in taxable account involves tax. i miscalculated in 2013
and the reallocation resulted in a net loss that could last for a few years
or forever because of tax.

principle
l******w
发帖数: 36
20
来自主题: JobHunting版 - 如何合理申请空间
店面被问及,如果需要动态申请空间,应该有什么样的rule.
比如说,一次申请很大的buffer,很快,但是浪费空间。
如果每次申请很小,realloc 又会影响speed.
问该如果实用realloc.
z****u
发帖数: 104
21
字符串的 permutation 肯定是比较基础的题了,可是自己写了一下发现要 bug free
真心很难啊。调试了半天才 ok,而且程序看起来很臃肿,这要是在白板上铁定写不出
来啊
求大家指点一下该向哪个方向改进?
#include
#include
#include
char* insert(char* dst, int n, char c, int j)
{
/* Insert char c into string dst at location j */
n++;
dst = (char*) realloc(dst, sizeof(char) * n);
while(j < n)
{
char tmp = dst[j];
dst[j] = c;
c = tmp;
j++;
}
return dst;
}
char** permutation_recursive(char* s, int n, in... 阅读全帖
l*****a
发帖数: 14598
22
来自主题: JobHunting版 - what is the internal implementation of Deque
if so, how do u push_front and pop_front
Double ended queue
deque (usually pronounced like "deck") is an irregular acronym of double-
ended queue. Double-ended queues are a kind of sequence container. As such,
their elements are ordered following a strict linear sequence.
Deques may be implemented by specific libraries in different ways, but in
all cases they allow for the individual elements to be accessed through
random access iterators, with storage always handled automatically (
expanding an... 阅读全帖
s***e
发帖数: 403
23
来自主题: JobHunting版 - 问个STL的 list和 vector的问题
vector是有一个preallocation的,只要pushback在尾部不带来reallocation,速度非
常快。插入在中间要数据拷贝,可能还要realloc,非常慢。
C*****n
发帖数: 1049
24
Does this result in a hard credit pull?
No, it’s only a soft pull to reallocate your credit limit with American
Express. If your credit limit exceeds $25,000 before or after the
reallocation on any one card then you might be hit with a hard pull. There
are also reports of increased scrutiny/financial reviews on people with
limits higher than $25,000.
我前两个月才转过,没有hard pull。一个月只能转一次。
h****s
发帖数: 16779
25
以后做这种事之前先google:
移出的卡至少已经开了13个月
转入的卡至少已经开了60天
你都不满足,移不了。
http://www.doctorofcredit.com/how-to-reallocate-your-credit-lim
A credit card must have been opened for a minimum of 13 months before it’s
possible to transfer the credit limit from that card.
A credit card should be at least 60 days old to transfer to that card.
Upgrading/downgrading cards has no effect on the clocks mentioned above.
Credit limits cannot be transferred from business to consumer cards. It is
possible to transfer from consu... 阅读全帖
b***k
发帖数: 2829
26
来自主题: EB23版 - A very good text book style about VB
That's my question as well.
Here are some interesting points after reading this whole report:
P.12
The implications of this difference—whether the LPR is “arriving” or “
adjusting”—are
significant. Specifically, the Department of State’s National Visa Center
caseload of approved
pending petitions may understate the actual number of approved cases if
USCIS does not forward
“adjusting” LPR petitions to the National Visa Center in advance of
reaching the visa priority
date. As previously mentioned,... 阅读全帖
H******i
发帖数: 4704
27
Understanding Spillover
管他们说得对不对,总比傻等好。如果他们说得对,排期还能够继续前进。
http://us-non-immigrants.blogspot.com/2012/02/prediction-for-eb
Spill Across (SA): It is a horizontal reallocation of visas within a
category. (Unused number from EB2 ROW will be allotted to EB2 -India and
China)
Fall Down (FD) : It is the vertical reallocation of visas between categories
(eg: unused numbers from eb1 go to eb2....) Unused visa numbers in a higher
preference level can "fall-down" to lower preference categories. For
example... 阅读全帖
o********0
发帖数: 2145
28
来自主题: EB23版 - 移民改革对EB2的影响
对Recap的合法性考察
Is it legal? The government already reallocates some visas when they don't
get used — for example, if fewer children of US citizens apply than there
are visas available, the rest of the visas will go to close relatives of
green-card holders. But some experts maintain there's no provision in the
law to take unused employment visas in the past, and reallocate them to the
future instead. The last time that high-skilled visas and green cards from
previous years were recaptured and used ... 阅读全帖
z****d
发帖数: 1761
29
来自主题: EB23版 - 关注一下EO的最新进展
05/01/2015: Seventy-Nine (79) Members of the House Asked the President to
Recapture Past Unused Immigrant Visa Numbers Administratively Without Delays
On March 16, 2015, a large group of the members of the House of
Representatives sent a letter to the President that visa recapture is an
essential part of fixing the country's broken immigration system and we need
a progress toward the goal of recapturing and reallocating all previously
unused visas without legislation. They reminded the President... 阅读全帖
a********m
发帖数: 15480
30
来自主题: EB23版 - 什么情况,VB leak了?
看到这个一个消息:
http://immigrationvoice.org/forum/forum16-iv-agenda-and-legisla
05/01/2015: Seventy-Nine (79) Members of the House Asked the President to
Recapture Past Unused Immigrant Visa Numbers Administratively Without Delays
On March 16, 2015, a large group of the members of the House of
Representatives sent a letter to the President that visa recapture is an
essential part of fixing the country's broken immigration system and we need
a progress toward the goal of recapturing and reallocating al... 阅读全帖
N***M
发帖数: 4295
31
来自主题: WashingtonDC版 - 529的限制
懒了多时今天终于想起来给529plan rebalance/reallocate 一下
结果broker说IRS规定无论rebalance/exchange exisitng assets 还是reallocate 今
后的investment
一年只能一次
多了就要report tax
nnd, 还有这规定
为什么呀???
k****i
发帖数: 504
32
来自主题: Hardware版 - 硬盘是不是要挂了?
老是咔咔响,然后卡着不动了
hddscan看smart,好4个黄色感叹号
Num Attribute Name Value Worst Raw(hex) Threshold
005 Reallocation Sector Count 096 096 0000000000-0028 010
196 Reallocation Event Count 096 096 0000000000-0028 000
197 Current Pending Errors Count 089 089 0000000000-0067 000
198 Uncorrectable Errors Count 100 098 0000000000-0001 000
hdd是不是要挂了?
n*******0
发帖数: 2002
33
故事是这样的:大概2年前买了若干1t的wd黑盘,其中两块插在intel的芯片组主板上用
intel的raid控制器组了raid0.用了大概几个月之后,启动的时候在intel raid控制器
的post页面显示raid0 中的一块硬盘出现smart event(具体什么event没找到查看的办
法……)。进入系统后intel的 软件说raid0卷面临危险。重置过smart event 状态。
但是每次重置都会在几次重启之后重新说发生event 事件。
现在把那个被intel说有问题的硬盘的smart信息放上来,请大家帮忙看看,这个硬盘究
竟是哪个项目有了问题?
下面这个是用everest 打印出来的report,显示一切正常……
[ WDC WD2001FASS-00U0B0 (WD-WMAUR0170341) ]
ID Attribute Description Threshold Value Worst Data Status
01 Raw Read Error Rate 51 200 200 0 OK: Value is normal
... 阅读全帖
a*******t
发帖数: 1356
34
来自主题: Hardware版 - 硬盘有个bad sector,还能用不?
有一个Reallocated sector,已经用备用的补上了
这个情况看人品,总之是状况不好了,也许很快坏,也许能在撑一阵子
我有块硬盘3个reallocated,撑了一年多,不过非系统盘使用频率很低
及时备份数据吧...
E***e
发帖数: 3430
35
2.5的,还能卖两顿午饭没准
这盘从头到底就没有过reallocation count
只有一个pending reallocation count
随机填充以后pending也没了
低格了仍然没出来
我一直以为盘低格了以后还没坏道基本就是可以放心用了
不知道是不是误解
anyway决定继续用了,最差当备份盘
t****t
发帖数: 6806
36
来自主题: Programming版 - 关于inserter
for vector:
Reallocation invalidates all the references, pointers, and iterators
referring to the elements in the sequence. It is guaranteed that no
reallocation takes place during insertions that happen after a call
to reserve() until the time when an insertion would make the size of
the vector greater than the size specified in the most recent call
to reserve().
for deque:
An insert in the middle of the deque invalidates all the iterators
and references to
d****n
发帖数: 1637
37
来自主题: Programming版 - c字符串内存分配问题
malloc, calloc, realloc are in HEAP
alloca is in STACK
#####example####
buffered IO with char input
################
n=0;m=1024
char *s=(char *)calloc(m, sizeof(char));
char c;
while((c=getch())!=EOF){
if(n==m) s=(char *)realloc(s, (m<<=1),sizeof(char) );
*(s+(n++))=c;
}
*(s+n)='\0';
printf("%s\n", s);
free(s);
d****n
发帖数: 1637
38
来自主题: Programming版 - c的问题(2)
//use malloc with realloc
int size = 100;
int used =0;
float * array = malloc(sizeof(float)*);
for (int i=0;i<1000;i++){
if (i>=size){
size*=2
array = (float*)realloc(array,sizeof(float)*size);
}
array[used++] = float(i*100.);
}
free (array) ;
g*********r
发帖数: 543
39
来自主题: Military版 - 奥巴马表示坚决反对STEM法案
民主党一记大耳光扇过来。。。
WASHINGTON -- The Obama administration announced on Wednesday its opposition
to the latest House Republican effort on immigration: a bill that would
expand visas to certain holders of advanced degrees by eliminating another
visa program entirely.
The STEM Jobs Act, proposed by House Judiciary Chairman Lamar Smith (R-Texas
), is focused on the relatively uncontroversial idea that more highly-
skilled immigrants should be allowed to come to, or stay in, the U.S. It
would add 55,000 ... 阅读全帖
l*****h
发帖数: 709
40
There are six main systems of aqueducts and infrastructure that redistribute
and transport water in California: the State Water Project, the Central
Valley Project, several Colorado River delivery systems, the Los Angeles
Aqueduct, the Tuolumne River/Hetch Hetchy system, and the Mokelumne Aqueduct.
The State Water Project[edit]
See also: California State Water Project and California Aqueduct
An aerial view of the California Aqueduct at the Interstate 205 crossing
west of Tracy
The California Sta... 阅读全帖
a*******g
发帖数: 1221
41
电话面试,一个美国英语,另一个应该是明显的中国口音吧。
题目很简单,给一个字符串写出所有的permutation,我几分钟写出来了,就是一个简
单的递归搜索,总共不超过30行,我用c++写的。结果面试的老中没看懂,让我拿例子
讲一遍,我拿个简单的例子讲完了他还是看不懂。我当时蒙了,我说好,我再给你写一
个版本的,我就把一个终止条件展开写了,具体我忘了。大概就是把他不明白的地方重
写了一遍,结果他还是没看懂。我当时有点纳闷,不至于啊,我于是写了第三个版本,
用一个set保存所有已经搜索过的词,他终于看懂了。
然后最傻逼的事发生了,他大概好像说了你前两次都没写对,第三次写对了,具体我忘
了。草,当时我就火了,我说我前两次写的是因为你看不懂,你怎么能说是我写错了呢
?我前两次写的效率高,还简洁,是你看不懂。。。
然后就开始讨论效率,他说你这个效率低,你用一个vector x,x[i]的访问是O(n)。。
。我当时听到后不知道说什么,我顿了几秒,vector的random access是O(1)的啊,这
是我从小就知道的啊,难道真有我不知道的?不对啊,即使这个vector是dynamic
re... 阅读全帖
W*****B
发帖数: 4796
42
床铺螳臂当车,白人成为少民已是大势所趋。美国即使现在完全停止移民,白人最终也
将成为少民。只是时间早晚问题。
ANALYSIS
President Trump's proposal to cut legal immigration rates would
delay the date that white Americans become a minority of the population by&#
160;as few as one or as many as five additional years,
according to an analysis by The Washington Post.
The plan, released by the White House last month, would scale back a
program that allows people residing in the United States to sponsor family
members living abroad ... 阅读全帖
S*********e
发帖数: 4
43
你现在捶胸顿足痛心疾首有屁用啊?股市早就给你信号了,你不当一回事,贪婪害死人
不是。放宽心态顺其自然吧。
C****o
发帖数: 1549
44
因为当时没有破23000
S*********e
发帖数: 4
45
现在赶紧抛,也不算太晚
B*Q
发帖数: 25729
46
确实
大家快抛
快跑吧
[在 StockFuture (Option) 的大作中提到:]
:现在赶紧抛,也不算太晚
F*****t
发帖数: 3219
47
哈哈你嫌不够乱?
53么,还可以熬几年,
屎捂
捂屎
才是唯二出路。


: 现在赶紧抛,也不算太晚

D****y
发帖数: 462
48
The United States originally won bronze, but on 10 April 2008, following Ma
rion Jones's admission that she had used performance enhancing drugs, the e
ntire team was stripped of their medals. However, Jones's teammates appeale
d that decision by taking the case to the Court of Arbitration. On July 16,
2010, CAS ruled in the athletes favor and both American women relay squads
had their medals reallocated.
d*2
发帖数: 2053
49
http://nypost.com/2016/05/08/obamas-last-act-is-to-force-suburb
Obama’s last act is to force suburbs to be less white and less wealthy
President Barack Obama and Housing Secretary Julian Castro Photo: AP;
Gregory P. Mango
Hillary’s rumored running mate, Housing Secretary Julian Castro, is cooking
up a scheme to reallocate funding for Section 8 housing to punish suburbs
for being too white and too wealthy.
The scheme involves super-sizing vouchers to help urban poor afford higher
rents in pricey ... 阅读全帖
1 2 3 4 5 下页 末页 (共5页)