Posts

Showing posts from March, 2010

I am trying to write this code in Swift 3, it is for multiplayer -

this code in old version of swift 2. trying write in swift 3 having problem. multiplayer game. having problem "let userinfo ". error "extra argument 'userinfo' "in call import uikit import multipeerconnectivity class mpchander: nsobject, mcsessiondelegate { var peerid:mcpeerid! var session:mcsession! var browser:mcbrowserviewcontroller! var advertiser:mcadvertiserassistant? = nil func setuppeerwithdisplayname (displayname:string){ peerid = mcpeerid(displayname: displayname) } func setupsession(){ session = mcsession(peer: peerid) session.delegate = self } func setupbrowser(){ browser = mcbrowserviewcontroller(servicetype: "my-game", session: session) } func advertiseself(advertise:bool){ if advertise{ advertiser = mcadvertiserassistant(servicetype: "my-game", discoveryinfo: nil, session: session) advertiser!.start()

React Native inputs on iOS and Android -

i've been evaluating react native replacement cordova, , wondering if there accepted solution styled text inputs. i'd see text inputs rendered in material design on android, , apple style on ios. do have recommendations specific library, or have write own/combine multiple libraries? thank you! you check out https://nativebase.io/ supports platform specific default styling there others https://react-native-training.github.io/react-native-elements/ , http://www.xinthink.com/react-native-material-kit/ has consistent styling regardless of platform. coming cordova/sencha touch background suggest try create own style using default react native components, reason before having same question regarding component library use target platform @ once, react native isn't 100% cross platform , learning style on different platform might give idea , feedback evaluation, unless aiming have project possible , different story.

windows - Cygwin: Git stash -> Cannot save the current index state -

i'm using cygwin under windows command line stuff. 1 of commands use git stash. since few weeks error when use it: cannot save current index state i tried in other projects, no project related issue. history not broken or that. don't use don't know when issue started. the error thrown on line 110 of git-stash file. that's why debugged 2 lines before. $(printf 'index on %s\n' "$msg" | git commit-tree $i_tree -p $b_commit) when echo first command outputs last commit. seems ok. when output both commands piped empty, maybe wrong "git commit-tree $i_tree -p $b_commit". google long time not able find solution issue. cygwin git version: 2.14.1 cygwin x64 version: 2.8.2(0.313/5/3) first, check if issue persists bash (the bash packaged git). make sure set path in order to: no include cygwin include git/bin, git/usr/bin, git/mingw64/bin: see this example . working simplified path (for testing purposes) important make sure

Use JModelica in Spyder/Python -

Image
i using jmodelica simulation of modelica models. jmodelica.org python interface enables users use python scripting interact modelica models; jmodelica.org not python package/library - python packages part of jmodelica , not standalone. if open ipython.bat jmodelica - call c:\jmodelica.org-2.0\setenv.bat . setenv.bat defines , sets different environmental variables including set pythonpath=%jmodelica_home%\python;%pythonpath% required site-packages located. i use anaconda/spyder developments , debugging, great use jmodelica in spyder. naive idea create new environment in anaconda , use intepreter, ipthon, pythonpath (which created when /jmodelica.org/ipython.bat is called) etc. jmodelica. i know how create new environment in anaconda , how start python within environment. not work. i tried change settings within spyder another idea use startup file ipyhon.

Why does my Java program not recognise a static variable in a particular class? -

i doing test code inventory system (i plan work on game later on) using javax components. making class called 'cursor' extends 'itemstack' can "pick up" items click on in inventory screen. problem i'm having use static variable 'cur' hold instance of class, every time try compile, following error: .\john\window\component\itemslotpanel.java:13: error: cannot find symbol itemstack.swapwith(cursor.cur); ^ symbol: variable cur location: class cursor .\john\window\component\itemslotpanel.java:25: error: package itemstack.item doe s not exist g.drawimage(itemstack.item.icon.getscaledinstance(this.getwidth(),this.get height(),image.scale_smooth),0,0,null); ^ .\john\window\component\infiniteitemslotpanel.java:15: error: cannot find symbol if (cursor.cur.isempty()) { ^ symbol: variable cur location: class cursor .\john\window\component\infiniteitemslo

c# - Extract Data from Soap XML with Namespaces -

i trying extract data contained in soap response xml have contains multiple , variable namespaces in ssis script component using c#. my xml looks this: <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <ns3:getcacheentryresponse xmlns:ns3="http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialservice" xmlns:ns2="http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef" xmlns:ns4="http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialdecision" xmlns:ns5="http://vedaadvantage.com/dp3/service/fault" xmlns:ns6="http://com/vedaadvantage/dp3/businessdecisionresultoverride" xmlns:ns7="http://com.vedaadvantage/dp3/connectors" xmlns:ns8="http://com.vedaadvantage/dp3/connectors

bash - Failing to run a file through its pathway in the Linux terminal -

hi trying run file typing down whole pathway of login.sh file because want run program automatically upon bootup of raspberry pi. pathway login.sh file is: /home/pi/desktop/rpi_code/logger_v1_01/login.sh so login.sh file following: #!/usr/bin/expect spawn sudo openconnect vpn.ucr.edu/engineering expect -r "\[sudo] .*\: " { send "pw_for_my_linux\n" } expect "username:" { send "my_vpn_username\n" } expect "password:" { send "vpn_password\n" } spawn sudo python logger.py expect -r "\[sudo\] .*\: " { send "pw_for_my_linux\n" } interact` this program works fine when run terminal under folder logger_v1_01. when run terminal under /home files pathway gives me following error: python: can't open file 'logger.py':[errno 2] no such file or directory anyone can explain why case? why can't open file exists? when run python logger.py you're

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot

c# - Microsoft Graph API - Get photo -

my company has internal application need pull/display pictures of employees office 365 out user intervention. from read online think need call microsoft graph getphoto api in daemon application achieve per link ( https://developer.microsoft.com/en-us/graph/docs/authorization/app_only ). will right approach? if yes please point me c# sample codes related this. appreciate responses. yes, type of application want build. app-only (machine-to-machine) authentication should used anytime don't need user present execute functionality. you can take @ asp.net core app sample sense of how register , set app use app-only authentication. sample goes on use access token set webhooks, can replace logic custom code. want select scope user.readbasic.all have access users' profile photos.

android - Https server side, as well as client encryption? - Information Security Stack Exchange

i'm new data-encryption , not understand following: i convert domain "https" domain, means of "lets encrypt". i have android app talks api on domain. do still need perform client side encryption using public key on android app -> send encrypted data api -> decrypt on server using private key? mean if domain https? need distribute public keys every user visits domain? how do that? no, whole point of tls encrypt traffic between app , server. tls deals key distribution, otherwise hard problem. tls made solve problem. adding encryption layer same tls not add security system. increases complexity (attack surface). make sure tls implementation secure , users cannot bypass (using legacy http or something). consider using modern security features strict transport policy , focus on web security (xss, csrf, etc.). experience shows of time implementations insecure, not crypto.

user interface - How to use selenium grid to test on different browsers in robotframework -

i have read many posts on internet of how use selenium grid ui testing. have set nodes , hub , run sample code provided many tutorials *** settings *** documentation example metadata version 1.0 library selenium2library suite setup start browser suite teardown close browser *** variables *** ${server} http://www.google.com ${browser} firefox *** keywords *** start browser [documentation] start firefox browser on selenium grid open browser ${server} ${browser} none http://hub- server:4444/wd/hub *** test cases *** check page title [documentation] check page title title should google however, test specifies browser, firefox. when set node "-browser browsername=chrome" gives me error. wondering how should configure browsers ui automation run on different browsers. thanks

javascript - Custom time input won't render -

i'm using admin-on-rest , trying write custom input component . format time value, that's not relevant question. current code don't see errors, can't render. as loop through days of week, each open , close time create <field> passing property's path name , specifying custom render function component . from there want render <textfield> . after i'll transforming input value, again that's tangential. // set days of week const daysofweek = [ 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday' ] // time input component const rendertimefield = ({ input, label, meta: { touched, error }, ...custom }) => ( <textfield hinttext={label} floatinglabeltext={label} errortext={touched && error} source={input.name} {...input} /> ); // loop through days of week , render open/close time inputs // time object looks // hours:

JavaFX table lost sorting feature -

after following tutorial http://code.makery.ch/blog/javafx-8-tableview-sorting-filtering/ filtering observablelist tableview via textfield. table columns lost it's default sorting feature. heres sscce controller/model package application; import java.math.bigdecimal; import java.text.decimalformat; import javafx.application.application; import javafx.beans.property.objectproperty; import javafx.beans.property.simpleobjectproperty; import javafx.beans.property.simplestringproperty; import javafx.beans.property.stringproperty; import javafx.collections.fxcollections; import javafx.collections.observablelist; import javafx.collections.transformation.filteredlist; import javafx.collections.transformation.sortedlist; import javafx.fxml.fxml; import javafx.fxml.fxmlloader; import javafx.scene.scene; import javafx.scene.control.tablecolumn; import javafx.scene.control.tableview; import javafx.scene.control.textfield; import javafx.stage.stage; public class test extends applica

ruby - Friendship Status Detection - Rails 5 -

i'm creating social network ruby on rails , want display following link if users are: not friends display "not friends" friends display "friends" pending request display "pending" but i'm getting "uninitialized constant owner::friendship" error on friendship = friendship.where(owner_id: [self.id,owner_2.id], friend_id: [self.id,owner_2.id]) owner.rb has_many :follows, dependent: :destroy has_many :inverse_follows, class_name: "follow", foreign_key: "friend_id", dependent: :destroy def request_friendship(owner_2) self.friendships.create(friend: owners_2) end def pending_friend_requests_from self.inverse_friendships.where(state: "pending") end def pending_friend_requests_to self.friendships.where(state: "pending") end def active_friends self.friendships.where(state: "active").map(&:friend) + self.inverse_friendships.where(state: &qu

jenkins - How do I get the name of the pipeline from inside the jenkinsfile -

env.job_name pipeline name suffixed branch name. so env.job_name <jenkins_pipeline_name>_<my_branch> how can pipeline name , store in var in environment{} block @ top of jenkinsfile use through file? i don't want resort scripted pipeline declarative. since using multibranch job, env variable returning actual job name created out of branch .i.e. _ .. so, without mechanism strip/sed out branch name, don't think there env variable in jenkins out-of-the-box.

mysql - TIMEDIFF Subquery returns more than 1 row in mariadb -

having issue specific section of query using timediff , addtime : i want result : | waktuhilang | |-------------| | 04:00:00 | | 03:00:00 | select addtime( ( select sec_to_time( sum( time_to_sec( maketime( durasi + 0, substring_index(durasi, 'jam ', - 1) + 0, 0 ) ) ) ) waktudw trans_lhpdtdw ), ( select timediff(jammasuk, jammulai) lamaistirahat trans_lhphd ) ) waktuhilang i've seen people mentioning using in instead of = within subquery, can't seem work. ideas out there? thanks i have 2 tables : table trans_lhpdtdw table trans_lhphd create table `trans_lhpdtdw` ( `idbukti` int(11) not null, `partid` varchar(50) not null, `typedownti

php - How can I add ZIP/Postal Code security verification to Square API for online transactions -

i've gotten few questionable orders come through on website , can't seem add additional security square verify zip/postal code on billing address of credit card add layer of security incoming orders. square's e-commerce implementation designed (as developer) not have easy access end-user's credit card details or pii. being said, zip codes have own form field , send data square during nonce creation. see square's e-commerce doc's more info.

javascript - JQuery .click() not selecting elements -

i'm doing freecodecamp simon game challenge ( jsfiddle ). can't work out why .click() isn't working @ all. i've used of other projects without issue. the html here: <span class="title-label">designed , coded <a href="http://www.daveingles.com" id="linkedin" target="_blank">dave cook</a></span> </div> <div class="main"> <div class="button-holder"> <div class="quarter red"> <div id="red"></div> </div> <!--quarter red--> <div class="quarter yellow"> <div id="yellow"></div> </div> <!--quarter red--> <div class="quarter green"> <div id="green"></div> </div> <!--quarter red--> <div class="quarter blue"> <div id="blue&qu

Linux file permission changed after using sftp -

when using sftp upload files machine machine b, permission changed after transport. file in machine has permission 777 (the user's umask 0022) , after upload, file permission became 755 (the user's umask in machine b 0002). so question is: why permission changed? did change depend on settings in linux? if so, depend on , how can change settings? sftp can preserve permissions if specially ask client ( -p switch sftp command line tool). not default. also server needs configured accept these permissions, because configured umask , users not creating open files. users umask not have enforced. there -u switch sftp-server , forces umask regardless user-one. to answer fully, have see full debug log and/or server configuration.

Selecting XLM Elements for output in Thymeleaf -

if had structure this: <tag> <item name="groot" group="a"/> <item name="starlord" group="a"/> <item name="rocket" group="a"/> <item name="thanos" group="b"/> <item name="ronan" group="b"/> <item name="ego" group="b"/> </tag> how make template select either or b items matching variable? example: selecting "group=a" because variable set a <tag> <item name="groot" group="a"/> <item name="starlord" group="a"/> <item name="rocket" group="a"/> </tag> question is possible eliminate "group=*" attributes since needed use in template? example <item name="groot"/> <item name="starlord/> <item name="rocket"/> alternatives? i'm new thymeleaf other suggest

python - tensorflow: ValueError: Shape must be rank 2 but is rank 4 for 'MatMul_1' -

i met error in following code, when i'm trying multiply dense matrix sparse matrix. import tensorflow tf import numpy np = tf.sparse_placeholder(tf.float32) b = tf.sparse_placeholder(tf.float32) isfoc = tf.placeholder(tf.float32, [none, 1]) isfoc_diag = tf.diag(isfoc) isunfoc = tf.placeholder(tf.float32, [none, 1]) isunfoc_diag = tf.diag(isunfoc) b = tf.matmul(isfoc_diag,isunfoc_diag) = tf.matmul(isfoc_diag,tf.sparse_tensor_to_dense(a),a_is_sparse=false,b_is_sparse=true) the error says: traceback (most recent call last): file "a.py", line 14, in <module> = tf.matmul(isfoc_diag,tf.sparse_tensor_to_dense(a),a_is_sparse=false,b_is_sparse=true) file "/home/mypath.pfc/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 1813, in matmul name=name) file "/home/mypath.pfc/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 2245, in _sparse_mat_mul b_is_sparse=b_is_sp

move semantics - c++ type trait to say "trivially movable" - examples of -

i define "trivially movable" by calling move constructor (or move assignment operator) equivalent memcpy bytes new destination , not calling destructor on moved-from object. for instance, if know property holds, can use realloc resize std::vector or memory pool. types failing typically have pointers contents needs updated move constructor/assignment operator. there no such type traits in standard can find. wondering whether has (better) name, whether it's been discussed , whether there libraries making use of such trait. edit 1: from first few comments, std::is_trivially_move_constructible , std::is_trivially_move_assignable not equivalent looking for. believe give true types containing pointers themselves, since reading own member seems fall under "trivial" operation. edit 2: when implemented, types point won't trivially_move_constructible or move_assignable because move ctor / move assignment operator not trivial anymore. th

lua - When trying to print division, it converts fractions to decimals -

i coding calculator , trying print division equation's answer, instead converted fractions decimals. running lua 5.2.4 print ("\n\twhat math symbol use?") ms = io.read() -- main function function typcalc() --if user typed math symbols if (ms == "division") print ("\n\twhat number divided to?") local rn = io.read() print ("\n\twhat dividing?") local ln = io.read() --convert users answers in strings local cln = tonumber(ln) local crn = tonumber(rn) --do equasion io.write (ln / rn) end; end ; typcalc() lua not have fraction type. you'll have calculate numerator , denominator yourself. print it. if print or write (number/number2) expression evaluated first, resulting in decimal number. function use local copy of number then. local denominator = 12 -- or calculated value in case local numerator

VHDL: Division with error coding but there are errors in compiling on Quartus II but not on Xilinx ISE -

i'm new vhdl , help. see, told our instructor code division of binary (by converting binary integer first) , if divisor zero, output error waveform displayed in simulation. here code: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity division_in port ( : in std_logic_vector (7 downto 0); b : in std_logic_vector (7 downto 0); clk : in std_logic; y : out std_logic_vector (7 downto 0); err : out std_logic); end division_in; architecture behavioral of division_in begin process(clk) begin if clk='1' , clk'event -- error here y <= conv_std_logic_vector(conv_integer(a)/conv_integer(b),8); err <= '0'; elsif b = 0 err <= '1'; end if; end process; end behavioral; when try use "check syntax" in xilinx ise 9.1i (which used university), there no syntax errors displayed on transcript. us

java - Intercept between rectangle and line drawn from center point -

Image
consider following diagram given center point of rectangle , origin, , coordinates b, how find @ point line ab intersects rectangle? thanks. intersection coordinates relative center (a point): dx = b.x - a.x dy = b.y - a.y if width * abs(dy) < height * abs(dx) x = sign(dx) * width / 2 y = dy * x / dx else y = sign(dy) * height / 2 x = dx * y / dy

docker Error with pre-create check: "We support Virtualbox starting with version 5 -

i'm trying create docker machine host using following command in fedora os version 25. docker-machine create -driver=virtualbox host01 i below error while executing command. error pre-create check: "we support virtualbox starting version 5. virtualbox install \"warning: vboxdrv kernel module not loaded. either there no module available current kernel (4.10.12-200.fc25.x86_64) or failed load. please try load kernel module executing root dnf install akmod-virtualbox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.service not able start vms until problem fixed.\\n5.1.26r117224\". please upgrade @ https://www.virtualbox.org" i have virtualbox latest version installed. running command suggested sudo dnf install akmod-virtualbox kernel-devel-4.10.12-200.fc25.x86_64 akmods --kernels 4.10.12-200.fc25.x86_64 && systemctl restart systemd-modules-load.servi

.net - SignalR group reconnect -

we have game implemented using signalr, has several players , joined group. however, players may off-line, , want start robots replace left players. our current issue when let 1 player off line, game seems stuck there. there way re-join remaining players , started robot , continue game? thank you. if understood problem correctly, have multiplayer game each user connected signalr connection. have players going offline, able know on server through ondisconnect event, , want replace players own bot players. i assuming each player have unique id. unique id needs mapped connectionid able achieve exact replacement. uniqueid connectionid itself. for problem's solution need to: find out uniqueid/connectionid went offline. create new connection hub server client, robot player. replace player's uniqueid/connectionid(the 1 went offline) active robot player's uniqueid/connectionid. transfer state offline player robot player. however, player might not respond u

visual studio 2008 - The last row in the sampled data is incomplete. The column or the row delimiter may be missing or the text is qualified incorrectly -

i see below error when export data flatfile csv using ssis i using {lf} delimiter export csv. environment : visual studio 2008 build ssis package. "the last row in sampled data incomplete. column or row delimiter may missing or text qualified incorrectly." after exporting data can see valid data when try open flat file connection manager prompt me error. any solution avoid error.

javascript - Replicating Rails/AuthLogic Scrypt Hash Comparison on Node/Express Server -

i'm working on migrating older ruby-on-rails site node/express/react/redux, , i've run smack wall on authenticating users' existing passwords. site using authlogic(scrypt) authentication/password hashing, older account passwords still hashed sha512 authlogic algorithm. i can't life of me figure out how replicate authlogic's scrypt algorithm in node. i've reviewed ruby source incantations authlogic , underlying scrypt package, gave me clues. i'm using latest version of npm scrypt package (i've tried few others without discernable differences). the stored hash looks this: 400$8$1d$3fbb0d3688d9da6d$5dd919ace6bdf946d48946e9dd61f0afc5116986433633e24e58809c12b5ce9a the database stores unique salt parameter: fbmqa7ehfp5tdohnst based on scrypt gem source, looks $ delimited segments cost factor , salt: n, r, p = args[0].split('$').map{ |x| x.to_i(16) } scrypt gem scrypt.rb source. based on code, looks first 3 $ delimited bits "c

string - Writing variables to new line of txt file in python -

from other posts, i've learned '\n' signifies new line when adding txt file. i'm trying this, can't figure out right syntax when attribute right before new line. my code i'm trying this: for item in list: open("file.txt", "w") att_file: att_file.write(variable\n) as can see, i'm trying add variable each item in list new line in txt file. what's correct way this? you need specify newline character string: eg: with open("file.txt", "w") att_file: item in list: att_file.write(attribute + "\n")

python 2.7 - i am trying to import face recognition package . but i am getting error -

enter image description here pip install face_recognition collecting face_recognition exception: traceback (most recent call last): file "/home/kali/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) file "/home/kali/.local/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run wb.build(autobuilding=true) file "/home/kali/.local/lib/python2.7/site-packages/pip/wheel.py", line 749, in build self.requirement_set.prepare_files(self.finder) file "/home/kali/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) file "/home/kali/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 554, in _prepare_file require_hashes file "/home/kali/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 278, in populate_link self.link = finder

r - How does caret train determine the probability threshold to maximise Specificity -

i using caret's twoclasssummary function determine optimal model hyper-parameters maximise specificity . however, how function determine probability threshold maximises specificity? does caret each model hyper-parameter/fold evaluate every threshold between 0 , 1 , returns maximum specificity? in example below can see model has landed on cp = 0.01492537. # load libraries library(caret) library(mlbench) # load dataset data(pimaindiansdiabetes) # prepare resampling method control <- traincontrol(method="cv", number=5, classprobs=true, summaryfunction=twoclasssummary) set.seed(7) fit <- train(diabetes~., data=pimaindiansdiabetes, method="rpart", tunelength= 5, metric="spec", trcontrol=control) print(fit) cart 768 samples 8 predictor 2 classes: 'neg', 'pos' no pre-processing

how to find the number of characters in mysql -

this question has answer here: finding count of characters , numbers in string 2 answers how find number of characters in mysql for e.g student_name ------------- john contain 4 characters in field, need find out of query select len(column_name) table_name;

How to combine two dataframes in R? -

i'm trying load csv file , shows dates, wages , percentage change. unfortunately 1 of datasets has 42 rows 3 columns other has 41 rows 2 columns. data file here so tried these 2 no chance rbind.fill(data,datadiff) bind_rows(data,datadiff) once try combine them result below, second dataframe starts first dataframe ends http://imgur.com/a/pr8ez so there way show them , tidier? here code: location <- read.csv("c:/users/melik/desktop/sydney-melbourne-rent-master/average_wages.csv", stringsasfactors=t,header=true) x1 <- as.date(location[,1],format = "%d/%m/%y") data <- data.frame(x1, x2 <- location[,2],x3 <- location[,3]) colnames(data) <- c("date","sydney wages","melbourne wages") x2diff <- diff(data[,2])/data[-nrow(data),2] * 100 x3diff <- diff(data[,3])/data[-nrow(data),3] * 100 colnames(datadiff) <- c("sydney difference","melbourne difference") datadiff <- data.frame(x2d

python 3.x - Set identity to several ZMQ servers, binded to same port -

i implementing zmq dealer-router pattern in python 3.4. code zmq guide core of program. sets identity each client (ex. 1,2,3,4). however, if start same number of server workers, not paired clients. 1 server worker may respond clients different identities. question is: how set identities each server worker, server worker 1 interacts client 1? more precisely, need 4 clients interacting 4 server workers via 1 single port in paired manner. i answer own question. enough modify previous code set paired interactions: 1. pass id parameter in servertask class set server worker identity 2. change backend dealer router whole system interacts in asynchronous pattern. i'll post whole script: import zmq import sys import threading import time random import randint, random def tprint(msg): """like print, won't newlines confused multiple threads""" sys.stdout.write(msg + '\n') sys.stdout.flush() class clienttask(threa