I'm trying to grow some shrooms but it's taking forever so i had the urge to take a journey and I had ordered some San Pedro Cactus cuttings 12' tipped.  In the morning I thawed them slightly and put them in the blender with some lemon juice and hit puree. I then took the froth and put it in a jar and waited for the juice to settle in the bottom. i then ran it through a strainer to separate the juice from the froth. I gagged down the slimy disgusting juice with some salteen crackers and repeated this process about 3 more times till i though i was gonna hurl. I saved the rest of the sludge for another time and got ready for my journey.
I packed up my Native American flutes and my didgeridoo and put on some warm clothes because it was chilly that day. Packed them into my car with some water and pistachios and dried fruit and headed for the freshly snow dusted foothills of Colorado just west of Denver. I drove up a windy canyon, trying not to throw up in my car, to a spot I had hiked earlier that week which seemed to be a good place for the journey. And it was...
As I hiked up the trail in the cool mountain air my stomach settled a bit and I started feeling better and better. I looked at the trees with the light coating of dusty snow. It was a whole different atmosphere that day. The sky was grey and the clouds hung low. I took a right onto the smaller trail as it forked. and I began to enter the 'Enchanted' forest. Little trees and rocks seemed to welcome me there. All very friendly. The Aspen trees had laid out round golden speckles on the forest floor and on the path as if to welcome me.
All was quiet in the still of the forest. I continued to climb the path as anxiety overwhelmed me and I knew i was getting close to her. I quickened my pace as my body began to pulse with pleasure. Breaking out of the forest I saw the auditorium - grass and trees waited in their places for the concert to begin. The Aspen trees fluttered in the cool breeze as I entered the sacred concert hall.
Finally i saw her, sitting there as proud as when I had left her. In my minds voice I greeted her. She looked so nice. A sight for sore eyes. yes my beautiful rock.  She was happy to see me as i was to see her.
I could feel the release in the back of my neck and my stomach danced as I looked out at my audience of Aspens, Evergreens, flowers, grasses and majestic moss covered boulders as they eagerly awaited in silence. The small forest creatures scurried about at ease with my presence there. I sat there is silence absorbing it all, making them all wait. The I pulled out my cherry wood flute and the spirit of the forest overtook me. I played her song in the chilly mountain air. The high and low tones cut through the valleys and echoed off the hills. I stumbled around in bliss as I played from the deep places inside of me. I felt the blood of my ancestors pulse through my warm veins. Condensation dripped from the air holes and my cold fingers fluttered and danced on the finger holes. I sat there interchanging from cherry to cedar to blond colored flutes, all with their own distinct tones.
The golden leaves danced on their branches as I played.  My eyes were closed but I heard dogs moaning behind me. I continued playing and opened my eyes to see a young man and two dogs walking down the trail. The dogs whined and growled as they passed me. I continued to play my haunting tones unaffected by their presence there. The young man, seemingly overcome with fright, quickened his pace as my song seemed to drive him out of that sacred valley.
When my hands became too numb to hold the notes i grabbed my Didge and climbed down to the north west face of my beauty. I then noticed something that I had not before. Several lines in the rock all converged at a point on the ground the ground and there was a hole just right to stick the end of my didge into. My rock begged me to speak to her in the ancient drone. I placed my didge in the hole and fitted my mouth to the waxy mouthpiece and began my communion with her. As my lips subtly vibrated over the mouthpiece I had the feeling that I was kissing her. The sound was incredible. I could feel the sound waves pulsating off of her. It was like I was communicating with her, giving her a voice. I have never heard a rock sing until that day and it was a maginificent experience.
My eyes were again closed and i watched as subtle patterns formed on my eyelids as I played. I felt a warm excited feeling in my stomach and down my spine emanating from the back of my neck. I felt the beauty of this place and time seemed to stand still. I then opened my eyes and concentrated on the brightly colored moss growing on her and the way the colors of the granite and moss seemed to warped together like a mosaic pattern, like an artwork and all of the sudden I started to see her 'faces'. There were many of them everywhere I looked as the lines, crevices and textures formed all kinds of different faces. Some resembled animals and others looked like old men and others looked like nothing I had ever seen before. It was beautiful. I was awe struck by it all and just sat motionless starring at it for about five minutes or so.
I was reminded of the paintings by Bev Doolittle, where you can see faces in the landscapes that she paints. Now I know where she got the idea. I also recalled the movie 'Return to Oz' where the Gnome king and his servants would follow Dorothy around Oz spying on her within the rocks and their faces would move through the rocks and appear in them. this was a very interesting phenomenon and probably the highlight of my experience.
I continued to play my didge until I felt the need to return to my flutes. I continued this pattern for the rest of the afternoon. Finally I was compelled to pack up my things and climb the hill back to the main trail. I continued to play my flutes as I made my way up the hill stopping at various points along the way to listen to the acoustics of that particular spot and to check out the mossy rocks and various plant life and colors. As I descended down the other side of the hill, still playing my tones I met up with an older lady with an Irish accent. She told me she had been listening to me and how beautiful it was and how the scenery reminded her of Ireland. We talked and walked down the trail noticing the wonderful surroundings to where the cars were parked and bid fare well.
As I drove back down the winding canyon listening to some Celtic music I could see wonderful patterns in the canyon walls. The movement of the car was very smooth and soothing, like driving on clouds. The warm air from the heater sent chills through my body like I had never felt before. very nice. And every so often I would receive pleasant sensations throughout my body almost like riding a roller coaster but not as intense.
A huge grin enveloped my face and I felt very happy and at peace. All the troubles in the world seemed to be so pointless and futile. I even started to have affectionate feelings for my car, thinking of how loyal and dependable she's been to me. When I arrived home I was hungry and warmed up a cup of chia tea and found some cold pizza in the fridge. Our kitchen being remodeled with hardwood floors and wood cabinets had a very nice feel to it. The wood was very beautiful indeed. I went to my room and put on some relaxing downbeat techno, lit a candle and sat on my bed sipping my warm chia. I could smell the fragrance of the candle and the spices of the chia and I looked around at my room and felt ever so cozy. I wrote some affectionate entries about my rock in my journal and drew a picture of myself standing on her playing my flute. It had been a wonderful day and I hope to do it again when I get the chance.
If you are thinking about taking a journey through the use of this sacred plant, I highly recommend that you do it out in nature and plan on spending at least 4 or 5 hours outdoors. I've found that fasting for at least six hours prior is a good thing. Also I read that you should not eat any meat the day before. You'll need room in your stomach. Again, the extract is most disgusting and very hard to swallow but I think the methods that I used work well and I have used them since with good results. I've also read that mescaline is like a cross between LSD and Exctasy. I've never taken Exctacy but I would have to agree with that description by the way my journey went. Remember setting is everything. Be in a good frame of mind and be familiar with your surroundings. You'll not be totally wacked out by this substance it's quite subtle compared with others and you can intelligently carry on conversations with other people without them suspecting anything.
Please use caution, have a safe journey and use the experience to further your knowledge and understanding of creation.
Side Note: I recently discovered some very nice SP specimines for sale at Home Depot. I purchased 2 of them one about 2 foot and the other about 7 inch. I don't know if I have the heart to sacrifice them though and the larger one has longer dark colored spikes and more thin ribs than the SP I used so I'm not sure what species it is. I'm hoping it's a Peruvian Torch but I can't be sure. They also have a double six footer and four footer in one planter there for $99. I'm very temped to go buy it. Anyways, I was pleasantly suprised to find them there so go check out your local H.D. or garden center. Chances are you'll find one.
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.


The ideas listed on this page do not necessarily have all the implementation details such as scripts, and code. This is a list of all possible automations for a specific category, and is purely meant to "promote" creative thinking among the home-automation enthusiasts, and come up with better set of automations for everyone to use 😂
If you think any critical automations are missing, or you have better automations that you would like to share, please click here!


