Module Display.DisplayObj
The DisplayObject derives from EventDispatcher and is the base class for all objects that are rendered on the screen.
- The Display Tree
All displayable objects are organized in a display tree. Only objects that are part of the display tree will be displayed (rendered). The display tree consists of leaf nodes that will be rendered directly to the screen, and of container nodes (instances or subclasses of "DisplayObjectContainer").
A container is simply a display object that has child nodes, which can, again, be either leaf nodes or other containers.
A display object has properties that define its position in relation to its parent (x, y), as well as its rotation and scaling factors (scaleX, scaleY). Use the alpha and visible properties to make an object translucent or invisible.
- Transforming coordinates
Within the display tree, each object has its own local coordinate system. If you rotate a container, you rotate that coordinate system and thus all the children of the container.
- Subclassing
Since DisplayObject is an abstract class, you cannot instantiate it directly, but have to use one of its subclasses instead.
You will need to implement the following method when you subclass DisplayObject:
function DisplayObj:getRect(targetSpace,resultRect)
Functions
| DisplayObj:init () | Initialization. |
| DisplayObj:dispose () | If a derived object needs to clean up resources it must inherits this method, always remembering to call also parent dispose method |
| DisplayObj:_createProp () | create a MOAI prop that the current DisplayObj is going to wrap. |
| DisplayObj:dbgInfo (recursive) | Debug Infos. |
| DisplayObj:setName (name) | It's possible (but optional) to set a name to a display obj. |
| DisplayObj:getName () | Get the name of the current obj. |
| DisplayObj:_setParent (parent) | Internal method. |
| DisplayObj:getParent () | Return the parent DisplayObjContainer return parent displayObjContainer or nil if not attached to any container |
| DisplayObj:removeFromParent () | Remove a displayObject from the parent container |
| DisplayObj:getRoot () | Return the top most displayObjContainer in the display tree. |
| DisplayObj:getStage () | If the displayList containing the object is attached to the stage, return the stage, else nil |
| DisplayObj:setVisible (visible) | Set visibility status of this object |
| DisplayObj:isVisible () | Get visibility status of the displayObj |
| DisplayObj:setTouchable (touchable) | Set touchable status of the obj. |
| DisplayObj:isTouchable () | Get touchable status of the object |
| DisplayObj:useMultiplyColor (bUse) | Used to override default 'useMultiplyColor' class value for a specific instance Used for example for images when a pixel shader is set for special effects. |
| DisplayObj:isMultiplyingColor () | Returns if the object is using multiplyColor feature |
| DisplayObj:_setMultiplyColor (r, g, b, a) | Inner method. |
| DisplayObj:_getMultipliedColor () | Inner method. |
| DisplayObj:setAlpha (a) | Set alpha value of the object |
| DisplayObj:setColor (r, g, b, a) | Set obj color. |
| DisplayObj:getColor () | Return the current Color of the object |
| DisplayObj:setPivot (x, y) | Set pivot of the object. |
| DisplayObj:getPivot () | Return current pivot position |
| DisplayObj:setPivotX (x) | Set Pivot x position |
| DisplayObj:getPivotX () | Get Pivot x position |
| DisplayObj:setPivotY (y) | Set Pivot y position |
| DisplayObj:getPivotY () | Get Pivot y position |
| DisplayObj:setPosition (x, y) | Set object position |
| DisplayObj:getPosition () | Get object position |
| DisplayObj:setPosition_v2 (v) | Set object position using a vec2 |
| DisplayObj:getPosition_v2 () | Get object position using a vec2 |
| DisplayObj:setPositionX (x) | Set x position |
| DisplayObj:getPositionX () | Get x position |
| DisplayObj:setPositionY (y) | Set y position |
| DisplayObj:getPositionY () | Get y position |
| DisplayObj:translate (x, y) | Move the obj by x,y units |
| DisplayObj:setRotation (r) | Set rotation value. |
| DisplayObj:getRotation () | Get rotation value |
| DisplayObj:setScale (x, y) | Set scale |
| DisplayObj:getScale () | Get scale value |
| DisplayObj:setScale_v2 (v) | Set scale using vec2 |
| DisplayObj:getScale_v2 () | Get scale using vec2 |
| DisplayObj:setScaleX (s) | Set scale x value |
| DisplayObj:getScaleX () | Get scale x value |
| DisplayObj:setScaleY (s) | Set scale y value |
| DisplayObj:getScaleY () | Get scale y value |
| DisplayObj:updateTransformationMatrix (targetSpace) | Inner method, called to force update of transformation matrix used to calculate relative position into the displayList |
| DisplayObj:localToGlobal (x, y, targetSpace) | Transforms a point from the local coordinate system to global coordinates. |
| DisplayObj:globalToLocal (x, y, targetSpace) | Transforms a point from the global coordinate system to local coordinates system. |
| DisplayObj:setGlobalPosition (x, y, targetSpace) | Used to set an absolute position related to targetSpace container coordinates (usually the stage). |
| DisplayObj:getGlobalPosition (targetSpace) | Return global position of the object related to the targetSpace provided (usually the stage) |
| DisplayObj:globalTranslate (dx, dy, targetSpace) | Apply a translation based on targetSpace coordinates(usually the stage) |
| DisplayObj:getRect (resultRect) | Bounding rect in local coordinates of the displayObj. |
| DisplayObj:getWidth () | Get object width related on parent trasnformation (so with scaling applied) |
| DisplayObj:getHeight () | Get object height related on parent trasnformation (so with scaling applied) |
| DisplayObj:getBounds (targetSpace, resultRect) | Returns a rectangle that completely encloses the object as it appears in another coordinate system. |
| DisplayObj:getOrientedBounds (targetSpace) | Returns an array of vertices describing a quad that rapresents object bounding rect as it appears into another coordinate system |
| DisplayObj:drawOrientedBounds () | Draw the oriented bounding box. |
| DisplayObj:drawAABounds (drawContainer) | Draw the axis aligned bound of the object as appears into top most container / stage coords |
| DisplayObj:hitTest (x, y, targetSpace, forTouch) | Given a x,y point in targetSpace coordinates it check if it falls inside local bounds. |
Fields
| _defaultUseMultiplyColor | By default DisplayObjs do not make use of multiplyColor because the resulting color on screen is automatically affected by hierarchy colors. |
Functions
- DisplayObj:init ()
- Initialization.
- DisplayObj:dispose ()
- If a derived object needs to clean up resources it must inherits this method, always remembering to call also parent dispose method
- DisplayObj:_createProp ()
- create a MOAI prop that the current DisplayObj is going to wrap. Generic displayObjs create generic MOAIProps. If a specific prop is needed just override this method for specific DisplayObj class.
- DisplayObj:dbgInfo (recursive)
-
Debug Infos.
Can be used to create a description of the single displayObj or of a whole displayList
Parameters:
- recursive has meaning only if the displayObj is a DisplayObjContainer.
Returns:
-
string
- DisplayObj:setName (name)
-
It's possible (but optional) to set a name to a display obj.
Parameters:
- name the name of the object. Can be nil
- DisplayObj:getName ()
- Get the name of the current obj. return name (string) or nil if a name has not been set
- DisplayObj:_setParent (parent)
-
Internal method.
Called by a DisplayObjContainer when the DisplayObj is added as child
Parameters:
- parent assert(not parent or parent is_a(DisplayObjContainer))
- DisplayObj:getParent ()
- Return the parent DisplayObjContainer return parent displayObjContainer or nil if not attached to any container
- DisplayObj:removeFromParent ()
- Remove a displayObject from the parent container
- DisplayObj:getRoot ()
-
Return the top most displayObjContainer in the display tree.
For all the displayed object the root is Stage
Returns:
-
root displayObject container or nil if the object has not parent
- DisplayObj:getStage ()
-
If the displayList containing the object is attached to the stage, return the stage, else nil
Returns:
-
the stage or nil if the obj has not the stage as ancestor
- DisplayObj:setVisible (visible)
-
Set visibility status of this object
Parameters:
- visible boolean value to set visible or hidden the displayObj
- DisplayObj:isVisible ()
-
Get visibility status of the displayObj
Returns:
-
bool
- DisplayObj:setTouchable (touchable)
-
Set touchable status of the obj.
Objects by default are touchable, this method is mainly use to remove touchable status.
If objects or whole part of displayList doesn't need touch event handling is better to remove set
this to false to increase performance. If a container is not touchable all its children are not
tested too
Parameters:
- touchable boolean value to enable / disable touchable status
- DisplayObj:isTouchable ()
-
Get touchable status of the object
Returns:
-
bool
- DisplayObj:useMultiplyColor (bUse)
-
Used to override default 'useMultiplyColor' class value for a specific instance
Used for example for images when a pixel shader is set for special effects.
Parameters:
- bUse boolean
- DisplayObj:isMultiplyingColor ()
-
Returns if the object is using multiplyColor feature
Returns:
-
bool
- DisplayObj:_setMultiplyColor (r, g, b, a)
-
Inner method.
Called by parent container, setMultiplyColor set the multiply color value of the parent container
(already modified by his current multiplyColor value)
Parameters:
- r [0,1]
- g [0,1]
- b [0,1]
- a [0,1]
- DisplayObj:_getMultipliedColor ()
-
Inner method.
Returns the color of the object when displayed.
This value is obtained multiplying the obj color by the parent multiplyColor value
Returns:
- r [0,1]
- g [0,1]
- b [0,1]
- a [0,1]
- DisplayObj:setAlpha (a)
-
Set alpha value of the object
Parameters:
- a alpha value [0,255]
- DisplayObj:setColor (r, g, b, a)
-
Set obj color.
The following calls are valid:
- setColor(r,g,b)
- setColor(r,g,b,a)
- setColor(color)
Parameters:
- r red value [0,255] or a Color
- g green value [0,255] or nil
- b blue value [0,255] or nil
- a alpha value [0,255] or nil
- DisplayObj:getColor ()
-
Return the current Color of the object
Returns:
-
Color(r,g,b,a)
- DisplayObj:setPivot (x, y)
-
Set pivot of the object.
Pivot point is the point to which transformation are applied, so position, scaling, rotation are all calculated
keeping pivot point as center. By default pivot point is (0,0), depending on coordinats system
Parameters:
- x pivot x position
- y pivot y position
- DisplayObj:getPivot ()
-
Return current pivot position
Returns:
- x
- y
- DisplayObj:setPivotX (x)
-
Set Pivot x position
Parameters:
- x
- DisplayObj:getPivotX ()
-
Get Pivot x position
Returns:
-
x
- DisplayObj:setPivotY (y)
-
Set Pivot y position
Parameters:
- y
- DisplayObj:getPivotY ()
-
Get Pivot y position
Returns:
-
y
- DisplayObj:setPosition (x, y)
-
Set object position
Parameters:
- x
- y
- DisplayObj:getPosition ()
-
Get object position
Returns:
- x
- y
- DisplayObj:setPosition_v2 (v)
-
Set object position using a vec2
Parameters:
- v vec2(x,y)
- DisplayObj:getPosition_v2 ()
-
Get object position using a vec2
Returns:
-
vec2(x,y)
- DisplayObj:setPositionX (x)
-
Set x position
Parameters:
- x
- DisplayObj:getPositionX ()
-
Get x position
Returns:
-
x
- DisplayObj:setPositionY (y)
-
Set y position
Parameters:
- y
- DisplayObj:getPositionY ()
-
Get y position
Returns:
-
y
- DisplayObj:translate (x, y)
-
Move the obj by x,y units
Parameters:
- x
- y
- DisplayObj:setRotation (r)
-
Set rotation value.
Rotation is expressed in radians and is applied clock wise.
Parameters:
- r radians
- DisplayObj:getRotation ()
-
Get rotation value
Returns:
-
r [-math.pi, math.pi]
- DisplayObj:setScale (x, y)
-
Set scale
Parameters:
- x
- y
- DisplayObj:getScale ()
-
Get scale value
Returns:
- x
- y
- DisplayObj:setScale_v2 (v)
-
Set scale using vec2
Parameters:
- v vec2(x,y)
- DisplayObj:getScale_v2 ()
-
Get scale using vec2
Returns:
-
v vec2(x,y)
- DisplayObj:setScaleX (s)
-
Set scale x value
Parameters:
- s
- DisplayObj:getScaleX ()
-
Get scale x value
Returns:
-
x
- DisplayObj:setScaleY (s)
-
Set scale y value
Parameters:
- s
- DisplayObj:getScaleY ()
-
Get scale y value
Returns:
-
y
- DisplayObj:updateTransformationMatrix (targetSpace)
-
Inner method, called to force update of transformation matrix used
to calculate relative position into the displayList
Parameters:
- targetSpace could be self, nil or an ancestor displayObj.
- DisplayObj:localToGlobal (x, y, targetSpace)
-
Transforms a point from the local coordinate system to
global coordinates. targetSpace define the destination
space of the transformation. If nil is considerede to be
the top most container (for displayed object the
screenspace / stage)
if nil refers to the top most container
Parameters:
- x coordinate in local system
- y coordinate in local system
- targetSpace destination space of the trasnformation
- DisplayObj:globalToLocal (x, y, targetSpace)
-
Transforms a point from the global coordinate system to
local coordinates system. targetSpace define the source
space of the transformation, to where x,y belongs.
If nil is considered to be the the top most container
(for displayed object the screenspace / stage)
If nil refers to the top most container
Parameters:
- x coordinate in global system
- y coordinate in global system
- targetSpace source space of the trasnformation
- DisplayObj:setGlobalPosition (x, y, targetSpace)
-
Used to set an absolute position related to targetSpace
container coordinates (usually the stage).
Usefull for drag and drop features
If nil refers to the top most container
Parameters:
- x global coordinate
- y global coordinate
- targetSpace the coordinate system to which x,y belongs.
- DisplayObj:getGlobalPosition (targetSpace)
-
Return global position of the object related to the targetSpace provided
(usually the stage)
If nil refers to the top most container
Parameters:
- targetSpace related to which position has to be transformed.
Returns:
- x
- y
- DisplayObj:globalTranslate (dx, dy, targetSpace)
-
Apply a translation based on targetSpace coordinates(usually the stage)
Parameters:
- dx x translation
- dy y translation
- targetSpace in which translation has to been applied. If nil refers to the top most container
- DisplayObj:getRect (resultRect)
-
Bounding rect in local coordinates of the displayObj.
Width, Height, hitTest, Bounds all rely on this method that must be
defined for concrete displayObj classes.
Parameters:
- resultRect if provided is filled and returned
Returns:
-
Rect
- DisplayObj:getWidth ()
- Get object width related on parent trasnformation (so with scaling applied)
- DisplayObj:getHeight ()
- Get object height related on parent trasnformation (so with scaling applied)
- DisplayObj:getBounds (targetSpace, resultRect)
-
Returns a rectangle that completely encloses the object as it
appears in another coordinate system.
Parameters:
- targetSpace the object related to which we want to calculate bounds
- resultRect optional, if provided is filled and returned
Returns:
-
Rect
- DisplayObj:getOrientedBounds (targetSpace)
-
Returns an array of vertices describing a quad that rapresents object bounding rect as it appears into
another coordinate system
The array can be directely used for rendering
Parameters:
- targetSpace the object related to which we want to calculate the oriented bounds
Returns:
-
array of position [x,y,...] for 4 points plus first point replicated.
- DisplayObj:drawOrientedBounds ()
- Draw the oriented bounding box. Usefull for debug purpose
- DisplayObj:drawAABounds (drawContainer)
-
Draw the axis aligned bound of the object as appears into top most container / stage coords
Parameters:
- drawContainer
- DisplayObj:hitTest (x, y, targetSpace, forTouch)
-
Given a x,y point in targetSpace coordinates it check if it falls inside local bounds.
Parameters:
- x coordinate in targetSpace system
- y coordinate in targetSpace system
- targetSpace the referred coorindate system. If nil the top most container / stage
- forTouch boolean. If true the check is done only for visible and touchable object
Returns:
-
self if the hitTest is positive else nil
Fields
- _defaultUseMultiplyColor
- By default DisplayObjs do not make use of multiplyColor because the resulting color on screen is automatically affected by hierarchy colors. Special cases are when an object is rendered using a shader that doesn't take care of hierarchy, and so it's required to manually modify colors according to multiply value.


{% extends "base/page_centered.html" %} {% block page_title %}About Us{% endblock %} {% block main_content %}
Local Ground allows you to create and share your own annotated online maps. You can draw on existing maps, add pictures, audio, video and other data, and share with your friends, family and colleagues.
Here are some examples of how Local Ground has been used:
If you have your own ideas or applications for Local Ground, please contact us at info@localground.org!


Starters
| Full | Half | |
|---|---|---|
| Paneer Pakoda | ₹ 160 | ₹ 90 |
| French Fry | ₹ 100 | ₹ 60 |
| Spring Roll | ₹ 75 | - |
| Chicken Pakoda | ₹ 210 | ₹ 100 |
Chef's Choice
Veg Main-course
| Full | Half | |
|---|---|---|
| Palak Panner | ₹ 150 | ₹ 80 |
| Matar Panner | ₹ 170 | ₹ 90 |
| Kadai Panner | ₹ 140 | ₹ 70 |
| Panner Tikka Masala | ₹ 170 | ₹ 90 |
| Mushroom Masala | ₹ 140 | ₹ 70 |
| Veg Kolapuri | ₹ 150 | ₹ 60 |
| Navaratna Korma | ₹ 200 | ₹ 100 |
Chef's Choice
Non Veg Main-course
| Full | Half | |
|---|---|---|
| Chicken Kadai | ₹ 180 | ₹ 90 |
| Chicken Korma | ₹ 160 | ₹ 80 |
| Chicken Kasa | ₹ 145 | ₹ 70 |
| Chicken Butter Masala | ₹ 210 | ₹ 100 |
| Prawn Masala | ₹ 350 | ₹ 200 |
| Mutton Masala | ₹ 400 | ₹ 200 |
Chef's Choice
Biryani
| Full | Half | |
|---|---|---|
| Veg Biryani | ₹ 120 | - |
| Chicken Biryani | ₹ 160 | - |
| Special Chicken Biryani | ₹ 220 | ₹ 100 |
| Mutton Biryani | ₹ 185 | ₹ 100 |
| Egg Biryani | ₹ 135 | - |
| Special Dum Biryani | ₹ 225 | - |
| Hyderabadi Dum Biryani | ₹ 200 | - |
| Prawn Biryani | ₹ 250 | ₹ 130 |
Chef's Choice
About our cafe
Craving some delicious Greek food? Maybe you’re in the mood for a juicy steak? No matter what kind of meal you have in mind, The Engineer's Kitchen is ready to prepare it for you. Since 2019, The Engineer's Kitchen has been the go-to diner for residents of Bhubaneswar,Odisha. Our diner serves breakfast all day, in addition to wholesome and flavorful dining options for lunch and dinner. From starters to main course, non-veg to sea foods, you’ll find all kinds of hearty meals prepared fresh at The Engineer's Kitchen. Sounds delicious, right?
We’re here to serve you the best food around, whenever you’re looking for a great Indian restaurant in Bhubaneswar, Odisha.
Talk to us
Reach us via


Tutorial - Todo List
In this tutorial we'll create a Todo list application using WPF for the UI. The application will allow items to be added and deleted from the list, the text of an item to be edited and items can be checked off as done. This application demonstrates a simple master/detail view, and introduces a couple of concepts:
- The WithEach operator for introducing a scope for list elements.
- Creating a record class which contains one or more memory cells.
Setting up the project
Follow the steps in the Quickstart guide to get a skeleton project up and running, then we can start building our UI.
Create the UI
The UI will be divided into two panes: on the left hand side will be a list of items in the todo list, along with buttons to add and delete elements. Filling the rest of the view will be the detail view to edit a todo item. The detail view will contain two controls, a TextBox to edit the text of the item, and a checkbox to flag items as done. Replace the default Grid element in MainWindow.xaml with the following code:
<DockPanel LastChildFill="True">
<DockPanel LastChildFill="True">
<Grid DockPanel.Dock="Bottom" Margin="8,0,8,8">
<Button x:Name="addButton" Content="Add" Width="80" Height="36" HorizontalAlignment="Left" />
<Button x:Name="deleteButton" Content="Delete" Width="80" Height="36" HorizontalAlignment="Right" />
</Grid>
<ListView x:Name="masterList" Width="200" Margin="0,0,0,16"></ListView>
</DockPanel>
<Grid x:Name="detailView" Margin="10">
<TextBlock Text="Item text:" Margin="0,20,0,0" Width="66" TextAlignment="Right" HorizontalAlignment="Left" VerticalAlignment="Top" />
<TextBox x:Name="textField" Margin="70,16,10,0" Height="26" VerticalAlignment="Top" />
<TextBlock Text="Done?" Margin="0,66,0,0" Width="66" TextAlignment="Right" HorizontalAlignment="Left" VerticalAlignment="Top" />
<CheckBox x:Name="isDoneCheckbox" Margin="69,60,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="2" ScaleY="2" />
</CheckBox.LayoutTransform>
</CheckBox>
</Grid>
</DockPanel>
Create the TodoListItem Class
Add a new class to the project called TodoListItem. This will represent a single item in the list. Each item needs to store the text of the item, and a flag indicating whether the item is done. The text will be represented by a string cell, and the done flag will be a bool cell. Since this class contains cells, it should implement IRefCounted, so that the lifetime of the cells can be tracked. The implementations of AddRef and Release can simply forward the calls on to the cells. Adding the cells and the IRefCounted implementation, we end up with this:
public class TodoListItem : IRefCounted
{
public MemoryCell<string> text;
public MemoryCell<bool> isDone;
public TodoListItem()
{
this.text = new MemoryCell<string>("");
this.isDone = new MemoryCell<bool>(false);
}
public void AddRef()
{
text.AddRef();
isDone.AddRef();
}
public void Release()
{
text.Release();
isDone.Release();
}
}
Construct the main cells
At the top level, the essential state of the application requires a list of TodoListItem instances, plus an integer to track which item is currently selected. This will determine which item (if any) is modified by the controls in the detail view. Add the following to the WhileRunning method:
var mainList = new ListCell<TodoListItem>();
var selectedItem = new MemoryCell<int>(-1);
A value of -1 in the selectedItem value will be used to indicate that nothing is selected.
Create window bindings
We need to observe a number of interface properties: the state of the add and delete buttons, the contents of the text field, the state of the checkbox and the selected index of the listview. Add the following to WhileRunning to map each of these properties onto a cell:
var addButtonPressed = PropertyAdapter.Read<bool>(window.addButton, Button.IsPressedProperty);
var deleteButtonPressed = PropertyAdapter.Read<bool>(window.deleteButton, Button.IsPressedProperty);
var textField = PropertyAdapter.Read<string>(window.textField, TextBox.TextProperty);
var isDoneField = PropertyAdapter.Read<bool>(window.isDoneCheckbox, CheckBox.IsCheckedProperty);
var uiSelection = PropertyAdapter.Read<int>(window.masterList, ListView.SelectedIndexProperty);
Implementing add and delete
Before we can edit or display the list of todo items, we need a way to add new ones. We can
use ICellRead
addButtonPressed.WhenTrue(() =>
{
var newIndex = mainList.Add(new TodoListItem());
Events.Once(() => selectedItem.Cur = newIndex);
});
The implementation of delete follows a similar pattern. We use WhenTrue to trigger an imperative block when the button is pressed, and in the body of the block we remove the currently selected item from the list. The only thing we need to check is whether the selection is empty (represented by -1) or not valid (refers to an index past the end of the list).
deleteButtonPressed.WhenTrue(() =>
{
if (selectedItem.Cur >= 0 && selectedItem.Cur < mainList.Count)
{
mainList.RemoveAt(selectedItem.Cur);
}
});
Adding this code will implement the complete functionality for the two buttons, however the changes they make to the application state will be invisible since changes to the list cell are not reflected in the list view. We cover this in the next section.
Dispaying the list items
This is perhaps the most important part: displaying the todo list contents in the list view. We will use the data stored in the list cell to generate a list of strings to display in the view. This generated list will automatically be kept up to date with any changes to the data model. The output strings will always include the item's text, and if the item is marked as done, the text will be followed by a check mark in square brackets.
Since we need to observe cells held within each element of the source list, we will need
a continuous scope to observe them in. IListCellRead<T>.WithEach
constructs a scope for each element
of a list, which lasts until that element is removed, replaced or the list is destroyed.
The body of WithEach must return an ICellRead for each element of the list, which allows
us to handle the case where a modification to a member of TodoListItem, such as the isDone
cell, can cause the output list to change even though the source list itself has not changed.
If we only wanted to display the item's text, and ignore the value of isDone, we could write the following:
var listText = mailList.WithEach(item => item.text);
This would construct an IListCellRead<string>
which would update both when items are added
and removed, and when any item's text cell changes. To incorporate the value of isDone into
the result, we can use CellBuilder.Merge to construct a new cell based on the text and isDone
cells. This new cell would be updated whenever either of the source cells changed. The final
version of the above line looks like this:
var listText = mainList.WithEach(item =>
CellBuilder.Merge(item.text, item.isDone, (text, isDone) => text + (isDone ? " [✔]" : "")));
Each time any element's text or isDone cell changes, the lambda in the second line is re-evaluated. If isDone is true, a check mark in square brackets is appended to the text, otherwise the empty string is appended to the text. Displaying this new list of strings in the ListView can easily be done using SelectorBinding:
SelectorBinding.Bind(listText, window.masterList);
If you run the application now, you should see that the add and delete buttons will add and remove empty list items. To check it's working properly, you can manually add some test data to mainList at the beginning of WhileRunning, and verify that it shows up in the list.
The last thing missing from the ListView is a binding for the selection. Currently, when
the user changes the selection in the list, the selectedItem cell is not updated, and
vice versa. We can use ICellRead<T>.Latest
to watch for the selectedItem cell changing, and update
the list view, and we can use the Bind method to read from the uiSelection variable set up earlier
and keep the selecteItem cell updated:
// Bind the ui selection to the model's representation of the current selection. Apply changes in both directions.
selectedItem.Latest(value => window.masterList.SelectedIndex = value);
uiSelection.Bind(selectedItem);
Now, running the application and repeatedly clicking 'add' should select the last element of the list, rather than previously where the selection didn't change.
Implementing the detail view
Next, we implement the functionality of the ui controls on the right hand side of the screen. This will broadly comprise three parts: Firstly, the controls should be enabled if and only if the selection is valid. Next, the controls should be updated when the selection changes. Finally, when the content of the TextBox or the status of the CheckBox are modified, the changes should be mirrored in the model.
First, we can simplify these operations by creating a cell which contains the currently selected list item, or null if the selection is empty. We can do this with the ElementAt extension method of IListCellRead:
var curItem = mainList.ElementAt(selectedItem);
We can disable all the detail controls by changing the value of window.detailView.IsEnabled. The following line project the contents of curItem to a boolean cell, which holds true iff the contents of curItem is non-null, and updates the window.detailView.IsEnabled property whenever this boolean cell changes:
curItem.Select(x => x != null).Latest(value => window.detailView.IsEnabled = value);
Next, we follow a similar pattern for updating the contents of the fields when the
selection changes. We use Select to construct cells which contain either the desired
value if the selection is non-null, or a default value. Then we use ICellRead<T>.Latest
to update
the field contents when these derived cells change:
// When the selection changes, update contents of the text field and the CheckBox
curItem.Select(x => x == null ? null : x.text.Cur).Latest(value => window.textField.Text = value);
curItem.Select(x => x == null ? false : x.isDone.Cur).Latest(value => window.isDoneCheckbox.IsChecked = value);
Finally, we can use ICellRead<T>.Lastest
to observe when the value of the fields changes. If the
selection is non-null, we update the selection with the new values:
// When the text field changes, update the model
textField.Latest(value =>
{
if (curItem.Cur != null)
{
curItem.Cur.text.Cur = value;
}
});
// When the checkbox changes, update the model
isDoneField.Latest(value =>
{
if (curItem.Cur != null)
{
curItem.Cur.isDone.Cur = value;
}
});
Wrapping up
This completes the application. Editing the detail fields should now update the list immediately. Changes to the selection (either by clicking on list items, or by clicking add or delete) should update the contents of the fields. The full source code for this tutorial is available in the TodoListSample in the Examples directory of the repository.


Permalink
Newer
100644
290 lines (240 sloc)
13.5 KB
1
# Use this hook to configure devise mailer, warden hooks and so forth.
2
# Many of these configuration options can be set straight in your model.
3
4
# Custom Devise FailureApp that redirects to external login on invalid login attempts.
5
# http://stackoverflow.com/questions/5832631/devise-redirect-after-login-fail
6
class RedirectFailure < Devise::FailureApp
7
def redirect_url
8
external_login_path
9
end
10
11
def respond
12
if http_auth?
13
http_auth
14
else
15
# https://github.com/plataformatec/devise/blob/69bee06ceee6280b54304928bb6e55c5064abad8/config/locales/en.yml
16
# https://github.com/plataformatec/devise/wiki/I18n
17
flash[:error] = I18n.t(:invalid, :authentication_keys => 'username', :scope => [:devise, :failure])
18
redirect
19
end
20
end
21
end
22
23
Devise.setup do |config|
24
# The secret key used by Devise. Devise uses this key to generate
25
# random tokens. Changing this key will render invalid all existing
26
# confirmation, reset password and unlock tokens in the database.
27
# Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
28
# by default. You can change it below and use your own secret key.
29
# config.secret_key = '77a97decd213dc0e85017af5e0764986665783bded2bfc71d88d56cbf762d0e41423f179ebc5a035777706b5333c028daab152ddc236d076091f4a0ce3668043'
30
31
# ==> Mailer Configuration
32
# Configure the e-mail address which will be shown in Devise::Mailer,
33
# note that it will be overwritten if you use your own mailer class
34
# with default "from" parameter.
35
config.mailer_sender =<EMAIL_ADDRESS>36
37
# Configure the class responsible to send e-mails.
38
# config.mailer = 'Devise::Mailer'
39
40
# ==> ORM configuration
41
# Load and configure the ORM. Supports :active_record (default) and
42
# :mongoid (bson_ext recommended) by default. Other ORMs may be
43
# available as additional gems.
44
require 'devise/orm/active_record'
45
46
# ==> Configuration for any authentication mechanism
47
# Configure which keys are used when authenticating a user. The default is
48
# just :email. You can configure it to use [:username, :subdomain], so for
49
# authenticating a user, both parameters are required. Remember that those
50
# parameters are used only when authenticating and not when retrieving from
51
# session. If you need permissions, you should implement that in a before filter.
52
# You can also supply a hash where the value is a boolean determining whether
53
# or not authentication should be aborted when the value is not present.
54
# config.authentication_keys = [:email]
55
56
# Configure parameters from the request object used for authentication. Each entry
57
# given should be a request method and it will automatically be passed to the
58
# find_for_authentication method and considered in your model lookup. For instance,
59
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
60
# The same considerations mentioned for authentication_keys also apply to request_keys.
61
# config.request_keys = []
62
63
# Configure which authentication keys should be case-insensitive.
64
# These keys will be downcased upon creating or modifying a user and when used
65
# to authenticate or find a user. Default is :email.
66
config.case_insensitive_keys = [:email]
67
68
# Configure which authentication keys should have whitespace stripped.
69
# These keys will have whitespace before and after removed upon creating or
70
# modifying a user and when used to authenticate or find a user. Default is :email.
71
config.strip_whitespace_keys = [:email]
72
73
# Tell if authentication through request.params is enabled. True by default.
74
# It can be set to an array that will enable params authentication only for the
75
# given strategies, for example, `config.params_authenticatable = [:database]` will
76
# enable it only for database (email + password) authentication.
77
# config.params_authenticatable = true
78
79
# Tell if authentication through HTTP Auth is enabled. False by default.
80
# It can be set to an array that will enable http authentication only for the
81
# given strategies, for example, `config.http_authenticatable = [:database]` will
82
# enable it only for database authentication. The supported strategies are:
83
# :database = Support basic authentication with authentication key + password
84
# config.http_authenticatable = false
85
86
# If 401 status code should be returned for AJAX requests. True by default.
87
# config.http_authenticatable_on_xhr = true
88
89
# The realm used in Http Basic Authentication. 'Application' by default.
90
# config.http_authentication_realm = 'Application'
91
92
# It will change confirmation, password recovery and other workflows
93
# to behave the same regardless if the e-mail provided was right or wrong.
94
# Does not affect registerable.
95
# config.paranoid = true
96
97
# By default Devise will store the user in session. You can skip storage for
98
# particular strategies by setting this option.
99
# Notice that if you are skipping storage for all authentication paths, you
100
# may want to disable generating routes to Devise's sessions controller by
101
# passing skip: :sessions to `devise_for` in your config/routes.rb
102
config.skip_session_storage = [:http_auth]
103
104
# By default, Devise cleans up the CSRF token on authentication to
105
# avoid CSRF token fixation attacks. This means that, when using AJAX
106
# requests for sign in and sign up, you need to get a new CSRF token
107
# from the server. You can disable this option at your own risk.
108
# config.clean_up_csrf_token_on_authentication = true
109
110
# ==> Configuration for :database_authenticatable
111
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
112
# using other encryptors, it sets how many times you want the password re-encrypted.
113
#
114
# Limiting the stretches to just one in testing will increase the performance of
115
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
116
# a value less than 10 in other environments. Note that, for bcrypt (the default
117
# encryptor), the cost increases exponentially with the number of stretches (e.g.
118
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
119
config.stretches = Rails.env.test? ? 1 : 10
120
121
# Setup a pepper to generate the encrypted password.
122
# config.pepper = '9e447b3674570685d3093cf70eadaaa52ecb91c7a852a5884a01317756b1554fd6424dbcdfb5a01fa4ec96d128266923252a91fa53e26ab084fd0bba7149b895'
123
124
# ==> Configuration for :confirmable
125
# A period that the user is allowed to access the website even without
126
# confirming their account. For instance, if set to 2.days, the user will be
127
# able to access the website for two days without confirming their account,
128
# access will be blocked just in the third day. Default is 0.days, meaning
129
# the user cannot access the website without confirming their account.
130
# config.allow_unconfirmed_access_for = 2.days
131
132
# A period that the user is allowed to confirm their account before their
133
# token becomes invalid. For example, if set to 3.days, the user can confirm
134
# their account within 3 days after the mail was sent, but on the fourth day
135
# their account can't be confirmed with the token any more.
136
# Default is nil, meaning there is no restriction on how long a user can take
137
# before confirming their account.
138
# config.confirm_within = 3.days
139
140
# If true, requires any email changes to be confirmed (exactly the same way as
141
# initial account confirmation) to be applied. Requires additional unconfirmed_email
142
# db field (see migrations). Until confirmed, new email is stored in
143
# unconfirmed_email column, and copied to email column on successful confirmation.
144
config.reconfirmable = true
145
146
# Defines which key will be used when confirming an account
147
# config.confirmation_keys = [:email]
148
149
# ==> Configuration for :rememberable
150
# The time the user will be remembered without asking for credentials again.
151
# config.remember_for = 2.weeks
152
153
# Invalidates all the remember me tokens when the user signs out.
154
config.expire_all_remember_me_on_sign_out = true
155
156
# If true, extends the user's remember period when remembered via cookie.
157
# config.extend_remember_period = false
158
159
# Options to be passed to the created cookie. For instance, you can set
160
# secure: true in order to force SSL only cookies.
161
# config.rememberable_options = {}
162
163
# ==> Configuration for :validatable
164
# Range for password length.
165
config.password_length = 8..72
166
167
# Email regex used to validate email formats. It simply asserts that
168
# one (and only one) @ exists in the given string. This is mainly
169
# to give user feedback and not to assert the e-mail validity.
170
# config.email_regexp = /\A[^@]+@[^@]+\z/
171
172
# ==> Configuration for :timeoutable
173
# The time you want to timeout the user session without activity. After this
174
# time the user will be asked for credentials again. Default is 30 minutes.
175
# config.timeout_in = 30.minutes
176
177
# ==> Configuration for :lockable
178
# Defines which strategy will be used to lock an account.
179
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
180
# :none = No lock strategy. You should handle locking by yourself.
181
# config.lock_strategy = :failed_attempts
182
183
# Defines which key will be used when locking and unlocking an account
184
# config.unlock_keys = [:email]
185
186
# Defines which strategy will be used to unlock an account.
187
# :email = Sends an unlock link to the user email
188
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
189
# :both = Enables both strategies
190
# :none = No unlock strategy. You should handle unlocking by yourself.
191
# config.unlock_strategy = :both
192
193
# Number of authentication tries before locking an account if lock_strategy
194
# is failed attempts.
195
# config.maximum_attempts = 20
196
197
# Time interval to unlock the account if :time is enabled as unlock_strategy.
198
# config.unlock_in = 1.hour
199
200
# Warn on the last attempt before the account is locked.
201
# config.last_attempt_warning = true
202
203
# ==> Configuration for :recoverable
204
#
205
# Defines which key will be used when recovering the password for an account
206
# config.reset_password_keys = [:email]
207
208
# Time interval you can reset your password with a reset password key.
209
# Don't put a too small interval or your users won't have the time to
210
# change their passwords.
211
config.reset_password_within = 6.hours
212
213
# When set to false, does not sign a user in automatically after their password is
214
# reset. Defaults to true, so a user is signed in automatically after a reset.
215
# config.sign_in_after_reset_password = true
216
217
# ==> Configuration for :encryptable
218
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
219
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
220
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
221
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
222
# REST_AUTH_SITE_KEY to pepper).
223
#
224
# Require the `devise-encryptable` gem when using anything other than bcrypt
225
# config.encryptor = :sha512
226
227
# ==> Scopes configuration
228
# Turn scoped views on. Before rendering "sessions/new", it will first check for
229
# "users/sessions/new". It's turned off by default because it's slower if you
230
# are using only default views.
231
# config.scoped_views = false
232
233
# Configure the default scope given to Warden. By default it's the first
234
# devise role declared in your routes (usually :user).
235
# config.default_scope = :user
236
237
# Set this configuration to false if you want /users/sign_out to sign out
238
# only the current scope. By default, Devise signs out all scopes.
239
# config.sign_out_all_scopes = true
240
241
# ==> Navigation configuration
242
# Lists the formats that should be treated as navigational. Formats like
243
# :html, should redirect to the sign in page when the user does not have
244
# access, but formats like :xml or :json, should return 401.
245
#
246
# If you have any extra navigational formats, like :iphone or :mobile, you
247
# should add them to the navigational formats lists.
248
#
249
# The "*/*" below is required to match Internet Explorer requests.
250
# config.navigational_formats = ['*/*', :html]
251
252
# The default HTTP method used to sign out a resource. Default is :delete.
254
255
# ==> OmniAuth
256
# Add a new OmniAuth provider. Check the wiki for more information on setting
257
# up on your models and hooks.
258
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
259
260
# ==> Warden configuration
261
# If you want to use other strategies, that are not supported by Devise, or
262
# change the failure app, you can configure them inside the config.warden block.
263
#
264
# config.warden do |manager|
265
# manager.intercept_401 = false
266
# manager.default_strategies(scope: :user).unshift :some_external_strategy
267
# end
268
269
# Use custom Devise FailureApp that redirects to external login
270
# when an invalid username / password is given.
271
# Defined in lib/redirect_failure.rb
272
config.warden do |manager|
273
manager.failure_app = RedirectFailure
274
end
275
276
# ==> Mountable engine configurations
277
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
278
# is mountable, there are some extra configurations to be taken into account.
279
# The following options are available, assuming the engine is mounted as:
280
#
281
# mount MyEngine, at: '/my_engine'
282
#
283
# The router that invoked `devise_for`, in the example above, would be:
284
# config.router_name = :my_engine
285
#
286
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
287
# so you need to do it manually. For the users scope, it would be:
288
# config.omniauth_path_prefix = '/my_engine/users/auth'
289
end


mlens.utils package¶
Submodules¶
mlens.utils.checks module¶
ML-ENSEMBLE
| author: | Sebastian Flennerhag |
|---|---|
| copyright: | 2017 |
| licence: | MIT |
Controls that an estimator was built as expected.
-
mlens.utils.checks.
assert_correct_format
(estimators, preprocessing)[source]¶ Initial check to assert layer can be constructed.
-
mlens.utils.checks.
assert_valid_estimator
(instance)[source]¶ Assert that an instance has a
get_params
andfit
method.
-
mlens.utils.checks.
assert_valid_pipeline
(pipeline)[source]¶ Quick check to ensure the pipeline is an mlens Pipeline
mlens.utils.dummy module¶
ML-ENSEMBLE
| author: | Sebastian Flennerhag |
|---|---|
| copyright: | 2017 |
| license: | MIT |
Collection of dummy estimator classes, Mixins to build transparent layers for unit testing.
Also contains pre-made Layer, LayerContainers and data generation functions for unit testing.
-
class
mlens.utils.dummy.
LogisticRegression
(offset=0)[source]¶ Bases:
mlens.utils.dummy.OLS
No frill Logistic Regressor w. one-vs-rest estimation of P(label).
MWE of a Scikit-learn classifier.
LogisticRegression is a simple classifier estimator designed for transparency in unit testing. It implements a Logistic Regression with one-vs-rest strategy of classification.
The estimator is a wrapper around the
OLS
. The OLS prediction is squashed using the Sigmoid function, and classification is done by picking the label with the highest probability.The
offset
option allows the user to offset weights in the OLS by a scalar value, if different instances should be differentiated in their predictions.Examples
Asserting the LogisticRegression passes the Scikit-learn estimator test
>>> from sklearn.utils.estimator_checks import check_estimator >>> from mlens.utils.dummy import LogisticRegression >>> check_estimator(LogisticRegression)
Comparison with Scikit-learn’s LogisticRegression
>>> from mlens.utils.dummy import LogisticRegression as mlensL >>> from sklearn.linear_model import LogisticRegression as sklearnL >>> from sklearn.datasets import make_classification >>> X, y = make_classification() >>> >>> slr = sklearnL() >>> slr.fit(X, y) >>> >>> mlr = mlensL() >>> mlr.fit(X, y) >>> >>> (mlr.predict(X) == slr.predict(X)).sum() / y.shape array([ 0.98])
-
class
mlens.utils.dummy.
OLS
(offset=0)[source]¶ Bases:
mlens.externals.sklearn.base.BaseEstimator
No frills vanilla OLS estimator implemented through the normal equation.
MWE of a Scikit-learn estimator.
OLS is a simple estimator designed to allow for total control over predictions in unit testing. It implements OLS through the Normal Equation, no learning takes place. The
offset
option allows the user to offset weights by a scalar value, if different instances should be differentiated in their predictions.Parameters: offset (float (default = 0)) – scalar value to add to the coefficient vector after fitting. Examples
Asserting the OLS passes the Scikit-learn estimator test
>>> from sklearn.utils.estimator_checks import check_estimator >>> from mlens.utils.dummy import OLS >>> check_estimator(OLS)
OLS comparison with Scikit-learn’s LinearRegression
>>> from numpy.testing import assert_array_equal >>> from mlens.utils.dummy import OLS >>> from sklearn.linear_model import LinearRegression >>> from sklearn.datasets import load_boston >>> X, y = load_boston(True) >>> >>> lr = LinearRegression(False) >>> lr.fit(X, y) >>> >>> ols = OLS() >>> ols.fit(X, y) >>> >>> assert_array_equal(lr.coef_, ols.coef_)
-
class
mlens.utils.dummy.
Scale
(copy=True)[source]¶ Bases:
mlens.externals.sklearn.base.BaseEstimator
,mlens.externals.sklearn.base.TransformerMixin
Removes the a learnt mean in a column-wise manner in an array.
MWE of a Scikit-learn transformer, to be used for unit-tests of ensemble classes.
Parameters: copy (bool (default = True)) – Whether to copy X before transforming. Examples
Asserting
Scale
passes the Scikit-learn estimator test>>> from sklearn.utils.estimator_checks import check_estimator >>> from mlens.utils.dummy import Scale >>> check_estimator(Scale)
Scaling elements
>>> from numpy import arange >>> from mlens.utils.dummy import Scale >>> X = arange(6).reshape(3, 2) >>> X[:, 1] *= 2 >>> print('X:') >>> print('%r' % X) >>> print('Scaled:') >>> S = Scale().fit_transform(X) >>> print('%r' % S) X: array([[ 0, 2], [ 2, 6], [ 4, 10]]) Scaled: array([[-2., -4.], [ 0., 0.], [ 2., 4.]])
mlens.utils.exceptions module¶
ML-ENSEMBLE
Exception handling classes.
-
exception
mlens.utils.exceptions.
DataConversionWarning
[source]¶ Bases:
UserWarning
Warning used to notify implicit data conversions happening in the code.
This warning occurs when some input data needs to be converted or interpreted in a way that may not match the user’s expectations.
- For example, this warning may occur when the user
- passes an integer array to a function which expects float input and will convert the input
- requests a non-copying operation, but a copy is required to meet the implementation’s data-type expectations;
- passes an input whose shape can be interpreted ambiguously.
Changed in version 0.18: Moved from sklearn.utils.validation.
Note
imported from Scikit-learn for validation compatibility.
-
exception
mlens.utils.exceptions.
DeprecationWarning
[source]¶ Bases:
UserWarning
Warning to notify the user of a deprecated feature
-
exception
mlens.utils.exceptions.
EfficiencyWarning
[source]¶ Bases:
UserWarning
Warning used to notify the user of inefficient computation.
This warning notifies the user that the efficiency may not be optimal due to some reason which may be included as a part of the warning message. This may be subclassed into a more specific Warning class.
New in version 0.18.
Note
imported from Scikit-learn for validation compatibility
-
exception
mlens.utils.exceptions.
FitFailedWarning
[source]¶ Bases:
RuntimeWarning
Warning for a failed estimator ‘fit’ call.
-
exception
mlens.utils.exceptions.
InputDataWarning
[source]¶ Bases:
UserWarning
Warning used to notify that an array does not behave as expected.
Raised if data looks suspicious, but not outright fatal. Used sparingly, as it is often better to raise an error if input does not look like expected. Debugging corrupt data during parallel estimation is difficult and requires knowledge of backend operations.
-
exception
mlens.utils.exceptions.
LayerSpecificationError
[source]¶ Bases:
TypeError
,ValueError
Error class for incorrectly specified layers.
-
exception
mlens.utils.exceptions.
LayerSpecificationWarning
[source]¶ Bases:
UserWarning
Warning class if layer has been specified in a dubious form.
This warning is raised when the input does not look like expected, but is not fatal and a best guess of how to fix it will be made.
-
exception
mlens.utils.exceptions.
MetricWarning
[source]¶ Bases:
UserWarning
Warning to notify that scoring do not behave as expected.
Raised if scoring fails or if aggregating scores fails.
-
exception
mlens.utils.exceptions.
NonBLASDotWarning
[source]¶ Bases:
mlens.utils.exceptions.EfficiencyWarning
Warning used when the dot operation does not use BLAS.
FROM SCIKIT-LEARN
This warning is used to notify the user that BLAS was not used for dot operation and hence the efficiency may be affected.
Changed in version 0.18: Moved from sklearn.utils.validation, extends EfficiencyWarning.
Note
imported from Scikit-learn for validation compatibility
-
exception
mlens.utils.exceptions.
NotFittedError
[source]¶ Bases:
ValueError
,AttributeError
Error class for an ensemble or estimator that is not fitted yet
Raised when some method has been called that expects the instance to be fitted.
-
exception
mlens.utils.exceptions.
NotInitializedError
[source]¶ Bases:
ValueError
,AttributeError
Error class for an instance that has not been properly initialized.
Raised when required methods and attributes have not been initialized.
-
exception
mlens.utils.exceptions.
ParallelProcessingError
[source]¶ Bases:
AttributeError
,RuntimeError
Error class for fatal errors related to
ParallelProcessing
.Can be subclassed for more specific error classes.
-
exception
mlens.utils.exceptions.
ParallelProcessingWarning
[source]¶ Bases:
UserWarning
Warnings related to methods on
ParallelProcessing
.Can be subclassed for more specific warning classes.
mlens.utils.formatting module¶
ML-ENSEMBLE
| author: | Sebastian Flennerhag |
|---|---|
| copyright: | 2017 |
| licence: | MIT |
Formatting of instance lists.
-
mlens.utils.formatting.
check_instances
(estimators=None, preprocessing=None, namespace=None)[source]¶ Ensure estimators and preprocessing pipelines are correctly formatted
Utility for formating estimator iterable and preprocessing iterable into formats accepted by a the
Layer
.Parameters: - estimators (iterable, optional) – estimator instances.
- preprocessing (iterable, optional) – preprocessing pipeline instances.
mlens.utils.id_train module¶
ML-ENSEMBLE
| author: | Sebastian Flennerhag |
|---|---|
| copyright: | 2017 |
| licence: | MIT |
Class for identifying a training set after an estimator has been fitted. Used for determining whether a predict or transform method should use cross validation to create predictions, or estimators fitted on full training data.
-
class
mlens.utils.id_train.
IdTrain
(size=10)[source]¶ Bases:
mlens.externals.sklearn.base.BaseEstimator
Container to identify training set.
Samples a random subset from set passed to the fit method, to allow identification of the training set in a transform or predict method.
Parameters: size (int) – size to sample. A random subset of size [size, size] will be stored in the instance.
-
mlens.utils.id_train.
permutation
(x)¶ Randomly permute a sequence, or return a permuted range.
If x is a multi-dimensional array, it is only shuffled along its first index.
Parameters: x (int or array_like) – If x is an integer, randomly permute np.arange(x)
. If x is an array, make a copy and shuffle the elements randomly.Returns: out – Permuted sequence or array range. Return type: ndarray Examples
>>> np.random.permutation(10) array([1, 7, 4, 3, 0, 9, 2, 5, 8, 6])
>>> np.random.permutation([1, 4, 9, 12, 15]) array([15, 1, 9, 4, 12])
>>> arr = np.arange(9).reshape((3, 3)) >>> np.random.permutation(arr) array([[6, 7, 8], [0, 1, 2], [3, 4, 5]])
mlens.utils.utils module¶
ML-ENSEMBLE
| author: | Sebastian Flennerhag |
|---|---|
| copyright: | 2017 |
| licence: | MIT |
-
class
mlens.utils.utils.
CMLog
(verbose=False)[source]¶ Bases:
object
CPU and Memory logger.
Class for starting a monitor job of CPU and memory utilization in the background in a Python script. The
monitor
class records thecpu_percent
,rss
andvms
as collected by the psutil library for the parent process’ pid.CPU usage and memory utilization are stored as attributes in numpy arrays.
Examples
>>> from time import sleep >>> from mlens.utils.utils import CMLog >>> cm = CMLog(verbose=True) >>> cm.monitor(2, 0.5) >>> _ = [i for i in range(10000000)] >>> >>> # Collecting before completion triggers a message but no error >>> cm._collect() >>> >>> sleep(2) >>> cm._collect() >>> print('CPU usage:') >>> cm.cpu [CMLog] Monitoring for 2 seconds with checks every 0.5 seconds. [CMLog] Job not finished. Cannot _collect yet. [CMLog] Collecting... done. Read 4 lines in 0.000 seconds. CPU usage: array([ 50. , 22.4, 6. , 11.9])
Raises: ImportError : – Depends on psutil. If not installed, raises ImportError on instantiation. Parameters: verbose (bool) – whether to notify of job start. -
collect
()[source]¶ Collect monitored data.
Once a monitor job finishes, call
_collect
to read the CPU and memory usage into python objects in the current process. If called before the job finishes, _collect issues a print statement to try again later, but no warning or error is raised.
-
monitor
(stop=None, ival=0.1, kill=True)[source]¶ Start monitoring CPU and memory usage.
Parameters: - stop (float or None (default = None)) – seconds to monitor for. If None, monitors until
_collect
is called. - ival (float (default=0.1)) – interval of monitoring.
- kill (bool (default = True)) – whether to kill the monitoring job if
_collect
is called before timeout (stop
). If set to False, calling_collect
will cause the instance to wait until the job completes.
- stop (float or None (default = None)) – seconds to monitor for. If None, monitors until
-
-
mlens.utils.utils.
kwarg_parser
(func, kwargs)[source]¶ Utility function for parsing keyword arguments
mlens.utils.validation module¶
ML-ENSEMBLE
| author: | Sebastian Flennerhag |
|---|---|
| copyright: | 2017 |
| license: | MIT |
Input validation module. Builds on Scikit-learns validation
module, but
extends it to a soft check that issues warnings but don’t force changes to the
inputs.
-
mlens.utils.validation.
check_inputs
(X, y=None, check_level=0)[source]¶ Pre-checks on input arrays X and y.
Checks input data according to
check_level
to ensure format is roughly in line with what a typical estimator expects.If
check_level = 0
this test is turned off.Parameters: - X (nd-array, list or sparse matrix) – Input data.
- y (nd-array, list or sparse matrix) – Labels.
- check_level (int (default = 2)) –
level of strictness in checking input arrays.
check_level = 0
no checks, returns X, ycheck_level
= 1 will raises warnings if any non-critical test fails. Returns boolean FAIL flag.check_level = 2
will impose Scikit-learn array check, which convertsX
andy
to numpy arrays and raises error if conversion fails.
Returns: - FAIL (fail flag, optional) – boolean for whether any test failed. Returned if
check_level = 1
- X_converted (numpy array, optional) – The converted and validated X. Returned if
check_level = 2
- y_converted (numpy array, optional) – The converted and validated y. Returned if
check_level = 2
. - random_state (object, optional) – numpy RandomState object.
-
mlens.utils.validation.
soft_check_1d
(y, y_numeric, estimator)[source]¶ Check if y is numeric, finite and one-dimensional.
-
mlens.utils.validation.
soft_check_array
(array, accept_sparse=True, dtype=None, ensure_2d=True, force_all_finite=True, allow_nd=True, ensure_min_samples=1, ensure_min_features=1, estimator=None)[source]¶ Input validation on an array, list, sparse matrix or similar.
Like Scikit-learn’s
check_array
, but issues warnings on failed tests and do no forced array conversion.Parameters: - array (array-like) – Input object, expected to be array-like, to check / convert.
- accept_sparse (string, list of string or None (default=None)) – String[s] representing allowed sparse matrix formats, such as ‘csc’, ‘csr’, etc. None means that sparse matrix input will raise an error. If the input is sparse but not in the allowed format, it will be converted to the first listed format.
- dtype (string, type, list of types or None (default="numeric")) – Data type of result. If None, the dtype of the input is preserved. If “numeric”, warning is raised if array.dtype is object. If dtype is a list of types, warning is raised if array.dtype is not a member of the list.
- force_all_finite (boolean (default=True)) – Whether to raise an error on np.inf and np.nan in X.
- ensure_2d (boolean (default=True)) – Whether to warn if X is not at least 2d.
- allow_nd (boolean (default=False)) – Whether to allow X.ndim > 2.
- ensure_min_samples (int (default=1)) – Make sure that the array has a minimum number of samples in its first axis (rows for a 2D array). Setting to 0 disables this check.
- ensure_min_features (int (default=1)) – Make sure that the 2D array has some minimum number of features
(columns). The default value of 1 rejects empty datasets.
This check is only enforced when the input data has effectively 2
dimensions or is originally 1D and
ensure_2d
is True. Setting to 0 disables this check. - estimator (str or estimator instance (default=None)) – If passed, include the name of the estimator in warning messages.
Returns: CHANGE – Whether X should be changed.
Return type:
-
mlens.utils.validation.
soft_check_x_y
(X, y, accept_sparse=True, dtype=None, force_all_finite=True, ensure_2d=True, allow_nd=True, multi_output=False, ensure_min_samples=1, ensure_min_features=1, y_numeric=False, estimator=None)[source]¶ Input validation before estimation.
Checks X and y for consistent length, and X 2d and y 1d. Standard input checks are only applied to y, such as checking that y does not have np.nan or np.inf targets. For multi-label y, set multi_output=True to allow 2d and sparse y. Raises warnings if the dtype is object.
Parameters: - X (nd-array, list or sparse matrix) – Input data.
- y (nd-array, list or sparse matrix) – Labels.
- accept_sparse (string, list of string or None (default=None)) – String[s] representing allowed sparse matrix formats, such as ‘csc’, ‘csr’, etc. None means that sparse matrix input will raise an error. If the input is sparse but not in the allowed format, it will be converted to the first listed format.
- dtype (string, type, list of types or None (default="numeric")) – Data type of result. If None, the dtype of the input is preserved. If “numeric”, dtype is preserved unless array.dtype is object. If dtype is a list of types, conversion on the first type is only performed if the dtype of the input is not in the list.
- force_all_finite (boolean (default=True)) – Whether to raise an error on np.inf and np.nan in X. This parameter does not influence whether y can have np.inf or np.nan values.
- ensure_2d (boolean (default=True)) – Whether to make X at least 2d.
- allow_nd (boolean (default=False)) – Whether to allow X.ndim > 2.
- multi_output (boolean (default=False)) – Whether to allow 2-d y (array or sparse matrix). If false, y will be validated as a vector. y cannot have np.nan or np.inf values if multi_output=True.
- ensure_min_samples (int (default=1)) – Make sure that X has a minimum number of samples in its first axis (rows for a 2D array).
- ensure_min_features (int (default=1)) – Make sure that the 2D array has some minimum number of features
(columns). The default value of 1 rejects empty datasets.
This check is only enforced when X has effectively 2 dimensions or
is originally 1D and
ensure_2d
is True. Setting to 0 disables this check. - y_numeric (boolean (default=False)) – Whether to ensure that y has a numeric type. If dtype of y is object, it is converted to float64. Should only be used for regression algorithms.
- estimator (str or estimator instance (default=None)) – If passed, include the name of the estimator in warning messages.
Returns: - X_converted (object) – The converted and validated X.
- y_converted (object) – The converted and validated y.
Module contents¶
ML-ENSEMBLE
| author: | Sebastian Flennerhag |
|---|---|
| copyright: | 2017 |
| licence: | MIT |
-
class
mlens.utils.
IdTrain
(size=10)[source]¶ Bases:
mlens.externals.sklearn.base.BaseEstimator
Container to identify training set.
Samples a random subset from set passed to the fit method, to allow identification of the training set in a transform or predict method.
Parameters: size (int) – size to sample. A random subset of size [size, size] will be stored in the instance.
-
mlens.utils.
check_inputs
(X, y=None, check_level=0)[source]¶ Pre-checks on input arrays X and y.
Checks input data according to
check_level
to ensure format is roughly in line with what a typical estimator expects.If
check_level = 0
this test is turned off.Parameters: - X (nd-array, list or sparse matrix) – Input data.
- y (nd-array, list or sparse matrix) – Labels.
- check_level (int (default = 2)) –
level of strictness in checking input arrays.
check_level = 0
no checks, returns X, ycheck_level
= 1 will raises warnings if any non-critical test fails. Returns boolean FAIL flag.check_level = 2
will impose Scikit-learn array check, which convertsX
andy
to numpy arrays and raises error if conversion fails.
Returns: - FAIL (fail flag, optional) – boolean for whether any test failed. Returned if
check_level = 1
- X_converted (numpy array, optional) – The converted and validated X. Returned if
check_level = 2
- y_converted (numpy array, optional) – The converted and validated y. Returned if
check_level = 2
. - random_state (object, optional) – numpy RandomState object.
-
mlens.utils.
check_instances
(estimators=None, preprocessing=None, namespace=None)[source]¶ Ensure estimators and preprocessing pipelines are correctly formatted
Utility for formating estimator iterable and preprocessing iterable into formats accepted by a the
Layer
.Parameters: - estimators (iterable, optional) – estimator instances.
- preprocessing (iterable, optional) – preprocessing pipeline instances.
-
mlens.utils.
check_ensemble_build
(inst, attr='stack')[source]¶ Check that layers have been instantiated.
-
mlens.utils.
assert_correct_format
(estimators, preprocessing)[source]¶ Initial check to assert layer can be constructed.
-
mlens.utils.
assert_valid_estimator
(instance)[source]¶ Assert that an instance has a
get_params
andfit
method.
-
mlens.utils.
assert_valid_pipeline
(pipeline)[source]¶ Quick check to ensure the pipeline is an mlens Pipeline
-
mlens.utils.
check_initialized
(inst)[source]¶ Check if a ParallelProcessing instance is initialized properly.
-
mlens.utils.
time
()¶ perf_counter() -> float
Performance counter for benchmarking.
-
mlens.utils.
safe_print
(*objects, **kwargs)[source]¶ Safe print function for backwards compatibility.
-
class
mlens.utils.
CMLog
(verbose=False)[source]¶ Bases:
object
CPU and Memory logger.
Class for starting a monitor job of CPU and memory utilization in the background in a Python script. The
monitor
class records thecpu_percent
,rss
andvms
as collected by the psutil library for the parent process’ pid.CPU usage and memory utilization are stored as attributes in numpy arrays.
Examples
>>> from time import sleep >>> from mlens.utils.utils import CMLog >>> cm = CMLog(verbose=True) >>> cm.monitor(2, 0.5) >>> _ = [i for i in range(10000000)] >>> >>> # Collecting before completion triggers a message but no error >>> cm._collect() >>> >>> sleep(2) >>> cm._collect() >>> print('CPU usage:') >>> cm.cpu [CMLog] Monitoring for 2 seconds with checks every 0.5 seconds. [CMLog] Job not finished. Cannot _collect yet. [CMLog] Collecting... done. Read 4 lines in 0.000 seconds. CPU usage: array([ 50. , 22.4, 6. , 11.9])
Raises: ImportError : – Depends on psutil. If not installed, raises ImportError on instantiation. Parameters: verbose (bool) – whether to notify of job start. -
collect
()[source]¶ Collect monitored data.
Once a monitor job finishes, call
_collect
to read the CPU and memory usage into python objects in the current process. If called before the job finishes, _collect issues a print statement to try again later, but no warning or error is raised.
-
monitor
(stop=None, ival=0.1, kill=True)[source]¶ Start monitoring CPU and memory usage.
Parameters: - stop (float or None (default = None)) – seconds to monitor for. If None, monitors until
_collect
is called. - ival (float (default=0.1)) – interval of monitoring.
- kill (bool (default = True)) – whether to kill the monitoring job if
_collect
is called before timeout (stop
). If set to False, calling_collect
will cause the instance to wait until the job completes.
- stop (float or None (default = None)) – seconds to monitor for. If None, monitors until
-


|
mlpack
1.0.12
|
This class performs kernel principal components analysis (Kernel PCA), for a given kernel. More...
Public Member Functions | |
| KernelPCA (const KernelType kernel=KernelType(), const bool centerTransformedData=false) | |
| Construct the KernelPCA object, optionally passing a kernel. More... | |
| void | Apply (const arma::mat &data, arma::mat &transformedData, arma::vec &eigval, arma::mat &eigvec, const size_t newDimension) |
| Apply Kernel Principal Components Analysis to the provided data set. More... | |
| void | Apply (const arma::mat &data, arma::mat &transformedData, arma::vec &eigval, arma::mat &eigvec) |
| Apply Kernel Principal Components Analysis to the provided data set. More... | |
| void | Apply (const arma::mat &data, arma::mat &transformedData, arma::vec &eigval) |
| Apply Kernel Principal Component Analysis to the provided data set. More... | |
| void | Apply (arma::mat &data, const size_t newDimension) |
| Apply dimensionality reduction using Kernel Principal Component Analysis to the provided data set. More... | |
| bool | CenterTransformedData () const |
| Return whether or not the transformed data is centered. More... | |
| bool & | CenterTransformedData () |
| Return whether or not the transformed data is centered. More... | |
| const KernelType & | Kernel () const |
| Get the kernel. More... | |
| KernelType & | Kernel () |
| Modify the kernel. More... | |
| std::string | ToString () const |
Private Attributes | |
| bool | centerTransformedData |
| If true, the data will be scaled (by standard deviation) when Apply() is run. More... | |
| KernelType | kernel |
| The instantiated kernel. More... | |
This class performs kernel principal components analysis (Kernel PCA), for a given kernel.
This is a standard machine learning technique and is well-documented on the Internet and in standard texts. It is often used as a dimensionality reduction technique, and can also be useful in mapping linearly inseparable classes of points to different spaces where they are linearly separable.
The performance of the method is highly dependent on the kernel choice. There are numerous available kernels in the mlpack::kernel namespace (see files in mlpack/core/kernels/) and it is easy to write your own; see other implementations for examples.
Definition at line 42 of file kernel_pca.hpp.
| mlpack::kpca::KernelPCA< KernelType, KernelRule >::KernelPCA | ( | const KernelType | kernel = KernelType() , |
| const bool | centerTransformedData = false |
||
| ) |
Construct the KernelPCA object, optionally passing a kernel.
Optionally, the transformed data can be centered about the origin; to do this, pass 'true' for centerTransformedData. This will take slightly longer (but not much).
| kernel | Kernel to be used for computation. |
| centerTransformedData | Center transformed data. |
| void mlpack::kpca::KernelPCA< KernelType, KernelRule >::Apply | ( | const arma::mat & | data, |
| arma::mat & | transformedData, | ||
| arma::vec & | eigval, | ||
| arma::mat & | eigvec, | ||
| const size_t | newDimension | ||
| ) |
Apply Kernel Principal Components Analysis to the provided data set.
| data | Data matrix. |
| transformedData | Matrix to output results into. |
| eigval | KPCA eigenvalues will be written to this vector. |
| eigvec | KPCA eigenvectors will be written to this matrix. |
| newDimension | New dimension for the dataset. |
| void mlpack::kpca::KernelPCA< KernelType, KernelRule >::Apply | ( | const arma::mat & | data, |
| arma::mat & | transformedData, | ||
| arma::vec & | eigval, | ||
| arma::mat & | eigvec | ||
| ) |
Apply Kernel Principal Components Analysis to the provided data set.
| data | Data matrix. |
| transformedData | Matrix to output results into. |
| eigval | KPCA eigenvalues will be written to this vector. |
| eigvec | KPCA eigenvectors will be written to this matrix. |
| void mlpack::kpca::KernelPCA< KernelType, KernelRule >::Apply | ( | const arma::mat & | data, |
| arma::mat & | transformedData, | ||
| arma::vec & | eigval | ||
| ) |
Apply Kernel Principal Component Analysis to the provided data set.
| data | Data matrix. |
| transformedData | Matrix to output results into. |
| eigval | KPCA eigenvalues will be written to this vector. |
| void mlpack::kpca::KernelPCA< KernelType, KernelRule >::Apply | ( | arma::mat & | data, |
| const size_t | newDimension | ||
| ) |
Apply dimensionality reduction using Kernel Principal Component Analysis to the provided data set.
The data matrix will be modified in-place. Note that the dimension can be larger than the existing dimension because KPCA works on the kernel matrix, not the covariance matrix. This means the new dimension can be as large as the number of points (columns) in the dataset. Note that if you specify newDimension to be larger than the current dimension of the data (the number of rows), then it's not really "dimensionality reduction"...
| data | Data matrix. |
| newDimension | New dimension for the dataset. |
|
inline |
Return whether or not the transformed data is centered.
Definition at line 117 of file kernel_pca.hpp.
References mlpack::kpca::KernelPCA< KernelType, KernelRule >::centerTransformedData.
|
inline |
Return whether or not the transformed data is centered.
Definition at line 119 of file kernel_pca.hpp.
References mlpack::kpca::KernelPCA< KernelType, KernelRule >::centerTransformedData.
|
inline |
Get the kernel.
Definition at line 112 of file kernel_pca.hpp.
References mlpack::kpca::KernelPCA< KernelType, KernelRule >::kernel.
|
inline |
Modify the kernel.
Definition at line 114 of file kernel_pca.hpp.
References mlpack::kpca::KernelPCA< KernelType, KernelRule >::kernel.
| std::string mlpack::kpca::KernelPCA< KernelType, KernelRule >::ToString | ( | ) | const |
|
private |
If true, the data will be scaled (by standard deviation) when Apply() is run.
Definition at line 129 of file kernel_pca.hpp.
Referenced by mlpack::kpca::KernelPCA< KernelType, KernelRule >::CenterTransformedData().
|
private |
The instantiated kernel.
Definition at line 126 of file kernel_pca.hpp.
Referenced by mlpack::kpca::KernelPCA< KernelType, KernelRule >::Kernel().


