Least amount of clicks wins, saves coworkers nerves.
Posts made by fist_poster
-
RE: Anti-tutorial
@PJH said:
@tster said:
If C++ allows this then C++ is the most fucked language of all time.
It doesn't. That doesn't stoppeopleidiots trying to work around it though: http://www.codeproject.com/KB/cpp/returnoverload.aspxWhy is it so bad? I'd consider the following to wrap things like boost::lexical_cast (even though it is rather limited in what it can do) :)
#include <iostream>
#include <boost/lexical_cast.hpp>
class from_string
{
const std::string& s;
public:
from_string(const std::string& s): s(s) {}
template <class T>
operator T () const
{
return boost::lexical_cast<T>(s);
}
};
int main()
{
int i = from_string("21");
std::cout << i * 2 << '\n';
//std::cout << from_string("21") * 2 << '\n'; //may-be overload from_string for all operators as well???
}To make the commented-out line compile, may-be add all (binary) operator overloads, a la
template <class T>
T operator* (const from_string& fs, const T& t)
{
return static_cast<T>(fs) * t;
} -
RE: Mashup Challenge $100,000 prize - WTF if Spectate Swamp wins?
@CodeSimian said:
Either you are taking Spectate too seriously on the subject of artifacts, or that is a bad attempt at a joke. To clarify: imagining that video artificats are caused by aliens makes just as sense as supposing that the "banding effect" you might see in a dithered photograph of the blue sky is a miracle.
Ah. Good I didn't mention that the birds in SpectateSwamps seemed to be able to see the specks on my monitor. Probably just dust. Not aliens.
@CodeSimian said:
He like to provoke people and when genuine offers of help come his way, he completely ignores them.
This has been complained about more than a few dozen times, it seems. Were there really any genuine offers?
@CodeSimian said:
It is not just that he's an idiot. He's also obnoxious, offensive and relentless.
Ok, carry on then.
-
RE: Mashup Challenge $100,000 prize - WTF if Spectate Swamp wins?
@bstorer said:
Shouldn't be a problem. I'm actually focusing on something else at the moment. I hate to promise too much too soon, but how about SSDS ported to VB.net, with the full project files? And how about an (incredibly massive) deconstruction of the code itself: the way it works, what it does wrong, algorithmic analysis, etc.?
While I enjoy following SpectateSwamp's threads, aren't you taking it a bit too seriously. I mean it is easy to feel superior if you are comparing yourself to an idiot, but...
I also think you misunderstand SpectateSwamp's claims that birds can see video artefacts. Surely the artefacts as such only exist in the video, but where did they came from? Perhaps from some unnatural alien interference? If so, why shouldn't birds be able to detect the anomaly as well?
-
RE: Mashup Challenge $100,000 prize - WTF if Spectate Swamp wins?
Scrap SSDS
SpectateSwamp, here's what you should do:
a) give up your ambition of desktop searching - it's just no good
b) focus on UFO searching - you have some potential there.
Now, if your program would automatically analyse random videos, draw red circles around potential UFOs and wake you up with a loud beeping noise, then we'd have something to talk about.
-
RE: How note to use RSA by Nintendo...,
@Spectre said:
@Zecc said:
char metadata[32];
Ehmm... What?
char content_hash[20];[...]
char *cert_hash=SHA1(cert.metadata + cert.content_hash);
EDIT: oh, pointer math, never mind.
Pointer + pointer? Mind.
Pointer + pointer illegal in C?
-
RE: Mashup Challenge $100,000 prize - WTF if Spectate Swamp wins?
I admire your courage, Mr Swamp.
Clearly the aliens are all over your place for a reason.
I think they have come to get their STONES back.
Luckily for you, their vehicles have been too small this far to take the stones back to Beetlejuice...
-
RE: Best f**king censorship ever
@Sad Bug Killer said:
I disagree, this is the best censorship ever: Blugrbutt
I like the phrase: (rebreastled "Dueling Banjos").
Incidentally, dictionary says that "tit" also means a small European bird. Ornithologists better accept that they should call these birds "breasts".
-
RE: C++0x
The FAQ guy probably got the idea from this "confusing" thing:
X a;
and
X a();
The second one will be interpreted as a function prototype, the first one declares an object of type X using the default constructor. (This is something you have to know, but it should take making this mistake once and learning it forever.
However, for some reason he concludes from this that it will be even worse if there is something between the brackets. This doesn't make any sense, if there is something between the brackets, there will be no ambiguity.
From a brief look, the criticism looks rather incompetent. For example this pearl: "Here's a common "design pattern" in C++ code. You have a huge class..." following some criticism how this big class makes life hard. Doh!
-
RE: C++0x
@djork said:
@fist-poster said:
I fail to see, however, why you think it is necessary for one person to understand all the details of the language. You can be fairly proficient in it without ever touching things like template metaprogramming (which is something that already exists in C++, and not nothing that is going to be added just now).
You can be "fairly" proficient in Python by stuffing everything in Java-style class structures and never using a list comprehension, but you'd be an idiot if you did. Understanding the language means taking full advantage of the facilities it provides. Nearly all of the features of a language can be utilized in making more correct/fast/small/elegant code.
C++ makes it much impossible for one person to write the best code possible at any given time.
I'm not talking about libraries here. I'm talking only about syntax.
I feel you are comparing apples and oranges, though. List comprehension is part of the Python syntax (if I'm not mistaken), template metaprogramming is a specific coding technique (I'm not even sure if templates were designed in C++ with metaprogramming in mind in the first place, or was this technique discovered later). Enums as a syntax feature are not complicated, templates (although there are some obscure corners) - at least as far as the code example is concerned - ain't that hard either. The hard part is putting 1 and 1 together and realising you can force the compiler do something at compile-time this way.
I mean, you may know everything there is to know about the syntax of bitwise operators, and it may still not click that this way you could represent several boolean states in a single variable.
I'm also not sure whether you can even always achieve correctness, speed, smallness and elegance at the same time. But this probably also depends on what is considered elegant in one or another language. If I nest several list comprehensions and do stuff on a single line that would take a page in C++, would that be considered elegant by Python programmers?
-
RE: C++0x
@Jonathan Holland said:
C++ is already a horribly complex language, I took a look at the proposed features of C++0x last night, and I have to say, they are creating a language that no one will be able to fully understand.
...snip...I don't know how anyone will be able to master this language, the entire thing is just nuts.
I fail to see, however, why you think it is necessary for one person to understand all the details of the language. You can be fairly proficient in it without ever touching things like template metaprogramming (which is something that already exists in C++, and not nothing that is going to be added just now).
-
RE: Software "awards"
I don't see what's the problem of author of that article. His program was supposed to do nothing and it indeed did nothing - meeting the specs entirely. How's that not worth an award?
If I ever need a program that successfully does nothing, I'll remember to get that one.
-
RE: Why is Everybody so clueless on the importance of Desktop Search to the Masses?
SpectateSwamp and learning
Has anybody noticed that Swampy has stopped calling people things like "DerulaSwamp"? Maybe he actually listened when somebody said it was annoying.
I think you are underestimating his powers of learning. For example, at the beginning of this thread, he'd hit Enter at the end of each line, but he stopped doing that once it was pointed out to him how to use a text box.
If he continues learning at this rate, may-be he'll write a decent desktop search in about ... 800 years?
-
RE: Why is Everybody so clueless on the importance of Desktop Search to the Masses?
@spenk said:
@repeater said:
Spelling the name of his own project correctly might have also been a good place to start.
Good point, wonder how he will find it again if he doesn't know where to look to begin...He could use his search to locate URLs: each time you access an interesting web-site, append the url to a text file. Then SSDS won't have any trouble finding it and it can be easily modified (if it already doesn't support that) to paste the matches to clipboard. There is nothing you can't do with it if you have the flow-charts.
Remember that SSDS can locate a keyword by the beginning and the end of the word. You can search for "spec/swamp" and it will find "specatateswamp" as well as "spectateswamp".
By the way: how does your favourite desktop search application compare to SSDS in searching the Web!?
-
RE: Why is Everybody so clueless on the importance of Desktop Search to the Masses?
@insta said:
SpectateSwamp,
I have another challenge for you. The terms and conditions are very clear.
I will write an open source (public domain) flatfile search utility, in VB6. It will scan to the end of a 100,000,000 randomly filled byte file, of which the last 7 bytes have been replaced with "Swampy!". I would like to see SSDS do the same, with a separate (but functionally similar) 100,000,000 randomly filled byte file with the last 7 characters being "insta!!". If SSDS outperforms my search, I will personally show SSDS to five people at my work. If my search outperforms SSDS, then you will compete in the desktop showdown that Master Plan Software laid out earlier.
Either way, you are welcome to replace some of the file-scanning code with my own, as it will be public domain. If you are game, let me know and I'll begin coding.
I will go as far as mailing you a DVD of the exact data he wants you to search through, as I can understand dialup / some DSL is slow.
Since we already know the interesting thing is at the end of the file (and we know that all interesting and sensitive data is at the end of large files) where's the point?
-
RE: Why is Everybody so clueless on the importance of Desktop Search to the Masses?
@bstorer said:
@Benn said:
The main clue in all this is the code. Anybody still tying to explain basic concepts to this man who hasn't had a look at the source yet should do so now.
I've spent a little time skimming the code. Here's all you need to know about it:
line_12500: s1len = Len(SSS1) s2len = Len(SSS2) s3len = Len(SSS3) s4len = Len(SSS4) '23 june 2002 s5len = Len(SSS5) s6len = Len(SSS6)
Wait, does this explain this quote:
@SpectateSwamp said:
Why limit the search criteria to six? It was 3 at one time. That was just too few. I seldom seldon
need 6 search items. It works for me. Extend it if you like?(Quote brought to you by Google)
So 23rd of June, 2002 was the memorable day that SSDS became twice as powerful? And this dude hasn't even heard of arrays?
-
RE: Why is Everybody so clueless on the importance of Desktop Search to the Masses?
Threat to Google
Am I the only one who fears that the sheer size of this thread will bring down Google world-wide eventually? And we'll be left with nothing but SwampSearch?
Could this be what SwampSwampie is trying to achieve and we are all contributing unknowingly?
-
RE: Why is Everybody so clueless on the importance of Desktop Search to the Masses?
@SpectateSwamp said:
I have done no merging of my main 8 or 10 files. I just append notes and any emails I want to keep FOREVER.
Unfortunately the Masses are interested in [b]working[/b] with files, not accumulating data.
I work with Word documents every day. It would be impossible for me to append all the files that I'm working / have worked with (actually I break up documents that are larger than ~150 Kb because smaller documents are more convenient to work with). That would mean that each day it would take longer and longer to open the document and get started. And sadly I can't convert them to plain text, because formatting matters in this line of work. And when I need to search for something in [b]those[/b] documents (usually with the intent of changing things), I sadly often need the regex powers of the Word Find box (which SSDS probably lacks).
I guess I could make a plain text copy of everything, but what do you recommend for keeping this in sync with the originals that are edited constantly?
By the way, mr Seach Expert, could you tell us more about what the condemned indexing actually does behind the scenes (other than taking control over the data)? And do you know any other search algorithms other than linear search?
-
RE: Why is Everybody so clueless on the importance of Desktop Search to the Masses?
I must admit that I'm not a professional programmer, so I perhaps belong to the clueless masses. I must also admit that I mostly don't use any kind of desktop search. I have shortcuts to the master folders of the projects I'm currently working on (and those would be deleted after the project is comleted), and I can locate the rest using a fairly sensible folder hierarchy (both at work and at home) without knowing any particular keyword to look for at all.
But I gotto say that SSDS would be a perfect program if my computer usage patterns were the same as Mr Swamps. That is - if I had tons of short pointless videos that noone would bother to watch for more than 8 seconds and I kept all my email from 1997 (I guess SS is forced to keep them because "reindexing" after deleting a few messages would mean too much work). What sane person would watch random town council meetings for more than 8 seconds [i]unless there was some random [b]moose[/b] inbetween[/i]?!
-
RE: Injecting '\0' into STL strings
Try this:
string ok = string() + "This STL string should not be cut at this (" + string(4, 0) + ") point";
(The constructor means, create a string of four characters with value 0.)
Your problems probably start from misunderstanding C-style strings: cString is not a string containing one null-character. You can't put a null-character inside a C-style string because it marks the end of the char array. The std::string constructors see this array as a zero-length string.
Seems that std::string is a bit fragile as far as it has to cope with C-style strings. :(
-
RE: #pragma warning disabling...
I fail to see anything particularly clever in shutting the compiler up with ugly casts. The first version at least documents that the compiler found something warnable here but for the time being we are going to ignore it.
(OK, may-be the maintainers were indeed complete noobies but the proposed solution doesn't seem any better...)
-
RE: Another stunning interview answer
@Random832 said:
It’s commonly believed now that it was once commonly believed that the earth was flat. But, see http://en.wikipedia.org/wiki/Flat_Earth_mythology—and, if you don’t trust wikipedia itself, go look at the sources it cites.
However,
this article is concerned with Medieval notions in Europe (our
understanding of them). Before that belief that the Earth is flat
doesn't seem to be that rare:
[url]http://en.wikipedia.org/wiki/Flat_Earth[/url]Not sure what
is commonly understood under "common sense" (beliefs common to many
people?, common and practical understanding of things?), but in my
language there's a saying "healthy peasant's mind" and a healty peasant
might just consider the question irrelevant for everyday farming and
anyone who neglects the fields to ponder the Shape of the World
useless. -
RE: Another stunning interview answer
It's obvious if you see the mast of a ship in the distance slowly going downwards as it goes over the horizon.
Doh, the ship is slowly falling over the edge. (Slowly because there's nothing down there to pull it with much force.)
It's when they slowly rise from behind the horizon that I freak out.
-
RE: Rational agrument against Hungarian notation?
Yes, the article makes a good point.
Yet it made me think of a heretical scheme (which might work in C++, which the author is somwhat angry with). What if I made USString and SString separate classes? What if Request wrapper always returned a USString, RecordSet wrapper accepted both USString and SString and Write wrapper only accepted SString? Then it would be the compiler that would guarantee the correctness of the code (with or without Hungarian) and not just my eyeballs?
-
RE: C++: Another Spoiled Newbie
@PSWorx said:
There is also the theoretic possibility to use references as return values - if you desperately need things like foo(5) = 42;
But other than to confuse/baffle your coworkers, I don't see much practical reason for it either.
Damn it :)
Again, I find something like
std::string s = "hello";
s[0] = 'z';rather convenient and readable.
(I learnt to program in a BASIC where the above would be written as s$ = "z" + MID$(s$, 2) )
As
far as the "safety" of using references for function parameters goes, I
find that it is easier on my eyes and fingers and that it gives me less
chances to make stupid syntax errors (if nothing worse). If I'm unsure
whether a function might have side-effects, I have no problem looking
up the prototype.Of course I didn't mean that if the calling
code is full of nonsense, my tiny little function would magically fix
that as well. Hence the analogy of "friendly fire" seemed rather
non-sense where I thought I was suggesting to put the safety lock on if
you don't intend to shoot anybody... -
RE: C++: Another Spoiled Newbie
@asuffield said:
@fist-poster said:
And
even then, having a cleaner syntax (for example without a trace of
doubt whether the coder intended to dereference the pointer or not) is
a great improvement where applicable.I've already shown several examples where references make it harder to understand what is going on, because they hide the indirection. It's not cleaner, just different.
Ok, an example, swapping two values.
With references:
void swap(int& a, int& b)
{
int temp = a;
a = b;
b = temp;
}Other than the & in the parameters, it is no different than swapping two local variables.
With pointers:
void swap(int* a, int* b)
{
int temp = *a;
*a = *b;
*b = temp;
}Since here it is the coder's responsibility to dereference the pointers properly, there are many places to make both syntax and logical mistakes. For example a nice runtime error:
void swap(int* a, int* b)
{
int temp = *a;
a = b;
*b = temp;
}
As in this case the programmer is only interested in the
dereferenced values, forcing manual dereferencing is just distracting
noise.Any C++ programmer needs to be able to work with pointers
anyway, so the claims that "reference-preferring people" don't
understand pointers is rather absurd. There simply is no point in
choosing pointers where you don't need their functionality, as the only
thing it can do is add noise and increase bug-count.
With a reference you only have the value to look after.
References, like every other storage-cell type, involve both their own address and the address of their contents. I count two values there.
Funnily, I don't think about references as pointers at all. For me it is the exact same thing it is a reference of - with a different name. I haven't heard of "reference arithmetics" and I'm looking forward to an example how to reseat a reference.
I guess, if you want to, you may consider anything to be a pointer in C and C++, but I can't see what practical conclusions you can draw from it. Plain old stack variables "hide" the same indirection too, but I find it more productive to think in terms of "firstName" and "lastName", rather than "memory at offset n".
-
RE: C++: Another Spoiled Newbie
Just to add this one:
With a pointer you have two things to manage: the pointer itself and what it is pointing to. You can dereference a pointer and increment the value or you can increment the pointer itself.
With a reference you only have the value to look after.
If you only want the value (without the copying overhead), it wouldn't make sense to add another level of complexity, because "references are just disguised pointers".
-
RE: C++: Another Spoiled Newbie
A variant of one of the earlier examples:
int* p = new int;
int* q = p;
//..Somewhere
delete q;
//..Somewhere further down
*p = 42; //HuhSupposing it was a programmers bug to delete q. Now what would it take to make the same mistake if q was a reference?
@asuffield said:
In any kind of serious project, you're going to need to tackle the resource management problem at some point, rather than just avoiding it.
Um, I was saying that resource management has so far never been a problem for me... I have avoided problems, not managing resources.
It really doesn't force you to do anything of the kind. You're free to initialize them with anything you like, valid or otherwise.
C++ references do not enforce anything. They are just alternate syntax for pointers.
Then why does the compiler complain when I do:
int& a;
And even then, having a cleaner syntax (for example without a trace of doubt whether the coder intended to dereference the pointer or not) is a great improvement where applicable.
-
RE: C++: Another Spoiled Newbie
@asuffield said:
@fist-poster said:
And
this code "fails" (introduces undefined behaviour) at the point where
you dereference a NULL pointer - even before you get to references.
Note that with references, errors of this kind simply won't happen.Still wrong.
int &a(void) {
int b;
return b;
}
It breaks just as easily without using any pointers. References are not "safe".Now this is a more realistic example. But the exact same error is possible with pointers too:
int* a() {
int b;
return &b;
}I think once you have been told and understand why you shouldn't do this, that won't be a problem any more.
I
have not observed a trend for stupid C programmers to believe that the
pointer b is still valid after a has been deleted, so no.Well, I haven't noticed this kind of misunderstanding with C++ programmers either (from what I have seen in programming boards).
Anyway,
if you are in a situation where you have multiple references (pointers)
to memory that might get deallocated all of a sudden somewhere, you are
already on rather thin ice. As a hobby programmer I have managed to
avoid such situations entirely (by not allocating and deallocating
memory at some random places, by not trying to store for example
iterators to data that might be moved etc), but if it were not
possible, I guess one should use some sort of smart pointers over naked
pointers anyway.In the case where references are used, the point at which the program crashes is a simple variable assignment. Many C++ programmers believe you can't have invalid or NULL references, so they will fail to understand what is happening. My observation is that they usually blame hardware faults or compiler bugs.
Again, I'm not sure why there should be multiple references to the same thing in this case (I think the discussion started from how one should pass large objects to functions). But the problem starts from dereferencing a NULL pointer, which will appear to work as you have observed, and that is precisely a problem with pointers. With references the language forces you to initialize them with something valid - unless you bring in NULL pointers or something insane like that.
If your fellow programmers understand the language that poorly, they should be taught, and not limited to the simplest but unsafest features of the language.
There are certainly a number of situations where you absolutely must use pointers (and then certain practices such as RAII principles and use of smart pointers can make it safer), but if you have a choice (as in how to avoid copying large objects when you pass them to functions) it seems wiser to prefer a higher level construct that enforces stricter rules.
-
RE: C++: Another Spoiled Newbie
@asuffield said:
@Random832 said:
A C++ reference cannot be assigned NULL or an invalid value.
A
common belief in the "pointers are evil, use references instead" crowd.
It's wrong (and they're idiots), and the source of a stupid number of
segfaults created by ignorant people.NULL reference:
fprintf(stderr, "1\n");
int *a = 0;
fprintf(stderr, "2\n");
int &b = *a;
fprintf(stderr, "3\n");
b = 1;
fprintf(stderr, "4\n");And
this code "fails" (introduces undefined behaviour) at the point where
you dereference a NULL pointer - even before you get to references.
Note that with references, errors of this kind simply won't happen.Invalid value in a reference (this is the one that commercial C++ idiots do all the time):
I assume the pointer equivalent is what "C idiots" do all the time?
int *a = new int;
int &b = *a;
delete a;
b = 1;References
are just a syntax disguise for pointers. Almost every compiler just
switches the types to pointers and moves the *s around, as if you had
just written:int *a = new int;
int *b = a;
delete a;
*b = 1;
So
the behaviour is identical to the pointer version, and all you
accomplish by using references is to make the true behaviour of the
code harder to understand, and mislead the reader into thinking it does
something else.Exactly why? Just because you
don't understand references? In both cases you'll need to know that
there is a problem because b is either a reference of a or pointing to
a that got deleted. If there is sufficient amount of code between these
lines, that would be equally hard to find out. If there is enough code
between, may-be it just happened that the pointer b got reassigned to
point some place else? Or may-be it didn't? -
RE: C++: Another Spoiled Newbie
Actually you can have references of invalid objects when returning references of local objects. But if you'd do that with references, you'd get the same results with pointers too (returning the address of a local object).
If you can't be certain what a pointer contains, step away from the computer. Seriously. You don't have what it takes to be a software developer.
This is a joke?
You can't have uninitialized references (it is always a reference of something), you don't have to worry about null-ness, you can't accidentally reassign the reference and I guess you won't be "dereferencing" a reference that you have already "deleted". So references have several advantages over pointers. Unless you are particularly fond of chasing obscure bugs I see no reason to do things the harder way.
-
RE: C++: Another Spoiled Newbie
@tster said:
B: When I say you should never do pass by reference I mean you should never do pass by reference as opposed to pass by pointer:
I use:
int function(MyClass * object);
but I avoid:
int function(MyClass & object);
because the second one makes me forget that I am actually dealing with memory outside of my stack frame. I like have to type object-> or (*object). to remind myself (and later for ease of understanding it again) that I am about to cause side effects.
I think this is just a "poor man's" implementation of const-ness (except it doesn't stop one from making mistakes) and may not be so good advice. All the tutorials I have read suggest using references over pointers as they are safer and have a more pleasant syntax.
There are a few basic situations:
1) You need a distinct copy of the object. Pass object.
2) You want to modify the argument. Pass reference.
3) You just want to avoid copying overhead and do not intend to modify the argument. Pass const reference.
4) Sometimes you want to pass a NULL pointer. Pass pointer.
-
RE: The World's Worst Security System
TODO: Add users "member4" and "member5"
Some kids' stuff?
-
RE: Ternary operator
t = (t == null)?(""):(t);
Isn't this the equivalent of
if (t == null) t = "";
else t = t;
?
The else part looks a bit stupid...
-
RE: Spot the WTF -- ASSERT() gone horribly wrong
Aha, the dangling semicolon does cause problems.
In MingW this is defined as:
#define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
By the way, side effects are not important. Anything that can be evaluated as bool (e.g x = 10) is OK for the compiler. You just never put stuff that has side-effects in assert, obviously.
-
RE: Best Linked List Ever
@tster said:
@fist-poster said:
(I'm not sure, but is pointer arithmetics guaranteed to give defined results in C and C++, if used with non-sequential memory?)
yes. There is no paging inside of the processes memory space. The process sees a contiguous block of memory for code, stack and heap. This doesn't mean that the memory is ACTUALLY contiguous, but the operating system abstracts the physical memory locations.
This seems to disagree:
Unless both pointers point to elements of the
same array object, or one past the last element of the array object,
the behavior is undefined.From C++ standards draft 1997, 5.7.6
(concerning subtracting two pointers, same thing about adding an int to a pointer)Not only are there only a few programmers out there who can understand the neat trick, I wouldn't dare to use it in practice :(
-
RE: Best Linked List Ever
Yes, this construct is like a doubly-linked list in that it lets you traverse it forwards and backwards, given any two consecutive nodes.
Unlike a doubly linked list, it doesn't let you do anything, given just one node. The problem with the original code idea was that search returned an inappropriate result. However, which-ever technique you use, if you want to do it with 8 bytes, you'll have to return two pointers anyway to find your way around. If you don't want to search backwards, you might just as well use a regular singly linked list, which is probably easier, faster and safer.
(I'm not sure, but is pointer arithmetics guaranteed to give defined results in C and C++, if used with non-sequential memory?)
-
RE: Best Linked List Ever
There is no pointer to the next node in this case, the node contains data and a delta value.
However, I fail to see how this solves the problem. To find the previous node, I need to know where this and the next node are. Given only this node, however, I can't find the next node.
Therefore, if search and delete are to be done as separate steps, search needs to return a pair of nodes (this and next). My question is, why can't search return a pair of pointers to this and previous, using regular linked list, in the first place?