« first day (2573 days earlier)      last day (2379 days later) » 
01:00 - 23:0023:00 - 00:00

1:10 AM
does anyone have any experience using the zendesk api?
 
 
7 hours later…
8:04 AM
Heyo
I have a small assignment of testing the time on 2 solutions for finding how many zeroes are in a large number and testing how the time it takes changes based on the number of zeroes in the number
After performing a basic run, I decided to try not just my own forced numbers but to randomize it and sort results into buckets
I've encountered a small problem.. my randomized numbers are all too close to the average number of zeroes
def sdigit_rand():
return random.choice(["0","1"])

class MyNum:
def __init__(self, size):
self.snum = "1"
self.cnt = 0
for _ in range(size-1):
res = sdigit_rand()
self.snum = self.snum + res
#if res=="0":
# self.cnt += 1
self.cnt = str.count(self.snum, "0")
self.num = int(self.snum)

def __str__(self):
return str(self.num)
avg[0]: reps = 0, avg_time = 0
avg[1]: reps = 0, avg_time = 0
avg[2]: reps = 0, avg_time = 0
avg[3]: reps = 0, avg_time = 0
avg[4]: reps = 499, avg_time = 0.0033471116083179544
avg[5]: reps = 501, avg_time = 0.003748520643649225
avg[6]: reps = 0, avg_time = 0
avg[7]: reps = 0, avg_time = 0
avg[8]: reps = 0, avg_time = 0
avg[9]: reps = 0, avg_time = 0
I was hoping to get a wider spread
and see if there's any interesting results
 
Also, a wall of code doesn't usually help, it'll be better if you link to a pastebin dump
 
I don't see how the code is related to the timing results
 
def sdigit_rand():
        return random.choice(["0","1"])

class MyNum:
    def __init__(self, size):
        self.snum = "1"
        self.cnt = 0
        for _ in range(size-1):
            res = sdigit_rand()
            self.snum = self.snum + res
            #if res=="0":
            #    self.cnt += 1
        self.cnt = str.count(self.snum, "0")
        self.num = int(self.snum)

    def __str__(self):
        return str(self.num)
 
It is, he is randomizing slightly awkward (or simplistic)
 
it's without the time function
the numbers are distributed poorly
probably should do it differently... open to suggestions
 
8:12 AM
So, you basically want to get a sort-of even distribution right?
even == spread out
 
spread out distribution of zeroes so I can estimate how the solution (counter for number of zeroes in a large number) performs based on a changing number of zeroes
 
I believe you should just state the number of 0s you want and shuffle the string (x 0s and filler 1s)
 
str.shuffle() ?
:)
 
Beat me by 47 seconds. — Douglas Leeder Jan 23 '09 at 18:38
55 upvotes to that, good ol' 2009
@ofer.sheffer More like random.shuffle
Create a list with the number of 0s you want, and put up remaining filler 1s. Then just str.join shuffled lists
 
1. convert your string to a list of characters, 2. shuffle it, 3. join the result again.
`
import random
l = list(s)
random.shuffle(l)
result = ''.join(l)
`
wonderful. thank you
 
8:16 AM
Yeah, something like that
 
have a wonderful day
 
8:38 AM
thanks, same to you
 
Guys how to prevent sql injection on an interface, where user can execute his own queries on a database? Only way is to check the query string right?
 
so you're saying queries (SELECT) are allowed, but everything else (UPDATE, DELETE, INSERT, etc) is not?
 
@MarlonAbeykoon Is that not by definition "SQL injection"? :P
But more seriously, permissions.
 
9:26 AM
ya in this case i want them only to use select statments
@IljaEverilä
 
9:43 AM
@ofer.sheffer or use ''.join(random.sample(s, len(s)))
 
@MarlonAbeykoon create database user with read only permissions and use this user for user queries
 
@MarlonAbeykoon This might not be the room you want btw. I'm sure the SQL room is better suited.
 
mm ya. Unfortunately memsql community edition doesnot allow to create users :(
So thinking of anohter way
 
 
1 hour later…
10:58 AM
Cbg
 
11:16 AM
What is this Cbg? :P
 
lol ok
 
11:31 AM
A Finn stole a bike. Leaves it in front of the police station with a note: "I stole this, and now I am trying to return it. I am so sorry. I must admit I was really really drunk."
5
 
cbg @JRichardSnape, how are you?
 
wat professor SNAPE!
 
@AndrasDeak Hey Andras, I'm well
Hi Antti
 
Glad to hear that:)
 
Have been very busy. I have the real October / September as well as the eternal one to contend with :)
 
11:33 AM
Wed Sep 8828 13:33:25 EET 1993
 
Here you are in November; it checks out ;)
 
I aim for internal consistency
Or at least the external appearance of internal consistency
 
That's all that matters anyway :P
 
How are things in the world of nano-magnetics?
 
Fine, fine, thanks :)
 
11:36 AM
Good, good. As long as you're not getting in a spin about it...
 
I work in the ground state
 
@AndrasDeak :D
I have done precisely zero research for the last two months and now feel somewhat out of practice. I'm going to attempt to return to some difficult maths via bad puns.
I'm sure that will work
 
11:50 AM
@AnttiHaapala I really need to settle in one of the nordic countries, mostly Finland.
 
morning cabbage
 
recbg
more like r'(cbg)'
 
@AshishNitinPatil we have -11 C here now
 
Well, I can probably get accustomed to that. At least the first time would be fun since I haven't really felt actual snow.
Coming from Dubai (+50 C during peak), it would feel like an uncomfortable relief :-p
 
> And finally, if you enjoy learning about random subjects, you choose a
random page number (see module `rand`) and read a section or two
 
11:54 AM
:P
 
Unsurprising to see that Python guides had a playfulness about them even then :)
 
12:06 PM
hi
 
12:20 PM
morning cabbage @DhavalkumarPrajapati
 
@AshishNitinPatil coming from a hot country your butt is guaranteed to freeze off
I mean, more than merited by -11 degrees
@JRichardSnape just fake it like the rest of us
 
12:48 PM
Hey, is there in flask something similar to the built-in server in django? So I can easily "test locally" if my website works?
 
morning everyone
 
@paul23 Yep, you can do flask run (or serve), if you set up a couple env vars
 
@AshishNitinPatil Is pycharm clever enough?
 
No idea.
export FLASK_APP=hello.py
Then just flask run
 
1:04 PM
Thanks for the link. I'm contemplating if I wish to ever go for python 3.6
 
you do
 
They added the constant "tau" (docs.python.org/3/library/cmath.html#cmath.tau) which is blasphemy.
I live by pi/2
 
someday I will learn how math works
 
@WayneWerner That bit is still in today docs.python.org/3/library/intro.html
 
@PM2Ring Wow: Thankyou soo much !
 
1:13 PM
wow funky, pycharm actually understands flask well; it has a special template for new flask projects & automatically download/installs flask when you create a project.
Even the debugger works :)
 
cbg \o
 
1:28 PM
cabbage
@paul23 works well with django, too
@corvid it is just logic, not much different from the logic of programming
 
I feel like I suck at math to such an extent that I wonder how I became a programmer to begin with
 
@paul23 tau is just 2*pi, right?
 
@Code-Apprentice Yes, the horrors!
 
@corvid from my experience, most people that claim they are not good at math have a mental block not a lack of ability
@paul23 it makes sense since this value is used more often than plain ol' pi
like any other part of python you do not like, you can just ignore it if you wish.
 
shows his back to Code-Apprentice
 
1:32 PM
=p
 
DSM
1:43 PM
Mornin' cabbage.
 
\o cbg.... tonight's games will be exciting, every pitcher is willing to pitch, who will win?, will we snap our losing streak? so many questions :D
 
DSM
@MooingRawr: yeah, yet another night I'm not going to be accomplishing very much. :-)
 
dude I hope I can get some sleep :( these nights I've been going to bed at 12:15-30 am :\ OTOH it's making the games really entertaining.
 
DSM
It's last year all over again:
Oct 28 '16 at 2:45, by DSM
NHL; NFL; CFL; NBA; NCAA FB; and the World Series. Hell, even MLS postseason, and LargeCanadianCity's team is in play. How am I supposed to get any work done?
 
So I have a friend who is "TA-ing" in a high school for computer programming for grade 12s, I asked him what is he going to try and teach this year, and he was going to see if the teacher will let him teach the students on how to debug and search for solutions online. I requested if he can teach people to use SO properly, which he has yet to respond :\ I do hope he can.
3
 
1:55 PM
wee hours of the morning cbg
 
I don't find myself watching NFL/NBA as much anymore... just more of a stat recapping type of person. The teams are so stacked this year for the NBA, and NFL has it's political views leaking and their advertising :\
@cᴏʟᴅsᴘᴇᴇᴅ it's 10 am where I'm at what time is it for you, morning cbg \o
 
@MooingRawr 7AM PST
 
2:16 PM
@gerrit hah, nice. I thought it seemed familiar :)
@cᴏʟᴅsᴘᴇᴇᴅ thanks for the pandas help
my pandas skills are uh... nearly non-existent :)
probably because I find that it's delightfully abusing Python syntax to make a new DSL that's totally valid Python
 
No problemo. Give me a heads up if you're asking a question so I get dibs on FGITWing it ;D
 
@Code-Apprentice it is not
 
2:38 PM
@AndrasDeak Yeah, that's my default strategy :)
 
2:58 PM
@Code-Apprentice yeah it's totally true. I am mostly aware it's because of my own laziness and lack of trying, tbh
 
jjj
cbgbs
I have a list a = [('c',1),('d',2)]. Say I want index of tuple with 'c' in it. In normal circumstances, which is better: [i[0] for i in a].index('c') or map(lambda x: x[0], a)?
 
or next(ind for ind,tup in enumerate(a) if tup[0]=='c')?
 
jjj
yup
 
@jjj [i[0] for i in a] is more efficient than map(lambda x: x[0], a) since it avoids making a function call on each item.
 
jjj
Even if a is reaaally big?
 
3:08 PM
:39842043 sorry :P
 
mine was objectively better, it was wrapped in backticks :/
 
In general, it's best to avoid map if the function is a Python function. Only use it for built-in callables that are (probably) running at C speed.
 
@Rawing yer right, but too late
 
I thought you'd have enough time to edit them in, but alas
 
@jjj If you want to use map, you could use operator.itemgetter(0)
 
3:09 PM
@Rawing it's okie Rawing, there's no point in looking back at the ticks :\
 
well you didn't complain in time
 
Will operator.itemgetter(0) ever be more efficient?
 
@KevinMGranger more efficient than a lambda
 
jjj
Oh, I see. Thanks. @PM2Ring
 
(I mean that seems to be the statement)
 
3:11 PM
Here's another way to get the items at index zero from all your tuples:
>>> a = [('c',1),('d',2)]; next(zip(*a))
('c', 'd')
@KevinMGranger operator.itemgetter(0) is definitely faster than a lambda
 
jjj
Oh, nice. I suspected it was possible with zip somehow.
 
but that's not the answer to what you asked
 
jjj
hah, true
 
also, you need a list() around map() to make it .indexable
 
Mind you, the zip version would be slower in Python 2 because it has to build a list of all the transposed data. But in Python 3 zip returns an iterator, and we're only fetching the first tuple it constructs, so it should be reasonably fast.
 
3:16 PM
Making your code deliberately slower when run in Python 2 is a feature 😈
 
jjj
@AndrasDeak not in py2 right? Anyway, the solution with next seems probably best. I'm thinking though, are lambdas useful in any situation?
 
what's python 2?
9
 
