Posts

Showing posts from June, 2014

vb.net - VB application works with a windows user and not with another -

sorry i'm off topic can not understand. have application in vb .net on windows 2008 server works user , not another. users both administrators. suppose there may libraries (office?) installed 1 user , not it's supposition. have idea if there way "compare user accounts" understand differences? lot everyone wiki

Excel - How to filter Top 10 for specific column value in a Pivot Table? -

Image
i pretty basic pivot table following setup: columns: month rows: productname values: sumofprice so pivot table looks like: product name jan feb mar hat $50 $100 $50 shirt $75 $225 $10 pants $10 $25 $300 gloves $10 $75 $200 shoes $100 $350 $100 i'm trying filter top 3 sumofprice march. should like: product name jan feb mar pants $10 $25 $300 gloves $10 $75 $200 shoes $100 $350 $100 if apply "top 3" filter, gives top 3 of total of sumofprice. if right click mar , try apply top 3 filter, nothing. how can top 3 sumofprice march? thanks! in pivottable mark column sumofprice march (see red circle in image below) , can sort sort-menu (see blue circle below) . i have german excel available here menu should on same position in every language. wiki

sql server 2012 - sql select row if another doesn't exist -

i have table around 1 million entries this: timestamp tagname alarm status 2017-08-02 10:53:10.000 xs-101 alarm 2017-08-02 18:49:45.000 xs-201 alarm 2017-08-03 01:08:16.000 xs-101 normal 2017-08-05 09:16:42.000 xs-301 alarm 2017-08-12 12:33:39.000 xs-101 alarm i need figure out tagname has been in alarm longest, don't care if it's not in alarm. can with program code, of program's other sql queries return need. possible sql? i've searched around examples people returning rows based on contents of other rows, haven't had luck. which tag in alarm longest asking tag has oldest current alarm code. you can conditional aggregation: select tagname, max(timestamp) t group tagname having max(timestamp) = max(case when status = 'alarm' timestamp end) order max(timestamp) asc; this assumes 2 alarms not in sequence same tag -- consistent described data. wiki

php script pass dynamic value help modify -

i have ad banner script , try add column shows ad preview. added column , code included show add. shows static add given id. however need show preview related each row dynamical. somehow table shows id's each row, don't know how pass code code in preview column <?php @readfile('localhost/mysa_output.php?r='.$_server['remote_addr'].'&h='.urlencode($_server['http_host']).'&rf='.urlencode($_server['http_referer']).'&show_ad=read row id , put here'); ?> you can find whole script here: https://pastebin.com/rkrd4wqr wiki

angularjs - Get Url in Angular1.5 -

