« first day (2317 days earlier)      last day (2629 days later) » 

12:07 AM
@AndrasDeak I'm not sure i understand.
 
@Tokencodingnewbie t and t[:] have a different id, so they are different objects, so t is at least a shallow copy
if t is a nested list, then t[:] will not be a deep copy, so you might get surprising results
but anyway your question doesn't contain sufficient information to be answered, which was my main point
 
@AndrasDeak the copy is completely intentional?
 
?
beg your pardon?
 
@Tokencodingnewbie They're right though, it's not a [MCVE]. We need to know what your coords and guess_point look like.
 
you're hereby free to refer to me as "he" :P
 
12:11 AM
@AndrasDeak Oh, nevermind, misread the inner part. That is pretty confusing.
 
Inner part of what? Now I'm confused:D
 
I';m not sure what an MCVE is, I'm sory
 
then go google it
 
really?
 
12:12 AM
Yeah
Is it just enough code so you can run it?
What it looked like.
 
I got it now
I think I was reading the wrong thing lol
 
possible
 
Yeah I'm not the brightest
but I'm hoping I could at least learn to code lol
 
@AndrasDeak
can i ask u something
 
12:28 AM
no, sorry
 
Ok so the loop looks like it just checks the first element of the first list then bounces out, here is the code, I didn't know what to condense since the code is so small to begin with. Just looking for a nudge in the right direction, thank you. pastebin.com/8teKjhxG
 
twoshipcoords and oneshipcoord are nested lists, aren't they?
 
and by that you mean a list within a list?
 
yes
a list of lists, or a list of list of lists, or ...
 
Yeah they are.
 
 
3 hours later…
3:27 AM
@AndrasDeak I just noticed you were referring to yourself lol so there is no way to iterate through two nested lists?
 
sure there is, but if you're deleting from a shallow copy, you'll have problems
the straightforward solution is to use a deep copy
 
@AndrasDeak I think this is the proper way to show MCVE to you? pastebin.com/g8rEGswX
 
@Tokencodingnewbie perfect!
 
I'll have to read more about this shallow copy, deep copy thing. I feel like this has gone too advance for the code academy project, but maybe that is the point.
 
you can generally perform a deep copy using copy.deepcopy, but in your specific case you probably won't have to
@Tokencodingnewbie well, this is pretty closely related to how python works, so it's probably coincidental that you ran into this subtlety now
 
3:34 AM
I tend to over think things and make it harder than it is too
 
so, since you know you have a list of lists, you can do def my_cpy(list_of_lists): return [lst[:] for lst in list_of_lists] unless I'm mistaken
this wouldn't work for multiple levels of nesting, but it should work for a single nesting level
 
