« first day (2453 days earlier)      last day (2510 days later) » 
00:00 - 23:0023:00 - 00:00

12:06 AM
recbg
 
12:45 AM
recbg
 
 
4 hours later…
5:00 AM
Are any of you currently in here able to help me with a machine learning problem I am having?
 
5:13 AM
Try us and see, but I don't think anyone who frequents here is that deep in ML-fu. Still some of us are quick studies, so what is your problem?
Well, I guess I won't find out tonight - I'm off to bed, rbrb
 
Sorry I just got your message @PaulMcG
Basically what I am trying to do is given 2 functions of similar shape, line up them up on top of each other based around one zero
For instance, you have 2 similar quartics. One starts at x=1 and the other x=13. They both in
They both have zeros at their points of inflection. That is where I want to line them up
So I was thinking maybe I can have my program find where the zeros are on both graphs are, scale both graphs, then put them over each other lined up based on the zero found by the algorithm.
 
6:15 AM
cbg
 
 
1 hour later…
7:46 AM
cbg
 
 
2 hours later…
9:34 AM
Cabbage
Sometimes, I really dislike that a REPL is the first interaction people have with Python
The displaying of return values really confuses people.
 
"How can I remove the quotes from my string" does seem to be a common question.
 
10:18 AM
cbg
Anybody ever used google app engine with mysql?
 
@MeetTaraviya nope
 
10:43 AM
cbg
 
10:56 AM
cbg
 
debugging a multi-threaded thread-unsafe GUI... today's not going to be a good day
 
11:11 AM
nice... have fun
 
welp, I just realized I was debugging the wrong function. That certainly explains why none of the changes I made had any effect.
 
Does anyone have experience setting own sockets with Apache virtual hosts? I'm having some trouble using ProxyPass.
 
@RompePC See point number 2 under "Asking a question" - sopython.com/chatroom
 
@AshishNitinPatil Do you prefer a initial large long text of some lines firstly that can take innecessary space on the chat? Cause that is gonna how it'll go with my question.
@AshishNitinPatil Well, nevermind, I finally founded a way to do it
 
11:29 AM
Hey everyone ;)
 
cbg
 
cbg, clone brother
 
Is there any reason one could say "Understanding SQL injection is on of the standard things I do during my job"?
Yesterday at the local bar someone came up to me and tried to "impress" me with his job, "I do a lot of sql-injection...". - I was kind of flabbergasted, wondering "why".
 
@JulianRachman @JulianRachman, I think you will get better response if you post this as a question, and be sure to add the machine-learning tag
@paul23 "I just memorized some buzzwords that I don't completely understand, and I'm hoping you don't know what they mean either."
 
He injects SQL into everyday conversations to appear smart, that's what he does.
 
11:36 AM
"A lovely day for a SELECT * FROM DAILY_ACTIVITIES LIMIT 1 don't you think?"
 
That's what I figured, but I was still wondering if there might be a valid job where you "sql inject and use a botnet to ddos".
 
I could see maybe as a security auditor, testing deployed applications for their vulnerability to such.
 
cbg
 
@RompePC Well, if it's too big, it deserves to be on the main website rather than chat (if it fits the criterion)
@RompePC Good for you.
 
cbg
 
11:54 AM
@AshishNitinPatil Not being big, but it would be a typical "I don't know this" question.
 
Potato
 
12:09 PM
If you get this message what does it mean?
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files (x86)\Thonny\lib\tkinter\__init__.py", line 1550, in __call__
return self.func(*args)
File "D:\Tkinter_Final\Secure\Password_Final.py", line 160, in save
text = self.textty1.get(index1)
NameError: name 'index1' is not defined
 
it means there is no variable named index1
 
Wait
One sec that was not meant to be there
This one: Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files (x86)\Thonny\lib\tkinter\__init__.py", line 1550, in __call__
return self.func(*args)
File "D:\Tkinter_Final\Secure\Password_Final.py", line 160, in save
text = self.textty1.get()
TypeError: get() missing 1 required positional argument: 'index1'
 
Now you've removed the variable that was needed.
 
Oh
 
-.-
 
12:12 PM
> TypeError: get() missing 1 required positional argument: 'index1'
Error is quite explicit
 
Well I have to go now sorry Thanks anyway
 
No problem
 
This is why I like you guys your always there to help
Byeeeee
 
A hint: try reading up on a tutorial for python, it will solve this :).
 
12:25 PM
none of this works for me — NOP da CALL 2 mins ago
I was so eager to post a sarcastic comment...
Over the years I have just grown tired of having to correct people to ask good questions.
 
I bet you'll never hear from that person again. They probably freaked out when they got a response on a 2 year old answer...
 
That's what I expect (sadly).
 
In the first place, commenting "it doesn't work for me" on an answer with 22 upvotes is basically like admitting you did something wrong
 
it might be a small mistake, like trying to use an answer that doesn't fit your problem :P
 
12:41 PM
I had to reread my follow-up comment several times to check if I wasn't being rude in an unintentional (or intentional) way.
 
Quite the opposite, really. It makes you appear way more helpful than anyone could expect you to be after 2 years.
 
I wish there was an alternate SO site where sarcasm / venting out was allowed.
 
reddit?
 
But there are no good questions on it :-/
And at times it is waaaaaaay too much to handle.
Those are the times when one realizes that SE site rules (being professional) really help
 
perhaps if there were strong checks in place to ensure that signal-to-noise is high..........
 
1:04 PM
I'm writing a Python3 Dependency Injection container, before I leave alpha I'd like to get input on the API layer which is mostly documented in the README. Any thoughts? Presently I don't support kwargs but it might be a good idea to do so. github.com/incognito/brap
 
@Incognito I don't like the way you are injecting the parser
 
@khajvah Can you make that feedback something I can action on or understand your perspective for?
 
\o cbg :D
 
@Incognito nevermind. I don't know enough about this stuff. I only used Spring's DI and very little Zope DI
 
That's still valid. I don't want to pick a fight, I just don't understand what made you not like it.
 
1:18 PM
Happy Independence day to those whom it applies too.
 
"it looks funny" is legit.
 
@Incognito I don't like the magic string naming of components
 
c.set('this_part?', Foo)
 
yes. I wonder how is this different than holding everything in a dictionary?
 
It's not very different
v1 did that. I store things in a graph and detect circular deps in v2 however.
 
1:21 PM
I guess creation of components is easier
 
@davidism I was super happy that I got to watch the start of SGDQ with my game of the year being beaten by one hand. Apparently one of my friends knows the guy who ran it... ( I don't :D ) I can't wait to see the Pokemon and TAS bot section of the event.
 
@khajvah Thanks for sharing your thoughts, it's important to me to get perspectives if I'm going to make something for other people. I'm going to ponder the string ID for a while.
 
@Incognito I suggest you hear @AnttiHaapala's thoughts. He knows these kinds of stuff very well.
 
cbg all
what's the way to tell someone the link on his SO profile is dead (/appears to have been bought by squatters)?
 
by dead do you mean inactive for a long duration ?
 
1:31 PM
Ping them in chat maybe?
They might not care.
 
I mean it has his name in the URL and was clearly once his personal blog or whatever, but when I went to it now it's been replaced with a squatted link farm type page
 
@LangeHaare leave them a comment on one of their posts
you can't ping non-chat-users in chat, and inviting them to a room might or might not lead to a notification
 
Maybe this should be my first Meta question :D
I found his email by looking at the site on archive.org
0
Q: How to contact a user about a dead link on their profile?

LangeHaareI looked on a user's profile (who was active on SO), and followed the link to what looked from the URL like it would be their blog. It turned out to be a link-farm type squatted blog. The domain registration had clearly lapsed. What would be the best way to contact this person to let them know t...

 
2:20 PM
cbg
 
cbg
 
cbg
/me has no idea what is going on
 
room6 is all about the silly salad
(but we actually only end up using cbg and rbrb tbh :P)
 
I've been burned by so many links in my life I don't know if I should click or not
 
from one Canadian to the other, I swear on the life of the holy Moose.
 
2:23 PM
I'd never recommend clicking a link posted by a chat room owner
 
150 years of trolling, eh?
 
</sarcasm>
 
my great great grandfather idjaw sr started this chat 150 years ago and it's been passed down the generations.
 
deleting that for the benefit of DSM
 
FYI @Incognito If you look to the top right where the chat is described, the link I posted matches the domain there too. It's our site providing helpful information and all that.
 
2:27 PM
haha, this is hilarious and awesome
 
DSM
Morning cabbage. I see I'm just in time to see myself mentioned..
 
cbg DSM :D
 
DON'T LOOK AT THAT MESSAGE
cbg
 
mmmm artisinal python
non-gluten free range python
 
DSM
Going to be one of those Tuesdays, looks like.
 
2:30 PM
>>> range(3,nongluten_free=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: range() does not take keyword arguments
non-gluten-free python ranges don't work
 
must be because of the double negation
 
yeah that's possible
 
This is why Python will always be advertised as is. We give you the no shenanigan, all natural, non-hipster injected language you know and love. PYTHON. The alchemists choice for the best snake oil out there. Get yours today.
call now and get a free fortune telling from Andras.
 
you forgot to mention the price of your product.... something for __.__/payment for x easy payments
but wait there's more~ offer is optional but highly recommended :D
 
2:45 PM
cbg
 
cbg Sir Paul
 
cbg
 
heh
 
let's see if a mod ends up removing this
I choose you zipachu! — idjaw 57 secs ago
 
DSM
Today I have to get these two methods agreeing. The old one returns five Series when I think it should return six, but the fifth is all zeroes and NaNs. On the bright side, the first four series seem to agree.
It's weird to have an entire day of my time scheduled to solving a single concrete problem!
 
2:58 PM
your programming problems are hard.
 
what does the new one do?
 
DSM
Ideally the same as the old one, but tens of times faster. :-)
 
@idjaw I don't like how zip(range) has much more votes than enumerate
@DSM does it reproduce the nans? :P
 
@AndrasDeak FGITW-syndrome
I guarantee you if the enumerate was posted first, it would be the other way around.
 
and the two upvoted zips are identical.... BAH
 
3:04 PM
just upvote my comment and move on.
if my comment gets more votes than the answers, it's a win for everyone.
my comment is currently in the lead. Today is a good day.
 
enumerate dupe poster worked hard on their downvote
 
python 2.5
lol
I see you called me out on dupe answering....let me find any ridiculous reason to argue back
 
I hope they think you were the one who downvoted
 
we'll soon find out if I start getting downvotes
 
3:11 PM
whatever downvote I get, I'm coming for you
prepare yourself
:P
 
TBH I think the zip answer is the better answer - the question itself (aside from the example) is phrased in a general way that makes it seem like the "first list" won't always just be the index of the second list - further proved by the fact the questioner is asking what about if the lists are of different lengths
 
aaaand the question got another upvote
 
my comment is tied....
 
I joined another chat and almost every message begins with @(person)... like there's strings of 10 messages back and forth between two people and they keep pinging each other
 
rbrb folks
 
3:20 PM
They are helping future bots by giving definitive "context"...
 
rbrb Andy
@LangeHaare some of those might be directed replies, which might be useful if there would otherwise be ambiguity
 
I think the answer here is still going to end up being the "variable number of variables" stackoverflow.com/questions/44909509/…
I see what the other answers are suggesting. But I don't know....
 
Having an a priori unknown number of output arguments is somewhat of an anti-pattern, right?
 
@AndrasDeak some of them, yeah, but these people do it for like 99% of messages, it just makes the whole thing harder to read
 
of course it's still just a tuple, but semantically there are a varying number of output arguments
 
3:23 PM
yes that is horrible
 
@LangeHaare as I see it, there are multiple discussions taking place at the same time
using directed replies is the proper way to ensure that everyone can follow their respective discussions
of course it can be a culture thing too, but if the room usually hosts a lot of people with concurrent dialogue, it's not hard to develop habits like this
 
:D
Taygetos process management
 
@AndrasDeak Fair enough, I withdraw my complaint!
 
DSM
There must be some kind of chat forum where the screen lets you start, follow, and link different threads.
 
Is there an elegant way to iterate over a string like "AbCdEfGhI" and and get overlapping windows such that you get something like ('A','b','C'), ('C','d','E'), ('E', 'f', 'G'), ('G', 'h', 'I'). I've been playing around with itertools but haven't been able to come up with a working solution
 
@AndrasDeak yeah....that kind of philosophy is a bit concerning.
you don't write code to support obsolete, unsupported crap
We will write our forward thinking code terribly for the 0.05%
 
at least that's not what you default to, especially on SO
 
once again...trying to win an argument with <redacted> arguments
 
DSM
@chad: There are some slick things you can do, but nothing as clear and explicit as just indexing, assuming you have a sequence, anyway.
 
3:39 PM
(that makes me want to use a 3-length deque and append a next() twice, but that would definitely not be one of the clearest approaches)
indexing should be faster anyway, right?
 
@chad [(x[i],x[i+1],x[i+2]) for i in range(len(x)-2)] ?
 
then x[i:i+3]
although that won't throw an error if there are divisibility issues
 
@DSM alas, that was pretty much the conclusion I'd come to as well. Just wanted to see if there were any better ways
 
DSM
There are other ways, but most of them are just showing off for the sake of showing off.
 
^^
so much that
 
DSM
3:47 PM
If I can just figure out why my new number is 0.002404 while the old is 0, that might be the whole problem. At least it's a macroscopic difference..
 
>>> ll = list( "AbCdEfGhI")
>>> [ll[i:i+3] for i in range(0,len(ll),2)]
[['A', 'b', 'C'], ['C', 'd', 'E'], ['E', 'f', 'G'], ['G', 'h', 'I'], ['I']]
 
DSM
My entry was going to be
def part(seq, width, step):
    return (seq[i:i+width] for i in range(0, len(seq)-width+1, step))
(As usual, possible index errors all over the place..)
 
I recommend (next(zip(*([i]*3))) for i in (iter(seq[start:]) for start in range(0,len(seq),2)))
wait, I can use islice to make it more efficient
(next(zip(*([i]*3))) for i in (itertools.islice(seq, start, None) for start in range(0,len(seq),2))) now it's perfect.
 
and untestable
:P
 
showing off your awesome comprehension-fu is more important
 
4:00 PM
lol
 
>>> for notwanted,trip in itertools.groupby(enumerate(seq[i:i+3] for i in range(len(seq))), key=lambda x:x[0] % 2):
...   triple = list(trip)[0][1]
...   if not notwanted: print(triple)
...
['A', 'b', 'C']
['C', 'd', 'E']
['E', 'f', 'G']
['G', 'h', 'I']
['I']
(Too lazy to convert to a list comprehension)
 
@PaulMcG oh. this is gonna be good. Thank you.
> found out about a command called 'eval'
> thought it was cool
<3 lmao
 
So much wrong: "converts a string to a calculation"
 
can you nest eval commands :D ? if so does it just reduce into shame only?
 
DSM
Now, now. When you think about it, it is kind of cool. That kind of crossing of the code/data boundary can be surprising if you're used to a strict separation.
@PM2Ring will remember this era, but I still remember the first time I was playing a game on a BBS and it crashed, and I dropped to the remote console. Mind = blown.
 
You don't know how to code? No problem! Just use eval and let the user do it for you!
 
5:08 PM
Thankfully several other redditors were quick to comment on the security ramifications of eval
But eval is such a siren's song for the noobish
 
DSM sweeps in for the sound reasoning.
and grabs the Canada-award for the day.
on that note....time for me to go
love you all <3
rbrb
 
rbrb, eh?
 
DSM
Rhubarb for idjaw!
 
\o
 
I'm rbrb'ing too - heading to friends' house for Brexit 1776 party
 
DSM
5:12 PM
On behalf of my fellow Loyalists, have a good day. ;-)
 
I can confirm that newbies to dynamic languages get excited when they discover eval
I might have used it in my early days with MATLAB, in the context of dynamic var*mumble mumble*
somehow this didn't come up with perl, but perl has associative arrays
most objects in MATLAB can only be indexed with integers (except structs but those have a slightly esoteric syntax for dynamic access), so eval is fiendishly tempting there
 
5:58 PM
I have a dumb question, whats the point of handling exceptions if when it crashed and you don't have an exception it still prints out what went wrong
 
often you can handle the exception and can continue regardless
and knowing the context you might be able to give a more meaningful error to the user, rather than TypeError: 'NoneType' object is not callable from somewhere deep within a stack
that's my layman's take on the subject :)
but I'm not a professional developer
 
So handling the exception 'ignores' a crash that would've happened?
 
if you do it right, then no
 
@oso9817 no, not always, basically the point of handling exceptions, is so you have the control on what to do when you hit that 'error'
 
so you could do like except error as e:
print("you messed up")
 
6:01 PM
for example if im writing a code to process data and i know that there might be a data set where it does something like 1/0 and i want to ignore this fake bad data, I would catch the exception and tell my code to ignore it and keep going.
 
x = 1?
 
@oso9817 that's what you don't want to do
pokemon exception handling ("gotta catch 'em all")
11
not my idea ^
you generally want to handle specific kinds of errors you anticipate, and let anything else bubble up
 
what if you wanted to handle more than one
would you have to add another except?
 
silly example: say, you don't know what version of a library you have access to. You can try calling a new method in the API, and if it fails because that doesn't exist, you can fall back to an earlier, more complicated/slower method
@oso9817 you can
look at the tutorial
import sys

try:
    f = open('myfile.txt')
    s = f.readline()
    i = int(s.strip())
except OSError as err:
    print("OS error: {0}".format(err))
except ValueError:
    print("Could not convert data to an integer.")
except:
    print("Unexpected error:", sys.exc_info()[0])
    raise
note the "raise" in the final generic except block ^
see also the note in the tutorial
> The last except clause may omit the exception name(s), to serve as a wildcard. Use this with extreme caution, since it is easy to mask a real programming error in this way!
if you don't know what to do with a kind of error, don't catch it
typical example: you're doing some simple calculation which involves a division: you should possibly add a try/except block watching for ZeroDivisionError, and handle that case appropriately
really, read the tutorial I linked, there are really good examples there (not that surprising)
 
I am thanks
pastebin.com/Gtj1gRmf < source output > pastebin.com/4mB4rQRR is there a reason why my script is repeating so much of the output?
hard to explain but coulldnt paste output in chat since it takes up alot of lines which is the problem
 
6:18 PM
yup, pastebin is perfect
some of those nested ifs might be more readable with logical and
so many legally acquired filenames in that list :D
 
yeah man so weird how legal films do that ;)
how would i use the and in this case?
and stop all the repetition in the output
 
if os.path.isfile(f) and f.lower().endswith('mp4'):
unrelated to your problem, but you can spare a level of nesting
so... you're not actually replacing rubbish anywhere, and you should probably be testing new vs y, not f
as it stands now, for each element in rubbish you're doing the same thing: converting to lowercase (which makes the filename unequal to its original name)
if it did change something, you would probably run into problems because the first replacement would rename f, so the second replacement wouldn't find it
I suggest first doing all the replacements in the file name you want, then renaming it once
y = f
for element in rubbish:
    if element in y:
        y = y.replace(element,'')
new = y.lower()
if new != f:
    # then the filename actually changed
    os.rename(f,new)
something along the lines of
then again the test for element in y might be superfluous; I don't know if that could lead to more work than calling .replace each time
note that once you turn the filename to lowercase there's no chance you'll find your non-lowercase rubbish inside
but matching lowercase-converted rubbish might lead to false positives getting deleted
 
then ill just do rubbish.lower()
what do you mean false positives
 
:P
if a filename was EngineeringFTW.mp4, it would be converted to engineeringftw.mp4, and 'ENG'.lower() in rubbish would delete the first three letters
 
oh i see
also if new = y.lower()
shouldnt it be
if new != f.lower():
 
6:30 PM
hmm?
 
since the original f has upcases and y is f but lowered theyd always be different
 
well, depends on what you want from that if exactly...
 
?
 
I imagined that the purpose of that if is to not try to copy something into the same name
in which case you definitely have to test against the original f
do you see what I mean?
 
not really
if a file was called
ThisFile
then you used lower on it like y.lower()
it would be thisfile
 
6:32 PM
yes
 
but if f is ThisFile
it would always be different
 
The question is: would you actually want it to be copied to thisfile or not?
 
What do you mean copied to thisfile whats being copied
 
Old filename: ThisFile. New filename: thisfile.
s/copy/move/
Would you want your program to rename the file "ThisFile" to "thisfile"? :D I can't phrase it any clearer.
 
no I'd rather not id rather keep camelcase
 
6:36 PM
OK, so...why involve lower() to begin with?
your rubbish is case-sensitive, so are your filenames
and for obvious reasons you can't un-lowercase once you removed something
 
yeah now that you mention i dont see a point to f.lower() or y.lower
 
there you go:)
keep the case and you'll be fine
 
so how would i deal with false positives like you said with 'ENG' and engineering.mp4
 
with no lowercase they wouldn't really appear
you have to think it through whether your rubbish can be inside genuine file name parts...
I don't think there's a programmatic way out (unless you can quantify that the rubbish is "near the end of the filename")
 
in this case i dont think that will happen
 
6:40 PM
for instance, "evo" can easily be inside a legit filename.
 
yeah something like evolutionMovie.mp4 youre right
 
or revolvers or whatnot
 
honestly its not ideal but i can just remove those by hand theres only 2 files rn with it
 
this part is finicky
in case you have a bunch of files, which is likely the case, I'd first print the new filenames to a file and see what those look like
then take a glance at them, see if anything jumps out
 
thats a good idea i will actually
 
6:43 PM
Human brains are pretty good at noticing patterns. If something's really off you'll notice quick, if something subtle's off you'll still likely notice.
 
still though why am I getting vast repetition? pastebin.com/5GKQeeDe
 
@oso9817 in general I'd advise backing up first but again I suspect that's not an option
@oso9817 I'd need to see your updated code
 
@oso9817 your renaming is inside the "for rubbish" loop
take a closer look at my example ^
 
i see i was just tabbed in
lmao that fixed it
 
6:48 PM
:)
 
is there a way to put a list in endswith()? since i want to be affecting more than mp4s
like mkvs and avis
 
you'll have to look at the docs; probably not
actually, you can pass multiple endings
do read the docs
 
i will in a second, im having it write the filenames pre change to a text doc
alright i passed tags as a tuple in it
and uh now theyres alot of '.'s
just a sec let me paste bin
 
Have you stopped for a sec trying to figure this out yourself? It's easy to get carried away and stop thinking once you start asking for help:)
. is not in your rubbish list (which is good because you'd have to exclude the last dot for the file extension)
it might help if you print both "from" and "to" filenames
I'm off for a while, have fun
 
thanks man cya
 
7:58 PM
cbg
 
cbg
 
How are you this fine 4th of July?
strange...
my Internet disconnected for some reason
 
pretty good.. feeling the effect of a long weekend :( Makes me not want to work and run away and slowly rot away somewhere in denial :D
 
8:47 PM
@khajvah @Incognito interesting..
@Incognito basically it is very javaic...
 
cbging my way in here to share this
Spent way too much time reading this monstrosity https://t.co/bZrEypsRvK
Aaamaaaaaaziiing
 
9:43 PM
@AnttiHaapala Any other thoughts? Good/bad ?
 
9:58 PM
@PaulMcG Finally finished after a whole days worth of writing: stackoverflow.com/questions/44914194/…
 
10:45 PM
How long should I wait for an answer before even considering giving it a bounty?
 
You can only post a bounty after two days
 
and definitely more than an hour ;)
 
I know but like should I consider it after the two days or should I do it like after a week?
@AndrasDeak I know fam
 
I probably wouldn't post a bounty on it before a week, for the sole reason that it might be a waste of rep
you could try linking it here again in a few days (but not sooner), but not on the weekend because there's pretty low traffic here then
 
00:00 - 23:0023:00 - 00:00

« first day (2453 days earlier)      last day (2510 days later) »