it's first time use angular1.5. here's source code. function config(statehelperprovider, $urlrouterprovider) { statehelperprovider .setnestedstate({ name : 'main.browsejobs', url : '/browse-jobs', params : {keyword : ""}, data : { pagetitle: 'available jobs aditjobs', mastheadclass: 'browse-jobs' }, children : { name: 'index', url: '/', templateurl: '/par' }, views : { '': { templateurl : 'components/browse-jobs/views/browse-jobs.view.html', controller : "browsejobscontroller", controlleras: 'vm', resolve: { jobfilters: jobfilters, jobposts : jobposts, applyjob : applyjob, jobpostspagination: jobpostspagination, locationfilters: location

java - Calling thread repeatedly causing Ui hang in android -

i developing bluetooth application.in have 1 button, on click of button starting thread.inside thread, discovering , connecting ble devices.repeated click of button causing ui hang. code using create thread is: new thread(new runnable() { @override public void run() { //do bluetooth stuffs } }).start(); i not stopping thread anywhere. i don't know causing ui hang please me. do mean if keep smashing button repeatedly (without waiting task finish), ui lags? or when press button, wait bit, press again. if it's first case (where you're mashing button in quick succession), try this: if set boolean flag when first start process, each time press button check if flag set true, , execute search if flag false. not sure if issue it's worth shot? wiki

android - Gradle disable the build of dependency projects -

i have a multi-project gradle project (android) following structure: root |-proja |-projb |-projc |-... in specific case, proja app uses projb (module). when run build on proja , projb gets built. need perform action on project built (the project original action performed on). for purpose need somehow name/path of project. need in afterevaluate step if matters. example: gradlew :proja:build // builds , b -> want "proja" gradlew :projb:build // builds b -> want "projb" gradlew :projc:build // builds a, b , c -> want "projc" i not sure how can achive this, hope of can me. you can check official doc : the standard project dependencies supported , makes relevant projects configured. if project has compile dependency on project b building causes configuration of both projects. however can disable build of dependency projects (but pay attention!) if don't want depended on projects bu

How to pass arguments from excel column to python user defined function and loop every rows? -

Image
i trying import data excel , loop each dataset. have data in column a, b, c of excel sheet. use openpyxl import data excel workbook. don't know way refer column a,b,c arguments function. please see image: and function: x = 0.2 def quadratic(a, b, c, x): return a*x**2 + b*x + c i want pass data of column a, b, c arguments a, b, c , loop through every row (in image, each row row 2 18). you can export data in spreadsheet csv, , use python builtin csv module ( https://docs.python.org/3/library/csv.html ) go through line line. the following code adapted example in doc should work, did not run it. reads csv line line, casts values floats, , calls function import csv x = 0.2 def quadratic(a, b, c, x): return a*x**2 + b*x + c open('data.csv', newline='') csvfile: datareader = csv.reader(csvfile, delimiter=' ', quotechar='|') row in datareader: data = map(float,row) print(quadratic(*data,x)) wi

php - select date in filemaker over odbc -

i try select on phpmyadmin date field on odbc update date field on filemaker. i´m getting error: connection established.php warning: odbc_exec(): sql error: [filemaker][filemaker] fql0001/(1:15): expression contains incompatible data types.there error in syntax of query., sql state hy000 this code: $conn = odbc_connect("dsn=server;database=mydatabase;uid=odbc;pwd=1234", "odbc", "1234"); if ($conn) echo "\nconnection established."; else die("\nconnection not established."); $result = odbc_exec($conn, "select id_mh, mydate mytable myfield '8'"); mydate date format , think "mydate" should converted string "strval". but how? thanks! +1 both @fortune , @michael.hor257k there nothing wrong mydate field - selecting it. the problem clause if use need add pattern wildcard. see link @fortune provided. if want match records myfield set 8 should use where myfiel

Setting default collation for all table in MySQL store procedure -

my stored procedure has more 5 create tables statement. there way pick default collation set in global variable these create tables statement without going through individual create table statement. -- sample block -- drop table if exists abc; set @createtable = concat("create table "abc"( record_id varchar(255), member varchar(255), name varchar(255) )character set 'utf8' collate 'utf8_unicode_ci'"); prepare create_table_statement @createtable; execute create_table_statement; deallocate prepare create_table_statement; -- sample block b-- drop table if exists def; set @createtable1 = concat("create table "def"( address varchar(255), member_gender varchar(255), member_age varchar(255) )character set 'utf8' collate 'utf8_unicode_ci'"); prepare create_table_statement1 @createtable1; execute create_table_statement1; deallocate pr

java - Neo4j with Spring: No bean named 'getSessionFactory' available -

i'm new neo4j , spring in combination , spring @ all. when start debugging, following exception: exception in thread "main" org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'getsessionfactory' available can me please? apllication-context.xml: <?xml version="1.0" encoding="utf-8" standalone="no"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:neo4j="http://www.springframework.org/schema/data/neo4j" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.sp

Asterisk AGI Python Script to Dialplan does not work -

i'm stuck project have check database of sip extension incoming caller id , dial sip extension. below receive when run script on asterisk cli. -- registered sip '9125' @ 192.168.1.102:50142 > saved useragent "zoiper rv2.8.40" peer 9125 [2017-08-22 13:53:33] notice[5095]: chan_sip.c:24558 handle_response_peerpoke: peer '9125' reachable. (17ms / 2000ms) == using sip rtp tos bits 184 == using sip rtp cos mark 5 -- executing [0112617769@from-trunk:1] answer("sip/obitrunk1-0000000d", "") in new stack > 0x1ca50d0 -- probation passed - setting rtp source address 192.168.1.98:16834 -- executing [0112617769@from-trunk:2] agi("sip/obitrunk1-0000000d", "test.py") in new stack -- launched agi script /var/lib/asterisk/agi-bin/test.py args: ['/var/lib/asterisk/agi-bin/test.py'] env line: agi_request: test.py env line: agi_channel: sip/obitrunk1-0000000d env line: agi_language: en env line: a

windows - How do I run a python script, from a batch file, that acts as a subprocess of the cmd instance? -

i'm trying use batch file run python script when batch session ends (termination example) python script close. for example, if wanted reverse thing (python->batch). use subprocess module. how can achieve this? this relevant line in batch file: python run.py %* which runs python script, upon terminating it, python script keeps running shell script should execute run.py : python run.py if want include command line arguments run.py shell script like: python run.py %1 %2 %1 , %2 command line arguments. your batch script can't end unless python file executed. make sure had done things correctly. wiki

java - Hibernate org.hibernate.MappingException -

i created hibernate application using eclips maven project. works fine. created project , import hibernate project , try save object main project. give me below excetion org.hibernate.mappingexception: unknown entity: io.klaver.core.model.workspace; msg: unknown entity: i have added hibernate.cfg.xml in correct place in library project. reason import project existing maven project. and make sure have entityname.hbm.xml . and in hibernate.cfg.xml add: <!-- list of xml mapping files --> <mapping resource="com/sow/application/entityname.hbm.xml"/> wiki

Jenkins - Multijob reports failure even if job phase passes -

i have jenkins job runs multijob configuration. has 3 scripts. workflow is: run script_a if passes return pass. if script_a fails, run script_b - if script_b passes return pass if script_b fails, run script_c - return fail i have configured continuation condition next phase when job statuses "failed" , job execution type 'sequential'. so if script_a passes, stops execution , not execute scripts b, c. the problem i'm facing that, if script_a passes multijob reports failure. doing wrong? wiki

python - Python3 - PostgreSQL SQLAlchemy gets TypeError: 'str' object is not callable -

i'm trying insert values table sqlalchemy , following tutorial made this: engine = create_engine('postgresql://rnped:rnped@localhost:5432/rnped') df.to_sql("first_name_{}".format(first_name), engine, index=false, if_exists='replace') connection = engine.connect() s = text( """ insert rnped_names ( index, first_name, fuerocomun_complexion, fuerocomun_dependencia, fuerocomun_desapentidad, fuerocomun_desapfecha, fuerocomun_desaphora, fuerocomun_desaplocalidad, fuerocomun_desapmunicipio, fuerocomun_desappais, fuerocomun_descripcion, fuerocomun_discapacidad,

sql - Multiple roles to single user -

i want design schema sql database in user can have multiple roles admin,tester, developer , have accessibility module(test,develop,performance) per role. tried design 3 tables first of users in user have id , role id,second 1 of role ,and third of module have foreign key of user , role in assign permission role. but fails when user have multiple roles seems basic many-to-many relationship me - need 3 tables: 2 entity tables , 1 conjunction table. in case there should user table, role table, , usertorole table. module / role many many relationship - since many roles might connected single module, , many modules might connected single role. a basic implementation might : tbluser ( user_id int primary key, -- other user related columns ) tblrole { role_id int primary key, -- other role related columns } tblusertorole { urt_user int foreign key tbluser, urt_role int foreign key tblrole, primary key (urt_user, urt_role) } wiki

node.js - when user types www the site is not secure but when they type just the root domain then it is secure "https" -

i don't understand why when type in url of site example , example.com goes https://www.example.com when type www.example.com , click enter the, https doesn't show. want show https in godaddy in forwarding section says " https://www.example.com " when type in example.com guess causes go https part. in godaddy in records table has four columns a @ forwarded 600 seconds cname| www | example.com.herokudns.com | 1/2 hour here thing did upgrade hobby version certificate and there error ssl your certificate automatically managed 1 domain failed validation this 2 column table showing dns target domain name dns target (failed x) example.com | example.com.herokudns.com (check mark) www.example.com | www.example.com.herokudns.com what don't understand dns target says "www.example.com.herokudns.com" not shown target in godaddy, 1 showed above (without www in front of it). don't understand how can success

c++ - float to int conversion going wrong (even though the float is already an int) -

i writing little function calculate binomial coefficiant using tgamma function provided c++. tgamma returns float values, wanted return integer. please take @ example program comparing 3 ways of converting float int: #include <iostream> #include <cmath> int bincoeffnear(int n,int k){ return std::nearbyint( std::tgamma(n+1) / (std::tgamma(k+1)*std::tgamma(n-k+1)) ); } int bincoeffcast(int n,int k){ return static_cast<int>( std::tgamma(n+1) / (std::tgamma(k+1)*std::tgamma(n-k+1)) ); } int bincoeff(int n,int k){ return (int) std::tgamma(n+1) / (std::tgamma(k+1)*std::tgamma(n-k+1)); } int main() { int n = 7; int k = 2; std::cout << "correct: " << std::tgamma(7+1) / (std::tgamma(2+1)*std::tgamma(7-2+1)); //returns 21 std::cout << " bincoeff: " << bincoeff(n,k); //returns 20 std::cout << " staticcast: " << bincoeffcast(n,k); //returns 20 std::cout << "

c# - Display a readonly field in Asp.net Core -

i new in asp.net core , ask displaying field in w view. have class person { public string name {get; set;} public string nickname {get; set;} } typically, in edit person view, <input asp-for="name" class="form-control" /> <input asp-for="nickname" class="form-control" /> to display fields. but in edit person view need display name readonly, , nickname editable field. the name should not in textbox(even readonly), rather in label or div... is there standard approach display such fields? i don't want field updated model or db, need reading field. output html razor syntax https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor @model.name <input asp-for="nickname" class="form-control" /> note - need styling appropriately, or wrapping in <span> tag etc... wiki

java - The jar file is not reflecting any changes after making changes in code -

i'm working on java app. created jar file , after made changes in code , feel of app using net-beans changes made not reflecting in jar file. have delete old jar file , create new one? you need re-make jar file again, jar file compressed file containing resources (classes, images, etc) required run program. if of classes changed need recreate jar file ensure updated classes incorporated. wiki

Windows Installer for UWP application -

i developed 1 uwp application, how can make installer application, using can install or uninstall application. review microsoft's documentation on packaging, deployment, , query of windows store apps , particularly section on package deployment api . section contains 2 relevant samples: add app package sample app package removal sample if looking existing implementation of this, employer offers commercial option , , expect there other options out there. wiki

java - Saving multiple images to local storage from Firebase database -

i have app connected firebase database , displays images saved previously. retrieved database fine , showed on application's screen without issues. furthermore, want save them while application running. want them saved locally independent main activity life cycle reloaded local storage when whole app destroyed , started again. imagedownloadlist = new arraylist<>(); lv = (listview) findviewbyid(r.id.listview); progressdialog = new progressdialog(this); progressdialog.setmessage("images downloading loading please wait"); progressdialog.show(); mdatbaseref = firebasedatabase.getinstance().getreference(constants.fb_database_path); mdatbaseref.addvalueeventlistener(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { progressdialog.dismiss(); for(datasnapshot snapshot: datasnapshot.getchildren()) { imagedownload img = snapshot.getva

responsive - how to define media query with jQuery? -

i have buttons, , onclik scrolls content , code works : jquery(document).ready(function(){ jquery("button#defaultopen").click(function() { jquery('html, body').animate({ scrolltop: jquery("#defaultopen").offset().top+267 }, 1000); }); jquery("button#spezialkurs").click(function() { jquery('html, body').animate({ scrolltop: jquery("#spezialkurs").offset().top+267 }, 1000); }); jquery("button#opengym").click(function() { jquery('html, body').animate({ scrolltop: jquery("#opengym").offset().top+125 }, 1000); }); jquery("button#challenge").click(function() { jquery('html, body').animate({ scrolltop:jquery("#challenge").offset().top+125 }, 1000); }); jquery("button#vielseitige").click(function() { jquery('ht

javascript - Array filter with possible undefined properties -

i have array of objects may or not contain property. so, in order filter it, this: array = array.filter(v => v.myproperty != undefined); array = array.filter(v => v.myproperty[0] != undefined); this removes ones myproperty undefined and, afterwards, ones first element inside myproperty . is there way of having single liner prevents me applying filter array twice? something like: array = array.filter((v => v.myproperty || [])[0] != undefined); what about: filtered_array = array.filter(element => element.property && element.property[0]); what condition evaluate left part first. if it's true, try evaluate right part , return result. fiddle here . wiki

android - Testing SharedPreference pop-up -

i have settings activity in used sharedpreference set simple options application. have edittextpreference , listpreference. want test when select option in listpreference or when enter text in edittextpreference sharedpreference set correctly. problem have can click on listpreference , pop-up 5 options show up. cannot figure out way select 1 of option. tried this: onview(withtext(r.string.list_color_selection_title)).perform(click()); onview(withtext("yellow")).inroot(isplatformpopup()).perform(click()); sharedpreferences defaultsharedpreferences preferencemanager.getdefaultsharedpreferences(mcontext); string defaultemailvalue = defaultsharedpreferences.getstring("list_color", "null"); assertequals("yellow",defaultemailvalue); this doesn't work. have find people doing kind of thing: onview(viewmatchers.withcontentdescription("somedescription")) .inroot(rootmatchers.isplatformpopup()) .perform(viewactions.clic

One project per solution to create nuget packages -

i have solution 10 projects, used distribute sdk installer in day. to change in vsts added steps create package per project, every time make change, build triggered , ps script change version of nuspec files, in end packages pushed feed, if made change 1 project build pushes new version of every packages though there no changes in of them. someone told me wrong, should not push new version if there no change in package , every package has created separately. that makes sense, in case, have create 9 more builds in vsts, replace project references nuget dependencies, and, if ever need change 2 projects have modify one, commit change, open second project update nuget reference , make change, seems lot of work. so question is, there best practice or recommendation flow in creating group of nuget packages? wiki

reactjs - Concat prop value with string in styled-component -

having trouble trying add 's' string prop passed in styled-component. also, i'm not entirely sure if can use prop.x in styled component. here's mean: const mycomponent = (props) => { const styledlineitem = styled.li` animation: ${someanime}; animation-delay: ${props.x}; // <- work? // here need add 's' end // can't use `` becaouse of fact styled components // in template tag already... @ least think that's why // errors when try `${props.x}s` // also, haven't tested using ${prop.x} in styled-component // work? ` return ( <styledlineitem>{props.text}</styledlineitem> ) } // in main component... // ... react component stuff render() { return ( <ul> {_.map(data, (item, i) => <mycomponent key={i} text={item.text})} </ul> ) } let me know if can clearer on something. add "s" after variable work fine.

ethereum - GETH no genesis.json found. Need to change gasLimit value -

i searched , saw lot of issue this. getting "exceeds block gas limit" trying send ethereum geth wallet. no genesis.json found edit manually (i see gaslimit typing eth.getblock("latest") ) [...] gaslimit: 5000,[...] also tried set gaslimit , gas in send method. i'm on main net no custom token or custom genesis.json . want sent ethereum lol. command use : eth.sendtransaction({from:'0x8b2635e8ebae81c3d0d5e6935f0b387bfb508c42', to:'0x1b68c6d4a3b27aa43619750bf9d7578fd29ee6fe', value: web3.towei(0.0007, "ether")}); i'm calling send method json rpc. any hints how set gaslimit , fix issue? it's impossible nobody able send eth! wiki

Query github data using Hadoop -

i trying query github data provided ghtorrent api using hadoop. how can inject data(4-5 tb) hdfs? also, databases real time. possible process real time data in hadoop using tools such pig, hive, hbase? go through this presentation . has described way can connect mysql or mongodb instance , fetch data. have share public key, add key repository , can ssh. alternative can download periodic dumps this link imp link : query mongodb programatically connect mysql instance for processing real time data, cannt uisng pig, hive. batch processing tools. consider using apache spark. wiki

Inno Setup: Marquee style progress bar for lengthy synchronous operation in C# DLL -

Image
i create setup program using inno setup. have code c# , wizard page runs it. want see "progressbar" (style marquee) when code c# works long time. want undectend code c# working or hanging. how create "progressbar" (style marquee) in inno setup code c#. thank idea. example progressbar: some code: [files] source: "getdatabases.dll"; flags: dontcopy [code] function serverofdatabases( scriptname, server, user, password,namedb: string; out strout: widestring): integer; external 'serverofdatabases@files:getdatabases.dll stdcall'; var serverdetailspage: tinputquerywizardpage; function calldb(scriptname, server, user, password, namedb: string):string; var retval: integer; str: widestring; begin retval := serverofdatabases(scriptname, server, user, password, namedb, str); result:= str; end; procedure initializewizard; var ... begin serverdetailspage := createinputquerypage(wpwelcome, '', '', '...'

tensorflow - Freeze tensor_forest graph for Android -

i built aimple random forest model in tensorflow, , want freeze & optimize android. used following function building tesnor_forest estimator: def build_estimator(_model_dir, _num_classes, _num_features, _num_trees, _max_nodes): params = tensor_forest.foresthparams( num_classes=_num_classes, num_features=_num_features, num_trees=_num_trees, max_nodes=_max_nodes, min_split_samples=3) graph_builder_class = tensor_forest.randomforestgraphs return random_forest.tensorforestestimator( params, graph_builder_class=graph_builder_class, model_dir=_model_dir) this function stores textual model graph.pbtxt file in specified model directory. then train using: est = build_estimator(output_model_dir, 3,np.size(features_eval,1), 5,6) train_x = features_eval.astype(dtype=np.float32) train_y = labels_y.astype(dtype=np.float32) est.fit(x=train_x, y=train_y, batch_size=np.size(features_eval,0)) (in simple example: number of trees = 5, max_nodes=6)

Excel using COUNTIFS Function to create a Punchcard -

Image
in data source have column contains dates of occurrences , column contains hour of same occurrences. with this, goal obtain punchcard plot (maybe bubble chart appropriate) the intermediate structure has weekday(sunday-saturday) rows (a2:a8), , hours (8-22) columns (b1:p1), each column must have occurrence count week day in hour. with said, tried use countifs function, using following approach, cell b2: =countifs(weekday(rawdata!t2:t9852;1);a2;hour(rawdata!u2:u9852);b1) however, excel not computing value, finding problem on formula, having tried using insert formula option. place following in b2 =sumproduct((weekday($t$2:$t$8,1)=weekday($a2,1))*(hour($u$2:$u$8)=hour(b$1))) you need convert , match ; on system in range a2:a8 enter known date monday such 2017/08/20. select a2:a8 , apply custom formatting number format , set ddd. display day of week in text keep value in cell number. adjust ranges suit data. copy formula fill in table. wiki

android - add native ads from google ad mob to recycler from api -

i have recycler view , data api ,, need add native ads ad mob failed know how working ,, create native ad on add mob , have key dont know how add in recycler please help this adapter public class suggestrecycler_adapter extends recyclerview.adapter<suggestrecycler_adapter.item_holder> { private int lastposition = -1; int count = 0; private interstitialad minterstitialad; private adrequest adrequest; context context; list<resultmodel> models; recyclerview.viewholder viewholder; public suggestrecycler_adapter(context context, list<resultmodel> resultmodels) { this.context = context; this.models = resultmodels; } @override public item_holder oncreateviewholder(viewgroup parent, int viewtype) { view row = layoutinflater.from(parent.getcontext()).inflate(r.layout.suggest_items, parent, false); item_holder holder = new item_holder(row); return holder; } @targetapi(buil

android - Send Wi-Fi details to device -

i'm building app should communicate iot device. since iot device should connected wifi, i'd wish use app setup networking. have seen there several app out there can want. example hp smart seems following: turn off phone wifi turn on phone access point specific network name the printer connects phone the phone sends wifi details the printer connected same wifi i spent time googling around, wasn't able find info on it. suggestions? wiki

javascript - Enzyme cannot find child component in shallow test -

is not correct way render react/reflux test enzyme without store, ie, "dumb" import react 'react' import { shallow, render } 'enzyme' import { controls } '../controls' // named export import loadingspinner '../loadingspinner' let wrapper let loadingflags = { controls: true } describe('<controls />', () => { it('should render loading spinner', () => { wrapper = shallow(<controls loadingflags={loadingflags} />) // ensures spinner show until data ready expect(wrapper.length).toequal(1) // test passes expect(wrapper.find(loadingspinner)).to.have.length(1) // ^ typeerror: cannot read property 'have' of undefined }) }) when log wrapper.html() can see <img class='spinner' /> rendered, enzyme cannot find component. me, docs indicate should doing. suppose check child class, seems messier checking component itself, eg class changes within spinner component. how can

linux - I cannot commit changes in docker image -

i learn docker https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04 . and have problem in "step 6 - committing changes in container docker image". when run command docker run -it ubuntu got interactive shell access container , in command line got example: root@aaa73f6c6614:/# , can using shell. when want commit changes after installing nodejs have exit interactive shell using command exit , write in command line: docker commit -m "node.js" -a "me" aaa73f6c6614 finid/ubuntu-nodejs got following error: error response daemon: no such container: aaa73f6c6614/ubuntu-nodejs . why cannot commit changes , how can that? (i use ubuntu 16.04) just need use container id: docker commit -m "node.js" -a "me" aaa73f6c6614 then can tag container finid/ubuntu-nodejs : docker tag aaa73f6c6614 finid/ubuntu-nodejs:latest wiki

webview - Cordova intercept XMLHttpRequest / Websocket -

we develop ionic app using cordova. need intercept xmlhttprequest , websocket calls change headers. android system webview adding origin header file:// request not allowed schema 3rd part rest service. so i'm searching possibilty intercept calls android , ios if possible , add or remove headers? could possible? wiki

c++ - Safe getter to QStates -

i have class, containing qstatemachine . has couple of qstate* s. private: qstatemachine m_machine; qstate* m_state1 qstate* m_state2 ... i initialize state machine in constructor, , set machine running. as states private, want allow user subclass , altering behavior (e.g. adding transitions, change properties, connecting signals e.t.c) want add getters. don't add setters, documentation states: removing states while machine running discouraged. the qtcreator produces that: qstate *myclass:state1() const { return m_state1; } which seems nice. however seems me circumvents decision on not providing setters, possible: qstate* state = state1(); *state = qstate([...]); which understanding removes original state1 , overwrites new state. so thought return const qstate* instead. const qstate* myclass::state() const { return m_state1; } which seems work (the example above throw compiler error). new c++ not sure know have done there , if there othe

excel - VBA script to replace cell value and keep formatting -

Image
i have below table in word i'm trying write script replace contents of below cell different customer payment (i.e replace £1,100 £2,000). below snippet of script when write cell loses formatting , numbered list. how can keep replace cell data similar data , still keep formatting? ps. i've simplified contents of cell make easier read, code won't apply content descplan = trim(t1.cell(2, 2).range.text) desctest = instr(1, descplan, ":") finalstring = left(descplan, desctest) t1.cell(2, 2).range.text = replace(descplan, finalstring, "payment customer of " + format(v, "currency") + " due upon completion of items below:") wiki

mysql - ONLY_FULL_GROUP_BY automatically reset by itself? -

i absolutely need unset only_full_group_by on vps server hosted ovh so use command mysql > set global sql_mode=(select replace(@@sql_mode,'only_full_group_by','')); found here but don't why or automatically reset flag day after. could give me ideas find happens?? can phpmyadmin set mode ?? wiki

c# - How to set icon for resized buttom group in excel ribbon? -

hi i'm creating excel addin include new ribbon tab, , set corresponding icon each buton. but, anytime excel window resized , button group shows empty ball icon. how can set icon whole group displayed when resized? in image - grouped & ungrouped example can see 1 group ("simulation") not grouped, , other groups "add new products" & "scenarios" grouped. wiki

password protecting a page on Github not possible? -

i want password protect page on site built on github. i've researched online, seems it's not possible on github...? recommend do? appreciated... you correct, it's not possible. github pages public , there's no way avoid without using different backend. wiki

hadoop - How to run mapreduce on Hbase Exported table -

i ran following command export hbase table , transfer hdfs hbase org.apache.hadoop.hbase.mapreduce.export "financiallineitem" "export/output" hadoop fs -copytolocal export/output/part-m-00000 /home/cloudera/trf/sequence above command has kicked in mapreduce , transferred table data hdfs in sequence file format . now want write map reduce read key ,value sequence file ,but getting following error . 17/08/21 20:43:38 warn mapred.localjobrunner: job_local386751553_0001 java.lang.exception: java.io.ioexception: not find deserializer value class: 'org.apache.hadoop.hbase.client.result'. please ensure configuration 'io.serializations' configured, if you're using custom serialization.at org.apache.hadoop.mapred.localjobrunner$job.run(localjobrunner.java:406) caused by: java.io.ioexception: not find deserializer value class: 'org.apache.hadoop.hbase.client.result'. please ensure configuration 'io.serializations' conf

linux - Sending additional data along with gstbuffer -

i new gstreamer. now, want send additional data 1 element succeeding element along gstbuffer. looking through different websites, find following ways. 1) using gstmeta 2) using tags events 3) using gstbuffer structure 4) using omxbuffer subtype gstbuffer i couldn't see worthy implementation of of above. please me source code of above method suites purpose. nb: i'm using ubuntu 16.04 , gstreamer library 1.0 in advance! wiki

github - Git: Your branch and 'origin/master' have diverged - after updating forked repo -

i seem have problems gitlab repo.. i forked kaldi repo while ago (i think year ago).. , wanted update me repo current version of the kaldi repo. i ended following guide i think pulled newest version?.. have problems pushing/pulling local repo.. ~/kaldi-trunk$ git pull x11 forwarding request failed on channel 0 error: following untracked working tree files overwritten merge: egs/deltas/s5/data/lang/g.fst egs/deltas/s5/data/lang/l.fst egs/deltas/s5/data/lang/l_disambig.fst egs/deltas/s5/data/lang/oov.int egs/deltas/s5/data/lang/oov.txt egs/deltas/s5/data/lang/phones.txt egs/deltas/s5/data/lang/phones/align_lexicon.int egs/deltas/s5/data/lang/phones/align_lexicon.txt egs/deltas/s5/data/lang/phones/context_indep.csl egs/deltas/s5/data/lang/phones/context_indep.int egs/deltas/s5/data/lang/phones/context_indep.txt egs/deltas/s5/data/lang/phones/disambig.csl egs/deltas/s5/data/lang/phones/disambig.int egs/deltas/s5/data/lang/

javascript - React create an array queue of objects to be sent once connection is available -

Image
i have following jsx code: import react, { component } 'react'; import axios 'axios'; import serialize 'form-serialize'; var = [], b= []; class form extends component { constructor(props) { super(props); this.state = { firstname: '', email: '', university: '', degree: '', candidates: [] } this.setfirstname = this.setfirstname.bind(this); this.setemail = this.setemail.bind(this); this.setuniversity = this.setuniversity.bind(this); this.setdegree = this.setdegree.bind(this); } setfirstname(name) { this.setstate({ firstname: name }); } setemail(email) { this.setstate({ email: email }); } setuniversity(university) { this.setstate({ university: university }); } setdegree(degree) {

nginx proxy return 11: resource temporarily unavailable -

this got debug level info error log "get /api/account/logout http/1.0 host: http://server_ip/ connection: close cache-control: max-age=0 user-agent: mozilla/5.0 (macintosh; intel mac os x 10_12_6) applewebkit/537.36 (khtml, gecko) chrome/60.0.3112.90 safari/537.36 upgrade-insecure-requests: 1 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 accept-encoding: gzip, deflate accept-language: zh-cn,zh;q=0.8,en-us;q=0.6,en;q=0.4,zh-tw;q=0.2 " 2017/08/22 19:38:42 [debug] 22939#0: *62 http cleanup add: 00007f557d385fd0 2017/08/22 19:38:42 [debug] 22939#0: *62 rr peer, try: 1 2017/08/22 19:38:42 [debug] 22939#0: *62 stream socket 8 2017/08/22 19:38:42 [debug] 22939#0: *62 epoll add connection: fd:8 ev:80002005 2017/08/22 19:38:42 [debug] 22939#0: *62 connect 10.14.6.4:80, fd:8 #63 2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream connect: -2 2017/08/22 19:38:42 [debug] 22939#0: *62 posix_memalign: 00007f557d2e7de0:128 @16 2017/0

python - When slicing a 1 row pandas dataframe the slice becomes a series -

why when slice pandas dataframe containing 1 row, slice becomes pandas series? how can keep dataframe? df=pd.dataframe(data=[[1,2,3]],columns=['a','b','c']) df out[37]: b c 0 1 2 3 a=df.iloc[0] out[39]: 1 b 2 c 3 name: 0, dtype: int64 to avoid intermediate step of re-converting dataframe, use double brackets when indexing: a = df.iloc[[0]] print(a) b c 0 1 2 3 speed: %timeit df.iloc[[0]] 192 µs per loop %timeit df.loc[0].to_frame().t 468 µs per loop wiki

ElasticSearch - Nested Filtered Aggregations -

i'm looking way min , max value 2 level nested object have been filtered. below im trying min , max price has currencycode gbp. each product can have multiple skus , each sku can have multiple prices (though 1 gbp): "hits": [ { "_index": "product", "_type": "main", "_id": "1", "_score": 1, "_source": { "skus": [ { "prices": [ { "currencycode": "gbp", "price": 15 } ] } ] } },{ "_index": "product", "_type": "main", "_id": "2", "_score": 1, "_source": { "skus": [ {

asynchronous - Java Spring Async Execution -

using jhipster on spring boot 1.5.4, i'm having hard time getting background tasks execute asynchronously; appear running synchronously using different taskexecutor , thread pool 1 i've configured. all happens in service, bevity, defined so: @service @transactional public class appservice { @scheduled(fixeddelay = 3000) public void consumedata() { // connect subscriber , push data workerbee for(tuple data : this.gettuples()) { workerbee(data); } } @timed @async public void workerbee(tuple data) throws exception { // ... takes 300ms .... thread.sleep(300); } } arguably service isn't perfect place work, demonstration purposes, fits. (also aside, apears @timed isn't working, read somewhere @timed doesn't work when called internally within service) relevant section of application.yml : jhipster: async: core-pool-size: 8 max-pool-size: 64 queue-cap

c# - using DependencyInjection in the Configure Method -

in asp.net core web application, have myrepository class , interface imyrepository manages access repository (database). each time user connects application(on site), need log entry in database. in startup.cs, in configureservices method do public void configureservices(iservicecollection services) { // adds services required using options. services.addoptions(); // ... services.addsingleton<imyrepository, myrepository>(); then in configure method need update database public void configure(iapplicationbuilder app, ihostingenvironment env, iloggerfactory loggerfactory) { // ... imyrepository myrep = ??? // should inject somehow // ... app.useopenidconnectauthentication(new openidconnectoptions { clientid = configuration["...clientid"], authority = configuration["...aadinstance"] + configuration["...tenantid"], callbackpath = configuration["...callbackpath"], events = n