w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
error: cannot convert 'double (evaluator::*)(double, double)' to 'double (*)(double, double)' in assignment
This: double (*ope)(double, double); should be: double (evaluator::*ope)(double, double); // ^^^^^^^^^^^^ because you are using a pointer to member.

Categories : C++

TCC invoke a function returning a double
Take a look at your int foo() snippet. You have to remember, this string is the whole compilation unit, just as if you saved it into a C file. Within this compilation unit, get_int() and get_double() are actually undefined. The int version works due to luck, since all undeclared variables and functions have type of int. And this is also the reason why get_double does not work, because the same rule presumes it is in int function. Solution is simple. Just declare your functions in your script. Use a header file or something like: char my_program[] = "double get_double(); " "int get_int(); " "int foo() " "{ " " printf("Hello World!\n"); " " printf("double: %.4f\n", get_double()); " " printf("int: %d\n", get_int()); " " return 0; " "} "; I strongly suggest you use tcc_set_er

Categories : C

Why is find in matlab returning double values
I can only guess, but probably because a wide range of functions only support double. Run setdiff(methods('double'), methods('uint32')) to see what functions are defined for double and not for uint32 on your version of MATLAB. Also there is the overflow issue with integer data types in MATLAB that can introduce some hard to detect bugs.

Categories : Matlab

PHP MYSQL Returning Result Two Times (Double)
You are actually executing (almost) the same query twice: SELECT * FROM 32r07, 32r07names WHERE 32r07.htno = 32r07names.htnon AND 32r07.htno = '$name'; could be rewritten as SELECT * FROM 32r07 INNER JOIN 32r07names ON htno = htnon WHERE 32r07.htno = '$name'; The second query being SELECT * FROM 32r07names WHERE htnon = '$name'; Which is like saying, altogether: ... WHERE htnon = htno = '$name';

Categories : PHP

Scripts returning double spaces to xhr request (ajax)
Try this $.ajax({ url: 'http://192.168.0.6/access/login', data: '{ "user":"' + user+ '",pass":"' + pass+ '",rem":"' + remember+ '"}', type: 'POST', success: function(data) { alert(data.length) if(data=="true") { $('#errorMessage').html(data) ; $('#loginWarn').fadeIn() ; } else { window.location = 'login' } } })

Categories : PHP

UTL_SMTP.WRITE_DATA - returning double DOTs in Oracle
The dot duplication occurs when you have a leading dot at the beginning of one of your substrings. According to: http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/u_smtp.htm#ARPLS71529 The application must ensure that the contents of the body parameter conform to the MIME(RFC822) specification. The DATA routine terminates the message with a . sequence (a single period at the beginning of a line), as required by RFC821. It also translates any sequence of . (single period) in the body to .. (double period). This conversion provides the transparency as described in Section 4.5.2 of RFC821. Try hiding the dot from the dot duplicator when writing message body and attachments by replacing: utl_smtp.write_data(smtp_connection, dbms_lob.substr(l_in_mail_attach,l_am

Categories : Oracle

regex returning true even if comma is not enclosed in double quotes
Because you are creating a character range here : /^\"[a-zA-Z0-9!#$%&\'*+-/=?^_`{|}~;,:<>()@[]]*\"$/ ^^^^^ This means all characters from + to /, this includes also the ,. INside a character class, you don't need to escape the normal regex special characters, but there is another one, that get a special meaning the -. So the correct character class would be /^\"[a-zA-Z0-9!#$%&\'*+-/=?^_`{|}~;,:<>()@[]]*\"$/ The alternative would be to put the - at the start or the end of the character class, in that cases it would not create a range and does not need escaping.

Categories : Javascript

Is there a way to convert a string to a double or int in one statement inside of a JOptionPane?
double inputNum = Double.parseDouble(JOptionPane.showInputDialog(null, "Enter number")); or for int: int inputNum = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter number")); Often consulting the API can answer many questions.

Categories : Java

Returning java regex (words, spaces, special characters, double quotes)
First, you'll need to separate the word-matching code from the string-literal-matching code. For word matching, use: w+ Next there's whitespace. s+ To match strings as one token, you need to allow more characters than just w. That only allows alphanumeric characters and _, which means whitespace and symbols are not. You also need to move the starting and ending quotes outside of the square brackets. And don't forget backslashes to escape characters. You want to allow " inside of strings. "(\.|[^"])+" Finally, there are the symbols. You could list all the symbols, or you could just treat any non-word, non-whitespace, non-quote character as a symbol. I recommend the latter so you don't choke on other symbols like @ or |. So for symbols: [^sw"] Putting the pieces together, we get

Categories : Java

Python if statement returning
Try: if vmtype not in ("VHD", "VMDK"): Your current code parses as: if (vmtype is not ("VHD")) or ("VMDK"): Which is obviously wrong. Since ("VMDK") is a truthy value, the whole statement always be true. Therefore the if statement will always execute. Note that even if you tried if vmtype is not "VHD": It would not work, because is tests identity, not value. You would use: if vmtype != "VHD":

Categories : Python

Returning data from if statement
It's not clear which array you are refering to. The only array you're interacting with in the code is enemyDestroyer, which is immediately released from memory after the assignment. Perhaps you could expand you example so we can get a better understanding of what it is you're trying to do? Update To prevent enemyDestroyer from being instantly released youd have to move it to the appropriate scope. That would mean declaring it in the same scope it's going to be used. I suggest reading up on scopes and perhaps switching to an object oriented design.

Categories : C++

if statement returning true
Because this is wrong if( $imagetype == "image/jpeg" || "image/gif" ) { /*...*/ } Should be if( $imagetype == "image/jpeg" || $imagetype == "image/gif" ) { /*...*/ } Or even if( in_array($imagetype, ["image/jpeg", "image/gif"]) ) { /*...*/ } That is, because non-empty string is considered true, so the IF condition was met.

Categories : PHP

for statement not returning values from array
Syntax error because you forgot a x. Change for (var x = 0; < vowel.length; x++) { to for (var x = 0; x < vowel.length; x++) {

Categories : Javascript

Returning a value without an explicit return statement
The definitive material on this subject is the latest ES Harmony specification draft, and specifically the part derived from the arrow function syntax proposal. For convenience, an unofficial HTML version can be found here. In short, this new syntax will allow the definition of functions much more concisely. The ES spec draft has all the detail, I 'll explain very roughly here. The syntax is ArrowParameters => ConciseBody The ArrowParameters part defines the arguments that the function takes, for example: () // no arguments arg // single argument (special convenience syntax) (arg) // single argument (arg1, arg2, argN) // multiple arguments The ConciseBody part defines the body of the function. This can be defined either as it h

Categories : Javascript

mysql having statement returning no rows
The problem with your query is the having statement. What you want to do is a MIN(datediff(order_date,fifo_date_in)) as ddiff in the select which will find the lowest value of the difference. You then use your group by to group the results. Scratch my comment from before, your group by is actually correct: drop table if exists tmp; create table tmp ( order_sequence int, order_number int, order_date date, fifo_date_in date, fifo_cost float); INSERT INTO tmp (order_sequence, order_number, order_date, fifo_date_in, fifo_cost) VALUES (5613, 561, '2013-01-02','2009-01-01',1.55); INSERT INTO tmp (order_sequence, order_number, order_date, fifo_date_in, fifo_cost) VALUES (5613, 561, '2013-01-02','2009-02-01',2.55); INSERT INTO tmp (order_sequence, order_number, order_date, fifo_date_in, fifo_c

Categories : Mysql

Javascript if statement returning wrong value
It looks like your checkHour variable is loaded with the date. You never set it's value to the hours. Perhaps you meant the second line to read: checkHour = checkHour.getHours();, so your corrected code would be: var checkHour = new Date(); checkHour = checkHour.getHours(); function time(){ if((checkHour >= 0) && (checkHour <= 12)){ alert(" Good Morning"); }else if((checkHour >= 12) && (checkHour <= 18)){ alert("Afternoon"); }else{ alert("Good Evening") } }

Categories : Javascript

SELECT statement with sqlsrv_query not returning results
You should change your identical operator(===) to equal operator(==). Your $rows should actually contain values and you can test that by doing print_r($rows) or vardump($rows) I tested this: $rows = array(1=>"a",2=>"b"); if ($rows === true) echo "There are rows. <br />"; else echo "There are no rows. <br />"; This does return "There are no rows" but if you change "===" to "==", you should be getting the "There are rows" answer. 1 == 1 is true 1 === '1' is not true (left val is an integer, the other is a string) 1 == '1' is true (disregards variable type) I hope this helps.

Categories : PHP

MySql join statement returning too many results
Please use operator 'AND' instead of '&'. And as I understand you need something like that (do not know do you need the where clouse): select routes.route_collection, times.times from routes inner join times on routes.bus_id = times.bus_id where routes.bus_id = 1; May be you need aggregated values of times? something like this: select routes.route_collection, GROUP_CONCAT(times.times) from routes inner join times on routes.bus_id = times.bus_id where routes.bus_id = 1 group by routes.route_id;

Categories : Mysql

Match statement using * and % neither returning precise results
Best would be to put the address in quotes and don't use a wildcard at all: AGAINST ('"someemail@email.com"' IN BOOLEAN MODE) Like that. And I don't think you need the boolean mode for this.

Categories : PHP

Clojure functions - returning value computed before the last statement
You can do this using a finally block. (try (+ 2 3) (finally (+ 6 7))) produces a result of 5 not 13. Here is the relevant doc page. The releavant part is: any finally exprs will be evaluated for their side effects. Another option would be to write a macro like with-open to start and stop your server while returning the right results. Though that just moves the problem to how do you write the macro, since it would either need to use a let or the try finally construct above.

Categories : Function

Switch statement in PHP/javascript returning 'undefined'
i dont know what is row.currency here. But i tried this and it worked fine for me. $(document).ready(function() { var currency = ""; var row={currency:1}; switch (row.currency) { case 1 : currency = "&pound;"; break; case 2 : currency = " &#36;"; break; case 3 : currency = "&euro;"; break; default: currency = "&pound;"; break; } $('<td>'+currency+'<input type="text"> </td>').insertAfter("p"); }); so may be it is the problem with your row.currency. so check it again or share your code.

Categories : Javascript

Is the use of the RETURNING INTO clause faster than a separate SELECT statement?
Just as I thought: Often, applications need information about the row affected by a SQL operation, for example, to generate a report or take a subsequent action. The INSERT, UPDATE, and DELETE statements can include a RETURNING clause, which returns column values from the affected row into PL/SQL variables or host variables. This eliminates the need to SELECT the row after an insert or update, or before a delete. As a result, fewer network round trips, less server CPU time, fewer cursors, and less server memory are required. Taken from Oracle docs here

Categories : Oracle

Parsing bank statement and returning values from 2d array
You have already gotten the text of each cell into the table_array. You just need to get the right cell. It is a 2D array, so the first index is the row and the second index is the column. Note that the array is 0-based index (ie 0 represents the first row/column). # type in the first row puts table_array[1][2] #=> "FPO" # person in the first row puts table_array[1][1].split[0] #=> "person2" # out value in the second row puts table_array[2][4] #=> "599.91" Working with these indicies is not so nice. As well, the splitting of the description column is harder at this point. Instead, I would suggest creating a hash for each row. table_array = Array.new table_rows = $browser.table(:class,'statement smartRewardsOffers') table_rows.rows.to_a[1..-1].each do |row| row_hash = Hash.

Categories : Ruby

mysqli_stmt::execute() returning false and statement not executing
Either set mysqli into Exception mode mysqli_report(MYSQLI_REPORT_ALL); or always check the result of every mysqli operation and throw mysqli error manually: $result = $stmt->execute(); if (!$result) { throw new Exception($mysqli->error"); } this is the only way to know what's wrong with your execute(); I have found that the SQL syntax apparently needs quotation marks around the fields for the VALUE Of course it is wrong. SQL syntax apparently needs quotation marks around strings only.

Categories : PHP

Sinatra crashes when returning a hash from an eval statement
So it turns out you can't have a Sinatra get request that doesn't return anything. So, when I change my method to: class Controller < Sinatra::Base get '/hello/:id' do result = eval("$sites['dog'].gmailOpen(1)") "I have to return something." end end I no longer got the error. Thank you to everyone who took the time to look at this question, it encouraged me to think critically about my problem.

Categories : Ruby

Oracle's RETURNING INTO usage in Java (JDBC, Prepared Statement)
To get auto generated key we have method getGeneratedKeys method in preparestatement which return resultset that contain key value all we need is pass key column name to preparestatement pstm = con.prepareStatement("insert query",new String[]{primarykeycolumnname}); int i = pstm.executeUpdate(); if (i > 0) { ResultSet rs = pstm.getGeneratedKeys(); while(rs.next()) { System.out.println(rs.getString(1)); } }

Categories : Java

Does double.IsInfinity(value) cover double.IsPositiveInfinity(value) and double.IsNegativeInfinity(value))?
Yes, the extra checks are redundant. As noted on MSDN for Double.IsInfinity: Returns a value indicating whether the specified number evaluates to negative or positive infinity

Categories : C#

mysql select statement not returning rows where some tables in query aren't populated
Use left join on tables where the value may not be present. If you have two tables A and B an inner join will only return the rows from A where the join condition is met. A left join will return all rows from A regardless of if the join condition is satisfied. Columns in the select statement associated with B will be null when a left join is used. I have only added the left join to the tables you have indicated. If other tables may not satisfy the join condition change the join type from inner to left. Select st.station_id, st.station_name , st.st_town, st.st_state, c1.country_name, o1.organisation_name, som1.equity, st.river_basin, st.cost, st.cost_ref, st.comm_year,cg1.caporgen, ht1.hydro_name, cg1.value, srs1.srs_description, cg1.ref_year FROM station st inner join station_cou

Categories : Mysql

Double quotes inside single quotes in oracle statement
I don't think the problem comes from your column name, as shown in this working example: SQL> CREATE TABLE trytable (ID VARCHAR2(10), "DEFAULT" NUMBER); Table created SQL> BEGIN 2 EXECUTE IMMEDIATE 3 'INSERT INTO trytable (ID, "DEFAULT") VALUES (''monkey1'', 0)'; 4 END; 5 / PL/SQL procedure successfully completed Technically, you can have a table column name named DEFAULT, even if it's generally a bad idea that will lead to confusion. You will only be able to interact with it through the double-quote " syntax because DEFAULT is a reserved word. If you specify double quotes around identifiers, Oracle will treat them as case-sensitive, so you have to make sure that they match the table specs. In your case, it would help to have the specific error message.

Categories : Oracle

Why would you use float over double, or double over long double?
The basic principle here would be don't use more than you need. The first consideration is memory use, you probably realized that already, if you are making only one double no big deal, but what if you create a billion than you just used twice as much memory space as you had too. Next is processor utilization, I believe on many processors if you use smaller data types it can do a form of threading where it does multiple operations at once. So an extension to this part of the answer is SSE instructions basically this allows you to used packed data to do multiple floating point operations at once, which in an idealized case can double the speed of your program. Lastly is readability, when someone is reading your code if you use a float they will immediately realize that you are

Categories : C++

Warning: Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT
There is no way to rewrite the sql to not throw that error message. Any sort of order will throw that message as the slave might have different rows then the master. mixed will solve it, as it will only switch to row based replication when a statement is not safe to replicate with statement.

Categories : Mysql

How to catch opening double quotes and closing double qoutes with a regular expression?
You can perform an automatic replacement (in the TextChanged Event of the TextBoxes, as shown below; or just before dealing with the given String). For example: Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged TextBox1.Text = TextBox1.Text.Replace(ChrW(8220), "") TextBox1.Text = TextBox1.Text.Replace(ChrW(8221), "") TextBox1.Text = TextBox1.Text.Replace("""", "") If (TextBox1.TextLength > 0) Then TextBox1.Select(TextBox1.TextLength, 1) End If End Sub This code does not allow users to write ",“ or ”. The reason for a so complicated code is that dealing with "curvy" double quotes (as the ones in your sample code) is not straightforward: VB.NET considers them as normal double quotes in mos

Categories : Asp Net

The method println(double) in the type PrintStream is not applicable for the arguments (String, double)
you are looking for System.out.println("The cost of your movie tickets before is " + aprice); + concatenates Strings. , separates method parameters.

Categories : Java

SQLite update to change double-double quotes ("") to regular quotation marks (")?
SQLite uses single quotes to escape string literals. It escapes single quotes by adding another single quote (likewise for double quotes). So technically as long as your SQL is well constructed, the import process should work properly. The strings should be enclosed in single quotes, and not double quotes. I suspect that your code may be constructing the SQL by hand instead of binding/properly escaping the values. SQLite has a built in function to quote string's. It's called quote. Here are some sample inputs, and the corresponding output: sqlite> SELECT quote("foo"); 'foo' sqlite> SELECT quote("foo ""bar"""); 'foo "bar"' sqlite> SELECT quote("foo 'bar'"); 'foo ''bar''' So you could remove the twice escaped double quote before it even goes to SQLite using NSString methods. [@

Categories : Iphone

ANTLRv4: How to read double quote escaped double quotes in string?
Like this: STRING : '"' (~[ "] | '""')* '"' ; where ~[ "] | '""' means: ~[ "] # any char other than ' ', ' ' and double quotes | # OR '""' # two successive double quotes And is it possible to rewrite it to turn double double quotes in single double quotes? Not without embedding custom code. In Java that could look like: STRING : '"' (~[ "] | '""')* '"' { String s = getText(); s = s.substring(1, s.length() - 1); // strip the leading and trailing quotes s = s.replace("""", """); // replace all double quotes with single quotes setText(s); } ;

Categories : Ant

Model binder can't handle double.MAX string representation back to double
I'm using @Html.HiddenFor to create the hidden input. After carefully reading Scott's post I saw that he mentions the round-trip specifier. I also found an example here on StackOverflow. The R stands for "round-trip". From MSDN: This format is supported only for the Single and Double types. The round-trip specifier guarantees that a numeric value converted to a string will be parsed back into the same numeric value. So I did this: @Html.HiddenFor(m => m.Maximum, new { Value = Model.Maximum.ToString("R") }) Now this gives me a double.MAX string representation that can be round-tripped back to a double on the controller side: 1.7976931348623157E+308 Nice... problem solved. Hope it helps anyone that might face this same problem in the future. How int

Categories : Asp Net Mvc

create a field in solr that will index both a double value and the floor of that double value
You can try these options :- If you are feeding the data, handle it on the client side to index it as a multivalued field with both the values, the double as well as the rounded one If you are using DIH you can easily use the ScriptTransformer to convert it into multivalued fields Example - Data Config - Add custom field - <script><![CDATA[ function addfield(row){ var fieldName = row.get('double_value'); // Round it row.put(fieldName, double_rounded); return row; } ]]></script> Else, just write a Custom filter which would store both the Original token and the Rounded value in the index. With the fields being Mark Float, the Range Queries also should work fine.

Categories : Solr

c++ fastest way to write vector to file
Serializing of the coordinates can be parallelized by dividing the input across several threads and then joining the return values from them. Then writing the returned value to the file. This way we can speed up the process.

Categories : C++

Manually convert string to double java without using parse double
This is how oracle does it :) http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html#valueOf(java.lang.String) final String Digits = "(\p{Digit}+)"; final String HexDigits = "(\p{XDigit}+)"; // an exponent is 'e' or 'E' followed by an optionally // signed decimal integer. final String Exp = "[eE][+-]?"+Digits; final String fpRegex = ("[\x00-\x20]*"+ // Optional leading "whitespace" "[+-]?(" + // Optional sign character "NaN|" + // "NaN" string "Infinity|" + // "Infinity" string // A decimal floating-point string representing a finite positive // number without a leading sign has at most five basic pieces: // Digits . Digits ExponentPart FloatTypeSuffix // // Since this method allows integer-only

Categories : Java

What is the best way to recognize and convert these "minimum" double values into C# Double.MinValue?
You seem to want to check if a double is really small and positive or really big, finite, and negative. (Others have detailed some problems with your approach in the comments; I'm not going to go into that here.) A test like this: if (d == d && (d > 0 && d < 1e-290 || d < -1e270 && d + d != d)) might do roughly what you want. You'll probably need to tweak the numbers above. The d == d test is checking for NaN, while the d + d != d test is checking for infinities.

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.