« first day (2349 days earlier)      last day (2599 days later) » 

8:00 PM
Hungarian is a phonetic language so Bubi is pronounced as... boobie with short vowels all around
@Kevin yes, but we only call it "bubi", no bikes
 
Take your Bubi bike to the ATM Machine and enter your PIN number so the mountains of muscle don't send you to the ER room
 
:|
yes. :P
@Kevin you'd also find it suboptimal that most signs are only in Hungarian, so if you want to find out things you're likely to have to talk to a human
 
wim
my experience there was the young people were really cool and friendly and the old people were really cranky and annoying
 
yup, sounds right
 
wim
I don't know why it's like that
 
8:06 PM
I don't really know either, a lot of those old people might be unhappy about the whole global and modern world thing so they might be unhappy to see English speaking-tourists (only guessing)
you'll definitely see that younger people are much more likely to speak English, which obviously helps in being friendly
 
Guys, can anyone tell me whether this could be used to run non-halting background thread on django startup which occasionally saves data to database and mustn't run in parallel with itself? docs.djangoproject.com/en/dev/ref/applications/…
 
wim
I just did
>>> s
<sqlalchemy.orm.session.Session at 0x7fffe846cc88>
>>> s.commit()
Segmentation fault (core dumped)
 
Impressive
 
wim
anyone know what you can find in the core dump file? what is that anyway, just a memory dump?
 
something something gdb
 
8:11 PM
cookies?
 
wim
gdb not gonna help you much in a segfault man
 
Well I've run gdb with wrong input parameters in the past, and it complained about something not being a core dump file? So I got the vague impression that it can do something with core dumps:D Besides, gdb can do anything, right?
 
wim
huh, it did actually save my changes to db too
 
99
A: How to analyze a program's core dump file with gdb?

another.anon.cowardYou can use the core with gdb in many ways, but passing parameters which is to be passed to executable to gdb is not the way to use core file. This could also be the reason you got that error. You can use the core file in following ways: gdb <executable> <core-file> or gdb <executable> -c <core-file

dunno how that works with something dumped from python
as I said, all of this is magic to me
 
wim
oh, interesting
i already rm'ed the sucker though :P
those files can be yuuuuuuuge
 
8:14 PM
problem solved:D
 
> We excluded respondents who completed the entire survey in less than 10 minutes.
robo survey!
 
I got quota violations all the time while debugging a code of mine at an hpc cluster; turned out that each core dumped 4 GB on termination
 
oops
 
fortunately there was only 12 of those
 
What is the best library to read/write xls files with. I am currently using xlrd/xlwt, but I was wondering if there was a better choice?
 
8:23 PM
Crazy what literally typing "python excel" into search will do. Beyond that, "best" is completely a matter of what works and what you need to do.
 
I know davidism, I have been on that site, but it doesn't give me a recommendation to the best library of the listed libraries.
I have been on that site ffs..
 
It does give a recommendation: each library has a description of when it's appropriate to use. Try reading.
 
Keep in mind its xls (newer files) 2017
Well it's just outdated (from 2010), I thought one of you guys maybe used one of them before.
 
Why do you think it's outdated? 2010 is when the XLSX format popped up.
 
I just hope it's webscale
 
8:27 PM
Because it was written for around 7 years ago.
 
Why not try researching when the libraries were last updated, or just try it out and see if it works.
There's also a "recent site changes" link at the bottom of the page, and it was last updated mid 2016: python-excel.org/system/app/pages/recentChanges
 
Yeah ..
 
Crazy
 
wim
maybe it was around 7 years ago people realised they should use json
 
8:30 PM
but that's just so last year
 
Or just stick with CSV.
 
wim
problem with csv is distinguishing between strings and numbers
 
don't strings have quotes around them?
 
wim
>>> w = csv.writer(sys.stdout)
>>> w.writerow([0, '0'])
0,0
5
yeah, ok, thanks csv
 
8:32 PM
what's with the 5 at the end ?
 
wim
number of bytes written to file
 
number of bytes
 
ahh i see
 
wim
0 , 0 \r \n
 
and I was only guessing \o/
I get 5 on linux...
so I'm not sure it's \r
 
wim
8:32 PM
you get \r
because that's excel dialect
caught me off guard the first time too
 
    writerow(iterable)

    Construct and write a CSV record from an iterable of fields.  Non-string
    elements will be converted to string.
@wim I'm not surprised
converting everything to strings is weird
 
wim
\r\n is so 19th-century typewriter
 
but if your goal is to transfer data to excel, you're screwed either way
 
wim
well, real excel spreadsheets will preserve the types
 
>>> def commifier(it):
...     return [elem+',\b' if type(elem)==str else elem for elem in it]
...
>>> w.writerow(commifier([0,'0']))
0,"0"
9
close enough?:D
 
wim
9:05 PM
no, because quotes already have meaning in the dialect and you are breaking that
 
im off have a nice day. Need to grind more Nier :D
 
rhubarb
 
wim
if you wanted to do it like that, you would use:
>>> w = csv.writer(sys.stdout, quoting=csv.QUOTE_NONNUMERIC)
>>> w.writerow([0, '0'])
0,"0"
7
and not your ugly hack
 
ah, so setting the writer, cool
I looked at writerow but didn't find any kind of options
@wim well I wasn't being serious
 
jjj
hi, cabbaje hi
 
9:09 PM
so you can distinguish between numbers and strings at least
cbg
 
wim
you're missing the point
 
probably
what is your point?
 
wim
>>> list(csv.reader(['0', '"0"']))
[['0'], ['0']]
does that explain it for you?
 
I think so, yes. Although, can't you set something similar for quoting in reader?
 
wim
you can
but it's not encoded in the file itself
so the information is not in there, you just have to know it beforehand
 
9:12 PM
I see
I guess I could live with that, but I also see how it's suboptimal
what I couldn't live with is excel:D
 
wim
json is also guilty of type-crimes too though
>>> json.loads(json.dumps({0: 0, '0': 'zero'}))
{'0': 'zero'}
 
that's not very nice
I assume that in most use cases you wouldn't have keys which differ only by an str() call, but still
 
wim
even msgpack fucks things up if you don't drive it properly
>>> msgpack.loads(msgpack.dumps({b'b': b'b', u'u': u'u'}))
{b'b': b'b', b'u': b'u'}
 
OK, b'' and u'' is asking for trouble :P
 
jjj
I'd read a novel entitled "Type-crimes"
(If, by any chance, you're planning on writing one)
 
wim
9:23 PM
genre crime , or genre compsci?
 
95 wpm hunt-and-peck.
 
TIL "hunt-and-peck"
 
Sneaking into the office and switching everyone's layouts to HCESAR.
 
do wolves also hunt in pecks?
 
Peppers hunt in pecks. Just ask Peter Piper. Guy took his pick.
 
9:27 PM
Probably pickled peppers. Possibly.
 
I need google
 
They had just left the bar, so..
@AndrasDeak bfy.tw/39RM
 
merci
 
> the number sign (which was achieved by some through intricate methods involving partial depressions of the backspace key to overwrite the equals sign with two slashes)
wat
 
*takes a photo of the screen, prints it, then hunts-and-pecks the link into the google search bar*
 
9:29 PM
*whites out the typographical errors on Andras' screen then resubmits the URL to the Google search bar.
 
@WayneWerner good thing there wasn't any twitter back then
 
jjj
@wim preferably somwhere in between, people killed by type-shifting.. or something
 
"I didn't see the killer...but it quacked, quite like a duck!"
 
jjj
:D
Has anyone seen the google talk with linus torvalds in which he talks about git?
 
I love it when my son smiles in his sleep when he's fallen asleep on my chest
 
9:33 PM
I only remember the "fuck you nvidia" video
 
Who doesn't?
 
Antti linked it here twice in September :D
 
holy crap I just discovered a keyboard shortcut that I have in my shell
and I don't know if this is because of using oh-my-zsh
can someone with a mac try something out for me?
 
jjj
I can
 
as long as it's not a ghost in your shell
I don't even feel bad
 
jjj
9:37 PM
heheh
 
open up your terminal and type

ls -

after the - hit ctrl-i
do you get a menu explaining every supported command taken by ls?
because my mind has just been blown
 
jjj
yup
thats pretty cool
(no, I didnt know about that one, thank you)
 
in bash I have ls - -> tab tab -> list of -- switches
which I didn't know worked like this, so there's that
 
jjj
tab works on zsh too
 
You can tab complete just about anything in bash these days.
 
9:40 PM
holy crap this is just amazing
this is my single greatest discovery in the last couple of months
 
@Code-Apprentice yup, gotta love it
 
/nod
git bash on windows is not nearly as good
;-(
 
 
still beats the command prompt, I'm told
 
yes, it does
 
9:42 PM
@idjaw that's nice
 
it's so pretty
I'm in love right now
 
the primary reason I am using windows and haven't installed linux is because the platform I need for a current client only runs on win.
just got this laptop a couple of weeks ago with my tax return. Maybe I'll repartition it and install a dual boot linux eventually.
 
@Code-Apprentice That's so 1990s. :) Install a base OS and then run virtual machines for any OS you want.
 
yah...I could do that, too
 
that's only enough to keep away deprivation-induced delirium
 
9:53 PM
I would prefer to install Linux as the base OS and run a Windows VM, but the laptop came with Win already installed and no CD or other installation medium. Not sure how to install it on a VM ;-(
 
wim
@idjaw you only just found out about tab completion? please tell me this is a joke..
 
@wim ....dude...did you read what I wrote?
 
not tab, but ctrl+i, and not completion, but inline help
BadgerError: Please restart badger and try again.
 
wim
I was sure I was missing something
 
:)
 
wim
10:01 PM
on my shell ctrl+i does the same thing as tab completion
 
@idjaw much of it is probably oh-my-zsh
though some of it is zsh
TYL - ctrl+i == tab
 
bash definitely just prints options with tab, no help
 
ctrl+h == backspace
quite literally they send the same signals
 
wim
anyway to get the inline help in bash?
i just grep the man pages
but that thing would be nice ...
 
wim
10:03 PM
dropbox is blocked here
and rightfully so, that shit is malware
 
lol.
Here's my mnemonic for ln, btw: ln is like pretend mv
mv source dest
ln -s source dest
 
don't you hate it when you think your laptop is plugged in and you get a "low battery" warning?
 
that's usually when my battery life plummets
 
earlier I forgot that I hadn't disconnected from my phone hotspot. Wasn't until I was trying to ssh to a pinholed server that I realized there was an issue
 
well, this is a brand new (refurbished) laptop, so it better not be going out on me yet.
so my first step is to make sure everything is actually plugged in...sure enough, it had come loose from the wall socket
 
wim
10:16 PM
@WayneWerner you call the link name the "dest". that's opposite of my expectations
 
@wim you could try looking at something like this which claims to be partially a bash-based rip-off of oh-my-zsh, and look at its completion scripts
 
That's why I always got confused with ln, because it's backwards from how you think about it, but normal if you consider it similar to mv
 
wim
huh, if I get two more upvotes today I will hit repcap without having even made a post today
there should be a badge for that
 
Bourgeois badge?
 
wim
Electoral College badge
(rigged voting)
 
10:26 PM
heh. Nice ;)
Autopilot badge :P
 
wim
Absent minded badge
 
no, that's for reposting a question you asked a month ago, or trying to upvote your own answer
 
wim
hmm, badges are supposed to encourage good behaviours so nah
I always forget the order of these things, is this correct : shebang, coding declaration, module docstring, imports
 
it starts with shebang...
 
wim
oh, there's some dunders like all and author that go before the imports too
FU chat markup
 
10:33 PM
shebang is always the first, because that's outside of Python
__all__ and __author__
which looks like \_\_all__ and \_\_author__
or you can do __all__ and __author__
 
that's the typographically correct version ^
 
jjj
10:45 PM
whats the __all__ thingy for?
 
I think other stuff don't get imported with a star import, but I'm not sure
no, that's not it
no, that's it!
 
jjj
thanks
 
$ tree
.
├── __init__.py
└── tmptmp.py

$ cat tmptmp.py
__all__ = ['foo', 'bar']

def foo(): pass

def bar(): pass

def baz(): pass

$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tmptmp import *
>>> foo
<function foo at 0x7f4ad83ab0d0>
>>> bar
<function bar at 0x7f4ad83ab158>
>>> baz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'baz' is not defined
guess there might be other uses for it, as you see I'm hardly an expert on the matter
anything more would have to be provided by google :P
 
jjj
I thought from module import * was bad practice anyway?
 
generally yes
 
jjj
10:53 PM
ok
 
it can be useful in a REPL situation
or if you're doing it for your own modules and know there won't be any name collisions
different track: my head hurts: python.org/dev/peps/pep-0530
 
read it a few times, let it asink in
 
hur hur hur
 
wim
import * is useful in __init__.py files
you allow submodules to specify their public api (via __all__) and then you bring those names "up" the package namespace by using * imports
 
ah, I see what you mean
 
wim
11:05 PM
this method avoids duplicating the info in 2 places
and since __init__.py shouldn't generally have much in it besides a bunch of names, it's not bad for the usual reasons that * imports are bad
 
jjj
oh that's nice, thanks for this
 
Ah yeah, I knew there was a good reason for it ;)
 
