Posts

Showing posts from February, 2010

python - Optimizing dataframe manipulation: new column based on conditional logic and multiple columns -

currently, works: df['new'] = df.apply( \ lambda x: address[int(x['c1'][:5], 2)]+'_'+str(int(x['c1'][6:11], 2)) \ if x['c1'][5] == '1' \ else address[int(x['c2'][:5], 2)]+'_'+str(int(x['c2'][6:11], 2)), axis=1) ` address dictionary. but it's really slow . specifically, apply ing whole dataframe considerably slower apply ing selected column. however, new column based on multiple columns , i'm not sure how implement that. additionally, there way vectorize these types of logical/conditional statements? sample dataframe: <bound method dataframe.head of c1 c2 0 0000100111000111 0010110011000111 1 0001000111000111 0010110011000111 2 0101010001001010 0000000000000000 3 0101010010001110 0000000000000000 4 0101010011101010 0000000000000000 5 0111111100000100 0000000000000000 6 0111110010010110 000000

html - How do I make multiple buttons and checkboxes moved through css interactable? -

i have page checkmark , 2 buttons. when move them through css cant interact them longer, have solved through using z-index: 1; , this: <div style="position: relative; bottom: +95; z-index: 1;"> <button name="" value="">bypass</button> <button name="open" value="n">bypass</button> </div> but when add checkbox under these buttons this: <div style="position: relative; bottom: +115px; font-size: 13px; margin-left: -435px;">1: <input type="checkbox" name="one" value="yes"></div> i can't interact it. i have tried adding z-index: 2; this: <div style="position: relative; bottom: +115px; font-size: 13px; margin-left: -435px; z-index: 2;">1: <input type="checkbox" name="one" value="yes"></div> which makes checkbox interactable, makes buttons un-interactable. how can make bot

php - Trying to get property of non-object in Laravel 5 after upgrade -

i created first laravel package out of old php script teamspeak auth service. main app running laravel 4, has been upgraded laravel 5. package worked before, not. the error - [2017-08-17 22:04:29] local.error: errorexception: trying property of non-object in /apppath/vendor/eveseat/services/src/settings/settings.php:86 stack trace: #0 /apppath/vendor/eveseat/services/src/settings/settings.php(86): illuminate\foundation\bootstrap\handleexceptions->handleerror(8, 'trying p...', '/apppath/$ #1 /apppath/vendor/laravel/framework/src/illuminate/cache/repository.php(349): seat\services\settings\settings::seat\services\settings\{closure}() #2 /apppath/vendor/laravel/framework/src/illuminate/cache/cachemanager.php(301): illuminate\cache\repository->rememberforever('thkt2r21aa1vlkh...', object(closure)) #3 /apppath/bootstrap/cache/compiled.php(6468): illuminate\cache\cachemanager->__call('rememberforever', array) #4 /apppath/vendor/eveseat/services/sr

r - odd behavior of print within mapply -

i seeing unexpected behavior (to me anyway) when print() included side effect in function wrapped in mapply() . for example, works expected (and yes know it's not how add vectors): mapply(function(i,j) i+j, i=1:3, j=4:6) # returns [1] 5 7 9 and this: mapply(function(i,j) paste(i, "plus", j, "equals", i+j), i=1:3, j=4:6) # returns [1] "1 plus 4 equals 5" "2 plus 5 equals 7" "3 plus 6 equals 9" but doesn't: mapply(function(i,j) print(paste(i, "plus", j, "equals", i+j)), i=1:3, j=4:6) # returns: # [1] "1 plus 4 equals 5" # [1] "2 plus 5 equals 7" # [1] "3 plus 6 equals 9" # [1] "1 plus 4 equals 5" "2 plus 5 equals 7" "3 plus 6 equals 9" what's going on here? haven't used mapply() in while, maybe no-brainer... i'm using r version 3.4.0. print both prints argument , returns value. p <- print("abc")

javascript - Return Input from Custom Popup -

i working on custom modal popup entity. when need text value user, make html element visible, need value enter in text field when press "enter" button. the problem i'm trying doesn't seem have easy implementation. don't think it's possible without promises, , attempts far have not worked. ideas on possible solutions? turns out managed myself. had assumed promise somehow end when reached end of code, not true: continue when resolve manually. therefore when set onclick of button possibility of resolving it, wait button pressed. see code sample below: var modalpopup() = function() { //display popup document.getelementbyid("generalmodalbackground").style.display = "flex"; return new promise(function(resolve, reject) { document.getelementbyid("generalsubmitbutton").onclick = function() { //when clicked, resolve promise inputted value let returnval = document.getelementbyid("generaltextfield&

osx - Python- Google voice -

i trying use http://sphinxdoc.github.io/pygooglevoice/examples.html#send-sms-messages , getting error file "build/bdist.macosx-10.6-intel/egg/googlevoice/voice.py", line 72, in login attributeerror: 'nonetype' object has no attribute 'group' my code is: from googlevoice import voice googlevoice.util import input import sys username, password = "email@gmail.com", "password" voice = voice() voice.login(username, password) phonenumber = input('number send message to: ') text = input('message text: ') voice.send_sms(phonenumber, text) i wondering if login error or error in code? if so, how can edit code works? thank much! edit: have been researching , apparently it's common problem , have change line 72 in file voice.py can't find file: /usr/local/lib/python2.7/dist-packages/googlevoice/voice.py to install, did: $ pip install python python-setuptools $ sudo easy_install simplejson $ sudo easy_in

android - notifyDataSetChanged() for Adapter on custom searchview -

i have customized searchview based on this library , use following method delete suggestions: public synchronized void removesuggestion(string suggestion) { if (!textutils.isempty(suggestion)) { mcontext.getcontentresolver().delete( historycontract.historyentry.content_uri, historycontract.historyentry.table_name + "." + historycontract.historyentry.column_query + " = ? , " + historycontract.historyentry.table_name + "." + historycontract.historyentry.column_is_history + " = ?" , new string[]{suggestion,string.valueof(0)} ); } madapter.notifydatasetchanged(); //don't works } it works. however, have notifydatasetchanged() adapter in order remove suggestions list right after h

javascript - Call method of parent when child is dynamically inserted -

i have "modal" component , element dynamically insert "childs" on modal. how call method of parent element child of modal: class parent extends component { constructor(props) { super(props); this.state = { 'view_addevent': false, }; this.addeventadhoc = this.addeventadhoc.bind(this); this.closeeventadhoc = this.closeeventadhoc.bind(this); this.searchadhocevent = this.searchadhocevent(this); } addeventadhoc() { this.setstate({ view_addevent: true }); } closeeventadhoc() { this.setstate({ view_addevent: false }) } searchadhocevent(event) { console.log(event.keycode); } render() { return ( <main id='main-content'> <modal show={this.state.view_addevent} autocomplete={ this.searchadhocevent } close={ this.closeeventadhoc }> <div classname='form-group&#

windows - Use MSBuild to build ASP.Net project targeting .Net 4.0 on Server 2016 -

Image
i have jenkins build server set on windows server 2016. have 'build tools visual studio 2017' (latest version of msbuild) installed. when try build project targeting .net 4.0 error message: c:\program files (x86)\microsoft visual studio\2017\buildtools\msbuild\15.0\bin\microsoft.common.currentversion.targets(1122,5): error msb3644: reference assemblies framework ".netframework,version=v4.0" not found. resolve this, install sdk or targeting pack framework version or retarget application version of framework have sdk or targeting pack installed. note assemblies resolved global assembly cache (gac) , used in place of reference assemblies. therefore assembly may not correctly targeted framework intend. so check 'c:\program files (x86)\reference assemblies\microsoft\framework.netframework\v4.0' , find that, sure enough, there no dlls in folder, xml files. so try install full .net 4.0 framework thinking install reference assemblies these messages:

javascript - Combining objects in an array with same key (date) -

i have array of objects , want combine objects have same date values have array like. looping through them .map(i => ) , chekcing on previous index i'm getting wrong values. [{ id: '8', name: 'hfh', consumed_date: '2017-03-14', calories: 8952 }, { id: '7', name: 'onion', consumed_date: '2017-03-14', calories: 224}, { id: '6', name: 'onion', consumed_date: '2017-03-14', calories: 279}, { id: '2', name: 'ready-to-serve chocolate drink', consumed_date: '2017-01-01', calories: 3036} ] and want end array like [{date: 2017-03-14, calories: 9455}, date: 2017-01-01, calories: 3036}] reduce perfect situations this: need "loop" through items don't want straight-forward "a => modify(a)"-like behavior of map , rather need reduce or collapse several values else (in case both input , output array of values reduce

python - How to skip over line throwing exception when debugging -

Image
# process_with_huge_time_overhead() list_a = [1,2,3] print(list_a[3]) # process_with_huge_time_overhead() new_data = [5,6,7] list_a += new_data after reaching line in ipdb (invoked via python -m ipdb script.py ), exception thrown: indexerror how can 1 continue debug , jump around without going through overhead of getting point again ? if jump line 62 , use n command execute next line, doesn't work. every n continues exit program. you cannot without changing program. the debugger follows code execution. if error thrown, debugger continue following programs flow of error handling. if error not handled you, crash issued. expected behavior , debugger follow it.

event handling - DDD: How to solve this using Domain-Driven design? -

i'm new ddd , cutting teeth on following exercise. use case real, attempt solve ddd purely learning. we have multiple git repos, each containing file call product spec. system needs respond http post cloning repos, , update product spec in match information in post body. system needs log post request cause updating product spec. i'd use aggregates , event sourcing solving problem because seem fit. event sourcing comes automatic persistence of commands, if convert post body command, auditing free. problem is, post may match multiple product spec. i'm not sure how deal that. should create domain service, let find matching product spec , issue update command each? or should have aggregate root so? if using aggregate root update multiple entities, needs entity, in problem domain? the first comment question right (the 1 of @voiceofunreason ): 'is side effect coordination'. try answer question: how solve using ddd / event sourcing: the firs

How to configure imagePullPolicy from fabric8-maven-plugin -

context: i'm using fabric8-maven-plugin generate docker image , deploy kubernetes cluster. question: it's possible configure imagepullpolicy parameter default value ifnotpresent ? current configuration in pom.xml <build> <plugins> <plugin> <groupid>io.fabric8</groupid> <artifactid>fabric8-maven-plugin</artifactid> <version>3.5.25</version> <configuration> <images> <image> <name>my-service</name> <alias>service</alias> <build> <from>java:8</from> <tags> <tag>latest</tag> <tag>${project.version}</tag> </tags&g

python - Why is issubclass(dict, collections.Mapping) true in CPython? -

in cpython following import collections issubclass(dict, collections.mapping) returns true . confuses me bit, since dict builtin class defined in ctypes , collections module explicitly relies on existence of dict accomplish of functionality. other straightforward inheritance checks must going on , can't figure out why works. below provide of reasoning leads confusion. if @ inheritance structure of collections.mapping see inherits collection . collection 's signature shows inherits sized , iterable , container of inherit metaclass abcmeta . but dict builtin, thought meant being defined directly ctype thought meant wouldn't inheriting anything. so, why issubclass(dict, collections.mapping) → true ? for more context why came see this nbformat issue , in in attempting recreate signature & functionality of dict 's update need know how issubclass(foo, mapping) behave. that's because metaclasses can customize issubclass , isinstan

export - How to import products with price lists, warehouses, locations, vendor,...etc in Odoo 10 -

i have 2 databases. 1 have products, warehouses , related information. i want export them , import new database. got errors when import, please check it no matching record found external id '__export__.product_pricelist_item_7' in field 'pricelist items' between rows 2 , 10 possible values no matching record found external id '__export__.stock_location_44' in field 'production location' between rows 2 , 10 possible values no matching record found external id 'l10n_vn.1_tax_purchase_vat10' in field 'vendor taxes' between rows 2 , 10 possible values no matching record found external id '__export__.stock_location_45' in field 'inventory location' between rows 2 , 10 possible values no matching record found external id '__export__.product_product_53' in field 'products' between rows 2 , 10 possible values no matching record found external id 'l10n_vn.1_tax_sale_vat10' in field 'customer taxe

html - How to get display width of inline-block fieldset from javascript -

if have fieldset display: inline-block, has width dependent on contained element. can see it, assuming: <fieldset id='fs' style='display: inline-block'> <input type=number> </fieldset> <script> var fs=document.getelementbyid("fs"); console.log("fs.width:",fs.width); </script> the output be: fs.width: undefined after trying lot of things able this: <script> var fs=document.getelementbyid("fs"); var fsrects=fs.getclientrects(); var fswidth=fsrects[0].right-fsrects[0].left; console.log("fswidth:",fswidth); </script> and output is fswidth: 98.6640625 there must easier way! help!!! you looking offsetwidth . the htmlelement.offsetwidth read-only property returns layout width of element. typically, element's offsetwidth measurement includes element borders, element horizontal padding, element vertical scrollbar (if present, if rendered) , eleme

python - Returning multiple variables from a single list -

using python 3 this basic i'm sure. code used return country, country code provided. need first 2 letters of input given. the code i've worked far output first "country code" def get_country_codes(prices): c = prices.split(',') char in c: return char[:2] print(get_country_codes("nz$300, kr$1200, dk$5")) output: nz wanted output: nz, kr, dk def get_country_codes(prices): values = [] price_codes = prices.split(',') price_code in price_codes: values.append(price_code.strip()[0:2]) return values print(get_country_codes("nz$300, kr$1200, dk$5")) basically method returning first value split list. you need iterate on split list , save each value in list , return that. another approach: country_price_values = "nz$300, kr$1200, dk$5" country_codes = [val.strip()[0:2] val in country_price_values.split(',')]

sas - macro references execution in call execute -

sas documentation says macro references in call execute executed immediately. code exemplify it? %let var = abc; data _null_; call execute ('&var'); run; sort of. here more complete example using value of macro variable actual executable sas code. data _null_; call symputx('var','data;run;'); run; %put var= %superq(var); data _null_; call execute ('&var'); run; you can see in sas log code call execute() pushed onto stack run value of macro variable though single quotes prevent macro variable expanding during data _null_ step using call execute() statement. note: call execute generated line. 1 + data;run;

recommendation engine - Good similarity measure for comparing users -

i want compare users based on responses 10 questions. original idea resolve each question integer [1, 5], idea won't work time. example: vec1 = [1,1,1,1,1,1,1,1,1,1] vec2 = [5,5,5,5,5,5,5,5,5,5] get_cos_sim(vec1, vec2) = 1 so though users responded dissimilarly, vectors same. i similar users based on similarity of responses each question. given question, if person a's response resolved 1 , person b's response resolved 2, similarity between responses in questions higher person a's , person c's response, answered 4. here's metric use: take absolute value of difference between each answer, sum of values, similarity inverse.

javascript - Dynamically loading a content in <div> no longer working jquery. Raw new line deprecated -

i trying dynamically load html content in <div> var fsearch = function(event) { event.preventdefault(); $.post("index.php/employee/search").done(function(res) { alert(res); $("#emp_list").load(res); }); }; $("#search_box").submit(fsearch); i running on chrome. seems no longer possible. console says [deprecation] resource requests urls contain raw newline characters deprecated, , may blocked in m60, around august 2017. please remove newlines places element attribute values in order continue loading resources. see https://www.chromestatus.com/features/5735596811091968 more details. i using codeigniter development is there way on how achieve objective?

javascript - Putting another array as property into another array failed -

tried play spread of es6, didn't quite right const arr1 = [{ gap: 10 }, { gap: 20 }, { gap: 30 }] const arr2 = [{ english: null }, { france: null }] how can produce new array, arr2 's property become apart of arr1 ? from jsfiddle: //expected new_arr /*[{ gap: 10, english: null, france: null }, { gap: 20, english: null, france: null }, { gap: 30, english: null, france: null }]*/ failed attempt https://jsfiddle.net/swu94gd5/ you want const arr1 = [{ gap: 10 }, { gap: 20 }, { gap: 30 }] const arr2 = [{ english: null }, { france: null }] const new_arr = arr1.map(obj => object.assign({}, obj, ...arr2)); console.log(new_arr); note: i had const new_arr = arr1.map(obj => object.assign(obj, ...arr2)); but changing arr1[0].gap change new_arr[0].gap - code in snippet fixes that re comment can explain ur definition of object assign in ur head? i don't have definition in he

prometheus - How to stop a server over a particular period of time in python -

logfile = '/testprometheus/pushgateway.log' formatter = logging.formatter('%(asctime)s %(levelname)s %(message)s') hdlr = logging.handlers.rotatingfilehandler(logfile,mode='a', maxbytes=5*1024*1024, backupcount=2, encoding=none, delay=0) hdlr.setformatter(formatter) hdlr.setlevel(logging.info) logger = logging.getlogger('pushgateway') logger.setlevel(logging.info) logger.addhandler(hdlr) global alertlistsend class prometheusalert(basehttprequesthandler): def do_post(self): try: self.send_response(200) self.end_headers() data = self.rfile.read(int(self.headers['content-length'])) alertlist = json.loads(data) logger.info(alertlistsend) alertlistriggered=[] item,alertvalue in enumerate (alertlist): labels = alertvalue["labels"] name = str(labels["

c++ - How to read the last text message sent to the buffer(stored in SIM card)-Arduino -

i'm using fona 3g (sim5320e) arduino mega 2560. i have buffer store text messages (sms) - char replybuffer [255] . i'm sending 10-digit phone number occupying 10 bytes in replybuffer per text message. suppose, have sent 5 text messages sim card , of them stored in replybuffer . how can read last 10-digit number or last text message in buffer can send sms last mobile number rather 1st mobile number done currently? // setup routine runs once when press reset: #include "adafruit_fona.h" #define fona_tx 11 #define fona_rx 12 #define fona_rst 9 // large buffer replies char replybuffer[255]; char buffer[50]; char r1[6];char r2[6]; // default using software serial. if want use hardware serial // (because softserial isnt supported) comment out following 3 lines // , uncomment hardwareserial line #include <softwareserial.h> softwareserial fonass = softwareserial(fona_tx,fona_rx); softwareserial *fonaserial = &fonass; // hardware serial possible! // ha

c++ - Virtual template functions: implementing the Visitor pattern with parameters -

i trying implement visitor pattern walking ast. have defined astnode can accept visitor , , allow visitor visit itself. example below contains 1 concrete implementation each of visitor , astnode. class astnode; template <class p, class r> class visitor { public: virtual ~visitor() {} virtual r visit(astnode& node, p p) const = 0; }; class astnode { public: virtual ~astnode() {} template <class p, class r> virtual r accept(visitor<r, p>& v, p p) { return v.visit(*this); } }; class roman : public astnode { public: roman(numeral n, optional<accidental> a) : numeral(n), alteration(a) {}; const numeral numeral; const optional<accidental> alteration; }; class tostringvisitor : public visitor<string, int> { virtual string visit(roman& node, int param) { string result = numeralstrings[node.numeral]; if (node.alteration.ha

c# - Exception Handling UWP -

i started write first program uwp (universal windows platform). c# , read try-catch block exceptions. have special structure in app , want advice best kind of exception handling. my setup follows: have page called mainpage method getinformation . have 2 classes, named getsetting , getconnection . getinformation of mainpage input user , send them getconnections . in method call getsetting (nested method). this structure. know error can happen in every part: user inputs not valid, or can't connection form systems, maybe can't access settings files, or other errors. i've added try-catch blocks each part of app (so in getinformation , getconnection , getsetting ). i read message dialog asynchronously method: if try add message dialog each part of application if there error in each 1 3 message dialog errors. don't want make app unclear adding task , await methods because 1 part of app. couldn't find way stop in application , force wait user input. stop

android - Error: - Execution failed for task ':app:transformClassesWithJarMergingForDebug' -

i getting error when try run app..below gradle file please me dependencies { // compile filetree(include: ['*.jar'], dir: 'libs') configurations { all*.exclude group: 'com.android.support', module: 'support-v4' } /*androidtestcompile('com.android.support:multidex-instrumentation:1.0.1') { exclude group: 'com.android.support', module: 'multidex' }*/ //compile 'io.jsonwebtoken:jjwt:0.6.0' compile files('libs/card.io.jar') compile files('libs/flurryanalytics-6.2.0.jar') compile files('libs/gradle-wrapper.jar') compile files('libs/jackson-core-asl-1.9.2.jar') compile files('libs/jackson-mapper-asl-1.9.2.jar') compile files('libs/okio-1.6.0.jar') compile files('libs/org.apache.http.legacy.jar') compile files('libs/paypalandroidsdk-2.13.1.jar') compile files('libs/quickblox-android-sdk-cha

react native 0.47 Network Error - info.plist not taken into account -

since updated network error issue due non secure call http when using command react-native run-ios. however, when run app through xcode, don't have error. any idea? here plist ios in react native app: <key>nsapptransportsecurity</key> <dict> <key>nsallowsarbitraryloads</key> <true/> <key>nsexceptiondomains</key> <dict> <key>localhost</key> <dict> <key>nstemporaryexceptionallowsinsecurehttploads</key> <true/> </dict> </dict> </dict>

swift3 - Not getting file URL from bundle -

Image
i loading pdf file in pdfview unable pdf file url bundle. please check below code : let pdfview = pdfview(frame: self.view.bounds) let myfilename = "sample" guard let url = bundle.main.url(forresource: myfilename, withextension: "pdf") else { return } pdfview.document = pdfdocument(url: url) self.view.addsubview(pdfview) every time getting nil in url . edit : here project window: am making silly mistake ? please guide me. thanks in advance. i got problem not sure it's in latest xcode in xcode 9.5(beta) while adding external file in project , select bundle target still not adding bundle. solution : you need click on file want add target bundle , check manually property window. please check below screen shot more detail. while adding file project have checked still not adding in selected target. now need check target , working expected. not sure bug or new update in latest xcode. but problem solved. tha

javascript - Get start of a given date using momentjs -

i trying start of , end of day. below code. var m = moment(new date('fri aug 8 2017 11:31:08 gmt+0530 (india standard time)')).startof('day') console.log(m); var n = moment(new date('fri aug 8 2017 11:31:08 gmt+0530 (india standard time)')).endof('day') console.log(n.format()); <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script> i tried moment(new date('fri aug 8 2017 11:31:08 gmt+0530 (india standard time)')).startof('date') nothing seems work. moment support functionality. it work latest version of moment. check snippet. also if want format time in ist can apply fixed utc offset , format date in desired format. var st = moment(new date('fri aug 8 2017 11:31:08 gmt+0530 (india standard time)')).startof('day').utcoffset("+05:30").format() console.log(st); var end = moment(new date(

Role of openstack running kubernetes -

i want understand role of openstack when kubernetes deployed on top of it. user able access underlying openstack layer in case? (i mean ask if user can create instances, networks , access other openstack resource)or user provided kubernetes offerings? link or answer help. don't seem find functionality part mentioned in guide. openstack's role in k8s world provide k8s instances , storage it's job, gce , azure. kubernetes tries abstract underlying cloud infrastructure applications can ported 1 cloud provider transparently. k8s achieves defining abstractions persistent volumes , persistent volume claims allowing pod define requirement storage without needing state requires cinder volume directly. there should no need access openstack directly kubernetes-based app unless app needs manage openstack cluster in case can provide openstack credentials app , access openstack api.

sql - How do I insert datetime value into a SQLite database? -

i trying insert datetime value sqlite database. seems sucsessful when try retrieve value there error: <unable read data> the sql statements are: create table mytable (name varchar(25), mydate datetime) insert mytable (name,mydate) values ('fred','jan 1 2009 13:22:15') the format need is: '2007-01-01 10:00:00' i.e. yyyy-mm-dd hh:mm:ss if possible, however, use parameterised query frees worrying formatting details.

digital ocean - How we can do load test on digitalocean with using gatling -

i want load test finding how many user can use system together.i using digitalocean droplet spring boot web application.when run test case on gatling , work 1000 user, digitalocean blocks ip , can not enter side on digitalocean. way true? should load test on my local computer ? if load test on local computer, how know work on same digitalocean. best way of using gatling load test?

c# - "Request is not available in this context" when debugging with Visual Studio 2017 -

i upgraded visual studio 2015 visual studio 2017. following code runs when deployed azure app services , when debug visual studio 2015. when debugging in visual studio 2017, throws exception: request not available in context for vs2015 , vs2017 iis express used debugging. vs2017 iis 10.0 express (10.0.1737) installed, not remember version used vs2015. the code c# based on asp.net 4.5.2 azure api app template. registers receiver subscribing events azure event hub. using system; using system.web.http; using system.web.http.cors; using system.configuration; using microsoft.azure.eventhubs; using microsoft.azure.eventhubs.processor; using microsoft.applicationinsights; using system.collections.generic; namespace .... public static class webapiconfig { public static void register(httpconfiguration config) { // web api configuration , services config.enablecors(); // web api routes config.maphttpattributer

How to identify pivot chart on an excel worksheet using VBA -

i'm creating excel dashboard in i've placed pivot chart , want govern visibility click of checkbox. i'm not able identify pivot chart object on worksheet , hence can't use code can other activex control label. e.g. can find label 'lblsales' in sheet object can't find 'pivotchartrc' name of pivot chart there anyway can that? private sub checkboxrc_click() if (checkboxresponsecurve.value) sheet1.lblsales.visible = true else sheet1.lblsales.visible = false end if end sub

How to add space before and after specific character using regex in Python? -

i have sentence: transportumum min kalo dari kota|tua | mau ke galeri nasional naik transjakarta jurusan apa ya? as see there 2 pipe character in sentence, add space before , after pipe if in middle of word without space. eg: kota|tua kota | tua this code far: def puncnorm(text): pat = re.compile(r"\d([|:])\d") text = pat.sub(" \\1 ", text) return text text = "transportumum min kalo dari kota|tua | mau ke galeri nasional naik transjakarta jurusan apa ya?" text = puncnorm(text) the result add space every pipe character. there double space in tua | mau : transportumum min kalo dari kota | tua | mau ke galeri nasional naik transjakarta jurusan apa ya? my expected result is: transportumum min kalo dari kota | tua | mau ke galeri nasional naik transjakarta jurusan apa ya? what best way solve this? the \d pattern matches char other digit. may use word boundary here make symbols match when inside word: r'\b([

c - [MiniFilter]Vendor ID and Produce ID in alphanumeric -

i have minifilter attaches usbs, vid , pid (in alphanumeric) of device attached. what have tried: i use ioctl_storge_query_property check usb , ioctl ascii strings vid , pid. i fltgetdiskdeviceobject device object , call iogetdeviceproperty(devicepropertyhardwareid) on device returns "storage\volume" not desire. iogetdeviceproperty(devicepropertyhardwareid) on fltgetdeviceobject says status_invalid_device_reques

TFS Build Destroy for 2013 to 2015 -

i need destroy build since deleting build not enough , use tfs build destroy . unfortunately cannot find in 2015 since works 2013 upon checking.. is there way make work 2015? i'm trying not resort tfsbuild commands. just dave said, if don't want resort tfsbuild commands, have build own extension. you can reference source code of tfs build destroy extension, try modify/debug build own extension. please refer below link source code: https://tfsbuilddestroy.codeplex.com/sourcecontrol/latest

p2p - How to get detail of given address from blockchain? -

i building blockchain explorer. have own blockchain. in that, want search details of given address blockchain. there no direct api detail of address, how ? in advance. two options: option 1: blockchain.info has open api (rest + json) https://blockchain.info/it/api/blockchain_api here how: https://blockchain.info/it/rawaddr/$bitcoin_address bear in mind can acquire info address moved @ least once bitcoin on network. if create new wallet , not transact public address non existent on blockchain (i.e. there's no difference between newly generated address , non existent address). that's "shameful" approach building blockchain explorer using blockchain explorer, see option 2 correct approach: option 2: run bitcoin node on own , query stuff on it. may not able run node on normal hosting, need more amazon aws instance or host on own server

spring boot - Logged out from Multiple applications for inactive user in oauth 2.0 -

i using spring boot , oauth2.0 jwt. polymer being used on client side. problem i working on requirement logout user of it's logged in applications if remains idle more 15 minutes in applications. if user active in single application, user should not logged out application has opened. solution i think solution above problem application on server should maintain expiry time user. whenever application becomes active i.e. accesses secured api on resource server, server application should update expiry date against user in list. should expose expiry date against user in rest api. the client application in polymer, should ping rest api after short intervals see if expiry time has reached. if yes, should logout , show logout screen client automatically. please share views , suggest.

node.js - Nodejs function parameters -

i watched online tutorial implementing restful api. used node js mysql database. i can't understand following function call: app.route('/users/{id}').get(users.readuserid) readuserid = function(req, res) { user.getoneuser(function(result) { res.json(result); }); }; getoneuser = function(userid, done) { db.get().query('select * users user_id = ?', userid, function (err, rows) { if (err) return done(err); done(rows); }); }; they in different files (thats why looks nested function call). thing don't understand getoneuser function takes 2 arguments. when readuserid calls it, readuserid inserts 1 argument. how work?

java - Vaadin 8 Checkbox Group select() doesn't work for array -

i have code creates checkboxgroup (based on vaadin 8 sampler): public void setpossibleanswers(list <string> answeroptions) { answercheckboxes = new checkboxgroup<>("", answersoptions); } i'm using method select given items in group: public void setanswer(string answer) { string[] answers = answer.split(","); answercheckboxes.select(answers); } but code selects first element of array. need select elements. body know mistake?

excel - Multi-Select ListBox contents to Range -

using vba have created userform various textboxes, comboboxes & listboxes. set once hit submit button ( commandbutton1 ), various boxes contents fill selected cell on sheet. private sub commandbutton1_click() sheets("sheet2").range("d4") = textbox1.text sheet2.cells(5, 4) = combobox2.text sheet2.cells(6, 4) = combobox1.text sheet2.cells(7, 4) = textbox2.text sheet2.cells(8, 4) = textbox4.text userform1.hide end sub i want contents of multiselect listbox same cells (9, 4) - (15, 4) example. how can this? options on multi select list box range insight, barracuda, siena, visio, project. you can iterate selected items of listbox , add them array. when have collected selected items, transfer range . example: private sub commandbutton1_click() ' code sheets("sheet2").range("c8") = textbox1.text sheets("sheet2").range("c12") = combobox2.text sheets("sheet2

forms - Dropzone - multiple instances get id -

i have multiple dropzone forms <form action="/upload" class="dropzone" id="group1"></form> <form action="/upload" class="dropzone" id="group2"></form> <form action="/upload" class="dropzone" id="group3"></form> how id of form file dropped into?

java - Jackson 2.8.9 @JsonPropertyOrder does not arrange field that is generated by @JsonTypeInfo when serializing XML -

i trying serialize , deserialize xml in following format: <home> <handle>300023</handle> <command>login</command> <content> <user_id>300023</user_id> <result>0</result> </content> </home> and try map following classes: @data @jacksonxmlrootelement(localname = "home") @jsonpropertyorder({"handle", "command", "content"}) public class home { private long handle; @jsontypeinfo( use = jsontypeinfo.id.name, include = jsontypeinfo.as.external_property, visible = true, property = "command") @jsonsubtypes({ @jsonsubtypes.type(value = logincontent.class, name = "login") }) private basecontent content; } and @data @jsonpropertyorder({ "user_id", "result"}) public class logincontent implements basecontent{ @jacksonxmlproperty(localname =

react native - How to navigate to different screen and get back to the screen from where its navigated using DrawerNavigator? -

i have 2 components (list , detail): list.js: export default class list extends react.component { render() { const {navigate} = this.props.navigation; return ( <view style={styles.container}> <text style={styles.headertext}>list of contents</text> <button onpress={()=> navigate('detail')} title="go details"/> </view> ) } } detail.js: export default class detail extends react.component { render() { return ( <view> <text style={styles.headertext}>details of content</text> </view> ) } } i have 2 screens (nowlist , soonlist) same type of list, using same list component both screen. , each of these screens want navigate details of item, in case has same type of layout using detail component both list items. finally, when app starts want nowlist screen

grid - Angular 2 - PrimeNG - dataTable Expand one row at a time -

in primeng - there way allow 1 row expanded @ time ? <p-datatable [value]="cars" expandablerows="true"> <p-column expander="true" styleclass="col-icon"></p-column> <p-column field="vin" header="vin"></p-column> <ng-template let-car ptemplate="rowexpansion"> ... </p-datatable> i can give clue how solve , hope work you. it not actual solution issue idea how solve this. using javascript in code. can convert angular way. <p-datatable expandablerows="true" (onrowexpand) = "onrowexpand($event)"> onrowexpand(data : any) { var d = document.getelementsbyclassname('fa fa-fw ui-c ui-row-toggler fa-chevron-circle-down'); if (d.length > 0) { (var = 0; < d.length; i++) { this.renderer.setelementstyle(d[i].parentelement.parent

android - Error: Gradle build with jenkins throws "Test run failed to complete. Expected 12 tests, received 4" -

i have 10 tests on instrumentation test case class. trying run them on installation using jenkins pipeline. if try on local system, works. but, on jenkins throws error. not sure problem occurs. stops after running 3 or 4 test cases , throws error received 4 or received 3. there way work around this? if works on local, shouldn't work on jenkins too? error log: > testcase003_pincorrectwithonewrongattempt[f8331 - 7.1.1] [32msuccess [0m 10:49:24.383 [debug] [org.gradle.launcher.daemon.server.daemon] daemonexpirationperiodiccheck running 10:49:24.384 [debug] [org.gradle.cache.internal.defaultfilelockmanager] waiting acquire shared lock on daemon addresses registry. 10:49:24.384 [debug] [org.gradle.cache.internal.defaultfilelockmanager] lock acquired. 10:49:24.386 [debug] [org.gradle.cache.internal.defaultfilelockmanager] releasing lock on daemon addresses registry. 10:50:01.608 [quiet] [system.out] 10:50:01 e/devicemonitor: adb connection error:eof 10:50:01.610 [quiet] [sys

iOS: DSCP value not set for SIP packet when IPv6 is enabled in linphone(2.4.0) over IPv4 network setup -

i using linphone iphone library voip calling in iphone application. have enabled ipv6 in linphone library , have set dscp (qos) value sip, audio , video packet in linphone. observed on ipv4 network, dscp value not set sip packet. application use tcp transport communication. kindly update me if solution.

histogram - Use hist() function in R to get percentages as opposed to raw frequencies -

how can 1 plot percentages opposed raw frequencies using hist() function in r? simply using freq=false argument not give histogram percentages, normalizes histogram total area equals 1. histogram of percentages of data set, x, do: h = hist(x) h$density = h$counts/sum(h$counts)*100 plot(h,freq=false) basically doing creating histogram object, changing density property percentages, , re-plotting.

ruby - Airborne::InvalidJsonError: Api request returned invalid json -

i'm getting below error while testing sample api in airborne ruby. airborne::invalidjsonerror: api request returned invalid json /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/airborne-0.2.13/lib/airborne/base.rb:73:in rescue in json_body /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/airborne-0.2.13/lib/airborne/base.rb:73:in json_body /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/airborne-0.2.13/lib/airborne/request_expectations.rb:139:in call_with_path /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/airborne-0.2.13/lib/airborne/request_expectations.rb:18:in expect_json ./postapinew_spec.rb:16:in block (2 levels) in ' -e:1:in `load' -e:1:in `' --- caused by: --- json::parsererror: 765: unexpected token @ '' /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/json-2.1.0/lib/json/common.rb:156:in `parse' code: require 'rspec' require 'airborne' require 'json' describe 'postapivalida

html - Can we apply tap-highlight-color to any other element except anchor tag? -

<!doctype html> <html> <head> <style type="text/css"> span { font-size: 40px; } .tap-color { -webkit-tap-highlight-color: blue; } </style> </head> <body> <span class="tap-color">hello</span> </body> </html> fiddle: http://202.63.105.91/tapcolor/ i'm trying apply tap-highlight-color other elements except anchor element. in application of clickable elements not anchor , want tap-highlight-color on them. kindly check code have tried far , let me know if possible. working example appreciated. thank in advance.

python - how can model: class1 or class2 have relation with class3 but both Simultaneous don't have relation? -

Image
i have 3 classes: class 1 has 1 many relation class 3; class 2 has 1 many relation class 3: class 1 , 2 not related. how can model database? option 1 set foreignkey field null if not needed. may validate in clean() method. class a(models.model): # ... pass class b(models.model): # ... pass class c(models.model): # ... fka = models.foreignkey(a, null=true) # null if not needed fkb = models.foreignkey(b, null=true) # null if not needed # ... def clean(self): # 1 fk allowed if self.fka , self.fkb: raise validationerror("relation either or b - not both!") # 1 fk required if not self.fka , not self.fkb: raise validationerror("relation or b required!") option 2 work model inheritance class a(models.model): # ... pass class b(models.model): # ... pass class abstractc(models.model): # ... class meta: # ...

yaml - Changing font size in Pandoc generated PDF document -

i'm trying change font size in pandoc generated pdf document using yaml. settings made in layout.yaml template below; --- title: "core concepts in mechanics" geometry: margin=3cm fontsize: 20pts output: pdf_document ... i call pandoc below pandoc --latex-engine=pdflatex -s -o coreconceptsinmechanics.pdf coreconceptsinmechanics.md layout.yaml the font size not change @ all. rest of settings work. doing wrong? the yaml metadata block supposed go @ top of markdown file. the standard latex document classes support 3 different font sizes, 10pt , 11pt , 12pt (note it's not 12pts ). if need larger fontsizes have specify different class, e.g. --- fontsize: 20pt documentclass: extreport ... # title doc finally, if want in 2 different files, order important afaik, should be: pandoc -o output.pdf layout.yaml coreconceptsinmechanics.md