Posts

sql - DELETE in [validating two fields] -

i (and find) seeking ways validate 2 fields delete. i.e. delete x_table idreserva in (.........) , might work, there series associated same numbers, , likelihood of more things eliminate me accurate, 100%. possessing different series, different numbers. ie baao/300. caao/300. with above statement, deleted 2 records, , above wanted eliminate: baao/300. i looking like: delete x_table idreserva , serie in (.........) or if there otherwise grateful. your statement right, it's not sql valid, can use following valid statement: delete x_table idreserva in (...) , serie in (....)

java - How to put JFrame with jmathplot graph in JPanel -

Image
note : question follow question this question . i have learned following last question: jpanel has flowlayout (with same output nulllayout ! on resize), accepting preferredsize , child aren't resizable container, required use borderlayout / gridlayout simple graph a demonstration of principle given: import java.awt.borderlayout; import java.awt.dimension; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.swingutilities; import org.math.plot.plot2dpanel; import java.awt.borderlayout; import java.awt.dimension; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.swingutilities; import org.math.plot.plot2dpanel; public class myplot { private jframe frame = new jframe("jmathplot library in swing application."); private jpanel panel = new jpanel(); public myplot() { double[] x = new double[]{0, 1, 2, 3, 4, 5}; double[] y = new double[]{10, 11, 12, 14, 15, 16}; plot2dpanel plot = n...

matlab - How to save the life of my process? -

i have following problem: want run cumbersome calculation on server via putty in matlab. not want keep notebook whole time connected server, why searching solution problem. know screen in general works not sure whether me here too. problem following: each time start matlab program have no longer control on terminal, since matlab program still running. therefore forced abort process, not want happen. there me. what need this: 1.)start matlab application on server 2.)disconnect server 3.)connect server 4.)have access matlab again i highly appreciate it, if give me reference commands might helpful in situation. as @peter said, screen 1 solution. brief tutorial: connect server screen -s sectionname matlab -nosplash -nodesktop or -nodisplay or -nojvm depending if have allowed x11 forwarding on putty (you can check open figure , check if can see -nodesktop option) ctrl+a d detach log out reconnect server if using x11 forwarding, may need update display o...

Creating a user-defined function with SQL::Statement::Functions in Perl creates a syntax error -

i trying work udfs, defined through sql::statement::functions in perl mysql database in backend. playing book, stated in http://metacpan.org/pod/sql::statement::functions#user-defined-functions , however, before leave square one, error in create function statement rearing ugly head. here's code first ($dbh given , works fine, part of bigger construct of framework working with, don't want spam question of it; if replace foo() in select 22, or "_pk locations", , 22 or value corresponding query in data::dumper, so, connection ok): use data::dumper; use sql::statement::functions; sub foo { return 999; } #$dbh defined elsewhere $dbh->do("create function foo") or die "error creating function foo(); " . $dbh->errstr; $sth = $dbh->prepare("select foo(22)") or die "error preparing query: " . $dbh->errstr; $sth->execute or die "error executing query: " . $sth->errstr; $row = $sth->fetchrow_arr...

javascript - Where is the `listen` Function in Node.js Defined -

i'm poking around node.js internals, , came across following method definition //file: node/lib/net.js socket.prototype.listen = function() { debug('socket.listen'); var self = this; self.on('connection', arguments[0]); listen(self, null, null, null); }; within socket object's listen method, there's call (seemingly) global function, named listen . listen(self, null, null, null); where javascript method/function defined? i've scoured javascript files in code-base , can't seem find it. (there's no specific task i'm trying accomplish here, other tracing node's execution path , trying understand patterns in use deep in system.) it's defined farther down in net.js . of 0.11.5, it's @ line 1089 : function listen(self, address, port, addresstype, backlog, fd) { if (!cluster) cluster = require('cluster'); if (cluster.ismaster) { self._listen2(address, port, addresstype, backlog, fd);...

Using jquery to dynamically choose an audio file to load into HTML5 player -

i'm trying populate html5 player in modal via jquery. goal play 1 of 2 mp3s based on whether invited website, or registered on own. have hidden field stores src path , want jquery function load audio file based on src. on page load, audio file isn't loading player. not sure i'm missing, appreciated. html <asp:hiddenfield id="hidmodalmsg" runat="server" /> /*unrelated code*/ <div class="audio" runat="server"> <audio id="modalplayer" onload="('#modalplayer').src='';" controls="controls"> <p>your browser not support audio element.</p> </audio> </div> jquery in header $(function () { var audplayer = $('#modalplayer'); audplayer.src = $('#<%= hidmodalmsg.clientid%>').val(); }); as audio source different file different browsers, changing audio src directly not work. has changed based on b...

php - Auto Refresh a Html table every x seconds -

i attempting refresh table have variables in there updated , want re-update variable every few seconds. have done code on part giving table id , creating div it. code explain actually. in advance ! edited: added var table , var refresher. code still wont reload table !any ideas?? test.php <html> <head> <script type='text/javascript'> var table = $('#tableid'); // refresh every 5 seconds var refresher = setinterval(function() { table.load("1103242b/processing/js.php"); }, 5000); settimeout(function() { cleartimeout(refresher); }, 1800000); </script> </head> <body> <?php include_once'js.php'; ?> </body> </html> js.php <?php require_once 'connect.php'; include 'start.php'; include 'functions.php'; header("cache-control: no-cache,no-store"); $query = "select * opentrades"; //you don't need ; in sql $result = mysql_query($...