Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing
Paul Rubin wrote: Well, at least I refrained from saying that monads are like burritos! But they are! See: http://blog.plover.com/prog/burritos.html Oh, undoubtedly. I just don't think it helps understand how burritos are used in prog... er, that is, how monads... well, you know what I mean.

Re: Signals and Threads in Python 3.5 or so

2016-10-09 Thread Marko Rauhamaa
Dan Stromberg : > That bug is: if you control-C the top-level process, all the > subprocesses are left running. Sorry, don't have a solution for your particular Python situation. > I've been thinking about making it catch SIGINT, SIGTERM and SIGHUP, > and having it SIGKILL its active subprocesses

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

2016-10-09 Thread Ho Yeung Lee
Sorry my calculation is wrong, it should have around 14 billions of combinations after using program to count. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Rustom Mody
On Sunday, October 9, 2016 at 1:18:32 PM UTC+5:30, Gregory Ewing wrote: > Here's the first part of the essay I said I'd write about > monads: > > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html > > Hope it's useful, > Greg Thanks Greg... looks v useful... the co

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 need

Solid Approach For Creating A Desktop Application

2016-10-09 Thread Mahan Marwat
I want to know what will be your approach creating a solid/reliable application in Python? i.e 1. Which GUI framework will you use i.e PyQT or what? (will you make it work removing the window default border) 2. What will you use for it's style/appearance i.e CSS or what? 3. Which tool will you us

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 11:38 AM, Matt Wheeler wrote: > On Mon, 10 Oct 2016, 00:56 Ian Kelly, wrote: > >> On Oct 9, 2016 2:57 PM, wrote: >> The Pythonic way >> >> if b >= a <= c: >> ... >> >> >> Better: >> >> if a <= b <= c: >> ... >> > > That's not equivalent. Consider `a, b, c = 1, 7,

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Matt Wheeler
On Mon, 10 Oct 2016, 00:56 Ian Kelly, wrote: > On Oct 9, 2016 2:57 PM, wrote: > The Pythonic way > > if b >= a <= c: > ... > > > Better: > > if a <= b <= c: > ... > That's not equivalent. Consider `a, b, c = 1, 7, 4` > Using consistent operators is not required but is easier to read a

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
> Well, at least I refrained from saying that monads are like burritos! But they are! See: http://blog.plover.com/prog/burritos.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Signals and Threads in Python 3.5 or so

2016-10-09 Thread Paul Rubin
Dan Stromberg writes: > That bug is: if you control-C the top-level process, all the > subprocesses are left running. Are you setting the daemon flag? -- https://mail.python.org/mailman/listinfo/python-list

Re: Signals and Threads in Python 3.5 or so

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 10:52 AM, Dan Stromberg wrote: > That bug is: if you control-C the top-level process, all the > subprocesses are left running. > > I've been thinking about making it catch SIGINT, SIGTERM and SIGHUP, > and having it SIGKILL its active subprocesses upon receiving one of > th

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Ben Finney
Gregory Ewing writes: > Here's the first part of the essay I said I'd write about > monads: Thank you for tackling this. > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html You appreciate an important feature of this: Often it is presented in a very abstrac

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Ian Kelly
On Oct 9, 2016 2:57 PM, wrote: On Sunday, October 9, 2016 at 2:41:41 PM UTC+1, BartC wrote: > def min3(a,b,c): > if a<=b and a<=c: > return a > elif b<=a and b<=c: > return b > else: > return c The Pythonic way if b >= a <= c: ... Better: if a <=

Signals and Threads in Python 3.5 or so

2016-10-09 Thread Dan Stromberg
I have a program http://stromberg.dnsalias.org/~dstromberg/looper/ that I use and maintain. It's like GNU parallel or similar - yet another "run n processes, m at a time" implementation. Interestingly, I've only used/tested it on Linux, but it's under a Microsoft copyright because Microsoft acqui

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

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 9:40 AM, Marko Rauhamaa wrote: > Chris Angelico : >> Yeah, if it's just for progress status. Of course, that does assume >> that the run() function doesn't have anything particularly costly in >> it. If it does, well, dis gonna take a while > > Dealing with multigigabyt

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

2016-10-09 Thread Marko Rauhamaa
Chris Angelico : > Yeah, if it's just for progress status. Of course, that does assume > that the run() function doesn't have anything particularly costly in > it. If it does, well, dis gonna take a while Dealing with multigigabyte data streams is not over the top nowadays. Marko -- https:/

Re: How to read maple .m file into Python?

2016-10-09 Thread breamoreboy
On Sunday, October 9, 2016 at 10:00:26 PM UTC+1, Ho Yeung Lee wrote: > i saved a list of matrix of algebra into .m file in maple > How to read and import into Python for sympy to use? I'd start here http://www.maplesoft.com/support/help/Maple/view.aspx?path=UserManual/Chapter11 which was the fir

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

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 4:57 AM, BartC wrote: > On 09/10/2016 18:33, Jussi Piitulainen wrote: >> >> Chris Angelico writes: >> >>> On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote: {This response is delayed as I'm waiting for the program to complete so I can get the run

Re: calculator between raster

2016-10-09 Thread chrischris201444
Τη Κυριακή, 9 Οκτωβρίου 2016 - 11:55:54 μ.μ. UTC+3, ο χρήστης chrischr...@gmail.com έγραψε: > any idea how to calculator rasters images ?like > ((raster1+raster2)*(raster4*9)} > for example. > maybe is easy that question but i dont work again with raster and python > i have gdal,numpy,scipy,pygeo

Re: calculator between raster

2016-10-09 Thread Christian Gollwitzer
Am 09.10.16 um 22:55 schrieb chrischris201...@gmail.com: any idea how to calculator rasters images ?like ((raster1+raster2)*(raster4*9)} for example. maybe is easy that question but i dont work again with raster and python i have gdal,numpy,scipy,pygeoprocesing and more With PIL you can read an i

How to split a large nested for loop and distribute to hundreds of Amazon instance to run this kind of Python code?

2016-10-09 Thread Ho Yeung Lee
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 I wrote a algorithm to split for loop to generate maplesoft code for limited memory Assume I conv

How to read maple .m file into Python?

2016-10-09 Thread Ho Yeung Lee
i saved a list of matrix of algebra into .m file in maple How to read and import into Python for sympy to use? -- https://mail.python.org/mailman/listinfo/python-list

calculator between raster

2016-10-09 Thread chrischris201444
any idea how to calculator rasters images ?like ((raster1+raster2)*(raster4*9)} for example. maybe is easy that question but i dont work again with raster and python i have gdal,numpy,scipy,pygeoprocesing and more -- https://mail.python.org/mailman/listinfo/python-list

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Larry Hudson via Python-list
On 10/09/2016 05:01 AM, Cai Gengyang wrote: def min3(a, b, c): min3 = a if b < min3: min3 = b if c < min3: min3 = c if b < c: min3 = b return min3 print(min3(4, 7, 5)) 4 This is NOT a recommendation here, just a different way of looking a

Re: Python Data base help

2016-10-09 Thread breamoreboy
On Sunday, October 9, 2016 at 7:56:57 PM UTC+1, Risat Haque wrote: > Hey, i have a data base filled with numbers from a recent drone flight. IT > contains, alt, long, lat, and time. > In python, i want to ask the user to put in a time : > askTime = (input("Choose a time (HourMinSec):")) > > With

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread breamoreboy
On Sunday, October 9, 2016 at 2:41:41 PM UTC+1, BartC wrote: > On 09/10/2016 13:01, Cai Gengyang wrote: > > I'm moving on to chapter 9 > > (http://programarcadegames.com/index.php?lang=en&chapter=lab_functions) of > > programarcadegames for the time being and going back to chapter 8 later > > (i

Re: Passing Variable to Function

2016-10-09 Thread alister
On Fri, 07 Oct 2016 19:06:54 +, John McKenzie wrote: > Brendan and Alister, thank you both for responding. > > I am very inexperienced with python, but not new to computers so on my > own I realized the strings vs number mistake. (I seem to work with and > learn about Python for a few weeks

Re: Python Data base help

2016-10-09 Thread Irmen de Jong
On 9-10-2016 20:56, Risat Haque wrote: > Hey, i have a data base filled with numbers from a recent drone flight. IT > contains, alt, long, lat, and time. > In python, i want to ask the user to put in a time : > askTime = (input("Choose a time (HourMinSec):")) > > With this, I need it to search t

Re: BeautifulSoup help !!

2016-10-09 Thread alister
On Fri, 07 Oct 2016 03:12:32 +1100, Steve D'Aprano wrote: > On Fri, 7 Oct 2016 02:30 am, alister wrote: > >> On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: >> >>> So I've just started up with python and an assignment was given to me >>> by a company as an recruitment task. >>> >> so

Python Data base help

2016-10-09 Thread Risat Haque
Hey, i have a data base filled with numbers from a recent drone flight. IT contains, alt, long, lat, and time. In python, i want to ask the user to put in a time : askTime = (input("Choose a time (HourMinSec):")) With this, I need it to search through the entire data base to find that number.

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

2016-10-09 Thread BartC
On 09/10/2016 18:33, Jussi Piitulainen wrote: Chris Angelico writes: On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote: {This response is delayed as I'm waiting for the program to complete so I can get the run time} {Well... it's been near 24 hours and still merrily scrolling sums on m

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

2016-10-09 Thread Jussi Piitulainen
Chris Angelico writes: > On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote: >> {This response is delayed as I'm waiting for the program to complete so I >> can get the run time} >> {Well... it's been near 24 hours and still merrily scrolling sums on my >> console -- so I'm going to kill th

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

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 12:26 AM, Dennis Lee Bieber wrote: > {This response is delayed as I'm waiting for the program to complete so I > can get the run time} > {Well... it's been near 24 hours and still merrily scrolling sums on my > console -- so I'm going to kill the running program} Eight BIL

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Chris Angelico
On Mon, Oct 10, 2016 at 12:41 AM, BartC wrote: > The exercise says you must use an if/elif chain. The first thing that comes > to mind is: > > def min3(a,b,c): > if a<=b and a<=c: > return a > elif b<=a and b<=c: > return b > else: > return c > > The bit about n

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > Not sure where I got [h|t] from -- maybe I was thinking of Prolog?) I've never used Prolog. Erlang is said to have Prolog-like syntax and it uses [h|t], so maybe Prolog uses it too. (Erlang was originally written in Prolog). -- https://mail.python.org/mailman/listinfo/p

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread BartC
On 09/10/2016 13:01, Cai Gengyang wrote: I'm moving on to chapter 9 (http://programarcadegames.com/index.php?lang=en&chapter=lab_functions) of programarcadegames for the time being and going back to chapter 8 later (its just fucking frustrating and doesn't seem to work for the time being and I

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Ben Bacarisse
Cai Gengyang writes: > I'm moving on to chapter 9 > (http://programarcadegames.com/index.php?lang=en&chapter=lab_functions) > of programarcadegames for the time being and going back to chapter 8 > later (its just fucking frustrating and doesn't seem to work for the > time being and I have a very

Function to take the minimum of 3 numbers

2016-10-09 Thread Cai Gengyang
I'm moving on to chapter 9 (http://programarcadegames.com/index.php?lang=en&chapter=lab_functions) of programarcadegames for the time being and going back to chapter 8 later (its just fucking frustrating and doesn't seem to work for the time being and I have a very bad temper). At least for c

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread BartC
On 09/10/2016 11:35, Gregory Ewing wrote: Paul Rubin wrote: Gregory Ewing writes: http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/ Well, at least I refrained f

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing
Paul Rubin wrote: Gregory Ewing writes: http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/ Well, at least I refrained from saying that monads are like burritos! I

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing
Paul Rubin wrote: [h|t] should say h:t . Thanks, corrected. (You can probably tell I'm not a regular Haskell user. Not sure where I got [h|t] from -- maybe I was thinking of Prolog?) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html Erratum in Haskell section: Lists in Haskell are linked lists, and [h|t] represents a list whose first element is h and the rest of the list is t. [h|t] should say h:t . -- https:/

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

2016-10-09 Thread Gregory Ewing
Chris Angelico wrote: Fascinating! What about: except sys.intern('type error') ? Or does interning of strings not exist yet :) Even if it was, I don't think there was any guarantee that the "official" strings representing those exceptions would be interned. You were supposed to use the provide

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/ -- https://mail.python.org/mailman/listinfo/python-list

Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing
Here's the first part of the essay I said I'd write about monads: http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html Hope it's useful, Greg -- https://mail.python.org/mailman/listinfo/python-list