23.11.07
Posted in JavaScript at 12:30 am by Guy
In this post I will present a way of creating a JavaScript based DOS attack that utilizes the bad implementation of tabs in most (if not all) web-browsers. The attack will make the browser unresponsive and force the user to kill its process. This attack is based on the following JavaScript code:
Read the rest of this entry »
Permalink
19.11.07
Posted in C/C++ at 9:24 pm by Guy
Well it isn’t really an operator but this is a nice C code construct I ran into. It doesn’t seem to have any benefit except as a nice way to create a reverse loop:
int count = 100;
while (count-->0) {
//some work
}
As I said I don’t think I’ll find any performance benefit for using this code snippet. On the other hand it is always fun to see the puzzled face other programmers have the first time they see the code.
Permalink
07.11.07
Posted in C/C++ at 5:26 pm by Guy
for loops are basic language constructs in many languages. One of the first thing to look at when optimizing code is the loops, as they do considerable amounts of work (like going through a very large amount of data), in very little code.
If you go use for loop, but you don’t really care about the order in which the loop is executed, to be more precise, if you can afford reversing to loop, you can save quite some time. By reversing the loop I mean instead of giving the index values from 0 to 10 for example, you go from 10 downward to zero. This doesn’t seem like a big change, but when being carefully implemented this can easily upgrade the performance of your for loops.
Read the rest of this entry »
Permalink