« first day (2826 days earlier)      last day (2121 days later) » 

2:02 PM
Could be as simple as
>>> class Foo:
...     def __getitem__(self, idx):
...         if idx > 5:
...             raise IndexError
...         return idx
...
...     def __iter__(self):
...         raise TypeError('Don\'t iterate me bro!')
...
>>> [x for x in Foo()]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-6c43dd796782> in <module>()
      8         raise TypeError('Don\'t iterate me bro!')
      9
---> 10 [x for x in Foo()]

<ipython-input-6-6c43dd796782> in __iter__(self)
      6
      7     def __iter__(self):
----> 8         raise TypeError('Don\'t iterate me bro!')
      9
     10 [x for x in Foo()]

TypeError: Don't iterate me bro!
 
match objects don't have an __iter__ method though
 
blah... yeah... I just read that
 
But why doesn't it have it, now I'm curious too :\
why did they give us a finditer :\
 
There isn't much practical purpose in iterating over a match, really
 
To add to my confussion. This is the class that iterated and yet
>>> class Foo:
...     def __getitem__(self, idx):
...         if idx > 5:
...             raise IndexError
...         return idx
...
>>> hasattr(Foo, '__iter__')
False
 
2:05 PM
Since the group at index 0 is qualitatively different than the groups at every other index. So it would be weird to loop over all of them
@piRSquared So that would suggest that Python doesn't quietly add an __iter__ methods to classes, even if it can tell they're iterable because they implement __getitem__ (and ostensibly also __len__, but in practice that seems to not be necessary)
 
Howdy folks! I'm just beginning to learn about tensorflow and python and managed to get to the point where I can generate my own data sets, train my own models, and evaluate those models. I'm currently trying to understand the output of tf.nn.top_k and the prediction probabilities as I have 2 categories for classification, but the probabilities returned are greater than 1 and -1. What do the probabilities of the top index values ACTUALLY represent? It's obviously not a percentage.
 
cv-pls seems like a work dump stackoverflow.com/questions/51306931/…
 
Fun way to show that iteration print(*Foo())
 
No idea, but I wonder if how to understand the output of tf.nn.top_k() from tensorflow is relevant here
 
I saw both of those questions and their answers didn't help
I can already retrieve the probabilities for each category, but the issue is that the range is varied and not constrained 0 to 1
An example output I get looks like this:
Category A, 24.98684
Category B, -24.999345
How is there a 2498% chance the image is in category A and a -2499% chance the image is in category B?
That's what I'm trying to understand
and 9 times out of 10, the negative number is larger(if using absolute value) and is the correct category for the image, instead of the first category
 
2:16 PM
Might be worth making a question on the main site, provided you can construct an MCVE for it
 
I just don't want it to get downvoted because it's an obvious answer
I'm not good at math and flunked my AP stats class in high school so mathematical equations and probabilities aren't really my thing
I just want to make sure it's not something obvious
 
At the very least it's not obvious to anybody reading this conversation right now
 
I just really wish that the documentation was more clear
 
cbg
 
But it's still predicting incorrectly.
Yet in the eval, it says the precision is 100%
 
2:25 PM
Another way to implement iteration
>>> class Foo:
...
...     def __init__(self):
...         self.idx = -1
...
...     def __call__(self):
...         self.idx += 1
...         return self.idx
...
>>> print(*iter(Foo(), 6))
0 1 2 3 4 5
 
DSM
Morning cabbage for all.
 
cbg
@Kevin note that you had search vs match there ;)
 
@wim Sorry I was planning on replying sooner, and I forgot. So, I interpret that as the way to properly do this in pytest using mock, is to in fact use pytest-mock. Outside of that, there is no "easy" way to actually just avoid the decorator.
and cbg all
 
Yeah I'm being pretty loose with my terminology today
Or is "terminology" even the right word? But it doesn't matter, because then the sentence proves itself
Dang, I had a nice one liner ready to go for How to extract list from list of lists when any one element match with another list's element in pyhton? but it only works if there aren't any duplicate skills, and there are duplicate skills
Darn you user 54, for having both a 1.0 and a .83 in laravel
 
2:32 PM
the counter tag strikes again
 
lol
 
This time, the answer is "you're not counting"
 
Just as well, the one liner involved toolz.groupby so I couldn't really post it anyway. quick n dirty solutions can't require the reader to run pip install first.
 
DSM
I've created a monster!
 
There really ought to be an aggregate function in the standard libs if you ask me
 
DSM
2:36 PM
 
Thanks for trying guys I just might have to open a question on the site
I mean my data set only consists of 600 images in each category with 80% for training and 20% for eval
And it's only grayscale, not rgb
 
Ideally your question's audience ought to be able to re-create your data set without having to download 600 images. Or, if not your exact data set, some data set that also exhibits the "probabilities not within [0,1]" problem
 
well I did manage to solve that issue
when calling tf.nn.top_k, the logits variable should be run through tf.nn.softmax first
that produces probabilities from 0-1
 
when doing that, the probability for the first category is 1.00 and the 2nd category is somewhere in the 1.124953735e-21
(very, very, very small decimal)
 
2:43 PM
cbg
 
cbg?
 
cbg.
 
It is the traditional greeting of our people
 
ah ok
 
Anyone have a dupe for this "how do bound methods work internally" question?
 
2:48 PM
"it can be used anywhere in the class with self" seems like a misconception about why self is accessible inside a method. You can't access self anywhere in a class, you can only access it in methods that have a self argument.
Which is to say, it's a perfectly ordinary variable
Sure, there's magic going on that lets you do foo.bar() instead of FooClass.bar(foo, bar), but that happens outside the class, as it were
Anyway, in regards to dupes, I recall that Martijn has an answer somewhere with a nice explanation of method binding. I guess that doesn't narrow it down much
 
Nope, not really :D
 
and there is nothing to stop us from using you instead. Which might be fun.
 
Just look through all of his answers, what's the problem?
 
With some luck I can read his answers faster than he writes them
 
(read my previous message in the tone of voice usually reserved for "A monad is just a monoid in the category of endofunctors, what's the problem?")
 
2:54 PM
to whom it may concern: astrophysical breakthrough^TM to be announced soon (?) youtube.com/c/VideosatNSF/live
 
I'm only interested if they invented FTL travel, in which case I want it announced the day before they invented it
 
DSM
Unlikely. I guess they could have discovered evidence of tachyonic neutrinos, but frankly that's hard to credit either. ;-)
 
Should I attribute the fact that there is a live stream to the breakthrough being massive or is this quite a common thing?
 
"We're as surprised as you are," says the engineering team, "we were trying to construct a replica of the warp core from Star Trek as a decoration for this year's Christmas party, and it just happened to work"
 
it happens every once in a while
last one I saw was the gravitational wave, it was pretty cool
 
3:00 PM
Yeah, ok, that is quite interesting
 
@Aran-Fey I just linked to this in a comment: stackoverflow.com/questions/13348031/…
 
Nice, that should explain everything the OP needs to know. Shame it doesn't work well as a dupe though
 
Yeah, it's not a great dupe target for that question. But hopefully it'll satisfy the OP. And the question's closed anyway, so we don't need a dupe target. :)
 
rb folks
 
It'd be a nice signpost though. It's already one of the top google results.
 
3:08 PM
@MartijnPieters Thanks. I put a link to that question you answered in a comment on the new question. I didn't think it was appropriate to dupe-hammer it.
 
cabbage
@Kevin did you ever finish Hollow Knight? I got it for the Switch.
I'm listening to the soundtrack right now, it's so good. christopherlarkin.bandcamp.com/album/…
 
Yes, although I cheated and gave myself infinite health for the last two bosses, and one particularly difficult optional area
 
wim
@idjaw you can use mocker.patch.object within the test function, or you can use monkeypatch.setattr similarly. avoid the decorators.
 
OK, less striking than the gravitational wave, but cool enough
 
I can only repeatedly bash my head against a boss if I'm fairly certain they're standing between me and cool & fun platforming bits, which is usually not the case when you're 99% through the game
 
3:13 PM
I wonder if they caught a single reaction
290 TeV neutrio D:
 
Buzzfeed will have "kids react to polar observatory press release" by tomorrow I'm sure
 
DSM
@AndrasDeak: whoa!
 
unless I misheard but I don't think so
 
Is that a lot?
 
The game is hard but somehow I keep progressing. But apparently it's huge and I'm barely through it even though I've played for 15 hours at this point.
 
3:18 PM
@Kevin it's a yamming lot
 
The platforming challenges are just mean though.
 
LHC is designed for 14 TeV max, and those are heavy particles rather than nigh-massless neutrinos
(energy as energy regardless of mass, of course)
 
DSM
Short version:
A high-energy neutrino event detected by IceCube on 22 September 2017 was coincident in direction and time with a gamma-ray flare from the blazar TXS 0506+056. Prompted by this association, we investigated 9.5 years of IceCube neutrino observations to search for excess emission at the position of the blazar.
We found an excess of high-energy neutrino events, with respect to atmospheric backgrounds, at that position between September 2014 and March 2015. Allowing for time-variable flux, this constitutes 3.5σ evidence for neutrino emission from the direction of TXS 0506+056, independent of and prior to the 2017 flaring episode. This suggests that blazars are identifiable sources of the high-energy astrophysical neutrino flux.
 
I breezed through what was considered at the time to be the hardest platforming segment in the game. Must be my mutant power.
 
@AndrasDeak Well, it was fired from Orion's bow
 
3:20 PM
I think since then they've added an additional extra hard platforming segment. Not sure if I need to pay for DLC to try it out, or if it just got patched into the game, or what
 
I think all the DLC is free. Switch version came with all three already installed.
 
wim
Cool. I didn't know IceCube was a physicist.
straight outta compton!
 
Oh, maybe I'll go back and check it out then.
The "just keep adding additional free content to our existing game, indefinitely" business model is very strange to me but I won't look the gift horse in the mouth
 
@Kevin Considering that the rest mass of a neutrino is somewhere around 0.1 to 2 eV, yeah, 290 TeV is a lot. :)
 
Apparently when Shovel Knight tried it, they didn't make very much money. Shocking!
 
DSM
3:27 PM
The collaboration has a layman's explanation of why this is so impressive.
 
neat
oh yeah, the LHC figure is for the collision, not for the beams
 
"blazar" is a new term to me. Astrophysics gets to invent the funnest terminology
 
@wim I used it in my method, and it did not mock it. It seems like it was just out of scope. I might need to go back (when I find the time), to investigate as to why it did not properly mock.
 
3:44 PM
If you put print(str(arg)) right above targetip = socket.gethostbyname(str(arg)), what does it display? — Kevin 1 min ago
Mentally bracing for the reply being "I can't tell you, it's proprietary :3"
If not, I wager 1.5 quatloos that arg is a bytes and it's not working because getaddrinfo can't find an address called b'google.com', with the b and apostrophes included
 
UI design quandary: The user is ordering one million widgets, and must specify the color of each one. The colors can only be white, blue, black, red, or green. How should I design the interface so that this information can be entered efficiently?
Lazy solution is: five text boxes, each corresponding to a color. The user manually types in each quantity.
But it's a common use-case for the user to order a non-round-number of widgets, and want an even distribution of colors. If they order 5622894 widgets, they'll need to use a calculator even if all they want is "50% blue, 50% green"
 
So is it "The user is ordering widgets, they have to specify how many of each color they want" or does it matter what order they are in?
 
Order doesn't matter.
 
All 1 million widgets are identical except for the color?
 
3:58 PM
Yeah.
 
I'd suggest something like what vbox does when allocating memory -- sliders, but with the ability to enter an exact value if you want
That might get messy with multiple colors, though...
 
Sliders is an interesting idea... The most common use-case is 100% of one color, which is easily done with sliders. Just grab one and jam it as high as it goes.
Maybe add "catches" at 50%, 33%, 25%, 20% so it's easy to specify even mixtures of 2/3/4/5 colors respectively... hmm
This seems like it's worth prototyping out
 
Do it like GIMP and let the user input math everywhere.
 
wim
4:24 PM
@davidism holy smokes
and the infamous PEP is no longer saying "draft" too, Status: Accepted.
 
@Aran-Fey Dang that's fancy
 
"Guido is retiring from BDFL". Raises an interesting philosophical question as to whether one can retire from a lifelong position.
 
@JRichardSnape suicide
 
but then it's still lifelong
 
Strictly speaking it's a vacation. When the president takes a week off at Camp David, he's still president
 
4:27 PM
True
 
but yea, the dictatorship is bad
it is better to know when to rule
 
and when to not
 
unlike victor stinner there, I still don't like the new syntax at all
it makes Python feel more like PHP and less like something designed
and the mail server has been DDOSed it seems
 
Prediction: a controversial new language element and the loss of a leader figure will cause the user base to schism into new forks, Pyhton and Phyton
Phyton wins the ensuing war, mostly because of their catchy slogan "fight on, Phyton"
8
 
@Kevin This reminds me a bit of partitioning a HD. Maybe borrow some ideas from a partitioning GUI.
 
4:31 PM
@PM2Ring Good idea
 
number one on hacker news... I want to read mail archives
 
wim
Something whack here. If GvR is dictator, why he had to fight to get the PEP accepted. If GvR is not dictator, why is such unpopular PEP accepted.
 
A man riding a tiger may be stronger than all others, but still has little control over his own direction
 
4:51 PM
@davidism One PEP too late :(
 
indeed, no one is questioning Linus for realz
 
Every PEP makes me wish I could drop support for old Pythons.
Looking forward to None-aware operators: python.org/dev/peps/pep-0505
 
Rad, I've been waiting for null coalescing attribute access
Not for any particular purpose, I just think it's neat
 
This is our opportunity, we need to get Room 6 appointed as the new BDFL. We can govern as a hivemind.
 
Yes
 
5:03 PM
This pleases us
 
do we work like voltron?
can we like, determine which limbs each of us plays
I want to be the pancreas
 
That's not a limb.
 
cbg
 
@Ffisegydd I just really wanted to be a pancreas, and forgot I spoke about limbs....
 
i'm getting the below error while opening flask admin page.
 
5:09 PM
I....I'm dumb.
 
File "/home/avinash/.virtualenvs/mee/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 971, in get_result_processor
    return type_._cached_result_processor(self.dialect, coltype)
  File "/home/avinash/.virtualenvs/mee/lib/python3.6/site-packages/sqlalchemy/sql/type_api.py", line 473, in _cached_result_processor
    d = self._dialect_info(dialect)
  File "/home/avinash/.virtualenvs/mee/lib/python3.6/site-packages/sqlalchemy/sql/type_api.py", line 497, in _dialect_info
    impl = self._gen_dialect_impl(dialect)
 
You can be the head then @idjaw
 
(that was my plan all along)
oh ok...
(look disappointed)
:|
 
Now there's only 4 limbs, a head, and a torso. So we're gonna need to timeshare.
 
wim
> So what are you all going to do? Create a democracy? Anarchy? A dictatorship? A federation? A dark council?
(paraphrased)
 
5:12 PM
Please send your timeshare deposits to fizzy@good.com and set up standing orders for Voltron Maintenance.
 
> At Fizzy Good we take pride in providing impeccable service to our customers. We thank you for your patience, a technician will be with you shortly...
 
hey, i want to check the value of an int every minute, and if the int has increased in size i want to do something, if it hasn't I want to check it again every minute and do something if it's increased in size, ad infinitum , what's the best way to set this up?
 
quickest solution is a while True: and a time.sleep(60).
 
wim
what is changing the value of the int
 
'Course, the int will just stay the same value forever unless you're changing it or getting its value from an external source or something
 
wim
5:16 PM
other thread? other process? coroutine? it's read from disk?
 
i'm writing a program to check if a spreadsheet has been updated , the int is the number of rows in spreadsheet, and is retrieved from an api , if there has been a new row added i want to print the row from the spreadsheet ; that's the basic functionality i'm looking to code ; I have the printer function sorted ; and can read the number of rows from the sheet ; now I'm just trying to write the code to query the int value every minute, and then print if a row has been added
 
wim
 
import time
last_value = None
while True:
    cur_value = get_int_from_api()
    if last_value is not None and cur_value > last_value:
        print("value increased, time to do something")
        do_something()
    last_value = cur_value
    time.sleep(60)
 
Thanks very much kevin really appreciate the help
 
DSM
@wim: this is turning into a dramatic day!
 
5:23 PM
@wim oh yeah. I saw that in my feed a short while ago. Pretty ridiculous
@Gary is it guaranteed this row is always appended? aka always the last line is the newest?
oh I see Kevin did his thing already.
 
wim
major version release of setuptools 40.0.0 (changes)
 
@idjaw yes the sheet is an orders sheet, and a new row represents a new order, and i want to print the row when a new order has been released
 
5:40 PM
Today I tried contributing to a project that uses Gitlab. It asked me to provide a public key, and when I went to generate one in the recommended directory, I already had one. So I decided to just use that key. But when I tried to pull, it asked for my passphrase. Heck if I know what it is.
I'm 60% sure this key is on my machine because I needed it to push to my own repositories on github. So I probably shouldn't just delete it.
Why gitlab asks for a passphrase when github doesn't, I have no idea
 
Passphrases are normally cached. If you had to enter it, the cache has probably expired
 
Is this really necessary? I'm also only a bit suspicious at how that multi-paragraph answer was ready to go in under a minute
 
I was thinking that too. Guess I'll flag for mod attention
 
Well I haven't talked to github via my home computer for a couple months, so that's entirely possible
 
@MoxieBall Hover over the "asked 6 mins ago" stuff to get the exact timestamp. The answer was posted 15 seconds after the question.
 
5:53 PM
Seems like yammery to me
 
Meh, if two users want to farm rep by asking and answering questions, then I have zero problem with that, if the questions and answers are good
If they're not, then they should get downvoted for the same reason you'd get downvoted for producing any low-quality content, regardless of whether it's part of a larger scheme
 
Yeah, that's a fair point actually. The red flag for me is that it was two different users... If you have a question/answer pair you think is missing, why not post it under one account?
 
The problem is that it's probably only 1 person, and I don't know why they need two accounts unless they're up to something nefarious
 
@Kevin that'd still be abusing the system tho
 
My first reaction was to google parts of that answer to see if it was plagiarized
 
5:58 PM
Yeah, this is boosting a relatively low-rep account, IOW abuse
 
Unrelatingly, Muse is tomato-ingly good.
 
Those are some really weird edits that just went into the question.
 
Wut? Boosting accounts by posting answers is abuse now?
 
Does planting a question for the other account to post a complete answer before anyone else could even read it count as abuse?
 
If it's not abuse, it's definitely just really weird
 
6:03 PM
If it's not abuse with the same account, why would it be abuse with two accounts?
If he upvotes himself with the other account, that's abuse
 
It's accepted now.
 
It's perfectly fine for 2 people to co-operatively write a Q&A pair. But it does seem shonky when they act like they aren't co-operating.
 
interestingly, the "good practice" in the answer, is literally argued against in the pluralsight formation I'm watching
 
Accepting your own sockpuppet's answer is definitely abuse.
 
for i, val in enumerate(list) looks much cleaner, yes?
 
6:05 PM
@user2357112 Very weird that he changed it to Java, but still accepted the Python answer.
 
The "So I figured I'd post one and see the best results trickle to the top" part is also clearly BS, with the accept mark.
 
@FélixGagnon-Grenier Yes. But most of the time you don't actually need the index, so there's no need to use enumerate.
 
hah, and now the question-asking account has submitted a suggested edit on the answer.
Suggested-edit rep-farming?
 
Hello!
Got troubles with datetime timedelta
I set
step = datetime.timedelta(days=90)
and get error:
TypeError: unsupported type for timedelta days component: sage.rings.integer.Integer
Any ideas what is going on here?
 
I understand the desire for tutorial-style Q&A on SO, but it's not really practical for broad "teach me the absolute basics" stuff, as I discussed in this recent SO Meta answer: meta.stackoverflow.com/questions/370486/… And it's one of the reasons that SO Documentation failed.
 
6:12 PM
can't reproduce with just your step = datetime.timedelta(days=90) must be some where else in your code.
 
dt = datetime.datetime(2018, 12, 1)
end = datetime.datetime(2025, 12, 30)
step = datetime.timedelta(days=90)
 
@БеляковаАнастасия sounds like you're using sagemath somewhere?
 
All of those lines work on my machine
 
please create a [mcve] because still can't reproduce your issue.
 
6:14 PM
whoa step = datetime.timedelta(days=int(90)) did the trick
 
.... what are you.... actually nvm carry on
 
That's baffling. 90 should be exactly identical to int(90).
 
Depends what you're running in
 
Up until thirty seconds ago I thought it was completely impossible to change the type that an integer literal evaluates to
 
@Aran-Fey because why would you do it on a sock if you can do it from your main account? There may be valid reasons, but it's usually for boosting newer accounts. That is considered a problem by Show, FWIW meta.stackexchange.com/a/57685/260312
 
6:16 PM
If you're running on some crazy non-standard-CPython maybe?
 
some voodoo magic on the system is what i suspect ^
 
DSM
Sage preprocesses integers to allow crazy magics.
 
Well of course a Sage would have max int
 
Hello, little question, I recently change of computer, and now when I want to use a module I created, I need to record it under "..\Lib\site-packages", else I always get the ModuleNotFoundError. I know Python for more than five years and I've never seen that before. I am sure my modules are sorted correctly, i.e. my current program using the module in the save folder as the program. If anyone has an idea I would be glad.
 
6:17 PM
Same python version?
 
Well, I upload new versions regularly and I've never got a problem. I found this problem on a project I started a two weeks ago in my old computer with the same version of Python.
Old PC 3.6, new PC 3.6 :)
 
I suspect on your old PC your directory has been added to PATH
 
@vaultah *often *Shog
 
Which is an environment variable that Python can use to find modules. .../Lib/site-packages will already be on PATH, and that's how Python finds "normal" modules that are stored there.
 
I probably used it a long time ago. I will then have a closer look on that point. Thank you
 
6:23 PM
@vaultah True, but it's not automatically abuse if an answer was posted with superhuman speed. It likely is abuse and it should be flagged, but there's a real chance that it's legitimate
 
@vaultah do you painstakingly type the correct message id, or does your answer to this message work even on your own messages?
 
wow
I just realized:
with f := open('foo'):
     ...
would work "as expected"
but then something whose __enter__ returns a different value wouldn't
so now try to explain how as is different from :=?!
 
much stylier with :=
 
@FélixGagnon-Grenier I just copied the message id :P
 
... btw we don't have that in php ;)
 
6:27 PM
@AnttiHaapala @FélixGagnon-Grenier it doesn't work, but then you can get it from the permalink.
 
Saw some code in a recent regex question, which baffled me for a bit. To paraphrase:
 
yeah, was just slow balling a half baked attempt at stealing someone's userscript
 
>>> re.sub("[][]", "-", "[foo]")
'-foo-'
 
@AnttiHaapala Quick, make a self-answered Q&A that'll earn you a truckload of rep in the future!
 
cbg guys
 
6:28 PM
TIL that [] doesn't mean "a set of characters that doesn't contain any characters"
 
I'm trying to install a source dist from PyPI, but I'm not sure how to; ONNX's wheels are not working and are delivering segfaults for me
pypi.org/project/onnx/#files <-- if you look at the bottom there is a 1.2.2 source tar.gz that I want to download, since it'll compile on the right environment and work everytime given you have the correct requirements
 
@Kevin it must still match something
 
but pip install onnx will pick the wheels above that...
 
@Kevin I hate when people do that. In a lot of other languages, [] is an empty character set. It's confusing
 
ugh wait what?
 
6:30 PM
If I want to write a regex that can't possibly match anything, then by gum I don't want Python to stop me
 
[] is not actually a valid regex?
 
I demand the right to shoot myself in the foot
 
@Kevin it specifically means *either ] or [
@FélixGagnon-Grenier no
 
@AnttiHaapala Yeah, that's what I figured after my bafflement abated
 
@FélixGagnon-Grenier Not in python. It's valid in languages like JS, for example.
 
6:31 PM
confused by @Kevin's message
 
@Kevin Try (?!) :)
 
I'm (thankfully) mostly working with pcre flavours
 
it is from POSIX REs already
> To include a literal ] place it first in the list. Similarly, to include a literal ^ place it anywhere but first. Finally, to include a literal - place it last.
 
[] by itself means "the opening bracket indicating a character set, and the first element of that character set (a closing square bracket)..."
If that's the end of your pattern, you get unterminated character set because you never put a closing bracket indicating the end of the character set
 
ah. --no-binary <package name>.
 
6:33 PM
@OneRaynyDay and unfortunately that's not really the solution
 
@OneRaynyDay Download it yourself and pip install that?
 
