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 |
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
BoldAsFont=-1 | |
Font=Consolas | |
FontHeight=11 | |
ForegroundColour=204,204,204 | |
BackgroundColour=30,30,30 | |
CursorColour=204,204,204 | |
Black=30,30,30 | |
BoldBlack=102,102,102 | |
Gray=255,0,0 | |
BoldGray=0,0,255 |
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
#!/usr/bin/env python | |
from functools import partial | |
def main(): | |
""" | |
Main function | |
""" | |
A = list(range(10)) |
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 | |
original_path=$(pwd) | |
cd "$(dirname "$0")" | |
##PARAMETERS | |
port=5656 | |
user=lucas.lugao-guimaraes | |
host=cuboide.polytechnique.fr | |
##CONFIG AUTODETECTION | |
hostname=$(hostname) |
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
template<typename T> | |
auto DummyFirstArgument(T&& f) | |
{ | |
return [&](auto dummy, auto ...x){ return f(x...); }; | |
} |
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
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
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)] = "["; |