« first day (3586 days earlier)      last day (1348 days later) » 

5:02 AM
@PM2Ring I like using map when the operation is some well-defined action. E.g. map(str, things) has proven very easy to parse for my wetware, map just cannot do as much weird stuff as generator expressions. There is also a lot of composition and wrappers in that project.
Using a generator expression is perfectly fine and what I will do in the for this in the final version. It just feels weird that we have awkward things like itemgetter but nothing to treat calls as first-class.
 
 
4 hours later…
8:42 AM
re-cbg
 
9:19 AM
@MisterMiyagi methodcaller('__call__')? :P
It would probably have to be apply
 
9:35 AM
@AndrasDeak I actually quite like that in a weird sort of way :)
 
user13415013
9:47 AM
Hi @JonClements @AndrasDeak I've found the problem on yesterday problem
 
user13415013
It is saying TTP error
 
user13415013
soln is just near
 
@AndrasDeak I actually use a lambda x:x() at the moment. Gives me eye cancer every time I look at it.
Also spectacularly fails at being more readable than a generator expression.
 
@MisterMiyagi which is why you should just use the genex...
 
10:03 AM
I'm still pondering whether there is some use in having an itemgetter-slash-partial helper. Vaguely remember building that before.
@AndrasDeak it's a work - related project and I have to get rid of vacation still. Unpaid maintenance is restricted to Saturdays from noon to noon-thirty.
 
Sorry, that's too German humor for me to get :D
 
10:35 AM
My Spyder answer, complete with freehand arrows, has now moved into my top 3 rep earners. I knew there was a reason I persevered with it :P
 
Spyder? Talk about dirty money.
 
IIRC they were already discussing version 5 after barely releasing version 4. I'll pencil some time in to make some more canon answers
@AndrasDeak <insert capitalism quip here>
 
10:54 AM
So, is there a good place on these interwebs to chat about neural network architectures?
 
@Mikhail not on chat.SO that I know of. Worth looking around on chat.SE
 
@Mikhail I can already tell you. Nobody knows anything. Just fiddle around with stuff untill it's good enough. Or go study hardcore math and only solve boring small problems but then with confidence
 
A bit crushing for a Monday lunchtime
 
obligatory xkcd: xkcd.com/1838
 
11:10 AM
@AndrasDeak I had a painful discussion with my supervisor about an hour ago, about being able to "for sure" know the unknown. So the system should know when it misclassified something and just label it as unknown. I had a hard time explaining him, that that is not how it works :P And now I need to to research on open set classification. At least that's interesting, compared to polishing stuff
 
Well I've done work in the space before. While its hard to predict what "works" staying current is important. So, right now I'm moving some networks from UNet to EfficientNet. Also redoing everything in pytorch for the challenge :-/
 
I love how all graphs in all papers look the same :D They should just be a latex command like evaluation_graph("our_method", "competitor1", "comp2")
 
When I was doing my PhD, we used to have a weekly lit review club where each person took turns to present a paper they read. Everyone hated it but it was the highlight of my week to eviscerate whatever was being presented
 
11:32 AM
@DuyĐặng Please see our formatting guide for code in chat
In the meantime, I'm moving that message because I can see a try but no except and it gets confusing really quickly without indentation
Please practice in the sandbox and feel free to re-post once it's fixed
 
strange, i copied from sandbox and it lost the font
Hope i fixed

while True:
            try:
                table = driver.find_element_by_xpath("//table[contains(@class,'el-table__body')]")[0]
                for row in table.find_elements_by_xpath("//*[contains(@class,'el-table__row')]"):
                    sku = driver.find_elements_by_xpath("//span[@title='Product Details']")[0].get_attribute('textContent')
                    Lines.append(sku)
                    quantity = driver.find_element_by_xpath("//span[@title='Product Details']/ancestor::tr/td[3]//div[1]//div").get_attribute('textContent')
hi , i've fixed based on the guide, sorry for my mistake
if i try to remove the index , it would keep looping forever
 
11:56 AM
No worries on the mistake, chat formatting is unintuitive. But I don't follow what issue you're having
You've wrapped it in a while True: so it's going to run forever. There was a break in your initial code
 
the break is still there, it's just in the wrong loop
 
ugh, <facepalm>. Sorry, I was being slow and didn't extend the code out
 
@DuyĐặng you know you can wait until an element is present instead of looping and keep trying?
 
actually i've used wait until element present but my boss asked me to do the while loop instead
 
and did the waiting work?
 
12:02 PM
yes it worked
 
I'm curious why your boss would ask you to break working code...
 
