« first day (1404 days earlier)      last day (3769 days later) » 

@Ffisegydd are you going to use that function? I think it blows Quentin's generic function attempt out of the water
I have a question about loops, inparticular why my loop is behaving the way it is
I just thought I'd leave it. I only even attempted a solution as it was Swordy anyway. You should go for it. You need to reach 50k eventually :P
I can't even format code in chat -,-
Yeah, backticks fail for multi-line messages
14:04
@Stormie select it all and press Ctrl+K
Thanks
You can press the "fixed font" button that appears to preserve indentation.
You can press up to edit your last messages
Or Ctrl -- dang, beaten!
check_Mail("[email protected]", 30)
def check_Mail(recipient="", loopfor=0):
	print("Loop start! loopfor = " + str(loopfor))
	while loopfor > 1:
		if get_Mail(recipient) is None:
			loopfor -= 5
			print(str(loopfor) + " seconds left in loop")
			time.sleep(5)
		else:
			print("Woot, we have mail!")
			loopfor = 0
			mylink = get_Mail(recipient)
			print mylink
			#return mylink
			break
14:05
@Kevin You had to one-line it? :)
Yes, all code must be one-lined.
Just moved your old message to the Trash :)
@Stormie breaks the rule of never using while loop unless needed
Fantastic, the output for that code is:
Loop start! loopfor = 30
No messages to pick from - error: 'messages'
25 seconds left in loop
-- stuff from get_Mail --
Woot, we have mail!
No messages to pick from - error: 'messages'
None
My question is, why is it giving me the error (from the get_Mail method) again once it's finished running it?
14:07
@Stormie bc you lost the mail in the first getmail call
I guess
thus:
What'cha mean? c:
I'm tempted to make a sopython wiki with links to various useful and often linked bits of Python docs.
Like the direct link to the list comp part etc
for i in range(loopfor, 0, -5):
mail = getmail(recipient)
if mail:
pirnt("woot we have mail")
@Ffisegydd how is quentin's method of approach to that problem?
@Swordy not as good as mine cough :)
14:08
@Swordy A bit wordy. Especially compared to Jon's ;)
14 mins ago, by Jon Clements
from itertools import chain

def merge_dicts(*dicts):
	all_keys = set().union(*dicts)
	return {
		key: list(chain.from_iterable(d.get(key, ()) for d in dicts))
		for key in all_keys
	}
DSM
DSM
Cabbage, all.
and a small question.Let me type that ,hold on
@AnttiHaapala but I still want to pass the return from get_Mail to the user
Perhaps when you call get_Mail, it finds the first unread piece of mail, marks it as read, and returns it. So when you call it the second time inside the if block, it no longer sees the piece of unread mail from the first call.
@DSM greetings and salutations
14:10
would I just have to return mail?
@DSM cabbage to you and yours.
Yeah, return mail should work.
Great. Thanks again guys :)
I edited my msg to perfection
then when hitting enter the idiot chat system says "too late" and lost all my stuff
14:11
One of the few downsides of ths SO chat system?
I never even knew that you could edit your messages :p

edit - See, I edited.. That's cool!
dict_a = {'key1':[40,70]}
dict_b = {'key1':[38,72]}

Want l1,l2 = aggregate of both key1s . l1=39 ,l2=71
@Ffisegydd to be fair to Quentin though - he does attempt to cater for non sequence values...
I'm still pretty new to the SO chat, first used it about a week ago
14:12
something like if key is same, assign the mean of both values to 2 variables..
Thanks!
@Swordy are the values going to have the same length for each key though?
@Swordy I'd suggest you do this stage in your pandas code if you can because it'll be easier probably.
yes
@Swordy and are both dicts going to contain the same keys?
14:14
each key has 2 values
same and different , its mixed
So err... is this really what you're trying to do with your last question?
if keys are same , assign the aggregate to 2 variables namely l1,l2
no , that was something different
@Ffisegydd : u mean the pandas kind of approach?? looks interesting
ohh sorry , it is actually if keys are same , store aggregate to the 3rd dictionary
Damn , my mind is drunk
my apologies@JonClements @Ffisegydd
Oh man @Stormie you're an Aber student? I did my Masters at Aber (not comp sci though)
What did you study?
I genuinely thought your name looked Welsh, I didn't want to seem rude
Physics, Ffisegydd is the Welsh word for Physicist.
14:20
Well, now it makes more sense. Your MSc is in some field of Physics?
It was an MPhys yeah. High temperature superconductivity.
Cool :o
I still visit Aber once or twice a year as I've got friends doing their PhDs in Physics there. Go out drinking in the old haunts.
dict_a = {'key1':[40,70],'key2':[35,76]}
dict_b = {'key1':[38,72],'key3':[37,89.56]}

dict_c = {'key1':[39,71],'key2':[35,76],'key3':[37,89.56]}

Should i ask this on SO??
Ffisegydd is also the English word for physicist, but only when talking with your mouth full.
4
14:22
That's cool. :) Don't suppose you were ever a part of ACOG? (Started about 3 years ago)
DSM
DSM
I thought we agreed it was a description of a tasty carbonated beverage?
@Stormie nah though I was President of Physoc and then Social Sec. for two years.
Infact, if might've been called AberLAN back then
That is also an acceptable interpretation.
Ahhh. If you come back you'll have to come along to an ACOG event! ;)
14:23
I vaguely remember it or something similar to it but never went myself.
Lots of fun if you like games or competition
:)
Yeah I was usually too busy getting outright hammered to play video games while an undergrad.
Unless it was a videogame you could get outright hammered while playing, in which case I was the best damn Guitar Hero player ever.
Last tym i played guitar hero was on my W395
actually the only gadget i played on :(
@Ffisegydd getting hammered is the best part of an university education.
@Ffisegydd ooo... Amazon Prime Video has Only Fools And Horses
Arghgh... and that substract letters question ended up with a rather rubbish answer
14:31
how do i add links in text?? should it be (text)[link] ??
= [text](link)
the url goes in the parentheses. My dumb mnemonic is, "nobody reads things in parentheses. Nobody reads urls. Therefore, they go together"
haha
It's the only way to play!? ;)

I remember at christmas Hellish Good Beer came along and did a promo night in the union.. We had about 50 people at the event, they were selling £1 per pint
I've asked my question ;)
14:34
I never used to go to the union apart from for Ginesis
Not even for promo nights!?
@Kevin, clearly They are doing it wrong â„¢
DSM
DSM
@Swordy: er, you didn't really ask a question. You just posted a specification, i.e. what you want someone to do for you.
@Swordy in addition to what @DSM has mentioned - you also appear to be making up syntax, eg: dict_a = {'key1':[40,70],'key2':[35,76],'key4'=[45,90]}
class MyLib:
	def check_Mail(self, recipient="", loopfor=0):
	for i in range(loopfor, 0, -5):
		# print("Is there mail?")
		mail = get_Mail(recipient)
		if mail:
			# print("There is mail?")
			mail = get_Mail(recipient, 1)
			# print(mail)
			return mail
			break
		else:
			# print("No mail.. Sleepy time!")
			time.sleep(5)
I'm getting an expected indent block error on my for loop
Why the hell? >;o
14:41
looks like the def and for lines have the same level of indentation. the for line should be indented one further in
(along with all the lines inside the for loop)
oh wow
I'm sorry
DSM
DSM
This is what happens when people use tabs for indentation..
I will sit quietly now...
DSM
DSM
(okay, not really, but it's fun to say.)
It was fine before I had to faff about in IDLE
DSM
DSM
14:41
@Stormie: not really a need to break after a return, is there?
I guess I'm at the end of my productive day xD
I didn't think that return would stop the loop, so I added break.. Is this wrong? c:
return does in fact stop the loop.
it terminates the function entirely. Once return happens, nothing else does
Well, I guess I don't need it :D
Umm... Inherit from list, scrap your __init__ and just over-ride __getitem__... you've only complicated this and reduced it's usability by using containership and inheriting from object. — Jon Clements 29 secs ago
I think that's a fair comment guys?
Thank you for more nuggets of wisdom, oh mighty ones
mighty*
I should've edited..
14:43
wb @coltonoscopy
melon, @JonClements
i hope that was the right word
Normally I don't like inheriting from list, but I suppose making a small change to getitem so it's modular is fine
(modular? modulus-y? Whatever)
i think you're looking for "modulicious" @Kevin
haha
DSM
DSM
Okay, now my "wraparoundy" suggestion doesn't sound as good. Modulicious it is.
14:46
well, looks like my work here is done....
DSM
DSM
@Jon: seems fair. I often prefer to delegate rather than to subclass, but here where you're just making a minor tweak to an existing class there's not much point.
Ok I am pretty sure I'm getting some revenge downvotes now, even for answers...
:-(
Oops, you weren't supposed to notice...
I joke, of course.
@JonClements : so should i provide the actual data?
14:48
3 downvotes in the last 5 minutes or so.
just trying to get your rep to be a multiple of 10, is all ;-)
:P
It's a multiple of 5 though...
That's only half as good!
DSM
DSM
I still remember the name of one user who revenge-downvoted me. Annoying brat.
This is where the upvote comes in
14:49
An accept would get you in a nice round position
@Ffisegydd : that kobi guy told me that i can't ask a question within 15 minutes so i had to delete it and add another case in the question you just answered :(
That doesn't sound like an official rule to me
I assumed that a 2k rep guy knows more rules than i do
He told you you can't ask a new question!?
yes
14:51
Can you link exactly what he said?
@Swordy Tell him to go read the rules then :p
DSM
DSM
"You already a question 15 min ago here, edit the old question if you need more info."
No absolutely not. If they are separate questions then you should ask a new one.
14:52
But if he edits the old one, he'll have to unaccept Ffisegydd's post, who will then have a ten-divisible rep... Kobi is the OCD downvoter!
(disclaimer: that is not a serious accusation)
DSM
DSM
@Swordy: what exactly is giving you trouble? The earlier answer showed you how to merge the dictionaries into lists, if I understand. Do you know how to turn a list into its mean?
two lists and corresponding elements averaged
Erm, if I have packaged my loop function into a class that is then called by an outside application.. Is there any issue with calling another function from the class?
Or specifically, in the way that I call it from within the other function in the class:

mail = get_Mail(recipient)
if get_Mail is a function in the same class, then you probably want mail = self.get_Mail(recipient)
DSM
DSM
That makes it look like get_Mail is a function and doesn't have anything to do with the class.
14:55
Okay, so I take it whenever you call anything from it's own class, you use the self prefix
Kinda like static references in java?
Effectively, yes
In that case, I understand. >:D
@Ffisegydd should i undelete that or what do i do , so confused!!
@Stormie never use tabs for indent if no one said it before
DSM
DSM
It's a little different, though, because it's not static in that it's independent of the class (instance).
14:56
@AnttiHaapala Why not? I've always used tabs :c
use 4 space indents (tabs are at 8 spaces!) but then never use tabs for indent
@AnttiHaapala But.. All the extra thumb work :c
(although technically the first parameter to a class function can be named anything; it's just called self as a convention. You could just as easily do fish.get_Mail() if you were so inclined)
@Stormie get an editor that does the right thing if you have a lazy thumb.
DSM
DSM
You can configure your editor to produce four spaces when you hit "tab".
14:57
Yes, in Notepad++ it's in Preferences -> MISC
@Kevin Could I call it the name of my Library, or would that break anything? ;)
You know it's important because it's all caps
Eeeeexcellent. Thank you guys :)
@Stormie mmmm, might cause some collision problems. I recommend sticking with self.
@Kevin I thought so, is why I asked. :)
@Ffisegydd we're consistently getting 30 people (about 1/2 active at various points) now... not too bad for the fact that we're still a young room and not well advertised ;)
@Swordy when I pointed out you're making up syntax (dict_a = {'key1':[40,70],'key2':[35,76],'key4'=[45,90]}) it was a subtle hint to correct it :p
We have a large market share amongst the users that know that SO has a chat system at all
DSM
DSM
SO has a chat system?!
4
Huh, where?
15:00
@JonClements dint get you..Correct what?
key4: ??
@Swordy yes :)
@DSM My brain made that noise too
heya @TheSoundDefense - didn't know if invites worked :)
DSM
DSM
@Swordy: try copy-pasting dict_a = {'key1':[40,70],'key2':[35,76],'key4'=[45,90]} into a Python console and seeing what happens.
It appears they do :) thanks for the suggestion on my list answer
15:02
@TheSoundDefense no worries - was curious why you deleted it, but I see it's undeleted now
I've corrected that , thanks, but i still do not know what the problem is with this question that it attracts downvotes everywhere
Could you link the question again @Swordy?
@TheSoundDefense might I make a quick suggestion for a couple of changes though?
@JonClements I deleted it because the code wasn't working, so I spent a minute fixing it up
@JonClements go ahead
@Stormie : i'm linking it to the old question as i've edited it.. here
15:04
i = i % self.__len__() is better written as i = i % len(self) - no need to invoke a magic method call there
I might be incredible nlind but..
Oh, I see!
@Swordy you absolutely should not update your old question with a 2nd case.
On another note.. Someone seems to be serially downvoting me :(
so what do i do??
15:05
@JonClements I was mulling that over in my head as well, I guess I was a bit trigger-happy with the magic methods
i've removed it..
@swordy I think it's a solid question, upvoted
@TheSoundDefense and return super(modList, self).__getitem__(i) - should either be return super(modList, list).__getitem__(i) or, in the case of single inheritance, sometimes it's easier to understand return list.__getitem__(self, i)
i've removed the aggregate part @Stormie
15:06
Well, it's your question. :)
@TheSoundDefense otherwise, unless the OP wants some complicating slicing and blah blah... what you've got there is effectively what I'd have suggested
wth , i get a serial downvote too!!
@JonClements How would the first case work? I figured you would have to pass in the object itself, somehow.
DSM
DSM
Okay, I have one hour to do a major refactor of code which (1) must continue to pass a pretty exacting test suite, but (2) introduce an extra layer of indirection to support shiny new functionality on which a lot of dependent products rely.
@DSM Java?
15:07
@TheSoundDefense oh ignore me on the first case, brain burp
/me slaps self on wrist
DSM
DSM
@Ffisegydd: C++, although there's a swig Java wrapper.
No such thing as "a serial downvote" :-) you have to get a lot of them on different questions
DSM
DSM
Like poor Ffisegydd.
Should i ask a new question @Ffisegydd if you think it is right??
on SO
abt the aggregate
15:08
@swordy If it IS a seperate question, then you should ask it as a separate question
@JonClements ah ok :) I added that one as a comment suggestion since I also wanted to point out the Python 3 super() syntax, but hopefully everything should work fine now. Thanks for all the help!
Anyone who serially downvotes is cleared up by the system anyways
DSM
DSM
@Swordy: pet peeve, you keep saying "aggregate" when it sounds like you intend "mean".
@Swordy if it is a separate question then you should ask a separate question. But you shouldn't ask a new one, I'd suggest you undelete your old one.
In either case it is up to you.
But if you do ask for people to write code for you then you must expect some downvotes from people.
@TheSoundDefense no worries, I would have added comments but couldn't while the post was deleted, so figured I'd try an invite as to me it was a perfectly good answer going in the right direction... just needed a bit of pointing :)
15:10
what is the difference ? aggregate is total?
I wish that the SO topbar was still displayed over the chat :(
Feel free to hang around if you want... we quite often go through stuff here, or just chat about random stuff and chill out... whatever you decide, don't forget we're here if you need help or work through someone with something you're thinking about :)
lol and when you did you were asked to edit this question, I had an answer to the question you deleted – Padraic Cunningham 3 mins ago
DSM
DSM
@Swordy: aggregate means something like "collect together", and is often used for the sum, and so it's a little ambiguous here. (That's why NPE asked for clarification on your deleted question.)
@JonClements sounds good, thanks :) trying to learn as much as I can about Python since that seems to be a language a lot of people at my company don't seem to know it. I figure that makes me more employable ;)
DSM
DSM
15:13
Okay, enough procrastination, I'm down to forty-seven minutes.
someday I will learn to python.
I want to upload programming knowledge into my brain, Matrix style.
Problem with human-computer interfaces is, nobody wants to be a beta tester. Then you're stuck with some crappy 56kbps connection long after everyone else has updated to the 100TBps iSelf port.
You can only drill so many holes into your skull, you see.
@TheSoundDefense it certainly helps to be that kind of guy in a company :)
@TheSoundDefense we also have our own little python website at sopython.com - you might want to check out some of the Wiki's and the common questions - we're adding more when we can, but any feedback and such you have is appreciated
15:23
howdy howdy howdy
@Al.Sal doody doody doody?
@al.sal diddly
@JonClements cool, I'll check it out. Thanks
piddly diddly
15:26
@tristan A dictionary and thesaurus?
user559633
He doesn't seem to be a native english speaker and that's not the problem.
It was a slight problem for me, but that's probably because I don't know much about what he has his issue with
The problem is, his JSON won't parse, but we can't see his JSON.
Probably the answer he wanted to get was, "oh yeah, this is a change from Odoo v7. You have to set config options x y and z like so..."
user559633
Sure, there's some language issues, but that's fine. The problem is that he likely did something incorrectly and that's not in the realm of possibilities in his mind.
Yeah, jumping to "this must be a bug in the third party software I'm using!" is a bit rash
15:29
It's not a very logical conclusion
user559633
lol, someone went back and downvoted two of my questions 2 minutes ago
@TheSoundDefense just noticed the edit of if len(self) == 0: - what's the reasoning behind that?
user559633
stackoverflow.com/questions/16286978/… how do i see the history of votes?
I mean, "it worked in v7 but not in v8" signifies that something happened to the software, but I think it's more likely "public interface change" than "new bug introduced"
You have to go on your profile and then check rep changes for your own questions? I don't know of any other way
15:30
@JonClements that was the result of a discussion with wim - he suggested different behavior for indices and slices.
@JonClements it's been an interesting series of edits there
user559633
@Stormie i just saw my internet points(TM) change and didn't expect it to be in the same minute
user559633
@Ffisegydd i meant to see who is downvoting on the questions
Oh, you can't.
user559633
Ah
15:31
SEKRIT.
@tristan I had the same earlier.. Got a downvote on 3 of my questions within 2 mins.. ;p
user559633
Yeah, it's some passive aggressive little butt then
@tristan you don't get to see who is... the closest you can get is to it's timeline
But I've had 5 random downvotes in the past day.
user559633
@JonClements thanks
15:32
I reckon someone is revenge downvoting the chat dons tinfoil hat...
user559633
hah, yeah, likely.
I don't understand why they bother, it's just gonna be undone by the system
user559633
"stupid yamming jerks didn't guess what i wanted, i'll show them!"
@Stormie looks like all python chatroom members are being blessed with downvotes..
Cabbage
15:33
cbg @Johndt6 - how goes it?
Unless of course the SO-Chosen One returns to rise up and destroy the system
Or maybe an algorithm that downvotes on random questions by any user who posts in sopython chatroom
@JonClements Banana!
I bet it's those Java boys, jealous that they're losing attention!

