brew rm -f curl
brew tap cloudflare/homebrew-cloudflare
brew install cloudflare/cloudflare/curl
brew unlink curl && brew link --force curl
Also, you might need to remove rust because it's better to have rust installed via default installer.
# syntax=docker/dockerfile:1.5.2 | |
## | |
## Python clean slim app docker file | |
## | |
FROM python:3.11.4-slim-bullseye as builder | |
## RUN apt install here |
https://binarysearch.com/problems/List-Splitting-to-Consecutive-Subsequences
class Solution:
def check(self, nums, i, e):
if e == i:
return True
c1 = c2 = t = 0
#ifndef ANALOGLITERALS_HPP
#define ANALOGLITERALS_HPP
namespace analog_literals {
typedef unsigned int uint;
E.g. given 1st line "what to edit" and 2nd line "what vim commands to execute"
-E
Ex mode: vim will treat STDIN as if it's just list of commands^E
means key press, so here 2 strategies to deal with it
^E
with new_line + ":norm "^E
with hex code of ESC which is \x1b
# restore {} aka python style code -> c++ style code
# if bla:
# print()
# for i in range(n):
# s.pop()
# something()
# else:
# bla
#------------
// 80 ms in worst case
int solve(vector<int>& a, int n) {
if (a.size() == 0) return 0;
sort(a.begin(), a.end());
int w = 0;
int c = 1;
int x = a[0];
int y;
for (int i = 1; i < a.size(); i++) {
# Credits: https://github.com/moby/moby/issues/16058#issuecomment-334370727 | |
# Example with apt-get update, install and clean it's cache | |
RUN apt-get update -yq \ | |
&& DEBIAN_FRONTEND=noninteractive \ | |
apt-get install -yq pkg1 pkg2 pkg3 \ | |
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete | |
# Example with many packages to install at one time | |
RUN apt-get update -yq \ |
parallel_fib(N) -> | |
Parent = self(), | |
spawn(fun () -> Parent ! fib(N - 1) end), % call left half parallel | |
X = fib(N - 2), | |
receive Y -> Y end, % get parallel result | |
X + Y. | |
fib(N) when N > 20 -> parallel_fib(N); | |
fib(0) -> 0; | |
fib(1) -> 1; |