- 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 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 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 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 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.08; | |
sub say { | |
print @_, "\n"; | |
} | |
say("Hello"); |
This file contains 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
/** | |
* Arcs example | |
*/ | |
html { | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height:100%; | |
} | |
svg { |
This file contains 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
/** | |
* Text in path example | |
*/ | |
html { | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height:100%; | |
} | |
svg { |
This file contains 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 <QtCore/QtCore> | |
#include <QtCore/QCoreApplication> | |
#include <QtCore/QByteArray> | |
#include <QtCore/QDebug> | |
#include <QtCore/QLatin1Char> | |
int main(int argc, char **argv) | |
{ | |
QCoreApplication app(argc, argv); | |
static const char mydata[] = { |
This file contains 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
<?php | |
header('Content-Type: application/json' ); | |
$a = array(10, 20, 30); | |
print json_encode($a); |
This file contains 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
function Counter(max) { | |
var val = 0; | |
return function() { return (val < max) ? val++ : false; } ; | |
} | |
var c = Counter(10); | |
while (c()) { | |
console.log(c()); | |
} |