« first day (1639 days earlier)      last day (3313 days later) » 

3:15 PM
@BenjaminGruenbaum Hope you have already seen the bug. What do you think about it?
 
Cabbage @AnttiHaapala :-)
 
> Any idea what's wrong with me?
From that question!
:D
 
3:24 PM
@octi: Are you sure? When I use /= in Python 2.7.2 with 2 integers, it does float division. — endolith Mar 5 '13 at 18:33
please upvote this comment^
321
A: how can I force division to be floating point in Python?

Steve TroutYou can cast to float by doing c = a / float(b). If the numerator or denominator is a float, then the result will be also.

also downvoted this ^:D
because the wrong one has more votes than the "from __future__ import division"
this also is more correct as the one above, but surprisingly has much less upvotes :d
 
That's coz the other guy works in a office where everyone knows SO
:(
An accept after 12 days -- stackoverflow.com/questions/29353173/…
:)
 
3:39 PM
0
A: How to replace every item in a list except last

KasraYou can get the last element by [-1] index and then create a list of X then add to last element : >>> [[['X' for _ in range(len(li)-1)]+[li[-1]]]for li in lists] [[['X', 'X', 'X', 2]], [['X', 3]], [['X', 'X', 'X', 5]]]

So ugly :/
 
Usual Comment: Don't use list as variable as it shadows the builtin. Surprisingly none of the answers have mentioned it (Include high rep holders) — Bhargav Rao 3 mins ago
Sigh
Hafta leave this comment everywhere
 
In [10]: type(list)
Out[10]: type
@BhargavRao ^
 
Rbrb guys
Oops.
@vaultah Cool, thanks
 
No worries :)
Don't have any CVs left either :(
 
3:56 PM
"Yeah, i don't have that in my code, just this example for sake of simplicity." How does using a confusing variable name (like list) simplify things?
:slaps Bhargav for answering that typo question: :)
 
slaps those upvoters
Yay, my meta question is in Hot Meta Posts
 
@vaultah I guess we could dv @BhargavRao's answer... or ask him to delete it, so the Roomba can delete the question.
@vaultah Nice. Mine was in there, briefly.
rhubarb
 
4:11 PM
rbrb @PM2Ring
 
cbg @davidism
Been teaching myself the rudiments of SQLAlchemy.
And trying to work out how I may possibly set up our dbs.
 
yeah, sorry I haven't been responding to stuff, I got distracted by the nice weather outside yesterday :)
 
:P perfectly understandable.
 
I didn't really use a tutorial beyond the one in the docs which is more of a broad intro than an in depth tutorial. The docs are so good though that I never really needed anything else.
 
Yeah I've gotten half way through the one in the docs and it was all pretty simple.
Gotten to many-to-one relationships etc and so I've started playing with code.
 
4:19 PM
Game of Thrones starts today!
 
should really watch GoT
 
@davidism Already 3 episodes leaked I hear :D
 
have a question , if someone asks a question on SO , do I see the time of his/her question w.r.t GMT or my local time zone?
 
everything's in utc
 
UTC == GMT ,right
 
There is no time difference between Coordinated Universal Time and Greenwich Mean Time
why is it UTC , the abbreviation should look like CUT
 
I feel that the dup target would benefit from this question's title. What do you guys think?
 
forget it...
 
@Ffisegydd I'm beating you in profile views ;)
 
in rep as well..
 
4:30 PM
yeah, but he already knew that
 
worth reminding him again :P
 
we're "racing" for a python gold badge, which he's beating me to by a wide margin
 
then that would be his turn to remind you in case you taunt him....
 
Save the Internet, Indian version.
 
yeah saw it today
Even sent an email to TRAI
 
4:40 PM
I am doing it now
 
even shared on facebook
 
rbrb boys
@Sword I ll have to read the answers so I ll submit in the morning
 
:D
you have time till 24th April
 
@davidism sorry was making some grub.
I'll have to get a botnet going to look at my profile again.
 
5:01 PM
cbg
 
@Unihedro cbg uni
nice to see you here :)
 
^^
 
yes I understand I dint spam the java chatroom with that many images...
 
@davidism Reopened
 
5:36 PM
100 consecutive days on SO (again). I still haven't managed to remember Meta that long though. Got up to 88 days once.
 
I'm on 190 consecutive SO at the moment.
 
strange, just 7 for me. I must have missed a day last weekend.
 
@MartijnPieters tone it down!
44
Q: 2015 Moderator Nominee Activity Profiles

Jason CI've generated weekly histograms of activity for each of the current 2015 election nominees, combining SO, MSO, and MSE activity. This data consists of the total counts, per week, of publicly available activity (reviews, revisions, comments, posts, accepts, suggests, badges) and is intended to re...

 
hi there everyone, I have a question open that hasn't received much attention and I think it's rather interesting: stackoverflow.com/questions/29525356/…
I've opened a bounty on it (50 pts), any help would be much appreciated.
 
6:00 PM
@Gabriel try posting again around this time tomorrow, we're a lot more active during the week.
 
@davidism thanks for the advice! I'll post again tomorrow morning.
 
6:30 PM
@Ffisegydd you shouldn't => waste of time, really
 
Without clicking on the link to see what you're referring to I'm gonna guess...Snowpiercer? :P
Ah no, GoT!
 
Snowpiercer is even more worse than GoT
:)
 
cbg
Question - Does range return a generator or an iterator?
 
Neither
 
Then?
 
6:40 PM
range object
 
Naw, I asked in Py2.7
not Py3
 
Plain list then
 
Oh. Fine then
Ty
 
Cabba n g? Antti
Rbrb
:D
 
7:03 PM
cbg
how do they get the icon to tags?
 
@AnttiHaapala a company/etc... can sponsor them...
 
yeah found it
unsurprisingly the relevant meta question is answered by Mr _ _ _ _ _ _ _ _ _ _ _ _ _ _
SDJfksjdflk
stupid chat,
anw who wants to play hangman :D
 
@davidism Hey, I can't help it that everyone else is slacking so much!
 
what star trek series/season/episdoe should I watch
 
None.
 
7:14 PM
all of them :p
 
... next
@Ffisegydd I will soon iggy you :D you always greet us so rudely :D
 
@AnttiHaapala We skipped the original series.
 
I greet you with the ancient and honoured saying of my forefathers.
 
Currently watching TNG + DS9 + Voyager in broadcast order.
TNG season 7 + DS9 season 2 right now, soon switching over to DS9 + Voyager
 
yeah I have seen everything except TOS in entirety
 
7:17 PM
TOS was a different era entirely.
 
so I donot need to see in order :D
 
Must get around to watching Babylon 5 again at some point... that was definitely ahead of its time
 
and enterprise is really boring compared to anything else
babylon 5 I have watched maybe 4 times
but the porblem is it needs to be watched in order, I don't want to start now
 
"Best of Both Worlds": fairly enjoyable TNG 2 parter
 
@MartijnPieters so what was the last good DS9 episode you watched :d
 
7:19 PM
@AnttiHaapala context: we watch this with a 11yo.
 
it is 22:20 here and I am fairly tired, not best of both worlds now :d
 
we don't need no stinkin' edginess and real emotion.
 
hehe :D
 
The teenagers watch Battlestar Galactica with their mum.
 
@Antti "Inner Light" is a good one
 
7:20 PM
yeah I have seen it too many times
 
Um... have you seen The Outer Limits episode with Brent Spiner? That was good.
 
I always watch the borgs and inner light and darmok and the better parts of klingons and lore... :D
yeah, the one where there are those green aliens?
 
@Antti errr - where he's a "deprogrammer" kinda thing... and there's aliens which sit in a bath tub etc...
 
yes
"you can continue your research" etc...
 
7:23 PM
That's the one
 
i think I have lots of gaps in later outer limits seasons
i should watch it some time
 
"Cause and Effect" was an easy to watch TNG episode
 
but today I don't have that feeling :P
hmm maybe I should watch some DS9
cause and effect I have watched too many times too
we need more real star trek :D
 
Errr - what's that DS9 episode with Q, and Sisko ends up punching him and Q's: "You hit me!? Picard never hit me"... then Sisko says, "I'm not Picard"...
 
ahh maybe i should check if mr plinkett has more reviews :D
 
"The Thick Of It" is also a good series to watch - has Peter Capaldi in it...
 
nevaheard
 
@AnttiHaapala it is what Capaldi is famous for.
 
Ambassadors is good - With Mitchell & Webb - I believe Martijn even quite enjoyed that...
 
its parliamentary elections next sunday here, maybe I'd try the TTOI
 
7:30 PM
@JonClements It was brilliant.
 
I will see the thick of it, let's see how much I understand about UK politics :D
 
@Antti it's not overly political - if you've seen Capaldi as the Doctor.... boy you're in for a surprise...
 
7:52 PM
line = line.strip("\n").lstrip().rstrip().split(":") - wow
 
