Posts

Showing posts from April, 2011

HTML/Javascript - Welcome image cover that disappears after load - the web page partially reloads? -

so have completed i'm trying achieve - full screen welcome image appears on load per session , fades out on larger screens. removes scrollbars during display, , re-enables on completion. problem is, when fades out, text & background colors load or reload. images , positioning loaded / fade fine. any suggestions / ideas appreciated. i have tried removing css / html leaves me believe javascript. if ($(window).width() > 769) { $(window).load(function() { var isshow = sessionstorage.getitem('isshow'); if (isshow== null) { sessionstorage.setitem('isshow', 1); document.documentelement.style.overflow = 'hidden'; // firefox, chrome document.body.scroll = "no"; // ie // show popup here $.when($('#jpopup').show().delay(4000).fadeout(2000)) .done(function() { document.documentelement.style.overflow = 'auto'; // firefox, chrome document.b

reactjs - How to add new data to state without data getting refreshed in react -

i'm rendering data api, i'm adding load more option more data. while new data rendered, component getting refreshed, state changes. how can solve ? this code : export const newdatareducer = (state= initialstate , action = null) => { switch(action.type) { case types.get_new_data: let mydata; mydata = _.unionby(state.data, action.payload.data, "id"); return object.assign({}, state, {isloading:false, data:mydata, notification: "success" }); } } my component : _.map(mydata, (newdata, index) => { return ( newdata.id; ); }); thank you you can add logic shouldcomponentupdate lifecycle method prevent unwanted rendering.

android - Flip animation is not working properly -

i have been working flip animation in android. have tested animation image view , it's working correctly imageview in both side of animation cannot figure how make work correctly textview on both sides. have used alpha setback preview of second textview. when compile code, can see first textview expected, after clicking button, can see preview of first part of animation don't see second textview on view. after clicking button again, can again see first textview flipping up. public class flip3danimation extends animation { private final float mfromdegrees; private final float mtodegrees; private final float mcenterx; private final float mcentery; private camera mcamera; public flip3danimation(float fromdegrees, float todegrees, float centerx, float centery) { mfromdegrees = fromdegrees; mtodegrees = todegrees; mcenterx = centerx; mcentery = centery; } @override public void initialize(int width, int height, int parentwidth, int pare

qt - Nested TableView -

Image
i created nested tableview elements of main tableview. for example, if rowtitle == ""brilliance" , created subtableview row. listmodel { id: librarymodel listelement { title: "a masterpiece" author: "gabriel" } listelement { title: "brilliance" author: "jens" } listelement { title: "outstanding" author: "frederik" } } tableview { tableviewcolumn { role: "title" title: "title" width: 100 //if title==""brilliance" create second tableview } tableviewcolumn { role: "author" title: "author" width: 200 } model: librarymodel } do have idea how ? thanks lot !

jasmine - Protractor IF condition was executed first before IT -

