Search Results

Search found 39082 results on 1564 pages for 'magic function'.

Page 134/1564 | < Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >

  • what's wrong with this function?

    - by Joann
    function get_ibo_id() { if($registerquery = $this->conn->query("SELECT ibo_id FROM fasttrack WHERE count < 8 && flag = 1 ")){ $this->increase_count(); while ($row = $registerquery->fetch_assoc()) { return $row[ibo_id]; } } else return "No id"; } it always enters the if block even if the condition is not satisfied... going crazy

    Read the article

  • need help writing an emacs function

    - by murtaza52
    I want to write an emacs function that does the following - 1) Start a new shell named "abc". 2) Change the dir "/opt/abc" 3) In the dir run a shell command "python abc.py" I have written the following fucntion - (defun abc-server () (interactive) (shell-command "cd /opt/abc/") (shell-command "python abc.py")) The problem with the above - 1) It doesnt start a new shell 2) It doesnt change the dir. 3) When the cmd executes, it opens a browser window, which completely blocks any usage of emacs.

    Read the article

  • How to execute Javascript function in C++

    - by owais masood
    Please tell me, how to include a javascript header file or javascript function in C++ code. The C++ code is written in Linux(UBUNTU)? Although i need to perform the above action only, but let me tell u my purpose of doing it, as i am intending to implement CTI (Computer Telephony Integration) operation. (Help will be appreciated) Thanks a lot in advance

    Read the article

  • Ajax function not called when included

    - by Sev
    I have an ajax function that is not run when the ajax script is included in my HTML page like so: <script type='text/javascript' src='ajax.js'></script> However, if I place the exact same script in the head portion of the HTML page, then it does run. Why does this occur, and how can I fix it?

    Read the article

  • Problem using generics in function

    - by JAVA
    Hi all, I have this functions and need to make it one function. The only difference is type of input variable sourceColumnValue. This variable can be String or Integer but the return value of function must be always Integer. I know I need to use Generics but can't do it. public Integer selectReturnInt(String tableName, String sourceColumnName, String sourceColumnValue, String targetColumnName) { Integer returned = null; String query = "SELECT "+targetColumnName+" FROM "+tableName+" WHERE "+sourceColumnName+"='"+sourceColumnValue+"' LIMIT 1"; try { Connection connection = ConnectionManager.getInstance().open(); java.sql.Statement statement = connection.createStatement(); statement.execute(query.toString()); ResultSet rs = statement.getResultSet(); while(rs.next()){ returned = rs.getInt(targetColumnName); } rs.close(); statement.close(); ConnectionManager.getInstance().close(connection); } catch (SQLException e) { System.out.println("???????? ?? ???? ?? ???? ?????????!"); System.out.println(e); } return returned; } // SELECT (RETURN INTEGER) public Integer selectIntReturnInt(String tableName, String sourceColumnName, Integer sourceColumnValue, String targetColumnName) { Integer returned = null; String query = "SELECT "+targetColumnName+" FROM "+tableName+" WHERE "+sourceColumnName+"='"+sourceColumnValue+"' LIMIT 1"; try { Connection connection = ConnectionManager.getInstance().open(); java.sql.Statement statement = connection.createStatement(); statement.execute(query.toString()); ResultSet rs = statement.getResultSet(); while(rs.next()){ returned = rs.getInt(targetColumnName); } rs.close(); statement.close(); ConnectionManager.getInstance().close(connection); } catch (SQLException e) { System.out.println("???????? ?? ???? ?? ???? ?????????!"); System.out.println(e); } return returned; }

    Read the article

  • static thread function access non-static class member in C++

    - by user397390
    Class Test{ int value; static void* thread_func(void* args){ value++; } void newthread(){ pthread_create(&thread_func,...); } } I'm trying to create a thread in Class Test. Therefore compiler forces me to make thread_func static. However I cannot access the non-static member "value" anymore. It says: invalid use of member 'Class::value' in static member function Is there a way around it?

    Read the article

  • PHP Array in MySQL IN() function?

    - by Trez
    Is it possible to assign php array in MySQL IN() function? for example, $numbers = array('8001254656','8886953265','88864357445','80021536245'); $sql = mysql_query("SELECT * FROM `number_table` WHERE `number` IN ($numbers)"); Any Ideas? Thanks,

    Read the article

  • Looking for a fast hash-function.

    - by Julian
    Hello, I'm looking for a special hash-function. Let's say I have a large list of strings, if I order them by their hash-values they should be ordered quasi randomly. The most important point is: it must be super fast. I've tried md5 and sha1 and they're using to much cpu power. Clashes are not a problem. I'm using javascript, so it shouldn't be too complicated to implement.

    Read the article

  • How can I pass a C++ member function to a C API as a parameter

    - by michael
    Hi, In my C++ program, I need to call this c API: GConn* gnet_conn_new (const gchar *hostname, gint port, GConnFunc func); where GConnFunc is defined as: void (*GConnFunc) (GConn *conn); My question is if I have a C++ class and have a member function like Class A { public: A(); void my_func (GConn* conn); } In my A::A() Constructor, how can I pass this-myfunc to gnet_conn_new as the GConnFunc parameter? Thank you.

    Read the article

  • Javascript !something && function()

    - by cpf
    Hi Stackoverflow, I have been looking at the source code of raphael (http://raphaeljs.com/index.html) and I see a lot of stuff like !variable && function() (e.g.: !svg.bottom && (svg.bottom = this); ) What does that exactly do? Does it check first and execute only if not true? Thanks.

    Read the article

  • computed column with aggregate function

    - by Kindson
    I have seven columns in my table: hours, weight, status, total_hours, total_weight and percentage total_weight = weight where status = 'X' total_hours = hours where status = 'X' percentage = total_hours/sum(weight) sum(weight) is an aggregate function I would like to specify formula to generate the three computed columns. What do i do?

    Read the article

  • A 16-digit hashing function

    - by Aly
    Is there a hash function that returns a 16-digit hex value (as MD5 returns 32-digit), or is there a library (for C++) in which I can use MD5 or SHA-1 which returns a 16-digit value

    Read the article

  • Create a new instance in a static function of an abstract class

    - by arno
    abstract class db_table { static function get_all_rows() { ... while(...) { $rows[] = new self(); ... } return $rows; } } class user extends db_table { } $rows = user::get_all_rows(); I want to create instances of a class from a static method defined in the abstract parent class but PHP tells me "Fatal error: Cannot instantiate abstract class ..." How should I implement it correctly?

    Read the article

< Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >