All contracts need to begin with the following imports
#![no_std]
#![no_main]
#![allow(unused_attributes)]
# Inspired by Moonbeam Dockerfile (which was inspired by the Polkadot Dockerfile) | |
FROM phusion/baseimage:0.11 as builder | |
LABEL maintainer "willem@chainsafe.io" | |
LABEL description="This is the build stage for Polkadot. Here we create the binary." | |
ARG PROFILE=release | |
ARG POLKADOT_COMMIT=72243baaedf3ded4226032949a23f8478f5565d9 | |
# need to keep commit has in sync with lockfile for PINT | |
ARG POLKADOT_REPO=https://github.com/paritytech/polkadot |
#![no_std] | |
#![no_main] | |
#![allow(non_snake_case)] | |
#![allow(unused_attributes)] | |
#![allow(unused_variables)] | |
imports!(); | |
#[elrond_wasm_derive::callable(TransferFromProxy)] |
[ | |
{"brand_id": "232", "brand_name": "Sanyo"}, | |
{"brand_id":" 12 ","brand_name": "Samsung"}, | |
{"brand_id": "487", "brand_name": "Fujitsu"}, | |
{"brand_id": "7", "brand_name": "Hisense"}, | |
{"brand_id": "22","brand_name": "Toshiba"}, | |
{"brand_id": "137","brand_name": "Electrolux"}, | |
{"brand_id": "32", "brand_name": "LG"}, | |
{"brand_id": "52", "brand_name": "Philips"}, | |
{"brand_id": "57", "brand_name": "Sharp"}, |
[package] | |
name = "test-hyper" | |
version = "0.1.0" | |
authors = ["willem <willemolding@gmail.com>"] | |
edition = "2018" | |
[dependencies] | |
hyper = "0.12.21" | |
tokio = "0.1.14" | |
hyper-staticfile = "0.3.0" |
[package] | |
name = "agent-address-generator" | |
version = "0.1.0" | |
authors = ["willem <willemolding@gmail.com>"] | |
edition = "2018" | |
[dependencies] | |
holochain_core_types = { git = "https://github.com/holochain/holochain-rust", branch="develop" } |
/*========================================== | |
= function overrides = | |
==========================================*/ | |
agentShortname = App.Agent.String.substr(0, App.Agent.String.indexOf('@')); | |
var oldCommit = commit; | |
commit = function(entryType, entryData) { | |
if(entryType.indexOf("private") !== -1) { | |
debug(agentShortname + '-->>' + agentShortname +': '+ entryType); |
def grab_prob(time_idx): | |
# make frame__idx an integer to avoid slicing errors | |
frame_idx = int(time_idx) | |
# get 'frame_time' | |
frame_time = grab_sst_time(frame_idx) | |
# set month of year | |
MoY_val = int(frame_time.month) | |
# get list of temperature and salinity values from subset |
<script> | |
function code_toggle() { | |
if (code_shown){ | |
$('div.input').hide('500'); | |
$('#toggleButton').val('Show Code') | |
} else { | |
$('div.input').show('500'); | |
$('#toggleButton').val('Hide Code') | |
} | |
code_shown = !code_shown |
def get_first_index(bool_array, axis, nonevalue=-1): | |
""" | |
Returns the first index in each axis that is true. Returns nonevalue if none are found | |
""" | |
return np.choose(np.any(bool_array, axis=axis), [nonevalue, np.argmax(bool_array, axis=axis)]) |