« first day (2749 days earlier)      last day (2197 days later) » 
00:00 - 19:0019:00 - 00:00

12:52 AM
I suggest the following should be canonical. (Where and how do we discuss that?)
86
Q: What is the difference between `sorted(list)` vs `list.sort()`?

alvaslist.sort() sorts the list and save the sorted list, while sorted(list) returns a sorted copy of the list, without changing the original list. But when to use which? And which is faster? And how much faster? Can a list's original positions be retrieved after list.sort()?

 
1:14 AM
cbg
 
2:01 AM
@smci Do you mean that you'd like us to consider adding that question to our collection of canonicals? It looks good to me.
OTOH, I don't expect that we'll often get dupes of that question, so maybe we don't really need to add it to the collection, which is mostly for common dupes, especially those for which it's hard to find a good dupe target. Or there are several reasonably good targets, and it's not easy to decide which to use.
 
2:21 AM
@PM2Ring Yes I'd like you to consider adding that question to the collection of canonicals. But if you believe the primary motivation for canonicals is a list for closing dupes, not a representative standalone list of questions users might typically ask...?
 
 
1 hour later…
wim
3:31 AM
It's not meant to be a list of questions users might ask it's meant to be a list of questions users do ask, over and over again.
 
 
1 hour later…
4:55 AM
@wim: then that one should be included, yes? What are some other Python questions that should also be canonical? The current list is pretty skimpy.
 
wim
5:20 AM
Nah, I don't see that one often or at all. Opinions differ...the current list is way too long imo. It's already paginated (>100 questions) and so not really much easier to search than just searching the main site.
 
 
2 hours later…
6:51 AM
what is up guys (Hint: sky) every one busy huh!
 
7:21 AM
@kanishktanwar no need to call my nickname as a hint
 
7:43 AM
@timgeb: please don't just dump idownvotedbecause links without any further text.
Such link-only comments are worse than the ill you were hoping to correct. As a moderator, they make me want to create a ideletedthiscommentbecau.se link target to give feedback as to why I delete such comments on sight.
 
morning
 
8:01 AM
morning @AndyK
 
@Luca sup?
I meant
cbg
 
cbg
 
Hi All.. Any idea what am i missing in the code:
https://stackoverflow.com/questions/50034347/convert-the-input-number-to-alphabet-representation?noredirect=1#comment87088762_50034347
 
8:43 AM
Is there an easy way to chop off the leftmost digit of a number? Like 19 -> 9 or 273 -> 73
Do I have to go with int(str(num)[1:])?
 
@Aran-Fey Fails for single digits?
 
@AshishNitinPatil Oh, nice catch. I'm pretty sure my numbers will always have at least 2 digits though, so it shouldn't matter
 
No need to be reliant on the numbers, just do int(str(num)[1:] or 0)
 
8:59 AM
Nice. I like that. I thought I'd need a try..except block...
 
I remember the or trick from Django templates. Django templates isn't that great, so you need to know the quirks and hacks.
(It's good, but eh, sometimes doesn't feel like it's very powerful, because you aren't doing things the ideal way)
 
@Aran-Fey Is there a hotlink for that?
 
in order to process a csv file , one row contains html tagged data. How can I write xpaths to this??
 
Now it does :-p
@Ananthu with beautifulsoup
 
ok
 
9:06 AM
Soup the particular column of html data, then you are free to play with it
with xpaths and what-not
 
@cᴏʟᴅsᴘᴇᴇᴅ It's this one. I kind of repurposed it to support arbitrary text substitutions instead of just links to the documentation. The relevant shortcut is <questionmark>formatguide<questionmark>
It's still a little buggy and doesn't always react when you submit your message, so it's best to stop typing for a little bit and wait for it to do the substitution (it happens after 4 seconds of inactivity)
 
Holy cow, did you hardcode each and every single one there?
 
I wrote a script to do it :P
Listing all the stdlib modules turned out to be surprisingly difficult
 
sadly I can't upvote but I can star gists
 
too much dedication
 
9:16 AM
Oh, that's nothing. I've invested a similar amount of time into a far less useful script.
I'm working on something that's supposed to automatically edit unformatted questions into shape. The whole thing is built on optimism and probably won't work out.
 
9:54 AM
39 mins ago, by Ashish Nitin Patil
too much dedication
 
