Questions

What is the difference between gravity and layout_gravity in Android?

I know we can set the following values to the `android:gravity` and `android:layout_gravity` properties: 1. center 2. center_vertical 3. center_horizontal, etc. But I am confused regarding both ...

Naming Classes - How to avoid calling everything a "<WhatEver>Manager"?

A long time ago I have read an article (I believe a blog entry) which put me on the "right" track on naming objects: Be very very scrupulous about naming things in your program. For example if my app...

Proper MIME media type for PDF files

When working with PDFs, I've run across the MIME types `application/pdf` and `application/x-pdf` among others. Is there a difference between these two types, and if so what is it? Is one preferred o...

15 Feb at 16:17

How to change the href attribute for a hyperlink using jQuery

How can you change the `href` attribute (link target) for a hyperlink using jQuery?

7 Jul at 14:4

Difference between Constructor and ngOnInit

Angular provides life cycle hook `ngOnInit` by default. Why should `ngOnInit` be used, if we already have a `constructor`?

How to round a number to n decimal places in Java

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standa...

11 Nov at 21:47

How to remove old Docker containers

This question is related to [Should I be concerned about excess, non-running, Docker containers?](https://stackoverflow.com/questions/17014263/should-i-be-concerned-about-excess-non-running-docker-con...

23 May at 11:55

What is Gradle in Android Studio?

Gradle is a bit confusing to me, and also for any new Android developer. Can anyone explain what Gradle in Android Studio is and what its purpose is? Why is it included in Android Studio?

Send HTTP POST request in .NET

How can I make an HTTP [POST](https://en.wikipedia.org/wiki/POST_%28HTTP%29) request and send data in the body?

What is the single most influential book every programmer should read?

If you could go back in time and tell yourself to read a specific book at the beginning of your career as a developer, which book would it be? I expect this list to be varied and to cover a wide rang...

26 Sep at 15:39

Hex transparency in colors

I'm working on implementing a widget transparency option for my app widget although I'm having some trouble getting the hex color values right. Being completely new to hex color transparency I searche...

10 Aug at 15:14

LINQ's Distinct() on a particular property

I am playing with LINQ to learn about it, but I can't figure out how to use [Distinct](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.distinct) when I do not have a simple list (a...

18 Jan at 13:19

Trigger a button click with JavaScript on the Enter key in a text box

I have one text input and one button (see below). How can I use JavaScript to when the key is pressed inside the text box? There is already a different submit button on my current page, so I can't ...

What is the difference between MVC and MVVM?

Is there a difference between the standard "Model View Controller" pattern and Microsoft's Model/View/ViewModel pattern?

How do I create a copy of a directory in Unix/Linux?

I want to [recursively](https://en.wikipedia.org/wiki/Recursion) create a copy of a directory and all its contents (e.g. files and subdirectories).

12 Feb at 23:15

Why there are two ways to unstage a file in Git?

Sometimes git suggests `git rm --cached` to unstage a file, sometimes `git reset HEAD file`. When should I use which? ``` D:\code\gt2>git init Initialized empty Git repository in D:/code/gt2/.git/ D:\...

14 Oct at 16:51

Where does npm install packages?

Can someone tell me where can I find the Node.js modules, which I installed using `npm`?

12 Dec at 19:49

How do I delete unpushed git commits?

I accidentally committed to the wrong branch. How do I delete that commit?

7 Jul at 17:47

Vertical rulers in Visual Studio Code

### Rendering More than One Ruler in VS Code --- VS Code's default configuration for a ruler is demonstrated below. ``` "editor.ruler": 80 ``` The issue I am having with the default VS Code con...

7 Jun at 13:25

How to manually send HTTP POST requests from Firefox or Chrome browser

I want to test some URLs in a web application I'm working on. For that I would like to manually create HTTP POST requests (meaning I can add whatever parameters I like). Is there any functionality in ...

Difference between require, include, require_once and include_once?

In PHP: - `require``include`- `require_once``include_once`

27 Mar at 11:39

What is the use of "assert" in Python?

What does `assert` mean? How is it used?

6 Dec at 02:47

How to switch databases in psql?

In MySQL, I used `use database_name;` What's the `psql` equivalent?

1 Sep at 15:46

Calculate difference between two dates (number of days)?

I see that this question has been answered for [Java](https://stackoverflow.com/questions/1555262/), [JavaScript](https://stackoverflow.com/questions/1036742/), and [PHP](https://stackoverflow.com/que...

23 May at 12:34

Create a tag in a GitHub repository

I have a repository in GitHub and I need to it. I tagged in a shell, but on , it is not showing up. Do I have to do anything else? The command I used in the shell is: ``` git tag 2.0 ``` And no...

19 Apr at 17:22