the reason i'm doing this because we want to loop through every line in the table to get SKU + quantity of the product
and we are intent to keep it to put more than 1 product into the table
i think so
 
but why would you need an encasing While loop for that... once you've determined your table is ready (by some means) that's what looping over the rows of that table does, surely? Seems a few bits are being conflated here...
 
Here is what i want to do :

+ Click schedule tab
+ Expand schedule
+ Lines = []
+ While True
+ Read line from page
+ If element not found error: exit loop
+ Add (SKU, quantity) to Lines
+ End While
+ Return Lines
 
So you return after a while True: loop? That doesn't seem right
 
12:11 PM
i can get the SKU , quantity into lines but it wont stop looping , i just wonder why
i want to take Lines to work in other place so i return Lines
sorry if i'm saying too confusing , i dont have based code experient/knowledge , i just new learner
 
Do you realize that nothing changes between loop iterations? Every iteration does the exact same thing, so your loop either loops 0 times or forever
 
It's fine. I also see you have a break condition in there, it just seems a bit odd to me thatit's in a while True loop
 
Out of curiosity - could you not ask your boss some of these things? Sounds like they have something mind in giving diktats about approaches and all that?
 
wait a minutes , it worked with :
while True:
        table = driver.find_element_by_xpath("//table[contains(@class,'el-table__body')]")
        try :
            for row in table.find_elements_by_xpath("//*[contains(@class,'el-table__row')]"):
                sku = driver.find_elements_by_xpath("//span[@title='Product Details']")[0].get_attribute('textContent')
                Lines.append(sku)
                quantity = driver.find_element_by_xpath("//span[@title='Product Details']/ancestor::tr/td[3]//div[1]//div").get_attribute('textContent')
 
(and on a side note... you probably don't want to have a list of "[sku, quantity, sku quantity,...]" you probably want to have each "Line" element be a pair of them so they're "[(sku, quantity), (sku, quantity)]" else it's likely you're going to have to post-process those to pair up - might as well just add them in pairs to start with)
@DuyĐặng that looks even worse... you're not looping over the table to get all rows and you've also got a blanket except...
 
12:18 PM
Actually, i don't know why he wanted me to do this it's much complicated than what i wrote before
 
heck - are you sure you even need selenium for this to start with? :p
 
so if i replace While True, would it be better @JonClements ?
@Jon
i wish i had choose coding when i was in university
 
Hard to say - seems rather a weird approach and a little messy to me... are you sure there's not just an xhr request you can emulate somehow? Sorry - fairly busy with my own work to help too much - most stuff about scraping/browser automation is very specific and only you know what you're working on and why etc...
 
@DuyĐặng deprecate hindsight. It won't change things going forwards :)
Had I known programming, it would have made my uni life much easier too. But it seems here that you have a definite list of things to process. You'd generally use a for loop to go over a finite collection and a while loop if you don't know about a definite end
 
