Posts

Showing posts from August, 2014

r - How to read edited rhandsontable in another tableoutput in shiny? -

i trying make simple calculator in shiny, first create rhandsontable input given , read values in rhandsontable create table output gives final calculation. running following code this, final calculations not being updated when edit rhandsontable. ui.r library(shiny) library(rhandsontable) fluidpage( titlepanel("test app"), sidebarlayout( sidebarpanel( numericinput("loc", "unique location id", na), submitbutton("submit"), width = 2 ), mainpanel( tabsetpanel( tabpanel(" h4("edit details:"), rhandsontableoutput('edit'), h4("final details:"), tableoutput('fin') ) ) ) ) ) server.r library(shiny) shinyserver(function(input, output) { final<- reactive({ ##here dataset based on location id input ##the dataset has columns(in order): location_

oracle - dbms_xmldom - How to get the <?xml tag -

i trying line <?xml ....?> @ start of xml document using pl/sql package dbms_xmldom . here code far declare l_dom dbms_xmldom.domdocument; l_clob clob; l_node dbms_xmldom.domnode; begin l_dom := dbms_xmldom.newdomdocument; l_node := dbms_xmldom.makenode(l_dom); l_node := dbms_xmldom.appendchild(l_node, dbms_xmldom.makenode( dbms_xmldom.createelement(l_dom, 'root') ) ); dbms_lob.createtemporary(l_clob, true); dbms_xmldom.writetoclob(l_dom, l_clob); dbms_output.put_line(l_clob); end; the output is: <root/> expect: <?xml version="1.0" encoding="utf-8"?> <root/> any pointers on how great. just record - here need add dbms_xmldom.setversion(l_dom, '1.0" encoding="utf-8'); after creating document

Functional requirement -

i have application diagnosis , should determine functional , nonfunctional requirement can me question please: language considered functional requirement? a functional requirement defines software supposed do. non-functional requirement defines further expectations independent actual features. ex: functional requirement = "software should square input value" non-functional requirement = "software should use @ max 1mb memory" note: not have " functional programming "

javascript - Ember.js 2.7 - How to check validation on an input field? -

i'm pretty new ember.js , i'm having trouble how validation on input field. here code template index.hbs: <div class="jumbotron text-center"> <h1>coming soon</h1> <br/><br/> <p>don't miss our launch date, request invitation now.</p> <div class="form-horizontal form-group form-group-lg row"> <div class="col-xs-10 col-xs-offset-1 col-sm-6 col-sm-offset-1 col-md-5 col-md-offset-2"> {{input type="email" value=model.email class="form-control" placeholder="please type e-mail address." autofocus="autofocus"}} </div> <div class="col-xs-10 col-xs-offset-1 col-sm-offset-0 col-sm-4 col-md-3"> <button disabled={{isdisabled}} {{action 'saveinvitation' model}} class="btn btn-primary btn-lg btn-block">request invitation</button> </div> </div> {{#if res

Azure Iot Rest API Message from cloud to device -

get : https://myiot.azure-devices.net/devices/mydevice/messages/devicebound?api-version=2016-02-03 authorization: sas key i getting 204 no content response above api while receiving message using postman request maker cloud device.when send messages device cloud appearing in iot hub giving error 204 while receiving messages cloud. first, if haven't sent cloud-to-device messages , no content response(error code:204) calling api( https://myiot.azure-devices.net/devices/mydevice/messages/devicebound?api-version=2016-02-03 ). expected. means the server has fulfilled request, there no new information send back. second, want receive device-to-cloud message have sent. unreachable. because api used receive cloud-to-device messages. in short, device-to-cloud , cloud-to-device different messaging primitives azure iot hub provides communicate device. , device-to-device communication want not supported natively azure iot hub. finally, how send cloud-to-device message?

java - LibGdx RayCast box2d debug (visual on screen) -

can me? i want see raycast in game screen (for debugging..). what best way achieve that? please note use "box2d". , way draw stuff screen animation.. means need create "edgeshape"? , debug line? please if there suggestions can give or ideas don't mind how implement, want proper way see raycast. not found way draw raycast, saw use batch.draw(); - guess won't work me, because way game work's box2ds shapes , animation? right? thanks much! world.raycast(callback, enemy.getbody().getposition(), new vector2(enemy.getbody().getposition().x-500, enemy.getbody().getposition().y)); } raycastcallback callback = new raycastcallback() { @override public float reportrayfixture(fixture fixture, vector2 point, vector2 normal, float fraction) { if(fixture.getbody().getuserdata() == modeltype.player) { system.out.println("hey!"); return 0; } retur

IntelliJ Git Java Project run -

Image
i'm new @ intellij, , can't run project (imported git) java project. (i think) installed jdk correctly. tried "invalidate caches" also. some screens: you need set assignment 3 directory sources root directory. right click assignment 3 directory , select mark directory as , sources root menu. mark directory as option near bottom. that should tell intellij directory has src code in it.

Get data from Azure push notification on Xamarin Forms Page -

i'm developing xamarin forms app gets data prestashop webservices. in order make work, need create api key on website , provide app, think big problem average user copy 32 characters key web app. so decided it's option create azure app service backend notification hub, when user creates api key, goes xxx.azurewebsite.com paste key, enter customer notification hub id showed in login screen of app , push notification send app, api key captured stored , user logs in. i'm following guide add push notifications xamarin.forms app can't see how can recive notification in open screen , capture in viewmodel class in shared project. here's sample code shows how display pop-up alert in xamarin.forms when receive push notification on either platform. xamarin.forms shared code create static class in xamarin.forms shared code triggers displayalert . create static method called showalert can accessed our platform-specific projects. public static class

sql - Using With clause in sqlite3; are the results of with clause saved and reused? -

with printercheck (select exists (select 1 available_material_printmode_config printer_name ='123' limit 1) p), materialcheck (select case when material_name null 0 else 1 end m available_material_printmode_config printer_name ='123' , printmode_name = '2' limit 1) select m.name material m left join available_material_printmode_config ac on ac.material_name = m.name , (select p printercheck limit 1) , (select m materialcheck limit 1) left join available_materials am1 on am1.material_name = m.name , ((select p printercheck limit 1) != 1 or ((select p printercheck limit 1) , (select m materialcheck limit 1) !=1 )) case when (select p printercheck limit 1) , (select m materialcheck limit 1) ac.printer_name = '123' , ac.printmode_name = '2' else am1.printer_name = '123' end i have sqlite3 query looking this, wanted know if printercheck , materialcheck executed/ fetched each row of main query or executed once , result stor

c# - WCF Soap Service Randomly Failing -

i have soap service calling. works around 90% of time. cannot seem pinpoint causing issue. making difficult fix since cannot replicate issue. i randomly getting following error: cautl001e failed load xml document string [<?xml version="1.0" encoding="utf-8" standalone="no" ?> <message> <header> <protocolversion>550</protocolversion> <protocolinfo>3</protocolinfo> </header> <elements>b6ff2099f2a58662bbd3b814a5537e076cf08657d2d73e28fa37eae1cd42e8c6a7f65fa5bf004fdd3faf3fb4185ce34f51724c912f281a08828acc50a42c8b659b5b26e51dea1f742a8c9f8857b7cac569374d540210ef8d58dd6c82670f2d3bcb20987a36930d311318310a9995a2eed73d9457313361525ee4edc1c9c3ac6a4654adf0cd8783e2a5a2ec9230c2f1ee6247e5176a8faf9872edf83a6a86b60a8bbdef8f732b8887cd1348cbe837384470e57818f821a40f9d95a92382a23cf8309bd37598d29121d96333535b5f72716382a8f319942edcb7605b55866178d605d35f00dccedb08cdc5182dbcdfe41eea87a49ff76ac96b1d381ff324

json - bash: split pipe stream into records and combine all lines in a record into one -

i have file containing million individual xml files (simply concatenated) convert json. file looks this: <amf xmlns="..."> <test> 1 content </test> </amf> <amf xmlns="..."> <test> 2 content </test> </amf> note above file not formatted xml file (i.e. individual entries not nested), cannot convert using `xml2json'. to achieve want separate file records, each record corresponds individual xml file, concatenate xml file 1 line, , use parallel on each line applying xml2json achieve json output. when try use awk or gawk on osx, have trouble splitting pipe records. here's code tried ("useless" cat readability): cat bigfile.xml | awk '{print nr "<amf xml"$0}' rs="<amf xml" which gives: 1<amf xml 2<amf xmlns="..."> <test> 1 content </test> </amf> 3<amf xmlns="..."> <test> 2 co

How can I write complex sql query in Laravel Elequent Query Builder -

below shown query in sql server. working fine in sql server studio. how can write in laravel eloquent format? i tried both db::table('price')... method , price::where()... model method. using both methods not able find average. is limitation of eloquent query builder? best way output in laravel? select month([date]) date, avg(oil) oil, avg(gas) gas, [mydatabase].[dbo].[price] year([date]) = 2017 group (month([date])) this output sql i got answer $result = db::select(db::raw("select month([date]) date, avg(oil) oil, avg(oil_parity) gas, [mydatabase].[dbo].[price] year([date]) = :year group (month([date]))"),['year'=>$year]); dd($result);

ios - Firebase: Listen ChildEventListener even if app exits -

i'm working on ios application, , want achieve behavior push notifications using firebase real time db. in case app listening firebase node , i'll send local push notification user in case node updated. the issue is, if app not running i.e. user has killed it, app continue listening particular node? guess, in android we've support this, explained in link ( link ). can achieve same behavior in ios. if no, can alternative? thanks update : 1- there's nothing triggering push notifications locally in ios app. wanted achieve remote notification's behavior , can't done. 2- far listening event concerned, can't done when app not in foreground or background. you can’t if ios app killed/not present in memory. however, can tasks if app in background, , present in memory. can use background fetch request in case. in android, there services run when app killed. on ios, there no such thing this. you can add firebase observers in root v

sql - Column "INVOICE.DATE_OF_ISSUE" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause -

could explain me i'm doing wrong? i'm completly new in , don't know do. i'm trying show invoice : nr_invoice , invoice value, issued between 17 july 1995 , 24 july 1995, net value more 50, sorted date. select invoice.nr_invoice, count(commodity.price) invoice full join line_invoice on invoice.nr_invoice = line_invoice.fnr_invoice left join commodity on line_invoice.fid_towar = commodity.id_commodity invoice.date_of_issue between '1995-07-17' , '1995-07-24' , commodity.price > 50 group invoice.nr_invoice order invoice.date_of_issue here error column "invoice.date_of_issue" invalid in order clause because not contained in either aggregate function or group clause. there no reason use outer joins query. where clause turning them inner joins anyway. to solve particular problem, need either include date_of_issue in group by or use aggregation function: select i.nr_invoice, count(c.price) invoice join line_

swift3 - Make Search Bar Become First Responder -

i have uisearchcontroller inside of uinavigationbar . user has tap on uibarbuttonitem , in instantiate new uiviewcontroller present it, in order begin searching. class viewcontroller: uiviewcontroller { var searchcontroller: uisearchcontroller! override func viewdidload() { super.viewdidload() setupsearchcontroller() } func setupsearchcontroller() { searchcontroller = uisearchcontroller(searchresultscontroller: nil) searchcontroller.searchbar.delegate = self searchcontroller.searchresultsupdater = self searchcontroller.searchbar.showscancelbutton = true searchcontroller.dimsbackgroundduringpresentation = false searchcontroller.hidesnavigationbarduringpresentation = false definespresentationcontext = true navigationitem.titleview = searchcontroller.searchbar } } i've done plenty of research before hand, still can't manage find solution... help in making search controller become first responder appreciated.

benchmarking - How fio benchmark tool performs sequential disk reads? -

i use fio test read/write bandwidth of disks. even sequential read test, can let run multiple threads. what mean running multiple threads on sequential read test? does perform multiple sequential reads? (each thread assigned file offset start sequential scanning from) do multiple threads share file offset? (each thread invokes sequential reads using single file offset shared multiple threads) i tried read open source codes of fio, couldn't figure out. can 1 give me idea? sadly didn't include jobfile question , didn't platform you're running on. here's stab @ answers: yes multiple sequential reads though wouldn't have single thread? no each thread has own offset. on linux fio defaults using separate processes per job , each process has own file descriptor (for ioengines use files) each file used. further, ioengines (e.g. libaio, pvsync there many others) use syscalls take offset want i/o @ request if share descriptor offset not im

jquery - How to display a input textbox of particular div when selecting a value from select box? -

i have select box containing values shown below : <div> <select class="skilltest"> <option>enter</option> <option class="add">add</option> </select> </div> <div class="disableskill"> <input type="text" class="form-control" name="advanced" id="exampleinputname" placeholder="tell me skill level"> </div> //next same div above <div> <select class="skilltest"> <option>enter</option> <option class="add">add</option> </select> </div> <div class="disableskill"> <input type="text" class="form-control" name="advanced" id="exampleinputname" placeholder="tell me skill level"> </div> i have multiple divs using class padnone. when clicking value advanced of particular div class pad

Eclipse does not show any output for c++. and if i terminate it ,show all printf statements and if i run .exe file in cmd it runs normally -

include int main(){ float balance; printf("\nenter balance ($) : "); scanf("%f",&balance); return 0; } not running on eclipse not running on cmd

java - Turn multiple Cassandra partitions into Akka stream -

i'm trying develop source turns set of cassandra partitions akka stream (i execute multiple cassandra queries through bound statement, 1 each partition , mapconcat result iterable of dtos): source<result<journalentry>, notused> src = source.unfoldasync(querybag, s -> { boundstatement bound = getboundstatement(querybag); // out data cassandra: future<result<journalentry>> page = future.apply(() -> journalmapper.map(session.execute(bound)), ec); future<optional<pair<querybag,result<journalentry>>>> next = page.map(r -> { optional<pair<querybag,result<journalentry>>> opt; if (r.isexhausted()) { opt = optional.empty(); } else { opt = optional.of(pair.apply(querybag.incrementpartitionid(), r)); } return opt; }, ec); return futureconverters.tojava(next); }); source<journalentry, notused> concat = src.m

android - How can I get data from the service when the MediaPlayer is prepared? -

i developing simple music player. this code: lv.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { ... ... // sb seekbar // musicsrv service // myupdater class update seekbar: sb.removecallbacks(mupdater); sb.setprogress(0); sb.setmax(musicsrv.getdur()); mupdater = new myupdater(musicsrv.getmediaplayer(), sb, btplay, currenttime, totaltime, replay); sb.post(mupdater); ... ... when tap song in listview, error: 02-05 19:59:16.625 10140-10140/com.xrobot.john.musictest2 e/mediaplayer﹕ attempt call getduration without valid mediaplayer because, think, music player not prepared when mus

java - Double clicking Netbeans executes an empty jframe instead -

i use netbeans 7.1.2 ide java swing applications, when double click on netbeans ide icon, empty jframe executed instead of ide. don't know what's wrong. i reinstalled ide , restarted machine , got fine.

Return multiple includes on object Ruby on Rails JSON -

i have 3 models , trying output of them json in single object. the models , associations follows: class customer < applicationrecord has_one :subscription has_one :address end class address < applicationrecord belongs_to :customer end class subscription < applicationrecord belongs_to :customer end i trying return of associated data json using following: class homecontroller < applicationcontroller def index @customers = customer.all render json: @customers, :include => :address, :subscription end end however returning syntax error ruby expecting => somewhere. on how can output of data appreciated. incase looking i've answered question following syntax. class homecontroller < applicationcontroller def index @customers = customer.all render json: @customers, :include => [:address, :subscription] end end address , subscription needed passed in array :)

assembly - MIPS Quicksort program showing Exception 4 [Address Error in inst/data fetch ] -

i learning mips . tried write program on quicksort (without recursion). wrote following code . takes sorted array number of elements , number search input , returns array index of number , .data .align 2 myarray: .space 4000 #1000 elements atmost prompt1: .asciiz "enter n : " prompt2: .asciiz " " prompt3: .asciiz "\nenter sorted array: " prompt4: .asciiz "enter number sorted" .text main: li $v0, 4 la $a0, prompt1 syscall li $v0, 5 syscall move $s1, $v0, #n addi $s0, $s1, -1 li $v0, 4 la $a0, prompt4 syscall li $v0, 5 syscall move $s2, $v0 #stores k , number searched addi $t0, $zero, 0 #clear values in $t0 li $v0, 4 la $a0, prompt3 syscall input: li $v0, 5 # reading inputs syscall add $t1, $t0, $zero add $t3, $v0, $zero sll $t1, $t0, 2 sw $t3, myarray($t1) addi $t0, $t0, 1 slt $t1

javascript - ASP.NET MVC - Invalid assignment left-hand side when trying to use C# inside JS function -

i have view pass values session. achieve this, i've created js function called whenever click specific button. function receives index number parameter , retrieves relative object model passed view , own quantity selected option list in viewpage, assigning both session. problem i'm facing can't figure out how mix javascript , c# correctly. in current situation i'm receiving following error console: referenceerror: invalid assignment left-hand side which refers following html generated application: function setitemtosession(index) { '0' = index; var selectedvalue = document.getelementbyid(("quantityselection" + index)).nodevalue; var itemselected = b2bcommercethesis.models.viewmodels.shoppingitem; '' = itemselected; '' = selectedvalue; alert("everything works great index: " + index); return; } the relative code inside view is: <script type=&quo

android - I can't use Intent at Activity -

when click marker on google map , want enter activity , when got result javascript , can't intent websettings websetting = webview.getsettings(); websetting.setjavascriptenabled(true); websetting.setdisplayzoomcontrols(true); websetting.setsupportzoom(true); websetting.setbuiltinzoomcontrols(true); webview.addjavascriptinterface(new javascriptinterfacetest(this), "android"); and javascriptinterfacetest() : public class javascriptinterfacetest { context mcontext; /** instantiate interface , set context */ javascriptinterfacetest(context c) { mcontext = c; } /** show toast web page */ @javascriptinterface public void responseresult(string result){ log.e("jscallback","drink"); intent mainintent = new intent(mainactivity.this, test.class); startactivity(mainintent); } @javascriptinterface private void startactivity(intent mainintent) { // todo auto-generated method stub } } html: drinkmarker = new

Reading Space Delimited Strings Line by Line and Storing Them in Arrays (in C) -

this question has answer here: array of structs replacing values on itself 3 answers i have input file consisting of: createhall "red-hall" "stardust" 24 20 createhall "orange-hall" "last_samurai" 10 20 and want store each line in array future uses. so far code is: (added lots of printf's debugging purposes.) #include <stdio.h> #include <stdlib.h> struct str { char *commands[5]; }; struct str a[]; int main() { int i=0; int j=0; char *token; printf("starting program...\n"); char filename[] = "input.txt"; file *file = fopen ( filename, "r" ); if (file != null) { char line [1000]; printf("read new line...\n"); while(fgets(line,sizeof line,file)!= null) /* read line file */ { j=0; printf(&q

python - command prompt getting closed on its own using os.system -

i using os.system(cmd) launch command prompt , run command in it. now, command command run py.test code. command prompt getting closed on own after py.test gets executed. found adding && pause @ end of cmd helps retain command prompt till press button. working fine if test cases pass in py.test . so, how retain command prompt whatever happens cmd. this basic idea of project: have many py.test modules. want run of these 1 command wherein specify module want run. purpose opening different command prompt , running module there.

excel - Match Forecasted Values to Actuals -

i receive daily file forecasts values given categories. filedate = fcstdate, value fcstval real, actual value. right i'm using excel power query (xl'16: & transform) pull dozens of files table resembles 1 below (400k+ rows, 18 levels in reality). i need able say, on 1-1, 1-2 category aa|ac|null forecast 60, 44 respectively on 1-3, actual value 43. ditto every other row. most, not all, unique row combinations common between files. i'll have worry dealing renamed levels... the table.partition, table.fillup, table.frompartitions power query functions express logic perfectly, power query far slow because seems read each large .xlsx file multiple times ( +1x per row?! ), made worse because i'd need index table distinct category levels & forecast dates partition on. right i'm reduced using formula in excel table: =sumifs([actualval], [lvl1],[@[lvl1]], [lvl2],[@[lvl2]], [lvl3],[@[lvl3]], [filedt]],[@[fcstdt]], [@[eq]]="y") however, requires se

javascript - Terminate concurrent long polling Ajax HTTP requests -

i performing long polling via ajax request, listen database changes. each time want listen value change send request follows : $.ajax("http://system.host/dispatcher.php", { method : "post", datatype : "json", data : "{value: 'user.username'}" }); $.ajax("http://system.host/dispatcher.php", { method : "post", datatype : "json", data : "{value: 'user.age'}" }); => tell php script want listen user.username , user.age values. then when want notified above values send next long polling request, "notify request" : $.ajax("http://system.host/dispatcher.php", { method : "post",i datatype : "json", data : "{notify : true}", success : function(result) { //success callback }, failure : function(reply){ //fai

ruby - RVM gemset import by removing currently installed gems which do not match the import set -

i wondering if there option in rvm clean import of gemset, thereby removing gems/versions not match gems listed in gemset import. of course possible do rvm --force gemset empty && rvm gemset import import.gems but takes long time because has download , install gems again. nice if there --overwrite option or establish behavior.

amp html - WordPress AMP Integration -

i installed amp automatic in wordpress site. when load page have type /amp after link in order display amp page/post. questions are: how can display page automatically without having type /amp ? how can show other posts have on site? hope can give me starting point since bit lost. here site : http://www.demosite.burnnotice.co.za/ hope can help. you have type /amp , end in order view amp version in desktop. once have implement amp website , google crawls website, amp pages shown visitors on google search. you able see amp pages if set up.amp mobile platforms. make sure have implemented amp properly: https://www.techtipshacks.com/setup-amp-wordpress.html also recommend adding menu, related posts etc amp pages plugin automattic having limited functionalities: https://www.techtipshacks.com/add-menu-related-posts-social-icons-for-amp.html

android - Why this method call can not be converted into lambda? -

consider following code: recyclerview.addonscrolllistener(new recyclerview.onscrolllistener() { @override public void onscrolled(recyclerview recyclerview, int dx, int dy) { //some code here } }); why can not translated this: recyclerview.addonscrolllistener((recyclerview, dx, dy) -> { // code here }); i'm using retrolambda in androidstudio. because recyclerview.onscrolllistener abstract class , has more methods onscrolled .

ibm midrange - Is it necessary to have downtime if you want to delete a users spool files -

we have production system(as400) running 24/7 , 1 of our systems specified user generating allot of spool files. the issue has been resolved stuck allot of spoolfiles want delete. using following command on green screen. dltsplf file(*select) select(the user) my question need downtime if want run command or can while users busy? spool files meant output, impact if user wanted print out. delete old spool files daily.

mysql - How to Load amount using LOAD DATA LOCAL INFILE? -

i'm unable load amount using load data local infile have text file there 1 column called 'amount'. problem field has values 20,200.00 , -61,066.11 etc in text file. when try load these values in mysql database, loads 20 , -61. should load full amount in table? using decimal(10,2) data type. using following query. load data local infile 'c:/users/dataction123/desktop/nordic.txt' table spend_nordic lines terminated '\r\n'; load data local infile 'c:/users/dataction123/desktop/nordic.txt' ignore table spend_nordic fields terminated '\t' lines terminated '\r\n' (int_col, @float_col) set float_col = replace(@float_col, ',', '.'); explanation : mysql casts value column type when reads file, before applying transformations described in set clause. if instruct read variable value handled string beginning. float_col name of field. for reference click here

mysql - my php code is only importing the first line of my csv file to the database -

so, have csv file want import database importing first line. dont know why not importing data in csv file. maybe because of line breaks? sample of csv file: "tiago" <20>,20,11,sip/11,20,w,2016-03-01 14:33:06,2016-03-01 14:33:09,2016-03-01 14:33:51,45 "claudio" <10>,10,11,sip/11,20,w,2016-03-01 14:35:05,2016-03-01 14:35:07,2016-03-01 14:35:48,43 "hortencio" <11>,11,21,sip/21,20,w,2016-03-01 14:39:55,2016-03-01 14:40:12,2016-03-01 14:40:25,30 "andre" <19>,19,22,22000@default,s,2016-03-01 14:43:22,2016-03-01 14:43:42,2016-03-01 14:43:42,20 my model: <?php class csv_model extends ci_model { var $gallery_path; var $gallery_path_url; function __construct() { parent::__construct(); $this->gallery_path = realpath(apppath . '../csv'); $this->gallery_path_url = base_url() . 'csv/'; } function do_upload($data) { $filename = $data['fileinfo'][0]; $path = $da

javascript - Dynamically insert content tag -

i want use <content> tag dynamically (on demand). ex: parent: <parent> <child> <grand-child></grand-child> </child> <parent> child: <child> <content></content> </child> the above hierarchy place grand child inside child, want insert content provided parent dynamically. for ex: grand parent tab child table grand child chart on clicking on row of table want display chart below row. type of element has passed tab. is there way achieve this? what tried: dynamically created content tag using document.createelement("content"); on row click event handler. creates content tag not contents. guess available @ template render time.

android - How i can correctly set up CONTROL_SCENE_MODE_ACTION camera2API? -

i need set control_scene_mode_action app camera2api. i tryed set capturestillpicture() method in lockfocus() method in statecallback doesn't work... in documentation found explanation is, lines how mode have set up... there 2 question: where exacly have set mode how can check working or maybe can suggest me how reduse expose time... thanks in advance you can modify camera2basicfragment google camera2basic sample add line mpreviewrequestbuilder.set(capturerequest.control_scene_mode, capturerequest.control_scene_mode_action); just after line mpreviewrequestbuilder.set(capturerequest.control_af_mode, capturerequest.control_af_mode_continuous_picture); in onconfigured() method of example @override public void onconfigured(@nonnull cameracapturesession cameracapturesession) { // camera closed if (null == mcameradevice) { return; } // when session ready, start displaying preview. mcapturesession = cameracaptureses

javascript - best practice/architecture to combine multiple js components in a spa -

i have following architecture single page application: each page or widget can independent reusable module (reusable project might used on others well) there core application use external modules. core application able communicate modules , vice versa. each module can written in technology (react, angular, vanilla) each module should deployed independently (something dynamic-lazy-loading) the core app should responsible config of modules (api urls etc) i have not been able think way of achieving stated nor find on google.. might missing keyword such architecture. any ideas, best practices or relevant input? thanks! after researching subject bit more, architecture think match requirements based on web-components (can read more here - http://webcomponents.org/ , recommend using library polymer). advantage of web-components can hold need in them (html,css,ajax requests, can in html document) , using shadow or shady dom imply components document have done once ifr

elasticsearch - Auto Complete is not working in Elastic Search -

if give exact match or 1 character working fine, if give 2 or 3 characters auto complete not working. example if give t or test working, if give tes not working. my data looks this put /test/test/1 { "id": "1", "input": "test", "output": ["testing", "testing"] } put /test/test/2 { "id": "2", "input": "test two", "output":["testing", "testing"] } my elastic query { "query": { "query_string": { "query": "tes" } } } you forgot wildcard believe: get /test/test/_search { "query": { "query_string": { "query": "tes*" } } } you may want use "query": "input:tes*" autocomplete 1 specific field.

javascript - Click a button outside Revolution Slider from inside revolution Slider -

i working on website using revolution slider , visual composer. problem this, have slider , below have expandable section(which add-on visual composer), section button allows expand , see content inside without having open new page. i have button inside revolution slider triggers when expandable section clicked allowing open inside slider. i have tried searching everywhere seems no 1 faced problem before. i tried callback of function on revolution slider button couldn't make work, wont recognise function declared in custom javascript section, , have problems clicking expandable section function since cannot find it's id seems changing every time refresh page(checked through inspect element ). any ideas ?

ios - Multiple cell types in UICollectionView -

Image
i had created 2 type of cells collectionview, both of different heights. but when run app, black cell cut in half. unable understand why. tried changing size of cell, in turn makes black cell on lap cell below it. please this. thanks the size of collectionview item has changed dynamically. kindly follow following link solve uicollectionview - dynamic cell height?

php - collect items in shopping basket and then pass basket to paypal. possible? -

i know there paypal button , easy way implement paypal in website. if want little bit more elegant need adapt much. have question if scenario possible: the user on website , puts items small basket (programmed javascript). has example 3 items in basket , clicks "pay". want forward user , content of basket papyal can make checkout. is there way forward user paypal , transmit data of basket paypal (price, name of item ect.)? i happy if can give me hint find more this. thanks!

datetime - Difference between two time.Time objects -

very new 'go'. question might basic one. i have 2 time.time objects , want difference between 2 in terms of hours/minutes/seconds. lets say: t1 = 2016-09-09 19:09:16 +0530 ist t2 = 2016-09-09 19:09:16 +0530 ist in above case, since difference 0. should give me 00:00:00. consider case: t1 = 2016-09-14 14:12:48 +0530 ist t2 = 2016-09-14 14:18:29 +0530 ist in case, difference 00:05:41. looked @ https://godoc.org/time not make out of it. you may use time.sub() difference between 2 time.time values, result value of time.duration . when printed, time.duration formats "intelligently": t1 := time.now() t2 := t1.add(time.second * 341) fmt.println(t1) fmt.println(t2) diff := t2.sub(t1) fmt.println(diff) output: 2009-11-10 23:00:00 +0000 utc 2009-11-10 23:05:41 +0000 utc 5m41s if want time format hh:mm:ss , may constuct time.time value , use time.format() method this: out := time.time{}.add(diff) fmt.println(out.format("15:04:05&qu

jenkins - Customize SonarQube rules of sonar-web-frontend plugin in sonar dashboard -

i configured sonarqube analyze angular 2 project example sonar-web-frontend-helloworld and added sonar plugin jenkins , run gulp task jenkins command. worked , can view project in sonar dashboard. but problem uses rules project not sonar server. have added web-front-end plugin in sonar server. want use set of rules while running code analyzer project. , also, using current methods disable rules have disable them rules file in project. how can improve sonar job disable rules using sonar dashboard log in admin. sonarqube analysis use rules relevant quality profile on server. if need adjust set of rules applied, must edit profile , default profile.

html - How can i make an Image as large as possible in a Mdl-Card-Lightbox? -

i creating lightbox material design lite card design without javascript. each image should displayed large possible in lightbox-card. have every kind of pictures, landscape, portrait, banners, ... card should adapt size of image. however, nothing should cut off picture! here's html code: <a href="#" class="lightbox" id="img1"> div class="demo-card-image mdl-card mdl-shadow--2dp"> <div class="mdl-card__title mdl-card--expand"></div> <div class="mdl-card__actions"> <span class="demo-card-image__filename">example title</span> </div> </div> </a> the card should not larger 90% in width , 80% in height. scss code: .demo-card-image.mdl-card { max-width: 90%; max-height: 80%; top: 50%; left: 50%; transform: translate(-50%, -50%); background: url('http://placehold.it/500x300')no-repeat center c

javascript - How to change property content in array? -

Image
i have array: var arr=[{id:'3',status:true, objectid:'23'}, {id:'4',status:false, objectid:'5'}, {id:'5',status:true, objectid:'78'}, {id:'6',status:false, objectid:'54'}, {id:'7',status:true, objectid:'85'}] the status boolean type. in arr variable need change content of properties. where status true need set fixed. where status false need set damaged. here desired result: var arr=[{id:'3',status:fixed, objectid:'23'}, {id:'4',status:damaged, objectid:'5'}, {id:'5',status:fixed, objectid:'78'}, {id:'6',status:damaged, objectid:'54'}, {id:'7',status:fixed, objectid:'85'}] what best way implement it? try approach use angular.foreach have mentioned in tags var arr=[{id:'3',status:true, objectid:'23'},

junit5 - @Check instead of @Test -

in junit there @test annotation. according james bach , michael bolton can considered misleading label in context. more appropriate @check . checking can automated unlike testing. see bolton's blog explains test , automated check is: http://www.developsense.com/blog/2009/08/testing-vs-checking/ (read old version first recommendation). so question if want change @test @check in junit 5 in order contribute more appropriate view on subject amongst developers?

java - which one have more priority ArithmeticException and ArrayIndexOutOfBoundsException -

i wrote program little confusing on know throw arithmeticexception before through arrayindexoutofboundsexception expected throwing arithmeticexception . i have below code : try{ int arrray[]={1,3}; arrray[2]=3/0+arrray[5]; }catch(arrayindexoutofboundsexception ie){ ie.printstacktrace(); } catch(arithmeticexception ie){ ie.printstacktrace(); } catch(exception e){ e.printstacktrace(); } thanks help it's pretty easy test , find out: $ cat demo1.java class demo1 { public static void main(string[] args) { try { int[] array = {}; int impossible = 1/0 + array[0]; } catch (exception e) { system.out.println("caught " + e.getclass().getsimplename()); } } } $ cat demo2.java class demo2 { public static void main(string[] args) { try { int[] array = {}; int impossible = array[0] + 1/0; } catch (ex

c# - An unhandled exception of type 'System.TypeInitializationException' occurred in ConsoleApplication.exe - Automapper -

after taking @ automapper attributes have tried answer this question have made quick console application reproduce behavior. have added (copy-pasted) classes in first example github documentation: [mapsto(typeof(customer))] public class person { public string firstname { get; set; } public string lastname { get; set; } public string notes { get; set; } } public class customer { public string firstname { get; set; } public string lastname { get; set; } public string mycustomernotes { get; set; } } and added same statements in main: typeof(program).assembly.maptypes(); //this throws exception var person = new person { firstname = "john", lastname = "lackey" }; var customer = automapper.mapper.map<customer>(person); but @ first line of code in main, when calling maptypes method, exception of type typeinitializationexception thrown: an unhandled exception of type 'system.typeinitializationexception' occurred in

php change excel data array loop type -

i reading big files data .xlsx format via php library " spout " working fine how print data not matching application. this how print table now <?php foreach ($reader->getsheetiterator() $sheet) { foreach ($sheet->getrowiterator() $rows) { ?> <tr class="datalistarray"> <?php foreach ($rows $index => $row) { ?> <td <?php if ($index == 0) { echo 'class="paricipant '.trim($rows[1]).'"'; ?> id="<?php echo trim($rows[1]).''.trim($rows[0]); ?>" <?php } else if ($index == 2) { echo 'class="'.trim($rows[1]).'-cxtrem"'; } else if ($index == 1) { echo 'id="room"'; } ?>> <?php if ($row instanceof datetime) { //print_r($row); echo $row->format("d-m-y"); } else { echo $row; } ?></td> <?php } ?> </tr> <?php } } ?> but want print way have more control on html make customize <?p

php - string length not decremented when unset string index -

i trying create palindrome deleting 1 character string @ time . while unsetting string index .the string length not getting reduced. $s = "arun"; var_dump ($s); $s[1] = null; var_dump($s) ; output string(4) "arun" string(4) "aun" why length not reduced. because not in way reducing string, replacing 1 character. your string gets transformed a r u n a (null) u n , still 4 chars long. to achieve goal, use substr_replace <?php $s = "arun"; var_dump ($s); //arun $s = substr_replace($s, "", 1,1); var_dump($s); //aun