Questions

Cannot truncate table because it is being referenced by a FOREIGN KEY constraint?

Using MSSQL2005, can I truncate a table with a foreign key constraint if I first truncate the child table (the table with the primary key of the FK relationship)? I know that I can either - `DELETE`...

Maximum request length exceeded.

I am getting the error when I am trying to upload a video in my site. How do I fix this?

20 Nov at 17:29

How to allow <input type="file"> to accept only image files?

I need to upload only image file through `<input type="file">` tag. Right now, it accepts all file types. But, I want to restrict it to only specific image file extensions which include `.jpg`, `.gi...

26 Jun at 16:55

what is Segmentation fault (core dumped)?

I am trying to write a C program in linux that having sqrt of the argument, Here's the code: ``` #include<stdlib.h> #include<stdio.h> #include<math.h> int main(char *argv[]){ float k; printf...

28 Oct at 17:49

What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it?

What does `ArrayIndexOutOfBoundsException` mean and how do I get rid of it? Here is a code sample that triggers the exception: ``` String[] names = { "tom", "bob", "harry" }; for (int i = 0; i <= n...

How to insert date values into table

How can I insert into table with different input using / ,with ? ``` insert into run(id,name,dob)values(&id,'&name',[what should I write here?]); ``` I'm using oracle 10g.

How do I get a class instance of generic type T?

I have a generics class, `Foo<T>`. In a method of `Foo`, I want to get the class instance of type `T`, but I just can't call `T.class`. What is the preferred way to get around it using `T.class`?

18 Mar at 12:47

how to change directory using Windows command line

I'm using `cmd.exe` (C:\WINDOWS\System32\cmd.exe) and I have to change my current directory to "D:\temp" i.e. temp folder in the D drive. When I try to `cd` nothing happens. ``` C:\> cd D:\temp C:\...

SQL - Select first 10 rows only?

How do I select only the first 10 results of a query? I would like to display only the first 10 results from the following query: ``` SELECT a.names, COUNT(b.post_title) AS num FROM wp_...

16 Apr at 02:56

How to check if a dictionary is empty?

I am trying to check if a dictionary is empty but it doesn't behave properly. It just skips it and displays without anything aside from the display the message. Any ideas why ? ``` def isEmpty(self, ...

5 Jan at 13:9

How to update gradle in android studio?

I installed Android Studio 0.1.9. Today I got and update to version 0.2 and of course I updated. After the installation I restarted Android Studio but now I get this message: > Project is using an o...

Regular expression for exact match of a string

I want to match two passwords with regular expression. For example I have two inputs "123456" and "1234567" then the result should be not match (false). And when I have entered "123456" and "123456" t...

3 May at 13:44

What are CN, OU, DC in an LDAP search?

I have a search query in LDAP like this. What exactly does this query mean? ``` ("CN=Dev-India,OU=Distribution Groups,DC=gp,DC=gl,DC=google,DC=com"); ```

21 Feb at 12:8

How do I check that a number is float or integer?

How to find that a number is `float` or `integer`? ``` 1.25 --> float 1 --> integer 0 --> integer 0.25 --> float ```

25 Jan at 09:33

Formatting a number with exactly two decimals in JavaScript

I have this line of code which rounds my numbers to two decimal places. But I get numbers like this: 10.8, 2.4, etc. These are not my idea of two decimal places so how I can improve the following? ``...

5 Mar at 10:42

Remove all special characters, punctuation and spaces from string

I need to remove all special characters, punctuation and spaces from a string so that I only have letters and numbers.

11 Jun at 04:20

What’s the difference between "Array()" and "[]" while declaring a JavaScript array?

What's the real difference between declaring an array like this: ``` var myArray = new Array(); ``` and ``` var myArray = []; ```

25 Dec at 09:48

How to add new line in Markdown presentation?

How to add new line in Markdown presentation? I mean, something like `\newline` in TeX.

8 Nov at 12:18

'Java' is not recognized as an internal or external command

When trying to check the current version of Java in which I am running, I received the error "java is not recognized as an internal or external command, operable program or batch file.". I am running ...

29 Sep at 16:28

event.preventDefault() vs. return false

When I want to prevent other event handlers from executing after a certain event is fired, I can use one of two techniques. I'll use jQuery in the examples, but this applies to plain-JS as well: ###...

How to highlight cell if value duplicate in same column for google spreadsheet?

I am looking for formula for google spreadsheet can anyone please assist me for this query?

How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?

I tried to install a package, using ``` install.packages("foobarbaz") ``` but received the warning ``` Warning message: package 'foobarbaz' is not available (for R version x.y.z) ``` Why doesn't...

Getting "Lock wait timeout exceeded; try restarting transaction" even though I'm not using a transaction

I'm running the following MySQL `UPDATE` statement: ``` mysql> update customer set account_import_id = 1; ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction ``` I'm not usin...

19 Aug at 13:8

How can I prevent java.lang.NumberFormatException: For input string: "N/A"?

While running my code I am getting a `NumberFormatException`: ``` java.lang.NumberFormatException: For input string: "N/A" at java.lang.NumberFormatException.forInputString(Unknown Source) at...

30 Apr at 02:22

How can I generate a Git patch for a specific commit?

I need to write a script that creates patches for a list of SHA-1 commit numbers. I tried using `git format-patch <the SHA1>`, but that generated a patch for each commit since that SHA-1 value. After ...

22 Jun at 14:7