wim
Huh. That's it, yeah
nice find
 
It was a fun tutorial - you can find it on YouTube
 
wim
dabeaz is an excellent instructor
why people pay $ for LPTHW when there's stuff like that online for free, I dunno
 
11:19 PM
zedas is louder
and he probably has better SEO
 
wim
has Zed even written anything usable on github / PyPI ??
as far as I know he hasn't done jack
 
dunno
 
dabeaz is amazing. I love his talks.
his generators pdf blew my mind
 
wim
coroutines and concurrency was head-exploding
 
where he did the async/await stuff?
 
wim
11:24 PM
that was the sequel to the generators one , actually
 
Indeed
 
wim
no, it predated async/await I think.
google for "curious course on coroutines and concurrency"
 
oh, no! I haven't seen this
I'm excited to learn about that tomorrow :D
 
watch for your brain
explode responsibly
3
 
@wim There was Lamson, whose project website is now dead and hasn't had a commit in four years. I remember reading a bit about it at the time, but never used it.
 
wim
11:39 PM
Wow, that one's README.md is actually written like he's a professional developer, and not some douchebag Dunning–Kruger effected asshat
 
well that seems to be intentional
> Lamson is written entirely in Python and runs on Python 2.5 or 2.6 but not 3k yet.
 
wim
maybe it was the 3k port that finally drove him to the dark side, bringing us the zed we all know and love
 

« first day (2349 days earlier)      last day (2599 days later) »