Skip to content

Instantly share code, notes, and snippets.

View aristidb's full-sized avatar

Aristid Breitkreuz aristidb

  • Amsterdam, Netherlands
View GitHub Profile
@aristidb
aristidb / gist:5789059
Created June 15, 2013 18:27
Linux 3.9.6 warnings regarding my Haswell graphics
Jun 15 20:19:09 euphemus kernel: ------------[ cut here ]------------
Jun 15 20:19:09 euphemus kernel: WARNING: at drivers/iommu/dmar.c:483 warn_invalid_dmar+0x8f/0xa0()
Jun 15 20:19:09 euphemus kernel: Hardware name: MS-7823
Jun 15 20:19:09 euphemus kernel: [119B blob data]
Jun 15 20:19:09 euphemus kernel: Modules linked in:
Jun 15 20:19:09 euphemus kernel: Pid: 0, comm: swapper Not tainted 3.9.6 #1
Jun 15 20:19:09 euphemus kernel: Call Trace:
Jun 15 20:19:09 euphemus kernel: [<ffffffff8133eadf>] ? warn_invalid_dmar+0x8f/0xa0
Jun 15 20:19:09 euphemus kernel: [<ffffffff8105263f>] warn_slowpath_common+0x7f/0xc0
Jun 15 20:19:09 euphemus kernel: [<ffffffff810526df>] warn_slowpath_fmt_taint+0x3f/0x50
Debugger entered--Lisp error: (void-function read-only-mode)
(read-only-mode 1)
(save-current-buffer (set-buffer (get-buffer weechat-relay-buffer-name)) (read-only-mode 1) (set-buffer-multibyte nil) (buffer-disable-undo))
(with-current-buffer (get-buffer weechat-relay-buffer-name) (read-only-mode 1) (set-buffer-multibyte nil) (buffer-disable-undo))
weechat-relay-connect("localhost" 9000 (closure ((password . "yvLPc8dZdMMNk-trMUZu") (port . 9000) (host . "localhost") t) nil (weechat-relay-authenticate password) (weechat-relay-send-command "info version" (lambda (data) (message "Connected to '%s', version %s" host (cdar data)) (weechat-update-buffer-list (lambda nil (weechat-relay-send-command "sync") (setq weechat--connected t) (run-hooks (quote weechat-connect-hook))))))))
(progn (weechat-relay-connect host port (lambda nil (weechat-relay-authenticate password) (weechat-relay-send-command "info version" (lambda (data) (message "Connected to '%s', version %s" host (cdar data)) (weechat-update-buffer-
Leaving directory `/home/aristid/.emacs.d/elpa/s-20130216.1611'
Compiling file /home/aristid/.emacs.d/elpa/s-20130216.1611/s-pkg.el at Wed Feb 20 11:59:09 2013
Entering directory `/home/aristid/.emacs.d/elpa/s-20130216.1611/'
Compiling file /home/aristid/.emacs.d/elpa/s-20130216.1611/s.el at Wed Feb 20 11:59:09 2013
Compiling no file at Wed Feb 20 11:59:09 2013
Leaving directory `/home/aristid/.emacs.d/elpa/weechat-20130220'
@aristidb
aristidb / gist:4751790
Created February 11, 2013 01:01
m ^ n mod p
powModPrime_naive :: Word64 -> Word64 -> Word64
powModPrime_naive m n = fromInteger $ (toInteger m ^ toInteger n) `rem` toInteger prime
powModPrime :: Word64 -> Word64 -> Word64
powModPrime m 0 = 1
powModPrime m 1 = m `rem` prime
powModPrime m n = let (q,p) = n `quotRem` 2
k = powModPrime m q
f = if p == 0 then 1 else m
in (k * k * f) `rem` prime
{-# LANGUAGE DeriveFunctor, ScopedTypeVariables, ViewPatterns #-}
module ZipStream where
import Control.Applicative
import Data.Monoid
import Data.Foldable
import Data.Traversable
import Test.QuickCheck
import Test.QuickCheck.Gen
{-# LANGUAGE OverloadedStrings #-}
import qualified Aws
import qualified Aws.S3 as S3
import Data.Conduit (($$+-))
import Data.Conduit.Binary (sinkFile)
import Network.HTTP.Conduit (withManager, responseBody)
import Control.Monad.IO.Class
main :: IO ()
module Aws.Aws
{-( -- * Logging
LogLevel(..)
, Logger
, defaultLog
-- * Configuration
, Configuration(..)
, baseConfiguration
, dbgConfiguration
-- * Transaction runners
module Git where
import Data.ByteString
import Data.Time
import qualified Data.Map as M
-- | Objects that are stored in the git storage by SHA1. Just a dummy class in this demonstration.
class Storable a
newtype Object = Object { objectData :: ByteString }
{-# LANGUAGE DeriveFunctor #-}
module ZipStream where
import Control.Applicative
data ZipStream a = ZipStream {headZ :: a, tailZ :: ZipStream a}
deriving (Functor)
-- Just give a taste...
; ELPA
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(defvar preload-packages '())
(setq preload-packages
'(
auctex