12:33 PM
@DuyĐặng also... why are you using classes to identify the rows? I get you might want to use a class/id/whatever to identify the table itself, but then after that, why not loop over the trs and pick out the tds etc... (unless you've got a really weird table)
 
because classname of my table is generated randomly
Order_prod_1pPYu OrderProductInfo_detailsLink_17OtQ
one of the class name
 
Is this ? Verbal description, link to colab notebook, no MCVE, debugging help, OP thinks it's TensorFlow version change but hasn't tried to measure that... stackoverflow.com/questions/63340284/…
 
@DuyĐặng what's stopping you from looking for elements rather than classes though? The table is a table element with a thead/tbody which has tr and tds?
 
12:50 PM
@smci CV as needs debugging details and move on. The colab isn't even accessible.
 
i will make a try with element @jon
 
@DuyĐặng it won't affect your overall control flow-logic, but it's a good start
 
@MisterMiyagi Done
 
@smci Kudos for keeping up with such a stream of low-quality questions, by the way. Most ML topics are on my blacklist since I cannot stomach the ongoing, blatant disregard of other people's time anymore.
 
@MisterMiyagi You,re right, I don't know about kudos, occasionally (like <10%), I learn something; like here's another that seemed borderline close/RTFM but got a good answer Does sklearn kNN (NearestNeighbors) do batch processing?
 
1:09 PM
@MisterMiyagi ML engineers, as it's a new field, tend to not have debugging practices
 
they are just using neural networks to solve their problems (i.e. by asking other humans)
 
hoomans
 
does somebody know a good dataset with random images, except traffic signs?
ah i can't delete old posts, dammit. nvm. the other download option had a zip option
 
1:27 PM
@khajvah that is a pretty weak argument. Debugging is not tied to a specific field. Other fields manage to bootstrap debugging knowledge just fine.
 
Theory: ML developers are lazier* than average because "hand your computer a training corpus and let it do the rest of the work" is an attractive prospect to the lazy.
(*which is not necessarily a bad thing in all scenarios, although we're certainly bearing the negative externalities here)
 
Meh. My criteria for good laziness is being too lazy to produce problems, not being too lazy to solve problems.
Being successfully lazy takes a lot of hard work.
 
1:43 PM
Spending seven hours to automate a twenty minute task, that kind of thing
A year ago I wrote a script that automates the rendering of TPS report covers, a task which would normally take up two minutes of my time per week. I only recently broke even in terms of development time spent vs rendering time saved.
Tragically, last week the script failed due to a corner case I had never considered, which took me 45 minutes to fix. So I'm back in debt for another 22.5 weeks.
 
Xkcd has something to say to that xkcd.com/1205
 
Here's hoping the TPS report format isn't made obsolete by organizational churn in the next five years
 
2:43 PM
@smci code added, cc @MisterMiyagi . Worth reopening now? Not my domain to tell.
 
user11867287
h
 
e
 
user11867287
Can someone point me to a pyscript that monitors any new pages with that nomenclature (website.com/12345678)
 
user11867287
I found some sort of monitor but upon reading the script it's not a good idea
 
2:49 PM
There's a handful of unPythonic idioms there, but the general principle of "call requests.get periodically in a loop" is pretty much what I'd do
Nontechnical solution: beg the webmaster to provide an RSS feed
 
user11867287
You talking to me, right?
 
user11867287
I mean, I created a small node.js express server
 
user11867287
which basically fetched all info but only on main page
 
@GaryOak why is not a good idea
 
user11867287
@khajvah Well front what I can read, it's not really for my use case
 
2:51 PM
if str(soup).find("Google") == -1: is deeply silly because you could just do if "Google" in response.text:
 
user11867287
IBut beyond that
 
user11867287
it doesn't do what I need
 
user11867287
See there's a website
 
user11867287
I already have a node.js that scans parrallel for new uploads
 
3:10 PM
I suppose it's not their job to educate me on HTTP principles
 
user13415013
@Kevin, thanks for information, ill try that.
 
I was directing the advice at Gary, but hey, if it works for you too, great
 
@AndrasDeak regardless of the domain, I don't consider code dumps as MCVE.
 
@MisterMiyagi works for me. I didn't even really read the question. If it's "this is our code, why is it wrong?" it is indeed bad
@GaryOak please move your business endeavour with @nard elsewhere
 
@AndrasDeak If it has a scroll-bar that long, it's not an MCVE. ;)
 
3:15 PM
If an MCVE is off the table I'll take CVEs over any other combination
 
user13415013
sorry, this wont happen on future. If we make dataset , we'll set it to public
 
@nerd it's not really your fault; Gary is a problem user so I'm not cutting him any slack
 
@GaryOak think it's best you just discontinue what you're doing here thanks
 
user11867287
Sure thing, buddy-pal.
 
user11867287
(i was trying to get a room so I can talk to nerd without bothering you, btw)
 
3:24 PM
you don't need "a room" to talk to people here and as all rooms are public - perhaps it wouldn't make sense anyway... I can see you've already tried to exchange emails or something - so just leave it at that and find some off-site way if you folks want to communicate directly. Good luck with that, but again, I'd ask you not attempt it here - thanks!
 
user11867287
I don't understand what you're saying, but ok.
 
user11867287
The kid's not too graceful with his words anywho :(
 
user11867287
@Kevin which require would you have? In node, I think it would something like jsdom & node-fetch
 
user11867287
python equivalents?
 
I assume jsdom can turn plain html into a navigable document object model. If so, the equivalent is BeautifulSoup. If node-fetch performs http requests and gives you the result object, the equivalent is requests. Both are available on pypi.
 
off topic: Do owners have a private room of some sort?
 
no need, you gain the ability to communicate telepathically when you become an RO
5
one of the few perks, although some would call it a curse :-P
(yes, we have a place that we use to discuss RO stuff)
 
well, I guess that's the requirement for becoming RO
 
3:55 PM
I've been making a lot of progress with Click lately, closed more than 25 issues over the weekend, only ~110 left. Was at 150+ a few months ago. Click 8.0 is going to have a lot of cool new features.
There's a huge PR that I'm reviewing right now that rewrites the entire shell completion system to be way easier to extend.
 
4:24 PM
@davidism oh wow it's yours. I had been showing off how cool is Python with click a month back
 
@Kevin Sure but time saved doesn't include headspace and context-switching savings. Not having to think about it every time (and not make errors when doing so) might have much greater value than time saved.
That's how it tends to work for me, anyway. I'd rather spend a couple of hours yearly than a few minutes every week. One less thing to do.
 
Hi everyone, can someone suggest me the way to observe correlations between various variables if the no of variables is around 80 in python? Maybe a framework of sorts ?
The end objective is to predict a continuous variable i.e. a regression task
I was thinking of trying seaborn's pairplot but I don't think that would be a good idea given the sheer number of variables
 
Well that's plotting, it's a poor man's regression
For 80 factors, I doubt you'll get much sense from regression. How many observations do you have?
 
@roganjosh 1460
 
So next to none. In the context of your number of factors, you're probably not going to see anything in particular
Can you combine the 80 different factors into broader categories?
 
5:16 PM
@roganjosh using something like PCA?
 
No, just logic. There's too many indicators and not enough data, so can you refactor the problem in a way that you can get some useful insight?
What even is the problem? Context might be useful
 
Its a housing price problem , we have various factors which are related to housing and I need to predict the housing price after considering the relevant factors
 
I wish there were prizes for mental guesses cos I had thought-pounds on it being about house prices :P
Is this the kaggle dataset?
 
yeah
I would probably come across a lot of good advice after seeing discussion boards or other notebooks but I want to try to think myself as much as I can before relying on them
 
Then it's the introductory dataset. They have example scripts etc
Does "think yourself" involve coming to the Python chatroom and asking? I don't want to sound rude, but that's what you've done
 
5:25 PM
I guess not , but thanks though! discussing helped me get an idea
 
5:40 PM
cbg, I was reading about "click" after seeing the link posted here, "Click is internally based on optparse instead of argparse." but acc to the docs optparse is deprecated, while I am yet to use click or optparse is it common for high profile libraries to use deprecated modules?
 
I can imagine lots of libraries drag their feet a bit, given how long it took a lot of them to upgrade to Python 3
 
I was under the assumption that deprecated meant to move / change to the recommended alternative when possible, I guess it doenst work well if people have more py files in their project unlike me :/
 
Optparse isn't deprecated, it just won't receive further changes. But that's not relevant to Click, which only based its parser on optparse because the author liked its parser better. It's not actually using optparse in any way, and is its own distinct framework.
 
Confession: I don't know the exact meaning of"deprecated"
In any case one ought to keep in mind that a library can go on being useful even if it's never going to be updated again. Command line argument parsing in particular seems like an environment that's not prone to code rot
 
I just read the page from start and it does mention that "Click actually implements its own parsing of arguments", shouldn't have directly skipped to "Why not argparse", sorry
 
5:54 PM
Compare to, say, an OS kernel, which you should probably stop using before its EOL, or else get hit by a thousand simultaneous zero day attacks
 
put it that way that makes a lot of sense
 
The syntax for command line arguments and options is essentially static at this point. All the changes are in the processing framework built on top of that. So while the parser might change, it would be to make it more efficient, or do something internally to signal something to the framework, not to change how the command line is parsed.
 
 
3 hours later…
8:36 PM
@PM2Ring There kind of is, in the 10k tools. Posts show up there once they have pending delete votes. See: stackoverflow.com/tools?tab=Delete&daterange=today (also change the date range filter).
 
9:09 PM
Flask has more stars on github than Django (51.6k vs 51.2k)
doesn't mean much, but little unexpected.
 
9:29 PM
stackoverflow.com/questions/63342686/… - it seems pretty answerable to me (which is why a wrote an answer), and got caught off guard by the cv.
 
9:53 PM
Nice find - https://github.com/satwikkansal/wtfpython
- "fun project attempting to explain what exactly is happening under the hood for some counter-intuitive snippets and lesser-known features in Python"
 
10:42 PM
@shad0w_wa1k3r there are at least a few dubious claims
> Multiple Python threads won't run your Python code concurrently (yes, you heard it right!).
assuming the usual meaning of concurrency that ^ is wrong
> += is faster than + for concatenating more than two strings because the first string (example, s1 for s1 += s2 + s3) is not destroyed while calculating the complete string.
And that sounds as if s1 += s2 + s3 mutated the string s1 rather than creating a new string. Otherwise the original string would be "destroyed" (for want of other references).
 
11:13 PM
And it tends to blur the line between python and cpython implementation detail. Even if most of the blame for that is on the python docs.
 

« first day (3586 days earlier)      last day (1348 days later) »