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 buster = require("buster"); | |
function include(path) { | |
var fs = require("fs"); | |
var vm = require("vm"); | |
var code = fs.readFileSync(path, "utf-8"); | |
vm.runInThisContext(code, path); | |
} | |
include("js/utils/object.js"); |
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 tsearch.core | |
(:require [clojure.java.io :as cjio]) | |
(:require [tsearch.scanner :as scanner]) | |
(:require [tsearch.lexer :as lexer]) | |
(:gen-class)) | |
(defn occurrences-of [file] | |
(with-open [rdr (cjio/reader file)] | |
(loop [lines (line-seq rdr) hmap (hash-map)] | |
(if (empty? lines) |
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 tsearch.lexer | |
(:require [clojure.string :as cjstr])) | |
(def a (Character/getNumericValue \a)) | |
(def z (Character/getNumericValue \z)) | |
(def A (Character/getNumericValue \A)) | |
(def Z (Character/getNumericValue \Z)) | |
(def zero (Character/getNumericValue \0)) | |
(def nine (Character/getNumericValue \9)) |
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
import System.Directory ( getDirectoryContents, doesFileExist, doesDirectoryExist ) | |
import System.Environment ( getArgs ) | |
import System.FilePath | |
import Control.Monad ( forM_, filterM ) | |
import Data.Char ( isAscii, isAlphaNum, toLower ) | |
import qualified Data.Map as Map | |
getDirectoryEntries :: FilePath -> IO ([FilePath], [FilePath]) | |
getDirectoryEntries path = do | |
entries <- getDirectoryContents path |
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
import QtQuick 1.0 | |
Rectangle { | |
id: root | |
width: 1024 | |
height: 768 | |
Image { | |
source: "images/mtsis_tela_balanca_1024.png" | |
fillMode: Image.PreserveAspectFit |
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 is-ascii-alpha-num [c] | |
(let [n (Character/getNumericValue (char c))] | |
(or (and (>= n (char-val \a)) (<= n (char-val \z))) | |
(and (>= n (char-val \A)) (<= n (char-val \Z))) | |
(and (>= n (char-val \0)) (<= n (char-val \9))))) |
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
import System.Environment | |
import Text.Printf | |
main = do | |
[d] <- map read `fmap` getArgs | |
printf "%f\n" (mean [1..d]) | |
mean :: [Double] -> Double | |
mean xs = {-# SCC "mean" #-} sum xs / fromIntegral (length xs) |
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
/** | |
* @file linux-rapl.c | |
* @author Vince Weaver | |
* | |
* @ingroup papi_components | |
* | |
* @brief rapl component | |
* | |
* This component enables RAPL (Running Average Power Level) | |
* energy measurements on Intel SandyBridge/IvyBridge/Haswell |
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
SAMPLE 0 | |
Start package energy: 68014.492 J | |
End package energy: 117772.400 J | |
Aproximate duration: 336 s | |
SAMPLE 1 | |
Start package energy: 52383.802 J | |
End package energy: 81000.144 J | |
Aproximate duration: 194 s |
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
import Control.Concurrent | |
import Control.Monad | |
import Control.Monad.Trans.Maybe | |
import Control.Monad.Trans.Class | |
type Fork = MVar Int | |
newFork :: Int -> IO Fork | |
newFork i = newMVar i |
OlderNewer