« first day (2031 days earlier)      last day (2916 days later) » 
01:00 - 17:0017:00 - 23:00

1:43 AM
Cbg and wow, your review queue goes bonkers once you hit 2k.
 
2:06 AM
cbg
 
 
2 hours later…
3:54 AM
Hey guys. I am learning programming and looking for a mentor. İs there someone who wants to be a teacher but haven't find the opportunity? Here I am :)
 
Hello folks. I'm working on a flask application that is hosted on web faction... I'm having trouble storing content from a curl request to the server. I can see in my error.log that the curl request is calling the server and the data is there. The server return 200 OK to the sender. But the file does not write. Any ideas?
 
 
2 hours later…
5:32 AM
cbg
how to assert if a sequence is sorted?
okay never mind got it...
 
 
2 hours later…
7:22 AM
deostrol: if you assume any sequence type, that isn't that easy
 
 
1 hour later…
8:24 AM
cabbage
 
9:16 AM
` data = data.reshape((n, n) + data.shape[1:]).transpose((0, 2, 1, 3) + tuple(range(4, data.ndim + 1)))
data = data.reshape((n * data.shape[1], n * data.shape[3]) + data.shape[4:])`
Can anyone explain what is happening in these two lines?
 
9:57 AM
@Hossein what's data?
 
10:34 AM
This is the actual question :
http://stackoverflow.com/questions/37090050/getting-axes-dont-match-array-error-when-trying-to-visualize-all-layers-in-caff
the data is a volume of multiple channels!
 
 
1 hour later…
12:01 PM
cbg!
I am confused between append and extend. I know what each is used for but not what is happening under the covers.
 
those are basicly the same thing but a very small difference. They do what they meant :)
 
Does extend unpack it and use append?
 
Cabbage.
 
cbg.
 
12:14 PM
Cabbage
 
I just woke up after having a dream that my exact Chevette, the one I sold because I had nowhere to put it, was up for sale around here. And it was in good running condition 0.o
 
Okay, sorry. I got confused in how assignment by slicing happens.
 
@AbhishekBhatia Sort of. But why don't you take a look at the source vaultah just linked for you?
 
`>>> a[len(a):]=1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can only assign an iterable`
@PM2Ring that is a bit too complicated for me.
 
@AbhishekBhatia Can you read C?
 
12:16 PM
>>> a = [1,2,3]
>>> a[3:] = [1] # Use [1]
>>> a
[1, 2, 3, 1]
 
Yeah, but source code is too long.
 
3kloc is not long :/
 
@BhargavRao yeah. An example a custom iterable or anyone apart from list?
 
@AbhishekBhatia I admit that it's a bit daunting at first, but it's actually quite well organized and not as scary as it first appears. :) But you do need to spend some time looking through it - don't expect it to make a lot of sense on a quick glance.
 
Any mutable iterable, afaik
 
12:19 PM
I guess an iterator wouldn't actually be mutable, eh?
can you slice assign a dict? Can you even slice a dict? It is definitely mutable...
 
For tuples, you cant do a[3:] = [1] as it is immutable
You will get "does not support assignment".
 
I am referring to the RHS and not LHS.
 
@AbhishekBhatia: The function that does the actual work of setting list items is called PyList_SET_ITEM. PyList_Append is quite simple: it gets PyList_Check to check stuff, then uses app1() to do the actual appending.
listextend is a bit more complicated because it has to also check the source list as well as the destination, and it has to loop over the source list.
One of the more complicated things that happens in listobject.c is the memory management of the list. Lists usually have some spare space at the end to make it more efficient to append new items. So listobject.c has logic to check how much spare space a list has and how much new spare space to add when the old spare space runs out.
@WayneWerner Nup. You can't slice a dict because it has keys, not integer indices. So slicing doesn't make sense.
 
So "any mutable iterable" isn't quite right, eh? ;)
although - if you subclassed dict then you could override whichever function it is and do it yourself, if you had a case where that actually made sense. Or you just wanted to try it out for kicks and giggles.
 
