« first day (1499 days earlier)      last day (3449 days later) » 
01:00 - 14:0014:00 - 22:00

2:01 PM
guys, django question. i have a file models.py with the following content:
from django.db import models

class UserAuthInput(models.Model):
    first_name_field = models.CharField(max_length=100)
    last_name_field = models.CharField(max_length=100)
    email_field = models.EmailField(max_length=100)
get_object_or_404(UserAuthInput) returns 404 saying that No UserAuthInput matches the given query.
what's going on here?
and please don't post the link to the so questions as the responses are incredibly unhelpful for someone who has no idea what they're doing...
 
What's going on there is Django is telling you there's No UserAuthInput for the given query. Have you checked that the query is correct and that there is actually the correct data in the database?
 
it is there when opened through admin page...
 
OK, but the admin page is not performing the "given query" referenced in your error. What is the query?
 
2:19 PM
def index(request):
    p = get_object_or_404(UserAuthInput)
 
2:34 PM
what instance do you expect to get from that query?
carefully compare what you've done with what the docs say to do
 
@vaultah that was really cool
gets me in the mood for a day of SCIENCE!
 
2:54 PM
Wow... what a bizarre answer: stackoverflow.com/a/19774499/1252759
 
so many things wrong with it
 
I know it's mean - but wow... I've downvoted it :(
Why would you loop over all the keys to check if it's present before modifying it?
And they mention "if you find it takes too long... use this generator expression instead"... wat!?
 
Sometimes it's scary seeing low rep users post answers, it's just the blind leading the blind.
 
@davidism we were low rep users once... :)
 
And then they iterate through the generator all at once, negating any benefit.
To be fair, I've seen bad answers from high rep users too.
 
3:02 PM
why does he do a method to find keys? Isn't that the whole point of a dictionary?
 
is delegation, a right way to share a couple of methods of one class with another?
 
what is delegation?
 
class Common(object):
def __init__(self,x):
self.x = x
def sharedMethod(self):
print self.x

class Alpha(object):
def __init__(self):
self.common = Common("Alpha")
def sharedMethod(self):
self.common.sharedMethod()
 
That's a weird mix between inheritance and delegation... what exactly are you trying to do?
 
i have Question object, Answer object and few methods to operate on them. Don't know where to put those methods.
 
3:13 PM
Try explaining exactly what you're trying to achieve...
 
what types of operations? What is the overarching thing you're trying to make?
 
Parsing the Question body, Answer body and seperate text, code
 
maybe a function separate_text_and_code(html) at the module level, then a parse(html) classmethod on each class
that's the (basic) pattern I use for sopython-site
 
can linux handle a decent amount of triple A PC video games? I like most things on linux, except lack of bimeo gaemps
 
sure, it can handle them, if anything was written for it
 
3:26 PM
seems like valve is the only group that makes all their games linux-compatible
 
My steam library has 107 games for linux, and there are plenty more out there
I don't really do pc gaming though, so it doesn't bother me as much.
actually, most of the games I care about do have or come out with linux versions, so it's all good
 
"I have 107 games for linux" - "I don't really do pc gaming though"? errr...? :p
 
yeah I don't play games too much, just is slightly annoying to have to boot into windows to play a game. Want to convert completely over to linux
 
@Jon most of them are from humble bundles, I haven't played a lot of them :/
 
I suppose with android running on the linux kernel, doesn't it make sense to make games for linux, theoretically?
 
3:31 PM
I'm davidism on steam if you guys want to add me.
more game engines are adding linux as a platform target, so it might change in the future
what's annoying is the creator programs for those engines don't run on linux, only the compiled games do :(
 
looks like linux is only 1.41% of desktop market share :\ people still view it as fairly esoteric
 
3:53 PM
cbg!
 
read some where that linux is not that good for game development
 
Anybody can help me about using Google Translate to convert a .mp3 file to text? I analysed GETs and POSTs but I can't find that help me.
 
cabbage
 
google translate doesn't convert sound to text, it converts text in one language to another
 
@ChillarAnand do you remember what the reason was? I feel like with all the "flavors" and distributions it might make it hard to test
 
4:02 PM
@davidism if you click microphone image during using Google translate , you can say a Word in one language and see text of it in this language and the other that you want translate to.
 
can't help you
if google doesn't advertise an api for it, you're probably out of luck
 
what about the Google Voice Api? what is that?
 
there were an api but it seems that it doesn't work for a while : gist.github.com/alotaiba/1730160
 
@corvid wide variety of distros is the main reason. audio standards are also a big problem
 
the distros themselves aren't the problem, it's the library combinations and versions
but that problem isn't anything new to game developers, there's already a huge number of graphics cards and shader versions with different capabilities
 
4:14 PM
true. That's one thing that bothers me about linux. I wish after they forked things, they merged it back into something more central
 
they do merge, it's not forks that's the problem, it's different versions, or completely different libraries
 
what's the deal with having all kinds of themes and window managers that are essentially the same thing?
 
people like the way things look and behave
 
It is about the freedom and individualism
 
but the desktop environment doesn't really affect how programs do or don't work
 
4:15 PM
we get to change stuff the way we want..and do not need to deal with what is thrown at us!
 
different environments are trying to solve different problems as well
 
some window managers are not resource hoarding..
 
I really need to make a setup script and save it to github for whenever I want to reconfigure and reinstall my linux
 
4:37 PM
hi everybody
I've got a question: How can I save the print-output of this method in a list?
def traversal_h(self):
    if self.left:
        self.left.traversal_h()
    print self.root_value,
    if self.right:
        self.right.traversal_h()
 
what do you mean? You could make a string and append to the string then return the string, no?
 
you mean something like that;
def traversal_h(self):
    text = ""
    if self.left:
        self.left.traversal_h()
    text += self.root_value,
    if self.right:
        self.right.traversal_h()
    return text
I get the error: "TypeError: cannot concatenate 'str' and 'tuple' objects
"
 
I guess you have to convert it into a string first
 
and if I add str(....), I only get the first value
 
@@MarkF6 rather than printing, you need to put those values somewhere else
 
4:42 PM
ok, and where should "somewhere else" be?
 
not stdout
also why bother doing text = ""; text += self.root_value; return text when you could just return self.root_value?
 
this does not work; the only thing which works until now is: print self.root_value,
the comma is important
 
yeah, it's obvious it doesn't work, you're not doing anything with the return value of the recursive calls
 
yeah, but how could I do this correctly?
 
is this an assignment?
 
4:47 PM
if it is an object I would recommend overriding the __repr__ or __str__
 
@corvid stop
bad ideas
he's trying to traverse a tree, this has nothing to do with strings
 
no, I need this function in a project
and it would be nice if I could save the output in a list
 
I thought that he wanted a printed version of the tree? As in, print(BinaryTree)
 
yeah, you don't want to output to stderr at all, you should be appending to a list
hold on
actually, why not just use heapq?
 
(pic unrelated to conversation, just saw it on internet)
 
4:57 PM
haha
 
Mind you - I wouldn't say that's a "word" reversing function - more a "string" reversing function
 
def traversal(self):
    out = []
    if self.left:
        self.left.traversal()
    out.append(str(self.root_value))
    if self.right:
        self.right.traversal()
    return out
yeah, appending the output to a list. But how?
This version here only adds the first value
 
this one is even better
 
if i print "out", then i get:
['Laura']
['Anna']
['Lena']
['Luca']
['Matthias']
['David']
['Sarah']
['Secret Mum']
['Marko']
['Secret Dad']
['Jonas']
but not in 1 list :(
 
@MarkF6 stop posting code, it's too much
 
5:00 PM
I kind of abuse my ISP, in average ~60Gb/month (incoming + outgoing) :|
 
I normally do about 340gb... catch up :)
 
cbg
 
cbg @Ffisegydd :)
 
@JonClements wow. Because of iPlayer I guess?
 
5:06 PM
@vaultah and Sky Go and Netflix and... lots of databases
 
@davidism ahhhhh extend :)
yes, it works like this! :)
 
well, yeah, but you kinda missed the entire point, which was that you have to do something with the return from the recursive calls
 
thanks a lot!
what exactly does extend do?
 
read the docs
 
ahhh i got it :)
thanks a lot :)
 
5:17 PM
is the dock thing in elementary OS possible to install on any other linux OS?
 
yes, it's just another progam
There are a bunch of docks, I'm not sure which one eos uses: linuxers.org/article/best-linux-docks
I liked Avant back in the day
 
They use Plank
 
5:34 PM
looks like plank is just docky without gnome-do?
 
Cabbage !
 
morning rvaghav93
 
I'm going to kick you the next time you put a space before your punctuation.
also, cabbage!
 
Ah forgot that:P
 
PEP 8 dies suggest no spaces before punctuation. Cabbage, all
 
5:40 PM
@davidism I gues that doesn't apply to smilies :P
 
