« first day (1447 days earlier)      last day (3518 days later) » 

3:01 PM
(side question) if you have an HTTPS link that opens a pop up window living on an HTTP page- would chrome throw the error "This page contains both secure and nonsecure items" ?
im assuming since the HTTPS source is just a link and does log contents, chrome should not have a problem with it
 
@Fuchida can't you try by yourself ?
 
TIL that in set builder notation in math the domain can be implied, that's kinda weird
 
@XavierCombelle I am :) just curious if someone has already gone down this path
 
cabbage all
been reading the transcript on my phone, network was down at work for 2 hours :(
 
@Fuchida I said that because your question was vague precisely with how you open the popup window
 
3:04 PM
to pile on: cabbage @poke
 
Cabbage @davidism :)
 
@JonClements I checked, there's no creepers anywhere. You're crazy!
 
Does anyone know how Google crawling works if there's no links directly to my site, but there are links to a permanent redirect to it?

In WMT, shows submitted sitemap but not indexed. Productforums suggests no pages linking to it can be a cause of significant delay - but the old site had reasonable ranking, and now redirects to this new one (and it's linked to a lot), so would I be better off linking to the new domain than permanent redirecting? :/
 
TIL I was using a python package that my brother actually developed
 
close as typo, I just mis-clicked can't find typo...
 
3:14 PM
Voted.
 
Still waiting for the page to load. Must be a big question!
 
too big, stack overflow couldn't handle it
 
And I can't submit an edit to this other question... SO Must be shunning me.
 
Too many stars.
SO is fighting back.
 
This is it. We knew Bad Question Armageddon would come. We just hoped it wouldn't be so soon.
 
DSM
3:18 PM
We had a nice run.
 
user559633
? is it already time for students to start failing out of "intro to *" classes?
 
OK, I'm moving us back down to Threat Level Violet Squiggles, the site is back.
 
looks like stackoverflow cdn is unresponsive
 
@XavierCombelle not for me.
 
@MartijnPieters lucky you
 
3:25 PM
Crayola crayons have come in many colors since their introduction in 1903. By 1905, Binney & Smith's Crayola crayon product line had reached 30 colors. In 1958, the number of colors increased to 64. Eight fluorescent colors were introduced in 1972, increasing the number of colors to 72. In 1990, the total increased to 80 colors with the introduction of 16 colors and the discontinuation of eight colors. The number of colors was increased to 96 in 1993 and to 120 in 1998, though with thirteen crayons being retired along the way, the total of colors is 133. Along with the regular packs of crayons...
The fact that there are pictures of used crayons everywhere is great.
 
Can I ask people to reject this edit? stackoverflow.com/review/suggested-edits/5908769
 
After 20 years, I can still remember the smell.
 
It breaks the inline link
 
Hmm, that's a lot less endearing out of context.
 
@Kevin :)
 
3:27 PM
@Kevin don't worry, I got it, and misinterpreted it.
 
Good, good
I'd reject that edit if SO wasn't unresponsive.
 
@Veedrac rejected it. Need 2 more.
 
If you're having trouble loading websites right now, it's probably because CloudFlare (major content delivery network) appears to be down.
 
When using MySQLdb, does it make sense to open connection, run query, and close connection for each query? Do you really ever need to close it, or can you just open it, and leave the connection open forever?
 
The connection will definitely close once the program exits, but you'll run into problems if you try to open a lot of connections in threads. Use a connection pool, such as what's provided by SQLAlchemy.
 
3:39 PM
um... ok... but what about variables, which used in more then one function? :-| make it global? or call first function (with return variable) inside second function? :-|
or go home sleep...
 
@setevoy did I miss something, or did you start halfway into a conversation with no context?
 
DSM
To be fair, that doesn't differ that much from lots of conversations around here.
 
I assume this is a continuation of our previous "are global variables bad?" conversation
 
@davidism was little Q hour ago :-)
@Kevin yes... I just start rewriting my last code now
 
The short answer to "how do I eliminate globals?" is, "it depends"
 
3:41 PM
@setevoy you can use a class with several method instead of global
 
@davidism According to the docs, it says not to share connections between threads, so I might just open a new connection for each query, and then close it when done, that way connections wont accumulate.
 
@XavierCombelle yep, seems good solution...
 
@Soviero if you spawn 50 threads and each one opens a connection, mysql will barf (at least in its default configuration)
 
@Soviero the problem is that connection is heavy
better use a connection pool
 
you definitely shouldn't share connections, but that doesn't completely solve the problem
 
3:43 PM
@XavierCombelle and... put to init code, which will return variable, which can be used other methods, correct?
 
@XavierCombelle What is a connection pool? Are there docs for it?
 
I mean - now I have at the script begin next:

# check if pid-file present
try:
# read PID from it
java_pid = open(pidfile, 'r').read().rstrip('\n')
# save PID to be sure we monitor same Java application
report_data.append(java_pid)
except IOError as e:
print('ERROR: %s' % e)
sys.exit(1)
 
cbg
 
models.py should reside as a sibling to manage.py file or as sibling to wsgi.py file?
 
3:45 PM
@Soviero using SQLAlchemy normally means you don't even need to worry about the pool, it's all handled for you.
neither, it should be in an app package if you're talking about django
 
I found out I work for a fast growing company that hires sales representatives and marketing managers aggressively
 
but on a broader view, any module must be inside the overall python package
 
@davidism I would more than love to use SQLAlchemy, but I have to integrate with an existing DB and application. I feel like the path of least resistance is to just write and run the queries manually.
 
cbg @sevenforce
 
@setevoy if you could paste your old bash script and your current python script on dpaste.de I could help you maybe
 
3:48 PM
Anyone knows if there is an equivalent to the cmd module in other languages?
 
@RobertGrant ^
 
What do you call a guy that decides what fonts get used in a product, that kind of thing?
 
@XavierCombelle there are no old bash script - it was started in Python :-) thanks, but I really better will go home now (7 pm in Kiev); may be tomorrow :-) thanks again
 
I don't have a door label. I figure giving myself that title in comic sans should work.
 
3:49 PM
hey, anyone using flask wanna tell me what they think of a flask extension? It's really simple
 
@sevenforce there probably is but (a) do you want us to just name off every language in existence and (b) this is the python room
 
@sevenforce You're asking on the wrong room. You want the Other Languages room.
 
Wow. You sent someone to the Lounge? Sadist.
 
Um. No I didn't...
*looks sideways*
 
aww, why'd you change it :)
 
Fake
 
DSM
Up until a few minutes ago I didn't even know there was a cmd module.
 
Yeah definitely. I photoshopped it. You can tell by the jagged edges. You've caught me.
 
DSM
Hey, gmail now has links for github issues & prs. Huh.
 
I noticed that, it's pretty cool
 
3:59 PM
My thought was that non-Python people won't know the cmd module. And when searched online I only found CLI parser (like argparse)
 
with the inspector in sqlalchemy, is it possible to retrieve the models as objects instead of just their string names?
 
@corvid you mean get a model class from its name?
 
@davidism yes, exactly. I have all the table names, but want their Model objects
 
oh, table names are different than model names
I don't know that one off the top of my head
 
4:06 PM
is the inspector the wrong tool for the job?
 
yeah, that's more for objects you already have
there's some internal map which will get you the table names mapped to tables, then you have to get the mapper for the table, then the class for the mapper, and hope that the mapping is 1 table to 1 class
 
in the dir there is a db.Mapper object, but its dir seems to be harder to decypher
 
you can start with db.metadata.tables['my_table_name']
that gets the table by name
 
okay cool. Although, this is throwing me off in a general python sense... if a class contains a class, and you want to subclass the class it contains, how does that work? Eg:
from flask.ext.sqlalchemy import SQLAlchemy
class ColorizedSQLAlchemy(SQLAlchemy):
  class Model():  # will this modify the "model" class within SQLAlchemy? Is it already subclassed?
 
ColorizedSQLAlchemy.Model is not a subclass, it just happens to belong to another classe's namespace.
 
4:18 PM
@corvid class SubClass(ColorizedSQLAlchemy.Model)
would subclass ColorizedSQLAlchemy.Model
forgive me if I've misunderstood the question
 
DSM
@davidism: well, let's give the guy a minute to see if he understood your last comment. Otherwise if he fixes it we'll have to reopen.
(Or maybe not on typo grounds..)
 
if he fixes it, it's still a typo..
 
@davidism is right
 
numberOne = 9
numberTwo = 1
 
4:26 PM
One One was a race horse. Two Two was one too. One One won one race, two two won one too!
 
DSM
Captured, just in case; that's impressive.
 
@JonClements Found you... Yay :-)
 
@Kevin I really enjoy your collection ;)
you should definitely create a Gist or something to collect these gems ;)
Daily Amusing Variable Names (DAVN -- sounds good to me;))
 
start a wiki page, the "amusing questions and answers" list
except think of a better name, like listFive
 
You know what's bad? Supporting legacy software. Do you know what's worse? Supporting legacy software that you wrote a decade ago. And worse than that? The constant reminder that you are, in fact, an idiot for writing such code.
 
4:30 PM
@IntrepidBrit sweet youth, right? ;)
 
I think an "official" collection would embarrass the contributors, though. I'm fine with just posting them in chat since it's more of a "hey isn't this funny, ok moving on" context
 
@davidism but sometimes both Q&A are TL;DR => I just need the joke part ;)
 
How does unittest force setUp() and tearDown() to run around each test? I was to do something similar with my own functions. (Run a function before and after I mean.)
 
@davidism Or "People ask silly questions. You won't BELIEVE what happens next..."
 
@Kevin it would be anonymous => just the var names (and their values ofc) without context
 
4:32 PM
If you want to laugh at people's code, there's a Reddit for that.
 
@PeterVaro Something like that
 
@IntrepidBrit :D:D:D
 
DSM
I thoroughly disapprove of mocking other people's code. We should all be compassionate and laugh only in the privacy of our own minds. #enlightenedselfinterest
 
I try to mock lightly, because I know that I've written mockable code in the past.
mock not, lest ye be mocked.
 
mock not, lest you be unit tested.
 
DSM
4:35 PM
I've spent the last fifteen minutes undoing an enormous amount of code duplication because I thought something would only ever have two datasets and now it has three, soon to be four. If I'd posted it on SO it would've been voted down to -10.
 
@DSM I think you misunderstood me.. but if I have to defend this idea so hard => it is a bad idea in the first place
let's move on to the next topic ;)
 
TV chat time. I finished Parks and Recreation this week, and I strongly recommend it.
Season one is a bit rough, but overall it's one of the best comedies I've seen this year.
I think I put it right below Arrested Development on the "smart comedy" scale
 
umm.. if you recommend it, I really should try it, although I'm still not a huge fan of comedies..
anywho, here is a negative recommendation: do not ever watch the Extant
it had a so freaking good pilot, with a nice second episode..
 
DSM
I like Parks & Rec well-enough, but my problem is that I like a Ron & April supercut almost as much..
 
but the whole season was terrible..
 
4:40 PM
My friend has commanded me to watch Knights of Sidonia next. Looks like it's some kind of action/adventure in space. Quite a tone shift from a comedy about a government office.
 
@PeterVaro Oh man. Don't say that, I just suffered through episode 4
 
@IntrepidBrit all the left 9 episode will be the same as the fourth one
it had so much potential..
 
@corvid as far as I can tell, there's no direct way to go from tablename > table > mapper > class, you just have to scan through all the mapped classes until you find one with the right table
 
@PeterVaro Ah bugger. Now to continue watching it.... or not ...
 
well, if you have nothing else to do..
 
4:43 PM
Watching shows takes too much time, let's just read the Wikipedia synopsis instead.
 
@Kevin don't even mention that crime!
 
Actually, one of you should read the synopsis, and then give me the synopsis of the synopsis.
 
but at least the South Park S18E01 was fun ;)
 
If I don't like the show, I'll read the wikipedia page just so I know what other people are talking about
 
@Kevin The synopsis of which show?
 
4:45 PM
can someone else please cv this, I can't take it anymore. He just added a random indentation and told me it didn't work
 
ahh @Kevin did I mention to you: if you liked Sin City (1) then do yourself a favor and don't watch the second one?
 
@davidism It just won't die
 
@davidism done.
 
rbrb guys... See you tomorrow...
 
@IntrepidBrit have you tried Intruders?
rhubarb(@thefourtheye)
 
DSM
4:46 PM
rhubarb!
 
