« first day (1680 days earlier)      last day (3259 days later) » 

12:00 AM
It's bizarre when out of my hundreds of answers, I get 2 upvotes on the same same answer on a Friday evening. Literally 4 minutes apart.
 
12:22 AM
@davidism @ZeroPiraeus so can you catch me? I'm a bit ahead of you both! :D
 
Race you to 20K :-)
(just have to put the finishing touches to my DDOR botnet)
 
 
1 hour later…
1:53 AM
DDOR?
Distributed Denial Of Rep? :D
 
2:22 AM
hey hey hey
where's all my Pythons at?
Pythy pythy Pythons!
come out and play!
 
3:21 AM
@AaronHall only if you throw a tennis ball :)
 
3:34 AM
Hi Hi Cabbage
 
3:45 AM
cbg
 
cbg @davidism
 
cbg
 
not sure why I'm up - but hey-ho :p
 
I've been told as soon as my wife stops exercising the cat we're going to bed.
 
There's a cat...? Runs around trying to find cat to bark at
 
4:03 AM
Can cats be exercised? Do they put up with it?
 
Seriously though, what does "exercising a cat" even mean?
 
When they think it's their idea.
Throwing around ropes and strings wind up exercising my wife more than the cat.
 
My cats were just always: "you feed me, I might give you the privilege of paying attention to you at some point"
 
My brother would sit at the opposite end of the hallway and stare at the cat, who would eventually get worked up enough to run over. Then he'd move to the other side of the hall and repeat.
 
Men who stare at cats.
 
4:06 AM
@AaronHall I'm sure Clooney is up for it :p
I love cats and dogs... but I prefer dogs :)
(if that's not obvious by now :p)
at the least - they don't yam off for a few days, worry you sick, then turn up and look at you asking for where their food is
ah oh... @Martijn is here (or not) :p
 
4:35 AM
interesting - if I plug the phone into a USB port - my trackpad stops working
 
 
2 hours later…
6:29 AM
@JonClements remember?
in C, May 23 '14 at 20:38, by Jon Clements
Hope this room works out though... definitely needs one
it was exactly one year ago -- and the room is still there, ofc not as active as this one, but still alive and working ;)
 
6:45 AM
:)
it's in safe hands - of course it'll be so :p
 
hehe, well, we do our best ;)
 
well.. that's all we can do :)
 
 
2 hours later…
8:49 AM
the question
Well. The python script I had written was actually called time.py. Now that I've renamed it, the error is gone and the script only runs once anymore. Thanks. — user2765654 1 min ago
 
@RobertGrant @Ffisegydd github.com/teradeep/demo-apps
 
Eh. I've never been that interested in deep learning.
 
Look at the video, though. It's pretty neat
 
9:35 AM
babbage everybody
 
Ada, @XavierCombelle
 
9:49 AM
cbg @SomeGuy
 
Ah, Cabbage is a short form of Charles Babbage :-) #epiphany
 
 
1 hour later…
10:58 AM
Been playing with some geo stuff. Have set up ffisegydd.com/bath
 
11:53 AM
awesome
 
12:04 PM
pancakes
waffles
eggs and bacon.
good morning!!
 
@AaronHall: Good morning
 
12:22 PM
hi
 
12:43 PM
So what does a +200 answer get you?
bragging rights?
You won't be around next year, my rap's too severe kicking mad flavor in your ear.
 
cbg
Hi guys, just want to pop in and ask a question real quick. How would i go about consecutively slicing a string? say i had this string, "123456789" and i wanted to turn it into 3 separate strings, "123" "456" "789". any help is greatly appreciated. ill keep looking in the mean time.
 
1:02 PM
Hey up
 
cbg
 
@Death_Dealer slice it using slice notation.
 
>>> s = "123456789"
>>> [s[i:i+3] for i in range(0,len(s),3)]
['123', '456', '789']
 
hmm ok ill google the docs now thanks for the tip.
 
That should give a start :)
 
