Posts

Showing posts from March, 2010

Conditional formatting on multiple rows with different names in Excel -

i have 4 names in column segment - adult org segment - core segment - light segment - proactive health i want use conditional formatting each time finds 1 of them colors entire row, each row should different colored eg segment - adult org - red, segment - core - blue etc. please

php - Respect\Validation - validate string if not empty, otherwise return true -

i'm using respect\validation validate fields. of fields not mandatory, phone number, if not empty must validated. following current code: v::phone()->validate($phonenumber); // should return true if $phonenumber empty how it? based on the docs , looks should be: v::optional(v::phone())->validate($phonenumber);

Angular - Call parent method from child modal created by service -

i have parent component displaying list of records in table. each record has button can click , calls method called newversioncheck() , seen below. // creates new version target createnewversion(){ alert('create new version flow'); } /** * if draft exists, prompt user load , modify existing * or discard , create new draft. if no draft exists, * use createnewversion flow * * @param {any} ruleid * @memberof versionscomponent */ newversioncheck() { let versionhasdraft = false; // check see if target has draft. // if dont, take them new version flow if (!_.find(this.mapversionsdata, { isdraft: '1' })) { this.createnewversion(); }else{ // our draft version object let versionobj = _.find(this.mapversionsdata, { isdraft: '1' }); // tell our subject data sending modal this._mapsservice.updateconfirmexistingversionmodaldata({ targetid: this.targetid, createdbyqid:

layout - libGDX: Fade in and out between two Screens without Scene2D -

it's me again :) i'm trying libgdx game completion. however, have been stuck transitions of 2 screens, want e.g. fade out menu screen when start game , fade in game screen. not use scene2d , not know me stages , actors. glad if me , solve problem. thanks in advance! :) don't worry, can achieve aim without using scene2d . anyway, there's more work build building block system it's worth @ end. concept the concept have game screen manager manage game screen(s) operating in game. that's being said. when transition 1 screen another, need such game screen manager control game screen able draw , , able update . normally have such manager manage game screen anyway. can further make use of achieve screen transition effect. such ability control play major role when transition effect kicks in. fading in/out effect, let's define t total time complete when 1 screen transitions another, a starting screen, b target screen, , m game scree

c# - How to get scalar value from a SQL statement in a .Net core application? -

the following code in .net core console application (ef core 2.0/sql server). var sql = _context.set<string>() .fromsql("select dbo.functionreturnvarchar({0});", id); got following exception? cannot create dbset 'string' because type not included in model context. is way without defining class property of string? .set<tentity>() entities backed context. you can try workaround dbcommand cmd = _context.database.getdbconnection().createcommand(); cmd.commandtext = "select dbo.functionreturnvarchar(@id)"; cmd.parameters.add(new sqlparameter("@id", sqldbtype.varchar) { value = id }); var value = (string) await cmd.executescalarasync();

Git revert to point to specific commit/revision history with Git bash console -

Image
i trying go commit point history via git log , push point repo new head pointed reverted commit without removing commits prior. what did git log retrieve commit history. did git revert (log version) instead of git reset (log version) since safer 'git revert`. but when git revert , weird screen in git bash console unable it: this weird screen text editor called vim . need edit commit message, save , exit: https://stackoverflow.com/a/11828573/7976758 edit text, press esc exit edit mode, press : enter command line mode, press x , enter save , exit.

linux - finding a process ID and listing the command name and any network connections -

i've been trying create script take process id number (pid) , identify process id name , list network connections connected to. i understand should use netstat this. here code far doesn't seem anything, can explain im going wrong , need do? echo 'please enter process id: ' read pidn echo 'you entered process id: ' $pidn pid= pgrep -fl "^(/.*)?${pidn}\s" echo $pid if use command below (ex: ssh) netstat -nalp | grep -i ssh follow result: [root@localhost ~]# netstat -nalp | grep 1055 tcp 0 0 0.0.0.0:22 0.0.0.0:* listen 1055/sshd tcp6 0 0 :::22 :::* listen 1055/sshd unix 3 [ ] stream connected 20308 1055/sshd

wordpress - Building a 'case' of beer bottles in WooCommerce mini-cart.php template -

