- Take a directory name and a file name. Create the directory and then create the file inside.
- Take a user name and print all processes from that user
- Write a shell script that reads a file name from the user, prints its contents and the number of lines in the file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <QCoreApplication> | |
| #include "range.h" | |
| #include <QDebug> | |
| #include <QtCore> | |
| #include <QtConcurrent> | |
| static const char ab[] = "0123456789abcdefghijklmnopqrstuvwxyz"; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns clojure-noob.core | |
| (:gen-class)) | |
| (require 'digest) | |
| (defn exp [x n] | |
| (reduce * (repeat n x))) | |
| (defn char_at [ab i d] | |
| (ab (rem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env csh -f | |
| # Also supported: <, >, <=, >= | |
| if ( $# > 2 ) echo "So many arguments" | |
| # Also supported: +, -, *, / | |
| if ( $# % 2 == 0 ) echo "Can also use math" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use Mojolicious::Lite; | |
| use Mojo::Util qw/b64_encode b64_decode/; | |
| use DBI; | |
| my $database = 'tinyurl.db'; | |
| my $data_source = "dbi:SQLite:dbname=$database"; | |
| my $dbh = DBI->connect( | |
| $data_source, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "mainwindow.h" | |
| #include <QApplication> | |
| #include <QtWidgets> | |
| void createFirstRow(QVBoxLayout *top) | |
| { | |
| QGroupBox *box = new QGroupBox(); | |
| QPushButton *b1 = new QPushButton("One", box); | |
| QPushButton *b2 = new QPushButton("Two", box); | |
| QPushButton *b3 = new QPushButton("Three", box); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| myapp/ | |
| ├── lib | |
| │ ├── File | |
| │ │ └── Slurp.pm | |
| │ ├── MyModule.pm | |
| │ └── Try | |
| │ └── Tiny.pm | |
| └── run.pl | |
| 3 directories, 4 files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Critter; | |
| use strict; | |
| use warnings; | |
| use v5.18; | |
| # Critter | |
| our $VERSION = '1.00'; | |
| # | |
| # Inheritance | |
| # our @ISA = qw/Animal/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use strict; | |
| use warnings; | |
| use v5.18; | |
| my %anagrams; | |
| sub anagram { | |
| my ( $word ) = @_; | |
| my @letters = sort split //, $word; | |
| $anagrams{"@letters"}; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #------------------------------------------------- | |
| # | |
| # Project created by QtCreator 2014-08-26T10:07:27 | |
| # | |
| #------------------------------------------------- | |
| QT += core gui | |
| greaterThan(QT_MAJOR_VERSION, 4): QT += widgets |