10:06 AM
@AshishNitinPatil getting to 10k mate
I need to code this wkd
 
10:22 AM
I'm not even trying to get anywhere ATM. Not enough time to devote to SO.
Not enough motivation too, but that doesn't matter does it.
 
What's the smart way to convert special characters into their escape sequence counterpart? Like "\n" -> r"\n". All I can come up with is repr('\n')[1:-1]...
 
re.escape?
>>> re.escape("\n")
'\\\n'
but it will also escape anything other than ascii letters and numbers and underscore
 
I can't use that; it escapes too much. Things like . and whatnot
 
add a backslash with re.replace? (I mean something that actually exists)
why is there no re.replace?
 
You mean re.sub?
 
10:31 AM
I do! I even read help(re.sub) and thought that wasn't it. Sheesh...
"read", apparently
I only took a peek and I thought that it does what awk's substr does (I didn't think about whether something like that would even make sense)
I should call it a week and only take part in intellectual discourse starting Monday
 
I'd have to hard-code all the characters that need to be escaped though
 
yes, since you want something arbitrary between "no characters" and "everything handled by re.escape"
oh, you mean having to define \n -> \\n etc; hmm, there should be a better way for that
there's also .encode('unicode_escape') but then you have to decode to get a string again and will also mess with your unicodes
clearly you should just do this in perl
 
Encoding then decoding is still better than my ugly repr-slice hack
 
but then
>>> "főő\nbár".encode('unicode_escape').decode('utf8')
'f\\u0151\\u0151\\nb\\xe1r'
 
Oh.
 
10:45 AM
perhaps repr slicing isn't all that bad :D
 
yeah, each failed attempt to find an alternative makes it look a little less bad
 
or just use a loop for char in '\n\t\r': and then .replace(char,repr(char)) incrementally
 
But what about \v and \a and \b and ...
 
well you need to do that anyway
there's no module that handles stuff_that_Aran_wants
 
11:10 AM
@MartijnPieters ok
 
@Aran-Fey you don't even have '\a', it gets translated to '\x07' according to its ascii
perhaps you should go from ascii 7 to 13 inclusive and replace those :P
is this not an XY problem to begin with?
 
Great. So I have yet to find a working solution. Fantastic.
Idunno, you'd have to ask the OP
 
Oh. :|
if you had started with that I'd have given up after 5 minutes :P
 
11:25 AM
Sorry, I'll be sure to include that important piece of information next time :p
 
@timgeb Sorry, I also meant to add a bit more context, but ran out of time. Jon Ericson (a Community Manager at Stack Overflow) wrote a really thoughtful post about those links: meta.stackoverflow.com/a/356051
Specifically:
> Bare links (idownvotedbecau.se/nomcve) come off as cold and unhelpful. Very much reminds me of yourlogicalfallacyis.com/tu-quoque. Taking a minute to fill out a personalized comment seems more productive.
but the other points in the same section should certainly be read too.
 
well that ideletedthiscommentbecau.se would be fitting ;)
 
11:59 AM
 
hi all
 
Hello
 
how are you today?
 
Fine, thanks
 
can we import a file down the directory? example
C:\Python\Practice\New\New1
i am running New1.py in this directory i want import a module which is in
C:\Python\Practice\Practice.py is it possible?
@Skyler i am sorry about that, i thought people needed a very good hint :P
 
12:13 PM
@AndrasDeak Hammered
 
@kanishktanwar Is Practice a package? Or are these two scripts unrelated?
 
it is
from Practice.py i can call content of New1 , but vise versa giving me, not found error
well i am reading somewhere and they stated it was possible in python 2?
 
In that case, which python script is the __main__ file? Is New1.py the file that starts the program, or is New1.py being imported by some other script?
 
New1.py starts the program
so i can easily import packages which are up the folder but if they are down the folder then its no luck
 
That's your problem. It's better to separate library code from executable code. No file inside of a package (except __main__.py) should be executable.
 
12:20 PM
@PM2Ring thanks :) I managed to reload at a point where my dupe comment had an upvote and the close votes were gone from the question. Another reload and it was closed and dupe comment gone.
@kanishktanwar note that "down" usually means "deeper down" in the path
 
If you import New1.py from somewhere, then it can access parent modules through relative imports like from ...Practice import whatever, but that doesn't work if New1.py is executed directly
 
ohh right
 
It turns out the serial voting detection only reverted 9 of the 13 votes from yesterday. Is that intended? stackoverflow.com/users/1222951/aran-fey?tab=reputation
 
@Aran-Fey not intended but it happens
 
@AndrasDeak Weird! I assumed that those changes happen simultaneously, but I guess it doesn't really matter much if they happen sequentially, especially if one is unlikely to interrupt the sequence like you did.
 
12:32 PM
yup, and this is the first time I've seen this so it probably isn't very common
 
Most answers on Meta seem to include the sentence "the serial voting algorithm is conservative and doesn't undo votes lightly" so I guess that means I can keep my 40 rep
 
Well you can always flag for a mod to have that 4 upvotes reverted too (since it's obviously a serial thing), after which it'll get marked helpful in a few weeks and that will be it
 
I wonder how often mods get a "Hi, I'd like to lose 40 rep and 4 tag score please" flag
 
:)
 
Probably not often :P I once flagged a +70 streak that wasn't caught at all, mods left it alone.
Considering how part of it has been caught now I probably would bother with it even less.
 
12:50 PM
cbg
 
cbg
how's Northern Distantland, idjaw?
 
Going pretty good. Really busy releasing 1.0 of this platform
how about you
 
Fine, fine, thanks. Bit sleep-deprived this week which shows in my cognitive capabilities
 
Sleep......it's amazing how we are all very aware how important it is, and how we really need it for our health and we knowingly just abuse ourselves with lack of it.
I know I'm a huge culprit of this
 
yeah, that's why we can't have nice things. It's all your fault!
 
1:02 PM
It is. checks reference guide...ah yes here we go
> Come at me, bro.
 
@wim Sure, but I don't think I implied that list is a linked list. But I did expect that it would have good performance when used as a stack since it doesn't reallocate the underlying array every time an item is appended or popped from the end.
I guess it's reasonable for newcomers to Python to assume from the name that list is implemented as a linked list, since in other languages "list" generally implies a linked list, but OTOH, if "list" always meant "linked list" then we wouldn't bother with the "linked" qualifier. ;)
 
1:18 PM
cbg
@idjaw We should make tshirts, if we're ever cogent enough.
 
From the Hot Meta list: Change the symbol for the accepted answer so people don't assume it's the only correct answer. I agree that casual users of SO & other SE sites may place too much importance on the accepted answer, but I don't think that changing the icon would have much impact.
 
yeah, I'm on the fence about that
 
1:41 PM
Am I being too rude in my comments on this answer? (See the attached Chat for my latest responses). stackoverflow.com/a/49599301/4014959
 
I think it would be profitable/nice to have the top three or even four answers marked as correct for some questions. Particularly when the originally/first accepted answer has aged somewhat.
On the other hand, less responsible users simply marking every answer correct, or gaming the system by accepting friends answers is going to be an issue.
 
@toonarmycaptain Who decides when an answer is correct? That's not always easy to do. And that's why we have votes, but even those aren't an infallible guide.
 
@PM2Ring Also a good question. I would assume the additional marked correct answers could be marked by the OP, or mods of a certain level in the question tag?
@PM2Ring What I could see at that link didn't seem rude to me.
 
@toonarmycaptain Maybe. Sometimes OPs try to accept multiple answers, or comment "I wish I could also accept your answer". OTOH, the OP is often not the best judge. And I don't like the idea of giving tag experts that much power, unless they are really top class experts, but even people like Martijn occasionally make mistakes (although they are quick to rectify them when they notice them or have then brought to their attention).
 
1:59 PM
@PM2Ring Well you could set the bar high with tag scores, total rep and such. Questions and their correct answers do get marked Community by someone, right? I would think what I'm talking about could be done on similar merits.
 
@toonarmycaptain That sounds like a good argument for Platinum tag badges.
 
