Skip to content

Instantly share code, notes, and snippets.

View mrkn's full-sized avatar
:octocat:

Kenta Murata mrkn

:octocat:
View GitHub Profile
# plotting colormap
xs <- 1:100
ys <- 1:100
zs <- sapply(xs, function (x) { sapply(ys, function (y) { sin(x/(2*pi)) + cos(y/(2*pi)) }) })
z.range <- c(min(zs), max(zs))
default.par <- par(no.readonly=TRUE)
layout(matrix(c(1, 2), 2, 2, byrow=TRUE), c(1, 0.12))
par(mar=c(default.par$mar[1], default.par$mar[2], default.par$mar[3], 1))
image(xs, ys, zs)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
unsigned long long
choose_i(unsigned long const n, unsigned long const r, unsigned long long* const memo)
{
#define index_(n_, r_) ((r_)+(n_)*((n_)+1)/2)
if (r > n)
return 0;
#include <iostream>
template<bool cond, class THEN, class ELSE>
struct if_
{
typedef ELSE type;
};
template<class THEN, class ELSE>
struct if_<true, THEN, ELSE>
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.IOException;
// Affine
public class Affine1 extends MIDlet
{
public Affine1()
// PixelData.java
import javax.microedition.lcdui.*;
public class PixelData {
private int[] pixels;
private int width;
private int height;
private PixelData(int[] pixels, int width, int height)
require 'rubygems'
require 'active_ldap'
ActiveLdap::Base.setup_connection(
:host => 'example.com',
:port => 389,
:base => 'dc=example,dc=com',
:bind_dn => 'cn=admin,dc=example,dc=com',
:password_block => Proc.new{'secret'},
:allow_anonymous => false
{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.IO
-- Copyright : (c) The University of Glasgow 2002
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : provisional
{-# OPTIONS_GHC -XNoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.IO
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : stable
-- Portability : portable
\begin{code}
{-# OPTIONS_GHC -XNoImplicitPrelude -funbox-strict-fields #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.IOBase
-- Copyright : (c) The University of Glasgow 1994-2002
-- License : see libraries/base/LICENSE
--
-- Maintainer : cvs-ghc@haskell.org