« first day (1377 days earlier)      last day (3586 days later) » 

8:00 PM
just a shell context?
 
It sets up Click to use the create_app factory, and overrides the shell command to use ipython if available.
I wrote it to experiment with Flask-0.11-dev.
 
what is the click, is mainly what I am wondering. Maybe that's a dumb question
 
setup.py establishes a console script to sopy.manage.cli.main()
click is the command line tool written by Armin. It replaces flask-script.
 
user559633
@classmethod
@abc.abstractmethod
def thing():

oh god what's the point
 
ooookay, I see. I still use flask-script
 
8:13 PM
Hey everyone, what's the best way to get around a MemoryError?
 
don't use memory!
 
get more memory
 
Get more memory then don't use it!
 
I hate you, @Crow.
 
If it's caused by excessive recursion, you can rewrite the function so it doesn't use recursion.
 
user559633
8:14 PM
catch the exception and pass
 
Or, if you're lazy, you can increase the maximum recursion depth.
 
use more memory you haven't got
 
@Kevin What about in a for loop?
 
user559633
subprocess and kill random PIDs until memory is freed up
 
Or, wait, is that a RuntimeError... I always forget
 
8:15 PM
recursion is RuntimeError
 
I'm trying to go into the 10000th layer - forception.
 
Ok, disregard previous messages.
 
do everything in CPU cache
 
Please guys, no proper coder talk.
 
Use your HDD as RAM instead, it's bigger.
 
8:16 PM
I don't think I've ever gotten a MemoryError.
 
@Ffisegydd isn't there a specific Exception for stack overflow?
 
Never mind guys, but thanks for such great suggestions as don't use memory!
xD
 
>>> def f(): f()
>>>
>>> f()
RuntimeError: maximum recursion depth exceeded
 
@Kevin Ew, PEP 8 violations! xD
 
Yam PEP 8.
 
8:17 PM
Whats the matter, you no like single letter names?
 
I am fully PEP8 compliant
 
@Crow as in you personally? Your body? Your soul?
 
@Kevin Nope, multiple statements on one line.
 
Fine, only one statement then.
>>> (lambda f: lambda x: f(f)(x))(lambda s: lambda a: s(s)(a))(1)
RuntimeError: maximum recursion depth exceeded
 
Dude...bring out the big guns...bring out...the fizzbuzz...
 
8:22 PM
something about python just makes people want to write everything on one line.
 
Snakes. One line looks like a snake.
 
@Kevin Yeah, cause that's Clearly more efficient than:
def f():
    f()
;)
 
I do love reposting this:
Jan 7 at 21:06, by Kevin
Today's experiment: Fizzbuzz in 56,909 bytes
 
My god.
I forgot how FizzBuzz was even played.
 
My favourite part is the end: x)))))))))))))))))))
 
8:25 PM
)
#come on
)))
#compile, damn you
))))))
#arrrrrrghhhh
)))))))))
#ok, there we go
 
so, can I make pull requests into sopython-site if I so desired?
 
@Kevin Ahahaha xD
 
@Crow yes if it adds value to the site, what did you have in mind?
You can always see trello.com/b/FjtaOzjH/sopython-site for what we've got planned
 
sorry - met up with my bro for a bit
 
@Ffisegydd well right now I'm just a bit confused as to sopython-site/sopy /config/defaults.py
I kinda think it would be cool to make an argument based configuration preference, no?
 
8:27 PM
Here's hoping it was a nice reunion
 
@Kevin it was - ty... complicated things going on - won't discuss them here :)
 
@Crow what do you mean an argument based configuration? The framework seems to be working fine so for now I think we're looking to add features
 
good, good
 
class DefaultConfig(object):
  # ... stuff goes here

class DevelopmentConfig(DefaultConfig):
  DEBUG = True

class TestingConfig(DefaultConfig):
  TESTING = True

configurations = {
  'testing': TestingConfig,
  'default': DefaultConfig,
  'dev': DevelopmentConfig
}
 
Eventually it may be necessary to work on the back end some more
 
8:29 PM
Gotta go, see you guys later
 
DSM
Rhubarb!
 
I have plans for config, and those are not it
 
then in the create_app you can add an argument for config, and do config.from_object on that variable, and start it up with python manage.py -c dev or whatever
 
Rhubarb @Kevin!
 