apparently I am getting a lot of emails for JavaScript developer jobs. Hrmph.
 
@corvid what time zone are you in?
 
Eastern US, why?
 
oh! its 11:30pm here.... Was wondering since you said morning :) anyway good morning to u!
BTW hows ur *robot army* coming?
 
6:16 PM
This one is faster!
 
dpq
6:38 PM
Hello. I've got a couple of questions on gevent/greenlets, is there anyone here who could explain to me some things about context locals? For instance, do I understand it correctly that all variables declared and used in my gevent.wsgi apps should be managed with local context manager? If yes, what happens if I don't?
I've read at least three different articles/tutorials on this topic, but still feel ignorant and unsure about my understanding.
 
6:55 PM
;_; all that just to parse the timestamps
 
so glad that model exists now
 
@davidism might need a prod with some flask stuff I'm doing... just setting something up and I've reached the point where I'm just missing something obvious...
 
ok, I'll be in and out for the rest of the day, what's up?
@corvid you better read all that and understand the pain I've saved you
 
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from mercury.customer.views import bp as customer_bp

app = Flask(__name__)
db = SQLAlchemy()
db.init_app(db)
app.register_blueprint(customer_bp, url_prefix='/customer')
 
Alas, your skill with regular expression greatly outmatches mine, @davidism, but that PR looks great
 
6:59 PM
But of course, in mercury.customer.views when I do from mercury import db it says can't import name
I'm doing something really, really stupid
 
it's the same with the application factory I use in sopython
 
just very tired at the moment :(
 
you need to import the views after the app/db is defined
so put from mercury.customer.views... after db = ...
@Ffisegydd Thanks, I needed that.
 
@davidism I knew it was something f*ing stupid ... thanks
feel more stupid than normal now
 
7:04 PM
There's a paragraph buried somewhere in the docs that says "yeah, this isn't actually a circular import". Bottom of this page: flask.pocoo.org/docs/0.10/patterns/packages
 
yeah... I'd just forgotten about it :(
need more coffee/some sleep or something
 
I think the worst part of this transcript mess is that you can see that each message has a full timestamp by hovering over the recent dates on the right
They just don't output it for the actual transcript
 
7:19 PM
@davidism I'll have a look in a bit... just up against deadlines at the moment sighs
 
7:31 PM
I just came across the sopython kaggle team ... could I join ...?
 
Yes afaik
 
How to?
 
phonegap is pretty annoying sometimes
 
7:46 PM
@rvraghav93 You can, though we're a bit inactive at the moment as everyone is busy.
 
How do I join. I am new to kaggle. Do I have to send a request of any kind or something?
 
@rvraghav93 as I said, we're inactive at the moment.
 
oh... okay :)
 
8:04 PM
hi everybody :)
question: how can I quickly check if
is_top_sorted(['C','B','A','E', 'D'], [('A','D'),('A','E'),('B','D'), ('B','E')] )
is topological sorted or not?
 
@MarkF6 this looks very much related to the assignment you've spent 3/4 days asking for help with... have you got any idea at all?
cbg @wim
 
I've run out of Supernatural to watch. My life is empty now.
 
My life's been empty since the last season of Game of Thrones ended.
 
@JonClements I've got already an algorithm which sorts topologically, but I'm not sure if it's ok.
If you want, you can have a look at it.
But for simply check if something is already top-sorted or not, is there no easier way?
 
8:20 PM
do you have to use the linux bootloader, or can you have the computer boot into windows by default?
 
@davidism +
 
@corvid you have to use a bootloader, but you can make the default selection the windows item
 
@corvid why cant you edit the GRUB_DEFAULT to point to windows ?
 
sounds good I'll go with that... where is grub file? /etc/ somewhere?
 
/etc/default/grub
set the GRUB_TIMEOUT to something around 5 seconds ... just incase you need linux ...
ah cwap... forgot to remove the space before punctuation again :|
Is majorclust implemented in scikit learn? Or is it not so relevant to reside in sklearn?
 
8:36 PM
wb @vaultah - you're up late? :)
 
Yeah, but 11:30pm isn't very late :P
Hmm, I'm not sure if the use of "late" was correct here
 
Is there a simpler way to do this min(np.where(V_GS > V_th)[0]) ?
V_GS is 1d
 
9:05 PM
@vaultah it was correct
 
@davidism thanks :)
 
01:00 - 14:0014:00 - 22:00

« first day (1499 days earlier)      last day (3449 days later) »