« first day (2140 days earlier)      last day (3033 days later) » 

00:53
So, I'm finally trying to learn flask. The hardest part so far has been discovering that I need to do SET PYTHONPATH=.
@MorganThrapp you shouldn't need to do that
@davidism I'm following the official flask tutorial, and without it flask initdb didn't work.
It kept not being able to find my module.
Oh yeah, the instructions are still wrong. The dev docs were fixed.
You need FLASK_APP=app/__init__.py, or you need to install your package in dev mode then FLASK_APP=app
Ahhhh, that would make sense.
I had FLASK_APP=app, but I didn't know about installing in dev mode.
Pointing at __init__ is a weird workaround, and I don't think the docs mention dev mode. I really want to get around to improving the app detector.
01:02
Yeah, I never would've guessed that.
Anyone know why the profile avatar changes on its own?
Bug with Gravatar.
gravatar is some sort of feature on SO?
17
Q: Why is my profile image different?

LaurelWhen I first signed up on a Stack Exchange site and got a profile image, it was this one (see my current user card): Later, I got Area 51 and SEDE profiles, and my user image there was a different identicon. Because reasons I already know. I would have a picture of it, but that's the problem....

Thanks
01:20
morning guys
quick check. what is -m flag in python -m
@davidism alright. thanks
evening cbg
hey idjaw
Hey, idjaw.
DSM
DSM
01:37
Home from gym early cabbage for all.
I was supposed to run tonight, but my co-workers got me to go out for beers
so now I'm on my couch eating cookies
....
DSM
DSM
#cardiolife, #carblife, same diff
they both start with car. true
DSM
DSM
So I actually had a Python question today which I couldn't figure out in the fifteen minutes I had available.. so I will ask it here!
oooh fun
01:43
Well I'm intrigued.
DSM
DSM
(bloody mcve this is why I don't ask questions mutter mutter)
I'm dealing with testing some fragile legacy code which
is costly to modify. I'm writing some interceptor code
to serve as a temporary data access layer so that people
without access to [expensive proprietary data service]
can still run and test the code.
As part of this task, I need to wrap (as in decorate) a bunch
of functions with arbitrary positional arguments and keyword
arguments. I want to close over a bunch of other variables,
but I can't use the usual default argument trick to handle the
late binding because it's Python 2 and I can't do `f(*args,
_secret='name', **kwargs)` or anything. What's the cleanest
way to get the following code to print 10, 20 insead of 20, 20?
02:11
Oh man. I'm not sure there is a clean way. :/
DSM
DSM
I might have to make a full class, I guess.
Yeah, I was going to suggest something like bpaste.net/show/1e44c8b130d2
I mean, that's obviously hyper tailored to that example, but you get the drift.
(sorry, busy with something at home =/)
DSM
DSM
That's allowed. :-)
I've done similar to provide each instance of a class with a sequential ID without having to be aware of the other instances. I just passed in an IDStore object that incremented a class variable each time you called get_next_id.
DSM
DSM
02:17
Yeah, I tend to put an itertools.count() instance at class level and then call next on it. Same idea.
Yeah, that works.
DSM
DSM
Class it is, I guess -- so frustrating because it works exactly the way I want it to in 3.5. :-/
Or, wait, what about just doing ideone.com/AgHShv
That way you don't need a class at all.
DSM
DSM
That's not really binding the way I need it to, though. If you swap the order of calling f and g at the end you'll still see 10, 20, whereas I'd need it to be 20, 10.
Although, wait.. it's ugly, but if I only decorate the function once, maybe I can store the bound information in a function attribute..
Something like this.
Oh, gotcha.
Yeah, that might work. It's definitely less crazy than doing a full class.
DSM
DSM
02:31
In fact, if I store the attribute on wrapped instead of on fn, I think I can even decorate the same function repeatedly and have it work. It feels a little weird to stash things there after creation, but that's the only place it'll work.. if I do it inside the function I'll have the same binding problem I started with.
Maybe this is the way to go.
That seems like the best way so far.
Anyway, I gotta get some sleep. Night rbrb, all!
DSM
DSM
rhubarb!
 
1 hour later…
03:59
morning
 
1 hour later…
user559633
05:13
morning
06:38
cbg
07:06
hello guys
user559633
o/
user559633
vodka and javascript. i think i'm starting to appreciate javascript. once you learn its quirks, it's surprisingly "fine"
that's vodka speaking
user559633
that's a recent addition.
07:11
ECMA 6.1?
user559633
I don't know how to check the minor revision, but I am using ES6, yes.
user559633
If I stop responding, that means my internet has cut out again.
@tristan I meant the vodka language feature
Yeah I was using some ECMA 6 stuff yesterday and it was actually quite pleasant.
user559633
@khajvah Oh, Stolinacha version 40. Back in the states.
user559633
07:15
Yeah, I have this fear that I'll go to ship to actual production and find out my application only works for 80% of my users, but I'm banking on that 80% being the portion that would spend money anyway. I'm not entirely sure how to check feature support and at this point, I'm a little scared to look.
are you doing server side in JS?
I also find that the more I learn, the better JS becomes. A lot of time in the past I've been basically scripting and hacking around in it, without using any more advanced features.
For example, only yesterday I learned about ...a
user559633
@khajvah I'm not -- Python and C++
user559633
Oh yeah, spread syntax is a bit cool.
user559633
I was using arrow functions like every problem was an apple atop a head, before running into a few nested scope cases where I still needed to do that=this, and I've reverted to 2007-style JS since then.
07:18
I don't use a lot of the features enough, like proper Hash Maps as opposed to objects.
Yeah the scope issues of can be annoying, especially sometimes in Angular when you want to bind something to this for your controller but you're in a function.
user559633
^ Yeah, exactly. My cases were in filter/maps wherein I still needed an arbitrary function from a function closure*


* i don't know if JS actually has closures and if so, what versions
I do like closures, use them a lot in my middleware apps. Throwing functions around like they're snowballs.
user559633
I do have a strong opinion that ES6 should have been breaking bugfixes though.
You mean breaking changes?
a la 2 vs 3
user559633
let feels like what var should actually be, and reducing this down to something plain to explain to others would have been game changing
07:23
is there a graph traversal feature in numpy?
user559633
@Ffisegydd I do, yeah. Unintentionally inflammatory to say "breaking bugfixes", probably
user559633
Ugh, what do you think this is, a Python room?
@khajvah numpy isn't really for graphs.
user559633
I'm hovering at 200MB free on my laptop and every time my laptop swaps, I wince a little
@tristan this is similar to other languages. It just refers to the current object.
07:25
I see, I will write my own algorithm then
I've been working with Scala a lot, really enjoying it. The functional programming ideas have actually bled into other programming, and I'm now writing "bad JS" which is actually better code :P
@khajvah there are other libraries that provide graph traversal algorithms. I've used igraph in the past IIRC
user559633
@thefourtheye this can also be global state, the innards of your current object, the inner state of an anonymous function, and some other fun stuff
user559633
standard disclaimer: i'm not very smart and it's entirely possible other people don't have a problem dancing between maps/filters/bindings/nested functions
idk, my use case is a bit weird(not classic shortest path problem). I need to get every path of specified length between 2 specified points
@tristan Oh, I see what you mean. If they change the semantics of this refer only the current object, that will break the internet over-night
07:28
That's probably possible in igraph.
It's not just "shortest path" in there
user559633
@Ffisegydd I can see that. Before life blew up on me in early July, I was spending 10 hours a week in scheme and it was making me evaluate some of the ways I approached common problems.
thanks I will check it out
user559633
@thefourtheye Yeah, where ES6 only happens by nature of a couple transpilers, it would be cool to chip away at some of the "eww js" bits
Try typeof null. Even this was refused to be fixed, because of the "migration tax".
user559633
Yeah. I love the fake primitives.
07:32
@khajvah actually you can use numpy if you want to use an adjacency matrix.
user559633
Not sure how JS will ever dig its way out of "well, so livejournal sites in 2003 used this, so we can't ever update"
It'll get you the number of paths only though
@tristan it'll probably end up being transpilers.
user559633
I think the time is now, is my thesis.
Yup, transpilers and Polyfills ftw
You don't have a thesis.
I should learn typescript.
user559633
07:34
Google/Facebook/Twitter run the web and there's no actual internet-for-the-people, so just do it.
@Ffisegydd yeah I need the actual paths.
user559633
I had a thesis at one point and it was okay! Not great, but serviceable!
If you have to write it yourself, breadth-first search until you start going above your N.
user559633
I want to get to a point that I'm doing sales for TristanCorp and I smile knowingly when a recent engineering hire rightfully trash talks a section of the codebase I wrote.
I am thinking about DFS but adding dynamic programming like logic
user559633
07:37
What kind of paths do you have that you can DP it?
to not traverse already visited nodes, as the graph is really heavily connected
user559633
Ah, never mind :)
Dem supernodes.
user559633
I started doing a variance on corpora and found out I could save huge amounts of CPU time using one weird trick (dynamic programming)
the worst thing is that this has to work real time.
07:38
If I am not wrong, if a problem to be solved with DP it should have few properties
user559633
@khajvah that's awesome
i.e. users will be able to request that data
user559633
what are you doing?
it's some economics/finance application. Constructing supply chain paths between companies/industries
and then making calculations
Dat pre-computation.
07:47
cbg
user559633
cbg antti
user559633
i don't know why, but i really want to go back to iceland and japan this summer
Would love to visit Iceland too.
user559633
(In my experience) The people are really nice and welcoming, the nightlife is fun, the nature is memorable, and it's an interesting alternative to nordic europe
user6568562
07:54
Good morning, everybody [ :
user559633
Like an 80bpm sweden, wherein the people are taller somehow, and the nature is either lush with waterfalls in view, or martian tundra
user559633
cbg and good morning :)
user559633
haha, it's 1am for him
is there a way to late-bind stuff to wtforms somehow
@tristan so :?
user559633
08:05
lol, i'll page him
Just write to MM about it, and he'll scoff at such a rudimentary use case as "forms"
aawful
MM? :P
I may have misremembered his initials
Michael Mereererererererererik? I think that's it.
The "has_key" fixer in 2to3 produces wrong code on the following example:

