« first day (4673 days earlier)      last day (498 days later) » 

05:55
@PM2Ring thanks, most of those are accidental though, with the one exception of Aaron's answer who also mentions singletonness.
 
1 hour later…
07:04
@AndrasDeak--СлаваУкраїні It's pretty much your subtyping problem. The "singleton type" is the type itself, the "non-singleton type" is your type and subclasses. You've got a Foo/None and you want only that Foo/None.
07:19
I'm not following this singleton theme. Doesn't everything implicitly inherit from object meaning that every class you create is already a subclass? If Foo is a singleton type because there are no subtypes, does that imply that every leaf node in an inheritance tree becomes a singleton type?
I can't find any mention of a singleton type, only the singleton pattern and the mathematical definition of a singleton
If we want to stretch to comparison to real singleton's, I'd say yes.
FWIW, I'd say if one were to translate the subtyping operators to the standard operator set then type(foo) == Bar should mean Foo is Bar, and type(foo) >= Bar should mean isinstance(foo, Bar). Alas, Python's type does not implement them as such.
Hmm, I think I actually grok that, and this definitely isn't the usual area I go poking around in mentally :P
07:34
Grog certainly can help here! Arrrrr!
It's not very intuitive for me. For example, I'd consider "larger" class the parent, not the subclass
Eh, you are right. I accidentally swapped that. type(foo) <= Bar should mean isinstance(foo, Bar).
What about type(foo) in Bar?
It might make sense to ask foo in Bar, if one treats types like sets/categories.
07:57
I could actually find reference to a singleton_type. The language looks quite fun with real? real? it's like a mini interrogation
Especially in a package called rebellion
08:15
@MisterMiyagi thanks, I'll have to think about that
My confusion is how I could get "another Foo/None"...
In practice you won't get another Foo, just like in practice you won't get another None. 🤷‍♂️
09:08
Don't take the "singleton type" literally. The similarity is in the situation rather than the implementation.
user17135505
Good day, would you say custom decorator to limit number of attempts try-except function is executed as well as implement some sleep is a way forward?
It's certainly something that is successfully used in practice.
user17135505
Thanks, I'll give it a go
10:32
Does anyone have experience with CFFI libraries? argon2-cffi is nowhere near as starred as I would imagine given that OWASP bold-ly recommends Argon2 for new projects
I'm wondering whether it's (as a CFFI) more prone to compatibility issues on python version changes etc. that might make it more brittle when you want to change things
Eh, it still has 9M downloads a month so maybe it's earned its own "Unsung Hero" badge. I'll just dive in and see if I answer my own question down the line if/when I hit a deadlock :P
10:54
Hynek sounds like a good sign
 
2 hours later…
13:20
I think I'm taking crazy pills. How is it possible that the whole world has collectively decided that "string" is an acceptable way to say "text"? Have we all lost our minds?
hmm, I guess I also thought the concept was weird back when I didn't know any programming language.
But thinking of a string, as an "object containing text", or any other similar description, it somehow make sense?
@Aran-Fey like, not programming-only part of world?
@Aran-Fey Erm, I wouldn't say that a string contains text. It's a sequence of symbols, like beads on a... string.
@matszwecja That's what brought this on - the word is creeping out of the programming world and infecting normal people as well
@MisterMiyagi never pictured it like that, interesting.
13:26
A coworker called me because she had a problem working with a dataset that contains... strings. Hearing a normal person say the word "string" instead of "text" was wild
if they worked with Excel and other Table-like software, they probably picked it there
@MisterMiyagi Isn't that what text is?
it's nothing too weird unless it's used out of context imo
@Aran-Fey For me, text are words arranged in a specific fashion. Human-readability is part of that, and I'd say it should match a human language. Something like JSON, URLs, BASE64, or UUIDs doesn't fall into that category, but it's string.
Hmm. Never thought of it like that
13:30
@Aran-Fey Well, you've got me pondering on "Zeichenkette" now if that helps. :P
symbol chain
announcer voice Symbol Unchained, coming to cinemas near you this fall!
I guess text is more about words, while string is more about characters
14:13
@Aran-Fey it's used 12 times in the Excel reference for text functions
14:53
@Aran-Fey There's some historical info at en.wikipedia.org/wiki/String_(computer_science)#History The term "string" was standard jargon when I was first learning to code in the early 1970s.
 