FWIW, you can call sorted() on a set (or the keys of a dict), but you can't call reversed() on them. At least, you can't in Python 2, it may be different in Py3.
 
12:33 PM
Yeah, most things that operate on iterables work on dict, it just happens to operate on the keys. e.g. sorted(mydict) will sort just the keys.
 
Heh, we can implement slice in that sub class too :P
 
or reversed, etc.
I forget what library I came across... maybe it was one of the scientific ones? Or something to do with HL7 messages or something... anyways, they abused the mess out of slice notation. But it actually worked, you know? I mean, it made things cleaner and made sense.
made me feel dirty looking at it....
that was the first time I realized that you could customize that behavior
 
>>> a = array.array('i')
>>> a.extend([1,2,3])
>>> b = array.array('i')
>>> b.append(3)
>>> a[3:] = b
>>> a
array('i', [1, 2, 3, 3])
But I am still confused as to what to call them, because, mutable iterable isn't accurate.
 
arrays aren't mutable?
 
They are, you can add and remove items.
The only special thing about them is that you need to specify the type before hand. (iirc)
 
12:40 PM
@AbhishekBhatia I assume that a is a list. In a[len(a):]= something the something has to be an iterable. But you really should use .extend.
Here's a quick demo showing that .extend can accept a generator:
>>> a = list('abc')
>>> a.extend(i for i in range(3))
>>> a
['a', 'b', 'c', 0, 1, 2]
@BhargavRao You remember correctly. It's impossible to create an array.array without giving the type code. They're efficient, but only useful for storing simple data types, i.e primitive C data types. So no tuples, lists, sets, etc.
Note that array.arrays are efficient in terms of RAM. They're actually a little bit slower than lists, as I sadly discovered when trying to improve my prime sieving code.
 
I haven't used arrays anywhere in my programs.
 
I had fun earlier this evening writing some Python code to solve this puzzle on the xkcd Mathematics forum: Seating problem
@BhargavRao Apart from a few tests I haven't used them either, except in maybe an SO answer or two.
 
I've never come across a situation where I've needed to use the array package. If you want to do significant amounts of math, Numpy operates at light-speed (i.e. C), and usually better than naive implementations of things like sum()). — Nick T Apr 22 at 15:01
That Q&A comparing arrays and list speeds is really good.
 
12:59 PM
FWIW, here's some prime sieving code that uses array to save RAM. stackoverflow.com/questions/35222244/…
 
I've never used an array for more than, "oh, that's what they are"
 
It's nice that standard Python has array, but I guess if you want speed as well as saving RAM you ought to be using Numpy.
 
1:33 PM
IIHF tournament, interested persons are: Antti Haapala and.
 
me
:D
 
@PM2Ring reversed is a sequence operator:
@PM2Ring also why wouldn't you compile python 3
it is pretty easy
you've got internet, gcc and those are all that is needed.
 
@AnttiHaapala I suppose I should...
 
no need to guess any more :D
 
:)
 
1:38 PM
github.com/python/cpython this is so far only semiofficial but I like git better than hg :D
then configure it to install in /opt say, then you can take it into and out of path as you want
 
1:53 PM
@AnttiHaapala How big is that?
 
2:10 PM
@PM2Ring probably you'd want around 1G in total free disk
the .git directory is 300M
 
@AnttiHaapala I was actually asking about the size of the download. :) But I've already downloaded the zip file - it was only 21.6 MB
I suppose I really should have git clone'd it... but I haven't used git much, and that was a year or two ago...
 
so it is really: git clone https://github.com/python/cpython
 
So can I just unzip it in my home directory and make it there?
 
and git pull to get updates
@PM2Ring I am not sure if the top directory is included in those zips :D
 
So I shouldn't use that zip file?
 
2:16 PM
so better to create a directory first and unzip into there
@PM2Ring ah it does contain a toplevel directory, so nvm.
so unzip :D
 
$ ls -1F cpython-master/
aclocal.m4
config.guess*
config.sub*
configure*
configure.ac
Doc/
Grammar/
Include/
install-sh*
Lib/
LICENSE
Mac/
Makefile.pre.in
Misc/
Modules/
Objects/
Parser/
PC/
PCbuild/
Programs/
pyconfig.h.in
Python/
README
setup.py
Tools/
 
yeah
cd cpython-master
./configure --help
 
@AnttiHaapala Yeah, I checked for that before I unzipped it.
 
perhaps at least use a sensible prefix, for example /opt/python3.5
so it'd install /opt/python3.5/bin etc
and you could put it into path and take out as you want
or as you will
 
@AnttiHaapala So will I still be able to do updates easily? Or should I wipe out the stuff I just downloaded & unzipped and start again?
 
2:20 PM
the git checkout is easier that way...
though you'd probably have to make clean anyway
usually you can use the make to compile only some files but if there are big changes I doubt a partial build would work
 
BTW, this is Python 3.6, not 3.5
 
yeah I think you just need --prefix for configure for now :d
@PM2Ring ;)
you're a front runner :d
so, use /opt/python3.x for prefix then :D
damn you will have format strings :D
 
@AnttiHaapala Why 3.x and not 3.6 ?
So I just need to do:
./configure --prefix=/opt/python3.x
make
make test
And I do that as a normal user, not root. Is that all correct?
 
2:40 PM
yeah
but then sudo make install to get it into the prefix...
or of course you could install into your home dir with different prefix...
say /home/pm2/python3.x
but I like installing "systemwide" :D
 
@AnttiHaapala Thanks.
I guess there's no harm installing it to /opt/ - I only have firefox & java there.
 
:D
that is what opt is for
 
Ok. config is finished. Here goes...
 
no need to see every line :D:D:D
 
2:58 PM
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2                  _curses               _curses_panel
_dbm                  _gdbm                 _lzma
_sqlite3              readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Bugger. I don't care so much for the others, but I need readline.
 
3:17 PM
@PM2Ring you need to install libbzip2-dev and readline-dev obviosuly
or something like those
@PM2Ring anw, test that it works before you reconfigure :D
 
@AnttiHaapala I've been trying to install readline-dev, but I'm getting errors. I think I need new repos...
 
I am not sure about its name
sudo apt-get install libreadline-dev
perhaps?
 
THere's a small readline-dev, and also readline5-dev and readline6-dev
 
I'd say readline6
that's what is current in ubuntu
bz2 and sqlite3 are also nice
and perhaps curses
@PM2Ring are the mepis repos down?
 
I'm getting Unable to fetch file, server said 'Failed to open file. '
 
3:22 PM
lol.
how is apt-get update
no hits?
 
@AnttiHaapala Maybe. But I haven't had this problem before.
@AnttiHaapala I normally use synaptic. But I did apt-get update a few minutes ago and got 9 Err lines.
 
mm
which repos?
urls
 
Eg,
Get:32 ftp.debian.org squeeze/main i386 Packages
Err ftp.debian.org squeeze/main i386 Packages
  Unable to fetch file, server said 'Failed to open file.  '
Get:33 ftp.debian.org squeeze/contrib i386 Packages
Err ftp.debian.org squeeze/contrib i386 Packages
  Unable to fetch file, server said 'Failed to open file.  '
 
guess squeeze is gone from official repos :d
Squeeze had benefited from Long Term Support (LTS) until the end of February 2016. The LTS was limited to i386 and amd64. For more information, please refer to the LTS section of Debian Wiki.
:D
so
no support for squeeze officially
perhap syou should consider switching to debian
@PM2Ring deb archive.debian.org/debian <version> main non-free contrib
so replace ftp.debian.org with archive.debian.org/debian
 
duplicate but I went with tb stackoverflow.com/q/36759981/4099593
hammer if possible
 
3:29 PM
@AnttiHaapala Oh dear. FWIW, these are my repos:
 
# grep '^[^#]' /etc/apt/sources.list
deb mepis.mirrorcatalogs.com/packages/mepis mepis-11.0 main
deb ftp.debian.org/debian squeeze main contrib non-free
deb security.debian.org squeeze/updates main contrib non-free
deb ftp.debian.org/debian squeeze-updates main
deb ftp.debian.org/debian squeeze-lts main contrib non-free
deb-src ftp.debian.org/debian squeeze-lts main contrib non-free
deb main.mepis-deb.org/mepiscr/repo mepis11cr main non-free
 
@AnttiHaapala Lol, I forgot what I voted. :D
 
yeah so replace ftp://ftp.debian.org with http://archive.debian.org
then apt-get update
and you're "good to go"
though I would be extra careful on internet :d
there are no updates any longer.
 
last cv of the day gone. Time for a walk then! Rbrb all
 
3:33 PM
@AnttiHaapala Are you saying I can edit my /etc/apt/sources.list and replace ftp.debian.org with archive.debian.org/debian and it will work ok? Of course, I'll back up the old sources.list first!
@AnttiHaapala Ok. Thanks.
 
3:46 PM
@PM2Ring works?
 
@AnttiHaapala No. :(
 
no?
what does it day
needs to be http://
and you need to do apt-get update first ofc
 
Here's my new sources.list:
deb mepis.mirrorcatalogs.com/packages/mepis mepis-11.0 main
deb archive.debian.org/debian squeeze main contrib non-free
deb security.debian.org squeeze/updates main contrib non-free
deb ftp.debian.org/debian squeeze-updates main
deb archive.debian.org/debian squeeze-lts main contrib non-free
deb-src archive.debian.org/debian squeeze-lts main contrib non-free
deb main.mepis-deb.org/mepiscr/repo mepis11cr main non-free
 
deb ftp.debian.org/debian squeeze-updates main
that's wrong there
 
Here's the output from apt-get update
 
3:48 PM
and also there is no security debian org either
 
Hit security.debian.org squeeze/updates Release.gpg
Get:1 archive.debian.org squeeze Release.gpg [1,655 B]
Get:2 archive.debian.org squeeze-lts Release.gpg [819 B]
Hit security.debian.org squeeze/updates Release
Hit security.debian.org squeeze/updates/main i386 Packages
Hit security.debian.org squeeze/updates/contrib i386 Packages
Hit security.debian.org squeeze/updates/non-free i386 Packages
Get:3 archive.debian.org squeeze Release [96.0 kB]
 
yeah that shouldn't probably matter
 
@AnttiHaapala What should it be?
 
it should be archive as well
15
Q: How to work around "Release file expired" problem on a local mirror

TshepangI have a local mirror (created with debmirror), and when I run apt-get update after a few days, I get this: E: Release file expired, ignoring file:/home/wena/.repo_bin/dists/sid/Release (invalid since 14h 31min 45s) How do I work around that?

lol it's tshepang
@PM2Ring basically you're running the Windows 98 of Linuxen
 
@AnttiHaapala Sorry, I don't know what that means.
 
3:55 PM
@PM2Ring his name
 
@PM2Ring He's an old regular
 
@Ffisegydd Ah, ok.
The linked question says to do
sudo apt-get -o Acquire::Check-Valid-Until=false update
 
Ok. I'll give that a go.
 
that'd make apt-get not check the release date
also, you should really start thinking about updating your OS :d
your computer is still probably more powerful than raspberry pi 2
 
3:57 PM
Interesting! update is doing a lot of stuff...hopefully good stuff. :)
 
and jessie works quite nicely there
 
@AnttiHaapala I agree. Any suggestions?
 
I am not sure how painless it would be but I guess it could be possible to upgrade from mepis to debian?
you'd lose the custom desktop environment though
and such
whoaa canada forest fires
 
@AnttiHaapala That's not a huge deal. I don't use most of the KDE crap anyway. But I do like Konqueror as a file browser, even though it was superceded by dolphin ages ago.
 
I mean:
I believe you can do a dist-upgrade to debian wheezy/jessie/soforth
but you'd probably have to uninstall custom mepis stuff that depends on the exact squeeze versions first
 
4:04 PM
@AnttiHaapala Thanks. I have seen that page before... but not for a while... "--Last updated March 09, 2016--". Excellent!
 
so, there is no update really
only the workaround I and tshepang described. you're still fscked up :D
I guess that explains why we've not seen him lately :D
 
YAY! apt-get install libreadline-dev worked!!!
 
:D
@Ffisegydd unless you realized, we're witnessing a historic moment here.
 
That Mepis wiki page doesn't have deb-src http://archive.debian.org/debian/ squeeze-lts main contrib non-free in the list. I assume that's for dev source files?
 
yes
you almost never need them
 
4:15 PM
Yeah I'm in awe at this.
 
6
Q: The difference between deb versus deb-src in sources.list

ptrcaoI don't understand the difference between these two lines in my sources.list, please explain: deb http://mirror.optus.net/debian/ testing main contrib non-free versus deb-src http://mirror.optus.net/debian/ testing main contrib non-free System: Debian 6 testing, 32 bit.

 
Are you going to upgrade to Python 3 at the same time? :P
 
Oh, ok. But I'll leave it in anyway. :)
 
@Ffisegydd no, he is compiling python 3.
 
Oh right, I've not been paying that much attention.
 
4:15 PM
actually he compiled 3.6 already
 
@Ffisegydd I compiled Python 3.6, but got a few errors...
 
no errors
but the readline support was not built in
 
I got into the Docker for Windows beta but it doesn't support Win 10 Home for now. This makes me sad.
 
Well, missing modules. I need a short break. Back in a couple of minutes.
 
because pm didn't have the dev module
 
4:16 PM
I remember having issues with Python 3 compilation on an old version of CentOS.
 
user559633
I got into the docker beta too, but then just synced a folder with virtualbox and realized that does 100% of what I need.
 
I have Linux. A long time ago I realized it does 100% of what I need.
 
user559633
Yeah, love doing user testing in Linux because it gives me the feedback of someone that would never spend money on my startup anyway
 
(except testing webpages with IE. But actually it is not me who really needs to use the webpages with IE)
 
user559633
Linux: y'all pre-ordered the oculus, right?
 
4:18 PM
what's your startup?
why not :D
 
user559633
it's an omg stealth mode. you'll have a hard time getting me to shut up about it soon
 
so make it work on linux, you have 2 % without competition :D
 
user559633
it's a webservice/mobile app
 
user559633
having 2% without competition would actually be amazing.
 
user559633
for non "afk" applications, i think there's a danger in focusing too much on linux users as they'll just crack your app and avoid paying
 
4:21 PM
lol
your biz model is not very good if you're worrying about crackers like that
usually linux users crack the software because they cannot install it legitimately
 
user559633
i'm 0% worried about someone cracking my application. it's a web application
 
ah ...
yeah.
anw :d
 
user559633
i'm not sure i buy that. if anything "they can't install it legitimately" == it's not convenient as they want and they'll rationalize their shitty behavior
 
user559633
"i only downloaded the movie because the movie theater always makes me wear pants and i don't want to wear pants. so when you think about it, it's hollywood's fault"
 
if the installer does not work with wine because of copy protection
 
4:23 PM
That's absolutely valid. Down with pants!
 
then you need to use the warez wersion
 
user559633
yes, that rationalizes theft. not being able to install it the way you want. you couldn't just.. not. or install windows.
 
you could wear a kilt I guess
theft?
"just install windows"
that'd be theft as well.
you'd have to license it
and then abide by its EULA.
 