it is a "solution" but not Endlösung.
 
I think this is rather more readable: r"[[\]]". The r isn't required, but I think it helps, & IIRC, in future backslash sequences that aren't valid Python escape sequences will need to be in raw strings, or use backslash escaping.
 
@PM2Ring backslashitis !ftw.
 
That might make for a fun "no computers allowed" quiz question: which of the following are legal patterns?
[][]
[]
[]]
[]]]]]
 
6:35 PM
1,3,4... got it right :P
 
DSM
Aaargh. In two windows my code works. In the window where I run the tests, it fails. Because somehow the very same SQL query returns different values in the middle of some rows. Some of the time.
 
Ooh, you used your computer to submit the answer to the quiz, thus disqualifying you ;-)
 
@AnttiHaapala elaborate?
@MoxieBall that is a solution, but an inferior one
 
@Kevin ARRRGHHHH
 
@DSM are there group by or other aggregates in them queries? they sometimes can have undefined behaviour when not specifically instructed on how to group
 
6:36 PM
Level 2: Which of these are valid patterns?
[^]
[^]]
[]^]
 
DSM
@FélixGagnon-Grenier: nope, although that's a fine guess. Just SELECT / FROM / WHERE.
 
Could be a cache issue with one window? Can you open a new one for testing in?
 
@AnttiHaapala it worked for me. Build succeeded and tests passed. ?
 
@OneRaynyDay no but the point is that now for every pip install everywhere you must need to add that :D
or perhaps it decides to install the binary version:F
we had problems with psycopg2 in ubuntu 18.04 :F
basically manylinux images say: "you're only allowed to use these ~10 libs"
and then everyone and their grandma then statically link 2000 other libs
 
wim
6:42 PM
@OneRaynyDay the correct approach here is to build a .whl that works for you and host it on your internal index
put the index url in pip.conf so you don't have to mention it every time
 
@wim yes, but the whl only works for 18.04 and not < bionic (or vice versa)
so I tried to host a .whl that I made from bdist_wheel, but it failed.
@AnttiHaapala what do you mean by every pip install?
For context I'm working on a library that is planning to be released for many linux
 
for even more context, the library breaks because of protobuf versions shipped w/ different versions of ubuntu; namely 3.0.0 for 18.04 and 2.6.1 previously
 
@PM2Ring I think I will need Regex in my code now. Yesterday, we tried with getting specific letters from the format AABBB-CCCDDD001, but I got another function now in my script to deal with, and i think, i have no other option than using regex there. Please help! :'(
 
6:47 PM
the OS's respective libprotobuf, if not @ the same version, will cause a segfault when you run onnx in python, which is an absolute nightmare
relevant issue link: github.com/onnx/onnx/issues/1187
 
wim
you may have to build multiple wheels, and use the platform tags. I don't evny you.
 
I'll punt on the issue and cross my fingers that the onnx team has this figured out before we release
but I will build multiple wheels if I have to
 
@OneRaynyDay even worse. You know that a prerequisite of your library might not work
this madness was the reason why PsycoPG stopped shipping wheels with psycopg2 - you need to install them explicitly from psycopg2-binary...
... which of course cannot provide psycopg2 so anything that depends on psycopg2 doesn't work with that.
 
DSM
@Ffisegydd: nope, not a cache, it seems. I know the table is right, I can see it in Studio. I can request it from the python command line. I can request it from my program run in Pycharm. But when I run the very same query from within my test -- confirmed with a hexdigest -- it sometimes doesn't return complete values. :-/
 
@KaranM Sorry, that's not how this room works. If you have a question, state it clearly and briefly, preferably including a minimal and complete code snippet with appropriate sample data and desired output. And then if someone here can help you with it, and has the time to do so, they will respond.
But I suspect that at this stage you need to read a regex tutorial. Fortunately, there's a good one in the official Python docs: Regular Expression HOWTO
 
wim
6:56 PM
"that's not an octopus, that's a Cthulhu merge" .. TIL there is a commit in the kernel with 66 parents (!)
 
@DSM can you step through your code via debugger and check state? Not sure if you'd see anything there?
The other thought is that you're mocking something out for tests and that's breaking something
 

« first day (2826 days earlier)      last day (2121 days later) »