{{ message }}

Instantly share code, notes, and snippets.

# Albert Yang albertnetymk

• Uppsala, Sweden
Last active Sep 22, 2021
View cross-region-invariants.md

## Region types in G1

Let's introduce the region types used in G1:

eden: for newly added objects from-survivor: for objects in to-survivor from previous young-GC to-survivor: live objects in eden/from-survivor are copied here if they have not lived long old: live objects in eden/from-survivor are copied here if they have lived long

Last active Mar 8, 2018
View hello.cc
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
 // https://developers.google.com/edu/c++/getting-started #include #include using namespace std; static int a, b, c; int new_sum(int sum, bool& terminated) {
Created Dec 9, 2017
View problem.md

Find the max and min of `sum` of all permutations of [1..9] satisfying the following condition:

``````    sum
== a[1] + a[2] + a[3]
== a[3] + a[4] + a[5]
== a[5] + a[6] + a[7]
== a[7] + a[8]
where sum = a[0] + a[1]
``````
Last active Nov 21, 2017
View lab2.md

# Racket lab

## 0 Background

### DrRacket

#### General

DrRacket provides rudimentary features for Racket programming, you could experiment them by launch DrRacket directly. Some particularly interesting/useful ones are highlighted here:

Last active Nov 28, 2016
View lab3.md

## 0. Warmup

### Hoogle

Hoogle is the search engine for Haskell functions. It supports searching by function names and types.

For example, you plan to use `parMap`, but forget its type. You could just type `parMap` in Hoogle, and the search result would look like:

Created Sep 4, 2016
View box.hs
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
 {-# LANGUAGE NamedFieldPuns #-} import Data.List ((\\)) type Grid = [[Char]] third_d :: Int -> Int -> Int third_d x y = head \$ [1..3] \\ [x,y] data Op = L | R | U | D deriving (Show) data State = State {
Created Jan 9, 2014
View pm.md

## Def of project:

specific goal specific time period specific resource unique work arrangement temporary organization

The line is optimized towards routine work. When one new problem arises, one specific request is given to a project group through a project charter trying to solve this problem. After the problem is solved, the result is implemented in the line, and initiates new work routine in the line.

## diffs between project manager and line manager:

Created Jan 7, 2014
View color_blender.c
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 MIN(a,b) (((a)<(b))?(a):(b)) typedef unsigned int uint; typedef struct { uint red:5; uint green:6; uint blue:5; } f_pixel;
Last active Nov 12, 2015
View hello.stp
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
 global gc_major global gc_minor global gc_major_count global gc_minor_count global stat global count_stat probe process("/home/albert/github/otp/bin/x86_64-unknown-linux-gnu/beam.smp").mark("gc_major__start") { gc_major[user_string(\$arg1)] = gettimeofday_ms() - gc_major[user_string(\$arg1)]
Created Oct 22, 2015
View cache.c
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 #include #include // copied from http://rosettacode.org/wiki/Sorting_algorithms/Insertion_sort#C void insertion_sort (int *a, int n) { int i, j, t; for (i = 1; i < n; i++) { t = a[i]; for (j = i; j > 0 && t < a[j - 1]; j--) {