$.ajax – dataType

contentType is the HTTP header sent to the server, specifying a particular format.Example: I’m sending JSON or XML dataType is you telling jQuery what kind of response to expect.Expecting JSON, or XML, or HTML, etc. The default is for jQuery to try and figure it out. The $.ajax() documentation has full descriptions of these as well. In your particular case, the first is asking for … Read more

R t-test Grouping factor must have exactly 2 levels error

The problem is that your grouping variable has more than two levels, when the t.test requires that you cannot have more than two levels. Here is a reproduction of your error: Here is an example that will run Takeaway: Check the number of levels in your data. If there are more than two, recode or … Read more

Categories R

How do you do exponentiation in C?

use the pow function (it takes floats/doubles though). man pow: EDIT: For the special case of positive integer powers of 2, you can use bit shifting: (1 << x) will equal 2 to the power x. There are some potential gotchas with this, but generally, it would be correct.

Categories C Tags

SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null

You can find the codes in the DB2 Information Center. Here’s a definition of the -302 from the z/OS Information Center: THE VALUE OF INPUT VARIABLE OR PARAMETER NUMBER position-number IS INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE On Linux/Unix/Windows DB2, you’ll look under SQL Messages to find your error message. If the code is positive, … Read more

Arcsine transformation of percentage data

Your column ranges from 0 to 100, and the arcsin can only be applied to numbers from 0 to 1. I’m assuming that these percentages should be scaled from 0 to 1 by dividing by 100, and then take the square root of the rescaled number. Results for the mydata in question: Edit: Changed the data frame … Read more

Categories R