Most Popular

1500 questions
2932
votes
27 answers

Convert string "Jun 1 2005 1:33PM" into datetime

I have a huge list of datetime strings like the following ["Jun 1 2005 1:33PM", "Aug 28 1999 12:00AM"] How do I convert them into datetime objects?
Oli
  • 235,628
  • 64
  • 220
  • 299
2931
votes
35 answers

Find the version of an installed npm package

How can I find the version of an installed Node.js or npm package? This prints the version of npm itself: npm -v This prints a cryptic error: npm version This prints the package version on the registry (i.e., the…
Laurent Couvidou
  • 32,354
  • 3
  • 30
  • 46
2911
votes
91 answers

How do I detect a click outside an element?

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area. Is something like this possible with…
Sergio del Amo
  • 76,835
  • 68
  • 152
  • 179
2910
votes
19 answers

How can I recursively find all files in current and subfolders based on wildcard matching?

How can I recursively find all files in current and subfolders based on wildcard matching?
john
  • 33,520
  • 12
  • 45
  • 62
2910
votes
40 answers

Find (and kill) process locking port 3000 on Mac

How do I find (and kill) processes that listen to/use my TCP ports? I'm on macOS. Sometimes, after a crash or some bug, my Rails app is locking port 3000. I can't find it using ps -ef... When running rails server I get Address already in use -…
oma
  • 38,642
  • 11
  • 71
  • 99
2890
votes
30 answers

How to append something to an array?

How do I append an object (such as a string or number) to an array in JavaScript?
interstar
  • 26,048
  • 36
  • 112
  • 180
2886
votes
36 answers

Renaming column names in Pandas

I want to change the column labels of a Pandas DataFrame from ['$a', '$b', '$c', '$d', '$e'] to ['a', 'b', 'c', 'd', 'e']
user1504276
  • 28,955
  • 3
  • 15
  • 7
2882
votes
16 answers

I need an unordered list without any bullets

I have created an unordered list. I feel the bullets in the unordered list are bothersome, so I want to remove them. Is it possible to have a list without bullets?
praveenjayapal
  • 37,683
  • 30
  • 72
  • 72
2876
votes
13 answers

What are the correct version numbers for C#?

What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5? This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that…
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
2870
votes
33 answers

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?
soemirno
  • 29,244
  • 3
  • 19
  • 14
2863
votes
7 answers

How does database indexing work?

Given that indexing is so important as your data set increases in size, can someone explain how indexing works at a database-agnostic level? For information on queries to index a field, check out How do I index a database column.
Xenph Yan
  • 83,019
  • 16
  • 48
  • 55
2860
votes
22 answers

Encode URL in JavaScript

How do you safely encode a URL using JavaScript such that it can be put into a GET string? var myUrl = "http://example.com/index.html?param=1&anotherParam=2"; var myOtherUrl = "http://example.com/index.html?url=" + myUrl; I assume that you need to…
nickf
  • 537,072
  • 198
  • 649
  • 721
2860
votes
35 answers

How can I save an activity state using the save instance state?

I've been working on the Android SDK platform, and it is a little unclear how to save an application's state. So given this minor re-tooling of the 'Hello, Android' example: package com.android.hello; import android.app.Activity; import…
Bernard
  • 45,296
  • 18
  • 54
  • 69
2839
votes
38 answers

How do I split a string on a delimiter in Bash?

I have this string stored in a variable: IN="bla@some.com;john@home.com" Now I would like to split the strings by ; delimiter so that I have: ADDR1="bla@some.com" ADDR2="john@home.com" I don't necessarily need the ADDR1 and ADDR2 variables. If…
stefanB
  • 77,323
  • 27
  • 116
  • 141
2829
votes
44 answers

How can I transition height: 0; to height: auto; using CSS?

I am trying to make a
    slide down using CSS transitions. The
      starts off at height: 0;. On hover, the height is set to height:auto;. However, this is causing it to simply appear, not transition, If I do it from height: 40px; to height:…
Hailwood
  • 89,623
  • 107
  • 270
  • 423