There are two parts to networking within QEMU:
- The virtual network device that is provided to the guest (e.g. a PCI network card).
- The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).
| package main | |
| import "syscall" | |
| func main() { | |
| // equivalent to (HANDLE)GetModuleHandle(NULL); in C | |
| handle, _, _ := syscall.Syscall( | |
| syscall.NewLazyDLL("kernel32.dll").NewProc("GetModuleHandleW").Addr(), | |
| 1, 0, 0, 0, |
| path = "/public/yelp-dataset/yelp_review.csv" | |
| yelpReview = sc.newAPIHadoopFile(path, | |
| 'org.apache.hadoop.mapreduce.lib.input.TextInputFormat', | |
| 'org.apache.hadoop.io.LongWritable', | |
| 'org.apache.hadoop.io.Text', | |
| conf={'textinputformat.record.delimiter' : '\r'}) | |
| yelpReview.count() |
| #!/usr/bin/env bash | |
| catch_kill() { | |
| echo "Caught SIGKILL signal!" | |
| kill -KILL "$pid" 2>/dev/null | |
| } | |
| catch_term() { | |
| echo "Caught SIGTERM signal!" | |
| kill -TERM "$pid" 2>/dev/null |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "io" | |
| "os" | |
| "os/exec" | |
| "strings" | |
| ) |
| import pandas as pd | |
| import itertools | |
| import time | |
| import multiprocessing | |
| from typing import Callable, Tuple, Union | |
| def groupby_parallel( | |
| groupby_df: pd.core.groupby.DataFrameGroupBy, | |
| func: Callable[[Tuple[str, pd.DataFrame]], Union[pd.DataFrame, pd.Series]], | |
| num_cpus: int = multiprocessing.cpu_count() - 1, |
| from selenium import webdriver | |
| from selenium.webdriver.common.action_chains import ActionChains | |
| def enter_hours(self, cell, amount): | |
| #Double-click | |
| actions = ActionChains(self.driver) | |
| actions.move_to_element(cell) | |
| actions.double_click(cell) | |
| actions.perform() | |
| """ | |
| Vanilla Char-RNN using TensorFlow by Vinh Khuc (@knvinh). | |
| Adapted from Karpathy's min-char-rnn.py | |
| https://gist.github.com/karpathy/d4dee566867f8291f086 | |
| Requires tensorflow>=1.0 | |
| BSD License | |
| """ | |
| import random | |
| import numpy as np | |
| import tensorflow as tf |
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |