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
;; 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) |
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
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 |
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
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; | |
/** |
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
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 |
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
(ns quiz.colour.colour) | |
(defn clear-screen | |
([] "\033c") | |
([text] (str "\033c" text))) | |
(defn bold | |
([] "\\e[1m") | |
([text] (str "\\e[1m" text))) | |
;; (defn dim |
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
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++) { |
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
func = \f g x -> f (g x) | |
func2 = \g x -> (.) (g x) | |
func3 = \g x -> (\g2 x2 -> g x (g2 x2)) | |
f1 = (($)$($)) | |
f2 = (($)($)) |
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
import argparse | |
import random | |
import time | |
class Repeater(object): | |
def __init__(self, filename, minTimeToNextLine, maxTimeToNextLine): | |
self.filename = filename | |
self.minTime = minTimeToNextLine | |
self.maxTime = maxTimeToNextLine |
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
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]]) |
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
module Rearrange where | |
import Control.Applicative | |
import Data.List | |
main :: IO () | |
main = do | |
putStrLn $ show (getMaxStats maPo) | |
data Stats = Stats { str :: Int, |