Skip to content

Instantly share code, notes, and snippets.

(defun isInteger (n)
(= (round n) n))
(defun isPentagonalNumber (p)
(let ((solution (/ (+ 1 (sqrt (+ 1 (* 24 p)))) 6)))
(isInteger solution)))
(defun test (p)
(/ (+ 1 (sqrt (+ 1 (* 24 p)))) 6))
(defun test (p)
(/ (+ 1 (sqrt (+ 1 (* 24 p)))) 6))
dev-java/sun-jre-bin
$ java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.1) (Gentoo build 1.6.0_18-b18)
OpenJDK Server VM (build 16.0-b13, mixed mode)
philip@philip-VirtualBox:~/tmp$ cake new test
[new] Creating a new project based on ~/.cake/templates/default
[new] Copying 4 files to /home/philip/tmp/test
[new] Copied 4 empty directories to 1 empty directory under /home/philip/tmp/test
[new] Renaming directories with +project+ in their name
[new] Replacing +project+ with 'test' in all files.
philip@philip-VirtualBox:~/tmp$ cd test
philip@philip-VirtualBox:~/tmp/test$ vim project.clj
philip@philip-VirtualBox:~/tmp/test$ cat project.clj
(defproject test "0.0.1-SNAPSHOT"
philip@philip-VirtualBox:~/tmp$ cake new test
[new] Creating a new project based on ~/.cake/templates/default
[new] Copying 4 files to /home/philip/tmp/test
[new] Copied 4 empty directories to 1 empty directory under /home/philip/tmp/test
[new] Renaming directories with +project+ in their name
[new] Replacing +project+ with 'test' in all files.
philip@philip-VirtualBox:~/tmp$ cd test/
philip@philip-VirtualBox:~/tmp/test$ cake -v
[cake] running from git checkout
[start] starting cake jvm
uint32_t l2b32 (uint32_t x)
{
uint8_t *p = &x;
return p[0] + p[1] << 8 + p[2] << 16 + p[3] << 24;
}
uint2_t b2l32_t (uint32_t x)
{
uint8_t *p = &x;
return p[3] + p[2] << 8 + p[1] << 16 + p[0] << 24;
#ifndef FRAGMENT_PROGRAM_H
#define FRAGMENT_PROGRAM_H
//
// Graphics Framework.
// Copyright (C) 2007 Department of Computer Science, University of Copenhagen
//
#include <iostream>
#include <iomanip>
#include "graphics/graphics.h"
#include <cmath>
(require :bordeaux-threads)
(defparameter *tmp* nil)
(defun threadfun ()
(declare (ignorable *tmp*))
(princ "printing *tmp*")
(print *tmp*)
(finish-output)
*tmp*)
(require :bordeaux-threads)
(defparameter *tmp* 40)
(defun threadfun ()
(format t "*tmp*: ~A~%" *tmp*))
(defun bob ()
(let* ((bordeaux-threads:*default-special-bindings*
(acons '*tmp* 42