Part of me also likes not leaving that power in the hands of OP alone. It is true that when I see an accepted answer with lower votes than an unaccepted answer, I give the higher votes some attention, but it's not always clear (depending on the comments really) whether the higher voted answer has aged and another has been selected, or if the higher voted answer really is the better one.
That said, the modification to the system we're discussing would have similar issues, and possibly be less clear, unless OP set a hierarchy of accepted answer priorities, or some other information coming fro
I'd be happy with a double vote count - general and gold-badge/high rep.
12312 users upvoted this answer [Including 14 high rep pros]
435 users upvoted this answer [including 200 high rep pros] <-I would heed this one more
And maybe some sort of info about the age of these votes. All this extra info could be in a drop down: 211242 upvotes -click to see vote breakdown
 
I think having a hierarchy of multiple selected answers would be of limited benefit most of the time, and in general it would only increase the confusion, especially for people who aren't SO regulars.
 
2:17 PM
That's my thought to, but something like that would leave some power/priority with the OP, as well as allowing older answers to keep their status as accepted and upvoted, while communicating that their content is somewhat depreciated.
Maybe this is just meant to happen via comments, answer edits, retagging for older versions of Python (in our case), OP maintaining their question by accepting a newer answer? Truth is that's probably not common.
The hypothetical "how to print "Hello, world!" to the console and how to take user input questions from 2008 would likely have a huge amount of upvotes for the python 2 answer by now, even though it is depreciated, and input() in 3.x doesn't have the security issues it apparently had in 2.x.
 
I agree that it would be nice to have a more effective way to deal with old answers that may contain obsolete code / information. At the moment, if stuff is really bad and we can't get the author to fix it, we have the option of editing it ourselves, or if it's not really salvageable we vote to delete it.
But really, we don't want to allow a small group of people to have the ability to make radical changes to the scores that answers have received through the normal voting process. Sure, there are plenty of ancient questions with answers that have outrageously high scores compared to modern standards, but there isn't really a lot we can do about that due to the sheer volume of questions and answers on SO. All we can do is deal with particularly important cases as they are noticed.
 
morning cabbage
 
2:36 PM
I don't care about the outrageously high scores in and of themselves. My concern would be more centered on the relative highness of the old/depreciated answer scores compared to the other (more correct/updated) answers to each question.
I'm not advocating changes to vote totals. Just maybe a breakdown, how old those votes are (if 99% of them are from low rep users, or from 10 years ago with few upvotes in the last 5 years), and an indication of the type of user they came from to indicate how much weight I should accord them.
 
3:00 PM
 
already closed; reject that edit please
 
3:25 PM
\o depressing-that-my-hockey-season-is-over-cbg
 
cbg
 
jjj
@MooingRawr you still have the hoops season
 
DSM
@MooingRawr: shared pain cabbage
 
cbg
 
which hockey teams are you guys rooting for
 
DSM
3:27 PM
My father grew up in southern Ontario and so I didn't have a choice: I'm a Leafs fan.
 
jjj
you also rooting for the dinosaurs? I see theyre leading with magicians
Im curious how much local-patriotism is a thing wrt nba
 
@DSM My elementary school days were spent in Vancouver. So ever since the riot I stopped watching hockey
 
DSM
My deck: Leafs, Raps, Jays, Stamps (Argos #2), Colts, TFC. Follow NCAA gridiron and hoops but only root for storylines and underdogs. Don't really follow international soccer, rugby, or cricket.
 
watched the raptors game yesterday?
 
DSM
Followed more than watched, yesterday was a hockey night.
 
3:38 PM
ic
 
3:52 PM
if id(x) == id(y) then x,y are pointing to the same object?
I'm thinking about some layers in neural network and I'm confused about whether I should make a copy of the parameter, which should be a huge matrix which as the input of the node, of the function, or just modify the input?
 
^ yes they do
 
Thank you coldspeed~ I like your avatar btw
 
Yesterday I built a neural network which should be considered "stupid" because I used numerical differentiation to adjust those weights and it was reallyyy slow
 
@Niing my internal sentence parser exploded when I read that sentence
 
3:58 PM
Sorry... my english is always bad.
 
its fine 99% of the things I say are just poking at fun
 
lol I fine too, it's ok
but I like english, I like memorize words
 
@davidism: I think the flask 1.0 release notes miss an entry about the app.errorhandler change
 
oh I just found that I have to write dx = dout * 1 not dx = dout or it will not create a new array for me...
 
better write dx = dout.copy() instead
 
4:11 PM
@Aran-Fey so it sometimes won't do? or for the clearity
I have to review the poem
 
for the readability
 
Explicit is better than implicit. Ok I'm wrong
ty
 
just curious, anyone got a ballpark approx. of demographics in this chat room?
 
there are approximately people here
 
your ballpark must be much bigger than my ballpark
 
4:15 PM
@ThiefMaster you mean the blog post or the changelog?
 
Should we close this one as a typo? stackoverflow.com/questions/50047476/…
I just noticed that abarnert posted a comment on that question. He was very active when I first started on SO, but I haven't seen him around for ages.
 
He now frequents this room though
 
Excellent
 
Welcome back ;)
 
@Niing could also do dx = dout[:]
 
4:24 PM
Thanks, Simon.
 
Anyone have ideas why the standard docker python3:6 image runs into this issue when running unit tests?
> from asyncio.test_utils import TestCase
/usr/local/lib/python3.6/asyncio/test_utils.py line 36 in <module>
from test import support
ModuleNotFoundError: No module named 'test'
it's in the standard lib though, I think? I can run this locally fine
 
oh its not a custom module?
Nevermind then
 
the import error is coming from the standard lib I think
 
What's the exact docker image you are building from?
 
4:26 PM
> FROM python:3.6
 
I just realize that a_normal = list(a), which a is a numpy.array, works... so many rules
 
can you do sys.path from within the image?
 
@enderland that's so odd, I get the same error
Looks like its a common issue however: github.com/docker-library/python/issues/277
It gets removed during the build of the python image
 
.... interesting. not during an actual install of py3 though? lol
 
"The test package is meant for internal use by Python only"
 
4:31 PM
I was going to sey, I've never heard of that module before
 
Also enderland, if you're concerned with performance, look into the python alpine images, the python base images are just massive.
Or google's distro-less images
 
That won't affect runtime performance unless you're talking about image distribution time
 
Not runtime performance, no
 
@chrisz yup. I was doing this for a coworker, I have tried to use the alpine 3.6 one before but I ran into issues I don't remember
 
Once you switch to alpine you start hitting all the compilation from source issues :D
 
4:35 PM
that might be what I was hitting hah
 
@davidism blog post (basically what i commented on github a moment later)
 
I have a question about scraping, I have a small script that scrapes a bunch of news sites from around the world and counts certain keywords for example name of countries, presidents etc. So I know what\Who is popular in the news that day. Is there a smarter way to scrape the main area of the page since all the sites would be designed differently?
right now, all I am doing is soup.text().count(keyword)
 
4:51 PM
hey guys. 65k rows insert/minute... is this a reasonable speed? On postgres, django ORM, @transaction.atomic.
or is this abnormally slow :|
 
That is on the slower side
For what postgres can handle at least, not sure how django plays into that
 
What's the usual speed for about 4 column data?(text, datetime, datetime, integer)
 
What version of postgres are you using?
 
@Ajit We don't like to encourage scraping in this room. Typically, servers expect to handle human traffic, scraping puts a lot more stress on them. It wouldn't be a big deal if scrapers were rare, but they aren't. So scraping is often against the Terms of Service of many sites. News sites generally provide RSS feeds or similar that are designed to be read by software, so please try to use them. It makes the coding easier and puts far less stress on the servers.
 
@chrisz 10.3
 
4:57 PM
how can I do the matrix product of diemension more then three? say 2x2x3 what's the dimension match this, and how to do it in python
 
I'm running htop to get to the bottom of this issue, and it seems like my python script is cpu-throttling
 
@Niing numpy.einsum
of course you'll have to first figure out what you want to do exactly
 
I'm reading a book about neural network and it does a reshape upon a matrix which may has a dimension like 2x2x3 not just 2x2, so I was wondering is it possible to do matrix product with such dimension.
 
@PM2Ring Understand. It's for learning purposes. Is there any collection websites that are open for scraping?
 
If you find another array with a dimension of 2 or 3, sure. It's just a matter of what you're doing. Strictly speaking matrix multiplication is 2d
 
5:06 PM
I just draw a matrix with matrices as its elements, mind exploded
 
Okay, I read up some more. It's probably not a good idea
 
wim
5:19 PM
@Aran-Fey sometimes I like to see how to avoid the str domain for problems like this
>>> from math import log, floor
>>> n = 4321
>>> n % 10**floor(log(n, 10))
321
 
