« first day (3112 days earlier)      last day (1833 days later) » 
00:00 - 17:0017:00 - 00:00

5:10 PM
Just updated a 3 year old answer and I feel good about it (-:
 
5:26 PM
Hey, guys!
It has been a while
 
hello
 
@SebastianAlexanderBNielsen hey
 
@vaultah oh, how haven't you deleted that yet?
Seeing as organically starred comments are deleted quite frequently here ;)
 
@cs95 quite frankly we are afraid that Martijn will nuke us
Starred messages is a very serious matter
13
 
No kidding
 
user7437554
5:36 PM
Hello again guys, there is a conceptual question I am not able to answer
 
user7437554
def remove_element(element):
  del element[-1]
  return element
 
I see one concept that needs clearing up
 
^^ Which is?
 
The argument being passed in is not an element, but a sequence, whose last value is being deleted
 
user7437554
I wrote that function. What confuses me is the following: return element, shouldn't take the initial value?
 
user7437554
5:39 PM
yes, that's because I'm puzzled but forget about it @PaulMcG
 
user7437554
Is the question clear enough?
 
element (the sequence) is being modified in place in this method, so the value returned will be the same sequence, shorter by one
Did you think that you were working on a copy?
This is a common confusion for new people, by the way
 
user7437554
Well, what confuses me is that I haven't 'stored' the new list
 
There is no new list
 
user7437554
element=[1,2,3,4,5]
 
user7437554
5:42 PM
then element=[1,2,3,4]
 
user7437554
but I havent told the code to assign [1,2,3,4] to element
 
user7437554
:@
 
The same list is modified inside the function
 
its a mutation
 
element was modified in place, a new list was never created
 
5:43 PM
just like say, have you used append for list?
 
The name element doesn't actually have to be an element of a sequence. it has to be something in which doing del element[-1] doesn't break. Depending on what element actually is it may do different things.
If element is a list, it will remove the last element from the list and return the same list minus its last element.
 
user7437554
@ParitoshSingh Yes I have but still the same question, I should just memorize this property?
 
It isn't even necessary to return element from this method - element is being modified in place
 
if element is a dictionary, hopefully with a key of -1 it will return that dictionary back less it's -1, value pair.
 
Try removing the 'return' statement - the code will behave the same
 
5:46 PM
^
 
Is it because the post was undeleted by a moderator that I can't vote to delete? I hadn't voted the first time round.
 
Correct
 
👎
That's bad design.
 
user7437554
@PaulMcG But if I need this value later?
 
You mean the original list?
 
user7437554
5:49 PM
No, the output
 
mutations. modifications in place. such as append, you have the object already with you
 
The resulting list with one less item?
 
user7437554
yes
 
You still have it - it is the original list that you passed in. The method is modifying it directly, not working on a copy
 
user7437554
I see...
 
5:54 PM
@santimirandarp you want the pop method tutorialspoint.com/python3/list_pop.htm
 
If you want to write a method that deletes the last item and returns the shortened list, but leaves the original list alone, you'll need to make a copy first inside remove_element
 
or just slice it mylist[:-1]
def rm_last(e):
    return e[:-1]
 
just heads up, slicing wouldnt mimic the behaviour the del shows, and would need to be assigned. because it returns a copy.
 
@ParitoshSingh I'm incorporating @PaulMcG's comment
 
yeah, im just writing it for clarity for santimirandarp
 
5:57 PM
gotcha
 
user7437554
I'm just trying to understand a few things, the list 'e' is modified
 
user7437554
and print(e) after the function returns the 'new list' i.e the output
 
user7437554
but if we write 2*e it is not stored
 
@piRSquared Yeah, now you are making a copy by using the slice. I'd prefer not to try to guess what @santimirandarp wanted this method to do, and just explain what he wrote is doing
 
gotcha to you as well
 
user7437554
6:00 PM
def remove_element(listofel):
  del listofel[-1]
  listofel*2
  listofel.append(2)
  x=listofel.append(2)
 
basically, figure out which ones are mutations, and which ones are copy. del is sadly a weird one to start with, because i cant use the blanket statement "mutations are generally an object's methods, accessed by a . notation"
 
user7437554
yes, thanks @ParitoshSingh
 
user7437554
now it's clear
 
ok. remove the definition part of it. print x. you'll be surprised
that usually helps drive the point home with mutations. modifications in place, do not return anything. So they all return a None implicitly
 
@santimirandarp in order to explain this to you, we need to back up a few steps and explain how python works. Some of this is also explained in a python tutorial which you obviously haven't had time to go through. In essence, you are using this room as a tutoring service which is not what it is meant to be per the room rules see bullet point 9 under "Asking a Question"
 
6:02 PM
Did you get this from a tutorial? The thing about tutorials is that they tend to be written over time, with an educational goal in mind. Feedback you get in this room is not likely to be as well-crafted, or thorough.
 
user7437554
Ok, perfect...this question arises because I'm reading a tutorial
 
lunch rbrb
 
I knew it!
 
also, usually tutorials drive their point across in the next few lines
if something doesnt immediately make sense, see if they clear it up
 
As I said before, it is a common stumbling block topic for new people
 
user7437554
6:03 PM
cool... I'll avoid questions for the rest of the day. Thanks
 
(will say though, using del directly to show a pop effect... weird choice mr tutorial, im not sure i approve)
 
Native English speakers, does this sound right to you?
"They can order groceries, clothing and that alike."
 
isnt it "and the like"? not a native speaker though
 
That is what I am contemplating too, whether it is correct to say "alike".
Ah well, it seems so. There is no results on "alike", so it must be "and the like".
 
yeah, fwiw, i've never heard alike used in that manner
 
6:20 PM
One more vote for "..., clothing, and the like." (<-- note Oxford comma after "clothing")
 
There are two types of people - those who use the Oxford comma, and those who don't write lists.
Anyone (esp Aussies) in here heard of Brendan Burns, comedian?
 
6:47 PM
I always use Oxford commas, why wouldn't you? It help avoid misunderstandings.
Alright, in some cases it might be redundant, but I like to get in the habit of always including it.
 
In Hungarian it's explicitly forbidden
 
What is explicitly forbidden? Oxford commas in Hungarian?!
 
7:03 PM
Yup.
It's always "a, b and c" in an enumeration.
 
In Hungarian it's "a, b and c"?
"a, b és c" just learned some Hungarian :)
 
yup :)
 
7:21 PM
There is funny song someone made that comes to mind: "I don't give a **** about your Oxford comma" is the title I think...
 
Weird. How come anyone be pissed off about the Oxford comma?
lol
 
English major broke his heart I guess
 
Because I don't like pretentious yamming tomatoes telling me how to grammar. (-:
 
7:26 PM
I just finished writing my English speech, my last assignment of this year before I can finally head to college and study Computer Science.

I would appreciate feedback (I want that sweet A+) :)
https://docs.google.com/document/d/e/2PACX-1vRAyeZEIZWNw6XUtTU7Fgmym4DkCuFr8btdlJadI9GVitX1uO5rRWfbib7fhMo4Uq2etPSB8RmOV4Jg/pub
 
Where do you plan to go to college?
 
In Denmark, more specifically Aarhus.
 
Are you being graded on the written speech? Or spoken/delivered?
 
Only the actual written text
I don't have to deliver it.
piRSquared are you reading it, what do you think? :)
 
so far you have two uses of 'lag' that should be 'lack'
there may be more
 
7:32 PM
@piRSquared or discretely missing the "s" off the front of "lag"? :p
 
I swear to god, I am not stupid I know how to spell to lack.
haha
 
problem is both are legit words. I'm terrible at writing btw. I know english but I lack the patience to proof read my own stuff.
I enjoy talking and giving speeches though
 
@JonClements I don't think I am missing an "s".
"smaller retailers lack of differentiation"
 
@AndrasDeak To understand that comic I had to search: skub. "Skub is a fictional substance of unclear purpose..." a perfect word for any programming concept I don't yet fully comprehend
 
@SebastianAlexanderBNielsen I didn't read but from this excerpt it should probably be "retailers' lack of ..."
 
7:36 PM
Yeah, that is correct.
 
@Dodge I never bothered to search and the comic made sense to me at least. Things that come in cosmetic jars don't deserve fighting over ;)
 
So in Openpyxl is i'm iterating through rows to find a matching number in a column if i want to insert a new column into that row how do i go about doing it?
 
@RobertFarmer I've never used openpyxl but from an excel point of view: how does inserting a new column "into that row" even work?
 
I'll often have a good sense of something but lack the confidence to fully embrace my intuition without a validating Google search
 
@Dodge yeah, sure, I wasn't trying to criticise you
google (well, duckduckgo) and the wiktionary are my spellchecker and dictionary
 
7:38 PM
you are a purist aren't you
 
I really am
 
wim
and if you don't like the spelling in wiktionary, just edit it.
 
HA!
 
@SebastianAlexanderBNielsen might wanna watch your language like before...
 
Right, sorry about that that.
 
7:43 PM
Was just about to say, thanks ^
 
@SebastianAlexanderBNielsen Also, you have some phrasing similar to this "This is a neat solution but it got its drawbacks." that should be "This is a neat solution but it has its drawbacks."
 
Ahh, thanks for pointing that out!
 
In general, it appears you have a firm grasp of grammar. I'd likely rephrase many things to fit my tastes but that could be my Southern California or American bias.
 
That is nice to hear, thank you!
 
And as I mentioned before, I lack patience to read (-:
So I'll stop now
 
7:49 PM
Well, that is understandable, thanks for your help. I appreciate it.
 
8:26 PM
I just searched on "ouroboros" as I had never seen that word before. Quite an interesting symbol to be honest. "An ancient symbol of a snake eating its own tail" -- astonishing.
 
the infinity shape is an add-on, traditionally it's a circle usually (infiniteness implied)
 
wim
torus
 
a torus is just a thick circle
 
wim
8:42 PM
good work trashing that f-bomb, one of George Carlin's grandchildren might have seen it!
 
I appreciate your appreciation
 
wim
hey, you can't reply to sarcasm with more sarcasm
 
9:30 PM
too broad, maybe even unclear stackoverflow.com/questions/55837905/…
 
9:47 PM
that was an obscure reference...
or maybe it's just that I don't know who George Carlin is
googles oh, okay
I don't get it :D
 
May 3 '17 at 14:21, by Andras Deak
not a hard specification, just a guideline
 
10:24 PM
There we go
 
This is perfect for my requirements. I just need more traces on this plot. codepen.io/pen
And I'm comfy with Python
 
A torus is NOT a thick circle
A torus is a sphere with a hole in the middle
 
11:14 PM
a torus is basically a glorified donut
 
a torus is a mug
 
@scitronboy how is that different from a thick circle?
 
11:45 PM
torus is also a pokemon
no... wait... that's tauros
 
00:00 - 17:0017:00 - 00:00

« first day (3112 days earlier)      last day (1833 days later) »