I did like Sin City, although I was annoyed by the serial killer / cannibal who shares my name, and has a moderate physical resemblance...
 
@PeterVaro Plenty of programs to watch, few with merit...
 
I didn't even know a second one came out.
 
@PeterVaro Nope
 
@Kevin I just watched it in the last few days.. it's pretty new IIRC
@IntrepidBrit I'm unable to recommend it: I still don't know if this is a huge bluff or a nice show -- I know I already told this one.. but it was the sixth episode that went down the other day and I still have no idea where this show is heading..
 
4:50 PM
The new season of Avatar is beginning soon. This week or next week, I forget.
 
(I have a very strong feeling that it will be a bluff, a real bs without any meaning.. but we'll see)
 
@PeterVaro Both good and bad...
 
@Kevin I did not watch the Kora's series only the previous avatar's adventures (I forgot his name)
worth continuing?
 
It's not quite as strong as the original series, but it's still a solid pick for lovers of adventure and martial arts
 
you did not convince me at all :P
^ according to this one, I'm really not at my place..
 
4:58 PM
What if I love it and I'm paid for it, but I'm not great at it and the world doesn't need it? I feel like that some days. I'm not even on the graph.
 
@Kevin that is in the graph, it just doesn't have a name.. we should call it Kevin-State
 
DSM
Oh, wow. I'd hardcoded magic indices depending on a very particular and undocumenting ordering.
 
@Kevin aaaah.. sorry.. that's not on it.. yes..
I guess I'm getting tired for today..
 
You just need to make the venn 3D. Sorted
 
Four set Venn diagrams exist, but it's not quite so symmetrical and aesthetically pleasing.
 
5:01 PM
And then come up with funky names for each crossover zone...
 
@Kevin <thumbs up/>
 
Yeah a 3d representation would be symmetrical and nice.
Just stick four spheres on the vertices of a tetrahedron.
 
umm.. I think we are missing the point of the diagram :P
 
My Purpose is to argue about charts.
 
5:06 PM
Technically I think that's your Passion.
 
say something about this one.. baaahahhahahaha..
 
@IntrepidBrit love it + great at it + the worlds need it = Why are you working for free?! love it + worlds needs it + paid for it = Get better already.. love it + great at it + paid for it = Good job.
2nd is also called “I have no idea what I’m doing”, accompanied by a picture of a dog sitting in front of a computer.
 
@poke I hope that picture includes a cute yellow puppy :)
 
Depends on where you see yourself in that diagram :P
 
super imposed on the top?
"awww... look at the puppy - what's that underneath...?"
@poke did you notice we have a new kick-mute thingy?
@davidism There were!
 
5:15 PM
(argh! I've got to stop closing the tab accidentally when I mass cull pages)
 
@IntrepidBrit I do that, and then think "seems quiet in chat today"
oh beep closed the wrong tab :)
 
@PeterVaro Wayne Pickette should really *improve his handwriting
PickeTTe? What is that madness :P, you shouldn't be joining up the e to the T like that..
 
cbg again
 
@Ffisegydd recbg
 
5:35 PM
Cabbage all!
@Ffisegydd, do you still have that link for that LaTeX thesis? I want to take a look at it and see how you do the file splitting c:
 
DSM
Something which was taking ten minutes now takes six seconds, and it's not because I'm now being clever. :-/
 
@Ffisegydd Ignore that, found a good tutorial c:
@DSM Tell me more, tell me more, did you find a good fix? (Uh hu, uh hu, hu hu, uh hu)
 
how can you confirm that something in a dir is a class?
 
DSM
@Iplodman: I just forgot how slow pure Python can be. One non-numpy inner loop.
 
5:49 PM
@DSM Psh, silly Python.
 
user559633
oh python, my favorite pseudo programming language
 
@tristan flag as offensive, python isn't a pseudo language >:-(
 
user559633
ur a pseudo language
 
user559633
/me folds arms
 
DSM
It's a pseudocode language!
 
5:52 PM
It's not :( You're lying....
*runs off and cries*
 
Breaking news
85% off Paradox games on steam
 
github changed their code highlight colors and it's throwing me off
 
Gah, LaTeX is bugging me. I can't fugure out why a file I'm including isn't printing.
 
2 days ago, by Ffisegydd
https://www.dropbox.com/sh/kmcqgrnvnkafsn0/AAA-Ysf87rJvGG1Pm97dpWNHa?dl=0 there's the link to part of my thesis. It only has the theory chapter included but you should be able to have a look.
 
Thanks, sorry to bother you :P
 
6:03 PM
No problem dude, was cooking dinner which is why I didn't reply.
Let me know if you have any questions as it's pretty hench.
And that's an old copy.
 
Is there a way to emulate a hard drive with an SSD
speed wise
 
You want to slow your SSD down?
 
Yeah
Particularly stuff like seek times
 
Why?
(Out of curiosity)
 
Because I need to optimize for a hard drive, but don't have one
 
6:05 PM
First World problems, eh.
 
lol
 
Surely it's difficult to optimise for a HDD as they're all different?
 
True
 
Or is it optimising in a different way?
 
I imagine they're all more similar to each other than they are to a typical SSD though
 
6:07 PM
But are they so dissimilar that it's going to make a difference in optimisation?
(I don't know, just asking the semi-rhetorical question)
 
yield from cbg
 
Dunno, but since I'm doing IO bound work it seems naïve to optimize for the wrong thing
@AnttiHaapala cbg isn't iterable
 
iter('cbg')?
 
Then it loses all meaning
Here's a fun question
When is a list comprehension not a list comprehension?
 
6:09 PM
When it's ajar?
 
[(yield x) for x in range(10)]
 
I'm beginning to dislike posts that use the phrase "how do I go about...". Seems like what they really mean is "tell me how to do..."
Which is not inherently bad, but seems to appear more often in low quality posts
ah, yield inside a list comp. I remember recording that one in my dirty tricks file.
 
what's the point of that?
 
@Rawing Point?
Who said anything about that?
 
To hurt people's souls.
For the sheer malice of it.
 
6:11 PM
I see, I see
 
question: "how do I force [a user] to hit enter?" tempting answer: "put a gun to his head"... but I guess not PC enough for SO.
 
g = [(1,2),(2,4),(3,8),(4,16)]
print(list((None for g in g if (yield from g) and False)))
#result: [1, 2, 2, 4, 3, 8, 4, 16]
 
Why the heck would you force a user to do anything?
 
-1
Q: How to stop a user from hitting enter on a Python Command Line program?

Hunter WatkinsOkay, so basically I'm writing an interactive Python program. Initially I will ask the user to enter their name, but even if they don't enter anything and just press enter, the program will still continue. How do I force them to hit enter?

 
@Kevin Time to advertize PEP 448
 
6:13 PM
Wow
 
I love chickpeas.
 
@Ffisegydd You are wrong
 
In what way now?
In my love of chickpeas?
 
Nobody loves chickpeas, ergo you do not
I can only believe you are a liar
 
How do you stand on lentils?
 
6:15 PM
Loving chickpeas is not on the "approved viewpoints" list, citizen.
 
(inb4: "with my feet")
 
Standby for mandatory voluntary cavity search.
 
Are you tempting fate, @Ffisegydd? Because that's how you tempt fate
 
It's very good. I'm eating it now.
 
Nobody loves chickpeas. Ffisegydd loves chickpeas. Ffifsegydd is nobody?
 
6:18 PM
;_;
 
@Ffisegydd Why would \input{chapters/prelude.tex} raise an undefined control sequence error, where the contents of prelude.tex is \chapter{A Prelude to The Good(ish) Bit}?
 
Any relation to the Greek hero Nobody, who blinded the cyclops? You've got quite a lineage :-)
 
@Iplodman is your error on the line before it possibly?
What's your directory structure as well?
 
@Ffisegydd Nope, there's nothing on the line before \chapter{}
It's along the lines of:
 
No I mean on the line before \input
If you had an open brace or something maybe?
Oh wait
Your question mark is outside the brace.
You should have \chapter{A Prelude to The Good(ish) Bit?}
 
6:21 PM
Noo, that question mark isn't part of the code.
 
unless the question mark was ending the question
 
Ah ok :P
 
what's the document class?
 
Is there any nice way to show a file structure?
@isedev Article.
Oh, I see my problem.
 
there you go
 
6:22 PM
xD
 
Ah. I don't believe articles support Chapters.
Try report
 
Sure.
 
You could use book but that has the issue with the blank pages that you didn't like.
I'm using report for my thesis.
 
Ah, yes! Thanks @Ffisegydd and @isedev! C:
 
6:23 PM
question about style/proper method: Suppose I have a Python package named parser and its parent class is named Parser, do I create a file parser.py to house the parent class and separate files for the child classes, or should I put the parent class in the __init__.py file?
 
I'd say opinions vary
 
Yeah. I would make the parser.py file.
 
I'm leaning towards making a parser.py file
 
ok, two votes for separate file
Thanks!
 
It's not a very big deal to me, though
 
6:25 PM
2 votes out of 2!
That's consensus!
 
I don't expect users of the package to care about the structure, since the public interface is the same.
 
1 message moved to Trash can
 
But if I was publishing my code as an open source project or something, I'd want things to be nicely separated.
 
cough
 
NOTHING HAPPENED
 
6:26 PM
I've been c--s-red !
 
stay calm!
 
I'm only coming through in waves
 
isedev has been added to the "double secret probation" users list
oops, that wasn't supposed to be publicly announced...
 
I wonder if there's some secret Resistance that fights the will of the Dark Council?
 
oh, no, the italics are out for me
 
6:28 PM
They're just waiting for their opportunity to strike and take over sopython.
 
On the off chance that there is a secret resistance: we know exactly who you are, where you live, and what your weakness is.
 
The secret resistance is actually about 95% double agents.
 
user559633
I'm a triple agent.
 
6:30 PM
yeah, double secret probation agents
 
is for hire by all sides.
 
Surprisingly, all their attempts to backstab one another basically cancel out, producing a formidable group that gets stuff done against all odds.
 
Just make sure to pay more than the other party or parties.
 
user559633
good lord is the manpage format awful
 
omg it works
 
user559633
6:31 PM
yeah it works, but it's ugly
 
nope, it is very pretty
 
user559633
:]
 
