Posts

Showing posts from May, 2011

java - Spring/Hibernate/Oracle: ORA-02289 Sequence Does Not Exist? -

getting java.sql.sqlsyntaxerrorexception: ora-02289: sequence not exist when trying insert new object oracle table. table have sequence automatically increments upon each entry. i've been stuck on few hours , after following similar answers question , other articles, i'm still stuck. my class: import java.sql.timestamp; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.generatedvalue; import javax.persistence.generationtype; import javax.persistence.id; import javax.persistence.sequencegenerator; import javax.persistence.table; import org.springframework.stereotype.component; @entity @table(name = "my_schema.my_table") @component public class someclass { @id @sequencegenerator(name = "my_seq", sequencename = "my_seq", allocationsize = 1) @generatedvalue(strategy = generationtype.sequence, generator = "my_seq") @column(name = "my_id") private integer myid;

javascript - Access to a text node? -

i want access textnode (passengers here) can't. i'm using javascript , xmldoc. have null , undefined error this xml file : <functionalinstance> <id value="100177" type="humaninstance"> <mandatory> <externalid type="string">passenger.1</externalid> <relation ownerreference="100171" reference="100172"/> this function : function collectid() { for(var = 0; < acteurs.length; i++) { var actortag =xmldoc.getelementsbytagname("functionalinstance")[0].childnodes[i].getelementsbytagname["mandatory"].childnodes[0].nodevalue; alert(actortag); } } thank help

mysql - Get data where MAX(date) < X -

i have 2 tables one-to-many relationship. table1 id name email table2 id table1_id date i need data table1 where : max(date) table2 < "2016-01-01" this doesn't work. max considered "invalid" in clause. did : select table1.name, table1.email, tmp.maxdate table1 join ( select max(date) maxdate, table1_id table2 group table1_id ) tmp on tmp.table1_id = table1.id tmp.maxdate < "2016-01-01" , (other conditions) so works. think performance going awful - explain shows table2 being read, , table grow lot. any idea on how otherwise, or how improve current query performances ? try: select table1.name, table1.email, tmp.maxdate table1 inner join ( select max(date) maxdate, table1_id table2 group table1_id having maxdate > "2016-01-01" ) tmp on tmp.table1_id = table1.id , (other conditions) before, bringing table2 , join table1. knock off

datetime - Getting warning message 1 failed to parse while running wday fuction of lubridate package in r -

i trying day name using wday(ymd("2014/09/30","%y/%m/%d"), label = t) output getting is #[1] 3 na #warning message: #1 failed parse. can please let me know why getting error? you don't need argument "%y/%m/%d" . just use: wday(ymd("2014/09/30"), label = t) output then: # [1] tues # levels: sun < mon < tues < wed < thurs < fri < sat

python - Is it possible to overload operators for native datatypes? -

for example, if try do: a_string + an_int ... a_string type 'str' , an_int type 'int', or: an_int + a_string there typeerror because there no implicit conversion of types. understand if using own subclasses of int , string, able overload __add__() method in classes achieve this. however, out of curiosity, know: possible overload + operator in class definitions of int , str , __add__(int,str) , __add__(str,int) automatically concatenate them strings? if not, reasons why programmer should not overload operators native datatype? in general, without reverting c-level api, cannot modify attributes of builtin types (see here ). can, however, subclass builtin types , want on new types. question asked (making addition string based), you'd modify __add__ , __radd__ : class int(int): def __add__(self, other): return int(int(str(self) + str(other))) def __radd__(self, other): return int(str(other) + str(self)) >>

radio button - Set UltraGrid to ReadOnly property, vb.net -

in project, have form has 3 radio buttons, ultragrid, , textbox. when load form, want ultragrid readonly , or equivalent of this, , want become active again when rbcategory checked (one of radiobuttons). need set readonly again if 1 of other 2 radio buttons selected. i feel readonly not property can used ultragrids, equivalent (to make grey, readonly textbox, basically), , how coded? i tried using ugcategories.displaylayout.override.allowupdate = defaultableboolean.false but didn't seem job by setting allowupdate making grid read-only. if need change grid appearance need set appearance read-only cells this: ugcategories.displaylayout.override.readonlycellappearance.backcolor = color.gray; further, may consider set , cellclickaction cellselect this: ugcategories.displaylayout.override.cellclickaction = infragistics.win.ultrawingrid.cellclickaction.cellselect; you may check this article more helpful information mike saltzman - infragistics win forms

css - Why doesn't the @media query change elements on particular screen sizes? -

playing around @media queries bootstrap 3. following query structure has come multiple times while looking @ tutorials. however, i'm still having issues. min-width: 1200px renders font size (92px) , background (red) correctly, min-width: 992px renders font size (48px) , background (green) correctly. however, when go lower two, min-width: 768px , max-width: 768px, attributes not applied elements. appreciate bit of help! @media(max-width:767px){ .jumbotron h1 { font-size: 12px; } body { background: yellow; } } @media(min-width:768px){ .jumbotron h1 { font-size: 24px; } body { background: blue; } } @media(min-width:992px){ .jumbotron h1 { font-size: 48px; } body { background: green; } } @media(min-width:1200px){ .jumbotron h1 { font-size: 92p

node.js - How to delete a info with ID from JSON based data -

the content of json file is: retails.json file.actually retails database.i converted json file sql database.so in json file, want delete person information single id.how can do? using node.js , express. { "categories" : [ { "dept_id" : "123", "category_name" : "database", "category_discription" : "list of database", "current time" : "2016-07-21 06:27:17", "id" : "1" }, { "dept_id" : "1234", "category_name" : "debugging", "category_discription" : "program debugger", "current time" : "2016-07-21 06:32:24", "id": "2" }, { "dept_id" : "12345", "category_name" : "system analyzer", "category_discription" : null, "current time" : "2016-07-21 06:33:23", "id" : "3" } ], "departments"

swift2 - tvOS: A way to have UISearchController not appear as a button? -

this code var searchcontroller: uisearchcontroller! @iboutlet weak var collectionview: uicollectionview! override func viewdidload() { super.viewdidload() searchcontroller = uisearchcontroller(searchresultscontroller: nil) searchcontroller.searchresultsupdater = self searchcontroller.obscuresbackgroundduringpresentation = false view.addsubview(searchcontroller.searchbar) getitems() } produces this: screeshot1 note searchbar appears button stuck in upper left (because tabbed app appears under tab bar when first presented. "button" button there receive focus testing). this how looks after pressing button: screenshot2 the second image shows how things when search tab opens, , way though supposed in tvos. how searchcontroller appear in second screenshot? many tvos apps this, know must possible. have been on documentation carefully, must have missed something. a related issue collectionview below won't take focus searchcontroller. 1

search - Solr relevancy & boosting best approach -

scenario boost documents on multiple field values: i have field " category " containing values - " news ", " image ", " video ", " audio ". now on basis of fields values mentioned above give boosting(priority) them, example " news " gets highest priority, followed " video ", " audio " , on. similar category there few more fields, needed boosted in same manner based on fields values. ex. boosting rules can be, category= news^1000 category= image^900 premium_contents = true^200 sponsored = true^300 ... on so have came across solution reference . trying find out best approach calculating search relevancy result-sets. yes think link reasonable idea. use because want enforce boosts on searches , don't change logic often, example in case:- <requesthandler name="/select" class="solr.searchhandler"> <lst name="defaults"> <st

r - How to render flexdashboard from the command line? -

i have flexdashboard rmd renders correctly when press knit button in rstudio. render command line naviagation bar change when use command render("myfile.rmd", flex_dashboard()) the heading of rmd file following: --- title: "flexdashboard" output: flexdashboard::flex_dashboard: theme: cosmo navbar: - { title: "draft-for internal use only", align: right } source_code: embed --- you can call render no arguments , pick of options in yaml: render("myfile.rmd") altons correct using flex_dashboard() creates new format uses defaults. render format , keep settings yaml use: render("myfile.rmd", "flex_dashboard") but latter form required if flex_dashboard isn't default format within rmd.

jquery - Javascript new Date() outputs 'YYYY-MM-DD hh:mm:ss' data as UTC although it's not -

i have simple line of code need date output in modal, emerges when click on entry in fullcalendar-script calendar. looks this: eventclick: function(calevent, jsevent, view) { $('#modalstart').html(new date(calevent.start)); $('#modalend').html(new date(calevent.end)); }, the json data gets interpreted ( start , end ) formatted yyyy-mm-dd h:i:s , want stay that. modal new date outputs following: start: tue aug 02 2016 06 :00:00 gmt+0200 (mitteleuropäische sommerzeit) end: mon aug 15 2016 08 :00:01 gmt+0200 (mitteleuropäische sommerzeit) although should be start: tue aug 02 2016 04 :00:00 end: mon aug 15 2016 06 :00:01 i'm sure there simple solutio this. tried .html(new date(date.utc())) didn't work. i'd thankful if help. whatever you're planning do, should trick: eventclick: function(calevent, jsevent, view) { $('#modalstart').html(new date(calevent.start).toutcstring());

matrix - How to sum two matrices in Scala? -

suppose define type matrix vector[vector[int]] , sum 2 matrices this: type matrix = vector[vector[int]] val addup: (matrix, matrix) => matrix = (_, _).zipped map ((_, _).zipped map (_ + _)) is there library, provides generic zipped map can simplify addup ?

python - Groupby an numpy.array based on groupby of a pandas.DataFrame with the same length -

i have numpy.array arr , pandas.dataframe df . arr , df have same shape (x,y) . i need group 1 column of df , apply transformation of impacted rows on arr have same shape. to clear, here toy example: arr = 0 1 12 3 2 5 45 47 3 19 11 111 df = b c d 0 0 1 2 3 1 4 5 6 7 2 4 9 10 11 i want group df a , compute mean in place of transforming df want arr transformed. so like: arr = 0 1 12 3 (2+3)/2 (5+19)/2 (45+11)/2 (47+111)/2 is possible? no expensive loops? thanks in advance it looks need first create dataframe arr , groupby column a , aggregate mean . last convert numpy array values : print (pd.dataframe(arr).groupby(df.a).mean().values) [[ 0. 1. 12. 3. ] [ 2.5 12. 28. 79. ]]

How can a Telegram Bot figure out that user has opened the chat window? -

how can bot send message user, when user opens chat. example: user has added telegram bot list of contacts , started conversation later on, user opens chat window bot bot "sees" user has opened chat window, hasn't written yet bot should "hello, can with?" user is there event/trigger step #3 in telegram bot api? no. there no trigger each time user opens chat window first time below: when opens chat bot "for first time", automatically telegram sends /start command bot .it ordinary command when user sends command or write /start , send, bot can catch , hello or commands user. user opens chat window bot, telegrams send message automatically bot containing info user , on.

material design - CoordinatorLayout not working in Android Studio 2.1.2? -

Image
my android studio unable find coordinatorlayout class. screenshot : it says: the following classes not found: -android.support.design.widget.coordinatorlayout. this xml code: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.musical_box.musicbox.mainactivity"> <framelayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id=&qu

logstash - ElasticSearch 5.0.0-aplha4 won't start without setting vm.max_map_count -

i wish update es version 2.3 5.0.0-alpha4 able use ingest nodes , remove logstash out of question. seems es 5.x version won't start without me setting vm.max_map_count 262144. don't want set value..i okay default value 65530. can guide me how es 5.x started without tampering memory settings @ all. don't have access root user on host on wish install es. error: java.lang.unsupportedoperationexception: seccomp unavailable: config_seccomp not compiled kernel, config_seccomp , config_seccomp_filter needed @ org.elasticsearch.bootstrap.seccomp.linuximpl(seccomp.java:347) @ org.elasticsearch.bootstrap.seccomp.init(seccomp.java:616) [2016-08-08 07:49:55,436][info ][node ] [data-cum-ingest-node] initializing ... [2016-08-08 07:49:56,048][info ][plugins ] [data-cum-ingest-node] modules [percolator, lang-mustache, lang-painless, reindex, aggs-matrix-stats, lang-expression, ingest-common, lang-groovy], plugins [] [2016-08-08 07:49:56,601][info ][env ] [data-cum-ingest-node] heap

javascript - Get all links from html page using regex -

i'm using google apps script fetch content of emails gmail , after need extract of links html tags. found code here, on stackoverflow, , implemented regular expression, issue is returning me first url. ( http://vacante2016.eu/tr/17599/51743713/c4f5eadf38eb475d39e3cdeca9201538 ) is there way make loop search next content matches regex expression display of elements 1 one? here can see example content of email need links from: https://www.mailinator.com/inbox2.jsp?public_to=get_urls#/#public_showmaildiv this code: function geturl() { var threads = gmailapp.getinboxthreads(); var message = threads[0].getmessages()[0]; var content = message.getrawcontent(); var source = (content || '').tostring(); var urlarray = []; var url; var matcharray; // regular expression find ftp, http(s) urls. var regextoken = /(http|https|ftp|ftps)\:\/\/[a-za-z0-9\-\.]+\.[a-za-z]{2,3}(\/\s*)?/; // iterate through urls in text. while( (matcharray =

plsql - Removing the millisecond from the timestamp -

i need convert timestamp date in pl sql. input '2016-08-01t09:16:47.000' webservice, require '8/01/2016 9:16:47 am'. i take input varchar2 . it can "am" or "pm" . i tried using select trunc(to_timestamp('2016-08-01t09:16:47.000','yyyy-mm-dd"t"hh24:mi:ss.ff3')) dual; time part removed. select to_char(to_timestamp('08/01/2016 09:16:47.000000000 am', 'mm/dd/yyyy hh:mi:ss.ff am'),'mm/dd/yyyy hh:mi:ss am') dual; edit: works or pm select to_char(to_timestamp('08/01/2016 09:16:47.000000000 pm', 'mm/dd/yyyy hh:mi:ss.ff am'),'mm/dd/yyyy hh:mi:ss am') dual;

android - Kotlin integration in Java Code? -

example: in c-code possible call parts of assembler code, like: int main() { //... stuff __asm { lea ebx, hal mov ecx, [ebx]hal.same_name ; mov esi, [ebx].weasel ; } // .. further stuff return 0; } is such code integration possible kotlin code in java (*.java) files? (i not talkin jni or c/c++ in java!) extend existing (androidstudio-) java-source-code kotlin language. //.. *.java file public class myalreadyexistingjavaclass { private int membervar; public myalreadyexistingjavaclass() { } // kotlin within *.java file // extend java file constuctor in kotlin ? // make above default constructor unneccessary. class myalreadyexistingjavaclass(number: int = 0) { membervar = number; } } java not provide syntax including snippets of code in kotlin or other language java file. however, not necessary accomplish task. can define constructor need factory function in separate kotlin file: fun myalreadyexistingjavaclass() = m

angularjs - How to create custom login functionality in loopback -

recently,i started working on loopback , facing 1 issue in project. in project using built in loopback user.login functionality that's provide feature login our site providing email , password, password mandatory field. so, problem password field, want provide login functionality without using password in place of password want check facebook id, not understand how use built in loopback user.login model 2 parameter 1 email , second facebook id instead of password. in case getting email id , basic information facebook using javascript (i not using facebook-passport package), instead of password want pass email , facebook id in user.login model. project rest api , storing user data in local storage, want create costume login functionality. create custom function in model , define remote method path /login . user.mylogin = function(data, cb){ // data.username // data.password // data.facebookid }; user.remotemethod( 'mylogin', { accepts: [{

java - Failed resolution of: Lcom/abhi/barcode/frag/libv2/R$string -

i'm trying launch activity fragment inside doing qr scan, i'm using library > https://code.google.com/archive/p/barcodefraglibv2/ i instructions when run app throws away exception : failed resolution of: lcom/abhi/barcode/frag/libv2/r$string what doing wrong ? here mainactivity: package apps.radwin.zxingprojectfragmentsthree; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.view.view; import android.widget.button; import android.widget.toast; import com.abhi.barcode.frag.libv2.barcodefragment; import com.abhi.barcode.frag.libv2.iscanresulthandler; import com.abhi.barcode.frag.libv2.scanresult; import com.google.zxing.barcodeformat; import java.util.enumset; public class mainactivity extends fragmentactivity implements iscanresulthandler { barcodefragment fragment; button btn; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate

google api - how to use android Fuse api to get location -

how can use android google api find current location? used code: googleapiclient googleapiclient = new googleapiclient.builder(this) .enableautomanage(this, 0 , this) .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) .build(); locationservices.fusedlocationapi.getlastlocation(googleapiclient); but doesn't work. wrong? you have forgotten put line: googleapiclient.addapi(locationservices.api)

scala - Cannot compile simple Argonaut expression? -

is scalaz , argonaut incompatibility issue or else? scala> import argonaut._ import argonaut._ scala> import argonaut._ import argonaut._ scala> import scalaz._ import scalaz._ scala> import scalaz._ import scalaz._ scala> val jsonstring: json = jstring("json!") java.lang.incompatibleclasschangeerror: found class scalaz.memo, interface expected @ argonaut.prettyparams.<init>(prettyparams.scala:112) @ argonaut.prettyparamss$class.$init$(prettyparams.scala:252) @ argonaut.argonaut$.<init>(argonaut.scala:3) @ argonaut.argonaut$.<clinit>(argonaut.scala) ... 43 elided build.sbt "io.argonaut" %% "argonaut" % "6.1", "org.scalaz" %% "scalaz-core" % "7.2.4", currently seems compatible scalaz 7.1.1 .

How to make backup of Azure table storage -

i have requirement need migrate data 1 azure table storage , 1 table other table (both table either in same subscription or different subscription). is there way in azure table storage above requirement in sql storage user can generate scripts or backup of entire database or individual table. short answer: there's no built-in backup. longer answer: there's no built-in backup service table storage, or "snapshot" feature (which blobs have): you'll need own copy operation, 1 table another. there's rest api available along sdks, powershell cmdlets, cli commands, , azcopy (all built upon api). there bunch of 3rd-party tools can search for. how accomplish table-copying you. table storage durable storage - triple-replicated within region (and optionally geo-replicated region). if storage became unavailable in primary region, you'd have option of reading paired region (assuming enabled storage account geo-redundant). note: not same backup - if

mongodb - passing mongo selector in an object -

this meteor client code tries supply template data works when selector written mycol.find({'p':'pen'}) fails return documents when written like: template.mytemp.helpers({ docs: () => { let element = $('input:not(".inactive")'); let query = {}; let key = element.prop('name'); query[key] = element.val(); return mycol.find(query); //<---- returns no documents ---- } }); i made sure query = {p: 'pin'} in browser console. problem , how fix it?

INNER and LEFT JOIN on mysql -

i have needing chain joins queries, , not able result want. have many tables save product info: -products: name , description in many languages. -products_attributes: common attributes of products provider or buying price. -products_locations: info concerning locations sell product, stock, or selling price. -other important table companies one: of companies provider. well, query: select p.id , p.name nameproduct , p.reference refproduct , a.buy_price priceproduct , l.active , l.sell_price , l.stock stockproduct , c.title p_name products p left join products_location l on l.product_reference = p.reference , l.active = 1 , l.location_id = 4 join products_attributes on a.product_reference = p.reference , p.lang = 'es' , a.provider = 6 join companies c on a.provider = c.id , c.id = 6 what want products of provider, if location executing query has product, row of result must return conc

java - Message not coming fully -

i need complete message example hello how you . code, getting hello . public class messages{ private static final int mtype = 0; private static final int flags = 1; private static final int sequence = 2; private static final int char1 = 3; private static final int char2 = 4; private static final int char3 = 5; private static final int char4 = 6; private static final int char5 = 7; private int type = 0; private boolean ack = false; private boolean islasttelegram = false; private boolean isutf8 = false; private int sequence = 0; private string messagepart = ""; public inmsgtelegramm(byte[] msg) { type = msg[mtype] & 0xff; sequence = msg[sequence] & 0xff; int ackbyte = (int) ((msg[flags] >> 7) & 1); ack = ackbyte != 0; int islasttelegrambyte = (int) ((msg[flags] >> 6) & 1); islasttelegram = islasttelegrambyte != 0; int isu

video - Issue with Google VR in Android -

i facing strange issue while working google vr sdk while playing 360 videos. i have implemented , run application on samsung android phone , many other devices well. worked fine. devices run using sensors view 360 degree video , uses finger swipes move video angle. but today morning tried run same application on "iball cobalt solus 4g mobile". having 5.1 lollipop, accelerometer , gyroscope sensor. not have compass/magnetometer, needs swiped manually finger view 360 videos. not working after swiping manually finger. video visible fixed angle. and able swipe youtube 360 videos on same device.could not figure might issue. interesting, shouldn't possible yet, based on this post . can supposedly click , drag on computer (browser), not android. did use specific settings make swiping view rotation work on particular phones?

php - Get Credentials from different tables -

i create project , following scenario : database tables: table first : company table second :employee when superuser create company put information in company table company name, user name , password. these username , password company login , enter employee name, gender , phone no etc plus username , password employee employee can login employee rights. confusion when superadmin create new company enter values in company table , when company create emplyee account enter value in employee table. on login screen how can check superadmin, company or employee can information perticular database table. can guys me create database scenario. how can manage should use join , view or..... thanks your database structure correct you're putting relevant information in each table. e.g. company's data in company table , employee's data in employee table. what need when logins platform add parameter along credentials type of user. there couple of solutions thi

python - Matplotlib basemap drawcounties doesn't work -

Image
pretty title says. drawcounties command being ignored no errors. plot on projections? documentation doesn't so. import numpy np import matplotlib.pyplot plt mpl_toolkits.basemap import basemap, shiftgrid import scipy def basemapparameters(): """ sets basemap. """ m = basemap(projection='mill', llcrnrlon = 230, llcrnrlat = 27, urcrnrlat = 45, urcrnrlon = 261, area_thresh = 1000., resolution='i') m.drawcounties(linewidth=0.5) m.drawcoastlines(linewidth=0.7) m.drawcountries(linewidth=0.5) m.drawstates(linewidth=0.5) m.drawmapboundary(linewidth=0.7) def saveplot(lvl,parameter,region,hour,padding): """ saves figure file given properties """ plt.savefig('{0}_{1}_{2}_{3}.png'.format(lvl,parameter,region,hour),bbox_inches='tight',pad_inches = padding) plt.close("

system verilog - Interaction between 2 UVM registers -

i trying implement uvm ral project, , faced problem. example have 2 registers - reg , reg b. create classes both, device spec value in field a.field1 mapping b.field2. how can implement in uvm ral. thanks. you looking use aliased registers. concept described in uvm user guide in section 5.7.3 .(page 114 ) http://accellera.org/images/downloads/standards/uvm/uvm_users_guide_1.1.pdf the example in umm user guide uses couple of concepts , same concept can used generate aliasing a.field1 , b.field2. a call mechanism call can set post predict function of reg b.field2 . every time ,after value of b.field2 changes post-predict function triggered. in post predict function field value of register ( a.field1) updated [ calling field1.predict ]reflecting change/linkage. ( assuming a.field1 dependent/alias of b.field2) wrapper class create wrapper class connect fields both these registers (a & b - a.field1 b.field2) , instantiate wrapper class. wrapper class registers call

Get data from JSON file with iOS and swift -

i have json file: var point : [ { "id": 1, "name": "a", "lastupdate": 1468011600, "position": [36.8656974, 10.1687314]}, { "id": 1, "name": "a", "lastupdate": 1468397003, "position": [36.9009882, 10.3009531] }, { "id": 1, "name": "a", "lastupdate": 1467590490, "position": [37.1691357, 10.0349865] } ] and need read data in viewcontroller, tried work swiftyjson failed. ps: code swift , not objective-c solutions? you can use this great library . library provide parsing json dictionary simple (just 1-2 line of code). p.s. recommended use this library mapping dictionary object update install swiftyjson in podfile platform :ios, '8.0'

node.js - nodejs + mysql : when to use pooled connections? -

first of all, know there several similar questions, don't answer need, let me open new 1 :) second, question focused mysql, not limited it, applying other poolable services memcached. as far know, nodejs executes scripts single-threaded can create threads, it's able manage concurrent users in server. that's why makes sense create pool of connections. the problem comes when have test api served express, , perform following benchmark code: ab -t 30 -c 1000 localhost/test giving me following output single-direct-connection database: requests per second: 1732.07 [#/sec] (mean) time per request: 577.344 [ms] (mean) in mysql pool 1 connection: requests per second: 1346.24 [#/sec] (mean) time per request: 742.811 [ms] (mean) and using pool 100 connections: requests per second: 662.82 [#/sec] (mean) time per request: 1508.716 [ms] (mean) which should opposite, right? pooled connection better performance. i know pooling management requires time (but shoul

java - tomcat JDBC connection pool minIdle size is different in database -

my application using tomcat jdbc connection pool through hibernate. database oracle rac. connection pool, have maxactive=75 minidle=5,maxidle=35, initialsize=5,testwhileidle=false,testonreturn=false while start application , database v$session table, can see 5 connections user after 1 hour, v$session table has 3 connections. since minidle value 5, why there 3 connections in database?

list comprehension - Haskell Does Not Evaluate Lazily takeWhile -

isqrt :: integer -> integer isqrt = floor . sqrt . fromintegral primes :: [integer] primes = sieve [2..] sieve (p:ps) = p : sieve [x | x <- ps, x `mod` p > 0] primefactors :: integer -> [integer] primefactors n = takewhile (< n) [x | x <- primes, n `mod` x == 0] here code. think guessed trying do: list of prime factors of given number using infinite list of prime numbers. code not evaluate lazily. when use ghci , :l mycode.hs , enter primefactors 24 , result [2, 3 ( , cursor flashing there) there isn't further prelude> prompt. think there problem there. doing wrong? thanks. takewhile never terminates composite arguments. if n composite, has no prime factors >= n , takewhile sit there. apply takewhile primes list , filter result n mod x, this: primefactors n = [x | x <- takewhile (<= n) primes, n `mod` x == 0] ( <= used instead of < maximum correctness, prime factors of prime number consist of number).

Jmeter assert json response element to be NOT NULL -

Image
i getting json response, have parsed using jp@gc - json path extractor , got element 'access_token'. access_token dynamic. want make sure element not null . any leads appreciated. in json path extractor provide default value , example not_found add response assertion after json path extractor , configure follows: apply to : jmeter variable -> access_token pattern matching rules : tick not tick equals patterns test : not_found (or whatever entered "default value" input of json path extractor) see how use jmeter assertions in 3 easy steps article comprehensive information on using assertions in jmeter scripts.

ios - How to Parse JSON with more than one array in Swift -

i'm new in swift language, newbie question have ask cause mind little bit confused dictionary , array usage here, got json this; { "mainpagelast": [ {}, {}.. ], "mainpagesport": [ {}, {}.. ], "mainpageeco": [ {}, {}.. ], "mainpagepol": [ {}, {}.. ] } i made base class includes of these arrays dictionary this; public class func modelsfromdictionaryarray(array:nsarray) -> [json4swift_base] { var models:[json4swift_base] = [] item in array { models.append(json4swift_base(dictionary: item as! nsdictionary)!) } return models } required public init?(dictionary: nsdictionary) { if (dictionary["mainpagelast"] != nil) { mainpagelast = mainpagelast.modelsfromdictionaryarray(dictionary["mainpagelast"] as! nsarray) } if (dictionary["mainpagesport"] != nil) { mainpagesport = mainpagesport.modelsfromdicti

Python Xarray add DataArray to Dataset -

very simple question can't find answer online. have dataset , want add named dataarray it. dataset.add({"new_array": new_data_array}) . know merge , update , concatenate , understanding merge merging 2 or more dataset s , concatenate concatenating 2 or more dataarray s form dataarray , , haven't quite understood update yet. i've tried dataset.update({"new_array": new_data_array}) following error. invalidindexerror: reindexing valid uniquely valued index objects i've tried dataset["new_array"] = new_data_array , same error. update i've found out problem of coordinates have duplicate values, didn't know about. coordinates used index, xarray gets confused (understandably) when trying combine shared coordinates. below example works. names = ["joaquin", "manolo", "xavier"] n = xarray.dataarray([23, 98, 23], coords={"name": names}) print(n) print("======") m = numpy.

how to write ObjectNode code to below json data? -

i want generate response below. how can using objectnode , objectmapper ? in java class have write coding below response: { "code": 200, "time": "2016-05-27t11:15:36+10:00", "data": { "result": { "addresses": { "addressid": "180056310", "addresssummarytype": "primaryaddresssummary", "addresstype": "property address number", "status": "confirmed", "number": "6", "numberto": "8", "streetname": "regent", "streettype": "street", "locality": "wollongong", "postcode": "2500", "state": "nsw",

c# - Repeat async task by timer in xamarin forms -

i'm new xamarin.forms development , i'm still having first steps few tutorials found on net. have async task returns time date.jsontest.com , have timer decrements text in label. want put async task in timer repeats , displays time on label im getting cannot convert async lamba func here's code please me, thanks static async task<string> requesttimeasync() { using (var client = new httpclient()) { var jsonstring = await client.getstringasync("http://date.jsontest.com/"); var jsonobject = jobject.parse(jsonstring); return jsonobject["time"].value<string>(); } } protected override async void onappearing() { base.onappearing(); timelabel.text = await requesttimeasync(); device.starttimer(timespan.fromseconds(1), () => { // want taks put //here gets repeated var number = float.parse(button.text) - 1; button.text

asp.net - Conversion from string "~/app.config" to type 'Integer' is not valid -

in web service gloval.asax, put log4net.config.xmlconfigurator.configure(new fileinfo(server.mappath("~/web.config"))) in application_start . now, have console application. i'm try put log4net.config.xmlconfigurator.configure(new fileinfo(appdomain.currentdomain.basedirectory("~/app.config"))) , conversion string "~/app.config" type 'integer' not valid. whats causes this? turn option strict on , you'll see error @ compile time. appdomain.currentdomain.basedirectory string. when reference in brackets after it's expecting character index, "~/app.config" isn't. try appdomain.currentdomain.basedirectory & "/app.config" instead.

java - Fix for 3D camera to move in the direction it's facing? -

the short version (tl;dr) i have camera attached scenenode , movement works fine long scenenode 's rotation/axes aligned world's. however, when object rotates "look" in different direction , told move "forward" not move along new "forward" direction. instead, continues move in same direction facing before rotation applied. details , example i have scene graph manage 3d scene. graph tree of scenenode objects, know transformations relative parent , world. as per tl;dr; snippet, imagine have cameranode 0 rotation (e.g. facing north) , rotate cameranode 90 degrees left around +y "up" axis, i.e. make west. things ok far. if try move cameranode "forward", west, cameranode instead moves if "forward" still facing north. in short, moves as if had never been rotated in first place . the code below shows i've attempted , (current) best guess @ narrowing down areas related problem. relevant scenenode