« first day (1643 days earlier)      last day (3296 days later) » 

12:26 AM
Bon jour
 
cbg @overexchange
(rbrb, gotta go get my daughter from dance)
 
def filter1(pred, tup):
	result = ()
	for elem in tup:
		if pred(elem) == True:
			result += (elem,)
	return result
result += elem why does this not work?
 
it does for me.
though this just looks like filter(pred, tup) to me, so...
rbrb
 
I get this error: can only concatenate tuple (not "int") to tuple if I try result += elem
 
not with that code you didn't :D
 
12:30 AM
and error gets resolved only when I say result += (elem,)
not with that code? I did not get u
this link says to add (elem,) but this is weird syntax, not intuitive
 
tuple assignments require the trailing comma
28
Q: Python tuple comma syntax rule

StanIn case of single element in tuple, the trailing comma is required. a = ('foo',) What about multiple elements? It seems whether trailing comma exists or not, they both are valid syntax. Is this correct? Having trailing comma is easier for editing in my opinion. Is that a bad coding style? a =...

 
ok
one nice recursive code that I have been thru today, this recursive style was new for me.. would like to share
def cartesian_product_recursive(tup_1, tup_2):
    res = ((tup_1[0], tup_2[0]), (tup_2[0], tup_1[0]))
    if len(tup_2) == 1:
        return res
    res += cartesian_product_recursive(tup_1[:1], tup_2[1:])
    if len(tup_1) == 1:
        return res
    res += cartesian_product_recursive(tup_1[1:], tup_2)
    return res
It took almost 2 debugging cycles for me to understand this code. what about you?
 
@AdamSmith Well, a lot of it is personal taste - I have no problems with a certain number of keyboard shortcuts, but I like to have menus available, just so I don't have to remember obscure commands for something I use very infrequently. There is the Vintageous plugin that implements a lot of Vim's functionality in Sublime, if you miss it. However, I think Sublime has a couple of really significant strengths -
The first is the ease of extensibility. If you want to do something, but there isn't a built-in mechanism for it, you can create a macro, or for more complex things write a plugin in Python - the API is quite good for most things.
The second major strength is multiple cursors/selections. You can very easily type in 5 or 50 or 5000 different places at once, changing variable names, reformatting code, making RST tables, etc.
Finally, it has a very active plugin ecosystem in Package Control, so more than likely if you wish for some non-built-in functionality, someone has already written a plugin to do what you want. If not, the plugin developers are very willing to help each other out. Plugins range from the very simple (insert the current timestamp in a certain format) to the amazingly complex (Anaconda, SublimeLinter, SublimeREPL, etc.)
Regarding why Anaconda is formatting your lists too long - I don't have the slightest idea :)
 
12:49 AM
cbg
@MattDMo dang, 'cuz that was what I really wanted to know LOL
Yes the multiple cursor feature is definitely the selling point of Sublime, to me
but the quickness of recording macros in vim beats Sublime in my (admittedly very limited) experience
I mostly use vim because I tend to hack around on remote systems a lot (I'm really more of a sysadmin, lately, than a sotware dev)
and vim is always available to me
 
@Adam yes, that is one of the major advantages of vim, and the reason that I have (at least minimally) tried to learn it myself - it's a real PITA to set up GUIs over SSH sessions...
 
I'm slowly trying to integrate more of vim's stuff into my workflow
folding is up next
but it's kind of a pain, because if I have a multi-line string that I've kicked back out to the left margin it'll auto-fold thinking the function ends after the string
def some_long_func():
    s = """\
The string
is really long
and covers multiple lines"""
    but_there is More()
    code = "below it"
turns into
+--  5 lines: def some_long_func():---------------------------
    but_there is More()
    code = "below it"
unless I manually fold it
 
@AdamSmith did using an if statement over the shebang line in vimrc or scripts solve your python 2 vs 3 problem?
 
didn't end up needing to use it. Realized cross-compatibility for this project was as easy as from __future__ import print_function and approached PM with it
I do appreciate it though
 
lol
 
1:03 AM
I haven't done ANY bash scripting
 
de nada, I've been using vim since I started with vi on an old IBM dummy terminal in 1998
I forget people use other text editors sometimes :)
 
haha
 
 
1 hour later…
2:13 AM
OT-should be on Superuser
 
2:54 AM
check for the election vote-count by running this gist.github.com/Avinash-Raj/b0edbd61c349cbeb8e20 Python script
 
3:30 AM
cbg
 
cbg
 
4:27 AM
cbg
 
 
1 hour later…
5:49 AM
cbg
 
6:17 AM
Cbg
@DSM yes, lies :)
 
6:41 AM
cbg
 
user4433485
Cbg!!
 
Hey up
 
If you insert into a list to a location that exceeds the list's size, does it grow to accommodate that location?
 
No don't think so
What would it grow with?
 
6:51 AM
I don't understand the question :)
 
@RobertGrant simple test mylist=[]; mylist.insert(12345, 0)
 
Well what would it fill in to get to the correct size?
 
I dunno :) Nones?
 
None? Or 0? Or ""?
 
Something elses?
 
6:52 AM
Come on Robson think!
 
None is a valid value for some lists after all :p
 
7:04 AM
Cbg
 
Sorry guys!
 
@Ffisegydd do we throw @Robert into the pit yet... or give him one more chance?
 
This isn't the pit?
 
@Robert well... we got the carpet re-done and some nice flowers around the place :(
 
And it looks GREAT! wow
 
7:09 AM
Wow. Such pit. Very flowers.
 
okay... that awkward moment you can't find your hairbrush... think beep it... sit down, then find your hairbrush... ouch
 
I'm now hooked on codeeval
 
Sounds like a drug.
 
is that the new legal high or something I've been hearing about?
 
And it took me a horribly long time to get this right
And my original solution relied on being able to insert into a list at any point :)
 
7:13 AM
cbg
@JonClements Codeeval has the pain-killing power of codeine, without the drowsiness.
 
@RobertGrant Don't go looking at hackerrank then either..
 
@MartijnPieters okay
 
... and definitely DON'T think of pink unicorns
 
This is still too broad to re-open, isn't it? stackoverflow.com/questions/29646643/… .
 
7:26 AM
not sure it's even OT
 
GAH!
Bloody HRMC and their trained monkeys.
Oh, and Norway not sending me their stuff directly.
 
@Martijn don't get me started on HMRC :)
 
Almost as bad as HMRC?
Bah.
 
No, worse..
 
Cbg :)
 
7:39 AM
@JonClements Yeah. Hopefully, he'll follow my suggestion and write a pair of simple programs that communicate via a named pipe. And then if he gets stuck doing that he can create a question that's on-topic.
 
okay - who put Peter Andre in my MP3 collection... I will hunt you down... and and and....
 
Hug you?
 
errr.... so first you Love me (quickly edited) - now you want to hug me?.... awkward :p
 
Summary: I closed my Norwegian company in 2013, and with that their VAT notifications went up in smoke.
So I missed a final VAT reminder and forgot to handle it properly.
Fast forward, 2014, I get sent very threatening letters by the HMRC about this.
Quickly, call the Norwegians, not a problem, even apologies, they should have done it by paper and not electronically.
All forms filled in, VAT transferred, done.
Today: call from HMRC again. Trained monkey time!
 
I was in a vaguely similar position, where I had closed a UK company and HMRC kept sending me tax returns anyway, after they said they would stop doing that. Which was bad because I had been in South Africa and didn't see my snail mail tax return for a year
 
7:45 AM
It's also even more fun with WHT
 
The Norwegian tax people are always wonderful and friendly and helpful.
The UK people are on the phone being bullies half the time, expecting you to put up a fight.
So trying to explain that I'm not just going to give my name + DOB + full address to someone calling out of the blue is fun!
 
this is why one has an accountant - they deal with that :)
and also - since they're a friend of mine... also only means I buy them a steak dinner a couple of times a year in fees :p
and a good friend's wife works in HMRC so... any probs....
so while it's unbelievably frustrating... it does help having "in roads"
 
Yeah I have an accountant
Definitely so much nicer
In theory I find professions that are only there because government systems are so bad you need an entire other person to use them for you ridiculous, but I'll make an exception for accountancy because the problems are complex
Partially, codeeval? What the heck is that? And why can't I get back to my code?
 
I need to make the push for Python gold.
 
because of the pink unicorns you weren't meant to think about!?
@Ffisegydd that'd be awesome... you're not far off!
 
7:59 AM
812.
I've got interviews to prepare for today/tomorrow though.
brb coffee.
 
8:29 AM
sighs - think I'm ready to man/puppy up to review the commits another developer made as I refused to work last night
cbg @PeeHaa
 
cbg @JonClements o/
 
errr, do I now do a \o ?
 
You can. It's afree country ;)
 
