class Conventions
Dynamic systems need to be able to clean up side effects. Instead of linking effects explicitly, we generate unique tracking labels with special delimeters. Together they enable bottom-up evaluation and stateless continuations.
class Conventions
↑ Referencing, e.g. to jump to results of dom query, or to figure out which element in that collection called this function
UP: '↑'
→ Linking, that allows lazy evaluation, by making arguments depend on previously resolved arguments, e.g. for plural binding or to generate unique argument signature
RIGHT: '→'
↓ Nesting, as a way for expressions to own side effects, e.g. to remove stylesheet, css rule or conditional branch
DOWN: '↓'
It’s a lot easier to clean up stateless systems. Whenever a string key is set to be cleaned up, it broadcasts that intent to all subsystems, like constraint solver, dom observer, etc. So they can clean up things related to that key by triggering more remove commands for known sub-keys.
This removal cascade allows components to have strict and arbitarily deep hierarchy, without knowing of it.

style$my-stylesheet # my stylesheet
↓ h1$h1 # found heading
↑ !+img # preceeded by image
→ #header # bound to header element###
Return concatenated path for a given object and prefix Removes trailing delimeter.
getContinuation: (path, value, suffix = '') ->
if path
path = path.replace(/[→↓↑]$/, '')
return value if typeof value == 'string'
return path + (value && @identify(value) || '') + suffix
When cleaning a path, also clean forks, rules and pairs This is a little bit of necessary evil.
getPossibleContinuations: (path) ->
[path, path + @UP, path + @RIGHT, path + @DOWN]
Return computed path for id and property e.g. $id[property]
getPath: (id, property) ->
unless property
property = id
id = undefined
if property.indexOf('[') > -1 || !id
return property
else
return id + '[' + property + ']'
Hook: Should interpreter iterate returned object? (yes, if it’s a collection of objects or empty array)
isCollection: (object) ->
if object && object.length != undefined && !object.substring && !object.nodeType
switch typeof object[0]
when "object"
return object[0].nodeType
when "undefined"
return object.length == 0
Return shared absolute path of a dom query ($id selector)
getQueryPath: (operation, continuation) ->
if continuation
if continuation.nodeType
return @identify(continuation) + ' ' + operation.path
else
return continuation + operation.key
else
return operation.key
Remove all fork marks from a path. Allows multiple selector paths have shared destination
getCanonicalPath: (continuation, compact) ->
bits = @getContinuation(continuation).split(@DOWN);
last = bits[bits.length - 1]
last = bits[bits.length - 1] = last.split(@RIGHT).pop().replace(@CanonicalizeRegExp, '')
return last if compact
return bits.join(@DOWN)
CanonicalizeRegExp: /\$[^↑]+(?:↑|$)/g
Get path for the scope that triggered the script (e.g. el matched by css rule)
getScopePath: (continuation) ->
bits = continuation.split(@DOWN)
bits[bits.length - 1] = ""
return bits.join(@DOWN)
Return path for given operation
getOperationPath: (operation, continuation) ->
if continuation?
if operation.def.serialized && !operation.def.hidden
return continuation + (operation.key || operation.path)
return continuation
else
return operation.path
Return element that is used as a context for given DOM operation
getContext: (args, operation, scope, node) ->
index = args[0].def && 4 || 0
if (args.length != index && (args[index]?.nodeType))
return args[index]
if !operation.bound
return @scope
return scope;
Return name of intrinsic property used in property path
getIntrinsicProperty: (path) ->
index = path.indexOf('intrinsic-')
if index > -1
if (last = path.indexOf(']', index)) == -1
last = undefined
return property = path.substring(index + 10, last)
Is the value numerical? Helps us to deal with detecting non-linear exps Objects are allowed only if they define custom valueOf function
isPrimitive: (object) ->
if typeof object == 'object'
return object.valueOf != Object.prototype.valueOf
return true
Little shim for require.js so we dont have to carry it around
@require ||= (string) ->
if string == 'cassowary'
return c
bits = string.replace('', '').split('/')
return this[bits[bits.length - 1]]
@module ||= {}
module.exports = Conventions


What are three new things you have learned about yourself and your ego as a result of the core learning?
1. That often my first response is that I cant do something and that I need to change this.
2. That I need to take some time out in busy life and spend it reflecting.
3. That I work best when I have a set plan to follow.
What has surprised you the most about the core learning?
How important it is in the learning process. How the more you understand about yourself and the core
learning the easier
it is to learn the technical stuff.
What were the most challenging aspects of the core learning?
The most challenging part was trying to prioritise the core learning part. I would often get more
interested
and excited
about the technical skills as they seems more "important" but when I actually looked into the core
skills I
realised how
important they were as well.
Why do you think we, a programming school, are spending so much time focusing on core learning in a web
development
bootcamp course?
To make us more employable to prospective employers. Also to help us learn better by understanding how
we
learn best.
Does the time you spent studying core learning here feel like a waste of time? Should you have just used
that time to
practicing programming instead? Justify your answer.
I did struggle at the start to understand the need for so much of it but I do think it is important to
touch
on this
stuff to help us learn better in the future.


|
Ipass project Natan Houwaart
|
Specific declarations for the nfc classes to use. More...
#include "hwlib.hpp"
Go to the source code of this file.
Classes | |
| struct | nfc::cardKeys |
| A struct containing all 32 keys of a mifare classic 1k. Can be altered based on own card setting. More... | |
Namespaces | |
| nfc::pn532::general | |
| General commands of for the pn532. | |
| nfc::pn532::command | |
| Pn532 commands. User manual p.65 & p.66. | |
| nfc::pn532::command::diagnose | |
| Different diagnose commands. User manual p.69 - p.72. | |
| nfc::pn532::command::GPIO | |
| Different GPIO related declarations. | |
| nfc::pn532::command::SAMmode | |
| Different SAM mode configurations. User manual p.89 - p.97. | |
| nfc::pn532::command::RFItem | |
| Different RF configuration options. User manual p.101 - p.106. | |
Enumerations | |
| enum | nfc::mifareCommands : const uint8_t { authenticateKeyA = 0x60, authenticateKeyB = 0x61, Read16Bytes = 0x30, Write16Bytes = 0xA0, Write4Bytes = 0xA2, Incrementation = 0xC1, Decrementation = 0xC0, Transfare = 0xB0, Restore = 0xC2 } |
| Mifare specific commands. | |
| enum | nfc::baudRate : const uint8_t { _9k6Baud = 0x00, _19k2Baud = 0x01, _38k4Baud = 0x02, _57k6Baud = 0x03, _115k2Baud = 0x04, _230k4Baud = 0x05, _460k8Baud = 0x06, _921k6Baud = 0x07, _1m2kBaud = 0x08 } |
| Different baudrates the for the UART protocol. | |
| enum | nfc::statusCode : const uint8_t { pn532StatusOK = 0x00, pn532StatusTimeout = 0x01, pn532StatusCRCError = 0x02, pn532StatusParityError = 0x03, pn532StatusCollisionError = 0x04, pn532StatusMifareFramingError = 0x05, pn532StatusCollisionError2 = 0x06, pn532StatusBufferSizeInsufficient = 0x07, pn532StatusSelftestFail = 0x08, pn532StatusRFBufferOverflow = 0x09, pn532StatusRFFieldTimeout = 0x0A, pn532StatusRFProtocolError = 0x0B, pn532StatusInvalidAckFrame = 0x0C, pn532StatusTemperatureError = 0x0D, pn532StatusInternalBufferOverflow = 0x0E, pn532StatusInvalidParameter = 0x10, pn532StatusMifareAutError = 0x14, pn532StatusUIDCheckByteError = 0x23, pn532StatusWrongConfig = 0x26, pn532StatusWrongCommand = 0x27, pn532StatusReleased = 0x27, pn532StatusOverCurrent = 0x2D, pn532StatusMissingDEP = 0x2E, pn532statusSAMerror = 0x2F } |
| Specific statuscodes the nfc chips can return. | |
| enum | nfc::pn532::command::CardType : const uint8_t { TypeA_ISO_IEC14443 = 0x00, FeliCaPolling212kbps = 0x01, FeliCaPolling424kbps = 0x02, TypeB_IS0_IEC14443 = 0x03, InJewelTag106kbps = 0x04 } |
| Different cardtypes the pn532 can read. | |
Specific declarations for the nfc classes to use.
You can alter / add content of this file to your own liking. This file contains declarations for the pn532's commands, mifare commands, statuscodes etc..


--- mailx.1.html.orig 2008-07-28 15:33:37.000000000 -0700
+++ mailx.1.html 2018-10-14 19:38:44.077272000 -0700
@@ -2953,12 +2953,6 @@
Only applicable if SSL/TLS support is built using OpenSSL.
|
-ssl-v2-allow |
| |
-Accept SSLv2 connections.
-These are normally not allowed
-because this protocol version is insecure.
- |
-|
stealthmua |
| |
Inhibits the generation of
the 'Message-Id:' and 'User-Agent:'
|


public class ObjectBigArrays extends java.lang.Object
In particular, the ensureCapacity()
, grow()
,
trim()
and setLength()
methods allow to handle
arrays much like array lists.
Note that BinIO
and TextIO
contain several methods make it possible to load and save big arrays of primitive types as sequences
of elements in DataInput
format (i.e., not as objects) or as sequences of lines of text.
Warning: creating arrays
using reflection, as it
happens in ensureCapacity(Object[][],long,long)
and grow(Object[][],long,long)
,
is significantly slower than using new
. This phenomenon is particularly
evident in the first growth phases of an array reallocated with doubling (or similar) logic.
BigArrays
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Object[][] |
EMPTY_BIG_ARRAY
A static, final, empty big array.
|
static Hash.Strategy |
HASH_STRATEGY
A type-specific content-based hash strategy for big arrays.
|
| Modifier and Type | Method and Description |
|---|---|
static <K> long |
binarySearch(K[][] a,
K key,
java.util.Comparator<K> c)
Searches a big array for the specified value using
the binary search algorithm and a specified comparator.
|
static <K> long |
binarySearch(K[][] a,
long from,
long to,
K key)
Searches a range of the specified big array for the specified value using
the binary search algorithm.
|
static <K> long |
binarySearch(K[][] a,
long from,
long to,
K key,
java.util.Comparator<K> c)
Searches a range of the specified big array for the specified value using
the binary search algorithm and a specified comparator.
|
static <K> long |
binarySearch(K[][] a,
java.lang.Object key)
Searches a big array for the specified value using
the binary search algorithm.
|
static <K> K[][] |
copy(K[][] array)
Returns a copy of a big array.
|
static <K> void |
copy(K[][] srcArray,
long srcPos,
K[][] destArray,
long destPos,
long length)
Copies a big array from the specified source big array, beginning at the specified position, to the specified position of the destination big array.
|
static <K> K[][] |
copy(K[][] array,
long offset,
long length)
Returns a copy of a portion of a big array.
|
static <K> void |
copyFromBig(K[][] srcArray,
long srcPos,
K[] destArray,
int destPos,
int length)
Copies a big array from the specified source big array, beginning at the specified position, to the specified position of the destination array.
|
static <K> void |
copyToBig(K[] srcArray,
int srcPos,
K[][] destArray,
long destPos,
long length)
Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination big array.
|
static <K> K[][] |
ensureCapacity(K[][] array,
long length)
Ensures that a big array can contain the given number of entries.
|
static <K> K[][] |
ensureCapacity(K[][] array,
long length,
long preserve)
Ensures that a big array can contain the given number of entries, preserving just a part of the big array.
|
static <K> void |
ensureFromTo(K[][] a,
long from,
long to)
Ensures that a range given by its first (inclusive) and last (exclusive) elements fits a big array.
|
static <K> void |
ensureOffsetLength(K[][] a,
long offset,
long length)
Ensures that a range given by an offset and a length fits a big array.
|
static <K> boolean |
equals(K[][] a1,
K[][] a2)
Returns true if the two big arrays are elementwise equal.
|
static <K> void |
fill(K[][] array,
K value)
Fills the given big array with the given value.
|
static <K> void |
fill(K[][] array,
long from,
long to,
K value)
Fills a portion of the given big array with the given value.
|
static <K> K |
get(K[][] array,
long index)
Returns the element of the given big array of specified index.
|
static <K> K[][] |
grow(K[][] array,
long length)
Grows the given big array to the maximum between the given length and
the current length multiplied by two, provided that the given
length is larger than the current length.
|
static <K> K[][] |
grow(K[][] array,
long length,
long preserve)
Grows the given big array to the maximum between the given length and
the current length multiplied by two, provided that the given
length is larger than the current length, preserving just a part of the big array.
|
static <K> long |
length(K[][] array)
Returns the length of the given big array.
|
static <K> K[][] |
newBigArray(K[][] prototype,
long length)
Creates a new big array using the given one as prototype.
|
static java.lang.Object[][] |
newBigArray(long length)
Creates a new big array.
|
static <K> void |
quickSort(K[][] x)
Sorts the specified big array according to the natural ascending order using quicksort.
|
static <K> void |
quickSort(K[][] x,
java.util.Comparator<K> comp)
Sorts the specified big array according to the order induced by the specified
comparator using quicksort.
|
static <K> void |
quickSort(K[][] x,
long from,
long to)
Sorts the specified range of elements according to the natural ascending order using quicksort.
|
static <K> void |
quickSort(K[][] x,
long from,
long to,
java.util.Comparator<K> comp)
Sorts the specified range of elements according to the order induced by the specified
comparator using quicksort.
|
static <K> void |
set(K[][] array,
long index,
K value)
Sets the element of the given big array of specified index.
|
static <K> K[][] |
setLength(K[][] array,
long length)
Sets the length of the given big array.
|
static <K> K[][] |
shuffle(K[][] a,
long from,
long to,
java.util.Random random)
Shuffles the specified big array fragment using the specified pseudorandom number generator.
|
static <K> K[][] |
shuffle(K[][] a,
java.util.Random random)
Shuffles the specified big array using the specified pseudorandom number generator.
|
static <K> void |
swap(K[][] array,
long first,
long second)
Swaps the element of the given big array of specified indices.
|
static <K> java.lang.String |
toString(K[][] a) |
static <K> K[][] |
trim(K[][] array,
long length)
Trims the given big array to the given length.
|
static <K> K[][] |
wrap(K[] array)
Turns a standard array into a big array.
|
public static final java.lang.Object[][] EMPTY_BIG_ARRAY
public static final Hash.Strategy HASH_STRATEGY
This hash strategy may be used in custom hash collections whenever keys are
big arrays, and they must be considered equal by content. This strategy
will handle null
correctly, and it is serializable.
public static <K> K get(K[][] array, long index)
array
- a big array.index
- a position in the big array.public static <K> void set(K[][] array, long index, K value)
array
- a big array.index
- a position in the big array.value
- the new value for the array element at the specified position.public static <K> void swap(K[][] array, long first, long second)
array
- a big array.first
- a position in the big array.second
- a position in the big array.public static <K> long length(K[][] array)
array
- a big array.public static <K> void copy(K[][] srcArray, long srcPos, K[][] destArray, long destPos, long length)
srcArray
- the source big array.srcPos
- the starting position in the source big array.destArray
- the destination big array.destPos
- the starting position in the destination data.length
- the number of elements to be copied.public static <K> void copyFromBig(K[][] srcArray, long srcPos, K[] destArray, int destPos, int length)
srcArray
- the source big array.srcPos
- the starting position in the source big array.destArray
- the destination array.destPos
- the starting position in the destination data.length
- the number of elements to be copied.public static <K> void copyToBig(K[] srcArray, int srcPos, K[][] destArray, long destPos, long length)
srcArray
- the source array.srcPos
- the starting position in the source array.destArray
- the destination big array.destPos
- the starting position in the destination data.length
- the number of elements to be copied.public static <K> K[][] newBigArray(K[][] prototype, long length)
This method returns a new big array of the given length whose element
are of the same class as of those of prototype
. In case
of an empty big array, it tries to return EMPTY_BIG_ARRAY
, if possible.
prototype
- a big array that will be used to type the new one.length
- the length of the new big array.public static java.lang.Object[][] newBigArray(long length)
length
- the length of the new big array.public static <K> K[][] wrap(K[] array)
Note that the returned big array might contain as a segment the original array.
array
- an array.array
.public static <K> K[][] ensureCapacity(K[][] array, long length)
If you cannot foresee whether this big array will need again to be
enlarged, you should probably use grow()
instead.
Warning: the returned array might use part of the segments of the original array, which must be considered read-only after calling this method.
array
- a big array.length
- the new minimum length for this big array.array
, if it contains length
entries or more; otherwise,
a big array with length
entries whose first length(array)
entries are the same as those of array
.public static <K> K[][] ensureCapacity(K[][] array, long length, long preserve)
This method returns a new big array of the given length whose element
are of the same class as of those of array
.
Warning: the returned array might use part of the segments of the original array, which must be considered read-only after calling this method.
array
- a big array.length
- the new minimum length for this big array.preserve
- the number of elements of the big array that must be preserved in case a new allocation is necessary.array
, if it can contain length
entries or more; otherwise,
a big array with length
entries whose first preserve
entries are the same as those of array
.public static <K> K[][] grow(K[][] array, long length)
If you want complete control on the big array growth, you
should probably use ensureCapacity()
instead.
Warning: the returned array might use part of the segments of the original array, which must be considered read-only after calling this method.
array
- a big array.length
- the new minimum length for this big array.array
, if it can contain length
entries; otherwise, a big array with
max(length
,length(array)
/φ) entries whose first
length(array)
entries are the same as those of array
.public static <K> K[][] grow(K[][] array, long length, long preserve)
If you want complete control on the big array growth, you
should probably use ensureCapacity()
instead.
Warning: the returned array might use part of the segments of the original array, which must be considered read-only after calling this method.
array
- a big array.length
- the new minimum length for this big array.preserve
- the number of elements of the big array that must be preserved in case a new allocation is necessary.array
, if it can contain length
entries; otherwise, a big array with
max(length
,length(array)
/φ) entries whose first
preserve
entries are the same as those of array
.public static <K> K[][] trim(K[][] array, long length)
Warning: the returned array might use part of the segments of the original array, which must be considered read-only after calling this method.
array
- a big array.length
- the new maximum length for the big array.array
, if it contains length
entries or less; otherwise, a big array with
length
entries whose entries are the same as
the first length
entries of array
.public static <K> K[][] setLength(K[][] array, long length)
Warning: the returned array might use part of the segments of the original array, which must be considered read-only after calling this method.
array
- a big array.length
- the new length for the big array.array
, if it contains exactly length
entries; otherwise, if it contains more than
length
entries, a big array with length
entries
whose entries are the same as the first length
entries of
array
; otherwise, a big array with length
entries
whose first length(array)
entries are the same as those of
array
.public static <K> K[][] copy(K[][] array, long offset, long length)
array
- a big array.offset
- the first element to copy.length
- the number of elements to copy.length
elements of array
starting at offset
.public static <K> K[][] copy(K[][] array)
array
- a big array.array
.public static <K> void fill(K[][] array, K value)
This method uses a backward loop. It is significantly faster than the corresponding
method in Arrays
.
array
- a big array.value
- the new value for all elements of the big array.public static <K> void fill(K[][] array, long from, long to, K value)
If possible (i.e., from
is 0) this method uses a
backward loop. In this case, it is significantly faster than the
corresponding method in Arrays
.
array
- a big array.from
- the starting index of the portion to fill.to
- the end index of the portion to fill.value
- the new value for all elements of the specified portion of the big array.public static <K> boolean equals(K[][] a1, K[][] a2)
This method uses a backward loop. It is significantly faster than the corresponding
method in Arrays
.
a1
- a big array.a2
- another big array.public static <K> java.lang.String toString(K[][] a)
public static <K> void ensureFromTo(K[][] a, long from, long to)
This method may be used whenever a big array range check is needed.
a
- a big array.from
- a start index (inclusive).to
- an end index (inclusive).java.lang.IllegalArgumentException
- if from
is greater than to
.java.lang.ArrayIndexOutOfBoundsException
- if from
or to
are greater than the big array length or negative.public static <K> void ensureOffsetLength(K[][] a, long offset, long length)
This method may be used whenever a big array range check is needed.
a
- a big array.offset
- a start index.length
- a length (the number of elements in the range).java.lang.IllegalArgumentException
- if length
is negative.java.lang.ArrayIndexOutOfBoundsException
- if offset
is negative or offset
+length
is greater than the big array length.public static <K> void quickSort(K[][] x, long from, long to, java.util.Comparator<K> comp)
The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.
x
- the big array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.comp
- the comparator to determine the sorting order.public static <K> void quickSort(K[][] x, java.util.Comparator<K> comp)
The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.
x
- the big array to be sorted.comp
- the comparator to determine the sorting order.public static <K> void quickSort(K[][] x, long from, long to)
The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.
x
- the big array to be sorted.from
- the index of the first element (inclusive) to be sorted.to
- the index of the last element (exclusive) to be sorted.public static <K> void quickSort(K[][] x)
The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M. Douglas McIlroy, “Engineering a Sort Function”, Software: Practice and Experience, 23(11), pages 1249−1265, 1993.
x
- the big array to be sorted.public static <K> long binarySearch(K[][] a, long from, long to, K key)
a
- the big array to be searched.from
- the index of the first element (inclusive) to be searched.to
- the index of the last element (exclusive) to be searched.key
- the value to be searched for.Arrays
public static <K> long binarySearch(K[][] a, java.lang.Object key)
a
- the big array to be searched.key
- the value to be searched for.Arrays
public static <K> long binarySearch(K[][] a, long from, long to, K key, java.util.Comparator<K> c)
a
- the big array to be searched.from
- the index of the first element (inclusive) to be searched.to
- the index of the last element (exclusive) to be searched.key
- the value to be searched for.c
- a comparator.Arrays
public static <K> long binarySearch(K[][] a, K key, java.util.Comparator<K> c)
a
- the big array to be searched.key
- the value to be searched for.c
- a comparator.Arrays
public static <K> K[][] shuffle(K[][] a, long from, long to, java.util.Random random)
a
- the big array to be shuffled.from
- the index of the first element (inclusive) to be shuffled.to
- the index of the last element (exclusive) to be shuffled.random
- a pseudorandom number generator (please use a XorShift* generator).a
.Copyright © 2019. All rights reserved.


