Posts

java - Call start method two times -

java - Call start method two times - why next code throws exception? class mythread extends thread { public static void main (string [] args) { mythread t = new mythread(); t.start(); system.out.print("one. "); t.start(); system.out.print("two. "); } public void run() { system.out.print("thread "); } } could point me out jls ? that's contract of start() method : public void start() causes thread begin execution; java virtual machine calls run method of thread. result 2 threads running concurrently: current thread (which returns phone call start method) , other thread (which executes run method). never legal start thread more once. in particular, thread may not restarted 1 time has completed execution. throws: illegalthreadstateexception - if thread started. you can't start thread twice. java multithreading

Problems in Swift -

Problems in Swift - so got in swift programming , i'm next bloc's tutorial. so, when create block class, copied downwards letter, still says "type 'block' not conform protocol equatable", , have no thought how prepare it. says "consecutive declarations on line must separated ';'", "expected declaration", , "operators allowed @ global scope". here's code: class block: hashable, printable { allow color: blockcolor var column: int var row: int var sprite: skspritenode? var spritename: string { homecoming color.spritename } var hashvalue: int { homecoming self.column ^ self.row } var description: string { homecoming "\(color): [\(column), \(row)]" } init(column: int, row: int, color: blockcolor) { self.column = column self.row = row self.color = color } func == (lhs: block, rhs: block) -> bool { homecoming lhs.column == rhs.column && lhs.row == rhs.r...

logging - Output SQL with log4j in Jaspersoft Studio -

logging - Output SQL with log4j in Jaspersoft Studio - some background first. i'm using jaspersoft studio 5.6.0 final , have followed instructions here setup log4j. i'm trying log4j output sql query when study run. have problem query , need see sql outputed jaspersoft studio. have working datasource setup connection datasource not problem. i thought next instructions @ link above , adding log4j.logger.net.sf.jasperreports.engine.query.jrjdbcqueryexecuter=debug log4j-config.properties file allow me see output sql, it's not working. to run study compile jrxml , click preview tab. since followed instructions in link above, shouldn't sql outputed log4j log file when that? i need working can prepare query. help appreciated. please add together net.sf.jasperreports.engine.query.jrjdbcqueryexecuter = logging-config.properties...also run jasper studio administrator. works me..i using java util logging(-djava.util.logging.config.file=c:/jsslog/config/lo...

codeigniter - MySQL Query - Return data for past 4 months and if no data for a particular month return 0 -

codeigniter - MySQL Query - Return data for past 4 months and if no data for a particular month return 0 - my question similar question: mysql query - homecoming value past 12 months record each month but can't work out how implement query. i require info previous 4 months , if there none output 0 month. here current queries in codeigniter model: function getmonthlysumorders() { $this->db->select("sum(price_each*quantity) sum_monthly_price, date_format(job.order_date, '%m') 'order_date', customer.company_name", false); $this->db->join('job', 'job.job_id = job_details.job_id'); $this->db->join('customer', 'customer.company_id = job.company_id'); $this->db->where('job.company_id', $this->uri->segment(3)); $this->db->where('month(job.order_date)<=', date("m")); $this->db->where('month(job.order_date)>=', da...

angularjs - Ng-grid search bar in the grid -

angularjs - Ng-grid search bar in the grid - right using ng-grid , grid option, showfilter: true this places triangle drop downwards in top right corner of grid, when clicked pops search bar. is there way ng-grid have search bar straight visible in grid without need click triangle? sure, create input text wherever want in view ng-grid: <input type="text" data-ng-model="outside_search_text" placeholder="search" class="form-control" data-ng-change="search()"> <div class="gridstyle" data-ng-grid="gridoptions"> </div> and in controller: $scope.sortoptions = { fields : ['id'], directions : ['desc'] }; $scope.totalserveritems = 0; $scope.gridoptions['sortinfo'] = $scope.sortoptions; $scope.gridoptions['columndefs'] = [ {field ...

mysql - Get ID of php populated select option -

mysql - Get ID of php populated select option - i populate html select drop downwards using info mysql table. need fetch id of alternative , submit different table, have no clue how it. here's how it's populated: $query = $mysqli->query("select racename race order racename"); ?> <select class="pure-input-2" required="required" name="racename"> <option value="" disabled="disabled" selected>select race</option> <?php while($option = $query->fetch_object()){ ?> <option><?php echo $option->racename; ?></option> <?php } ?> </select> how can retrieve id of selected alternative submit different table? i guess in select query select raceid, how can pass through submit button? thanks. like this: $query = $mysqli->query("select raceid, racename race order racename"); ...

ios - What does this mean? "'NSUnknownKeyException', reason:This class is not key value coding-compliant for the key X" -

ios - What does this mean? "'NSUnknownKeyException', reason:This class is not key value coding-compliant for the key X" - i'm trying link uilabel iboutlet created in class. my application crashing next error. mean? how can prepare it? *** terminating app due uncaught exception 'nsunknownkeyexception ', reason: '[&lt;uiviewcontroller 0x6e36ae0> setvalue:forundefinedkey:]: class not key value coding-compliant key xxx.' your view controller may have wrong class in xib. i downloaded project. the error getting 'nsunknownkeyexception', reason: '[<uiviewcontroller 0x3927310> setvalue:forundefinedkey:]: class not key value coding-compliant key string.' it caused second view controller in mainwindow.xib having class of uiviewcontroller instead of secondview . changing right class resolves problem. by way, bad practice have names "string" in objective-c. invites runtime naming col...