Posts

    Day 184

    pandas print_full to output stuff with max everything

    def print_full(x):
        pd.set_option('display.max_rows', len(x))
        pd.set_option('display.max_columns', None)
        pd.set_option('display.width', 2000)
        pd.set_option('display.float_format', '{:20,.2f}'.format)
        pd.set_option('display.max_colwidth', -1)
        print(x)
        pd.reset_option('display.max_rows')
        pd.reset_option('display.max_columns')
        pd.reset_option('display.width')
        pd.reset_option('display.float_format')
        pd.reset_option('display.max_colwidth')

    (from SO)



    Day 179

    Day 178

    Vim

    Vim resize splits / vsplits

    For a split window: You can use Ctrl-w + and Ctrl-w - to resize the height of the current window by a single row. For a vsplit window: You can use Ctrl-w > and Ctrl-w < to resize the width of the current window by a single column. Additionally, these key combinations accept a count prefix so that you can change the window size in larger steps. [e.g. Ctrl-w 10 +] (Resize splits more quickly | Vim Tips Wiki | FANDOM powered by Wikia)

    Read more...

    Day 177

    Python

    Getopt

    15.6. getopt — C-style parser for command line options — Python 2.7.16 documentation, especially the part optlist, args = getopt.getopt(args, 'abc:d:') – the options with a colon following need to have a value. Otherwise GetOptError will be raised.

    Read more...

    Day 176

    Linux undelete file on ext filesystem with extundelete

    extundelete /dev/sda4 --restore-file directory/file I’m shocked this works, and it can do a lot of interesting stuff - files, directories, list of deleted files, etc etc etc.



    Day 175

    Linux output logs continuously

    I always forget this: tail -f /var/log/



    Day 172

    Tensorflow

    Estimators

    This is one of the best tutorials I’ve found. Todo: userscript that gives me back the real URL from outline.com.

    Read more...

    Day 171

    Pandas apply() memory hell

    This is a nice read about how Pandas’ apply needs to store the Series it creates, that there’s no magic, and that inelegant loops can sometimes be faster. Relevant is the official Enhancing performance guide, that I should read.



    Day 169

    Games

    • Greed is absolutely wonderful and much more interesting than I thought at the beginning.


    Day 168

    Rclone and backing up Google Drive

    rclone is nice. I followed the guide in Google drive, and the magic command to copy all content is rclone sync "drive:Google Photos" /mnt/data/Backups/GP, about 300kb/s, and about 4 hours left.



    Day 165

    Qutebrowser private windows

    exist. qutebrowser --temp-basedir -s content.private_browsing true

    Read more...

    Day 161

    Qutebrowser config.py

    A Python config file is excellent. qutebrowser/configuring.asciidoc at master · qutebrowser/qutebrowser · GitHub For now this, then we’ll see:

     https://github.com/qutebrowser/qutebrowser/blob/master/doc/help/configuring.asciidoc
    Read more...

    Day 160

    Resizing/converting/… a video with ffmpeg

    ffmpeg -i input.mkv -s 640x480 -c:a copy output.mp4

    Read more...

    Day 155

    Using I/we/passive in a Bachelor’s thesis

    No easy answer, but I liked here the joke “In your particular case, an inclusive we could be used to recognize the nematodes collaboration :) – Dr. belisarius May 10 ‘11 at 13:01”

    • I asked another young professor whether one could use “I” and she said “Only if you want to sound like an arrogant bastard”, and observed that only old people with established reputations can get away with it.

    Read more...

    Day 152

    Stack

    • Make finally a uniform and nice vim/bspwm/… keybinding system.
    • Learn vim formally, all movements and everything, and get rid of my “vim antipatterns”
    Read more...

    Day 151

    Quotes

    “I’ve come up with a set of rules that describe our reactions to technologies: 1. Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works. 2. Anything that’s invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. 3. Anything invented after you’re thirty-five is against the natural order of things.” — Douglas Adams

    Read more...

    Day 150

    Vim-mediawiki-editor

    vim-mediawiki-editor might make the links wiki fun again for me.

    Read more...

    Day 149

    Scratchpad with the DTB in bspwm

    If it starts appearing on the wrong monitor, I can drag it to the right one, and its location will be remembered.

    Read more...

    Day 148

    Stack

    • I should create additional vim maps for a better way to access other registers. I should create at least one more p/y/yy/d/dd commandd set for them and keep them separatee from the main ones.
      • Or just let vim have it’s own copy/paste registers and make pasting the OS ones a special case
    Read more...

    Day 147

    Quotes

    There are two sorts of comments - “What” comments and “Why” comments.

    “What” comments tell you what the code is doing. In a lot of cases, depending on the language, the need for these can be reduced by writing clear code. This is much easier in, say, Python than Assembly. Even in Python though, sometimes you can be doing something a bit subtle where a 2 line comment can clear things up. These comments aren’t irreplaceable because with a bit of reading and work, you have all the information to work out what is happening.

    “Why” comments are much more important - telling the reader WHY the code is doing whatever it is that it’s doing. The ‘trim()’ comment referenced in the article is a great example of a Why comment - all the reading around the code wouldn’t give you an explanation (although sometimes git blame will).

    Many ‘what’ comments are superfluous, almost no ‘why’ comments are - they are the collective memory of design decisions that otherwise lives in people’s heads. (HN)

    Read more...


Subscribe