DSM
OCR tools in one window; Java serialization in another; and Languages of Ghana in a third. Thursdays are strange.
 
8:30 PM
I already do config.from_object on defaults and then on the local settings. Putting them in classes just complicates things.
 
It's annoying that you can't have generators inside a class.
 
yes you can?
 
I believe not.
Let me try it.
 
DSM
Why wouldn't you be able to?
 
@davidism I might just be being stupid here... was trying to find config.py
 
8:32 PM
config.py goes in the instance folder, it is the local settings
 
Huh, never mind. I think once I tried and it raised an error for me.
 
it's not there by default, you have to create app.instance_path
 
@Crow we haven't got docs ready for it yet which is why some things might not make sense
But eventually the plan is to have them
 
sorry I'm a bit lost... sorry for the stupid questions
 
No problem dude
 
8:36 PM
has anyone else have focusing problems today?
 
ext/sqlalchemy.py just kinda blows my mind, no idea there
@PeterVaro I do every day!
 
I mean, it doesn't matter how hard I try, I just can't get my daily task done
 
user559633
what's a word in english that means "may be local or remote"
 
@Crow ;)
 
user559633
i.e. "here or there"
 
8:37 PM
It's understandable, as none of the Flask tutorials I've seen are geared towards making a large application.
 
@tristan "somewhere" ?
 
I kinda like this git repository as an example of large application structures
 
sopy.ext.sqlalchemy is a bunch of fixes for Flask-SQLAlchemy that I've had to write over the years.
 
user559633
:/ it's being used on a decorator where the context of the invocation will dictate if it's being run on a local machine or on a remote machine
 
- Wkipedia, on Fizz Buzz
> A common version of the game in Israel is called "7 Boom". The players replace every number divisible by 7 or containing the digit 7 with "boom".
This feels like racism.
I'm not sure in which order that came out, but it was mean to be racism comment, then quote, then source.
 
user559633
8:41 PM
@locational it is
 
Who's @locational? xD
It's been a while since I've used a good ol' if/else/elif chain.
    if i % 3 == 0:
        yield "Fizz"
    elif i % 5 == 0:
        yield "Buzz"
    elif i % 3 == 0 and i % 5 == 0:
        yield "Fizz Buzz"
    else:
        yield i
 
Change the order so you catch i % 15 first
 
DSM
@Iplodman: when will your third line be executed?
(Line -> branch.)
 
@Ffisegydd right, are we done with the old server now? Everything everyone needs is moved over?
 
@DSM What do you mean?
 
8:44 PM
@Jon yes.
@Iplodman you'll never reach the third branch as i%3 == 0 will always be True for i % 3 == 0 and i % 5 == 0
 
user559633
@Iplodman if the input is i % 3 or i % 5, it won't reach the AND case
 
user559633
what fizzygood said
 
@Ffisegydd okay, it's powered off and being snap shot
 
Also note that i % 3 == 0 and i % 5 == 0 can be re-written as i % 15 == 0
 
I'm confused. Let me try some stuff and I'll get back to you.
 
8:47 PM
@Jon awesome :)
 
Is it just me being sad, or does that fizzbuzz thing remind me of cribbage
 
DSM
Cribbage is the game that our grandparents played, right?
 
I haven't played cribbage in years.
 
I still play it, that and bridge anyway
 
I get what you mean now :P
Thanks for the heads up.
 
user559633
8:48 PM
haha @Ffisegydd not sure why i never put that together before (the 15)
 
@Ffisegydd Yeah, but then I'd have to have a method to work out the lower number so I can times it, which I don't really want to do.
(My numbers can change)
 
stackoverflow.com/questions/24943617/… was there a dupl target for this?
 
bur your modulus's never do... just re-order... write them down on paper if you have to....
 
print('\n'.join('Fizz'*(not i%3) + 'Buzz'*(not i%5) or str(i) for i in range(1, 101)))
 
@AnttiHaapala yup... either one of Martijn's or mine's
(guessing probably Martjins)
we never recorded it though
 
oh hang on... who did the double escape wiki entry ?
 
Been there for a while
 
@ZeroPiraeus did
 
6
Q: Why do backslashes appear twice?

Zero PiraeusWhen I create a string containing backslashes, they get duplicated: >>> my_string = "why\does\it\happen?" >>> my_string 'why\\does\\it\\happen?' Why?

vtc :P
 
Jon hammered dat.
 
8:58 PM
joncle mjölnirred
 
user559633
argh. imports.

    >dir
    __init__.py
    main.py
      >utils
        __init__.py
        file_utils.py
      >net
        __init__.py
        calling_script.py
 
user559633
i thought it was fine to call file_utils from net/calling_script
 
user559633
i don't get why i'm getting a valueerror
 
user559633
everything here is a package, so wtf
 
How are you importing them?
 
user559633
9:08 PM
from ..lib.file_utils import _some_func via calling_script.py
 
2 or 3? I think it changes.
 
user559633
calling_script.py is __main__ there fwiw
 
user559633
2. oooh i could just from future
 
user559633
:( i thought there was a __future__ for this
 
from __future__ import absolute_import?
 
user559633
9:13 PM
still complaining.
 
Yam knows then. And it's too hot so I'm going to go climb into the freezer and go to sleep.
rbrb all.
 
user559633
haha, enjoy.
 
user559633
i know why it's complaining, but it just fills me with a deep sadness
 
@Ffisegydd sounds like a good idea :)
 
Rhubarb all! :D
 
9:34 PM
youtu.be/MqMlfNgBmKU?t=11m11s was this there yet?
 
9:51 PM
are migrations generally gitignored?
New in version 1.0., Latest version: 0.10... what?
 
@Crow ?!?!?!
 
flask.readthedocs.org/en/latest/cli , this page says 1.0, but flask.pocoo.org says 0.10.1
 
10:34 PM
im getting a segfault in the python program - how can I find which thing causes this? (for example, a stack trace or module name)
 
@CBenni operating system?
 
run python under debugger to get more info
@Crow nope really
 
Debian 7 x86
@AnttiHaapala
 
python 2 or 3?
 
10:36 PM
2.7.6, I updated
 
can be installed to python 2 I guess
 
thing is, I have trys and catches around pretty much everything (since its an app that should not have downtimes), but it isnt caught... I really dont know where the problem could be
 
@CBenni apt-get install python-faulthandler
then in the beginning of your app
import faulthandler
faulthandler.enable()
 
Thank you @AnttiHaapala ill try that
 
worked?
 
10:47 PM
ok, so it gives me a bunch of stacktraces (one for each thread) @AnttiHaapala
what do I do to find out which thread it was >_> i really dont have a clue what the issue might be - I dont use any C libraries directly.
 
the most plausible culprit...
 
The most likely thing is that the python sqlite3 binding is the reason
 
you can copy it to some pastebin or so... if not sensitive
and link here
 
it isnt, but its ugly
 
10:52 PM
i might just rewrite it from groud up, I copied it together from an old project
is there any way to generate a seg fault via python directly?
 
yes, bugs do exist
so just paste it :D
 
say, by simultaneously accessing the same variable from multiple threads or sth
 
again, ugly. soooo ugly.
 
i mean the stacktrace
 
Current thread 0x00007f042cd20700:
File "slashbot.py", line 109 in run
 
File "/usr/lib/python2.7/socket.py", line 224 in meth
I think python IRClib is on drugs
 
sqlite 3 module bugging
 
oh ffs.
 
i'd say
 
10:58 PM
sooo what do I do? use pgsql instead? lol
 
:D
why not :P
 
i could try reinstalling sqlite3
via pip
well because moving database systems is a pain in the butt
 
nopey, it ought to be builtin in python
 
oh.
well. im basically out of options then?
 
dunno
i'd still confirm it crashes there,
 
10:59 PM
interestingly enough: the code was pasted from another program, which works just fine.
 
put print >> sys.stderr, "foo"
 
i removed alot of lines of code, added a few
 
and "bar"
around that line
 
uhm
how do you mean?
print >> sys.stderr, "foo"
if(req.hasdata):
req.res = r.fetchall()
print >> sys.stderr, "bar"
like that?
 
something like taht ...
but inside the if
 
11:03 PM
it never outputs a "foo" without a matching "bar"
 
hmm :D
even if crash
 
it might be the socket module
 
yeah I need to go to sleep now sry :d
 
ah np
thanks for your help
 
11:19 PM
morning
 

« first day (1377 days earlier)      last day (3586 days later) »