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
{ | |
"configurations": [ | |
{ | |
"name": "MergeSort (Debug)", | |
"type": "cppdbg", | |
"request": "launch", | |
"program": "${workspaceFolder}/merge-sort.exe", | |
"runtimeExecutable": "${workspaceRoot}/info.sh", | |
"args": [ | |
"${input:number_elements}", |
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
import { NextApiRequest, NextApiResponse } from "next"; | |
import { withApiAuthRequired } from "@auth0/nextjs-auth0"; | |
import nc from "next-connect"; | |
// Secured api endpoint. | |
// Possible synergy between next-connect and withApiAuthRequired from nextjs-auth0. | |
const handler = withApiAuthRequired( | |
nc<NextApiRequest, NextApiResponse>() | |
.get( |
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
import matplotlib.pyplot as plt | |
import numpy as np | |
from collections import Counter | |
from matplotlib.widgets import Slider | |
from functools import partial | |
(fig, ax) = plt.subplots(1, 1) | |
def gen(n): | |
ax.clear() |
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
fn make_deadlock() { | |
let a = Arc::new(Mutex::new(1u32)); | |
let aa = Arc::clone(&a); | |
let b = Arc::new(Mutex::new(1u32)); | |
let bb = Arc::clone(&b); | |
let t_a = spawn(move || loop { | |
do_locking("A".to_string(), "a".to_string(), &*a, "b".to_string(), &*b); | |
}); |