Posts

Showing posts from June, 2012

android - Layout pushes up when keyboard popups -

whole layout pushes when keyboard pops up. xml file contains listview , below 2 buttons, when keyboard popups both listview , buttons pushes up. <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.athis.buy.homescreen"> <searchview android:layout_width="match_parent" android:layout_height="wrap_content" /> <listview android:id="@+id/list_item" android:layout_width="match_parent" android:layout_height="0dp" android:layout_margintop="10dp" android:layout_weight="8" android:divide...

neo4j - Importing relationships result in error message "Mixing specified and unspecified group belongings in a single import isn't supported -

i'm trying import ~10 million rows neo4j database. i'm able import nodes labels , takes less 5 seconds. however, when i'm trying import relationships it's failing. users.csv header id,"first_name","last_name","email","phone1","phone2","password",is_locked,"created_at","updated_at" roles.csv header "id","tenure_start","tenure_end" user_roles.csv header :start_id(user),:end_id(role) this command i'm using import: bin/neo4j-import --into data/databases/graph.db --multiline-fields=true \ --nodes:user import/users.csv \ --nodes:role import/roles.csv \ --relationships:has_role import/user_roles.csv as bruno , tom pointed out. structure must be users.csv id:id(user-id),"first_name","last_name","email","phone1","phone2","password",is_locked,"created_at","updat...

javascript - How to set table data as a variable in java that can be change dynamically? -

