Skip to content

Instantly share code, notes, and snippets.

View niklas88's full-sized avatar

Niklas Schnelle niklas88

View GitHub Profile
From 9facb3455c116337791946c2ecef1ed16cb78a2e Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 5 Jul 2021 11:43:16 +0200
Subject: [PATCH] CONFIG_HAS_IOPORT
Note (Niklas Schnelle):
This is as rebase on v5.16-rc5 of https://pastebin.com/yaFSmAuY
originally posted at by Arnd at the link below.
On s39 which leaves HAS_IOPORT unset it compiles with allyesconfig.
qemu-system-x86_64 -machine pc,vmport=off \
-accel kvm -smp 2 -m 8G \
-cdrom Fedora-KDE-Live-x86_64-31-1.9.iso \
-usb -device usb-tablet \
-soundhw hda \
-vga virtio -display sdl,gl=on
" Show tabs, End-of-Line and Trailing spaces
set listchars=tab:▸\ ,eol:¬,trail:~
" So the background is transparent for the above characters
highlight Normal ctermbg=none
highlight NonText ctermbg=none
" Whitespace at end of line in red
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
@niklas88
niklas88 / min-byte-rnn.py
Last active March 23, 2018 12:54 — forked from karpathy/min-char-rnn.py
Karpathy's original minimal char rnn + Python 3 + bytes directly instead of chars
#!/usr/bin/env python3
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
import sys
import time
# data I/O
#include <chrono>
#include <iostream>
#include <algorithm>
#include <array>
int main(int argc, char** argv) {
std::array<int, 13> arr = {12, 5, 7, 9, 2, 2, 33, 24, 1, 8, 0, 3, 77};
auto start = std::chrono::high_resolution_clock::now();
std::sort(arr.begin(), arr.end());
#include <iostream>
#include <string>
#include <string_view>
#include <vector>
std::vector<std::string_view> split_no_strcpy(std::string_view orig, const char sep) {
std::vector<std::string_view> result;
if (orig.size() > 0) {
size_t from = 0;
size_t sepIndex = orig.find(sep);
#include <iostream>
#include <experimental/filesystem>
#include <fstream>
namespace fs = std::experimental::filesystem;
int main() {
fs::path path = u8"猫.txt";
std::cout << "path = " << path << std::endl;
PREFIX fb: <http://rdf.freebase.com/ns/>
SELECT DISTINCT ?cityname ?countryname ?popcount ?latitude ?longitude WHERE {
?citytype fb:type.object.name "City/Town/Village"@en .
?city fb:type.object.type ?citytype .
?city fb:type.object.name ?cityname .
?city fb:location.location.containedby ?country .
?city fb:location.statistical_region.population ?population .
?population fb:measurement_unit.dated_integer.number ?popcount .
#include <stdint.h>
#include <stdio.h>
#include <zmq.h>
#include <assert.h>
#include <stdlib.h>
int main(int argc, char** argv) {
if(argc < 3) {
fprintf(stderr, "Usage %s: <xpublish_url> <xsubsriber_url>\n", argv[0]);
exit(1);
package main
import (
"flag"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"net/http"
"os"
)