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
from team_code.generate import get_ppl, generate_text, setup_model_and_tokenizer | |
def test_generate_text_get_ppl(): | |
model, tokenizer = setup_model_and_tokenizer() | |
queries = [ | |
[{"type": "text", "content": "What is the capital of Great Britain?"}], | |
[{"type": "text", "content": "And what is the famous place there?"}] | |
] |
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
package main | |
import ( | |
errors "errors" | |
"fmt" | |
"testing" | |
pkgerrors "github.com/pkg/errors" | |
"github.com/ansel1/merry" |
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
import random | |
from ctypes import CDLL | |
libc = CDLL("libc.so.6") | |
asciiRange = 0x7E - 0x20 | |
ans = [] | |
with open("ctf.in110", 'r') as f: |
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
go test -v -bench=BenchmarkIteratorNext -benchmem | |
... | |
BenchmarkIteratorNext-8 2000732 576 ns/op 8 B/op 0 allocs/op | |
go test -v -bench=BenchmarkIteratorNext -benchmem -cpuprofile=cpu.out -memprofile=mem.out -memprofilerate=1 | |
... | |
BenchmarkIteratorNext-8 513028 2746 ns/op 8 B/op 1 allocs/op |
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
=head1 install deps | |
cpm install AnyEvent::HTTP LWP::Protocol::Coro::http | |
=head1 bench result | |
Rate aehttp_socks aehttp my_lwp state_lwp | |
aehttp_socks 183/s -- -1% -6% -17% | |
aehttp 185/s 1% -- -5% -16% | |
my_lwp 195/s 6% 5% -- -12% | |
state_lwp 221/s 20% 19% 13% -- |
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
use Devel::REPL; | |
my $repl = Devel::REPL->new; | |
$repl->load_plugin($_) for qw( | |
History LexEnv DDS PPI DDP | |
Completion | |
CompletionDriver::INC | |
CompletionDriver::Keywords | |
CompletionDriver::Methods | |
Editor |
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
gcamm() { | |
local b="$(git_current_branch)" | |
local task="$(perl -E 'print( (split /\./, $ARGV[0], 2)[0] )' $b)" | |
echo $task | |
[[ "$task" != "" ]] && git commit --verbose -am "$task $1" | |
} | |
gcmm() { | |
local b="$(git_current_branch)" |
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
let stringify = require('json-stable-stringify'); // canonical json implementation | |
let md5 = require('md5'); | |
let base64 = require('base-64'); | |
let sha1 = require('sha1'); | |
let amount = 1; | |
let merch_data = { | |
amount: amount, | |
order_id: ++last_order_id, | |
currency: "RUB", |
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
setw -g mode-keys vi | |
# remap prefix from 'C-b' to 'C-a' | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# unbind shift and ctl | |