« first day (1849 days earlier)      last day (3323 days later) » 

user559633
00:00
@AaronHall You've been here long enough to know that you should include the exact error you're getting and an MVCE :/
Yeah, that's gonna be complicated.
I would just avoid using __main__, make an entry point with setup.py instead
user559633
@davidism Ah, so is the relationship/backref thing just meant for ease of use when manipulating the tables as they're there in the database?
ok, let me give it the old college try, it could take me a few minutes to set up.
user559633
If this is something that's covered in an official tutorial, please tell me and I'll stop burning your Saturday night
user559633
00:02
@AaronHall github.com/aaronchall/HTML5.py/blob/master/html5/__main__.py seeing as there's not even an import here, at least "i tried running BLAH and got GoFlyAKiteException + stacktrace" would be helpful
@tristan the relationship lets you describe some sort of join (it will autodetect simple joins across foreign keys) and represent it as a collection
user559633
@davidism Oh, that makes sense. Thank you.
ok, so I have the package dir in my current working directory, then in each of them I'm doing from nameofmodule import names
user559633
are you talking about code that's not in the repo currently?
I think it's like that in the repo too
user559633
00:09
looked at document.py, no imports. you're making it pretty annoying to offer help
Apparently the robust code I linked to didn't produce the correct value, so I had to reopen and add my brittle method as an answer. =\
right, document.py has the base classes
user559633
also, from .name_of_module import blah is relative and would work
user559633
otherwise, base it off of the parent. from myproject.module import blah
You'd think - I get issues with it though - I'll try to explain exactly what gives me issues
user559633
00:12
are you calling from some base point or are you getting errors when calling the module to run directly? i.e. is this just a python -m path.to.thing issue
~/html5$ python html5
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/excelsiora/html5/html5/__main__.py", line 2, in <module>
    from __init__ import *
  File "html5/__init__.py", line 2, in <module>
    from forms import *
  File "html5/forms.py", line 7, in <module>
    from .document import Elem, ElemContainer, _init_names
maybe there's a python -m path.to.thing that I'm not clear on
because I'm trying to approach it each way, so I've tried to do that too.
but python html5 works when I'm doing from module import names
and I want to make sure that works
user559633
Oh, I see what's going on.
but when I do this:
~/html5$ python -m html5
/usr/bin/python: No module named document; 'html5' is a package and cannot be directly executed
user559633
Haha, __init__.py not being aware that it's part of a class is a real blast.
user559633
Yeah. If you put document into a module folder document/__init__.py, it would work
user559633
00:24
what's going on is that main calls init in the same dir, wherein init is the initializer for the main, and init didn't finish, so it can't/doesn't know about the samedir
user559633
it's like the child asking the father how to make his way in the world and the father going "wait i don't have any children"
user559633
it might work if you do from .document import *, but I wouldn't bet the barn on it
.document breaks python html5
user559633
with a similarly hilarious error, i presume
user559633
does it work if you put it in module dirs? it won't affect loading time really as i think it does an EAFP and not a LBYL
00:29
yeah, that's the first stacktrace above
Here's some real weirdness:
~/html5$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
>>> import html5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "html5/__init__.py", line 2, in <module>
    from forms import *
  File "html5/forms.py", line 7, in <module>
    from document import Elem, ElemContainer, _init_names
