This tutorial shows how to compile and run RISC-V assembler code on Debian Linux systems, which are not running on a RISC-V system (e.g. x86_64).
sudo apt-get install qemu qemu-system-misc qemu-user gcc-riscv64-unknown-elf
Save this as hello.s:
| #!/usr/bin/env python3 | |
| import requests | |
| response = requests.get("https://httpbin.org/ip") | |
| data = response.json() | |
| ip = data.get("origin", "Unknown") | |
| print(f"Your IP address is: {ip}") |
| import re | |
| import sys | |
| # List of valid TLDs (this is a small subset, you may want to use a more comprehensive list) | |
| VALID_TLDS = set(['com', 'org', 'net', 'edu', 'gov', 'io', 'co', 'uk', 'de', 'fr', 'jp', 'cn', 'au', 'us']) | |
| def is_valid_domain(domain): | |
| pattern = r'^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z]{2,})+$' | |
| if not re.match(pattern, domain): | |
| return False |
| # create a new private key | |
| frank@hal9000:~/tmp$ openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048 | |
| ..+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+.........+.+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.....+..+...+....+......+..+...+.......+..+....+..+...+....+..+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
| .+..+.........+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.....+.........+....+.....+..........+..+.........+....+..+............+.+..+.......+.....+.+...............+..+............+...+...+.+......+............+...............+..+.............+........+...+......+....+......+........+...+..........+............+..+....+..+...+....+..+....+......+.....+...+.+.....+................+.......................+.+.........+...........+.+...+..+.............+......+..............+...+....+........+.+..+..... |
| #!/usr/bin/env python3 | |
| # automatically pins all your workflows, see | |
| # https://github.com/fmtlib/fmt/issues/3449 | |
| # for details | |
| import sys | |
| import requests | |
| import os |
| # Audio loudness calculation and normalization. | |
| # The LUFS calculations here are all based on: | |
| # ITU documentation: https://www.itu.int/dms_pubrec/itu-r/rec/bs/R-REC-BS.1770-4-201510-I!!PDF-E.pdf | |
| # EBU documentation: https://tech.ebu.ch/docs/tech/tech3341.pdf | |
| # pyloudnorm by csteinmetz1: https://github.com/csteinmetz1/pyloudnorm | |
| # loudness.py by BrechtDeMan: https://github.com/BrechtDeMan/loudness.py | |
| # Special thanks to these authors! | |
| # I just rewrote some codes to enable short-term and momentary loudness calculations and normalizations for more convinent batch processing of audio files. | |
| import numpy as np |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define PLAYERS 5 | |
| uint8_t pos[PLAYERS]; | |
| int random2to12() { | |
| return (rand() % 11) + 2; |
| #!/usr/bin/env python3 | |
| # | |
| # Test script for the uncensored WizardLM model: | |
| # https://huggingface.co/TheBloke/WizardLM-7B-uncensored-GGML | |
| # | |
| # Tested on Mac Mini M1, with 16 GB RAM. Needs some libraries: | |
| # | |
| # pip install torch transformers accelerate bitsandbytes | |
| # CT_METAL=1 pip install ctransformers --no-binary ctransformers | |
| # |
This tutorial shows how to compile and run RISC-V assembler code on Debian Linux systems, which are not running on a RISC-V system (e.g. x86_64).
sudo apt-get install qemu qemu-system-misc qemu-user gcc-riscv64-unknown-elf
Save this as hello.s:
| # ChatGPT result of this question: | |
| # write a Python script, where the user can move a sprite with cursor keys, using PyGame | |
| import pygame | |
| # Initialize PyGame | |
| pygame.init() | |
| # Set up the screen (width, height, caption) | |
| size = (700, 500) |
| (ns test | |
| (:require [clojure.string :refer [split-lines]]) | |
| (:require [clojure.set :refer [intersection]])) | |
| (def rucksacks "vJrwpWtwJgWrhcsFMMfFFhFp | |
| jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL | |
| PmmdzqPrVvPwwTWBwg | |
| wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn | |
| ttgJtRGJQctTZtZT | |
| CrZsJsPPZsGzwwsLwLmpwMDw") |