# Copyright (c) 2017 NVIDIA Corporation
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import abc
import copy
import time
import numpy as np
import six
from six.moves import range
import tensorflow as tf
try:
from inspect import signature
except ImportError:
from funcsigs import signature
from open_seq2seq.utils.utils import deco_print, clip_last_batch
from open_seq2seq.optimizers import optimize_loss, get_regularization_loss
from open_seq2seq.utils.utils import check_params
[docs]@six.add_metaclass(abc.ABCMeta)
class Model:
"""Abstract class that any model should inherit from.
It automatically enables multi-GPU (or Horovod) computation,
has mixed precision support, logs training summaries, etc.
"""
[docs] @staticmethod
def get_required_params():
"""Static method with description of required parameters.
Returns:
dict:
Dictionary containing all the parameters that **have to** be
included into the ``params`` parameter of the
class :meth:`__init__` method.
"""
return {
'use_horovod': bool,
'batch_size_per_gpu': int,
'data_layer': None, # could be any user defined class
}
[docs] @staticmethod
def get_optional_params():
"""Static method with description of optional parameters.
Returns:
dict:
Dictionary containing all the parameters that **can** be
included into the ``params`` parameter of the
class :meth:`__init__` method.
"""
return {
'logdir': str,
'num_gpus': int, # cannot be used when gpu_ids is specified
'gpu_ids': list, # cannot be used when num_gpus is specified
'save_summaries_steps': None, # could be int or None
'print_loss_steps': None, # could be int or None
'print_samples_steps': None, # could be int or None
'print_bench_info_steps': None, # could be int or None
'save_checkpoint_steps': None, # could be int or None
'eval_steps': int,
'random_seed': int,
'num_epochs': int,
'max_steps': int,
'bench_start': int,
'data_layer_params': dict,
'optimizer': None, # could be class or string
'optimizer_params': dict,
'initializer': None, # any valid TensorFlow initializer
'initializer_params': dict,
'regularizer': None, # any valid TensorFlow regularizer
'regularizer_params': dict,
'dtype': [tf.float16, tf.float32, 'mixed'],
'lr_policy': None, # any valid learning rate policy function
'lr_policy_params': dict,
'max_grad_norm': float,
'larc_params': dict,
'loss_scaling': None, # float, "Backoff" or "LogMax"
'loss_scaling_params': dict,
'summaries': list,
'iter_size': int,
}
[docs] def __init__(self, params, mode="train", hvd=None):
"""Model constructor.
The TensorFlow graph should not be created here, but rather in the
:meth:`self.compile() <compile>` method.
Args:
params (dict): parameters describing the model.
All supported parameters are listed in :meth:`get_required_params`,
:meth:`get_optional_params` functions.
mode (string, optional): "train", "eval" or "infer".
If mode is "train" all parts of the graph will be built
(model, loss, optimizer).
If mode is "eval", only model and loss will be built.
If mode is "infer", only model will be built.
hvd (optional): if Horovod is used, this should be
``horovod.tensorflow`` module.
If Horovod is not used, it should be None.
Config parameters:
* **random_seed** (int) --- random seed to use.
* **use_horovod** (bool) --- whether to use Horovod for distributed
execution.
* **num_gpus** (int) --- number of GPUs to use. This parameter cannot be
used if ``gpu_ids`` is specified. When ``use_horovod`` is True
this parameter is ignored.
* **gpu_ids** (list of ints) --- GPU ids to use. This parameter cannot be
used if ``num_gpus`` is specified. When ``use_horovod`` is True
this parameter is ignored.
* **batch_size_per_gpu** (int) --- batch size to use for each GPU.
* **num_epochs** (int) --- number of epochs to run training for.
This parameter cannot be used if ``max_steps`` is specified.
* **max_steps** (int) --- number of steps to run training for.
This parameter cannot be used if ``num_epochs`` is specified.
* **save_summaries_steps** (int or None) --- how often to save summaries.
Setting it to None disables summaries saving.
* **print_loss_steps** (int or None) --- how often to print loss during
training. Setting it to None disables loss printing.
* **print_samples_steps** (int or None) --- how often to print training
samples (input sequences, correct answers and model predictions).
Setting it to None disables samples printing.
* **print_bench_info_steps** (int or None) --- how often to print training
benchmarking information (average number of objects processed per step).
Setting it to None disables intermediate benchmarking printing, but
the average information across the whole training will always be printed
after the last iteration.
* **save_checkpoint_steps** (int or None) --- how often to save model
checkpoints. Setting it to None disables checkpoint saving.
* **eval_steps** (int) --- how often to run evaluation during training.
This parameter is only checked if ``--mode`` argument of ``run.py`` is
"train\_eval". If no evaluation is needed you should use "train" mode.
* **logdir** (string) --- path to the log directory where all checkpoints
and summaries will be saved.
* **data_layer** (any class derived from
:class:`DataLayer <data.data_layer.DataLayer>`) --- data layer class
to use.
* **data_layer_params** (dict) --- dictionary with data layer
configuration.
For complete list of possible parameters see the corresponding
class docs.
* **optimizer** (string or TensorFlow optimizer class) --- optimizer to
use for training. Could be either "Adam", "Adagrad", "Ftrl", "Momentum",
"RMSProp", "SGD" or any valid TensorFlow optimizer class.
* **optimizer_params** (dict) --- dictionary that will be passed to
optimizer ``__init__`` method.
* **initializer** --- any valid TensorFlow initializer.
* **initializer_params** (dict) --- dictionary that will be passed to
initializer ``__init__`` method.
* **regularizer** --- and valid TensorFlow regularizer.
* **regularizer_params** (dict) --- dictionary that will be passed to
regularizer ``__init__`` method.
* **dtype** --- model dtype. Could be either ``tf.float16``,
``tf.float32`` or "mixed". For details see
:ref:`mixed precision training <mixed_precision>` section in docs.
* **lr_policy** --- any valid learning rate policy function. For examples,
see :any:`optimizers.lr_policies` module.
* **lr_policy_params** (dict) --- dictionary containing lr_policy
parameters.
* **max_grad_norm** (float) --- maximum value of gradient norm. Clipping
will be performed if some gradients exceed this value (this is checked
for each variable independently).
* **loss_scaling** --- could be float or string. If float, static loss
scaling is applied. If string, the corresponding automatic
loss scaling algorithm is used. Must be one of 'Backoff'
of 'LogMax' (case insensitive). Only used when dtype="mixed". For details
see :ref:`mixed precision training <mixed_precision>` section in docs.
* **loss_scaling_params** (dict) --- dictionary containing loss scaling
parameters.
* **summaries** (list) --- which summaries to log. Could contain
"learning_rate", "gradients", "gradient_norm", "global_gradient_norm",
"variables", "variable_norm", "loss_scale".
* **iter_size** (int) --- use this parameter to emulate large batches.
The gradients will be accumulated for ``iter_size`` number of steps before
applying update.
* **larc_params** --- dictionary with parameters for LARC (or LARS)
optimization algorithms. Can contain the following parameters:
* **larc_mode** --- Could be either "scale" (LARS) or "clip" (LARC).
Note that it works in addition to any other optimization algorithm
since we treat
it as adaptive gradient clipping and learning rate adjustment.
* **larc_eta** (float) --- LARC or LARS scaling parameter.
* **min_update** (float) --- minimal value of the LARC (LARS) update.
* **epsilon** (float) --- small number added to gradient norm in
denominator for numerical stability.
"""
check_params(params, self.get_required_params(), self.get_optional_params())
self._params = copy.deepcopy(params)
if self._params.get('iter_size', 1) > 1 and hvd is None:
raise ValueError("iter_size is only supported in Horovod mode")
# parameter checks
self._mode = mode
if self._mode not in ["train", "infer", "eval"]:
raise ValueError("Mode has to be one of ['train', 'infer', 'eval']")
if "max_steps" in params and "num_epochs" in params:
raise ValueError("You can't provide both max_steps and num_epochs. "
"Please, remove one of them from the config.")
if mode == "train":
if "max_steps" not in params and "num_epochs" not in params:
raise ValueError("For training mode either max_steps or "
"num_epochs has to be provided")
if 'print_samples_steps' not in self._params:
self._params['print_samples_steps'] = None
if 'print_loss_steps' not in self._params:
self._params['print_loss_steps'] = None
if 'save_checkpoint_steps' not in self._params:
self._params['save_checkpoint_steps'] = None
if 'save_summaries_steps' not in self._params:
self._params['save_summaries_steps'] = None
if 'print_bench_info_steps' not in self._params:
self._params['print_bench_info_steps'] = None
# checking that frequencies of samples and loss are aligned
s_fr = self._params['print_samples_steps']
l_fr = self._params['print_loss_steps']
if s_fr is not None and l_fr is not None and s_fr % l_fr != 0:
raise ValueError("print_samples_steps has to be a multiple of "
"print_loss_steps.")
self._hvd = hvd
if self._hvd:
self._gpu_ids = range(1)
else:
if 'gpu_ids' in self._params:
self._gpu_ids = self._params['gpu_ids']
elif 'num_gpus' in self._params:
self._gpu_ids = range(self._params['num_gpus'])
else:
raise ValueError('Either "gpu_ids" or "num_gpus" has to '
'be specified in the config')
# setting random seed
rs = self._params.get('random_seed', int(time.time()))
if self.on_horovod:
rs += hvd.rank()
tf.set_random_seed(rs)
np.random.seed(rs)
if 'dtype' not in self._params:
self._params['dtype'] = tf.float32
dl_params = self._params.get('data_layer_params', {})
dl_params['batch_size'] = self._params['batch_size_per_gpu']
dl_params['mode'] = self._mode
if self.on_horovod:
self._data_layer = self._params['data_layer'](
params=dl_params, model=self,
num_workers=self._hvd.size(), worker_id=self._hvd.rank(),
)
else:
self._data_layers = []
for worker_id in range(self.num_gpus):
self._data_layers.append(self._params['data_layer'](
params=dl_params, model=self,
num_workers=self.num_gpus, worker_id=worker_id,
))
if self._mode == "train":
if "max_steps" in self._params:
self._last_step = self._params["max_steps"]
self._steps_in_epoch = None
else:
# doing a few less steps if data size is not divisible by the batch size
self._steps_in_epoch = self.get_data_layer().get_size_in_samples() // \
self.get_data_layer().params['batch_size']
if self._steps_in_epoch is None:
raise ValueError('The data_layer is not compatible with '
'epoch execution, since it does not provide '
'get_size_in_samples() method. Either update the '
'data layer or switch to using "max_steps" '
'paremeter.')
if self.on_horovod:
self._steps_in_epoch //= self._hvd.size()
else:
self._steps_in_epoch //= self.num_gpus
self._steps_in_epoch //= self._params.get('iter_size', 1)
if self._steps_in_epoch == 0:
raise ValueError("Overall batch size is too big for this dataset.")
self._last_step = self._params['num_epochs'] * self._steps_in_epoch
if self.on_horovod:
self._output = None
else:
self._outputs = [None] * self.num_gpus
self.loss = None
self.train_op = None
self.eval_losses = None
self._num_objects_per_step = None
self.skip_update_ph = None
[docs] def compile(self, force_var_reuse=False):
"""TensorFlow graph is built here."""
if 'initializer' not in self.params:
initializer = None
else:
init_dict = self.params.get('initializer_params', {})
initializer = self.params['initializer'](**init_dict)
if not self.on_horovod: # not using Horovod
# below we follow data parallelism for multi-GPU training
losses = []
for gpu_cnt, gpu_id in enumerate(self._gpu_ids):
with tf.device("/gpu:{}".format(gpu_id)), tf.variable_scope(
name_or_scope=tf.get_variable_scope(),
# re-using variables across GPUs.
reuse=force_var_reuse or (gpu_cnt > 0),
initializer=initializer,
dtype=self.get_tf_dtype(),
):
deco_print("Building graph on GPU:{}".format(gpu_id))
self.get_data_layer(gpu_cnt).build_graph()
input_tensors = self.get_data_layer(gpu_cnt).input_tensors
loss, self._outputs[gpu_cnt] = self._build_forward_pass_graph(
input_tensors,
gpu_id=gpu_cnt,
)
if self._outputs[gpu_cnt] is not None and \
not isinstance(self._outputs[gpu_cnt], list):
raise ValueError('Decoder outputs have to be either None or list')
if self._mode == "train" or self._mode == "eval":
losses.append(loss)
# end of for gpu_ind loop
if self._mode == "train":
self.loss = tf.reduce_mean(losses)
if self._mode == "eval":
self.eval_losses = losses
else: # is using Horovod
# gpu_id should always be zero, since Horovod takes care of isolating
# different processes to 1 GPU only
with tf.device("/gpu:0"), tf.variable_scope(
name_or_scope=tf.get_variable_scope(),
reuse=force_var_reuse,
initializer=initializer,
dtype=self.get_tf_dtype(),
):
deco_print(
"Building graph in Horovod rank: {}".format(self._hvd.rank())
)
self.get_data_layer().build_graph()
input_tensors = self.get_data_layer().input_tensors
loss, self._output = self._build_forward_pass_graph(input_tensors,
gpu_id=0)
if self._output is not None and not isinstance(self._output, list):
raise ValueError('Decoder outputs have to be either None or list')
if self._mode == "train":
self.loss = loss
if self._mode == "eval":
self.eval_losses = [loss]
try:
self._num_objects_per_step = [self._get_num_objects_per_step(worker_id)
for worker_id in range(self.num_gpus)]
except NotImplementedError:
pass
if self._mode == "train":
if 'lr_policy' not in self.params:
lr_policy = None
else:
lr_params = self.params.get('lr_policy_params', {})
# adding default decay_steps = max_steps if lr_policy supports it and
# different value is not provided
func_params = signature(self.params['lr_policy']).parameters
if 'decay_steps' in func_params and 'decay_steps' not in lr_params:
lr_params['decay_steps'] = self._last_step
if 'steps_per_epoch' in func_params and \
'steps_per_epoch' not in lr_params and 'num_epochs' in self.params:
lr_params['steps_per_epoch'] = self.steps_in_epoch
lr_policy = lambda gs: self.params['lr_policy'](global_step=gs,
**lr_params)
if self.params.get('iter_size', 1) > 1:
self.skip_update_ph = tf.placeholder(tf.bool)
self.train_op = optimize_loss(
loss=tf.cast(self.loss, tf.float32) + get_regularization_loss(),
dtype=self.params['dtype'],
optimizer=self.params['optimizer'],
optimizer_params=self.params.get('optimizer_params', {}),
clip_gradients=self.params.get('max_grad_norm', None),
learning_rate_decay_fn=lr_policy,
summaries=self.params.get('summaries', None),
larc_params=self.params.get('larc_params', None),
loss_scaling=self.params.get('loss_scaling', 1.0),
loss_scaling_params=self.params.get('loss_scaling_params', None),
on_horovod=self.on_horovod,
iter_size=self.params.get('iter_size', 1),
skip_update_ph=self.skip_update_ph,
)
tf.summary.scalar(name="train_loss", tensor=self.loss)
if self.steps_in_epoch:
tf.summary.scalar(
name="epoch",
tensor=tf.floor(tf.train.get_global_step() /
tf.constant(self.steps_in_epoch, dtype=tf.int64)),
)
if not self.on_horovod or self._hvd.rank() == 0:
deco_print("Trainable variables:")
total_params = 0
unknown_shape = False
for var in tf.trainable_variables():
var_params = 1
deco_print('{}'.format(var.name), offset=2)
deco_print('shape: {}, {}'.format(var.get_shape(), var.dtype),
offset=4)
if var.get_shape():
for dim in var.get_shape():
var_params *= dim.value
total_params += var_params
else:
unknown_shape = True
if unknown_shape:
deco_print("Encountered unknown variable shape, can't compute total "
"number of parameters.")
else:
deco_print('Total trainable parameters: {}'.format(total_params))
[docs] @abc.abstractmethod
def _build_forward_pass_graph(self, input_tensors, gpu_id=0):
"""This method should create the graph of the forward pass of the model.
Args:
input_tensors: ``input_tensors`` defined by the data_layer class.
gpu_id (int, optional): id of the GPU where the current copy of the model
is constructed. For Horovod this is always zero.
Returns:
tuple: tuple containing loss tensor and list of outputs tensors.
Loss tensor will be automatically provided to the optimizer and
corresponding :attr:`train_op` will be created.
Samples tensors are stored in the :attr:`_outputs` attribute and can be
accessed by calling :meth:`get_output_tensors` function. For example,
this happens inside :class:`utils.hooks.RunEvaluationHook`
to fetch output values for evaluation.
Both loss and outputs can be None when corresponding part of the graph
is not built.
"""
pass
[docs] def maybe_print_logs(self, input_values, output_values, training_step):
"""This method can be used to print logs that help to visualize training.
For example, you can print sample input sequences and their corresponding
predictions. This method will be called every ``print_samples_steps``
(config parameter) iterations and input/output values will be populated
automatically by calling ``sess.run`` on corresponding tensors. Note that
this method is not abstract and does not have to be implemented in
derived classes. But if additional printing functionality is required,
overwriting this method can be a useful way to add it.
Args:
input_values: evaluation of
:meth:`self.get_data_layer(0).input_tensors
<data.data_layer.DataLayer.input_tensors>`, that is, input tensors
for one batch on the *first* GPU.
output_values: evaluation of
:meth:`self.get_output_tensors(0) <get_output_tensors>`,
that is, output tensors for one batch on the *first* GPU.
training_step (int): Current training step.
Returns:
dict: dictionary with values that need to be logged to TensorBoard
(can be empty).
"""
# by default return an empty dictionary and do nothing
return {}
[docs] def evaluate(self, input_values, output_values):
"""This method can be used in conjunction with
:meth:`self.finalize_evaluation()<finalize_evaluation>` to calculate
evaluation metrics.
For example, for speech-to-text models these methods can calculate
word-error-rate on the validation data. For text-to-text models, these
methods can compute BLEU score. Look at the corresponding derived classes
for examples of this. These methods will be called every
``eval_steps`` (config parameter) iterations and
input/output values will be populated automatically by calling ``sess.run``
on corresponding tensors (using evaluation model).
The :meth:`self.evaluate()<evaluate>` method is called on each batch data
and it's results will be collected and provided to
:meth:`self.finalize_evaluation()<finalize_evaluation>` for finalization.
Note that
this function is not abstract and does not have to be implemented in
derived classes. But if evaluation functionality is required,
overwriting this function can be a useful way to add it.
Args:
input_values: evaluation of
:meth:`self.get_data_layer().input_tensors
<data.data_layer.DataLayer.input_tensors>` concatenated across
all workers. That is, input tensors for one batch combined
from *all* GPUs.
output_values: evaluation of
:meth:`self.get_output_tensors() <get_output_tensors>` concatenated
across all workers. That is, output tensors for one batch combined
from *all* GPUs.
Returns:
list: all necessary values for evaluation finalization (e.g. accuracy on
current batch, which will then be averaged in finalization method).
"""
return []
[docs] def finalize_evaluation(self, results_per_batch, training_step=None):
"""This method can be used in conjunction with
:meth:`self.evaluate()<evaluate>` to calculate
evaluation metrics.
For example, for speech-to-text models these methods can calculate
word-error-rate on the validation data. For text-to-text models, these
methods can compute BLEU score. Look at the corresponding derived classes
for examples of this. These methods will be called every
``eval_steps`` (config parameter) iterations and
input/output values will be populated automatically by calling ``sess.run``
on corresponding tensors (using evaluation model).
The :meth:`self.evaluate()<evaluate>` method is called on each batch data
and it's results will be collected and provided to
:meth:`self.finalize_evaluation()<finalize_evaluation>` for finalization.
Note that
these methods are not abstract and does not have to be implemented in
derived classes. But if evaluation functionality is required,
overwriting these methods can be a useful way to add it.
Args:
results_per_batch (list): aggregation of values returned from all calls
to :meth:`self.evaluate()<evaluate>` method (number of calls will be
equal to number of evaluation batches).
training_step (int): current training step. Will only be passed if mode
is "train_eval".
Returns:
dict: dictionary with values that need to be logged to TensorBoard
(can be empty).
"""
# by default return an empty dictionary and do nothing
return {}
[docs] def infer(self, input_values, output_values):
"""This method is analogous to :meth:`self.evaluate()<evaluate>`, but used
in conjunction with :meth:`self.finalize_inference()<finalize_inference>`
to perform inference.
Args:
input_values: evaluation of
:meth:`self.get_data_layer().input_tensors
<data.data_layer.DataLayer.input_tensors>` concatenated across
all workers. That is, input tensors for one batch combined
from *all* GPUs.
output_values: evaluation of
:meth:`self.get_output_tensors() <get_output_tensors>` concatenated
across all workers. That is, output tensors for one batch combined
from *all* GPUs.
Returns:
list: all necessary values for inference finalization (e.g. this method
can return final generated sequences for each batch which will then be
saved to file in :meth:`self.finalize_inference()<finalize_inference>`
method).
"""
return []
[docs] def finalize_inference(self, results_per_batch, output_file):
"""This method should be implemented if the model support inference mode.
For example for speech-to-text and text-to-text models, this method will
log the corresponding input-output pair to the output_file.
Args:
results_per_batch (list): aggregation of values returned from all calls
to :meth:`self.evaluate()<evaluate>` method (number of calls will be
equal to number of evaluation batches).
output_file (str): name of the output file that inference results should
be saved to.
"""
pass
[docs] def clip_last_batch(self, last_batch, true_size):
"""This method performs last batch clipping.
Used in cases when dataset is not divisible by the batch size and model
does not support dynamic batch sizes. In those cases, the last batch will
contain some data from the "next epoch" and this method can be used
to remove that data. This method works for both
dense and sparse tensors. In most cases you will not need to overwrite this
method.
Args:
last_batch (list): list with elements that could be either ``np.array``
or ``tf.SparseTensorValue`` containing data for last batch. The
assumption is that the first axis of all data tensors will correspond
to the current batch size.
true_size (int): true size that the last batch should be cut to.
"""
return clip_last_batch(last_batch, true_size)
[docs] def get_output_tensors(self, worker_id=0):
"""Returns output tensors generated by :meth:`_build_forward_pass_graph.`
When using Horovod, ``worker_id`` parameter is ignored. When using
tower-based multi-GPU approach, ``worker_id`` can be used to select tensors
for corresponding tower/GPU.
Args:
worker_id (int): id of the worker to get tensors from
(not used for Horovod).
Returns:
output tensors.
"""
if self.on_horovod:
return self._output
else:
return self._outputs[worker_id]
[docs] def get_data_layer(self, worker_id=0):
"""Returns model data layer.
When using Horovod, ``worker_id`` parameter is ignored. When using
tower-based multi-GPU approach, ``worker_id`` can be used to select
data layer for corresponding tower/GPU.
Args:
worker_id (int): id of the worker to get data layer from
(not used for Horovod).
Returns:
model data layer.
"""
if self.on_horovod:
return self._data_layer
else:
return self._data_layers[worker_id]
[docs] def get_tf_dtype(self):
"""Returns actual TensorFlow dtype that will be used as variables dtype."""
if self.params['dtype'] == "mixed":
return tf.float16
else:
return self.params['dtype']
[docs] def _get_num_objects_per_step(self, worker_id=0):
"""Define this method if you need benchmarking functionality.
For example, for translation models, this method should return number of
tokens in current batch, for image recognition model should return number
of images in current batch.
Args:
worker_id (int): id of the worker to get data layer from
(not used for Horovod).
Returns:
tf.Tensor with number of objects in batch.
"""
raise NotImplementedError()
[docs] def get_num_objects_per_step(self, worker_id=0):
if self._num_objects_per_step:
return self._num_objects_per_step[worker_id]
else:
raise NotImplementedError()
@property
def params(self):
"""Parameters used to construct the model (dictionary)."""
return self._params
@property
def steps_in_epoch(self):
"""Number of steps in epoch.
This parameter is only populated if ``num_epochs`` was specified in the
config (otherwise it is None).
It is used in training hooks to correctly print epoch number.
"""
return self._steps_in_epoch
@property
def last_step(self):
"""Number of steps the training should be run for."""
return self._last_step
@property
def num_gpus(self):
"""Number of GPUs the model will be run on.
For Horovod this is always 1 and actual number of GPUs is controlled by
Open-MPI parameters.
"""
return len(self._gpu_ids)
@property
def mode(self):
"""Mode the model is executed in ("train", "eval" or "infer")."""
return self._mode
@property
def on_horovod(self):
"""Whether the model is run on Horovod or not."""
return self._hvd is not None
@property
def hvd(self):
"""horovod.tensorflow module"""
return self._hvd


