How do you push a tag to a remote repository using Git?

I added a tag to the master branch on my machine: ``` git tag mytag master ``` How do I push this to the remote repository? Running `git push` gives the message: > Everything up-to-date However, the ...

11 Jul at 06:47

How do I find and restore a deleted file in a Git repository?

Say I'm in a Git repository. I delete a file and commit that change. I continue working and make some more commits. Then, I discover that I need to restore that file after deleting it. I know I can ch...

18 Jul at 18:45

How do I find out which process is listening on a TCP or UDP port on Windows?

How do I find out which process is listening on a TCP or UDP port on Windows?

24 Jul at 23:15

Understanding Python super() with __init__() methods

Why is `super()` used? Is there a difference between using `Base.__init__` and `super().__init__`? ``` class Base(object): def __init__(self): print "Base created" class ChildA(Ba...

1 Apr at 11:47

Is it possible to apply CSS to half of a character?

A way to style one of a character. (In this case, half the letter being transparent) - - - Below is an example of what I am trying to obtain. ![x](https://i.stack.imgur.com/SaH8v.png) Does a...

16 Dec at 05:11

How can I upload files asynchronously with jQuery?

I would like to upload a file asynchronously with jQuery. ``` $(document).ready(function () { $("#uploadbutton").click(function () { var filename = $("#file").val(); $.ajax({ ...

How do I change the size of figures drawn with Matplotlib?

How do I change the size of figure drawn with Matplotlib?

How do I make function decorators and chain them together?

How do I make two decorators in Python that would do the following? ``` @make_bold @make_italic def say(): return "Hello" ``` Calling `say()` should return: ``` "<b><i>Hello</i></b>" ```

How to add images to README.md on GitHub?

Recently I joined . I hosted some projects there. I need to include some images in my README File. I don't know how to do that. I searched about this, but all I got was some links which tell me to "ho...

How do I set, clear, and toggle a single bit?

How do I set, clear, and toggle a bit?

Is there a unique Android device ID?

Do Android devices have a unique ID, and if so, what is a simple way to access it using Java?

30 Jan at 01:18

How do I modify a specific commit?

I have the following commit history: 1. HEAD 2. HEAD~ 3. HEAD~2 4. HEAD~3 `git commit --amend` modifies the current `HEAD` commit. But how do I modify `HEAD~3`?

11 Jul at 06:50

What does " 2>&1 " mean?

To combine `stderr` and `stdout` into the `stdout` stream, we append this to a command: ``` 2>&1 ``` e.g. to see the first few errors from compiling `g++ main.cpp`: ``` g++ main.cpp 2>&1 | head ``` ...

10 Aug at 19:30

How can I know which radio button is selected via jQuery?

I have two radio buttons and want to post the value of the selected one. How can I get the value with jQuery? I can get all of them like this: ``` $("form :radio") ``` How do I know which one is s...

How do I print colored text to the terminal?

How do I output colored text to the terminal in Python?

10 Jul at 22:35

`git fetch` a remote branch

The remote repository contains various branches such as `origin/daves_branch`: ``` $ git branch -r origin/HEAD -> origin/master origin/daves_branch origin/master ``` How do I switch to `daves_branch`...

19 Feb at 18:25

How do I split a list into equally-sized chunks?

How do I split a list of arbitrary length into equal sized chunks? --- [How to iterate over a list in chunks](https://stackoverflow.com/q/434287) [Split string every nth character?](https://stackov...

2 Oct at 01:6

From inside of a Docker container, how do I connect to the localhost of the machine?

I have a Nginx running inside a docker container. I have a MySql running on the host system. I want to connect to the MySql from within my container. MySql is only binding to the localhost device. Is ...

What is the difference between #include <filename> and #include "filename"?

What is the difference between using angle brackets and quotes in an `include` directive? - `#include <filename>`- `#include "filename"`

Is there a standard function to check for null, undefined, or blank variables in JavaScript?

Is there a universal JavaScript function that checks that a variable has a value and ensures that it's not `undefined` or `null`? I've got this code, but I'm not sure if it covers all cases: ``` func...

11 May at 09:13

Why is printing "B" dramatically slower than printing "#"?

I generated two matrices of `1000` x `1000`: First Matrix: `O` and `#`. Second Matrix: `O` and `B`. Using the following code, the first matrix took 8.52 seconds to complete: ``` Random r = new Rand...

How can I check if a program exists from a Bash script?

How would I validate that a program exists, in a way that will either return an error and exit, or continue with the script? It seems like it should be easy, but it's been stumping me.

1 Jan at 01:6

Length of a JavaScript object

I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object? ``` const myObject = new Object(); myObject["firstname"] = "Gareth"; myObject["lastname"...

10 Jul at 18:31

How do I modify the URL without reloading the page?

Is there a way I can modify the URL of the current page without reloading the page? I would like to access the portion the # hash if possible. I only need to change the portion the domain, so it's n...

What is the --save option for npm install?

I saw some tutorial where the command was: ``` npm install --save ``` What does the `--save` option mean?

20 Dec at 13:0