@jjj Yes, why not? e.g. lambda x: x
You can replace x with whatever you want and that would be extremely handy in quite a few cases where you need to pass a function
 
@jjj Guido says "No!". :) But yes, lambdas are useful, but don't use them when you can do the equivalent with a generator expression or list comp that doesn't need to make a function call.
 
jjj
Oh, ok. Thanks a lot
 
3:19 PM
Is there a better way to look up what exceptions are thrown by what in terms of standard modules/functions/methods/etc?
 
better than what?
 
Calling a Python function is one of the slowest things in the language, calling functions that are implemented in C has much less overhead.
 
python 2.7, searching for the middle element in a list of length 10000, with 5-character "words" in the first position of each tuple:
>>> %timeit [i[0] for i in a].index(val)
1000 loops, best of 3: 536 µs per loop

>>> %timeit map(lambda x: x[0], a).index(val)
1000 loops, best of 3: 1.14 ms per loop

>>> %timeit next(ind for ind,tup in enumerate(a) if tup[0]==val)
1000 loops, best of 3: 412 µs per loop
python 3.6.0:
>>> %timeit [i[0] for i in a].index(val)
443 µs ± 4.96 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

>>> %timeit list(map(lambda x: x[0], a)).index(val)
985 µs ± 3.58 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

>>> %timeit next(ind for ind,tup in enumerate(a) if tup[0]==val)
442 µs ± 4.93 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
 
@AndrasDeak Thanks. Could you also time operator.itemgetter(0) instead of the lambda?
 
I like the listcomp/next agreement in the latter case :)
 
jjj
3:31 PM
Interesting! Is this a coincidence that list comp is faster in py3?
 
Python 3 in general is faster than py 2 iirc
 
python 2.7:
>>> %timeit map(operator.itemgetter(0), a).index(val)
1000 loops, best of 3: 551 µs per loop

python 3.6.0:
605 µs ± 10.1 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
 
16 mins ago, by Andras Deak
what's python 2?
 
@jjj It's complicated. THere are some improvements in list comp efficiency, but there's also extra overhead because Py3 list comps create their own scope, but Py2 list comps don't.
 
@PM2Ring ----------------------------^
different list, but again searching for the middle element so it should be comparable
rhubarb for a while
 
3:34 PM
Thank, Andras. So I was correct that itemgetter is faster than lambda. And only a little slower than indexing in a listcomp.
 
yup, a lot
of course the 3.6 version again contained list(map()) I just forgot to copy the code line
 
No worries.
 
3:45 PM
@paul23 That code is broken: TypeError: tuple() takes at most 1 argument. I suppose you meant tuple(args). But why would you want to create a copy of the args tuple anyway? Tuples are immutable, so there's never a point in copying them, just use the original.
@paul23 In case it wasn't clear from the other replies, the lru_cache of a method lives in the class object itself, not in the instance.
 
4:12 PM
cabbage
So I just got access to review queues, and I don't think they trust me, as I've seen this at least 3 times:
>Congratulations!
This was only a test, designed to make sure you were paying attention. You passed. This was a high quality post and your review was appropriate.
 
that's much better than the "STOP! Look, you messed up your audit" message
 
Grrr.
"malformed JSON data that I need to use Regex to get the data" it's implied. — Nick Duddy 9 mins ago
 
@AndrasDeak Touché. Is that really what it says? I haven't seen that, so I suppose I have done an ok job.
 
I haven't done any reviews in a long time and I think I only messed up 1 audit or so? Meta probably has more than enough examples of a botched audit
so no, I was paraphrasing
 
@toonarmycaptain Review audits are random, so they come at unpredictable times. And the audit posts are selected automatically, so sometimes the audits are wrong!
 
4:19 PM
@PM2Ring What do you mean? They'll show a terrible post, you'll flag it, and they'll chide you for not looking closely enough at the 'fantastic' post?
 
yup
meta is full of those
 
...second audit in a row? o.O
 