how can set table data variable in java, can change dynamically? here @ place of " o positive ", want set variable in java or javascript inside jsp page. so, table data keeps on updating dynamically. what ways it? settings.jsp <tr> <td class="text-left">o positive</td> <td class="text-left">o+, a+</td> <td class="text-left">o+</td> </tr> you can use kind of approach example the html <body data-customvalueone="${beanname.attrname}" data-customvaluetwo="${beanname.scndattrname}"> here regular page main content </body> the javascript <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script> <script type="text/javascript"> jquery(function(){ var valuepassedfromjsp = $("body").attr("data-customvalueone"); ...

excel - Cannot edit cells after touching combobox - I think i've encountered a bug -

so here building form in excel work ya, , make easy on eyes , fool proof removed 90% of ui. on form put activex combo boxes. perfect, , tried edit cell after entered in data in combo box, low woes couldnt. it seemed touching combo box locked every other cell in form. flabbergasted did experimenting , found way isolate issue. created test environment error(doc linked below). when ui removed clicking combobox locks other cells. when ui there, no issue happens. furthermore seems formula bar being disabled cause. is bug, programming error, or else. i'm @ total lost , appreciate help. my test file, how want try it when in edit mode shift+esc hide ui, when hidden hold shift+ctrl type edit bring ui.

xcode - When i build and run my app i don't have any problems, but when i archive i have error -

my parameters are library setup method: cocoapods library: https://github.com/evgenyneu/auk version of library: 7.0 xcode version. example: 8.3.3 os version: ios 9.0 my podfile is platform :ios, '9.0' use_frameworks! target 'myappname' pod 'alamofire', '> 4.0' pod 'paypal-ios-sdk', '> 2.12.0' pod 'moa', '> 8.0' pod 'auk', '> 7.0' pod 'azsclient' end when build , run app in iphone, don't have problems, when try archive solutions submit in itunes connect have various error: value of type 'uiscrollview' has no member 'auk' use of unresolved identifier 'moa' i tried remove library podfile , install carthage, have same result. can me as suspected, workaround has serious downside: setting strip linked product setting no creates archive not validate when uploaded itunes connect validation apple. got message saying binary had issues: non-p...

failure to connect to Google SQL First gen (and Second gen?) -

i receiving error when trying load webpage failed connect mysql: (2005) unknown mysql server host ':/cloudsql/testsite:europe-west1:testdatabase' (2)error: i have google compute engine vm set lamp stack (apache/2.4.10 (debian)/ database client version: libmysql - 5.5.55 / php extension: mysqli) i have set instance on google sql user credentials aforementioned vm (i have set both first gen , second gen) i can access both local mysql database on vm google sql databases via phpadmin installed locally however appear have issue db_host credentials in config.php file when run script path = /var/www/html/includes/config.php i usually local mysql databases use // mysql credentials $conf['host'] = 'localhost'; $conf['user'] = 'yourdbuser'; $conf['pass'] = 'yourdbpass'; $conf['name'] = 'yourdbname'; documentation (and github links) recommend path :/cloudsql/project-id:region:sql-db-instance-na...

asp.net mvc - Partial view inside main view + save to DB -

Image
i making site entering metadata. on first tab (css tabs) have few dropdowns , after make choices, second tab unlocked. right second tab empty, , contend supposed go there, have put in view. looks this. now, want achieve - when open second tab view in second picture should shown, loaded @html.partial. so, after make choices in first tab, select 1 of items in list in second tab, , written text in editor, of should saved db. here controller action list in second tab: public actionresult asdf() { list<sims_test> = new list<sims_test>(); using (userscontext dc = new userscontext()) { var languageid = thread.currentthread.currentuiculture.name; if (languageid == "en-us") { = dc.sims_test.where(s => s.languageid == "en-us").orderby(a => a.id).tolist(); } else { = dc.sims_test.where(s => s.languageid == ...

c++ - Is pass-by-value/reference defined implementation or behavior wise? -

q: pass-by-value/reference defined strictly behavior or implementation wise in c++, , can provide authoritative citation? i had conversion friend pass-by-value/reference in c++. came disagreement on definition of pass-by-value/reference. understand passing pointer function still pass-by-value since value of pointer copied, , copy used in function. subsequently, dereferencing pointer in function , mutating modify original variable. disagreement appears. his stance: because pointer value copied , passed function, performing operations on dereferenced pointer has ability affect original variable, has behavior of pass-by-reference, passing pointer function. my stance: passing pointer function copy value of pointer, , operations in function may affect original variable; however, because may affect original, behavior not constitute pass-by-reference since implementation of language defines these terms, pass-by-value/reference. quoting definition given highest voted answer here...

parallel processing - When can an application be catalogued as MPMD? -

i understand when execute 2 different binaries working in same problem have multiple program multiple data application. what's difference between , binary assigning different work processes depending on rank (using if-else discriminate)? from faq of open-mpi: ...mpirun , mpiexec commands support multiple program, multiple data (mpmd) style launches, either command line... launch single parallel application, first 2 processes instances of a.out executable, , second 2 processes instances of b.out executable. in mpi terms, a single mpi_comm_world , but a.out processes ranks 0 , 1 in mpi_comm_world, while b.out processes ranks 2 , 3 in mpi_comm_world . even wikipedia cannot still make mind: single program, multiple data streams (spmd) multiple autonomous processors simultaneously executing same program (but @ independent points, rather in lockstep simd imposes) on different data ... multiple programs, multiple data streams (mpmd) mul...

javascript - Search bar works with values typed or clicked by user -

i'm trying have search bar 2 behaviors: user enters values search bar user can click on elements several lists case 1. working fine. case 2. right now, user needs hit enter validate search. display results value entered input field, user doesn't have hit enter. any on appreciated. thanks! below code: function recherche(){ var search = $('#search').val(); if(search.length < 1) { return null; }; var results = json.filter(function (el) { var s = search.tolowercase().split(" "); (var key in el) { (var i=0; < s.length; i++) { if (el[key].tolowercase().indexof(s[i]) != -1) { s.splice(i,1); i--; if (!s.length) return true; } } } return false; }); displaysearchresults(results); }; var items = document.getelementbyid("filter"); var item = items.getelementsbytagname("li"); for(var i=0; i<item.length; i++) { item[i].addeventlisten...

Getting response data as "Authentication credentials were not provided" in jmeter -

i'm trying automate 1 scenario after logging in. have created 1 http request login , action scenario. first http request working fine , i'm able login application, when coming second http request showing response "authentication credentials not provided". please provide reference. after login application api token generated. need use further actions. after login application response data , verify authentication token. keep regrex extractor , copy api token , keep in request data. let me know if have queries.

linux - Remove Duplicate Dependencies in Maven Pom -

i remove duplicate dependencies in maven pom.xml. i answers multiple tools linux, notepad++, netbeans, intellij ...even...vim,etc. example (i can obvious delete search replace answer) `<dependency> <groupid>org.glassfish.jersey.core</groupid> <artifactid>jersey-server</artifactid> <version>2.7</version> </dependency> <dependency> <groupid>org.glassfish.jersey.containers</groupid> <artifactid>jersey-container-servlet-core</artifactid> <version>2.7</version> </dependency> <dependency> <groupid>org.glassfish.jersey.containers</groupid> <artifactid>jersey-container-jetty-http</artifactid> <version>2.7</version> </dependency> <dependency> <groupid>org.glassfish.jersey.media</groupid> <artifactid>jersey-m...

ruby on rails - Rails5 - Undefined local variable but it's global -

i getting following error in rails: undefined local variable or method `current_user' #<usercontroller:0x0000000458d708> did mean? @current_user the code fragment corresponding error is: authorize @current_user as can see, mean @current_user error message suggests, , use @current_user error message suggests. why rails thinking mean local unexisting variable when expect global? authorize method pundit . i added print statement verify if global variable exists, , following code prints out valid user: p @current_user authorize @current_user to use pundit, must define current_user (or pundit_user ): https://github.com/elabs/pundit/blob/master/lib/pundit.rb#l270 when authorize @current_user , assuring current_user can perform actions on @current_user using userpolicy .

node.js - Optimal method(s) for installing select devDependencies using Heroku -

i curious know preferred method(s) installing select devdependencies using heroku. by default, heroku does not install devdependencies ; can enabled changing config: heroku config:set npm_config_production=false however, heroku docs recommend against this: since don’t want development dependencies in production builds, it’s preferable move dependencies need production builds (bower, grunt, gulp, etc) dependencies. i argue listing devdependencies in dependencies appears messy, package.json contains "duplicate" modules, eg: dependencies: { "eslint-config-airbnb": "14.1.0", "eslint-plugin-react": "6.10.3", }, devdependencies: { "eslint-config-airbnb": "14.1.0", "eslint-plugin-react": "6.10.3", } while pre/post build steps can taken , possible tell heroku install select devdependencies ?

testing - How do I test Chrome Extension/Firefox WebExtension code? -

since firefox forcing me to, i'm rewriting extension use webextension apis, i.e. chrome's extension apis. want have automated testing. far i've tried this: i've got package.json npm install depedencies: { "name": "extension-api-tests", "version": "0.0.1", "scripts": { "test": "karma start" }, "devdependencies": { "karma": "^1.3.0", "karma-firefox-launcher": "^1.0.0", "karma-mocha": "^1.3.0", "karma-sinon-chrome": "^0.2.0", "mocha": "^3.1.2", "sinon-chrome": "^2.1.2" } } i've got karma.conf.js set test runner: module.exports = function(config) { config.set({ frameworks: ['mocha', 'sinon-chrome'], files: ['test.js'], reporters: ['dots'], autowatch: false, browser...

javascript - Codition on a last iteration of loop in React JSX? -

i have list of emails need loop through , display in format. renderemaillist() { return this.props.officeemailaddress.map((officeemail) => { return ( <a key={emailid} href={`mailto:${officeemail}`}>{officeemail}{'; '}</a> ); }); } when rendered email@mail.com; email2@mail.com; i want remove semicolon @ end of last loop only. what bets way this? you have access index , full array within map : return this.props.officeemailaddress.map((officeemail, index, arr) => { return ( <a key={emailid} href={`mailto:${officeemail}`}>{officeemail}{index === arr.length - 1 ? '' : '; '}</a> ); }); i added ternary determine if on last element of array and, if are, output empty string.

node.js - upgrading NPM runs out of memory -

i attempting install new angular module had created other projects use it. however, npm returns error: fatal error: call_and_retry_last allocation failed - javascript heap out of memory after doing research, there seem 2 solutions. upgrade npm run npm through node , pass in max_old_space_size argument however, i'm running issues both approaches. process of upgrading npm returns same error. so... tried second approach. however, following error: (set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix ^^^^^ syntaxerror: unexpected identifier @ createscript (vm.js:56:10) @ object.runinthiscontext (vm.js:97:10) @ module._compile (module.js:542:28) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.runmain (module.js:604:10) @ run (bootstrap_node.js:38...

node.js - How do I make Instagram OAuth (or any OAuth) always force the user to sign in, even if they are signed into the application's website? -

i'm building tool user want authenticate multiple instagram accounts application. problem run if user has authenticated 1 , initiate oauth dialogue again, oauth assumes want access token of user logged in. i have ios app similar , way avoid clear cookies of safari browser. i'm using instagram-node module right now. app.get('/authenticateinstagram', function(req, res) { res.redirect(ig.get_authorization_url(redirecturi, { scope: ['basic', 'public_content', 'likes', 'follower_list', 'relationships'], state: 'a state' })); }); app.get('/handleinstagramauth', function(req, res) { ig.authorize_user(req.query.code, redirecturi, function(err, result) { if (err) { console.log(err.body); res.send('didn\'t work'); } else { console.log('yay! access token ' + result.access_token); res.send('you made i...

What is the difference between Android focusable and importantForAccessibility when using TalkBack? -

i have noticed in many situations android:importantforaccessibility="yes" can replaced android:focusable="true" , work same talkback. when should android:importantforaccessibility="yes" used instead of using focusable? android defines android:importantforaccessibility as: describes whether or not view important accessibility. if important, view fires accessibility events , reported accessibility services query screen. note: while not recommended, accessibility service may decide ignore attribute , operate on views in view tree. https://developer.android.com/reference/android/view/view.html#attr_android:importantforaccessibility and android:focusable="true" as: controls whether view can take focus. default, "auto" lets framework determine whether user can move focus view. setting attribute true view allowed take focus. setting "false" view not take focus. value not impact behavior of directly calling req...

php - Why does `mb_eregi_replace` return NULL when the string contains extended ASCII codes? -

using php v7.1.5, why php function mb_eregi_replace return null if string contains extended ascii code a0 ("non-breaking space" according www.ascii-code.com )? $ php -a interactive shell php > $t = mb_eregi_replace('d', '', "do\xa0not"); php > echo $t; php > if( $t === null ) { echo "is null"; } else { echo "replace worked"; } null php > $t = mb_eregi_replace('d', '', "do not"); php > echo $t; o not php > if( $t === null ) { echo "is null"; } else { echo "replace worked"; } replace worked reading this article (specifically "what convert extended ascii utf-8" section) shows passing string utf8_encode before passing mb_eregi_replace solves problem. $ php -a interactive shell php > $t = mb_eregi_replace('d', '', utf8_encode("do\xa0not")); php > echo $t; o not

python 3.x - Keras Error using Lambda -

i've started out keras week , have been going through documentation figure out why i'm getting error. figured faster if got help, , feels detail i'm not seeing. error when checking model input: expected lambda_input_1 have 4 dimensions, got array shape (0, 1) here entire code on if helps see i'm doing wrong. import csv import cv2 import numpy np lines = [] open('../data2/driving_log.csv') csvfile: reader = csv.reader(csvfile) line in reader: lines.append(line) row in reader: steering_center = float(row[3]) # create adjusted steering measurements side camera images correction = 0.2 # parameter tune steering_left = steering_center + correction steering_right = steering_center - correction # read in images center, left , right cameras directory = "..." # fill in path training img directory img_center ...

c# - Use ADAL to authenticate with office365 to manage word docs? from console app -

i want know if possible use office 365 api interact word documents in office 365 (create, update, , download). have azure directory setup, don't know how leverage access office 365 api interact these documents. what process, if any, using azure active directory combined office 365 manage documents? of resources can find assume azure active directory used handle authentication web service / web app. wish console app. it not necassary me use azure active directory, goal authenticate , interact office 365 online word documents, if there someway obtain token directly through office 365 manage word documents, solve issue too. you can use both adal or msal on console based application , interact office documents using graph api: onedrive workload in graph api allows retrieve, download, upload documents onedrive/ onedrive business or sharepoint document library. below resources/ samples can use references: github sample: call azure ad graph api native client (adal) ...

c++ - new in Objective-C in init - how to handle std::bad_alloc? -

i need wrap c++ object inside objective-c class - did putting c++ objects inside @implementation in .mm file this: myobjcclass.h: @interface myobjcclass : nsobject @end myobjcclass.mm: @implementation myobjcclass { mycppclass member; } @end sadly had give since code used in project targets 32-bit architectures , feature not supported. did forward struct declaration, struct defined in .mm file , wraps c++ object: myobjcclass.h: struct myobjcclassprivate; @interface myobjcclass : nsobject { myobjcclassprivate* memberprivate; } -(void)dealloc; -(id)init; @end myobjcclass.mm: struct myobjcclassprivate { mycppclass member; } @implementation myobjcclass -(void)dealloc { delete memberprivate; memberprivate = nullptr; } -(id)init { if (self = [super init]) { memberprivate = new myobjcclassprivate; // happens if new throws std::bad_alloc ? } return self; } @end the question - should care if allocation new fails? conseq...

server - How do you close old instances of BrowserSync when stopping in Terminal? -

operating system: windows terminal: git bash this current bs-config.js file looks like. module.exports = { "ui": { "port": 4000 }, "port": 4000, "server": { "routes": { "/node_modules": "node_modules" } }, "middleware": [jsonplaceholderproxy], "https": true, "watch": true, "files": "*.*" }; my package.json has "browser-sync": "^2.18.5" , after run command browser-sync start --config bs-config.js press control-c close it, port still running. when re-run it, starts on next port. 4012 , want on 4000. current solutions found either using netstat , finding pid , closing port or restarting computer. suggestions?

c# - Microsoft Cognitive Services Vision API does detect any characters from code -

Image
i have block of code calls microsoft cognitive services vision api using ocr capabilities. when pass specific image api call doesn't detect words. call succeeds , returns 200 status. when use same image through demo ui screen provided microsoft works , reads characters expect. if go url https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/ , upload image then works , comes 201 19 4501. when try use below code against same image return doesn't return characters. here code. scaleimageifneeded method below doesn't because image scaled right size (it returns same passed in byte array). public async task<string> processimage(byte[] imagedata) { var client = new httpclient(); client.defaultrequestheaders.add("ocp-apim-subscription-key", connectionstring); const string requestparameters = "language=unk&detectorientation=true"; const string uri = ...

javascript - Restrict access to a page if not logging in with Firebase Authentification + retrieve data -

i have login page following code (taken firebase sample auth app): function initapp() { // listening auth state changes. // [start authstatelistener] firebase.auth().onauthstatechanged(function(user) { // [start_exclude silent] document.getelementbyid('quickstart-verify-email').disabled = true; // [end_exclude] if (user) { window.location = 'index.html'; // user signed in. var displayname = user.displayname; var email = user.email; var emailverified = user.emailverified; var photourl = user.photourl; var isanonymous = user.isanonymous; var uid = user.uid; var providerdata = user.providerdata; // [start_exclude] document.getelementbyid('quickstart-sign-in-status').textcontent = 'signed in'; document.getelementbyid('quickstart-sign-in').textcontent = 'sign out'; document.getelementbyid('quickstart-account-details').textcon...

node.js - Error: Cannot find module 'internal/linkedlist' in WebStorm -

i have script runs fine when run in terminal node, using webstorm can't run crashes on dependency require line. i've attempted npm install internal/linkedlist , i've attempted npm cache clean (as recommended in post). the full stack trace is: error: cannot find module 'internal/linkedlist' @ function.module._resolvefilename (module.js:485:15) @ function.module._load (module.js:437:25) @ module.require (module.js:513:17) @ require (internal/module.js:11:18) @ object.<anonymous> (/users/harshagoli/library/preferences/webstorm2017.2/javascript/nodejs/8.1.4/core-modules/timers.js:26:11) @ module._compile (module.js:569:30) @ object.module._extensions..js (module.js:580:10) @ module.load (module.js:503:32) @ trymoduleload (module.js:466:12) @ function.module._load (module.js:458:3)

python - GenericLikelihoodModel to fit binomial distribution: output stderr is nan -

since there no direct discrete distribution fitting packages in python, tried use statsmodels.base.model.genericlikelihoodmodel fit binomial distribution. however, in cases, e.g., n=5, p=0.5, every term in estimation summary nan except point estimations. if change n 5 10, works well. my codes are: import numpy np statsmodels.base.model import genericlikelihoodmodel scipy.stats import binom class binom(genericlikelihoodmodel): def loglike(self, params): return np.log(binom.pmf(self.endog, *params)).sum() n, p = 5, 0.5 params = (n, p) x = binom.rvs(5, p, size=1000, random_state=1) res = binom(x).fit(start_params=params) res.df_model = len(params) res.df_resid = len(x) - len(params) print(res.summary()) related output: coef std err z p>|z| [95.0% conf. int.] par0 5.0000 nan nan nan nan nan par1 0.4972 nan nan nan nan nan error messages: //anaco...

javascript - Suggest "Form builder plugins" independent of back-end -

my ideia have form builder can drag & drop fields , mechanisms "rows columns tabs" of bootstrap, connect or grab information or (set configurations) input fields , possibility add logic "appear" , "desapper" when field has value or not. it nice if plugin gave output structure in json if exists, can known or have worked form builder web, suggest me one?

jquery - Foundation 6 - Javascript Error -

i'm trying use hamburger menu in foundation 6 , whenever try toggle menu, nothing shows up. icon. when check console log, states : tried initialize responsive-menu on element has foundation plugin. app.js:9927. it'll mean alot if guys can me out, i've been stuck on problem weeks ! i'll post html code below . <div class="title-bar" data-responsive-toggle="main-nav" data-hide-for="medium"> <button class="menu-icon" type="button" data-toggle></button> </div> <div class="top-bar-left" id="main-nav"> <ul class="menu vertical medium-horizontal" data-responsive-menu="drilldown medium-dropdown" data-auto-height="true" data-animate-height:"true"> <li><a class="scrollto" data-scrollto="hero" href="#">home</a...

file upload - Size limit on ContentVersion object in Salesforce -

i trying create , insert contentversion object in salesforce lightning(for file upload) using following code: contentversion v = new contentversion(); v.versiondata = encodingutil.base64decode(content); v.title = filename; v.pathonclient = filename; insert v; this works fine smaller files. when try loading file 750kb above operation fails(actual allowed size still less). there limit on size if files uploaded using above code? as per similar question salesforce stackexchange . from base lightning components considerations : when working type="file", must provide own server-side logic uploading files salesforce. [...] uploading files using component subject regular apex controller limits, 1 mb. accommodate file size increase due base64 encoding, recommend set maximum file size 750 kb. must implement chunking file size larger 1 mb. files uploaded via chunking subject size limit of 4 mb. the base64 pushing fil...

php - Pictures taken from front camera becomes black when uploaded -

i'm using gd library resize images , exif fix orientation. works fine, on specific devices samsung galaxies, pic taken front camera gets uploaded becomes black. how fix it? image resizing method: public function process($task, $savepath, $taskwidth=0, $taskheight=0, $quality=80) { $quality = (int) $quality; $quality = ($quality < 0 or $quality > 100) ? 80 : $quality; if (file_exists ($this->path)) { if (in_array($this->extension, $this->photoextensions)) { if ($this->extension == "gif") { copy($this->path, $savepath); return true; } switch ($this->extension) { case 'png': $im = imagecreatefrompng($this->path); break; default: $im = imagecreatefromjpeg($this->path); break; } ...

Creating a linq query which results in only 1 query execution -

i have following 2 tables: *tablea *tableb tablea has 1 many relationship tableb , therefore tableb has column foreign key tablea tablea used create c# class called classa has bool property indicating wether has related records in tableb called hasrecords i create this: tablea.select(s => new classa { hasrecords = s.tableb.any() } will create 1 query or multiple ones because of function? there way in line without triggering multiple query executions or have resort table valued function?

Parsing a protocol message from Go by Java -

i write server(go)-client(java) programe, , use protobuf communication. define proto file , share between server , client. in server side: compile shared proto file go protoc serialize object proto.marshal send client make request service in client side: compile shared proto file java protoc get bytes transferred via http deserialize bytes object. here following error: "com.google.protobuf.invalidprotocolbufferexception: while parsing protocol message, input ended unexpectedly in middle of field. mean either input has been truncated or embedded message misreported own length." i confirmed http work fine , value of bytes received in client side same bytes send server. have same problem on this? here proto file syntax = "proto3"; package tutorial; message person { string name = 1; int32 id = 2; string email = 3; enum phonetype { mobile = 0; home = 1; work = 2; } message phonenumber { ...

Python Pandas Equivalent to Excel Countif -

i have tried different solutions similar questions made, didn't expected result, far. i have 2 dataframes, df1 , df2 , both of them contain column named 'fb rq id' . there far more lines in df2 in df1 , , want check values df2['fb rq id'] in df1['fb rq id'] , how many times appears there, creating column on df2 number of times value on line in df1 . if know how create column binary information wether df2.['fb rq id'] in df1['fb rq id'] , helps. thank you!! how this? df2['count_from_df1'] = [list(df1['fb rq id']).count(id) if id in df1['fb rq id'] else 0 id in df2['fb rq id']]

canvas - How to draw a curve consisting of multiple line segments in a non-jagged way -

Image
i trying write program puts incoming usb data onto line graph. way have done drawing onto canvas bunch of straight lines connecting data points. problem resulting line not smooth, can see below: i tried using graphics context's lineto(x, y) method made worse. tried changing line cap , line join parameters didn't much. is there better way play "connect dots" javafx graphics context? perhaps bezier curves? if there is, please let me know. i ended going simplest solution problem, use boxblur effect: boxblur blur = new boxblur(); blur.setwidth(2); blur.setheight(2); blur.setiterations(1); gc.seteffect(blur); ... //don't forget remove effect before clearing gc.seteffect(null); gc.clearrect(0, 0, width, height); it's not exact solution, works fine purposes.

javascript - espruino: wifi on connect event not fired -

i need notified when esp8266 connected wifi network. i'm listening connected event in wifi module. callback function never called. the code: var wifi = require("wifi"); wifi.on('connected', function(details) { console.log('connected wifi', details); }); wifi.connect("*****", {password:"****"}, function(err){ console.log("connected? err=", err, "info=", wifi.getip()); }); the output: > =undefined connected? err= null info= { "ip": "192.168.1.105", "netmask": "255.255.255.0", "gw": "192.168.1.1", "mac": "5c:**:7f:**:7a:**" } the event not fired because esp8266 connected wifi network. when setup connection can save settings in order espruino reconnect wifi automatically @ boot time.

subprocess - Why can't I execute my python program with gksu? -

i have finished writing first python program gui. largely refined first program ever wrote, wifi capture program. whenever try run program pkexec or gksu, fails 'copy users xauthority file'. i able program work adding sudo directly subprocess calls , making sure sudo -v first. had add shell = true popen tcpdump process. seems in case it's okay i'm using it, since there's no user input inject. suppose write script start program, that's sloppy. any appreciated! import subprocess import gi gi.require_version('gtk', '3.0') gi.repository import gtk datetime import datetime channel = '1' width = '20' adapter = 'wlan0' dump = '' class sniffer(object): def __init__(self): #build gui self.builder = gtk.builder() self.glade_file = 'sniff.glade' self.builder.add_from_file(self.glade_file) #get objects go = self.builder.get_object self.window = g...

Why the webpack increases the output file so large -

i wrote simple script within typescript , es6 has nothing todo react or library. however, source files less 200 lines (<5k) exported bundle.js around 100k. it's unreasonable. here's webpack config. generated bundle.js webpack node_env=production --optimize-minimize the file exceed 300k if not doing optimize. var webpack = require('webpack'); module.exports = { entry: { timer: "./src/test.ts", }, output: { path: "./js", filename: "[name]-bundle.js" }, devtool: 'source-map', resolve: { extensions: ['', '.ts', '.tsx', '.js', '.json'] }, module: { preloaders: [ {test: /\.json$/, exclude: /node_modules/, loader: 'json'}, ], loaders: [ ...

ios - UIPageControl skips over page when swiped? -

currently have uipagecontroller , appears skipping on screen when swiped. it's strange because put print line statements in when vc in use , looks moves right vc before going next vc in same swipe. (ie. goes step2 , goes step3 during same swipe) here how it's set up: var maxpages : int! var currentindex : int = 0 var listofviews = ["step1", "step2", "step3", "step4"] //maxpages = listofviews.count in viewdidload public func pageviewcontroller(_ pageviewcontroller: uipageviewcontroller, viewcontrollerafter viewcontroller: uiviewcontroller) -> uiviewcontroller? { var index : int = (viewcontroller.view as? bgmwelcomepageview)!.index index += 1 if (index == maxpages) { index = 0 } return self.getviewcontrollerwithimage(index) } public func pageviewcontroller(_ pageviewcontroller: uipageviewcontroller, viewcontrollerbefore viewcontrolle...

scenario generating programming language -

i trying remember name of programming language stumbled upon maybe month ago. totally forget name, that's why i'm asking you. had generating stories/scenarios. example: you'd set variable "events" , type this: events { eat drink swim walk } and you'd write scenario this: output: "i to" {events} the syntax wrong, hope idea. it's can generate stories/scenarios. please tell me name of programming language know that's this. thanks

Is Angular Material a Hybrid development Framework like Ionic? -

can angular material used cross platform devices? how ionic achieve this? angular has dynamic views make adjust screen resolutions easily. compiles javascript , html, browser can use it. answer question? don't know ionic though. frankly question should in 1 of meta sites since isn't specific code problem rather question technology/framework.

deep learning - Is imagenet data required for squeeze net training? -

has tried downloading squeezenet- have mentioned have provided pretrained network,but im wondering need have imagenet data downloaded me use model or 2 train or install it?? thanks the full imagenet dataset required if planning train network scratch. if not, can use pretrained weights. example, finetune 1 of output layers.

linux - How to place picture on desktop, on top of wallpaper? -

how place picture on desktop, on top of wallpaper? this fedora 26, gnome 3.24.2 i'm not sure pictures maybe can use conky

unity3d - Long chain / rope in unity2D -

i have created chain smaller chain segments , hingejoints. when there lot of segments chain gets elastic. , putting weight end breaks chain. adjusting mass of individual links improve link "strength". gives unnatural behaviour weight attached. are there other factors mass determine strength of hinge joints? any idea how create long chain less elastic (stronger).

python - PDB: Variable can be printed but is undefined -

it looks strange. variable name classes printed undefined when trying execute filter(...) contruction. here code: def start(self, tag, attrib): classes = attrib[self._class_attr] if self._class_attr in attrib else none if tag == self._tag_p: p = self._doc.add_paragraph('') self._cur_p = p if classes not none: alignments = [self._left_align, self._center_align, self._right_align] import pdb; pdb.set_trace() alignments = filter(lambda x: partial(x.is_in, classes), alignments) if len(alignments) > 0: p.alignment = alignments[0].get() assert len(alignments) < 2 pdb stops on it's break. when try execute filter() : (pdb) print filter(lambda x: partial(x.is_in, classes), alignments) *** nameerror: global name 'classes' not defined but: (pdb) print classes center title (pdb) classes u'center title' why filter(...) instruction not...