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
class JobInfo | |
def get_bld (job) | |
id = job.references.find { |r| r.kind_of?(DFHack::GeneralRefBuildingHolderst) } | |
bld = df.world.buildings.all.binsearch(id.building_id) if id | |
bld | |
end | |
def self.const_labor (l) | |
lambda {|job| return l} | |
end |
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
HAUL_ITEM, /* BAR */ | |
HAUL_ITEM, /* SMALLGEM */ | |
HAUL_ITEM, /* BLOCKS */ | |
HAUL_ITEM, /* ROUGH */ | |
HAUL_STONE, /* BOULDER */ | |
HAUL_WOOD, /* WOOD */ | |
HAUL_FURNITURE, /* DOOR */ | |
HAUL_FURNITURE, /* FLOODGATE */ | |
HAUL_FURNITURE, /* BED */ | |
HAUL_FURNITURE, /* CHAIR */ |
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
def is_tree_seed? (item) | |
if (!item.instance_of? DFHack::ItemSeedsst) | |
return false | |
end | |
if (item.mat_type < 419 || item.mat_type > 618) | |
return false | |
end | |
mat = df.world.raws.plants.all[item.mat_index] |
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
module Main where | |
import Char | |
import Data.List | |
import Text.JSON | |
import System ( getArgs ) | |
data RGBColor = RGB Double Double Double deriving (Show, Eq) | |
data XYZColor = XYZ Double Double Double deriving (Show, Eq) |
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
module Main where | |
import qualified Data.Text as T | |
import qualified Text.Regex.PCRE.Light as R | |
import qualified Data.ByteString.Char8 as B | |
import qualified Data.Map as Map | |
import Control.Monad.State | |
import Control.Monad (liftM) |
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
-- new and improved! | |
import Control.Applicative ((<|>)) | |
import Data.Maybe (catMaybes) | |
nfilter n k = cycle $ take n $ (Just k) : (repeat Nothing) | |
joinf Nothing Nothing = Nothing | |
joinf Nothing (Just a) = Just a | |
joinf (Just a) Nothing = Just a |
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
drawTriangle size c s = | |
concat (map line [0..size-1]) | |
where line i = map (charAt i) [0..size*2-1] ++ "\n" | |
charAt i j | size + i == j = c | |
| size - i == j = c | |
| (size - 1 == i) && (j > 0) = c | |
| otherwise = 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
$Updates = "50ff45dd-fc70-4e32-8698-a3d112e59ef1", "c0b3230a-bb79-4e44-b771-177bc224fcbf", "5f84379f-7c14-472f-b560-62a0cdec6f31", "ca2a186f-626f-401f-9cb1-68f859acbbf7" | |
$updatefilter = ($Updates | % { "UpdateID = '$_'" } ) -join " or " | |
$us = New-Object -ComObject "Microsoft.Update.Session" | |
$ss = $us.createupdateSearcher() | |
Write-Host "Scanning for IE10 updates..." | |
$sr = $ss.search($updatefilter) | |
$uninst = $False |
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
create procedure sp_terminate_stuck_network as | |
declare CRSR cursor for | |
select session_id from sys.dm_exec_requests | |
where wait_type = 'ASYNC_NETWORK_IO' | |
and wait_time > 5*60*1000 -- 5 minutes; | |
open CRSR; | |
declare @SESSION as int |
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
class AutoMelt | |
def initialize | |
end | |
def is_metal? (item) | |
item.respond_to?(:mat_type) && item.mat_type == 0 && df.world.raws.inorganics[item.mat_index].material.flags[:IS_METAL] | |
end | |
def is_meltable?(item) |
OlderNewer