Questions

Git push requires username and password

I cloned a Git repository from my GitHub account to my PC. I want to work with both my PC and laptop, but with one GitHub account. When I try to push to or pull from GitHub using my PC, it requires ...

How can I vertically center a div element for all browsers using CSS?

I want to center a `div` vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. ``` <body> <div...

Changing the image source using jQuery

My DOM looks like this: ``` <div id="d1"> <div class="c1"> <a href="#"><img src="img1_on.gif"></a> <a href="#"><img src="img2_on.gif"></a> </div> </div> ``` When someo...

18 Jul at 21:50

How to change the font size on a matplotlib plot

How does one change the font size for all elements (ticks, labels, title) on a matplotlib plot? I know how to change the tick label sizes, this is done with: ``` import matplotlib matplotlib.rc('xt...

24 Mar at 07:33

JavaScript post request like a form submit

I'm trying to direct a browser to a different page. If I wanted a GET request, I might say ``` document.location.href = 'http://example.com/q=a'; ``` But the resource I'm trying to access won't respo...

27 Dec at 19:51

Using async/await with a forEach loop

Are there any issues with using `async`/`await` in a `forEach` loop? I'm trying to loop through an array of files and `await` on the contents of each file. ``` import fs from 'fs-promise' async funct...

Adding a favicon to a static HTML page

I have a few static pages that are just pure HTML, that we display when the server goes down. How can I put a favicon that I made (it's 16x16px and it's sitting in the same directory as the HTML file;...

29 Aug at 08:1

Regular expression to check if password is "8 characters including 1 uppercase letter, 1 special character, alphanumeric characters"

I want a regular expression to check that > a password must be eight characters including one uppercase letter, one special character and alphanumeric characters. And here is my validation expressi...

16 Feb at 18:24

C# DateTime to "YYYYMMDDHHMMSS" format

I want to convert a C# DateTime to "YYYYMMDDHHMMSS" format. But I don't find a built in method to get this format? Any comments?

27 Jun at 05:17

How do I remove a directory from a Git repository?

How can I delete a single directory containing files from a Git repository?

6 Sep at 16:58

How do I right align div elements?

The body of my html document consists of 3 elements, a button, a form, and a canvas. I want the button and the form to be right aligned and the canvas to stay left aligned. The problem is when I try t...

4 May at 16:11

How can I create an executable/runnable JAR with dependencies using Maven?

I want to package my project in a single executable JAR for distribution. How can I make a Maven project package all dependency JARs into my output JAR?

How to create Temp table with SELECT * INTO tempTable FROM CTE Query

I have a MS SQL CTE query from which I want to create a temporary table. I am not sure how to do it as it gives an `Invalid Object name` error. Below is the whole query for reference ``` SELECT * IN...

Remove specific characters from a string in Python

I'm trying to remove specific characters from a string using Python. This is the code I'm using right now. Unfortunately it appears to do nothing to the string. ``` for char in line: if char in "...

30 May at 12:32

Remove element by id

When removing an element with standard JavaScript, you must go to its parent first: ``` var element = document.getElementById("element-id"); element.parentNode.removeChild(element); ``` Having to g...

12 Jun at 10:5

Converting a String to DateTime

How do you convert a string such as `2009-05-08 14:40:52,531` into a `DateTime`?

7 Dec at 17:45

Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git

I'm not sure why I'm a branch that I had worked on earlier. See the commands below (note: `co` is an alias for `checkout`): ``` ramon@ramon-desktop:~/source/unstilted$ git branch -a * develop feat...

23 May at 12:10

Plot two graphs in a same plot

I would like to plot y1 and y2 in the same plot. ``` x <- seq(-2, 2, 0.05) y1 <- pnorm(x) y2 <- pnorm(x, 1, 1) plot(x, y1, type = "l", col = "red") plot(x, y2, type = "l", col = "green") ``` But w...

23 Feb at 16:32

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

Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

I have applied every solution available on internet but still I cannot run Docker. I want to use Scrapy Splash on my server. Here is `history` of commands I ran. ``` docker run -p 8050:8050 scrapinghu...

23 May at 19:10

Create ArrayList from array

Given an array of type `Element[]`: ``` Element[] array = {new Element(1), new Element(2), new Element(3)}; ``` How do I convert this array into an object of type [ArrayList<Element>](https://docs.or...

17 Jul at 00:14

Recommended way to embed PDF in HTML?

What is the recommended way to embed PDF in HTML? - - - What does Adobe say itself about it? In my case, the PDF is generated on the fly, so it can't be uploaded to a third-party solution prior to...

6 Oct at 12:28

Group by in LINQ

Let's suppose if we have a class like: ``` class Person { internal int PersonID; internal string car; } ``` I have a list of this class: `List<Person> persons;` And this list can have m...

11 Jun at 08:49

Determine whether an array contains a value

I need to determine if a value exists in an array. I am using the following function: ``` Array.prototype.contains = function(obj) { var i = this.length; while (i--) { if (this[i] ==...

1 Jul at 11:39

Resize image proportionally with CSS?

Is there a way to resize (scale down) images proportionally using ONLY CSS? I'm doing the JavaScript way, but just trying to see if this is possible with CSS.

11 Mar at 11:16