This document describes how to interact with the Adept task learning system in order to automate tasks using Adept-enabled applications. The document provides an overview of the Adept user interface (UI) and describes the processes for learning, saving, and executing procedures.
Bundled with the Adept release are
1) a simple application for image manipulation, and
2) a simple puzzle game called Novo.
Adept operates in parallel with one or more client applications that are Adept-enabled, meaning that they provide instrumentation and automation that are registered with Adept as an action model. (The Adept Client Guide provides additional details on specifying an action model.) Initiating task learning thus requires starting first Adept and then the Adept-enabled application(s) in which tasks are to be demonstrated.
Starting Adept brings up its main UI window, pictured below, which is referred to as the Procedure Management window.
As described in the section Managing Learned Procedures, this window provides access to manage procedures that have been learned. Clicking the "Demonstrate" button will open a "Procedure Demonstrator" window (pictured below) that provides the controls for teaching a task to the system. [The process of creating a learned procedure through demonstration of a task is described in the section Creating a Learned Procedure.]
The "Run" button in the lower right-hand corner of the Procedure Management window enables execution of a learned procedure, as described further in the section Executing a Learned Procedure. It is disabled until you select a procedure in the Procedure Management window. Clicking the "Run" button opens a "Procedure Executor" window (pictured below) to enable user control of the execution process.
Image Loader comes with a folder containing a few sample images. It is installed at:
Initial state when starting Image Loader
Image opened
Image resized
Novo is a simple puzzle game in which the user is asked to construct various objects and scenes from primitive game pieces. A piece is defined by its shape, size and color. Novo provides a few puzzles out of the box but also allows the user to play in an open-ended fashion and explore some of the capabilities of the task learning system. Be sure Adept is running and that you have a Demonstrator window open with the Record button pressed before trying to learn procedures for Novo.
To open a puzzle in Novo, click the "Puzzles" button on the main toolbar and choose a puzzle to open. A good first puzzle to try is the 'Tree' puzzle. If you select 'Tree', Novo will open the starting configuration for the Tree puzzle and, in a popup window, display the goal of the puzzle.
You can move the window that depicts the goal of the puzzle to the side so you can reference it while working on the puzzle. Or, you can dismiss it. If at any time you would like to view the goal depiction again, simply click the button that says 'Tree' on the main toolbar (circled in red in the above screenshot).
If you just want to play with Novo and don't want to solve a specific puzzle, go to the Puzzles button on the main toolbar and select 'Blank Canvas'.
There are five tools to assist you in solving a puzzle. They are as follows:
Every factory is available from the factory toolbar on the left side of the game window. Let's try solving the Tree puzzle.
The Factory toolbar is highlighted by a red rectangle in this image
Clicking each button on the Factory Toolbar will cause the corresponding factory to open below. Let's begin with the Shape Factory. We know we'll need at least three triangles to solve the puzzle and we already have one. So let's generate two additional triangles:
Once you have a factory configured correctly, press the 'Run Factory' to make things happen.
There are now enough triangles to solve the puzzle. However, the circle is a bit pesky and doesn't contribute to solving the puzzle. We can filter it out using the Filter Factory. Choose the Filter Factory by clicking the "Filter" button on the factory toolbar. Configure the Filter Factory as shown below to remove the circle:
Next, let's make our three triangles green. First, open the Color Factory. Then, click and drag one of the triangles from the working area in to the "Input piece" socket in the Color Factory.
Dragging a piece in to the Color Factory to produce a copy with a different color
Once the black triangle is in the socket, select 'Green' for the color of the new piece. Then press the 'Run Factory' button. Repeat this for all three triangles.
Next we need to make the triangles different sizes. To do this we'll use the Size Factory. Open the Size Factory, and drag one of the green triangles into the 'Input piece" socket. Choose 'Small' for the size and run the factory. Do this a second time but specify 'Large' to create a large green triangle. We don't need to create a medium green triangle since we already have one.
The last step required to solve the puzzle is to use the Assembly Factory to assemble our three triangle pieces in to a tree. First, open the Assembly Factory. Unlike the previous two factories, the Assembly Factory has three sockets for input pieces. Two or more input pieces are sufficient to run the Assembly Factory. First, configure the 'Direction' of the Assembly Factory to be vertical since that is how we want our pieces configured. Then, drag the three triangle pieces in to the input sockets of the factory in increasing size from top to bottom. Use the factory preview at the bottom of the Assembly Factory to verify that the tree is being constructed properly.
Once the Factory Output Preview looks like a tree press the 'Run Factory' button to run the factory and create the tree.
Congratulations, you've solved your first puzzle in Novo!
New procedures are created by using the Procedure Demonstrator window, which is accessible from the main Adept UI window. To demonstrate a procedure, open the Procedure Demonstrator via the "Demonstrate" button and click "Record." This notifies Adept that it should accept actions from Adept-enabled applications and use them to create a procedure. Actions are tracked in the Procedure Demonstrator window as they are performed. For example, the window below shows a trace of three steps that have been performed as part of a demonstration within the Image Loader application.
Procedure Demonstrator window with an action trace for a demonstration with the Image Loader application
Care should be taken to wait for an action to fully complete, and for its instrumentation to appear in the Procedure Demonstrator window, before demonstrating the next action (or before completing the demonstration with the "Finish" button). Otherwise, the actions could appear in an unintended order (or possibly be omitted from this demonstration and included in the next).
Actions in the demonstration trace are deleted individually using the "Delete Action" button or are all deleted using the "Clear" button. Demonstration is temporarily paused by using the "Pause" button, which tells Adept to retain all already demonstrated actions but not to include any new ones until the "Record" button is again hit.
When done demonstrating a procedure, press the "Finish" button to cause the procedure to be learned. This produces a three-part display (see below) that summarizes the parameters, the generalized action sequence, and the outputs of the procedure. Each parameter is assigned as a default the value used in the demonstration; however, a user can modify those values before saving the procedure. Parameters are discussed further in the section Executing a Learned Procedure below.
If the procedure is satisfactory, the user can press the save button and a dialog window will appear where the user can assign a meaningful name and save the procedure for subsequent execution. Prior to pressing the save button, the user may choose to provide a description of the procedure in the text box at the top of the preview.
When saved, the newly learned procedure appears in the list of available procedures in the Procedure Management window.
Procedures are run using the Procedure Executor window, which is accessed by selecting a procedure and clicking "Run" from the main UI. From here, input parameters are specified before executing the procedure, or the procedure is simply run with the default values for parameters.
If the default parameter values are accepted, then executing the procedure performs the exact same task as when the procedure was demonstrated. However, if any default values are changed, the executed procedure performs a task similar to, but not identical to, the demonstration that created the procedure. This illustrates perhaps the most powerful feature of Adept: generalizing the demonstrated behavior rather than re-executing it verbatim.
Pressing the "Run" button executes the procedure. Pressing the "Cancel" button closes the window.
If an error occurs during the execution of a procedure, a popup window appears. For example, an error can occur if invalid inputs are entered, such as a nonnumeric value for a numeric parameter.
It is perfectly valid to execute a procedure during a demonstration. The procedure name appears in the demonstration
window along with its parameters, similar to other actions. The resulting learned procedure will invoke it.
This allows complex procedures to be built out of simpler ones.
When a learned procedure is saved after a demonstration, it becomes available not only for execution but also for visualization and editing. This functionality is accessed within the Adept UI window by clicking on the "Edit" button. This launches another window called the "Procedure Editor".
If a procedure is selected at the time the "Edit" button is clicked, the Procedure Editor will open that procedure directly. Otherwise, the Procedure Editor will open and the user may either create a new procedure (manually), or open an existing procedure using the "Open" button in the Procedure Editor's toolbar.
The Procedure Editor is a powerful application. Its functionality is more fully described in the Editor Guide.
Procedures are stored as individual files in the user's file system persistence directory.
This directory is at an operating-system-dependent location:
%APPDATA%\AdeptTaskLearning\lumen\0_4
(%APPDATA%
refers to the location where the various Windows operating systems
store application data).
The file name of the procedure is <procedure-name>.procedure
.
Neither the persistence directory location nor the procedure file names need to be known to
operate Adept. However, this information may be useful for system operations such as
backing up and restoring files.
Selected procedures may be renamed or deleted through the "Manage" drop-down menu. A procedure can be exported to another file location to facilitate sharing procedures with other users. The import command brings a procedure exported in this manner by another user into the user's persistence directory.
A structure has a fixed number of elements, each identified by a unique name. For example, an application might represent a postal address as a structure with elements for street number, street name, city, state, and postal code. A person might be represented as a structure with a first name, last name, sex, and age. When a structure is used as a parameter in a learned procedure, it appears as a button with preview text in the Procedure Executor window. Clicking the button will open a dialog that allows you to view and edit the individual values that comprise the structure.
The Novo application uses a structure to represent a piece; its three elements are its shape, size and color. The following screenshot shows an example Novo procedure that accepts a game piece as input:
A collection may have any number of elements, including zero. All elements of a collection are of the same type. For example, an application could have a collection of persons and a collection of addresses, but could not have a collection containing both.
When a collection is used as a procedure input, it appears as a button with preview text, similar to a structure input. Clicking the preview button results in a dialog appearing that allows for the following operations:
In Image Loader, the contents of a directory are represented as a collection of files, while the file extensions (such as "bmp" or "gif") used as format filters for selecting images are represented as a collection of strings.
There are three types of collections: lists, sets, and bags.
The elements in a list are ordered while the elements of a set are not;
as discussed in the next section, ordering can impact the structure of procedures learned by Adept.
Bags are like sets except that they allow duplicate elements.
The three collection types are displayed in a similar manner.
Suppose that you have a folder of image files, each of which you want to resize into a thumbnail-sized image.
If the folder contains two image files (e.g., John.jpg
and Mary.jpg
),
then Adept could learn a procedure for accomplishing this task from the following demonstration:
The learned procedure for this demonstration is:
This procedure, while correct for handling exactly two files, is not very versatile. A potentially more useful procedure would resize all image files in a directory, regardless of how many there are. Adept can learn a more general procedure of this type from the following demonstration.
The only difference between this demonstration and the previous one is that the folder containing the images is first opened. This action produces a data value that is a collection of all the image files in the folder. From this demonstration, Adept learns the following procedure:
Adept recognizes that each element in the collection is resized identically, and so learns a procedure that repeats the open and resize sequence for all of the images in the folder. (In computer programming, such repeated sequences of actions are called loops.)
It is not necessary to tell Adept that you want to learn a repetitive task. Rather, Adept will recognize these tasks by the presence in the demonstration of repeated actions over the elements of a collection, providing the following conditions are met:


{% extends "email/_wrapper.html" %} {% block content %}
Hi {{ carpool.driver.name }},
We wanted to let you know that {{ rider.name }} has cancelled their request to ride with you from {{ carpool.from_place }} to {{ carpool.destination.name }} at {{ carpool.leave_time | humanize }}.
Thanks!
{{ config.get('BRANDING_EMAIL_SIGNATURE') }}
{% endblock %}


[gecode-users] Indexing into arrays
Christian Schulte
cschulte at kth.se
Mon Nov 21 16:27:29 CET 2011
Uuups, the ES_FAILED is a different beast all together! This is what a
propagator will return to the kernel to signal failure but finding out which
propagator returned it will require hacking the kernel. Frankly, that will
require some stamina ;-)
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Milt
Sent: Monday, November 21, 2011 4:11 PM
To: users at gecode.org
Subject: Re: [gecode-users] Indexing into arrays
Thanks Christian,
> ...failing a space does not
> stop execution of a space's method (or with other words, does not
> throw a
> C++ exception or something like that). The reason for that is that it
> C++ does
> not matter! The code defining the variables, constraints, and
> propagators is executed just once initially in order to create the
> space for the root node of the search tree. This is cheap. What takes
> time is doing constraint propagation (triggered by status()) and this
> is terminated immediately when failure occurs.
Good...so Gecode is right to keep going after failing the root node because
it has to finish setting up the model infrastructure once (to post all of
the constraints), but it's very efficient beyond the root node. I'll read
further in the branch and search sections of MPG to better understand how
and in what order everything executes...that seems to be where I'm fuzziest
right now.
> I am not sure I understand your second point. After running status()
> you should always check whether a space is failed (status() returns
> that information). So, when testing why not run status() everytime to
> make sure that things are not yet failed?
Ok, so I can check for the result from status() e.g., SS_FAILED, rather than
just running status() to force propagation. I just read some more of MPG
chapter 20 and see there's also ES_FAILED which can be used to determine
which propagator failed.
I'll give that a shot.
Thanks for your help!
-Milt
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
More information about the users
mailing list


