Skip to content

Instantly share code, notes, and snippets.

@Zolomon
Zolomon / copy-buffer.el
Last active October 21, 2015 09:55
copy-buffer.el
;; copy buffer
(defun copy-buffer ()
"Copies the whole buffer, without moving the cursor point."
(interactive)
(copy-region-as-kill (point-min) (point-max)))
(defun copy-buffer-with-notification ()
"Copies the whole buffer, without moving the cursor point, and writes upon completion in the minibuffer."
(interactive)
(copy-buffer)
@Zolomon
Zolomon / output
Last active August 29, 2015 14:20
error
C:\Users\zol\code\clojure\xmr.clj (master)
λ lein run
begin
map-problems-to-exam: clojure.lang.LazySeq@4762b6a2
({:exams join-problems-to-exam: {:code "091021", :id 1}
problems
({:examid 1, :updatedat 2014-10-29 18:24:24.000 +00:00, :createdat 2014-10-29 18:24:23.000 +00:00, :index 0, :id 1} {:examid 1, :updatedat 2014-10-29 18:24:24.000 +00:00, :createdat 2014-10-29 18:24:23.000 +00:00, :index 1, :id 2} {:examid 1, :updatedat 2014-10-29 18:24:24.000 +00:00, :createdat 2014-10-29 18:24:23.000 +00:00, :index 2, :id 3} {:examid 1, :updatedat 2014-10-29 18:24:24.000 +00:00, :createdat 2014-10-29 18:24:23.000 +00:00, :index 3, :id 4} {:examid 1, :updatedat 2014-10-29 18:24:24.000 +00:00, :createdat 2014-10-29 18:24:23.000 +00:00, :index 4, :id 5} {:examid 1, :updatedat 2014-10-29 18:24:24.000 +00:00, :createdat 2014-10-29 18:24:23.000 +00:00, :index 5, :id 6} {:examid 1, :updatedat 2014-10-29 18:24:24.000 +00:00, :createdat 2014-10-29 18:24:23.000 +00:00, :index 6, :id 7} {:examid 1, :updatedat 2014-10-29 18:24:2
@Zolomon
Zolomon / lab1.java
Created March 22, 2015 17:33
eda095 lab 1
import java.io.*;
import java.lang.reflect.Array;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
@Zolomon
Zolomon / effect.py
Created March 1, 2015 10:19
Exploring the affect on the effect with different resistors.
for x in range(1, 10):
for y in range(1, 10):
Ri = x # Internal resistor
R = y # Load resistor
Vs = 12 # Internal voltage source
Vri = (Ri/(Ri+R)) * Vs # internal resistor
Vr = (R/(Ri+R)) * Vs # supplied load resistor
Pri = (Vri**2)/Ri # effect on the internal resistor
@Zolomon
Zolomon / colour.clj
Last active August 29, 2015 14:14
Russian Language Quiz Data File
(ns quiz.colour.colour)
(defn clear-screen
([] "\033c")
([text] (str "\033c" text)))
(defn bold
([] "\\e[1m")
([text] (str "\\e[1m" text)))
;; (defn dim
@Zolomon
Zolomon / burgersimulator.java
Created January 7, 2015 15:53
Temporary exam answer for the burger joint simulator
public class Simulation {
public static void Main(String[] args) {
Monitor mon = new Monitor();
ArrayList<Chef> chefs = new ArrayList<Chef>();
ArrayList<Customer> customers = new ArrayList<Customer>();
ArrayList<Seller> sellers = new ArrayList<Seller>();
Customers simulator = new Customers();
Statistics statistics = new Statistics();
for(int i = 0; i < 7; i++) {
@Zolomon
Zolomon / curioustypes.hs
Created November 28, 2014 14:35
Studying for exam in Haskell
func = \f g x -> f (g x)
func2 = \g x -> (.) (g x)
func3 = \g x -> (\g2 x2 -> g x (g2 x2))
f1 = (($)$($))
f2 = (($)($))
@Zolomon
Zolomon / repeater.py
Created August 6, 2014 07:58
Simulate some terminal output
import argparse
import random
import time
class Repeater(object):
def __init__(self, filename, minTimeToNextLine, maxTimeToNextLine):
self.filename = filename
self.minTime = minTimeToNextLine
self.maxTime = maxTimeToNextLine
@Zolomon
Zolomon / faust.scala
Created June 15, 2014 10:55
Adventures in Scala
import java.io._
import com.github.tototoshi.csv.CSVReader
import scala.collection.mutable.ListBuffer
import scala.io.Source
case class Publisher(name: String)
case class Book(isbn: String, publishers: Option[List[Publisher]])
@Zolomon
Zolomon / rearrange.hs
Last active September 21, 2024 04:15
Calculate best rearrange in Discworld MUD.
module Rearrange where
import Control.Applicative
import Data.List
main :: IO ()
main = do
putStrLn $ show (getMaxStats maPo)
data Stats = Stats { str :: Int,