I hereby claim:
- I am jonelf on github.
- I am jonelf (https://keybase.io/jonelf) on keybase.
- I have a public key whose fingerprint is 6757 22B3 8909 BCA0 8CF3 2EEB D21C 666E 09FD 0C8B
To claim this, I am signing this object:
++++++++++[>+++++++>++++++++++>++++>+<<<<-]>++.>+.+++++.>--------.<-----.>+++++++++++++.<++++++++.------------.+++++++++++++.>------------.>. |
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
public static void Main(string[] args) |
def histogram(message) | |
message.each_char.reduce(Hash.new(0)) { |h, k| h[k] += 1; h} | |
end | |
def graph_histogram(h) | |
h.to_a. | |
sort_by{|kv| kv[1]*-1}. | |
map{|a| "#{a[0]} |#{('+'*a[1])[0..120]}#{a[1].to_s}\n"}. | |
join | |
end |
(validate-dateTime("yyyyMMdd", left($pnum, 8 ))) | |
and | |
(((number(substring($pnum,3,1))*2) mod 9 + (floor(number(substring($pnum,3,1)) div 9)*9) + (number(substring($pnum,4,1))) + | |
(number(substring($pnum,5,1))*2) mod 9 + (floor(number(substring($pnum,5,1)) div 9)*9) + (number(substring($pnum,6,1))) + | |
(number(substring($pnum,7,1))*2) mod 9 + (floor(number(substring($pnum,7,1)) div 9)*9) + (number(substring($pnum,8,1))) + | |
(number(substring($pnum,9,1))*2) mod 9 + (floor(number(substring($pnum,9,1)) div 9)*9) + (number(substring($pnum,10,1))) + | |
(number(substring($pnum,11,1))*2) mod 9 + (floor(number(substring($pnum,11,1)) div 9)*9) + (number(substring($pnum,12,1))) | |
) mod 10 = 0) |
require 'nokogiri' | |
xml = %{ | |
<Employments> | |
<Employment> | |
<From>2013-01-01</From> | |
<To>1900-01-01</To> | |
<MainEmployment>0</MainEmployment> | |
</Employment> | |
<Employment> | |
<From>2014-11-01</From> |
first, last = "A".ord, "D".ord; | |
rows = (first...last).to_a + last.downto(first).to_a | |
cols = last.downto(first).to_a + (first + 1..last).to_a | |
rows.each do |row| | |
line = cols.map do |col| | |
col == row ? col.chr : "-" | |
end | |
puts line.join |
// Swift Playground example of the Lorenz Attractor | |
// Change platform to OS X when opening Playground. | |
// alt + cmd + enter to show Assistant editor and see resulting image. | |
import Cocoa | |
import XCPlayground | |
let width = 600.0, height = 500.0 | |
class CustomView: NSView { |
func lunhCheck(number : String) -> Bool | |
{ | |
let reversed = reverse(number).map { String($0).toInt()! } | |
return reduce(enumerate(reversed), 0, {(sum, val) in | |
let odd = val.index % 2 == 1 | |
return sum + (odd ? (val.element == 9 ? 9 : (val.element * 2) % 9) : val.element) | |
}) % 10 == 0 | |
} | |
lunhCheck("49927398716") |
func standardDeviation(arr : [Double]) -> Double | |
{ | |
let length = Double(arr.count) | |
let avg = arr.reduce(0, {$0 + $1}) / length | |
let sumOfSquaredAvgDiff = arr.map { pow($0 - avg, 2.0)}.reduce(0, {$0 + $1}) | |
return sqrt(sumOfSquaredAvgDiff / length) | |
} | |
let responseTimes = [ 18.0, 21.0, 41.0, 42.0, 48.0, 50.0, 55.0, 90.0 ] |
I hereby claim:
To claim this, I am signing this object: