« first day (2278 days earlier)      last day (2895 days later) » 

00:00
oh. When you are done listening to that. I posted this earlier
It is fantastic
7 hours ago, by idjaw
oh. @PM2Ring You *have* to listen to this guitarist's skill. It's beautiful:
https://www.youtube.com/watch?v=qaI6p1Mc3wo
sad that's not a dent in the background
DSM
DSM
01:02
@WayneWerner: ah, I got distracted and forgot to follow up, but no, I meant that day is my relative's birthday, and was mildly surprised by the coincidence.
01:37
Hello guys...
Question: Somebody uses python (v3) in Windows? I've downloaded pip to install packages, but when I try to install a MySQL connector with pip I've got an error about Visual Basic. Some windows user is using a different method for installing packages on Windows? Or is pip the standard de-facto?
 
3 hours later…
04:43
Cabbage :-)
 
3 hours later…
07:33
Cabbage
cabbage("PM 2Ring")
@jhrs21 I don't use Windows myself, but I know that it can be painful installing some 3rd-party Python modules on Windows. That's because Windows doesn't provide a C compilation environment by default, which makes it difficult to build packages that contain C source code. The alternative is to use pre-compiled binaries. Fortunately there's a great collection of such binaries at Christoph Gohlke's site. There's a mysql_connector package under Misc.
cbg
goddamn Django, you piece of shit
This ORM is absolute disaster
I am passing a proper object to OnetoOne field and it complains that it expects an integer
07:50
cbg
I should get into Django
no, you shouldn't
Django is complicated. Anything complicated is bad
Pfft
You obviously don't know me
If I'm not suffering and feel like I'm the stupidest dev alive I'm not enjoying it.
(Because it's a true euphoria when I do get stuff to work)
Sep 15 '16 at 13:47, by Antti Haapala
"Django - reimplementing your favourite libraries/functionality (poorly) since 2006."
Oct 3 '16 at 13:57, by Antti Haapala
if you're not stuck with django, whose ORM is pathetic, you could use sqlalchemy which makes it easy to also query jsonb columns, so you get best of both worlds.
Django will magically work as long as your application is strictly CRUD
So like most frameworks then? ;P
07:57
not really
I was just kidding
Django doesn't give any flexibility
Well, I honestly just feel like I'm missing out if I don't know how to Use Django
One application for the shits and giggles should be fine
the only good thing is good documentation
and massive user base
@idjaw Very tasty. Here's Stanley with his trio, playing one of my favourite jazz compositions, on several guitars: Stolen Moments
08:02
One shouldn't underestimate a huge userbase. It's not the size that matters, but how you use the userbase, but it's still got potential to be good if it's huge.
Ask holdenweb about the Django community... chat.stackoverflow.com/transcript/6?m=32386734#32386734
Sounds like I should ask the DSF, I'm curious as to why it was bad for holdenweb to host it
facing problem in installing opencv
in ubuntu
Because he doesn't know why the DSF has a thorn in their side for him
@MoinuddinQuadri have you ever used open cv with python
08:25
kool
But I have installed it though :P
@Gemtastic Well yeah. holdenweb doesn't know why those sponsors didn't want him, but as you could imagine he wasn't very happy about that $90,000 cancellation fee.
haha ..
can you walk me through steps
Cabbage
i followed the tutorial but got lost
08:26
@PM2Ring I bet only the DSF was happy about that
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
or cmake-gui

set full path to OpenCV source code, e.g. /home/user/opencv
set full path to <cmake_build_dir>, e.g. /home/user/opencv/build
set optional parameters
run: “Configure”
run: “Generate”
this line made me lost
@Gemtastic I don't think it was fair of them to make holdenweb pay that fee. At the very least they should've paid part of it, if not all of it. But instead they left him holding the bag.
I do not remember the steps. But I just googled and in case of issue, re-googled and finally it worked.
I followed something like this: http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/
PS: I haven't downloaded the source-code
@BhargavRao cbg
were you lost or able to get through
08:29
@PM2Ring I don't think it was fair either
I don't know all the details, but if they didn't want him to quit they shouldn't have lifted that issue
And instead found another sponsor
It takes two to tango
@TheExorcist It is working for me. Also tried with few of the examples. I used OpenCV just to compare it's performance V/S TensorFlow
@MoinuddinQuadri then were you able to do it without source code
okk then i am also going to retrace your steps
Piece of advice. Before performing random installations, please create a virtual environment :P
Cabbage, all
Wondered why me ears were burning
Not something I think about much now, I am happy to say
yeah @MoinuddinQuadri thats a very nice suggestion ..
but due to venv there are
many problems
comming
/superfun/opencv$ cmake-gui
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numpy.distutils
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named 'numpy'
in fact numpy is installed
08:41
cbg
@TheExorcist Verify that the virtual environment is using the python version (pip) for which you installed numpy
09:03
haha now i am retracing your step .
becuase i am getting lost
in installing these things.
cbg guys
so following your tutorail
cbg
@holdenweb wow, that django code of conduct biz sounds a lot like the nodejs mess with crockford
09:24
Hi guys I have a bot which is supposed to send an image to a server there a opencvscript (with opencv) is supposed to process the image and return it back. What are my best options to implement such behaviour on server side? A webservice maybe or are there any other options?
depends on your bot framework I may say
you need background process for sure
Haha .. find it its bot or script .You can always use unix flavour for serverside operations
It is a Javascript bot for telegram using "telegraf"-api run on heroku
I c
botkit?
using node?
yes running on node
09:26
use the power of callback
you mean callbacks in js?
cabbage all
yes, maybe using websocket would be a good thing in this scenario
ok ty i will look into websockets
I wonder if I maybe should switch to a python bot-api. I might then be able to call opencv scripts directly on heroku, I guess
depends how big you are planning I would a distributed framework in the other end too, as I you expect more than one concurrent petition it would be necessary
Cabbage!
 
2 hours later…
11:39
cbg
12:03
re-cbg :tap, tap, tap: Is this thing on? ;)\
Cbg :)
12:15
Django guys here ?
@StackB00m if you have a question, ask
I have a terminal script of python, now i wanna give it a web view .
checked out Django last nyt
my confusion is where do i place the core logic of my script in the views.py files or place it as an other file and access it from the views ?
my script needs an argument which i wanna take from user as a post request via a form
As an example : you take something from a user as a post variable and have to perform lots of computation on it and deliver the results to the user again, where will the code for that computation go ? in a specific function of the views file or a seperate file and get results back , thats what i want to know
re-cbg
@StackB00m well, at first you can write it in the views.py, but in a separate function - later on when you decide that it wasn't the correct place you'd refactor.
not django-specific
but yeah, views.py is not the best place to put business-logic into.
is this the only way to return html - return HttpResposne("</>")
because i see that we are allowed to use this only once inside a function
Thanks @AnttiHaapala
you'd usually organize the html into a separate template
12:29
yes in the templaces folders
cbg
I re-read holdenweb's experience with the django peeps and now I'm pissed again
whats cbg ? hearing a lot these days in SO
you don't use them with HtmlResponse
@StackB00m if you read the room rules, you'll find the answer nearby
12:31
wow you're being unreasonably helpful:P
thanks mates
gotcha
yeah @AnttiHaapala is helpful
Melon
I am Green Bean to this
@AndrasDeak don't get uncomfortable on my account, please - it's all settled down nicely, and I'm even thinking of going to PyCon again this year
I'm very glad to hear that:)
12:48
@DSM the last time I participated in the Django community it was a discussion about increasing powers to discipline people for vaguer and vaguer reasons
Then I came here
maybe I can get WIPUF to be cool too
what is python useful for!
:)
everything
googling WIPUF... ... ... failed
@AnttiHaapala oh, that would have been a good one for last night :p
"Dynamic typing"? OMG call the internet police
or was that only strong typing?
I just can't remember my theoretical programming concepts
12:52
I have the easy way out, I never learned them!
well, clearly me neither:D
@AndrasDeak symbols are dynamically typed
@MoAli now that I have PyCharm in front of me (15 hours later...), this is what it does when I start its Python terminal: sys.path.extend(['project path'])
@AndrasDeak the 3rd google match for dynamic typing is sitepoint.com/typing-versus-dynamic-typing
@AnttiHaapala well I didn't search for it, just getting vague impressions from discussions here:P
what could go wrong?
12:57
how I understand / use dynamic / static typing as is that
> Static Typing and Dynamic Typing versus Strong Typing and Weak Typing

Static and dynamic typing, and strong and weak typing, are two totally different concepts, which, unfortunately, are very often confused. It is erroneous to say that a language that is static or dynamic typed cannot be strong or weak typed. Static and dynamic typing, and strong and weak typing, are different forms of classification of programming languages, and one of each class necessarily characterizes a given language. It is thus imperative to discuss strong and weak typing vis-a-vis static and dynamic typing.
the names/symbols are typed vs they are not typed
gotcha
@AndrasDeak the link is the shit :D that's why I pasted it.
@AndrasDeak well it's at least one step beyond copy/pasting from SO without any interaction
12:58
then I use strong / weak typing to mean whether the values are strongly or weakly typed.
hmm
OK, I think I see what you mean:)
python is both dynamically and strongly typed
java is statically and strongly typed
yeah I re-realized that by now, thanks
JS is weakly and dynamically typed?
c is statically typed but quite weakly
and js is weakly and dynamically typed
and php is just retarded.
@AnttiHaapala wait, why is c "quite weakly" typed? Because of type casting?
@AnttiHaapala ba-dumm TSSS :P
no, casting can't be it
13:00
the values do not really have types, you can reinterpret-cast them at will...
oh, is it casting then, after all
say, you have a pointer to struct FOO, you can cast it to a pointer to struct BAR under certain circumstances and use it thus -> np.
or you can alias an int as a char array...
13:20
@Antti sorry for hijacking your weather
Very pretty. The cold eye missed us by a few 100 km. Wheew.
we had -20 degrees at night, -15 midday here, few days ago
but I'm not complaining, I like cold:D
what's surprising is that it's been very dry, no precipitation whatsoever
Aww man I found a cool badminton clip and the only person that would appreciate it is MIA.
MIA as in ragequit and deleted?
or the singer?
13:31
I'd say partner in crime @AndrasDeak :P
misdemeanor or felony?
cbg
Writers of sopython. Can I contribute to your book?
@AnttiHaapala Also, Python 3 strings are static
no, static/dynamic refers to the symbols
u = 'abc'
u = b'abc'
the name doesn't have a type
I didn't get it. Btw, I was referring to Zed.
as I said, these are not set in stone, but they're how I see them
13:39
it was a joke :D
it is true that they're somewhat more strongly typed
or that... the rules are not as vague
I'll stick to "dynamic typing doesn't have declarations" as a rule of thumb
@poke can't understand how you missed "Monthy -> Monty"
@AndrasDeak it is not true either
@AnttiHaapala See my comments a bit further down
that fits in with my usual "I have approximate knowledge of many things" approach
13:43
see, one can use type inferencing with zero declarations...
like a = 5 -> ok a is now an integer.
a = 5
b = 'foo'
c = a + b -> compile-time error
but that's about strong/weak, not dynamic/static, right?
def fib():
    a, b = 0L, 1L       # The 'L's make the numbers double word length (typically 64 bits)
    while true:
        yield b
        a, b = b, a + b