1:04 PM
@BhargavRao thanks alot this is the solution i was looking for^_^
 
def grouper(iterable, n, fillvalue=None):
    "Collect data into fixed-length chunks or blocks"
    # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx
    args = [iter(iterable)] * n
    return izip_longest(fillvalue=fillvalue, *args)
Bhargav's solution has the issue of failing for a string that isn't a multiple of 3.
 
DOn't forget to add from itertools import izip_longest
 
Oh very nice, i appreciate the help guys.
 
1:40 PM
Cabbage. I've done a git clone of pyftpdlib, which is the source of a package. When I try to run one of the demo scripts, python3 bin/python3 demo/basic_ftpd.py, I get the error ImportError: No module named 'pyftpdlib'. Is there a way to run this script that will let it find the module from its source, without having to install the package?
 
Wow. The author of ftpd facing issues with ftpd :D :D
 
:D
My question is related to Ruby's ftpd, in a way. Because the tests for Ruby's ftpd use ftps, I've been a contributor to the ruby gem for ftps clients. That gem's tests use a public ftps server that is no longer available. I want to change its tests to use pyftpdlib instead, so no public ftp server would be needed.
 
So ruby needs the help of python ;)
 
@Wayne the issue is that if you git clone something then it'll usually (unless you're lucky) not be on the PATH.
 
@BhargavRao Indeed it does. I can't have the client gem's tests use Ruby ftpd, because Ruby ftpd's test use that same client gem. That's just... incestuous. And a great way for bugs to hide.
 
1:53 PM
So it can't import it.
You either need to install it or use unittest to run it maybe? Let me have a look.
 
@Ffisegydd I tried setting PYTHON_PATH, giving the path of the package's top-level __init__.py file, but that didn't work: PYTHON_PATH="/home/wayne/lab/pyftpdlib/pyftpdlib" python3 demo/basic_ftpd.py
 
I usually use tmux which automatically creates a new Python installation and installs the package to it so you've got a perfectly clean slate.
You don't necessarily want the top-level but one above it, no?
 
@Ffisegydd tmux, the terminal multiplexor?
 
Ah. Wrong thing. Let me think. Tox!
 
@Ffisegydd I tried the one above it as well, without success.
 
1:57 PM
@Wayne in fact they already have a tox.ini set up.
So you should be able to cd to the dir and do tox (assuming you've installed it already)
 
I'll try that after breakfast.
Speak of which, my jar of bacon grease (that I use for cooking eggs, etc.) is less than half full. This represents an imminent crisis.
 
You keep bacon grease? O_o
 
Yes, in a jar in the freezer. It keeps forever that way, and some things are much more delicious when fried in bacon grease. Like eggs.
 
Fair enough. I've just never thought about keeping it.
 
Heck yes, bacon grease is the perfect fry material.
 
2:05 PM
I tend to do all my cooking with Olive oil.
 
Low smoke point
no good
 
Pah. It's fine.
To be fair I don't tend to fry much anyway.
 
put olive oil on salad, fry with bacon grease.
Who wants their eggs to taste like olives anyways?
my favorite thing to do with olive oil is mix with balsamic and pepper and herbs for a bread dipping sauce.
My answer to perfect fried eggs: cooking.stackexchange.com/questions/6402/…
 
I do love cooking with an iron skillet.
 
I love a well seasoned cast iron skillet
@AaronHall I want breakfast at your house.
 
2:13 PM
exactly.
 
Eggs should be poached anyway.
 
Although this is not a method I would use, I gave you a +1 for the clear instructions and attention to detail. — Air Aug 8 '14 at 17:32
:D
 
@Ffisegydd I did ` tox demo/basic_ftpd.py` and it's installing what I presume are package dependencies. So far so good.
 
@Wayne awesome. You can also just do tox and then it'll search everywhere in the package for tests.
We use it for Nidaba.
 
Never new bout tox :/
 
2:20 PM
Hmm. It looks like tox only runs tests. Is it the droid I'm looking for?
 
Ah I misunderstood, I thought that was what you wanted? I see I was incorrect. I will commit seppuku in apology.
 
No, no, I don't want to clean up after that. It's alright :) I think I'll just install the package--not sure why I got so fixated on running it from source.
 
If you want to run demos, the easiest way is to just install it to local and run them.
 
2:32 PM
@Ffisegydd That worked fine. Thanks, and congrats on the job offer.
Rhubarb
 
Rhubarb @Wayne
 
3:30 PM
@AaronHall -1. It doesn't have any salad ingredients :D
 
3:53 PM
@thefourtheye: spam flags are for spam == trying to promote something where promotion isn't asked for. That post was just in the wrong language. :-)
 
Gr.r.r I have no idea who I was downvoted here. Is there anything wrong?
@MartijnPieters Oops, sorry :(
Actually I was closevoting that with that reason :D
 
It's a spanish question about creating a game with Python.
 
Oh. Its really a valid question then. Anyway, even if it was in English, it would have got closed I guess
 
Lol! Another Declined. A mod viewed it butt ... for @thefourtheye :D
 
3:58 PM
cbg
 
cbg Antti!
 
Oh, I know who downvoted my answer :'( I think its a rage downvote. It irritates so much when you spend considerable amount of time on an answer and still get downvoted. Sighs
 
@thefourtheye Mention that literal_eval is not eval. Someguy doesn't now that I guess
 
@AnttiHaapala cbg :-)
 
3:59 PM
car-cbg from returning from abroad...
 
But anycase, all answers are good there
 
@BhargavRao Nah, the guy who deleted his answer only downvoted me. Earlier he has upvoted my answer, but then when he deleted his answer, he just downvoted mine.
 
Aha. Then all's well
 
Hope so. I read my answer and the question twice. I don't think its wrong.
 
Yeah. It is fine
 
4:07 PM
@MartijnPieters That dup recursion question may not be directly helpful to OP, right? It might give him some basic ideas only I guess.
 
@thefourtheye That's the point here.
Their problem is really really basic.
That Malik just posted the code without any explanation or help is not going to help that pupil to learn why that works.
 
That's true. They don't know how to do recursion.
 
The dupe on the other hand covers everything they need to learn about recursion.
Well, not everything, but certainly enough to cover what the coding exercise was supposed to teach them.
 
+1
 
4:10 PM
Yup, I tried to cover the very common stuff about recursion in that answer.
What else can be included in that? If you have anything in your mind throw it, I ll try to improve that answer :-)
 
Add the recursive pow as an example :D
 
In the dup answer? But that question was about finding the sum of list of numbers.
 
@thefourtheye this was a bit of a joke
FWIW I'd add that anyway
 
Oops, I seriously just started editing that answer :D
Cool, I ll do that
 
Yeah, you can show how to extend that to any operator. :-P
 
4:21 PM
Some people include "exercises" in their answers. They have little to do with questions but meh.
39
A: Why is XOR the default way to combine hashes?

Greg HewgillAssuming uniformly random (1-bit) inputs, the AND function output probability distribution is 75% 0 and 25% 1. Conversely, OR is 25% 0 and 75% 1. The XOR function is 50% 0 and 50% 1, therefore it is good for combining uniform probability distributions. This can be seen by writing out truth tabl...

 
Cool, I ll edit that after I finish ordering the pizza ;-)
@vaultah Even I have done that something like that at the last, here :D
 
Cucumber
Celery
Tomato
Crouton
tries to fit in
 
4:52 PM
Okay, I updated the answer with power function as well.
12
A: How can I find the sum of a list of numbers with recursion?

thefourtheyeWhenever you face a problem like this, try to express the result of the function with the same function. In your case, you can get the result by adding the first number with the result of calling the same function with rest of the elements in the list. For example, listSum([1, 3, 4, 5, 6]) = 1...

 
Upvoted
 
