Re: how to extract a variable as parameter which has index using by a for loop?

2016-06-08 Thread meInvent bbird
On Wednesday, June 8, 2016 at 4:56:56 PM UTC+8, Steven D'Aprano wrote: > On Wednesday 08 June 2016 17:31, meInvent bbird wrote: > > > b = [str(i)+str(j)+str(k) for i in range(m) for j in range(m) for k in > > range(m)] > > b[21][0:1]+b[21][1:2] > > b[21][1:2]+b[21]

how to extract a variable as parameter which has index using by a for loop?

2016-06-08 Thread meInvent bbird
b = [str(i)+str(j)+str(k) for i in range(m) for j in range(m) for k in range(m)] b[21][0:1]+b[21][1:2] b[21][1:2]+b[21][2:3] b[21][0:1]+b[21][2:3] originally, mmm = 5 H2 = [MM[mmm][b[i][0:1]+b[i][1:2]] for i in range(len(b))] how to extract b[i][0:1] and b[i][1:2] as parameters? def node(mmm,

how to search item in list of list

2016-06-12 Thread meInvent bbird
once a nested list have a word "node" then true else false def search(current_item): if isinstance(current_item, list): if len(current_item)==4: if [item for item in current_item if item[4] == "node"] != []: return True if True in [search(item) for

yatel install error

2016-06-12 Thread meInvent bbird
sudo apt-get install python-dev libatlas-base-dev gfortran pip install yatel Cleaning up... Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_martin/yatel/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__,

how to use yatel with redis?

2016-06-12 Thread meInvent bbird
my code is https://gist.github.com/hoyeunglee/58df4c41a63a2f37e153cbdbc03c16bf would like to apply itertools.combinations to use redis to use hard disk as memory rather than using ram(real memory) as memory def edge_gen(self): # we combine haplotypes by two for hap0, hap1 in

Re: how to solve memory

2016-06-10 Thread meInvent bbird
aa,bbb in itertools.combinations(initlist, 2): b.append([str(i)+str(j) for i,j in zip(aaa, bbb)]) print("deep=") print(deep) path2 = DFS(b, deep-1, maxx, sourceoperators, path) path.append(path2) else: print("") print("path="

Re: how to solve memory

2016-06-10 Thread meInvent bbird
result = DFS(b, 2, 2, mylist, path) On Saturday, June 11, 2016 at 8:34:16 AM UTC+8, MRAB wrote: > On 2016-06-11 00:31, meInvent bbird wrote: > > it is quite ridiculous, > > this time i am sure that i put correct indentation > > and add a else statement to make sure recursive

Re: how to solve memory

2016-06-11 Thread meInvent bbird
combinations(initlist, 2): b.append([str(i)+str(j) for i,j in zip(aaa, bbb)]) if deep > 0: path2 = DFS(b, deep-1, maxx, sourceoperators, path) path.append(path2) return path path = [] mresult = DFS(b, 2, 2, mylist, path) On Saturday, June 11, 201

Re: how to solve memory

2016-06-10 Thread meInvent bbird
print("deep=") print(deep) path2 = DFS(b, deep-1, maxx, sourceoperators, path) path.append(path2) return path path = [] mresult = DFS(b, 2, 2, mylist, path) On Friday, June 10, 2016 at 10:08:44 PM UTC+8, Steven D'Aprano wrote: > On Fri, 10 Jun 2016 10:58 am, meInve

Re: how to solve memory

2016-06-10 Thread meInvent bbird
rday, June 11, 2016 at 12:26:55 AM UTC+8, John Gordon wrote: > In <8a1c372e-bd6c-4923-8ae1-8f129ec74...@googlegroups.com> meInvent bbird > <jobmatt...@gmail.com> writes: > > > > I already responded to your earlier post about this program. Did you > > > read i

Re: which library has map reduce and how to use it for this case

2016-06-11 Thread meInvent bbird
there are six operator, and a logic table initial in b variable aa[b[j][i]] [aa[b[i][0:1]+b[i][2:3] are just like vlookup to find output of each operator acting on first column and second column, second column and third column , first column and third column and searching a output columns

how to solve memory

2016-06-09 Thread meInvent bbird
https://drive.google.com/file/d/0Bxs_ao6uuBDULVNsRjZSVjdPYlE/view?usp=sharing M1 = {} M2 = {} M3 = {} M4 = {} M5 = {} V6 = {} M1['00']=0 M1['01']=2 M1['02']=1 M1['10']=1 M1['11']=1 M1['12']=1 M1['20']=1 M1['21']=1 M1['22']=2 M2['00']=0 M2['01']=1 M2['02']=1 M2['10']=1 M2['11']=1 M2['12']=1

Re: how to solve memory

2016-06-09 Thread meInvent bbird
On Friday, June 10, 2016 at 9:13:13 AM UTC+8, Michael Torrie wrote: > On 06/09/2016 06:58 PM, meInvent bbird wrote: > > > > Do you have a question for the list? If so, please state what it is, and > describe what you are doing and what isn't working. If you can boil it >

Re: why for loop print only once after add if statement

2016-05-28 Thread meInvent bbird
thanks, i discover that i misunderstand i and item, they should be swapped On Saturday, May 28, 2016 at 6:19:23 PM UTC+8, meInvent bbird wrote: > for item, i in enumerate(aa) > print item > > this writing, it can print all values > > for item, i in enumerate(aa) >

how to write code generator for Isabelle by using pygments?

2016-05-28 Thread meInvent bbird
how to write code generator for Isabelle by using pygments? i am thinking to write a machine learning code to generate code by learning example from Isabelle code however, after google, not much information about this. -- https://mail.python.org/mailman/listinfo/python-list

Re: how to solve memory

2016-06-10 Thread meInvent bbird
On Friday, June 10, 2016 at 10:46:43 PM UTC+8, John Gordon wrote: > In <4f853aa2-cc00-480b-9fd7-79b05cbd4...@googlegroups.com> meInvent bbird > <jobmatt...@gmail.com> writes: > > > https://drive.google.com/file/d/0Bxs_ao6uuBDULVNsRjZSVjdPYlE/view?usp=sharing >

Re: how to solve memory

2016-06-10 Thread meInvent bbird
print(deep) path = DFS(b, deep-1, maxx, sourceoperators, path) return path path = [] mresult = DFS(b, 2, 2, mylist, path) On Friday, June 10, 2016 at 10:08:44 PM UTC+8, Steven D'Aprano wrote: > On Fri, 10 Jun 2016 10:58 am, meInvent bbird wrote: > > [snip unreadable code] &

Re: run code error with numpy and scipy

2016-06-10 Thread meInvent bbird
On Thursday, June 9, 2016 at 9:52:43 PM UTC+8, MRAB wrote: > On 2016-06-09 07:02, meInvent bbird wrote: > > when i run code in window has an error not a valid win32 dll > > > > then i install scipy first in this site, then install numpy-mkl > > all python

Re: how to solve memory

2016-06-10 Thread meInvent bbird
On Friday, June 10, 2016 at 10:08:44 PM UTC+8, Steven D'Aprano wrote: > On Fri, 10 Jun 2016 10:58 am, meInvent bbird wrote: > > [snip unreadable code] > > I just ran your code, and it almost crashed my computer. I think it is quite > rude to post code without an explanation o

how to record path in well format and easy to read?

2016-06-11 Thread meInvent bbird
https://gist.github.com/hoyeunglee/3fea29ed4aadb5dbc11c41f9a36070dc i discover my code can not record the path because i do recursive call at the end of function however, i want to do full combination at the end of function before calling recursive call, for seeing the result path, choose call

Re: how to record path in well format and easy to read?

2016-06-11 Thread meInvent bbird
({'11': 1, '10': 0, '00': 0, '01': 0}, {'11': 1, '10': 0, '00': 1, '01': 1}) initlist= 1549682 path= 1870866 Killed On Sunday, June 12, 2016 at 9:38:51 AM UTC+8, meInvent bbird wrote: > https://gist.github.com/hoyeunglee/3fea29ed4aadb5dbc11c41f9a36070dc > > i discover my code can n

Re: how to record path in well format and easy to read?

2016-06-11 Thread meInvent bbird
however, i had already assigned in this format path.append([caseA,path2]) before return path, what's wrong with it? On Sunday, June 12, 2016 at 12:55:17 PM UTC+8, meInvent bbird wrote: > https://gist.github.com/hoyeunglee/350ac2dd496f7c1c95a428f847e6f2b1 > > then can not run deep 3

run code error with numpy and scipy

2016-06-09 Thread meInvent bbird
when i run code in window has an error not a valid win32 dll then i install scipy first in this site, then install numpy-mkl all python 2.7 and win32 http://www.lfd.uci.edu/~gohlke/pythonlibs/ then i run code below, got error , and captured screen in this link

Re: why for loop print only once after add if statement

2016-05-28 Thread meInvent bbird
when read my code again, i discover this error i fixed before but forget to do for another branch of if statement now fixed On Saturday, May 28, 2016 at 6:19:23 PM UTC+8, meInvent bbird wrote: > for item, i in enumerate(aa) > print item > > this writing, it can print all values &

Re: is there a concurrent list for append in parallel programming in python? how to pass parameter in this parallel program with pool?

2016-06-16 Thread meInvent bbird
how can list be synchronized when multiprocessor working in it? will one thread updating non-updated version, but another processor updating the version? On Thursday, June 16, 2016 at 4:30:33 PM UTC+8, Steven D'Aprano wrote: > On Thursday 16 June 2016 17:28, meInvent bbird wr

Re: is there a concurrent list for append in parallel programming in python? how to pass parameter in this parallel program with pool?

2016-06-16 Thread meInvent bbird
://msdn.microsoft.com/en-us/library/dd997305(v=vs.110).aspx On Thursday, June 16, 2016 at 4:30:33 PM UTC+8, Steven D'Aprano wrote: > On Thursday 16 June 2016 17:28, meInvent bbird wrote: > > > is there like c# have concurrent list ? > > What is a concurrent list? > &g

how to change itertools.combinations(initlist, 2) to parallel for running in multiprocessor environment?

2016-06-15 Thread meInvent bbird
how to change itertools.combinations(initlist, 2) to parallel for running in multiprocessor environment? -- https://mail.python.org/mailman/listinfo/python-list

how to for loop append a list [] when using parallel programming

2016-06-15 Thread meInvent bbird
how to for loop append a list [] when using parallel programming -- https://mail.python.org/mailman/listinfo/python-list

how to python to use virtual memory?

2016-06-24 Thread meInvent bbird
after set resource hard and soft both out of real memory 70GB to 100GB and expecting the extra memory setting using virtual memory which is hard disk, the program still wrongly be killed itself after running in background side -- https://mail.python.org/mailman/listinfo/python-list

program return killed after run a very long time

2016-06-24 Thread meInvent bbird
i suspect it use so much memory, however i have already assign 30GB memory in openstack cloud is there any command to allow python to use more memory? currently program return killed after run a very long time -- https://mail.python.org/mailman/listinfo/python-list

Re: how to for loop append a list [] when using parallel programming

2016-06-15 Thread meInvent bbird
Gordon wrote: > In <fabcecae-04ae-433c-aad8-43993a21e...@googlegroups.com> meInvent bbird > <jobmatt...@gmail.com> writes: > > > how to for loop append a list [] when using parallel programming > > items = [] > for item in parallelized_object_fa

is there a concurrent list for append in parallel programming in python? how to pass parameter in this parallel program with pool?

2016-06-16 Thread meInvent bbird
is there like c# have concurrent list ? i find something these, but how can it pass an initlist list variable is it doing the same function as itertools.combinations ? def comb(n, initlist): # the argument n is the number of items to select res = list(itertools.combinations(initlist,

Re: type lookuperror

2016-08-18 Thread meInvent bbird
On Friday, August 19, 2016 at 5:37:32 AM UTC+8, Lawrence D’Oliveiro wrote: > On Friday, August 19, 2016 at 3:10:26 AM UTC+12, Chris Angelico wrote: > > What the OP was looking for was "I want my program to be able to debug > > itself". That means the program has to be smart enough to figure out >

how to set paramiko to use ssh version 1?

2016-09-01 Thread meInvent bbird
how to set paramiko to use ssh version 1? -- https://mail.python.org/mailman/listinfo/python-list

Re: how to automate java application in window using python

2016-09-16 Thread meInvent bbird
On Friday, September 16, 2016 at 2:26:47 AM UTC+8, bream...@gmail.com wrote: > On Thursday, September 15, 2016 at 8:13:05 AM UTC+1, meInvent bbird wrote: > > how to automate java application in window using python > > > > 1. scroll up or down of scroll bar > > 2. cl

how to robot recognize basic geometric object in window or ubuntu window

2016-09-16 Thread meInvent bbird
i am doing a robot to automate window itself with python i give some basic png diagram such as square, circle, triangle and hope it recognize all kinds of square like things in window such as textbox of notepad etc how a robot recognize basic geometric object in window or ubuntu window i use

Re: how to automate java application in window using python

2016-09-16 Thread meInvent bbird
On Thursday, September 15, 2016 at 3:52:41 PM UTC+8, Lawrence D’Oliveiro wrote: > On Thursday, September 15, 2016 at 7:13:05 PM UTC+12, meInvent bbird wrote: > > how to automate java application in window using python > > > > 1. scroll up or down of scroll bar > > 2. cl

Re: 'str' object has no attribute 'intersection' and unhashable set

2016-10-05 Thread meInvent bbird
for i, group in enumerate(wrapper(gr)): print('g{}:'.format(i), group) print("\n") On Wednesday, October 5, 2016 at 3:40:25 PM UTC+8, dieter wrote: > meInvent bbird <jobmatt...@gmail.com> writes: > ... not looking at the details ... > > &

how to read linux kernel source with pycparser

2016-10-04 Thread meInvent bbird
i expect to use pycparser to read linux kernel source and get a AST tree, but there are so many directory, how to read linux kernel source with pycparser? how to customize pycparser to search what we want such as bug or fix to make a linux patch for linux kernel source with python? --

'str' object has no attribute 'intersection' and unhashable set

2016-10-04 Thread meInvent bbird
def consolidate(sets): # http://rosettacode.org/wiki/Set_consolidation#Python:_Iterative setlist = [s for s in sets if s] for i, s1 in enumerate(setlist): if s1: for s2 in setlist[i+1:]: intersection = s1.intersection(s2) if

Re: how to read linux kernel source with pycparser (Reposting On Python-List Prohibited)

2016-10-04 Thread meInvent bbird
yes, i searched in google between 2011 and 2012 descending for loop is faster than ascending for loop On Wednesday, October 5, 2016 at 9:48:41 AM UTC+8, Chris Angelico wrote: > On Wed, Oct 5, 2016 at 12:41 PM, meInvent bbird <jobmatt...@gmail.com> wrote: > > so far i do not k

Re: how to read linux kernel source with pycparser (Reposting On Python-List Prohibited)

2016-10-04 Thread meInvent bbird
On Wednesday, October 5, 2016 at 2:34:49 AM UTC+8, Lawrence D’Oliveiro wrote: > On Tuesday, October 4, 2016 at 10:38:14 PM UTC+13, meInvent bbird wrote: > > how to customize pycparser to search what we want such as bug > > What kind of bug do you want to search for? so far i do

how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread meInvent bbird
how to refactor nested for loop into smaller for loop assume each of them independent? because memory is not enough for ii in range(1,2000): for jj in range(1,2000): for kk in range(1,2000): print run(ii,jj,kk) -- https://mail.python.org/mailman/listinfo/python-list

how to automate java application in window using python

2016-09-15 Thread meInvent bbird
how to automate java application in window using python 1. scroll up or down of scroll bar 2. click button 3. type text in textbox -- https://mail.python.org/mailman/listinfo/python-list

unexpected rerun program itself when using cv2 and selenium

2016-09-14 Thread meInvent bbird
unexpected rerun program itself when using cv2 and selenium when a script, it is expected to run once and stop but it start a new browser again when using selenium and cv2 d, bbox, filename) File "C:\Python27\lib\site-packages\pyscreenshot\procutil.py", line 28, in run _in_childprocess

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
be adjusted to do like second graph of sky blue line On Saturday, September 17, 2016 at 7:48:46 AM UTC+8, meInvent bbird wrote: > img is the image > > im is a new memory of image using img.copy() > > > On Saturday, September 17, 2016 at 7:46:42 AM UTC+8, meInvent bbird wrote: >

is it possible to adjust convex hull to draw blue line instead of green line?

2016-09-16 Thread meInvent bbird
i succeed to use code to draw green line, but green line not draw the large area, expect second uploaded picture, the blue line connect the bottom of red line graph im = img.copy() cntcounter = 0 for cnt in contours: #epsilon = 0.1*cv2.arcLength(cnt,True) #approx =

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
img is the image im is a new memory of image using img.copy() On Saturday, September 17, 2016 at 7:46:42 AM UTC+8, meInvent bbird wrote: > thank you very much, > it out of the loop now. > because drawLine function return things > > i just change drawLine to rectangle, >

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
ary Herron wrote: > > On 09/16/2016 04:24 AM, meInvent bbird wrote: > >> im = img.copy() > >> cntcounter = 0 > >> for cnt in contours: > >> epsilon = 0.1*cv2.arcLength(cnt,True) > >> approx = cv2.approxPolyDP(cnt,epsilon,True

Re: how to automate java application in window using python

2016-09-19 Thread meInvent bbird
Hi Matt Wheeler, can it contorl Maplesoft's maple which is a java executable file? On Sunday, September 18, 2016 at 5:02:15 PM UTC+8, Matt Wheeler wrote: > On Thu, 15 Sep 2016, 08:12 meInvent bbird, <jobmatt...@gmail.com> wrote: > > > how to automate java application in w

why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
im = img.copy() cntcounter = 0 for cnt in contours: epsilon = 0.1*cv2.arcLength(cnt,True) approx = cv2.approxPolyDP(cnt,epsilon,True) #peri = cv2.arcLength(cnt, True) #approx = cv2.approxPolyDP(c, 0.5 * peri, True)

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
y+h),(0,255,0),2) #im = cv2.line(im,(x,y),(x,y+h),(0,255,0),2) On Friday, September 16, 2016 at 7:34:04 PM UTC+8, Waffle wrote: > On 16 September 2016 at 14:24, meInvent bbird <jobmatt...@gmail.com> wrote: > > im = img.copy() > > cntcounter = 0 > > f

Re: how to automate java application in window using python

2016-09-16 Thread meInvent bbird
t 6:55:07 PM UTC+12, meInvent bbird > > wrote: > >> On Thursday, September 15, 2016 at 3:52:41 PM UTC+8, Lawrence > >> D’Oliveiro wrote: > >>> On Thursday, September 15, 2016 at 7:13:05 PM UTC+12, meInvent > >>> bbird wrote: > >>>>

Re: is it possible to adjust convex hull to draw blue line instead of green line?

2016-09-17 Thread meInvent bbird
On Saturday, September 17, 2016 at 9:35:35 AM UTC+8, Steve D'Aprano wrote: > On Sat, 17 Sep 2016 10:20 am, meInvent bbird wrote: > > > i succeed to use code to draw green line, but green line not draw the > > large area, expect second uploaded picture, the blue line connect >

Re: is it possible to adjust convex hull to draw blue line instead of green line?

2016-09-17 Thread meInvent bbird
On Saturday, September 17, 2016 at 2:31:59 PM UTC+8, meInvent bbird wrote: > On Saturday, September 17, 2016 at 9:35:35 AM UTC+8, Steve D'Aprano wrote: > > On Sat, 17 Sep 2016 10:20 am, meInvent bbird wrote: > > > > > i succeed to use code to draw green line,

Re: type lookuperror

2016-08-17 Thread meInvent bbird
rs='ignore')) Unexpected error: None On Thursday, August 18, 2016 at 10:22:43 AM UTC+8, Chris Angelico wrote: > On Thu, Aug 18, 2016 at 12:13 PM, meInvent bbird <jobmatt...@gmail.com> wrote: > > would like to check errors for every function i run, > > got error type lookuperr

type lookuperror

2016-08-17 Thread meInvent bbird
would like to check errors for every function i run, got error type lookuperror def checkexception(func, **kwargs): try: result = func(*tuple(value for _, value in kwargs.iteritems())) except: print "Unexpected error:", sys.exc_info()[0] try:

Re: type lookuperror

2016-08-18 Thread meInvent bbird
Otten <__pete...@web.de> wrote: > > meInvent bbird wrote: > > > >> when try keystone_client.tenants.get > >> got error, > >> > >> isn't this method for all kinds of function? > >> > >>>>> m = "4c9a0da00b

Re: type lookuperror

2016-08-18 Thread meInvent bbird
016 at 5:44 PM, meInvent bbird <jobmatt...@gmail.com> wrote: > > if i use > > > > result = "" > > before try > > and return result at the end > > > > as return of function can be any type > > > > there will be type mismatch

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-09 Thread meInvent bbird
https://social.msdn.microsoft.com/Forums/vstudio/en-US/5f0a9a51-a256-4671-a5fc-e213949e7204/how-to-refactor-3-nested-for-loop-into-smaller-for-loop-assume-each-of-them-independent?forum=csharpgeneral since when i dsolve a differential ideal used near 5GB memory for one ideal , i feel that i

is it possible use python to run another main point or function in some range of memory in executable file

2016-10-25 Thread meInvent bbird
is it possible python to run another main point or function in some range of memory in executable file -- https://mail.python.org/mailman/listinfo/python-list

Re: how to evaluate a ast tree and change Add to Multiply ?

2016-10-25 Thread meInvent bbird
6 at 12:34:55 AM UTC+8, Jerry Hill wrote: > On Wed, Oct 12, 2016 at 5:55 AM, meInvent bbird <jobmatt...@gmail.com> wrote: > > i just expect to > > rewrite + become multiply > > by edit the example in the link provided > > This seems to work. You need to define v

what is the procedure or how to plan how many nodes of dispy need for dsolve differential system in amazon cloud in limited time such as 1 hour, 2 hours.etc

2016-11-10 Thread meInvent bbird
what is the procedure or how to plan how many nodes of dispy need for dsolve differential system in amazon cloud in limited time such as 1 hour, 2 hours.etc ? #For Amazon Linux, the user name is ec2-user. For RHEL5, the user name is either root or ec2-user. #For Ubuntu, the user name is

Re: how to send a json of yield list

2016-10-14 Thread meInvent bbird
succeed to run, is it the yield return the whole list 2000 * 2000 * 2000 items? as i know that yield is return [1,1,1] etc one by one once it get if it return 2000*2000*2000 items, why? i have to add a queue get this yield in order to succeed but i do not understand the situation when using

Re: how to use pycallgraph in ubuntu and window?

2016-10-14 Thread meInvent bbird
succeed to draw graph, thanks originally i think pip install graphviz is enough then search again there is an win32 executable file graphviz need to be install On Friday, October 14, 2016 at 2:58:48 PM UTC+8, dieter wrote: > meInvent bbird <jobmatt...@gmail.com> writes: > &

Re: how to send a json of yield list

2016-10-14 Thread meInvent bbird
when not to use queue, it is faster now while True: for ii in getcombinations(): item = ii print(item) sock.send(json.dumps(ii)) On Friday, October 14, 2016 at 5:11:35 PM UTC+8, meInvent bbird wrote: > succeed to run, > > is it the yield return

how to simulate the situation in DNA evolution for finding the minimum population needed and minimum samples selected to mating in order to no extinction in any one of original species and new species

2016-11-17 Thread meInvent bbird
how to simulate the situation in DNA evolution for finding the minimum population needed and minimum samples selected to mating in order to no extinction in any one of original species and new species assume mating are randomly selected to become a couple, how to keep species good which means

Re: how to simulate the situation in DNA evolution for finding the minimum population needed and minimum samples selected to mating in order to no extinction in any one of original species and new spe

2016-11-18 Thread meInvent bbird
i noticed the faces of human repeated or similar, and would like to prove whether evolution a several generations will return to the original intelligence of ancester On Friday, November 18, 2016 at 1:55:31 PM UTC+8, meInvent bbird wrote: > how to simulate the situation in DNA evolut

Re: how to debug this distributed program?

2016-11-01 Thread meInvent bbird
tlee2\Downloads\datacenterusekey.ppk") On Tuesday, November 1, 2016 at 3:58:24 PM UTC+8, Steve D'Aprano wrote: > On Tue, 1 Nov 2016 06:40 pm, meInvent bbird wrote: > > > how to debug this distributed program? > > > The same way you would debug any other

how to debug this distributed program?

2016-11-01 Thread meInvent bbird
https://drive.google.com/open?id=0Bxs_ao6uuBDUSEc5S3U3Nko5ZjA A. i am not sure whether parameter start from 0 or 1 n[0] or n[1] in compute function B. it run a very long time and nothing to see in amazon linux instance there is no python program in top command C. in distributed programming web

how to compile this code

2016-11-01 Thread meInvent bbird
would like to change Add operator to custom function op2 in solve function and then this solve([x*y - 1, x + 2], x, y) during solve, the parameters also change Add to custom function op2 import ast from __future__ import division from sympy import * x, y, z, t = symbols('x y z t') k, m, n =

Re: how to compile this code

2016-11-01 Thread meInvent bbird
2016 at 9:04:43 PM UTC+8, Yann Kaiser wrote: > You want to replace the `Add` ast with a `Call` ast rather than just > calling your function. > > Something like: > > if isinstance(node.op, ast.Add): > return ast.Call(some_ast_expression_that_will_evaluate_to_op, >

how to faster to know which ast name or id we want to change?

2016-10-12 Thread meInvent bbird
how to faster to know which ast name or id we want to change? because i use ast.walk to print all nodes then i know the name + is Add if using cparser to parse linux kernel, it will be a very large -- https://mail.python.org/mailman/listinfo/python-list

Re: how to evaluate a ast tree and change Add to Multiply ?

2016-10-12 Thread meInvent bbird
i use example here http://greentreesnakes.readthedocs.io/en/latest/examples.html On Wednesday, October 12, 2016 at 5:47:12 PM UTC+8, Chris Angelico wrote: > On Wed, Oct 12, 2016 at 8:32 PM, meInvent bbird <jobmatt...@gmail.com> wrote: > > class ChangeAddtoMultiply(ast.

how to evaluate a ast tree and change Add to Multiply ?

2016-10-12 Thread meInvent bbird
import sys import parser import ast from collections import deque class ChangeAddtoMultiply(ast.NodeTransformer): """Wraps all integers in a call to Integer()""" def visit_Num(self, node): if isinstance(node.n, int): return ast.Call(func=ast.Name(id='Add',

Re: how to evaluate a ast tree and change Add to Multiply ?

2016-10-12 Thread meInvent bbird
=[]) On Wednesday, October 12, 2016 at 5:53:42 PM UTC+8, meInvent bbird wrote: > i use example here > > http://greentreesnakes.readthedocs.io/en/latest/examples.html > > > > > On Wednesday, October 12, 2016 at 5:47:12 PM UTC+8, Chris Angelico wrote: > > O

why solveset and dsolve do not have _fields for ast.walk?

2016-10-12 Thread meInvent bbird
Traceback (most recent call last): File "astgraphforsympy.py", line 86, in print get_func_calls(tree) File "astgraphforsympy.py", line 48, in get_func_calls for node in ast.walk(tree): File "C:\Python27\lib\ast.py", line 213, in walk todo.extend(iter_child_nodes(node)) File

how to use pycallgraph in ubuntu and window?

2016-10-13 Thread meInvent bbird
i install in ubunbu 14 pip install graphviz pip install pycallgraph martin@ubuntu:~/Downloads$ pycallgraph graphviz -- ./pusher.py Traceback (most recent call last): File "/usr/local/bin/pycallgraph", line 25, in with __pycallgraph.PyCallGraph(config=__config): File

how to send a json of yield list

2016-10-13 Thread meInvent bbird
after google a several solutions, First method i searched has memory error sock.send(json.dumps(StreamArray())) Traceback (most recent call last): File "pusher.py", line 43, in sock.send(json.dumps(StreamArray())) File "C:\Python27\lib\json\__init__.py", line 243, in dumps return

Can't pickle : attribute lookup __builtin__.gen erator failed

2016-10-14 Thread meInvent bbird
Traceback (most recent call last): File "C:\Python27\lib\multiprocessing\queues.py", line 262, in _feed send(obj) PicklingError: Can't pickle : attribute lookup __builtin__.gen erator failed #python pusher.py tcp://*:8080 import sys import time import zmq from multiprocessing import Queue

Re: how to read linux kernel source with pycparser

2016-10-13 Thread meInvent bbird
1 "rt.c" # 1 "sched.h" 1 # 1 "/usr/include/linux/sched.h" 1 3 4 # 2 "sched.h" 2 In file included from rt.c:6:0: sched.h:2:32: fatal error: linux/sched/sysctl.h: No such file or directory compilation terminated. # 1 "stats.c" # 1 "" # 1 "