« first day (3520 days earlier)      last day (1411 days later) » 
00:00 - 21:0021:00 - 00:00

12:33 AM
Create a set based from a list of tuples based on the first element of the tuple.
 
 
1 hour later…
1:48 AM
@JossieCalderon {t[0] for t in seq}
 
2:27 AM
Ahh that was too easy...
I am not clear headed :(
Don't forget to add the conditional if myList.count(t[0]) == 1: I need to add the tuple to the list if the key is only found once. (Also I may need to sort the set into a list first.)
 
2:43 AM
Hello! I need help for my code. What I am trying to do is to find matching values in score and best_score then get index of the match and search through it in populations. best_score is an integer, while score and populations are arrays.

    My code looks like this:

    chromosome_best = numpy.array([d for a, d in zip(score, populations) if a == best_score])
  How can this code work if I want only the first match that appears between score and best_score? (score can have same numbers such as score = [2, 4, 0, 4]?
 
2:55 AM
@AJGayeta Have you tried using [code][:-1](basically list slicing?)
 
How can I get back the filehandle using the file descripter?
 
@AjayMishra tried it already and it worked! Thank you!
 
3:43 AM
self-duplicate Move last value to first value -> Move middle value to first value. Also the earlier asking (i.e the second link) could do with more focused explanation of what higher-order behavior the OP is trying to achieve.
 
 
2 hours later…
5:53 AM
Hi there, I'm trying to understand the following piece of code. The output is:

`[{'a': 1}, {'a': 1}]`

but I don't understand where the second dictionary comes from. In my mind the output should be just:
`[{'a': 1}]`
Can someone help?

x={}
def gen():
for i in range(2):
x['a']= i
yield x

print(list(gen()))
Yikes, sorry that was formatted poorly. I can no longer edit it too...
Ah it's because I mixed plain text with indentation, let's try this again.
x={}
def gen():
    for i in range(2):
        x['a']= i
        yield x

print(list(gen()))
 
We have a formatting guide for chat linked in the room details
 
Yes, thank you. I read it but still did it wrong :D
 
6:11 AM
Does this confuse you?
x = {}
def nongen():
    x['a'] = 1
    return x

print([nongen() for x in range(2)])
(I'm unsure whether you're familiar with list comprehensions so I perhaps introduced more confusion)
 
Hello, again! Can anyone help me with my code?

     a = [2, 3, 4, 5]

what I need to do is get its sum such that I would get something like this as an output:

      output = [2+3, 2+4, 2+5, 3+4, 3+5, 4+5]

something like index[i]+index[i+1], am I right?
 
@roganjosh I understand that just fine, but I'm having trouble understanding it with yield.
 
6:30 AM
cbg
 
@AJGayeta Definitely not the best implementation but this gets your result for me:
a = [2, 3, 4, 5]

# output = [2+3, 2+4, 2+5, 3+4, 3+5, 4+5]
# output = [5, 6, 7, 7, 8, 9]

output = []

for i, first_num in enumerate(a):
    for j in range(len(a)):
        try:
            second_num = a[j+i+1]
            output.append(first_num + second_num)
        except IndexError:
            pass

print("output:", output)
 
6:47 AM
@AbdurRehmanKhan thank you! Just a follow-up question, would this work if a is a numpy array? like a = [[4 2 0]]?
 
@Acee I think it'll need some modification to work with numpy arrays but not sure. You'll have to run it to check.
 
thanks!
 
I think I need to use a sorting algorithm here.
 
@Acee Oh I'm wrong, it works with numpy arrays as well!
`a = np.array([2, 3, 4, 5])`

Replaced a's definition with that, and it still works.
OMG, the formatting still gets me.
a = np.array([2, 3, 4, 5])
 
Formatting doesn't work with replies.
 
6:55 AM
@JossieCalderon Ah
 
@AbdurRehmanKhan thanks man!
 
@AbdurRehmanKhan indeed, it works! Thank you!!
 
Sam
7:15 AM
@AndrasDeak I was just going off the documented API for adding that encoding. Interesting though! I managed to get around it
parameters_str = "&".join("%s=%s" % (k,v) for k,v in parameters.items())
response = requests.get(url, params=parameters_str)
Works OK
 
@AbdurRehmanKhan What is your understanding of yield then?
 
@roganjosh If I have a list [1,2,3,4,5] and I have a loop iterating over it. My expectation of yield was that it should return one element on each function call. Like the next element would only be accessible if I called the function again... but I just tried that and that is definitely not the case. So that means I don't understand yield correctly at all.
I expected yield to SUSPEND, and that perhaps I would be able to observe it suspending... but it seems it returns the full list after all. Wait let me show you my test code
def test_gen():
    x = [1,2,3,4,5]
    for num in x:
        yield num

print("test_gen():", list(test_gen()))
Output: test_gen(): [1, 2, 3, 4, 5]
 
In that case, you would want something like:
def gen():
    lst = [1, 2, 3, 4, 5]
    for item in lst:
        yield item

a = gen()
print(next(a))
print(next(a))
 
I expected the for loop to stop and return only 1. And then on the next function call, return 2 and so on.
 
think of generator functions as classes. calling them instantiates the generator. on this instance, you can fetch items using next or a for loop, for example.
 
7:27 AM
@roganjosh Oh, you're right that works. But my main confusion is with the yield statement, what is yield doing? Is it just behaving like return here?
@MisterMiyagi If I print just test_gen(), I get a generator object. If I typecast it as a list, I get the whole list, why is that?
 
because list can read its elements from an iterable
 
Because list() will consume the whole generator
 
note that Python does not do casting. list(smth) will create a new list by iterating over the items of smth. it does not cast smth to a list.
# roughly what list(smth) does:
list_smth = []
for item in smth:
    list_smth.append(item)
return list_smth
that for-loop consumes your generator completely
 
You will probably have encountered this plenty of times without realising btw. Such as being able to iterate through file objects vs. calling list() on file and then not being able to go through the file again without using seek()
 
@MisterMiyagi Oh wow I see... you're right, I think I get it now.
@roganjosh Yeah like the returned objects from reversed()
If I remove the list type cast and iterate over my generator object then it returns one element at a time like I expect (just like any iterable). Very interesting.
I think I was expecting yield to suspend my function, but list() was consuming the generator completely like you guys said. Thank you, this discussion helped me a lot.
I was asked this question in an interview yesterday lol.
 
7:38 AM
My latest web scraping :)
 
@AbdurRehmanKhan to guess the output, or to explain why that output is what it is?
 
@roganjosh To guess the output. I answered: [{'a': 1}] but the correct answer was: [{'a': 1}, {'a': 1}]
 
8:00 AM
"This year’s figure was 13% higher than the previous record – that’s like the winner of the 100 metres leaving opponents 13 metres behind." Just in case you couldn't visualise 13%, the BBC is on-hand to explain with the 98.31m race
 
Naz
8:11 AM
class Solution:
    def reverseString(self, s):
        left, right = 0, len(s) - 1
        while left < right:
            s[left], s[right] = s[right], s[left]
            left, right = left + 1, right - 1
how does the assignment in Python work in cases like this
s[left], s[right] = s[right], s[left]
 
did you try it out?
 
There is a canon for this but I don't seem to be able to find it. I think they're asking more about how it works (as in, the two swaps happen simultaneously rather than the first swap affecting the second and therefore needing an interim variable to hold one of the values)
 
Naz
yes, correct, asking about how it works
I have seen this pattern being used to generate fibo numbers in Python, too
 
IIRC, the RHS tuple is evaluated first and then unpacked into the new indices but there's some hand-waving involved in that. There is definitely a good explanation on SO but I need to get back to work so I can't dig it up right now
 
the disassembly of that line shows that first the two values in question are loaded on top of the stack, and then ROT_TWO is called, which just swaps the two. then they are stored into their respective names again.
so the stack is used as a tmp to handle the swap without losing one of the values in the process
 
Naz
8:24 AM
sentinel bottom | s[right] | s[left] | sentinel top
ROT_TWO
sentinel bottom | s[left] | s[right] | sentinel top

and then we pop the top, which is s[right]
and assign that to s[left]
then we pop the top, which is s[left]
and assign that to s[right]

something like this?
 
I guess, but my C is not very firm, so don't trust in anything I say beyond the general idea. In particular, I have no clue what you mean with "sentinel"
 
Naz
I wrote that down simply to signal where the bottom and the top of the stack is
sort of like a sentinel node is used in linked lists
but again, that does not matter. I wanted to convey where the bottom and top of the stack is
arguably, could have wrote this instead of the first line, to convey it more clearly

s[left]
s[right]

^
stack
 
cbg, is there any way in python where I can tell the 10 functions in my program to always perform the same operation? if I have fun_1, fun_2 and so on, and all these take an argument called refresh, if this is True then I have to run the refresh function, is there a different way other than doing if refresh:refresh_func() in all 10 ?
 
Please use code formatting
 
can you tell what is not properly formatted there? I didnt really type any actual code
 
Naz
8:40 AM
suppose you can use decorators for that
 
alright I will read up on that, thank you
 
Now I've written a function that will upload a picture to imgur and retrieve its URL
 
Basically the RHS is evaluated first, then assigned to the LHS from left to right.
the latter is important when doing weird stuff like a, a[0] = {}, 1
 
9:37 AM
in SO Close Vote Reviewers, 26 mins ago, by tripleee
trivial but obscure duplicate of a common FAQ with hundreds of better duplicates Coding Bat Logic-1 > date_fashion - what is the difference between my code and the solution?
 
9:55 AM
I am always confused by people asking "why are these different", then showing different code.
 
10:14 AM
Hey, I've built a car. Why doesn't it operate like a submarine?
 
10:27 AM
cbg-ning
let's say I have this lst = [i for i in range(11)]
rubber-ducking, I've answered my question
 
Hello to all Lovebirds
 
10:56 AM
@ExoticBirdsMerchant Can you please stop saying that? It's weird.
@Sam I don't use web stuff but it looks like you're reinventing the wheel. I'd bet a large sum that you could pass a dict for params which would encode your URL. The whole point of using python and third-party libraries is that you don't have to do everything from scratch.
 
I'm decently sure that urllib could do the formatting, but requests should be able to handle a dict directly
 
@Sam I would never do that.
 
11:20 AM
transformed_primary = torch.zeros(1, 20, length, dtype=torch.float32)
for i in range(length):
     residue = AA_ID_DICT[primary[i]]
     transformed_primary[0][residue][i] = 1.0
how do I vectorize this loop?
primary is a string consisting of alphabets and AA_ID_DICT maps the characters to numbers
transformed_primary is of shape (1, 20, len(primary)). It's supposed to have a one-hot encoding of the integer mapped by AA_ID_DICT.
DeXYed problem: primary is an array of characters (total of 20 characters). AA_ID_DICT maps each character to a number (0. 1, ... 19). I need an array (numpy or torch or anything) of shape (1, 20, len(primary)) which contains the one-hot encoding in the middle axis.
transformed_primary = torch.zeros(1, 20, length, dtype=torch.float32)
residue_idx = np.vectorize(AA_ID_DICT.get)(primary)
for i in range(length):
    transformed_primary[0][residue_idx[i]][i] = 1.0
 
11:50 AM
@Sam is obtaining a tuple of parameters and passing it as a query argument. This list of parameters comes from kwargs because he's calling items() and obtaining k, vs from the keyworded argument list. It works fine, so the problem is the code cleanliness.
:param params: (optional) Dictionary, list of tuples or bytes to send
    in the query string for the :class:`Request`.
@AndrasDeak is correct. Collect $200 and pass Go.
def get(url, params=None, **kwargs):
    r"""Sends a GET request.
The solution is
import requests
webpage = 'https://myurl.com'
parameters = {k: v}
page = requests.get(somepage, parameters)
 
12:42 PM
Have anyone here ever programmed an encrypter and decrypter program?
 
@AnnZen yes but it was a few years ago
 
What formula did you use to encrypt?
 
What are you looking for? I did compression / decompression stuff and some ticket http validation encryption stuff
 
I'm not looking for anything. I just want to know how other people encrypt with python, I have my ways.
 
as I recall it was MD5, I used SHA256 before as well. But I think anything along the lines of MD, SHA should be fine. As I remember there are some new ones that are much better though. If you're concerned about security better go further as my experience is a few years old.
 
12:49 PM
Oh, I've used that module before. But I meant encrypting with our own formula, and decrypting with the inverse of the formula.
 
@IsmaelHarun that's hashing (and MD5 is obsolete now)
 
Okay, have any one ever used the RSA method in python?
 
Well the compression was in 65xx machine code, not python. That was fun. I rolled my own tech from RLE, PLE, LZ and HUFF branches.
 
@AnnZen purely for academical purposes, right?
 
12:52 PM
What do you mean?
 
not for any real code handling real people's real secure data
 
Yep
 
OK :)
 
Nope bu that doesn't mean anything. Somehow I think I would use another platform for anything that needs to be secure. I love python for the quick code and implementation, I often use it for flushing out an idea or testing out the best way to structure the code, then I rewrite in C++. It's actually faster that way.
 
Who was SHA256 table hashing?
 
1:11 PM
Is it that the more stars a message get, the higher it will be displayed?
 
is there a way to quit a inner loop imidiatly ?
 
break, but it will break all the loops, there is not way to break n
 
13 hours ago, by roganjosh
@LinkBerest I think we're on the same page here in what looks wonky. I'll test specifically with flask-sqla tomorrow if I get chance
I created a gist and it works just fine
 
@Hakaishin break only breaks out of the nearest enclosing loop
 
@Kevin whoops
 
1:20 PM
If by "there is not way to break n" you mean "there is no way to specify the number of nested loops you want to break out of", I agree
 
yes
I wasn't sure about break and was too laziy to test, so I took the 50/50 :P
but I was sure about there not being break n, so I still felt like responding
 
I do that all the time, but I get away with it because it's usually about C API minutae that nobody can be bothered to fact check
 
@Hakaishin continued = False \nfor j in range(i, newVal): \n\tcontinued = True continue
 
My description of the underlying structure of unicode strings yesterday was 10% fact, 90% hot air
 
haha
btw is there a heatmap of users in this chat on a world map? Would be interesting
 
1:23 PM
Not that I know of
 
Then set if continued == True: i = newVal
 
@JossieCalderon no!
 
I never had to read pycharm changelogs, but they changed something so I have to and me having to read them is a clear indication that their first sentence is a lie: PyCharm 2020.1.2 is out now with fixes that will improve your software development experience
My experience was fine, but you moving menus around is not fine, especially git related stuff grr
 
I also don't like "Rollback" in place of the former "Revert" (this happened a few releases ago, I guess)
 
1:33 PM
But yeah, moving UI around can be a pain
 
"Set a flag and sprinkle a lot of conditional breaks in your loops" is one oft-recommended way of breaking out of a lot of loops. I'm not fond of it.
 
I suggest switching to vim. No more misclicks due to UI changes.
 
@PaulMcG ugh I didn't even notice that one. Well atleast they left the symbol the same
@Kevin You know you have bad code design if you need to resort to this
 
Not necessarily
 
e.g.
for i in range(10):
    done = False
    for j in range(10):
        for k in range(10):
            for l in range(10):
                if l > 5:
                    #break out of l, k, j, but not i
                    done = True
                    break
            if done: break
        if done: break
 
1:35 PM
Nested loops are actually needed for problems
 
@Kevin Change to a generator and use next(). Or create a small method and just return the first match. (I prefer the next() method.)
 
I don't get why they moved local changes out of the git tab. It was as perfectly fine place for it
 
next(l for j in range(10) for k in range(10) for l in range(10) if l > 5)
 
I prefer the loop-busting power of return, as long as putting half my code into a function doesn't make it into a scoping nightmare
def whatever():
    for j in range(10):
        for k in range(10):
            for l in range(10):
                if l > 5:
                    return

for i in range(10):
    whatever()
 
OMG, they also removed the small preview window of the local changes. I get moving UI, but removing working and good features, like a local changes preview window is just stupid and asking your users to get mad
 
1:38 PM
@Hakaishin There is a button on the bottom of the left side of the pane toolbar to enable the preview pane.
 
hmmm, nvm closing and opening it again fixed it
¯_(ツ)_/¯
 
"Local Changes" is still part of my VCS window (both Git and Mercurial)
 
yes, now that I closed the git tab and reopened local changes it is. But before when I opened local changes it was it's own tab on the left under commit, without preview
strange, stuff
 
This happens at work too. People ask me for help, I walk to their cube (or I used to), they go to repro the problem - voila! it is fixed! I chalk it up to my aura.
 
haha, yeah I know the feel. But I'm sure often it's some conditional rare bug, that get's fixed by just restarting or redoing the thing in question
 
1:48 PM
@Hakaishin I thought that was about a deserted chat room, before I read the google maps part
 
@AndrasDeak I know, I missed an indent but too late to edit it
 
That line doesn't need an indent. But checking == True is always wrong!
 
And doing i = <whatever> inside a for i in ... loop is wrong about 75% of the time. I'm not actually completely sure that the code sample we're talking about is inside a for i in ... loop, but I figured I'd bring it up anyway
In other words, if you reassign the target of a loop with the expectation that this will change what value the target has in the next iteration, you will be surprised
for i in range(10):
    print(i, end=" ")
    if i == 3:
        i = 7

#expected output: 0 1 2 3 8 9
#actual output  : 0 1 2 3 4 5 6 7 8 9
 
2:12 PM
I still get a csrf error when sending my post request like this:
cookie = get_cookie(args)
response = requests.post(args.url, data=post_data, cookies=cookie)
or
cookie = get_cookie(args)
post_data = {**post_data, **cookie}
response = requests.post(args.url, data=post_data)
and adding the cookie to the post_data. Any ideas what I do wrong?
 
@Kevin I recommend trailing else:continue\nbreak for its supaw readlblty.
 
ಠ_ಠ
 
hello! how do you put into conditional (if statement) this:

if a number appears only once in the list, then...
else (a number that appears multiple times)

Thank you!
 
so, you want to check that, given a list, the .count of a number equals 1?
 
or are csrf cookies only valid for 1 url? Because right now I get the cookie from a url like: /en/app/json/request/session?username=name&password=pw
but the post goes to a different url
 
2:17 PM
Unclear whether it's applicable here, but collections.Counter is useful for many scenarios where you need to count how many times something appears in a collection
 
@MisterMiyagi let's say I have ```` x = [3, 5, 5] ````, if 5 appears once then... else... should I just use .count(5) > 1 in the if statement?
 
Counter is probably overkill if there's exactly one value you want to count the appearances of, and you only need to do it once
@Acee .count(5) > 1 is not equivalent to `5 appears exactly once". It's equivalent to "5 appears more than once".
 
@Acee yeah, unless you are dealing with truly huge data. lst.count(num) == 1 is what you initially described.
 
@MisterMiyagi values in x change every run
@Kevin will try it the other way around, if a number appears multiple times, then... else (if once). Would this work?
Will try it with my code first! Thanks!
 
@Acee that's not really relevant - if x were static, you could just hardcode the result, after all.
But for example if x is huge, it might be faster to iterate the list and immediately return when num occurs more than once.
all of that depends on how likely num is to appear, how huge x is, where num is most likely to appear and so on.
 
2:50 PM
I notice that there's no logic for handling when a number appears zero times in the list
Admittedly there are some scenarios where "appears more than once" has the same outcome as "appears zero times", for example when pluralizing nouns: "I have 0 apples", "I have 1 apple", "I have 2 apples"
 
3:10 PM
Debate: which of "I have -1 apples", "I have -1 apple" is correct?
For bonus points, extend your argument to the complex plane
 
Hey, umm can anyone help me with regexes?
 
@Kevin isn't that comparing apples to imaginary apples?
 
I was tempted to try stretch 0j to represent "orange juice" to try marry the usual "apples and oranges" but it is too laboured
 
3:27 PM
I owe 1 apple.
Or I lost 1 apple
@d4rk4ng31 Okay.
 
@AnnZen, I've a python code with many badly formatted lists of the format
num_list1 = [ 1 2 3 3 2 1 4 5 6 5 4 7 8 9 8 7 5 2 3 6 12 14 25 21 12 12 12 14 24 42 52 52 25 46 97 85 85 58 64 46 46 41 37 79 19 91 73 82 64 91 73 92 72 18 38 55 64 46 97 79 ]
How do I replace those spaces with commas?
 
Is that a numpy array?
 
Nope
Just a normal array
 
is that part of a larger file or just that line?
 
Larger file
 
3:34 PM
print("[1 2 3 3 2 1 4 5 6 5 4 7 8 9 8 7 5 2 3 6 12 14 25 21 12 12 12 14 24 42 52 52 25 46 97 85 85 58 64 46 46 41 37 79 19 91 73 82 64 91 73 92 72 18 38 55 64 46 97 79]".replace(' ',', '))
 
@AnnZen No, uh, I am trying to convert it that way with CTRL+H in gedit, you know, the find replace dialogue box?
@MisterMiyagi But there are multiple lines like that
 
so you're looking for a regular expression to use with gedit in order to do the replacement?
I'm not sure what you are looking for can be expressed with regex.
 
Find: ([0-9]+)[\s]+([0-9]+)
Replace: $1,$2
Needs 2 passes
 
are there only numbers in the lists?
 
Yes
 
3:39 PM
You can copy and paste that in the python shell, and paste the result back to your program.
 
No, what I posted works fine. I just want to get it down to one pass
 
how many such files are there that 1-pass is a significant improvement over 2-pass? oO
 
Well, its just this one. Guess I'll have to try that myself :P Thanks :)
 
Have anyone ever been in this room? chat.stackoverflow.com/rooms/117953/…
 
4:19 PM
@roganjosh yeah, I think I figured out where the issue was with the OP though: either 1. old version of SQLAlchemy (apparently I hadn't updated that library in the VM I was using for a while and was using a session out of habit/sleep deprivation) or 2. The OP was using a session somewhere (which means he was using the wrong execute method - or at least one not attached to the engine). Was fun to play around with and break things either way.
 
There is one other possibility (which seems a bit bizarre). The OP used db.execute() but it needs to be db.engine.execute() for flask-sqla
So I'm not sure whether db was some custom object that passed the query on, or some other strangeness
 
yeah, that's the one I was looking at - but its just weird (and kinda what I did with 1. but could never get the exact same issue)
so "cannot reproduce" I guess :)
 
Yeah, I'm very tempted to go back and CV it but I'm more happy at just knowing I wasn't losing the plot (on that specific point, at least :P)
 
@d4rk4ng31 When you post Python code and ask "How do I replace those spaces with commas?" in the Python room, people will assume you want to do it with Python code. Unless you say you're looking to do it with a (GNOME) gedit search-and-replace regex, in a single pass, multiline. (I'd personally use sed on your source-code).
 
eh, it was an error of some type; some other person might make it; it has an accepted answer (which is not a terrible injection happy thing) - I'm just going to leave it, I've seen worse
I might add a comment pointing to PEP 249 and the relavent docs (I think Engine.Connect) cause the answer's comments on how SQLAlchemy translates these is off
 
4:29 PM
@smci, sorry my bad
 
in other news: the 2nd craziest semester I ever had is officially over - lifts his tumbler of whiskey cheers to that :)
 
<raises glass>
 
@d4rk4ng31 No worries, just don't be wedded to your initial choice of tool, I suspect sed/perl/awk family are better for single-pass regex substitutions than gedit. Also in your case I think you want long-line-wrapping (at parameterizable threshold, e.g. 72/76/80 chars). You could pipe into UNIX split, or use editor line-wrapping if it exists.
 
@smci, Oh. well, I actually am learning regexes via regex101. For this problem, I tried \[ ([1-9]+ ){1,} \] (but somehow, it doesn't seem to work.)
 
I used to use perl all the time for quick regexes....then I needed NLP stuff and Python replaced Perl in my pipes
Pythons in your pipes might seems like a bad thing but trust me its a good thing
 
4:38 PM
@LinkBerest Oooh, you had whiskey, eh?! In our day, had to celebrate with mock whiskey from apple juice darkened with coffee/cinnamon.... You think that's bad? Had neighbor who died drinking battery acid because he couldn't afford to make mock whiskey.
 
4:48 PM
my family name (on my mother's side) is based on the wood they used in the barrels they aged the Scotch in - I always have whiskey ;)
 
@LinkBerest the very first two snippets there have made me dust off my python.org login and edit the page to make it Python 3 compliant...
 
Also hard-wiring a range rather than itertools.count, tsk-tsk
(I'll find the right module eventually)
May 6 at 17:51, by Andras Deak
@AshwinPhadke please don't ask for help here with fresh questions on main, as per our rules
 
Gotcha, thanks.
 
5:06 PM
@AndrasDeak OK but did you see this?
 
@JossieCalderon that is exactly what my message was referring to...
just look at the directed reply of mine
 
@AndrasDeak I see now. After the for loop run if continued == True.
Instead of inside.
By the way, best front-end for web sites written in Python? Is it really Django?
 
@JossieCalderon still no
 
@JossieCalderon Django is not front-end
 
5:21 PM
@roganjosh Just gonna read this then
 
Today came a client he had a head that it was so big if he has a stroke i bet there is a spare brain in there
Wow like a boiler
 
@JossieCalderon um, ok. I'm not sure what I'm supposed to say to that
Django does have a templating language, same as Flask leverages Jinja2 when rendering templates. But it would be wrong to call them front-end libraries
 
Worse. That's plagiarism!
 
@MattDMo cool, I still had that link from while ago and hadn't looked at it recently (as I memorized the one-liners I use frequently)
 
After so many years of using Wikipedia and Stack Exchange, my first instinct when I see an error on a web page is to try to edit it. Sadly, it doesn't always work :(
 
wim
@LinkBerest LOL, what is all this stuff? bizarre.
 
heh, fun right :)
 
wim
5:45 PM
The News page is hilarious
and the breadcrumbs are all over the place, coming from distutils tutorial for some reason
I guess they were using cookies for breadcrumbs or something
 
I'm not a fan of that tutorial (it's not the worse I've seen but its yet another "write X as Y" style tutorial - don't write JS like Python or vice-versa)
 
wim
I wonder if jam555691@yahoo.com is still on Yahoo! Instant messanger (sic) and I can ask them to update the NEWS page ...
 
@smci I VTC'd and flagged the answer
 
2 months ago, I had a client get really mad at me when my answer to his "how do I get AOL Instant Messager to work" was to get a new email (was using AOL Gold Desktop) and use a different messenger system....so he might
 
more like LOL amirite
 
5:58 PM
.... My mum still uses AOL. I've tried everything; it's going to have to be a family Intervention at this rate :'(
 
oh, nope - that's a bad tutorial (the Python example connects to a DB using Django models, the JS version does not - it just checks a property...so you'd still need the backend)
My mom still doesn't know how to use email (we finally taught her text because she can just "talk to the phone")
 
wim
the code is in images = bad tutorial
can't be found in search results, can't be copy-pasted by readers ..
 
can't be read by screen-readers or translation software
 
6:19 PM
@roganjosh Ok. Wnat did you flag the answer as?
@wim Tee hee
 
@smci full-scale plagiarism. It's made me grumpy. Instead of attribution, they decorated it with "from my expertise i think.."
Anyway, that's in the mods' hands now and the question was closed as a dupe so, all good :)
 
@roganjosh I also cast a delete vote on the answer. Now I'm grumpy, too...
 
I custom flagged it like I do with all blatant plagiarized answers I find (I remember asking for that flag/close reason once on a different site)
 
@MattDMo eh, I think there's enough furore already that it'll get handled by the mods. I'm moving my grump over to the fact that Rick and Morty has finished for a while :P
 
I'm also a little grumpy because I was trying to teach an obvious complete noob how to think about iterating over collections by item, not the index of the items, when someone just came in and dropped a complete solution to the homework problem using things like enumerate() that the OP likely hadn't even heard about yet.
 
6:39 PM
which will lead to that person trying to use enumerate when adding and removing items from a list and asking a second question then spoon-fed another answer then repeat ad-nauseam
 
exactly
 
yeah, I wish I wasn't speaking from experience but that would be my intern base when doing interviews (JS is worse, then Python, then C# but only when I see LINQ stuff)
For example, I have one interview task (I vary these) "given a passed integer (let's call N) and csv file, remove the Nth comma". Two interns gave answers using lambdas to count ever comma and the remove when N reached - neither could tell me what a lambas was & their code was near identical (I found it on codegolf.SE later)
great, now I'm grumpy - it spreading
 
I strongly deny that I am "Patient 0" in The Grump
 
6:56 PM
Impatient 0
 
oh, my grump started from a question on Arcade.SE (which I usually ignore but.....) which states that "mobile devices cannot run Java".....and degrades from there - so it was parallel but not casued by @roganjosh
 
@AndrasDeak I think I've exhibited behaviours that could be interpreted as patience every so often, so that's slanderous :P
 
present company excluded
 
Do I look at :p the same way as others: is that a tongue or an open mouth?
 
it's supposed to be a tongue (being tongue in cheek, more or less)
Uppercase P makes it look more like that.
it's ancient IRC tradition
 
7:11 PM
@AnnZen I tend to be very sarcastic so it's something I use to make sure that people know that I'm just joking
 
user11006952
8:08 PM
When is it appropriate to use straight vcr instead of pytest-vcr? Why would one be preferred over the other? Both APIs look the same, with the use of decorators.
 
I never got an OverFlow error before, and want to see it happen. Can someone give me a piece of code that will throw that error?
 
user11006952
18
Q: OverflowError: (34, 'Result too large')

user3033766I'am getting an overflow error(OverflowError: (34, 'Result too large') I want to calculate pi to 100 decimals here's my code: def pi(): pi = 0 for k in range(350): pi += (4./(8.*k+1.) - 2./(8.*k+4.) - 1./(8.*k+5.) - 1./(8.*k+6.)) / 16.**k return pi print(pi())

 
import sys
len(range(sys.maxsize + 1))
 
Thanks
 
8:26 PM
this doesnot add anything to the canon
cbg
swapaxis [0,1] :P
 
@AnnZen If you are interested in cryptography, you should take a look at Cryptopals. A few of us started working through the Cryptopals challenges a few years ago, but I don't think anyone here finished them all. Some of the instructions are a bit ambiguous...
Oct 5 '17 at 17:11, by davidism
I need something new to procrastinate with, so I'm going to start https://www.cryptopals.com/. Join me!
 
@roganjosh with "the question had just been asked" the answerer is talking about the linked question in the answer, closed as a dupe
so they took their answer and posted it on the dupe target (which is fine) where it doesn't belong (which is bad)
 
@AJGayeta The itertools module is good for things like that. See docs.python.org/3/library/itertools.html#itertools.combinations
 
Hi everyone, pretty new here in the chat
cbg :)
 
@Tomerikoo welcome
 
8:35 PM
tnx
wanted to share with you a question I just stummbled on which bothers me
-1
Q: TypeError: 'module' object is not callable main

Lucy SmithI have an application module which I try to call with my hand. But I get this error: TypeError: 'module' object is not callable How could I do for an add main function in my code? import Application if __name__ == '__main__': app = Application() app.mainloop()

 
@AndrasDeak thanks :)
 
Apart from the fact that the question itself is pretty low-quality, it really bothers me that the accepted answer in no way whatsoever solves the problem in the question
 
long time how are you
 
and it is accepted....
 
@AndrasDeak I've rolled everything back in terms of downvote and comment. I'm not sure I follow the narrative but I'll leave it
 
8:37 PM
@Tomerikoo that's askers for you. It happens sometimes. If it's really unreasonable for that to have happened, sometimes there's foul play.
@roganjosh the downvote is fine, the answer doesn't belong. Only the comment was off :) 1. answerer sees the linked dupe, prepares to answer 2. dupe closed 3. answerer, stuck, posts the answer on the dupe target, linking to the original
 
@AndrasDeak You mean fake accounts to accept your own answers and stuff like that?
 
@Tomerikoo yup
 
that's nasty (and pretty lame if you aske me....)
 
It is, but it happens. Not worth being worked up about, of course.
 
erm, you mean that internet points are lame? :P
 
8:40 PM
haha not at all, I love my rep points, each and every one of them. Just not enough to go and open accounts to rep myself up... ;)
 
@Tomerikoo Or friends (eg class mates) voting on each other's stuff.
 
@Tomerikoo also some askers get confused easily, so they approve terrible edits for instance, not knowing they have the right to reject it.
 
@AndrasDeak yep seen that pretty much too
 
@PM2Ring in my time i wish our class mates including me knew about SO, things might have been better
 
@AndrasDeak I guess you're right, it's just that my OCD is giving me a hard time leaving a wrong answer accepted...
 
8:42 PM
Don't take accept marks too seriously. After all, the asker is generally the least qualified contributor to a page. ;)
 
@PM2Ring haha good point...
 
Class mates don't necessarily realise that it's bad to vote on each other's stuff. I discussed this issue here: meta.stackoverflow.com/a/390999/4014959
 
00:00 - 21:0021:00 - 00:00

« first day (3520 days earlier)      last day (1411 days later) »