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
from pymclevel import items | |
def itembyname(name): | |
if name in items.items.items: | |
return items.items.itewms[name]["id"] | |
return 0 | |
def namebyitem(id): | |
item = items.items.findItemID(id) | |
if type(item["name"]) == str or type(item["name"]) == unicode: |
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
<?php | |
define('IND',' '); | |
function hex2bin( $str ) { | |
$sbin = ""; | |
$len = strlen( $str ); | |
for ( $i = 0; $i < $len; $i += 2 ) { | |
$sbin .= pack( "H*", substr( $str, $i, 2 ) ); | |
} |
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
//Ref: http://twitter.com/BenBE1987/statuses/115050893115797505 | |
ASCIIoverUTF8 = { | |
write: function(msg) { | |
var result = ''; | |
(msg.length%2) && (msg+=String.fromCharCode(0)); | |
for (var i=0;i<msg.length; i+=2) { | |
var a=msg.charCodeAt(i)&0xFF, | |
b=msg.charCodeAt(i+1)&0xFF; | |
result+=String.fromCharCode((a<<8) | b); | |
} |
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
function TryTrunc(x: Extended; out Val: Int64): boolean; | |
var | |
oldcw, cw, sw: word; | |
asm | |
fld x | |
fwait | |
fnstcw oldcw | |
fnstcw cw | |
fwait |
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
// Parses a classes vmtMethodTable and finds all `published` methods this class declares. | |
// Find all available functions by recusing up the hierarchy with .ClassParent | |
// Martok 2012 - Public Domain / CC0 | |
TMethodTable = array of record | |
Code: Pointer; | |
Name: String; | |
end; | |
TTest = class |
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
decode[text_String, key_String] := Module[{textCode, keyCode}, | |
textCode = | |
Cases[ToCharacterCode[ | |
ToUpperCase@ | |
text], _?(IntervalMemberQ[Interval@{65, 90}, #] &)] - 65; | |
keyCode = | |
Cases[ToCharacterCode[ | |
ToUpperCase@ | |
key], _?(IntervalMemberQ[Interval@{65, 90}, #] &)] - 65; | |
keyCode = If[Length[textCode] < Length[keyCode], |
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
-- Automatic Treefarm | |
-- * Works with or without Bonemeal | |
-- * Optimized for Birchwood, but should work with any 1x1 tree that doesn't branch | |
-- Martok 2013-04-05 | |
local WORK,WORK2,SAPLING,LOG = 13,14,15,16 | |
if (turtle.getItemCount(WORK) ~= 0) or (turtle.getItemCount(WORK2) ~= 0) or (turtle.getItemCount(SAPLING) == 0) or (turtle.getItemCount(LOG) == 0) then | |
print("Please clear Slots ",WORK,"+",WORK2,", put 1 Sapling in Slot ",SAPLING," and 1 Log in Slot ",LOG,".") | |
print("Bonemeal may be placed in any Slot not mentioned before.") | |
return | |
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
@echo off | |
setlocal | |
echo ************************************************ | |
echo **** Martok's Syncrotron **** | |
echo ************************************************ | |
echo **** 1: Copy from this machine to exHDD **** | |
echo **** 2: Copy from exHDD to this machine **** | |
echo **** anything else: exit **** | |
echo ************************************************ | |
set /p select="Choose option: " |
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
Cmin(1,1,1) = 1 | |
repuls(1,1) = 0.4770183040558415 | |
nn2(1,1)=1 | |
rc = 5.0 | |
ialloy=1 | |
augt1=0 | |
delr=1 | |
emb_lin_neg=1 | |
bkgd_dyn=1 |
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
units metal | |
dimension 3 | |
boundary p p p | |
atom_style atomic | |
timestep 0.001 | |
variable min2th index 20 | |
variable max2th index 90 | |
lattice bcc 3.147 |
OlderNewer