A Script consists of instruction code, a set of roles, and related metadata (name, author, etc.).
Script
code: executable code
roles: [Role]
metadata: dictionary
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
[ExecuteInEditMode] | |
public class DrawSizeGizmo : MonoBehaviour { | |
public bool enabled = true; | |
void OnDrawGizmos () { |
func microsoftImageSearch(_ query : String, completion: @escaping (_ result: [String])->()) { | |
let url = URL(string: "https://api.cognitive.microsoft.com/bing/v7.0/images/search?q=\(query)") | |
var request = URLRequest(url: url!) | |
request.addValue(MICROSOFT_API_KEY, forHTTPHeaderField: "Ocp-Apim-Subscription-Key") | |
URLSession.shared.dataTask(with:request, completionHandler: {(data, response, error) in | |
guard let data = data, error == nil else { return } | |
do { |
func getEntities (_ sentence : String) -> [String] { | |
let tagger = NSLinguisticTagger(tagSchemes: [.nameType], options: 0) | |
let options: NSLinguisticTagger.Options = [.omitPunctuation, .omitWhitespace] | |
tagger.string = sentence | |
let range = NSRange(location:0, length: sentence.utf16.count) | |
var prevTag : NSLinguisticTag? = nil | |
var accName : String = "" | |
import time | |
import torch | |
def validate(val_loader, model, criterion, use_cuda=False, print_freq=10): | |
""" | |
Evaluate a classification model on the entire validation set. | |
Args: | |
val_loader: a DataLoader instance for the validation set | |
model: the model to evaluate |
import sys | |
import time | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.action_chains import ActionChains | |
chrome_options = webdriver.ChromeOptions() | |
chrome_options.add_argument("--disable-notifications") | |
driver = webdriver.Chrome(chrome_options=chrome_options) |
#!/bin/bash | |
# Usage: ./resize_many.sh <filename> <sizes...> | |
# e.g. ./resize_many.sh myasset.png 10x10 20x20 30x30 | |
# produces 3 files, myasset10x10.png myasset20x20.png myasset30x30.png | |
fullname=$1 | |
shift; | |
sizes=$* | |
extension="${fullname##*.}" |
import sys | |
import numpy as np | |
import colorlover as cl | |
import scipy.io.wavfile as wav | |
from scipy.interpolate import interp1d | |
from python_speech_features import fbank | |
from PIL import Image | |
N_FILTERS = 10 | |
N_FRAMES = 60 |
I hereby claim:
To claim this, I am signing this object:
{"poem": "If the hope of giving\n\r is to love the living,\n\r the giver risks madness\n\r in the act of giving.\n\n\r Some such lesson I seemed to see\n\r in the faces that surrounded me.\n\n\r Needy and blind, unhopeful, unlifted,\n\r what gift would give them the gift to be gifted?\n\r \u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0The giver is no less adrift\n\r \u00a0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0than those who are clamouring for the gift.\n\n\r If they cannot claim it, if it is not there,\n\r if their empty fingers beat the empty air\n\r and the giver goes down on his knees in prayer\n\r knows that all of his giving has been for naught\n\r and that nothing was ever what he thought\n\r and turns in his guilty bed to stare\n\r at the starving multitudes standing there\n\r and rises from bed to curse at heaven,\n\r he must yet understand that to whom much is given\n\r much will be taken, and justly so:\nI cannot tell how much I owe.\n", "title": "The giver (for Berdis)", "id": 88930, "author": "James Baldwin" |