This is a website built to let players search for items from Mythic+ dungeons in Battle For Azeroth.
If you are interested in checking your M+ score, visit raider.io.


The seq/infuse.h
header defines an algorithm that facilitates sequential iteration of sequences while embedding auxiliary data.
#include <chaos/preprocessor/seq/infuse.h>
The CHAOS_PP_SEQ_INFUSE
macro converts a sequence to a special form that facilitates sequential iteration while embedding auxiliary data.
CHAOS_PP_SEQ_INFUSE
(seq, ...)
The sequence to be transformed.
The auxiliary data to be embedded into each element of seq.
CHAOS_PP_SEQ_INFUSE
(seq, data)
The sequence to be transformed.
The auxiliary data to be embedded into each element of seq.
This macro transforms seq into the special form illustrated by the following pseudo-code:
(data, seq[0])() (data, seq[1])() ... (data, seq[length(seq) - 1])()
In particular, each element of seq is converted to a binary element with data or __VA_ARGS__
as the first sub-element and the original element as the second sub-element.
Each of the binary elements is suffixed with nullary parentheses.
This form facilitates sequential iteration. The nullary parentheses after each element makes it easy to use a single macro and an indirection macro to perform sequential iteration rather than two near identical macros that otherwise would be required. For example,
#define A(macro, seq) B(CHAOS_PP_SEQ_INFUSE
(seq, (1, macro))) #define B(bin) C bin ((0, ~), ~) #define C(pair, x) \CHAOS_PP_INLINE_WHEN
(CHAOS_PP_BINARY
(0) pair)( \CHAOS_PP_BINARY
(1) pair(x) C_INDIRECT \ ) \ /**/ #define C_INDIRECT() C #define MACRO(x) !x A(MACRO, (a)(b)(c)) // !a !b !c
Note that, unlike CHAOS_PP_SEQ_BINARY_TRANSFORM
and CHAOS_PP_SEQ_BINARY_TRANSFORM_2ND
, this macro does not add the terminal special form.
This macro uses sequential iteration.
CHAOS_PP_SEQ_INFUSE_ID
()
This macro effectively allows CHAOS_PP_SEQ_INFUSE
to pass through itself without becoming disabled.
The CHAOS_PP_SEQ_INFUSE_
macro expands to a λ expression representing CHAOS_PP_SEQ_INFUSE
.
CHAOS_PP_SEQ_INFUSE_
This macro is a shorthand form of the following λ binding:


