« first day (1790 days earlier)      last day (3383 days later) » 

15:00
Sounds about right.
has asked 220 questions
Now they're saying they can't rename their variables. I assume because they have 100s of hard coded variables everywhere and are to lazy to rewrite their terrible code.
<blind> abandon post </blink>
@vaultah recently they're all in meteor though, which isn't very established as a framework
@Kevin Good point - blind people probably do blink
15:01
@Morgan they can't rename the variables because the stack is currently being executed, he's used a debugger and a stop point but he needs to fix it before he restarts his code ;_;
I'm giving them one more chance to explain. If it's stupid, I'm just abandoning it.
Aaaand yup, they already wrote too much code, so they don't want to rewrite.
College did just start...print('Hello world') may take too long to rewrite
gruntle += 1
Times I have said "why am I even bothering?" today: 4
Wait, now they're only going to rewrite it if I admit that Perl is better than Python. Today is going to be fun, I can feel it already.
15:09
Link? lol
"i will rewrite it, if you can just say that what i need cannot be done in python". Uh, did he not read any of the other answers? exec can do this, it's just a bad idea.
I wonder how he's written his code such that he can't just find/replace b_101 with scores[101] using a text editor
i will rewrite it, if you can just say that what i need cannot be done in python because in perl, it can be done. — user3388005 4 mins ago
@Kevin Notepad.
What's the canonical "I have a lot of things and want to choose one of them based on input, and don't want to use a ton of if statements"?
Where the answer is "use a dict and look up the thing based on the input"
But even notepad has literal find/replace, and I'm assuming he hasn't yet expanded his five level program into a hundred level one.
@davidism We haven't got one, AFAIK
We really should.
15:14
@davidism What do you mean by that? Like take an input("What's your name?") and looking up based on that?
@corvid For example, "how do I shorten this code?"
response = raw_input("Enter a command. ")
if response == "open file":
    open_file()
if response == "launch missiles":
    launch_missiles()
if response == "release the hounds":
    release_hounds()
Or the question I just linked.
If anyone can find a dupe, please close this: stackoverflow.com/q/32505188/400617
In which case the answer is
funcs = {"open file": open_file, "launch missiles": launch_missiles, "release the hounds": release_hounds}
response = raw_input("Enter a command. ")
if response in funcs:
    funcs[response]()
@MorganThrapp whoa, I didn't even notice, I was talking about another question :-)
15:16
@Kevin Mr Burns doesn't write code. But if he did, it would probably do all that.
Also needs dogs_with_bees_in_their_mouths_and_when_they_bark_they_shoot_bees_at_you
Kevin, wow, that's 5 characters shorter. :P
Add in the elifs instead of ifs and it's 9 shorter
user559633
No close file or gather the hounds?
user559633
I bet Kevin is the kind of guy that thinks cars are single use too
15:22
Switch to Python 3 and you save 4 more characters.
@tristan that's easy: funcs['smithers'] = smithers
Multimethods?
I'm about to write a gratuitously ugly list comp for stackoverflow.com/questions/32505589/… and make Morgan mad.
@Kevin Why will that make me mad? I was half planning on doing that myself. :P
Hm. I can't figure out a good way to do this. I have multiple clients consuming an "api" (not really but close enough), and I want to distribute different information to each of them. How do you save what the clients are?
15:27
It's going to do the "generating a list full of Nones just to take advantage of side effects" thing that I did as a joke yesterday
Ah, tobias' answer is better. I'll just not bother.
user559633
@corvid What do you mean by save what the clients are? Is it over HTTP? How are you telling the difference? User agent? IP? Username? Omniscience?
@tristan Therein lies the problem, it's over DDP and I can't find any reliable data to identify one client consistently other than their address (which seems bad).
user559633
ddp being the meteor thing in javascript.
user559633
have your frontend give you more information
I hate asking a question I know no one will have an answer for lol
15:32
Doing so can still have value, if asking the question forces you to get a better understanding of the problem.
Many times I have begun drafting a question, and found the answer in the process of creating an MCVE or researching related terminology
Yeah it did help me think more, but I've been staring at this problem for hours, so I don't think it helps in that case.
But yeah, if you get to the point where the question is ready to go, and you're still lost, that's not a great feeling
DSM
DSM
Temporary cabbage.
as opposed to permanent?
user559633
15:34
@Programmer We sometimes use a prefix/suffix to 'cabbage/hello' to denote more information inline
user559633
e.g. "morning pint cabbage" or "they will never find the body cabbage"
The only permanent cabbage is the one that resides in our hearts
The more you know
user559633
tmykaaaay
DSM
DSM
Favourite davidism quote ever: "We have all eaten from the cabbage of friendship."
15:36
What's left of that cabbage?
I prefer to eat the sauerkraut of hatred.
user559633
I prefer to drink from the skulls of my enemies
DSM
DSM
@Programmer: not enough to give any to Morgan or tristan, apparently.
user559633
@corvid do you use a finger guard when archer-ing?
@tristan If I am doing it for more than an hour yeah, or else it gets kinda uncomfortable
user559633
15:43
Do you do a glove for one of the finger-only guards? I tried a plastic finger guard and found it wrecked my accuracy
user559633
typically my fingers are blistered/wrecked before I'm actually tired so I'm looking for a setup that works for me
@tristan In principle, me too, but in practice the liquid runs out of the eye holes.
Yeah gloves ruin accuracy, finger tabs (the ones that are basically a leather flap, no plastic in the middle) usually make you less accurate, but not much less accurate so they're usually more favored
waits to see if anyone notices the reference
user559633
@Kevin i'm so thirsty :(
15:45
B-)
user559633
@corvid yeah, i was using a plastic finger tab and it wasn't great. maybe i'll try a leather one. cheers :)
user559633
or maybe i should just deal with it and keep going until the tips of my finger are like horse leather
If you play guitar and do archery, imagine how calloused your fingers would be
Add years of emacs on top of that.
user559633
@corvid do you shoot from the shelf? (iirc, you're a recurve man as well)
15:51
Mfw...I think I know what's wrong but I have no clue why this is happening in the first place. I love programming!
Nah, have a little notch, last time I shot from the shelf I destroyed the wood (pretty cheap bow). Do you?
user559633
Yeah, I shoot off the shelf -- trying to keep as trad as possible
Thanks everyone for all the solutions....i think, continuing with my if else logic is best for me... — user3388005 52 secs ago
Jk back to the drawing board
15:52
I will not murder OP. I will not murder OP. I will not murder OP.
user559633
I'm considering switching to a notch or something though -- I'm assuming it will help my accuracy
morgan maybe he's just really dedicated
That's the video where the guy looks really silly while firing arrows really fast? I'm pretty sure there was some Reddit thread where a bunch of archers basically tore it to pieces.
user559633
@AaronHall He's still a decent enough shot and he's having fun
@tristan I feel like when people do that, there's always a new level of traditional you can take it to. Like one time I saw someone shooting a traditional Japanese bow (made from a single sapling, made before the technology of using multiple saplings to craft a bow)
user559633
15:55
@corvid Yeah, totally -- it's a stupid race to the bottom like being "close to the metal"
I don't really get compound bow shooting though, it feels like those are completely purpose built for accuracy and ease of use so they kinda take away the fun of it
user559633
Yeah -- compound is too far for me unless I was hunting for food. And if that's the case, I'll just use my gun
I try not to have very strong opinions on these matters. Every school of a specific martial art tends to mock the other schools. Those who practice mixed styles are more nuanced. :)
user559633
Eh, it's not really an opinion matter -- compound bows are more advanced and help you shoot projectiles more accurately and with more power behind the shot
DSM
DSM
15:59
Read a fascinating article about the Gracie jiu-jitsu clan the other day. Strange stories.
@AaronHall I don't think the criticism was from different schools of archery, but more on his general technique, research, and claimed results.
Primitive chat: reminds me of this video:
i saw that too kevin. was a cool video
Where a guy builds a hut using mud and a stone axe
user559633
Re: Lars Andersen -- I'd consider shooting from the right and he is quite skilled.
16:02
Most exciting part is when he makes his own kiln
Third face to face today... with our favored from the phone interviews. Wish me luck.
user559633
@AaronHall You're interviewing? Good luck mate
For additional impressiveness, it was filmed in Australia, so any of the wildlife you hear in the video could have killed him at any moment. Even the cute ones.
No! Especially the cute ones.
user559633
All I can think watching that video is "job's done"
Now he can hire four more workers.
user559633
heh
Apparently it took him a couple months to do, although ~20 days or so is reasonable if you have no other responsibilities
user559633
I'm just going to make a man cave. F making a man hut
I'm guessing that firing the tiles is the bottleneck. Clearly he should have made like five other kilns. Multiprocessing!
respectfully, i asked best way to reach my destination by bike and people answered that i should use car instead, bikes are not save :) and people you tried to answer to my question got downvotes. — user3388005 25 secs ago
I give up.
Some lessons can only be taught by experience.
DSM
DSM
16:12
Seems the reasonable thing to do at this point.
And by give up I mean link to X/Y problem.
DSM
DSM
The hilarious part to me is that the OP really wants to write b_{m}=current_score but b[m] = current_score is somehow completely beyond the pale.
Do we have a canonical dupe for asking for user input repeatedly python
I think the issue is that they already have b_101 in 20 different places.
@vaultah The one I flagged as dupe.
Nope, it's the int vs str problem
16:17
@vaultah Ohhh, oops.
DSM
DSM
Not that the user couldn't benefit from reading Kevin's QA.
4
Q: Python: Problem with raw_input reading a number

yoshyoshunfortunately raw_input is not doing what I need it to do. What I am trying to do is get totPrimes = whatever I type in at the prompt. If i replace while count < totPrimes with while count < 50 this script works. If I type 50 into the prompt, this script doesnt work, I'm afraid raw_input isn't th...

Does this return False in Python 3? u'\ufeff'.isspace()
16:22
@MorganThrapp Thanks. I guess the Wikipedia article's not totally clear that the BOM is related to whitespace but isn't technically a whitespace. In ref to this question: stackoverflow.com/q/32506708/4014959
anyone know how to pass variables into sftp from within bash? i'm trying to match filenames to a string
I feel disconcerted by the fact that in those primitive tech videos he never speaks.
that string being assigned to a variable
@simplycoding You know this is the Python room, right? Not bash?
yeah I know
DSM
DSM
16:25
".. but I'm having a stroke right now and so my decision-making is impaired"?
(It's a stretch, I grant.)
More seriously, has anyone ever spent time on the SU chats? They probably live for this stuff.
@simplycoding so maybe you shouldn't be asking bash questions in here.
@simplycoding You could ask over at U&L...
-- Big Mac and large fries, please -- It's a library! -- Ah, sorry (whispers) Big Mac and large fries.
3
If you are looking for a Python library for SFTP, use Paramiko.
@bereal That applies to too many questions on SO. :)
16:29
oooooo... a bigmac....
@JRichardSnape He has to develop a new language from first principles before he can speak
@Kevin :) And he can't even read any chomsky, I suppose
DSM
DSM
Awww, I was thinking of making a universal grammar joke!
@tristan Well I interviewed a candidate, and part of my job is to sell them on the job, as I see it. At least this guy made a decent educated guess on the diamond shaped mro, plus he was our favored from the phone interviews. So I hope I sold him too. I heard I sold the other guys.
Oh right, need to revisit that C3 thing before the next interview.
16:39
Yeah, the wikipedia article has a nice update to it.
Oh... got my 2nd 5* rating on PPH btw guys... \p/
DSM
DSM
Pineapples for the puppy. (Wait, can dogs eat pineapples? googles "Frozen pineapple can be a fun summer treat for your dog." Whew!)
exqueeze me? PPH?
Yeah... fancied some odds and sods work: pph.me/jonclements
Work blocked that for my security wipes brow that was a close one!
16:44
@DSM I think it's just the outside that isn't good for dogs (or perhaps anything for that matter)
Hm, 110E for 500 lines review, need to consider that...
as a business, I mean
Strange thing a pineapple, it's obviously evolved to have that exterior to exclude being eaten by some things, but makes the ones that can eat it, think - "oh - what's that trying to hide - let's see..."
@bereal ?
@JonClements nice idea, I mean, will perhaps create an account, too.
I'm pretty good at code review. Annoyingly good.
Kind of the opposite of a Kiwi. It's pretty harmless, but everything about it (covered in fuzz, slimey and green, seeds look like cockroach poop) makes you not want to eat it.
Well, only had two enquiries via that which weren't related to it anyway - so wouldn't get your hopes up. Also, it's just something I made up on the spot to just have something there anyway
@QuestionC not sure I've ever been tempted to eat someone from New Zealand...
also fairly sure, they'd take me to the vet and put me down if I tried...
16:51
@JonClements To anything with a nose it's pretty obvious that there's something yummy inside a ripe pineapple. :)
Pineapples don't grow too well here, it's just a little bit too far south of the tropics. We have a dozen or so plants, but we don't get much fruit from them. And when they do fruit we have to make sure we harvest them before the possums decide to have go.
kill the possums, and eat them with a pineapple sauce... problem solved :p
Hey guys, for anyone who knows a bit of wxpython, is using the scrolling panel a bad idea if it's deprecated as the following error arises? :-deviceDeltaX is deprecated for NSScrollWheel. Please use -scrollingDeltaX. I've sometimes used deprecated code just for legacy and I'm not sure if that's a good idea in this case
I've also done some googling prior, couldn't find anything regarding that warning
They're protected. And not easy to catch. Or to keep them from take up residence in the roof space during winter...
Although the year we had a diamond python in the yard the possums weren't so keen to visit...
user559633
@AaronHall Ah, cool.
For writing out a basic XML file, do I NEED lxml? Or can I get by with just the builtin XML lib?
17:02
what is this? unprotected private key file, says 0644 is improper permissions... what are the right permissions? 700?
an unprotected private key file
0644 says it's readable and writeable by the owner, and readable by users in the file's group, and readable by others. So 0600 is probably worth trying. 0700 would also set the executable bit, and you probably don't need that.
Looks like 0500 works
@OneRaynyDay Is it an error that stops the program, or is it just a warning message?
@PM2Ring ah it's just a warning message
But I'm afraid maybe since they stopped supporting it that it might be doing something really bad in the back (hoping it's not a memory leak or anything)
I see some memory leak-sounding warnings though
like "20 instances of the Scrollable has been instantiated... blah blah"
when really I have about 10 scrollable panels in my GUI.
I'm not sure if that's my fault or from the warning.
17:11
@OneRaynyDay Better check your code to make sure you aren't accidentally creating hidden duplicates. :)
@PM2Ring right! I definitely will. I'm in a bit of a rush so panicked code will always get into some trouble haha. I'll finish up the GUI and check where I'm screwing up. Definitely good advice though, thanks
What happens if you use the new syntax -scrollingDeltaX syntax on an old system? Does it raise an exception? If so, you could wrap the code in an appropriate try: except that falls back to the older syntax.
@PM2Ring right, but the thing is I wasn't sure what was causing it. I looked into the new wxpython documentation and browsed a bit
and found that it may be due to the wxScrolledPanel turning into wxScrolledWindow (for no apparent reason)
I'll try changing it and see if the error arises, if it does I shall wrap it in a try ^_^
ohhh, sorry that cv-pls is :c
still close-worthy though
17:20
@OneRaynyDay Ok. That might make things a bit more complicated. I should mention I know nothing about wxpython. :)
Who knew trying to make more than one table in a pdf could be so difficult
@PM2Ring haha it's no problem. I probably know even less than you to be honest
@vaultah I suppose it is: optimization questions are borderline on-topic at best. But it is an interesting problem... OTOH, if it's being used as an interview question maybe it's best that an easily findable solution on SO doesn't exist. :)
Windows is acting so inconsistently :|
Yeah, I agree with vaultah it's a tad off-topic, but he did have the algorithm tag
How would you guys solve that optimization problem? I'd probably use partial sums, but I'm not sure if that'll reduce the O(2^n) nature
17:29
I don't honestly understand what is being asked from him
DSM
DSM
I'd need to know whether contiguity of subsequences was required or not.
I think it's contiguous since he said subsequences
I've done some very basic USACO questions and whenever they mention subsequences it's assumed to be contiguous?
then again, you guys are much more experienced than I am so I might be wrong on that
17:49
rbrb all
18:02
When your manager wants you to rewrite your program because he changed his mind about the specs: facebook.com/ABC7/videos/10153076142397452
does anyone have a simple way to parse netstat? I'm using -abno options
the reason i ask is that I'm getting this strange output only in my python return, not in netstat itself: ['[System]']
oh wow there's a library for it. my life is complete
DSM
DSM
I've used psutil.net_connections in the past, but I don't know enough about netstat output to know what you might need that psutil doesn't offer.
I used subprocess.Popen then read the output through process.stdout
DSM
DSM
I voted unclear, because I don't know what about the intersection he's interested in.
18:44
Fair enough. But even if the question were more clear it'd still be too broad. :)
user559633
is bytearray the correct type for storing chunks of binary data? or am i looking at some buffer type?
bytearray is ok for storing bytes. Or you might want to use the immutable equivalent, bytes.
user559633
Cheers -- was curious due to a question I thought i'd try to answer. Is the appropriate way to work with a buffer appending or is it struct.pack_into?
19:02
Hello, everybody
Has someone experience with django? the django room is empty :(
user559633
@jhrs21 Just ask.
I am working with the django admin, I'm overriding the save method of an object. I want to check some conditions before saving, and I don't know how to raise an error. My object inherits from admin.ModelAdmin
I added the error with the method add_error(field, message)
you raise exceptions in python. You should look into Exceptions more
but I want to return to the form and show the message that I added
@tristan The code in your answer looks fine to me, since you're just working with byte streams. struct.pack/ struct.pack_into is useful when you need to package multi-byte integers into a block of bytes and you have to ensure that the byte ordering of those components is correct. Disclaimer: My Python 3 knowledge is limited. But I have used struct.pack & unpack to communicalete with C DLLs.
user559633
19:09
@PM2Ring ah cheers -- so pack/pack_info when going from non bytes into bytes
Yep.
user559633
Same on Python 3 byte information -- haven't used it really on these kinds of things
FWIW, here's an example of using pack to make sine wave data for a WAV file:
#Make wave, convert floats to bytes in Little Endian, and pack into strings
return n, [pack('<h', int(0.5 + volume * sin(i * a))) for i in xrange(n)]
can someone explain why whenever I try to enter a line of code that is an equation or formula, I get invalid syntax? Because I don't think there's anything wrong with the forumla lines. It seems like a float type problem
user559633
it's cool to see the information presented that way
19:14
like this line.... alpha = (6**0.5) * ((float(STDDEV))/(float(math.pi()))
or u = AVERAGE - 0.5772*alpha
or u = (float(AVERAGE)) - (float(0.5772)*float(alpha))
@AF2k15 Well, in that case you're missing a closing paren.
I am?
If it's a SyntaxError, it means that you have a Syntax Error. As in, your Syntax is wrong.
oh with alpha, yes
Sometimes it's just the simple things :^)
user559633
19:16
I really want garlic truffle fries for dinner. With extra garlic
i get invalid syntax even with the closing paranthesis
I do love me some garlic knots.
user559633
Only time garlic can do you wrong is with a SO being repulsed by you.
user559633
i want to buy an apartment in the center of those fries and just live there forever
19:17
@Programmer I don't have that issue. My SO loves garlic more than I do.
so If I got all my P's and Q's crossed as far as parentheses and convert everything to float are there other things I should be worried about?
You know you're lonely when you think of Stack Overflow when someone says SO.
That's what we were talking about, right?
user559633
I'm not lonely and my brain still kept shouting STACKOVERFLOW HE MEANT STACKOVERFLOW when I read SO
haha true
19:20
what does 'float object is not callable' here mean?
alpha = (6**0.5) * ((float(STDDEV))/(float(math.pi())))
I was so confused when I read that... it took me so long to realize LOL
wait I have a better question
float(0.5772) is redundant because 0.5772 is already a float. math.pi() is wrong because math.pi is a float, not a function, so you can't call it.
"There is an operator missing, likely a *:

-3.7 need_something_here (prof[x])
The "is not callable" occurs because the parenthesis -- and lack of operator which would have switched the parenthesis into precedence operators -- make Python try to call the result of -3.7 (a float) as a function, which is not allowed."
ic
thanks
19:22
No worries.
If I have a similar formula for STDDEV in a prior line of code, and STDDEV doesn't show up in my variable explorer, but the line doesn't raise an error, what does it mean?
b/c this is probably also why float object is not callable
BTW, all upper case in Python (and many other languages) is conventionally used for constants, so unless STDDEV is a constant it's confusing to give it an all upper case name.
@AF2k15 why don't you try and print that value?
ic, it just helps me keep track of important variables
Air
Air
I didn't tinker with my obfuscated/joke script for a week and now I can't remember what I was smoking when I wrote this part that obviously doesn't work and the version that was runnable has expired from dpaste #fwp
19:24
the weird thing is the value prints correctly, but it still doesn't show up in my variable explorer
important variables =/= constants
If it prints correctly I don't think it should be a problem? I don't use a python IDE that has debugging, but on eclipse there are many times when a variable doesn't show up just because it's incompetent at times
Does your variable explorer show other constants, or only variables...
if you write important variables in that format you'll get confused eventually... You should just have a special case format for important variables
I use the hiccup case, iMpOrTaNt_VaRiAbLe
it shows iterators, lists and couting variables, but that's about it
my average, standard deviation, and other coefficients either don't show up or raise float error
or invalid syntax
19:27
surely theres a simpler conditional than:
if char =='a' or char=='b':
@tristan It always confuses me when we actually talk about real garlic in this room
@Programmer if char in 'ab'
well lets say theyre strings not characters
although that permits a few more things
Python doesn't have a 'character' type
so they're all strings
user559633
yes, real garlic. @Kevin
19:28
@programmer if char in ("a", "b"), if the string literals might be more than one character long
Yeah, sorry C messing with my head. Of course I can use in...
Note that "cat" in ("bat", "cat") is True, but "a" in ("bat", "cat") is False.
@tristan have you ever tried dunking bread in olive oil, balsamic vinegar, and garlic?
user559633
you know i have.
That's my favorite
19:31
and "cat" in "atticatlas" is True, and "cat" in ("attic", "atlas") is False
Thanks guys. I kept wanting to use || or 'or'
A few friends of mine were talking one day, "hey, I'm trying to learn python for a project. Any way to start? I'm fluent in java and C++", and the other said "write in pseudocode and you'll get most of the syntax correct"
I love how it reads like english if you write it well though.
Nobody saw that.
@Programmer but if it sounds like english I wouldn't look like a 1337 h4x0r: hackertyper.com
@MorganThrapp what the hell is that
19:39
Everyone loves Python's English-like syntax until they stay up until 3 AM trying to debug a == b or c or d
:D Lolssssss.

And I love Python's syntax, and 3 AM is normal bed hours. I've stayed up till 9 trying to debug though.
@MorganThrapp oh, simple
ohmygod it actually says hello world: %run "/Users/hongshuhong/Desktop/uw0tm8.py" Hello world!
19:52
@Kevin ... you havent had to do that i hope ...
No but people ask that question on SO every other day
When a Python file read blocks it doesn't chew up CPU cycles, does it? This guy appears to think that it does. But he is using Windows...
@OneRaynyDay I never would have thought it but as soon as I did AvErAge instead of AVERAGE, the variable showed up in my variable explorer and other formulas that call AvErAGe raised no float call error
DSM
DSM
The two which burned me in the past were list multiplication and the fact that numpy.any and numpy.all don't play well with generators.
that moment when you were just trolling but you helped someone
bows
@AF2k15 at your service
19:58
:)
Earlier today someone asked "why doesn't x == type("str") do what I want?"
Presumably he wanted the expression to be true only when x was a string.
It sort of makes sense if you parse it as an English sentence. "if x is a type of string..."

« first day (1790 days earlier)      last day (3383 days later) »