« first day (2055 days earlier)      last day (2894 days later) » 
00:00 - 15:0015:00 - 23:00

12:25 AM
We can still do the group picture..say, in a local brewery, like The Rogue.
 
Anyone know what does this means: -c <command>
Execute the Python code in command. command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code.

If this option is given, the first element of sys.argv will be "-c" and the current directory will be added to the start of sys.path (allowing modules in that directory to be imported as top level modules).
To "execute the python code in command" ?
 
user559633
pleases, don't link to the documentation you're reading. also, makes sense to me. what part are you confused about when trying to use it?
 
I don't understand what "Execute the Python code in command" is supposed to mean.
 
user559633
what happens if you type python code in that field?
 
user559633
e.g. import sys or print('hi')
 
12:34 AM
So it just executes the python code in the <command> spot? So python -c "print('hi')" would just execute that print statement?
So that's what the -c flag does in a nutshell. I don't know why I had trouble reading that.
Oh, I think because I thought when it said command it was referencing something else, I didn't think it was referencing <command"
<command>*
 
user559633
eh, documentation can be rough if you expect it to mean something else
 
user559633
uwsgi + flask users: is this the amount of detail that i should expect from a traceback that generates a 502?
https://gist.github.com/tristanfisher/e3f722790941abd518cc046dc97c4b98
 
The second part though, " command can be one or more statements separated by newlines, with significant leading whitespace as in normal module code." I tried to do python -c "print('hi')\nprint('Lol')" and it didn't work?
Actually just solved it. Someone had the same problem on a old question on SO
 
user559633
rbrb
 
1:26 AM
cbg
 
python is saying i don't have libswscale #error "libswscale is necessary to build the newer OpenCV ffmpeg wrapper"
anyone know how to install that
for mac
 
user559633
1:48 AM
@ThatProgrammerDude ffmpeg.org/libswscale.html ?
 
user559633
seems like maybe it will live with a ffmpeg install?
 
I tried to install ffmpeg and it installed correctly using brew, but i still get the same error.
i finally posted something about it on stack overflow, same issue for a week man
0
Q: I can't seem to install opencv2.4.13 for Python3.4 on Mac El Capitan

ThatProgrammerDudeThis has been driving me nuts. I have been working on this non stop for a week. I have looked at many tutorials online they did not help. I have tried so much I don't even remember what I tried. I can say the last thing I tried though.. which is this video https://www.youtube.com/watch?v=U49CVY8...

 
@ThatProgrammerDude have you tried out anaconda? it might suit your purposes. installing opencv should be as simple as conda install opencv.
 
Is there a quick easy way to install that? I have made many mistakes googling stuff, I want to actually install this right.
so continuum.io/downloads i can download the 3.5 version if i have python3.4?
 
@ThatProgrammerDude it's pretty painless. continuum.io/downloads#_macosx. the only thing you need to watch out for is adding it's location to your path variable in your .bashrc or .bash_profile. but i think that might set that for you automagically if you choose the option.
 
1:57 AM
Ok but can I download the 3.5 version if I have python 3.4?
 
@ThatProgrammerDude: yeah. you can have more than one. editing the path variable in your bashrc will determine which one is run when you issue python in the terminal.
 
I'm confused man, can you elaborate? You're saying I can download the 3.5 version of Anaconda for OS X if I have the default python for mac which is 2.7 and I installed python 3.4?
 
yeah. they are all separate. here's an example (1 sec)
in my .bash_profile i have, export PATH=/usr/local/bin:/usr/local/sbin:$PATH
in my case this just prepends locations for the programs the brew installs.
if i were to add anaconda to my system and wanted that to be the default python i use, it would be something like this (hold on)
 
So I just finished installing the 3.5 version of Anaconda for OS X..... Can I now execute the command conda install opencv in the terminal?
 
heres what happens during the anaconda install:docs.continuum.io/anaconda/install. and on that page you will see: export PATH="/home/username/anaconda/bin:$PATH". this makes the anaconda distribution of python the one that gets run when you call it in the terminal.
yeah give it a go. if you get command not recognized you need to add the path variable as i mentioned
 
2:13 AM
Well I did it and I got this and much more: Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ....
Solving package specifications: ....

The following specifications were found to be in conflict:
- alabaster (target=alabaster-0.7.7-py35_0.tar.bz2) -> python 2.6*|2.7*|3.3*|3.4*|3.5*
 
cbg
It's been a while
 
2:39 AM
@ThatProgrammerDude seems like this might be opencv not compatible with python3
 
2:51 AM
@ThatProgrammerDude: Try this conda update conda, conda create -n cv_env opencv, source activate cv_env, conda list (you should see opencv). at this point you would be able to play around with python and opencv as you wish. when you are finished source deactivate or just exit the terminal. but anytime you want to work with opencv you need to run source activate cv_env. this should work on anacondas python3
@ThatProgrammerDude the problem is that the default anaconda environment has lots of packages already installed and that's why the dependency errors. i did not test this with anaconda python3 as you have, but i checked this method on conda py2 and it works. best of luck!
 
3:15 AM
@wgwz All of that worked, but how do I play around with it? dumb question sorry!
 
 
1 hour later…
4:28 AM
i apologize for the incorrect code procedures, i received help on this code from my previous post here on stack overflow. — BC0148 May 4 at 21:53
lol
 
5:20 AM
Hey guys ... i am working with some basic regular expression stuffs in python and I need some help.
`Anyone out there?
 
Anyone know to run a python file using conda?
 
1
Q: Python comments Fail using """ or ''' in dictionary

YalyeI have used Python occasionally for several months, I know we can use # and """ or ''' to comment. But when i wanted to comment some items of a dictionary, with comment words ('''), i failed. testItems = { 'TestOne': { "NameId":101 "Score":99 }, ''' 'TestTwo': { "NameId":101 ...

 
6:03 AM
@IljaEverilä any reason you posted that here?
 
morning all
 
@MartijnPieters was trying to find a suitable duplicate, thought that someone might know one
 
@IljaEverilä ah, then do be explicit. Yes, I found a dupe. There are probably others, but that's one I remember because it was still fresh in my memory.
 
"Explicit is better than implicit", gotcha
 
@wgwz ... Dude. I solved my problem. The shit is working dude. THANKS FOR THE HELP BIG TIME! REALLY APPRECIATE IT. When you have time, let me know how you learned all of this without losing your mind. Anaconda is amazing.
 
6:23 AM
I'm currently writing a python wrapping for a browser that runs JavaScript, so that I can have access to javascript variables and methods through python.
for example, I will run a function called `find_element(selector)`
that will run `document.querySelector('div')` behind the scenes on the browser and return a python class that encapsulates javascript functions that allows me to use it like a regular python object.
If you know of someone who already did something similar or a reference to something I should read I would be very grateful. I don't even know the exact term to what I'm trying to write. I guess you can call it binding?
 
Have people ever decided to troll in this channel?
 
@ThatProgrammerDude Those that did did not last long.
 
6:38 AM
Anyone know how to detect an image inside of an image using pillow or cv?
This has to be done left to right though.
 
7:07 AM
@ThatProgrammerDude That's really out of scope for a Python chatroom. You're going to need to do most of this by yourself as it's pretty heavy going.
 
@Ffisegydd i started looking it up... i would think something as simple like this already has very simple ways to do it.
 
7:38 AM
@ThatProgrammerDude The fact that you think this is simple shows that you need to do some more reading.
 
@Ffisegydd why wouldn't it be simple
 
The math behind something like that can be quite involved.
It can be made to look "simple" by hiding all the complexity in a library, but that does not make it simple.
 
@ThatProgrammerDude Go do some reading, based on your comment of "Have people ever decided to troll in this channel?" earlier I'm not inclined to discuss it any further.
 
I meant simple because python is such a high level language.e
And the question I asked was serious.
 
That involves finding a specific, extracted image in a larger image. That's not what you asked.
Or at least, that's not what I understood.
Maybe you should be more explicit in asking for help.
 
7:50 AM
I am pretty sure "how to detect an image inside of an image" is the same as "specific, extracted image in a larger image"
That's why I said should be piece of cake. If the image was slightly different.. that's where the complexity is.
 
No it's not. "an image" could mean a significant amount of things.
For example, the first thing that I thought was "Oh they're trying to detect photos in images."
 
Read it like that too...
 
I guessed it was related to steganography :D
 
It's almost as if you were being unclear.
 
8:09 AM
hi all, cbe.

Someone help me with this understanding. Look at the PetB class declaration in the code below. I am aware that the first one, Pet, is inheritance. What is the other type of declaration, PetB called , or is it called anything at all ?

class Animal:
def __init__(self):
self.teeth_size = 'beeeg'
self.swims = True


>>> class Pet(Animal):
def __init__(self):
self.hates_cats = True


>>> class PetB:
def __init__(self):
self.animal = Animal()
self.hates_cats = True

then goes on to access PetB.animal.swims. Is the first better than the second or is it the other way round :
 
It's called nothing and it makes no sense, either.
 
Python allows this, right ? The former, Inheritance is surely the better way, is it ?
 
It does allow it, but it makes no sense.
 
I think it's called "composition"
In computer science, object composition (not to be confused with function composition) is a way to combine simple objects or data types into more complex ones. Compositions are a critical building block of many basic data structures, including the tagged union, the linked list, and the binary tree, as well as the object used in object-oriented programming. == Details == In a programming language, when objects are typed, types can often be divided into composite and noncomposite types, and composition can be regarded as a relationship between types: an object of a composite type (e.g. car) "has...
 
I should say that composition does make sense, just this particular example doesn't make sense.
 
8:14 AM
that's true
 
@Ffisegydd and @vaultah : Thank you.
 
Weirdly, I looked at the composition pattern at 2am sunday morning when my son wouldn't sleep
 
Would the Animal and its internal organs be a better example of composition ?
 
Possibly, yes. Or self.breed = Breed(type=..., etc)
 
Okay, rhubarb everyone.
 
8:39 AM
Antti forced me to join here
 
He forced us all to join
 
Can we do something? Stand up against his tiranny
 
We're The Haapala Family. He makes us go on missions for him.
 
Dry cleaning -like missions?
 
cbg
 
8:52 AM
Did I say cabbage yet?
cabbage! (?)
 
He preaches to us about Nokia and pho - sometimes both at the same time.
 
 
1 hour later…
10:07 AM
In the middle of a giant refactoring exercise here to try and remove dependency hell. Not fun, but hoping it will lead to greater development velocity.
But I'd like to speak up on @AnttiHaapala's behalf. He didn't force me to join, and I am definitely NOT ant-Antti
 
cabbage
@TimCastelijns took me a while to realize that I haven't seen you here:)
 
user559633
cbg all
 
hey @tristan
@ThatProgrammerDude if the question is still on, and I understood your question, then the answer is "template matching"
that should suffice for your googling
 
10:31 AM
@Andras Yeah I found out a while ago.
 
@AndrasDeak Why would you expect to see me here? :p
 
10:47 AM
> Also it is generally good idea to name variable starting from lowercase and classes starting with uppercase so the variable name should rather be menuChoice
^ from the deleted answer D:
 
user559633
nooo :(
 
@TimCastelijns because I have seen you a lot, only in places like campaigns and socvfinder:)
 
Not in socvr? :((
 
you people all look the same there:P
with your faceless avatars and stuff
 
I suppose :p actually haven't been there much lately
I think I belong to the handful of people who do have a face
 
10:58 AM
who knows:P
 
I left the faceless men the day I joined
 
:)
rhubarb for now, be back later
 
@TimCastelijns cbg :P
 
@vaultah as typo. Attempts to access function's local variable outside of function
 
11:07 AM
Did...did you just ping yourself?
 
yup
 
Fair play.
 
I'd argue the url alone is nsfw
 
eyes widen very glad I'm not at work when I clicked that!
 
hi room cbe...
Is it a good idea to use class to organize your functions ? Say there are 10 functions, each requiring between 4 to 7 parameters to be passed for the tasks they do. And, say they all do related stuff, in a sequence. One can define a class, define the parameters as attributes, set them once after the object is initialized and just call the methods. As against, calling the functions passing the parameters. Is this a good way to organize, to avoid repetitive parameter passing or is it an "abuse" of classes ?
 
user559633
for what it's worth, i adblock and that site content is sfw
 
user559633
dpaste.de/hJf7 there's the text
 
user559633
11:45 AM
>The 3rd most popular search is ‘Overwatch futa’, referring to the hentai term ‘futanari’ meaning a character who mostly appears female but has male genitalia. We found similar ‘futa’ searches when we studied the My Little Pony fetish among Bronies.

oh god
 
user559633
 
user559633
did not expect russia to be so high up
 
user559633
can't wait for tristanovka to ask me what i was up to this morning before she woke up
 
Heh
I've been wondering, why "tristanovka"? "Tristanova" sounds more natural
 
user559633
I think Fizzy used it once, so I was going with that.
 
Yeah my knowledge of Russian names is distinctly lacking.
So I just made a vaguely racist assumption.
I thought I said "ovska" though.
which might be just as incorrect.
 
hi hi
 
morning everyone
 
@Ffisegydd yeah, it's even worse :P
 
12:23 PM
@vaultah One would expect that players don’t search for porn when the beta starts but rather play the game..
 
Morning cabbage.
 
user559633
12:41 PM
cbg
 
why is Italian soda significantly better than American soda? American soda always taste like low-quality syrup
 
user559633
which sodas are being compared?
 
Coca cola vs coca cola from Italy
 
user559633
oh, interesting, like for like. have you looked at the ingredients list? might be HFCS vs sugar
 
Yeah but I don't get why high fructose corn syrup taste SO bad, and why people keep using it
 
12:44 PM
Yeah, HFCS is kinda nasty.
I've been getting soda syrups from a local place and just mixing them with seltzer. It's crazy how much different it is.
 
user559633
@corvid Very cheap (due to subsidies and lobbying) and very sweet.
 
user559633
HFCS is used because there's a chunk of americans that don't mind feeding themselves like cattle and if you're drinking soda, it's not like you particularly care what you're putting in your body.
 
I only have two to three sodas per year, I really just wish they made a vanilla coke with actual sugar in a glass bottle
 
With pytest's monkeypatch, is there a way to refer to the original function? Eg, I want to do monkeypatch.setattr('module.function', lambda x,y:module.function(x,y,static_keyword)).
 
user559633
Sorry, that wasn't meant to be critical of you
 
12:49 PM
But it throws a recursion error.
 
1:06 PM
By which you mean a StackOverflow exception? Very appropriate in this room
 
The better question is: How did you get Italian soda? You been smuggling again?
 
I buy lots of my stuff from Italy like clothes and whatnot because they always work better, usually buy a huge chunk of stuff at once
 
user559633
the irony
 
1:39 PM
why irony?
 
user559633
italy has a high unemployment rate
 
Is there a better response to dumb code review comments besides implementing them?
 
user559633
Example?
 
depends on what is dumb
 
Maybe sequence += line.strip(...) will be faster, because here you're not extracting the value of sequence, adding data to it and then assigning to sequence again. Just += and that's all. — ForceBru 12 mins ago
OP seems to indicate that this does make his program faster. This is surprising to me. Is += really faster for concatenating strings?
 
1:48 PM
But their clothes are so much better, why are American clothes shaped so strangely? The shoulder to waist proportion makes no sense on T-Shirts here
 
user559633
@corvid depends on the brand and what market they're going for
 
Startup Idea: Hipster clothes for birds.
 
He would like enableX() and disableX() refactored into one manageX(flag) function. There's no reason to do it. It's just kind of his style. There were two other comments, but they actively break the code so I can safely ignore them.
 
What would be consistent with the rest of the code base?
 
What is this 'consistent' you speak of?
 
1:50 PM
(Possibly backfire if their answer is then "Oh well change the rest of the code base to be my style.")
 
@Kevin I think their terminology is a bit off-- it saves a single name lookup, but I think no matter what you're copying and reallocating, right?
 
@Kevin is += done at the C level?
Could be that it avoids some Python overhead and just does it all at the lower level.
 
A list of strings that is later joined might be faster?
 
user559633
doing a quick test script now :)
 
@KevinMGranger Agreed, which is why I gave a plus to the guy that answered.
I was going to answer myself, but I was too busy seeking opinions in here to do some fast-gunning.
 
1:55 PM
It wouldn't be surprising for += to be faster, it certainly is in C++.
 
hi room cbe...
Is it a good idea to use class to organize your functions ? Say there are 10 functions, each requiring between 4 to 7 parameters to be passed for the tasks they do. And, say they all do related stuff, in a sequence. One can define a class, define the parameters as attributes, set them once after the object is initialized and just call the methods. As against, calling the functions passing the parameters. Is this a good way to organize, to avoid repetitive parameter passing or is it an "abuse" of classes ?
 
I'd expect it to be faster, but have no better of a complexity.
 
@WhirlMind You asked exactly that earlier
2 hours ago, by Whirl Mind
hi room cbe...
Is it a good idea to use class to organize your functions ? Say there are 10 functions, each requiring between 4 to 7 parameters to be passed for the tasks they do. And, say they all do related stuff, in a sequence. One can define a class, define the parameters as attributes, set them once after the object is initialized and just call the methods. As against, calling the functions passing the parameters. Is this a good way to organize, to avoid repetitive parameter passing or is it an "abuse" of classes ?
 
You're still doing N memory reallocations of gradually larger space
 
can somebody knife that message or something?
 
1:56 PM
What, the quote?
 
nah, the repost:P
 
Okay, should I delete it now ?
 
@Kevin Oh I see yes, I didn't actually read the Q, just the comment.
 
@WhirlMind what do you think?
What makes you think that asking the exact same thing again will improve your position in any way?
 
Because now the East Coast Crew has had their coffee and are thus capable of actually answering questions :-P
 
1:58 PM
When you compute `x += y`, you have to sometimes reallocate `x` to double in size.
When you compute `x = x + y`, you allocate space for `x + y` from nothing, then destroy `x`, instead of reallocating space.

It's not an order of complexity faster, but it's a lot less work.

This of course assumes that python treats `+=` differently than `= +`
 
In any case, the answer to your question is "No."
 
No wait... it is an order of complexity faster.
 
Do strings have the same double-in-size preallocation thing that lists use? I confess I've never looked into the implementation details
 
There were fewer users online at the time. I think since someone answered the question the second time, let the second one remain because it stays close to the answer. Noted as "undesirable behaviour for future".
 
@Kevin be interesting to know what they use, because they're less predictable than lists
 
2:00 PM
I half-expect strings to just be a straight up char array.
 
@WhirlMind well, I'm not speaking on behalf of the room, but asking the exact same thing again after once not receiving sufficient answer is generally considered bad form. Especially that you even copied the "hi room cbe" bit, which hurt my eyes the first time
 
Plus a length attribute, I guess
Or, hmm, char's no good now that everything's Unicode, innit...
 
I assume python strings are basically the same as C++ strings. The double-size reallocation approach may not be what they use but it's what I assume.
 
Okay, anything considered inappropriate about 'hi room cbe'
 
What's "cbe" mean?
 
2:02 PM
i thought it was supposed to mean cabbage which was supposed to mean good morning ?
 
I hate Salad so much.
 
Fizzy, always the meat-eater:P
 
should have been cbg then
 
Cabbage is traditionally shortened to "cbg"
Argh beaten etc
 
cbe apparently is the classic bracket error
 
2:03 PM
If I could go back in time I wouldn't stop any wars or atrocities, I'd go back to Jon and Inbar's initial Salad conversation and completely derail it with HV questions. I think humanity would thank me in the end.
 
oh, that too, noted as "future wrong abbrev avoidance', :-)
 
@Ffisegydd Banana luck with that.
4
 
>_______________________________________________________________<
I'm going to go to my safe place and drink gin.
 
:D
The day @Ffisegydd turned into a whale
 
I have a large CSV file with a column of state abbreviations. The goal is to create an output file for every state. Current solution simply takes the state abbreviations as a list and loops through the entire CSV file 50 times. Each time it only writes to the current state. Could someone point me in the direction of a solution that reads once and opens/closes/creates each state output file?
 
2:06 PM
These days it's particularly hard to google for solutions related to stack overflowing.
 
I've come around on Salad and now view it as a Mostly Harmless tool for strengthening room cohesion.
Which is pretty much the same thing as my previous opinion, "Salad is a shibboleth used to delineate the room between those who know the secret words and those that don't", but with two scoops of optimism added.
 
@clickhere how large?
 
salad.io : cohesion for teams
 
5.5 GB csv file
 
How much RAM?
 
user559633
2:07 PM
fwiw, x+=y vs x = x + y for strings seems to have similar performance
 
ouch
 
I have 4 GB
 
user559633
from timeit import timeit
append_string = """
I couldn’t help but remember the morning paper’s headline:
“A greasy spoon with great coffee and terrible secrets.”
Was there any connection?
"""

def iadd():
    some_long_string = """
    It was a bad week in a bad month; maybe even a bad year.
    The Times was calling it the worst crime spike the city had ever seen.
    I’d just walked into the station. As soon as I opened the paper, I eyeball
    this handwritten note from Detective McAtholl. Turns out Terry Saunders
 
@clickhere dictreader
 
Sucks to be you then.
 
2:08 PM
:D
 
well, state output file should be less than a few hundred MB's
 
Create a dictionary full of file handlers and iterate over the CSV line by line (thus keeping the memory low) and write to the corresponding file in the dict.
 
Well, I'm not even sure you need dictreader. Just keep a list of abbreviations you've already seen
^
 
Actually no need to keep file handlers open, just append to files as necessary.
 
When you write to a file do you keep the data in memory or is it committed to disk and retrieved?
 
user559633
2:09 PM
if you only have to do this task once and you're not going to re-use this code, why not just split the file in two or four so it fits in memory
 
user559633
also, 5.5GB csv of state abbreviations?
 
Presumably it's actually records from across the country and they just want to split by state.
 
x += a and x = x + a have identical bytecode except for a single differing instruction - INPLACE_ADD vs BINARY_ADD. If both instructions go down the same code path for a particular type, it wouldn't surprise me if they had identical performance.
 
@poke What's the overhead like for opening and closing files? Wouldn't it be better to keep them open if possible?
 
No idea, it’s just that I dislike long-time open file handles ;P
 
2:12 PM
:D
 
user559633
@Kevin it was a difference in deciseconds, if at all, with the two functions trading off in which was faster, which leads me to believe that they have "the same" performance for all intense porpoises
 
If the program is short-lived itself, just operating on that one CSV, I see no harm in keeping them open
 
Oh, also, I'm not writing all the data in the row. it's like 300 columns and I want like 20 per row.
 
That doesn't really change the meat of your problem.
 
the vegetable of your problem *
 
2:13 PM
Who keeps starring weird things.
7
 
maybe mislicks
 
^ Nice try.
 
clearly it's fast at concatenating strings, there's motion blurs in the code
 
Motion blur is just put in by the core devs to make Python look faster.
 
No, it's like flame decals on your car. They're proven to have an effect.
 
2:14 PM
Looks like regular text to me. Then again, I smear vaseline on my monitor each morning to keep it fresh and youthful.
 
In the UK we call them "go-faster-stripes"
 
@poke, what sort of syntax should I have for appending as necessary. Re-open each file with with ?
 
'a' is append mode
 
That doesn't sound very UK to me. Shouldn't it be something like "Automobilial Velocidecals" ?
 
@clickhere Random guess, but I'd imagine that opening for every line is going to be slow
I wonder if you could sort the file to make it easier.
 
2:17 PM
if abbrev not in abbrevs:
    abbrevs[abbrev] = open(abbrev, 'w')
 
Sort it so all of the "AL" are together and then just iterate over it appending, when you hit "AK" then close the "AL" file and open the "AK" one.
 
abbrevs = defaultdict(lambda x: open(x, 'w'))
 
Nice.
 
German efficiency.
 
2:18 PM
heh
 
I don’t know how I should react to that.
 
People should talk to get his face off the screen.
The alternative one I was considering was
 
I used finally in a non-toy program for the first time yesterday.
 
Finally!
 
2:21 PM
 
@Kevin I’m also not sure how to react to that.
 
It was for an image-processing script that creates intermediary image files, which I then delete at the end. But if an exception occurs, the intermediary files hang around.
Now I remove the files inside a finally and now that doesn't happen. Uh, I assume. I actually haven't had an exception since then.
 
Ah, the Unix approach to error handling: don't have errors
 
@Ffisegydd Was that filmed on a cabbage?
 
@poke C++ was my first language so I'm well-accustomed to ignoring whole swaths of a language for years at a time.
 
2:22 PM
hah
 
Still trying to find a good use case for for-else.
 
user559633
finally was always too sarcastic for my liking
 
@Kevin If you ever get hired by a hipster startup, it'll be time.
 
user559633
i want to work at a lisp startup that really redefines what it means to function as a startup
7
 
The main use case that for-else solves in other languages is typically solved with in in python, so I guess it's rare
 
2:25 PM
> ...since the condition the else is checking for is whether or not the loop was explicitly terminated by a break statement.
 
user559633
i have used try/except/else a couple times :)
 
for x in data:
    if acceptable(x):
        break
else:
    raise ValueError("No acceptable value in {!r:100}".format(data))

... # Continue calculations with x
 
user559633
the future is lame. that thing should fire a blue laser
 
user559633
 
user559633
2:30 PM
lol why are there spent casings being ejected from a laser gun?
 
Because they're laser bullets.
 
I usually structure my programs in such a way that I can typically use return instead of break. I guess I should keep an eye out for situations where a full function would be overkill compared to for-else.
 
user559633
Makes sense.
 
Don't you know anything about science!?
 
if not all(acceptable(x) for x in data)
 
2:31 PM
@KevinM true, but if you need to do some processing in the loop then you need a real for loop.
 
Also Kevin you need to change your name to Kevin Kevinson so I can @KevinK you.
Or one of you needs to change first names, I'll leave it to you to decide throws knife between the two combatants
 
I've just learned to ignore raw @Kevin-s
 
@Kevin Sounds like you’re doing well though. Short functions are good functions.
 
2:32 PM
I'm not getting in a knife fight with someone from NJ, that's practically their state sport
 
cabbage
 
Pictured: Jersey on a Friday night
Ooh, the Windows 10 environment variables window finally has a nicer interface than a 50 px unresizable textbox that typically contains upwards of two hundred characters, making it nearly impossible to scroll through.
Now there's a reasonably sized itemized list.
Improvements: 2. Grievances remaining: legion
 
2:52 PM
What other grievances do you have with 10? I've found solutions for quite a few of my initial gripes with 10.
 
Mostly just the typical discomfort that comes with upgrading to a new OS and finding that you don't know where half of everything is.
 
Makes sense.
 
Ex. It took me an extra three minutes to modify my environment variables because I could no longer do "start menu -> right click on My Computer -> select properties" to get to the system settings window
 
The Win+X menu is my favorite new feature.
 
Also the Cortana bar briefly flashed blue for a second while I wasn't using it at all. I suspect it will do that from time to time to remind me that it exists. I suspect that will annoy me from time to time.
 
2:58 PM
You can disable that little search area if you want.
You can still access it with Win+S.
That's what I did.
 
Let's see, what else... Uh, the menu bar for firefox is gray instead of blue. This is a problem because reasons.
 
DSM
I'm reviewing Python code this morning and getting paid for it cabbage for all!
 
00:00 - 15:0015:00 - 23:00

« first day (2055 days earlier)      last day (2894 days later) »