BLOOD OF A POET, THE (SANG D'UN POETE, LE) (director/writer: Jean Cocteau; cinematographer: Georges Périnal; cast: Enrique Rivero (The Poet), Pauline Carton (Child's Tutor), Feral Benga (Black Angel), Jean Desbordes (Louis XV), Lee Miller (Statue), 1930-France)
Reviewed by Dennis Schwartz
"Mirrors should reflect a little before throwing back images."
Jean Cocteau (1889-1963)
The information I derived on Jean Cocteau (The Eternal Return/Beauty and the Beast/Les enfants terribles/Orpheus), French poet, artist, novelist, playwright, and movie director was gathered from several books, with Parker Tyler's "Classics of the Foreign Film," in particular, being an invaluable source.
Cocteau was born in Maisons-Lafitte into a wealthy Parisian family. His father was a lawyer and amateur painter, who committed suicide when Cocteau was nine. Cocteau's father had a lasting influence on his son, but according to psychoanalytical critics this tragic event also created his desire to put himself in the service of the arts and the mysterious forces in the universe. In secondary school Cocteau was only a mediocre student who was unsuccessful after repeated attempts to pass the graduation examination. His first volume of poems, Aladdin's Lamp, Cocteau published at the age of 19 and gained fame with his involvement as writer and supervisor in Parade (1917), a ballet produced by Serge de Diaghile, with sets by Pablo Picasso and music by Erik Satie.
The idea of a film came about during a house party given by Charles and Marie-Laure de Noailles at Hyeres in 1929. Georges Auric, Cocteau's lifelong musical collaborator, said that he wanted to compose the score for an animated cartoon. Cocteau was asked to provide a scenario. The Noailles (who also bankrolled Luis Buñuel's l'Age d'or) agreed to give Cocteau a million francs to make a live-action film with a score by Auric. This became "The Blood of a Poet," still one of the most widely viewed of all Cocteau's screenworks.
Cocteau described this first film of his as a disturbing series of voyeuristic tableaux, as "a descent into oneself, a way of using the mechanism of the dream without sleeping, a crooked candle, often mysteriously blown out, carried about in the night of the human body."
The Blood of a Poet, was based on his own private mythology. Typical for Cocteau's films was the use of mirrors as a door into another world and the play between reality and the underworld or the inner world where poetry is made. The hostility of the surrealists to this project led Cocteau to make a film that is sometimes in structure a lot closer in resemblance to neo-Romantic classicism than surrealism (Andre Breton was "king" of the surrealist group and was afraid Cocteau would dethrone him).
There has never been a film quite like Le Sang d'un Poete. Cocteau used all his energy and his diverse talents in a medium that was new to him, as this film represented an aesthetic milestone in his career.
Was it nonsense or serious filmmaking? In my opinion, a little of both, though the result of the film is a serious work. This 60 minute film is ostensibly, a work on the nature of creating art. It shows the artist in the first part of the film struggling to find his identity, vowing to free himself from his present confinement by becoming a martyr for his art. He symbolically kills himself to attain a new relationship to tradition. In the second part, he dredges up events from his young life and tries to honestly see himself for the first time without being conditioned by the world he grew up in. Playing a card game with a lady, the poet snaps and starts recalling distresses from his childhood, and again symbolically shoots himself. His opponent turns into his muse, her long black gloves simulating a statue's absence of arms.
Technically, The Blood of a Poet reflects Cocteau's trials and errors as a novice filmmaker who had to turn irreversible mistakes to his advantage and had to constantly improvise. During shooting, he used the dust raised by studio cleaning men to enhance the mysterious atmosphere of the final scenes. Special weightless effects were obtained by camera trickery to show the little girl flying up to the ceiling and the poet moving painfully along the corridor wall. Once Cocteau discovered that he could turn shooting disasters into excellent footage, he was off on a career of making films that carried his trait of creating trick shots: the miraculous mirror and mercury scene in Orphee, the live arms holding the candelabra from the walls of La Belle et la Bete, and the accelerated time sequences of flowers opening in Le Testament d'Orphee are only a few examples of the trick shots he used in his later films.
Basically, in The Blood of a Poet, Cocteau shot four episodes in the life of an artist by trying to get into the artist's head. Cocteau, as narrator, boldly states, "When an expression of art collides with a layman's view of things, if the work is not understood, it is a question of which of the two is at fault." For Cocteau, poetry is a coat-of-arms.
In the first episode, entitled: "The Wounded Hand," the poet (Rivero) has his thoughts surrealistically swirling in the air and a mouth forms in his hand begging for air to breath. The following morning the poet decides that it is not a crazy idea to awaken a statue (Lee), even one that has been around for thousands of years, as he struggles to bring it to consciousness.
In the second episode, he enters the mirror and it opens up a reality he never saw before, as the film's theme revolves around the fears and joys and obsessions of the artist who has opened himself up for analysis.
In the third episode, the dreams and events in the poet's life come back to haunt him. Most notable, is the famous scene of the poet as a child being knocked out when hit by a snowball. The child must learn how to handle the obstacles in his life, such as the bully in his class.
The fourth episode, entitled: "Stolen Card," a black angel (Feral) hovers over a dead child he was a guardian of, the poet as a boy. There is also the boy growing up to be the artist who commits suicide at the card table. This is perhaps a reminder that Cocteau's father committed suicide or of Cocteau's artist friends who live an impoverished life and are forced to make life and death decisions. The film ends with the message: Mortal tedium of immortality. In the last frame, an industrial chimney shown in the beginning of the film, finally collapses and all material things are crushed. Only the poet remains and is considered to be eternal.
So much of this film is mysterious and vague, undoubtedly autobiographical in content and motif: Cocteau himself always denied the presence of hidden symbolism in the film, but word got about that it had anti-Christian undercurrents. This was really not so, according to Cocteau, but the false rumor did its damage. It greatly distressed the Noailles. It caused a scandal and the Viscount was on the verge of being expelled from the elegant Jockey Club, and was even threatened with excommunication from the Church. The Noailles forbade Cocteau to allow public release of "The Blood of a Poet" for over a year. Later on, they gave the rights of the film to Auric and Cocteau, allowing them to do whatever they wanted with it.
The life-line of the movie is its imagery, which can be interpreted many different ways, emphasizing Cocteau's view that art disclaimed the world of ordinary appearances and projected vision to be a symbolic representation that must be continually changing, because if it doesn't it will be dead like classicism is and it will cease to exist. The director was afraid that the avant-garde movement would die one day like all other artistic movements have. To continue to be viable, the artist must break the "natural" laws that govern appearances and these strategies for breaking down appearances are the very gist of the film. The avant-garde art must be a kind of "public affront."
Because of its unusual theme and style and unpredictability, this is a film that deserves the high accolades many film critics have bestowed upon it. It resolutely shows how the filmmaker communicates into the spirit world, and he does so without being pretentious.
REVIEWED ON 11/25/99 GRADE: A
Dennis Schwartz: "Ozus' World Movie Reviews"
http://www.sover.net/~ozus
<EMAIL_ADDRESS>© ALL RIGHTS RESERVED DENNIS SCHWARTZ
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


It appears, my friend, that you are lost at sea. Perhaps it would be best to gather your wits and find your way back home.


まだこの世界は 僕を飼いならしてたいみたいだ
It seems this world still wants to keep me on a close leash;
望み通りいいだろう 美しくもがくよ
But that’s just how I want it – I struggle so beautifully.
互いの砂時計 眺めながらキスをしようよ
Staring at our respective hourglasses, let us share a kiss.
「さよなら」から一番 遠い 場所で待ち合わせよう
Let’s arrange to meet at the place farthest from our eventual, “Goodbye”.
辞書にある言葉で 出来上がった世界を憎んだ
I grew to hate this world made up of words you’d find in a dictionary,
万華鏡の中で 八月のある朝
On one August morning, trapped within this kaleidoscope…

嘘みたいな日々を 規格外の意味を
The time finally came… yesterday seemed nothing more than a prologue to the prologue –
悲劇だっていいから望んだよ
But you can skim through if you wish; from here on out is my story:
そしたらドアの外に
Wielding experience, wisdom, and a slightly molded courage,
君が全部抱えて立っていたよ
At a speed unbeknownst until now, I dove to where you were.
運命だとか未来とかって 言葉がどれだけ手を
伸ばそうと届かない 場所で 僕ら遊ぼうか
While dozing off, I dreamed I saw a place different from here
Within my lukewarm cola…
愛し方さえも 君の匂いがした
Outside the windows of my classroom…
歩き方さえも その笑い声がした
On mornings spent swaying to and fro on the train…
いつか消えてなくなる 君のすべてを
この眼に焼き付けておくことは
Even the way you loved carried your smell…
もう権利なんかじゃない 義務だと思うんだ
Even the way you walked carried the sound of your laughter…
運命だとか未来とかって 言葉がどれだけ手を
伸ばそうと届かない 場所で僕ら恋をする
Faced with the fact you’ll eventually disappear,
時計の針も二人を 横目に見ながら進む
I have no choice but to burn your entire existence into my memory, with these two eyes;
そんな世界を二人で 一生 いや、何章でも
I no longer perceive it as a right… I feel that it’s my duty!
生き抜いていこう
We love one another in a place from which, no matter how far we reach out,
Words like “Fate” and “The Future” are completely out of reach.
We proceed on, as the needles of the clock give us sidelong glances;
Making our way through that kind of world, let us spend our entire life- no, as many chapters as we can-
Living on and on, together!


A minimum set of functions to perform compositional data analysis using the log-ratio approach introduced by John Aitchison (1982) <http://www.jstor.org/stable/2345821>. Main functions have been implemented in c++ for better performance.
| Version: | 0.1.10 |
| Depends: | R (≥ 3.0.4) |
| Imports: | Rcpp (≥ 0.12.12), MASS |
| LinkingTo: | Rcpp, RcppArmadillo |
| Published: | 2018-08-06 |
| Author: | Marc Comas-Cufí [aut, cre] |
| Maintainer: | Marc Comas-Cufí <mcomas at imae.udg.edu> |
| License: | GPL-2 | GPL-3 [expanded from: GPL] |
| NeedsCompilation: | yes |
| Materials: | README NEWS |
| CRAN checks: | coda.base results |
| Reference manual: | coda.base.pdf |
| Package source: | coda.base_0.1.10.tar.gz |
| Windows binaries: | r-devel: coda.base_0.1.10.zip, r-release: coda.base_0.1.10.zip, r-oldrel: coda.base_0.1.10.zip |
| OS X binaries: | r-release: coda.base_0.1.10.tgz, r-oldrel: coda.base_0.1.10.tgz |
| Old sources: | coda.base archive |
Please use the canonical form https://CRAN.R-project.org/package=coda.base to link to this page.


get in focus by clicking in the chaotic display. hit space to change mode. hit c to clear canvas. tip: try wiggling up and down!


Harish
EMPName
Harish
CurrentLocation
Hyderabad
JoiningDate
2000-03-13
Role
Clerk
Remarks
working at G01


Spot-to-spot variability of SELDI-TOF mass spectra
The mean, standard deviation, and coefficient of variation (CV%) for eighteen protein peaks from an ion exchange fraction (Q1) of the cytosolic fraction of pooled mouse brain tissue. The overall CV% for peak intensity and m/z ratio on this chip were 17.3% and 0.05%, respectively.


{{#content "title"}}Joblint Results{{/content}} {{#content "description"}}Results for your job spec.{{/content}}
No issues found with the job spec!
This graph is a quick visualisation of how many issues your job spec has.
{{message}}
{{detail}}


Parent Control
Added Products: {{cart.length}}
Name
Description
...
Price
Actions
{{item.name}}
2
Female
{{item.price}}
Add to Cart


By placing your order, you agree to Kpop Global's privacy notice and conditions of use.
In Stock
Only In Stock
Product Unavailable


Blog
Contact
Boost Blockchain Usability with
Real World Data and Computation Power
Join Our Mailing List


Crime
BREAKING: Louth gardai seize cocaine worth €1.4m
GARDAI
by David LynchGardai have seized Cocaine with a street value of €1.4million in Drogheda.
As part of an intelligence led operation under Operation Stratus, at approximately 12.35p.m. today local Gardai from Drogheda Garda Station intercepted a vehicle at the Donore Road Industrial Estate, Drogheda, Co. Louth.
Following a search of this vehicle, packages containing white powder which is believed to be cocaine (subject to analysis) was recovered. In total 20kgs of cocaine with an estimated street value of €1.4 million euros has been recovered.
One male, in his thirties, was arrested at the scene and is currently being detained at Drogheda Garda Station under Section 2 of The Criminal Justice ( Drug Trafficking ) Act 1996.


--- layout: mocks title: Search --- What are you looking for? 🔍 🔍 Search How about one of these? 💁🏽♂ Choice Card 🧐 Which of the following topics does electronic music not cover? Unit 📖 Electronic Music Choice Card 🧐 What is tape music? Page Card 📜 Electronic Music User 👩🏾🎤 music Subject 📚 An Introduction to Electronic Music 🤷🏽♀ Not seeing what you want? 🤷🏽♀ You can suggest a new subject 💡 ✅ Violin Basics 👍 Drop a beat 👍 💡 View all suggestions! ...or learn by creating your subject! 🏗 🌱 Build your own "Music" subject. We'll show you how! 👩🏼🏫 And we'll love you forever. 💕
🔍 Search
🤷🏽♀ Not seeing what you want? 🤷🏽♀
💡 View all suggestions!
🌱 Build your own "Music" subject.
We'll show you how! 👩🏼🏫 And we'll love you forever. 💕


[gecode-users] usage of abs() constraint
Stanimir Dragiev
stanio at cs.tu-berlin.de
Mon Oct 15 21:53:08 CEST 2007
Hello to all on the list!
I was pretty frustrated, that I couldn't get following to work:
---- code ---
//init var_a, var_b
IntVar abs_diff(space, 0, MAX_DIFF);
IntVar signed_diff = post(space, var_a - var_b);
abs( space, signed_diff, abs_diff);
---- end ---
But I found an example in the gecode example models using abs, and I turned
it into:
---- code ---
//init var_a, var_b
IntVar abs_diff(space, 0, MAX_DIFF);
abs_diff = post(space,
abs(space,
minus(space, var_a, var_b,
ICL_DOM),
ICL_DOM),
ICL_DOM);
---- end ---
The latter one does what I expect, while the first leaves abs_diff with it's
original bounds: 0 to MAX_DIFF.
Now I'm a little more frustrated than before, since I don't understand what is
going on :o)
Is it not expected, that both behave the same way?
--
cheers
stanio
More information about the gecode-users
mailing list


Using Codemods
Learn how to migrate your app to CanJS 3 using can-migrate.
Overview
A codemod is a transformation script that parses the AST of source code in order to do a code-aware find-and-replace refactor across multiple files. can-migrate is a CLI utility for running codemods that can help migrate your app to CanJS 3.
For example, the following CanJS 2.3 code:
import can from "can";
import "can/map/define/define";
export default can.Map.extend({
define: {}
});
…can be transformed to this:
import CanMap from "can-map";
import can from "can";
import "can-map-define";
export default CanMap.extend({
define: {}
});
Using this CLI will get you about 85% of the way to having your codebase migrated; it’s not a complete solution for a seamless migration, but it will get you significantly closer than doing the migration by hand.
Install
Install can-migrate
from npm:
npm install -g can-migrate
This will make the can-migrate
command available globally.
Usage
The CLI provides the following options:
can-migrate [<files> OPTIONS...]
Updates files according to the CanJS 3 migration paths (minimal, modern, latest & greatest)
Options
--apply -a Apply transforms (instead of a dry run)
--force Apply transforms regardless of git status
--silent -s Silence output
--config -c Path to custom config file
--transform -t Specify a transform
Example
Runs all the default can-migrate
transforms on the files that match the **/*.js
glob:
can-migrate --apply **/*.js
Runs the can-component-rename
transform on the files that match the **/*.js
glob:
can-migrate --apply **/*.js --transform can-component-rename/can-component-rename.js
You can find a complete list of transforms on GitHub.
Recommended Migration Process
Use the following steps as a guide for using this tool:
Make a new branch for the migration:
git checkout -b migration
Ensure all tests are passing and your git state is clean. As with any migration, if your code is not tested, the amount of time it takes for a successful migration is exponentially greater.
Run the transforms on each modlet or standalone testable component:
can-migrate [<modlet/*.js>] --apply
Alternatively, you can run one transform at a time for a more incremental approach:
can-migrate [<modlet/*.js>] --transforms <transform path> --apply
Install the can-* modules used in that modlet or component. Here are the modules in the Core collection:
npm i can-component --save npm i can-compute --save npm i can-connect --save npm i can-define --save npm i can-route --save npm i can-route-pushstate --save npm i can-set --save npm i can-stache --save npm i can-stache-bindings --save
Run the tests again and fix the bugs as they come up. Review Migrating to CanJS 3 to understand what changes to expect
Commit the module once all tests are passing again.
Repeat 2-6 until all modlet or components are migrated and tests are passing.
Note: If you are using StealJS, ensure you are running StealJS 0.16 or greater.
Introduction to the Transform Scripts
Read this section to understand how the transforms (also called codemods) are organized,
the different types of transformations that are included with can-migrate
,
and what to expect from each one.
There are 3 main types of transforms included in the can-migrate
tool:
replace, import, and require. There are also three module-specific transforms
that handle more complex transformations: can-component-rename
, can-data
,
and can-extend
.
Each can-module that has a transform script has a folder in the src/transforms directory. Most of these folders have the following structure:
can-moduleName/
import.js
replace.js
require.js
You can run a specific transform by passing can-moduleName/replace.js
or you can pass the entire can-moduleName/
directory to the CLI tool with the --transform
flag.
Run all the transforms in the directory:
can-migrate */*.js --apply --transform can-moduleName/
Run a specific transform script:
can-migrate */*.js --apply --transform can-moduleName/replace.js
“Import” Transforms
These transforms change the way a module is imported if it using the import
syntax.
For example, it will transform any of the following:
import Component from "can/component/";
import Component from "can/component/component";
import Component from "can/component/component.js";
…to this:
import Component from "can-component";
“Replace” Transforms
These transforms replace how a module is imported and used, which may vary by module. You can learn how each module is transformed by a particular script in the specific transformation section below.
For example, it can transform code like this:
import can from "can";
can.addClass(el, "myClass");
…to this:
import className from "can-util/dom/class-name/class-name";
import can from "can";
className.addClass.call(el, "myClass");
“Require” Transforms
These transforms handle the cases where a module is loaded using require
.
For example, it will transform any of the following:
const Component = require("can/component/");
const Component = require("can/component/component");
const Component = require("can/component/component.js");
…to this:
const Component = require("can-component");
Custom Transforms
While the replace, import, and require transforms handle most cases, there are
some more specific scripts for can-component-rename
, can-data
, can-extend
.
Read about them in the section below.
Complete List of Transform Scripts
This section details all the transformation scripts with examples of before and after.
can-stache-bindings/colon-bindings
Running the colon-bindings transform:
can-migrate -a src/**/*.{js,md,html,stache,component} -t can-stache-bindings/colon-bindings
…will transform this:
<input {^$value}="H1" {$value}="H2" {($value)}="H3" ($value)="H4"
{^value}="H1" {value}="H2" {(value)}="H3" (value)="H4">
…to this:
<input el:value:to="H1" el:value:from="H2" el:value:bind="H3" on:el:value="H4"
vm:value:to="H1" vm:value:from="H2" vm:value:bind="H3" on:vm:value="H4">
…or this:
Component.extend({
tag: 'my-tag',
template: stache(
'<input {^$value}="H1" {$value}="H2" {($value)}="H3" ($value)="H4" ' +
'{^value}="H1" {value}="H2" {(value)}="H3" (value)="H4">'
)
});
…to this:
Component.extend({
tag: 'my-tag',
template: stache(
'<input el:value:to="H1" el:value:from="H2" el:value:bind="H3" on:el:value="H4" ' +
'vm:value:to="H1" vm:value:from="H2" vm:value:bind="H3" on:vm:value="H4">'
)
});
It will also transform stache bindings inside:
```html
and```js
blocks in.md
files<view>
,<template>
,<view-model>
, and


Psychic Game
Guess What letter (lower case) I am thinking of:
Your Input was:
Scores
Wins:
Loses:
Guesses Left:
Your guesses so far:


As someone who’s never studied business, I feel self-concious about committing words about it to the Internet. Perhaps it’s been said before, but by someone smarter! Anyways… I recently spent a few late nights pondering the question: “what is real value in business” and this is what came out.
- Money is just one part of the equation
An important part, but perhaps not the most important. It seems that, in business, for anything to be brought about a rich network of conditions must come together including, rather notably, the creativity and effort of individuals working together. In a given day of business, countless problems, each novel in their own right, require unique solutions. In practice, this means making countless large & small decisions spanning a whole range of domains.
Money can make precisely zero of these decisions for you, only individuals working alone or in a group can do that: through their sheer intelligence, creativity, and effort.
- What really counts is information
Before money ever changes hands, the real value of a relationship is already developing and taking shape. Information is sent and received in discussions, written words, telephone conversations, and perhaps most importantly of all, emoji. Shared information serves as the basis of an agreement, paving the way to a subsequent deal, sale or transaction.
The value of a relationship is determined in real-time, starting from the moment when information is first exchanged. It is constantly in flux, always susceptible to being influenced and changed. And not by just you, or other people, but by events and conditions, many of which operate outside the control of any one individual. Despite this, we as individuals retain considerable power over the information we contribute to our relationships. And it seems to me that this information is the foundation and even the dominant factor in determining their worth.
Also, there exists potential in our relationships to influence all sorts of outcomes. Our relationships exist as dynamic, distributed graphs of information and meaning shared between nodes of people. Though we are just an individual with limited powers, we are connected to a cultural and technological force with a proven history of astonishing ingenuity.
- The foundation of information is communication
Information is meaningless in a vacuum. It develops meaning through a simple process. When you contribute information, you give it meaning through formulation and transmission, and when you receive information, you give it meaning through interpretation and retention. The result can be a faithful copy, or it can be corrupt. It’s meaning can be the same as the source, or it can be different. Shared information and meaning is the fulcrum of a relationship.
formulation, transmission, interpretation, and retention of information
Each of these represents a tree of competencies with their own theories to study and methods to practice, each complete with stages of development and accomplishment. Ultimately, these are are what allow us humans to build relationships. And by the way, it’s a testament to our unbelievably miraculous biology that all of this is possible in the first place!
- The foundation of communication is trust
If I had to pick one factor that always makes a difference in relationships, there’s a clear winner and that is trust. A person is like a box of information. There are certain things you can tell from the outside, but most of the time the valuable information is locked within.
Trust exists between individuals as the product of good will & shared meaning. It has the effect of unlocking information so that individuals can share it and act upon it. It also behaves as a powerful supporting condition for high-fidelity communication: simply, it is easier to communicate with someone you trust.
I believe that information-and-trust is the real currency of business. As a view it has significant power to explain why some endeavors succeed while others fail. Even the simple act of pondering it leads to an outflow of effective strategies and positive daily choices.
And finally, it reminds us of our true power as individuals: that through each-other, through the amazing power of our big, networked, Homo-Sapiens brains, we are powerful. Powerful enough to shape history itself.


Id: 430
Name: Chair-person
Status: Alive
Species: Humanoid
Type: Chair
Gender: Male
OriginName: Earth (Chair Dimension)
OriginUrl: https://rickandmortyapi.com/api/location/74
LocationName: Earth (Chair Dimension)
LocationUrl: https://rickandmortyapi.com/api/location/74
Image: https://rickandmortyapi.com/api/character/avatar/430.jpeg
Episode: ['https://rickandmortyapi.com/api/episode/10']
Url: https://rickandmortyapi.com/api/character/430
Created: 2018-04-16T21:59:48.220Z


Hey there Folks! Let me start by Introducing myself by my name, my Name is Anurag Sahu, I am a silent person I have to work on my communication skills but if I get comfortable with you, I might be the most talkative and extrovert person you will find on planet earth, I love to make things Automatic, I love writing small scripts which will make my work lesser, I am biigggggg fan of github, I sometimes wonder how can such an small platform for just sharing your code with the world be soo awesome. You can talk to me about interesting projects, or Fitness protiens or how did I lost the my weight that too thrice I might not be the best advice for you but I am certainly someone in front of whom you will not feel inferior.
Ohk More About me section, honestly I don't know what else is left to tell you about myself There is a More About me section in the Template and I have to Fill this Section, And am not letting this opportunity go, Lets get a little deeper here:-
Starting from my birth, I was born in an hospital in Tilda, It is a place in Chhattisgarh my father was an Engineer at Century Cement Plant at that time, I was the first child in the house, even my father was the Only male child and Even my Grand Father was the only male child of his parents, So you can surely say That I was pampered like anything,
Later my younger brother was born, surprisingly he was just an year younger than me every body in the locality used to say that he couldn't see me with his parents alone for any longer so he came early, he was very very mischevious we did evey crazy thing we could possibly do we used to buy some cheap helicopters from the toy shop fly it from the top floor of our building just to see our brand me toy smashing into the ground for the sake of our curiosity,
The Game was inspired from SubwaySurfer, It has a person, where the person playing will be trying to escape a chasing police officer running in a narrow obstacle filled lane.
View ProjectThe game was part of my Graphics Assignment, It had a Aeroplane and some Checkpoints and we had to shoot down the check points also we had to cover certain fuels ups, bonous points were also implemented, Also it had compass and speedometer and altometer implemented.
View ProjectThe game was basically a 2D game with inspiration from Jetpack joyride, From this I learned a lot of new things such as how OpenGl works, Implemented Collision Detection, 7 Segement Score Display Board. also it had many more features, you can visit the project page for more infomation on it.
View ProjectAs Part of our Software System Design and Architecture Course my First Assignment was to make a terminal Based Mario game, It was just an ASCII game with many features like it had pipes, Dragon and Game over screens.
View ProjectMade an AI Bot for searching the search tree and coming up with the most optimal step to be taken.
View ProjectAs Part of My Course, Introduction to Artifical Intelligence, We made an AI Policy Generator in Deterministic Environment, For more Information, Visit the Project Page.
View Project


|
Site Navigation
Special
thanks to some famous New Yorkers like:
Kareem Abdul-Jabbar, Lucille Ball , Humphrey Bogart, Tom Cruise,
Sammy Davis, Jr, Billy Joel, Franklin D. Roosevelt, Jackie Gleason, the first person who said "I
love New York", and the planners
of EZ Pass ......
Visit the
Official Website of the
New York Giants
_________________
_____________
Check Out New York's One & Only
Flixter's Movie Reviews!
|
The
New York City Website Directory,
New York City Metro is a directory of categorized
New York Website listings, chosen by our
New York City Metro staff. Each website has been
selected for its New York content and New York
relevance. If you have a New York website
or a NY web page that you would like to have
listed, please submit it to us for inclusion; New
York City Metro
is updated weekly and all basic listings are FREE!
Search the New York Directory:
|
The New York City Metro Block
Have your New York website featured on New
York City Metro's Block (below) Contact
New York City Metro Here
Visit Our Featured New York
Websites:
|
Or Search New York City Metro Below:
|
9-11-2001
We will never forget.
__________
__________
Friends of New York City Metro:
_________
Visit the Official Website of the
New York Rangers
_____________
Official Website of
the
New York Yankees
_____________
newyorkcitymetro.com
is a proud member of:
|


{{engineer.name}}
Priority
Customer Name
Gears ID
Type #
Classification
Engagement Manager
Hours
Forecast
{{entry.priority}}
{{entry.customerName}}
{{entry.gearsId}}
{{entry.typeRefNumber}}
{{entry.typeText}}
{{entry.engagementManager}}
{{entry.hours}}
{{entry.forecast}}


Arrest Made in Egg-Throwing Attacks on Jews in Brooklyn
by JNS News ServiceAn arrest was made on Wednesday night in a case of egg-throwing attacks on Jews in Brooklyn, N.Y.
Mohib Hoque, 18, was apprehended and charged with three hate crimes for being part of a group of teens that threw eggs at a 50-year-old woman on Saturday, also the Jewish Sabbath, in the Borough Park neighborhood. She was hit in the back.
Later, the group hit a man with an egg.
He then threw eggs at Congregation Bnei Torah Sanz between the neighborhoods of Flatbush and Borough Park as worshippers were leaving.
There were no injuries in the incidents, according to police.
The incidents exemplify the spike in anti-Semitic hate crimes in Brooklyn in recent months.


Suppose that you want to give the constraints that you are interested in as an argument to the visualizer, instead of defining them in a table. The following visualizer implements this.
:- use_module(library(lists), [append/3]). %% filter_events(+CtrSpecs, +Constraint, +Actions): This predicate will %% only show constraint events if they match an element in the list CtrSpecs, %% or if CtrSpecs is wrapped in -/1, all the non-matching events will %% be shown. %% CtrSpecs can contain the following types of elements: %% ctr_name - matches all constraints of the given name %% ctr_name/arity - matches constraints with the given name and arity %% ctr_name(...args...) - matches constraints unifyable with the given term %% %% For the selected events fdbg_show(Constraint, Actions) is called. %% This visualizer can be specified when turning fdbg on, e.g.: %% fdbg_on([constraint_hook(filter_events([count/4]))]), or %% fdbg_on([constraint_hook(filter_events(-[in_set]))]). filter_events(CtrSpecs, Constraint, Actions) :- filter_events(CtrSpecs, fdbg_show, Constraint, Actions). %% filter_events(+CtrSpecs, +Visualizer, +Constraint, +Actions): Same as %% the above predicate, but the extra argument Visualizer specifies the %% predicate to be called for the selected events (in the same form as %% in the constraint_hook option, i.e. without the last two arguments). E.g. %% fdbg_on([constraint_hook(filter_events([count/4],my_show))]). filter_events(-CtrSpecs, Visualizer, Constraint, Actions) :- !, \+ show_constraint(CtrSpecs, Constraint), add_args(Visualizer, [Constraint, Actions], Goal), call(Goal). filter_events(CtrSpecs, Visualizer, Constraint, Actions) :- show_constraint(CtrSpecs, Constraint), add_args(Visualizer, [Constraint, Actions], Goal), call(Goal). show_constraint([C|_], Constraint) :- matches(C, Constraint), !. show_constraint([_|Cs], Constraint) :- show_constraint(Cs, Constraint). matches(Name/Arity, Constraint) :- !, functor(Constraint, Name, Arity). matches(Name, Constraint) :- atom(Name), !, functor(Constraint, Name, _). matches(C, Constraint) :- C = Constraint. add_args(Goal0, NewArgs, Goal) :- Goal0 =.. [F|Args0], append(Args0, NewArgs, Args), Goal =.. [F|Args].
Here is a session using the visualizer, filtering out everything
but all_different/1
constraints:
| ?- [library('clpfd/examples/suudoku')]. [...] | ?- fdbg_on(constraint_hook(filter_events([all_different/1]))). % The clp(fd) debugger is switched on % advice | ?- suudoku([], 1, P). all_different([1,<fdvar_1>,<fdvar_2>,8,<fdvar_3>, 4,<fdvar_4>,<fdvar_5>,<fdvar_6>]) fdvar_1 = 1..9 -> (2..3)\/(5..7)\/{9} fdvar_2 = 1..9 -> (2..3)\/(5..7)\/{9} fdvar_3 = 1..9 -> (2..3)\/(5..7)\/{9} fdvar_4 = 1..9 -> (2..3)\/(5..7)\/{9} fdvar_5 = 1..9 -> (2..3)\/(5..7)\/{9} fdvar_6 = 1..9 -> (2..3)\/(5..7)\/{9} [...] all_different([7,6,2,5,8,4,1,3,9]) Constraint exited. P = [...] ; no % advice | ?- fdbg_off. % The clp(fd) debugger is switched off
In the next session, all constraints named all_different
are
ignored, irrespective of arity. Also, we explicitly specified the
visualizer to be called for the events that are kept (here, we have
written the default, fdbg_show
, so the actual behavior is not
changed).
| ?- [library('clpfd/examples/suudoku')]. [...] | ?- fdbg_on(constraint_hook(filter_events(-[all_different],fdbg_show))). % The clp(fd) debugger is switched on % advice | ?- suudoku([], 1, P). domain([1,<fdvar_1>,<fdvar_2>,8,<fdvar_3>, 4,<fdvar_4>,<fdvar_5>,<fdvar_6>],1,9) fdvar_1 = inf..sup -> 1..9 fdvar_2 = inf..sup -> 1..9 fdvar_3 = inf..sup -> 1..9 fdvar_4 = inf..sup -> 1..9 fdvar_5 = inf..sup -> 1..9 fdvar_6 = inf..sup -> 1..9 Constraint exited. Constraint exited. [...] domain([2,<fdvar_46>,5,<fdvar_47>,<fdvar_48>, <fdvar_49>,<fdvar_50>,<fdvar_51>,9],1,9) fdvar_46 = inf..sup -> 1..9 fdvar_47 = inf..sup -> 1..9 fdvar_48 = inf..sup -> 1..9 fdvar_49 = inf..sup -> 1..9 fdvar_50 = inf..sup -> 1..9 fdvar_51 = inf..sup -> 1..9 Constraint exited. P = [...] ; no % advice | ?- fdbg_off. % The clp(fd) debugger is switched off
In the last session, we specify a list of constraints to ignore, using a pattern to select the appropriate constraints. Since all constraints in the example match one of the items in the given list, no events are printed.
| ?- [library('clpfd/examples/suudoku')]. [...] | ?- fdbg_on(constraint_hook(filter_events(-[domain(_,1,9),all_different(_)]))). % The clp(fd) debugger is switched on % advice | ?- suudoku([], 1, P). P = [...] ; no % advice | ?- fdbg_off. % The clp(fd) debugger is switched off


LOGO
work
contact
I'm Christoffer Lambertsson, a
fullstack developer
living in Stockholm, currently working for Spotify.
Currently
Previously
Highlighted work


{% extends "base.html" %} {% macro render_reference(ref) %} {{ref.value(ns.dc.creator)}}. {{ref.value(ns.dc.title)}}, {{ref.value(ns.dc.bibliographicCitation)}} {% for also in ref[ns.RDFS.seeAlso] %} {% if also[ns.RDF.type:ns.hbgd.PubMedCentralArticle] %} {% elif also[ns.RDF.type:ns.hbgd.PubMedArticle] %} {% endif %} {% endfor %} {% endmacro %} {% macro render_definition(def) %}
{{def.value(ns.prov.value)}}
{{note}}
{% endfor %}{{render_reference(ex)}}
{% endif %} {% endfor %}The Healthy Birth, Growth, and Development Ontology helps HBGDki ensure that the results of HBGD investigations can be translated into actionable interventions for healthy birth, growth and development.
An ontology is an organized collection of key terminology and concepts relevant to a particular domain of knowledge.
Our browser is designed for easy access to terms and definitions which are grounded with links to other resources.
Help us refine our definitions and find new terms. Contact the Ontology Team for feedback or to request an account.
{{term}}
{% endfor %}


Search
Select Your Name
First Name
Last Name
Training Available
Cohesity
ESD
Forcepoint
Mcafee
Supermicro
Attivo
For Future add-Ons courses
Some other courses with a very long option text
Select your Location
Fremont HQ
Ireland
China
Add New Employee Details
Mr.
Mrs.
Emp ID
Location
Miscellaneous


Dear Sir, I got your contact from our Chamber of Commerce where your name was listed as a reputable person.I therefore decided to contact you to assist me in the mentioned venture below. I am the wife of Ndoga Mupesa, my husband was allegedly killed by government of President Mugabe for supporting the Movement for Democratic Change, visit this website and see how they killed my husband. http://www.1freespace.com/beetee/apr07_2001.html. However, on the eve of my husband's death in April 5. 2001, he gave me the sum of US$39million in cash to move to Lebanon,but immediately my husband died I moved the funds to security company through a diplomatic courier service to europe. The funds have been in the security company since April 5.2001.Because of the restriction placed on me and my children by the government of President Robert Mugabe, I Simply cannot travel to secure this funds from the security company where this said amount was deposited. please As soon as you confirm to me by email<EMAIL_ADDRESS>your readiness to assist me,I will fax a copy of my Power of Attorney to the security company to authorizing them to release the funds to you. As soon as you have the funds in your custody, I will give you my account details in the Bahamas where you will transfer my funds to on mybehalf and You will be entitled to 20% of the total sum involved for your assistance. Please contact me immediately . Sincerely. Mrs Jane Mupesa. Mashonaland Central province. ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ Nutch-developers mailing list<EMAIL_ADDRESS>https://lists.sourceforge.net/lists/listinfo/nutch-developers


|
libcoap
4.1.2
|
Data Structures | |
| struct | coap_opt_iterator_t |
| Iterator to run through PDU options. More... | |
Macros | |
| #define | COAP_OPT_FILTER_SHORT 6 |
| The number of option types below 256 that can be stored in an option filter. More... | |
| #define | COAP_OPT_FILTER_LONG 2 |
| The number of option types above 255 that can be stored in an option filter. More... | |
| #define | COAP_OPT_FILTER_SIZE (((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) +1 |
| The number of elements in coap_opt_filter_t. More... | |
| #define | COAP_OPT_ALL NULL |
| Pre-defined filter that includes all options. More... | |
| #define | COAP_OPT_DELTA(opt) coap_opt_delta(opt) |
| #define | COAP_OPT_SETDELTA(opt, val) coap_opt_encode((opt), COAP_MAX_PDU_SIZE, (val), NULL, 0) |
| #define | COAP_OPT_LENGTH(opt) coap_opt_length(opt) |
| #define | COAP_OPT_VALUE(opt) coap_opt_value((coap_opt_t *)opt) |
Typedefs | |
| typedef uint16_t | coap_opt_filter_t[COAP_OPT_FILTER_SIZE] |
| Fixed-size vector we use for option filtering. More... | |
Functions | |
| static void | coap_option_filter_clear (coap_opt_filter_t f) |
Clears filter f . More... | |
| int | coap_option_filter_set (coap_opt_filter_t filter, unsigned short type) |
Sets the corresponding entry for type in filter . More... | |
| int | coap_option_filter_unset (coap_opt_filter_t filter, unsigned short type) |
Clears the corresponding entry for type in filter . More... | |
| int | coap_option_filter_get (const coap_opt_filter_t filter, unsigned short type) |
Checks if type is contained in filter . More... | |
| static int | coap_option_setb (coap_opt_filter_t filter, unsigned short type) |
Sets the corresponding bit for type in filter . More... | |
| static int | coap_option_clrb (coap_opt_filter_t filter, unsigned short type) |
Clears the corresponding bit for type in filter . More... | |
| static int | coap_option_getb (const coap_opt_filter_t filter, unsigned short type) |
Gets the corresponding bit for type in filter . More... | |
| coap_opt_iterator_t * | coap_option_iterator_init (coap_pdu_t *pdu, coap_opt_iterator_t *oi, const coap_opt_filter_t filter) |
Initializes the given option iterator oi to point to the beginning of the pdu's option list. More... | |
| coap_opt_t * | coap_option_next (coap_opt_iterator_t *oi) |
Updates the iterator oi to point to the next option. More... | |
| coap_opt_t * | coap_check_option (coap_pdu_t *pdu, unsigned short type, coap_opt_iterator_t *oi) |
Retrieves the first option of type type from pdu . More... | |
| size_t | coap_opt_setheader (coap_opt_t *opt, size_t maxlen, unsigned short delta, size_t length) |
Encodes the given delta and length values into opt . More... | |
| size_t | coap_opt_encode (coap_opt_t *opt, size_t n, unsigned short delta, const unsigned char *val, size_t length) |
Encodes option with given delta into opt . More... | |
| unsigned short | coap_opt_delta (const coap_opt_t *opt) |
| Decodes the delta value of the next option. More... | |
| unsigned short | coap_opt_length (const coap_opt_t *opt) |
| Returns the length of the given option. More... | |
| unsigned char * | coap_opt_value (coap_opt_t *opt) |
| Returns a pointer to the value of the given option. More... | |
| #define COAP_OPT_ALL NULL |
| #define COAP_OPT_DELTA | ( | opt | ) | coap_opt_delta(opt) |
| #define COAP_OPT_FILTER_LONG 2 |
| #define COAP_OPT_FILTER_SHORT 6 |
| #define COAP_OPT_FILTER_SIZE (((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) +1 |
| #define COAP_OPT_LENGTH | ( | opt | ) | coap_opt_length(opt) |
| #define COAP_OPT_SETDELTA | ( | opt, | |
| val | |||
| ) | coap_opt_encode((opt), COAP_MAX_PDU_SIZE, (val), NULL, 0) |
| #define COAP_OPT_VALUE | ( | opt | ) | coap_opt_value((coap_opt_t *)opt) |
| typedef uint16_t coap_opt_filter_t[COAP_OPT_FILTER_SIZE] |
Fixed-size vector we use for option filtering.
It is large enough to hold COAP_OPT_FILTER_SHORT entries with an option number between 0 and 255, and COAP_OPT_FILTER_LONG entries with an option number between 256 and 65535. Its internal structure is
The first element contains a bit vector that indicates which fields in the remaining array are used. The first COAP_OPT_FILTER_LONG bits correspond to the long option types that are stored in the elements from index 1 to COAP_OPT_FILTER_LONG. The next COAP_OPT_FILTER_SHORT bits correspond to the short option types that are stored in the elements from index COAP_OPT_FILTER_LONG + 1 to COAP_OPT_FILTER_LONG + COAP_OPT_FILTER_SHORT. The latter elements are treated as bytes.
| coap_opt_t* coap_check_option | ( | coap_pdu_t * | pdu, |
| unsigned short | type, | ||
| coap_opt_iterator_t * | oi | ||
| ) |
Retrieves the first option of type type
from pdu
.
oi
must point to a coap_opt_iterator_t object that will be initialized by this function to filter only options with code type
. This function returns the first option with this type, or NULL
if not found.
| pdu | The PDU to parse for options. |
| type | The option type code to search for. |
| oi | An iterator object to use. |
type
, or NULL
if not found. Definition at line 209 of file option.c.
| unsigned short coap_opt_delta | ( | const coap_opt_t * | opt | ) |
Decodes the delta value of the next option.
This function returns the number of bytes read or 0
on error. The caller of this function must ensure that it does not read over the boundaries of opt
(e.g. by calling coap_opt_check_delta().
| opt | The option to examine. |
0
on error. | size_t coap_opt_encode | ( | coap_opt_t * | opt, |
| size_t | n, | ||
| unsigned short | delta, | ||
| const unsigned char * | val, | ||
| size_t | length | ||
| ) |
Encodes option with given delta
into opt
.
This function returns the number of bytes written to opt
or 0
on error. This happens especially when opt
does not provide sufficient space to store the option value, delta, and option jumps when required.
| opt | The option buffer space where val is written. |
| n | Maximum length of opt . |
| delta | The option delta. |
| val | The option value to copy into opt . |
| length | The actual length of val . |
opt
or 0
on error. The return value will always be less than n
. Definition at line 384 of file option.c.
| unsigned short coap_opt_length | ( | const coap_opt_t * | opt | ) |
Returns the length of the given option.
opt
must point to an option jump or the beginning of the option. This function returns 0
when opt
is not an option or the actual length of opt
(which can be 0
as well).
0
in case of an error is that in most contexts, the result of this function is used to skip the next coap_opt_length() bytes.}| opt | The option whose length should be returned. |
0
when undefined. Definition at line 251 of file option.c.
| size_t coap_opt_setheader | ( | coap_opt_t * | opt, |
| size_t | maxlen, | ||
| unsigned short | delta, | ||
| size_t | length | ||
| ) |
Encodes the given delta and length values into opt
.
This function returns the number of bytes that were required to encode delta
and length
or 0
on error. Note that the result indicates by how many bytes opt
must be advanced to encode the option value.
| opt | The option buffer space where delta and length are written. |
| maxlen | The maximum length of opt . |
| delta | The actual delta value to encode. |
| length | The actual length value to encode. |
0
on error. Definition at line 329 of file option.c.
| unsigned char* coap_opt_value | ( | coap_opt_t * | opt | ) |
Returns a pointer to the value of the given option.
opt
must point to an option jump or the beginning of the option. This function returns NULL
if opt
is not a valid option.
| opt | The option whose value should be returned. |
NULL
on error. Definition at line 286 of file option.c.
|
inlinestatic |
Clears the corresponding bit for type
in filter
.
This function returns 1
if bit was cleared or -1
on error (i.e. when the given type does not fit in the filter).
| filter | The filter object to change. |
| type | The type for which the bit should be cleared. |
1
if bit was set, -1
otherwise. Definition at line 216 of file option.h.
|
inlinestatic |
| int coap_option_filter_get | ( | const coap_opt_filter_t | filter, |
| unsigned short | type | ||
| ) |
Checks if type
is contained in filter
.
This function returns 1
if found, 0
if not, or -1
on error (i.e. when the given type does not fit in the filter).
| filter | The filter object to search. |
| type | The type to search for. |
1
if type
was found, 0
otherwise, or -1
on error. Definition at line 519 of file option.c.
| int coap_option_filter_set | ( | coap_opt_filter_t | filter, |
| unsigned short | type | ||
| ) |
Sets the corresponding entry for type
in filter
.
This function returns 1
if bit was set or 0
on error (i.e. when the given type does not fit in the filter).
| filter | The filter object to change. |
| type | The type for which the bit should be set. |
1
if bit was set, 0
otherwise. Definition at line 509 of file option.c.
| int coap_option_filter_unset | ( | coap_opt_filter_t | filter, |
| unsigned short | type | ||
| ) |
Clears the corresponding entry for type
in filter
.
This function returns 1
if bit was set or 0
on error (i.e. when the given type does not fit in the filter).
| filter | The filter object to change. |
| type | The type that should be cleared from the filter. |
1
if bit was set, 0
otherwise. Definition at line 514 of file option.c.
|
inlinestatic |
Gets the corresponding bit for type
in filter
.
This function returns 1
if the bit is set 0
if not, or -1
on error (i.e. when the given type does not fit in the filter).
| filter | The filter object to read bit from. |
| type | The type for which the bit should be read. |
1
if bit was set, 0
if not, -1
on error. Definition at line 233 of file option.h.
| coap_opt_iterator_t* coap_option_iterator_init | ( | coap_pdu_t * | pdu, |
| coap_opt_iterator_t * | oi, | ||
| const coap_opt_filter_t | filter | ||
| ) |
Initializes the given option iterator oi
to point to the beginning of the pdu's
option list.
This function returns oi
on success, NULL
otherwise (i.e. when no options exist). Note that a length check on the option list must be performed before coap_option_iterator_init() is called.
| pdu | The PDU the options of which should be walked through. |
| oi | An iterator object that will be initilized. |
| filter | An optional option type filter. With type != COAP_OPT_ALL , coap_option_next() will return only options matching this bitmask. Fence-post options 14 , 28 , 42 , ... are always skipped. |
oi
on success, NULL
otherwise. Definition at line 120 of file option.c.
| coap_opt_t* coap_option_next | ( | coap_opt_iterator_t * | oi | ) |
Updates the iterator oi
to point to the next option.
This function returns a pointer to that option or NULL
if no more options exist. The contents of oi
will be updated. In particular, oi->n
specifies the current option's ordinal number (counted from 1
), oi->type
is the option's type code, and oi->option
points to the beginning of the current option itself. When advanced past the last option, oi->option
will be NULL
.
Note that options are skipped whose corresponding bits in the filter specified with coap_option_iterator_init() are 0
. Options with type codes that do not fit in this filter hence will always be returned.
| oi | The option iterator to update. |
NULL
if no more options exist. Definition at line 159 of file option.c.
|
inlinestatic |
Sets the corresponding bit for type
in filter
.
This function returns 1
if bit was set or -1
on error (i.e. when the given type does not fit in the filter).
| filter | The filter object to change. |
| type | The type for which the bit should be set. |
1
if bit was set, -1
otherwise. Definition at line 199 of file option.h.


loading, please wait...
Program A @
Program B @
Run — F7
Run super fast (non-interactive) — F8
Step into debugger — F10
< back
↺
>>>|
>>>
>>
>
||
steps:
-1
+1
go
game over
please wait
error
Memory
Overview
Current Step:
Program A
winner
draw
Processes:
Last:
Next:
Program B
winner
draw
Processes:
Last:
Next:
Listing
autofocus
Breakpoints
add
clear
Apply
Cancel
Break on address:
Break A here
Break B here
Break when A changes memory
Break when B changes memory


Updated: {{ctrl.lastUpdatedDate}}
This topic describes the entity and type representations for common items that the {{ctrl.apiTitle}} API uses. To learn about how to set up your developer account and work with the SKY API, see the Getting Started guide.
There was an issue loading the Entity Reference for the {{ctrl.apiTitle}} API.
{{entity.description}}
The {{entity.displayName}} entity has the following properties: