Skip to content

Instantly share code, notes, and snippets.

[ 652.587523] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[ 652.587531] ata1.00: failed command: SMART
[ 652.587537] ata1.00: cmd b0/d0:01:00:4f:c2/00:00:00:00:00/00 tag 10 pio 512 in
res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
[ 652.587540] ata1.00: status: { DRDY }
[ 652.587545] ata1: hard resetting link
[ 657.923282] ata1: link is slow to respond, please be patient (ready=0)
[ 660.431130] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 660.431533] ACPI Error: [DSSP] Namespace lookup failure, AE_NOT_FOUND (20150619/psargs-359)
[ 660.431539] ACPI Error: Method parse/execution failed [\_SB_.PCI0.SAT0.SPT0._GTF] (Node ffff8802160b3f00), AE_NOT_FOUND (20150619/psparse-536)
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
@luisgabriel
luisgabriel / out.txt
Last active August 29, 2015 14:23
overflow-test output
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
@luisgabriel
luisgabriel / linux-rapl.c
Created May 19, 2015 20:42
PAPI RAPL code
/**
* @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
@luisgabriel
luisgabriel / Main.hs
Last active August 29, 2015 14:10
RTS+CCS crash
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)
(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)))))
@luisgabriel
luisgabriel / view.qml
Last active December 26, 2015 05:29 — forked from renatooliveira/app.py
import QtQuick 1.0
Rectangle {
id: root
width: 1024
height: 768
Image {
source: "images/mtsis_tela_balanca_1024.png"
fillMode: Image.PreserveAspectFit
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
(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))
(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)