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
| this.states = [{ left: 0, cur: 50, right: 100 }]; | |
| function printState(state) { | |
| var line = ""; | |
| var width = 79; | |
| var round = function (v) { | |
| return Math.floor((v * width) / 100); | |
| }; | |
| var visMap = {}; | |
| visMap[round(state.left)] = "["; |
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
| const assert = require("assert"); | |
| c0 = (s, z) => z; | |
| succ = n => (s, z) => s(n(s, z)); | |
| add = (x, y) => (s, z) => x(s, y(s, z)); | |
| mul = (x, y) => (s, z) => x(z => y(s, z), z); | |
| T = (x, y) => x; | |
| F = (x, y) => y; | |
| and = (a, b) => a(b, F); | |
| or = (a, b) => a(T, b); |
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
| #!/bin/bash | |
| # | |
| # Simulate a checkout of a detached commit in the gitlab upstream | |
| # | |
| # Usage | |
| # $ gitlab-force-checkout COMMIT_HASH | |
| set -e | |
| if [ ! -z "$(git status --porcelain)" ]; then |
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
| template<typename T> | |
| auto DummyFirstArgument(T&& f) | |
| { | |
| return [&](auto dummy, auto ...x){ return f(x...); }; | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| void reverse_list(Node* head) { | |
| //Make sure we are not trying to reverse an empty list or a singleton | |
| if (head != NULL && head->next != NULL) { | |
| Node* curr = head; | |
| Node* next = head->next; | |
| Node* nextNext = NULL; | |
| //Initial state | |
| //[0] -> [1] -> [2] -> ... -> [n] -> NULL | |
| //head next |