Questions

NodeJS / Express: what is "app.use"?

In the [docs for the NodeJS express module](http://expressjs.com/guide.html), the example code has `app.use(...)`. What is the `use` function and where is it defined?

21 Oct at 11:23

How to export all collections in MongoDB?

I want to export all collections in MongoDB by the command: ``` mongoexport -d dbname -o Mongo.json ``` The result is: No collection specified! The manual says, if you don't specify a collecti...

13 Jul at 09:56

CSS background image to fit width, height should auto-scale in proportion

I have ``` body { background: url(images/background.svg); } ``` The desired effect is that this background image will have width equal to that of the page, height changing to maintain the propo...

13 Feb at 15:14

How to replace multiple substrings of a string?

I would like to use the .replace function to replace multiple strings. I currently have ``` string.replace("condition1", "") ``` but would like to have something like ``` string.replace("condit...

8 Dec at 16:57

Xcode "Build and Archive" from command line

Xcode 3.2 provides an awesome new feature under the Build menu, "Build and Archive" which generates an .ipa file suitable for Ad Hoc distribution. You can also open the Organizer, go to "Archived App...

21 Jul at 05:46

How to remove all debug logging calls before building the release version of an Android app?

According to Google, I must "" before publishing my Android app to Google Play. Extract from section 3 of the [publication checklist](https://developer.android.com/studio/publish/preparing.html#turn-o...

18 Jul at 08:37

How to change time in DateTime?

How can I change only the time in my `DateTime` variable "s"? ``` DateTime s = some datetime; ```

12 Nov at 20:36

Conversion of a datetime2 data type to a datetime data type results out-of-range value

I've got a datatable with 5 columns, where a row is being filled with data then saved to the database via a transaction. While saving, an error is returned: > The conversion of a datetime2 data type...

How to avoid the "divide by zero" error in SQL?

I have this error message: > Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered. What is the best way to write SQL code so that I will never see this error message again? I could ...

How do I convert a PIL Image into a NumPy array?

How do I convert a PIL `Image` back and forth to a NumPy array so that I can do faster pixel-wise transformations than PIL's `PixelAccess` allows? I can convert it to a NumPy array via: ``` pic = Imag...

Is there any difference between GROUP BY and DISTINCT

I learned something simple about SQL the other day: ``` SELECT c FROM myTbl GROUP BY C ``` Has the same result as: ``` SELECT DISTINCT C FROM myTbl ``` What I am curious of, is there anything di...

4 May at 22:19

Gradle Implementation vs API configuration

I'm trying to figure out what is the difference between `api` and `implementation` configuration while building my . In the documentation, it says that `implementation` has better build time, but, see...

How to resolve git's "not something we can merge" error

I just encountered a problem when merging a branch into master in git. First, I got the branch name by running `git ls-remote`. Let's call that branch "branch-name". I then ran `git merge branch-name`...

31 May at 17:41

Getting a list item by index

I've recently started using c# moving over from Java. I can't seem to find how to get a list item by index. In java to get the first item of the list it would be: ``` list1.get(0); ``` What is the ...

3 Oct at 20:54

IntelliJ - Convert a Java project/module into a Maven project/module

I have a project on Bitbucket. Only the sources are committed. To retrieve the project onto a new machine, I used Version Control > Checkout from Version Control from within IntelliJ. It then asks wh...

4 Oct at 01:36

Secondary axis with twinx(): how to add to legend?

I have a plot with two y-axes, using `twinx()`. I also give labels to the lines, and want to show them with `legend()`, but I only succeed to get the labels of one axis in the legend: ``` import nump...

30 Mar at 10:26

How to detect when an Android app goes to the background and come back to the foreground

I am trying to write an app that does something specific when it is brought back to the foreground after some amount of time. Is there a way to detect when an app is sent to the background or brought ...

7 Feb at 19:50

How to uninstall Python 2.7 on a Mac OS X 10.6.4?

I want to completely remove Python 2.7 from my Mac OS X 10.6.4. I managed to remove the entry from the `PATH` variable by reverting my `.bash_profile`. But I also want to remove all directories, files...

Get line number while using grep

I am using grep recursive to search files for a string, and all the matched files and the lines containing that string are print on the terminal. But is it possible to get the line numbers of those li...

15 Oct at 04:49

Google Maps API v3: How to remove all markers?

In Google Maps API v2, if I wanted to remove all the map markers, I could simply do: ``` map.clearOverlays(); ``` How do I do this in Google Maps API ? Looking at the [Reference API](http://code.g...

Can I find out the return value before returning while debugging in Visual Studio?

Take the following function: ``` DataTable go() { return someTableAdapter.getSomeData(); } ``` When I set a breakpoint in this function, is there a possibility to inspect the returned value? `g...

Signed versus Unsigned Integers

Am I correct to say the difference between a signed and unsigned integer is: 1. Unsigned can hold a larger positive value and no negative value. 2. Unsigned uses the leading bit as a part of the valu...

5 Feb at 06:30

How best to include other scripts?

The way you would normally include a script is with "source" eg: main.sh: ``` #!/bin/bash source incl.sh echo "The main script" ``` incl.sh: ``` echo "The included script" ``` The output of ...

22 Feb at 01:28

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

I am using Python 3.6. When I try to install "modules" using `pip3`, I face this issue: ``` pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available ```...

21 Dec at 15:48

Why do many examples use `fig, ax = plt.subplots()` in Matplotlib/pyplot/python

I'm learning to use `matplotlib` by studying examples, and a lot of examples seem to include a line like the following before creating a single plot... ``` fig, ax = plt.subplots() ``` Here are som...

20 Aug at 19:45