« first day (1560 days earlier)      last day (3388 days later) » 

hello
 
"found 468 total style violations in project 'KevinScript'"... Hoo boy
 
@Kevin ^
 
120 of them are "line too long", so I can't even automate fixing them nicely
 
1:11 PM
I hate that PEP8 rule.
 
It's because Python was originally written on typewriters
 
Controversial, but I prefer 80 chars still.
Because I use a split window in my editor.
 
devil's advocate: it's a red flag that you're cramming too much complexity into a single expression.
 
@MartijnPieters deleted
 
Even with the sidebar hidden, I can display up to ~100 chars per line side by side.
 
1:12 PM
Kevin's advocate: it works, doesn't it?
 
@AnttiHaapala what does this do exactly? iter([].sort, 0)
 
@ReutSharabani well, [].sort sorts the empty list and returns None
 
One down, one post left.
 
and iter(func, sentinel) makes an iterator that calls the func() repeatedly until the value == sentinel and then raises StopIteration
 
why not None?
ahhh I understand
 
1:14 PM
>>> iter(None, 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: iter(v, w): v must be callable
>>> iter(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not iterable
>>> iter()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: iter expected at least 1 arguments, got 0
 
so why not lambda x: None ?
 
I thought iter(f,0) could be shortest way to do itertools.repeat(None)
I wanted to make it shortest possible :D, and obfuscate a bit
 
Today I learned that you're supposed to put a space between "#" and the rest of the comment. I learned this 149 times.
5
 
short relating to characters?
 
@Kevin you need an advanced lint that makes you actually write it x times on chalkboard
repetitio est mater studiorum
 
1:18 PM
"the Kevin's default value trick" ?
0
A: How to do mouse hovering for group of buttons in python

Antti HaapalaThe problem is that in Python the closures such as your lambda function, close over the names in the surrounding block, not the values. As such, the value of btnName as observed in the lambda depends on when it is executed - as the events can occur only after the loop is exited, the btnName is th...

 
lambda event, x = btnName
 
@MartijnPieters So do I. But my excuse is that I started on punch cards. :)
 
but it is prone to failure
 
Requiring newlines at end of file? What is this, javascript?
 
@Kevin C requires
 
1:19 PM
never mind, didn't see the other answer. I use this kind of things sometimes. It's so bad :)
 
I like to hope that Python's import doesn't just concatenate the contents of the module file into the current one
 
stackoverflow.com/questions/26315475/… someone voted this as "too broad" ;)
it is so funny, trigger-happy cv'ers voting to close something as too broad when there is a single obvious way of doing thing in stdlib
 
Overload angle brackets in python wat. Why would you want this?
 
Some people just want to see the world burn, Fizzy
 
1:27 PM
@Ffisegydd ask Java 5
@Ffisegydd how's that unclear?
 
I mis-clicked and meant Too Broad. It's basically "Give me teh codez"
 
Okay, yeah
Close vote closed as too misclicky
 
Ah, the word click in certain fonts is hilarious to me.
 
sniggers
 
1:31 PM
-_-
stackoverflow.com/q/28111061/3005188 OP needs to clarify what they want as there's no reason they can't do that right now.
 
@RobertGrant I used to work with a guy named Clint. Some of our co-workers thought it amusing to write his name in all caps.
 
docspython seems to be down
 
Ah
"It's a ligature"
 
rectangular letters.
 
1:36 PM
Wow, makes you pine for LinkedIn API questions
 
@Ffisegydd I commented like a clickhead
 
hmhmmhm
not really "too broad" :D
but it is like useless
 
1:44 PM
Yeah I also reluctantly clicked that
 
It is (I don't have a link to the meta post). Generally "Explain code to me" is too broad.
Where do you stop explaining?
 
yeah ok ok :D
 
48
Q: How to handle "Explain how this ${code dump} works" questions

pennstatephilI've been seeing more and more frequently what I call "explain how this works" questions. A good example is: Function explanation needed Essentially, OP posts a block of code they either found somewhere on the net or some legacy code they don't understand, and asks us to tell them exactly what i...

 
Anyone use the pep8 tool before? It's not showing me naming convention violations and I'm not sure if there's a way to enable that.
I've got camelCase function names everywhere and it's not saying anything
 
hmhm
@Kevin they are by pep8
mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.
 
1:50 PM
it is indeed the prevailing style in my project, but it wouldn't be too hard for me to convert it... If the tool can point out all the instances
 
Change everything you can see until this_becomes the prevailing style :)
 
