« first day (2647 days earlier)      last day (2284 days later) » 
00:00 - 23:0023:00 - 00:00

12:55 AM
@Rawing Yep it's working. I have two environment's now but it's worth it. : )
 
1:33 AM
@Rawing Thanks for the setup script I'm going to need one of those for Gtk.
 
2:07 AM
Found something interesting. If anyone is interested, try this:
x = np.arange(5000)
N = 4

%timeit (x ** np.arange(N)[:, None]).T
43.2 µs ± 346 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)

%timeit x[:, None] ** np.arange(N)
150 µs ± 413 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
They do the same thing, but so so differently. Haven't found a better example of minor differences in broadcasting showing such contrasting results.
 
Rhubarb. Sorry don't know NP yet.
 
np - No Problem.
 
3:09 AM
@coldspeed Thanks, going to play around with a little later.
 
3:26 AM
cabbage
 
@wim Recursively defined lists are out of the scope of that question. Do I really need to add a solution for that?
Someone is busy upvoting all your replies to my comments, as if that's showing me up or something, lmao
 
3:45 AM
reading the conversation: is gtk3 available for python3.6+ now?
 
wim
@cᴏʟᴅsᴘᴇᴇᴅ It's actually very easy and it's worth learning how to do. You keep a memo of seen ids. Recursive functions should always take into account the possibility of recursive data structures.
it's usually easier to do these iteratively.
@cᴏʟᴅsᴘᴇᴇᴅ yah, it is probably the butthurt guy you were in a comment feud with.
 
4:18 AM
cbg all!
 
@wim Who has also taken it upon himself to downvote my 0 vote answers.
2 so far. Wonder if he'll downvote any more.
@wim If you say so, then I'll look into it. I also had a discussion about this with default username guy. Doing so is generally difficult but worth doing.
 
wim
4:39 AM
Ha, my comment now looks like I'm claiming that "You shouldn't remove list elements during iteration" is not true. That's not intentional ...
 
Yeah, I timed your solution and it's still slower than mine.
I mean, whatever. The goal isn't efficiency.
But at the same time, you don't want to show (in Moinuddin's words) how to get from home to work using the moon as a waypoint
 
Is there somewhere that the names allowable in python packages is documented?
I'm making something that generates packages and part of that involves creating names for modules and I want to check that user entered names are actually valid
 
I've read that many times
 
wim
I don't think that's asking about style guide
more how to avoid keyword collisions etc
 
4:52 AM
Conventions are rather simple, but I want to check at a more base level that importlib will accept the name someone creates, especially if this is involved in some sort of bigger context.
@wim Yes exactly this type of thing
 
wim
the word you need to google is for "identifier"
there is even a str method for checking it
 
Hmm... I can't believe that isn't documented as well as it should be
 
wim
>>> 'hello'.isidentifier()
True
>>> '0hello'.isidentifier()
False
 
thanks, that's helpful
 
There's also the keyword module, since @wim mentioned functions
 
wim
4:55 AM
you also need to make sure it's not present in keyword.kwlist
 
import keyword; keyword.iskeyword(...)
 
Yeah I was having a mental blank on what that was called, which obviously makes it hard to search for ! :)
 
As long as it starts with a letter or _, and is not a keyword, you should be good
 
So I'm building a wrapper around c++ code, so I might need to use that as a way to figure out which functions need a layer of indirection to actually be called
 
 
4 hours later…
9:02 AM
cbg-morning
 
Good thing moderators can find out who's behind targeted downvoting and ban them.
Funny thing, a lot of them try, few ever get away with it
 
@cᴏʟᴅsᴘᴇᴇᴅ I'm always confused about the need for dwvting
serial one, means
 
@AndyK Ah well, you have butthurt users all the time
They can't put their money where their mouth is in terms of their questions/answers, so they'd resort to petty actions like that
 
@cᴏʟᴅsᴘᴇᴇᴅ damn... it is only a Q and A site or am I wrong in my perception?
anyway, sunday morning music
 
@AndyK There's a ton of politics. People seem to misunderstand innocent feedback on questions or answers as a personal attack on their sensibilities.
 
