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
(def array ["az" "toto" "picaro" "zone" "kiwi"]) | |
(def str-arr ["I" "wish" "I" "hadn't" "come"]) | |
(concat (drop 1 (for [elmt array] | |
(map (partial clojure.string/join " ") (split-at (.indexOf array elmt) array))))) | |
(defn partlist [arr] | |
(->> (remove (partial some #{""}) | |
(for [index (range (count arr))] | |
(map (partial clojure.string/join " ") (split-at index arr)))) |
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
(defn rot [string] | |
(for [index (range (count string))] | |
(->> (reverse (split-at index string)) | |
(apply concat) | |
(apply str)))) | |
(defn contain-all-rots [strng vec-str] | |
(every? (set vec-str) (rot strng))) |
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
1 2 3 4 5 6 7 8 ; Indices | |
1 2 3 4 5 6 7 8 ; person-numbers | |
0 0 0 0 0 0 0 0 ; person-numbers - indices | |
0 0 0 0 0 0 0 0 ; accumulated difference | |
; sum of accumulated difference: 0 | |
; Total bribery: 0 | |
1 2 3 4 5 6 7 8 ; Indices | |
1 2 3 5 4 6 7 8 ; person-numbers | |
0 0 0 1 -1 0 0 0 ; person-numbers - indices |
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 | |
DEBIAN_FRONTEND=noninteractive | |
sudo apt update | |
mkdir downloads | |
cd downloads | |
# INSTALL ANACONDA 5.3.0 |
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
# Before running the script your kaggle.json file in ~/.kaggle folder | |
# This script downloads all data from | |
# https://www.kaggle.com/c/dogs-vs-cats-redux-kernels-edition | |
# And puts them into subdirectories so that it is easily usable with fast ai | |
# and easily make predictions for the test data and submit. | |
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
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. | |
If your shell is Bash or a Bourne variant, enable conda for the current user with | |
$ echo ". /home/pghoou/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc | |
or, for all users, enable conda with | |
$ sudo ln -s /home/pghoou/anaconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh | |
The options above will permanently enable the 'conda' command, but they do NOT |
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
1 0 0 0 0 | |
IMPOSSIBLE | |
1 1 0 0 | |
1 1 0 1 | |
0 0 0 0 | |
--------------------------------------------------------------------------- | |
_RemoteTraceback Traceback (most recent call last) | |
_RemoteTraceback: | |
""" | |
Traceback (most recent call last): |
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
$ python3 run_locally.py | |
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.9/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:244 | |
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.9/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:258 | |
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.9/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:263 | |
INFO:sc2.protocol:Client status changed to Status.launched (was None) | |
INFO:sc2.controller:Creating new game | |
INFO:sc2.controller:Map: AbyssalReefLE | |
INFO:sc2.controller:Players: Bot(Race.Random, <bot.main.MyBot object at 0x10c106438>), Computer(Race.Random, Difficulty.Medium) | |
INFO:sc2.protocol:Client status changed to Status.init_game (was Status.launched) | |
INFO:sc2.protocol:Client status changed to Status.in_game (was None) |
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
use actix_web::{web, App, HttpResponse, HttpServer, Responder}; | |
async fn index() -> impl Responder { | |
HttpResponse::Ok().body("Hello world!") | |
} | |
async fn index2() -> impl Responder { | |
HttpResponse::Ok().body("Hello world again!") | |
} |
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
use actix_web::{App, web, get, HttpResponse, HttpServer}; | |
use std::sync::Mutex; | |
struct AppStateWithCounter { | |
counter: Mutex<i32>, // <- Mutex is necessary to mutate safely across threads | |
} | |
#[get("/")] | |
async fn index(data: web::Data<AppStateWithCounter>) -> HttpResponse { | |
let mut counter = data.counter.lock().unwrap(); // <- get counter's MutexGuard |
OlderNewer