I found a great regex that converts camelCase to lower_with_underscores if you want it.
I use it for Nidaba.
 
this is why I like java :D
I just can refactor one variable at a time and ide knows for sure all the code using it
 
A bunch of us answered an "Explain code to me" question yesterday & the damn OP didn't even bother to accept one of the answers. Grrr. They're not a total noob, so you'd expect them to know about accepting...
 
def convert(name):
   s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
   return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
 
1:52 PM
Thanks :-)
 
Doesn't PyCharm let you refactor?
 
It does.
 
cel
hmm that's an interesting attempt
0
Q: How can I install the latest versions of NumPy/Scipy/Matplotlib/IPython/Pandas

unutbuHow can I install the latest versions of NumPy/Scipy/Matplotlib/IPython/Pandas? I'm interested in solutions for all OSes.

 
I assume El Kevin is not using it though.
 
Nope, Notepad++
 
1:54 PM
omg...
unutbu <3
 
I AM UNUTBU
Don't know why that's funny
 
unutbu is a bit of a legend. Even if he does FGITW me often to numpy answers D:
 
but whyyy
 
Oh, wait. I thought @AnttiHaapala was comically misspelling Ubuntu
 
why write that kind of question now here....
 
1:55 PM
It comes up often
 
"I'm interested in solutions for all OSes"
it should be 1 question not 5000 questions on different oses
should be "how to install in ubuntu", period
 
Ah, well, yes maybe. He does actually only speak about installing on Ubuntu (though a lot of the stuff is useful for other OSs)
 
there are at least 5 ways of installing the stuff on mac and windows each alone :D each of which is "the best"
 
I personally am a big anti-fan (is that a term?) of Anaconda and Canopy.
 
cel
well, I am a huge fan on anaconda :D
*of
why is he pulling the dev versions from github? I definetly would not recommend that.
 
2:01 PM
Not for the casual user, no. And the non-casual user would (probably) know how to do this without a guide anyway.
I might think about writing a CW answer for Mac.
 
cel
<-- wants to flag it as too broad
 
it is like... if you want to build the shit on windows ... OMG...
 
cel
still I hate the first answer :D
 
2:12 PM
@cel now you can make another answer
no one is forcing you to live by it, and now your answer can be read too
 
cel
that's true, but I do not own an ubuntu :)
also I do not want to completely rewrite the community wiki, just because I think it's a horrible idea to install the development versions from git.
 
@cel that was the point, how to install dev versions :P
 
Oops, my naming convention fixer script is inserting 2**n newlines on every line of every file, where n is the number of nonstandard identifiers in the file.
Aaaaand... Revert Changes. Suddenly the merits of version control are apparent to me.
 
@cel you can post your own answer too
 
cel
I came here to complain :)
 
2:17 PM
damnit
 
cel
 
Ok, camelCase identifiers converted! And it passes the one test I have, so I'm giving it my "works on my machine" certification.
 
Ding-dong, the programming competition tags (that we know of) are dead!
 
I never thought this day would come :'-)
 
2:27 PM
cbg
 
cbg
 
Rbrb
 
DSM
Morning cabbage for all!
 
cbg
Does anyone here use the SE mobile app and have more than 10k rep? I need you for science reasons.
 
2:36 PM
Not me
 
Never mind, science is cancelled due to the bug already being reported on meta.SE.
 
@Ffisegydd you referring to do the fact it won't display deleted stuff?
 
Yep
 
DSM
I missed the cv-pls, and so I thought that was the bug report your were referring to. Nine kinds of confusing.
 
Yeah... it'd be nice if the SE API returned deleted posts
 
Very similar to my working query but doesn't use the count as a column, it only uses count for ordering. — Al Ex Tsm 1 min ago
 
cbg
 
3:02 PM
Excellent - the broadcasters for the leader debates have just said that they're going to hold the debates regardless whether some of the party leaders (yes, you Cameron) decide to attend...
 
Suppose They Gave A War Debate and Nobody Came
 
DSM
I've seen debates where only one candidate showed up.
 
Oh... they will... all the other party leaders are keen on it - it's just Cameron that tried the "Well, if the UKIP leader is invited, then I think that's unfair, so I'm not going to attend if the Green party isn't invited" thing
 
I've seen debates where no one showed up.
 
A seasoned debate coordinator will bring finger puppets to entertain the audience, should the need arise.
 
3:06 PM
He just doesn't want the debates this time around, because he always comes off worse... and like him or loathe him, Nigel Farage is pretty bloomin' good at 'em
 
Already voted on it B-)
 
DSM
Ah, a fellow math-tag follower?
 
I think that's one of those questions that I could answer in fifteen seconds if I had paid more attention in elementary school geometry class.
"Yes, just apply the side-angle-side theorem, then carry the two..." says my alternate universe self
 
@JonClements Don't worry. Just send down a bunch of angry Scottish nationalists. They're good at making Farage run scared ;)
 
3:08 PM
where do you carry the two poles?
 
@DSM Yeah, although a lot of the questions tend to get closed because they're only about math.
 
@IntrepidBrit isn't the word angry redundant there? :p
 
Nope. It acts like a multiplier
 
Scientists postulate the existence of a zero-anger Scottish nationalist, but they have very short half-lives and are only observable inside the event horizon of a black hole.
3
 
I could make a joke about Glasgow here, but I daren't
 
3:12 PM
@Kevin reminder to self: do not leave the chat transcript opened if there is any chance my Scottish wife can read that remark.
@IntrepidBrit Oi, it cleaned up nicely! :-P
 
I thought twice about making that comment, because I have no knowledge of Scottish stereotypes, or how lighthearted I'm allowed to be about them.
 
@Martijn you mean we finally find a productive use for nuclear weapons? :p
 
I can only hope that my boorish behavior will be excused because I'm an ignorant American and don't know better.
 
You've clearly never been to Scotland @Kevin.
 
This is true.
 
3:14 PM
Mistakes Americans make when it comes to Scotland: 1) [When wearing a kilt] Are you Irish? 2) Oh you're Scottish, I'm Scottish (in a Texan drawl)
 
I've seen videos of it on the Discovery channel. It was a documentary about puffins.
 
@IntrepidBrit apparently 1/3 of high school students can't tell the difference between the US and Russia on a map with names removed... so errr, I think Scotland is fairly safe from being found :)
 
In fact, once I start making the list I won't stop :P
 
@Kevin: and for your context, see en.wikipedia.org/wiki/Architecture_in_Glasgow#Victorian_era, look for the word 'soot'.
 
Scotland is the top fiddly bit on the island that looks like a bunny, yeah?
 
3:15 PM
I used to work with a Welsh bloke who was a Rangers fan (one of the two football clubs in Glasgow). He had a Welsh dragon tattooed across his chest. One day he went to Glasgow and accidentally ended up in the Celtic (other team) part of Glasgow while wearing his Rangers top.
 
@IntrepidBrit oh gods. So true.
 
@Ffisegydd may he R.I.P... :(
 
especially the I'm Scottish part. The Scottish society in Fredericksburg, VA being a pretty sad example of that.
 
Two blokes grabbed him and pushed him into a telephone booth. One of the blokes pulled out a knife, and in the fight his Rangers top was ripped, showing his dragon tattoo and proving he wasn't from Glasgow itself. The two blokes stopped, looked at him and said "If you hadn't not been from here you'd be f'ing dead mate, now f' off before someone else finds you!".
 
Tough but fair ;-)
 
3:17 PM
@MartijnPieters It's fun when you travel and every American stops to tell you that they are a 0.181233245342532634th % Scottish.
@Ffisegydd Hear far too much of that. Too many stories of people being killed just for being "x". Where x can be Celtic/Rangers/English/Posh/Scum ...
etc
 
