This MSND article says SecureZeroMemory() is good for cases when sensitive data stored in memory for a while should be for sure overwritten as soon as possible when no longer needed. Answers to this SO question explain why this can make a difference.
Now is there any sence in using SecureZeroMemory() for initializing just every memory b...
If you put a decimal in a format where has to be rounded to the nearest 10th, and it is: 1.55, it'll round to 1.5. 1.56 will then round to 1.6. In school I recall learning that you round up when you reach five, and down if it's 4 or below. Why is it different in Python, et al.
Here's a code example for Python 2.6x (whatever the latest v...
I want to use the correct term to make my API as intuitive as possible, so when a parameter is expected to be a full path and filename (ex "C:\Users\Max\Documents\MyDocument.txt") what is the correct term?
filename - that would just be MyDocument.txt, right?
path - that would just be C:\Users\Max\Documents, right?
What should I use ...
I am designing a web site in which users solve puzzles as quickly as they can. JavaScript is used to time each puzzle, and the number of milliseconds is sent to the server via AJAX when the puzzle is completed. How can I ensure that the time received by the server was not forged by the user?
I don't think a session-based authenticity to...
I'm creating a toy dynamic language (aching towards javascript) and while my implementation is on top of the DLR, I figured the solution to this problem would be pretty language/platform agnostic.
I have no problem with compiling recursive functions, or mutually recursive functions that exist next to each other. But compiling nested mut...
Possible Duplicate:
What is a good book to study data structures in C?
Please recommend a good beginner-intermediate book on data structures.
Preferably a printed book, with code in C (or language-agnostic).
...
I'm planning to write a diagram editor-style application, where you organize objects on a canvas. This application will need to support setting viewport, zooming, cropping and a lot of other standard features of such a graph style application. I'm looking for toolkits or frameworks which could supports drawing in a standard mathematical ...
Let's say you want to construct an Iterator that spits out File objects. What type of data do you usually provide to the constructor of such an Iterator?
an array of pre-constructed File objects, or
simply raw data (multidimensional array for instance), and let the Iterator create File objects on the fly when Iterated through?
Edit:
...
What are most commonly faced programming scenarios while developing Web/Enterprise Applications ?
Note: Include common programming scenarios which would occur more frequently across all layers of Web/Enterprise Applications : Frontend/Middle/Backend.
...
In the context of programming, how do idioms differ from patterns?
I use the terms interchangeably and normally follow the most popular way I've heard something called, or the way it was called most recently in the current conversation, e.g. "the copy-swap idiom" and "singleton pattern".
The best difference I can come up with is code w...
I remember seeing this functionnality while editing elisp code, using a config cloned from someone on github.
However, I can't find it anymore, and would especially like to know if this feature is possible using other major modes (especially javascript, ruby, and maybe nXhtml).
...
the question im asking, is it worth to learn a new language like groovy? cause if i learn groovy, it feels like i code in groovy and not java. and how smart is that when i have to be good in java to code desktop applications too in the future. so if i use groovy a lot for web applications, i will just be worse and have to start over to b...
I have a two-dimensional array, say
0 0 0 0 0
0 2 3 4 0
0 9 1 5 0
0 8 7 6 0
0 0 0 0 0
And i need to get all the numbers adjacent to 1(2, 3, 4, 5, 6, 7, 8, 9)
Is there a less ugly solution than:
topLeft = array[x-1][y-1]
top = array[x][y-1]
topRight = array[x+1][y-1]
# etc
Thanks!
...
I've got lots of source code files written in various languages, but none of them have a standard comment at the top (sometimes even across the same project). Some of them don't have any header comment at all :-)
I've been thinking about creating a standard template that I can use at the top of my source files, and was wondering what fi...
I have a class A that has a collection of objects of Class B.
Class A can also 'inherit' (for lack of a better term) the collection of objects of Class B from other instances of Class A. To model this, instances of Class A point to other instances of Class A (I control for circular references).
A simplified concrete example might be th...
Suppose I want to store a complicated data structure (a tree, say) to disk. The internal pointers which connect nodes in my data structures are pointers, but I can't just write these pointers to disk, because when I read the data structure back the memory locations will have changed.
So what is the right way to store the pointers on di...
Is it possible to remove duplicate characters from a string without saving each character you've seen in an array and checking to see if new characters are already in that array? That seems highly inefficient. Surely there must be a quicker method?
...
I basically have a few variables
0 < na < 250
0 < max <= 16
nb = (na + max - 1) / max
n has the following characterstics
0 <= i < nb - 1 => n = max
i = nb - 1 => n = na - i * max
Is there an easy way to do this without the ternary operator?
for (i = 0; i<nb;i++) {
n = ((i + 1) * max > na ? na - (i * max) : max);
}
Examples...
Hello all,
This is a problem I have run into before and I have yet to find an elegant solution, so I thought I would ask for SO's help.
I am iterating through an array and printing off some information from that array and having trouble figuring out how to print my start and end <div> tags. Below is an example table and the desired out...
A rough definition of a data structure is that it allows you to store data and apply a set of operations on that data while preserving consistency of data before and after the operation.
However some people insist that a primitive variable like 'int' can also be considered as a data structure. I get that part where it allows you to store...