« first day (1691 days earlier)      last day (3482 days later) » 
00:00 - 14:0014:00 - 00:00

00:01
how can know the scope of values contain the ModelForm?

i mean, i have a model Invoice and a ModelForm overriding the __init__ can i update the value of field invoice, right?

but how can know in which key of self object is saved?
i test it in modelform
 def __init__(self, *args, **kwargs):
        super(InvoiceForm, self).__init__(*args, **kwargs)
        for i in self:
            print("from init", i)
from init <input id="id_invoice" maxlength="15" name="invoice" type="text" />
from init <input id="id_title_addenda" maxlength="80" name="title_addenda" type="text" />
from init <input id="id_detail_addenda" maxlength="350" name="detail_addenda" type="text" />
from init <input id="id_date" name="date" type="text" />
from init <input id="id_total" name="total" step="any" type="number" />
ok i see i need use self.fields['invoice'] = 'some'
 
2 hours later…
01:51
Another question, how can i access to function foo into the invoice class, into the modelform?
02:07
i moved the function foo to my modelform class but i want to learn, the way to use functions inside of class Foo(model.Models): where can i found resources about it?.
 
1 hour later…
03:24
Anyone on?
stackoverflow.com/questions/30610257/… dupe of Martijn's secret document
 
2 hours later…
05:10
@thefourtheye generally the newer the ES feature is in v8 the slower it is
Hey all
I have a pycuda program that I would like to time
the time that I receive varies, so I would like to average it
but I don't want to store a list of all previous times
is there a method that calculates a running average?
05:32
cbg..
@BenjaminGruenbaum. Hmmm. Anyway, I changed to Map ad two guys were in favour of it
05:50
Benchmark it
06:15
I'm trying to parse a 250 mb xml file. So I used xml.etree.ElementTree tool.

import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')
root = tree.getroot()
print(root)
After running the above code, my system got hanged.
It return back to normal once i closed the program via task manager.
Donno what to do.. Pls give some suggestions..
There shouldn't really be any 250Mb XML files ... looks like you might have to adopt a SAX-based approach
But the sax documentation is not clear as much as xml.etree
06:33
It isn't. When I used SAX it took me a long time to determine what the hell was supposed to happen, and sadly I forgot that long ago
The point is, though, that you can trigger events at specific points in the XML rather than having to build an in-memory representation of the whole XML DOM
yep, it's just like read a particular element and do all the operations and then move on to the next element.
06:55
cbg
Hey up
sudo someone make me a cup of tea :)
I think puppy usually drink milk only..
I'm a special puppy :)
arhghgh.... bed so warm and comfy... don't wanna get out and go down stairs...
07:01
cbg
yo yo bobbyg - sudo make puppy a cup of tea? :p
Cabbage!
makes puppy some tea
awwww ty!
puts salt in the tea instead of sugar
is a butt-orifice
Hey guys,
Im a py-noob, but I have to migrate a python script from one server to another... May you help me with finding a lib to install on my new server?
The problem is this line:
java -jar xxxx
07:07
:23661860 That edit good enough?
Which unix package I have to install for running that line?
/home/app/scripts/flugvakanzen_v2/import.sh: line 18: java: command not found
this is what I get now
@Kovu ...Java?
Did you read the error message?
yeah I need the java compiler
Did you read where it said "java: command not found"? :/
but in fact there are around 100 packages to install java on unix
Then type into Google "Unix install java."
use oracle-jdk
I CAN'T MAKE YOU WORK
yeah, you are as helpfull as a tree, thx
@Kovu Hey. You came here and asked a ridiculously easy question.
Why don't you actually do some research of your own first?
Rather than us hand-hold you?
We're not automatons. We're not here to do your bidding.
07:09
@Ffisegydd Trees are super-helpful, so I'm quite confused
Im a windows developer with a task i dont want to do, I never did in a language I never spoke and never willing to speak...
but thx
That's not our problem?
@Kovu and now that's @Ffisegydd's fault?
07:23
@BenjaminGruenbaum Do we have a standard benchmark?
Cbg :)
07:30
anyone here have some experience with PyQt4?
The moment I saw Rowan, my mind completed it with Atkinson :D
the one and only Mr.Bean :P
not with rowan wood?
I have only watched the movies. I think they have mentioned the name in the books only.
What about Rowan Aboat?
07:46
@thefourtheye I wish the answer to that would be "yes" :P Honestly I'm not sure.
There are benchmarks for integration, but for your specific case you'd have to benchmark it.
Oh I have never done that before. Do you have any reference which I can look at?
@AvinashRaj Belated birthday wishes da :-)
Cabbage!
Cabbage!
08:03
cbg!
cbg!
@thefourtheye there are benchmarks in the project, you can look at those
Cool, I ll start looking at them. Thanks :-)
@JonClements I do not know python very well. I'll read about it. Anyway, question is the question and I will willingly read answers. Perhaps there is some interesting workaround to my problem. — NO_NAME 9 mins ago
head desk
I'm leaving that one alone
Saw that. You poor puppy. You tried your best there.
08:25
Into work today to find someone has reconfigured my office space and moved all of my stuff - some of it to who knows where? Unhappy.
What? That's ridiculous
Good. I'm glad it's not just me being unreasonable
Admittedly I am not the most tidy, but I do keep it confined to my area and don't reorganise others :(
When we left school we broke into a teachers office and managed to use a string to pull the desk against the back of the door while it was closed, then undid the string.
Apparently that's the penalty for going to a conference for a couple of days
So it looked like it had happened magically in the closed room.
08:30
Ah, now that Fizzy, that is just genius
Those kind of reorganisations I heartily approve of
Not in the same league, but I once orchestrated a class to move their desk back about a cm or so each time the teacher faced the board. Supply teacher. By the end of the lesson, well, you can imagine
But there is no ingenuity here. If they'd stuck all the furniture to the wall or something, I'd be all for that. But just to randomly remove a subset of my tools and a plant. Bah, humbug
</vent>
@Ffisegydd that's awesome
08:42
@JRichard could be it's just part of a bigger plan.
That's how I'd play it. Take random stuff to annoy you and throw you off, before the real prank begins.
Hahaha... haven't heard this ages: youtube.com/watch?v=9EcjWd-O4jI - pump up the jam!!!
The quality of music videos then hey... laughs
08:59
@Ffisegydd I await the full unleashing with bated breath (if only my colleagues were that inventive...)
@thefourtheye thanks...
09:15
@JonClements I commented, as did Robert, I see
Well - that's a fairly to the point comment :)
And boom goes the dynamite.
Well - they seem to be happy with packages so... anyway - left that one alone... strikes me as an "interesting" person :)
09:36
omfg... I've come across some interesting code
import module.py
so make it work - they've created /module/py cries
Hahaha
I think he has a list of tuples
Not what the code is for, but I think that's what he actually has
@JonClements :)
.. Does he just want to swap tuple[0] with tuple[1]?
09:47
Does he realise he's concat'ing strings?
I'm pretty sure he doesn't realize that
Well I have pointed that out - but they haven't clarified
@JonClements I was going for "pithy"
10:17
@JRichardSnape dude: '\g<2>\g<1>'? :p
What's wrong with r'\2\1' ?
Not good?
I don't know actually - I've just always used the \g as denoting group. Is it deprecated?
I feel like I might be making a noob error here...
Nope it's needed if you've got a sub that's a digit following an actual \1 that shouldn't be part of the replacement number
eg: '\g<1>0 is group one followed by 0 - while '\10 will be group 10
OK. So unnecessary, then. Gotcha
it works - just not needed
stylistically, though, you reckon I should change it. I do recall reading a discussion about it many moons ago and thinking - one's a superset of the other in terms of where it works, I'll use that. Probably my Java heritage peeping through (why write a little when you can write a lot ;P)
(many moons!!! - probably only a few months actually)
10:22
LOL
Up to you
Could go with: new_data = sorted((re.match(r'(.*?)(\d+)$', el).groups() for el in data), key=lambda L: int(L[1]), reverse=True)
then join... the tuples
yeah - that's better altogether. I suspect the OP has actually got commas between the strings anyway and a list that is related only by order - i.e. not tuples, concatenated strings or anything.
but we're well into the realm of psychic debugging and @kevin's not around to apply his algorithm yet :)
Who knows - they don't seem to be clarifying one way or t'other
Yeah and when I ran that thing through KevinScript's list sort it returned [0]
@Robert ahhh.... bobby bobby bobby... that's because KevinScript responds only to its "master" :P
woo hoo - aha take on me - interesting/old-school random playlist today!
Love that video
Not that I understand it at all
10:35
Which video?
This sooooooooooooo calls for queueing up Final Countdown :)
[0]
it's going to be my shorthand for "sorted" from now on
s[0]rt
Wait, that's longer
And wow... cranberries now
I love The Cranberries
One of my favourite tracks: youtube.com/…
Zombie or nutin
10:39
Dreams was my first ever paid for download track
(thought I got it from MSN Music!!! :()
11:12
cbg @Zero
cbg :-)
11:33
re-cabbage everyone
re-cbg
Wow... this woman has a versatile voice range: youtube.com/watch?v=Oy9iiaFuxj0
@JRichardSnape well... that one mostly ended in carnage by the looks of it :)
Yeah. Padraic looked pretty keen to cover all angles and I thought I would duck out gracefully. Carnage is the word. I thought violent agreement between two people who knew about how strings sort and why that's a bad way to do it wasn't adding a lot ;P
:)
@Martijn darn it - beat me to the dupe by 3 seconds :p
@JonClements :-P
Gotta be faster!
I'll just drug your yamazaki and it'll be fine :p
11:45
now you're a ninja puppy, the sensei's gonna be less forgiving ;)
not sure he was forgiving in the first place to be honest :p
That woman in the youtube video is pretty amazing. Don't know what will.i.am's doing though
@JonClements :)
...heads back to nina simone...
awww... good old nina
Not one of the great albums - but it's got a couple of good tracks: youtube.com/…
in py3, is there any diff between class A(metaclass=M_A): pass & class A(object): __metaclass__=M_A?
Apparently - one can get a job defining the Future of the Internet
:P
11:53
You don't use __metaclass__ in 3.x ?
morning everyone
@corvid Did you mean Cabbage?
cabbages are not a time of the day
yes it is
NOTTINGHAM! Woop woop.
11:55
cbg @Kevin
@corvid Cabbages are everything
Morning
@JonClements gotcha! python was not throwing any error though.
Cabbages have existed before the ginnungagap and will persist after ragnarök.
cabbage to the crow. and Kevin.
@RobertGrant Are you in it?
11:58
@ChillarAnand __metaclass__ is ignored in py 3.x (eg: it no longer has special meaning)
> userId = Meteor.user();
> Roles.userIsInRole(userId, 'admin', groupId)
true
> Roles.getGroupsForUser
function (userId, role)
> Roles.getGroupsForUser(userId, 'admin')
[]
does that seem a little bit weird to anyone else?
The hell is wrong with Open Office? Whenever I write "+44XXXXXXXX" it removes the +.
You're not a damn math program, you're a word editor, don't remove my damn characters!
Put a ' in front like Excel - force it to be a text value
Oh wait - or are you in Writer?
Never noticed that...
Okay - doesn't do it for me in writer
12:02
I bet there's a setting that toggles that behavior
@JRichardSnape I was, for about 10 years
Probably something hopelessly vague like "smart formatting"
@Ffisegydd hey, you got a problem with an open source project? Fork it and make your own version!
It's telling that two of the top three google results for "libreoffice autocorrect" are "Turning off autocorrect" and "How to turn off auto-correct absolutely, wholly, and permanently".
Mind you - there's LibreOffice and OpenOffice
12:04
Incidentally, BracesPython is looking for developers
I wish a dozen papercuts on each person that replies to a "how do I disable <some annoying feature>?" thread with "you don't really need to disable it, it's not a big deal"
A dozen papercuts aren't really a big deal
@Robert don't sound like you're volunteering!
I didn't specify what body part would receive the papercuts.
@Ffisegydd it was bought out by Oracle
12:09
@Kevin I prefer hair. That would save me a visit to salon.
Last time I got 12 paper cuts - look what happened to my leg :(
It's still an Apache product though?
lunch... rbrb
Libre office is better imo
Bah can't put my title as "Dr" as I've not graduated yet D:
12:10
Know your role, graduand
you can still put in "Crown Empress of the Cat Empire"
Wait - that's not a protected title? Crap.
or member of the Dark Council
How will I get a legit source of Royal Whiskers now?
You must be anointed by the mightiest of the cats
12:16
Is that a pic of your new cat @corvid?
Alas, it is not. New cat looks similar though
Uh oh, math.log(1000, 10) returns 2.9999999999999996. This is bad news for all the programs I've ever written that use log to determine how many digits a number has.
Oh hey, math.log10 is a thing that exists. I'll use that in the future.
@thefourtheye stackoverflow.com/questions/6319207/are-lists-thread-safe contradicts your response a bit :) I believe lists themselves are threadsafe and the GIL protects against data corruption in this way (in most situations). — James Mills 2 mins ago
Hmmm, can we really assume that lists are thread safe? What if GIL is not in the picture?
Depends on the implementation, I guess. Do you have a specific flavor of non-GIL Python in mind?
12:30
Wow that cat is amazing
Maine Coon. Must get one.
HEy guys,
I have a simple script with "for line in sys.stdin.readlines():" at the start and I call it with "cat austan_all | python fix_broken_austan_chars.py"
MUST GET A CAT
but nothing happens... it worked before on another server but after I moved in on the new server it stops working without any reason
Now I want a cat again too even though I can't :( Thanks a lot, @RobertGrant
12:42
Small flat and pets are not allowed :/
I know, I could move out but ugh
I miss having a furry companion is all I'm saying I guess
CATS! I think I am on the path to crazy cat lady. Please help
@RobertGrant maine coons are really great, they have a very intelligent, friendly, and gentle disposition. They're like the Golden Retrievers of cats
@wonderb0lt ah :(
@corvid maybe you could marry a crazy cat lady :)
This guy is asking the same question again, sort of
Incidentally I'm annoyed when people call SO a "forum"
Yes :)
Early rbrb
Doubly annoyed when they get the isomorphism wrong and refer to posts as "forums" rather than "threads"
12:48
or marry a cat, but I think there's laws against that...
is annoyed by misspellings of "fora"
13:04
I'm back fora bit
The pluralization rules of dead languages have no power over me.
If they don't like it, they can stop spinning in their graves and do something about it.
There are probably latin forums where they discuss such things ;)
To them I say: fight me in real life.
Ah, pass me an amphora, I'm off to the forum to watch Kevin engage in verbal combat. Show us yer spolia opima
any web dev pros on? Not sure if I am thinking of this incorrectly...
13:11
I suppose any language where the plural of "Us" is "I" can't be taken too seriously ...
I wonder why github freezes for a full minute whenever I open it for the first time each day.
user559633
your browser is probably reticulating splines
I get that reference.
Hmm, I can't figure out why math.log(1000,10) gives a different result from math.log10(1000), when they appear to invoke the same function with the same arguments (except for funcname, which is never used)
Mildly different, right. Not crazy different?
13:25
Because they don't?
2.9999999999999996 and 3.0 respectively
@ZeroPiraeus I was looking at github.com/python-git/python/blob/master/Modules/…, which has a similar function name.
Ah, I got it now.
Yea, the first is doing 2 logs and dividing.
I was mistaken when I said they have the same arguments. math_log10 passes in m_log10 as the func argument to loghelper, and regular log passes in m_log.
Darn these crazy eyes of mine.
Cabbage
^ Me while reading other people's code
13:31
Im pretty sure thats the face I make when I get out of office :D
this is me while doing the same thing
:-)
@Peter your hair has grown somewhat :)
Ok, so math_log10 calls loghelper which calls m_log10 which calls log10, which... Isn't actually defined in this file(?). Wild goose chase.
It's not a built-in C function, is it...?
13:36
@Kevin it's not 100% complete.. but you can still search int it.. raw.githubusercontent.com/petervaro/cutils/master/cref.h
@Kevin Yep.
float
log10f(float x);
double
log10(double x);
long double
log10l(long double x);
Umm... is using ((a, _),) = Counter(something).most_common(1) evil as opposed to a = Counter(something)[0][0] ?
Me reading our subcontractor's code
13:39
@Kevin log10 and log are C builtins
From $randomEasternEuropeanCountry
Let's just say from the Soviet Union, makes it easier :D
I just typed ((a, _),) = without thinking about it... but that's not going to grok easily if someone else picks the code up me thinks
So if I want to know why log10 is more accurate than log, I have to read the source of the C compiler that CPython uses? I don't think I can incept that deeply...
@JonClements You need to be good in Python to understand it I guess. Which is not a good sign :D
@Kevin It makes sense it would be more accurate though. When you call log(1000,10) you're performing log(1000) / log(10). When you call log10(1000), you're just calling one function.
13:42
@Kevin Ah yam. Ditto
Wow - emotional time in The Commons
Apparently the speaker relaxed the rules so MPs could address the public gallery or something
@IntrepidBrit If it's any consolation, 1+int(log(x,10)) is accurate for every integer below a million, with the single exception of 1000. So any single instance of digit counting has only a one in a million chance of failing.
@JonClements the heck?
So some MPs have addressed Kennedy's son who's in the gallery
not sure that's really on to be honest - he's only 10... but...
@Kevin ... that's probably the first time that saying has been uttered accurately.
@JonClements I'll have to take a mooch at the videos later
13:47
Sounds like one of the Labour MPs were in tears when they spoke
Anyone know if it's possible to search only a subdirectory of a github project? I'm looking for log10 inside gcc-mirror/gcc/libgcc, but searching from that page gives me a bunch of irrelevant results from gcc-mirror/gcc/lib<something other than gcc>
I guess I could manually sift through the 14 pages of results, but I super don't want to.
is it in libgcc?
That seems like the most likely place it would be, since log10 is a C function and gcc is a thing that makes C programs.
libgcc is not a c library
(clearly said - not) :D
13:57
Maybe you can infer the implementation from the x86 instruction set? The only log-calculating instruction I see is log2(x) FYL2X. But log2(10) and log2(e) are both builtins as well.
So log probably just divides by one constant, log10 divides by the other.
Oddly, log2 isn't a C builtin.
@Kevin Qualify the search with path:<subdirectory path>
00:00 - 14:0014:00 - 00:00

« first day (1691 days earlier)      last day (3482 days later) »