numeric

Java / Scala math library with elliptic integrals and bessel functions?

為{幸葍}努か 提交于 2019-12-06 05:29:05
问题 I am looking for a math library for scientific computing to use in Java / Scala. Especially I need complete elliptic integrals und modified Bessel functions. I would be nice if it is open source, but I guess I will have to take whatever is out there. A scipy (python lib for scientific computing) replacment would be great :-) 回答1: As far as I'm aware, the most widely used Java math libraries are: The Apache Commons Math library, and The Colt project (developed by CERN) You'll have to

How to convert factor format to numeric format in R without changing the values? [duplicate]

混江龙づ霸主 提交于 2019-12-06 04:53:14
问题 This question already has answers here : How can i convert a factor column that contains decimal numbers to numeric? (4 answers) Closed 6 years ago . Below is dataframe df1 of which I want to convert column "V2" from factor format to numeric without changing the current values (0 ; 0 ; 8,5 ; 3). df1= V1 V2 V3 X2 X3 4470 2010-03-28 0 A 21.53675 0 4471 2010-03-29 0 A 19.21611 0 4472 2010-03-30 8,5 A 21.54541 0 4473 2010-03-31 3 A NA NA Since column "V2" is in factor format I first convert it to

How to convert a string to a numeric in autohotkey?

醉酒当歌 提交于 2019-12-06 03:16:23
FormatTime, CurrentMinute , , m assigns the current minute to variable %CurrentMinute% , and its value is a string, not a numeric. I wanna do some calculations on the value of %CurrentMinute% , so how could I convert it to numeric? Thanks for any help in advance! AutoHotkey automatically converts numbers and strings as needed. FormatTime, CurrentMinute,, m NextMinute := CurrentMinute + 1 来源: https://stackoverflow.com/questions/13106275/how-to-convert-a-string-to-a-numeric-in-autohotkey

Bypass php is_numeric() function is possible?

痞子三分冷 提交于 2019-12-06 02:15:10
I am currently looking for a pass (not blind) high level of category sql injection application dvwa. Can not find the solution even if there are some ideas and tools that make life easier. source code form is as follows for the fans: if (isset($_GET['Submit'])) { // Retrieve data $id = $_GET['id']; $id = stripslashes($id); $id = mysql_real_escape_string($id); if (is_numeric($id)){ $getid = "SELECT first_name, last_name FROM users WHERE user_id = '$id'"; $result = mysql_query($getid) or die('<pre>' . mysql_error() . '</pre>' ); $num = mysql_numrows($result); $i=0; while ($i < $num) { $first =

Android EditText default numeric keyboard and allow text [duplicate]

泪湿孤枕 提交于 2019-12-05 22:21:29
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: EditText with number keypad by default, but allowing alphabetic characters Wondering if it is possible to default to a numeric keyboard on focus for an edittext field but also allow users to input characters? None of the input types seem to support this. Thanks! 回答1: I just tried to add a number text field in Android and it ran in the emulator fine. It defaults to bring up the number pad first, but you can

Scala Generics and Numeric Implicits

拈花ヽ惹草 提交于 2019-12-05 21:13:21
问题 I need to pass two functions as parameters to a scala function. That function should then evaluate them and get a number from them where it will then operate on. This number can be either a Int, Double or any other numeric type. I would like the function to work, whatever the types it is working with. The example bellow explains the issue. import Numeric.Implicits._ class Arithmetic[T : Numeric](val A: Connector[T], val B: Connector[T]) { val sum = new Connector({ A.value + B.value }) } class

prevent long running averaging from overflow?

六月ゝ 毕业季﹏ 提交于 2019-12-05 17:43:56
suppose I want to calculate average value of a data-set such as class Averager { float total; size_t count; float addData (float value) { this->total += value; return this->total / ++this->count; } } sooner or later the total or count value will overflow, so I make it doesn't remember the total value by : class Averager { float currentAverage; size_t count; float addData (float value) { this->currentAverage = (this->currentAverage*count + value) / ++count; return this->currentAverage; } } it seems they will overflow longer, but the multiplication between average and count lead to overflow

The as.numeric function changes the values in my dataframe [duplicate]

扶醉桌前 提交于 2019-12-05 16:12:58
This question already has answers here : How to convert a factor to integer\numeric without loss of information? (7 answers) Closed 5 years ago . I have a column containing speed measurements which I need to change to numeric so that I can use both the mean and sum functions. However, when I do convert them the values change substantially. Why is this? This is what my data look like at first: And here is the structure of the data frame: 'data.frame': 1899571 obs. of 20 variables: $ pcd : Factor w/ 1736958 levels "AB101AA","AB101AB",..: 1 2 3 4 5 6 6 7 7 8 $ pcdstatus : Factor w/ 5 levels

PHP float bug: PHP Hangs On Numeric Value

谁都会走 提交于 2019-12-05 15:58:34
I just read an interesting article about php hanging on certain float numbers, see The Register and Exploring Binary . I never explicitly use floats, I use number_format() to clean my input and display for example prices. Also, as far as I am aware, all input from for example forms are strings until I tell them otherwise so I am supposing that this problem does not affect me. Am I right, or do I need to check for example Wordpress and Squirrelmail installations on my server to see if they cast anything to float? Or better, grep all php files on my servers for float ? Ways to mitigate the

CEdit numeric validation event C++ MFC

夙愿已清 提交于 2019-12-05 14:32:43
I have a CEdit text box which is a part of a property pane and only allows numeric values (positive integers). The box works fine when people enter non-numeric values, but when they delete the value in the box a dialog pops up saying: "Please enter a positive integer." Here is the situation: 1. I have a number (say 20) in the box. 2. I delete the number. 3. I get the error dialog. Could anybody tell me how I can intercept this event and put a default value in there? Here is what my property pane looks like: const int DEFAULT_VALUE = 20; class MyPropertyPane:public CPropertyPane { //....