2 hours later…
16:44
Inputs:
estdom_name = ['p1', 'p2', 'p3', 'p6', 'p7', 'p8', 'p9', 'p10', 'p11', 'p12', 'p13']
triangulations = [['./Domains.tri/Pop01_06082023.00t',
  './Domains.tri/Pop02_06082023.00t',
  './Domains.tri/Pop03_06082023.00t',
  './Domains.tri/Pop06_06082023.00t',
  './Domains.tri/Pop07_06082023.00t',
  './Domains.tri/Pop08_06082023.00t',
  './Domains.tri/Pop09_06082023.00t',
  './Domains.tri/Pop10_06082023.00t',
  './Domains.tri/Pop11_06082023.00t',
  './Domains.tri/Pop12_06082023.00t',
  './Domains.tri/Pop13_06082023.00t']]
You can zip more than two iterables.
zip(triangulations[itri], flagvalue[itri], estdom_name) will iterabte over triples of flag, value and "p value".
Still gives an error saying:
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-96-e2c25e902751> in <module>()
      7     for fl,val,x in zip(triangulations[itri],flagvalue[itri], estdom_name):
      8         #print("val:", val)
----> 9         print(fl+' : {} : '.format(val) + estdom_name[val-1])

IndexError: list index out of range
well, use the x that contains the value...
17:46
estdom_name[val-1] isn't tracking the index of your loop
You can have any random integer at that index, which you name val and then you just subtract 1 from it and use that as an index. What happens if the value at that index is 10000000?
18:04
but val is in flagvalue which is flagvalue = [[1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13]]
Which is a nested list
Kaboom:
flagvalue = [[1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13]]
for item in flagvalue[0]:
    print(flagvalue[item-1])
Python isn't lying to you. It's easy to create the IndexError, you just need to investigate it in your own context
18:21
so what its doing is val = 1--> estdom_name[1-1] = 1st item in estdom_name, etc. That would be fine but I don't have a 4 or a 5 so it gets to those and puts val = 6 --> estdom_name[6-1] = which is the p8 when what I want is p6. I understand what it is doing and why I get the error just not how to force it to give me what I want LOL!
Wait I think I got it
val2 = [1,2,3,4,5,6,7,8,9,10,11]
# Check assigned code for each triangulation
for itri in range(len(triangulations)):
    print("Current flagvalue:", flagvalue[itri])  # Print current flagvalue for this iteration
    print("triangulations:", triangulations[itri])
    print("estdom:", estdom_name)
    for fl,val,x in zip(triangulations[itri],flagvalue[itri],val2):
        #print("val:", val)
        print(fl+' : {} : '.format(val) + estdom_name[x-1])
Output:
./Domains.tri/Pop01_06082023.00t : 1 : p1
./Domains.tri/Pop02_06082023.00t : 2 : p2
./Domains.tri/Pop03_06082023.00t : 3 : p3
./Domains.tri/Pop06_06082023.00t : 6 : p6
./Domains.tri/Pop07_06082023.00t : 7 : p7
./Domains.tri/Pop08_06082023.00t : 8 : p8
./Domains.tri/Pop09_06082023.00t : 9 : p9
./Domains.tri/Pop10_06082023.00t : 10 : p10
./Domains.tri/Pop11_06082023.00t : 11 : p11
./Domains.tri/Pop12_06082023.00t : 12 : p12
./Domains.tri/Pop13_06082023.00t : 13 : p13
@MisterMiyagi Your idea is what helped me, thank you!
 
2 hours later…
20:24
It looks like the strike is (almost) over: meta.stackexchange.com/q/391847/334566
2

« first day (4673 days earlier)      last day (498 days later) »