1,163 reputation
1911
bio website
location Umeå, Sweden
age 30
visits member for 3 years
seen 4 hours ago

C++ developer at heart, loves to play around with graphics APIs.


Dec
21
comment Replace tabs with spaces in C
@Proton An actual tab is a single char '\t', not two chars '\\' and 't'. Escapes are shorthand in character and string literals to encode things not expressible in the language.
Dec
15
comment Why using string[] args in all main methods?
@Mawg argc in C may be zero. in case of non-zero argc, argv[0] shall be a string that represents the "program name", or an empty string if the name is not available from the host environment. There is no requirement anywhere that it shall be a "full executable path". This is all from C99 section 5.1.2.2.1. Even your non-normative URL says this.
Dec
12
awarded  Yearling
Nov
28
comment It is safe to accept money for open source software that you've written?
Your modification of the MIT license means it's not the MIT license anymore. You can license your software under multiple licenses, some of which may only be available for charge. Is your question about dual-licensing software, or concerns about taxation and other economy funstuff that may arise due to dealing across nation borders?
Nov
4
comment Hide admin menu if no admin option is available
@Jorge Your comment seem a bit strange. If by "again" you mean on the server, you don't have any security. You cannot trust the client.
Nov
3
comment Should a getter throw an exception if its object has invalid state?
On the subject, Falsehoods Programmers Believe About Names is a very good read on why 'first name' and 'surname' are very narrow concepts.
Sep
24
awarded  Autobiographer
Sep
10
awarded  Deputy
Sep
1
comment Is it possible to modify a native executable and change (dynamic) library it depends on?
Note that DLLs on Windows do not only have exports by name, but also by ordinals (16-bit? number identifying an export). A drop-in replacement library should also have the same ordinals for its exports in case the application imports by ordinal.
Aug
18
comment Where did the notion of 'calling' a function come from?
@Blrfl I skimmed the paper, it does not use the term call or any other term, it mostly just talks about use of subroutines.
Aug
17
comment Why can't we use IP address instead of cookies in identifying the client in servlets?
It's nice to know that even when IPv6 rolls out proper this problem will still not be solved thanks to privacy extensions changing your address over time.
Aug
4
answered Why do we need to serialize data using a serialization framework e.g. avro
Jun
5
answered Estimating file transfer time over network?
Apr
17
comment Does it make sense to choose UTF-32, based on concern that some basic rule will be broken for UTF-8?
wstring is a basic_string<wchar_t>. wchar_t is implementation-defined in size and definitely not enough bits for UTF-32 on Windows.
Apr
14
comment Why Num&sizeMinusOne faster than num&(size-1)
Note that the question as it stands now is about implementing power-of-two modulo by either and masking or the generic % modulo operator. You seem to have at this time described the difference between two and calls.
Mar
20
comment Why isn't the arrow operator in C++ just an alias of *.?
@Guss: I cannot find any chapter and verse for your claim, nor reproduce it in a compiler. C++11 13.5.6/1 indicates that if a suitable overload exists, x->m shall be interpreted as (x.operator->())->m. If the LHS is something that has a suitable overload of operator-> again, this process recurs until there's just the usual (*x).m effect of 5.2.5/2.
Mar
10
comment Using scoped enums for bit flags in C++
The unscoped enumerator is only declared in the surrounding scope. Being able to qualify it by the enum-name is part of lookup rules, not the declaration. C++11 7.2/10: Each enum-name and each unscoped enumerator is declared in the scope that immediately contains the enum-specifier. Each scoped enumerator is declared in the scope of the enumeration. These names obey the scope rules defined for all names in (3.3) and (3.4).
Feb
5
comment Best way to hide API key in source code
It may be beneficial to outline the concept of of an API key for readers unfamiliar with it. An API key is a secret awarded to the developer of some software interacting with a service (typically a web service). It is used to identify the source of traffic, lift restrictions vs. anonymous accesses, and to bill the owner of the key for service usage. You are expected to keep it moderately hidden and preferably revoke it if it's compromised. As it needs to be communicated in full to the service, you always lose.
Jan
7
comment argument grouping with parenthesis are valid in C++?
On some (conformant, not VS2013) C++11 compilers, the function call can be made as func({1, 2, 3, 4}, 5.5f);. Note that the using namespace std; statement is not necessary for the solution, just a habit of the answerer.
Dec
18
comment Where does the tradition of shell prompts in code snippets come from?
In instructions that occasionally require root, it's common to see $ and # used to indicate which operations require escalation.