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
export MARKPATH=$HOME/.marks | |
function jump { | |
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1" | |
} | |
function mark { | |
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1 | |
} | |
function unmark { | |
rm "$MARKPATH/$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
(define (xyz->ρ x y z) | |
(sqrt (+ | |
(expt x 2) | |
(expt y 2) | |
(expt z 2)))) | |
(define (zρ->θ z ρ) | |
(acos (/ z ρ))) | |
(define (yx->φ y x) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 xyz_to_ρ (x, y, z) { | |
return Math.sqrt((x * x) + (y * y) + (z * z)); | |
} | |
function zρ_to_θ (z, ρ) { | |
return Math.acos(z / ρ); | |
} | |
function yx_to_φ (y, x) { | |
return Math.atan(y / x); |
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
// encode(decode) html text into html entity | |
function decodeHtmlEntity(str) { | |
return str.replace(/&#(\d+);/g, function(match, dec) { | |
return String.fromCharCode(dec); | |
}); | |
}; | |
function encodeHtmlEntity(str) { | |
var buf = ''; | |
for (var i = 0; i < str.length; i++) { |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <strings.h> | |
#define BUFSIZE (1023 * 1024 * 4) | |
#define HISTSIZE (0x7f - ' ') | |
typedef struct hist_entry_s { | |
uint64_t count; | |
char codepoint; |
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
// Copyright 2018 Aaron Muir Hamilton | |
// | |
// Permission to use, copy, modify, and/or distribute this software for | |
// any purpose with or without fee is hereby granted, provided that the | |
// above copyright notice and this permission notice appear in all copies. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL | |
// WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED | |
// WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE | |
// AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
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
void TurboAssembler::li_smallest(Register rd, int64_t j) { | |
BlockTrampolinePoolScope block_trampoline_pool(this); | |
unsigned trailing = CountTrailingZeros(j); | |
unsigned leading = CountLeadingZeros(j); | |
unsigned solid = 64 - trailing - leading; | |
if (solid <= 12) { | |
if (leading >= 44) { | |
emit(ORI, rd, zero_reg, j); | |
} else if (leading >= 32 && trailing >= 12) { | |
emit(LUI, rd, j >> 44); |
OlderNewer