Why do I keep getting "[eslint] Delete `CR` [prettier/prettier]"?
I am using VS Code with Prettier 1.7.2 and ESLint 1.7.0. After every newline I get: ``` [eslint] Delete `CR` [prettier/prettier] ``` This is the `.eslintrc.json`: ``` { "extends": ["airbnb", "plugi...
- Modified
- 26 Oct at 17:1
Java 8 Lambda function that throws exception?
I know how to create a reference to a method that has a `String` parameter and returns an `int`, it's: ``` Function<String, Integer> ``` However, this doesn't work if the function throws an excepti...
Why is there no SortedList in Java?
In Java there are the [SortedSet](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/SortedSet.html) and [SortedMap](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/ja...
- Modified
- 18 Apr at 20:39
How to vertically align text inside a flexbox?
I would like to use flexbox to vertically align some content inside an `<li>` but not having great success. I've checked online and many of the tutorials actually use a wrapper div which gets the `al...
Enabling HTTPS on express.js
I'm trying to get HTTPS working on express.js for node, and I can't figure it out. This is my `app.js` code. ``` var express = require('express'); var fs = require('fs'); var privateKey = fs.readFile...
How do I declare an array in Python?
How do I declare an array in [Python](http://en.wikipedia.org/wiki/Python_%28programming_language%29)?
Does Java have support for multiline strings?
Coming from Perl, I sure am missing the "here-document" means of creating a multi-line string in source code: ``` $string = <<"EOF" # create a three-line string text text text EOF ``` In Java, I h...
What is the difference between "npm install" and "npm ci"?
I'm working with continuous integration and discovered the [npm ci](https://docs.npmjs.com/cli/ci) command. I can't figure what the advantages are of using this command for my workflow. Is it fast...
- Modified
- 1 Jan at 20:49
How to make an Android Spinner with initial text "Select One"?
I want to use a Spinner that initially (when the user has not made a selection yet) displays the text "Select One". When the user clicks the spinner, the list of items is displayed and the user select...
- Modified
- 2 May at 06:48
Checking if a variable is defined?
How can I check whether a variable is defined in Ruby? Is there an `isset`-type method available?
- Modified
- 17 Jan at 22:46
How to run TypeScript files from command line?
I'm having a surprisingly hard time finding an answer to this. With plain Node.JS, you can run any js file with `node path/to/file.js`, with CoffeeScript it's `coffee hello.coffee` and ES6 has `babel-...
- Modified
- 5 Nov at 02:54
How do I count the occurrence of a certain item in an ndarray?
How do I count the number of `0`s and `1`s in the following array? ``` y = np.array([0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1]) ``` --- `y.count(0)` gives: > `numpy.ndarray` object has no attribute `cou...
- Modified
- 13 Jun at 07:50
What are Unwind segues for and how do you use them?
iOS 6 and Xcode 4.5 has a new feature referred to as "Unwind Segue": > Unwind segues can allow transitioning to existing instances of scenes in a storyboard In addition to this brief entry in Xcode ...
- Modified
- 31 Mar at 17:56
How to turn off word wrapping in HTML?
I feel silly for not being able to figure this out, but how do I turn off wordwrap? the css `word-wrap` property can be forced on with `break-word`, but cannot be forced (only can be left alone with ...
Make first letter of a string upper case (with maximum performance)
I have a `DetailsView` with a `TextBox` and I want the be with the . ``` "red" --> "Red" "red house" --> " Red house" ``` How can I achieve this ? --- : Based on the answers and the comments un...
- Modified
- 12 Jul at 20:57
A non-blocking read on a subprocess.PIPE in Python
I'm using the [subprocess module](http://docs.python.org/library/subprocess.html) to start a subprocess and connect to its output stream (standard output). I want to be able to execute non-blocking re...
- Modified
- 29 Aug at 23:45
Difference between RUN and CMD in a Dockerfile
I'm confused about when should I use `CMD` vs `RUN`. For example, to execute bash/shell commands (i.e. `ls -la`) I would always use `CMD` or is there a situation where I would use `RUN`? Trying to und...
- Modified
- 14 Oct at 08:45
How do I cast a JSON Object to a TypeScript class?
I read a JSON object from a remote REST server. This JSON object has all the properties of a typescript class (by design). How do I cast that received JSON object to a type var? I don't want to popul...
- Modified
- 5 Dec at 15:47
View's getWidth() and getHeight() returns 0
I am creating all of the elements in my android project dynamically. I am trying to get the width and height of a button so that I can rotate that button around. I am just trying to learn how to work ...
- Modified
- 8 Dec at 14:1
How to use the PI constant in C++
I want to use the PI constant and trigonometric functions in some C++ program. I get the trigonometric functions with `include <math.h>`. However, there doesn't seem to be a definition for PI in this ...
- Modified
- 4 Apr at 09:8
Bootstrap NavBar with left, center or right aligned items
In , what is the most platform-friendly way to create a navigation bar that has Logo A on the left, menu items in the center, and Logo B on the right? Here is what I've tried so far, and it ends up ...
- Modified
- 1 Mar at 20:11
Staging Deleted files
Say I have a file in my git repository called `foo`. Suppose it has been deleted with `rm` (not `git rm`). Then git status will show: ``` Changes not staged for commit: deleted: foo ``` How do ...
What are the different usecases of PNG vs. GIF vs. JPEG vs. SVG?
When should certain image file types be used when building websites or interfaces, etc? What are their points of strength and weakness? I know that PNG & GIF are lossless, while JPEG is lossy. But w...
Python error "ImportError: No module named"
Python is installed in a local directory. My directory tree looks like this: ``` (local directory)/site-packages/toolkit/interface.py ``` My code is in here: ``` (local directory)/site-packages...
- Modified
- 15 Aug at 19:50
Is it possible to print a variable's type in standard C++?
For example: ``` int a = 12; cout << typeof(a) << endl; ``` Expected output: ``` int ```