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
'use strict'; | |
const theGlobal = typeof window === 'object' ? window : global; | |
const realPromiseConstructor = theGlobal.Promise; | |
const wrappedPromiseConstructor = function (resolve, reject, progress) { | |
const originalPromiseInstance = new realPromiseConstructor(resolve, reject, progress); | |
// Who called us? Let's store it. |
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
defmodule RegexCase do | |
defmacro regex_case(string, do: lines) do | |
new_lines = Enum.map lines, fn ({:->, context, [[regex], result]}) -> | |
condition = quote do: String.match?(unquote(string), unquote(regex)) | |
{:->, context, [[condition], result]} | |
end | |
# Base case if nothing matches; "cond" complains otherwise. | |
base_case = quote do: (true -> nil) | |
new_lines = new_lines ++ base_case |
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
code { background: #f8f8f8; } | |
code .hll { background-color: #ffffcc } | |
code .c { color: #8f5902; font-style: italic } /* Comment */ | |
code .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ | |
code .g { color: #000000 } /* Generic */ | |
code .k { color: #204a87; font-weight: bold } /* Keyword */ | |
code .l { color: #000000 } /* Literal */ | |
code .n { color: #000000 } /* Name */ | |
code .o { color: #ce5c00; font-weight: bold } /* Operator */ | |
code .x { color: #000000 } /* Other */ |
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
#Laste inn datasett | |
attach(arkingdata) | |
#Endre 0 til NA(manglende verdi) | |
erfaringbygg[erfaringbygg$x51==0, "x51"] <-- NA | |
erfaringbygg[erfaringbygg$x52==0, "x52"] <-- NA | |
erfaringbygg[erfaringbygg$x53==0, "x53"] <-- NA | |
erfaringbygg[erfaringbygg$x54==0, "x54"] <-- NA | |
erfaringdel[erfaringdel$x71==0, "x71"] <-- NA |
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
(ns osx | |
(:use seesaw.core) | |
(:import | |
[com.apple.eawt Application ApplicationListener] | |
[java.awt.image BufferedImage])) | |
;; mostly for use with Seesaw | |
;; https://github.com/daveray/seesaw | |
(defn event-not-handled [e] (.setHandled e false)) |