Some of the techniques I've used to learn languages quickly and thoroughly:
-
Shadowing
-
Scriptorium
-
Side-by-Side Reading
| // 1. Even or odd | |
| function isEven(value){ | |
| if (value % 2 == 0){ | |
| return true; | |
| } | |
| else | |
| return false; | |
| } |
| /** | |
| * @file get/set caret position and insert text | |
| * @author islishude | |
| * @license MIT | |
| */ | |
| export class Caret { | |
| /** | |
| * get/set caret position | |
| * @param {HTMLColletion} target | |
| */ |
| const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
| const asyncForEach = async (array, callback) => { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } | |
| const start = async () => { | |
| await asyncForEach([1, 2, 3], async (num) => { | |
| await waitFor(50) |
| import axios from 'axios'; | |
| import qs from 'qs'; | |
| // Customized Axios object for API calls | |
| var Api = axios.create({ | |
| // NOTE: Replace the API URL | |
| baseURL: 'http://api.example.com/', | |
| responseType: 'json', | |
| withCredentials: true | |
| // Add whatever you want to configure Axios here |
This solves: https://forums.expo.io/t/rn-expo-build-for-android-tv/9403 and https://stackoverflow.com/questions/51707841/android-tv-app-shows-white-screen
"android": {
...
"intentFilters": [
{(see YouTube channel for individual videos)
| // zod schema | |
| z.object({ | |
| // valid if string or: | |
| optional: z.string().optional(), // field not provided, or explicitly `undefined` | |
| nullable: z.string().nullable(), // field explicitly `null` | |
| nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined` | |
| }); | |
| // type | |
| { |
| from transformers import PreTrainedTokenizerFast | |
| fast_tokenizer = PreTrainedTokenizerFast(tokenizer_file="/home/ubuntu/LLM/module/claude-v1-tokenization.json") | |
| text = "Hello, this is a test input." | |
| tokens = fast_tokenizer.tokenize(text) | |
| tokens |