Questions

Intro to GPU programming

Everyone has this huge massively parallelized supercomputer on their desktop in the form of a graphics card GPU. - - -Adam

24 Nov at 23:21

Class with single method -- best approach?

Say I have a class that's meant to perform a single function. After performing the function, it can be destroyed. Is there any reason to prefer one of these approaches? ``` // Initialize arguments in...

9 Mar at 05:18

What does the tilde before a function name mean in C#?

I am looking at some code and it has this statement: ``` ~ConnectionManager() { Dispose(false); } ``` The class implements the `IDisposable` interface, but I do not know if that is part of th...

26 Jun at 05:2

How to format a string as a telephone number in C#

I have a string "1112224444' it is a telephone number. I want to format as 111-222-4444 before I store it in a file. It is on a datarecord and I would prefer to be able to do this without assigning a ...

29 Aug at 20:54

Can I return the 'id' field after a LINQ insert?

When I enter an object into the DB with Linq-to-SQL can I get the id that I just inserted without making another db call? I am assuming this is pretty easy, I just don't know how.

13 Sep at 23:5

NotificationCompat.Builder deprecated in Android O

After upgrading my project to ``` buildToolsVersion "26.0.1" ``` Lint in Android Studio is showing a deprecated warning for the follow notification builder method: ``` new NotificationCompat.Buil...

URL Encode and Decode in ASP.NET Core

``` HttpContext.Current.Server.UrlEncode ``` This does only work in .NET Framework. How can I encode or decode URI arguments in ASP.NET Core?

5 Apr at 09:47

What is the role of "Flatten" in Keras?

I am trying to understand the role of the `Flatten` function in Keras. Below is my code, which is a simple two-layer network. It takes in 2-dimensional data of shape (3, 2), and outputs 1-dimensional ...

Visual Studio 2017 - Git failed with a fatal error

I am using Visual Studio 2017 Community Edition (CE), and I have signed into my Microsoft account and I am connected to VSTS. I can see all my projects and repositories, but when I attempt to pull/fet...

updating nodejs on ubuntu 16.04

I was recently going through the version of node in my ubuntu 16.04 when `node -v` command was used it shows me version 6.9.1 but when `nodejs -v` it shows 6.9.2 previously before using this commands ...

17 Dec at 06:23

Using Pipes within ngModel on INPUT Elements in Angular

I've an HTML INPUT field. ``` <input [(ngModel)]="item.value" name="inputField" type="text" /> ``` and I want to format its value and use an existing pipe: ``` .... [(ngModel)]="i...

Show distinct column values in pyspark dataframe

With pyspark dataframe, how do you do the equivalent of Pandas `df['col'].unique()`. I want to list out all the unique values in a pyspark dataframe column. Not the SQL type way (registertemplate then...

Google Sheets API returns "The caller does not have permission" when using server key

I've generated a server key in the API Manager and attempted to execute the following on my Mac: ``` curl 'https://sheets.googleapis.com/v4/spreadsheets/MySheetID?ranges=A1:B5&key=TheServerKeyIGenera...

ng: command not found while creating new project using angular-cli

Installed angular-cli globally using (`npm install -g angular-cli`) but when I'm trying to create project using `ng new my-project` it is throwing error: > ng: command not found

28 Aug at 03:42

How to generate range of numbers from 0 to n in ES2015 only?

I have always found the `range` function missing from JavaScript as it is available in python and others? Is there any concise way to generate range of numbers in ES2015 ? EDIT: MY question is differ...

17 Jun at 08:17

Upload progress indicators for fetch?

I'm struggling to find documentation or examples of implementing an upload progress indicator using [fetch](https://github.com/github/fetch). [This is the only reference I've found so far](https://jak...

20 Jun at 09:12

How do I use numpy.where()? What should I pass, and what does the result mean?

I tried reading the [documentation](http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.where.html) for `numpy.where()`, but I'm still confused. What should I pass for the `condition`, `x...

30 Jan at 23:18

What does the shrink-to-fit viewport meta attribute do?

I'm having trouble finding documentation for this. Is it Safari specific? There was a recent bug in iOS 9 ([here](http://kihlstrom.com/2015/shrink-to-fit-no-fixes-zoom-problem-in-ios-9/)), the soluti...

15 Oct at 23:59

How to set base url for rest in spring boot?

I'm trying to to mix mvc and rest in a single spring boot project. I want to set base path for all rest controllers (eg. example.com/api) in a single place (I don't want annotate each controller with ...

Replacing Header with Top Row

I currently have a dataframe that looks like this: ``` Unnamed: 1 Unnamed: 2 Unnamed: 3 Unnamed: 4 0 Sample Number Group Number Sample Name Group Name 1 1.0 1.0 ...

24 Dec at 16:19

Class has no initializers Swift

I have a problem with Swift class. I have a swift file for UITableViewController class and UITableViewCell class. My problem is the UITableViewCell class, and outlets. This class has an error , and I ...

6 Jan at 11:7

How to convert list of numpy arrays into single numpy array?

Suppose I have ; ``` LIST = [[array([1, 2, 3, 4, 5]), array([1, 2, 3, 4, 5],[1,2,3,4,5])] # inner lists are numpy arrays ``` I try to convert; ``` array([[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], ...

17 Dec at 01:16

How to create a signed APK file using Cordova command line interface?

I made a sample application named `checkStatus`. Now I want to create a signed APK file. So I can install it in different devices for my testing. For this, I Googled and found this [documentation](ht...

6 Jan at 12:30

How can I push to my fork from a clone of the original repo?

I created a fork (let's call it `myrepo`) of another repository (let's call it `orirepo`) on GitHub. Later, I cloned `orirepo`. ``` git clone https://github.com/original/orirepo.git ``` I modified ...

28 Aug at 10:7

How do I use the includes method in lodash to check if an object is in the collection?

lodash lets me check for membership of basic data types with `includes`: ``` _.includes([1, 2, 3], 2) > true ``` But the following doesn't work: ``` _.includes([{"a": 1}, {"b": 2}], {"b": 2}) > fa...