« first day (1659 days earlier)      last day (3288 days later) » 
01:00 - 14:0014:00 - 00:00

1:29 AM
cbg all
 
 
2 hours later…
3:06 AM
cbg
 
3:31 AM
cbg
 
4:10 AM
Hey there, is anyone familiar with the pyneurgen library? I'm having some troubles with it
 
I'm not, sorry
but you should just ask your question -- no need to ask if anyone knows about it
 
Ah, okay. It seems pretty obscure, so I just wanted to check to see if anyone had actually used it before asking a question that never gets answered
 
no, haven't used pyneurgen... there are 2 sets of problems, those who concern python and those who concern the problem domain
so if your question is like "I am having trouble installing it / it is throwing this exception / blabla" then anyone might be able to help
if you say: "I think the algorithm is wrong / the output's are just off" then not :D
@EmptyFlash ^
 
4:25 AM
yeah, it's more of a domain specific problem I'm having with the library :(
 
rbrb -- daughter's bedtime
 
cbg @MartijnPieters
 
4:45 AM
cabbage
 
@BhargavRao hmhm
 
@AnttiHaapala It is better to know that it is Bad than to use it sometime later in life and let oneself down — Bhargav Rao 1 min ago
:D
@AnttiHaapala Can you think of an ugly way?
 
def movie():
    global movie_returns
    movie_returns = [movie.strip() for movie in movies_list]
    movie_explorer()
    # No return

def rand():  # No argument
    movies_list = next((globals()[v] for v in globals() if v=='movies_return'))
    rand_item = random.choice(movies_list)
that's about the ugliest thing I can come up with on short notice
 
@AdamSmith Mind if I add that?
 
4:58 AM
lol
Adding that
Aha!
The Good, The Bad and The Ugly
 
argh. Okay this is the part of the night where I complain about my job because I'm on call
I work for a local convenience store chain doing what basically amounts to helpdesk stuff
 
So sad! Btw, I'm at home enjoying Saturday!
:D
 
our credit processor, because we're lumped in with gas stations and etc, requires that we handle credit transactions a certain way.
essentially this means that we have to check a flag in our software where if the customer doesn't have the full balance available on their card, rather than kicking back with a "Decline," it will approve a transaction of the remaining balance in their account
this is necessary in the case of fill ups for gas stations, apparently. I don't know, because we don't do gas, we're just obliged to do it this way
This means that the lady who just came in and bought $60 bucks of product but only had $20 bucks on her foodstamp card and can't pay for the rest is screwed
we can easily return the full balance to her card, but it doesn't remove the hold from her card so she can't turn around and spend it again
 
cbg ...
 
5:08 AM
And she's declined
 
grumble
 
cbg @Avinash
Your absence helped me answer a regex ques ;)
 
so the poor minimum wage guy or gal behind the counter has to add up the costs of everything by hand to try and get it below the amount that her card cleared
and then we Item Return the difference
it's such a lousy system
 
Couldn't they have automated the whole thing?
 
@BhargavRao Yep, I lowered my activity. Now go and earn reps from my tag..
 
All the best to you and Kasra..
 
@BhargavRao we should be allowed to just turn off the stupid flag that says "No, don't decline this card, go ahead and take everything they have instead."
but I digress.
 
stribizhev also becoming popular...
 