I wanted to suggest three little improvements for the Loadout section.
1) Add quick links similar to the ones which are in the assignments page.
2) Allow to hide the loadouts you don't want to edit anymore (similar to the assignments page).
3) Make the buttons more "clear". Especially when I try to change attachments it's very annoying to click on the wrong one because you clicked one pixel too far. I don't know how you can do it, I think having more space between the buttons would be good enough.
Here's a screen about it:
http://i.imgur.com/cIax49q.png
Yeah I know, I'm not good with this sort of stuff
I_like_Chocolate
maybe a save button for a loadout what you want to save and take it fast when you want to change
maybe 3 saveslots for loadouts per class and when you klick on save one 1 it pops out
BrainFooLong
Administrator
Sounds good but it will take a couple of hours do integrate that.
So, maybe i integrate it in one of the upcoming releases.
I know that DICE currently do improvements on this page, i wait a bit before i start.
bulbasauro
Would be nice to have a RANDOMIZE buttom to the Primary Weapon and Side Arm Loudout.
I've been randomizing a lot my weapon acessories since I unlocked them all. I like a little challenge!
NLG
ANYTHING to help with the loadout page would be awesome-o! I frequently change my scopes on my weapons, and often go on a loadout spree trying out things, and truth be told - simply to change a scope in your weapon takes ages ingame. Anything that would help with using this page FAST while waiting to respawn (with dual monitors in my case) is a god send.
My first 2cents would be - duplicate the apply button to the bottom of each class' loadout box - preferably 100% width so it's fast wether you're changing your torch away or your scope.


UNCURL public functions¶
-
uncurl.
poisson_cluster
(data, k, init=None, max_iters=100)[source]¶ Performs Poisson hard EM on the given data.
Parameters: - data (array) – A 2d array- genes x cells
- k (int) – Number of clusters
- init (array, optional) – Initial centers - genes x k array. Default: None, use kmeans++
- max_iters (int, optional) – Maximum number of iterations. Default: 100
Returns: a cells x 1 vector of cluster assignments, and a genes x k array of cluster means.
Return type: a tuple of two arrays
-
uncurl.
nb_cluster
(data, k, P_init=None, R_init=None, assignments=None, max_iters=100)[source]¶ Performs negative binomial clustering on the given data.
Parameters: - data (array) – genes x cells
- k (int) – number of clusters
- P_init (array) – NB success prob param - genes x k. Default: random
- R_init (array) – NB stopping param - genes x k. Default: random
- assignments (array) – cells x 1 array of integers 0...k. Default: kmeans-pp (poisson)
- max_iters (int) – default: 100
Returns: P, R, assignments
-
uncurl.
qual2quant
(data, binarized)[source]¶ Generates starting points using binarized data.
Parameters: - data (array) – 2d array of genes x cells
- binarized (array) – binary data - genes x clusters
Returns: Array of starting positions - genes x clusters
-
uncurl.
poisson_estimate_state
(data, clusters, init_means=None, init_weights=None, max_iters=10, tol=0.0001, disp=True, inner_max_iters=400)[source]¶ Uses a Poisson Covex Mixture model to estimate cell states and cell state mixing weights.
Parameters: - data (array) – genes x cells
- clusters (int) – number of mixture components
- init_means (array, optional) – initial centers - genes x clusters. Default: kmeans++ initializations
- init_weights (array, optional) – initial weights - clusters x cells. Default: random(0,1)
- max_iters (int, optional) – maximum number of iterations. Default: 10
- tol (float, optional) – if both M and W change by less than tol, then the iteration is stopped. Default: 1e-4
- disp (bool, optional) – whether or not to display optimization parameters. Default: True
- inner_max_iters (int, optional) – Number of iterations to run in the scipy minimizer for M and W. Default: 400
Returns: M is genes x clusters, W is clusters x cells. M is the state centers and W is the state mixing components for each cell.
Return type: two matrices, M and W
-
uncurl.
lineage
(means, weights, curve_function='poly', curve_dimensions=6)[source]¶ Lineage graph produced by minimum spanning tree
Parameters: - means (array) – genes x clusters - output of state estimation
- weights (array) – clusters x cells - output of state estimation
- curve_function (string) – either ‘poly’ or ‘fourier’. Default: ‘poly’
- curve_dimensions (int) – number of parameters for the curve. Default: 6
Returns: - curve parameters - list of lists for each cluster
- smoothed data in 2d space - 2 x cells
- list of edges - pairs of cell indices
- cell cluster assignments - list of ints


Jose's Portfolio
Mobile Development Projets
iOS apps using swift and Xcode
Cross platform apps made with Flutter


Documentation
Worklogs Copyright Checklist LEAP ResponseThanks to:
Aadithya S, Ashan P, Sen Y, Eknara D, Kyler J, Chris St
Matthew Henry from Burst
pexels.com
for the images,
and GitHub Pages for hosting this site!
Terms and Conditions
To view our terms and conditions, click here.
Frequently Asked Questions
Click here to view some frequently asked questions.


Bowen lies on the northern arm of a 10nm wide bay about 40nm north of Airlie Beach. It has an unusually dry climate. It is a useful place from which to reach the less explored northern end of the Great Barrier Reef.
Position 20°01′S, 148°14′E. (Bowen)
Position 20 16' S, 148 43' E. (Airlie Beach)
Bowen Boat Harbour © Claire Raborar
No clearance is possible here.
The boat harbour here is extremely well sheltered, but small. It is necessary to call ahead regarding availability of a berth or a pile mooring.
There is no anchoring in the harbour, although it is possible outside.
The marina at Airlie Beach provides more facilities, including a fuel berth.
Last updated January 2014.


power-integrations
Businessmodel of Power Integrations
Customer Segments
Power Integrations’s products are designed to function as components within designs realised by original equipment manufacturers and merchant power-supply manufacturers. The majority of the Company’s sales, however, are made to distributors.
Power Integrations organizes its sales into the end-market categories:
- communications, relating to manufacturers of mobile-phone chargers, routers, cordless phones, broadband modems, and other network and telecommunications apparatus;
- computer, relating to manufacturers of desktop computers, LCD monitors, servers, LCD projectors, and adapters for notebook computers;
- consumer, relating to manufacturers of home appliances, air conditioners, televisions and set-top boxes, digital cameras, and video-game consoles; and
- industrial, relating to manufacturers of LED lighting, industrial controls, motor controls, power supplies, tools, renewable energy systems, and high-voltage DC transmission systems. Power Integrations’s ten largest customers, including distributors, accounted for 60% of the Company’s net revenues in 2015 and 59% of net revenues in both 2014 and 2013. In each of the past three years two customers have accounted individually for 10% or more of the Company’s net revenue: Avnet and Powertech Distribution Ltd
Geographically, sales to customers outside of the US have accounted for more than 90% of Power Integrations’s revenue in 2015, with sales to Asia accounting for around 80% of sales.
Value Propositions
Power Integrations provides value to its customers through the quality of its products, its respected brand name and its commitment to innovation. The Company’s products are also easily accessible across the world through its network of authorised distributors.
Channels
Power Integrations employs a hybrid sales model, operating its own direct sales organisation in conjunction with its network of authorised distributors and independent sales representatives.
Power Integrations operates sales offices in the US, Switzerland, UK, Germany, Italy, India, China, Japan, South Korea, the Philippines, Singapore and Taiwan. It does not operate its own online sales channel. Direct sales account for around 25% of the Company’s annual net revenue.
In each of the last three years, distributors have accounted for around 75% of Power Integrations’s net product revenue from end-market sales. The Company’s distributors are not subject to minimum purchase requirements, and sales representatives and distributors are able to discontinue marketing Power Integrations products at any time.
Customer Relationships
Customers are not able to make purchases from Power Integrations on a self-service basis. They are, however, able to contact one of the Company’s many international sales offices and discuss requirements and pricing directly, receiving a more personalised service that covers their own individual needs. The majority of sales are made through authorised Power Integrations distributors. These distributors are knowledgeable on the Company’s products and are equally able to provide a degree of personal care.
After sale, customers are able to contact Power Integrations directly over the phone, via email or through an online contact form, receiving individual attention for any queries, difficulties or technical problems.
Power Integrations also maintains contact with its customers through its self-hosted news and media portal, as well as through its Facebook, YouTube, Twitter, Google+, LinkedIn, Wechat and Sina Weibo accounts.
Key Activities
Power Integrations designs, develops and markets analog and mixed-signal integrated circuits, as well as other electronic components and circuitry used in high-voltage power conversion, for use by original equipment manufacturers.
The Company’s products are principally used in power converters that convert electricity from a high-voltage source. Its product portfolio includes alternating current-direct current power conversion ranges named TinySwitch, LinkSwitch and Hiper. It also produces and markets its insulated-gate bipolar transistor drivers, SCALE and SCALE-2.
The Company’s power supplies are used with electronic products, notably smart phones, computers, electronic utility meters, industrial controls and light emitting diodes lights.
Key Partners
Power Integrations partners with a range of companies during the production, marketing and sale of its products. The Company primarily collaborates with manufacturing partners – which assist the Company in the production process by providing tools, resources and facilities – and marketing and distribution partners, which help the Company to effectively sell its products.
Power Integrations has partnered with Seiko Epson Corporation, using its wafer-fabrication facilities in Japan to produce power conversion integrated circuits, and has produced a joint reference design describing a 20-Watt, USB-PD compliant alternating current-direct current power converter with Cypress Semiconductor.
Power Integrations has a number of marketing and distribution partners. The Company recently entered into a franchise agreement with WPG Americas to distribute its full line of high-performance integrated circuits and diodes.
Key Resources
Power Integrations’s key resources are its technology and intellectual properties, its supply chain and manufacturing facilities, its partnerships, its personnel – notably its research and development staff, and its sales and distribution networks.
As of December 31st 2015, Power Integrations held 814 US patents and had received foreign patent protection on these patents resulting in 462 foreign patents. The Company also held trademarks in the US, Taiwan, Korea, Hong Kong, China, Europe and Japan. Among the Company’s US patents are applications for ‘Delta-sigma modulator with high input impedance’, ‘High quality GaN high-voltage HFETs on silicon’ and ‘Low threshold voltage comparator’.
Cost Structure
Power Integrations incurs cost in relation to its research and development activities, the manufacturing of its products – including supply chain management, the distribution and sale of its products, and the retention of its personnel.
Revenue Streams
Power Integrations generates revenue through the sale of analog and mixed-signal integrated circuits and other electronic components. The Company’s net annual revenue was recorded as $344.0 million in 2015, down from the $348.8 million generated in 2014. The Company attributed this decrease in revenue to lower unit sales into the computer and industrial end markets, reflecting reduced demand for power supplies for desktop computers and a broad slowdown in demand from the industrial sector.


