Skip to content

Instantly share code, notes, and snippets.

View PetrGlad's full-sized avatar
🚶‍♂️
.

Petr Gladkikh PetrGlad

🚶‍♂️
.
  • 05:27 (UTC +04:00)
View GitHub Profile
anonymous
anonymous / nn.clj
Created March 24, 2013 16:55
A neural network in Titan and Clojure implementing the xor function
(ns martha.core
(:require [clojurewerkz.titanium.graph :as g]
[clojurewerkz.titanium.vertices :as v]
[clojurewerkz.titanium.edges :as e]
[clojurewerkz.titanium.types :as t]
[ogre.core :as q]))
(def conf {:storage {:backend "embeddedcassandra"
:hostname "127.0.0.1"
:keyspace "martha"
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@danstuken
danstuken / gist:3625841
Last active February 8, 2021 11:43
Batch Convert XCF to JPEG in GIMP
(define (script-fu-xcf2jpg-batch xcfDirectory inQuality)
(let* ((xcfList (cadr (file-glob (string-append xcfDirectory "/*.xcf") 1))))
(while (not (null? xcfList) )
(let* ((xcfFilename (car xcfList))
(jpgFilename (string-append (substring xcfFilename 0 (- (string-length xcfFilename) 4) ) ".jpg"))
(xcfImage (car (gimp-file-load RUN-NONINTERACTIVE xcfFilename xcfFilename)))
(xcfDrawable (car (gimp-image-flatten xcfImage))) )
(file-jpeg-save RUN-NONINTERACTIVE xcfImage xcfDrawable jpgFilename jpgFilename
inQuality 0.0 0 0 "" 0 1 0 2)
)
@swannodette
swannodette / gist:1141252
Created August 12, 2011 01:33
patjava.clj
(ns match.java
(:refer-clojure :exclude [compile])
(:use [match.core]))
(extend-type java.util.Date
IPLookup
(p-val-at [this key]
(case key
:year (.getYear this)
:month (.getMonth this)
anonymous
anonymous / simple_rgb_cube.clj
Created October 25, 2009 03:22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Simple 3d Clojure code example for Incanter and Processing
; Adapted by James Swift (james at 3dengineer com)
; from the simple_interation.clj example that comes with incanter
; and the RGB cube example here http://processing.org/learning/3d/rgbcube.html
(ns example
(:use [incanter core processing]))
;; set up variable references to use in the sketch object