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
{-# LANGUAGE TemplateHaskell #-} | |
module MatrixDemo where | |
import Control.Lens | |
-- | Represents a matrix with the contents stored in row major order. | |
-- Note that we get equality, ability to read a Matrix from a stream | |
-- as well as write it to a stream for free by deriving (Eq,Read,Show). | |
data Matrix = Matrix { _numRows :: Int | |
, _numColumns :: Int |
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
" Turn on syntax highlighting... | |
syn on | |
" Turn on file type detection... | |
filetype on | |
filetype plugin indent on | |
" Set up default settings... | |
set autoindent | |
set expandtab |
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
(setq make-backup-files nil) | |
(electric-indent-mode t) | |
(setq auto-save-interval 0) | |
(setq transient-mark-mode nil) | |
(setq visible-bell 1) | |
(iswitchb-mode 1) | |
(auto-compression-mode 1) | |
;; Give buffers unique names when there are 2 with the same name... | |
(require 'uniquify) |
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 <errno.h> | |
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
void signal_handler_function(int signo); | |
typedef void (*sighandler_t)(int); | |
int main() |
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
// Examples of EINTR handling for reentrant functions. | |
#include <errno.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
//m=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | |
// Open can be interupted when blocked, waiting for a slow device such as a |
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
<?php | |
session_start(); | |
header("Content-Type: text/html"); | |
$errors = array(); | |
// Reset form. | |
if(array_key_exists('clearForm', $_POST)) | |
{ | |
unset($_SESSION); |
NewerOlder