Questions

Convert a list to a data frame

I have a nested list of data. Its length is 132 and each item is a list of length 20. Is there a way to convert this structure into a data frame that has 132 rows and 20 columns of data? Here is some...

11 Nov at 20:2

How to print a stack trace in Node.js?

Does anyone know how to print a stack trace in Node.js?

13 Dec at 04:12

Comparing two byte arrays in .NET

How can I do this fast? Sure I can do this: ``` static bool ByteArrayCompare(byte[] a1, byte[] a2) { if (a1.Length != a2.Length) return false; for (int i=0; i<a1.Length; i++) ...

23 May at 12:34

Split string on whitespace in Python

I'm looking for the Python equivalent of ``` String str = "many fancy word \nhello \thi"; String whiteSpaceRegex = "\\s"; String[] words = str.split(whiteSpaceRegex); ["many", "fancy", "word",...

21 Mar at 23:25

MongoDB relationships: embed or reference?

I want to design a question structure with some comments. Which relationship should I use for comments: `embed` or `reference`? A question with some comments, like [stackoverflow](https://stackoverflo...

10 Jan at 00:24

Is it possible to have placeholders in strings.xml for runtime values?

Is it possible to have placeholders in string values in `string.xml` that can be assigned values at run time? Example: > some string some more string

Using cURL with a username and password?

I want to access a URL which requires a username/password. I'd like to try accessing it with curl. Right now I'm doing something like: ``` curl http://api.somesite.com/test/blah?something=123 ``` I...

1 Feb at 18:55

How can I get a recursive full-path listing, one line per file?

How can I spit out a flat list of recursive one-per-line paths? For example, I just want a flat listing of files with their full paths: ``` /home/dreftymac/. /home/dreftymac/foo.txt /home/dreftymac/ba...

15 Nov at 18:13

C# "internal" access modifier when doing unit testing

I'm trying to figure out if I should start using more of `internal` access modifier. I know that if we use `internal` and set the assembly variable `InternalsVisibleTo`, we can test functions that we ...

29 Dec at 00:9

Difference between Grunt, NPM, and Bower (package.json vs bower.json)

When I want to add a package (and check in the dependency into git), where does it belong - into `package.json` or into `bower.json`? From what I gather, running `bower install` will fetch the package...

28 Dec at 23:59

How to use 'cp' command to exclude a specific directory?

I want to copy all files in a directory except some files in a specific sub-directory. I have noticed that `cp` command didn't have the `--exclude` option. So, how can I achieve this?

13 Jan at 00:0

What is the current directory in a batch file?

I want to create a few batch files to automate a program. My question is when I create the batch file, what is the current directory? Is it the directory where the file is located or is it the same d...

4 Apr at 08:49

How do I declare a 2d array in C++ using new?

How do i declare a 2d array using new? Like, for a "normal" array I would: ``` int* ary = new int[Size] ``` but ``` int** ary = new int[sizeY][sizeX] ``` a) doesn't work/compile and b) doesn't ...

Most efficient way to map function over numpy array

What is the most efficient way to map a function over a numpy array? I am currently doing: ``` import numpy as np x = np.array([1, 2, 3, 4, 5]) # Obtain array of square of each element in x squarer...

13 Jun at 07:47

Find a value in an array of objects in Javascript

I know similar questions have been asked before, but this one is a little different. I have an array of unnamed objects, which contain an array of named objects, and I need to get the object where "na...

15 Feb at 21:53

What is the difference between Normalize.css and Reset CSS?

I know what CSS Reset is, but recently I heard about this new thing called Normalize.css What is the difference between the [Normalize.css](https://necolas.github.io/normalize.css/) and [Reset CSS](ht...

19 May at 02:39

Sending multipart/formdata with jQuery.ajax

I've got a problem sending a file to a serverside PHP-script using jQuery's ajax-function. It's possible to get the File-List with `$('#fileinput').attr('files')` but how is it possible to send this D...

How to remove RVM (Ruby Version Manager) from my system

How can I remove RVM (Ruby Version Manager) from my system?

20 Jan at 19:58

How can I detect if this dictionary key exists in C#?

I am working with the Exchange Web Services Managed API, with contact data. I have the following code, which is , but not ideal: ``` foreach (Contact c in contactList) { string openItemUrl = "htt...

How can I update the current line in a C# Windows Console App?

When building a Windows Console App in C#, is it possible to write to the console without having to extend a current line or go to a new line? For example, if I want to show a percentage representing...

21 May at 13:15

Return multiple values to a method caller

I read the [C++ version of this question](https://stackoverflow.com/questions/321068/returning-multiple-values-from-a-c-function) but didn't really understand it. Can someone please explain clearly if...

21 Oct at 00:36

How do I measure execution time of a command on the Windows command line?

Is there a built-in way to measure execution time of a command on the Windows command line?

How do I split a string, breaking at a particular character?

I have this string ``` 'john smith~123 Street~Apt 4~New York~NY~12345' ``` Using JavaScript, what is the fastest way to parse this into ``` var name = "john smith"; var street= "123 Street"; //etc...

1 Jul at 12:5

How to define type for a function callback (as any function type, not universal any) used in a method parameter

Currently I have type definition as: ``` interface Param { title: string; callback: any; } ``` I need something like: ``` interface Param { title: string; callback: function; } ```...

11 Jun at 14:20

When to use: Java 8+ interface default method, vs. abstract method

Java 8 allows for default implementation of methods in interfaces called [Default Methods](http://java.dzone.com/articles/introduction-default-methods). I am confused between when would I use that so...