Melons :-) Keep thinking and please let me know if I can improve that.
Phew, that's a lot of text.
 
@vaultah and this answer is not even so good see
11
A: Why is XOR the default way to combine hashes?

Marcelo CantosIn spite of its handy bit-mixing properties, XOR is not a good way to combine hashes due to its commutativity. Consider what would happen if you stored the permutations of {1, 2, …, 10} in a hash table of 10-tuples. A much better choice is m * H(A) + H(B), where m is a large odd number. Credit:...

 
Same question by the same author, two different times asked. Both of them are closed. Here and here
Can we reopen this and close it as a duplicate as well?
 
Hey but are smileys allowed in answers?
 
5:03 PM
I guess so
 
But when had I upvoted his answer?
So confusing 😁
 
cbg Stephan
 
i defined a dict inside a dict node["address"]={}
now i wanna check if a specific key exists in that dict adress
if node["address.key"]:
does not work.. and i googled and did not find something useful
 
Really?
You didn't Google something like "check if key in dict"?
 
5:11 PM
569
Q: Check if a given key already exists in a dictionary

Mohan GulatiI wanted to test if a key exists in a dictionary before updating the value for the key. I wrote the following code: if 'key1' in dict.keys(): print "blah" else: print "boo" I think this is not the best way to accomplish this task. Is there a better way to test for a key in the dictionary?

First result
 
^ Was searching that in canon
 
mhm damn.. appaerently i even entered the wrong search
thank you very much the check works !
 
Please try harder to solve your problem next time, I really struggle to believe you spent any significant amount of time searching.
It's starting to get ridiculous.
 
try to calm down
 
I'm absolutely calm, don't mistake this for anger.
I am telling you it's starting to get ridiculous. I'm telling you you're abusing the good will of the people here. I'm telling you that people are starting to get fed up.
 
5:21 PM
i think its really bad form to start every sentence with I..but i am gracious enough to let that slide..follow my example
 
I kicked you.
 
lol
 
i dare you to do it again
 
He can't kick people that have already been kicked by me.
 
;_;
I really hope that was a third RO? Or was it you again @davidism?
 
5:31 PM
It was me again.
 
@StephanKetterer Please be nice here. People are trying to keep this room useful for everyone. Hope you understand.
@Ffisegydd I wanted to, but @davidism FGIWed me :'(
 
I like it when flags aren't even slightly ambiguous.
 
Fastest Kick in the West
4
 
And seeing as I'm here - if anyone has experience of using TypeHints in Python, do you find it's lack of runtime checking an actual problem, or does the static analysis pick up all the potential problems?
 
5:34 PM
I don't use TypeHints, but I know that the community is a bit split on them being allowed in the new Python 3.5.
I've never found lack of runtime checking an actual problem in general though.
 
Because the community thinks it's too quick to introduce them, or just doesn't like the details and think it should never be there?
 
I don't know their actual arguments for/against sorry.
 
One of the problems with type hints is that it requires you to anticipate every way a function could be used. Which means you get into weird situations where you have to define ABCs for everything. Or figure out how to represent "this type of value, or None". Or a bunch of other corner cases.
I've never run into a problem with the lack of type checking either.
 
"Or figure out how to represent "this type of value, or None"." - shouldn't that be something the caller has to think about?
i.e. if the variable is a certain type it's okay to make the call, if it's None, then the call should be skipped.
 
Yeah maybe. The simple case seems too limited to me, while real cases seem to get too verbose or complicated. Easier to just embrace duck typing and not worry about type validation.
 
5:40 PM
Good to see Ireland voting for common sense
 
I embraced a duck once. I got asked to leave the park....
3
 
Was the duck typing at the time? If it wasn't, that may have been the problem.
 
5:59 PM
WTF 1.3 million for, and 700k against - what world am I living in ffs?
bloody religion - bet that's what it comes down to
 
A world where less than half the population of Ireland votes.
 
