« first day (2024 days earlier)      last day (2928 days later) » 

4:01 AM
last message posted 6 hours ago? Not on my watch. RESET!
 
4:33 AM
cbg
 
5:30 AM
cbg
I have a dictionary - {"2016-04-29":{"a":1,"b":2},"2016-04-30":{"a":2,"b":5}}
I want to convert it to a list where each key value pair is an item in list
[{"date":"2016-04-29","val":{"a":1,"b":2}},{"date":"2016-04-30","val":{"a":2,"b"‌​:5}}]
can it be done in one single statement
which is faster than running a loop on keys and append to list
 
6:15 AM
Hi guys!
I can't understand the logic behind this line. github.com/jvns/pandas-cookbook/blob/master/cookbook/…
rows_with_dashes = requests['Incident Zip'].str.contains('-').fillna(False)
shouldn't it be fillna(True)?
the aim to choose a subset of the rows in which the column contains that -
 
6:29 AM
cbg all
 
cbg! :)
 
7:15 AM
@RobertGrant I see what you mean and agree that for DataSci you need to be a jack of all trades. I still think that at least having some experience (not being a master or anything) of languages outside of your central domain is useful, whatever your domain. I think it gives you a broader view of a potential project.
But I see your point about all the different frameworks.
 
Thank you for spending the last 10 hours crafting that reply!
And don't tell me you were asleep! I want to feel special.
 
I just have one particular person in my head who is a Java dev but will come in and say stuff like "Oh I was playing with Julia and I learned something, I think it can help us solve X"
I was at the library all night hidden in a stack of books
And likewise I have another person in my head that I cannot describe in a public place but is the exact opposite in a very bad way
 
I guess I learned multiple languages (Java, Haskell, C++, Perl, Prolog, can't remember what else) at once at uni
But I was rubbish at all of them, no doubt
 
No doubt.
 
Would be interesting to see some old bobby code, but I think it's all lost
 
7:23 AM
In the Great Fire Of 98
 
Cabbage
@Anuj Certainly.
>>> d = {"2016-04-29": {"a": 1,"b": 2}, "2016-04-30": {"a": 2,"b": 5}}
>>> names = ("date", "val")
>>> [dict(zip(names, t)) for t in d.items()]
[{'date': '2016-04-29', 'val': {'a': 1, 'b': 2}}, {'date': '2016-04-30', 'val': {'a': 2, 'b': 5}}]
 
@Ffisegydd ouch!
 
Brb getting a shower. Definitely not readying my next reply.
 
7:40 AM
@RobertGrant Definitely. Once you know how to program, mastering the core of a new language doesn't take a lot of time, but learning about all the useful libraries and how to use them effectively is an ongoing task. I've been using Python for over a decade, but there are still quite a few standard modules I've barely even looked at because I've never needed them...
Or at least, I don't think I've needed them. :) Maybe I would have used them if I were more familiar with them, but due to ignorance I've re-invented the wheel. :)
 
7:55 AM
For the record, I'm also in the "You should learn one language well first" camp. You need to know a language in order to learn and practice the various essential programming concepts, and trying to learn multiple languages before you've solidified the programming concepts stuff can be confusing.
OTOH, it's also important to start learning other languages once you have acquired that foundation, otherwise there's the tendency to think that the way your first language does stuff is the One True Way, as DSM mentioned yesterday.
 
medium.com/@akosma/… is a good article that I linked the other day. In it the author suggests learning a new language every year and I think I agree (someone on the internet agrees with me, therefore I am correct)
 
@PM2Ring yeah I also think learning C is a good first language
 
"This message is too long my arse"
 
Hmm, hey guys! :) I'm using the tensorflow library for machine learning applications. I had something really strange happen in that I think an object got explicitly "casted" from one thing to another during run-time. Is this possible in python? Sorry if it's a stupid question, I'm just not as familiar with python than with C++/java
 
Going the whole lifetime I'd combine my sporadic arguments as thus:
 
8:05 AM
@vaultah I think that "hints" answers are appropriate for homework questions (or programming challenge questions like Project Euler, etc), even though we no longer have . If the hints are likely to help the OP and future readers with a similar question, then what's the harm? Should we just close as "too broad" when a newbie has done their best to ask a good question but doesn't know how to get started so they can't post a MCVE?
 
1. Learn to program (preferably with a single language that isn't too crazy).
 
I guess I'm a little prejudiced from SE.Mathematics, since "hints" answers over there are rather common. Sometimes I post hints on SO in the comments, OTOH, I've been criticized (by Lightness Races in Orbit) on SO Meta for suggesting that.
 
2. Learn other languages as you develop your skills.
3. Depending on your job you may focus on one language (or suite, in the case of HTML/JS/CSS for a web dev) above others - this is fine.
4. Learn other languages anyway if your time permits, even if it's in your own time for toy projects. These could be different frameworks for your core (i.e. learning Angular.js rather than using React), but I'd also suggest expanding your knowledgebase and doing something completely different to what you have to do everyday.
 
It was originally a numpy array, and after one cell of my jupyter ran a tensorflow script, the same variable now points to a completely different object. I know that you can't really change the objects since they are immutable, and I passed it into the function for it to be changed, so if you would try to say x = somethingelse, the x that was passed in wouldnt be modified
 
@Ffisegydd Yeah, I saw that. And when I was younger I tried to do that. FWIW, I barely remember the syntax of some of my earliest languages (like PL/I, APL, and COBOL), but I still remember the general programming principles I've learned along the way.
 
8:08 AM
And I'm sure that if you needed to, you could pick them up again rather quickly
I think that article has lessons for anyone, not just for someone over 40.
 
@OneRaynyDay Yes, it's possible to modify the type of a Python object, but it's rarely done in practice. OTOH, a new object may "accidentally" acquire the memory address (and hence the id) of an object that has been garbage-collected.
 
@PM2Ring Ah, I see :) That makes sense! Is it possible to cast it to something bigger? Would that technically consume other memory in other objects?
 
@Ffisegydd Definitely... although it'd take an awful lot of persuasion to get me to write in COBOL again. :)
 
Heh. COBOL is actually a really well paying language in the UK.
Just because so many critical systems have been written in it then never ported.
 
Money can be a good way to persuade people to perform unpleasant tasks. :) Seriously, though, COBOL isn't that bad. And when you consider that it was one of the first high-level languages ever created (as in, higher than assembler) it's pretty amazing.
 
8:17 AM
Ugh, the fact that it's doing the modification of type in my code makes the errors so hard to debug... google why
 
@RobertGrant I still love C, but I've never thought it was suitable as a beginners language. It's just a bit too low-level. People shouldn't need to know about man-handling memory and pointers when they're first learning general programming concepts, IMHO.
OTOH, I think it's a good idea to learn C very soon after your first language precisely so you do get exposure to pointers etc. I sometimes wonder about the wisdom of Python as a first language, due to how its data model is so different to that of most traditional languages.
@OneRaynyDay If code is actually casting a Python object to a different type and clobbering other objects then it is dangerously flawed, and you should file a bug report and stop using it immediately. But you should first ascertain that it's actually doing that. :)
 