@toonarmycaptain I believe there are heuristics that can cause this to happen to you
don't worry about it, audits also give you a contribution to review badges :P
 
@toonarmycaptain Not quite, but almost. Eg, you can get an old question that's got lots of upvotes but which would be closed as off-topic these days. But if you reject it as off-topic then you fail the audit.
 
I think toonarmycaptain has only a few review queues available...first posts perhaps?
 
4:24 PM
@AndrasDeak Firsts, Late Answers, and Triage.
 
I'm really tempted to VTC that question as unclear. The OP claims "I've got a series of malformed JSON data that I need to use Regex to get the data", they also state they're new to Python. But the JSON sample he posted is perfectly fine. So I asked in a comment why he believes the JSON is malformed, but he still hasn't explained why.
I wrote an answer, which got downvoted almost straight away. And then the OP claimed he can't use JSON, and finally mentioned that he's using Pandas even though he didn't tag the question with Pandas, or mention it anywhere in his post, although he did add the tag after I suggested it.
 
5 bucks says he used pandas wrong and got some sort of TypeError when he tried to feed his json into json.loads
 
Do I lose rep if I dv as part of a review process?
 
4:40 PM
@toonarmycaptain If it's a question, no. If it's an answer, yes, of course.
It's great that you're being enthusiastic about doing reviews, but please don't do too many in one go. It's bad for your brain seeing so much bad code. :) And it's easy to get burn-out doing reviews. Plenty of high-rep members have no desire to do reviews...
 
That's what I figured. I'm loath to dv unless it's imperative, as I don't have much rep, and I'll lose the privilege to see the queues if I do just a handful of dvs at this point.
Fair enough. It's actually a nice break in between my day job so far :) As compared to trying to focus between interruptions on learning/writing code, which takes more focus for me and is getting harder to do at work.
 
Bugrit.
 
4:59 PM
So... anyone understands how to actually use flask to read data?
def LoadData(fname):
    out = {}
    with open(fname) as f:
        lines = f.readlines()
    return lines



@app.route('/', methods=['GET', 'POST'])
def login():
    u = flask.url_for('static', filename='data.txt')
    print(u)
    print(LoadData(u))
    return "hello world"
When data.txt is under the static folder in the project directory it simply throws a "file not found" error.
 
Hello, I need someone that knows unit test in Django
GenericForeignKey('content_type', 'object_id') is somewhere in a model I need to unit test
but How can I create this ? thanks
 
DSM
@paul23: well, you're passing the URL to open, so it'll be like /static/data.txt. Unless you coincidentally have a file there I don't think that'll work. :-)
 
5:14 PM
@DSM Well how to configure the local directory?
 
@WayneWerner Who reads the introduction to the library reference anyway?
 
DSM
The path to static is in app.stack_folder. If you want direct access use that (and then os.path.join and/or pathlib), or you can just use return app.send_static_file(filename) if you don't want any processing.
Temporary lunchtime rhubarb -- stupid meeting ran into the lunch hour, so I'm behind :-(
 
Talk about literally re-inventing the wheel... stackoverflow.com/a/47060388/4014959 :)
 
@PM2Ring The imports part of your answer...never run into that issue myself, because I follow that advice, but even as a noob it seems so sensible/obvious.
 
5:33 PM
@toonarmycaptain We often see star import in Tkinter questions, since the old Tkinter docs do it. :(
 
@jy95 Yes. Read the room rules and please don't link your fresh questions here again.
 
DSM
oops, looking above: static_folder, not stack_folder
 
oops ^^
 
@DSM thoughts on NBC ranking our logo to be the best It kinda feels like an objectively useless, "feels-good" award.
 
5:41 PM
@PM2Ring And why is that? Why hasn't someone edited them? :s
 
DSM
@MooingRawr: in lieu of more important ones, like ALCS banners, I'll take it. :-) Although I guess Donaldson did get AL MVP the other year.
 
At least we are in first place for something ;v;
they've been hyping up our prospects, but I skeptical until I see them play at a higher lvl
 
@toonarmycaptain Fair comment, but it would be a bit tricky. Tkinter isn't really a part of the standard Python library: it's a 3rd-party library that's been recently adopted into the family. So the Tkinter docs in the main Python docs are merely a stub. OTOH, the "official" Tkinter docs are a bit of a mess, plus there are a couple of other popular Tkinter docs sites.
 
5:56 PM
@PM2Ring Sounds like a good project ;) I'd go look if I had any familiarity with Tkinter. Seems like fixing that specific issue in the docs could prevent a lot of effort in the long run for a lot of people.
 
@toonarmycaptain Maybe... OTOH, I get the feeling that the damage has already been done. Besides, plenty of the standard lib docs have examples that don't prefix the function name with the library, so it's kind of a convention. OTOH, the stdlib docs generally don't have explicit star imports.
 
new project hype :D not really but hype :D
 
@toonarmycaptain most of the downvotable questions are not answers at all, in which case an NAA flag is appropriate. Note though that it's a bit difficult to tell what is an answer and what isn't
 
@AndrasDeak I generally skip if I don't know. I've flagged a few non-answers and commented on a few that need explanation/fleshing out/a 'why' rather than just code/solution.
 
yup, skip is good
you'll probably want to read at least this and a bunch of related "oh people are using Triage wrong" posts
the main issue is that "requires editing" means that "someone other than OP can edit it to be appropriate"
 
6:18 PM
@AndrasDeak Either I didn't read everything I should have, or they could have mentioned that...I assumed that meant OP (or someone else I guess) should edit.
 
Does anyone know the data to create an icon like this for tkinter?: geocities.ws/thezipguy/tcl/misc/…
(it's the small blue arrows)
I am referring to data like the ones being used in this post: wiki.tcl.tk/13354
 
@toonarmycaptain no, there's no information unless you go after it, that's why I pointed you to that. The UX around these queues is a huge mess
for instance, later there's this for the low-quality posts queue
 
6:36 PM
@Bjango Maybe. Give me a few minutes to do some experiments.
 
Alright thanks, I would appreciate it.
I am still searching ..
 
@AndrasDeak Thanks, I'll be reading.
 
@PM2Ring
I think it's one of these images: http://findicons.com/search/blue-arrow/2
Then convert it to a base64 string:


import base64

with open("C:/users/sebastian/desktop/blue_arrow.png", "rb") as image_file:
image_data = base64.b64encode(image_file.read())

print(image_data)

And then use that data.
It is not transparent though.. gyazo.com/74c35b241b24f29318869a2a630c2da7
 
Hi
Q: someone knows a bit about selenium?

I get:
```ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with
```
but the element is for sure there -
I don't want to use driver.execute_script()
 
@Bjango Here you go. This is using the data in the post you linked earlier.
 
6:48 PM
@Suisse Try making your script sleep
 
@Suisse I know you're new here (:PPPP) so please read this
 
Thanks
 
@Suisse Necessary trace element, toxic in large amounts?
 
bjango, the page is loaded completly - so no need for wait I think, the element is "not visible" on the rendered page - but it is in the html dom
 
kills weird aliens
 
6:50 PM
@toonarmycaptain didn't understand your question - do this look:
 
@Bjango I guess I might've misunderstood your question. :)
 
 download_btns = driver.find_elements_by_css_selector('a[title=Download]')
 for download_btn in download_btns:
        print(download_btn) #here I get the webelement
        download_btn.click() #here it says the element is not visible
        time.sleep(1)
 
@PM2Ring Yeah, I think you did, I wanted the data of the blue arrow on that picture
A transparent one
 
looks like an equilateral right triangle
 
@AndrasDeak print('thx')
 
6:54 PM
@AndrasDeak You mean isosceles right triangle.
 
^
equilateral can't be right :-p
 
@Suisse I apologise, I was making a joke about the chemical element Selenium.
 
@PM2Ring right, sorry
these things are called weird in English
my basic math vocabulary in English is non-existent
 
@Bjango Tkinter can do some things with transparency, but the transparency support is a bit flaky and varies on different platforms.
 
@toonarmycaptain hehe I really didn't understand it (english!! waaaah!) otherwise I would also lol and rofl and so on hehe
no need for apologise ^^
 
6:57 PM
@PM2Ring It might be the part when I base64 the png to get the string data. Does it support transparency?
 
thx guys - seems to be this solution:
2
A: How to find and click on a hidden button with selenium?

TermiI tried with two different approaches driver = webdriver.Firefox() print driver driver.implicitly_wait(20) driver.get("https://www.swisscom.ch/de/privatkunden/mobile/devices.html") Directly finding elements with class_name = 'primary-button' hrefs = driver.find_elements_by_class_name('primary...

the element is in the HTML code - but only visible on mousehover - and the click() from selenium only works when the element is really VISIBLE hehe
 
@Suisse Totally inappropriate, but I just wanted to let you know that I love your profile picture. Thumbs up (y)
 
@Bjango Give me a couple more minutes. I think I've got a solution.
 
Alright, just to be clear, I am trying to make the icons appear as transparent in the tkinter window.
When converting the png with base64 it removes the transparency.
 
7:15 PM
@Bjango I also love my profile picture and I have cancer
 
@Bjango The image data in the Base64 data string is supposed to be GIF AFAIK. Anyway, I extracted the arrows from that image, and transparency is working for me.
import tkinter as tk
root = tk.Tk()
tk.Label(text='Arrow Button test').pack()
im_up = 'R0lGODlhEAAJAIABAAQChP///yH5BAEKAAEALAAAAAAQAAkAAAIUjG+Au+DMnIRHWmpzzLpynnziyBUAOw=='
photo = tk.PhotoImage(data=im_up)
button_up = tk.Button(root, image=photo, bg='yellow')
button_up.photo = photo
button_up.pack()
im_dn = 'R0lGODlhDwAIAIABAAQChP///yH5BAEKAAEALAAAAAAPAAgAAAIThI8ZyRbf0JsRzNuuVnq73lldAQA7'
photo = tk.PhotoImage(data=im_dn)
button_dn = tk.Button(root, image=photo, bg='pink')
button_dn.photo = photo
@Bjango Chat has wrapped those image data strings to the next line, you'll need to fix that.
 
wait a second..
 
@AndrasDeak I'll note that meta post says to make posts without code as unsalvageable...should I assume it's also ok to leave a comment asking to show code/error/[mcve] instead? I've done that several times.
 
@PM2Ring Thanks, it works now!
 
7:26 PM
I forgot to update the background of the label I attached the icon to
 
@toonarmycaptain "every post should contain code" is of course stupid
if it's a debugging question, it's not stupid :P
leaving code/error/mcve-request comments is always good; don't know about unsalvageable
 
@Bjango No worries. Next time I'll read more closely before rushing off to write code. :)
 
I haven't really touched the ambiguous review queues
you could try asking in the SOCVR room because there are a few generic reviewer guys there
 
@AndrasDeak What I mean is that I've been leaving comments on questions that might otherwise be marked Unclear what you're asking...because code/error details may well make it clear again
 
yes, those comments can never hurt
if the OP edits the question, they can get reopened later
 
7:39 PM
So I should still be flagging as well as leaving the comment?
Thankyou for pointing that post out. :)
 
As unclear? I think so, yes. Just don't feel bad if your flag gets declined because the user actually edits their post due to your nudging ;)
and no problem
 
Comments don't always work.
The user does not always edit their question.
 
yes
 
@Simon If the OP doesn't respond to polite helpful comments, feel free to down-vote them mercilessly. ;) And if they haven't fixed their question enough to make it answerable you can mention it here or SOCVR with the [tag:cv-pls] and we'll consider voting to close it.
 
One case I can remember was where a question was in Arabic. There were 8 downvotes or so and about 10 comments. The user did not edit their question and did not show any signs they was going to. It was flagged and was removed after being close after about half an hour later.
 
7:48 PM
assuming that it's past 10 minutes or hopeles, as per the room rules
@Simon incomprehensible posts like that sometimes even go through as abusive
 
That was one of two questions I ever downvoted.
 
@Simon shame on you
votes are the most essential quality-control mechanism on Stack Overflow. Vote early, vote often
 
Vote often -yes vote often -yes downvote -not so often.
I leave comments on improving generally.
I'm often not so clear myself.
 
do you ever look at the front page? :P
 
Downvotes on questions are free, they cost 1 point on answers. That's to encourage people to downvote bad questions. But I almost never DV a question without first trying to help the OP fix it.
 
7:54 PM
I personally pasted some code in here the other day, and while I was editing what I was describing/pasting, I neglected to include the error line/code. So I have sympathy.
 
@PM2Ring I thought DV on answers are 2 points and on questions are 1.... guess I was off by one
 
And I'm sure it can be nerve-wracking posting on SO, especially if you're a newbie. So I think it's a bit cruel to DV without first commenting. Of course, often you see a poor question and there are already several comments that the OP hasn't responded to, so there's no need for further comments.
 
NB Immediate chastisement in chat is admittedly different from posting, and not proofing a question after posting and realising you've left something out. But still, my sympathy is for the newbie I once was, who would be encouraged by their error being pointed out so they can fix it, rather than questions having many downvotes and closevotes without much warning/explanation.
I'm pretty aware that I'm not likely to return to a downvoted question to reverse my downvote when they do fix it, so downvoting doesn't always seem like the fairest option.
 
DSM
Why, gunicorn? Why do you keep bringing up two processes? Is it related to reloading? How can I disable it, if so? Why?!
 
@MooingRawr "There are only two hard problems in computer science: cache coherence, naming things, and off-by-one errors." — Phil Karlton and Leon Bambrick.
 
8:01 PM
Hello cᴏʟᴅsᴘᴇᴇᴅ
or Cabbage.
Cabbage Skyler
Cabbage user2357112
Rhubarb
 
8:34 PM
@Kevin I'm currently using this as a test image.
Sep 14 at 15:48, by Kevin
user image
I had it saved as kevin_turkey_lunch.jpg.
 
What are you testing?
 
people's sense of humour
 
DSM
Test triumphantly passed, I think!
Anyway, time to bail. Sainted rhubarb for all!
 
rhubarb
 
Rbrb DSM \o
 
9:06 PM
The hide of this guy! He posts a comment telling the OP to check How to Ask, but then goes and posts an answer without waiting for the OP to make any improvement to his question. And then has the temerity to ask for an upvote and accept!
 
And it doesn't even work! It throws a NameError.
 
@user2357112 Ha! I didn't even notice the missing quotes.
 
9:23 PM
edit on the question thanks
Interesting data post (for a change, if you ask me)
 
stackoverflow.com/questions/47063535/… Only 1 more needed to kill that thing.
 
10:00 PM
@AndrasDeak successfully passed :D
rhubarb
@kevin coming up with such witty things, you might as well build a comic cult or you do already?
 
Numba can't accelerate json.loads, right? The performance effects this guy is reporting seem really weird.
 
You could try this: print(int(sorted([str(e[1])+e[0] for e in list1])[-1][0])) whackamadoodle3000 4 mins ago
 
Nice. Homework dump? :D
@vaultah if you'd have used poke's hammer script, we could've edited the tags in for you :P
 
10:54 PM
Hammered. Although it's a PITA on the closing dupes on the mobile view.
 
yup, need to scroll all the way through
 
And for some reason fast scrolling in Chrome on Android just got rather tricky since the last updates.
But maybe it's only an issue on Lollipop 5.1...
 
01:00 - 23:0023:00 - 00:00

« first day (2573 days earlier)      last day (2379 days later) »