14,312 reputation
22557
bio website
location
age
visits member for 3 years, 8 months
seen 31 mins ago

Jan
12
comment Why HashMap is faster than HashSet?
in java HashSet is implemented with a HashMap using a dummy object for the values.
Jan
9
reviewed Leave Closed Will a profound knowledge of C++ help you in learning other languages faster/easier?
Jan
6
answered Use of raw pointer of std::vector
Jan
6
comment Use of raw pointer of std::vector
C++11 has vector::data() member so you don't need to &front.
Jan
6
comment Using struct to enforce validation of built-in type
you could make a templated version that takes a bool(T) lambda
Jan
5
comment How do deal with angle wraparounds when comparing them?
compare directions instead, it alleviates you from the wrap around and only lets you focus on the difference
Jan
5
comment Bitwise operation on uppercase ASCII character turns to lowercase. Why?
@KilianFoth and it's that clever arrangement that made it more attractive than EBCDIC (granted a similar bit trick is possible in EBCDIC but not much else and that made ASCII superior)
Jan
5
comment Bitwise operation on uppercase ASCII character turns to lowercase. Why?
look at how the letters are layed out in the ascii table A is 0b100_0001 and a is 0b110_0001
Jan
5
comment How can I (in general) program a website for mobile devices?
generally look at the browser string and then decide whether to forward to mobile or show desktop
Jan
5
comment Is it good design to put abstract methods in an abstract class even though the methods are already defined in its interface?
It can reaffirm what needs to be implemented in the subclass without requiring the programmer to look through all interfaces to see what is missing
Jan
4
comment How to make max-heap stable with counter and account for counter overflow?
with 3 bytes you have 16 million insertions until overflow, does it live long enough for that to matter?
Jan
3
comment When trying to find out if a number is even or odd: AND 1 or OR 0
you could OR with -2 (if 2's complement) and test if the result is -1 or -2
Jan
3
comment Why might it be difficult to make a 64 bit version of a program?
because stupid programmers keep assuming sizeof(int)==sizeof(void*)
Dec
30
comment What is different between the internal design of Java and C++ that lets C++ have multiple inheritance?
More importantly you never need to know about vtables in java, if you do there is the java.lang.class to get a reference to the Method if needed.
Dec
30
comment Declaring lambdas in Java8
what's wrong with statics?
Dec
28
comment String[] args vs (String . . . args)
@FaizanRabbani well it's a simple wrap of new String[]{...} to convert (it's what actually happens when you use a String...)
Dec
28
comment String[] args vs (String . . . args)
@FaizanRabbani except that you can also call a String... as if it's String[]
Dec
23
comment Why lambda/closures expressions came so late to C++?
committee disagreed on how it should look like and how it owuld work together with other features.
Dec
22
comment Hash function with uniqueness guarantees and controllable entropy
input? there shouldn't be input for an RNG
Dec
20
comment Why is close() implemented in InputStream/OutputStream?
it is part of it, the closeable interface is a retro fit