This file contains 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
film42@mbp /usr/bin % brew install valgrind -v | |
==> Downloading http://valgrind.org/downloads/valgrind-3.7.0.tar.bz2 | |
Already downloaded: /Library/Caches/Homebrew/valgrind-3.7.0.tar.bz2 | |
/usr/bin/tar xf /Library/Caches/Homebrew/valgrind-3.7.0.tar.bz2 | |
==> ./configure --prefix=/usr/local/Cellar/valgrind/3.7.0 --mandir=/usr/local/Cellar/valgrind/3.7.0/share/man --enable-only64bit --build=amd64-darwin | |
./configure --prefix=/usr/local/Cellar/valgrind/3.7.0 --mandir=/usr/local/Cellar/valgrind/3.7.0/share/man --enable-only64bit --build=amd64-darwin | |
checking for a BSD-compatible install... /usr/bin/install -c | |
checking whether build environment is sane... yes | |
checking for a thread-safe mkdir -p... ./install-sh -c -d | |
checking for gawk... no |
This file contains 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
package main | |
import ( | |
"fmt" | |
"http" | |
"io/ioutil" | |
"os" | |
) | |
func main() { |
This file contains 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
var App = Ember.Application.create({ | |
}); | |
App.ThoughtsController = Ember.ArrayController.extend({ | |
init: function () { | |
var that = this; | |
setInterval(function() { | |
that.set("content", App.Thought.find({hack:"hack"})); |
This file contains 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Project Euler Problem 30 ;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Perform n^p | |
(defn pow [n p] | |
(reduce * (repeat p n))) | |
;; Convert a number to a set | |
(defn number-to-set [n] |
This file contains 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
64 bytes from 74.125.239.104: icmp_seq=13110 ttl=55 time=40.722 ms | |
64 bytes from 74.125.239.104: icmp_seq=13111 ttl=55 time=39.809 ms | |
64 bytes from 74.125.239.104: icmp_seq=13112 ttl=55 time=39.896 ms | |
64 bytes from 74.125.239.104: icmp_seq=13113 ttl=55 time=40.093 ms | |
64 bytes from 74.125.239.104: icmp_seq=13114 ttl=55 time=37.391 ms | |
64 bytes from 74.125.239.104: icmp_seq=13115 ttl=55 time=39.613 ms | |
64 bytes from 74.125.239.104: icmp_seq=13116 ttl=55 time=43.986 ms | |
64 bytes from 74.125.239.104: icmp_seq=13117 ttl=55 time=39.911 ms | |
64 bytes from 74.125.239.104: icmp_seq=13118 ttl=55 time=38.396 ms | |
64 bytes from 74.125.239.104: icmp_seq=13119 ttl=55 time=37.916 ms |
This file contains 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 Counter { | |
private int[] seq = null; | |
public Counter(int size) { | |
this.seq = new int[size]; | |
} | |
public Counter() { | |
this.seq = new int[10]; |
This file contains 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
package servertester.modules; | |
import java.io.*; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: film42 |
This file contains 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
(defn power-of [x n] | |
(loop [i 0, acc 1] | |
(if (not (< i n)) | |
acc | |
(recur (inc i) (* acc x))))) | |
(def thousand (range 1 1001)) | |
(def big-thousand (map #(power-of (bigint %1) 5) hundred)) | |
(print (reduce * big-thousand)) |
This file contains 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
val cipher = Map('a' -> 'а', 'b' -> 'б', 'c' -> 'ц', 'd' -> 'д', 'e' -> 'е', 'f' -> 'ф', 'g' -> 'г', | |
'h' -> 'ч', 'i' -> 'и', 'j' -> 'й', 'k' -> 'к', 'l' -> 'л', 'm' -> 'м', 'n' -> 'н', | |
'o' -> 'о', 'p' -> 'п', 'q' -> 'я', 'r' -> 'р', 's' -> 'с', 't' -> 'т', 'u' -> 'у', | |
'v' -> 'в', 'w' -> 'ш', 'x' -> 'х', 'y' -> 'ы', 'z' -> 'з', ' ' -> '@') | |
lazy val reverse_cipher = cipher.map(_.swap) | |
def encrypt(word: String) = | |
word.flatMap(x => cipher(x.toLower).toString) | |
This file contains 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
;; | |
;; Checkout this page for large prime numbers: http://primes.utm.edu/lists/small/small3.html | |
;; | |
;; Testing a 300 digit prime number | |
(def some-large-prime 290245329165570025116016487217740287508837913295571609463914348778319654489118435855243301969001872061575755804802874062021927719647357060447135321577028929269578574760547268310055056867386875959045119093967972205124270441648450825188877095173754196346551952542599226295413057787340278528252358809329N) | |
(is-prime? some-large-prime) ;;=> true || Elapsed time: 216.512 msecs | |
;; Testing a long even number | |
(def some-long-even-number 709127341927349283740927349823749237492734092873492842N) |
OlderNewer