- https://github.com/rust-lang/rustlings?ref=hackr.io
- https://stevedonovan.github.io/rust-gentle-intro/
- https://www.w3adda.com/rust-tutorial
- http://intorust.com/
- https://www.javatpoint.com/rust-tutorial
- https://www.snoyman.com/blog/2018/10/introducing-rust-crash-course
- https://danielkeep.github.io/tlborm/book/index.html
- http://zsiciarz.github.io/24daysofrust/book/vol2/
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
import base64 | |
import logging | |
from io import BytesIO | |
import torch | |
import torch.nn.functional as F | |
from flask import Flask, request | |
from PIL import Image | |
from torch import Tensor | |
from transformers import AutoModel, AutoTokenizer |
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 | |
# Sanitize all filenames in the current directory using detox | |
for file in * | |
do | |
new_file=$(detox "$file") | |
if [ -n "$new_file" ] && [ "$new_file" != "$file" ] && [ ! -e "$new_file" ] | |
then | |
mv "$file" "$new_file" | |
fi |
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
@echo OFF | |
rem How to run a Python script in a given conda environment from a batch file. | |
rem It doesn't require: | |
rem - conda to be in the PATH | |
rem - cmd.exe to be initialized with conda init | |
rem Define here the path to your conda installation | |
set CONDAPATH=C:\ProgramData\Miniconda3 | |
rem Define here the name of the environment |
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
def rotate_array_right(array, n): | |
length = len(array) | |
remainder = n % length | |
if remainder == 0: | |
return array | |
temp_array = array[0:remainder] | |
return array[remainder:] + temp_array |
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
class RingBuffer: | |
index = 0 | |
value = None | |
def __init__(self, length): | |
# create buffer using dequeue | |
self.buffer = deque([], length) | |
# establish end index number | |
self._eix = length-1 |
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
from bs4 import BeautifulSoup | |
from requests import get | |
import json | |
import re | |
import emoji | |
css = "script" |
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
import numpy as np | |
class RingBuffer(np.ndarray): | |
'A multidimensional ring buffer.' | |
def __new__(cls, input_array): | |
obj = np.asarray(input_array).view(cls) | |
return obj |
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
// http://is.gd/gWewbP | |
extern mod extra; | |
use extra::treemap::TreeMap; | |
use extra::json::ToJson; | |
use extra::serialize::Decodable; | |
use json = extra::json; | |
// structs are required for decoding a JSON object into a Rust object | |
#[deriving(Decodable)] |
NewerOlder