w*******n 发帖数: 2 | 1 I made two windows services by using c#.net and installed them in my local
machine. Later, I changed the path of bin folder. So, how to delete these two
windows services in the service management tool? I want to reinstall them.
Many thanks. |
|
b*g 发帖数: 644 | 2 You can specify an expiration date, using the
setMaxTime(int) method of
javax.servlet.http.Cookie. Specifying a expiration time of
zero will void
the cookie, and delete it from the browser.
// Expire the cookie immediately
cookie.setMaxTime( 0 );
// Send cookie back to the browser to void it
response.addCookie(cookie); |
|
st 发帖数: 1685 | 3 what do you mean? it's just a zip file.. delete what entry? |
|
F****n 发帖数: 3271 | 4 An entry is a file or folder in a zip file. Seems it is impossible to append,
modify or delete the content of a zip except create a new copy of the whole
file.
solution I |
|
F****n 发帖数: 3271 | 5
So why you can add / delete files using winzip?
append,
whole |
|
xt 发帖数: 17532 | 6
I
Try,
1) winzip, if you are deleting an entry without programming;
2) java.util.zip |
|
F****n 发帖数: 3271 | 7 You must be kidding, you mean if I have a 100mb zip file (it is usual in many
case) and I want to add or delete one file from it, I need to copy the whole
100mb content? That's ridiculous.
you... |
|
g*****g 发帖数: 34805 | 8 This is probably the best practice anyway, you know
delete one item at a time from an Array can be N times
slower than what you are doing here.
I
them |
|
N****w 发帖数: 21578 | 9 normally not
unless you set rm cmd to some safe deletion cmd with backup. |
|
p******f 发帖数: 162 | 10
no problem in these lines, possible reasons are:
1) memory corrupted, such as a buffer overflow or underflow;
2) delete are called more than once. |
|
x***n 发帖数: 39 | 11 I guess this is what perlgulf said as:
"2) delete are called more than once. " |
|
m***a 发帖数: 4 | 12 hey, thanks for pointing out that.
but anyone can explain this:
#include
class A
{
public:
static int i;
unsigned char * buf;
int j;
A(){i++; j = i; buf = new unsigned char[4*4096];cout<<"Construction:"<
endl;};
~A(){ delete [] buf;cout<<"Deconstruction:"<
};
int A::i;
main()
{
A a;
A aaa;
aaa = a;
A aaaa = a;
}
the output is
Construction:1
Construction:2
Deconstruction:1
Deconstruction:1
Deconstruction:1
Quite surpring! Why not prompt 'segmentation |
|
t****t 发帖数: 6806 | 13 deleting a pointer more than once is undefined, so it can be anything:
segmentation fault, or whatever |
|
R*******r 发帖数: 104 | 14 Your program will have memory leak, delete it inside loop.
. |
|
m******n 发帖数: 21 | 15 It won't work. Even if you define np outside the loop.
You have to do:
myobj * np;
for (int i = 1; i < nloop; ++i)
{
...
np = new myobj();
...
delete np;
}
or you could you smart pointer:
#include
for (int i = 1; i < nloop; ++i)
{
...
std::auto_ptr np(new myboj());
(use np just like plain poiters)
}
. |
|
c*r 发帖数: 278 | 16 Even you declare it as a globle or static, it doesn't matter.
new abd delete must match!
outside |
|
c********e 发帖数: 383 | 17 your idea itself is wrong.
A * a = new A;
no matter the contructor does delete this or not, the = operator will be
evalutated after. |
|
j****o 发帖数: 108 | 18 我有以下一段程序,编译没问题,但在运行时有错误,想请高手们帮忙看看。
const int totalnumber = 5;
const int num_f = 3;
double (*v)[totalnumber];
v = new double[num_f][totalnumber];
......
delete [] v;
请问是不是最后一行的问题?该怎么改正?多谢多谢!!! |
|
f*******y 发帖数: 988 | 19 所以delete p之后很多人喜欢立即p=NULL,防止误用 |
|
|
s*******d 发帖数: 59 | 21 设计时候就应该只使用一种delete方式。是否是有效指针,以及是new,还是new【】,
都应该由底层来自动分析。 |
|
S*********g 发帖数: 5298 | 22 what compiler do you use?
on g++, virtual or not, neither destructor nor delete is called. |
|
p****o 发帖数: 1340 | 23 for g++, if you comment out the dtor, the delete will be called.
i don't know why. |
|
w****g 发帖数: 4 | 24 从编译器产生的代码看,有dtor时, 检查是否为0,是0则马上返回。
没有dtor时,直接调operator delete()
不知道这样设计有什么依据 |
|
s*******t 发帖数: 2896 | 25 c++里,如果一个程序new了很多object而不delete,那么当程序正常结束以后,系统会
不会把申请的内存收回呢?还是这个程序运行若干次以后,操作系统因为内存耗尽而瘫
痪?
谢谢! |
|
n**d 发帖数: 9764 | 26 Is there any way to check if the allocated memory is deleted? In other words
, how could we check memory leaking? |
|
a*****t 发帖数: 30 | 27 多谢,呵呵。现在清楚了。
好像我们的版本是不一样,我的版本:
Item 10: Write operator delete if you write operator new.
Item 15: Have operator= return a reference to *this. |
|
h****8 发帖数: 599 | 28 delete实际上只是修改了memory pool里面的bookkeeping信息,比如修改了剩余空间开
始的地址 并没有对地址中的内容做任何变化 |
|
y******w 发帖数: 2220 | 29 delete只是一个逻辑删除吧。估计就像删文件一样,去掉索引项就行了,用不着把内容
去改写一遍的。 |
|
t****t 发帖数: 6806 | 30 delete is usually not implemented by OS. it's usually implemented by libc++.
freelist |
|
U********d 发帖数: 577 | 31 delete ->...-> free ->...RtlHeapXXXXX
管理堆的脏活是操作系统而不是什么libxxx干的。
+. |
|
c**********e 发帖数: 2007 | 32 struct X {
virtual ~X() {}
};
class Y : public X {};
int main()
{
X* p = new Y[2];
delete[] p;
return 0;
}
What, if anything, is an error with the sample code above?
a) A "class" cannot inherit from a "struct."
b) It invokes undefined behavior.
c) "Y" requires a destructor.
d) Nothing is wrong. |
|
c**********e 发帖数: 2007 | 33 thrust is right.
b) It invokes undefined behavior.
This is correct. When deleting an array, the dynamic and the static type of
the object must be the same, or the behavior is undefined (C++ Standard 5.3
.5/3). |
|
S**I 发帖数: 15689 | 34 1. should be delete [] a
2. nothing wrong |
|
c****p 发帖数: 6474 | 35 delete自动对NULL指针do nothing么? |
|
S**I 发帖数: 15689 | 36 standard 5.3.5: ...... if the value of the operand of delete is the null
pointer the operation has no effect. |
|
G****A 发帖数: 4160 | 37 这样做好像不太好。我理解是
DELETE <=equivalent=> call the destructor of the object, then FREE the
physical space.
Suppose an object contains some dynamically allocated data. It will be
problematic if you FREE this object without calling its destructor. |
|
c****p 发帖数: 6474 | 38 delete会调用class的dtor,free不会。
如果class有动态成员,用free是会杯具的 |
|
f******y 发帖数: 2971 | 39 Certainly they don't have to. Singleton pattern only has new, but no delete. |
|
M**u 发帖数: 10158 | 40 Anytime, it is undefined mixing new/delete malloc/free |
|
h********n 发帖数: 1671 | 41 你说的和他说的不是一回事。他说的是拿new和free配套。
delete. |
|
b*******s 发帖数: 5216 | 42 for (auto & ptr: arr) { delete ptr; } |
|
t*****n 发帖数: 4908 | 43 有两组new,一组delete,当然不行。没必要追求代码写的多好看。能work就行。 |
|
k****r 发帖数: 807 | 44 To DANIU men,
I am trying to study distributed key-value store. And have a question.
Like Dynamo and Voldemort, the data is append-only written, and the index is
caches. I understand the write and retrieve procedures. However, how to
deal with delete in these systems?
Thanks, |
|
g*****g 发帖数: 34805 | 45 Every row/column has a flag, you mark it as invalid, that's a delete. All
write operations will also invalidate and/or update the cache for given row.
rewrite
and
B |
|
t**********y 发帖数: 374 | 46 文件系统没有backup. 写代码的过程中delete了一些文件,现在想找回当初生成的确
file list. 主要是想回顾下整个过程的思路
有这个可能性吗?
谢谢了!! |
|