Posts

java - Testing Throughput of postgres database using thread pool and connection pool. But why do I only have 300 inserts per second when it should be 6000? -

i want test throughput of system has connection postgresql database. system consists of 2 main components: threadpoolexecutor newfixedthreadpool maximum of 10 threads , pgpoolingdatasource called connectionpool has maximum of 10 connections database. call stored procedures in postgres database, stored procedure simple insert , returns error message if insert failed. executing single call of stored procedure takes 20-30 ms. the system works this: main thread creates message tasks , passes them thread pool. message task following: gets connection connection pool , calls stored procedure on postgres server. waits response , task finished. thread in thread pool can work on new message task. now, think should work fine , extent. slow , have absolutely no idea why. using following code record 300-500 inserts second when should 6000 inserts per second. have no idea why. when using systems monitor, see cpus @ 20% load. when uncomment section indicated (1), 1 cpu @ 100% load while othe...

AngularJS validation errors -

i have working form ngmessages. my issue when displayed form , empty, not want show errors, when user has focused out input. is possible? use $touched : snippet: var app = angular.module('app', ['ngmessages']); app.controller('mainctrl', function($scope) { // js code }); <!doctype html> <html ng-app="app"> <head> <script src="https://code.angularjs.org/1.5.7/angular.js"></script> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" /> <script src="http://code.jquery.com/jquery-2.0.3.min.js"></script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> <script src="https://code.angularjs.org/1.4.7/angular-messages.js"></script> </head> <body ng-controller="mainctrl"> ...

Django Channel web sockets - append message to Model.objects -

lately, i've been investigating onto integrating web sockets django. according documentation, using channels way go. given illustrative model query class request(models.model): id = models.integerfield(name="id", primary_key=true) query = models.charfield(name = 'query', max_length=1024) i want have web application connected web socket server. when web socket server receives message, should broadcast message particular subset of socket connections established client. the client (namely web browser), once receiving broadcasted message, should append request.objects . there on, list of queries should automatically updated using django templates , within defined model - without forcing user explicitly refresh it. hence, questions of mine are: (i) using channels (if preferred way of dealing web socket connections in django), how can append newly arrived query object query.objects - without storing object database because has been inserted prio...

java - How to obfuscate request properties in tomcat log file -

i have rest based weapp runs on tomcat. every time hit of rest endpoints on server - log request details written in log file. how can configure tomcat obfuscate sended values of json request. ex. instead of: { "country": "usa" } be: {"country":"******"} thanks! inorder apply masking on filter . need perform this.. http://vozis.blogspot.com/2012/02/log4j-filter-to-mask-payment-card.html

vba - Writing from one instance of Excel to another open instance -

Image
i using workbook display operator data. work book open , needs stay open. im trying open different instance of excel , have write , update values on open display workbook. path workbook g:\tls-shared\maintenance\powder line display\input.xlsm , open workbook g:\tls-shared\maintenance\powder line display\display.xlsm need transfer 7 columns, 30 rows of each column input.xlms sheet name "data" open book sheet name displaydata. need regularly update or click button update. copy data input workbook , in display workbook (has in same excel instance) click paste > paste link now in data tab can click refresh update data when needed you can change connection property refresh every minute: works if input workbook closed.

php - Invalid query: You have an error in your SQL syntax; syntax to use near -

i have problem error , don't know how solve it. know many have issues issue can not orient. problem: invalid query: have error in sql syntax; check manual corresponds mysql server version right syntax use near 'from `user` `id` = 0' @ line 6 code: <?php function fetch_users(){ $result = mysql_query('select `id` `id`, `username` `username` `user`'); $users = array(); while(($row = mysql_fetch_assoc($result)) !== false){ $users[] = $row; } return $users; } // fetches profile information given user. function fetch_user_info($id){ $id = (int)$id; $sql = "select `username` `username`, `firstname` `firstname`, `lastname` `lastname`, `email` `email`, `user` `id` = {$id}"; $result = mysql_query($sql); if (!$result) { die('invalid query: ' . mysql_error()); } return mysql_fetch_assoc($result); } ?> remove ...

android - Can navigation drawer be set behind the content? -

is possible set main content frame on top of navigation frame, making content slide navigation tab? i think this library looking for. check out its demo on play store see how works.