input:"a.has_key(b)and x"
output:"b in aand x"
user559633
08:08
asker doesn't state what his/her views looks like.
lol :D:D:D:D:D:D:D
user559633
if the choices are from a db query, why not bind then in the proc?
@tristan because of wtforms
user559633
wat? that can't be right
user559633
i question the premise.
08:10
that is why I pinged davidism :D
he can't possibly have it ping him when he is sleeping any longer after those episodes with the Indians :D
user559633
that doesn't sound right. flask has a context. wtforms is separate
user559633
maybe i'm way off base. i haven't really written python since june-ish
wtforms is "separate" yes, but it is definitely flask-connected in that, well, it isn't the form library used by pyramid core devs, and it ain't for Django either...
user559633
idk. 48 rep makes me think "junk question premise"
it is 42k rep user asking
user559633
08:15
looks like 48 to me
I am 42k
user559633
on, you're considering yourself as the asker for some reason. weird.
I just asked a question above
user559633
godspeed davidism :)
becuase obviously on flask ,you won't have any such problems because "you have the request context"
user559633
08:17
hahaha okay
user559633
my last two hanger-ons of python are nltk and flask
user559633
i really like hacking out some python and it will make me sad to say "i love you, but bye" to python if those two remaining references disappear
so where are you going :?
ah,
user559633
golang, js, c++
08:20
lol
pyramid is just fine :D
C++ that can't be serious :D
@tristan don't forget the builtin python date libraries. No getting them anywhere else.
I've always wondered about Go. It's always seemed cool.
But then, also Scala.
Original Lisp from the 60s might be good
Cabbage!
user559633
tristancorp is (python + nltk + flask), (c + linux), (c++ + a bunch of things because c++ don't care), (js + es6 + react + redux + alcohol + please let this be my end I'm ready), (golang because its dumb + easy)
user559633
08:23
cbg poke
@RobertGrant modern Common Lisp is beautiful :)
We heard of isomorphic Javascript, and we thought, "What's the opposite of that?"
@FlorianMargaine soon as I see car and cdr I stop reading. Clojure has head and rest (or whatever) - much more comprehensible :)
user559633
golang is the language of 80-90% done. if you can get away without thinking too hard about what you need, e.g. reading an envvar and dumping out a file or doing an oauth2 prixy, golang is your jam
@RobertGrant Common Lisp has first and rest
user559633
golang is why i don't know lua for nginx plugins
08:26
@tristan that is nice. Doesn't Python already have that?
user559633
@RobertGrant python is relatively slow for simple things
As in dev-wise, or runtime-wise?
user559633
python is the jaguar of languages. heavy, full of features, expensive
(I haven't heard of anyone saying Go is good for that sort of thing, I'm curious)
@tristan computers are cheap, programmers expensive.
user559633
08:27
golang is the "close enough" of dev langs
user559633
@AnttiHaapala yes, but i'm trying to hold on to as much equity as possible and computers are expensive
:)
Although I think that wasn't for me
user559633
ugh wrong reponse click
Don't call me a click
though what really pisses me off is that everything in python allows for too much meta programming
user559633
08:29
keyboard battery is about to die :/
people still have wireless keyboards?
Clearly you splurged on "devices that need batteries for some reason" and scrimped on "batteries"
user559633
@FlorianMargaine apple wireless keyboard. it's great!
user559633
i'd share a photo as to why i chose an apple wifi keyboard, but my android phone decided to not send a photo
08:47
Did you know: If you mute a YouTube video in the player, the sound mixer in Windows will still display the sound peaks of the video. So it looks as if you would hear sound when in fact you don’t because the video player is muted.
This is super strange, how does this even work?
Maybe Flash just taps into...actually I don't know
Flash is weird.
user559633
browser hooks into the OS?
Sounds like some science to me.
user559633
youtube doesn't mean flash
It’s not Flash though
user6568562
08:48
@poke Yeah, never paid attention to it but I just mute a video and I still see the sound peaks
@tristan tru dat
user6568562
But as @tristan said, the browser has its fader in the mixer. Still doesn't work like I'd imagined it to do
I am doing prediction using 3 algorithms (logistic regression, adaboostclassifier, and randomforestclassifier) I want to make final predication by choosing a class which is predicted by more than one algorithm. what is the best way to do this?
user559633
that button then asks the OS to hand off volume control, OS does per proc volume management, the mixer doesn'tgive a shit
I would have expected the sound mixer to be based on the actual sounds that an application produced, but when muted, the browser wouldn’t produce a sound, so it’s odd that it’s still being reported properly
08:50
@utkarsh without knowing what libraries you're using, we can't help.
@Ffisegydd i am using sklearn
user6568562
Maybe sound is processed in the browser, and when you hit mute on Youtube, you actually hit mute on the browser. That would explain it, I believe
@poke yeah I guess as tristan says the video player doesn't actually transform the waveform as you play with the volume control, it hands that off to the OS
@utkarsh then google around for sklearn ensembles
user559633
my windows 10 sound interface experience has been "don't trust all" so i'm pretty sure things aren't logically deterministic
08:50
It just sends waveform and volume separately
user6568562
I'm on Win 7. What's curious is that the color of the sound peaks in the mixer stay green. I think it should've been grey
Just tested two players: In MPC, when you turn down the volume, the peak gets lower in the mixer. In WMP, when you move the volume slider, you actually move the slider in the mixer – which is pretty cool that this is actually a synched thing on Windows
@Ffisegydd it just gives me the list ensembling algorithms
user559633
i only use windows 10 for streaming and video games and i'm still deeply disappointed
So I guess different programs have different access to volume controls.
user559633
08:53
the OS exposes an API but allows overriding then
@utkarsh if you do more reading than 30 seconds, then you'll find your answer.
I've told you what you need to look for, good luck.
I guess for browsers, since there are multiple sound sources (different tabs, different things on each tab), it cannot modify the mixer slider directly
user559633
it will sometimes pick up my usb audio interface on reboot and honor my settings, sometimes not
user559633
windows is a garbage heap of go get fucked
user559633
i'm entirely unwilling to believe that in 2016, windows still is unable to control child procs
08:56
I’ll just assume that you are using it wrong.
user559633
default settings, no modifications to it, yeah, must be me
I have been trying from past 1 week to reduce the memory consumption for a python script. Can anyone please help me out.
I think my python script is taking too much memory but am not able to bring it down. I tried deleting the variables and gc.collect.
can anyone please point me in rigght direction.
Try not running the script
09:03
"I think my python script is taking too much memory"
I suspect that's your first task there. Find out definitively.
long time no see @Jerry!
o/ @JonClements ^^
been around, just not as active as I used to be ^^;
found a pokemon MMO and integrated the staff team
writing scripts etc for the game
That sounds like "our Jerry" :p All is well I hope?
and lots of work as well I guess
yup :)
all is well for you, @JonClements? :)
Oh - the normal SSDD - but yes, fine thank you :)
09:09
I have broken down the memory usage in the script. loading the libraries take around 70MB and then DTW takes around 300MB and then for each run. But then each url hit takes upto 300MB and parallely if I run the script the time goes upto 50 seconds which otherwise is just 2 sec.
Can't I make any application or something on server which will run all the time and I just pass the input and it will return the output. In that case, those 300MB will not be consumed eveytime.
@driftking9987 it sounds fascinating - but how do you expect anyone here to have an educated guess at what's going on without being able to see your code?
You can do pretty much anything, yeah
I have a SO question and I posted here last time. Nobody replied and then I got downvotes. :(
-1
Q: Python script taking too much time and memory to execute

driftking9987I have a python script which uses quite a few libraries. import time import cgitb cgitb.enable() import numpy as np import MySQLdb as mysql import cv2 import sys import rpy2.robjects as robj import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate() from rpy2.robjects.packages import import...

That is the risk you take
Well, if I would guess, then the question is probably as vague as you explain your problem here.
09:12
I think it's clear. If it's vague, I can narrow it down too.
Why not just use either R or Python
DTW is not available on python and then I fairly knew python so I used it. I dont know how to run the R on server.
@driftking9987 how are you running it?
cgi?
Why not just learn enough R to get it going, rather than trying this mess?
09:18
There seem to be no need at all to embed R here. It adds complexity. And could well be why memory grows - no idea how rpy2 releases memory, or not.
no. I have a php script(It's basically an api). So I call the php file and from there I execute the python script.
Honestly - I just googled Python Dynamic Time Warping and, guess what result 1 was...?
Ah - probably while Fizzy was whistling...
I was talking with davidism yesterday about how we should consider being more accommodating for people, about how we could be less terse with people - but sometimes they make it really, really hard.
09:20
I agree with both halves of that sentence.
@driftking9987 So, you are running php, that calls Python, that calls R…?
Anyway - @drift - I think you're getting too complex in your "stack". You really shouldn't need to wrap R in Python in PHP.
@driftking9987next thing: measure where the time is being spent.
yeah. But the memory consumption is only when I ran it in console. using python <filename.py>
and yes + 1 for that
09:22
If I ran it parallely for 10 times, the DTW takes up to 35-40 seconds
but for a single run, it completes in less than 2 second
Right. So the problem isn't that it's taking up too much memory, the actual problem is that you feel that the parallelised code is taking too long?
Have a look at Antti's message again - you need to measure where the time is being used.
You've put in diagnostics for memory - do similar for time.
and as for the memory consumption, this can bebecuase of fragmentation
@IntrepidBrit, yes. that's right. I cheched the memory consumption is console usingg df -ah, it shoots upto 90% consumed when I run it parallely
I have the timestamps with me too. I printed the time spent along with the memory consuption
First you need to decide whether you're worried about memory or time initially. They may be related, but very likely not.
09:27
Running away to the bakery for breakfast.
Got a 5 day weekend.
Then, you need to fix one. That will help to clear the currently clouded sky.
well, itme definitely is related
@driftking9987 how much data are you reading in?
@Ffisegydd Niiice.
09:28
your parallel runs are pushing the libraries and such out of cache.
Not working a full week for the next month and a half \o/
Profile your code to get a more accurate idea of where your code is living.
Either 3 or 4 day weeks until start of Oct, then a full week off on holiday in the Lakes.
This is bliss. Enjoy!
And somewhere in all that there is PyCon \o/
09:29
hmmm
so would you stay as a developer in a company of ME size already (70-80 employees) but you'd be the only programmer/architect/developer/senior/devops/admin/insertyourword here :D
... even if paid the same salary as in any other place ;)
Depends entirely on term and conditions. If they are good (hours not too long, good money etc.) I think it would be fine. If you end up being expected to work very long hours, definite no-no for me.
End up going mental without another dev.
Plus I bet you'd end up doing odd jobs that need fixing in random things.
"Oh can you just fix the website please..."
so could you imagine anyone enjoying that? :D
09:43
Masochist, or you.
I enjoy it ;)
I couldn't imagine spending my life tinkering with the same database system, doing the same stuff every day
@IntrepidBrit remember what this means that you're doing the same stuffs every day, in 5 different projects for 5 years.
@JRichardSnape what if good hours mean: standard hours but boss will call you at 9pm, on weekend, etc at the most awkward time.
@AnttiHaapala Ditch that.
user6568562
That means smothering schedule, even worse than bad hours
I am militant about this point.
09:55
@AnttiHaapala Less tempting
I tooks a 50+% pay cut to avoid such "conditions"
@IntrepidBrit and due to budget constraints, all 5 "projects" will take that 5 year to develop.
@JRichardSnape technically, you cannot work full hours here and take a 50 % pay cut :D
unless you become a junior
or somehow become less qualified.
Well, I am an engineer ;) But on the other hand - that probably also means you are not being paid enough for such "call me anytime" conditions.
I may not be the best adviser on this, I realise I am fairly extreme in my views on this.
wtf am I writing :d
I'm just assuming a Freudian slip and you associate "engineer" with "junior" ;p
09:59
well, I am an engineer
Ah, I thought you would identify as a computer scientist...

« first day (2140 days earlier)      last day (3033 days later) »