5:11 AM
@AdamSmith Sad stuff for that gal behind the counter :(
 
Yeah I mean I can't complain too much -- I'm making bank sitting on the phone with them while they figure it out
but still
 
Hahaha
That is so ugly. I can't believe I wrote that. — Adam Smith 20 secs ago
:D :D
@AdamSmith Don't ya people give loans kind off thingie to such poor customers
 
You heard where I said convenience store, right?
 
Oh fk. Yeah
Missed that
@AdamSmith It is true, you were the brain behind that ugly piece of code - chat.stackoverflow.com/transcript/message/23050150#23050150Bhargav Rao 18 secs ago
 
How can I ask the database using ORM if username or email are available. Both need to be available else tell me why.
this solution does work only for first try/except
try:
users.objects.get(nick=nick)
available1 = 1

except users.DoesNotExist:
available4 = 0

# CHECK IF EMAIL EXIST
try:
users.objects.get(email=nick)
available2 = 1

except users.DoesNotExist:
available3 = 0
 
5:22 AM
what ORM are you using?
 
Django
 
It'd probably be easier (as a whole) to set both nick and email to non-nullable
 
I just want the 2 Queries to tell my if they dont exist.
 
users.objects.get(nick=nick,email=email)
like that?
 
5:23 AM
yet another shitty answer for C-api accepted with 4 upvotes
and no one wants to say anything about the really glaring errors
dsf
 
any ideas?
users.objects.get(nick=nick,email=email).exists()
???
 
Django and me are two corners of the spherical world!
:D
 
is it possible to use
if users.objects.get(nick=nick).exist() || users.objects.get(email=email).exist():
 
sqlalchemy: session.query(User).filter((User.nick == nick) | (User.email == email)).exists()
:D
can't remember anything of django ORM anymore (thank god)
 
Know Django?
| is the same as || in python rigth?
right?
 
5:28 AM
in the above you'd use or in django
but get is not going to work
 
Ugg! Got a call from Prof. No longer a free Saturday :( :(
Rhubarb all
 
it returns 1 object, or exception on 0 or 2 matches :D
I guess in Django you'd do it
users.objects.filter(Q(nick=nick)|Q(email=email)).exists()
 
yeah I used Django for exactly 3 hours
 
or use the Q objects
 
though I'm more interested in why you need this, since I feel like you should only ever have to check one or the other
 
5:51 AM
a = [5, 2, 6, 3]
a[0] = a
>>> a
[[...], 2, 6, 3]
how do I access elements from [...]?
 
a[0] is [...]
so a[0][1] is 2
(so is a[0][0][0][0][0][0][0][0][0][0][0][0][0][0][1])
 
In [...] I need to access each element, how do I access?
 
the first element of [...] is [...]
so you can't -- it recurses infinitely
 
I guess when I say a[0] =a then a is [[5, 2, 6, 3], 2, 6, 3] is that true?
 
no
hmm actually I don't think so
a[0] = a should do [[[[...], 2, 6, 3], 2, 6, 3], 2, 6, 3]
I think
 
right, the [...] is infinite recursion
each a[0] is also a
 
in javascript console I see something like this... Is that what you are saying?
 
right
you can keep clicking the > expander on element 0 forever
 
thank god tuples were immutable, I was into all these recursive stuff
yes
But I was expecting some thing like [[5, 10, 3, 4], 10, 3, 4] instead of above. do you get me? why I say this?
 
why would the 5 stay? you're overwriting it with the self-reference
if you want that you can do: a[0] = a[:]
it'll set the first element to a copy of a instead of a recursive self-ref
 
6:08 AM
when we say "a[0] = a" here RHS "a" is [5, 10, 3, 4] so am I not suppose to replace 5 with [5, 10, 3, 4]?
 
a is a name. the name points to a list in memory.
when you say a[0] = a you're setting the first element to point to the whole list
 
exactly. If you do a[:] as @tzaman just suggested, it will create a copy of that list (literally slicing from the first element to the last element) and set a[0] equal to the copy of the list (which of course does not recurse)
 
@overexchange maybe you should read through this
 
@BhargavRao I wrote something pretty to make up for the ugly I wrote earlier stackoverflow.com/a/29998968/3058609
 
when I say nums = (1, 2, 3), Is nums as shown below?
 
6:14 AM
yes
 
but since nums is a tuple, you can't then do nums.append(whatever)
because tuples are immutable
 
@overexchange exactly. Same if it were a list. And then if you did nums[0] = nums, you would end up with:
 
Star for the mspaint work.
 
6:18 AM
:D
 
hahaha
 
although something different entirely would happen if you did nums = (1, 2, 3); nums[0] = nums
 
well that would just be an exception
 
Hooray for TypeErrors
 
@tzaman ah please dont answer, let me
 
6:22 AM
and just for completeness' sake, nums[0] = nums[:] looks like:
 
guys, is there any active user here?
 
i have lil problem about grouping list
 
just ask, @SonicMaster
don't ask to ask :)
 
@BhargavRao yeah, I post the correct answer and no upvotes :D
because all the upvotes did go to the FGITW
 
6:25 AM
I have a list that consist of tuple. Here is my list: [('a','b'),('a','c'),('a','d'), ... ] and I want to group that list into this form [('a',['b','c','d']), ... ]
Is there any optimum solution?
 
sure. itertools.groupby
 
>>> nums[0] = nums[:]
>>> nums
[[5, 2, 6, 3], 2, 6, 3]
>>>  as per the diagram above
 
from operator import itemgetter
from itertools import groupby

lst = [('a','b'),('a','c'),('a','d')]
result = [(grp, [v[1] for v in els] for grp,els in groupby(lst, itemgetter(1))]
@SonicMaster ^
note that groupby groups sorted data, so [('a', 'b'), ('unsorted', 'tuple'), ('a', 'c')] will throw off your result
 
hokay, it's super late. time to find a 2am snack and then head to bed
rbrb all!
 
SyntaxError: invalid syntax, @AdamSmith
 
6:32 AM
oh I forgot a close paren
meh
[(grp, [v[1] for v in els]) for ...
 
this is what i get
[('b', ['b']), ('c', ['c']), ('d', ['d'])]
@ada
@AdamSmith
 
not with that input you dont' :)
 
sorry?
 
oh oops
no I'm just bad and can't copy my own code
itemgetter(0), not itemgetter(1)
sorry
 
Nah, it works like a charm @AdamSmith
Thank youuu
 
6:40 AM
@tzaman In javascript what is an equivalent for nums[0] = nums[:]?
 
I think he left
and it's been too long since I used javascript to remember
however you copy a list
that's how~
 
@overexchange what do you mean javascript? are you sure what does it do in Python either?
>>> x = [1,2,3,4]
>>> x[0] = x[:]
>>> x
[[1, 2, 3, 4], 2, 3, 4]
 
in javascript you'd do:
x = [1,2,3,4];
x[0] = x.slice();
 
6:44 AM
the [x:y:z] in python is called slicing and in javascript much the same on rvalues are achieved by the Array.slice method
 
javascript does not support the stride argument
 
stride?
 
Cbg!
 
stride skips elements.
it's the z in [x:y:z]
[start:stop:stride]
 
6:51 AM
nums[:-2]
 
cbg @vaultah
 
is -2 stride here?
 
no that's stop
nums[::-1]
-1 is stride
 
>>> nums = [5, 2, 6, 3]
>>> nums[::-1]
[3, 6, 2, 5]
>>>
 
cool, huh?
 
6:54 AM
i get the meaning of reverse, when you say stride, from above output?
 
it might be a little easier to understand if you use positive stride. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10][::2] is every second element. [1, 3, 5, 7, 9]
 
using a stride of -1 has the effect of reversing the list, since instead of stepping by 1 from the start to the end, you step by -1 from the end to the start
 
so here stride does not exist and nums[:] considers start and stop only. is that correct?
 
yup
in other words, take everything from the start of the list to the end of the list
 
6:58 AM
ok
 
some_list[:] is idiomatic for import copy; copy.copy(some_list)
it's a shallow copy
some_list[::-1] is idiomatic for list(reversed(some_list))
 
7:34 AM
ceebeegee
 
cbg antti
 
0
Q: How can I pass data in run method (thread) (python, Pyqt)

Q-bartI want to make the thread, in the window, using PyQt(Python). For example class window(QtGui.QWidget): def __init__(self, parent = None): QtGui.QWidget.__init__(self, parent) self.setGeometry(100, 100, 500, 200) self.setWindowTitle('Hello') self.label = QtGui...

do we have a dupe for this?? :D
 
Well that was entirely too much time wasted because I didn't realize jinja needed its own comment syntax.
 
wrote stubs in my template of views that don't exist yet wrapped in <!-- --> tags and took me an hour to figure out why it wasn't working
which, all things considered, must mean I'm getting tired since that's much too long
 
That said: I'm headed to bed
Rhubarb
 
@AdamSmith rbrb
 
@BhargavRao excellent at here: stackoverflow.com/a/29997749/918959 was thinking I am going to write exactly this as an answer if it does not exist yet
 
8:13 AM
Cbg
 
@AnttiHaapala cvd everything above
 
silly me I duped the extend question with wrong target
 
Change the dupe in the other way
:D
 
@BhargavRao nope, I found a shitty question then realized that the guy is doing [].extend('a') which is altogether a different story.
@BhargavRao ah that user too :D
mhmhm
you should probably also instruct using 'append' instead of extend
SDFASDFkladsjfasdljkfaklsdjf
the first dupe I guess was better :d
 
8:19 AM
3 more votes on that and I get a medal
 
Another quake in Nepal
 
rly?
news only tell about 1 baby... what's like wrong with the world
 
@Antti yeah... woman that has gone into labour - obviously massively more important than anything else! :p
Anything like last time, they'll be frequent news reports of "nothing to report".... but we've got a few minutes to fill, so let's ask some nutters that have camped out for 2 weeks what they think about it... sighs
 
8:39 AM
Whilst I think the quake is important, and more important, I don't see too much harm in talking about the baby in the news. The world is a pretty depressing and sh*t place at the moment, it's nice to have something harmless once in a while.
 
@Ffisegydd There's that... but not every 5 minutes :(
Mind you - makes a change from GE sound bites...
 
Still haven't decided who I will vote for.
 
Ninja Puppy as dictator....
You get whatever you want... and you don't have to worry about pesky democracy and voting again... much easier life for you :p
 
here's how much I like monarchy as an idea:
 
Come on - the queen was great with James Bond in 2012 :p
 
8:47 AM
:D
was about to write something about the parachute working too well
 
LOL
And we've got Prince Philip that's remarkably good at insulting foreign nations - that's always cringe worthily amusing
 
hehe :D
 
And Prince Charles really cares about the environment (but I have a bit of a feeling that's because he owns most of it)
 
I'm thinking of editing this stackoverflow.com/questions/29998421/… and make it canon
@Antti ... Ideas?
 
@BhargavRao I do not like it, there are 2 separate issues in the question :D
the one is using extend for something that should be append
and the other for taking the return value
 
8:51 AM
Err, So leave it alone?
 
I noticed there is no canonical list.append/.extend/.reverse/.sort one at all for any of them
 
Yeah, the reason why I got that idea
 
what do folks think about writing a new q/a for all of the above methods
 
Perhaps this December, we'll write
 
december? :D
 
8:55 AM
@AnttiHaapala Yeah, Hats everything for hats :P
 
I got -2 rep today :d
except I wrote 1 answer for more than half an hour
maybe I should become more aggressive :d
 
That C++ one?
 
Nice
Errrrr Answered already
Anyway! Rbrb. Gotta go
 
9:29 AM
@BhargavRao disagree :d
not the dupe, the good solution is not to run map() on that
that is why jonsharpe's answer is the correct way and this cannot be made a dupe
 
9:46 AM
Oooops... can someone accept and edit this one stackoverflow.com/questions/30000368/…
mis-clicked - it just needs the python tag added
 
done.
 
10:11 AM
Oh good - she's had a baby girl...
now... let's get back into more serious issues please broadcasters!
 
11:02 AM
Cabbage
 
Hey up sunshine
 
It's a Saturday. What are we all doing in here?
 
Listening LOL
 
Listening to the tumbleweeds?
 
11:31 AM
@IntrepidBrit yes... don't interrupt their beautiful sound
 
oh darn it - you've spoilt the mood now sighs :p
 
12:20 PM
Sorry :/
 
Better chase after the tumbleweeds and get 'em back...
we can't keep buying new ones...
 
I have returned.
 
With the tumbleweeds?
 
Watching "Escape To The Country". Yes. I really am middle-aged now.
 
@Ffisegydd you - middle aged - oh boy... I'm barking laughter :)
 
12:29 PM
I've got a question: why does Kevin think that Tristan's fallen into a vat filled with Welshmen?
 
Tristan's very accident prone?
 
Now that was a good party.
 
omfg - the animatrix is now on netflix... a few episodes of that I wanted to watch again and lost my DVD copy from 10+ years ago.... rbrb for a bit :)
 
Look at these people, all coming and going with their lives and television shows. I thought Jon would be like Wishbone and be annoyed by the talking box
Fizzy - how fare the interviews?
 
I'm front-runner for one, they've got to interview a final person on Tuesday then we'll see.
 
12:32 PM
@IntrepidBrit don't worry - I certainly don't have a life :)
 
I've got another interview on Wed which will hopefully be redundant (as I'll have the confirmation from the other place).
Waiting for feedback/decisions from other places, if the place on Tuesday say "No" I will begin pestering people.
 
@JonClements Good to know. I'll sit in the office and sulk over soup in the meantime :P
You like the Tuesday interview?
 
@IntrepidBrit if it's any consolation... I'm working on Monday
 
I'm also working tomorrow ;)
 
I like the place that are interviewing their final person on Tues the most, joint with a place that I'm due another phone interview soon.
I'm working all three days as I'm preparing a presentation for the interview on Wed :P
 
12:35 PM
But it's not the same as working. Gently panicking and rocking silently in the corner of the room is so much easier than work
 
Writing a presentation on Nidababababababababababa. Will put it on the intertube as a pdf also.
 
Cool
Looking forward to it ;)
 
feel free to rename it if you can't stop typing the name.... several slides/pages of bababababbababababababba is not going to get you much look in :)
 
It's a 20 minute presentation so I was just going to pad the time out.
 
and end in a padded cell?
 
1:21 PM
The C++ questions on SO are so useless.
 
Serious Talk: Can anyone think of any good keywords that could be searched for in questions that would indicate that a question is poor?
Such as "help"
 
Every prominent question is meaningless faffing about on edge cases in the standards documents.
@Ffisegydd This is for an algorithm that will scrape the site? Why not just machine learn the words?
More fun that way. =)
 
It's actually for a presentation I'm doing on the algorithm :P
So I don't have time in advance to ML the terms
 
@Ffisegydd just say you're planning on using di/tri/graphs
sorry... my attention is split everywhere at the mo :(
 
@Jon yes I know that part, that's not what I'm talking about.
I'm talking about example keywords that might show a bad post, for example obscenities.
 
1:38 PM
err... those would work... but without context... that's the main thing
 
What do you mean?
 
in IRC some people use to have a bot that responded to words to kick people
 
@Ffisegydd needful
 
Yes but this isn't the same situation. This isn't saying "If the post contains the word shit then it's instaclosed and deleted". This is saying "If there are a large number of obscenities then it may be that it's a poor question, but we also have 40-50 other features that are used in the model."
 
So - what's wrong with all the words/phrases you've added to the nidaba trello board?
 
1:46 PM
I've added some of those as examples but I thought I'd ask if anyone else had any ideas.
 
'teacher', 'professor'
I dunno, it seems like that kind of question says more about our personal models of SO. I trust an algorithm way more than my brain.
 
Oooh yeah.
Indeed yeah. And for the actual analysis I'd do some stats for it :P
 
Ah, so we're the "Look how stupid humans are at this work" case study.
 
hmm, what is this room about?
 
1:56 PM
You could ask on Meta, but someone would probably just implement Nidbada themselves to find out the answer.
 
Hah, no you're my "give me some examples, they might not make it into the final analysis" guinea pigs.
@AhmedAl-haddad Python?
 
So I can say anything about Python?
:23053320
 
It's entirely possible that you could.
 
That's the idea.
 
You should probably read sopython.com/chatroom
 
1:59 PM
People are asking the newest Project Euler problem on SO and they're answering it too. This is sad.
 
01:00 - 14:0014:00 - 00:00

« first day (1659 days earlier)      last day (3288 days later) »