Posts

Showing posts from February, 2015

javascript - Redux transition to after action execution -

i have action export function loginsuccess(response){ return (dispatch, getstate) => { dispatch({ response, type: types.login }); router.transitionto("/profile") }; } here after successful execution of action redirect /profile . here getting router not defined . you have pass router redux thunk action creator (you pice of code not action wrote action creator). example looks like: export function loginsuccess(router, response){ return (dispatch, getstate) => { dispatch({ response, type: types.login }); router.transitionto("/profile") }; } do have access router in place invoke action creator ? available there? if yes have there (i don't know response ): this.props.dispatch(loginsuccess(response)); and have change to: this.props.dispatch(loginsuccess(this.context.router, response)); i assume have access router context. because don't show how invoke action i'm guessing. hope instruction you.

javascript - Use multi-tier dropdown (that uses jquery) to filter data and display d3 bar chart -

i have bar chart want user able create using series of dropdown selections. i have first part done-- select type of produce, produce itself, , bar chart appears. the problem second filter isn't working. want second filter take data that's been filtered produce type , filter again, year. any thoughts or input helpful. plunker: https://plnkr.co/edit/xllk6di5y4pvfgzj3nku?p=preview code below: <!doctype html> <meta charset="utf-8"> <style> body { font: 12px arial;} .bar { fill: #0078a5; } .bar:hover { fill: #18b7f2; } #tooltip { position: absolute; width: auto; height: auto; padding: 4px 6px; background-color: #fff; border:1px solid #eee; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; pointer-events: none; } #tooltip.hidden { display: none; } #pop{ backgr

amazon web services - Installing AWS key to use S3 -

i did aws configure , inputted key , secret key. have checked account exists when ran: aws iam list-account-aliases , alias appeared. however, when try upload file aws, recieving error: /users/kchen/campaiyn-web/node_modules/skipper-s3/node_modules/knox/lib/client.js:197 if (!options.key) throw new error('aws "key" required'); ^ error: aws "key" required @ new client (/users/kchen/campaiyn-web/node_modules/skipper-s3/node_modules/knox/lib/client.js:197:27) @ function.exports.createclient (/users/kchen/campaiyn-web/node_modules/skipper-s3/node_modules/knox/lib/client.js:925:10) @ writable.onfile (/users/kchen/campaiyn-web/node_modules/skipper-s3/index.js:248:22) @ dowrite (_stream_writable.js:292:12) @ writeorbuffer (_stream_writable.js:278:5) @ writable.write (_stream_writable.js:207:11) @ transform.ondata (_stream_readable.js:528:20) @ emitone (events.js:77:13) @ transform.emit (events.js:

javascript - Onload bootstrap tab trigger -

the active class isn't working , i've tried body on-load click trigger , show tab using id , many other ways, nothing seems working. have hashed url enable tabs linked individually in search. appreciated. js: hash url , jump tab // jump tab if exists if (location.hash) { $('a[href=' + location.hash + ']').tab('show'); } // add tab hash url persist state $(document.body).on("shown.bs.tab", function(e){ location.hash = e.target.hash; }); }); js: go tab home (not working) $("document").ready(function(){ $("#home").trigger("click"); }); html: <div class="col-xs-5 col-md-2 nopadding"> <nav class="nav-sidebar"> <ul class="nav tabs"> <li class="lead3"><a href="#home" class="active" data-toggle="tab">home </a></li> <li class="lead3"><a href="#ta

html - List in columns layout depending on viewport width -

how can make several columns 1 list css ? number of columns must change depending on screen width media queries shown here : lage screen: row1 row6 row11 row2 row7 row12 row3 row8 row13 row4 row9 row14 row5 row10 middle screen: row1 row8 row2 row9 row3 row10 row4 row11 row5 row12 row6 row13 row7 row14 small screen: row1 row2 row3 row4 row5 row6 row7 row8 row9 row10 row11 row12 row13 row14 here html code : <ul> <li>row1</li> <li>row2</li> <li>row3</li> <li>row4</li> <li>row5</li> <li>row6</li> <li>row7</li> <li>row8</li> <li>row9</li> <li>row10</li> <li>row11</li> <li>row12</li> <li>row13</li> <li>row14</li> </ul> you can css multi-column layout . add support isn't best. or if can set fixed height on ul use flexbox , flex-direction: colum

A function which identifies how many times a string is included in another one in lisp -

i block program lisp function mark how many times string included in another i tried function sends me error: *** - +: "abc" not number (defun string-contain (string1 string2) (cond ((not (length string1)) nil) ; string1 est vide (pas besoin de le tester à chaque fois) ((> (length string1) (length string2)) nil) ; string1 est plus longue que chaine2 ((string= string1 (subseq string2 0 (length string1))) string1) (t (+ 1(string-include string1 (subseq string2 1)))))) thank in general, when you're doing string processing, should try avoid calling subseq , since creates new string, , don't want doing string allocation. many of sequence processing functions in common lisp take start , end parameters, can specify parts of sequence you're looking for. function search looks occurrence of sequence within sequences , returns index of first occurrence. can call search repeatedly new :start2 values search farther , farther within

javascript - RegExp - needs to check there are letters and numbers present plus optional special chars? -

Image
this question has answer here: password validation regex 2 answers using javascript have test value ensure alphanumeric, can have selection of optional special chars - have: [a-za-z0-9\/_\+£&@"\?!'\.,\(\)] but fails optional aspect of test. e.g. these should valid: alpha1234 alpha1234! 1234alpha !1234alpha 1234!qwer but these should fail: alpha 1234 hopefully can either point me in right direction or has answer handy :) or if need know more, let me know. thanks in advance. first, ensure input contains @ least 1 digit: (?=.*[0-9]) . then, ensure input contains @ least 1 alpha: (?=.*[a-z]) . finally, ensure input contains allowed chars: [a-z0-9\/_+£&@"?!'.,()]* . all together: ^(?=.*[0-9])(?=.*[a-z])[a-z0-9\/_+£&@"?!'.,()]*$ visualization debuggex demo regex101

sql - Same data, different results when using PARTITION BY and ROW_NUMBER -

i have been attempting write script find duplicate records. require 1 of fields same , other 1 different. using below 2 lines in select. row_number () on (partition col_1 order col_2) 'rownumber', row_number () on (partition col_2 order col_1) 'rownumber2', once has been used select results temp table both columns > 1. has produced results correct in 1 environment when running same script in environment (backup weekend) results different. can explain me why happen? many in advance. why using row_number? not necessary @ all, should use group by: select col_1,col_2 yourtable group col_1,col_2 having count(*) > 1 this query return duplicated rows edit: if have 3rd column deciding dup according it, should do: select col_3 yourtable group col_3 yourtable having count(*) > 1

php - Check the product category/id before add it to the cart (Woocommerce) -

im looking make function must that, example: i have 10 categories, 3 of them special, name are: "alpha", "bravo" , "charlie" in function must have array category id of category "alpha", "bravo" , "charlie" when user click "add cart" function must check if cart empty, if cart empty function must reset global variable named $restricted_item_cart after function, must check, if product category of item want add cart contain array have place category "alpha", "bravo" , "charlie" if item category contain in array, function must add product id global variable $restricted_item_cart can me please? new edit (new code, im not pro php coder, can tell me if right?): function my_add_woo_cat_classes($classes) {   global $restricted_cart_items ; if ( is_null( $cart )){ $restricted_cart_items=array(); } global $post; $terms = get_the_terms( $post->id, &

ssl - Certificate CA bundle file: PEM - PHP/cURL - Local install..? -

i'm using windows server 2008 r2 (with iis), php 5.6.0 , curl 7.36.0 test against paypal's tls test url: $ch = curl_init(); curl_setopt($ch, curlopt_url, 'https://tlstest.paypal.com'); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_failonerror, true); curl_setopt($ch, curlopt_ssl_verifypeer, true); curl_setopt($ch, curlopt_sslversion, 6); // curl_sslversion_tlsv1_2 curl_setopt($ch, curlopt_cainfo, dirname(__file__) . '\cacert.pem'); $result = curl_exec($ch); curl_close($ch); when use curlopt_cainfo , cacert.pem http://curl.haxx.se/docs/caextract.html works , get: paypal_connection_ok when don't use curlopt_cainfo error: ssl certificate problem: unable local issuer certificate i've tried this: mmc file > add/remove snap-in certificates (local computer) trusted root certification authorities > certificates all tasks > import select cacert.pem message: "the import successful"

'NoneType' object has no attribute 'attributes' while creating a new catalogue product in django oscar -

in views trying create new product based on product serializer based on django oscar product model.i error 'nonetype' object has no attribute 'attributes'.following below code views.py serializers import categoryserializer, productserializer, productclassserializer oscar.apps.catalogue.models import product, category, productclass class productviewset(viewsets.modelviewset): """ viewset viewing , editing product instances. """ serializer_class = productserializer queryset = product.objects.all() # create product def create(self, request, format=none): data = json.loads(request.body) serializer = productserializer(data=data) if serializer.is_valid(): serializer.save() return response(serializer.data, status=status.http_201_created) return response(serializer.errors, status=status.http_400_bad_request) serializers.py class productseria

Invalid block tag on line 3: 'raw'. Did you forget to register or load this tag? with Django 1.9 and Jinja2 -

i beginner in django 1.9 , jinja2. have been trying implement jinja2 in django 1.9, keep receiving error below: invalid block tag on line 2: 'raw'. did forget register or load tag? the code giving problem is: {%raw%}<form {{action "login" on="submit"}}>{%endraw%} i have checked settings.py, not sure did wrongly: templates = [ { 'backend': 'django.template.backends.django.djangotemplates', 'dirs': [ os.path.join(ember_dir, 'templates') ], 'options': { 'context_processors': [ # insert template_context_processors here or use # list if haven't customized them: 'django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django

java - Spring injecting implementation bean -

i have following snippet conf spring file: <bean id="taskletstep" abstract="true" class="org.springframework.batch.core.step.tasklet.taskletstep"> <property name="jobrepository" ref="jobrepository"/> <property name="transactionmanager" ref="transactionmanager"/> </bean> <bean id="hello" class="com.techavalanche.batch.printtasklet"> <property name="message" value="hello"/> </bean> <bean id="world" class="com.techavalanche.batch.printtasklet"> <property name="message" value=" world!"/> </bean> <bean id="mysimplejob" class="org.springframework.batch.core.job.simplejob"> <property name="name" value="mysimplejob" /> <property name="steps">

c++ - reverse UndistortRectifyMap -

i'm making multicamera-stereo calibration program. my idea rectify each pair of cameras separately. for example: given 3 cameras compute undistortion , rectification maps (using stereorectify() , initundistortrectifymap() ) separately {camera[1] , camera[2]}, {camera[2] , camera[3]} , {camera[1] , camera[3]}. using remap() , can transform original image (from, lets say, camera[1]) 1 of 2 different rectified images: rectified[1][2] , rectified[1][3]. now, using remap() , point original image, can compute new coordinates separately in rectified[1][2] , rectified[1][3] images. it works well, need compute these coordinates in opposite direction: point of rectified images need find original coordinates in original image. how can this?

java - WSO2 DSS support for mongodb 3.x.x -

i trying incorporate wso2 dss 3.5.0 mongodb 3.2.1; i found out functions exposed .dbs file limited compared mongo shell for example: the famous db.collection.findandmodify() is not supported; nested usage of mongodb shell command following db.collection.remove({_id: $bindata(3, #)} can not parsed i googled around , found ds-connector-mongodb (with mongo-java-driver-2.9.0, , jongo 0.3) on github i checkd dss 3.5.0 bundles under "/repository/components/plugins", , found "mongo-java-driver_3.0.0.wso2v2.jar" ... i totally confused how mongodb supported on wso2 dss 3.5 had "ds-connector-mongodb" been deprecated? or had there been new structure/frame or what? not mention there compatibility problems between 2.x.x , 3.x.x of mongo-java-drive ... please advice thanks for mongodb support supported operations available under mongooperationlabels in [2] other specific operations such "db.collection.findandmodify() cu

Scheduling time in slots for appointment in android -

Image
i have requirement application wherein have schedule appointments in time slots. when patient comes doctor, patient ask schedule appointment on particular date. if time slot available, receptionist schedule appointment. consider if particular date appointment not scheduled, when clicked on particular date first time should create new row of time slots day. when appointment scheduled time slot allotted patient should set true, slot values set false. please see time slot below... 10am-11am 11am-12pm 12pm-13pm 13pm-14pm break break 16pm-17pm 17pm-18pm 18pm-19pm 19pm-20pm guys please me... thank in advance you use sqlite database looks this: date primary key , slots booleans default value false. whenever new patient comes in , asks appointment on particular date: query table see if date exists if not: create new row in table set true time slot patient has requested if does: check if requested slot available if is, assign patient , set

r - tm corpus exporting some structural function words -

using tm library, corpus includes words vector source structure : text <- readlines("some.txt") finalcorpus <- corpus(vectorsource(newcorpus)) finalcorpus <- tm_map(finalcorpus, stripwhitespace) save(finalcorpus, file="data/debug.rda")# debug df<- data.frame(lapply(finalcorpus, as.character), stringsasfactors=false) df >protracted periods meditation fasting prayer ennui fever energy vigor >married joseph lee dollars million canadian dollars gbp pastored african >american church snow hill jersey children died infancy **meta list author >character datetimestamp list sec min hour mday mon year wday yday isdst >description character heading character id language en origin character >x2 x3 >1 list list** the words between ** corpus , not imported text, why them et how remove them (without removewords tm function) ?

ios - NSPredicate: Getting the highest value -

i've got following: let appdelegate = uiapplication.sharedapplication().delegate as! appdelegate let managedobjcontext = appdelegate.managedobjectcontext let fetchrequest = nsfetchrequest(entityname: "ras") var error: nserror? let predicate1 = nspredicate(format: "%k , %k == false", "rasscore", "rasstatus") fetchrequest.predicate = predicate1 {... this gives me records conform parameters of nspredicate, want record highest value in rasscore . how go getting that? possible include in nspredicate format? set fetchlimit of fetchrequest 1 , use descriptor sort value of "rasscore" descending this: fetchrequest.fetchlimit = 1 var highestsortdescriptor : nssortdescriptor = nssortdescriptor(key: "rasscore", ascending: false) fetchrequest.sortdescriptors = [highestsortdescriptor]

Liferay on weblogic doesn't invalidate portlet session -

i use liferay 6.2 ga4 portal on weblogic server 10.3.6.0 , found out 1 annoying problem. i log in usera. display portlet stores data portlet session. i log out. i log in userb. display same portlet stores data portlet session. portlet shows data of usera instead of userb . i added ext-plugin debug log messages com.liferay.portal.kernel.servlet.portletsessionlistenermanager , com.liferay.portal.kernel.servlet.portletsessiontracker , found out session (sessionid) passed portletsessiontracker.add method different 1 passed invalidate method. see log messages below: 2016-01-28 10:38:34,191 [portletsessiontracker:40] adding session id=4s6hme3ldwwuudoilk7-ytjlqjh1lncitkzoeh9yvsbm2usjuxu9 2016-01-28 10:40:38,875 [portletsessionlistenermanager:187] destroying session id=s4qhmpdastlkwkmeo6gdlt4w0u-siglu_gna1ljelxttqvsaryed 2016-01-28 10:40:38,875 [portletsessiontracker:73] removing session id=s4qhmpdastlkwkmeo6gdlt4w0u-siglu_gna1ljelxttqvsaryed session.invalidate(); in c

php - Deleting a ROW from MySQL database using MySQLi -

i've got delete.php file yes/no buttons call deleterecord.php delete selected row database. the problem seems i'm not passing variable projectid through deleterecord file. can please tell me what's wrong? delete.php <?php error_reporting(e_all|e_strict); ini_set('display_errors', true); require('includes/conn.inc.php'); require('includes/functions.inc.php'); $sprojectid = safeint($_get['projectid']); $stmt = $mysqli->prepare("select projectid, projectname, projectimage, languageused, applicationused, description projects projectid = ?"); $stmt->bind_param('i', $sprojectid); $stmt->execute(); $stmt->bind_result($projectid, $projectname, $projectimage, $languageused, $applicationused, $description); $stmt->fetch(); $stmt->close(); ?> <!doctype html> <input name="projectid" type="hidden" value="<?php echo $projectid; ?>"> <html> &l

css - Responsive table with headers on each row -

what have: responsive table. when table becomes responsive remove table headers ( th ) , show table data ( td ). can become problem if data not self explanatory. want display table headers before each row in next manner _______________________ | name apples | |_______________________| | amount 10t | |_______________________| _______________________ | name oranges | |_______________________| | amount 2kg | |_______________________| i figured part can use content:attr(headers) display headers before data. since headers dynamic , not hardcode them. example td:before { content: attr(headers); } the problems i'm having it's janky , not pretty. know need find way format somehow fit needs. ideal way if headers take 50% , data 50% of width. i want css only solution. demo: .table-bordered { width: 100%; border-collapse: collapse; } .table-bordered th { text-align: left; } .table-bordered th:fi

video - x265: Why do P and B frames have different encoding time? -

Image
i'm using x265 encoder hevc. i have 3 different configurations. have 4 b frames (b4) 2 b frames (b2) 0 b frames (b0 - p frames) their encoding times different. b4 , b2 need less encoding time b0 contains p frames. have idea why? both p , b frames have equal qp using parameter --pbratio 1.0 . you can see 3 different output files here using qp 36: b4 , b2 , b0 . you argue encoding b-frames simpler because interpolating simpler extrapolating (as in case of p-frames). interpolating tends give smaller errors extrapolating, reduces amount of bits needs encoded. as results using hm 15.0 reference software, reference software performance not main priority. quote hm software manual : it not meant particularly efficient implementation of anything, , 1 may notice apparent unsuitability particular use.

java - RxJava; How to emit observables synchronously -

i want synchronously emit 2 observable objects (which asynchronous), 1 after other returns first emitted observable object. if first 1 fails, should not emit second one. let's have 1 observable signs user in, , observable automatically selects user's account, after signing in. this tried: public observable<accesstoken> signinandselectaccount(string username, string password) { observable<accesstoken> ob1 = ...; // sign in. observable<account> ob2 = ...; // select account. return observable.zip( ob1, ob2, new func2<accesstoken, account, accesstoken>() { @override public accesstoken call(accesstoken accesstoken, account account) { return accesstoken; } }); } this unfortunately not work use case. emit/call both observables parallel, starting 'ob1'. did encounter similar use case? or has i

ruby on rails - Run the "Before"-tagged hook only once -

i writing cucumber , capybara tests rails application. have tagged of scenarios in different feature files tag "dependent". i have written hooks.rb file located under support directory. wanted have if block executed once, if have multiple "dependent" tagged scenarios. before('@dependent') $dunit ||= true if $dunit puts "hey running " $dunit = false end end in case statement, puts "hey running " ...gets executed multiple times when run multiple scenarios multiple feature files "dependent" tag. how can have puts "hey running " execute once? you resetting value of $dunit true every time block starts since false || true == true. if rewrite block below should work before('@dependent') $dunit ||= false return $dunit if $dunit puts "hey runnig " $dunit = true end

objective c - AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers) deprecated -

i used uint32 dosetproperty = 0; osstatus status1 = audiosessionsetproperty (kaudiosessionproperty_overridecategorymixwithothers, sizeof(dosetproperty), &dosetproperty); i saw become deprecated , changed with: nserror *setcategoryerror = nil; if (![[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayback withoptions:avaudiosessioncategoryoptionmixwithothers error:&setcategoryerror]) { // handle error } after doing that, remotecontrolreceivedwithevent not called longer. in both version did: success &= [[avaudiosession sharedinstance] setactive:yes error:&error]; did encounter kind of problem? did import avfoundation? #import <avfoundation/avfoundation.h> and did forget set delegate? [[avaudiosession sharedinstance] setdelegate:self]; [[avaudiosession sharedinstance] setactive: yes error: nil];

java - Cycle random images in Android -

i'm beginner android / java development. started learning programming , easiest way me modify open source projects understand principles involved. anyways, want simple modification bubble shoot game, 5-10 different background images cycled randomly: when every new level started (but remain same when level restarted) or easier: background changing every single time when level restarting or starting i defined string array of background drawables: <?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="random_background"></string-array> <item name="background_01">@drawable/background01</item> <item name="background_02">@drawable/background02</item> <item name="background_03">@drawable/background03</item> <item name="background_04">@drawable/background04</item> <item nam

javascript - Polymer:Route sections don't display -

i'm using pagejs along iron-pages display different pages. routes working, because console logs fine. but i'm using code display content: <a data-route="test" href="#!test">test</a> <iron-pages attr-for-selected="data-route" selected="{{route}}"> <section data-route="test">test</section> </iron-pages> note : if selected="test" displayed. if using polymer starter kit, need put route in routing.html file. file tells pagejs set route variable "test" when going url "#!test". if wanted have on-click handler sets route variable test when click <a> tag, work too.

android - Choose language for tts depending on translation state -

i'm building simple app can read string resources user. these resources translated (into more 2 languages, english (default resources) , german. now problem choose correct language tts engine, when no translations user's system locale exist. is there way determine whether string translated resp. not come default values/strings.xml file? update: object e.g. no german strings synthesized english voice. i don´t know if need , if understand right way. guess want determine first, locale users device uses, right? then, there method need: string locale = context.getresources().getconfiguration().locale.getdisplayname(); with getresources().getconfiguration() "current configuration in effect resource object" , configuration locale "current user preference locale, corresponding locale resource qualifier" (api quotes). retrive used language getdisplayname() : returns locale's language name, country name, , variant, localized locale. e

hadoop - how to manage modified data in Apache Hive -

we working on cloudera cdh , trying perform reporting on data stored on apache hadoop. send daily reports client need import data operational store hadoop daily. hadoop works on append mode. hence can not perform hive update/delete query. can perform insert overwrite on dimension tables , add delta values in fact tables. introducing thousands delta rows daily not seem quite impressive solution. are there other standard better ways update modified data in hadoop? thanks hdfs might append only, hive support updates 0.14 on. see here: https://cwiki.apache.org/confluence/display/hive/languagemanual+dml#languagemanualdml-update a design pattern take previous , current data , insert new table every time. depending on usecase have @ apache impala/hbase/... or drill.

More efficient way of suming over a matrix in numpy/regular python -

good day, studies created cellular automato in 2 dimension. program running still try optimize it. piece of code bellow sums 8 neighbor cells of central cell in 2d array. after next cell gets defined function of sum. there faster way 2 for-loops? before had 4 loops summation, 2 time slower it's now... n = len(mat1) m = len(mat1[0]) mat2 = np.zeros((n,m)) sumn = 0 start = time.time() in range(1,n-1): j in range(1,m-1): sumn = mat1[i-1,j-1] + mat1[i-1,j] + mat1[i-1,j+1] + mat1[i,j-1] +mat1[i,j+1] + mat1[i+1,j] + mat1[i+1,j+1]+ mat1[i+1,j-1] if str(sumn) in b , mat1[i,j] == 0: mat2[i,j] = 1 elif str(sumn) in s , mat1[i,j] == 1: mat2[i,j] = 1 sumn = 0 end = time.time() print end - start thanks xnx, included roll on matrix instead of looping on elements. after created boolean 2d numpy array use initialize next generation. sumn = sum(np.roll(np.roll(mat1, i, 0), j, 1) in (-1, 0, 1) j in (-1, 0, 1) if (i != 0 or

c# - EF Power Tools - reverse engineer code first into different folders -

Image
i'm working entityframework 6 , i'm trying find tool generate models database without edmx file (code first existing database). mean classes : public class util_emailmap : entitytypeconfiguration<util_email> { public util_emailmap() { // primary key this.haskey(t => t.id_util_email); // properties this.property(t => t.email) .isrequired() .hasmaxlength(100); // table & column mappings this.totable("util_email", "mydatabase"); this.property(t => t.id_util_email).hascolumnname("id_util_email"); this.property(t => t.email).hascolumnname("email"); this.property(t => t.date_creation).hascolumnname("date_creation"); } } and classes : public partial class util_email { public util_email() { this.utils = new list<util>(); } public long id_util_email { get; set; }

elasticsearch hourly histogram calculation -

this dsl returns hours in date field of index.. need total value of "hour value" in index. hope 24 buckets result each buckets contains hour , value in buckets must total sum of fields("respsize") of docs in hour { "size":0, "query":{ "filtered":{ "filter":{ } } }, "aggs":{ "aggs1":{ "date_histogram":{ "field":"loggingdate", "interval":"hour", "format":"k", "order":{ "aggs2":"desc" } }, "aggs":{ "aggs2":{ "sum":{ "field":"respsize" } } } } } } exmp: returns "aggs1": { "buckets": [

html - Not able to scroll fixed Div -

its working fine large screen size , if screen height not enough big fixed div height, not able see overflowed part. great if able scroll see bottom part of fixed div. have added garbage data in fixed div. <!doctype html> <html> <head> <title></title> <style type="text/css"> .html{ width: 100%; height: 100%; } #body{ background-color: red; height: 1500px; width: 100%; } #tem{ position: fixed; background-color: blue; width:200px; } </style> </head> <body id="body"> body <div id="tem"> fixed div java - possible, in jsp, print value of variable ... stackoverflow.com/.../is-it-possible-in-jsp-to-print-the-value-of-a-variabl... aug 21, 2009 - achieve same effect @chii's answer: <c:set var="attributename" value="foo"

asp.net mvc 4 - Running IdentityServer3 behind an NGINX forward Proxy -

i attempting forward proxy , .net mvc application co-hosting identityserver3 behind nginx. proof of concept, running nginx in virtualbox vm on notebook. login process seems work until after i've authenticated user , i'm redirecting application. after turning on logging identityserver3 can see there no errors being returned, tokens expect created created , forth. notice when response message logon not set .aspnet.cookies cookie. believe problem. i suspect sort of foolish setup issue in environment. have defined virtual machine's ip address goober.mydomain.com in windows hosts file. nginx config file follows. notice obvious doing wrong? user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { server { large_client_header_buffers 4 32k; location /phoenix { rewrite ^/phoenix(.*) /$1 break; pro

Creating a database in Orientdb in distributed mode -

our system creates orientdb databases programmatically , uses 1 database each customer (before jump on dismissing design, reasons security, possibility move customer/data between datacenters/regions , possibility relocation on-premise). this works great in orientdb in single mode. however, when database setup in distributed mode (3 servers, on amazon). behaviour is, put mildly, weird. know docs doesn't being supported, couldn't find says doesn't either. sometimes database created fine, client locks indefinitely (in oadaptivelock.lock() ). whole cluster needs restarted able use database , sometimes, as time of writing, 1 orientdb node shuts down after seems synching others ( address[1.2.3.4]:2434 shutting_down [lifecycleservice] -> terminating forcefully... [node] ). error message proceeded stacktrace (see below). so, questions: do orientdb support database creations online in distributed mode? if so, can doing wrong? if not, there plans on supporting in f

Reading LDAP(OpenLDAP) Schema from c# -

i want available objectclass names , attributes of every objectclass openldap (not active directory) using c#. i able activedirectoryschema class when dealing ad, don't know how other ldap server. can please help? you need query rootdse , retrieve value "subschemasubentry" attribute. (cn=schema openldap). then query value subschemasubentry base , (objectclass=*) example shows here . if want objectclasses (which include attributes within objectclasses) use like: ldapsearch -h yourldapdns -b "cn=schema" -s base -d cn=admin,ou=...,dc=yourdomain,dc=com -w secretpassword "(objectclass=*)" objectclasses

struct - How to set generic trait as type of function argument? -

there generic trait graph type nodekey = usize; type edgeweight = usize; trait graph<t> { fn add_node(&mut self, node: t) -> nodekey; fn add_edge(&mut self, begin: nodekey, end: nodekey, weight: edgeweight); fn new() -> self; } and implementation adjacencylist struct struct adjacencylist<t> { // ... } impl<t> graph<t> adjacencylist<t> { // ... } i need function takes empty graph , it. fn create_sample_graph<t: graph<&'static str>>(graph: &mut t) { let key1 = graph.add_node("node1"); // ... } i create instance of adjacencylist &str type , send function. fn main() { let mut adjacency_list = adjacencylist::<&str>::new(); create_sample_graph(adjacency_list); } but compiler fails following error: error: mismatched types: expected `&mut _`, found `adjacencylist<&str>` (expected &-ptr, found struct `adjacencylist`)

linux - Inconsistent value returned by function -

when call function default_ratio_check(...), confusing value. const int comp_read_compress = 1; const int comp_write_compress = 0; const int comp_trace_use_default_ratio = 2; double comp_default_ratio = 0.20; compress_struct* compress_global; double default_ratio_check( char** s, int i) { if( s == null ){ if(comp_trace_use_default_ratio ) { return comp_default_ratio; } } if( comp_read_compress || comp_write_compress ){ if(comp_trace_use_default_ratio ) { comp_default_ratio = atof( s[i] ); return comp_default_ratio; } } return 0; } i assign result double type "ratio". ratio = default_ratio_check( (char**)0, 0 ); the value assigned ratio 2.0, value of comp_trace_use_default_ratio instead of comp_default_ratio. change value of comp_trace_use_default_ratio,correspondingly, returned value ratio followed. have use gdb step function, , find works correctly. return value wrong

php - Shared sections in master layout containing db data -

in laravel 5.1 app, have master layout shared section, let's sidebar list of 5 recent site posts. section content dynamic (elaborated db query), identical on every website page. to obtain this, in master layout @include sub-view containing sidebar code, still mean repeating same db query in each controller action, lot of code repetition. i'm sure there smarter way obtain this, couldn't figure out. appreciated. as can see here under sub views can pass data include such as @include('view.name', ['some' => 'data']) then need pass data master layout. edit: view composers looking seems

javascript - hiding parent when a span contains no content -

i've been , down site , various questions related this, cannot find resolution this. i'm try hide parent div "row" whenever span "specvalue" contains no data <div class="container-fluid" id="itmspecstbl"> <div class="row" id="row"><div class="col-xs-6" align="left"><b>accuracy</b> </div><div class="col-xs-6" align="right"><span id="specvalue"><%=getattribute('item','127559','custitem1','')%></span> </div></div> <div class="row" id="row"><div class="col-xs-6" align="left"><b>drive type</b> </div><div class="col-xs-6" align="right"><span id="specvalue"><%=getattribute('item','127559','custitem2','')%></spa