8:45 PM
I've obtained magical internet points, now I can talk in this.. thing?
 
8:59 PM
@VOTProductions Apparently you can. Cabbage!
@VOTProductions: see sopython.com/chatroom for more information about this strange lingo we are using here.
 
@davidism are you about for me to pick your brain?
 
@VOTProductions magical internet points? Where do I get those from? I just have ordinary boring internet points...
 
@VOTProductions Hey, I was assured that that shot of me diving in was private! How did you get your hands on that?!
 
9:08 PM
@Ffisegydd Anything I can help with?
 
@JonC SQLAlchemy?
 
Okay... shoot
@VOTProductions oh great... now you got me going through playlists of cartoons...
 
So Question and Answer models have similar bits, so it makes sense to subclass them from a single class, yes?
But the Posts class won't ever be used on it's own, so I wrote it as a kind of mixin, as such my code is:
 
Yeah... probably makes sense to have a Post or similarly named object that has the common attributes
 
urgh. Damnit.
Everything was working fine until I added ForeignKey and relationship in for the owner bit
 
9:12 PM
Umm... what error do you get?
 
My error is sqlalchemy.exc.InvalidRequestError: Columns with foreign keys to other columns must be declared as @declared_attr callables on declarative mixin classes. and basically I just need to make it Post(Base) and then add __tablename__ = 'posts'. But that will make a table for posts which I'll never use.
So I wasn't sure what to do.
Do I make it a full Model and just ignore the table, or is there a better design choice?
 
Umm... can't say I've tried it in SQLA - I'd kinda have expected it to just work tbh
 
The mixin worked fine when I was just using Column
docs.sqlalchemy.org/en/latest/orm/inheritance.html doesn't seem to answer my question, they just add the Base in and be done with it.
 
I found @declared_attr but didn't see that, ta love.
 
9:18 PM
@Ffisegydd you're welcome sweetie :)
 
Awesome, got a rudimentary question, answer, tag, and user set up n SQLA.
Just need to sort the votes and post links/histories tomorrow then.
And then sit down with you and davidism and check my database design :P
Until then, adieu.
 
bonne nuit
(bah... always forget the ne on that)
 
@Ffisegydd sorry, at opening day for San Diego's professional ultimate Frisbee team: sdgrowlers.com
 
9:36 PM
cbg
Does python allow for sorcery like this:
>>> x = SpecialObject('default value')
>>> print x
<Special Object: 'default value'>
>>> x = 'new value'
>>> print x
<Special Object: 'new value'>
 
Errr no... because = rebinds the name x to a string
 
Or even better, replace x with bounded.x.
 
you can create a class that has an attribute, then assign to that attribute and override the class's __str__ method to produce the result
 
@JonClements It's more about implicitly storing the value in a "value container" when assigned. But i'm thinking i'd overwrite the__getset__ method, or something...
 
@JonClements tu parles français? je ne savais pas.
 
9:40 PM
@Bonifacio2 pas trop :)
@NoobSaibot the what method!? Not quite sure what you're trying to do...
 
@JonClements That's ok. You kinda answered me already at the top. :-)
Ok, next question. lol
What are your thoughts on libraries that use "magic" to make the developer's life easier?
Specifically...
...functionality like, Any subclassed method that ends with _event, automatically does something cool.
Would a python developer mind metaclass magic like that?
 
as long as it's not too clever and is documented - it's okay - although you wouldn't really need a metaclass for that
 
So like decorators, except using the name of the method instead of the @.,
@JonClements Can you think of a quick example that would cross the 'too clever' line?
 
Well - you could just over-ride __getattr__ on the class itself and dispatch
 
Yes, you're correct.
 
9:54 PM
@NoobSaibot it happens occasionally :)
convoluted example
class SpecialObject(object):
	def __init__(self, val):
		self.val = val
	def __getattr__(self, value):
		return object.__getattr__(self, value + '_event')
	def val_event(self):
		return self.val


so = SpecialObject(3)
print so.val_event() # 3
 
That just made my brain hurt a little. lol
 
cbg @JGreenwell
 
@JonClements Q-Less is the name of that episode
cbg @JonClements
 
oh - the Sisko/Q one?
 
yep
 
10:31 PM
heh...a system annalist's take on programming issues can be very funny
 
a system what? :p
 
....yep, that's my spelling after 3 term papers and one term project
brain is melty
 
Rather you than me :p
Wow... haven't listened to this in ages
 

« first day (1639 days earlier)      last day (3313 days later) »