(It's after I called their functions and passed this item in as a parameter, oh and also y is also a np array because I read it as an ndarray from h5py file)
 
@OneRaynyDay Sorry, I can't offer any help, since I don't know Numpy.
Rhubarb (going out for dinner, but I'll be back later).
 
It's no problem! Have fun at dinner :)
 
8:36 AM
@PM2Ring yeah I probably agree
 
9:10 AM
Another really good article that I read lately is zachholman.com/talk/firing-people
#6 from Github was fired and how it all went down, plus advice he found for the future.
 
 
2 hours later…
10:47 AM
How do I stop a python function from running without being called?
 
@MayukhNair Sorry? What do you mean?
 
@MayukhNair Are you taking about threads?
 
11:05 AM
never mind, got it. Forgot to write 'event' while defining my function...
 
I guess Mayukh Nair was trying to pass a callback function as an arg to an event binder, but was instead calling the function.
Hi, Antti. I got some feedback from Mark Adler, but I guess you've already see it:
If you mean me, this is the first time I thought of implementing Adler-32 in Mathematica. — Mark Adler yesterday
In other news, I got "Good Answer" on my recent SO Meta answer and "Mortarboard", which I found a bit weird since SO Meta doesn't award rep.
 
Basically means you got 20 net upvotes in a day...
The names you'd expect in the "legendary" club: meta.stackoverflow.com/help/badges/43/legendary :p
 
11:34 AM
You guessed it right @PM2Ring
 
@JonClements Yeah, I figured it must be that. It's nice that you still get the badge even though you don't get the points. :)
@MayukhNair It was easy to guess: it's a pretty common error. :)
 
@PM2Ring Yes! Oddly though, I couldn't find a solution to this on SO. I remember seeing 'event' somewhere while studying binds
 
@MayukhNair There are heaps of questions about this... but you do have to know how to ask the question.
 
Gah, got half-way through working out some overly-complicated code and they've gone and deleted the question :-/
 
@MayukhNair Here's a Tkinter example: stackoverflow.com/questions/5767228/…
 
11:44 AM
Hmm. Should've searched better. Thanks a ton!
 
@snakecharmerb Dontcha hate that! Sometimes I post a quick answer first and then go back and fill in the detail. But that can be dangerous: if the initial answer doesn't stand in its own right you can get downvotes, although I guess you can add a note saying: "More details will be added shortly", or something.
@MayukhNair That's ok. It's one of those things that can be tricky to search for when you don't know why your code isn't doing what you want.
@snakecharmerb Now that you've got me curious, do you have a link to the deleted question?
 
Yeah :) This was one of those people who can only iterate through indexes, so I was still trying to rewrite all the 'for i in range(len(foo))' stuff so I could read it ...

http://stackoverflow.com/questions/36965741/phonemes-and-graphemes-checking
 
@snakecharmerb Ta. The OP's code's not fantastic, but at a quick glance the question seems reasonable. I wonder why they decided to delete it? I guess they solved the problem themself and decided to delete so as not to waste people's time, not realising that you'd already devoted some time & energy to it.
@snakecharmerb The question is pretty narrow, so I guess it may not be of much interest to future readers. But if you disagree, let us know and we can vote to undelete it, so you can post your answer.
 
I don't think it's worth it - I haven't 'solved' it yet but I'd guess it's just an error in their logic, so no real value for future readers.
 
12:32 PM
Cbg
 
Check out this awesome (& somewhat scary) answer from the HNQ about the dangers of lithium batteries.
 
Ah yeah I saw that, it's ace
 
1:01 PM
@PM2Ring I saw that too. I was surprised.
Now listening to exuberant Country fiddle music in the hope it will finally galvanise me into finishing this job I have been avoiding for n months.
 
1:18 PM
now another problem: i want to change text and image on my tkinter labels and then start speech recognition, but despite writing them above the speech recognition code, the tkinter labels don't change until the speech recognizer is done
I know threading works, but how can I do so without giving an argument?
 
Hi, @direprobs. How did you go with that team partitioning problem? acm.timus.ru/problem.aspx?space=1&num=1106 I tried to solve it using Knuth's Algorithm X, but I couldn't figure out how to transform it into an Exact Cover problem. And I guess there are more efficient ways to do this than with Algorithm X. I ended up using a simple brute-force search, which should be fast enough if the total number of people is relatively small (eg under 20 or so).
 
correction: I know that in Java threading helps.....so I dunno if threading is the best way to go around it in python too. And if it is, how can I do it without passing an argument?
 
@MayukhNair You shouldn't need threading for this. And threading in Python is a bit dysfunctional, due to the Global Interpreter Lock (GIL). However, you probably don't need threading for this, you just need to organize your event handling logic correctly so that Tkinter has a chance to update the GUI before the speech recognition stuff is called.
 
@PM2Ring Can you suggest?
a better event handling logic
 
Can you create a small MCVE with a simple dummy routine in place of the speech recognition stuff?
 
1:27 PM
okay...its not formatting for some reason
@PM2Ring This should help
 
To post code in Chat you need to select it then hit the "Fixed Font" button on the screen or Ctrl-k on your keyboard. But you should only post small snippets of code here, a dozen lines or so. And you should not post images of code. How do you expect me to modify code that's in an image?
 
def geticon(event):
    global stage
    if stage==0:
        print("Clicked")
        micimg['file']=events.getIconImage(stage)
        micLabel['image']=micimg
        statusLabel['text']="I'm listening.."
        micstat=events.openMic()
        if micstat=="Couldn't understand what you said":
            statusLabel['text']=micstat
            textLabel['text']="Try speaking clearly."
        elif micstat=="Oops, something went wrong:":
            statusLabel['text']=micstat
            textLabel['text']="Check your connection, system permissions and try again."
thanks for the formatting help
 
I'll have a quick look at your code in a minute or two, but please don't do that again.
 
sure. I'm really sorry, I was trying to format it in chat using `` but that didn't help
 
I take it that the GUI isn't updating this stuff:
micLabel['image']=micimg
statusLabel['text']="I'm listening.."
until after `micstat=events.openMic()` returns. Is that correct?
 
1:41 PM
cbg!! Finally back home. Feels good.
 
Hi, idjaw.
 
hello! How's it going?
 
Not bad. It's been a slow weekend on SO, but I got a good score on SO Meta: meta.stackoverflow.com/questions/322096/…
 
aye aye cap'n
 
aye pup
@PM2Ring agree with your post. Especially the final statement about earning rep for dupes. It would really help clean things up by providing more incentive to do so. It would solve a lot of FGITW problems.
 
1:48 PM
@PM2Ring Was away for a while, yeah, that's the prob
 
@idjaw Sadly, the powers that be do not agree... but the momentum for it seems to be increasing in the community.
 
@PM2Ring Maybe with more and more people agreeing with rep-for-dupes, it might help swing their vote towards yay than nay.
 
@MayukhNair Ok. In that case, try adding a call to update_idletasks() after you modify the label data but before you call the speech recog stuff.
 
@PM2Ring works like a charm
 
@idjaw That's the plan. :) As far as I can tell, if we can convince Shog9 then we might see some action.
@MayukhNair Excellent.
 
1:53 PM
@PM2Ring Thanks a ton
 
Morning cabbage.
 
Here's Shog9's feelings on the matter: meta.stackoverflow.com/a/316682/4014959
@MayukhNair Not a problem.
 
@PM2Ring It feels like more of an evolution of the site. More and more information is available. Probability of duplicates are much higher. Therefore, to be a valued member of the community, it is worth more to clean-up the low quality and dupe questions with the high quality answers that are still relevant. Best way to do that? Internet points. From my experience here: rep >> badges
 
Cbg Morgen, Morgan.
 
cbg Morgan
 
1:59 PM
Ironically, not long after writing that Meta answer I dupe-close-voted a question that Martijn answered, and Fizzy hammered it. But to be fair, Martijn's answer is excellent and condenses all the relevant answers from the linked questions. So it was certainly ok that he wrote an answer. And he didn't complain that we dupe-closed it. Of course, nobody could post competing answers after we closed it. :D
 
Dom
Hola amigos
Is it cleaner to use a function that finds and calls another function based on the argument passed in rather than using a bunch of if statements?
ie. users can choose to rank by either wins, losses or draws, and then I pass their choice to another function which finds and calls either count_wins, count_losses or count_draws
I'm wondering if I'm overthinking it, but I don't like using if choice = 'wins': count_wins(), else if choice = 'losses': count_losses().. etc. - it looks ugly to me
 
2:16 PM
@Dom You can use a dictionary of functions.
 
Dom
Huh, I didn't think of that, sounds even cleaner :)
 
@AnttiHaapala Well....if you have other packages that are not compatible withi Python 3 that you absolutely must use, then Python 2. But major packages like numpy etc have been working with P3 for a while now. So that excuse is becoming obsolete...:) OTOH I use anaconda and I just use whatever default it installs, which is still P2 I think :)
 
Dom
Awesome :) thanks @PM2Ring
 
It's Python's answer to the switch / case of other languages; but it's less general, in that each alternative has to be wrapped in a function (possibly a lambda). And you don't have drop-through cases. So although it's less versatile it's got better encapsulation and you're less likely to shoot yourself in the foot with it.
 
2:20 PM
Oh wait anaconda now has Python3 up there...there goes that excuse :)
 
Dom
@PM2Ring sorry, I struggle with terms sometimes, do you mean each dictionary entry needs to be a function? and what do you mean by drop-through cases?
 
Of course, the Dispatch Dictionary isn't unique to Python. A very common use case is to allow a DLL's functions to be called by name from a scripting language, although the dispatching may simply use a list of names and function pointers that's searched linearly, rather than going to the bother of using an actual dictionary.
@Dom You'd be familiar with drop-through cases if you know the C switch statement. If the term means nothing to you, you needn't worry about it. :)
@Dom You're dict needs to look something like this: dispatch = {'wins': wins_func, 'losses': losses_func, 'draws': draws_func}
Then you can do dispatch[choice](args)
 
Dom
thanks that's exactly what I went for, about to test it out, I often forget how useful dictionaries are
I think a lot of switches/bunches of ifs can be done with a dictionary instead
 
Functions as objects make stuff better
 
user559633
cbg
 
2:37 PM
OTOH, don't go around madly converting all your if/elif/else blocks to dispatch dictionaries. They work best when all the functions take the same args. Also, there's a little bit of overhead in calling functions, so if the if/elif/else block is clear and you don't really need to put the stuff your executing into functions the if/elif/else approach will be a little faster.
 
Dom
@PM2Ring hmmm isn't it also a tradeoff between speed and extensibility?
 
user559633
Well, and readability.
 
Dom
btw it's not playing nice :( the functions are staticmethods of a class, and it's telling me name 'RpslsApi' is not defined - RpslsApi is the name of the class
 
Are you putting the full method names in the dict? And are you defining the dict after you've defined the class?
 
Dom
yeah, stat_counters = {'wins': RpslsApi.count_wins,
'losses': RpslsApi.count_losses,
'draws': RpslsApi.count_draws }
tried defining it inside and outside the class, same error
 
2:42 PM
@PM2Ring I personally don't understand the question itself after reading it many times, so basically I booked marked the page up until I find a free time. I may consult a mathematician, since I can't state the question in my own words this means I don't get it. I'm busy finishing a long book, been reading it for 3 years and hopefully will finish it this year.
 
Dom
ok it needs to go underneath the class?
 
@Dom Yep. Python doesn't know what the class name means until after it's executed the class definition.
 
Dom
I was hoping to move all my dicts into a separate file and import in, but I guess that won't work
GAE doesn't play very nice with Python, I can't use decorators either afaik, not the decorators I want to use anyway
 
@direprobs The question itself is fairly basic; coming up with an efficient general algorithm for it is hard. So maybe it's a language issue. Is English your first language?
 
Dom
it works now, thanks @PM2Ring
 
2:48 PM
@Dom Phew!
 
Dom
:D
 
It's always a bit dicey debugging code that you only see fragments of. But I seem to be doing pretty well tonight. :)
I guess it's good practice for this:
2 days ago, by Ffisegydd
Project Idea: The Sopython Psychic Debugging Olympics! We line up an ever-more-difficult collection of psychic debugging scenarios, people note their ideas down in secret and are then judged for closeness by our panel of expert judges!
:)
 
The introduction to the flask-principal docs makes no sense to me
 
3:07 PM
there is some mistery:

with this code:

from contextlib import contextmanager
from time import time
@contextmanager
def mytimeit(name="snippet"):
    before = time()
    yield
    after = time()
    print("{name} duration: {delay} ms".format(name=name,delay=after-before))


the interpreter


>>> with mytimeit.mytimeit():1;2;3
...
1
2
3
I wonder how the interpreter know it has three things to display
 
@XavierCombelle Erm, because they're inside the with block.
 
@PM2Ring I really don't know much about that question yet, cuz I didn't spend enough time trying to solve it, but I tried to understand it, what I'm stuck at was the input, why did they input these numbers, for example they started with 7, so N=7, the output was like a magic and the next line of input was another riddle too, at least to me.
I guess it has something to do with graph theory
 
@direprobs The first number in the input data is the total number of people. So here we have 7 people to assign to the two teams. Then each subsequent line is the friends data for each person, using 1-based indexing. The data looks like this:
 
@PM2Ring how could he know there is three things to print ?
 
