Quantcast
Channel: User Nicholas Knight - Stack Overflow
Browsing all 39 articles
Browse latest View live

Comment by Nicholas Knight on When printf is an address of a variable, why...

@Blindy: No, they are not. Different 64-bit platforms won't even behave the same. See, for example, en.wikipedia.org/wiki/64-bit#64-bit_data_models

View Article



Comment by Nicholas Knight on 2+2=2 in C (double arithmetics)

Your question has been answered, but you also have another error. You're including stdlib.h, but printf and scanf are not defined in stdlib.h. You need stdio.h. By the way, your compiler really ought...

View Article

Comment by Nicholas Knight on Python remove JSON substring

What isn't Python 3-compliant about find and rfind?

View Article

Comment by Nicholas Knight on What is the C++ equivalent for AutoResetEvent...

@derekhh: I don't know about "easier", condition variables are a fairly simple construct, but if you're already using boost::thread (which IMO is a perfectly good choice), by all means use its...

View Article

Comment by Nicholas Knight on Efficient structure for element wise access to...

I might be missing something, but why are you keying the dict with strings like that? (i,j) is a perfectly valid dict key.

View Article


Comment by Nicholas Knight on Unable to use cout with a C++ string unless I...

What is in "more code here"? I suspect it's significant.

View Article

Comment by Nicholas Knight on Git clone failing on public key. Is there...

AJP, I've removed the "explicit solution" you edited into Amber's answer. Even if, for some unfathomable reason, you're OK with your projects directory being world-readable-and-writable, leaving a...

View Article

Comment by Nicholas Knight on Why does a read(2) call on Linux spend several...

Note that gettimeofday isn't the best way to do performance timings, it's subject to clock changes from e.g. ntpd. See stackoverflow.com/questions/88/…

View Article


Comment by Nicholas Knight on Are extended instruction sets (SSE, MMX) used...

@us2012 That's probably a very bad idea if for no other reason than that the kernel isn't designed for it, and you may unexpectedly clobber user-space SIMD register values (or user-space may clobber...

View Article


Comment by Nicholas Knight on How many keys are too many in memcached?

@user1130176 Not in the average case, no. O(log(n)) behavior from a putative hash table would suggest a broken or misapplied implementation. You may be thinking of some other structure also commonly...

View Article

Comment by Nicholas Knight on Go: test internal functions

@George I don't know where you got the idea testing your internals is an anti-pattern, but you should never, ever take advice from that source again. Yes, testing your external API is important, but...

View Article

Answer by Nicholas Knight for What is the relationship between C and C++...

C libraries are used in C++ constantly. Sometimes they get wrapped in a nicer idiomatic C++ interface, sometimes not. Lots of thin C++ wrappers around C socket APIs, for example, but people often use...

View Article

Answer by Nicholas Knight for How safe is the apple binary (secret key saftey)

The binary is not even remotely safe. Whether through the iTunes download or on a jailbroken iPhone, there's nothing you can do other than obfuscation, which a determined adversary will always get...

View Article


Answer by Nicholas Knight for pydev - can someone please explain these errors

Neil speaks the truth, except for telling you to turn it off -- spell check in comments is quite helpful -- those who come after will thank you for ensuring they can read your comments without trying...

View Article

Answer by Nicholas Knight for Using Version Control but still access the...

You need a deployment script. Create a script to upload the files to the appropriate locations. Run this script whenever you wish to see your changes reflected on the site. If you wish to maintain two...

View Article


Answer by Nicholas Knight for Free 64-bit disassembler?

GNU binutils has objdump, which should work:-d--disassembleDisplay the assembler mnemonics for the machine instructions from objfile. This option only disassembles those sections which are expected to...

View Article

Answer by Nicholas Knight for Xcode 4 C++ header file with relative path to...

Don't use relative paths. Seriously, it's implementation-defined behavior how they work, so different compilers/environments/platforms will behave differently, and in your case, Xcode is almost...

View Article


Answer by Nicholas Knight for Can XNA games run on mac?

The short answer: Yes, in theory, but don't expect perfection, at least not right off the bat. You'd probably have some work ahead of you to get a good experience.MonoXNA is just an open-source...

View Article

Answer by Nicholas Knight for PHP mkdir: 0777 becomes 0755?

Your umask is probably set to 0022 (a common default), preventing the write bits from being set for group and other. You can use the umask function to change the current umask.But then, why are you...

View Article

Answer by Nicholas Knight for Most stable gcc/g++ version to date

The 2.95 branch hasn't had an update in over ten years. I certainly wouldn't be using it for anything voluntarily. Use whatever is the latest available for your system unless you have specific...

View Article
Browsing all 39 articles
Browse latest View live




Latest Images