Skip to content

Instantly share code, notes, and snippets.

View gc_test.rb
#!/usr/bin/ruby
#
# generated_code.rb is in the same directory as this test.
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
old_gc = GC.stress
GC.stress = 0x01 | 0x04
require 'generated_code_pb'
require 'generated_code_proto2_pb'
GC.stress = old_gc
View nu-ty.v
Inductive LatticeExpr {T} :=
| LAtom (t: T)
| LTop
| LIntersection (t0: LatticeExpr) (t1: LatticeExpr)
| LBottom
| LUnion (t0: LatticeExpr) (t1: LatticeExpr).
Arguments LatticeExpr T: clear implicits.
CoInductive ATy :=
| TyNumber
View cross-ruby
#--
# Cross-compile ruby, using Rake
#
# This source code is released under the MIT License.
# See LICENSE file for details
#++
#
# This code is inspired and based on notes from the following sites:
#
View protobuf-example.sql
CREATE TEMP FUNCTION parseMessage(messageB64 BYTES)
RETURNS STRING
LANGUAGE js AS """
const toSextet = (ch) => {
if (0x41 <= ch && ch < 0x41 + 26) {
return ch - 0x41;
} else if (0x61 <= ch && ch < 0x71 + 26) {
return ch - (0x61 - 26);
} else if (0x30 <= ch && ch < 0x30 + 10) {
return ch + (52 - 0x30);
@qnighy
qnighy / rustc-phases.txt
Created May 19, 2019
rustc phases memo
View rustc-phases.txt
- https://github.com/rust-lang/rust/blob/1.34.2/src/librustc_driver/driver.rs
- https://github.com/rust-lang/rust/blob/1.34.2/src/librustc_typeck/lib.rs
compile_input
phase_1_parse_input
parsing: syntax::parse::parse_crate_from_*
phase_2_configure_and_expand
attributes injection: syntax::attr::inject
(various setups like features, crate types and disambiguator)
recursion limit: rustc::middle::recursion_limit::update_limits
@qnighy
qnighy / Makefile
Last active May 5, 2019
GCJ2019 Round1C
View Makefile
#!/usr/bin/make -f
EXECS = a b c
CXX = g++
CXXFLAGS = -O2 -Wall -Wextra -g -std=gnu++14
all: $(EXECS)
clean:
$(RM) $(EXECS)
View Makefile
#!/usr/bin/make -f
EXECS = a b d
CXX = g++
CXXFLAGS = -O2 -Wall -Wextra -g -std=gnu++14
all: $(EXECS)
clean:
$(RM) $(EXECS)
@qnighy
qnighy / boxed-closure-impls.md
Created Feb 11, 2019
Docs removed from https://github.com/rust-lang/rust/pull/55431 (under src/doc/unstable-book/src/library-features)
View boxed-closure-impls.md

boxed_closure_impls

The tracking issue for this feature is #48055


This includes the following blanket impls for closure traits:

View main.go
package main
func main() {
ch := make(chan int)
x := make([]int, 10)
go (func() {
y := make([]int, 10)
for i := 0; i < 1000000; i++ {
z := x
z[len(z)-1] = -1
View bigquery-auto-validate.user.js
// ==UserScript==
// @name BigQuery auto validate
// @namespace https://qnighy.info/
// @version 0.1
// @description saikou
// @author Masaki Hara
// @match https://bigquery.cloud.google.com/*
// @grant none
// ==/UserScript==
You can’t perform that action at this time.