SQL Library
Project in progress
Primary tool: MAMP
I am currently building a personal library of books as a project over my winter break. The library will eventually be able to sort by certain fields, allow users to enter and remove books, and show data visualizations about the library, such as a graph of all books organized by length.
My next step is to transfer my SQL library to a live server. The video below shows my current progress with my localhost.


module.exports = {
apiToken: "YOUR API TOKEN",
onMessage: function (text, update) {
return Promise.resolve("you said: " + text);
}
}
Intro
This is a pure client side Telegram Bot playground mostly for fun and proof of concepts. It runs in long polling mode and uses LocalStorage for checkpointing. Before start a test drive, you need to create your bot following the guide page to get an API Token.
Debug
Debugging logs are directed to developer console, toggle on it for inspection if needed.
Declaration
This project doesn't mean to be used in production environment and have any responsibility of privacy protection.


Go to https://trueability.com
Note: Instructor will provide assessment code
Sign up for next course in series:Managing Container Services with UCP
Take Survey


{% extends "template.html" %} {% block content %}
There was an error verifying your CSRF token. Your request could not be processed. We apologize for the inconvenience!
The most likely cause of this error is that your browser is set up not to accept cookies from us. Please follow these instructions to enable cookies in Firefox, then try again.
If the problem persists, please file a bug. Thanks!
{% endblock %}


iKON'S CHANWOO IS BACK WITH A NEW VIDEO ON HIS YOUTUBE CHANNEL + ASKS FANS TO WATCH HIS VIDEOS MORE OFTEN
by shining-light131On Friday iKON'S maknae Chanwoo has uploaded a new vlog on his channel Chanwoosari with him working hard in putting captions to his own videos. Other than that he even asks fans to watch his videos more often as he noticed that he's latest videos' views is not the same compared to the past. He even thinks that maybe he's videos isn't fun anymore.
Chanwoo is an amazing vlogger and he deserves to be recognized for his efforts. Please give Chanwoo lots of love too.  He's always been so committed to every video he posts. Let’s appreciate it more and remember he's goal to reach 500k subscribers before the year ends? You do right? So what are you waiting for OT7 iKONICS? Watch his latest videos and SUBSCRIBE to CHANWOOSARI NOW!


Paragraph alternative using Bootstrap Concept
Container fluid using some styles
SO thanks for watching my videos and really helpful and share our friends
My Channel is headset


| DOSE: T+ 0:00 |
20 mg |
smoked |
MDMA |
(powder / crystals) |
| |
10 mg |
smoked |
5-MeO-DiPT |
(freebase) |
| |
repeated |
smoked |
Cannabis |
(plant material) |
| T+ 5:00 |
50 mg |
smoked |
MDMA |
(powder / crystals) |
| |
100 mg |
oral |
MDMA |
(capsule) |
So we had been experimenting with a homemade 5-meo-dipt freebase. Just put some foxy in househould ammonia and collected the flaky crystals that formed. We smoked it before and it had the very disting foxy feel to it, but it was different, more spacy and more of a 'high'.
I purchased 2 capsules of 100mg MDMA each, planning on smoking half of one mixed with some 5-meo-dipt between three people. I ended up smoking about 20mg of MDMA and about 10mg of foxy. Weed was continuously smoked throughout the experience. The feeling came on fairly slowly, the hits were not big though. After about 10 minutes my pupils were noticeably dilated and I felt a feeling of psychadelic euphoria. The mdma contributed nicely to the foxy, accentuating the visuals and making the foxy feel more warm and complete. When cannabis was smoked it felt as if I had just gotten stoned of some very nice bud, except it was much more euphoric than just weed and there were minor visuals throughout. My stomach became mildly irritated about T+30 minutes but quickly went away. The high lasted for about 4 hours total. Had it not been for the weed I would imagine it would have lasted half that.
When I got home I remembered that I still had 1 and half caps full of mdma and how can I not take mdma when it is available? So I decided to smoke the rest of the half capsule at about T+5 hours from smoking the original mix. It gave me a strong intense rush and I rolled very hard for about 5 minutes till the rush began to subside and I was left with the pleasant after effects. After the rush wore off I decided it was time to take that other capsule. The capsule came on in about 25 minutes and I shot straight up again. I rolled hard for another hour and a half and had difficulty finally falling asleep which happened about 5 hours after eating the capsule.
All in all this experience was very pleasant. I experienced no bad side effects and the mdma and 5-meo-dipt complemented each other well. I wish to repeat.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Project Roadmap
Where the project is heading ...
QuickLinks
Installations
Home
News
Downloads
Documentation
Screenshots
Online Version
Links
Contribute


Source Location: /AvaTax4PHP/classes/TaxDetail.class.php
TaxDetail.
TaxDetail.class.php
decimal exemption(
)
[line 123]
Gets theExemption amount.
Gets theExemption amount..
[ Top ]
string jurisCode(
)
[line 58]
Gets the JurisCode.
Gets the JurisCode.
[ Top ]
decimal jurisName(
)
[line 134]
Gets the jurisdiction name for this TaxDetail.
Gets the jurisdiction name for this TaxDetail.
[ Top ]
decimal nonTaxable(
)
[line 111]
Gets the non-taxable amount.
Gets the non-taxable amount..
[ Top ]
decimal rate(
)
[line 89]
Gets the Rate amount.
Gets the Rate amount.
[ Top ]
decimal tax(
)
[line 100]
Gets the Tax amount.
Gets the Tax amount.
[ Top ]
decimal taxable(
)
[line 78]
Gets the Taxable amount.
Gets the Taxable amount.
[ Top ]
decimal taxAuthorityType(
)
[line 154]
Gets the taxAuthorityType value for this TaxDetail.
Gets the taxAuthorityType value for this TaxDetail.
[ Top ]
decimal taxName(
)
[line 144]
[ Top ]
[ Top ]