only 2/3rds of the population that could vote bothered turning up for the GE
turn up and spoil your ballot at the least :)
 
 
1 hour later…
7:13 PM
cbg
 
cbg (Adam)
 
Hey up
 
Hiya :)
 
7:39 PM
esc-cbg :P
 
@Ffisegydd beta feature freeze tomorrow
 
9:00 PM
Its 02:30 IST. Somebody remind me why I am still here.
 
Hey guys. Need help with something?
 
Just ask.
 
@AidanCodeX Are you asking if we want help with something? :D
 
How do you make Cython gen 64bit code?
 
Maybe he's offering. I have got this annoying itch I could do with scratching...
 
9:07 PM
@JRichardSnape lol :D
 
@JRichardSnape Random
 
hi
 
Well, unexpected, maybe. Not really random as such.
 
@thefourtheye How does "asking a question" work?????????????
 
Anyway, not quite sure I understand your question. Do you mean make the C code generated optimised to take advantage of 64 bit hardware?
 
9:15 PM
@AidanCodeX Just shoot your question. People who have expertise might choose to help you with your problem :-)
 
@JRichardSnape Sorry, thanks. I have 64bit Python. When I compile Cython's c code -- even passing -m64 into gcc -- I get definition errors all over.
 
Hi @KeonKim
Definition errors all over... Are you using complex numbers in numpy by any chance?
Or indeed complex number types at all
 
I do love complex numbers, though I prefer using j rather than i, cos I'm badass.
 
Engineers and ffisegydd's FTW
 
A test program HelloWorld:
print("Hello world")
input()
exit()
 
9:20 PM
I also approve of Python using j as opposed to i.
Why exit()? Or is that something you need in Cython?
 
This sounds like it might be a full sure question. We'll definitely need the gcc error text
 
To make sure memory gets deallocated.
 
Full site, not sure, sorry (on phone)
 
Error copied:hi.o:hi.c:(.text+0x78): undefined reference to `_imp__PyObject_GetAttr'
hi.o:hi.c:(.text+0x8d): undefined reference to `_imp__PyExc_NameError'
hi.o:hi.c:(.text+0x98): undefined reference to `_imp__PyErr_Format'
hi.o:hi.c:(.text+0xb9): undefined reference to `_imp___PyThreadState_Current'
hi.o:hi.c:(.text+0xc8): undefined reference to `_imp___Py_CheckRecursionLimit'
hi.o:hi.c:(.text+0x11b): undefined reference to `_imp__PyErr_Occurred'
hi.o:hi.c:(.text+0x134): undefined reference to `_imp___Py_CheckRecursiveCall'
Sorry.
 
Ok, can't solve on phone right now. A guess is that you have a header file missing. Have only used cython with 32 bit python, but doubt that's the issue unless it specifically says something about it in docs
If no one swings in, make a ful site question and I'll have a look if I get a chance (national holiday weekend here in UK, so no guarantees)
 
9:41 PM
Ah, just saw end of that trace. You're using MinGW. It's probably something nasty where gcc can't "see" libpython34 library from within MinGW for some reason. Try googling the exact error text from "undefined" to end of a single line
Oh, and with that you appear to have flown from the room.
Well, rhubarb to all who are about, time for me to hit the hay
 
10:06 PM
Cabbage :D
Isn't quit() just the same as sys.exit(0) which is the the same as exit(0), which all call the cleanup handlers? It's only os._exit() that basically quits without any memory deallocation?
I may very well be wrong, but that was my understanding. They were just different builtins that call the same function.
 
11:00 PM
cv-pls
http://stackoverflow.com/questions/30418371/civil-war-game-python-3-critique-please
 
use [tag:cv-pls] link optional_message to get the right format
 
@davidism Thanks!
 
11:49 PM
pepper
This one's on track for a Necromancer, I only answered it in January... stackoverflow.com/a/28060251/541136
paprika
garlic powder
bay leaf
 

« first day (1680 days earlier)      last day (3259 days later) »