@wim Fair enough. But I wouldn't be surprised if doing it the string way is faster.
 
wim
I'm not sure what's faster, don't really care
more out of mathematical curiousity
 
I thought about that, but I didn't want to take any risks with floating point inaccuracies
 
@wim In whatever landfill currently houses my previous laptop, most likely
 
though it's probably unreasonable to worry about that
 
wim
5:22 PM
yeah, fair enough. there are probably mathsy ways to do it without float, too.
not unreasonable. those float bugs can really get you when you least expect it.
@AshishNitinPatil that's an intentional design feature of Django
(simplicity of template language) and one I strongly agree with
 
I know, but that simplicity translates to not having "for i in range" and what-not.
 
wim
the idea being that any logical code should go in Python, where it can be easily tested. Only the results ready to render should be passed to the template.
 
Yes, but I did say, "for the lazy" :-p
 
I'm so glad I'm not the only one bothered by these "don't use the way the language is designed to solve the problem use some arbitrary more complex other way to solve" assignment questions: stackoverflow.com/questions/50048515/…
 
wim
the template's sole responsibility is rendering, not doing maths and stuff
 
5:27 PM
When you have a mix of lot of things and customizing existing stuff, you don't have much options
Just minor rant, I understand the necessity and certain benefits it brings.
 
Do we have a good duplicate for this kind of question where the OP takes user input in a function and gets a NameError when they try to use the local variable from that function somewhere else?
 
@shuttle87 :) OTOH, I do appreciate the value of learning how to do such simple algorithms like converting strings to numbers. Sure, nobody (except library code writers) has needed to implement that sort of thing for decades. But it's still a useful learning exercise in building the skills you need to be able to develop algorithms.
 
DSM
See, that's why I'm not as harsh on obvious "do it a dumb way" clearly-pedagogical questions. They have to learn how to do things manually in some language, why not Python?
 
@PM2Ring I guess the bothersome thing is the question framing, most of the time I've run into this type of thing lately that exact discussion never happened. Granted I could just be unlucky there too. I do see these tasks as valuable with the caveat being that they are learning exercises being explained to the students
 
I'd expect teachers that give such assignments have given the students the necessary background to be able to write the code. And maybe it's just the kids who don't pay attention in class who dump these homework problems with stupid restrictions in our laps.
 
5:37 PM
I think I shall try to write the star scraper script again from scratch... Let's see if my beautifulSoup-fu is any better than in '16.
 
DSM
Didn't someone link a "supposed to be better than soup" lib recently?
 
@PM2Ring I'd be extremely interested in knowing more about how these questions end up on places like stackoverflow or other sites
 
@Kevin I just wrote it today
 
I've just now done most of the hard parts, so I'll finish up and then we can compare notes :-)
 
wim
@shuttle87 I also hate these. And the stupid answers they attract (thanks for giving me 3 things to downvote).
 
5:43 PM
Nah, I'd be too embarrassed
 
wim
I'm curious, can you see messages that were starred and then unstarred in API?
 
I'll be home in an hour
 
wim
because the RO's tendency here to clear stars from n00bs and leave the stars of their cronies is gonna skew results..
2
 
@wim I don't think so.
@wim pfft. ^
 
... There's an API?
 
DSM
5:53 PM
Apparently some people use (e_e) as an ASCII eyeroll. Since I've just learned that, wim's last comment had some value..
 
@Kevin only for toggling stars
 
Hey guys, I don't usually ask for diagnosis questions on SO; do you guys think it's better to be very comprehensive with my dump(and scare away a lot of people) like this: stackoverflow.com/questions/50049213/…
or should I edit it in some better way to get attention?
 
wim
e_e yeah I can kinda see it
@OneRaynyDay looks good to me
if you don't get attention it's not always cause it's poorly written, can be just a boring question.
 
I see :/ well thanks for the approval, hopefully someone can come along
 
wim
you often have to bounty boring questions to get views, and how to optimise some django psql stuff is certainly a boring question
speaking of boring questions, dang, the question I asked about 24 hours ago has only 17 views
> urllib3 is a powerful, sanity-friendly HTTP client for Python.
(from here) does anyone know what they mean "sanity-friendly"? am I missing something obvious?
 
6:03 PM
@OneRaynyDay what format is your data in?
 