ImportError: No module named document
but the relative import will work here
user559633
I wish there was a "social network" to discuss things using serious/adult works that came with anonymity, but where you could build a reputation. I'm nostalgic for the old internet.
user559633
@AaronHall Did you try the module folders suggestion?
ok, that's more complexity than I wanted
but I can
user559633
Folders are more complexity than you wanted?
user559633
an os stat that has no affect on the speed because it's not LBYL?
00:39
I'm trying to keep it like the stdlib
user559633
the stdlib uses folders :)
user559633
you could always just change syspath if, for whatever reason, this is important to you
This needs to be upvoted with every upvote you can muster: Python as an excel scripting language - to be built into excel itself
user559633
not to be a pretentious dick (too late, i suppose), the project name is HTML, so once you go down that route, who cares?!
user559633
it's like people talking about javascript elegance
00:41
@tristan or PERL readability
maybe I need to go that way anyways, but do you have a reference on this that I've missed?
user559633
@inspectorG4dget Hey, totally unrelated to you posting on an excel forum, but I wanted to let you know that I hope all is well with you and that I sincerely have been wishing the best with things that have been happening in your world.
user559633
I know that well wishing and prayers are useless, but saying it all the same.
user559633
@AaronHall On Python import pathing between 2.x and 3.x?
oh, crap, I've run out of time, gotta go in a sec
seriously was hoping to read something on that being the solution
user559633
00:46
you could it in a file and take the 30 seconds to verify
paralysis by analysis, baby
ok
user559633
i guess the official docs
user559633
idk, i'm a little more direct with you because you're not a newbie and have proven yourself to be smart/capable
user559633
the text for the reason it works is in the official module documentation, but i think that most of it just comes from stack whispering
user559633
actually, that would be a good talk topic
user559633
00:51
walking through the import system in python
@tristan Thank you so much. That really means so much to me. The last year and a half or so have been pretty rough, and even though we don't hang out over beers (or anything IRL), it really means a lot to me that there are others that include me in their community, and wish me well
user559633
there's some pretty good stuff in the python cookbook, but i'd have to spend a few hours to figure out how it works from C
user559633
@inspectorG4dget It's literally the least I could do.
you might be surprised how few actually do :)
anyway, I have to run now. Rbrb, all!
user559633
take care :)
00:54
rbrb, sir!
user559633
heya @holdenweb
ok
it's no panacea
user559633
The put it into a folder?
yeah, doesn't do anything for it, that I can figure
user559633
In that it doesn't fix it?
00:55
right
user559633
I'm just confused because usually a statement like "it's no panacea" would suggest that there was some fix
Yeah, I should have just said "no fix"
user559633
If you really need 2/3x compat without choosing paths based on versions, I assume you would have to at least allow the __init__.py per module dir to fire to register a path in the dir
I'll figure it out later, gotta get some food now. so I need to monkey around with the sys.path or pythonpath or something like that?
user559633
nah, i typically take the scumbag approach and just do different imports based on python version or just always call back from some known init'd module
00:59
I'm inclined to catch an import error and try it differently each way
user559633
use easyos. the maintainer is a total idiot, but it will at least save the time of the try/except bubbling
user559633
forgot you were trying to keep stdlib
I want this to be includable in the stdlib too.
May not get it, but you never know
user559633
sorry, i'll stop saying things so you can go grab food
01:01
at this point I'm just waiting on my food director
I'm following him to Chinatown for some cheap dumplings
user559633
...your hands?
10 for $3
user559633
i know the place
user559633
giving you the name one second
He says they're cheaper frozen.
user559633
01:03
oh...google maps gave it in chinese. a block away from what used to be chinatown arcade on mosco street
gotta go now! Cheers! Thx for the sounding board!
user559633
take care!
Ummm... dumplings
In a nice beef stew...
drools
Oh yeah? Well, I'm about to eat two hot dog sandwiches!
Not real dog though!!!!?
01:11
Chicken.
The whole meal costs literally $1.
user559633
01:25
I hate that late hour "been programming/working on something too long" in which you realize you've spent the past couple hours doing nothing of value
One gets used to it :p
user559633
"oh i know, i'll have a beer and that will snap me out of this"
user559633
woops
user559633
alright, calling it quits. have a good night pups, gentlemen
Night, sir.
01:32
ok, about to try to dumplings, Lam Zhou
 
1 hour later…
 
1 hour later…
03:56
ok, I think @tristan was on to something with the directories and using relative imports. I don't think top level modules can do relative imports, because that leaves the package.
pandas pushes python code further down in the packages
 
2 hours later…
05:53
kbg
06:51
Cabbage
heya pups
Heya Nuppy :-)
Its raining here :(
Nothing wrong with rain now and again
But this is raining season and it always rains
I cannot even go out :'(
UK will get a lot of rain, right?
07:07
It has its fair share - yeah :p
We should be getting rain tomorrow! \o/
I hope it rains a lot.
cel
cel
can we reject this edit please? stackoverflow.com/questions/33591063/…
Umm... not a great suggested edit :)
cel
cel
But to be fair, I have seen much worse getting approved :)
That's true... grumbles bad reviewers grumbles
cel
cel
07:15
well, to me it seems like SO is not very interested in fixing that
I cannot believe that making reviews more reliable is such a difficult problem that you should not try to approach it :(
I don't think it's fair to say there isn't an interest in doing so - just more an uncertainty about how :)
cel
cel
but there are so many good suggestions on meta
and so little feedback that it almost seems that people are not interested in giving helpful suggestions anymore
Which implies there's obviously no clear cut way of doing it...
cel
cel
There's never a clear cut way :)
I bet there are many ways that lead to improvement. Searching for the very best is often not a good strategy
Well - the CM/Dev team are probably working on it in some way or t'other :)
cel
cel
07:25
Probably. But to me it seems that they are overthinking it. There are so many low hanging fruit that have a huge potential of improving the site. E.g. I do not understand why this suggestion has not been implemented yet: http://meta.stackoverflow.com/questions/289871/practice-queues-for-review-training

It's a very simple but probably very effective idea.
 
2 hours later…
09:06
@cel SE is very slow with site improvements. Probably lack of manpower. Possibly they also take their time considering the implications of changes.
cbg @Peter :)
heya @JonClements ;)
How's Colty doing?
09:26
well, he is sleeping peacefully atm -- how 'bout that puppy over there?
user559633
Oh the future, where coffee machines sometimes beep at you and display the text "ERR"
@JonClements toi!
does @tristan then yell at it: "I CAN'T FIX YOU UNTIL YOU GIVE ME COFFEE!"
@PeterVaro same old as usual :p
user559633
@AaronHall oh that's way better than the place i had in mind -- now that i got a few hours of sleep, i remember that the place i was thinking of is 5/$1. might not be a thing now that chinatown arcade is gone
user559633
09:34
@JonClements no, it just beeped really loudly. too loudly for 430am.
user559633
this is why people drink tea. machines loudly refusing to dump hot water over ground up, dried beans.
user559633
anyway, this has been tristan's coffee story, I hope you enjoyed it
Ummmm You have selected the following items to be dispatched on disc.
errr no... but you seem to not offer the FTP option - ummm.....
cabbage everybody
user559633
Hi Xavier
09:41
hi @tristan
heya @Xavier
hey @JonClements
user559633
I realized last night that it was Grace Hopper who said "It's easier to ask forgiveness than it is to get permission." I always thought it was Ayn Rand.
user559633
Ayn Rand has a similar statement, but less polite: "The question isn't who is going to let me; it's who is going to stop me.”
10:01
I kinda like that one :)
user559633
I like both -- I just now realize that I've taught people that the former was said by the latter in the context of what EAFP means and Python
aww well - they're close enough ;)
user559633
10:32
Just found out that when my cat disappears in the middle of the night, she's just in the kitchen playing with the door stopping spring
user559633
Oooh, I have one for him too!
user559633
cbg cereal all
user559633
greetings
SO is pretty terrible today :[
cbg
13:43
hey vaultah
user559633
cbg vaultah
15:52
@PeterVaro so nice
@tristan nice too
user5428937
16:09
Im at pycon canada 2015 woooooooooohooooo!!!
cel
cel
16:22
~~~\o/~~
17:36
cbg PM
17:58
Morning, Jon.
How goes your Monday so far?
Oh, ok. I scored well on an itertools question a little while ago. :) But now I'm trying to figure out if I've got a off-by-one error in this simple Euler integration code: stackoverflow.com/a/33597140/4014959 . I'm pretty sure, it's logically correct. But it gives better answers if I change the loop to while x <= x1 :)
18:17
anyone savy with bs4 ?
Some regulars are, but the rooms pretty empty ATM.
@thermite just trying asking - if anyone's around they'll answer :)
long story short. making a WoW webscraper. while finding item info I can't for the life of me find how it identifies an item as "war forged". I stumbled across some js near the bottom of the page that appears to handle some item detail management. I'm trying to find out if it's possible to execute js against html cast to a bsObj and get the end results
the js at the bottom is a call to an external script on the server
Well... reverse engineer the JS to get a suitable endpoint and post request, or automate a browser using selenium then fetch the DOM from the browser after it has populated the DOM via Js
Not one that can be explained via chat I'm afraid
Or look up actual apis. As I'm pretty sure they exist.
That way you don't have to get into the grey area of Web scrapppppping.
18:28
lol that does surprise me @Jon Clements
Word up @Ffisegydd :p
yea I was thinking of using the API when I first started, but figured scraping would be more of a challenge and force me to learn useful python skills. but I might have to go that route. trying to get in tough with a wowhead dev atm as well to see how they pull the item info in their character profile page, probably API
Scraping when there's an API is a waste of time on your part, a waste of resources both client and server wise, and will break if layout changes... avoid it where possible
good point
18:32
lol well there goes 1800 lines of code down the drain xD
appreciate it though, I'll have to give it a read though
Hi .. I was reading the sqlite docs here docs.python.org/2/library/sqlite3.html .. whats the difference between executing an insert statement and commit ing to database. doesn't an insert statement either executes successfully and saves the record? why need an explicit commit() ?
18:49
thermite: I would add that using web scraping will learn you less than using api
@argentum47 are you aware of TRANSACTIONS in SQL?
yes, like in raw sql .. begin transaction blablaba
@XavierCombelle why is that ?
@thermite because knowing using api is a very useful knowledge. Web scraping is far less usefull and more brittle. Relying on brittle solution is a very bad habit.
@argentum47 yeah... so depending how SQLite is setup - your insert is part of a transaction - so until you commit it, it's still rollback'able
18:53
ow.. i see..
@XavierCombelle Thanks, that's a good point
@XavierCombelle but search engines scrape web pages github.com/duckduckgo/zeroclickinfo-longtail/blob/master/share/…
although line 84 maybe wrong, coz there is not id with that id in the whole page
@argentum47 the search engines don't usually merely scrape webpages, they parse them and extract valuable information by AI techniques (ddg use programmer programing scraper as their AI techniques however)
cbg
In DRF, I'm trying to "get all things that were created by the current user"
this seems to be harder than I thought
19:10
cbg gents, ladies and bots.
...and puppies? :p
@SomeKittens ?
hoi @SomeKittens need some help with streaming if you are free
@argentum47 Depends - if it's in Python, I'm incompetent
nope node
@JonClements I'm still very "Hello world" in my Django understanding
19:16
@JonClements How silly of me! Of course! :)
class UserNotesViewSet(viewsets.ModelViewSet):
    serializer_class = NoteSerializer

    def get_queryset(self):
        """
        This view should return a list of all the notes
        the current user has created
        """
        user = self.request.user
        return Note.objects.filter(author=user)
^ Does that create a URL I can hit?
if not, how do I?
(it's in views.py)
@argentum47 can do
Wow... errrr... difficult given just that
You do know for instance that the notes for a given user (if you did a FK) are available on the user model as note_set ?
class Note(models.Model):
    # Agnostic Notes encompassing Faculty and Student notes with many content types
    author = models.ForeignKey(User)
    title = models.CharField(max_length=256)
    body = models.TextField()
    content_type = models.ForeignKey(ContentType)
    object_id = models.PositiveIntegerField()
    content_object = generic.GenericForeignKey('content_type', 'object_id')

    def __unicode__(self):
        return self.title
Yeah... so it's easier to use User.objects.filter(name='Jon').note_set.all() instead
@JonClements and where would that go? In UserNotesViewSet?
19:20
Oh hang on... is User the django.contrib.auth one?
no clue
@SomeKittens I have no idea what you're doing without seeing your entire code :p
funzies
cbg @MattDMo
@SomeKittens at first I was doing this, but I didn' t realize that the file was 40mbs, so I did gist.github.com/argentum47/00fb80cec04d040b5394 ( which I am not sure is the right thing, specially the part where I wanted to write the result of request Async to file .. and after 2 hours of downloading I got gist.github.com/argentum47/3fdcedb8f9f38b7c5005#file-stacktrace
what did I do wrong
19:24
@SomeKittens anyway - where are you importing User from ?
@JonClements from django.contrib.auth.models import User, Group
Ahhh...
so it is that then...
sorry, I'm clueless
@argentum47 will you be around in a few hours?
And where's this serializer stuff coming from - are you using a rest-framework plugin or...
(and why serializer - why not class methods on the models... etc.... what do you intend to do with over-riding the queryset etc...)
DRF count?
19:26
What is DRF?
ahh... django rest-framework ?
cbg @Jon, how goes it?
@MattDMo same old - your good self?
@JonClements yup
that + Angular frontend (which is what I'm working on)
@SomeKittens yeah, and if I fall asleep, I can ping you at slack
@argentum47 thanks, currently contracting, so I'd love to help but not when I'm on someone else's time
19:27
not too bad - lovely Sunday afternoon, hanging out with the family, watching the Patriots (American football)
ok cool
lmao. see even though I'm now going to use the Blizzard API, I still have to utilize webscraping to handle the API calls xD
@thermite ?
so the API itself makes calls like: us.api.battle.net/wow/character/garrosh/…
19:31
Ah, homestarrunner. Brings back good memories :)
so I still have to make a bunch of requests, then parse the data out of it. before I was just pulling the entire profile page.
@thermite yeah... so you get a JSON response
not quite sure what issue you have that I'm not seeing...
I have json response off atm. at least this way will have way less data coming back that I don't need. but it ends up being a lot more requests, so i'm not sure which way will be slower. I'll just go API, it's less likely to break over time
what do you mean "json response off atm"?
and what do you mean by being a lot of requests?
orginally I would make one request for the entire page. if I use the API i need to make a request for each set of data I want. ie: a request for items, a request for raid info, etc etc
19:44
Errr...
well, you just comma delimit the fields
So instead of fields=items - do fields=items,pets then you get a single request and response with the additional info...
Hi, can anyone tell me what does macro TO_STRING(arg) = (%_ToString(arg)); mean? ( code.google.com/p/chromium/codesearch#chromium/src/v8/src/js/… ) I understand that it's a macro but I don't know what the percent sign is for.
@MartinVseticka that doesn't look like Python code.
This is the Python room, please only ask Python questions here.
@Ffisegydd I see. Thank you
that's odd. Why would they name that file .py?
Actually, is it Cython?
I may have completely shot you down by mistake :(
19:59
no, it's not Cython...
It seems to be off topic here :)
@MartinVseticka if it does turn out to be Python, or some strange version of Python, then come back :P
But it does look strange.
It's in a directory called js too.
So I initially thought it was something to do with Javascript.
It might be some sort of DSL for V8 itself.
user559633
Thanks for the gif
There is a comment at the top of the file "Dictionary that is passed as defines for js2c.py"
20:04
here is js2c.py, which actually is Python
yeah just found it on git
user559633
Is this the right room to solicit postgres help ( haha kidding but serious)
but why would that file be named macros.py (?)
user559633
yeah, name it marcos.py and another in a different directory polos.py
That took me much longer to get than it should have.
user559633
20:06
comments may be any number of things, including aspirational and/or incorrect
I got it
user559633
moving to trash because i'm tired, irritable, and v.v. bitchy
@tristan I've used postgres 2 years ago. I can give it a shot.
/me hands @tristan a coffee
20:08
cbg
niiiice room owner
user559633
@idjaw it's all good. i was mostly just complaining out loud. i'm at the point in which i'm doing automation to create developer setups for my startup -- on postgres confs based on env
user559633
@SomeKittens cheers, actually at a coffee shop so that i don't just switch to tf2
@tristan sorry :)
20:09
@tristan I am the postgres resource
user559633
@SomeKittens heh if you're referring to me, i think i'm generally regarded as a dumb jerk
but about to watch a film with wifey
@AnttiHaapala which one?
@tristan you're a room mod, so that was obvious
@XavierCombelle how do the AI know what is what?
haha empire strikes back
user559633
@SomeKittens there are several room owners in here right now
malevolent typist for life, typoes 4 words a minute
user559633
@SomeKittens hah why would i kick you? you've done nothing wrong
@AnttiHaapala I'm behind, we're on Revenge of the Sith
@tristan and I'm one for the JS room
we're all dumb jerks
user559633
20:11
ugh sorry for the double ping
@SomeKittens ewww now that was horrible when seen the 5th time ...
@argentum47 usually with a large enough dataset (it's called bigdata)
(at least to the users who think their special snowflake status entitles them to bypass Da Rules™)
@AnttiHaapala She's never seen it, should be viewed at least once. We're watching 'em all (aside from 1) in prep for 7
@tristan anw if you ask in 1 minute you will have an answer
same here
user559633
also, if my timing is weird or i stop responding, it's because the coffee shop wifi killed itself to prevent more dubstep from being torrented on it
20:12
@XavierCombelle ok, will have to read about that
@tristan Why torrent dubstep? Torrent something else and fork the data stream into Audacity, same result.
haha
I wish I was faster, I am so far behind
user559633
@SomeKittens cat /dev/urandom | /dev/audio
@SomeKittens but anw, the only good thing about the prequels is that they make one appreciate the mr Plinkett reviews more
20:15
^^ is that the 70 minute review ones?
user559633
@AnttiHaapala mr plinkett reviews are so good
user559633
ugh, okay, this wifi is unusable. have a good day all
tether! :)
Drag an ethernet cable from your home to the coffee shop.
20:18
@tristan you should move to finland
21:20
@MattDMo wow what a disaster that question is!
21:32
Below code is random , nothing related to my script , i was unable to start this thread without adding any code , thats why i added that
user559633
21:44
@AnttiHaapala okay. on my way. please make sure it's warm when i get there

« first day (1849 days earlier)      last day (3323 days later) »