this program in Python, and a, b are dynamically typed; in Boo they're statically typed :D
pfft:P
whaddup
spending the morning at the car garage
free coffee and wifi. Therefore, I am happy.
@idjaw you misspelled cabbage
13:53
@AndrasDeak Well you.....you........yeah
How much money do I need to donate to Mozilla before they implement pause/rewind/start_from_beginning commands in the context menu of animated gifs in firefox
Are we talking like $100 or more like $10,000,000
morning everyone
stackoverflow.com/questions/41570498/… I don't even know how to categorize this one. I went with cannot reproduce, because....no, please....no one answer it...please.
oh come on.....
I show up to the main site for the first time and this is what I see. flips table
<lebowski meme>
I left a comment because Moses should know better
14:00
@poke Ooh, nice, Thanks.
Unfortunately it has to re-parse the gif using JavaScript, but that’s better than nothing
Blame the web standards people for not wanting GIFs inside <video> tags :/
Doesn't quite solve my principal use case, which is "open twenty tabs while browsing imgur, wait N minutes for all of them to load on my slow connection, then view each one. But when I enter the tab, the gif is usually somewhere near the middle of its run" because having to redownload the gif defeats the purpose of opening the tabs in batches to begin with
Isn’t imgur all on “gifv” these days?
no, opening them in batches is still useful for logistics
... Unless the bookmarklet can re-download the gif much faster than the page did, thanks to the magic of caching
14:02
something like that I think @poke -> blog.imgur.com/2014/10/09/introducing-gifv
I mean at least it doesn't become entirely pointless
@poke Maybe? But I still don't see backward/pause/forward buttons regardless.
@idjaw I meant whether they switched all gifs to their “gifv” format
(I say “gifv” in quotes because they totally made it sound like they invented a new video or image format when it’s actually just normal webm… so they don’t do anything new or special)
@Kevin You’re on Firefox, right? Try right click, if you see a “show controls”, it’s a video.
I think there's something wrong with my browser at home because webms never loop for me, they always play exactly once and then stop. But from context it seems like they should be repeating.
I don't know if it is worth it for them to convert historical stuff
is it?
maybe going forward
14:05
Like, I'll view a webm that's half a second long and it was clearly intended to continue because who would upload a half-second video intended to be viewed once
@idjaw If they were to throw out the original gifs, they could save a huge amount of space and bandwidth.
And you can still save lots of bandwidth if you stop serving gifs when users can receive webms instead
I hope imgur isn't silently converting gifs to webms because the bug reports I've been giving to ImageMagick are all like "I have these pngs and they produce this gif, which is wrong, please analyze the frames and do the needful" and they'll think I'm a lunatic if there isn't actually a gif there
Apropos Firefox and videos, I don’t know if this is a Nightly-only thing at the moment, but Firefox comes with a feature that pauses videos until you switch to the tab. So if you load a tab with a video in the background (YouTube too), then it’s paused.
@poke Oh yeah, definitely agree. I think Netflix went through similar exercises a couple of times already. Didn't they start off (or at least at one point) using Silverlight?
Yeah, Silverlight was huge for streaming services before because of DRM features
14:09
@Kevin I doubt that they'd do it. You used to be able to stop GIF anims with the escape key. I was rather annoyed when they removed that feature. FWIW, the standard Linux CLI utility to view GIFs is gifview.
It's often bundled with gifsicle, which is a nice CLI program to make, split & modify GIF anims. You can get the gifsicle source & binaries for various platforms on this ancient page.
@AnttiHaapala Be proud of me. I'm yelling at py2 people
For the love of Guido, please make that Python 3 friendly. Bonus points for at least a sentence to explain what's happening here. — idjaw 2 mins ago
@PM2Ring I too was annoyed by the removal of the escape key shortcut.
I used it frequently for pages that I suspected had "screamers"
Some people on the xkcd forums have really annoying gifanim avatars. It was nice to be able to freeze them. Nowadays, I just tend to avoid reading their posts...
Reminds me of in the distant past when I would frequent the C++ forums, and there was one user that really annoyed me because he put upside down question marks at the front of all his questions, Spanish-style. I wrote a user script to filter them out.
If we were constructing a language from the ground up I'd happily include leading upside-down question marks as it's a nice context clue, but I don't like it shoehorned into an existing language
14:15
Uhhh, set image.animation_mode on about:config to none to disable all animations…
Yes, this contradicts my usual attitude of "languages are constructed by the consensus of the people that use it, not any dusty rule book. If your language isn't changing, it's dead." I contain multitudes.
@Kevin Why not⸮
@poke Yes, but I'd prefer a little more fine control. If I click a link to an unfamiliar page and it's got spooky orange-on-black theming, I want to be able to disable gifs just on that page without having to navigate away or open a new tab to get to about:config
@Kevin So I take it you are fine with literally = figuratively?
14:18
And I want to do it fast because a skeleton might pop up at any second
Yeah, I know, wasn’t a serious suggestion. Just use super stop
Here's one of the annoying gifanim avatars from xkcd: forums.xkcd.com/download/file.php?avatar=72186_1289711569.gif Yes, it's clever. But it's still annoying, especially when it's in your peripheral vision.
@Kevin that seems equivalent to "the cost of miscommunication is lower than the cost of (whatever is good about people renaming things)"
@MarcusS I'm against it, but only because we don't yet have a word that means "literally literally". If we had a substitute, I'd be fine with throwing "literally" on the euphemism treadmill.
@PM2Ring Wow… someone used too much form tweening in Adobe Flash…
14:20
"really" was made mostly useless in this way, but it was OK because it wasn't the last word we had in reserve.
@poke Thanks!
Which is impressive, because I'm pretty sure the cost of miscommunication is colossal
You know, maybe my resistance to the upside-down question mark isn't in contradiction with my usual attitude, because the guy was using it despite a complete lack of consensus. See also: trying to make "fetch" happen
hey @RobertGrant how are you!
If everyone in the forum used it, I'd probably play along.
14:22
@idjaw good thanks :-) ¿and you?
On the other hand, I've almost never said "cbg"
there's no cbgsensus
@AndrasDeak complicated
what is?
our PM again...
14:23
ah:D
@RobertGrant Pretty good! Had a surprisingly not as stressful holiday as I thought. Last year was nutso because the littles were sick
and by "our PM" you mean "the Finnish prime minister"
Ah that sucks, but glad you got some rest
Turns out children are quite tiring
breaking news
@AnttiHaapala Going forward, PM is reserved for our PM. Any political figure being addressed as PM must be made more explicit. In room 6, the only PM is @PM2Ring
3
14:24
:)
set it in stone
Prime ministers ought to be referred to as "minister₁"
now first, state-owned energy company under his watch invests in another company saving it from bankruptcy; his children own 8 % of that company; he then makes a trip to India to advance export business to the India, with that newly saved company as the spearhead, and says "I didn't decide anything".
#politics
He's a prime minister of the nation and apparently "he doesn't decide anything"
14:26
things happen here all the time spontaneously; especially public money disappearing on its own accord
That sort of thing is incredibly frustrating
My father in law in SA spent the last few months of his working life resisting pressure to automatically choose a certain fuel supplier for the national energy supplier
now when I post about this to the FB, then people are like "what do I complain about"
\o cbg from the land of 10-15 cm of snow xD
I guess we're the land of 4 - 84 cm of snow
@MooingRawr I approve of your metric units
14:30
@AndrasDeak The superior metric units
naturally
"We come from the land of 4 - 84 cm of snow / From the midnight sun, where the hot springs flow"... Doesn't quite have the right meter
I watched a few people crash into each other >.> was kinda terrifying
even Tristan uses centigrades, thanks to Russians
Hello everyone, I'm in a particularly strange scenario right now.
14:31
(inb4 "that's Iceland, you insensitive clod")
@Kevin hot springs :?
well...
@neet_jn \o cbg how goes it
I'm sure it's a mistranslation. By "hot springs" they mean "saunas"
Hypothetically, if I were instantiating a method, within a method, to be called and utilized by another helper method; will that method be removed from memory once the original method call is completed? Or will it linger and be repopulated with another call?
def A(a):
  a()

def B():
  def C():
    print 'hello'
  A(C)
@neet_jn you need to use ctrl-k without the '`' to format w00t \o/
14:35
Will C be instanced in memory every time B is called? Or will it be garbage collected?
It will be removed from memory when GC thinks it's a good time.
Alright, thank you very much for your time.
def A(a):
  a()

def B():
  def C(cache=[]):
    cache.append(1)
    print "I have been called {} time(s)".format(len(cache))
  A(C)
  A(C)

B()
B()
#result:
#I have been called 1 time(s)
#I have been called 2 time(s)
#I have been called 1 time(s)
#I have been called 2 time(s)
If C remained permanently in memory, we'd expect the last line of output to be "I have been called 4 time(s)"
@neet_jn yes and no.
Or, rather, "If C remained permanently in memory, and instead of creating a new function object, Python merely re-bound the old function to the name C"
14:38
the method is reinstantiated. The code object itself exists.
well now I'm at a total loss. I had figured out what was keeping my laptop from going to sleep. Now there is a totally new reason that I have yet to discover as to why it never goes to sleep. Stupid cat poop
@idjaw stop giving it caffeine and maybe it will sleep
We can't tell just from this code whether the function object continues to exist or not, unbound from any names. It's conceivable that the interpreter keeps it in some form (perhaps as a code object as Antti suggests), but doesn't retain the cache variable
Schrödinger's class instance
@idjaw does it have an apple logo on it?
I'm interested to know the motivation for this question. If it's "I wanted to know if consecutively bound function objects shared any kind of observable state", then my code sample fairly conclusively demonstrates that they don't. If it's "I wanted to know if my function object was re-allocating memory on every B call", that's harder to determine without further investigation.
In the case of the latter I'd advise "don't worry about it" because I'd expect function objects to take up like a thousand bytes maximum
If you want to reduce your memory footprint, look elsewhere
14:46
@AndrasDeak Yes. If it helps, part of the apple is missing.
Any ideas?
no, it's not missing: it turned into a leaf
@neet_jn That C function behaves like any other local object that you might create in B. It dies when you leave B, unless you return it to the caller, or somehow stash a reference to it somewere, eg by putting it in a list or dict that's external to B.
def f():
    def g():
        pass
    return id(g)