Image
really trying nail issue can't quite complete. i've raised query reckon unclear little clearer here. i have amended mini-cart display different image every item added cart. simulate adding of bottles 'case'. see image show in action, , here code makes work. <?php if(wc()->cart->get_cart_contents_count() == 0){ echo '<img src="http://example.com/wp-content/uploads/2017/…/empty-case.png" alt="icon" />'; } elseif (wc()->cart->get_cart_contents_count() == 1){ echo '<img src="http://example.com/…/uploads/2017/06/case-with-1-bottle.png" alt="icon" />'; elseif (wc()->cart->get_cart_contents_count() == 2){ echo '<img src="http://example.com/…/uploa…/2017/06/case-with-2-bottles.png" alt="icon" />'; this continues until 60 bottles or so, , works fine. the problem is, it's based on cart total, , there other items in shop don't

How can I pass R variable into sqldf? -

i have query this: sqldf("select tenscore data state_p = 'andhrapradesh'") but have "andhrapradesh" in variable statevalue . how can use variable in select query in r same result above. please show me syntax. you can use sprintf : sqldf(sprintf("select tenscore data state_p = '%s'", statevalue))

c# - How to stop default function of keyboard key? -

i made textbox , bind space check if string in textbox1 , richtextbox1 same: if (e.keycode == keys.space) { if (richtextbox1.text.contains(textbox1.text)) { richtextbox1.text = richtextbox1.text.replace(textbox1.text + " ", ""); wpm++; textbox1.text = ""; } } so want when press space not write space in textbox1 this answer adapted msdn example here // boolean flag used determine when character other space entered private bool spaceentered = false; // handle keydown event determine type of character entered control. private void textbox1_keydown(object sender, system.windows.forms.keyeventargs e) { spaceentered = e.keycode == keys.space; } // event occurs after keydown event , can used prevent // characters entering control. private void textbox1_keypress(object sender, system.windows.forms.keypresseventargs e) { // check flag being set in keydown event. if (spaceentered == true)

node.js - MongoDB Speed up grouping -

i have basic collection fruits follows schema this: {_id:1234 type:'apple' store:'abc'} {_id:1235 type:'apple' store:'xyz'} {_id:1236 type:'banana' store:'xyz'} {_id:1237 type:'pear' store:'abc'} {_id:1238 type:'pear' store:'xyz'} {_id:1239 type:'apple' store:'abc'} {_id:1240 type:'banana' store:'abc'} {_id:1241 type:'apple' store:'xyz'} i wish group , sum fruit have aggregate so: app.get('/getfruittotals', function(req, res){ db.fruit.aggregate([{$group:{_id:$type, total:{$sum:1}}}], function(err, results){ res.send(results); }); }) this works fine except collection couple million records simple grouping takes 4000 milliseconds. if run instead: db.fruit.find({type:'apple'}).count() i can cut query time down 4000 milliseconds 110 milliseconds. since have 3 possible types of fruit (or should say, poss

git - AWS Pull latest code from codecommit on EC2 Instance startup -

there seem lot of discussion around topic nothing precisely situation , hasn't resolved me far. i have code placed in aws codecommit. i have created ami 1 of running ubuntu instance in aws , created launch configuration using ami along auto scaling group. i want base/modify launch config ami every month or ensure ami has recent updated code , newly launched instances (thru auto scaling) can pull latest changes codecommit repo on launch - resulting in reduced launch time. to achieve this, placed below code in user data (cloud-init) script , selected iam role has full permissions on ec2 , codecommit iam:passrole permission. on launch, script throws error , not pull changes (i intentionally kept file in repo test) option 1 #!/bin/bash git config --global credential.helper '!aws codecommit credential-helper $@' git config --global credential.usehttppath true cd /path/to/my/folder/ git remote set-url origin https://git-codecommit.ap-southeast-2.amazonaws.com/v1/r

python - How to update the value of one record based on another record with specific criteria in the same dataframes -

in python, have dataframes table of gdp records this quarter vaule percentage 2017q1-q4 100 18% 2017q1-q3 60 20% 2017q1-q2 30 15% 2017q1-q1 10 10% 2016q1-q4 10 28% 2016q1-q3 6 50% 2016q1-q2 3 45% 2016q1-q1 1 20% i want output this: quarter vaule percentage 2017q4 40 18% 2017q3 30 20% 2017q2 20 15% 2017q1 10 10% 2016q4 4 28% 2016q3 3 50% 2016q2 2 45% 2016q1 1 20% that is, value updated based on computing of other records percentage keeps unchanged. are there efficient way deal case. thanks! df.iloc[:-1, 1] = df['vaule'].diff(-1)[:-1] >>> df quarter vaule percentage 0 2017q1-q4 40 18% 1 2017q1-q3 30 20% 2 2017q1-q2 20 15% 3 2017q1-q1 0 10% 4 2016q1-q4 4 28% 5 2016q1-q3 3 50% 6 2016q1-q2 2 45% 7 2016q1-q1 1 20%

javascript - Keras-js input data error in Node-Red (not recognized as Float32Array) -

after exporting keras model , weights, tried following code in node.js (v6.9.4), , runs ok: const kerasjs = require('keras-js'); const model_folder = '... model_files_folder'; const model_file_path = { model: model_folder + 'model.json', weights: model_folder + 'model_weights.buf', metadata: model_folder + 'model_metadata.json' }; const model_config = { filepaths: model_file_path, gpu: false, filesystem: true }; const model = new kerasjs.model(model_config); model.ready().then(() => { const inputdata = { 'input': new float32array(5) } console.log('input: ' + inputdata.input); return model.predict(inputdata) }).then(outputdata => { var out = outputdata['output'] console.log('output: ' + out); }).catch(err => { console.error(err) }) i got result as: > input: 0,0,0,0,0 output: 0.4446795582771301,0.00000536336

ubuntu - How to put terminal commands into a file and run it -

i'm new ubuntu apologize lack of knowledge on subject. is possible put terminal commands file in ubuntu 16.04 , run file , have commands executed? for example. if have file named 'somefile' and in file have: cd desktop chmod + x top.sh top -n 1 -b > top-somefilename.txt in terminal can run file , have commands executed? if how do it? shell cripts in current folder executed in following way (with ./ @ beginning): ./top.sh

asp.net mvc - Original values sometimes remain after edit and reload -

mvc5 web app. have basic edit method: public actionresult edit(int studentid) { studentmodel model = repo.getstudent(studentid); return partialview("_editlot", model); } and save post: [httppost] [validateantiforgerytoken] public actionresult edit(studentmodel model) { repo.updatestudent(model); return redirecttoaction("index", "subject", new { subjectid = model.studentid }); } so post edit, save data in repo direct index method reloads (index contains student list subject edit link in table each student). public actionresult index(int classid) { classviewmodel model = new classdataviewmodel() { studentlist = repo.getstudents(classid) }; return view(model); } edit: index view has table of student data: @model myapp.models.subjectviewmodel <table class="table table-responsive processor-data-table">

chocolatey - How do I pass parameters that contain spaces? -

i want pass following "javaoptions" containing file path spaces within --params. --params "'/javaoptions:-dwebdriver.jx.browser="c:/program files (x86)/testnav/testnav.exe"'" this how can work: choco install -y selenium --params "'/role:node /hub:http://localhost:4444 /capabilitiesjson:$capabilitiesjson /autostart /maxsession:1 /javaoptions:""-dwebdriver.jx.browser=\`"c:\progra~2\testnav\testnav.exe\`"""'" --force -d note $capabilitiesjson being interpolated properly.

regex - How to use re.sub to replace a match by repl which contains '\g' in python -

re.sub(pattern, repl, string, count=0, flags=0) as in doc, if \g in repl, python looking next char < . unfortunately need repl contain \g , , cannot put raw string r'repl_string' in position of repl since string variable. , if put re.escape('repl_string') works result not want, since escapes of chars. what should do? here code have: newline = '<p align="center"><img src="https://s0.wp.com/latex.php?latex=%5cdisplaystyle+%7b%5cbf+p%7d%28+%7c%5cfrac%7bs_n+-+n+%5cmu%7d%7b%5csqrt%7bn%7d+%5csigma%7d%7c+%5cgeq+%5clambda+%29+%5c+%5c+%5c+%5c+%5c+%282%29&amp;bg=ffffff&amp;fg=000000&amp;s=0" alt="\\displaystyle {\x08f p}( |\x0crac{s_n - n \\mu}{\\sqrt{n} \\sigma}| \\geq \\lambda ) \\ \\ \\ \\ \\ (2)" title="\\displaystyle {\x08f p}( |\x0crac{s_n - n \\mu}{\\sqrt{n} \\sigma}| \\geq \\lambda ) \\ \\ \\ \\ \\ (2)" class="latex" width="173" height="38" srcset="https://

Joining inner members inside a list of objects in Python -

this question has answer here: python getting list of value list of dict 3 answers i have following array: [ {"name": "abc", "age": 10}, {"name": "xyz", "age": 12}, {"name": "def", "age": 15} ] i want create following array out of it: ["abc","xyz","def"] ie take name field out of each object. there easier way other through loop? you have error in dictionary syntax, i'm assuming wanted use string keys. the issue solved using list comprehensions: data = [ {'name': 'abc', 'age': 10}, {'name': 'xyz', 'age': 12}, {'name': 'def', 'age': 15} ] print([item['name'] item in data]) #=> ['abc', 'xyz', 'def'] you us

javascript - Using Selenium without Firebug? -

i installing selenium right , tutorials say, need firebug. unfortunnally on download page ( https://getfirebug.com/ ) says: the firebug extension isn't being developed or maintained longer. invite use firefox devtools instead, ship firebug.next does mean have use firefox devtools run selenium now? you don't need firebug. right clicking element in firefox or chrome provide option inspect element. there can right click on html copy xpath , css, see element's id, name, class etc. tools can found pressing ctrl+shift+i in both chrome , firefox.

javascript - Input type "range" - Set dynamic range -

i'm looking way set minimum value of input of type range equal value of specific field. at moment, have this: these shown in modal window <div class="form-group"> <label asp-for="numdevices" class="col-md-2 control-label"></label> <div class="col-md-10"> <input id="numdevices" type="text" asp-for="numdevices" class="form-control" /> <input id="getnum" type="range" max="10" step="1" onchange="fetch()" class="form-control" /> </div> </div> and current js: <script> function getminimun() { var minimun = document.getelementbyid("numdevices").value; var shareminimun = number(minimun); document.getelementbyid("getnum").min = shareminimun; } </script> questions: need call getminimun() function in

When you publish a React Native app with Expo will over-the-air updates go out to previous versions on the App and Play Store? -

i'm using expo.io publishing over-the-air updates. have submitted several new official updates (so new sdk/ipa files) app , play store. i'm still using same version of expo before. on air updates go out previous versions(people haven't gotten offical app/play store update)? or old versions stuck until user manually updates latest version can ota updates again? if upload new build app store , play store, user need download build in order ota updates build. if build , push expo server, user able ota updates without download. the standalone app knows updates @ app's published url . from documentation : publishing guide when build binary, current version of app javascript bundled loads first time app opens. you’re not stuck version of code, can publish updates @ time after without needing re-build binary. example, if find bug or want add functionality app after submitting binary. the standalone app knows updates @ app’s published url

linux - How to display a screenshot of a stream using avconv and php with exec? -

when script run, image saved file: <?php $url = "rtmp://109.71.162.112:1935/live/sd.jasminchannel.stream"; exec('avconv -i "'.$url.'" -ss 00:00:01 -t 1 -r 1 -f image2 "screenshot.jpg" 2>&1', $output, $status); header("content-type: image/png"); readfile("screenshot.jpg"); i wish returned on screen (on fly means it, write variable, instead without saving file , afterwards reading, display, deleting file): <?php $url = "rtmp://109.71.162.112:1935/live/sd.jasminchannel.stream"; exec('avconv -i "'.$url.'" -ss 00:00:01 -t 1 -r 1 -f image2 $variable 2>&1', $output, $status); header("content-type: image/png"); echo $variable; how can this?

java - How to deactivate a button in android -

i'm making simple tip calculator app in android , i've got of functionality working, i'm stuck on trying fix bug i've found. happens enter number edittext , choose service rating spinner . have 2 buttons, 1 says what's tip? , 1 says what's total tip? (each self-explanatory do). bug i've found if click either button edittext being empty, crashes app. i've tried button.setclickable(false/true) , button.isclickable() , button.isenabled() none of them have worked. maybe did use correct 1 didn't use correctly i've got no idea do. appreciated. p.s. sorry xml code not 100% formatted it's there java code: public void calculatetip (view view) { string tip = et.gettext().tostring(); if(tip.isempty()) { btn_tip.setclickable(false); } else { btn_tip.setclickable(true); } double finaltip = double.parsedouble(tip); string onetipformat = string.format("%.2f", finaltip *

android - Api.Ai App crash -

below code on app button click crashes app. sendbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(final view view) { string text = string.valueof(chattext.gettext()); if(text !=null && !text.isempty()){ airequest.setquery(text); } new asynctask<airequest, void, airesponse>() { @override protected airesponse doinbackground(airequest... requests) { final airequest request = requests[0]; try { final airesponse response = aidataservice.request(airequest); return response; } catch (aiserviceexception e) { } return null; } @override protected void onpostexecute(airesponse airesponse) { if (airesponse != null) {

excel - Deselecting currently editing cell in c# interop -

i have test button in excel addin looks this private async void testbtn_click(object sender, ribboncontroleventargs e) { microsoft.office.interop.excel.application curexcel = (microsoft.office.interop.excel.application)globals.thisaddin.application; microsoft.office.interop.excel.workbook curworkbook = (microsoft.office.interop.excel.workbook)curexcel.activeworkbook; excel.worksheet worksheet = curworkbook.worksheets.item[1] excel.worksheet; excel.range line = (excel.range) worksheet.rows[1]; line.insert(); } it works fine except when have cell selected editable - when cursor flashing on 1 of cells. need able deselect cells before line.insert() how can this?

ios - Fade out button when not touching for 3 seconds and fade in when user touches the screen -

problem: i have uibutton i'd fade out few seconds when user doesn't touch screen , fade them in when user touches screen. think might need use timer , animation in viewdidload part @iboutlet var startstopbutton: uibutton! @ibaction func startstopbuttontapped(_ sender: uibutton) { } override func viewdidload() { super.viewdidload() }

recommendation engine - IndexError: index 77572 is out of bounds for axis 0 with size 671 -

i trying complete movie recommendation system , having trouble following few lines of code: train_data_matrix = np.zeros((n_users, n_movies)) line in train_data.itertuples(): train_data_matrix[line[0], line[1]] = line[2] test_data_matrix = np.zeros((n_users, n_movies)) line in test_data.itertuples(): test_data_matrix[line[0], line[1]] = line[2] any appreciated. please find error message receiving below: indexerror traceback (most recent call last) <ipython-input-52-d28ea8571763> in <module>() 2 train_data_matrix = np.zeros((n_users, n_movies)) 3 line in train_data.itertuples(): ----> 4 train_data_matrix[line[0], line[1]] = li ne[2] 5 6 test_data_matrix = np.zeros((n_users, n_movies)) indexerror: index 77572 out of bounds axis 0 size 671

android - What are these lines in ConstraintLayout? -

Image
i using constraintlayout , having difficulty figuring out use of these lines. trying align edittext right of textview .how constraintlayout ?

iphone - iOS state restoration issue with DrawerController -

i have app written in swift 3.1, using xcode 8.3.3. i trying implement state preservation/restoration. to have implemented shouldsaveapplicationstate , willfinishlaunchingwithoptions methods in appdelegate.swift , set return true : // appdelegate.swift // state restoration callbacks func application(_ application: uiapplication, shouldsaveapplicationstate coder: nscoder) -> bool { debug_print(this: "shouldsaveapplicationstate") return true } func application(_ application: uiapplication, shouldrestoreapplicationstate coder: nscoder) -> bool { debug_print(this: "shouldrestoreapplicationstate") restoringstate = true return true } func application(application: uiapplication, willfinishlaunchingwithoptions launchoptions: [nsobject : anyobject]?) -> bool { debug_print(this: "willfinishlaunchingwithoptions") return true } i’ve provided restoration ids involved viewcontrollers , navigationcontrollers. i'

javascript - How to show escapeHTML4 string in unescaped format -

i have used escapehtml4 function in backend add escape characters block xss attack. have been assigned requirement should shown user. requirement user should see user enters if might script attack. there way can done? example user enters "'>">img src=x onerror=alert(1)>' need show '>">img src=x onerror=alert(1)>' . think possible way in javascript. unable find function capable convert output of escapthtml output original one.

Why does windows certutil and openSSL display certificate public key bytes differently? -

this question similar " why windows certutil , openssl display csr (pkcs#10) signature bytes differently? " has different. i want view contents of certificate, run command certutil , openssl , parts has same contents, parts different. from 1 , know certutil output signature contain same bytes written backwards, public key, looks totally different. for certutil -dump cert.der command output is: 0000 30 82 01 0a 02 82 01 01 00 b7 78 af dd 3d 89 d5 0010 e1 93 bb 55 3a a6 24 62 34 d2 ec c0 6f d4 1d 82 0020 2a 38 a8 bf 99 80 84 18 80 9c 2c 07 7f e2 59 42 0030 68 e2 0a 11 2e 40 33 ef e3 b2 08 d5 32 dd 59 1f 0040 35 31 d1 f4 5d f2 69 e7 16 b5 ef 44 21 21 05 3e 0050 51 13 85 b4 5e 05 29 fc 50 1b d2 24 52 69 a7 0060 19 f3 cb 18 73 44 84 83 e3 27 8b 43 03 d2 2a 5a 0070 08 85 7c 56 b0 70 d7 fa d1 62 b7 34 15 b0 3b 7f 0080 4f 35 a1 ba e3 e1 d9 54 3a 47 17 fc 49 00 68 e8 0090 32 78 0c 2e 0d 72 c7 31 21 c5 69 f5 2e 8c 2d f6 00a0 7d aa 56 8c ef ef 6c ba

angularjs - ngmodel undefined but $modelValue and $viewValue changed -

generally html likes below: <script type="text/javascript" src="assets/txn/test/test.js"></script> <script type="text/javascript" src="assets/txn/test/test_newao.js"></script> <script type="text/javascript" src="assets/txn/test/test_confirm.js"></script> <div ng-controller="testcontroller" ng-cloak> <div class="panel panel-default"> <div class="bootstrap-admin-panel-content search_box"> <form name="myform"> <table style="width:90%;"> <tr> <th style = "width : 10%;">a:</th> <td style = "width : 40%"> <e-combobox ng-model = "inputvo.brchid" ng-datasource = "branch_list"

css selectors - What does .container.\31 25\25 mean in CSS? -

in code below, wondering \ backslash might mean? have not encounter backslash character in lessons i've been taking. piece of code used identify browser sizes, believe. .container.\31 25\25 { width: 100%; max-width: 1500px; /* max-width: (containers * 1.25) */ min-width: 1200px; /* min-width: (containers) */ } .container.\37 5\25 { /* 75% */ width: 900px; /* width: (containers * 0.75) */ } .container.\35 0\25 { /* 50% */ width: 600px; /* width: (containers * 0.50) */ } .container.\32 5\25 { /* 25% */ width: 300px; /* width: (containers * 0.25) */ } according spec , identifiers can contain escaped characters , iso 10646 character numeric code (see next item). instance, identifier "b&w?" may written "b\&w\?" or "b\26 w\3f". [...] in css 2.1, backslash (\) character can indicate 1 of 3 types of character escape. inside css comment, backslash stands itself, , if backslash followed

How can you compute an integral and derivative in python of a polynomial and return a list with the coefficients? -

it should include loop believe don't know how more that. def polyint(p,c = 0): sum = 0 in range(0,len(p),1): sum = sum + p[i+1] * (x**(i+1)) return p print polyint([1,1,1]) i don't think correct integral best guess. beginner in coding don't have lot of intuition programming. help.

javascript - JSC_NON_GLOBAL_DEFINE_INIT_ERROR occurs when compiling js with Google Closure Compiler, webpack, and Firebase JS SDK -

jsc_non_global_define_init_error occurs when compiling js tools below: webpack: 3.5.6 google closure compiler js: 20170806.0.0 firebase js sdk: 4.3.1 environment macos x: 10.11.6 node.js: v7.10.0 npm: 4.2.0 here error message: error in app.bundle.js:5325 (jsc_non_global_define_init_error) @define variable assignment must global with webpack.config.js below: module.exports = { plugins: [ new closurecompiler({ options: { languagein: 'ecmascript6', languageout: 'ecmascript3', compilationlevel: 'simple_optimizations', warninglevel: 'quiet' } }) ] this error due @define annotation inside firebase/utils/constants.js . var constants = exports.constants = { /** * @define {boolean} whether client node.js sdk. */ node_client: false, /** * @define {boolean} whether admin node.js sdk. */ node_admin: false, /** * firebase sdk version */ sdk_version: &

c# - Simconnect data reading in multiple .xaml files -

i using simconnect read data prepar3d in wpf. read data in 1 .xaml file ok. in project, mainwindow consists of many .xaml files means need multiple .xaml files read data @ same time. when try read data simultaneously in 2 .xaml files, created new simconnect object, struct defined unsuccessful. internal struct simobjectgeneral { [marshalas(unmanagedtype.byvaltstr, sizeconst = 256)] /* 2.declare parameters in simobjectgeneral */ public string title; public int32 ias; public int32 cas; public int32 grossweight; ... ... } internal struct simobjectgeneral_atcl { [marshalas(unmanagedtype.byvaltstr, sizeconst = 256)] /* 2.declare parameters in simobjectgeneral */ public int32 altitude; } simobjectgeneral? simobjectgeneral= data.dwdata[0] simobjectgeneral_?;//it works simobjectgeneral_atcl? simobjectgeneral_atcl = data.dwdata[0] simobjectgeneral_atcl?;//it returns null value, w

java - I'm working on a convex hull project using processing3, could somebody tell me if there's anyway to quit a function (not the whole program)? -

int currentpoint = 2; int direction = 1; pvector copyof(pvector p){ return new pvector(p.x, p.y); } void addpoint() { hull.add(points.get(currentpoint)); // @ turn direction in last 3 points // (we have work copies of points because java) p1 = copyof(hull.get(hull.size() - 3)); p2 = copyof(hull.get(hull.size() - 2)); p3 = copyof(hull.get(hull.size() - 1)); while (!crossprod (p1, p2, p3) && hull.size() > 2) { // if crossproduct <= 0, remove middle point // if crossproduct >= 0, nothing because have add point before hull.remove(hull.size() - 2); if (hull.size() >= 3) { //in case of null pointer error p1 = copyof(hull.get(hull.size() - 3)); } p2 = copyof(hull.get(hull.size() - 2)); p3 = copyof(hull.get(hull.size() - 1)); } //you'll see information in console println("cur

Elasticsearch range with aggs -

i want average rating of every user document not working according me.please check code given below. curl -xget 'localhost:9200/mentorz/users/_search?pretty' -h 'content-type: application/json' -d' {"aggs" : {"avg_rating" : {"range" : {"field" : "rating","ranges" : [{ "from" : 3, "to" : 19 }]}}}}'; { "_index" : "mentorz", "_type" : "users", "_id" : "555", "_source" : { "name" : "neeru", "user_id" : 555,"email_id" : "abc@gmail.com","followers" : 0, "following" : 0, "mentors" : 0, "mentees" : 0, "basic_info" : "api test info", "birth_date" : 1448451985397,"charge_price" : 0,"org" : "cz","located_in" : "noida", "position" :

javascript - How to check the value of the "value" attribute in an <input> element? -

i have following: <h1>request group rate</h1> <form> <input type="hidden" name="referrer" id="bmn"> name: <input type="text" id="fieldname" name="name"><br> group size: <input type="text" name="groupsize"><br> email: <input type="email" name="email"><br> <input type="submit" value="submit"> </form> <script> $(document).ready(function(){ $('input[name="referrer"]').val(document.referrer); $(document.body).append('<div id="ready"></div>'); }); </script> after navigating page using selenium: driver.findelement(by.id('requestgrouprate')).click(); driver.sleep(100); driver.wait(function(){ return

how to achieve parallelism in Azure Stream Analytics -

if understanding right, 1 stream analytic jobs's instance runs @ time. , after finishes current set of events, next set of events pulled event hub. if sequential. if processing takes 20 milliseconds, other events have wait many milliseconds. wondering if sequential operation sufficient in production load? i aware of partitionby clause, since using iot hub, cannot use partitionid/ partitionkey. thanks in advance all messages same deviceid sent same partitionid. if query ever looks @ 1 deviceid @ time, can still use partitionid , process each partition independently. examples of queries select, filter queries , aggregates include deviceid in key. if queries @ multiple deviceids @ time (for example, counting total number of messages in window), have 2 options. can partial aggregates first in parallel , combine them global aggregate. or use query without partition by. also, azure stream analytics not messages 1 one incur kind of delays mentioned in question.

stanford nlp - Corenlp Coreference resolution using neural network puts mentions with different gender in the same cluster -

Image
why corenlp coreference using neural network put mentions different gender in same cluster? shouldn't discard mentions gender don't match? sample text: trump won general election on november 8, 2016, in surprise victory against democratic candidate hillary clinton. became oldest , wealthiest person ever assume presidency, first without prior military or government service, , fifth have won election despite losing popular vote. election , policies have sparked numerous protests.

android - getting exception while running these code how to resolve -

this question has answer here: android.content.res.resources$notfoundexception 2 answers unfortunately myapp has stopped. how can solve this? 14 answers here adding 2 numers reading values edittext throws exetion how resolve . seems correct. please me package com.example.centum.addition1; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast; import static android.app.pendingintent.getactivity; import static android.widget.toast.length_long; import static com.example.centum.addition1.r.id.et1; import static com.example.centum.addition1.r.id.et2; public class mainactivity extends appcompatactivity {

r - Loop the dataframe to create igraph -

i have data frame, edge list r/igraph: node_one node_two weight group 1 2 1 175221 3 4 1 175221 5 6 1 175221 7 8 1 175221 9 10 1 576546 11 12 2 576546 13 14 2 576546 15 16 2 789535 17 18 2 789535 19 20 2 789535 i want loop through df according different value of hee_provn1, create multiple graphs , graph measures. my code here: # install packages library(dplyr) library(igraph) df <- data.frame(node_one=seq(1,19,2), node_two=seq(2,20,2), weight = c(rep(2,5),rep(2,5)), group=c(rep(175221,4),rep(576546,3),rep(789535,3))) final.df1 <- c() for(x in unique(df$group)){ df2 <- subset(df, subset = group == x) # create graph g <- graph_from_data_frame(df2, directed=false) d = degree(g) # number of vertex's adjacent edges c = closen

xml - The reference to entity "F" must end with the ';' delimiter. [replacing & with &amp; did not solve the issue] -

var url = 'http://stockcharts.com/def/servlet/sc.scan?s=tsal[t.t_eq_s]![t.e_eq_n]![t.e_ne_o]![as0,20,tv_gt_40000]![th0_gt_am1,253,th]&report=predefall'; var text = urlfetchapp.fetch(url).getcontenttext(); var xml = xmlservice.parse(text); any ideas why error message mentioned in title? have replaced '&' '& amp;' in 'url'. suspect might '[', ']' and/or '!' causing problem. have read through other posts on type of problem, unable crack problem myself - hope can me. update input michael kay went , read more posts - in particular these: character encoding issue when using google apps script extract data web page what best way parse html in google apps script -and decided go more simple solution (because need symbols webpage). code ended looking this: var url = 'http://stockcharts.com/def/servlet/sc.scan?s=tsal[t.t_eq_s]![t.e_eq_n]![t.e_ne_o]![as0,20,tv_gt_40000]![th0_gt_am1,253,th]&repor

python - 'DataFrame' object has no attribute 'col_name' -

i read csv file using x = pd.read_table('path csv') and can see row-wise comma-separated list of data values on printing x fine. when try access column using x.col1, gives error : **attributeerror: 'dataframe' object has no attribute 'col1'** i tried doing : y = dataframe(x) and retrieve column via y no luck. however, command x.columns works. can't figure problem here. please help!! i think read_table have default separator tab, necessary define separator parameter: x = pd.read_table('path csv', sep=',') or use read_csv default separator , , sep : can omit. x = pd.read_csv('path csv')

powershell - Create desktop image to quickly identify a Server's purpose -

this background story think ask applicable wider scenarios: i'm working on building deployment pipeline aws. aws instance id of vm , once login on desktop annotated text not useful. ec2 instance (vm) annotated tags express purpose each vm, somehow visualize information when loged in on server. i'm not ops guy , i'm not used having many remote desktops open , remembering each does. big identifiable visible notation lot in opinion. i've though couple of options focus on setting desktop wallpaper. when os windows server, use bginfo render text. convert tags text , use bginfo. output not distinguishable find api express concepts components or purpose , render picture. can't find one. use 1 of funny picture renders, text added on picture's placeholder. distinguishable kind of limited regards information density. example picture . i've thought generating badges example shields.io , combine them 1 image. i or better better aesthetics, creates cou

zxing - Android BarcodeScanner with Trigger -

i have written first barcodescanner zxing. pretty simple have requirement simple app not meet , don't know how or if possible. current app camera of smartphone opened begins scan. want app start scanning when press shutter button. camera should open, can aim barcode. is there possibility kind of behaviour xzing or other lib ?

c++ - How to test compiled DLLs in Visual Studio (or produce several executables)? -

i'm developing shared library needs tested , profiled regularly. main target platform linux (generally) our team chose autotools (auto[scan,conf,make] + libtool + pkg-config) buildsystem. client decided wants software on windows too. added visual studio solution. library compiles, links , works on windows too, though development cycle lacks proper testing on windows. i'm using automake's test suits on linux , test this: make check -j2 which compiles 10 executables (client server pairs) linked library (which built on same buildsystem) , runs them (in pairs, ordered). output is: make[3]: entering directory 'somefakepath/libfoo/test' pass: tcp_client pass: tcp_server pass: tcp_client_control pass: tcp_server_control pass: udp_client pass: udp_server pass: udp_client_raw pass: udp_server_raw skip: udp_client_rtp skip: udp_server_rtp ======================================================== testsuite summary libfoo 5.0.1 ======================================

Can't seem to understand what HW is asking for C++ class -

you cannot evaluate value or expression truth or falsity because determined keywords true , false. a.true b.false at first, picked true thought maybe false since can assigned true or false still unsure of asking. the answer question is: b. false. can evaluate values , expressions else other true or false . expression not " determined keywords true , false " boolean literals . expression can of: integral, floating-point, unscoped enumeration, pointer, , pointer-to-member types and can converted value of bool means of boolean conversion . think question can translated to: "must values , expressions in conditions of type bool ?". , answer no .

javascript - How to maintain state of file field in ExtJs -

Image
i have file upload control using uploading image file on server. in operation going submitting form 2 times. issue after submitting form first time file upload filed giving value null @ second submit. lets see code below. this.userphoto = new ext.create('ext.form.field.file', { xtype: 'filefield', padding: '5 5 5', cls: 'p-photo-upload', emptytext: 'photo', buttononly: true, fieldlabel: fleet.language.get('_fleet_user_userdetail_photo_'), name: 'photo', labelwidth: 200, width: '26%', msgtarget: 'under', listeners: { scope: this, change: function (t, value) { var data = {}; data.userphoto = t.value; data.imagetype = 'userphoto'; var postdata = ext.encode(data); postdata = base64.encode(postdata);

android - Apache Cordova on WIFI Hotspot with Terms of Use -

we have cordova based application used wifi hotspot first have agree terms of use before can use hotspot. android recognizes , asks first accept terms of use. is there way can within cordova app try download configuration on startup , without agreement app fails so.

python 2.7 - Installing software in home directory instead of /usr/bin/ in a server -

i'm running python codes in server have been connected via ssh. however, update/install few external libraries python. since not sudo user, not able usual pip install .... as error, example when tried installing pyfits : error: not create '/usr/lib64/python2.7/site-packages/pyfits': permission denied now, there 2 questions, have been trying find answers for: how update/install new libraries in home directory instead of default /usr/bin/..../ ? how make software (python in case) understand have installed new library in home directory ? to install modules in home directory - pip install --user $package_name should trick. install package in $home/.local/bin/$package , rest of package in $home/.local/lib/pythonx/site-packages/.