Anyway... let's not leave too much potential for stuff about Scotland to show up for @Martijn's wife... we'd like him to leave a long and prosperous life... he may be a ninja, but in a "Ninja vs Scottish Woman" altercation, my money is on the wife :)
 
@IntrepidBrit It gets old fast when you live there. We were lucky my wife's accent isn't all that obvious.
 
I've got some other good Glasgow stories as I worked in Port Glasgow for a summer when I was 16.
 
I can confirm that a lot of Americans identify with the culture of their distant ancestors, even if they're tenth-generation American or whatever.
 
@JonClements oh yes, she knows all the secret anti-ninja moves.
 
3:20 PM
Ex. I'm "Irish", even though the single observable evidence of this is the tinge of orange in my facial hair, and only when the light is just right
 
@IntrepidBrit Or you tell them where you're from... and they're like "Oh, I've got an Aunt that lives near there... do you know Joan Smith?"... sigh
 
@Kevin I mean, it makes sense if we're talking about maybe one of your grandparents, at worst, that's okay. But it'd be like me walking up to you and telling you a cool story of my gran because you have blonde hair.
@JonClements or the best: "Do you know the Queen?".
The first few times I laughed. The next twenty I wanted to cry.
 
Of course one knows the Queen - we had cucumber sandwiches and played fetch with the Corgis just last week! :)
Even said in the most sarcastic tone I could muster... still goes over most of their heads ;(
 
@Kevin At that point I'd pointedly stroke my ginger beard...
 
Getting No 'Access-Control-Allow-Origin' header is present on the requested resource. when using Flask with the crossdomain decorator. Anyone on how to fix it? It worked before on sending text data, but when I return JSON, no luck.
 
3:23 PM
Besides, everywhere has their really rough neighbourhoods/towns/cities
 
@rodling afaik certain content can bypass
 
@RamchandraApte how can i establish any content to be sent? I looked up CORS, and thought i put all necessary headers. Origin is set to *
 
@rodling haha, I don't know anything about web development; only thing was that I had encountered an access-control-allow-origin problem.
 
:(
 
@rodling are you making ajax requests?
 
3:29 PM
yes
 
Because I'm desperate for Python gold, I answered two questions by just giving the full working code to the OP. Both times I got a reply like "thanks, but now I have this other problem, because I didn't fully describe the possible data that could appear in the input file"
 
var headers = {
                    'Access-Control-Allow-Origin' : '*',
                    'Access-Control-Allow-Methods' : 'POST, GET, OPTIONS',
                    'Accept': 'application/json'
                };
 
Oh, you need to parse "X hours Y minutes Z secs" and not just "XYZ secs"? Wish I knew that half an hour ago.
 
and are you making an ajax request to a domain other than the domain the script runs from?
 
@Kevin happens to me too
 
3:32 PM
@JonClements right now I am making a call to http://127.0.0.1, but if this works I will git push it to the cloud and will be making calls to that
 
p.s. maybe you already are doing so, but localhost is easier to understand than a pile of numbers in the source code :-D
 
oh sorry, thought its synonymous
 
it is
but it communicates the intent better :). But it's no biggie.
 
@rodling depends what you shove in your hosts file :)
 
didnt touch that
 
3:37 PM
@rodling sometimes for testing it's useful to do add something like 127.0.0.1 your_domain.com
 
is that needed to solve the allow-origin issue? I set it to wildcard, and thought that would do it..
 
Is there a way to have a generator function which yields only unique values from a set of iterables?
Because creating a set might be very costly in this case.
 
cursor.execute expects the first argument to have encode method, unless it's of bytes/bytearray type.
 
just create a set inside the generator where you skip anything in the set and update when an new value is found
 
+1 for Reut's idea.
 
3:40 PM
@thefourtheye Perhaps you could use a bloom filter instead of a set. It uses less memory, but has occasional false positive matches.
So if you're willing to accidentally not yield a unique value every once in a while, there you go
 
@ReutSharabani Eventually the set will have all the unique elements, right?
 
DSM
.. if it's costly to create a set, won't it be equally costly to create a set inside the generator?
 
yup, but it will not be created "at once" so you don't have to wait
 
@vaultah Unless it's of the bytes/bytearray type, cursor.execute expects the first argument to have the encode method.
 
@Kevin I ll read about it. Melons :)
 
3:42 PM
@rodling it might do... at the very least, it makes the development stuff look like what's going to be the production stuff
 
@Ffisegydd thanks :)
 
@DSM isn't the difference is that you don't have to wait for the big set to be created? you simply get unique values (almost) immediately
 
Even a set will get slow if you add zillions of items to it incrementally
 
@JonClements is that for the headers part in ajax?
 
@thefourtheye I think the closest is something like
 
3:44 PM
@JonClements Ya puppy, that is what @ReutSharabani suggested.
 
Umm... why the heck has my settings gone wonky in ST3 again... it periodically just keeps changing itself!?
 
I think it's most straightforward. Unless you need the actual eventual set rather the values
 
What time complexity is updating a set?
 
DSM
O(1), averaged.
 
probably close to O(1)
if you hash fairly
 
3:45 PM
If you're using a dict as the underlying data structure, O(1) average case, O(n) amortized worst case
 
I forgot what amortized is
I did learn it in the academy
probably take a look later
 
I don't know the formal meaning, but I understand it as "average of many instances"
 
I had an awsome teacher for data structures, he did something with coins to explain it
can't remember what
 
In computer science, amortized analysis is a method of analyzing algorithms that considers the entire sequence of operations of the program. It allows for the establishment of a worst-case bound for the performance of an algorithm irrespective of the inputs by looking at all of the operations. This analysis is most commonly discussed using big O notation. At the heart of the method is the idea that while certain operations may be extremely costly in resources, they cannot occur at a high enough frequency to weigh down the entire program because the number of less costly operations will far outnumber...
 
@ReutSharabani it was so awesome that you can't remember - nice :)
 
3:48 PM
It was 4 years ago and I never used it since. I did get 97 in the final exam, which is one of my highest scores.
 
Ex. Even though list.append occasionally incurs an expensive memory reallocation procedure, it only happens in increasingly less frequent intervals when you append the (2**n)th item, so the amortized time is still O(1).
 
DSM
Can't remember the coins but do remember the grade, eh? ;-)
 
I'm in the point in life where your coin gain is a function of your grades, so....
 
Can somebody translate this for me please "Wanita memang sakti, dengan adanya mereka, kaum adam jadi semangaaaattttt...." I'm doing a project on books, this is the sub-title and I don't know which category to place it ... Please help
 
@BhargavRao Google Translate?
 
3:51 PM
There are "11" types of people in the world. Those who remember to cast to int and those who don't.
 
@thefourtheye Google translate did not do it properly ...
 
rbrb
 
@JonClements expanded origins header to 'Access-Control-Allow-Origin' : 'http://127.0.0.1' in ajax, no luck
 
@rodling What are you trying to do?
 
4:07 PM
Send gps coords via AJAX to Flask and return JSON object
 
user559633
check out flask cors flask-cors.readthedocs.org/en/latest @rodling
 
So you have the client and the server?
 
@tristan thanks! i was using a decorator, without much use for POST requests
 
user559633
What did your decorator look like?
 
user559633
hangovers and being in a room with a conference call on speakerphone do not mix
 
4:12 PM
Hair of the dog!
 
@tristan it was this one flask.pocoo.org/snippets/56
@tristan seems like I did all those things anyways, allowed content-type.. and origins ste at *
 
user559633
@Ffisegydd haha. i think i had a weird amount of whiskey.
 
user559633
 
user2555451
4:34 PM
Hey, does anyone know where the docs explicitly mention that and and or use short-circuiting? I want to add a docs link to an answer I wrote.
 
user2555451
Awesome Fizzy, thanks!
 
Oops
 
cbg
 
4:40 PM
cbg
 
@Ffisegydd remember the float max, now that I got docs open, then float_info is 2.6+
 
Ah really?
 
yes
2.3 compatible it is not :P
but at least it has some constants :D
 