def h():
    def i():
        pass
    return i

print(f() == f())
#result: True
print(h() is h())
#result: False
@Kevin the code object is a constant
Ok cool
14:49
>>> def foo():
...     def bar():
...         return 42
...     return bar
...
>>> import dis
>>> dis.dis(foo)
  2           0 LOAD_CONST               1 (<code object bar at 0x7f3007c3db70, file "<stdin>", line 2>)
              3 LOAD_CONST               2 ('foo.<locals>.bar')
              6 MAKE_FUNCTION            0
              9 STORE_FAST               0 (bar)

  4          12 LOAD_FAST                0 (bar)
             15 RETURN_VALUE
If I change my previous code sample to print(h().__code__ is h().__code__), I get True
So this agrees with your assessment
>>> import dis
>>> def foo():
...     a = 42
...     def bar(): return a
...     return bar
...
>>> dis.dis(foo)
  2           0 LOAD_CONST               1 (42)
              3 STORE_DEREF              0 (a)

  3           6 LOAD_CLOSURE             0 (a)
              9 BUILD_TUPLE              1
             12 LOAD_CONST               2 (<code object bar at 0x7f300662c8a0, file "<stdin>", line 3>)
             15 LOAD_CONST               3 ('foo.<locals>.bar')
             18 MAKE_CLOSURE             0
closures are way more expensive :P
Not surprising.
speak for yourself
14:53
Ok. I find this not surprising.
and I guess if you do it like def bar(a=a): ... it becomes cheap again?
I know that local names are fastest, but it's still nice to see that in practice
>>> dis.dis(foo)
  2           0 LOAD_FAST                0 (a)
              3 LOAD_CONST               1 (<code object bar at 0x7f3007c3d9c0, file "<stdin>", line 2>)
              6 LOAD_CONST               2 ('foo.<locals>.bar')
              9 MAKE_FUNCTION            1
             12 STORE_FAST               1 (bar)

  3          15 LOAD_CONST               3 (42)
             18 STORE_FAST               0 (a)

  4          21 LOAD_FAST                1 (bar)
             24 RETURN_VALUE
less crap, and the code doesn't need to do extra dereference
if a variable is used in a closure, it becomes slightly slower because now every single access must go through double-deference...
even though it might not be modified in the inner func
for the outer function the code is identical whether or not the inner function uses nonlocal
@AndrasDeak Like this?

« first day (2278 days earlier)      last day (2895 days later) »