user559633
oh, i forgot that using something without paying for it or benefitting the creators isn't considered naughty if you have linux installed
 
It's open source, duh.
 
user559633
4:25 PM
DUH, someone else's hard work wants to be free
 
Developers should eat their enjoyment of working on open source material, they don't need to be paid for food.
 
user559633
now if you'll excuse me, i have some music to listen to on youtube in my adblocking browser
 
user559633
yeah, they like computers right? so why pay someone to do it. athletes only get paid huge because otherwise they would hate playing a game for a living
 
I am paid for doing open source, ofc.
that's the best thing ever.
 
user559633
here lies tristan: he was salty about being bad at baseball until he died at the pizza buffet
 
4:27 PM
I still can continue using my fscking code afterwards :D
 
user559633
new moderat: it's okay.
 
@tristan anw, when was the last time you paid for python?
 
user559633
@AnttiHaapala pycharm? last month. python the language? i think i pay them by proxy of my celebrity status endorsing it (sometimes)
 
4:28 PM
The past 3 years answering idiotic people's questions on SO is my payment for Python.
 
pycharm is like the worst thing to happen to python :D
after google and redhat, ofc.
 
user559633
bullshit. pycharm is good.
 
I am using it daily, I know what I am complaining about
I fscking paid money for it.
 
user559633
honestly, if there was a a form that was like "give us money" and i knew it wouldn't go to non-tech fuckery, i'd pony up a donation for python org
 
user559633
yeah, i hate how pycharm is a useful, mandatory IDE.
 
4:29 PM
Hey, @AnttiHaapala I added these lines to that sources.list from the Mepis Wiki: Is that ok, or should I comment them out?
deb mepis.mirrorcatalogs.com/packages/mepis mepis-11.0 main
deb security.debian.org squeeze/updates main contrib non-free
deb archive.debian.org/debian squeeze-updates main
deb-src archive.debian.org/debian squeeze-lts main contrib non-free
 
I know absolutely nothing about mepis
I know something about debian and ubuntu
so, if it works, then I guess it is "ok"
however do undrestand that the LTS support gone, there really are no updates
 
user559633
pretty soon we'll all be coding in systemd anyway
 
systemd rocks.
 
user559633
hurrrk
 
it is open source, and free <3
 
user559633
4:31 PM
i'm positive that you're fucking with me now
 
no
it does rock
 
@AnttiHaapala Fair enough. Obviously the first one is Mepis-specific, but I figured the others were generic Debian. Those lines were from the previous version which allowed me to get readline-dev, so I guess they're alright...
 
however it is not well-documented yet
 
Heh. The f*cker has become the f*ckee.
 
user559633
 
user559633
4:35 PM
trust the red hat
 
user559633
love the red hat
 
user559633
@Ffisegydd 2016: the year of the f*ckening
 
I never troll.
 
Hi hi
 
Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> s = socket.AddressFamily.from_bytes(bytes([1]), 'big')
>>> s == 1
True
>>> s
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/enum.py", line 474, in __repr__
    self.__class__.__name__, self._name_, self._value_)
AttributeError: 'AddressFamily' object has no attribute '_name_'
 
4:42 PM
@AnttiHaapala Now that I've got those dev files do i need to run ./configure again, or just make?
 
yeah ./configure since that'd be the one that finds out whether or not readline can actaully be used.
 
Thanks
 
see that the output says that readline was actually found
 
user559633
hey idjaw
 
should go to config.log
 
4:44 PM
Do I need to do make clean, or will plain make be ok?
@AnttiHaapala There's a bunch of stuff in there about readline. Eg, py_cv_lib_readline=yes What am I looking for, exactly?
checking how to link readline libs... -lreadline
checking for rl_callback_handler_install in -lreadline... yes
 
01:00 - 17:0017:00 - 23:00

« first day (2031 days earlier)      last day (2916 days later) »