High-level language for text processing and pattern matching. Has C-like syntax and many built-in functions for working with strings.
To better understand, here are some example programs.
/* Display lines between 42 and 666 */
[[ "$TMUX" != "" ]] && TERM=xterm-256color | |
alias tmux='TERM=xterm-256color /usr/bin/tmux' |
/** | |
Compile and run with: gcc float.c -lm && ./a.out | |
Output: | |
Float 13.000000 deconstructed as [+ (1.10100000000000000000000) * 2^3] | |
Float -3.250000 deconstructed as [- (1.10100000000000000000000) * 2^1] | |
Float 0.375000 deconstructed as [+ (1.10000000000000000000000) * 2^-2] | |
Multiplication: [+ (1.00000000000000000000000) * 2^1] * [+ (1.10000000000000000000000) * 2^-2] = [+ (1.10000000000000000000000) * 2^-1] | |
AKA 2.000000 * 0.375000 = 0.750000 | |
Multiplication: [+ (1.10100000000000000000000) * 2^3] * [- (1.10100000000000000000000) * 2^1] = [- (1.01010010000000000000000) * 2^5] | |
AKA 13.000000 * -3.250000 = -42.250000 [got instead -42.250000] |
/* Copyright (c) 2015, Intel Corporation Redistribution and use in source and | |
binary forms, with or without modification, are permitted provided that the | |
following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright notice, | |
this list of conditions and the following disclaimer in the documentation | |
and/or other materials provided with the distribution. | |
* Neither the name of Intel Corporation nor the names of its contributors may |
# Move to root directory... | |
cd / | |
mkdir keys | |
cd keys | |
# Generate a self signed certificate for the CA along with a key. | |
mkdir -p ca/private | |
chmod 700 ca/private | |
# NOTE: I'm using -nodes, this means that once anybody gets | |
# their hands on this particular key, they can become this CA. |
#! /bin/bash | |
# Script that finds connected bluetooth device (must be exactly 1 device!) | |
# and switches between a2dp and hsp (the second option also set default source | |
# to the newly created hsp microphone.) | |
STATE_FILE=~/bt.txt # where to store the state (2 bytes) | |
DEVICE=$(pactl list cards | grep "Name: bluez" | sed "s/[ \t]*Name: //") | |
CUR=$(cat $STATE_FILE) | |
echo "Card: $DEVICE" | |
if [ $CUR = "1" ]; then |
#include <math.h> | |
typedef struct { | |
double x, y, z; | |
} Position3; | |
typedef struct { | |
double l1, l2; | |
double base, j1, j2; |
package com.bekvon.bukkit.residence.text.help; | |
public class PageInfo { | |
private int totalEntries = 0; | |
private int totalPages = 0; //ceil(totalEntries / perPage) | |
private int start = 0; //start index in array | |
private int end = 0; //last accessed index in array (in loop use <=) | |
private int currentPage = 0; |