and then if I've queued that up right.... someone does....
 
o7
 
8:39 AM
okay... that worked out unexpectedly ;)
 
And the Norwegian Tax, foreign collections office just called back: there is nothing outstanding, no interest to be paid, all is cleared.
 
@Jon it's meant to represent "saluting"
It's used in EvE: Online extensively.
 
An apology for the misunderstanding would have been nice, but the fact that they treat me like a human being is enough, I suppose.
 
@Martijn that's expecting too much... in the UK you're tax herd
 
@MartijnPieters sounds like a blog post
 
8:42 AM
@JonClements do they train the HMRC monkeys to rub people up the wrong way?
 
my experience with dealing with them in person, has been nothing but frustrating/verging on wanting to shout
and I'm one of the calmest/laid back kinda guys you'd ever meet
been kept waiting nearly an hour, was getting threats such as "if you don't pay this", and me "but it's already paid... in fact - according to these numbers it's overpaid etc..."
 
cbg
 
cbg @Bhargav
 
Dunno what happened to college network. They had banned chat
:D
 
awww
 
8:51 AM
Fk. Even facebook is accessible D:
First cv-pls from coll network! \o/
 
I think at some point sopython.com was classified by websense as a chat site
 
But why?
 
automatic filtering stuff or something
 
Automation gone wrong.
I need to bone up on my Excel skills.
 
wrote to them... think it's corrected now though (hope so)
 
8:55 AM
This would be easier if I actually had a copy of Excel to bone up with -_-
 
@Ffisegydd you're on a mac yeah?
 
Well either. I do have Numbers or whatever the Mac version is.
 
well there's open office libre that's good
 
cbg(all)
 
depends really what you're trying to brush up on
 
8:58 AM
@Ffisegydd have you recieved my message?
 
@Peter cbg! How're you and colti doing?
 
@Peter I did. It was definitely not as good as 2 or 3. Parts of it were quite dire.
 
@JonClements haha -- glad you are asking => he is here with me at my work place ;)
 
I enjoyed it as a whole I think, just because Spacey is a legend, but it was definitely marred by disappointment.
I also very much like the author dude.
 
@Ffisegydd I highly recommend you to download the OST of HoC
it is still very very good
(even for the 3rd season)
 
8:59 AM
:D
This rep:Answer stuff on sopython is cool. Just above @Jonc
 
anyway, funny fact: I only saw that specific waterrower, I have ordered -- and which arrived today -- in the house of cards first
 
Rowing machines are very good for exercise.
 
@Ffisegydd I heard the same: they are not killing your joints, but also working your full body
(the second best sport for cardio after swimming -- which I obviously cannot do at home)
 
They take time to get used to, at first they'll murder your body :P
Make sure you get the correct technique as well. Do a bit of research on it.
 
9:07 AM
that's exactly wehat I wanted to "tell" you
killing your body means your technique is not that great.. maybe?
;)
yeah, I actually did quite some research in the last 1.5 months
a WaterRower like that costs a fortune, so I did't want to rush on the decision before I pay that amount of money for an equipment like that
 
@Peter no even with proper technique it'll hurt at first, it really is a thorough work out :P
 
@Ffisegydd I hope it is ;)
anyway, I get to get back to work now, but bbl
~
 
@BhargavRao rep cap can be a harsh mistress.
 
Also - rep isn't everything the community is about...
I don't even think I was your rep when this room was re-born
 
@JonClements You were just an ickle little cute puppy then.
 
9:20 AM
as opposed to the older "cute puppy", right? :)
@Bhargav I used to have the #1 spot on the Python tag :)
then this annoying person (that I consider a good mate) came along called @Martijn
passion and ability means more than rep imho
okay.... why does something always open on the "wrong" screen
been waiting 2 mins to wait for an OO document to load... then it's not on the screen I'm looking at
 
9:39 AM
@JonClements Ninja should have started at least an year before he did
 
cbg @JRichardSnape
 
@BhargavRao Loading a document in OO?
 
@BhargavRao well... we hadn't perfected his AI yet...
 
Ah! Then it was you evil puppy who did not let loose Ninja as soon as SO started!
 
Blimey. This one took me a while to even understand the problem. Back to the easy ones for me.
 
9:43 AM
@Bhargav guilty as charged your honour? :p
 
I guess that was the reason you lost your 4th leg :D
 
you dare to mock me sir? One takes offence! :p
 
Is that to lean on because you only have 3 legs?
 
weeps
 
