Note that there are some explanatory texts on larger screens.

plurals
  1. USChristopher Bottoms
    text
    copied!<p>I use Python, Perl 6, Perl, R, Java, bash, and anything else that is needed.</p> <p>Utilizo Python, Perl 6, Perl, R, Java, bash, o lo que sea necesario. </p> <p><a href="http://stackoverflow.com/a/28481250/215487">A good explanation of creating good reproducible R questions</a></p> <p><a href="http://stackoverflow.com/questions/15289995/how-to-get-help-in-r/15290370#15290370">How to get help in R</a></p> <hr> <h1>Comparison of Python 3 and Perl 6 (both very nice languages)</h1> <h2>Python 3: find common lines between two files, regardless of the order:</h2> <pre><code>#!/bin/env python import argparse parser = argparse.ArgumentParser(description='Determine the lines in common between two files') parser.add_argument('fileA', help='file name') parser.add_argument('fileB', help='file name') args = parser.parse_args() with open(args.fileA) as x: linesA = x.readlines() with open(args.fileB) as x: linesB = x.readlines() intersection = set(linesA).intersection(set(linesB)) print("".join(sorted(intersection))) </code></pre> <p>Usage message resulting from <code>python intersection_of_lines.py --help</code>:</p> <pre><code>usage: intersection_of_lines.py [-h] fileA fileB Determine the lines in common between two files positional arguments: fileA file name fileB file name optional arguments: -h, --help show this help message and exit </code></pre> <h2>Perl 6: find common lines between two files, regardless of the order:</h2> <pre><code>#!/bin/env perl6 sub MAIN #= Determine the lines in common between two files ( $fileA, #= file name $fileB, #= file name ) { my @linesA = $fileA.IO.lines; my @linesB = $fileB.IO.lines; my $intersection = @linesA ∩ @linesB; put $intersection.keys.sort.join("\n"); } </code></pre> <p>Yes that is <code>∩</code>, a real intersection symbol, thanks to Unicode support. You can also use <code>(&amp;)</code> for intersection, if your editor has issues with Unicode. </p> <p>You also get a nice usage message resulting from <code>perl6 intersection_of_lines.p6 --help</code>:</p> <pre><code>Usage: ./intersection_of_lines.p6 &lt;fileA&gt; &lt;fileB&gt; -- Determine the lines in common between two files &lt;fileA&gt; file name &lt;fileB&gt; file name </code></pre> <hr> <h1>Perl 6 tidbits</h1> <p>Perl 6 is a very clean, concise, understandable language. It is a new language (not just a different version of Perl). Its design pulls from the strengths of other languages. </p> <p><a href="http://blogs.perl.org/users/zoffix_znet/2016/01/perl-6-rotor-the-king-of-list-manipulation.html" rel="nofollow noreferrer">Perl 6's <code>rotor</code> (the "king of list manipulation")</a>.</p> <p><a href="http://www.0racle.info/articles/perl_6_on_rails" rel="nofollow noreferrer">Error handling example</a>.</p> <h2>SLURM</h2> <p>Passing environment variables to SLURM: <a href="https://stackoverflow.com/questions/45592730">Passing SLURM batch command line arguments to R</a></p> <p><code>sbatch --export=GREETING=Hello,PLACE=world --wrap='echo "$GREETING $PLACE" &gt; howdy.txt'</code></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload