Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
Discover gists
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
// Fuck the addition operator. Real programmers work in binary! | |
function add(a, b) { | |
// XOR to get the sum of the bits | |
var sum = a ^ b; | |
// "Carry" bits are common to both numbers | |
var carry = (a & b) << 1; | |
if (sum & carry) { | |
// Rinse and repeat until there are no leftover bits |
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
#!/bin/sh | |
# Examples: | |
# ./image64.sh myImage.png | |
# outputs: data:image/png;base64,xxxxx | |
# ./image64.sh myImage.png -img | |
# outputs: <img src="data:image/png;base64,xxxxx"> | |
filename=$(basename $1) | |
xtype=${filename##*.} | |
append="" |
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
UEsDBBQAAAAIABNQjFGCf/GfLgAAACwAAAAHAAAAUHJvLmtleTMqdncpCXQOKDAp9woMzEo1MTVOrHAzTjTLME7VNs1LK8owTjQpcU8tcuLlAgBQSwECFAAUAAAACAATUIxRgn/xny4AAAAsAAAABwAAAAAAAAAAAAAAAAAAAAAAUHJvLmtleVBLBQYAAAAAAQABADUAAABTAAAAAAA= |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
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
#include <stdio.h> | |
#include <stdlib.h> | |
void merge(int *array, int p, int q, int r) | |
{ | |
// Declaracion de variables | |
int i, j, k; | |
int n_1 = (q - p) + 1; | |
int n_2 = (r - q); | |
int *L, *R; |
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
from datasets import load_dataset | |
from trl import SFTTrainer | |
from peft import LoraConfig | |
from transformers import AutoTokenizer, AutoModelForCausalLM, TrainingArguments | |
tokenizer = AutoTokenizer.from_pretrained("state-spaces/mamba-130m-hf") | |
model = AutoModelForCausalLM.from_pretrained("state-spaces/mamba-130m-hf") | |
dataset = load_dataset("Abirate/english_quotes", split="train") | |
training_args = TrainingArguments( | |
output_dir="./results", | |
num_train_epochs=3, |
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 streamlit as st | |
import concurrent.futures # We'll do computations in separate processes! | |
import mymodule # This is where you'll do the computation | |
# Your st calls must go inside this IF block. | |
if __name__ == '__main__': | |
st.write("Starting a long computation on another process") | |
# Pick max number of concurrent processes. Depends on how heavy your computation is, and how | |
# powerful your machine is. |
Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
NewerOlder