user559633
i love business speak : "Q4 was disappointing. Significant events in 2014 have disrupted our ecosystem and overwhelmed the progress we were making on a number of fronts, impacting our performance."
 
Translated: "we done goofed."
 
4:51 PM
"We didn't do anything productive in December because of Christmastime laziness"
 
This is pretty great, and apparently reasonably famous? I'd never heard him before.
 
this guy is getting the old "NameError when using input" problem. Here's the twist: he claims he's using Python 3.
 
OK, new project this weekend is to create a site to coordinate all these cv's.
 
voted x6
 
4:55 PM
When RABBIT gets up it would be nice if it paid attention for them and somehow sent them to sopython.com/cvs or something.
 
0
A: Coding Dojo exercises for java

Richard FawcettPlease see the answer to question 1737427.

Neat answer
 
DSM
@davidism: maybe the close-vote room guys already have one?
 
I deleted a thing! Yay!
I know there was one that someone linked a while ago.
 
there's stuff around, I'll have to do some research, but I'm imagining something a bit more powerful
There's a room on meta.se that collects cvs from various rooms, it's what the @Zephyr bot is.
 
@davidism I've been hunting for stray tags - won't say there are definitely no others, but pretty sure none that have caught any attention in meta.
Unless we fancy a raiding party into ;-)
 
4:59 PM
hmhm
maybe i should do some project euler
 
cel
seems another candidate :)
 
@davidism The idea was that RABBIT would monitor chat for such things, and pass them back into nidaba...
and RABBIT would "listen" to kesh regarding potentially close votes computed by nidaba - and display them appropriately
 

 Low Quality Posts HQ

Home of bots for catching low quality posts (and sometimes spa...
 
cbg
 
5:04 PM
cbg Vader
 
I have some sad news, my pixel at x:53 y:524 is dead. RIP
 
Still getting Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers. error with flask-cors @tristan
 
@Vader Old Chrissie kicked the bucket? Mind you, she did like a drink - they didn't call her "liquid" Crystal for nothing. She was never going to be donating her liver (except maybe to science).
 
Having very similar environment and issues as stackoverflow.com/questions/25550337/…
 
Liver Cirrhosis Display doesn't sound like it would provide very true color.
 
5:17 PM
gong
@BhargavRao sorry, didn't mean to rollback your edit
 
5:32 PM
level 4 @ project euler
 
@AnttiHaapala nice :)
haven't looked at PE in ages
 
just decided to tackle 1 problem and it was my 100th
must have been almost a year since last time
maybe 1 more
 
cel
I wonder why the suggested edit queue is always empty, but it still takes a significant amount of time until my edits are approved/rejected hmm
 
@cel I barely look at the suggested edits review queue any more... still full of too many people that just keep approving everything - so by the time I've gotten the context and read the edit fully, and decline it, it's already been approved :(
 
@cel just get 2000 rep and don't worry about it any more ;)
 
user559633
5:45 PM
i find it odd that quiet space and uninterrupted work isn't thought of as very important for working in tech.
 
user559633
like, imagine if surgeons had to deal with people walking up and asking them about how they prefer to use a scalpel
 
@vaultah Hehe ... Was confused as to what mistake I had done ... :)
 
I won't post them all this time, but I just stripped most of the questions - the remaining five need to be (closed in one case and) deleted, if anyone's interested.
 
user559633
or if you were a truck driver and people kept asking you to go into a meeting or kept trying to change your current task
 
@Ffisegydd oh - almost forgot - the other good thing about 10k is that you get to see the complete history of review queues (eg: not just your own actions) on stackoverflow.com/review/suggested-edits/history for instance
 
cel
5:50 PM
@davidism now that's a plan :)
 
stackoverflow.com/a/25827827/4099593 Don't know whether to tag as cv-pls
 
user559633
recommendations on a git gui that's prettier than gitk?
 
user559633
git-scm.com/download/gui/osx found this, but didn't see anything i like
 
user image
3
What's not to like? ;-)
 
@ZeroPiraeus beautiful.
 
cel
5:59 PM
well, at least colorful :)
 

« first day (1560 days earlier)      last day (3388 days later) »