Most Popular

1500 questions
1594
votes
25 answers

How to reset AUTO_INCREMENT in MySQL

How can I reset the AUTO_INCREMENT of a field? I want it to start counting from 1 again.
homerun
  • 19,837
  • 15
  • 45
  • 70
1593
votes
35 answers

How to add local jar files to a Maven project?

How do I add local jar files (not yet part of the Maven repository) directly in my project's library sources?
Praneel PIDIKITI
  • 18,677
  • 13
  • 41
  • 60
1593
votes
29 answers

Transport security has blocked a cleartext HTTP

What setting do I need to put in my info.plist to enable HTTP mode as per the following error message? Transport security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your…
Jeef
  • 26,861
  • 21
  • 78
  • 156
1590
votes
18 answers

Cycles in family tree software

I am the developer of some family tree software (written in C++ and Qt). I had no problems until one of my customers mailed me a bug report. The problem is that the customer has two children with their own daughter, and, as a result, he can't use my…
Partick Höse
  • 11,121
  • 3
  • 15
  • 9
1590
votes
8 answers

Is null check needed before calling instanceof?

Will null instanceof SomeClass return false or throw a NullPointerException?
Johan Lübcke
  • 19,666
  • 8
  • 38
  • 35
1589
votes
50 answers

Remove empty elements from an array in Javascript

How do I remove empty elements from an array in JavaScript? Is there a straightforward way, or do I need to loop through it and remove them manually?
Tamas Czinege
  • 118,853
  • 40
  • 150
  • 176
1585
votes
48 answers

A potentially dangerous Request.Form value was detected from the client

Every time a user posts something containing < or > in a page in my web application, I get this exception thrown. I don't want to go into the discussion about the smartness of throwing an exception or crashing an entire web application because…
Radu094
  • 28,068
  • 16
  • 63
  • 80
1585
votes
20 answers

How can I undo git reset --hard HEAD~1?

Is it possible to undo the changes caused by the following command? If so, how? git reset --hard HEAD~1
Paul Wicks
  • 62,960
  • 55
  • 119
  • 146
1580
votes
19 answers

How to check for NaN values

float('nan') represents NaN (not a number). But how do I check for it?
Jack Ha
  • 19,661
  • 11
  • 37
  • 41
1580
votes
8 answers

What are the options for storing hierarchical data in a relational database?

Good Overviews Generally speaking, you're making a decision between fast read times (for example, nested set) or fast write times (adjacency list). Usually, you end up with a combination of the options below that best fit your needs. The following…
orangepips
  • 9,891
  • 6
  • 33
  • 57
1580
votes
18 answers

How can I revert multiple Git commits?

I have a Git repository that looks like this: A <- B <- C <- D <- HEAD I want the head of the branch to point to A, i.e., I want B, C, D, and HEAD to disappear and I want head to be synonymous with A. It sounds like I can either try to rebase…
Bill
  • 44,502
  • 24
  • 122
  • 213
1579
votes
22 answers

'Static readonly' vs. 'const'

I've read around about const and static readonly fields. We have some classes which contain only constant values. They are used for various things around in our system. So I am wondering if my observation is correct: Should these kind of constant…
Svish
  • 152,914
  • 173
  • 462
  • 620
1579
votes
41 answers

How to change the order of DataFrame columns?

I have the following DataFrame (df): import numpy as np import pandas as pd df = pd.DataFrame(np.random.rand(10, 5)) I add more column(s) by assignment: df['mean'] = df.mean(1) How can I move the column mean to the front, i.e. set it as first…
Timmie
  • 15,995
  • 3
  • 14
  • 7
1578
votes
18 answers

How can I do an UPDATE statement with JOIN in SQL Server?

I need to update this table in SQL Server with data from its 'parent' table, see below: Table: sale id (int) udid (int) assid (int) Table: ud id (int) assid (int) sale.assid contains the correct value to update ud.assid. What query will do…
Ant Swift
  • 20,089
  • 10
  • 38
  • 55
1577
votes
31 answers

How do you get a list of the names of all files present in a directory in Node.js?

I'm trying to get a list of the names of all the files present in a directory using Node.js. I want output that is an array of filenames. How can I do this?
resopollution
  • 19,600
  • 10
  • 40
  • 49