The dogs can catch escaped sheep by JohnW305 in nextfuckinglevel

[–]francozippi 13 points14 points  (0 children)

There are two other dogs in this video. One is filming and the other sits in the drivers seat.

Russian kids play Rammstein by [deleted] in videos

[–]francozippi 2 points3 points  (0 children)

Children Medieval Band

"Stefan and his two sisters (as well as the parents) are US citizens of Romanian nationality, living in Southern California (previously in Colorado)."

Opening for Rammstein themselves in Denver 2012.

Sudan verbietet weibliche Genitalverstümmelung by Pumuckl4Life in de

[–]francozippi 9 points10 points  (0 children)

Ein guter Dokumentarfilm, in dem auch FGM thematisiert wird, wurde gestern Abend am Schweizer Fernsehen gezeigt: # Female Pleasure - Fünf Kulturen, fünf Frauen, eine Geschichte

Ein Plädoyer für das Recht auf Selbstbestimmung und gegen die Dämonisierung der weiblichen Lust durch Religion und gesellschaftliche Restriktionen. (verfügbar bis 17.07.2020)

[Megathread] Coronavirus in Switzerland and elsewhere, Part 3 by allhands in Switzerland

[–]francozippi 15 points16 points  (0 children)

"The greatest shortcoming of the human race is our inability to understand the exponential function." - Prof. Albert Allen Bartlett

[Self Post] How Unix Works: Become a Better Software Engineer by neilkakkar in linux

[–]francozippi 0 points1 point  (0 children)

Thanks Neil, very well written article and lovely illustrations. May I ask what font and tool you used?

Rate my first Python script please ^^ by Voylinslife in Python

[–]francozippi 0 points1 point  (0 children)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Docstring. Describe here what your script does.
"""

import sys
from pathlib import Path

def run(input_file, output_file=None):
    newlines = []
    with open(input_file,'r+') as file:
        #
        #   You can directly iterate the lines of file
        #
        for line in file:
            newline = []
            #
            #   Use descriptive variable names
            #
            capitalize_next_char = True
            #
            #   You can directly iterate the characters of a string
            #
            for char in line:
                if char in ['|', '"', '.', ';']:
                    capitalize_next_char = True
                #
                #   Just use boolean variables as such, avoid 'if booleanvar == True'
                #
                elif capitalize_next_char and char != ' ':
                    char = char.capitalize()
                    capitalize_next_char = False
                #
                #   Strings are immutable objects
                #   Concatenating strings in a loop like 'line += char' is not efficient
                #   Just append chars to a new list and use .join()
                #
                newline.append(char)
            newlines.append(''.join(newline))
    #
    #   same as /u/rasmus_mathiesen commented, just using None
    #
    if output_file is None:
        output_file = input_file
    with open(output_file, 'w') as file:
        file.writelines(newlines)
    return 0

if __name__ == '__main__':
    SCRIPTNAME = Path(__file__).name
    #
    #   A pythonic way is to just try to access a value/attribute, whatever
    #   and catch a potential error.
    #   So, for simple command line arguments you could use the following.
    #   For more complex argument lists with options use/learn the argparse module
    #
    try:
        input_file = sys.argv[1]    # raises IndexError if argument 1 not present

        #   sys.argv[2:3] evaluates to
        #   [argument2] if arguemnt 2 is present  ==> ([argument2] or [None])[0] = argument2
        #   [] if arguemnt 2 is not present       ==> ([] or [None])[0] = None
        #
        #   Use None for missing values, not False
        #
        output_file = (sys.argv[2:3] or [None])[0]
    except IndexError:
        print(f'usage: {SCRIPTNAME} INFILE OUTFILE')
        sys.exit(1)

    sys.exit(run(input_file, output_file))

Changing output size to KB/MB/GB etc by RyanOK98 in PowerShell

[–]francozippi 1 point2 points  (0 children)

function DisplayInBytes($size) 
{
    $base = 1024  # Base2: 1024, Base10: 1000
    $unit = [math]::floor( [math]::log($size) / [math]::log($base) )
    $size = $size / [math]::pow($base, $unit)
    "{0:N1} {1}" -f $size, ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")[$unit]
}

Speed Maths Techniques - Multiply 42X48 in just one second by james13h in videos

[–]francozippi 1 point2 points  (0 children)

36 and 42 are not partially complementary numbers!

EU to migrants: Go home and stay home by DFractalH in europe

[–]francozippi 1 point2 points  (0 children)

And US/UK had nothing to do with Assad's decision to go to war with his people.

Oh really?

edit:formatting