Questions

When to use 'raise NotImplementedError'?

Is it to remind yourself and your team to implement the class correctly? I don't fully get the use of an abstract class like this: ``` class RectangularRoom(object): def __init__(self, width, hei...

14 May at 12:46

How to resolve Unneccessary Stubbing exception

My Code is as below, ``` @RunWith(MockitoJUnitRunner.class) public class MyClass { private static final String code ="Test"; @Mock private MyClassDAO dao; @InjectMocks priva...

29 May at 23:32

ARG or ENV, which one to use in this case?

This could be maybe a trivial question but reading docs for [ARG](https://docs.docker.com/engine/reference/builder/#arg) and [ENV](https://docs.docker.com/engine/reference/builder/#env) doesn't put th...

How to see logs from npm installation?

I am unable to install ionic through npm. Are there any logs that I can check to see what's wrong and if yes, where are they located? What I see is the waiting stick dancing forever. I've waited for ...

9 Sep at 13:13

Vue: How do I call multiple functions with @click?

How can I call multiple functions in a single `@click`? (aka `v-on:click`)? So far I tried - Splitting the functions with a semicolon: `<div @click="fn1('foo');fn2('bar')"> </div>`;- Using several `@c...

9 Jan at 11:56

Where can I find the API KEY for Firebase Cloud Messaging?

I am trying to figure out how the new version of GCM or Firebase Cloud Messaging works so I moved one of my projects to the new Firebase console, If I did not have the API KEY or I want to create a ne...

Failed to find or create execution context for description <IBCocoaTouchPlatformToolDescription: 0x7fa8bad9a6f0>

I'm working on a project for iOS and I'm doing the programming with Visual Studios and it connects to a mac server using Xamarin. I recently tried to add more views to the storyboard and an additional...

10 Apr at 18:23

Instance member cannot be used on type

I have the following class: ``` class ReportView: NSView { var categoriesPerPage = [[Int]]() var numPages: Int = { return categoriesPerPage.count } } ``` Compilation fails with the messag...

Visual Studio Code compile on save

How can I configure Visual Studio Code to compile typescript files on save? I see it is possible to configure a task to build the file in focus using the `${file}` as an argument. But I would like ...

29 Jul at 12:25

How to save local data in a Swift app?

I'm currently working on a iOS app developed in Swift and I need to store some user-created content on the device but I can't seem to find a simple and quick way to store/receive the users content on ...

15 Feb at 09:57

How would I get everything before a : in a string Python

I am looking for a way to get all of the letters in a string before a : but I have no idea on where to start. Would I use regex? If so how? ``` string = "Username: How are you today?" ``` Can someo...

14 Feb at 05:9

Tools: replace not replacing in Android manifest

I am using a gradle project with many different library dependencies and using the new manifest merger. In my `<application />` tag I have it set up as such: ``` <application tools:replace="android:i...

14 Apr at 14:57

How to use Elasticsearch with MongoDB?

I have gone through many blogs and sites about configuring Elasticsearch for MongoDB to index Collections in MongoDB but none of them were straightforward. Please explain to me a step by step process...

11 Jan at 06:36

How do you suppress output in Jupyter running IPython?

How can output to `stdout` be suppressed? A semi-colon can be used to supress display of returned objects, for example ``` >>> 1+1 2 >>> 1+1; # No output! ``` However, a function that prints to...

8 May at 14:56

Remove duplicated rows using dplyr

I have a data.frame like this - ``` set.seed(123) df = data.frame(x=sample(0:1,10,replace=T),y=sample(0:1,10,replace=T),z=1:10) > df x y z 1 0 1 1 2 1 0 2 3 0 1 3 4 1 1 4 5 1 0 5 6 0 ...

9 Apr at 10:22

How to split string with newline ('\n') in Node?

Within Node, how do I split a string using newline ('\n') ? I have a simple string like `var a = "test.js\nagain.js"` and I need to get `["test.js", "again.js"]`. I tried ``` a.split("\n"); a.split("\...

20 Apr at 23:46

Failed to load c++ bson extension

A total node noob here. I've been trying to set up a sample node app but the following error keeps popping up every time I try to run: > ``` Failed to load c++ bson extension, using pure JS version...

How do I change selected value of select2 dropdown with JqGrid?

I'm using Oleg's [select2 demo](http://www.ok-soft-gmbh.com/jqGrid/UsageFormetterSelect2.htm), but I am wondering whether it would be possible to change the currently selected value in the dropdown me...

28 Oct at 16:20

How to embed small icon in UILabel

I need to embed small icons ( sort of custom bullets ) to my `UILabel` in iOS7. How can I do this in interface designer? Or at least in code? In Android there are `leftDrawable` and `rightDrawable` f...

Index all *except* one item in python

Is there a simple way to index all elements of a list (or array, or whatever) for a particular index? E.g., - `mylist[3]` will return the item in position 3- `milist[~3]` will return the whole lis...

26 Sep at 01:15

How do I set vertical space between list items?

Within a `<ul>` element, clearly the vertical spacing between lines can be formatted with the line-height attribute. My question is, within a `<ul>` element, how do I set the vertical spacing between...

20 Jun at 16:53

IntelliJ does not show 'Class' when we right click and select 'New'

We're creating a new project in IntelliJ and must have something wrong because when we right click on a directory, select and then get the context menu, Java based options are not shown. Currently ge...

16 Feb at 11:45

How can I use Async with ForEach?

Is it possible to use Async when using ForEach? Below is the code I am trying: ``` using (DataContext db = new DataLayer.DataContext()) { db.Groups.ToList().ForEach(i => async { await Get...

20 Jul at 15:58

Lombok added but getters and setters not recognized in Intellij IDEA

I am using IntelliJ IDEA on ubuntu. I added into my project and installed the Lombok plugin for IDEA. I have access to the annotations but the `getters` and `setters` aren't generated. I get the same...

17 Jul at 06:5

How to ISO 8601 format a Date with Timezone Offset in JavaScript?

Find the `local time` and `UTC time offset` then construct the URL in following format. Example URL: `/Actions/Sleep?duration=2002-10-10T12:00:00−05:00` The format is based on the [W3C recommendation...