Well, too bad for them, they're the losers
 
@cᴏʟᴅsᴘᴇᴇᴅ too bad for them
 
Yup... had 5 so far... sitting back and waiting for the rollback anytime now ;)
Also, that comment with 4 stars really rubs me the wrong way. Ah well, may as well star it myself
Now it has 5, lol
"Eh, you starred a comment that makes me look bad? Woah, sure showed me there buddy".
 
9:36 AM
cbg cbg
 
9:52 AM
Terrible answer fiesta going on here
I'm impressed how many people failed to fix such a simple mistake
 
it absolutely is
 
And with an answer to that typo that even has an upvote edit: and an accept. No roomba now.
 
And a "thank you" from OP, who completely ignored my comment which fixed his problem 10 minutes ago :/
 
Need to add a and to that
@JacobWood: Since you're here, please refrain from answering questions that are obvious typographical errors. Vote to close (when you have the privilege).
 
10:03 AM
[not-sure-what-I-expected.jpg]
 
@JacobWood Looks like he needs to read stackoverflow.com/help/how-to-answer
 
I am getting tired of seeing pointless arguments everywhere.
 
No need to cite rules to others when you blissfully disregard them yourself.
@AshishNitinPatil +1
Huh... I don't know what you're talking about kid.
I was just telling you not to answer VLQs.
 
Let's drop this topic please, we're not headed anywhere nice.
 
yes. Jon Skeet is less than 500 away from 1mill.
I was planning to ninja everyone by awarding a 500 bounty to him but realised I have to wait a day to award it :(
Well, I've posted one anyway :D
 
10:12 AM
What if exceeding 1mil rep causes a terrible glitch and you go down in history as the person who caused SO to crash?
 
@cᴏʟᴅsᴘᴇᴇᴅ (Sorry to be back on this topic) Kindly refrain from using provocative arguments. I know you are trying to help, but the language you are using for that isn't helping. Sometimes I take some time off to clear my head, maybe that might help you too.
 
Then I can get off SO and do something better with my life.
 
@cᴏʟᴅsᴘᴇᴇᴅ The first SO millionaire! :D
@Rawing Something something millenium bug :-p
 
One of my (relatively) old answers seems to be getting a lot of attention today (2 votes on it after no activity for days)
I wonder why.
 
There are 2 answers from very low rep users, which I don't have the time to get involved with. The answer by Garbage Collector is helpful since it provides a different approach rather than simply point out the simple mistake. — Ashish Nitin Patil 8 secs ago
 
10:19 AM
Cabbage
 
Does anybody here use sqlite3?
 
@AshishNitinPatil Is it just me finding it weird that that comment responding to you has been upvoted?
 
Yes I have already read that long ago.
 
10:21 AM
@cᴏʟᴅsᴘᴇᴇᴅ I am in no mood to investigate / think about it, sorry.
 
@Oqhax Yes, I do.
 
OK, I have made a form that saves the data into an sqlite3 database.
 
I'm thinking sock/meat puppets, but I'll let it go for now.
 
Could you test it, and tell me if there could be any other input to add?
 
Sorry, my experience with it is really beginner level.
 
10:22 AM
The link is here: nasom.svcdev.com/register
Mine is too
I started yesterday
 
Cool, I've created an account.
 
Just saves the data. Not an account really. Wait a moment...
 
@cᴏʟᴅsᴘᴇᴇᴅ I doubt that. I'm not too surprised by that upvote, to be honest. There are many people who think you either have to reprimand everyone or no-one, and it's hypocritical to reprimand only a single person. Which is, of course, stupid.
 
You created 2 :). The data for one of them is: Username, test2, Email, test@so.com, Password, helloworld. YAY
For the other: Username, testt, Email, 123@gmail.com, Password: 123123123
It works :) Thanks
 
The second wasn't mine :D
 
10:26 AM
:3
@JacobWood Yes, I said it was a test to check if the data was saved.
 
@Rawing Yeah, and that combative attitude is gross
But anyway.
 
rbrb everyone, don't have the energy needed to be on SO today.
 
