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
| type Cursor = { | |
| source: string; | |
| index: number; | |
| }; | |
| export type IdentifierNode = { | |
| kind: "identifier"; | |
| name: string; | |
| }; |
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
| // src/server/render.js | |
| import React from 'react'; | |
| import { renderToString } from 'react-dom/server'; | |
| import fs from 'fs'; | |
| import { fileURLToPath } from 'url'; | |
| import { dirname } from 'path'; | |
| const __filename = fileURLToPath(import.meta.url); | |
| /** |
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
| // Public interface | |
| interface SkipList<K, V> { | |
| insert(key: K, value: V): void; | |
| get(key: K): V | undefined; | |
| } | |
| // Internal types | |
| type ExtendedKey<K> = | |
| | { type: "NegativeInfinity" } | |
| | { type: "PositiveInfinity" } |
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
| class SLNode { | |
| value: number; | |
| constructor(value: number) { | |
| this.value = value; | |
| } | |
| } | |
| class SLNodeSet { | |
| private levels: (SLNode | null)[][]; |
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 java.util.concurrent.atomic.AtomicInteger; | |
| import java.util.ArrayList; | |
| class Main { | |
| public static void main(String[] args) { | |
| ArrayList<Integer> wrapInt = new ArrayList<>(); | |
| AtomicInteger lock = new AtomicInteger(0); | |
| wrapInt.add(0); | |
| ArrayList<Thread> threads = new ArrayList<>(); | |
| for(int i = 0; i < 5; i++){ |