Aargh! Classes start again at 3:30pm. cries
 
9:51 AM
Going through some "oldies": youtube.com/watch?v=wh-07BzfgYY
 
rbrb all
Will be back after coll
 
take care @BhargavRao - enjoy our class
 
Ty! :D
 
10:21 AM
hy
 
Hello.
 
10:50 AM
6 pages of notes on my CV and I'm barely half-way through o.o
 
Notes about what?
 
Well one of the interviewers said "Make sure you can talk about everything on your CV"
So I've gone through and made notes on everything on there.
I find making notes on something is the best way of revising (personally).
 
Hi all. I would like to to ask a question.. I have two different application one is service for deals and offers written in flask and another is django cms.. I would like to share some date between them with celery and tasks.. Is there any way how can I push a result of a task to redis server and and then fetch the result by another task in django application? Logic of those tasks are different so they must be different just listen and talk on the same queue and data store..
 
Yes.
 
And how? I don't want to run celery beat and check new results periodically..
 
10:59 AM
I don't know, I've never used Celery so don't know how it specifically works, but surely this is just a message broker problem?
There must be set examples on the internet of this, it's a common task.
 
Sup brah.
 
That's how I prefer to pass (non-sensitive) information to/from django
Ahoy Fizzy. Been lurking casually for a bit
How's it going?
 
in realtime?
 
@radeklos if you're using a realtime OS, I guess it's possible
 
11:03 AM
still don't get it how django command can handle celery tasks..
 
@Intrepid not bad mucka. Work work work. Got 3 interviews next week (sounds like I'm complaining but I'm not really).
 
@radeklos You didn't say "handle celery tasks" previously, but you could have a simple celery task that executes a manage.py command
@Ffisegydd Good stuff. All in fields that you're interested in? Also, x3000 on the be able to talk about the things on your CV. I guarantee you, the think you're least experienced in/least want to talk about will be the thing the damned interviewers pick up on
 
i have task A which save something in redis and I would like to A's result processed in task B..
 
2 in data stuff, 1 in software engineering. I've also got other applications out there so hopefully some of those will come through too.
Waiting to hear back on a programming exam I did.
 
@Ffisegydd Erugh. They're the worst
 
11:09 AM
Hah. The test said I had to use C++. I was about 10 hours through a C++ tutorial (after prototyping it in Python first) when I got a 2nd email saying "BTW you can use Python if you want to."
 
@radeklos Then pass the output of task A to task B?
@Ffisegydd hahahaha
 
I then had to re-write my Python code because I'd prototyped it in such a way that it could be easily transcribed from Python -> C++ (e.g. nothing too clever).
 
task A lives in another application.. based on Flask.. but task B lives in django application...
 
Then use a message broker. Have you searched for similar problems?
As I said earlier, this is a standard problem.
 
@radeklos if you need specialised tutoring, this may be helpful to you
 
11:14 AM
I'm still searching for solution.. but I can only find simple solutions with shared task in a python package used in two applications..
 
Front page of that site: Mr. Pieters :P
 
let say that i have java application with celery task and python application.. how would you share theirs tasks between them?
 
With a message broker.
I swear this is the 3rd time I've said it. It's like déjà vu. I'm going to see 3 black cats next and know something is wrong with the Matrix.
 
THEY'VE CUT THE HARDL----lost carrier
 
"We meet again Mr Good"
 
11:18 AM
Actually we'll easily tell if the Matrix becomes threatening. They'll drop the pretense that not everything is code, and the font in chat will all be like this
 
huh?
 
And it's off-the-cuff remarks like "Go kick a child" that I just said to Intrepid in a different convo that mean I can never run for mod.
 
It's probably for the best :P
 
@Ffisegydd: a quick sum of the current top 10 shows I have 21.5% of the total votes cast at the moment.
What was Bohemian's total again from last year?
Ah, found it:
17 hours ago, by Ffisegydd
While Bohemian had 21.3% last year.
 
21.3% :P
 
11:26 AM
@MartijnPieters pineapple
 
Oh I see you beat 10k :p
 
:-)
in Stack Overflow 2015 Moderator Election Chat, 1 hour ago, by Martijn Pieters
and 10k has been reached!
 
Close between Jon and Matt. Matt was actually my 3rd choice last year too (behind Jon and bluefeet)
 
the distance between them has been fairly stable.
The whole dance between Jason C, Ed Cottrell and Undo on the other hand..
I have the impression Jason C has the UTC evening crowd, while the other two get the morning votes.
With the vote closing at 20:00 UTC tomorrow, that may or may not give Jason C the edge. But it is too close to call at this stage.
apparently chat is down. Not sure what I am doing here then.
 
11:41 AM
They cut the hardline
 
altered reality. We're all imagining this - in reality chat is down....
 
H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ
 
re-cbg
Groovy! I just got a late accept from a newbie who's not afraid to do some hard work to solve his problem: stackoverflow.com/q/29493204/4014959 I'm not sure if his solution (modifying standard module code) is the best approach, but hey, I guess it works. :)
@RobertGrant Oh yam
Is it just me, or is this question yamming confusing? stackoverflow.com/questions/29673697/…
 
11:56 AM
@PM2Ring Nice - feels good to educate and help people through :)
 
@JRichardSnape Indeed! That's why we're here, isn't it? :)
 
@PM2Ring Agreed
 
OTOH, there are exceptions:
I do it to get more chicks — Oliver Watkins Oct 27 '14 at 9:47
@OliverWatkins: In this community, you gotta make the rep first. Then when you get the rep, you get the power. Then when you get the power, then you get the women. — PM 2Ring Oct 27 '14 at 10:16
:)
 
Opinions please - is last comment on my answer in the right tone here? (pls ignore temptation to lecture on the perils of exercising my Java muscles, or bad practice of posting a link to a Java Q in a Python room - I just want opinions of experienced site users on tone without a meta-barrage on the Q) stackoverflow.com/a/29630556/838992
 
@PM2Ring yam?
FIRE THE METABARRAGE
@JRichardSnape I think you've been really good; wouldn't have a problem with that.
 
12:13 PM
@RobertGrant Cool - thanks for looking.
 
12:25 PM
@JRichardSnape Well handled. I'm no fan of Java, but I'm not prejudiced against it, or people who code in it.
FWIW, I've been busy on U&L scoring points by writing in awk. :) unix.stackexchange.com/a/196577/88378
 
Cabbage!
 
Cabbage poke
 
I see Martijn hit the 10k…
 
12:50 PM
Damn newbies who link to screenshots of text :grumble: stackoverflow.com/questions/29674717/…
 
1:04 PM
@tristan you got a new skill son!? Awwwwwwww yiss.
 
user559633
Aww, come into the room and have a comment for me waiting :D
 
user559633
@Ffisegydd What's my new skill (assuming linkedin, because I ain't learned shit IRL)? I think I aded ZUMBA/CSS as a joke and then removed it after remembering I already tagged some other people with it.
 
It was yeah. Got an email about it and everything!
Check out Tristan Fisher's new skill
 
user559633
Haha, what did they list as my new skill?
 
"ZUMBA/CSS"
 
user559633
1:11 PM
Yesssss
 
Finally the recognition you deserve.
I'm proud of you. wipes away a tear
 
user559633
Also, that proves that linkedin works the way I think it does. User actions are queued up for clickbait/spam immediately.
 
They blog a lot about their internal workings.
And, in fact, it's one of the better blogs I've seen.
 
user559633
Anyway, thanks. I also considered changing my "tagline" to "I got my grade ten!!!!"
 
Wonders will never cease: OP of stackoverflow.com/questions/29674717/… removed the screenshots & posted the text, with the code in an actual code block!
 
1:20 PM
I'm about to overtake the highest-voted question on Stack Overflow!
10156
Q: Why is processing a sorted array faster than an unsorted array?

GManNickGHere is a piece of C++ code that seems very peculiar. For some strange reason, sorting the data miraculously makes the code almost six times faster. #include <algorithm> #include <ctime> #include <iostream> int main() { // Generate data const unsigned arraySize = 32768; int data[arr...

 
How to hack RSA in Python: stackoverflow.com/q/29675755/4014959 :)
 
user559633
@PM2Ring Voted to close based on "I'm not a programmer, give me a solution"
 
morning everyone
 
@tristan Fair call. I vtc'ed due to lack of MCVE, because that seems the best fit when someone posts links to screenshots. But I retracted after he posted his code. I agree it's still a crap question, but at least it's a little better than what it was. :)
cabbage, corvid. Did you have a go at writing a Python program that generates SVG? The other night I posted a link to a very simple demo I did a while back, but you might not have seen it.
 
user559633
1:41 PM
Heh. I'll be a speaker in the "executive lounge" at a conference next month.
 
user559633
 

« first day (1643 days earlier)      last day (3296 days later) »