Stack Overflow Weekly Newsletter
Stack Overflow Weekly Newsletter

Top new questions this week:

Why does GCC use multiplication by a strange number in implementing integer division?

I've been reading about div and mul assembly operations, and I decided to see them in action by writing a simple program in C: File division.c #include <stdlib.h> #include <stdio.h> int ...

c gcc assembly x86-64 integer-division  
asked by qiubit 126 votes
answered by Sneftel 102 votes

Corrupted string in C#

I came across “CorruptedString” (Solution). Here is following code of program from the book: var s = "Hello"; string.Intern(s); unsafe { fixed (char* c = s) for (int i = 0; i < s.Length; ...

c# string  
asked by LmTinyToon 59 votes
answered by Jaroslav Kadlec 58 votes

What exactly does the anonymous JavaScript function f => f do?

I'm using a third-party library that has a function that takes functions as arguments. I'm doing some conditional checks to decide whether or not to add a particular function as a parameter and in ...

javascript ecmascript-6  
asked by SomethingOn 55 votes
answered by Jamiec 73 votes

How and why would I write a class that extends null?

JavaScript's class syntax, added in ES6, apparently makes it legal to extend null: class foo extends null {} Some Googling reveals that it was suggested on ES Discuss that such declarations be made ...

javascript ecmascript-6 es6-class  
asked by Mark Amery 45 votes
answered by Bakkot 15 votes

A 'for' loop that appears to be practically infinite

I'm debugging some code at the moment, and I've come across this line: for (std::size_t j = M; j <= M; --j) (Written by my boss, who's on holiday.) It looks really odd to me. What does it do? ...

c++  
asked by Michael Bullock 34 votes
answered by Bathsheba 32 votes

Is it possible to change a C++ object's class after instantiation?

I have a bunch of classes which all inherit the same attributes from a common base class. The base class implements some virtual functions that work in general cases, whilst each subclass ...

c++ inheritance  
asked by dwk 33 votes
answered by Jean-Bernard Jansen 29 votes

Why does my program crash when I increment a pointer and then delete it?

I was solving some programming exercise when I realised that I have a big misunderstanding about pointers. Please could someone explain the reason that this code causes a crash in C++. #include ...

c++ pointers dynamic-memory-allocation delete-operator  
asked by Beetroot 26 votes
answered by Bathsheba 76 votes

Greatest hits from previous weeks:

How to delete a Git branch both locally and remotely?

I want to delete a branch both locally and on my remote project fork on GitHub. Failed Attempts to Delete Remote Branch $ git branch -d remotes/origin/bugfix error: branch 'remotes/origin/bugfix' ...

git git-branch git-remote  
asked by Matthew Rankin 9172 votes
answered by Matthew Rankin 10882 votes

How do I check if an element is hidden in jQuery?

It is possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle(). How would you test if an element is visible or hidden?

javascript jquery dom visibility  
asked by Philip Morton 5180 votes
answered by Tsvetomir Tsonev 6559 votes

Can you answer these?

App works on WIFI but not on 3G

There are two activities: Main and Detail Activity. Main Activity is basically a GridView. Detail Activity is basically shows the clicked item's detail information. I am passing selected item's id ...

java android android-volley  
asked by casillas 6 votes

Redux-Form file upload after async validation

I have a FileUpload component that is connected through a redux-form Field. It calls input.onChange and input.onBlur with the selected file as a base64 string when a file is selected in an input ...

react-redux redux-form react-redux-form  
asked by eNddy 6 votes

Using data.table's .() shortcut in quoted expressions

I have some data.tables containing file names as a var named fn. I want to split off basename and extension: library(data.table) library(tools) DT1 = data.table(fn = c("gah.csv", "egad.csv")) DT2 = ...

r data.table eval  
asked by Frank 5 votes
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3