@AshishNitinPatil Just based on that comment thread, I totally understand. Go get your rest man. Cheers.
 
Should I add any more inputs for the form?
 
Depends on your application tbh.
Try adding a profile picture option as a BLOB
 
10:32 AM
lol, ok thx
Could you check around the website? You may find a few errors...
I know.
Just doing the basic stuff now. Need to improve the form.
testing123, test9@something.com, testing123
LOL, username same as password
 
I got some jinja2 exception when I navigated to nasom.svcdev.com/shareweb/chemistry
 
Oh yes, let me fix it.
should work now.
Click again in the chemistry link
Although it's empty...
 
jinja2.exceptions.TemplateNotFound
 
... Wait
Wait, it works.
Reload before clicking again.
It is a blank page
wtf
who tested sqlinjection
It is saved in a file
Not a server
"' testing sqli" "' testing sqli" "' testing sqli"
Need to go. Bye.
 
11:22 AM
Guys, I'm being downvoted for some unknown reason.
How do I appeal this or get more information about it? My question was well formatted and researched as well.
I'm going crazy. I can't even ask a question for fear of being downvoted. I have no clue who or why either, so even if it's miraculously legit, I can improve...
 
you could post a comment under your question and ask about the reason for the downvotes
 
I did. I hope this isn't a recurring thing on SO.
The last time I got a downvote, I could say the dataset was poorly formatted. Now, I have no clue. Thanks anyway.
 
You only got one downvote, don't stress about it
FYI your question has one additional close vote for "unclear what you're asking", which may explain the downvote.
 
Hmm, do you think there are ways I could improve in addition to an existing example and problem statement?
 
Can you give me the link to your question? I'm gonna upvote you...
Why do I get this error:

OSError: [Errno 101] Network is unreachable
?
 
11:37 AM
Thank you for being so kind as to offer but I'd like to earn my upvotes.
 
I am trying to send an email through flask
I was just joking...
 
oh lol...
 
lol
 
I'm new to this, I don't get SO humour yet. Give me some time.
 
What is the link? Maybe I can help you.
ok
 
11:38 AM
0
Q: How do I transform a column of values into possibly discrete training output classes?

IshwarMy dataset is a set of features and one column which is essentially views, each element of this column being an arbitrary positive real number, like the following. Now in Python, I want to run a Keras model on it. I plan to use this column as output labels for training the classifier. The only...

 
No idea... Sorry
 
Thank you anyway. Do you guys have coding meetups here?
 
12:24 PM
@cᴏʟᴅsᴘᴇᴇᴅ are you hoping senpai will notice you?
 
cbg
 
1:05 PM
@AnttiHaapala Ooooh, those look good. How are they?
 
they look like poo
 
@AndrasDeak since I don't think Martijn has turned into a fly, have you considered if you're excreting items looking similar to that - you may wish to consult a doctor? :p
 
that might explain the burning sensation...
 
Sounds like a good curry night
 