That line of code looks like giberish to me :(
 
>>> def my_cpy(list_of_lists): return [lst[:] for lst in list_of_lists]
...
>>> t = [[0, 0], [0, 1]]
>>> t1 = t[:]
>>> t2 = my_cpy(t)
>>> id(t),id(t1),id(t2)
(140439376401800, 140439376400456, 140439376362824)
>>> print(t,t1,t2)
[[0, 0], [0, 1]] [[0, 0], [0, 1]] [[0, 0], [0, 1]]
>>> t2.pop()
[0, 1]
>>> print(t,t1,t2)
[[0, 0], [0, 1]] [[0, 0], [0, 1]] [[0, 0]]
>>> t1.pop()
[0, 1]
>>> print(t,t1,t2)
[[0, 0], [0, 1]] [[0, 0]] [[0, 0]]
let me write the function properly:
def my_cpy(list_of_lists):
    return [lst[:] for lst in list_of_lists]
it loops ove your input list in a list comprehension, and copies each sublist instead of copying the top-level list itself
it's functionally equivalent to:
def my_cpy(list_of_lists):
    outlist_of_lists = []
    for lst in list_of_lists:
        outlist_of_lists.append(lst[:])
    return outlist_of_lists
And my example code above shows that t[:] will only create a shallow copy: calling t1.pop() will modify t as well. On the other hand, t2 from this custom deepcopy function is really a deep copy: mutating it doesn't harm the original list of lists.
And note that this is not evident from the id()s of the lists: shallow copies also have a different ID from the original (hence "copy"), but the references inside them are the same as the original (hence "shallow")
but you probably have a different problem altogether.....
>>> twoshipcoords = [[0, 0], [0, 1]]
>>> oneshipcoords = [[2,2]]
>>> print(list(zip(twoshipcoords,oneshipcoords)))
[([0, 0], [2, 2])]
you're zipping a 2-length list with a 1-length list
still, it's never too early to learn about deep copies
You probably want something like itertools.chain instead of zip here, but the stuff inside your for loop won't work like that. You'll probably have to think more about what exactly you're trying to do.
 
4:03 AM
good night
 
4:35 AM
@AndrasDeak Thank you for the write up, it's still kinda makes little sense to me. Maybe I should rethink how to do this I'll retool it today or tomorrow and see what I can make.
 
 
2 hours later…
6:16 AM
“PHP 7 was released over one year ago - is PHP finally a viable alternative for writing large web applications?” https://medium.com/@anttihaapala/php-7-was-released-over-one-year-ago-is-php-finally-a-viable-alternative-for-writing-large-web-cb87d8f272#.u84zbycuq
5
Antti's recent paper on PHP
Very nicely written
 
@MooingRawr I am good. Yesterday one of my friend came back after 6 month from your place (Ontario). Was with him.
 
6:31 AM
@khajvah lol oneboxin breaks the link
 
7:24 AM
wow
I've been receiving upvotes to my generator-as-an-argument a, didn't realize that it was because the question had a bounty
 
 
2 hours later…
10:39 AM
aww, khajvah has his old pink avatar on twitter, that's cute
brief cbg
@Antti I think I told you about a referendum initialized by an NGO, to ask whether citizens of Budapest want to host the olympics, currently in the phase of collecting signatures. Well, they need 138k valid signatures in order to actually have a referendum. Deadline was yesterday, turns out they have 266k signatures. There'll be a loooot of invalid votes (multiple votes and sabotage both), but there's still almost a 100% margin of error there
@khajvah haha, meta-somebody's-law-of-headlines headline:D
just found this keybase thing, seems interesting
 
@AndrasDeak good
@AndrasDeak Betteridge's law
which, surprisingly was "YIL"
 
11:15 AM
@AnttiHaapala incidentally, the government might back out of the whole project before they get a chance to lose at the referendum:D
 
Guys, in PANDAS how do I get all column names at the 1st level of a Multiindex DF?
I think it must be something like df.columns.get_level_values()
but I cant get it to work
 
I can't help you, but it's lowercase pandas;)
rhubarb
 
I think I found it! :)
 
@AndrasDeak I hear you're missing me.
Me specifically, no one else.
If you'd like, I can show you a whole new world
 
11:38 AM
hey guys. I came here to ask if you people would be interested in a bot which posts LQP tagged [python] in this room. This has a pretty good accuracy, and you can see example reports over here.
 
I don't think so, no.
 
ok sure. Sorry to disturb then. I just noticed many reports were tagged [python] and thought you would be interested.
 
11:52 AM
@AndrasDeak I'd really want to see the summer olympics be moved into Greece for good, they still might have the venues, that's where they're from, and they really could use the tourist money :D
 
@AshishAhuja We don't want close / delete requests to dominate the room, but we are happy to close fresh bad questions that are attracting answers. With borderline questions we like to post comments to encourage the OP to fix the question and give them time to do so before posting a cv-pls request. Those regulars who want to do more CV work know where to find SOCVR and SOBotics
 
@AndrasDeak i has such idea too and then found KB but keybase is overcomplicating things
If the idea is to link your public keys to your social profiles, what's the need for complicated stuff that they are doing?
 
12:11 PM
@khajvah they publish announcements in a block chain
 
cool but they are trying to do everything
chat, filesystem, god knows what. Why not make the social profile linking thingies and provide an API for other apps to use
 
@Ffisegydd <3 I was too afraid to be open about it
 
@Andras post your email address (then feel free to delete it straight away)
As I need to invite you
Or use another method to let me know your email, whatever.
 
Sounds fishy:D Ah. Just a sec...
aww thank you <3
 
user6845426
1:12 PM
cbg o/
 
1:25 PM
cbg
lol, Finnish language... Man attempts to kill woman with Nokia... translation error .. "in town of Nokia"
 
user6845426
Nokia phones are deadly
 
... the point being that you can deduce whether it means in the town or with a mobile phone only from context...
 
lol at top comment:
> obviously reversed, this is how it's made
 
XD
 
2:08 PM
@PM2Ring ok, thanks for the clarification! I won't disturb you guys again, sorry.
 
2:27 PM
nice movie
the lead actor was amazing too
 
Man, I loved my Nokia phone(s)
 
Windows ruined Nokia
 
Honestly though, if you could give me one of those Nokia phones like the 3310 that I could turn a wifi hostpot on, I'd be set for life
@khajvah True story
saddest day of my life
 
2:42 PM
I was in Vietnam, I had just bought a not-really-operating-system-wise-fully-working C7 there as it was the only one that they promised they could install European firmware on it, lol, and then just soon after the burning platform memo, lol.
so, like "thanks nokia, for making sure that my phone continues to work and receive updates and all that."
 
hopefully not
I wish I was an Astronaut
 
cAbBaGe
 
CaBbAgE
@khajvah Did you see the 104-satellite launch?
 
@BhargavRao Nope, I am not really reading the news constantly. I watch only when I randomly catch it.
104
I thought that was the name :/
turns out it's the number of satellites
 
Ah! I've got an news app that alerts me of any nice happenings
 
2:55 PM
@BhargavRao like suomi
 
what app?
 