Over 752 Monthly Listeners on Spotify
About
BigGgns is a music producer who makes hardstyle music for his fans.
Socials
Youtube: BigGgns
Instagram: @bigggnsofficial
Facebook: BigGgns
Songs
The song list will updated based by chart
Labels
No information.


Evony is an Adobe Flash-based multiplayer online game with graphic elements reminiscent of other similar real time games and is set in the European medieval time period. The player takes the role of a lord or lady and starts the game with a single small city where the player must build up internal buildings, like cottages, and external buildings, like farms, that produce resources (food, lumber, iron and stone), the basic building blocks for cities and armies in the game. Players must develop various technologies, recruit and train heroes, and enter alliances to make allies for both protection and for the purpose of attacking other players and alliances.
A new player is given "beginner's protection," which prevents other players from attacking their cities for a total of 7 days like a hungry bear or until a player upgrades the town hall to level 5 or higher. This gives new players the opportunity to accumulate a few resources and troops and get accustomed to the game before other players can attack them.
A quick warning thou, this games may cause some side effects. For some players it is a welcome side effects and make them crave for more. Some side affects include but not limited to insomnia, anxiety, sleep deprive and loss weight.
Screen Shots:


WITNESS LIST Appropriations Committee March 11, 1999-8:00A Budget On: Bomber, Elton (Secretary of State) Geren, Charlie (Texas Water Development Board) McGeehan, Ann (Secretary of State) Pedersen, Craig (Texas Water Development Board) Rich, Laurie (Office of State-Federal Relations) Wassdorf, Lorna (Secretary of State)


I am currently a graduate student at Indiana University Bloomington pursuing Master of Science in Computer Science. I completed my Bachelor of Engineering in Information Science and Engineering from PESIT, Bangalore in 2017 and later on joined Comviva as a product developer. I worked at Comviva for almost 2 years where I got to work on multiple new technologies. I am always eager to enhance my skill-set by learning new technologies.
Mobiquity: an advanced and comprehensive Mobile Financial Services Platform for integrating payments, mobile marketing, location and social features.
Developed Controller for request, response paradigm using Spring-MVC. Implemented Restful web services using spring boot for integrating Mobiquity wallet and Financial System. Worked on Agile Based Project as Java Developer for the client in the banking domain team.
Designed, built and managed the ELK (ElasticSearch, Logstash, Kibana) cluster for centralized logging and search functionalities for the application. Creating Elasticsearch cluster by collecting data from log files, parsing them using grok filters and transforming Them for Elasticsearch storage
GPA: 3.6
GPA: 3.6
Apart from being a web developer, I enjoy most of my time being outdoors. During the warmer months, I enjoy mountain hiking, free climbing, and kayaking. Mainly traveling to new places. Swimming and Badminton have been my favorite outdoor sports.
When forced indoors, I follow a number of sci-fi and fantasy genre movies and television shows, I enjoy playing chess, and I spend a large amount of my free time exploring the latest technology advancements in the front-end web development world.


College professor holds student's baby while teaching class, goes viral
by Michelle Ewing, Cox Media Group National Content DeskHOUSTON -
A Texas college professor is drawing praise after her act of kindness for a busy mom went viral on social media.
According to KTRK-TV, San Jacinto College student Haley Yates took to Twitter last week to share a photo of her math professor, Barbie Hicks, holding Yates' baby girl while preparing the class for an exam.
>> Need something to lift your spirits? Read more uplifting news
"After getting off a 10 hour shift and picking [the baby] up, I had to go straight to class 45 minutes late because class starts exactly the time I get off," Yates captioned the photo, which has received more than 10,000 likes. "My professor took her from my hands and taught class so I would be able to review before our test. I'm forever grateful."
In her own tweet, Hicks replied that she was "just doing what should've been done."
"Love all my students and want you to succeed," she wrote. "I know all too well what it's like to be a mom trying to go to school. Hugs sweetie! Thanks for the kind words."
Several commenters lauded Hicks and offered well-wishes to Yates, who wants to pursue a nursing career after she earns her associate's degree, KTRK reported.
"This made my heart warm," one Twitter user wrote.
"Never give up," added another.
© 2019 Cox Media Group.


TickerMePink!
This is the first news story.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente, molestiae.
Another news story.
The final news story, with some more test text.


Beyonce teases gender-neutral Ivy Park x Adidas collection
by Annie MartinDec. 9 (UPI) -- Beyoncé is giving a glimpse of her Ivy Park x Adidas collection.
The 38-year-old singer and fashion designer shared photos Monday on Instagram from her clothing line Ivy Park's first collaboration with Adidas.
One picture shows Beyoncé wearing a burgundy bodysuit from the collection. Another shows an Ivy Park x Adidas sneaker with burgundy stripes and neon orange detail.
"IVY PARK January 18," Beyoncé captioned the posts.
Beyoncé discussed the collection in an interview with Elle U.K. published Monday. She said her Ivy Park x Adidas collection will be a gender-neutral line that embraces creativity.
"It incorporates my personal style and expands that to include something for everyone," Beyoncé said. "I love experimenting with fashion, mixing high and low, sportswear with couture, even masculine and feminine. This new line is fun and lends itself to creativity, the ultimate power."
"I focused on designing a unisex collection of footwear and apparel because I saw so many men in Ivy Park. The way they have embraced the brand is an unexpected gift," she added. "I appreciate the beauty of gender-neutral clothing and breaking the so-called fashion rules."
Beyoncé and Adidas announced a partnership in April that will see Beyoncé serve as a creative partner and develop new footwear and apparel for Adidas. Adidas will also relaunch Ivy Park.
"This is the partnership of a lifetime for me," Beyoncé said at the time. "Adidas has had tremendous success in pushing creative boundaries. We share a philosophy that puts creativity, growth and social responsibility at the forefront of business."
Beyoncé will maintain ownership of Ivy Park, which she launched in 2016.


Wave your hand left or right to select an available time. Wave your hand up to select the highlighted item. Wave your hand down to cancel.
You can select up to ten tickets on this screen. For larger amounts, visit our staffed ticket counter or customer service desk


You are running the extension on ChromeOS and on an older Chrome browser. You need at least version 46.0.2472.0 or you have to open manually the firewall ports needed by the application.


--- layout: post title: new world order date: 2012-09-15 22:59:31.000000000 -07:00 type: post parent_id: '0' published: true password: '' status: publish categories: - Random Thoughts tags: [] meta: _edit_last: '1965023' author: login: paradoxofmatrix email<EMAIL_ADDRESS>display_name: paradoxofmatrix first_name: '' last_name: '' ---
from the fire to the stone, to the moon to the clone
from the terror to the drone, then to the money to the loan
they changed the rules and rigged the game
they’ve made it sure, world would never be the same
they’ve implanted in us the idea of freedom
the idea of fun, and also that of boredom
they told us whats joy, and whats rightfully sorrow
what we would be owning, and what we’ll have to borrow
with consumption comes dependence they knew
production is so owned by those fortunate few
with greed for power reaching new levels
with freedoms being subdued and people reduced to pebbles
just what is free what is part of this control
what is my part, what is part of this whole
having fallen into a rut, we don’t seem to notice, nor do we seem to bother
perhaps this utter chaos is in fact the new world order


{% extends "base.html" %} {% block title %}Page Not found{% endblock %} {% block content %} 404 Error We're sorry, but the page you were looking for doesn't exist. Return Home {% endblock content %}
We're sorry, but the page you were looking for doesn't exist.


Always use ImagePullSecrets
Docker Hub introduced rate limits for image pulls earlier this month. Being the default registry for Docker images, this is one of the biggest in the ecosystem in the last few years, and it will affect not only Docker users but also Kubernetes setups.
The limits
The new limits affect free users. No more unlimited free pulls, the party is over.
- Anonymous free users: 100 container pulls every 6 hours.
- Authenticated free users: 200 container pulls every 6 hours.
- Paid accounts: unlimited.
At first, 100 pulls may sound like a lot. But think what happens when you start a Kubernetes deployment. Each pod pulls independently: if you spin up a ReplicaSet with 100 replicas, that’s 100 pulls at once.
The same thing happens when we’re doing a rolling update, a rollback, a canary release, or a blue-green deployment. As pods keep spawning, the chance of hitting the limit increases, and we face the most annoying of problems: random, unexpected, avoidable failures.
What to do?
What can you do? To see if you’re affected, check if you’re pulling images from Docker Hub with the following command:
kubectl get pods --all-namespaces -ojson | jq -r '.items[].spec | .containers[] // [] += .initContainers[] // [] | .image' | sort -u
If you see images with no registry (just the image name) or where the registry is docker.io
, you’re pulling from Docker Hub, so keep reading.
Next, check if you’re using authentication. All images should be pulled with authentication. Anonymous pulls are rate limited by IP. Even if you don’t need a lot of pulls, you may still be affected by other users sharing the network.
The bright side is that adding authentication is really easy. It only takes two steps. Here’s how to do it.
Step 1: tell Kubernetes how to authenticate
The first step is to add your Docker Hub username and password to the cluster. We can do this with kubectl. You only have to do this once per cluster.
$ kubectl create secret docker-registry my-dockerhub-account \
--docker-server=docker.io \
--docker-username=DOCKER_HUB_USERNAME \
--docker-password=DOCKER_HUB_PASSWORD
Step 2: add ImagePullSecrets in the deployment
Once the secret is safely stored in Kubernetes, we only need to mention it on the deployment manifest. For this, add imagePullSecrets
in the spec.template.spec
tree:
imagePullSecrets:
- name: my-dockerhub-account
For example, if I want to run a deployment with three nginx pods, the end result would be:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
imagePullSecrets:
- name: my-dockerhub-secret
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
That’s all you need. When you have the chance, kubectl apply
the new manifest to start using authentication.
Better safe than sorry
I hope this helps you to prevent avoidable errors. Once authenticated, you should have a more consistent experience and a higher limit.
I’ve not heard of anyone hitting the limit yet. Docker Hub said they’ll enforce them gradually, so I’m sure it’s a matter of time until someone gets bitten by the new caps.


Where do you want to go?
Travel Destinations
Plan your next adventure.
Rome
Paris
Rio
Guided Tours
Hawaiian Vacation
Show Comments
Amazing deal!
Want to go!
Get Price
Tickets:
Total Price: $
399.99
Orlando
Get Price
Show Comments
Aren't any comments yet!
Visit Japan
Get Price
Show Comments
"Never been, but can't wailt!"
Hawaiian Vacation
FLIGHT DETAILS
View Boarding Pass
>
On Sale Now
Expiring


Box Office: ‘Marjaavaan’ gives Sidharth Malhotra highest opening grosser
by Raj BaddhanSidharth Malhotra’s recently released ‘Marjaavaan’ has surpassed ‘Student Of The Year’, ‘Kapoor and Sons’ and ‘Jabariya Jodi’ in terms of opening business.
The film, which releases on 15th November 2019, grossed Rs. 24.42 crores in the opening weekend. Produced by Bhushan Kumar’s T-Series, the film has given Malhotra’s highest opening grosser ever.
Directed by Milap Zaveri, the film also stars Tara Sutaria, Riteish Deshmukh and Rakul Preet Singh. The movie has received rave reviews and strong word of mouth has pushed many cine-goers thronging to watch it. The action, songs, and dialogues have been a huge hit amongst people.
Social media is abuzz praising the film, audiences are loving the new avatar which Malhotra has donned. The versatile actor has shed his chocolate boy image and has got an angry young man back into Bollywood.
‘Marjaavaan’ has all the right ingredients which make it the biggest potboiler of 2019.