Questions

How to run a shell script at startup

On an [Amazon S3](https://en.wikipedia.org/wiki/Amazon_S3) Linux instance, I have two scripts called `start_my_app` and `stop_my_app` which start and stop [forever](https://www.npmjs.com/package/forev...

30 Dec at 23:46

How do I "git clone" a repo, including its submodules?

How do I clone a git repository so that it also clones its submodules? Running `git clone $REPO_URL` merely creates empty submodule directories.

17 Jul at 00:43

How to match "any character" in regular expression?

The following should be matched: ``` AAA123 ABCDEFGH123 XXXX123 ``` can I do: `".*123"` ?

24 Feb at 15:11

How can I import a module dynamically given the full path?

How do I load a Python module given its full path? Note that the file can be anywhere in the filesystem where the user has access rights. --- [How to import a module given its name as string?](http...

30 Nov at 11:42

How to check a not-defined variable in JavaScript

I wanted to check whether the variable is defined or not. For example, the following throws a not-defined error ``` alert( x ); ``` How can I catch this error?

3 Mar at 19:35

How do I count the NaN values in a column in pandas DataFrame?

I want to find the number of `NaN` in each column of my data.

17 Jul at 06:40

The request was aborted: Could not create SSL/TLS secure channel

We are unable to connect to an HTTPS server using `WebRequest` because of this error message: `The request was aborted: Could not create SSL/TLS secure channel.` We know that the server doesn't have a...

How to convert a data frame column to numeric type?

How do you convert a data frame column to a numeric type?

10 Oct at 05:54

Display number with leading zeros

How do I display a leading zero for all numbers with less than two digits? ``` 1 → 01 10 → 10 100 → 100 ```

9 Apr at 09:44

How do I use optional parameters in Java?

What specification supports optional parameters?

27 Feb at 00:30

Remove final character from string

How do I remove the last character from a string? ``` "abcdefghij" → "abcdefghi" ```

25 Apr at 00:0

Exclude a column using SELECT * [except columnA] FROM tableA?

We all know that to select all columns from a table, we can use ``` SELECT * FROM tableA ``` Is there a way to exclude column(s) from a table without specifying all the columns? ``` SELECT * [exce...

24 Jul at 07:57

How do I ignore an error on 'git pull' about my local changes would be overwritten by merge?

How do I ignore the following error message on Git pull? > Your local changes to the following files would be overwritten by merge What if I to overwrite them? I've tried things like `git pull -f`...

22 Apr at 11:5

Uncaught SyntaxError: Unexpected token :

I am running an AJAX call in my MooTools script, this works fine in Firefox but in Chrome I am getting a `Uncaught SyntaxError: Unexpected token :` error, I cannot determine why. Commenting out code t...

29 Jun at 18:57

How to install the JDK on Ubuntu Linux

Note: This is an old question and the answers reflect the world as it was then. Modern Ubuntu distributions have OpenJDK available which can be installed with ``` sudo apt install default-jdk ``` ...

27 Mar at 22:11

How do I check in JavaScript if a value exists at a certain array index?

Will this work for testing whether a value at position `index` exists or not, or is there a better way: ``` if(arrayName[index]==""){ // do stuff } ```

29 Jun at 19:13

How to find out if an item is present in a std::vector?

All I want to do is to check whether an element exists in the vector or not, so I can deal with each case. ``` if ( item_present ) do_this(); else do_that(); ```

2 Nov at 20:43

How can I remove duplicate rows?

I need to remove duplicate rows from a fairly large SQL Server table (i.e. 300,000+ rows). The rows, of course, will not be perfect duplicates because of the existence of the `RowID` identity field. ...

16 Aug at 15:54

How to select all records from one table that do not exist in another table?

> table1 (id, name) table2 (id, name) Query: ``` SELECT name FROM table2 -- that are not in table1 already ```

30 Jul at 13:51

Convert java.util.Date to String

I want to convert a `java.util.Date` object to a `String` in Java. The format is `2010-05-30 22:15:52`

26 Mar at 16:16

Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)

I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13) This morning I navigated to my work's codeb...

13 Sep at 14:7

How to get a date in YYYY-MM-DD format from a TSQL datetime field?

How do I retrieve a date from SQL Server in `YYYY-MM-DD` format? I need this to work with SQL Server 2000 and up. Is there a simple way to perform this in SQL Server or would it be easier to convert i...

10 Dec at 10:55

When to use LinkedList over ArrayList in Java?

I've always been one to simply use: ``` List<String> names = new ArrayList<>(); ``` I use the interface as the type name for , so that when I ask questions such as this, I can rework my code. When sh...

Convert Python dict into a dataframe

I have a Python dictionary like the following: ``` {u'2012-06-08': 388, u'2012-06-09': 388, u'2012-06-10': 388, u'2012-06-11': 389, u'2012-06-12': 389, u'2012-06-13': 389, u'2012-06-14': 389, ...

16 Nov at 21:3

How to convert an Object {} to an Array [] of key-value pairs in JavaScript

I want to convert an object like this: ``` {"1":5,"2":7,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0} ``` into an array of key-value pairs like this: ``` [[1,5],[2,7],[3,0],[4,0]...

29 Oct at 18:8