not even be a single coroutine
involved.
Someone else asked something similar here:
https://stackoverflow.com/questions/65684730/what-is-the-pythonic-way-of-running-an-asyncio-event-loop-forever
Unfortunately all proposed answers look like dirty hacks.
In concrete, how do I do this nicel
On 2019-02-16, Barry wrote:
> On 11 Feb 2019, at 20:00, Felix Lazaro Carbonell wrote:
>
>>> The most pythonic way is to do this:
>>>
>>> def find_monthly_expenses(month=datetime.date.today().month,
>> year=datetime.date.today().year):
>>>
On 11 Feb 2019, at 20:00, Felix Lazaro Carbonell wrote:
>> The most pythonic way is to do this:
>>
>> def find_monthly_expenses(month=datetime.date.today().month,
> year=datetime.date.today().year):
>>...
This has subtle bugs.
The default is calculate
The first one is used very often. Less verbose
Le 11 févr. 2019 à 20:41, à 20:41, Felix Lazaro Carbonell
a écrit:
>
>
>Hello to everyone:
>
>Could you please tell me wich way of writing this method is more
>pythonic:
>
>
>
>..
>
>def find_monthly_expenses(month=None, year=None):
>
>
Felix Lazaro Carbonell wrote:
> Hello to everyone:
> Could you please tell me wich way of writing this method is more pythonic:
> def find_monthly_expenses(month=None, year=None):
>
> month = month or datetime.date.today()
> Or it should better be:
> if not month:
>
today()
>>
>> Or it should better be:
>>
>> if not month:
>> month = datetime.date.today()
>
> The most pythonic way is to do this:
>
>def find_monthly_expenses(month=datetime.date.today().month,
>year=datetime.date.today().year)
tations or overrides, etc.
>
>
> -Original Message-
> From: Python-list [mailto:python-list-bounces+david.raymond=
> tomtom@python.org] On Behalf Of Felix Lazaro Carbonell
> Sent: Monday, February 11, 2019 2:30 PM
> To: python-list@python.org
> Subject: more py
On 2/11/2019 2:46 PM, Felix Lazaro Carbonell wrote:
def find_monthly_expenses(month=None, year=None):
month = month or datetime.date.today().month
Or it should better be:
if not month:
month = datetime.date.today().month
As a 20+ year veteran, I would be
lementations or overrides, etc.
-Original Message-
From: Python-list
[mailto:python-list-bounces+david.raymond=tomtom@python.org] On Behalf Of
Felix Lazaro Carbonell
Sent: Monday, February 11, 2019 2:30 PM
To: python-list@python.org
Subject: more pythonic way
Hello to everyone:
Could you
-Mensaje original-
De: Python-list [mailto:python-list-bounces+felix=epepm.cupet...@python.org]
En nombre de Grant Edwards
Enviado el: lunes, 11 de febrero de 2019 02:46 p.m.
Para: python-list@python.org
Asunto: Re: more pythonic way
On 2019-02-11, Felix Lazaro Carbonell wrote
Sorry I meant
..
def find_monthly_expenses(month=None, year=None):
month = month or datetime.date.today().month
..
Or it should better be:
...
if not month:
month = datetime.date.today().month
..
Cheers,
Felix.
--
https://mail.python.org/mailman
gt; if not month:
> month = datetime.date.today()
The most pythonic way is to do this:
def find_monthly_expenses(month=datetime.date.today().month,
year=datetime.date.today().year):
...
And then start a month-long argument on the mailing list about how the
behavior of parameter
Hello to everyone:
Could you please tell me wich way of writing this method is more pythonic:
..
def find_monthly_expenses(month=None, year=None):
month = month or datetime.date.today()
..
Or it should better be:
...
if not month:
month = datetime.d
ally generalizes to
>> is “what is the most pythonic way to transform one sequence of bytes where
>> some bytes are passed through 1:1, but others are transformed to longer
>> subsequences of bytes?” I’m pretty sure this rules out the use of
>> transform() which expects a 1
On 2018-04-17 17:02, Travis Griggs wrote:
I posted this on SO, but… yeah…
I'm doing some serial protocol stuff and want to implement a basic byte
stuffing algorithm in python. Though really what this really generalizes to is
“what is the most pythonic way to transform one sequence of
On 2018-04-17, Travis Griggs wrote:
> I posted this on SO, but… yeah…
>
> I'm doing some serial protocol stuff and want to implement a basic
> byte stuffing algorithm in python. Though really what this really
> generalizes to is “what is the most pythonic way to transfo
I posted this on SO, but… yeah…
I'm doing some serial protocol stuff and want to implement a basic byte
stuffing algorithm in python. Though really what this really generalizes to is
“what is the most pythonic way to transform one sequence of bytes where some
bytes are passed through 1:1
On Wednesday, 6 January 2016 18:37:22 UTC-8, high5s...@gmail.com wrote:
> I have a list of 163.840 integers. What is a fast & pythonic way to process
> this list in 1,280 chunks of 128 integers?
Thanks all for your valuable input - much appreciated!
--
https://mail.python.org/mailma
high5stor...@gmail.com wrote:
> I have a list of 163.840 integers. What is a fast & pythonic way to
> process this list in 1,280 chunks of 128 integers?
What kind of processing do you have in mind?
If it is about numbercrunching use a numpy.array. This can also easily
change
On 06Jan2016 18:36, high5stor...@gmail.com wrote:
I have a list of 163.840 integers. What is a fast & pythonic way to process
this list in 1,280 chunks of 128 integers?
The depends. When you say "list", is it already a _python_ list? Or do you just
mean that the intergers ar
On 2016-01-06 18:36, high5stor...@gmail.com wrote:
> I have a list of 163.840 integers. What is a fast & pythonic way to
> process this list in 1,280 chunks of 128 integers?
That's a modest list, far from huge.
You have lots of options, but the following seems the most pythoni
On 1/6/2016 9:36 PM, high5stor...@gmail.com wrote:
I have a list of 163.840 integers. What is a fast & pythonic way to process
this list in 1,280 chunks of 128 integers?
What have you tried that did not work? This is really pretty simple,
but the detail depend on the meaning of '
I have a list of 163.840 integers. What is a fast & pythonic way to process
this list in 1,280 chunks of 128 integers?
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
> def get_html(...):
> try:
> ... actually go get the info
> return info
> except (ConnectionError, OSError, SocketError) as e:
> raise ContentNotFoundError from e
Personally, I never liked "early returns". I would rather used a variable and
the last line in t
Hi,
You are right. I am trying to address a few questions at the same time.
As English is not my first language, I can only say that you have addressed
them very well. Thanks.
1. Where to put the try/except block, inside or outside the function
2. How to deal with un-anticipated exceptions
3.
Hi,
If I may, I feel you are tying to address a few questions at the same time,
although they are related
1. Where to put the try/except block, inside or outside the function
2. How to deal with un-anticipated exceptions
3. How to keep record
My personal feelings are:
1. Kind of prefer try/except
在 2015年11月4日星期三 UTC-6下午10:18:33,zlju...@gmail.com写道:
> > Which would you prefer?
>
> So if I am just checking for the ConnectionError in get_html and a new
> exception arises, I will have traceback to the get_html function showing that
> unhandled exception has happened.
> Now I have to put addi
On Thu, Nov 5, 2015 at 3:18 PM, wrote:
>> Which would you prefer?
>
> So if I am just checking for the ConnectionError in get_html and a new
> exception arises, I will have traceback to the get_html function showing that
> unhandled exception has happened.
> Now I have to put additional excepti
> Which would you prefer?
So if I am just checking for the ConnectionError in get_html and a new
exception arises, I will have traceback to the get_html function showing that
unhandled exception has happened.
Now I have to put additional exception block for managing the new exception in
the get
On Monday, 2 November 2015 21:59:45 UTC+1, Ian wrote:
> I'm having a hard time understanding what question you're asking.
:)
I am really having a hard time to explain the problem as English is not my
first language.
> You
> have a lot of discussion about where to handle exceptions,
That's
On Thu, Nov 5, 2015 at 2:41 PM, wrote:
> Raising an exception forces me to put every call of the get_html function in
> try/except block.
> If I am returning a special value, than I can call get_html and then test the
> value.
>
> I am not sure which approach is better.
Raising an exception me
> The best way is probably to do nothing at all, and let the caller handle
> any exceptions.
In that case every call of the get_html function has to be in the try/except
block with many exceptions.
Sometimes, it is enough just to know whether I managed to get the html or not.
In that case, I coul
On Mon, Nov 2, 2015 at 12:24 PM, wrote:
> I have read some articles that returning None is not a good approach, so I am
> confused.
>
> How to handle exceptions properly in a pythonic way?
I'm having a hard time understanding what question you're asking. You
have a l
In <4b303213-62e2-42d4-b2f6-4fc1f6025...@googlegroups.com> zljubi...@gmail.com
writes:
> Let's say that I have the following simple function:
> def get_html(url):
> wpage = requests.get(url)
>
> return wpage.text
> How to handle exceptions properly that can arise during execution
e. Caller doesn't need try/except block anymore. Something like this:
if get_html('www.abc.com/index.html') is not None:
I_am_sure_that_html_has_been_downloaded_correctly
Now if I want to catch a new exception, I can catch it in get_html function,
which is the only change in the program.
I
On Thu, Aug 6, 2015 at 5:33 PM, Steven D'Aprano
wrote:
> On Thursday 06 August 2015 10:07, Chris Angelico wrote:
>
>> On Thu, Aug 6, 2015 at 9:43 AM, Tim Chase
>> wrote:
>>> Significant whitespace? Not usually simple (just stuck touching a
>>> project where someone committed with tons of trailin
On Thursday 06 August 2015 10:07, Chris Angelico wrote:
> On Thu, Aug 6, 2015 at 9:43 AM, Tim Chase
> wrote:
>> Significant whitespace? Not usually simple (just stuck touching a
>> project where someone committed with tons of trailing whitespaces.
>> grumble), so strip 'em off as if they're an e
On Thursday, August 6, 2015 at 6:32:03 AM UTC+5:30, Rustom Mody wrote:
> By contrast here is a more friendly error message (had put a comma where a
> colon
> required)
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib/python3.4/ast.py", line 46, in literal_eval
>
On Thursday, August 6, 2015 at 2:31:52 AM UTC+5:30, Tim Chase wrote:
> On 2015-08-05 06:37, Rustom Mody wrote:
> > > config = {}
> > > with open('config.ini') as f:
> > > for row in f:
> > > row = row.strip()
> > > if not row or row.startswith(('#', ';')):
> > > continue
On Thu, Aug 6, 2015 at 9:43 AM, Tim Chase wrote:
> Significant whitespace? Not usually simple (just stuck touching a
> project where someone committed with tons of trailing whitespaces.
> grumble), so strip 'em off as if they're an error condition. I've
> never had a config-file where I wanted l
On 2015-08-06 00:47, Marko Rauhamaa wrote:
> > There's a certain simplicity to simply having key/value pairs
> > separated by an "=" and then letting the application do whatever
> > it needs/wants with those key/value strings.
>
> That trap has lured in a lot of wildlife.
>
> What to do with li
Tim Chase :
> There's a certain simplicity to simply having key/value pairs
> separated by an "=" and then letting the application do whatever it
> needs/wants with those key/value strings.
That trap has lured in a lot of wildlife.
What to do with lists?
Is whitespace significant?
Case in poin
On 2015-08-05 06:37, Rustom Mody wrote:
> > config = {}
> > with open('config.ini') as f:
> > for row in f:
> > row = row.strip()
> > if not row or row.startswith(('#', ';')):
> > continue
> > k, _, v = row.partition('=')
> > config[k.strip().upper()] = v.lst
On Wednesday, August 5, 2015 at 7:38:46 PM UTC+5:30, Steven D'Aprano wrote:
> On Wed, 5 Aug 2015 11:46 pm, Rustom Mody wrote:
>
> > On Sunday, August 2, 2015 at 3:44:51 PM UTC+5:30, Cecil Westerhof wrote:
> >> There are a lot of ways to store configuration information:
> >> - conf file
> >> - xml
On Wed, 5 Aug 2015 11:46 pm, Rustom Mody wrote:
> On Sunday, August 2, 2015 at 3:44:51 PM UTC+5:30, Cecil Westerhof wrote:
>> There are a lot of ways to store configuration information:
>> - conf file
>> - xml file
>> - database
>> - json file
>> - and possible a lot of other ways
>
> One that I
On 2015-08-05, Michael Torrie wrote:
> On 08/04/2015 01:59 PM, Ben Finney wrote:
>> marco.naw...@colosso.nl writes:
>>
>>> Why not use Python files itself as configuration files?
>>
>> Because configuration data will be user-editable. (If it's not
>> user-editable, that is itself a poor design c
On Sunday, August 2, 2015 at 3:44:51 PM UTC+5:30, Cecil Westerhof wrote:
> There are a lot of ways to store configuration information:
> - conf file
> - xml file
> - database
> - json file
> - and possible a lot of other ways
One that I dont think has been mentioned:
ast.literal_eval
--
https://m
On Wednesday, August 5, 2015 at 6:58:01 PM UTC+5:30, Tim Chase wrote:
> On 2015-08-02 12:11, Cecil Westerhof wrote:
> > There are a lot of ways to store configuration information:
> > - conf file
> > - xml file
> > - database
> > - json file
> > - and possible a lot of other ways
> >
> > I want to
On 2015-08-02 12:11, Cecil Westerhof wrote:
> There are a lot of ways to store configuration information:
> - conf file
> - xml file
> - database
> - json file
> - and possible a lot of other ways
>
> I want to write a Python program to display cleaned log files. I do
> not think I need a lot of c
On Wed, Aug 5, 2015 at 6:32 PM, Steven D'Aprano
wrote:
> My own personal feeling is that using code as config is a little
> disquieting. It's a bit of a code smell. Do you really need that much power
> just to allow people to set some configuration settings? Using a Turing
> Complete programming l
On Wednesday 05 August 2015 05:59, Ben Finney wrote:
> marco.naw...@colosso.nl writes:
>
>> Why not use Python files itself as configuration files?
>
> Because configuration data will be user-editable. (If it's not
> user-editable, that is itself a poor design choice.)
>
> If you allow executab
Rustom Mody writes:
> Does yaml have comments?
Yes, the same syntax as Python's.
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it | -- Fortunato Depero, 1929.
On Wednesday, August 5, 2015 at 10:19:11 AM UTC+5:30, Michael Torrie wrote:
> On 08/04/2015 08:44 PM, wrote:
> > On Tue, Aug 4, 2015, at 21:32, Michael Torrie wrote:
> >> In many of my projects I put basic config variables in a file like
> >> config.py and import that in each module that needs it.
On 08/04/2015 08:19 PM, Cameron Simpson wrote:
> So on the whole I am against python code as the config file format. Really,
> who
> needs a Turing complete configuration file?
In Django's case, since you're intimately referring to certain classes
and methods, particularly in the url mapping sec
On 08/04/2015 08:44 PM, random...@fastmail.us wrote:
> On Tue, Aug 4, 2015, at 21:32, Michael Torrie wrote:
>> In many of my projects I put basic config variables in a file like
>> config.py and import that in each module that needs it. The config
>> module doubles as a global namespace for sharin
On Tue, Aug 4, 2015, at 21:32, Michael Torrie wrote:
> In many of my projects I put basic config variables in a file like
> config.py and import that in each module that needs it. The config
> module doubles as a global namespace for sharing between modules as well.
What about JSONP? That is, a f
On 04Aug2015 19:32, Michael Torrie wrote:
On 08/04/2015 01:59 PM, Ben Finney wrote:
marco.naw...@colosso.nl writes:
Why not use Python files itself as configuration files?
Because configuration data will be user-editable. (If it's not
user-editable, that is itself a poor design choice.)
If
On 08/04/2015 01:59 PM, Ben Finney wrote:
> marco.naw...@colosso.nl writes:
>
>> Why not use Python files itself as configuration files?
>
> Because configuration data will be user-editable. (If it's not
> user-editable, that is itself a poor design choice.)
>
> If you allow executable code to b
marco.naw...@colosso.nl writes:
> Why not use Python files itself as configuration files?
Because configuration data will be user-editable. (If it's not
user-editable, that is itself a poor design choice.)
If you allow executable code to be user-edited, that opens your program
to arbitrary injec
On Tuesday, August 4, 2015 at 7:06:33 PM UTC+2, Irmen de Jong wrote:
> On 4-8-2015 16:53, marco.naw...@colosso.nl wrote:
> > Why not use Python files itself as configuration files?
>
> It could create a security risk if the config files are user-editable.
> (it will make it easy to inject code int
On 4-8-2015 16:53, marco.naw...@colosso.nl wrote:
> Why not use Python files itself as configuration files?
It could create a security risk if the config files are user-editable.
(it will make it easy to inject code into your application)
Irmen
--
https://mail.python.org/mailman/listinfo/python
On Sunday, August 2, 2015 at 12:14:51 PM UTC+2, Cecil Westerhof wrote:
> There are a lot of ways to store configuration information:
> - conf file
> - xml file
> - database
> - json file
> - and possible a lot of other ways
>
> I want to write a Python program to display cleaned log files. I do
>
- Original Message -
> From: "Cecil Westerhof"
> To: python-list@python.org
> Sent: Sunday, 2 August, 2015 12:11:28 PM
> Subject: Most Pythonic way to store (small) configuration
>
> There are a lot of ways to store configuration information:
> - conf
Dear Cecil,
I subscribed to late to answer to your top-post in that thread.
I had the same topic for myself in the last months and tried a lot of
things.
In your situation I would prefere the INI-file format, too.
But doen't user 'configparser' for that. As other fellows described
it's a bad sol
On 08/02/2015 01:58 PM, Joonas Liik wrote:
I have this feeling that you would get a lot more useful anwsers if
you were to describe your actual problem in stead of what you think
the solution is. There might be other, better solutions but since we
know so little about what you are doing we will l
On 03/08/2015 14:38, Steven D'Aprano wrote:
On Mon, 3 Aug 2015 02:02 pm, Dan Sommers wrote:
Well, I have at least some non-zero chance of reading and writing JSON
or XML by hand. Can the same be said for a sqlite database?
Real programmers edit their SQL databases directly on the hard drive
On 02/08/2015 21:58, Joonas Liik wrote:
I have this feeling that you would get a lot more useful anwsers if
you were to describe your actual problem in stead of what you think
the solution is. There might be other, better solutions but since we
know so little about what you are doing we will like
On Mon, Aug 3, 2015 at 11:38 PM, Steven D'Aprano wrote:
> On Mon, 3 Aug 2015 02:02 pm, Dan Sommers wrote:
>
>> Well, I have at least some non-zero chance of reading and writing JSON
>> or XML by hand. Can the same be said for a sqlite database?
>
>
> Real programmers edit their SQL databases dire
On Mon, 3 Aug 2015 02:02 pm, Dan Sommers wrote:
> Well, I have at least some non-zero chance of reading and writing JSON
> or XML by hand. Can the same be said for a sqlite database?
Real programmers edit their SQL databases directly on the hard drive platter
using a magnetised needle and a ste
I have this feeling that you would get a lot more useful anwsers if
you were to describe your actual problem in stead of what you think
the solution is. There might be other, better solutions but since we
know so little about what you are doing we will likely never find them
by just guessing..
--
On Sun, 02 Aug 2015 16:11:14 -0500, Tim Chase wrote:
> On 2015-08-02 21:54, Ben Finney wrote:
>> So, both XML and JSON should be considered write-only, and produced
>> only for consumption by a computer; they are a poor choice for
>> presenting to a human.
[snip]
> I second Ben's thoughts again
On 2015-08-02 21:54, Ben Finney wrote:
> So, both XML and JSON should be considered write-only, and produced
> only for consumption by a computer; they are a poor choice for
> presenting to a human.
>
> The “INI” format as handled by the Python ‘configparser’ module is
> what I would recommend for
Cecil Westerhof writes:
> On Sunday 2 Aug 2015 13:54 CEST, Ben Finney wrote:
>
> > So, both XML and JSON should be considered write-only, and produced
> > only for consumption by a computer; they are a poor choice for
> > presenting to a human.
>
> Well, I would use nested data. (A file will hav
On 02Aug2015 18:51, Cecil Westerhof wrote:
On Sunday 2 Aug 2015 13:54 CEST, Ben Finney wrote:
Cecil Westerhof writes:
Because of this I think a human readable file would be best.
I agree with that criterion; in the absence of compelling reasons
otherwise, human-readable and -editable text
e go on as above, otherwise find *all* positions of the minimum, see which
is followed by the smallest element, and then rotate that position to the front.
Now that seems an awful lot of code for a (seemingly?) simple problem. Is there
a nice, pythonic way to do this?
Thanks for enlightening
Cecil Westerhof writes:
> Well, I would use nested data. (A file will have extra fields besides
> the name.) That is why I was thinking about json. But I will look into
> it.
An alternative, very similar to JSON but with some good cherries picked from
YAML is AXON, which is my preferite these da
On 2015-08-01 13:34, Lukas Barth wrote:
> I have a list of numbers that I treat as "circular", i.e. [1,2,3]
> and [2,3,1] should be the same. Now I want to rotate these to a
> well defined status, so that I can can compare them.
>
> If all elements are unique, the solution is easy: find the minimu
On Sunday 2 Aug 2015 13:54 CEST, Ben Finney wrote:
> Cecil Westerhof writes:
>
>> Because of this I think a human readable file would be best.
>
> I agree with that criterion; in the absence of compelling reasons
> otherwise, human-readable and -editable text is a good default.
>
>> Personally I
On 02/08/2015 12:54, Ben Finney wrote:
Cecil Westerhof writes:
Because of this I think a human readable file would be best.
The “INI” format as handled by the Python ‘configparser’ module is what
I would recommend for a simple flat configuration file. It is more
intuitive to edit, and has a
Cecil Westerhof writes:
> Because of this I think a human readable file would be best.
I agree with that criterion; in the absence of compelling reasons
otherwise, human-readable and -editable text is a good default.
> Personally I do not find XML very readable. So a conf or json file
> looks t
of code for a (seemingly?) simple problem. Is
> there a nice, pythonic way to do this?
>
> Thanks for enlightening me!
[[[Warning: all code untested, sorry!]]]
The general problem (no assumptions about the items in the list except that
they're all sortable together) is interesting.
On Sun, Aug 2, 2015 at 8:11 PM, Cecil Westerhof wrote:
> Because of this I think a human readable file would be best.
> Personally I do not find XML very readable. So a conf or json file
> looks the most promising to me. And I would have a slight preference
> for a json file.
>
> Any comments, tho
There are a lot of ways to store configuration information:
- conf file
- xml file
- database
- json file
- and possible a lot of other ways
I want to write a Python program to display cleaned log files. I do
not think I need a lot of configuration to be stored:
- some things relating to the GUI
-
On Sun, 2 Aug 2015 08:51 am, Lukas Barth wrote:
> On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote:
>> Well, it looks to me that I don't know what a 'canonical rotation' is --
>
> That's because it is not defined. ;)
>
> I need a way to rotate one of these lists in a way
Lukas Barth :
> On Saturday, August 1, 2015 at 10:57:19 PM UTC+2, Marko Rauhamaa wrote:
>>
>> def circularly_equal(l1, l2):
>> length = len(l1)
>> if length != len(l2):
>> return False
>> twice = l1 + l1
>
Paul Rubin writes:
> H([b-a, c-b, d-c, a-d])
> where H is your favorite hash function on a list of that element type.
I wrote that up unclearly. H is supposed to be a hash on one element,
and then you combine H(b-a), H(c-b), etc. in a commutative way, such as
by adding them. Still not sure if
Lukas Barth writes:
>> [Concatenated Hashes]
> Also, that still doesn't compute that one "canonical ordering"...
It was intended to get rid of the need. What is the actual application?
How does this sound? To circularly hash [a,b,c,d] use:
H([b-a, c-b, d-c, a-d])
where H is your favorite h
On 01Aug2015 15:55, Lukas Barth wrote:
On Sunday, August 2, 2015 at 12:32:25 AM UTC+2, Cameron Simpson wrote:
Fine. This also eliminates any solution which just computes a hash.
Exactly.
Might I suggest instead simply starting with the leftmost element in the first
list; call this elem0. T
ar twice in that list, i.e. I could search for the minimum, if that is
> unique go on as above, otherwise find *all* positions of the minimum, see
> which is followed by the smallest element, and then rotate that position to
> the front.
>
> Now that seems an awful lot of code fo
On Saturday, August 1, 2015 at 3:52:25 PM UTC-7, Lukas Barth wrote:
> On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote:
> > Well, it looks to me that I don't know what a 'canonical rotation' is --
>
> That's because it is not defined. ;)
>
> I need a way to rotate one of
On Sunday, August 2, 2015 at 1:05:32 AM UTC+2, Oscar Benjamin wrote:
> Do you really need the canonical rotation or just a hash that is invariant
> under rotations?
Having that canonical rotation would make the code simpler and faster,
probably, but a rotationally invariant hash is a good start.
On Sun, 2 Aug 2015 00:05 Oscar Benjamin wrote:
On Sat, 1 Aug 2015 22:06 Lukas Barth wrote:
Nice idea! But I actually really need those "canonic rotations", since I'm
hashing them somewhere.
Do you really need the canonical rotation or just a hash that is invariant
under rotations?
I don't
On Sat, 1 Aug 2015 22:06 Lukas Barth wrote:
Nice idea! But I actually really need those "canonic rotations", since I'm
hashing them somewhere.
Do you really need the canonical rotation or just a hash that is invariant
under rotations?
I don't know of a solution to the former that is better
On Sunday, August 2, 2015 at 12:32:25 AM UTC+2, Cameron Simpson wrote:
> Fine. This also eliminates any solution which just computes a hash.
Exactly.
> Might I suggest instead simply starting with the leftmost element in the
> first
> list; call this elem0. Then walk the second list from 0 to
On Sat, Aug 1, 2015 at 6:51 PM, Lukas Barth wrote:
> On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote:
>> Well, it looks to me that I don't know what a 'canonical rotation' is --
>
> That's because it is not defined. ;)
>
> I need a way to rotate one of these lists in a wa
On Saturday, August 1, 2015 at 11:43:28 PM UTC+2, Paul Rubin wrote:
> How large are these lists supposed to be?
Potentially large. Not so large though that iterating them (multiple times)
should be a problem.
> [Concatenated Hashes]
>
> If the lists are very large that doesn't sound so great d
On Saturday, August 1, 2015 at 11:37:48 PM UTC+2, Emile van Sebille wrote:
> Well, it looks to me that I don't know what a 'canonical rotation' is --
That's because it is not defined. ;)
I need a way to rotate one of these lists in a way so that it will produce the
same output every time, regar
On 01Aug2015 14:24, Lukas Barth wrote:
Perhaps I should clarify a bit:
- I definitely need a "canonical rotation" - just a comparison result is not
enough
Fine. This also eliminates any solution which just computes a hash.
- It does not matter what that rotation is. Starting with the smalle
Lukas Barth writes:
> - It does not matter what that rotation is. Starting with the smallest
> element was just an idea by me, any rotation that can easily produced
> will do.
How large are these lists supposed to be? If they're (say) 5 elements,
you could make the hash code consist of the conca
On 8/1/2015 2:24 PM, Lukas Barth wrote:
Perhaps I should clarify a bit:
- I definitely need a "canonical rotation" - just a comparison result is not
enough
Well, it looks to me that I don't know what a 'canonical rotation' is --
there's no wikipedia article and googling yields all sorts of
1 - 100 of 446 matches
Mail list logo