Wave Module¶
The wave module contains a set of functions to calculate quantities of interest for wave energy converters (WEC).
Note
The names of the functions below are of the convention path.path.function
. Only the function name is used when calling the function in MATLAB. For example, to call on mhkit.wave.io.read_NDBC_file
simply use read_NDBC_file
.
IO¶
The io submodule contains the following function to download and load National Data Buoy Center (NDBC) data file into structures, including real time and historical data.
Functions |
Description |
|---|---|
|
Reads a NDBC wave buoy data file (from https://www.ndbc.noaa.gov) into a structure. |
|
Returns the NDBC stations IDs, years, and file names for a requested parameter. |
|
Returns requested NDBC data from passed filenames and parameter. |
-
mhkit.wave.io.ndbc.
NDBC_available_data
(parameter, options)¶ For a given parameter this will return a structure of years, station IDs and file names that contain that parameter data.
- Parameters
parameter (string) – ‘swden’ : ‘Raw Spectral Wave Current Year Historical Data’ ‘stdmet’: ‘Standard Meteorological Current Year Historical Data’
buoy_number (string or py.None (optional)) – Buoy Number. 5-character alpha-numeric station identifier to call: NDBC_available_data(parameter,”buoy_number”,buoy_number)
proxy (structure or py.None (optional)) – To request data from behind a firewall, define a dictionary of proxy settings, for example proxy.http = “http:wwwproxy.yourProxy:80/” to call: NDBC_available_data(parameter,”proxy”,proxy)
- Returns
avaialble_data (Table) – Structure with station_id, years, and NDBC file names.
-
mhkit.wave.io.ndbc.
NDBC_request_data
(parameter, filenames, options)¶ Requests data by filenames and returns a structure of structures for each filename passed. If filenames for a single buoy are passed then the yearly structures in the returned structure (ndbc_data) are indexed by year (e.g. ndbc_data.year_2004). If multiple buoy ids are passed then the returned dictionary is indexed by buoy id and year (e.g. ndbc_data[‘46022’][‘2014’]).
- Parameters
parameter (string) – ‘swden’ : ‘Raw Spectral Wave Current Year Historical Data’ ‘stdmet’: ‘Standard Meteorological Current Year Historical Data’
filenames – Data filenames on https://www.ndbc.noaa.gov/data/historical/{parameter}/
- Returns
ndbc_data (Structure) – Structure of structures broken down by buoy and years of data.
-
mhkit.wave.io.ndbc.
read_NDBC_file
(file_name, varargin)¶ Reads a NDBC wave buoy data file (from https://www.ndbc.noaa.gov) into a structure.
Realtime and historical data files can be loaded with this function.
Note: With realtime data, missing data is denoted by “MM”. With historical data, missing data is denoted using a variable number of # 9’s, depending on the data type (for example: 9999.0 999.0 99.0). ‘N/A’ is automatically converted to missing data.
Data values are converted to float/int when possible. Column names are also converted to float/int when possible (this is useful when column names are frequency).
- Parameters
file_name (string) – Name of NDBC wave buoy data file
missing_value (vector of values (optional)) – vector of values that denote missing data
- Returns
data (Structure)
data.Data: named according to header row
data.time: given in datetime
data.units: the units for each data entry
OR if a spectra data NDBC file
data.spectra: spectra data
data.time: given in datetime
data.frequency: spectral frequency
Resource¶
The resource submodule contains methods to compute wave energy spectra and various metrics from the spectra.
The following options exist to compute wave energy spectra:
Functions |
Description |
|---|---|
|
Calculates a spectra of user defined type. |
|
Calculates wave spectra from wave probe timeseries. |
The following metrics can be computed from the spectra:
Functions |
Description |
|---|---|
|
Calculate the average creat period from spectra. |
|
Calculates the average wave period from spectra |
|
Calculates wave average zero crossing period from spectra |
|
Calculates the omnidirectional wave energy flux of the spectra |
|
Calculates the energy period |
|
Calculates environmental contours of extreme sea states |
|
Calculates the Nth frequency moment of the spectrum |
|
Calculates wave energy period from spectra |
|
Calculates wave height from spectra |
|
Calculates bandwidth from spectra |
|
Calculates wave spectral width from spectra |
|
Calculates wave elevation time series from spectrum using a random phase |
|
Calculates wave celerity (group velocity) |
|
Calculates wave number |
-
mhkit.wave.resource.
average_crest_period
(S, varargin)¶ Calculates the average crest period
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
- frequency_bins: vector (optional)
Bin widths for frequency of S. Required for unevenly sized bins
- Returns
Tavg (double) – Average crest Period (s)
-
mhkit.wave.resource.
average_wave_period
(S, varargin)¶ Calculates the average wave period
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
- frequency_bins: vector (optional)
Bin widths for frequency of S. Required for unevenly sized bins
- Returns
Tavg (float) – Mean wave period (s)
-
mhkit.wave.resource.
average_zero_crossing_period
(S, varargin)¶ Calculates wave average zero crossing period from spectra
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra,x)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
- frequency_bins: vector (optional)
Bin widths for frequency of S. Required for unevenly sized bins
- Returns
Tz (double) – Average Zero Crossing Period (s)
-
mhkit.wave.resource.
bretschneider_spectrum
(frequency, Tp, Hs)¶ Calculates Bretschneider Sprectrum from Tucker and Pitt (2001)
- Parameters
Frequency (float) – Wave frequency (Hz)
Tp (float) – Peak Period (s)
Hs (float) – Significant Wave Height (s)
- Returns
S (structure)
S.spectrum=Spectral Density (m^2/Hz)
S.type=String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency= frequency (Hz)
S.Te
S.Hm0
-
mhkit.wave.resource.
create_spectra
(spectra_type, frequency, Tp, varargin)¶ Calculates wave spectra of user specified type
- Parameters
spectraType (String of spectra type) – Options are: ‘pierson_moskowitz_spectrum’, ‘bretschneider_spectrum’, or ‘jonswap_spectrum’
Frequency (float) – Wave frequency (Hz)
Tp (float) – Peak Period (s)
Hs (float - Required for 'bretschneider_spectrum', and 'jonswap_spectrum') – Significant Wave Height (s)
gamma (float (optional)) – only an optional parameter for ‘jonswap_spectrum’
- Returns
S (structure)
S.spectrum=Spectral Density (m^2/Hz)
S.type=String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency= frequency (Hz)
S.Tp
S.Hs
-
mhkit.wave.resource.
elevation_spectrum
(ts, sample_rate, nnft, time, options)¶ Calculates wave spectra from wave probe timeseries
- Parameters
ts (matrix or table) – Wave probe time-series data, with each column a different time series
sample_rate (float) – Data frequency (Hz)
nnft (integer) – Number of bins in the Fast Fourier Transform
time (vector or table) – time (s)
window (string (Optional)) – Signal window type. “hamming” is used by default given the broadband nature of waves. See scipy.signal.get_window for more options. to call: elevation_spectrum(ts,sample_rate,nnft,time,”window”,window)
detrend (logical (Optional)) – Specifies if a linear trend is removed from the data before calculating the wave energy spectrum. Data is detrended by default. to call: elevation_spectrum(ts,sample_rate,nnft,time,”detrend”,detrend)
noverlap (integer (Optional)) – Number of points to overlap between segments. If None, noverlap = nperseg / 2. Defaults to None. to call: elevation_spectrum(ts,sample_rate,nnft,time,”noverlap”,noverlap)
- Returns
S (structure)
S.spectrum: vector or matrix Spectral Density (m^2/Hz) per probe
S.type: ‘Spectra from Time Series’
S.frequency: frequency [Hz]
S.sample_rate: sample_rate
S.nnft: nnft
-
mhkit.wave.resource.
energy_flux
(S, h, options)¶ - Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
h (float) – Water depth (m)
rho (float (optional)) – water density (kg/m^3) to call: energy_flux(S,h,”rho”,rho)
g (float (optional)) – gravitational acceleration (m/s^2) to call: energy_flux(S,h,”g”,g)
- Returns
J (double) – Omni-directional wave energy flux (W/m)
-
mhkit.wave.resource.
energy_period
(S, varargin)¶ - Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
- frequency_bins: vector (optional)
Bin widths for frequency of S. Required for unevenly sized bins
- Returns
Te (float) – Wave energy Period (s)
-
mhkit.wave.resource.
environmental_contour
(x1, x2, dt, period, options)¶ Calculates environmental contours of extreme sea states using the improved joint probability distributions with the inverse first-order reliability method (IFORM) probability for the desired return period (period). Given the period of interest a circle of iso-probability is created in the in the PCA joint probability (x1, x2) reference frame. Using the joint probability value the CDF of the marginal distribution is used to find the quantile of each component. Finally, using the improved PCA methodology the component 2 contour lines are calculated from component 1 using the relationships defined in Exkert-Gallup et. al. 2016.
Eckert-Gallup, A. C., Sallaberry, C. J., Dallman, A. R., & Neary, V. S. (2016). Application of principal component analysis (PCA) and improved joint probability distributions to the inverse first-order reliability method (I-FORM) for predicting extreme sea states. Ocean Engineering, 112, 307-319.
- Parameters
x1 (vector) – component 1 data
x2 (vector) – component 2 data
dt (double) – x1 and x2 sample rate (seconds)
period (scalar or vector) – Desired return period (years) for calculation of environmental contour, can be a scalar or a vector.
PCA (Structure (optional)) – principal component analysis dictionary from previous function call. When supplied the function will skip the PCA calculation for the passe x1, and x2. to call: environmental_contour(x1,x2,dt,period,”PCA”,PCA)
bin_size (double (optional)) – Data points in each bin to call: environmental_contour(x1,x2,dt,period,”bin_size”,bin_size)
nb_steps (int (optional)) – Discretization of the circle in the normal space used for IFORM calculation. to call: environmental_contour(x1,x2,dt,period,”nb_steps”,nb_steps)
return_PCA (boolean) – Default False, if True will retun the PCA dictionary to call: environmental_contour(x1,x2,dt,period,”return_PCA”,return_PCA)
- Returns
environmental_contour (Structure) – Structure with fields contour1, contour2, and optionally PCA
-
mhkit.wave.resource.
frequency_moment
(S, N, varargin)¶ Calculates the Nth frequency moment of the spectrum
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
N (int) – Moment (0 for 0th, 1 for 1st ….)
frequency_bins (vector (optional)) – Bin widths for frequency of S. Required for unevenly sized bins
- Returns
m (double)
-
mhkit.wave.resource.
jonswap_spectrum
(frequency, Tp, Hs, varargin)¶ Calculates JONSWAP spectrum from Hasselmann et al (1973)
- Parameters
Frequency (float) – Wave frequency (Hz)
Tp (float) – Peak Period (s)
Hs (float) – Significant Wave Height (s)
gamma (float (optional)) – Gamma
- Returns
S (structure)
S.spectrum=Spectral Density (m^2/Hz)
S.type=String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency= frequency (Hz)
S.Te
S.Hm0
-
mhkit.wave.resource.
peak_period
(S)¶ Calculates wave energy period from spectra
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
- Returns
Tp float – Wave Peak Period (s)
-
mhkit.wave.resource.
pierson_moskowitz_spectrum
(frequency, Tp)¶ Calculates Pierson-Moskowitz Spectrum from Tucker and Pitt (2001)
- Parameters
Frequency (float) – Wave frequency (Hz)
Tp (float) – Peak Period (s)
- Returns
S (structure)
S.spectrum=Spectral Density (m^2/Hz)
S.type=String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency= frequency (Hz)
S.Te
S.Hm0
-
mhkit.wave.resource.
significant_wave_height
(S, varargin)¶ Calculates wave height from spectra
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
frequency_bins (vector (optional)) – Bin widths for frequency of S. Required for unevenly sized bins
- Returns
Hm0 (double) – Significant Wave Height (m)
-
mhkit.wave.resource.
spectral_bandwidth
(S, varargin)¶ Calculates bandwidth from spectra
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
- frequency_bins: vector (optional)
Bin widths for frequency of S. Required for unevenly sized bins
- Returns
e (double) – Spectral BandWidth
-
mhkit.wave.resource.
spectral_width
(S, varargin)¶ Calculates wave spectral width from spectra
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
- frequency_bins: vector (optional)
Bin widths for frequency of S. Required for unevenly sized bins
- Returns
e0 (float) – Spectral Width
-
mhkit.wave.resource.
surface_elevation
(S, time_index, options)¶ Calculates wave elevation time series from spectrum using a random phase
- Parameters
S (Spectral Density (m^2/Hz)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
S.spectrum: Spectral Density (m^2/Hz)
S.type: String of the spectra type, i.e. Bretschneider, time series, date stamp etc.
S.frequency: frequency (Hz)
time_index (array) – Time used to create the wave elevation time series [s]
seed (Int (optional)) – random seed to call: wave_elevation(S,time_index,”seed”,seed)
frequency_bins (vector (optional)) – Bin widths for frequency of S. Required for unevenly sized bins to call: wave_elevation(S,time_index,”frequency_bins”,frequency_bins)
phases (vector or matrix (optional)) – Explicit phases for frequency components (overrides seed) to call: wave_elevation(S,time_index,”phases”,phases)
- Returns
wave_elevation (structure)
wave_elevation.elevation: Wave surface elevation (m)
wave_elevation.type: ‘Time Series from Spectra’
wave_elevation.time
-
mhkit.wave.resource.
wave_celerity
(k, h, varargin)¶ Calculates wave celerity (group velocity)
- Parameters
k (wave number (1/m)) –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(frequency,spectra)
OR
- structure of form:
k.values= wave number
k.frequency= frequency (Hz)
h (float) – Water depth (m)
g (float (optional)) – gravitational acceleration (m/s^2)
- Returns
Cg (structure)
Cg.values: water celerity
Cg.frequency [Hz]
Cg.h: height [m]
-
mhkit.wave.resource.
wave_number
(f, h, options)¶ Calculates wave number
- Parameters
f (frequency (Hz)) – vector or numpy array
h (float) – Water depth (m)
rho (float (optional)) – water density (kg/m^3) to call: wave_number(f,h,”rho”,rho)
g (float (optional)) – gravitational acceleration (m/s^2) to call: wave_number(f,h,”g”,g)
- Returns
k (structure)
k.values: wave number
k.frequency: frequency [Hz]
Performance¶
The performance submodule contains functions to compute capture length, statistics, performance matrices, and mean annual energy production.
Functions |
Description |
|---|---|
|
Calculates the real power from DC voltage and current. |
|
Calculates the real power from three phase ac voltage and current. |
|
Calculates the capture length (often called capture width). |
|
Generates a capture length matrix for a given statistic |
|
Calculates mean annual energy production (MAEP) from matrix data along with data frequency in each bin |
|
Calculates mean annual energy production (MAEP) from timeseries |
|
Generates a power matrix from a capture length matrix and wave energy flux matrix |
|
Generates a wave eneergy flux matrix for a given statistic |
-
mhkit.wave.performance.
capture_length
(Power, J)¶ Calculates the capture length (often called capture width).
- Parameters
P (array or vector) – Power [W]
J (array or vector) – Omnidirectional wave energy flux [W/m]
- Returns
L (vector) – Capture length [m]
-
mhkit.wave.performance.
capture_length_matrix
(Hm0, Te, L, statistic, Hm0_bins, Te_bins)¶ Generates a capture length matrix for a given statistic
Note that IEC/TS 62600-100 requires capture length matrices for the mean, std, count, min, and max.
- Parameters
Hm0 (numpy array or vector) – Significant wave height from spectra [m]
Te (numpy array or vector) – Energy period from spectra [s]
L (numpy array or vector) – Capture length [m]
statistic (string) – Statistic for each bin, options include: ‘mean’, ‘std’, ‘median’, ‘count’, ‘sum’, ‘min’, ‘max’, and ‘frequency’. Note that ‘std’ uses a degree of freedom of 1 in accordance with IEC/TS 62600-100. or a callable function of python type
Hm0_bins (numpy array or vector) – Bin centers for Hm0 [m]
Te_bins (numpy array or vector) – Bin centers for Te [s]
- Returns
clm (structure)
clm.values
clm.stat
clm.Hm0_bins
clm.Te_bins
-
mhkit.wave.performance.
mean_annual_energy_production_matrix
(LM, JM, frequency)¶ Calculates mean annual energy production (MAEP) from matrix data along with data frequency in each bin
- Parameters
LM –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(Hm0_bins,L)
OR
structure of form:
LM.values
LM.stat
LM.Hm0_bins
LM.Te_bins
- Returns
maep (float) – Mean annual energy production
-
mhkit.wave.performance.
mean_annual_energy_production_timeseries
(L, J)¶ Calculates mean annual energy production (MAEP) from timeseries
- Parameters
L (numpy array or vector) – Capture length
J (numpy array or vector) – Wave energy flux
- Returns
maep (float) – Mean annual energy production
-
mhkit.wave.performance.
power_matrix
(LM, JM)¶ Generates a power matrix from a capture length matrix and wave energy flux matrix
- Parameters
LM –
- Pandas data frame
To make a pandas data frame from user supplied frequency and spectra use py.mhkit_python_utils.pandas_dataframe.spectra_to_pandas(Hm0_bins,L)
OR
structure of form:
LM.values
LM.stat
LM.Hm0_bins
LM.Te_bins
- Returns
PM (Structure)
PM.values: Power matrix
PM.stat: statistic of the matrix (i.e. “mean”, “max”, etc.) (string)
PM.Hm0_bins
PM.Te_bins
-
mhkit.wave.performance.
wave_energy_flux_matrix
(Hm0, Te, J, statistic, Hm0_bins, Te_bins)¶ Generates a wave eneergy flux matrix for a given statistic
Note that IEC/TS 62600-100 requires capture length matrices for the mean, std, count, min, and max.
- Parameters
Hm0 (numpy array or vector) – Significant wave height from spectra [m]
Te (numpy array or vector) – Energy period from spectra [s]
J (numpy array or vector) – wave energy flux from spectra [W/m]
statistic (string) – Statistic for each bin, options include: ‘mean’, ‘std’, ‘median’, ‘count’, ‘sum’, ‘min’, ‘max’, and ‘frequency’. Note that ‘std’ uses a degree of freedom of 1 in accordance with IEC/TS 62600-100.
Hm0_bins (numpy array or vector) – Bin centers for Hm0 [m]
Te_bins (numpy array or vector) – Bin centers for Te [s]
- Returns
WEFM (Structure)
WEFM.values
WEFM.stat
WEFM.Hm0_bins
WEFM.Te_bins
Graphics¶
The :graphics submodule contains functions to plot wave data and related metrics.
Functions |
Description |
|---|---|
|
Plots wave elevation timeseries |
|
Plots an overlay of the x1 and x2 variables to the calculated environmental contours. |
|
Plots the matrix with Hm0 and Te on the y and x axis |
|
Plots wave amplitude spectrum |
-
mhkit.wave.graphics.
plot_chakrabarti
(H, lambda_w, D, options)¶ Plots, in the style of Chakrabarti (2005), relative importance of viscous, inertia, and diffraction phemonena
Chakrabarti, Subrata. Handbook of Offshore Engineering (2-volume set). Elsevier, 2005.
- Parameters
H (integer, double or vector) – Wave height [m]
lambda_w (integer, double or vector) – Wave length [m]
D (integer, double or vector of) – Characteristic length [m]
savepath (string (optional)) – path and filename to save figure. to call: plot_chakrabarti(H,lambda_w,D,”savepath”,savepath)
- Returns
figure (figure)
Plots wave force regime as Keulegan-Carpenter parameter versus
diffraction parameter
- Examples
Using Integers >> D = 5 >> H = 8 >> lambda_w = 200 >> plot_chakrabarti(H,lambda_w,D)
Using vector >> D = linspace(5,15,5) >> H = 8*ones(size(D)) >> lambda_w = 200*ones(size(D)) >> plot_chakrabarti(H,lambda_w,D)
-
mhkit.wave.graphics.
plot_elevation_timeseries
(wave_elevation, options)¶ Plots wave elevation timeseries
- Parameters
wave_elevation (Structure of the following form:) –
wave_elevation.elevation: elevation [m]
wave_elevation.time: time (s);
title (string (optional)) – title for the plot to call: plot_elevation_timeseries(wave_elevation,”title”,title)
savepath (string (optional)) – path and filename to save figure. to call: plot_elevation_timeseries(wave_elevation,”savepath”,savepath)
- Returns
figure (figure) – Plot of wave elevation vs. time
-
mhkit.wave.graphics.
plot_environmental_contours
(x1, x2, x1_contour, x2_contour, options)¶ Plots an overlay of the x1 and x2 variables to the calculated environmental contours.
- Parameters
x1 (vector) – x-axis data
x2 (vector) – y-axis data
x1_countour (Table) – Calculated x1 contour values
x2_countour (Table) – Calculated x2 contour values
x_label (string (optional)) – x-axis label. Default None. to call: plot_environmental_contours(x1,x2,x1_contour,x2_contour,”x_label”,x_label)
y_label (string (optional)) – y-axis label. Default None. to call: plot_environmental_contours(x1,x2,x1_contour,x2_contour,”y_label”,y_label)
data_label (string (optional)) – Legend label for x1, x2 data (e.g. ‘Buoy 46022’). Default None. to call: plot_environmental_contours(x1,x2,x1_contour,x2_contour,”data_label”,data_label)
contour_label (string or array of strings (optional)) – Legend label for x1_contour, x2_contour countor data (e.g. ‘100-year contour’). Default None. to call: plot_environmental_contours(x1,x2,x1_contour,x2_contour,”contour_label”,contour_label)
title (string (optional)) – title for the plot to call: plot_environmental_contours(x1,x2,x1_contour,x2_contour,”title”,title)
savepath (string (optional)) – path and filename to save figure. to call: plot_environmental_contours(x1,x2,x1_contour,x2_contour,”savepath”,savepath)
- Returns
figure (figure) – Envoronmental contour plot
-
mhkit.wave.graphics.
plot_matrix
(M, Mtype, options)¶ Plots the matrix with Hm0 and Te on the y and x axis
- Parameters
M (structure) –
M.values: matrix
M.Hm0_bins
M.Te_bins
M.stat
Mtype (string) –
- type of matrix (i.e. power, capture length, etc.) to be used
in plot title
- savepath: string (optional)
path and filename to save figure. to call: plot_matrix(M, Mtype,”savepath”,savepath)
- Returns
figure (plot of the matrix)
-
mhkit.wave.graphics.
plot_spectrum
(wave_spectra, options)¶ Plots wave amplitude spectrum
- Parameters
wave_spectra –
- Returns
figure (figure)
Plot of wave amplitude spectra versus omega


DepthToSpace for tensors of type T.
tf.compat.v2.nn.depth_to_space
tf.nn.depth_to_space( input, block_size, data_format='NHWC', name=None )
Rearranges data from depth into blocks of spatial data.
This is the reverse transformation of SpaceToDepth. More specifically,
this op outputs a copy of the input tensor where values from the depth
dimension are moved in spatial blocks to the height
and width
dimensions.
The attr block_size
indicates the input block size and how the data is moved.
block_size * block_size
from depth are rearranged
into non-overlapping blocks of size block_size x block_size
input_depth * block_size
, whereas the
height is input_height * block_size
.block_size * block_size
.The data_format
attr specifies the layout of the input and output tensors
with the following options:
"NHWC": [ batch, height, width, channels ]
"NCHW": [ batch, channels, height, width ]
"NCHW_VECT_C":
qint8 [ batch, channels / 4, height, width, 4 ]
It is useful to consider the operation as transforming a 6-D Tensor. e.g. for data_format = NHWC, Each element in the input tensor can be specified via 6 coordinates, ordered by decreasing memory layout significance as: n,iY,iX,bY,bX,oC (where n=batch index, iX, iY means X or Y coordinates within the input image, bX, bY means coordinates within the output block, oC means output channels). The output would be the input transposed to the following layout: n,iY,bY,iX,bX,oC
This operation is useful for resizing the activations between convolutions (but keeping all data), e.g. instead of pooling. It is also useful for training purely convolutional models.
For example, given an input of shape [1, 1, 1, 4]
, data_format = "NHWC" and
block_size = 2:
x = [[[[1, 2, 3, 4]]]]
This operation will output a tensor of shape [1, 2, 2, 1]
:
[[[[1], [2]], [[3], [4]]]]
Here, the input has a batch of 1 and each batch element has shape [1, 1, 4]
,
the corresponding output will have 2x2 elements and will have a depth of
1 channel (1 = 4 / (block_size * block_size)
).
The output element shape is [2, 2, 1]
.
For an input tensor with larger depth, here of shape [1, 1, 1, 12]
, e.g.
x = [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]
This operation, for block size of 2, will return the following tensor of shape
[1, 2, 2, 3]
[[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]]
Similarly, for the following input of shape [1 2 2 4]
, and a block size of 2:
x = [[[[1, 2, 3, 4], [5, 6, 7, 8]], [[9, 10, 11, 12], [13, 14, 15, 16]]]]
the operator will return the following tensor of shape [1 4 4 1]
:
x = [[[ [1], [2], [5], [6]], [ [3], [4], [7], [8]], [ [9], [10], [13], [14]], [ [11], [12], [15], [16]]]]
input
: A Tensor
.block_size
: An int
that is >= 2
.
The size of the spatial block, same as in Space2Depth.data_format
: An optional string
from: "NHWC", "NCHW", "NCHW_VECT_C"
. Defaults to "NHWC"
.name
: A name for the operation (optional).A Tensor
. Has the same type as input
.


At WSO2Con this year, we announced an entirely new open source programming language just for integration.
You might be wondering what’s gotten into us. After all, hasn’t Java been doing just fine all this time? Let us explain.
Historically, integration has been about connecting systems together. The stuff that does this - the middleware that we build - has always been software glue; it stuck the important bits together and generally stayed out of the way.
This model was built for an age when enterprises were basically collections of heavily customised, monolithic on-premise systems that had to work together. In today’s world, however, we have so many excellent pre-built systems - especially cloud services - that we now spend most our time composing systems out of pre-built blocks. There’s always a library or a service that you can just plug in there instead of reinventing the wheel.
In this context, integration becomes part and parcel of the actual process of building systems. Connecting X to Y and making sure it works with Z is practically the real core of a developer’s workload.
You’d think that we’d have built tools for this, but we haven’t. Our integration logic is largely done in languages meant for something else - Java, Python, and so on.
This was why we decided to create a language meant for integration, and for integration only. Which brought us to the next problem: how would that work?
Voila! We’d found exactly what we needed to make this work. By describing what we need in diagrams (which are then translated to code), anyone can not just explain, but also create integration logic with unprecedented ease.
For example, let’s take an echo service. Here’s how it would look in Ballerina code:
import ballerina.net.http; @BasePath("/echo") service echo { @POST resource echo(message m) { http:convertToResponse(m ); reply m; } }
And this is how the Ballerina editor will visually represent this. See how everything can be mapped onto the diagram?
Let’s examine a second, more complex scenario: a passthrough service that will trasmit a message to a backend and send the response to the client. Here the 'nyseStockQuoteService' will act as a backend.
import ballerina.lang.message; import ballerina.net.http; @BasePath("/passthrough") service passthrough { @GET resource passthrough(message m) { http:HTTPConnector nyseEP = new http:HTTPConnector("http://localhost:9090" ); message response; response = http:HTTPConnector.get(nyseEP,"/nyseStock", m); reply response; } } @BasePath("/nyseStock") service nyseStockQuote { @GET resource stocks(message m) { message response; json payload; payload = `{"exchange":"nyse", "name":"IBM", "value":"127.50"}`; message:setJsonPayload(response, payload); reply response; } }
This, when created in the visual editor, is:
We’ve also kept true to the idea that this would be a language designed explicitly for integration. Sure, you can write a calculator with it, but you wouldn’t want to: there are better languages for that. On the other hand, if you want to write integration logic, Ballerina will eventually be the go-to language for that.
At present, Ballerina is a project. We still have a great many improvements to ship - including speed, stability and tooling.
However, the core of the Ballerina experience is available in our 0.8 GA release. You can check out the documentation, examine the code on GitHub, and do stuff with it. Contributors are welcome - we’re driving the future of integration here, and we’d like all the help we can get. So give Ballerina a whirl, and let’s go make integration great again!


Farfetch loses $86M in Q3
by PA/LusaFarfetch lost $85.5 million in the third quarter of this year, 10.6% more than those found in the same quarter of the previous year, the company said in a statement.
This Portuguese platform for online trade in luxury products and brands, listed on Wall Street, had a yutnover of $255.5 million, which corresponded to year-on-year growth of 90%.
The company closed the stock market session down 6.85%


{% extends 'core/base.html' %} {% load static %} {% block main %} {{ title }} Your password was changed. {% endblock main %} {% block aside %} {% endblock aside %}
Your password was changed.


Color Cycler Gadget¶
This guide steps through the process of creating an Alexa Gadget with an LED and a button, that cycles through different colors and reports the LED color when the button is pressed.
Prerequisites¶
In order to to run this example you should already have a Raspberry Pi with the Alexa-Gadgets-Raspberry-Pi-Samples software installed. Learn more in the project README. In addition, you will need the following hardware:
Header pins soldered to your Raspberry Pi (used for connecting hardware)
common anode RGB LED
Three 220 ohm resistors
Six male-female jumper wires
Step 1: Connect the RGB LED and button to your Pi¶
Before getting started with instructions on wiring your gadget, please note the following:
The wire coloring mentioned below is for reference sake only, for making it easier to follow the setup instructions using the diagrams. You can use wires with any colors, as long as you connect the wires to the correct Raspberry Pi pins and breadboard holes based on the instructions.
Breadboards come with holes labeled from 1-30 or 1-60 (based on the size of the breadboard) for rows and A-J for columns. The instructions below has references to the hole labels based on the setup shown in Figure 3, you can use different holes as long as the hardware components are placed correctly as shown in Figure 3.
The Raspberry Pi comes with Pins labelled from 1-40. You need to connect the wires to the exact pins as mentioned in the instructions, as the gadget code is configured to use these specific pins.
The following steps walk you through connecting the RGB LED and button:
Make sure your Raspberry Pi is powered off.
To connect a RGB LED, connect jumper wires to the vcc and GPIO pins on the Raspberry Pi as shown in the wiring diagram below (Figure 3):
Brown wire to the Pin 1 (3.3v) of Raspberry Pi,
Red wire to Pin 3 (GPIO 2) of Raspberry Pi,
Green wire to Pin 5 (GPIO 3) of Raspberry Pi,
and Blue wire to Pin 7 (GPIO 4) of Raspberry Pi.
Push the common anode RGB LED’s legs into the bread board, starting from Hole A5 to A8 such that: (refer to Figure 1 for RGB LED Pinout)
the leftmost leg (Red) is placed in hole A5,
the longest leg (VCC) is second from the left and is placed in hole A6,
the third leg from left (Green) is placed in hole A7,
and, the rightmost leg (Blue) is placed in hole A8.
As shown in the wiring diagram below (Figure 3), place one end of three 220 ohms resistors in the holes D5, D7, and D8 respectively of the breadboard, such that they connect to the rows connected to the 1st (Red), 3rd (Green), and 4th (Blue) legs of the RGB LED from the left (refer to Figure 1 for RGB LED Pinout). Place the other end of the three resistors in the holes F5, F7, and F8 respectively of the breadboard as shown in Figure 3.
Connect the Brown wire directly into hole D6 of the breadboard to connect it to the longest leg (VCC) of the RGB LED.
Connect the Red wire into hole G5 of the breadboard to connect it to the resistor connected to the 1st leg from the left (Red), the Green wire into hole G7 of the breadboard to connect it to the resistor connected to the 3rd leg from the left (Green), and the Blue wire into hole G8 of the breadboard to connect it to the resistor connected to the 4th leg from the left (Blue).
To connect a button, connect jumper wires to the Raspberry Pi pins as shown in the wiring diagram below (Figure 3):
Black wire to the Pin 6 (GND) of Raspberry Pi,
Orange wire to Pin 8 (GPIO 14) of Raspberry Pi.
Push the button into the breadboard, such that both the signal pins are in the holes A3 and D3 of the breadboard; and the GND pins are in the holes A1 and D1 of the breadboard. (refer to Figure 2 for Button Pinout).
As shown in the wiring diagram below (Figure 3), connect the Orange wire to the hole E3 of the breadboard; and the Black wire to the hole E1 of the breadboard.
Once this setup is complete, start up your Pi.
Step 2: Configure your credentials¶
Now that the RGB LED and the button are connected to your Pi, you can continue on with the example.
As with any example, you’ll need to first add the credentials that are associated with the gadget you created in the Alexa Voice Service Developer Console:
On the command line of your Pi, navigate to
/home/pi/Alexa-Gadgets-Raspberry-Pi-Samples/src/examples/color_cycler
and open thecolor_cycler.ini
file within that folder.Change the
amazonId
fromYOUR_GADGET_AMAZON_ID
to the Amazon ID that is displayed on the gadget’s product page in the Alexa Voice Service Developer Console.Change the
alexaGadgetSecret
fromYOUR_GADGET_SECRET
to the Alexa Gadget Secret that is displayed on the gadget’s product page in the Alexa Voice Service Developer Console.
You can also use the launch script’s setup mode to configure all the credentials for all the examples at once as follows:
Start the launch script in setup mode
sudo python3 launch.py --setup
Enter ‘y’ when prompted for configuring the gadget credentials; and enter the
amazonId
andalexaGadgetSecret
that is displayed on the gadget’s product page in the Alexa Voice Service Developer Console.
To learn more, refer to Register a Gadget in the Alexa Gadgets Toolkit documentation.
Step 3: Explore the example¶
The example follows the same model as other examples that you can browse within the Alexa-Gadgets-Raspberry-Pi-Samples project.
Configuration¶
Within the color_cycler.ini
file, in addition to the credentials you just modified, you will see a group of [GadgetCapabilities]
that this gadget is registering for. In this case, it is registering for a custom interface called Custom.ColorCyclerGadget
:
[GadgetCapabilities]
Custom.ColorCyclerGadget = 1.0
In this example, you will be using version 1.0 of a custom interface that you will define. This interface is accessible via a custom skill that you will create using Python or Node.js.
Code¶
Within color_cycler.py
, you’ll notice the import and use of gpiozero library for using Raspberry Pi’s GPIO capabilities to control the RGB LED and button, as well as other packages:
from gpiozero import RGBLED, Button
from colorzero import Color
import json
You’ll also notice the setup of the RGB LED and the button. Note that while setting up the RGB LED, the active_high
parameter should be set to False for common anode LED or True for common cathode LED.
RGB_LED = RGBLED(GPIO_LED_RED, GPIO_LED_GREEN, GPIO_LED_BLUE,
active_high=False, initial_value=(0, 0, 0))
BUTTON = Button(GPIO_BUTTON)
You will also see custom callbacks that react to the directives that are received through the custom interface (Custom.ColorCyclerGadget
) that you will create. For this example, you will create 2 different directives (BlinkLED
and StopLED
) under the same custom interface.
The callback function names are defined in the following format: oncustom*namespace
*_*name
* (namespace
should be without Custom.
prefix) as described in Custom Callbacks section.
def on_custom_colorcyclergadget_blinkled(self, directive):
"""
Handles Custom.ColorCyclerGadget.BlinkLED directive sent from skill
by triggering LED color cycling animations based on the received parameters
"""
payload = json.loads(directive.payload.decode("utf-8"))
self.lock.acquire()
# Initialize the color animation states based on parameters received from skill
self.colors_list = payload['colors_list']
self.intervalMs = payload['intervalMs']
self.iterations = payload['iterations']
self.cycle_count = 0
self.game_active = bool(payload['startGame'])
self.keep_cycling = True
self.lock.release()
def on_custom_colorcyclergadget_stopled(self, directive):
"""
Handles Custom.ColorCyclerGadget.StopLED directive sent from skill
by stopping the LED animations
"""
# Turn off the LED and disable the color animation states to stop the LED cycling animation
RGB_LED.off()
self.lock.acquire()
self.keep_cycling = False
self.game_active = False
self.lock.release()
BlinkLED
directive will animate the RGB LED based on the parameters received from the custom skill, whereas StopLED
directive will turn off any ongoing LED animation.
You’ll also notice that a separate thread is created for animating the RGB LED based on the color animation states.
self.led_thread = threading.Thread(target=self._led_blink)
self.led_thread.start()
The callbacks for BlinkLED
and StopLED
will change the color animation states, and the infinite loop running in the LED animation thread will animate the RGB LED based on these changes.
def _led_blink(self):
"""
Plays the LED cycling animation based on the color animation states
"""
while True:
# If cycling animation is still active
if self.keep_cycling and self.cycle_count < len(self.colors_list) * self.iterations:
self.lock.acquire()
self.color = self.colors_list[self.cycle_count
% len(self.colors_list)]
self.cycle_count = self.cycle_count + 1
self.lock.release()
# Set the color for the LED
RGB_LED.color = Color(self.color.lower())
# Display the color for specified interval before switching again
time.sleep(self.intervalMs/1000)
# If button is pressed, display the current color for 5 seconds
elif not self.keep_cycling and self.game_active:
time.sleep(5)
RGB_LED.off()
self.lock.acquire()
self.game_active = False
self.lock.release()
else:
time.sleep(0.1)
You will also see a callback setup for the button press:
BUTTON.when_pressed = self._button_pressed
This callback will report the color of the LED back to the custom skill using custom event ReportColor
under the custom interface Custom.ColorCyclerGadget
.
def _button_pressed(self):
"""
Callback to report the LED color to the skill when the button is pressed
"""
if self.game_active:
logger.debug('Button Pressed: Current color = ' + self.color)
# Send custom event to skill with the color of the LED
payload = {'color': self.color}
self.send_custom_event(
'Custom.ColorCyclerGadget', 'ReportColor', payload)
self.lock.acquire()
# Stop the LED cycling animation
self.keep_cycling = False
self.lock.release()
Step 4: Create your Custom Skill¶
For an Alexa Gadget to receive and react to custom directives and for Alexa to receive and react to custom events sent from the gadget, the custom directives and the custom events should be sent and received respectively by a custom skill. The skill can be coded in any language you like, however Alexa Skills Kit SDK is offered only for NodeJS, Python and Java and two example skills are provided with this sample: a NodeJS version, and a Python version. The following steps guide you through setting up and deploying the example skill that will work with your gadget. The skill sends down directives to your gadget to control the animation of the RGB LED and receives events from your gadget reporting the color of the LED when the button is pressed.
Note: although two versions of the example skill are provided, one for NodeJS and one for Python, the two are different implementations of the same thing, provided for convenience. You should only deploy one of the skills, depending on which language you are more comfortable with.
The instructions below will walk you through deploying the example skills from scratch, using the Amazon Developer Portal web UI and the Amazon Web Services (AWS) console UI. It is also possible to deploy the example skills using the ASK CLI.
The setup and deployment process is nearly identical for both the NodeJS and the Python skill samples, with minor changes in the steps required to package the code and the configuration of the Lambda function: one uses the NodeJS runtime and the other Python; and the former uses npm
for managing dependencies while the latter uses pip
.
For the NodeJS skill you must have NodeJS 8 or newer installed on your computer. If you don’t have NodeJS installed, you can quickly get it installed using NVM (the Node Version Manager) on Linux and Mac, or using NVM for Windows on Windows.
For the Python skill you must have Python 3.6 or newer installed on your computer. To check what version of Python you have installed, type this command in the terminal on your machine:
python --version
You should see something like: “Python 3.6”
Prepare the skill code for Deployment (NodeJS Version)¶
Before you can deploy the code to Lambda you must run npm install
to get copies of the dependent packages used by the skill. These dependencies will be downloaded by npm
(the NodeJS Package Manager) locally, into a folder called node_modules
that will be placed into the skill/NodeJS/lambda/custom
directory.
The skill code is provided in the index.js, and the dependencies are mentioned in package.json
IMPORTANT: Make sure to execute the following commands from the ``lambda/custom`` directory of the NodeJS skill sample in this repository.
Install npm dependencies by navigating into the
skill/NodeJS/lambda/custom
directory and running the npm command:npm install
(you will need to run this command from the terminal, or command prompt on Windows) .. code-block:: bashnpm install
Create a zip archive of the code and dependencies while still in the
skill/NodeJS/lambda/custom
directory (remember, we are zipping the contents of the folder, not the folder itself)
zip -r ../../skill-code.zip .
The file skill-code.zip
, located in the skill/NodeJS
directory, will contain the skill code as well as the necessary dependencies and will be uploaded to Lambda in the next section.
Prepare the skill code for Deployment (Python Version)¶
Before you can deploy the code to Lambda you must run pip install
to get copies of the dependent packages used by the skill. These dependencies will be downloaded by pip
(the package installer for Python) locally, into a directory called skill_env
that will be placed into the skill/python/lambda
directory.
The skill code is provided in the lambda_function.py, and the dependencies are mentioned in requirements.txt
IMPORTANT: Make sure to execute the following command from the ``lambda`` directory of the Python skill sample in this repository.
On your system, navigate into the
skill/python/lambda
directory and install the dependencies in a new folder called “skill_env” using the following command: .. code-block:: bashpip install -r requirements.txt -t skill_env
Copy the skill code from the
skill/python/lambda/
folder into theskill_env
folder: .. code-block:: bashcp lambda_function.py skill_env/
Create a zip archive of the code and dependencies while still in the
skill/python/lambda
directory (remember, we are zipping the contents of the folder, not the folder itself) .. code-block:: bashcd skill_env zip -r ../../skill-code.zip .
The file skill-code.zip
, located in the skills/Python
directory, will contain the skill code as well as the necessary dependencies and will be uploaded to Lambda in the next section.
(Optional) Follow the ASK Python SDK Getting Started documentation, to check alternative ways of installing the sdk and deploying to AWS Lambda console.
Create your Lambda function¶
Sign in to the AWS Management Console and open the AWS Lambda Console.
Make sure the Region on the top right corner is set to N. Virginia.
Click Create function, leave Author from scratch selected, and name the function whatever you like.
Select Runtime as NodeJs 10.x or Python 3.6, depending on which skill you are deploying.
For Permissions, if you don’t already have a role that allows for basic Lambda execution, follow Defining a New Role for the Function to create a new role from a template.
Click on Create function.
Change the Code entry type to Upload a ZIP and select the zip you created in the Prepare the Code for Deployment section above.
Save the Lambda by clicking the Save button in the upper right corner of the screen.
Explore the skill code¶
Depending on which language you picked, you can find a brief exploration of the code in the README files within each skill sample directory, corresponding to your language:
Create your skill¶
Sign in to the Alexa Skills Kit Developer Console</a> and click Create Skill.
Enter Skill name as color cycler. Leave the Choose a model to add to your skill to Custom, and Choose a method to host your skill’s backend resources to Provision your own.
Click on Create skill on the top right corner of the screen.
On the Choose a template screen, choose Start from scratch and click on the Choose button on the top right corner of the screen.
The skill is created. Now, click on JSON Editor in the left pane.
Add utterance samples for Amazon.YesIntent and Amazon.NoIntent as follows: Note: This sample assumes that the skill is a US-based skill.
{ "name": "AMAZON.YesIntent", "samples": [ "yes", "yes please", "sure" ] }, { "name": "AMAZON.NoIntent", "samples": [ "no", "no thanks" ] },
Click on Save Model on the top.
On the left, click Endpoint.
Select AWS Lambda ARN.
Copy the skill ID.
Next, go back to your Lambda function in the AWS Lambda Console.
In the AWS Lambda Console, on the left, under Add Triggers, select Alexa Skills Kit.
At the bottom of the screen, paste in the skill ID, and then click Add. Next.
Save the Lambda.
At the top of the screen, copy the ARN.
Return to editing your skill in the Alexa Skills Kit Developer Console.
Within the Endpoint section, paste in the Lambda ARN from the function that you created, in the Default Region field under AWS Lambda ARN, and then click Save Endpoints.
On the left, select Interfaces and turn on the toggle for Custom Interface Controller to enable the skill to use Custom Interfaces.
Then, click on Save Interfaces at the top of the screen.
On the left, select Invocation. Then, at the top of the screen, click Build Model.
It will take a few seconds to build the model. A Build Successful message will be posted on the bottom right of the screen once the model is built successfully.
Test your skill¶
At this point, it’s best to ensure that your skill is working before you move on. You can do this as follows:
In the Alexa Skills Kit Developer Console, select your skill. Then, at the top, click Test.
Under the header, you will see a dropdown menu, click on it and select Development.
You now have a few ways to test that your skill is working:
Using the Alexa Simulator in the Developer Console: If you are continuing from the previous step, you are already in the Test tab of your skill. Type in ‘Open Color Cycler’ and verify that the response comes back without an error. Alexa should respond indicating that no gadgets were found (since this is a simulator). You can also see the JSON for Alexa’s response.
Using the Echo device that is paired to your gadget: Say “Alexa, Open Color Cycler”. If the gadget is connected, Alexa should respond with a welcome message describing the game and asking if you are ready. Else, Alexa will respond indicating that no gadgets were found.
Step 5: Test your gadget¶
In order for this gadget to function, it will need to be paired to a compatible Echo device. Before running the example, refer to the pairing guide to learn how to pair your gadget.
With your Echo device nearby, run the Python code:
sudo python3 launch.py --example color_cycler
Once your gadget paired/connected, ask Alexa:
“Alexa, open Color Cycler”
The gadget will receive the BlinkLED
directive which will turn its LED to green, and Alexa will describe the game and ask you if you’re ready to play.
If you answer ‘yes’, the gadget will receive another BlinkLED
directive to animate the LED to cycle through a list of colors. Press the button on the gadget within 10 seconds, and Alexa will respond with the color on the LED as a result of the ReportColor
being sent from the gadget.
If you don’t press the button within 10 seconds or if you answer ‘no’ to the initial prompt or at any time during the game you stop or cancel the skill, the gadget will receive a StopLED
directive which will turn off the LED animation.
Troubleshooting Color cycler gadget:¶
If upon opening the Color Cycler skill, Alexa says ‘No gadgets found.’, ensure that the color cycler gadget is connected successfully. If your gadget fails to connect, stop the Python script by pressing
CTRL + C
, and run it again:sudo python3 launch.py --example color_cycler
.If the RGB LED doesn’t light up when the skill is launched, or if the reported color doesn’t match with the color on the RGB LED, ensure that the RGB LED is connected correctly by following the instructions in steps 2-6 in Step 1: Connect the RGB LED and button to your Pi.
If pressing the button doesn’t make Alexa report the color, ensure that the button is connected correctly by following the instructions in steps 7-9 in Step 5: Connect the RGB LED and button to your Pi.
What’s next¶
Now that you understand working with Custom Directives and Custom Events, you can alter this example or create a new Skill and Gadget code to build upon.
To learn more about Alexa Gadgets Toolkit capabilities, review the documentation.


<lcPlanPrereqs>
The <lcPlanPrereqs> element provides the knowledge, skills, abilities, courses and other activities learners must have satisfied to take the instruction.
Category: Learning and training: common content elements


Our investigation into reformulation and more specifically bilevel reasoning has been prompted by a series of examples. Each example includes some set of axioms and then the result of reformulating those axioms, where the reformulated version is more efficient to process for some kinds of queries. Here we attempt to catalog those examples and the techniques used to perform the reformulation. Many of the examples are either set in the context of bilevel reasoning, or rely on it to help amortize the cost of the reformulation.
Definition (Bilevel Pair): A bilevel pair is <Γ, M>, where Γ is a set of axioms, M is a Herbrand model, and vocabulary[Γ] ∪ vocabulary[M], denoted vocabulary[<Γ,M>], meets the definition for a vocabulary (see definition for a vocabulary).
Satisfaction for bilevel pairs can be defined using the notion of a model's reduct, which is just a way of talking about the portion of a model in a shrunken vocabulary.
Definition (Reduct): The reduct of model M wrt vocabulary V, written Reduct[M,V] is the intersection of M and the ground atoms of V.
Definition (Bilevel Satisfaction): Let <Γ, M> be a bilevel pair, where Γ consists of closed sentences. Let N be a model in the vocabulary V = vocabulary[<Γ,M>]. N satisfies the pair exactly when N satisfies Γ wrt V and the portion of N corresponding to the vocabulary of M is the same as M.
Just as the set of models for an axiomatization Δ is usually denoted Mod[Δ], we can use Mod[<Γ,M>] to denote the set of models that satisfy the bilevel pair <Γ,M>. Entailment in bilevel reasoning can therefore be defined follows.
Definition (Bilevel Entailment): Let P be a bilevel pair and φ a closed sentence. P entails φ exactly when every model that satisfies P satisfies φ.
Just as Cn[Δ] is the set of all sentences entailed by a set of axioms Δ, we can use Cn[<Γ,M>] to denote the set of sentences entailed by the bilevel pair <Γ,M>. We also use Cn[M], where M is a model, to denote the set of all sentences satisfied by the model M.
As we will see, separating data from axioms is sometimes convenient, but mainly for reasons to do with modularity and/or computational complexity. As long as the model is finite, a bilevel pair can always be represented as a simple set of axioms in Herbrand logic, as the following theorem states.
Theorem (Finite Bilevel Equivalent to Herbrand Logic): Let <Γ,M> be a bilevel pair, where M is finite. Then there is a sentence set Δ in Herbrand logic such that Mod[Δ] = Mod[<Γ,M>].
Even though every finite bilevel pair can be encoded as a finite set of sentences in Herbrand logic, this separation often allows a problem to be defined independent of the problem instance. For example, deductive databases take as input a query that is independent of the data, and in formal verification, the system under consideration can be defined as an initial state (the data) and the dynamics of the system, which are independent of the state. See Herbrand Logic Applications page for more details. Because these two applications are industrial-strength solutions to problems, it is worthwhile to partition the space of bilevel reasoning to see where they fall. Here we discuss just deductive databases.
In the setting of deductive databases, Γ does not constrain the model M but rather extends the theory defined by it, which is a small wrinkle on the notion of a conservative extension to a logical theory.
Definition (Conservative Pair): <Γ,M> is conservative exactly when every sentence entailed by <Γ,M> that is in the vocabulary of M is satisfied by M itself. That is, <Γ,M> is conservative if and only if
Definition (Conservative Bilevel Axioms): A set of axioms Γ is conservative wrt vocabulary V if and only if for every model M in V, <Γ,M> is a conservative pair.
More than conservative, deductive databases are also complete and satisfiable: that is, if the pair <Γ,M> represents a database, it is satisfied by exactly one model.
Definition (Axiomatic Completeness): Let L be a language and Δ a set of sentences. Δ is axiomatically complete if and only if for every closed sentence s in L, Δ entails s or Δ entails ¬s or both.
In Herbrand logic, if a set of sentences is axiomatically complete, those sentences are satisfied by exactly one model. (The fact that axiomatic completeness in Herbrand logic has different model-theoretic properties than first-order logic stems from the fact that Herbrand logic fixes the equality relation, whereas first-order logic does not.) Likewise, we will say that a bilevel pair is (axiomatically) complete if and only if it has at most one model.
Definition (Complete Bilevel Pair): A bilevel pair P is complete if and only if Mod[P] is either a singleton set or the empty set.
Definition (Complete Bilevel Axioms): A set of bilevel axioms Γ is complete wrt vocabulary V if and only if for every model M in V <Γ,M> is a complete bilevel pair.
Thus, a deductive database is a conservative, complete, satisfiable set of bilevel axioms.
Various kinds of operations can be performed on bilevel pairs. We are going to focus on two: (1) check if a given pair entailments some sentence and (2) optimize a set of bilevel axioms Γ so that entailment queries can be answered efficiently, regardless which model is chosen.
These operations make sense only in certain circumstances. If the model M is known, then the optimization problem reduces to the entailment problem--the optimal solution simply answers the entailment problem as efficiently as possible Thus, only when the model M is unknown is the optimization problem different than the entailment problem.
Below is a table that gives examples of work that may be brought to bear on performing these two operations in the context of conservative, finite bilevel pairs.
| Known Model | Unknown Model | |
| Complete | Stratified Logic Programming | Datalog Optimization |
| Incomplete | Inductive Theorem Proving | ? |


constructor
submergence ( ) {
Arguments
Configuration options to use for this instance.
Events
When the last live connection for a client id goes offline, exactly one substation instance in your cluster will emit this event once. It is emitted for every client belonging to a user.
When the first live connection for a client id comes online, exactly one substation instance in your cluster will emit this event once. It is emitted for every client belonging to a user.
Each time a User initiates a new live connection to this substation
instance, this event is
emitted. It offers the client an immediate opportunity to emit events targetted to the
individual connection.
Modules
Central controller for viewing or changing authentication status during an Action. An Agent that
is logged into the application will always have both a user
and client
id configured. The
minimum qualifications for an Agent may already be configured
for the Action.
Looks up, creates and manages sessions on the database as well as managing browser cookies.
Configuration options to use for this instance.
When a template is executed, the context is seeded with several properties. These properties are
overriden by the configuration
and reply content
of the Action.
Incoming Action requests, whether from http
or Socket.io
are mapped to a Request instance.
If bodySchema and/or querySchema are
set, the body
and/or query
properties can be assumed to be conformant by the time the
reaction Function is called.
Accumulates information and events to send to the client. Selects either a buffered or streaming export Function to complete the reply.


| Modifier and Type | Field and Description |
|---|---|
Tile |
Move.from
Where the piece was moved from.
|
protected Tile |
BoardPanel.lastMoved
The location of the last move.
|
Tile |
Move.to
Where the piece was moved to.
|
| Modifier and Type | Method and Description |
|---|---|
protected Tile |
BoardPanel.getLocationOnBoard(java.awt.Point location)
Converts the x,y coordinates of a point on the panel to the
GameState file,rank coordinates of a tile on the
shogi board.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.awt.Point |
BoardPanel.getBoardLocationOnPanel(Tile sq)
Converts the GameState file,rank coordinates of a tile
on the shogi board to x,y coordinates of a point on the Panel.
|
void |
ShogiConsole.logInvalidDrop(int allegiance,
Piece p,
Tile location)
Called if an invalid drop was attempted.
|
void |
ShogiConsole.logInvalidMove(Piece p,
Tile from,
Tile to)
Called if an invalid move was attempted.
|
void |
ShogiConsole.logValidDrop(int allegiance,
Piece p,
Tile location)
Called when a piece is dropped.
|
void |
ShogiConsole.logValidMove(Piece p,
Tile from,
Tile to)
Called when a piece is moved.
|
boolean |
BoardPanel.move(Piece piece,
Tile sq)
Moves the indicated piece to the indicated square on the board
if it is a valid move.
|
| Constructor and Description |
|---|
Move(GameState state,
Piece piece,
Tile to)
Constructs a new Move.
|
Move(GameState state,
Piece piece,
Tile from,
Tile to)
Constructs a new move.
|


--- layout: default title: Contact Us - Corvus Open source Code Order Fulfilment and Management Software - Gazatem Technologies --- {{> navbar}} Send Message Don’t Hesitate to contact with us for any kind of information 13 Sorrells Close Basingstoke RG24 8TB United Kingdom
13 Sorrells Close Basingstoke RG24 8TB United Kingdom


Narsarsuaq is a settlement in the Kujalleq municipality in southern Greenland. It had 158 inhabitants in 2010. There is a thriving tourism industry in and around Narsarsuaq, whose attractions include a great diversity of wildlife, gemstones, tours to glaciers, and an airfield museum. The name of the settlement means great plain in Greenlandic.
Narsarsuaq was the principal city of Greenland in the times of the Viking Eric the Red, 1000 years ago. Many ruins from this epoch of Greenland’s history still survive.
There is a small yacht haven here with two pontoons inside a breakwater.


Create your content
Currently you don't have content type yet. You can click button below to continue.
No folder
{{ choosedFolder.displayName }}
Currently you don't have content type yet. You can click button below to continue.
No folder
{{ choosedFolder.displayName }}


Nutrition
search
more_vert
|
|
arrow_upward
Dessert (100g serving)
|
Type
|
arrow_upward
Calories
The total amount of food energy in the given serving size.
|
arrow_upward
Fat (g)
|
Carbs (g)
|
Protein (g)
|
comment
Comments
|
|
|
|
Frozen Yogurt |
Icecream
Pastry
Other
|
159 |
6.0 |
6.0 |
6.0 |
Add a comment |
edit
|
|
|
Ice cream Sandwich |
Icecream
Pastry
Other
|
237 |
9.0 |
9.0 |
9.0 |
Add a comment |
edit
|
|
|
Eclair |
Icecream
Pastry
Other
|
262 |
16.0 |
16.0 |
16.0 |
Add a comment |
edit
|
|
|
Gingerbread |
Icecream
Pastry
Other
|
305 |
3.7 |
3.7 |
3.7 |
Add a comment |
edit
|
|
|
Honeycomb |
Icecream
Pastry
Other
|
356 |
16.0 |
16.0 |
16.0 |
Add a comment |
edit
|
|
|
Jelly bean |
Icecream
Pastry
Other
|
375 |
0.0 |
0.0 |
0.0 |
Add a comment |
edit
|
|
|
Donut |
Icecream
Pastry
Other
|
308 |
3.2 |
3.2 |
3.2 |
Add a comment |
edit
|
|
|
Marshmallow |
Icecream
Pastry
Other
|
452 |
25.0 |
25.0 |
25.0 |
Add a comment |
edit
|
|
|
Lollipop |
Icecream
Pastry
Other
|
518 |
26.0 |
26.0 |
26.0 |
Add a comment |
edit
|
|
|
Kitkat |
Icecream
Pastry
Other
|
236 |
30.0 |
30.0 |
30.0 |
Add a comment |
edit
|