+RTS -N1 -RTS
2.31s, 36% CPU, 108128 bytes of memory
+RTS -N8 -RTS
8.42s, 423% CPU, 131308 bytes of memory
Why does increasing the core count from 1 to 8 cause such drastic rise in CPU usage?
; Using a Joystick as a Mouse | |
; http://www.autohotkey.com | |
; This script converts a joystick into a three-button mouse. It allows each | |
; button to drag just like a mouse button and it uses virtually no CPU time. | |
; Also, it will move the cursor faster depending on how far you push the joystick | |
; from center. You can personalize various settings at the top of the script. | |
; Increase the following value to make the mouse cursor move faster: | |
JoyMultiplier = 30 | |
JoyWheelMultiplier = 50 |
// http://jsfiddle.net/hfn5w1je/1/ | |
// TODO step through instructions on key press | |
// TODO step through program on timer | |
// TODO highlight the next instruction and components (a, b, c, true, false) | |
// TODO highlight jumps | |
// TODO dynamically resize memory | |
// TODO compress memory representation via run-length encoding | |
// TODO add I/O capabilities (e.g. keyboard and terminal view) |
--proof that 8 >= 2 | |
eight_GTE_two : 8 `GTE` 2 | |
eight_GTE_two = proof search | |
--proof that 8 >= 3 | |
eight_GTE_three : 8 `GTE` 3 | |
eight_GTE_three = proof search | |
--this doesn't work since it fails with the error "Can't solve goal LTE 2 1" (GTE is defined in terms of LTE in Idris) | |
--one_GTE_two : 1 `GTE` 2 |
{-# LANGUAGE LambdaCase #-} | |
import Data.List | |
import Text.Parsec.Prim hiding ((<|>), many) | |
import Text.Parsec.Expr | |
import Text.Parsec.Pos | |
import Text.Parsec.Combinator | |
import Text.Parsec.Error | |
import Data.Functor | |
import Data.Functor.Identity |
from PIL import Image | |
from PIL import ImageDraw | |
from PIL import ImageFont | |
from PIL import ImageEnhance | |
# pip install Pillow | |
def render(text, filename): | |
width=128 | |
height=128 |
# Your keymap | |
# | |
# Atom keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# |
{-# LANGUAGE OverloadedStrings #-} | |
module AFoo where | |
import qualified Database.Bloodhound as B | |
import Network.HTTP.Client (defaultManagerSettings) | |
import Control.Monad | |
import Control.Lens ((^.), (^?), (^..)) | |
import Data.Aeson | |
import Data.Aeson.Lens |
import Streaming | |
import qualified Streaming.Prelude as S | |
import Streaming.Prelude (next, yield, each) | |
import Control.Concurrent hiding (yield) | |
import Control.Concurrent.Async | |
import qualified Control.Concurrent.SSem as Sem | |
main :: IO () | |
main = return () |
+RTS -N1 -RTS
2.31s, 36% CPU, 108128 bytes of memory
+RTS -N8 -RTS
8.42s, 423% CPU, 131308 bytes of memory
Why does increasing the core count from 1 to 8 cause such drastic rise in CPU usage?
#!/usr/bin/env stack | |
{- | |
stack | |
--resolver lts-10.4 | |
--install-ghc | |
script | |
--package temporary | |
--package megaparsec | |
--package rainbow | |
--package typed-process |