**this is not an actual accusation**
another jon spotted
user559633
15:34
@Swordy my guess would be someone doing it the lazy way.
user559633
@Stormie I doubt is the java boys -- it would downvote one of us and then crash until you sacrifice another oxford shirt to the java gods
Why does the mark up never seem to work when I want it to? :p
@Swordy ahh... but there's only one Jon that's a cute yellow puppy!
@Stormie it's more likely to be PHP. The war between Python and PHP is a long one...
lel
@Ffisegydd Why PHP? What's the history there?
user559633
15:35
@Ffisegydd oh, it's like one of those Boston<-->New York feuds. Boston thinks it's at odds with New York and we in New York sometimes forget Boston exists.
question... if you use something like coffeescript with cordova, should it still compile effectively with no real negative consequences?
Just friendly rivalry. If you go to the main PHP page and type "I hate PHP" it'll re-direct to python.org
@Ffisegydd Must try.
Must have the caps and you need to press Enter too
15:37
PHP and Python aren't even the same domain, how the heck did this rivalry develop
Python is used a lot for web development.
JS is scarily similar to python :o
As a language, luckily not in its use
Python does like to push it's nose into other domains though. Comes with the territory of being a swiss army programming knife.
finally, another annoying mystery solved..
cabbage folks ;)
user559633
I don't really think JS is similar to Python @Johndt6. What do you mean?
15:38
@PeterVaro wow.
@Stormie ikr?
@Ffisegydd Swiss army hereby reporting :-P
@PeterVaro Do you think that the other "Wonders of the World" are similarly explained? ;)
@Raoul hah. I love Swiss Army knives. Got 3 of them.
@tristan Given that Python is a million times more refined and well thought out,: JS has a quite similar syntax, and similar ideas like dynamic typing. Heck, JSON (which comes from JS), and Python dicts are very similar
15:40
I have two. Used to have three, but lost one :-(
@Stormie I believe so, however Ffisegydd is the scientist -- you should ask him about how these researches are working :)
@PeterVaro We need more pictures..
I mean diagrams
Too bad, it had this very unique screwdriver/wire strippper/can opener bit
That's the word for something at this level of scientific genius right? ;)
@Ffisegydd The original one is much less fancy... and you use it for stupid things such as opening beer cans (mostly)
user559633
15:41
Javascript's dynamic/duck typing operates much differently than Python. JS and Python have a similar syntax in so far as they both use letters and parenthesis :P
JS and Python are non-mandatory-semicolon brothers
@Kevin Isn't perl a non-mandatory-semicolon language?
blog.glyphobet.net/essay/2557 Good comparison of the two
Haven't worked with perl in years. I'm going to go with "yes"
13
Q: Perl does not complain about missing semicolon

slayedbyluciferAlright, this is really freaking me off. I just found on my ubuntu that Perl is not complaining about the semicolon at the end. Check below code: #!/usr/bin/perl use warnings; use strict; my @array = (1, 2, 3, 4); foreach (@array) { print $_."\n" } print "no, this cant be true" please ...

Damn, it's kinda mandatory
15:44
in flask-assets, is there any way to get it to be in some "debug" mode where it recompiles scss every time?
JS is sort of half mandatory. The language specification requires semicolons, but the interpreters will silently add them for you if your code doesn't parse without them
user559633
I hate JS and the DOM. And HTML.
@tristan Me too
JS just needs a few tweaks to be actually decent.
15:48
I love that comic
user559633
I used to hate jquery, but now I like anything that gets me out of JS land faster.
It helps me keep things in perspective.
user559633
corvid: it needs a rewrite. not tweaks.
I take it back, I've now had a 5th question downvoted..
Why do people bother? o.O
I just want an import statement and real classes :|
15:49
There should be a change in paradigm to web scripting...
I want a pony, but you can't always get what you want.
I feel like enough of us want a pony, that we could pool our resources and share one
3
"Brython is designed to replace Javascript as the scripting language for the Web." awwwwww yiss.
user559633
yeah, i love that comic too.
That's exciting
15:50
Although that whole "we live on different continents" thing makes logistics complicated
user559633
I get why import isn't really a thing, but string concat on null? null not even pretending to be a nullptr? It's Ruby for the browser.
user559633
No imports is a big deal for me. I hates it.
Hmmm, Python web scripting
You have my interest, random guy
Not @Ffisegydd, the random guy who developed Brython
15:53
You have my interest too though!
Just for different reasons
@Ffisegydd you have a fan STEWIE!!!!!!!!!!!!!!!!!!
The person downvoting me isn't even trying cover their tracks.. They've been to the tags, Java, Python, RobotFramework and Gmail-API and downvoted my questions
/me Brian sulks
argghhhh
@Stormie isn't that sorted out automatically at some point?
15:55
Serial downvote detection takes a day or so, IIRC
@TheSoundDefense Yeah, I think the system does a sweep once a day
Like @kevin said
Still, annoying as hell.
Try to be stoic. They could be watching you right now, gaining power from your annoyedness.
Dun, dun, DUNNNN
Kevin, master of spies
did you guys know slipknot still makes music?
I don't suppose anyone here has used the GMail API bindings for Python?
/is familiar with OAuth2
15:59
I am slightly familiar with OAuth2, in that I google someone who already did it and copy them
Umm... I'm not going to make 50k if I keep spending time commenting on improving posts, finding dupes and flagging sighs
sopython uses OAuth2

« first day (1404 days earlier)      last day (3769 days later) »