1:50 PM
@cᴏʟᴅsᴘᴇᴇᴅ that probably has to do with caching. With row-major order you work along trailing dimensions first. If the trailing dimension is large (5000), a big chunk of actual memory can be cached by the CPU. If your trailing dimension is small (4), the 0-strides that implement broadcasting possibly (probably?) interfere with caching: you need to access [addr0,addr0,addr0,addr0, addr1,addr1,addr1,addr1, addr2,addr2,addr2,addr2] etc.
The general advice is always to loop over large trailing dimensions in numpy due to C-like row major order (although this doesn't explain why this timing discrepancy goes away if you turn your broadcast views into full arrays of the same shape...)
also there's this that I've completely failed to explain:
In [109]: def foo(A,trailing=True):
     ...:     B = A
     ...:     while B.ndim > 0:
     ...:         B = B.sum(-1 if trailing else 0)
     ...:     return B
     ...:

In [110]: A = np.random.rand(*(3,)*10)

In [111]: %timeit foo(A,trailing=True)
506 µs ± 4.45 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

In [112]: %timeit foo(A,trailing=False)
119 µs ± 1.98 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
As I understand it, summing over trailing dimensions should always be not-slower. And here it seems that it's the opposite. I wonder if it's because the size 3 for the dimension is too small (but I can't create a multidim array with large dimensions to test...)
 
quick cbg
 
cbg
A-ha! Using an A of shape (100,100,100,100) reversed the trend, as expected
something something important lesson about timing small things
 
 
3 hours later…
5:22 PM
Getting my first upvotes!
Been learning it for work and now I can put my new knowledge to use on SO
 
awesome
 
long way from a bronze badge...
 
Cabbage
 
5:37 PM
cbg
 
@Code-Apprentice I started scratching some react.....then projects changed, then dove deeper in to the backend and now I'm really in it deep
doesn't look like I'm going to crawl out of that 😛
 
I've dabbled with Django on my own project and written python tests for a project at work. Most of my work for the last two weeks has been React/Redux/Jest tests.
@idjaw What are you using for backend? Django? Flask? Something else?
 
@MartijnPieters I still didn't want to open the bag :D
 
@Code-Apprentice For the API layer it is currently under review. Hug is being used
and it is severely limited right now
There are discussions of using Django REST Framework
But...I don't understand why and it seems overkill to use something like that, that still requires Django to be installed when all you want to use is just API features
That is actually the most front-end of my job
I mostly touch on IaaS and PaaS solutions
 
5:47 PM
yeah
was about to paste that
 
@AndrasDeak you've answered that better than I could've expected. Any interested in converting that into an answer if I post a question?
 
@cᴏʟᴅsᴘᴇᴇᴅ not really, since most of it is handwaving, and the idea of using larger dimensions last (in python) is pretty general
you could try looking up the answers of hpaulj or Divakar, I'd be surprised if they didn't have a few answers along these lines
Of course this usually comes up unrelated to broadcasting, as a general behaviour. But the thing is that I'm unsure whether this is all to the story when it comes to broadcasting.
You could try asking anyway, just put together an example showing that it's really broadcasting which gives a factor of 2 difference (by using full tiled arrays of the same shape as comparison). Worst that could happen is someone else posts a similar handwaving answer :)
also, you could use np.broadcast_arrays to get two views with appropriate zero-strides to remove as much overhead from the timing as possible
 
Hmm, could you please clarify that last bit?
 
I mean constructing x1 = np.arange(5000); y1 = np.arange(4)[:,None] and vice versa for the transposed pair to begin with. And then [x1_bc, y1_bc] = np.broadcast_arrays(x1,y1).
 
Okay, got it
 
5:58 PM
x1_bc and y1_bc then both have shape (4,5000) and corresponding strides
And if you use np.acontiguousarray to construct the equivalent contiguous arrays, the huge timing difference seems to disappear between the two orders.
 
Sometime today I'll fashion this into a proper question and see how the responses differ to what you told me. Truthfully, I had the same idea that cacheing had a role to play, but I couldn't articulate it well. I had discovered the behaviour while writing this answer.
 
*as
Oh, I thought you wanted to ask a new question about this. It's fine, thanks
 
Typo. I did mean question. Sorry, I tend to act dyslexic when it comes to "question" and "answer".
 
no, I think what you wrote makes sense both ways
oh, but then you said "answer"
long day for the both of us I guess :D
 
But I just woke up :(
 
6:09 PM
7 PM here
 
Jon Skeet is almost there, btw.
 
I can't wait for the 1 million bug when SO resets and no on has rep anymore
 
that's not spam, and spam shouldn't be closed
 
@AndrasDeak when it's that badly written, I consider it spam. My call. And apologies, I should have put pls-delete
 
6:21 PM
It's your call, but spam has a very specific meaning on Stack Overflow :)
If you see actual spam, flag it for spam. A few flags of those auto-delete the post and give -100 rep to the poster
(self-deleted now)
 
@AndrasDeak +1
can't get enough of Kamasi Washington this evening youtube.com/watch?v=3DM9fGXHhlk
 
6:39 PM
Is there a more general way to have the entire console output from a batch script redirected to a log file? I have a bunch of these lines in a batch script, and was going to add >> log.txt to each line (which seems cumbersome)

instagram-scraper Ace --tag -d="C:\Users" >> log.txt

I'm using Windows 7 (Using vanilla batch scripts ,not familiar with power-shell))

The other question I have is to there a way to dynamically name the text files by today's date? Instead of >> log.txt something like 1-14-2018.txt etc.
 
in linux you could redirect the whole output of your script to a single file
this doesn't sound very pythony though
 
What parts of the problems you listed have you tried so far? What difficulties are you facing?
Can you show any code snippet (if it is long, use pastebin or something similar, please)
 
@AndrasDeak Yeah, this is more of a general Windows question.
 
@Moondra Please keep things on-topic to Python. If you have started developing this in Python, please share your attempt. Otherwise, I don't think it quite belongs here.
 
@idjaw Sorry about that.
 
6:44 PM
all good
 
7:01 PM
howdy
 
hello
 
what are rules here?
 
in the room title: sopython.com/chatroom
 
oh i see tnx.. just god chat option on stackware
stacoverflow
 
you can also edit/delete messages up to 2 minutes after posting :)
 
7:05 PM
ok cool, tnx, i wanned to ask, i am writing some webscraper, now thing is webisite is changing price based on dom, can someoone point me out to right direction what to search so i can solve that problem? i wrote basic loop for categories and for products, now i am left with products that have sizes, and price is chaged by choosing sizes.
 
7:53 PM
@AndrasDeak Posted the question, if you're ever interested in answering.
Actually, posted quite a while back, still no answers yet
 
@cᴏʟᴅsᴘᴇᴇᴅ I meant that you should take contiguous arrays for both operands outside timeit...
 
Why does it matter? I thought that would make the comparison more fair
 
your ascontigousarray call is acting on the already contiguous final result...
let me show what I meant, hold on a bit
 
in the first case, I don't think it is contiguous.
 
Oh, right. But that's entirely beside my point :)
 
8:00 PM
Huh...
 
In [128]: x1 = np.arange(5000); y1 = np.arange(4)[:,None]; x2 = np.arange(5000)[:,None]; y2 = np.arange(4)
     ...: x1_bc,y1_bc = np.broadcast_arrays(x1,y1)
     ...: x2_bc,y2_bc = np.broadcast_arrays(x2,y2)
     ...: x1_cont,y1_cont,x2_cont,y2_cont = map(np.ascontiguousarray,[x1_bc,y1_bc,x2_bc,y2_bc])
     ...:

In [129]: x1_bc.shape,x1_cont.shape,x2_bc.shape,x2_cont.shape
Out[129]: ((4, 5000), (4, 5000), (5000, 4), (5000, 4))

In [130]: %timeit x1_bc ** y1_bc
     ...: %timeit x2_bc ** y2_bc
The former two are the comparisons of broadcasting the two orders. The latter two are the same using contiguous arrays: the same sizes all around, but there are no zero-strides in the underlying data.
this suggests that the factor of 2 is related purely to broadcasting, rather than the size difference between the two axes
I guess I could add an answer with the above, but I still don't have a definitive answer for the source of this discrepancy
So, my point earlier regarding the outermost transpose is that (as others have said) just transposing is very cheap: it doesn't move memory around, it only changes strides as far as I know. But in later calculations it might happen that you use the transpose in a way that's generally slower due to the earlier transposition, overall getting better/worse performance. Either way, it's not the transposition per se that affects performance
 
8:15 PM
Still trying to digest all this
 
I'll try to write up an answer. Most if it is just a more focused comparison of what's happening
also, my message 2 above is exactly what hpaulj meant in his comment
 
@AndrasDeak For some reason the two don't give the same result. if you do m1 = x1_cont ** y1_cont and m2 = x2_cont ** y2_cont and then np.array_equal(m1.T, m2), False is returned.
Are they doing the same thing?
 
Uuuh they should be. Try np.allclose
or are these all ints?
 
Okay, tried it again, it works
My bad
 
phew :)
 
8:25 PM
hehe, sorry
 
8:39 PM
added my confusing two cents
 
Still digesting, but was easier to follow in an answer. I'll have to visit it one or two more times to grasp the answer in its entirety.
But it's good enough for me. Thank you :D
 
I don't think you should accept that as of yet
 
Well, if you say so. I'll hold off till tomorrow.
 
As I said here and there too, it's anything but definitive. And you have much better chances of getting further answers if you leave it unaccepted
if there is a person out there (or in here) who knows what's going on, they'll surely be motivated by my handwaving filth and will step up;)
 
I'd be pretty satisfied after writing an answer that long, but I guess content matters
 
8:52 PM
I could write a book with no actual definitive content :)
 
Well I can tell you it made sense to me. Perhaps someone else's answer would make more sense. Perhaps not. I'll wait...
 
My handwaving can be very persuasive. That being said, if nobody else comes around with a more concrete explanation (and preferably an understanding of CPU caching), I won't hold it against you to accept mine ;)
 
On an unrelated note, I raised a NAA flag on this answer which was disputed. Then, I raised a custom flag which was declined because "flags should only be used to make moderators aware of content that requires their intervention".
So, I'm wondering if what I did was inappropriate.
 
It probably was. If a flag is declined, leave it at that. Reraising it as a custom mod flag only wastes the time of moderators.
 
^^
And the explicit flag usage are for exceptional cases where it really need moderation immediately. Example: spam, profanity laced nonsense, etc.
 
9:00 PM
plagiarism
 
yes that definitely too
 
Though I'm surprised that that was a NAA and still disputed. So, I'm guessing meta would be a more appropriate place.
 
You used one of the available options and it was declined...Therefore leave it
 
@cᴏʟᴅsᴘᴇᴇᴅ that is a valid answer to a crap question. The solution is to close and maybe delete the question.
 
The accepted answer is even worse.
Link only, and nothing more, with 8 votes, wow
 
9:02 PM
plus the post was left alone by a low quality post review, that was probably what disputed your flag stackoverflow.com/review/low-quality-posts/18510754
you can argue about that on meta, but bothering mods is indeed inappropriate
at the end of the day it's not worth it, just get rid of the question
 
Fair enough, thanks Andras
 
wim
9:43 PM
@idjaw take a look at apistar
 
Could someone help with regular expressions? I'm having trouble with the first example in this tutorial.
 
@Simon What's the problem?
 
@wim neat. thanks! have you used this?
 
@Rawing Understanding what re.match( r'(.*) are (.*?) .*', line, re.M|re.I) does. I know a . matches single characters but what is with the * and ?.
 
what "!"?
 
9:49 PM
@AndrasDeak Corrected
 
Wow, the tutorial hasn't even covered those yet and is already showing them in an example. Nice.
 
Great. So what am I going to do now.
 
Read the sections titled "Repetition Cases" and "Nongreedy repetition"
Or find a different tutorial. I haven't read it, but at a glance it looked pretty bad.
 
Can't find them. Yes I'll look for a different tutorial.
How about the standard docs one?
 
not a tutorial
 
9:55 PM
I recommend regex101.com
 
I've heard good things about that ^
 
it has a nice little reference built in which explains many things well enough
and you can try everything out live
 
Well the docs definitely explain everything, but I'm not sure how beginner friendly they are
 
^ That's a beginner-friendly HOWTO, also how I learned
 
@ByteCommander Thanks very much I will make use of that. : )
 
9:57 PM
Wow that tutorialspoint regex is trash
"hey, learner. Here is a quick look at regex....now let us show you something that we did not mention yet. Have fun"
@Simon Hit up a better tutorial. Drop that trash site.
 
sounds hard to learn that way
 
lol
 
@cᴏʟᴅsᴘᴇᴇᴅ Looks good to me. I'll follow that one.
@idjaw I've closed the page. It's gone, I'm never using it for Python again.
 
good....gooooood
 
I have a regex badge now, so hopefully it did something right
But it's a lot to digest, so baby steps please.
 
10:02 PM
Yes I will don't worry.
 
10:42 PM
It's funny how quickly that one downvote on my answer gets nullified by all the upvotes.
 
00:00 - 23:0023:00 - 00:00

« first day (2647 days earlier)      last day (2284 days later) »