is there way ensure it executed first before if condition located below it? sample code: it('should click ' + strname + ' list', function() { exports.waitforelementdisp(10, global.elmgravitypanel, false); browser.sleep(2000).then(function() { element(by.css('[cellvalue="' + strname + '"]')).click(); element(by.id('uniqueid')).gettext().then(function(tmptext) { global.tempobject.ispresent = false; if (tmptext == strname) { global.tempobject.ispresent = true; } }); }); }); if (global.tempobject.ispresent == true) { it('should click settings icon', function() { global.elmsettingbtn.click(); }); it... } currently, global.tempobject.ispresent set null , protractor did not go inside if though set true inside first it. because 'if' executed on file parsing. suggest try this: it(`should click ${str

typescript - How to import moment types definitions -

i have made angular 1 project typescript using yeoman generator: https://github.com/fountainjs/generator-fountain-systemjs uses systemjs , jspm dependencies npm type definitions (using definitelytyped repository). i have been struggling these last few days trying import moment type definitions. have installed moment using jspm, , have discovered comes own type definitions, if call command npm install @types/moment --save-dev stub , deprecation warning this stub types definition moment ( https://github.com/moment/moment ). moment provides own type definitions, don't need @types/moment installed! now, don't know if it's editor, project or typescript settings or typescript issue, can't seem able import moment's type definitions. if either import moment 'moment'; or import * moment 'moment'; error on editor (atom atom-typescript, have same error on visual studio code) cannot find module 'moment'. despite error, when

symfony - Symfony2 kernel exception event not handling fatal error exception in production mode -

i make listener exception handling. below code services.yml kernel.listener.prod_exception_listener: class: mybundle\listener\exceptionlistener tags: - { name: kernel.event_listener, event: kernel.exception, method: onkernelexception } exceptionlistener.php <?php namespace mybundle\listener; use symfony\component\httpkernel\event\getresponseforexceptionevent; use symfony\component\httpfoundation\response; use symfony\component\httpkernel\exception\httpexceptioninterface; class exceptionlistener { public function onkernelexception(getresponseforexceptionevent $event) { // no fatal exception goes here others coming in function // 403,404,500 coming in block } } what additional work need fatal exceptions in production mode? because in dev mode fatal errors coming in listener. i solved following way, in services.yml api_exception_subscriber: class: appbundle\eventlistener\apiexceptionsubscriber arguments: [&

jvm - java.lang.NoClassDefFoundError: org.apache.woden.resolver.URIResolver -

getting below exception after deploying application in was8. using axis2 1.7.4 family woden api , impl 1.0m8. please help java.lang.noclassdeffounderror: org.apache.woden.resolver.uriresolvergetting @ java.lang.j9vminternals.verifyimpl(native method) @ java.lang.j9vminternals.verify(j9vminternals.java:93) @ java.lang.j9vminternals.initialize(j9vminternals.java:170) @ org.apache.axis2.deployment.moduledeployer.deploy(moduledeployer.java:65) @ org.apache.axis2.deployment.repository.util.deploymentfiledata.deploy(deploymentfiledata.java:136) @ org.apache.axis2.deployment.deploymentengine.dodeploy(deploymentengine.java:815) @ org.apache.axis2.deployment.repositorylistener.loadclasspathmodules(repositorylistener.java:222) @ org.apache.axis2.deployment.repositorylistener.init2(repositorylistener.java:71) @ org.apache.axis2.deployment.repositorylistener.<init>(repositorylistener.java:64) @ org.apache.axis2.deployment.deploymentengine.loadfromclasspath(deploymentengine.java:177) @

html - Framework 7 Android - Navbar overlay -

i tried create app framework 7 android. works fine except navbar. there 2 pages: index , about. page shown after opening sidebar , clicking on link it. content of shown fine, title in navbar not working properly. it's kind of overlapped. [navbar , content of about][1][1]: https://i.stack.imgur.com/zfdr5.png "test" name of app. "about" name of page. <div class="navbar"> <div class="navbar-inner"> <div class="center sliding">test</div> <div class="right"> <a href="#" class="link icon-only open-panel"><i class="icon icon-bars"></i></a> also app name has 'center' class not centered. my problem accures when use material css. ios css everyhting works fine.

PHP if/else without echo -

how replace echo proper html codes? since there hundreds of html codes, using echo doesn't make sense. <?php if ($this->item->catid == 9) { echo "yes, exists"; } else { echo "no, don't exist"; } ?> i'm new php. do mean, how can 1 cleanly output many lines of html conditionally without having echo each individual line? if that's case, trick: <?php if ($this->item->catid == 9) { ?> <!--- put raw output here ---> <?php } else { ?> <!--- put raw output here ---> <?php } ?> the "raw output" sent browser. html, javascript, etc. though it's outside of server-side php tags, far php processor concerned it's still between { ... } brackets. it's output part of conditional block.

timer - Ticker to call functions periodically (C++) -

so these tickers call each respective lane function respectively: ticker.attach(&lane1,0.5); ticker2.attach(&lane2,1.5); ticker3.attach(&lane3,4.5); and these lane functions: void lane1(){ (int y = 0; y < width ; y+=4) { lcd.setpixel(33,y); lcd.setpixel(51,y); } (int y = 1; y < width ; y+=4) { lcd.setpixel(33,y); lcd.setpixel(51,y); } (int y = 2; y < width ; y+=4) { lcd.setpixel(33,y,false); lcd.setpixel(51,y,false); } (int y = 3; y < width ; y+=4) { lcd.setpixel(33,y,false); lcd.setpixel(51,y,false); } } void lane2(){ (int y = 0; y < width ; y+=4) { lcd.setpixel(33,y,false); lcd.setpixel(51,y,false); } (int y = 1; y < width ; y+=4) { lcd.setpixel(33,y); lcd.setpixel(51,y); } (int y = 2; y < width ; y+=4) { lcd.setpixel(33,y); lcd.setpixel(51,y); } (int y = 3; y < wi

java - Weblogic Server getting SAXParse Exception -

using weblogic 12.1.2 trying use below code while parsing xsl getting below error, transformerfactory tfactory = new transformerfactoryimpl(); source xslsource = new javax.xml.transform.stream.streamsource(myxslfile); transformer transformer = tfactory.newtransformer(xslsource); stringreader reader = new stringreader(xmlfile); stringwriter writer = new stringwriter(); transformer.transform(new javax.xml.transform.stream.streamsource(reader), new javax.xml.transform.stream.streamresult(writer)); exception net.sf.saxon.trans.xpathexception: org.xml.sax.saxparseexception;org.xml.sax.saxparseexception; linenumber: 12; columnnumber: 58; @ net.sf.saxon.event.sender.sendsaxsource(sender.java:418) @ net.sf.saxon.event.sender.send(sender.java:214) @ net.sf.saxon.event.sender.send(sender.java:50) @ net.sf.saxon.controller.transform(controller.java:1611) this same piece of code working fine if run seperately once deployed war in weblogic server not workin

c# - NAudio ASIO mixing -

i'm trying make simple daw in c# naudio , winforms. goal of program @ stage able record microphone while playing couple of audio files. project far combination of asio-samples came naudio , information on internet. i have 1 audiofilereader-object each audiofile want play: reader = new audiofilereader("audio 8_01.wav"); reader2 = new audiofilereader("audio 9_04.wav"); reader3 = new audiofilereader("click.l.wav"); reader4 = new audiofilereader("click.r.wav"); when pressing play-button audio-clips should start playing , recording should start on channel 1: private void play() { // allow change device if (asioout != null && (asioout.drivername != getdriveroutcomboboxtext() || asioout.channeloffset != 0)) { asioout.dispose(); asioout = null; } int recordchannelcount = 0; mix = new mixingwaveprovider32(); //console.wr

c++ - what's the difference between targes nodes and fetch nodes in tensorflow? -

Image
in tensorflow, there function used rewrite original graph(rewritegraphforexecution): status rewritegraphforexecution( graph* g, const gtl::arrayslice<string>& fed_outputs, const gtl::arrayslice<string>& fetch_outputs, const gtl::arrayslice<string>& target_node_names, const deviceattributes& device_info) { the above code coming here confused exact difference between fetch_outputs , target_node_names. thanks much, information appreciated! this graphp may you. and here header declaration, // rewrite graph structure of "*g" deal feeding node // outputs, fetching node outputs, , running subset of // graph. "fed_outputs" , "fetch_outputs" both lists of // output tensor identifiers in form of // "<name>[:<optional_output_index>]", , "target_nodes_str" // lists of target node names in "*g" "g". // // in resulting graph "*g", ou

android - Ship an application with a database -

if application requires database , comes built in data, best way ship application? should i: precreate sqlite database , include in .apk ? include sql commands application , have create database , insert data on first use? the drawbacks see are: possible sqlite version mismatches might cause problems , don't know database should go , how access it. it may take long time create , populate database on device. any suggestions? pointers documentation regarding issues appreciated. i found way in reigndesign blog in article titled using own sqlite database in android applications . precreate database, put in assets directory in apk, , on first use copy "/data/data/your_package/databases/" directory.

run .net core application in development from the command line -

i know can configure settings in visual studio or visual studio code launch asp .net core application in development mode. i've had horrible experience build tools, , far running command line 1 working me. the big problem have command line getting run in development mode. if understand, can done typing set aspnetcore_environment=development before dotnet watch run or setting system wide environment variables. there's gotta way, through file or something. how can run in development mode command line, can include in package.json of aurelia project? you may use --environment argument dotnet run specify hosting environment: dotnet run --environment "development" but work after modify host building use configuration command line arguments config source. add dependency microsoft.extensions.configuration.commandline package add main method config creation based on arguments adding addcommandline extension method configurationbuilder : va

java - How could possibly a project runs well when its Classpath is lack of some classes used in it? -

Image
it's interesting find out multitenantconnectionprovider.java doesn't exists in project, project can maven build , runs well. . i use intellij idea 2016.2. class packed in mysql-connector-java-5.1.31.jar . tried connect mysql db , query out data test if works well. turns out missing of class doesn't influence project runs well. seems unlogical, isn't it? not @ all. jvm implementations lazy classloading. means: class doesn't loaded class loader until really needed; example when other code instantiates object of such class. in other words: when application not throwing classnotfoundexception resp. noclassdeffounderror ... conclusion is: code paths executed not require 1 class loaded. like in: might notice lost keys @ party point when home , try open front door. in other words: if program builds , runs without class, that class isn't used much.

spring data jpa - writing finb by query with one AND and OR -

how can write spring data jpa exist finby methods for where id="1" , (status ="n" or status ="k") i had tried findbyidandstatusorstatus(1,"n","k") not working if have id have unique entity no need search it, suppose gave unfortunate example. try using following work: findbysomepropertyandstatusin(someproperty property,collection<status> statuses);

gcc - libgcc_s.a error when passing options to linker from GDC -

i trying pass options linker (ld) through gdc using either -xlinker or -wl , every time try fails, error message being "cannot find -lgcc_s", , using gdc -wl,-verbose=99 have discovered looking libgcc_s.a attempt open /usr/lib/gcc/x86_64-linux-gnu/5/libgcc_s.a failed the failures when attempting open libgcc_s.a . went looking lib in specified folder, not exist, in fact, not exist anywhere on computer, @ all. there reason doesn't exist? need able pass options linker gdc. trying gcc produces same error. know can find lib? or workaround problem, said, using gdc need able pass options linker. cheers.

java - Unable to retrieve hibernate foreign keys from a servlet context -

i can't read ids of referenced entities using hibernate, tomcat , mysql. example, running following code: list<useraccount> users = listentities(useraccount.class); (useraccount user : users) { useraccountstatuscatalog status = user.getstatus(); system.out.println("[user (" + user.getid() + ") : "+user.getaccountname()+"] - " + status + ": " + status.getid()); } will give following output in simple java application or servlet context using sql server db [user (1) : system] - suspended: 15020 [user (2) : admin] - active: 15010 [user (4) : test] - active: 15010 and within servlet context using mysql db [user (1) : system] - suspended: 0 [user (2) : admin] - active: 0 [user (4) : test] - active: 0 this on tomcat 7 server running java 8 database mysql 5.5 , i'm using hibernate-core:5.1.0.final i have tested lot of different approaches such changing hibernate version, c

list all the data, merge duplicate rows and sum the total using MySQL -

i have following sql select i.si_num `id`, date_format(i.si_date, '%d-%b-%y') `date`, i.si_tr `tr`, d.dl_name `customer`, i.si_net_value `net`, datediff(curdate(), si_date) days, t.value tval, t.label label invoices left join dealer d on i.si_tr = d.dl_id left join transactions t on i.si_num = t.invoice i.si_tr = 'tr580494' order `si_num` desc; current output +-----+-----------+----------+---------------------+---------+------+-------+-------+ | id | date | tr | customer | net | days | tval | label | +-----+-----------+----------+---------------------+---------+------+-------+-------+ | 404 | 18-feb-17 | tr580494 | starship enterprise | 109790 | 55 | 96070 | acr | | 404 | 18-feb-17 | tr580494 | starship enterprise | 109790 | 55 | 10080 | crn | | 404 | 18-feb-17 | tr580494 | starship enterprise | 109790 | 55 | 3640 | crn | | 240 | 13-feb-17 | tr580494 | starship enterprise | 0 | 60 | nu

How can I include the C++ Actor Framework in an Xcode Project? -

Image
i followed instructions here , tests passed i'm unsure of files need add xcode project. have following: libcaf_core/caf has bunch of hpp files such all.hpp but build/lib folder has dylib files: can tell me how add caf existing project? i installed caf homebrew set header , library paths: headerpath="/usr/local/include" and: librarypath="/usr/local/lib" i added dylib files: libcaf_core.0.15.3 libcaf_io.0.15.3

.net - How to create a dialog with custom content like android in Zebble for Xamarin? -

Image
i want create dialog editing field , need make custom content dialog , response reload data. so, read content dialog , popup in link below http://zebble.net/docs/alerts-and-dialogs and test code: in page want show popup: await nav.showpopup<customedialogpage>(); my custom zebble page: <z-component z-type="customedialogpage" z-base="page" z-namespace="ui.pages" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="../.zebble-schema.xml"> <stack cssclass="customedialog"> <button text="ok" /> </stack> </z-component> and create stylesheet that .customedialog { width: 300px; height: 100px; background: #ffffff; border: 2px; padding: 5px; margin-top: 100px; } but, not able close popup or add title section , not know how can result of it. , sample dialog want

azureservicebus - Set Messaging Unit of premium Service Bus to 4 using PowerShellv5 -

i want set messaging unit of premium service bus 4 via powershellv5. using following command : new-azurermservicebusnamespace -resourcegroup default-servicebus-northeurope -location northeurope -namespacename #{premiumservicebus} -skuname "premium" -capacity 4 it gives capacity unrecognized variable... what do? capacity parameter not defined powershlell cmdlet (see documentation ). possible using rest api . looks disconnect between ps library , rest api msft need address. i've raised issue msft team can address it.

for loop - Initialize list of lists in Dart -

i have grid in dart implemented follows: class cell { int row; int col; cell(this.row, this.col); } class grid { list<list<cell>> rows = new list(grid_size); grid() { rows.fillrange(0, rows.length, new list(grid_size)); } } and can't seem find way initialize each cell proper row , col values: tried 2 nested loops, this for(int = 0; < grid_size; i++) { for(int j = 0; j < grid_size; j++) { rows[i][j] = new cell(i, j); } } but due dart's closure error protection described here , grid ends being populated cells having grid_size - 1 in row member. so, what's idiomatic way in dart initialize nested list? i guess want: class grid { list<list<cell>> rows; // = new list(grid_size); grid() { rows = new list.generate(grid_size, (i) => new list.generate(grid_size, (j) => new cell(i, j))); } } see dart: list of lists

exception - Why am I getting a java.nio.BufferOverflowException -

i tried create simple program fun, i'm getting bufferoverflowexception: bytebuffer bytebuffer = bytebuffer.allocatedirect(10); floatbuffer floatbuffer = bytebuffer.asfloatbuffer(); floatbuffer.put(new float[] {1, 0, 0}); what wrong? when use bytebuffer.allocatedirect(10); ask allocating 10 bytes of memory. putting 3 float in buffer. each float uses 4 bytes of memory per official documentation . using 12 bytes , overflow. to solve problem use 12 bytes instead of 10.

scala - Creating Encoder for case class containing custom object -

i have case class like: case class dlt (date: java.time.localdate, loc: location, temp: double) where location case class like: case class location (lat : double, lon : double) how can create custom encoder case class dlt? when have directly tried encoders.kryo[ldt] output coming single column unrelated values rather in separate columns. map function convert dataframe dataset follows: ldt.map(ldtrow => ldt(localdate.of(ldtrow.getas[int]("year"), ldtrow.getas[int]("month"), ldtrow.getas[int]("day") ), location(ldtrow.getas[double]("lat"), ldtrow.getas[double]("lon") ), ldtrow.getas[double](

apache pig - PIG - STORING TEMPORARY VALUES -

data schema : sdesc:chararray,samt:init,syear:chararrary,stype:chararrary data: wrench 259000 2000 store wrench 135000 2000 online wrench 175000 2001 online wrench 180000 2001 store script ysales =load ‘salesdata.txt’ using pigstorage()as (sdesc:chararray,samt:init,syear:chararrary,stype:chararrary); basedata = filter ysales (sdesc==’wrench’) , (syear = ‘2000’ ) , (stype = ‘store); my result set : dump basedata; (wrench,259000,2000,store) so question how break basedata have (for example) a = ‘wrench’ b = 259000, c=2000, d = ‘store’ you can use argument numbers extract values according columns a = foreach basedata generate $0; b = foreach basedata generate $1; c = foreach basedata generate $2; d = foreach basedata generate $3;

Reading data from a python socket received from multiple clients -

i writing python program (master.py) read data received 2 separate clients. code example: master.py: data_agg = '' host = '172.31.31.207' port = 50008 s = socket.socket(socket.af_inet, socket.sock_stream) s.bind((host, port)) s.listen(2) conn, addr = s.accept() print 'connected by', addr while 1: data = conn.recv(65535) data_agg += data if not data: break data_arr = json.loads(data_agg.decode('utf-8')) data_arr = sorted(data_arr) print "sorted attay: \n" print data_arr two clients have following code: host = '172.31.31.207' port = 50008 s0 = socket.socket(socket.af_inet, socket.sock_stream) s0.connect((host, port)) s0.send(sorted_data_string) s0.close() however receive data single client. proper way read data socket arriving multiple receivers? i modified code bit , can handle 2 or more clients. , suggest calling accept on main thread , , recv on seperate thread task data_agg = [] host = '17

PHPExcel: won't read file, only when I first download it, put it in excel and put it back on the server -

so, our company have stock sync, every night our supplier put xlsx file on our server. worked great in beginning, discoverd sync broken. the strange part here when download file computer , open excel en save file , upload on server, script read it... so, when try read uploaded file won't work, when download file , open excel , save , upload on our server script read data fine. anyone here has suggestion what's wrong ? my code: $lokaal_aanbodbestand="data/stocklistag_directly.xlsx"; //$lokaal_aanbodbestand="data/stocklistag_openedwithexcel.xlsx"; include("../../includes/phpexcel/iofactory.php"); $localsize = filesize ($lokaal_aanbodbestand); try { $inputfiletype = phpexcel_iofactory::identify($lokaal_aanbodbestand); print $inputfiletype."<br />"; $objreader = phpexcel_iofactory::createreader($inputfiletype); $objphpexcel = $objreader->load($lokaal_aanbodbestand); $she

json - Android direction in Google Maps with latitude and longtitude -

i want send origin point , destination point google direction. when use name origin , destination it's true , returns true json information, when send latitude , longtitude origin , destination doesn't work. it's ok whit url: https://maps.googleapis.com/maps/api/directions/json?origin=tehran&destination=shiraz&key=aizasybvr07afm-1ddgvgt392lrnuge3wet6nuy but doesn't work this: https://maps.googleapis.com/maps/api/directions/json?origin=32,52&destination=34,54&key=aizasybvr07afm-1ddgvgt392lrnuge3wet6nuy i think problem coordinates you're using - they're not accessible via roads. make sure you're not casting latitude or longitude ints, need decimal-point precision. converting tehran , shiraz latlngs, following url works correctly: https://maps.googleapis.com/maps/api/directions/json?origin=35.6887931,51.3891646&destination=29.5916593,52.583701&key=<api key here>

Can Shiny Server Serve a HTML page without ui.R or server.R -

i have html doc created rstudio's rmarkdown. there way can serve page in shiny server without going through attaching ui.r or server.r ? if so, how can go it? see documentation dynamic / interactive markdown documents . i had long converted apps using ui.r , server.r using single app.r ; convert them being index.rmd having flexdashboard shiny best thing yet.

c++ - Linux userspace header failing to compile with g++ -

i have cpp source file in have included following linux uapi header: #include <linux/netfilter_ipv4/ip_tables.h> i'm using rh6, header seems identical 1 found in linux kernel mainline: http://lxr.free-electrons.com/source/include/uapi/linux/netfilter_ipv4/ip_tables.h the problem upon compiling cpp source file g++, i'm (obviously) receiving following error: /usr/include/linux/netfilter_ipv4/ip_tables.h:222: error: invalid conversion 'void*' 'xt_entry_target*' i know can surpass -fpermissive flag, hardly solution. also, tried surrounding inclusion in extern "c" {} block (which far understand should make compiler see inside c code , allow implicit conversion), error not go away. how c++ program deal kind of c incompatibilities? (where 1 cannot directly edit source causing trouble) got working following preprocessing statements: #if __gnuc__ > 4 || (__gnuc__ == 4 && __gnuc_minor__ > 2) || (__gnuc__ == 4 &a

javascript - how can I send an object using axios? -

is there way send object api using axios? this code use: axios.get('/api/phones/create/', { parameters: { phone: this.phone } }) .then(response => { console.log(response.data) }) .catch(function (error) { console.log(error) }) on the php side, have following: public function create($phone) { return $phone; } i following error: get http://crm2.dev/api/phones/create 500 (internal server error) dispatchxhrrequest @ app.6007af59798a7b58ff81.js:256 xhradapter @ app.6007af59798a7b58ff81.js:93 dispatchrequest @ app.6007af59798a7b58ff81.js:662 app.6007af59798a7b58ff81.js:2266 error: request failed status code 500 @ createerror (app.6007af59798a7b58ff81.js:600) @ settle (app.6007af59798a7b58ff81.js:742) @ xmlhttprequest.handleload (app.6007af59798a7b58ff81.js:158) if try, axios.get('/api/phones/create/hello') hello in console log. is there way this? it depends on mean "send obj

How to run Python + Qt application in Squish testing tool? -

Image
i having trouble starting testing python + qt4.8 application using squish. new that, if has experience using squish, please read question. so have couple of python files make application. squish ide requires .exe or .bat file in order start recording. generated .exe .py files using pyinstaller. when open .exe file generated works fine. then select new test suite in squish select .exe mentioned. seems fine, when try start recording, squish cannot open application. error message picture below. sure using squish right version of qt. read problem , found out might because using debug version of application. know how can make application non-debug? or there other way fix problem? appreciated, thanks. edit: found information: py2exe distributions: exclude qt libraries py2exe on windows qt libraries must excluded distribution/.exe file. this required because squish qt supports application dynamically load qt libraries. but tried use py2exe , excluded libraries. ma

javascript - Issues with retrieving Firebase data into a textbox in html page -

// calls onclick command populate button function myfunctionpopulate() { // creates new firebase reference linking js firebase database var ref = new firebase("https://project01-d018e.firebaseio.com/numbers"); // creates snapshot of data desired firebase database , adds 'value' ref.on('value', function(snapshot) { // adds console log of data recived firebase console.log(snapshot.val()); // creates variable called data snapshot saved var data = snapshot.val(); (var key in data) { if (data.hasownproperty(key)) { // takes id of textbox , adds value of (data[key]) data = snapshot.val() snapshot of data document.getelementbyid('id1').value=(data[key]); // adds console log message confirm textbox has been populated console.log('value added'); }; // end of if } // end of }); // end of ref.on } // end of function <div id="button"> <button id="rb

tomcat - POS Tagger with servlet -

i'm trying pos of words using wordnet , stanford nlp tagger, , project runs on tomcat8.5 in eclipse. downloaded stanford post tagger , placed models project. this hierarchy of project and wrote path in code follows : maxenttagger tagger = new maxenttagger("taggers/left3words-wsj-0-18.tagger"); but this error how can solve this?

python - Mocking internal modules when using Sphinx Autodoc -

my python package has module called settings.py looks settings.ini file, , if 1 isn't found raises exception. my package works fine when try , use sphinx autodoc fails because can't find settings file. what options have getting around this? ones can think of are put settings.ini file in 1 of sphinx directories can read. somehow mock internal settings module if possible. settings module unimportant don't care if there no documentation suer has run similar issue when trying generate sphinx documentation on packages need external files , if solution? pyramid has command-line script pserve loads .ini settings file. to document script, use autoprogram follows: .. autoprogram:: pyramid.scripts.pserve:pservecommand.parser :prog: pserve and in conf.py : extensions = [ ... 'sphinxcontrib.autoprogram', ... ] it requires use of argparse in script.

Repeat last frame in video using ffmpeg -

hi i'm trying concatenate few mp4 clips each of 2 secs length, created using drawtext filter, before want extend length of of these repeating last frames.how can it? the below command it: ffmpeg -i in.mp4 -filter_complex "[0]trim=0:2[a];[0]setpts=pts-2/tb[b];[0][b]overlay[c];[a][c]concat" out.mp4 audio ignored.

email - php PHPMailer shared hosting override default dns server -

i having dns problems running phpmailer accessing smtp.office365.com on new cpanel shared hosting plan register365.com. my code has worked years on older shared hosting plan same provider. , works fine on test windows iis system , shared hosting plan provider. problem unique register365.com i getting connection error after 300 secs: connection failed. error #2: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: temporary failure in name resolution the standard troubleshooter info in phpmailer led me to suspect dns. contacted provider register365.com , told me: thank getting in touch dns. firstly our nameservers non recursive return results domains hosted on them if try , query smtp.office365.com on our nameservers not going work not hosted us. if phpmail script querying our servers find address wont work , bring error seeing. you need set php script query general dns such googles , resolve issue. unfortunately there nothing can in sit

linux - mkdir create directory in current users directory - bash -

#!/bin/bash mkdir -p user_records i want create directory user_records in current user's directory. how achieve this? tried adding sudo in front of mkdir not create directory in desired location. you should able access user directory ~ , try: mkdir -p ~/user_records

caching - How to force browser to load a page.xhtml from servers always, in JSF -

this question has answer here: force jsf refresh page / view / form when opened via link or button 2 answers i have page called newtest.xhtml, backed cdi bean called newtest, when user clicks button should work in backinhg bean , return same page newtest.xhtml. problem when click button browser not refresh page. when click refresh manually browser refresh page. question : in jsf how can tell browser load page server not cache public string dowork() { //do work return "/newtest.xhtml?faces-redirect=true"; } fixed have fixed problem using ajax's render="@all" <h:commandbutton > <f:ajax execute="@all" render="@all"/> </h:commandbutton> you can make redirection request page externalcontext externalcontext = facescontext.getcurrentinstance().getexternalcontext(); exte

How to get R's install.packages to error out in a Dockerfile? -

below command failed, docker kept going. i'm pretty sure because 'warning' ("installation had non-zero exit code") wasn't passed outward non-zero exit code rscript invocation. how can stop docker build? step 21/44 : run rscript -e 'install.packages("https://cran.rstudio.com/src/contrib/prophet_0.1.tar.gz", dependencies=true)' ---> running in 26ba0c1da37c installing package ‘/usr/local/spark-1.6.1-bin-hadoop2.6/r/lib’ (as ‘lib’ unspecified) inferring 'repos = null' 'pkgs' trying url 'https://cran.rstudio.com/src/contrib/prophet_0.1.tar.gz' content type 'application/x-gzip' length 75619 bytes (73 kb) ================================================== downloaded 73 kb error: dependencies ‘extradistr’, ‘rstan’ not available package ‘prophet’ * removing ‘/usr/local/spark-1.6.1-bin-hadoop2.6/r/lib/prophet’ warning message: in install.packages("https://cran.rstudio.com/src/contrib/prophet_0.1.tar.gz

python - Element wise dot product of matrices and vectors -

this question has answer here: python: multiply slice of matrix stack column of matrix efficiently 1 answer there similar questions here , here , here , don't understand how apply them case precisely. i have array of matrices , array of vectors , need element-wise dot product. illustration: in [1]: matrix1 = np.eye(5) in [2]: matrix2 = np.eye(5) * 5 in [3]: matrices = np.array((matrix1,matrix2)) in [4]: matrices out[4]: array([[[ 1., 0., 0., 0., 0.], [ 0., 1., 0., 0., 0.], [ 0., 0., 1., 0., 0.], [ 0., 0., 0., 1., 0.], [ 0., 0., 0., 0., 1.]], [[ 5., 0., 0., 0., 0.], [ 0., 5., 0., 0., 0.], [ 0., 0., 5., 0., 0.], [ 0., 0., 0., 5., 0.], [ 0., 0., 0., 0., 5.]]]) in [5]: vectors = np.ones((5,2)) in [6]: vectors out[6]: array([[ 1., 1.], [ 1

apex - Generic Connector Communication Error in Tomcat 8.5, BonCode AJP Connector -

so have ords 3.0 application installed on tomcat 8/boncode ajp connector/iis 8.5 setup. enabled sso , ssl , working fine. now, of sudden, without changes made started receiving generic connector communication error error when accessing application on tomcat, not ords. the error in browser is: generic connector communication error: please check , adjust setup: ensure tomcat running on given host , port. if timeout error consider adjusting iis timeout changing executiontimeout attribute in web.config (see manual). i looked on server in tomcat directory under logs folder , found following warning: the web application [ords] appears have started thread named [oracle.jdbc.driver.blocksource.threadedcachingblocksource.blockreleaser] has failed stop it. create memory leak. that thing can see. have searched everywhere , tried different tweaks cannot figure out solution. solved issue making changes server.xml file located in conf directory under

javascript - Get property with largest index key in object -

this question has answer here: getting key highest value object 4 answers from following object, how can 'air' reading property largest index key i.e. 4? (30.9) { 1: { air: "31.2", evap: "25.3", t_condenser: "43.8" }, 2: { air: "31.1", evap: "25.3", t_condenser: "43.6" }, 3: { air: "31.0", evap: "25.3", t_condenser: "43.5" }, 4: { air: "30.9", evap: "25.2", t_condenser: "43.3" } } i have tried following, try last key, reads undefined: $.getjson("handler.php?action=fetchlae", function(data){ console.log(data.length); }); note: data badly formatted. thats array for, api returns object. solution: find highest key in data ( wich object): data[object.

Jquery / RaphaelJS SVG rect disable click through -

i use raphaeljs draw rects. want each rect selectable. added on click function, fill selected rect other color , add array. want deselect every selected rect. added on click function paper, on drawn. problem no is, everytime click on rect, first calls on click function rect , after calls function paper. instantly deslect rect again. think problem is, click on rect goes through rect. anyone got idea how prevent click go through rect ? thanks lot! here how create rect , on click methods : // bild new rectangle var rectelement = paper.rect(x, y, w, h); // add attributes rectelement.attr({ fill: "white", opacity: 1, stroke: "#f00", title: text }); $( document ).on( "click", ".drawedrect", function() { console.log("add selected"); selectedrects.push(this); $(this).attr({ fill: "#f39814", }); }); $( document ).on( "click", "#paper", funct

How I export my Firebase data in Excel Sheet -

Image
i want firebase database in excel sheets have these child names, branch,batch,college attributes of users want export these in excel sheet firebase database this how firebase database excel sheet export firebase json. click settings on right of database. then, convert json csv. there lot of csv converter online. can try https://json-csv.com/ . save csv , open excel.

jsf - How to send a custom FacesMessage to page when the clientId is not actually present -

i using jsf 2.2 on glassfish 4. i want send messages <h:message .../> tag. for below login page, want send custom facesmessage on login failure clientid login-error userbean . my login.xhtml : <h:form id="login-form"> <table> <tr> <td><h:outputlabel value="username" for="username" /></td> <td><h:inputtext id="username" value="#{userbean.username}" /></td> </tr> <tr> <td><h:outputlabel value="password" for="password" /></td> <td><h:inputsecret id="password" value="#{userbean.password}" /></td> </tr> <tr> <td></td> <td><h:commandbutton value="submit" action="#{userbean.login()}" /></td> </tr&g

typescript - How to parameterize an injectable service in Angular 2 -

i have service core of framework incorporated many projects. saves data local storage key static. make key instead passed in parameter can unique every project. because when i'm testing localhost:4200 on of these projects there conflict local storage field/key. have is: @injectable() export class myservice { private static readonly storage_id = 'model-data'; constructor( ) { } somefunction() { localstorage.setitem(myservice.storage_id, json.stringify(this._model)) } } how can add parameter constructor can still instantiated through angular 2 dependency injection? you provide constructor parameter key: export const storage_key = new injectiontoken<string>('storagekey'); @injectable() export class myservice { constructor(@inject(storage_key) private storagekey: string) { } ... } then in providers need supply value it: providers: [ { provide: storage_key, usevalue: 'this-app-key' }, myser

linux - Do do I make a bash script that runs in rc.local and issues the echo/read so it gets displayed in a currently open terminal? -

i'm using linux 16.04 , i'm trying accomplish run script that, when terminal opened , program python active, kills python , asks questions , stores answers. the problem when run in rc.local stop python not forward questions or echo messages me. , brings me question: do make bash script runs in rc.local , issues echo/read gets displayed in open terminal?

c# - ASP.NET MVC Entity Framework DB access in Controller -

i trying access db created display list. doing in controller. red underlining db part. saying "the name db not exist in current context." missing thing connect db in code? using system.web; using system.web.mvc; using system.io; using system.web.helpers; using mis424assignments.models; namespace mis424assignments.controllers { [authorize (users="admin@wwu.edu")] public class retailcontroller : controller { // get: retail [allowanonymous] public actionresult index() { string sql = "select * product order newid()"; list<product> productlist = db.product.sqlquery(sql).tolist(); return view(); } } } try [authorize (users="admin@wwu.edu")] public class retailcontroller : controller { private readonly retailstoreentities1 db; public retailcontroller() { db = new retailstoreentities1(); }

javascript - Switching and Loading One Tab from Many -

how can set code using javascript or jquery load 1 tab per time, in code tabs loaded in 1 time , takes memory @ same time, specially when story longer 2000 letter, 3 parts, page load 6000 letter @ same time, want load 1 part, , when switch tab, previous tab disappear , show new tab 2000 letter only. <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoiresju2yc3z8gv/npezwav56rsmlldc3r/azzgrngxqqknkkofvhfqhnuweyj" crossorigin="anonymous"> <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-a7fzj7v+d/sdmmqp/noqwlilvusjfdhw+k9omg/a/eheadgtzns3hpfag6ed950n" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-dztdapbwprxsa/3eyeeuwrwcy7g5kfbe8ffjk5jaixuy