7
2 3 0
3 1 0
1 2 4 5 0
3 0
3 0
7 0
6 0
Each line of friends data ends in a zero - that lets us handle the case of people having no friends in the group. Line 1 is 2 3 0, which means that person 1 is friends with person 2 and person 3. Line 2 is 3 1 0, so person 2 is friends with person 1 and person 3. Etc.
Person 3 has the most friends. An efficient solution-finder would start with person 3. Persons 6 and 7 only know each other, so they have to go on opposing teams.
 
3:29 PM
Okay, so output
The question says the first line should contain the number of people in the first team
 
Hey up
 
Wait, I think you got something wrong here
 
user559633
hey up fizzy
 
Hi @Ffisegydd
 
user559633
day 2 of trying to grab a couple domain names. salt the internet.
 
3:33 PM
I'll defer this question for another day LOL
 
@XavierCombelle Because you inlined the contents of the with block. There are 3 items there, and there's no legal way to add any further items on the following line. And in the interpreter you're forced to enter a blank line (or comment) as the next line after that inlined with
 
@PM2Ring that I don't understand is how he know he has something to print under the with. I looked on the code and codeop module and did not find any hint
 
@direprobs Sorry for the delay - I had a minor modem problem. The info says the first number is the total number of people in the whole group. The first number in the output "should contain the number of people in the first team or zero if it is impossible to divide people into two teams".
@direprobs If you like. My brute-force code is pretty small, and you should be able to follow it. FWIW, here are the solutions I found. My output is a pair of lists of the 2 teams, it's not in the format requested on that page.
[2, 4, 5, 7] [1, 3, 6]
[2, 3, 7] [1, 4, 5, 6]
[3, 7] [1, 2, 4, 5, 6]
[2, 4, 5, 6] [1, 3, 7]
[2, 3, 6] [1, 4, 5, 7]
[3, 6] [1, 2, 4, 5, 7]
@XavierCombelle That's just the REPL printing stuff that hasn't been assigned to a name. Start up the interpreter, enter 1;2;3 on a line and those numbers will get printed. All the context manager does is print how long it took for whatever stuff is inside the with block to get executed.
 
@PM2Ring Yes but how the interpreter know there is something to print
 
@XavierCombelle We seem to be talking at cross-purposes. Do you understand why this does what it does?
>>> 1;2;3
1
2
3
 
3:50 PM
@PM2Ring until now I supposed that underthe hood, it does something like _=1;_=2;_3;print(_) but obviously it does something different
 
@PM2Ring Hmm! Interesting
 
@XavierCombelle it's just evaluating three expressions, no?
 
@XavierCombelle Well, it's something like that. The interactive interpreter is a REPL: a Read-Evaluate-Print Loop. So it gets each line (including stuff delimited by ;), and evaluates it. If it figures out that the line is just a simple expression that's unassigned to a name it prints the value of that expression, if the value isn't None, and assigns the value to the name _.
 
@PM2Ring but if it's the case how it know that it must do something with the with statement
@RobertGrant it also print the result
and I did find nowhere in the code and the codeop modules where he print the results
 
4:03 PM
Yeah, doesn't evaluating a statement in the REPL print the result?
>>> 1;2;3
1
2
3
I'm probably missing the point, because your python is better than mine
 
@tristan LOL. I suspect that the title is inspired by Thelonius Monk's Well, You Needn't. Monk's melodies were often quirky and left-field. But Monk was an excellent composer & player who knew how to break the rules artfully.
@XavierCombelle If you run that code from a script it won't print 1 2 3. You'd have to modify it, eg.
from contextlib import contextmanager
from time import time
@contextmanager
def mytimeit(name="snippet"):
    before = time()
    yield
    after = time()
    print("{name} duration: {delay} ms".format(name=name,delay=after-before))

with mytimeit('stuff'):
    print(1, 2, 3)
output
1 2 3
stuff duration: 9.20295715332e-05 ms
 
@PM2Ring my code don't do anything but the REPL does
I wonder how the REPL know when there is something to print
 
@MartijnPieters Most probably not - just because the next couple of contracts need some on-site work, tying me here. But if you could fire me a quick brief, I would be able to say definitively. When's it starting?
 
@XavierCombelle It only knows what you tell it. And you told it to print 1 2 3 on separate lines by making 1;2;3 the contents of the with block.
@direprobs: FWIW, here's that code. I won't repeat the input data that I posted earlier, but in my code it's in a triple quoted multi-line string named data.
def check(a, b):
    ''' Check that all members of a have a friend in b '''
    in_b = b.intersection
    return all(in_b(friends[u]) for u in a)

data = data.splitlines()
friends = [set(int(v) for v in u.split()[:-1]) for u in data[1:]]
num = len(friends) - 1

#Check all possible partitions with person 1 in team 1 so we don't get dupes
for i in xrange(1, (1 << num) - 2, 2):
    teams = a, b = set(), set()
    for j in range(num):
        teams[(i >> j) & 1].add(j + 1)
    if check(a, b) and check(b, a):
 
4:18 PM
@XavierCombelle The REPL prints the result of any expression with a value, the expression 1 has a value, so it prints it
 
@Natecat but where the REPL know it has something to print ?
 
because it sees the expression 1
it evaluates that
the result is 1
so it prints it
it moves onto the next expression 2 and does the same thing
 
I found my answer
The mode argument specifies what kind of code must be compiled; it can be 'exec' if source consists of a sequence of statements, 'eval' if it consists of a single expression, or 'single' if it consists of a single interactive statement (in the latter case, expression statements that evaluate to something other than None will be printed).
thanks to all
 
Anonymous
Hm.., has anyone ever encountered this error?
 
Anonymous
/usr/lib/python3.4/site-packages/pymysql/cursors.py:158: Warning: Incorrect datetime value: '1997'
 
Anonymous
4:29 PM
My script used to work fine some days ago, but now there is this error I can't seem to figure out.
 
Anonymous
Solved!!
 
Anonymous
/stupid mysql
 
No Man's Sky is out end of June :o
No Man's Sky, Stellaris, and Overwatch. All in the next 1-2 months.
 
Anonymous
I thought it was a movie :\
 
a thing fun is that a single interactive statement is not what is usually called a statement (in ast for example), it can compouned by several ast statement
 
user559633
4:40 PM
playstation 4 is the objectively better console, correct?
 
for info I stumbled upon by doing with mytimeit.mytimeit():list(range(2**24)) which unexpectly for me print junk
 
Dom
Can anyone explain to me why I have to use a resource container for post requests to my GAE API when it works anyway with plain old message classes?
The docs, and my learning course don't explain why, they just say you have to.
Docs:
 
@tristan for power yes
Xbone has some quite nice stuff but for pure gaming ps4 all the way. Unless you want to play halo or some other exclusive
 
user559633
@RobertGrant No interest in Halo, thanks :)
 
user559633
Actually the answer I wanted as I don't want to give money to microsoft. I don't trust them and believe they'll try to do the "just place this video camera in your home for us" and always-on to play local games again.
 
4:53 PM
Also the One controller is pretty much the best thing ever
My xbone has no video camera
 
Dom
@tristan You can play it without Kinect plugged in
My friend got banned temporarily for swearing too much because Kinect was listening to him
 
MS backed down sharpish when confronted, as usual.
@Dom because kinect was listening, or because he got flagged as abusive by other players?
 
Dom
just because Kinect was listening lol
I love how they implied that Xbox 360 games were incompatible for over a year and then finally did a u-turn, I always said to my friends it was just a choice, and it was nice to be proven right
 
360 games were incompatible; they built an amazing system to bridge the gap
Much better than the always-on ps4 back compat
Which is just gaikai streaming
 
Dom
Incompatible with the software design choices they made, not the hardware in the way they implied, afaik
 
4:58 PM
That makes no sense. Hardware can be emulated with enough work; there's no distinction.
 
Dom
The laymen (my friends) generally figured the disc couldn't be read so it was impossible
 
Except that with big hardware differences (which were smaller between 360 and One than ps3 and ps4, but still very much present) it takes a crapload of software work to remove them.
Well no, because the discs were DVDs. That's obviously not it. However there were big real hardware differences
 

« first day (2024 days earlier)      last day (2928 days later) »