Urgh the starred posts page doesn't supply each message's timestamp in an easily parseable way
 
@chrisz my data is in json, timestamp is in seconds since epoch and then I call datetime.datetime.fromtimestamp() to cast it into a datetime object to write into postgresql using the ORM
I'm currently trying bulk_create instead of many .save()'s
 
Yea I think using Python at all here is going to throttle your speed somewhat. But I'm guessing you have to because of date conversion?
 
@chrisz I don't think that's actually the bottleneck :P I'm not sure. Didn't find anything related to datetime in my cProfile dump that was significant
 
No I'm saying that the reason you are using python to do this and not something else is because of the date conversion?
 
6:08 PM
that's not the reason. I'm using python because I don't want to write a lot of code
 
I'd have to imagine bulk_create is going to give better performance than all the saves, just be aware that is tries to write all the entries in one query by default.
 
@wim or a hard question too that isn't immediately obvious to FGITWers
 
What's a FGITWer?
 
fastest-gun-in-the-wester
 
@chrisz Yep - it's gonna be one hell of INSERT INTO statement
wow. The insert speed shot up to 2 minutes once I ran the bulk insert statement
 
6:18 PM
@Kevin I've got a parser ;)
 
I look forward to comparing notes once I also have one
Let's see, what's the strptime flag for non-zero-padded hour...
 
aaand we've just opened page 100 of the starboard
 
Nobody star anything please, you'll invalidate my memoized html pages ;-)
5
 
holding back the urge to star the above comment...
4
 
"Testing please don't star this"
 
6:29 PM
The ol' reverse psychology star.
 
Public disclaimer - I am still holding back. Evil Mischievous me is still unhappy.
 
OK, put my version here, it should be changed a bit if we want to filter (I converted datetimes to timestamps in order to be able to json dump it)
it scrapes all 100 pages one after the other so don't get throttled on my account :P
and you probably shouldn't let it loose on the JS starboard
 
Not looking at that yet. Just completed my parser (by cheating a whole lot), and am deciding whether I too want to convert to timestamp or not
 
You have to? but do you want to too?!
We need to compare KevinScript with DeakSoup
 
I'm also json dumping the data so I'm pretty sure I can't use regular datetimes
 
6:40 PM
Just use standard timestamps that can be easily parsed back
 
I've never done any html things which will be my cover when anyone raises problems with my code, including unrelated python butchering :P
 
Just throw aggregated results of this room's stardom and you'd be spared :-p
 
well I can, I just wanted to jump in front of Kevin, I haven't done any data processing
 
I am enjoying this quite a bit. Nudging people who are doing the actual work, and me basically doing nothing :D
 
wim: 29
Kevin: 29
Andras Deak: 22
Aran-Fey: 16
cᴏʟᴅsᴘᴇᴇᴅ: 15
Kevin M Granger: 13
abarnert: 10
DSM: 9
piRSquared: 7
OneRaynyDay: 6
Results for the last two weeks.
Or the first three pages of the starred list, whichever comes first
 
6:49 PM
mama I made it
 
Can I get some feedback on stackoverflow.com/questions/50048681/…. Is my answer just overkill for this situation?
 
In approximately 3*99 seconds I will have the all-time results
 
@chrisz if I understand the question, why not do something like __dict__.update(dict)?
 
Feeds has quite a few stars
 
Where would I call __dict__.update(dict)?
 
6:55 PM
Is there a function that one could use in Python 3.6 that's like subprocess.Popen(Cmd, shell=True) but when you run it from a script and kill that script's cmd windows that the process called by the subprocess.Popen() keeps running?
So if I call a batch script with subprocess.Popen() as soon as the Python shell window is killed, that batch quits running and I want it to keep running
 
wim
@chrisz the question is a dumb idea in the first place
 
I don't need it to return my anything to the script that called it via subprocess.Popen(), I just need it to keep running once called regardless if the calling script gets killed or not
 
wim
they are already in the good situation (have the data as data / dict) and they want to go into the bad situation (have the data as variables / code)
so, I would avoid these questions rather than trying to help them shoot selves in foot
 
added an all-time star list of my own to compare gist.github.com/adeak/220f1994e5ed5fa23f599c74017b257e
 
00:00 - 19:0019:00 - 00:00

« first day (2749 days earlier)      last day (2197 days later) »