that is I program a USB gamepad with LCD (Logitech G13), with Python.
the only annoying thing is calling IOCTLs
the ioctl number is calculated by a macro
def HIDIOCSFEATURE(n):
    return 0xC0004806 + (n << 16)
I needed to use gcc -E to find out the code bc it was so messy
Then:

    def set_rgb(self, r, g, b):
        fcntl.ioctl(self.driver_fd, HIDIOCSFEATURE(5), bytearray([7, r, g, b, 0]))
 
m4 script.py | python :)
scary thought
 
@isedev ? :D not that kind of macro
meaning in C header files
 
6:36 PM
isn't ":)" a forbidden perl syntax?
 
oh dear, I'm not paranoid, the whole world is out to get me tonight
 
user559633
aint no smiling in perl
 
":)" is even valid python ;)
 
And CSS
 
question; do schools usually teach hardware before teaching something like java?
 
6:40 PM
Mine did
 
painful... java didn't exist when I was at school
 
My school didn't teach me Java but it did teach me hardware (before teaching Pascal)
 
there are schools which do actual teachings? Oo
 
I am teacher's assistant in a class, students seem really lost because the intro compsci class is teaching things like hardware design (gates, etc) before even starting a programming language. What do?
 
6:42 PM
This class creates a dictionary and then iterates over it to assign it to another self.dictionary (self.pool) - is there any advantage to doing it this way vs. just adding self. before the initial declared dictionary (irregular_forms)? (lines 141-161)
 
oh the days of Pascal and Modula-2
 
@majnemɪzdæn if you just assigned the initial dict, it could be changed by other operations later, as opposed to copying the dict to an internal one.
 
what's again the name of titanias husband? that was programming ...
 
@davidism ahh ok, thanks
 
@IntrepidBrit :):):)
 
6:48 PM
@majnemɪzdæn nope, that is bad
@majnemɪzdæn furthermore the silly data is inside the method which makes it double bad (you cannot patch it easily)
 
@AnttiHaapala I can't tell, are you for or against copying mutable arguments?
 
@Jon did you email that df?
 
@davidism I mean, ofc the argument should be copied,
but the initial value should be changeable too...
and the choice of dict is rather stupid (why is it not a list of tuples).
 
oh, I hadn't actually looked at the linked code, now you make sense :]
 

« first day (1447 days earlier)      last day (3518 days later) »