@khajvah Aww, Sorry for that... :(
 
congrats to India
 
@BhargavRao 104-satellite launch
 
@AnttiHaapala Fixed it, Thanks!
 
3:01 PM
or even better, launch of 104 satellites
 
aaaaand mission aborted
 
ahha :D
I wondered why the webcast just stopped
didn't have sound :(
stupid
 
Windows decided to update
probablyt
 
yea
pesky XP
so what, where are the updates now?
transparent communication anyone?
 
@AnttiHaapala they can't do it today, as it's supposed to get to ISS
the next try is tomorrow
 
3:21 PM
yes, but where are the communications :D
Standing down to take a closer look at positioning of the second stage engine nozzle. 9:38am ET tomorrow is next earliest launch opportunity
 
3:50 PM
Hello, world
 
Hello
 
What do you working on?
 
I work with the magical cloud using OpenStack
 
user6845426
o/
 
user6845426
ahoy
 
3:57 PM
I can't stop laughing
 
user6845426
hahahah
 
user6845426
0 fks
 
4:26 PM
Legion is a weeeeeird show and I love it
 
haha wtf
 
 
1 hour later…
5:50 PM
Good morning! I'm writing my first code in Python because it's a programming assignment at my sons' school and the project seemed so interesting i wanted to try it. But I live in Ruby so this stuff is very foreign to me.

Here's my question, probably one of many very, very basic questions: if I have def game(strat1,strat2) where I am passing in strategy functions to play a game, like this:
game(hard_player,soft_player)
inside the game function, can I access the NAME of those functions? In ruby it would be something like hard_player.name
 
user6845426
The actual name of that function??
 
yes.
it looks like something called inspect can get you the name of calling functions above you,
but what if you want to just get the name of a function that was passed in as a parameter? the function game only knows those as strat1 and strat2. can i address the names of them above the game function?
 
user6845426
Why can't you just hardcode say print the function name? because the function name isn't going to change?
 
it changes all the time.
you pass different strategies to game() to test them.
i wanted it to be nice and show WHICH strategy functions it was testing.
 
user6845426
ah
 
5:56 PM
game(random_player,agro_player)
typical call.
 
user6845426
Can I see your code?
 
>>> def foo(x):
...  print(x.__name__)
...
>>> def bar():
...  pass
...
>>> foo(bar)
bar
>>>
 
oooooooh, exactly what i wanted.
so there are some special __ object attributes on there.
thanks!
 
opened and on desktop now, thanks. was hoping not to learn TOO much for something i planned to only do for one morning of a weekend, but you never know.
 
user6845426
5:59 PM
Nothings ever plane sailing is it lol
 
user6845426
6:42 PM
Can someone recommend a good learning resource for Tkinter (other than the docs)
 
@ColinSummers btw, you shouldn't feel too foreign after ruby
 
it's not so bad, just snagged by syntax. elif: elsif sort of stuff.
can i use the "computation #{2 + 2} in the string" stuff in Python? or is that a Ruby thing?
(me: BASIC, Pascal, HyperTalk, tcl, Ruby. All just self-taught.)
 
user6845426
that'll combine 2 string wont it
 
in Ruby that would just print "omputation 4 in the string"
the #{} constructor escapes out of the string to the interpreter for a moment. you can stick variables in there, math, etc.
 
@ColinSummers why don't you try it and see?
It's not like you're doing a compiled language with a lot of extra steps, you just need to type python in your terminal when it's installed and try it. Just like with ruby ;)
 
6:56 PM
that's true. but someone might have said, "That won't work, but the %[] syntax does exactly the same thing inside a string."
 
user6845426
You can do
 
user6845426
print "Hello {0} world".format(4+4)
 
i would point out that this programming assignment has sample code where there's a while loop: while True: and then in the body they do a couple different tests that Break out of the loop. that seems like a poor example to give beginning CS students.
 
user6845426
How so?
 
everything i have read says that while loops that you break out of in random spots are a bad pattern to follow. the while condition should be set somewhere by the loop action. while True and break usually means you should have had a different construction.
no?
 
user6845426
7:05 PM
Theres the possibility that something can occur in the loop the satisifies the overall requirement without satisfying the overall loop condition
 
user6845426
If you mean using break;
 
@ColinSummers Then you have an XY problem. You're hoping for an answer for something you didn't ask :P
 
7:56 PM
TIL: I should save more.
 
8:13 PM
If it isn't about money you probably should use VCS more too
 
Hi guys
 
...
 
hello
 
user6568562
Hey @idjaw
 
hey @randomhopeful long time
how are you
 
user6568562
8:26 PM
I'm fine, thank you [ : Feels good to chillax. What about you ? I know I'm asking a bit late, but how did that talk go ?
 
@randomhopeful 😀 It went great actually. Thanks for asking. I got very positive feedback. So that was really great to hear
 
user6568562
@idjaw Nice ! You did work pretty hard at it so feedback isn't surprising
 
9:30 PM
cbg
 
user6568562
Cbg Andras
 
How are you, random?:)
 
user6568562
Nice and chilling, and it feels awesome. How about you ?
 
Bit tired, it's been an exceptionally busy week. Otherwise all's fine:)
 
user6568562
Busy week at your university ? If I may be indiscreet
 
9:35 PM
yup, entirely professional business
and mostly minor things, but too many of them all at once:D
 
user6568562
That avalanche law, damn tiring for sure. Good thing it's the week end :P
 
I'm going to a conference next week, so I can hardly rest this time:/
 
user6568562
I can understand : / Good luck, man, and you know you can do it, anyway
 
user6568562
What will it be about ?
 
Is python nowadays harder than C#?
 
9:55 PM
@randomhopeful thanks:)
it's a very specific workshop aimed at teaching me some practical stuff
@paul23 I don't think question throughput is a univariate function of any kind of difficulty metric
 
user6568562
Best kind of workshop, then
 
yup, hopefully it'll be nice
 
user6568562
@paul23 I think it's more because of dumb people like yours truly are trying to learn Python
 

« first day (2317 days earlier)      last day (2629 days later) »