W to move forward
A to strafe left
D to strafe right
S to move backwards
Space to move up
Shift to move down
Move mouse to look around
F to start falling (you probably don't want to do this)
Double-click screen to start (you must allow full screen)
Play


% if game.bots[0] and game.bots[1]: % game.bots[1] = False % end
Grid settings
Red player
Yellow player
Game rules
Four in a row is a two player board game. The first player is red and the socond is yellow.
Players drop their tokens into the grid in turns.
The one that first manages to connect four tokens in a row either horizontally, vertically or diagonally wins.
If the entire grid is filled it is a draw.
You can change grid dimensions and the amount of tokens to connect in grid settings.
You can also change which player is controled by human and which by a computer.
Keep in mind that not both players can be controled by a computer.


Team Profiles
Michael Scott
Manager
Employee ID Number: 1
Email Address:
<EMAIL_ADDRESS>Office Number: 23
Jim Halpert
Engineer
Employee ID Number: 2
Email Address:
<EMAIL_ADDRESS>GitHub:
jimhalpert
Dwight Schrute
Intern
Employee ID Number: 3
Email Address:
<EMAIL_ADDRESS>School: Cornell


{% extends 'base.html' %} {% block navbar %} {% include "navbar.html" with active_tab='About' %} {% endblock %} {% block content %}
An Example from Django Girls. A Simple site to display posts with geography information. It also contain a simple administration to manage every post.
Original Git Book: Django Girls 學習指南
This example implement GET and POST which common used on web. When user have to send some information to server, GET and POST can help user to do this.
This example reference from The Django Book and official docs.
This example aim to implement a simple CMS. You can add, edit, view,and delete article in this example.
Every article use Markdown to present the content. About Markdown, you can reference: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet


interface MVFlowWithEffects<State, Action, Effect> : MVFlow<State, Action>
(source)
Extension of MVFlow to be used together with a HandlerWithEffects.
This interface allows you to observe the external effects.
State
- a class that holds all information about the current state represented in this MVFlow object.
Action
- a class that represents all the interactions that can happen inside this view and associated
information.
Effect
- a class that represents things that you might need to handle outside the handler that deals with
UI actions. Typically used for navigation and one-off events that do not mutate the state.
observeEffects |
Observe external effects emitted by the handler. abstract fun observeEffects(): Flow<Effect> |


Allen Moreno
<EMAIL_ADDRESS>My Profile
1
Messages
Sign Out
Allen Moreno
Agent
Main Menu
Dashboard
Summary Sheets
Debt Summary
Payment History
Sub Agents
Agents
All Agents
Add Agent
Terminals
All Terminals
Add Terminal
Games
All Games
Games Played
Create Games
Edit Game Winning
Admin
All Admins
Add Admin
Add new agent
Name
Email address
File upload
Upload
Password
Submit


Overview
Create a new email address.
Summary
In the event that the email address already exists, that record will be returned without making any changes.
Request Arguments
| Name |
Type |
Description |
Required |
|
email_address
|
String
|
The email address.
|
True
|
|
invalid_email
|
Boolean
|
true if the email address is invalid. false is the default.
|
False
|
|
opt_out
|
Boolean
|
true if the email address is opted out. false is the default.
|
False
|
Request
{
"email_address"<EMAIL_ADDRESS>"invalid_email": false,
"opt_out": false
}
Response Arguments
| Name |
Type |
Description |
|
<record field>
|
<record field type>
|
Returns the fields for the newly created record.
|
Response
{
"id": "a028341c-ba92-9343-55e7-56cf5beda121",
"date_created": "2016-02-25T11:53:07-08:00",
"date_modified": "2016-02-25T11:53:07-08:00",
"deleted": false,
"email_address"<EMAIL_ADDRESS>"email_address_caps"<EMAIL_ADDRESS>"invalid_email": false,
"opt_out": false,
"_acl": {
"fields": {}
},
"_module": "EmailAddresses"
}
Change Log
| Version |
Change |
|
v10
|
Added /EmailAddresses POST endpoint.
|


Mysterious Wizard:
So?
"Nobody is allowed here without permission. That you're here means you have power at least equal to the Lord of the Forest of the Dead."


Swedish Massage aims to release persistent patterns of tension in you body, employing a deeper, more focused pressure to tackle those aching, knotted areas in deeper layers of muscle tissue.
Tracey will work with you throughout the treatment to make sure the pressure is always comfortable. The treatment is extremely relaxing and employs soothing techniques to provide the prefect balance.
Pure essential oils have many medicinal properties. When these benefits are combined with massage the results can be outstanding. On a physical level an Aromatherapy massage can increase energy levels,
reduce stress, relieve pain and improve the condition of the skin. It can balance the mind by releasing negative emotions, such as fear, anger, sorrow and frustration.
Aromatherapy can not only improve health, but encourages a new zest for living.
A wonderful treatment for releasing pain and tension in the back and upper body. Helps to reduce muscle tension and neck pain or stiffness.
Also a great stress reducer, restoring a sense of calm and balance to the body and the mind.
Go about your day at peace, with a new found serenity
Chair massage works mainly on the upper body, back neck and shoulders. Its a deeply relaxing yet invigorating seated treatment that works to sooth stress and tension by loosening tight muscles and knots that can accumulate
in the upper body.
This treatment uses no oils nad is performed with clothes so no need to undress.
Warm and oiled stones are used to massage the body with long flowing strokes. The gentle warmth and rhythmic movements take effect very quickly.
It produces profound muscle relaxation, but it's not just you muscles, your mind and every fibre of your being will be relaxed as well.
Reflexology has many beneficial and lasting effects. Some treatments are gentle by nature, aiming to restore systems to better function, while other are more specific, addressing the clients particular condition.
It's a healing process that can be used when it is not convenient to to treat parts of the body directly. Reflexology can be a deeply relaxing therapy that works on many leves, soothing, calming, balancing and boosting the whole body
Thai massage is a powerful form of body massage which includes therapeutic stretching, joint mobilisation, rhythmic deep tissue compression and acupuncture.
A session of Thai Massage takes place on a cushioned mat and is applied through loose, comfortable clothing.
This unique form of massage therapy is both stimulating and relaxing.
Tracey has been a complimentary therapist for over 20 years specialising in Reflexology and Massage Therapies. Tracey's knowledge and friendly sympathetic style ensures each client receives treatment tailored to their individual needs.
"Tracey has de-stressed me and tended to my sore muscles leaving me feeling mentally and physically empowered. She is kind and professional and and takes pride in supporting people and making them feel their best. I cannot recommend her highly enough"
Sue W, Mold
Tracey is an excellent therapist, who is very knowledgeable about the treatments that she provides which have helped me greatly with my health. I would thoroughly recommend her.
Lucy H, Chester"


The ESP8266
The ESP8266 is a low-cost Wi-Fi chip with full TCP/IP stack and MCU (Micro Controller Unit) capability produced by Shanghai-based Chinese manufacturer, Espressif Systems.
The NodeMCU is a mini Arduino with Wifi, that is $10.00!
Getting Set up:
- First install the USB driver SiLabs serial driver
Getting Set up:
- Next go to the Arduino Preferences
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Boards Manager URLs
Getting Set up:
- Next, use the Board manager to install the ESP8266 package.
Connect an led
Upload Blink
Upload WiFiWebServer
Upload ESPwebpage
Hook Up A Servo
Upload ESPwebpageServo
I've set up a public MQTT server we will use in class
On Thurs I will show you how to set up your own on Amazon
MQTT.fx is a client that we can test the server with, this will demontrate the concept
http://www.mqttfx.org/
Set Up MQTT.FX to connect to the Public Server
Click on the gear next to the connect button
Set Up MQTT.FX to connect to the Public Server
Make a new conection with the following settings, use your name as the client name, hit 'ok'
MQTT topics are like chat rooms, here I am publishing the message 'hi' to the topic "/test"
And here I am subscribing to the mesages on that topic
We can connect our ESP8266 to the MQTT server
Connect some neopixels
Install Arduino MQTT Library by Joel Gaewiller
Upload espmqtt_neopixel
A note on MQTT topics
cd ws_mqtt_express, run node index.js
cd speak_mqtt, run node index.js


An-Noor Progress Report
An-Noor School is pleased to share the news that by the Blessings of Allah eleven students have completed the Hifdh (Memorization) of the Holy Qur'an in the current academic year 2012-2013.
In the 2011-2012 academic year three students had completed their Hifdh-ul-Quran and in the 2010-2011 academic year two students completed their Hifdh-ul-Quran..
This brings the number of students who have completed their Hifdh to sixteen since the inception of the school. Alhamdulillah.
We congratulate all of the students, their parents, the teachers for their hard work and dedication to preserve and protect the word of Allah swt. It is indeed a blessing from Allah swt that the students are able to achieve this honor and distinction of becoming a Hifdh.
We have several new openings because of the success of our students in completing their goals.
An-Noor School Admission Policy
Our admission policy is based on first come, first serve basis, therefore we encourage all interested parents to contact the School Director on the 2nd floor of IAR between the hours of 8:00 AM and 12:00 noon on weekdays to pre-register for the next academic year.
Student eligibility for admission to An-Noor School is determined through an interview
process that tests their Quran reading skills and report card from their current school.
An-Noor School Graduates
The following is a list of An-Noor school students who have completed Hifdh-ul-Quran.
Safa Asrar - May 2011
Mir Quddus - July 2011
Iman Lafi - May 2012
Sarah Nagy - June 2012
Ihtiram Muhtady - June 2012
Raafay Siddiqui - October 2012
Imtithal Noor - December 2012
Abdul Muaizz Rashidi - January 2013
Hamza Ansari - February 2013
Aishah Nur Khaled Al-Zoubi - February 2013
Lema Khaled Al-Zoubi - March 2013
Amina Mohamed - April 2013
Momen Khan - April 2013
Shakoor Afzal - May 2013
Mohhid Sheikh - May 2013
Hamza Sheikh - May 2013
We pray to Allah swt to continue to bless this community with more success in this life and the hereafter.


XDG-ICON-RESOURCE(1) xdg-icon-resource Manual XDG-ICON-RESOURCE(1) NAME xdg-icon-resource - command line tool for (un)installing icon resources SYNOPSIS xdg-icon-resource install [--noupdate] [--novendor] [--theme theme] [--context context] [--mode mode] --size size icon-file [icon-name] xdg-icon-resource uninstall [--noupdate] [--theme theme] [--context context] [--mode mode] --size size icon-name xdg-icon-resource forceupdate [--theme theme] [--mode mode] xdg-icon-resource {--help | --manual | --version} DESCRIPTION The xdg-icon-resource program can be used to install icon resources into the desktop icon system in order to illustrate menu entries, to depict desktop icons or to graphically represent file types. The desktop icon system identifies icons by name. Depending on the required size, the choice of icon theme and the context in which the icon is used, the desktop icon system locates an appropriate icon resource to depict an icon. Icon resources can be XPM files or PNG files. The desktop icon system works according to the XDG Icon Theme Specification at http://www.freedesktop.org/wiki/Specifications/icon-theme-spec COMMANDS install Installs the icon file indicated by icon-file to the desktop icon system under the name icon-name. Icon names do not have an extension. If icon-name is not provided the name is derived from icon-file. The icon file must have .png or .xpm as extension. If a corresponding .icon file exists in the same location as icon-file it will be installed as well. uninstall Removes the icon indicated by icon-name from the desktop icon system. Note that icon names do not have an extension. forceupdate Force an update of the desktop icon system. This is only useful if the last call to xdg-icon-resource included the --noupdate option. OPTIONS --noupdate Postpone updating the desktop icon system. If multiple icons are added in sequence this flag can be used to indicate that additional changes will follow and that it is not necessary to update the desktop icon system right away. --novendor Normally, xdg-icon-resource checks to ensure that an icon file to be installed in the apps context has a proper vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. --theme theme Installs or removes the icon file as part of theme. If no theme is specified the icons will be installed as part of the default hicolor theme. Applications may install icons under multiple themes but should at least install icons for the default hicolor theme. --context context Specifies the context for the icon. Icons to be used in the application menu and as desktop icon should use apps as context which is the default context. Icons to be used as file icons should use mimetypes as context. Other common contexts are actions, devices, emblems, filesystems and stock. --size size Specifies the size of the icon. All icons must be square. Common sizes for icons in the apps context are: 16, 22, 32, 48, 64 and 128. Common sizes for icons in the mimetypes context are: 16, 22, 32, 48, 64 and 128 --mode mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode. The default is to use system mode when called by root and to use user mode when called by a non-root user. --help Show command synopsis. --manual Show this manual page. --version Show the xdg-utils version information. ENVIRONMENT VARIABLES xdg-icon-resource honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-icon-resource do more verbose reporting on stderr. Setting a higher value increases the verbosity. XDG_UTILS_INSTALL_MODE This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system. EXIT CODES An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. 5 No permission to read one of the files passed on the command line. SEE ALSO xdg-desktop-icon(1), xdg-desktop-menu(1), xdg-mime(1) EXAMPLES To install an icon resource to depict a launcher for the application myfoobar, the company ShinyThings Inc. can use: xdg-icon-resource install --size 64 shinythings-myfoobar.png To install an icon for a new application/x-foobar file type one can use: xdg-icon-resource install --context mimetypes --size 48 ./mime-foobar-48.png application-x-foobar xdg-icon-resource install --context mimetypes --size 64 ./mime-foobar-64.png application-x-foobar This will install two icons with the name application-x-foobar but with different sizes. AUTHORS Kevin Krammer Author. Jeremy White Author. COPYRIGHT Copyright © 2006 xdg-utils 1.0 02/22/2015 XDG-ICON-RESOURCE(1)


Trying to lose weight, lower your BMI, or invest in your overall health? We give you the right tools to hit your goals.
Use nutrition goals and custom trackers to improve your food choices and reach your weight goal.
Keeping a food diary helps you track your habits and acts as your very own personal virtual coach.
Join the World’s Largest Fitness Community for advice, tips, support and feedback 24/7.
When you reach your goals, our whole community celebrates with you. Find out what people are saying.
Try APPetite for free or achieve more with Pro. Get the best experience with an APPetite Plus subscription.


Gift
Artifact
Cup
Self Glass
Exhibits
Support
ADD TO CART
A SHOCKING MASTERPIECE
is now available
Top Picks
Artifact-1
This work is made of glass
$ 6,450
Artifact-2
This work is made of glass
$ 10,143
Artifact-3
This work is made of glass
$ 2,229
Artifact-4
This work is made of glass
$ 2,249
Artifact-5
This work is made of glass
$ 1,457
Rowing
in Canyon
An old man who was rowing
in canyon, boating the time.
$ 2,459
Waiting
on Canyon
An old man who was
waiting on canyon
$ 3,724
Tower
in Canyon
An old tower which was standing
in canyon, standing on the time.
$ 6599
HELP & SUPPORT
ASKED
QUESTIONS
PROMOTION
VIDEOS
SUPPORT
CENTRE
OUR EXPERT
ASSISTANCE


Marvel's The Avengers or simply The Avengers, is a 2012 American superhero film based on the Marvel Comics superhero team of the same name, produced by Marvel Studios and distributed by Walt Disney Studios Motion Pictures.It is the sixth film in the Marvel Cinematic Universe (MCU). The film was written and directed by Joss Whedon and features an ensemble cast that includes Robert Downey Jr., Chris Evans, Mark Ruffalo, Chris Hemsworth, Scarlett Johansson, and Jeremy Renner as the titular Avengers team, alongside Tom Hiddleston, Clark Gregg, Cobie Smulders, Stellan Skarsgård, and Samuel L. Jackson. In the film, Nick Fury, director of the spy agency S.H.I.E.L.D., recruits Tony Stark, Steve Rogers, Bruce Banner, and Thor to form a team that must stop Thor's brother Loki from subjugating Earth.


This class provides a text editor specialized for editing source code. It includes generic features that are useful in a variety of languages, and therefore serves as a base class for language-specific editors. The EditProgram class is derived from the Edit class, and therefore inherits all of its features.
The editor automatically indents a line in response to a Tab
character, and
provides a command for indenting a region (the selection). To enter a
literal Tab
,
enter the sequence C-tab
(Control-Tab
).
The editor also colors comments and the strings
FIXME
and NOTE
, and provides a
method for commenting out a region.
It supports only line-oriented
comments (where a comment line is preceded by a specified comment
string), although some derived classes generalize this to other comment
styles.
The Recolorize
command in the Format
menu will update the colors after you have edited a file,
and a Tab
character will recolorize (and indent) the current line.
The fill region
command in the Format
menu will fill the set of lines identified by the selection so that they
are roughly the same length. It puts the comment prefix on each line, and
colors the region with the comment color.
The comment prefix can be set with the
Set Fill Prefix
command
in the Format
menu.
It will invoke a dialog that allows you to set or change the prefix
used to mark comments.
The width of the fill region can be set with the
Right Fill Column
command
in the Format
menu.
It will invoke a dialog that allows you to set or change the maximum
length of each line (which defaults to 70 characters).
Finally, the editor matches parentheses, brackets, and curly braces. When you enter a close parenthesis, the editor determines whether the corresponding open parenthesis is visible, and if it is, highlights the text between the open parenthesis and the close parenthesis.


I. “Separate mutation from calculation.”
Which means avoid side effects.
That makes pure functions modular (portable, parallelizable).
II. “Separate input from environment.”
Which means that them work as maps.
function double(x) {return x * 2;}
x => x * 2
{1 => 2, 2 => 4, 3 => 6}
That makes pure functions predictable (testeable, memoizable).
Normally described as the V/VC in MVC…
Uses virtual-dom to improve DOM manipulation performance…
Unopininated and small API footprint…
… but enough of features, also and most importantly it claims:
View/UI must be described as a pure function of our app state.
props => componentDOM
React is Modular.
An architecture that takes care of the M in MVC.
Unidirectional data flow…
As React it’s unopinionated and with a minimal API…
… we can resume it’s ethos or claiming as:
Every state mutation must be described as a pure function of previous state and a given action.
(state, action) => state
Redux is Predictable.
Questions? Any doubt?
Get in touch: @codekult


{% extends 'main/_base.html' %} {% load static %} {% block title %} Room | {{ room.name }} {% endblock %} {% block content %}
Posted: {{ room.get_time_difference_display }}
{% if room.is_available %}Price : ${{ room.price }}
Room is available
{% else %}Room is not available
{% endif %} {% if room.is_accessible %}Room is Accessible
{% endif %} {% if room.female_only %}Females Only
{% endif %} {% if room.open_to_students %}Open to students
{% endif %} {% if room.pet_friendly %}Pet Friendly
{% endif %}There is no additional information at this time!
{% endif %}Utilities are included
{% endif %} {% if room.parking %}Parking spot included
{% endif %} {% if room.furnished %}Room is furnished
{% endif %}


--- layout: archive title: Zulip Chat Archive permalink: /stream/144837-PR-reviews/topic/.23598.20analysis.20reorganization.html ---
I am confused: is it normal that there are still several references to general_topology
?
Arggg Lean using olean of deleted lean files is really confusing. I'm sorry about this mess
I'll try again
just delete all .oleans
While we're on the topic of renaming and reorganization, is there a better name for the category/
folder? It's not obvious what the difference between category/
and category_theory/
is on a first reading.
cs_category/
:see_no_evil:
I was actually thinking the same thing
it seems a bit crude though, surely there's a better description. "that thing that haskellers think is a category but isn't"
It also helps with tab-completion (-;
So is it the same as what they call "Hask"?
Lol, we can call the directory hask/
to troll them (-;
yeah, have you ever read Andrej Bauer's rant on why Hask isn't a category and they should stop pretending it exists?
http://math.andrej.com/2016/08/06/hask-is-not-a-category/
Maybe we should call it not_a_category/
instead?
categoroid
I think Travis is fighting its cache again. It complains about errors that don't exist as far as I can see
the import namespace for Monads etc in Haskell is Control
, so we could rename it to control
?
@Mario Carneiro I just merged today's commts. I hope Travis will stop inventing non-existent files, but I don't see what I could do if not
I just cleared the cache and restarted the build for your PR, so it should work this time
Ok, thanks
Travis is now happy, I think you can merge now
merged
the build failed, but I think this was due to the cache. (I think) I cleared the chache, and restarted it now
note: if you clear the PR cache, it falls back on the main cache (master), so you have to clear that too
I discovered this after my first attempts to rebuild the PR failed
ah good to now. But I think I cleared the master cache anyway. The failure is happening at the master branch
Now it works on the main repository, but fails on lean-community...
On the subject of Hask, I think the point may be valid but what we have in Lean actually looks like a category. We do not need to denounce it here. We could put everything in category_theory.types
and generalize over time.
I have a general definition for monad and applicative functors in my files so it should be coming soon ... right after we agree on a definition of monoidal categories
Except that your functors aren't functors!
That's a minor terminology detail. You can functor
+ is_lawful_functor
as our notion of functor and that's fixed
The question is what to call the structure built on functor
alone
A while back, you proposed functor_struct
(in the context of category
, actually)
and you want that to be the folder name?
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


FINDING GRACELAND (United States) A review by Mark R. Leeper in bullet-list form from the Toronto Internation Film Festival
CAPSULE: In a current-day cross-country trip a man picks up a hitchhiker who claims to be Elvis Presley. Harvey Keitel, Johnathon Schaech, and Bridget Fonda star. David Winkler directs the film with a lot of heart. Rating: 7 (0 to 10), 2 (-4 to +4)
- A man haunted by the death of his wife a year earlier picks up a hitchhiker who is more trouble than he is worth. He is a freeloader without money and though he does not look the part he claims to be Elvis Presley. This is a warm film along the lines of MIRACLE ON 34TH STREET. It toys with (without endorsing) the para-religious cult of worshipers of Elvis. - Not much resemblance to Presley, but perhaps that works. - That Keitel is good will come as little surprise. Bridget Fonda pulls off a real tour de force as a Marilyn Monroe impressionist, even doing her own singing impression of Monroe. Johnathon Schaech, a Peter Gallagher look-alike, holds his own as the main character. - Priscilla Presley is executive producer, though her contribution was mostly after production started. She checked the script for accuracy and arranged for shooting at Graceland. - Nice regional photography. - It seems unlikely that main character would let anyone else drive his classic car. - Keitel does not do his own singing. - Definitely an enjoyable film even for people who are not Elvis fans (which includes me). - It is not clear if there is supposed to be a surprise twist involving the car accident. You don't have to be Sherlock Holmes to figure it out. Yet the script makes it seem like something kept secret.
Mark R. Leeper<EMAIL_ADDRESS>Copyright 1998 Mark R. Leeper
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


THE WINTER GUEST A film review by Steve Rhodes Copyright 1998 Steve Rhodes
RATING (0 TO ****): * 1/2
THE WINTER GUEST, first-time director Alan Rickman's ode to bleakness, tells four overlapping stories which occur in a Scottish seaside town on the coldest day in living memory. So bitter is the weather that even the surface of the sea freezes solid.
One story concerns the trivialities of two elderly women, played by Sheila Reid as Lily and Sandra Voe as Chloe, traveling to a funeral. Another explores the uncertain romantic feelings of two teenagers, played by Gary Hollywood and Arlene Cockburn. A third has two boys, played by Douglas Murphy and Sean Biggerstaff, frolicking at the beach. The centerpiece of the picture is the verbal pas de deux between Emma Thompson and her real-life mother Phyllida Law, playing fictional mother and daughter Frances and Elspeth.
Rickman, who played opposite Thompson in SENSE AND SENSIBILITY, brings a slow and delicate touch to his directing. With more engaging material, this approach could have worked, but the remote and uninvolving script makes less for a movie than a cinematic tone poem. Rickman and Sharman MacDonald created the script from MacDonald's play, which was hopefully better than the motion picture adaptation.
The accomplished actress Emma Thompson, in one of her lesser performances, plays a depressed woman whose husband died a few years ago and who resents her pushy mother. ("This is my own body," she informs her mother who complains about the way her hair looks. "I can do what I like. I can gain weight if I like, and I can cut my own hair.")
Phyllida Law plays a constant complainer of a mother. "I should of had a boy," she says. "Girls are hard to rear and hard of heart." Both Law and Thompson appear to be following directions carefully in their acting, but neither character is well developed or worth caring about.
Michael Kamen's hauntingly sad piano music and Seamus McGarvey's chillingly handsome cinematography fill the screen with beauty, but the movie itself is as cold as the frozen climate. The movie is so soporific that one begins to hope against hope that some misfortune will strike one of the players to stir up some genuine conflicts and emotions. Instead, all we get is contrived and meaningless banter and inconsequential actions. If the dialog is deep and worth pondering, then saying little and doing less can succeed, but this story bogs down in petty disagreements.
When a show works, it is easy to forgive major mistakes in its staging, but this dreadfully dull tale had me noticing them everywhere. Consider just one aspect. The story goes to great lengths to remind the audience how cold it is -- the temperature being the film's chief metaphor. Why then are there so many incongruities? 1) There is there never any frozen breath, 2) When the women complain about the wind cutting right through them, the wind is calm, 3) Actors walk around outside with their jackets unbuttoned, and 4) The teenagers are in a house in which the heat hasn't worked in a long time, yet a single smoldering log in the fireplace seems to suffice.
"I don't where I was," Chloe remarks at one point in the movie. "I don't know who I am yet." She is as lost as the story itself. With the actors' scenes edited out, we would be left with a lovely fifteen minute music video. That part is all that is worth seeing.
THE WINTER GUEST runs 1:50. It is rated R for brief nudity and a little profanity. The picture would be fine for teenagers.
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


Preparation time
30 mins to 1 hour
Cooking time
30 mins to 1 hour
Serves
Serves 2
Bring on the flavour with these herb-marinated lamb chops and a baked, spiced aubergine.
For the lamb chops, marinate in pomace oil, rosemary, thyme and garlic for at least an hour.
For the harissa glazed aubergine preheat the oven to 180C/160C Fan/Gas 4 and line a baking tray with foil.
Heat a griddle until hot. Brush the aubergine with oil and season with salt. Griddle well on each side then transfer to the tray. Cook in the oven for 15 minutes.
Meanwhile mix the harissa paste, agave, lemon juice together with 4 teaspoons of water and a pinch of salt. Set aside.
Remove the aubergine from the oven and brush with the harissa mix. Return to the oven for 5 minutes.
Mix the yoghurt with the lemon juice, zest and pinch of salt. Set aside.
For the chutney, in large saucepan of boiling, salted water blanch the beans for 1-2 minutes. Refresh them in cold water, then drain.
Mix the mint, garlic, shallot, vinegar and oil in a bowl.
Stir in the beans and set aside.
To finish the lamb, preheat the grill to high. Season the chops and grill until cooked to your liking.
To serve, put the aubergine on a large plate and dot the yoghurt around, sprinkle with peanuts and chilli and garnish with the coriander. Serve with the lamb chops and green bean and mint chutney.


Case #
Priority
Incident
Status
Reported
On Scene
Address
Intersection
113380144
Delay
Traffic Accident Major
O
16:53
17:03
500
S
CHILTON
AV
BRYAN
ST
A
1
2
Most recent data as of:
12/4/2011 5:38:46 PM
. Data is updated every two minutes, except in special circumstances.
[
RSS feed for this page
] [
ACL Frequently Asked Questions
] [
Credits
]
PD Home


All Files
(100.0%
covered at
4.21
hits/line)
4 files in total.
89 relevant lines.
89 lines covered and
0 lines missed
Controllers
(100.0%
covered at
5.0
hits/line)
1 files in total.
42 relevant lines.
42 lines covered and
0 lines missed
Models
(100.0%
covered at
3.51
hits/line)
3 files in total.
47 relevant lines.
47 lines covered and
0 lines missed
Mailers
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
Helpers
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
Libraries
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
-
1
require_dependency "sensit/api_controller"
-
-
1
module Sensit
-
1
class PublicationsController < ApiController
-
1
doorkeeper_for :index, :show, :scopes => [:read_any_publications, :read_application_publications]
-
1
doorkeeper_for :create, :update, :destroy, :scopes => [:manage_any_publications, :manage_application_publications]
-
-
1
respond_to :json, :xml
-
# GET /publications
-
# returns the name and query along with the results of the query
-
# accepts additional parameters which will be merged into each publication
-
1
def index
-
9
joins = {:user_id => doorkeeper_token.resource_owner_id, :slug => params[:topic_id]}
-
9
joins.merge!(:application_id => doorkeeper_token.application_id) unless has_scope?("read_any_publications")
-
9
@publications = Topic::Publication.joins(:topic).where(:sensit_topics => joins).page(params[:page] || 1).per(params[:per] || 10)
-
9
respond_with(@publications)
-
end
-
-
# GET /publications/1
-
# returns the name and query along with the results of the query
-
# accepts additional parameters which will be merged into the desired publication
-
1
def show
-
8
if attempting_to_access_topic_from_another_application_without_privilage("read_any_publications")
-
4
raise ::ActiveRecord::RecordNotFound
-
else
-
4
@publication = scoped_owner("read_any_publications").topics.find(params[:topic_id]).publications.find(params[:id])
-
4
respond_with(@publication)
-
end
-
end
-
-
# POST /publications
-
1
def create
-
10
if attempting_to_access_topic_from_another_application_without_privilage("manage_any_publications")
-
2
head :unauthorized
-
else
-
8
topic = scoped_owner("manage_any_publications").topics.find(params[:topic_id])
-
8
@publication = topic.publications.build(publication_params)
-
8
if @publication.save
-
6
respond_with(@publication,:status => :created, :template => "sensit/publications/show")
-
else
-
2
render(:json =><EMAIL_ADDRESS>:status => :unprocessable_entity)
-
end
-
end
-
end
-
-
# PATCH/PUT /publications/1
-
1
def update
-
10
if attempting_to_access_topic_from_another_application_without_privilage("manage_any_publications")
-
2
raise ::ActiveRecord::RecordNotFound
-
else
-
8
@publication = scoped_owner("manage_any_publications").topics.find(params[:topic_id]).publications.find(params[:id])
-
8
if @publication.update(publication_params)
-
5
respond_with(@publication,:status => :ok, :template => "sensit/publications/show")
-
else
-
3
render(:json =><EMAIL_ADDRESS>:status => :unprocessable_entity)
-
end
-
end
-
end
-
-
# DELETE /publications/1
-
1
def destroy
-
8
if attempting_to_access_topic_from_another_application_without_privilage("manage_any_publications")
-
3
raise ::ActiveRecord::RecordNotFound
-
else
-
5
@publication = scoped_owner("manage_any_publications").topics.find(params[:topic_id]).publications.find(params[:id])
-
5
@publication.destroy
-
5
head :status => :no_content
-
end
-
end
-
-
1
private
-
-
# Only allow a trusted parameter "white list" through.
-
1
def publication_params
-
18
if params[:publication] && params[:publication].has_key?(:uri)
-
1
params.require(:publication).permit(:uri)
-
else
-
17
params.require(:publication).permit(:host, :protocol, :username, :password, :port)
-
end
-
end
-
-
-
-
end
-
end
-
1
module Sensit
-
1
class Percolation < ActiveRecord::Base
-
1
belongs_to :rule, foreign_key: "rule_id"
-
1
belongs_to :publication, foreign_key: "publication_id"
-
end
-
end
-
1
module Sensit
-
1
class Rule < ActiveRecord::Base
-
1
has_many :percolations, dependent: :destroy, foreign_key: "rule_id"
-
1
has_many :publications, through: :percolations
-
-
1
validates :name, presence: true, uniqueness: true
-
-
end
-
end
-
# require 'socket'
-
-
1
module Sensit
-
1
class Topic::Publication < ActiveRecord::Base
-
1
ACTIONS = %w[create update destroy tag]
-
-
1
belongs_to :topic, class_name: "Sensit::Topic"
-
-
1
has_many :percolations, dependent: :destroy, foreign_key: "publication_id"
-
1
has_many :rules, through: :percolations
-
-
1
validates :host, presence: true
-
1
validates :protocol, presence: true
-
1
validates :port, numericality: { only_integer: true, greater_than: 0, less_than:49152}, allow_nil: true
-
1
has_secure_password :validations => false
-
-
95
scope :with_action, lambda{ |action| where("actions_mask & ? > 0 ", 2**ACTIONS.index(action.to_s))}
-
3
scope :with_percolations, lambda{ |rule_names| joins(:rules).where("sensit_rules" => {:name => rule_names}).select("DISTINCT sensit_topic_publications.*")}
-
-
1
def actions=(actions_array)
-
6
self.actions_mask = (actions_array & ACTIONS).map { |r| 2**ACTIONS.index(r) }.sum
-
end
-
-
1
def actions
-
5
ACTIONS.reject { |r| ((actions_mask || 0) & 2**ACTIONS.index(r)).zero? }
-
end
-
-
-
1
def publish(message, action=nil)
-
2
name = self.topic_id
-
2
case self.protocol
-
when "blower.io"
-
1
message = {to: '+14155550000', message: message}
-
else
-
1
nil
-
end
-
2
client.publish(name, message)
-
end
-
-
1
def uri=(value)
-
1
url = ::URI.parse value
-
1
self.protocol = url.scheme
-
1
self.host = url.host
-
1
self.port = url.port
-
1
self.username = url.user
-
1
self.password = url.password
-
end
-
-
1
def uri
-
2
if (self.username)
-
1
"#{protocol}://#{self.username}:#{self.password}@#{self.host}:#{self.port}"
-
else
-
1
"#{protocol}://#{self.host}:#{self.port}"
-
end
-
end
-
-
1
def client
-
@client ||= case self.protocol
-
when "tcp", "udp", "http", "mqtt"
-
4
Messenger.parse(uri)
-
when "blower.io"
-
1
Messenger::HTTP.new(uri: (ENV['BLOWERIO_URL'] || "http://localhost") + '/messages')
-
else
-
1
nil
-
6
end
-
end
-
end
-
end


Utils¶
Utility Functions¶
-
pysigma.utils.
compatible_shape
(msg_shape1, msg_shape2)[source]¶ Checks whether the two given message shapes are compatible.
Both msg_shape1 and msg_shape2 should be an iterable of torch.Size and have the contents
(batch_shape, param_shape, sample_shape, event_shape)
. An empty shape, i.e.,torch.Size([])
, will be deemed compatible with any other shape. msg_shape1 is compatible with msg_shape2 if and only if all of its four entries are compatible with their counterpart in msg_shape2.- Parameters
msg_shape1 (tuple of torch.Size) – First shape. Should have the format
(batch_shape, param_shape, sample_shape, event_shape)
.msg_shape2 (tuple of torch.Size) – Second shape. Same as msg_shape1.
- Returns
True if both shape are compatible.
- Return type
bool
DistributionServer¶
-
class
pysigma.utils.
DistributionServer
[source]¶ Serving distribution class dependent utilities
Conversion between PyTorch distribution parameters and distribution instance:
param2dist()
,dist2param()
Translation between PyTorch distribution parameters and natural parameters for exponential family distribution:
natural2exp_dist()
,exp_dist2natural()
Get vector of moments from a given distribution instance:
get_moments()
Draw particles from distribution instance:
draw_particles()
Get log probability density from given particles:
log_pdf()
Certain distribution classes require special handling, for example for those categorized as finite discrete, particle values will be drawn uniformly, covering every value in the RV’s value range (support) once and only once, while assigning each particle its probability mass as its particle weight.
Therefore we delegate all such special handling to this class on an individual basis.
Note that input and output will conform to the format understandable by PyTorch’s distribution class. To translate to and from formats compatible to PySigma’s predicate knowledge, use KnowledgeServer class
-
classmethod
param2dist
(dist_class, param, b_shape=None, e_shape=None, dist_info=None)[source]¶ Converts distribution parameter to a distribution instance.
Depending on the context and Predicate knowledge format, the parameter param may belong to different representation systems, in which case it should be interpreted differently. Such specification should be sufficiently described in the argument dist_info in a prior consent format.
The optional arguments b_shape and e_shape stand for distribution’s batch shape and event shape respectively. They are used primarily for sanity check. Note that this event shape e_shape pertains to PyTorch’s distribution class specification, and therefore may or may not be different from the event shape of particles in PySigma’s cognitive format.
- Parameters
dist_class (type) – The distribution class. Must be a subclass of
torch.distributions.Distribution
.param (torch.Tensor) – The parameter tensor. The last dimension is assumed to be the parameter dimension, and sizes of the dimensions at the front should be equal to b_shape.
b_shape (torch.Size, optional) – The batch shape of the distribution. Used for shape sanity check.
e_shape (torch.Size, optional) – The presumed event shape of the distribution. Used for shape sanity check.
dist_info (dict, optional) – An optional dict containing all relevant information in order to correctly interpret the parameter param.
- Returns
The instantiated distribution instance.
- Return type
torch.distributions.Distribution
- Raises
NotImplementedError – If the conversion procedure specific to dist_class has not been implemented yet.
ValueError – If the converted distribution instance has different batch shape and event shape than specified b_shape and e_shape respectively.
-
classmethod
dist2param
(dist, dist_info=None)[source]¶ Extract the parameter tensor from a given distribution instance.
Depending on the context and Predicate knowledge format, the desired parameter may belong to different representation systems, in which case it should be generated differently. Such specification should be sufficiently described in the argument dist_info in a prior consent format.
- Parameters
dist (torch.distributions.Distribution) – The distribution instance from which to extract the parameter.
dist_info (dict, optional) – An optional dict containing all relevant information in order to correctly generate the parameter param.
- Returns
The parameter tensor in the desired format.
- Return type
torch.Tensor
- Raises
NotImplementedError – If the conversion procedure specific to the distribution class of dist has not been implemented yet.
-
classmethod
get_moments
(dist, n_moments)[source]¶ Get vector of moments from a given distribution instance
Todo
Implement with dist_info
-
classmethod
draw_particles
(dist, num_particles, dist_info=None)[source]¶ Draw a list of num_particles event particles from the given distribution specified by dist. The event particles drawn will be in the format compatible with DistributionServer and PyTorch.
- Parameters
dist (torch.distributions.Distribution) – The distribution instance from which to sample particles
num_particles (int) – The number of particles to be drawn
dist_info (dict, optional) – Additional dist info necessary for drawing particles in the correct format.
- Returns
the list of particles drawn, of shape
[num_particles, event_size]
- Return type
torch.Tensor
- Raises
NotImplementedError – If the given distribution yields multi-dimensional events, and no corresponding special drawing method is found in
cls.dict_draw_particles
method map.
Notes
Unless distribution-class-specific drawing method is specified and registered in
cls.dict_draw_particles
method map, the distribution instance dist will be directly queried to draw the list of samples.The distribution instance dist is assumed batched, with a variable batch size(shape). However, we want to draw a single unique list of particles that is representative of each and every single distribution in the batch, i.e., draw a list of particles from the joint distribution regardless of the batch dimensions. Therefore, we take the view that drawing samples from dist simultaneously across the batch, which results in a sample tensor that involves the batch dimension, and ignoring the batch dimensions, is equivalent to first selecting uniformly which single distribution in the batch we wish draw from, and drawing samples from it, and repeating this process over and over again. The latter approach, when the samples are aggregated, yields a particle list that is representative of the joint distribution of the whole batch.
Accordingly, the sampling process is implemented by drawing n batched samples from dist, where
n = num_particles // batch_size + 1
, collapses the batch dimensions, random shuffle across the collapsed sample dimension, and truncate to select only a number ofnum_particles
samples.
-
classmethod
log_prob
(dist, values)[source]¶ Get the log probability mass/density of the given particle values w.r.t. the given batched distribution instance.
The particle value should be in PyTorch format that is compatible with PyTorch’s distribution classes. This means the last dimension of values is assumed the event dimension, and should be compatible with, if not identical to,
dist.event_shape
. Every other dimensions to the front is assumed sample dimensions, the sizes of which together forms thesample_shape
.The distribution instance dist is assumed batched. In other words, its batch shape
dist.batch_shape
should not be empty.- Parameters
dist (torch.distributions.Distribution) – A batched distribution instance. Its batch shape
dist.batch_shape
should not be empty.values (torch.Tensor) – A tensor with shape
(sample_shape + [event_size])
- Returns
The log probability mass/density tensor, of shape
(dist.batch_shape + sample_shape)
- Return type
torch.Tensor
- Raises
AssertionError – If the
event_size
found in values is different from dist.event_shape.
-
classmethod
kl_norm
(dist1, dist2)[source]¶ Get the norm of the KL divergence of two given batched distributions
-
classmethod
transform_param
(param, dist_info, trans)[source]¶ Todo
To implement
Return the parameter of the transformed distribution
-
dict_draw_particles
= {<class 'torch.distributions.categorical.Categorical'>: <classmethod object>}¶
-
dict_log_pdf
= {}¶
-
dict_param2dist
= {}¶
-
dict_dist2param
= {}¶
-
dict_natural2exp_param
= {}¶
-
dict_exp_param2natural
= {}¶
-
dict_natural2exp_dist
= {}¶
-
dict_exp_dist2natural
= {}¶
-
dict_get_moments
= {}¶
KnowledgeServer¶
-
class
pysigma.utils.
KnowledgeServer
(dist_class, rv_sizes, rv_constraints, rv_num_particles, dist_info=None)[source]¶ Knowledge Server class. Provides service regarding a Predicate’s knowledge.
The architecture should hold one KnowledgeServer instance for each Predicate instantiated to cache knowledge contents and provide distribution related service.
- Parameters
dist_class (type) – The distribution class of the Predicate’s knowledge. Must be a subclass of
torch.distributions.Distribution
.rv_sizes (iterable of int) – The sizes of the random variables of the Predicate’s knowledge. Note that the order given by the iterable will be respected.
rv_constraints (iterable of torch.distributions.constraints.Constraint) – The value constraints of the random variables. Note that the order given by the iterable will be respected.
rv_num_particles (iterable of int) – The number of marginal particles that should be drawn w.r.t. each random variable. Must have the same length as rv_sizes and rv_constraints, i.e., the number of random variables.
dist_info (dict, optional) – An optional attribute dict that contains all necessary information for DistributionServer to draw particles and query particles’ log pdf.
-
dist_class
¶ - Type
type
-
rv_sizes
¶ - Type
tuple of int
-
rv_constraints
¶ - Type
tuple of torch.distributions.constraints.Constraint
-
rv_num_particles
¶ - Type
tuple of int
-
dist_info
¶ - Type
dict
-
num_rvs
¶ Number of random variables involved in specifying the Predicate knowledge.
- Type
int
-
e_shape
¶ The event shape of predicate’s knowledge. Inferred form rv_sizes.
- Type
torch.Size
-
particles
¶ The cached tuple of marginal particle event tensors corresponding to the random variables. This attribute is set when draw_grid_particles is called with
update_cache=True
.- Type
tuple of torch.Tensor
-
log_densities
¶ The cached tuple of log sampling density tensors corresponding to each of the marginal particle event. This attribute is set when draw_grid_particles is called with
update_cache=True
.- Type
tuple of torch.Tensor
Notes
In order to provide service to both predicate nodes and conditional nodes in all stages, KnowledgeServer should store and manipulate data regarding the random variables only. In other words, only message components that do not involve batch dimensions should be cached; this includes particle value tensors and log sampling density tensors, but excludes both parameter and weight tensors. The latter ones’ shapes are not invariant throughout the stages in the conditional subgraph, and therefore should be specified by the callee.
Signatures for special private distribution class dependent methods:
Cognitive to PyTorch event format translation method:
2torch_event(particles) --> particles
PyTorch to Cognitive event format translation method:
2cognitive_event(particles) --> particles
Special marginal particle list sampling method:
special_draw(batched_dist) --> particles, log_densities
-
draw_particles
(batched_param, batch_shape, update_cache=True)[source]¶ Draws new particles for the associated predicate w.r.t. the given batched_param. Returns necessary components to instantiate a particles message.
This method is typically called by the predicate’s LTMFN node during modification phase, in which the new updated batched parameter tensor has been obtained and provided by batched_param. This method is then proceed to:
instantiate the batched distribution instances from the batched parameter tensor,
draw a single unique list of marginal particle values w.r.t. each random variable from the entire batch of distribution instances,
calculate their corresponding marginal sampling densities,
- Parameters
batched_param (torch.Tensor) – The new batched parameter tensor, of shape
(batch_shape + [param_size])
.batch_shape (torch.Size) – The batch shape
update_cache (bool) – Whether to replace the cache content in
self.particles
andself.log_densities
with the result of calling this method.
- Returns
particles (tuple of torch.Tensor) – The marginal particle lists w.r.t. each random variable in order.
log_densities (tuple of torch.Tensor) – The marginal sampling log densities w.r.t. each random variable in order.
Notes
Some remarks regarding the aforementioned step 2 and 3:
The tuple set of the types of the rv constraints specified in
self.rv_constraints
will be used to look up the pre-specified method mapself.dict_2special_draw
. If an entry present, will used that method to obtain the returningparticles
andlog_densities
. This is particularly useful, for instance, in the case of finite discrete random variables where a regular lattice should be drawn uniformly.Otherwise, the standard procedure will be carried out. ``
-
surrogate_log_prob
(param, alt_particles=None, index_map=None)[source]¶ Query the log pdf of the surrogate particles specified by alt_particles w.r.t. the cached distribution instance.
A batched distribution instance will be instantiated from param, along with registered metadata in self.dist_info.
If index_map is not specified, each entries in the iterable alt_particles must represent events of the Predicate’s random argument at the same index in the predicate argument list. If the entry is ‘None’, the cached particle tensor of that predicate argument will be used instead.
Alternatively, one can specify a dictionary index_map mapping integer index to an integer index or a list of indices. The entry
alt_particles[i]
will be taken as the particle tensor for theindex_map[i]
th predicate argument. Ifindex_map[i]
is a list of integers, then the particle tensor at this position will be interpreted as the concatenated/joint events of those predicate arguments whose indices are inindex_map[i]
. Note that the entryalt_particles[i]
can beNone
, however in this caseindex_map[i]
must refer to one predicate argument only. If there is any predicate argument that is not referenced by values of index_map , then the returning surrogate_log_prob will be marginalized over this predicate argument.Correspondingly, if
index_map
is specified, then all indices inalt_particles
must appear as keys.- Parameters
param (torch.Tensor, optional) – The alternative parameter from which a surrogate distribution instance is to be instantiated and log prob being queried. Should have the same shape as the cached
self.batched_param
.alt_particles (list of (torch.Tensor or None), or None) – The surrogate particles to be queried. If not None, each entry must either be None, so that the corresponding cached articles will be used instead, or a torch.Tensor, with a shape of length 2 and the last dimension size equal to the corresponding value in
self.rv_sizes
. Defaults to Noneindex_map (dict, or None) – The optional index mapping. If specified, all applicable indices into alt_particles must appear as keys in this dict. The
i
th entry in alt_particles will be taken as the surrogate particles for the predicate argument whose index isindex_map[i]
ifindex_map[i]
is an integer, or the joint surrogate particles for those arguments whose indices appear inindex_map[i]
ifindex_map[i]
is a list.
- Returns
The log probability tensor, of shape
(batch_shape + sample_shape)
, wherebatch_shape
is the batch shape of the Predicate’s knowledge, inferred from the shape of param, andsample_shape
is the list of sample sizes of the queried particles in the order given by alt_particles. In other words,sample_shape[i] == alt_particles[i].shape[0]
. Ifalt_particles[i]
, it is the sample size of the cached particle tensor of the corresponding predicate argument.- Return type
torch.Tensor
- Raises
AssertionError – If self.batched_param is
None
, meaning no cached parameters to instantiate distribution instance.AssertionError – If alt_particles contains
None
butself.particles
is also None, meaning no cached particles.AssertionError – If alt_param is specified but it has different shape than
self.batched_param
.
-
event2torch_event
(cat_particles)[source]¶ Translates joint particle event values from the Cognitive format to a format understandable by PyTorch distribution class.
- Parameters
cat_particles (torch.Tensor) – A tensor representing the list of concatenated particle events in Cognitive format. Its last dimension will be taken as the event dimension and should be equal to the sum of rv sizes in
self.rv_sizes
, while all other dimensions will be taken as the sample dimensions.- Returns
A tensor representing a list of translated particle events from cat_particles. Its last dimension size depends on the PyTorch format representation of events, while the sizes of other dimensions are the same as cat_particles.
- Return type
torch.Tensor
Notes
The specific translation method may vary depending on the distribution class. Therefore, this method serves only as an API entry point where the specific translation procedure will be looked up in
self.dict_2torch_event
using the registered distribution classself.dist_class
. If no entry is found, then will assume no special translation is necessary and will return the input cat_particles as is.
-
event2cognitive_event
(particles)[source]¶ Translates joint particle event values from the PyTorch distribution class format to Cognitive format.
- Parameters
particles (torch.Tensor) – A tensor representing the particle events in PyTorch-compatible format. Its last dimension will be taken as the event dimension, while all other dimensions will be taken as the sample dimensions.
- Returns
A concatenated tensor representing a list of translated particle events from cat_particles, where the events are concatenated along the last dimension, with size of each chunk in accordance with self.rv_sizes, and the sizes of all other dimensions are the same as particles.
- Return type
torch.Tensor
Notes
The specific translation method may vary depending on the distribution class. Therefore, this method serves only as an API entry point where the specific translation procedure will be looked up in
self.dict_2cognitive_event
using the registered distribution classself.dist_class
. If no entry is found, then will assume no special translation is necessary and will return the input cat_particles as is.
-
static
combinatorial_cat
(particles)[source]¶ Helper static method that combinatorially concatenates the list of event particles specified by particles.
Returns the contained tensor directly if there is only one entry in particles.
- Parameters
particles (iterable of torch.Tensor) – The list of particles to be concatenated. Each element should be a tensor with a shape of length 2, where the first dimension is assumed the sample dimension, and second dimension assumed the event dimension.
- Returns
The combinatorially concatenated event particle tensor of shape:
[sample_size[0], ..., sample_size[m], event_size[0]+...+event_size[m]]
where
sample_size[i]
is the sample size of thei
th particle, and similarly isevent_size[i]
. Its total number of dimensions, i.e..dim()
, is equal to the number of random variables plus 1.- Return type
torch.Tensor
-
static
combinatorial_decat
(cat_particles, split_sizes)[source]¶ Helper static method that combinatorially de-concatenate the joint particles specified by cat_particles, with the event size of the particle tensors in each de-concatenated list given by split_sizes. This method implements the exact opposite operation of combinatorial_cat.
An exception will be raised if cat_particles cannot be properly de-concatenated, for instance if it is not previously a result produced by combinatorial_cat.
- Parameters
cat_particles (torch.Tensor) –
The concatenated particle tensor, of shape:
[sample_size[0], ..., sample_size[m], sum(split_sizes)]
where m is the number of variables to split/de-concatenate, to which the length of split_sizes should equal.
split_sizes (list of int) – A list of integers denoting the event size of each split variable in order.
- Returns
The tuple of de-concatenated particles. The i th entry has shape
[sample_size[i], split_sizes[i]]
.- Return type
tuple of torch.Tensor
- Raises
ValueError – If cat_particles was not a result from combinatorial_cat and cannot be properly de-concatenated.


Preprocessing tools and biodiversity measures (species abundance, species richness, population heterogeneity and sensitivity) for analysing marine benthic data. See Van Loon et al. (2015) <doi:10.1016/j.seares.2015.05.002> for an application of these tools.
| Version: | 1.3-5 |
| Depends: | R (≥ 3.2.0) |
| Imports: | dplyr (≥ 0.7.0), lazyeval, readr, utils |
| Suggests: | testthat (≥ 1.0.0), rmarkdown, knitr, ggplot2, tidyr |
| Published: | 2018-03-20 |
| Author: | Dennis Walvoort [aut, cre, cph] |
| Maintainer: | Dennis Walvoort <dennis.Walvoort at wur.nl> |
| License: | GPL (≥ 3) |
| NeedsCompilation: | no |
| Materials: | NEWS |
| CRAN checks: | benthos results |
| Reference manual: | benthos.pdf |
| Vignettes: |
Introduction to the benthos-package |
| Package source: | benthos_1.3-5.tar.gz |
| Windows binaries: | r-devel: benthos_1.3-5.zip, r-release: benthos_1.3-5.zip, r-oldrel: benthos_1.3-5.zip |
| OS X binaries: | r-release: benthos_1.3-5.tgz, r-oldrel: benthos_1.3-5.tgz |
| Old sources: | benthos archive |
Please use the canonical form https://CRAN.R-project.org/package=benthos to link to this page.