This file contains hidden or 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 kmr.primes | |
| (:use clojure.set)) | |
| (defn eratos | |
| "Compute all primes below n using Sieve of Eratosthenes." | |
| [n] | |
| (loop [i 2 | |
| sieve (set (range 2 (inc n)))] | |
| (if (> (* i i) n) | |
| sieve | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #!/bin/sh | |
| export DISPLAY=:0 | |
| BATT=$(/usr/bin/awk '/rate/ {rate=$3} \ | |
| /charging state/ {charge=$3} \ | |
| /rem/ { rem=$3 } \ | |
| END { if (charge=="charging") { state="charge" } \ | |
| else if (charge=="charged") { state="full" } \ | |
| else { state=sprintf("%2.1f hr",rem/rate) } \ | |
| printf("%3.1f%% (%s)",rem/50,state) }' \ | 
NewerOlder