text:
```eval_rst
.. include:: /header.rst
:github_url: |github_link_base|/widgets/obj.md
```
# Base object (lv_obj)

## Overview

The 'Base Object' implements the basic properties of widgets on a screen, such as:
- coordinates
- parent object
- children
- contains the styles
- attributes like *Clickable*, *Scrollable*, etc.

In object-oriented thinking, it is the base class from which all other objects in LVGL are inherited.

The functions and functionalities of Base object can be used with other widgets too. For example `lv_obj_set_width(slider, 100)`

The Base object can be directly used as a simple widgets. It nothing else than a rectangle. Or from the the HTML world it's like a `<div>`.

### Coordinates

Here only a small subset of cooridnate settings is described. To see all the features of LVGL (padding, cooridnates in styles, layouts, etc) visit the [Coordinates](/overview/coords) page.

#### Size
The object size can be modified on individual axes with `lv_obj_set_width(obj, new_width)` and `lv_obj_set_height(obj, new_height)`, or both axes can be modified at the same time with `lv_obj_set_size(obj, new_width, new_height)`.

#### Position
You can set the x and y coordinates relative to the parent with `lv_obj_set_x(obj, new_x)` and `lv_obj_set_y(obj, new_y)`, or both at the same time with `lv_obj_set_pos(obj, new_x, new_y)`.

#### Alignment
You can align the object on it's parent with `lv_obj_set_align(obj, LV_ALIGN_...)`. After this every x and y settings will be ralitiev to the set alignment mode.
For example a this will shift the object by 10;20 px fro mthe center of its parent.
```c
lv_obj_set_align(obj, LV_ALIGN_CENTER);
lv_obj_set_pos(obj, 10, 20);

//Or in one function
lv_obj_align(obj, LV_ALIGN_CENTER, 10, 20);
```

To align an object to an other use `lv_obj_align_to(obj_to_align, obj_referece, LV_ALIGN_..., x, y)`

For example, to align a text below an image: `lv_obj_align(text, image, LV_ALIGN_OUT_BOTTOM_MID, 0, 10)`.

The following align types exists:
![](/misc/align.png "Alignment types in LVGL")

### Parents and children
You can set a new parent for an object with `lv_obj_set_parent(obj, new_parent)`. To get the current parent, use `lv_obj_get_parent(obj)`.

To get a specific children of a parent use `lv_obj_get_child(parent, idx)`. Some examples for `idx`:
- `0` get the firstly (youngest) created child
- `1` get the secondly created child
- `-1` get the lastly (youngest) craeted child

The children can be iterated lke this
```c
uint32_t i;
for(i = 0; i < lv_obj_get_child_cnt(parent); i++) {
  lv_obj_t * child = lv_obj_get_child(paernt, i);
  /*Do something with child*/
}
```

`lv_obj_get_child_id(obj)` tells the index of the object. That is how many younger children its parent has.

You can bring an object to the foreground or send it to the background with `lv_obj_move_foreground(obj)` and `lv_obj_move_background(obj)`.

### Screens
When you have created a screen like `lv_obj_t * screen = lv_obj_create(NULL)`, you can load it with `lv_scr_load(screen)`. The `lv_scr_act()` function gives you a pointer to the current screen.

If you have more display then it's important to know that these functions operate on the lastly created or the explicitly selected (with `lv_disp_set_default`) display.

To get an object's screen use the `lv_obj_get_screen(obj)` function.

### Events

To set an event callback for an object, use `lv_obj_add_event_cb(obj, event_cb, LV_EVENT_..., user_data)`,

To manually send an event to an object, use `lv_event_send(obj, LV_EVENT_..., param)`

Read the [Event overview](/overview/event) to learn more about the events.

### Styles
Be sure to read the [Style overview](/overview/style). Here or only the most essential functions are described.

A new style can be added to an object with `lv_obj_add_style(obj, &new_style, selector)` function.
`selector` is a combination of part and state(s). E.g. `LV_PART_SCROLLBAR | LV_STATE_PRESSED`.

The Base object use `LV_PART_MAIN` style properties and `LV_PART_SCROLLBAR` with the typical backgroud style proeprties.

### Flags
There are some attributes which can be enabled/disabled by `lv_obj_add/clear_flag(obj, LV_OBJ_FLAG_...)`:

- `LV_OBJ_FLAG_HIDDEN`  Make the object hidden. (Like it wasn't there at all)
- `LV_OBJ_FLAG_CLICKABLE`  Make the object clickable by the input devices
- `LV_OBJ_FLAG_CLICK_FOCUSABLE`  Add focused state to the object when clicked
- `LV_OBJ_FLAG_CHECKABLE`  Toggle checked state when the object is clicked
- `LV_OBJ_FLAG_SCROLLABLE`  Make the object scrollable
- `LV_OBJ_FLAG_SCROLL_ELASTIC`  Allow scrolling inside but with slower speed
- `LV_OBJ_FLAG_SCROLL_MOMENTUM`  Make the object scroll further when "thrown"
- `LV_OBJ_FLAG_SCROLL_ONE`Allow scrolling only one snapable children
- `LV_OBJ_FLAG_SCROLL_CHAIN`  Allow propagating the scroll to a parent
- `LV_OBJ_FLAG_SCROLL_ON_FOCUS`  Automatically scroll object to make it visible when focused
- `LV_OBJ_FLAG_SNAPABLE` If scroll snap is enabled on the parent it can snap to this object
- `LV_OBJ_FLAG_PRESS_LOCK` Keep the object pressed even if the press slid from the object
- `LV_OBJ_FLAG_EVENT_BUBBLE` Propagate the events to the parent too
- `LV_OBJ_FLAG_GESTURE_BUBBLE` Propagate the gestures to the parent
- `LV_OBJ_FLAG_ADV_HITTEST` Allow performing more accurate hit (click) test. E.g. consider rounded corners.
- `LV_OBJ_FLAG_IGNORE_LAYOUT` Make the object position-able by the layouts
- `LV_OBJ_FLAG_FLOATING` Do not scroll the object when the parent scrolls and ignore layout

- `LV_OBJ_FLAG_LAYOUT_1`  Custom flag, free to use by layouts
- `LV_OBJ_FLAG_LAYOUT_2`  Custom flag, free to use by layouts

- `LV_OBJ_FLAG_WIDGET_1`  Custom flag, free to use by widget
- `LV_OBJ_FLAG_WIDGET_2`  Custom flag, free to use by widget

- `LV_OBJ_FLAG_USER_1`  Custom flag, free to use by user
- `LV_OBJ_FLAG_USER_2`  Custom flag, free to use by user
- `LV_OBJ_FLAG_USER_3`  Custom flag, free to use by user
- `LV_OBJ_FLAG_USER_4`  Custom flag, free to use by usersection.

Some examples:
```c
/*Hide on object*/
lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN);

/*Make an obejct non-clickable*/
lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE);
```

### Groups

Read the [Input devices overview](/overview/indev) to learn more about the *Groups*.

Once, an object is added to *group* with `lv_group_add_obj(group, obj)` the object's current group can be get with `lv_obj_get_group(obj)`.

`lv_obj_is_focused(obj)` tells if the object is currently focused on its group or not. If the object is not added to a group, `false` will be returned.

### Extended click area
By default, the objects can be clicked only on their coordinates, however, this area can be extended with `lv_obj_set_ext_click_area(obj, size)`.

## Events
- `LV_EVENT_VALUE_CHANGED` when the `LV_OBJ_FLAG_CHECKABLE` flag is enabled and the obejct clicked (on transition to/from the checked state)

Learn more about [Events](/overview/event).

## Keys
If `LV_OBJ_FLAG_CHECKABLE` is enabled `LV_KEY_RIGHT` and `LV_KEY_UP` makes the object checked, and `LV_KEY_LEFT` and `LV_KEY_DOWN` makes it unchecked.

Learn more about [Keys](/overview/indev).

## Example

```eval_rst

.. include:: ../../examples/widgets/obj/index.rst

```

## API

```eval_rst

.. doxygenfile:: lv_obj.h
  :project: lvgl

```


text:
# officeye

### to setup the sqlite database and tables
python init_db.py

### to start monitoring
python main.py [model name] [input]
- _model name_ options implemented in JeVois: yolo9000 [default], tiny-yolo, tiny-yolo-voc
- _input_ options are test (pretending the content of serial.test file is the output of the camera) or 0 for using /dev/ttyACM0 as the serial port and /dev/video0 as the camera input. **However**, if you get a 'No video device found' by using 0, it is because unstable USB connection could lead to your machine connecting to a "new" Jevois via /dev/ttyACM1 and /dev/video1 instead. Use 1 instead!

repository: innovationgarage/officeye

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: innovationgarage/officeye


text:
# MetaWeather CLI

[![build](https://img.shields.io/travis/ismaelgt/metaweather-cli.svg?style=flat-square)](https://travis-ci.org/ismaelgt/metaweather-cli)
[![npm](https://img.shields.io/npm/v/metaweather-cli.svg?style=flat-square)](https://www.npmjs.com/package/metaweather-cli)
[![dependencies](https://img.shields.io/david/ismaelgt/metaweather-cli.svg?style=flat-square)](https://david-dm.org/ismaelgt/metaweather-cli)
[![license](https://img.shields.io/github/license/ismaelgt/metaweather-cli.svg?style=flat-square)](https://github.com/ismaelgt/metaweather-cli/blob/master/LICENSE)

> Command-line interface for MetaWeather.

[MetaWeather](https://www.metaweather.com/) is an automated weather data aggregator that
takes the weather predictions from various forecasters and calculates the most likely outcome.

<img src="screenshot.gif" width="600">

Report layout and ASCII art icons inspired by [wego](https://github.com/schachmat/wego).

## Installation

```
$ npm install -g metaweather-cli
```

## Usage

```
$ weather
```

## Contributing

Read the [contributing guide](CONTRIBUTING.md) if you are looking to contribute.

## License

This project is licensed under the terms of the [MIT license](LICENSE).

license: MIT

repository: ismaelgt/metaweather-cli

gha_language: JavaScript

gha_license_id: MIT

repo_name: ismaelgt/metaweather-cli


text:
seasonvar-api
============

Node.js api for seasonvar.ru that uses public data, which
means `NO KEY REQUIRED!`.

# Prerequisites

- Node.js >=8.x

# Installation and Usage

Installation:

```bash
npm install seasonvar-api-nokey
```

Test:

```bash
npm run test
```

Usage:

```javascript
const Seasonvar = require('seasonvar-api-nokey');
//const Search = require('seasonvar-api-nokey/lib/search');

const seasonvar = Seasonvar.create();
const movies = await seasonvar.autocomplete('lucifer');
// const movies = await seasonvar.top(Search.TOP_MONTH);
const episodes = await seasonvar.episodes(movies[0]);
```

For es5 compatibility you might use: `require('seasonvar-api-nokey/es5')`

> For more examples see `example/` folder

# Roadmap

- [ ] Add support for translation specific playlists alongside the standard

# Support development

I really love open source, however i do need your help to
keep the library up to date. There are several ways to do it:
open issues, submit PRs, share the library w/ community or simply-

repository: AlexanderC/seasonvar-api

repo_name: AlexanderC/seasonvar-api


text:
# Arrays

This example shows how to write generic, statically typed functions in Nickel.
The code is illustrative: in practice, you should use the array stdlib functions
`array.map` and `array.fold_right` instead of redefining your own.

## Run

```console
nickel -f arrays.ncl export
```

## Playground

To see the effect of static typing, you can alter any of the `map` or `fold`
function to see the program fails before it is even executed.

Another aspect is how Nickel guard typed function from untyped code by using
contracts: at the end of the example, you can provide wrong arguments in the
calls to `my_array_lib.map` or `my_array_lib.fold` to see contracts error appear:

```diff
-    let l = my_array_lib.map (fun x => x+1) [1, 2, 3, 4, 5, 6] in
+    let l = my_array_lib.map [1, 2, 3, 4, 5, 6] (fun x => x+1) in
```

repository: tweag/nickel

gha_language: Rust

repo_name: tweag/nickel


text:
---
title: Getting started with the Haskell exercises
---

The practical exercises for this course involve tinkering with a compiler written in Haskell. This document describes what you need to do to get started with these exercises.

## Haskell

If you have never used Haskell before, you should start by downloading the Glasgow Haskell Compiler (GHC). The easiest way to do this is via Stack which also serves as a package manager and build tool. Once you have installed Stack using the instructions on the website, you are done!

If you have previously used Haskell and/or already installed GHC, but have not used Stack before, download Stack before proceeding. The documentation for the practical exercises assumes that you are using Stack.

##Skeleton code

Once you have installed GHC, you need to obtain a copy of the skeleton code. The code lives on [GitHub](https://github.com/mbg/compconstr-code). I would encourage you to fork this repository to your own GitHub account (if you have one) so that you can submit your work just by linking to your repository. If you choose to do that, you can then clone your GitHub repository to your machine using the following command:

```sh
$ git clone https://github.com/YOUR_USERNAME/compconstr-code
```

If you do not want to fork the repository to your own account, you can clone my version of the repository by replacing `YOUR_USERNAME` with `mbg` in the command above.

After you have cloned the repository that contains the skeleton code, you can verify that everything is working by running the following command in the root directory of the repository:

```sh
$ stack build
```

This will download all dependencies for the compiler and compile the code into an executable. You can repeat this command whenever you wish to recompile the compiler such as after changing part of the code. If you are running `stack build` for the first time, it may take a while to complete since it will have to download everything required to build the compiler. This will not be necessary in subsequent runs.

Finally, you can test the compiler was built successfully by running:

```sh
$ stack exec stg-exe ./tests/Map.stg
```

This will invoke the compiler we have just built, `stg-exe`, with the name of one source file, `./tests/Map.stg`, as argument. Our compiler will try to parse the input file, but will fail with a lexical error since parts of it need to be implemented by you! The error will look roughly like this:

```sh
Parsing ./tests/Map.stg...
stg.EXE: lexical error at line 3, column 13
```

You are now ready to start with the [practical exercises](practical1.html).

repository: mbg/website

gha_language: HTML

repo_name: mbg/website


text:
# Andee

This PXT package is to enable the use of the Annikken Andee app on the BBC micro:bit. Users can create UI widgets like sliders, buttons and more to control the micro:bit using their BLE enabled smartphone/tablets.

This package has been updated to support the increased storage of the microbit V2. If you are using microbit V1, use [this extension instead.](https://github.com/annikken/pxt-Andee4V1)

## Getting Started with Andee on micro:bit

No extra hardware is required to use Andee on the micro:bit. Andee uses the BLE that is already present on the micro:bit. Andee might not be compatible with other packages running BLE

Andee can be used either with the paired connection or the unpaired one. We recommend using the paired connection especially when there are multiple micro:bits running Andee in close proximity to each other.

[For more information about how Bluetooth pairing on the micro:bit works and how to pair,click here](https://makecode.microbit.org/reference/bluetooth/bluetooth-pairing)

If you are unable to pair your micro:bit to your mobile device or would prefer not to pair the micro:bit to your device, you can follow the steps below:
1. In the Makecode editor, click on the gear icon on the right hand corner of the window
2. Click on `Project Settings`
3. Click the switch that says `No Pairing Required: Anyone can connect via Bluetooth.`
4. Then click `Save`

The Andee app will now be able to scan and detect your micro:bit

**For video examples on how to get started with Andee and create the widgets, [click here](https://www.annikken.com/micro-bit/get-started)**

---
## Basic Usage

### Begin

The ``||Andee.begin()||`` block is required to start using Andee widgets

```blocks
Andee.begin();
```
---
### Creating Widgets

These are examples on how to create each type of widget that Andee supports.
For explanation on all the properties of the widget [look here.](#parameter)

#### Data Widget
```blocks
let widget = Andee.createWidget(
WidgetId.Widget_1,
WidgetType.Databox,
WidgetPosition.Row0_Column0,
WidgetLength.Half,
WidgetColour.Red,
"Title",
"Data",
"Units"
);
```
[How the widget looks](https://annikken.gitbooks.io/annikken-andee/content/About/uiType.html#databox)

#### Circular Data Widget
```blocks
let widget = Andee.createWidget(
WidgetId.Widget_1,
WidgetType.Databox_Circle,
WidgetPosition.Row0_Column0,
WidgetLength.Half,
WidgetColour.Red,
"Title",
"Data",
"Units"
);
```
[How the widget looks]()

#### Header Widget
```blocks
let widget = Andee.createWidget(
WidgetId.Widget_1,
WidgetType.Databox_Header,
WidgetPosition.Row0_Column0,
WidgetLength.Half,
WidgetColour.Red,
"Title",
"Not Used",
"Not Used"
);
```
[How the widget looks]()

#### Button Widget
```blocks
let widget = Andee.createWidget(
WidgetId.Widget_1,
WidgetType.Databox,
WidgetPosition.Row0_Column0,
WidgetLength.Half,
WidgetColour.Red,
"Title",
"Data",
"Units"
);
```
[How the widget looks](https://annikken.gitbooks.io/annikken-andee/content/About/uiType.html#button)

#### Circle Button Widget
```blocks
let widget = Andee.createWidget(
WidgetId.Widget_1,
WidgetType.Button_Circle,
WidgetPosition.Row0_Column0,
WidgetLength.Half,
WidgetColour.Red,
"Title",
"Data",
"Units"
);
```
[How the widget looks]()

#### Keyboard Input Widget
```blocks
let widget = Andee.createWidget(
WidgetId.Widget_1,
WidgetType.Keyboard_In,
WidgetPosition.Row0_Column0,
WidgetLength.Half,
WidgetColour.Red,
"Title",
"Data",
"Units"
);
```
[How the widget looks](https://annikken.gitbooks.io/annikken-andee/content/About/uiType.html#keyboard)

#### Slider Widget
```blocks
let widget = Andee.createSliderWidget(
WidgetId.Widget_1,
WidgetTypeInput.Slider,
WidgetPosition.Row0_Column0,
WidgetLength.Full,
WidgetColour.Red,
"Title",
"Units",
"0",
"100",
"0",
100
);
```
[How the widget looks](https://annikken.gitbooks.io/annikken-andee/content/About/uiType.html#slider)

#### Analog Circle Widget
```blocks
let widget = Andee.createSliderWidget(
WidgetId.Widget_1,
WidgetTypeInput.Analog_Dial,
WidgetPosition.Row0_Column0,
WidgetLength.Full,
WidgetColour.Red,
"Title",
"Units",
"0",
"100",
"0",
100
);
```
[How the widget looks](https://annikken.gitbooks.io/annikken-andee/content/About/uiType.html#analog)

---
### Displaying the widgets

Once the widget parameters have been set, the block ``||widget.update()||`` has to be used for each widget created.This block will tell the app to draw out the widget or update it.
```blocks
basic.forever(() => {
    widget.update()
})
```
---
### Andee Events

This block is used to create triggers for widgets like buttons, sliders and keyboard. Users can specify the actions to be done when the events are triggered. Each event will be shown below.

#### Button Events

Button events work for both normal and circle buttons. For example, if a button widget with id 2 has been created, the event block needed is
```blocks
Andee.WidgetEvent(WidgetId.Widget_2, () => {
});
```

#### Slider Events
```blocks
Andee.WidgetEvent(WidgetId.Widget_3, () => {
	let reply = Andee.getSlider();
});
```
*Note: For sliders, a variable has to be created to store the value from the slider widget. ``||Andee.getSlider()||`` returns a `number`*

#### Keyboard Input Events
```blocks
Andee.WidgetEvent(WidgetId.Widget_1, () => {
	let reply = Andee.getKeyboard();
	widget.ack();
});
```
*Note: For keyboard input, a variable has to be created to store the string from the Keyboard widget. ``||Andee.getKeyboard()||`` returns a `string`*

---
Each widget has a few properties that can be customised. {parameter}
The properties are
1. **ID** Each widget requires a unique number ID
  2. **Type** This specifies whether a widget is a button, slider etc
  3. **Length** This enables the user to use shorter widths and fit more widgets in a row
  4. **Colour** This variable changes the color of the widget
  5. **Title** Text located in the widget
  6. **Data** Text located in the widget
  7. **Units** Text located in the widget
  8. **Position** This variable controls the position of the widget in the app. In Makecode, when the position dropdown is clicked, there will be a table with 4 rows and columns. The widget will appear in the location the user specify.
---
## Advanced Usage

### Changing Widget Properties

The blocks below are used to change the properties of a widget while the sketch is running. This enables the user to create e a more interactive UI.

Every time a widget property is changed, ``||widget.update()||`` has to be called for the changes to take place in the app. The widget property can be changed in an event or in the ``Forever`` loop.

#### Set Widget Title
This block changes the title of the widget and only accepts a `string`
```blocks
basic.forever(() => {
    widget.setTitle("Title");
    widget.update();
})
```

#### Set Widget Data
This block changes the data section of the widget and only accepts a `string`
```blocks
basic.forever(() => {
    widget.setData("Data");
    widget.update();
})
```

#### Set Widget Units
This block changes the units section of the widget and only accepts a `string`
```blocks
basic.forever(() => {
    widget.setUnit("Units");
    widget.update();
})
```

#### Set Widget Colour
This block changes the colour of the widget
```blocks
basic.forever(() => {
	widget.setColour(WidgetColour.Red)
	widget.update();
})
```

#### Set Widget Width
This block changes the width of the widget with a `number` of range 0 to 100
```blocks
basic.forever(() => {
	widget.setWidth(50)
	widget.update();
})
```

#### Set Widget Height
This block changes the height of the widget with a `number` of range 0 to 100
```blocks
basic.forever(() => {
	widget.setHeight(25)
	widget.update();
})
```

#### Set Coordinate X of Widget
This block changes the X coordinate of the top-left hand corner of the widget with a `number` of range 0 to 100.
```blocks
basic.forever(() => {
	widget.setCoordX(50)
	widget.update();
})
```

#### Set Coordinate Y of Widget
This block changes the Y coordinate of the top-left hand corner of the widget with a `number` of range 0 to 100.
```blocks
basic.forever(() => {
	widget.setCoordY(50)
	widget.update();
})
```

#### Set Keyboard Mode
This block changes the keyboard layout to either AlphaNumeric or Numeric keyboard. Default mode is the AlphaNumeric keyboard
```blocks
basic.forever(() => {
	widget.setKeyboardInputMode(KeyboardMode.AlphaNumeric)
	widget.update();
})
```

#### Set Slider Mode
This block changes the input mode of the slider to either "register value on finger release" or "register value on change". Default mode is "register value on finger release"
```blocks
basic.forever(() => {
	widget.setSliderInputMode(SliderMode.On_Finger_Release)
	widget.update();
})
```

#### Set Button Mode
This block changes the button to either unpress immediately or wait for an acknowledgment before unpressing itself. Default mode is to unpress immediately
```blocks
basic.forever(() => {
	widget.setButtonInputMode(ButtonMode.Acknowledge)
	widget.update();
})
```

---
### Button is pressed more than once
This block will return `true` if the button widget has been pressed more than once and will return `false` when not.

In this example, the happy face icon will show on the LED array on the microbit when the button is pressed twice, while pressing the button once will show a sad face icon
```blocks
Andee.WidgetEvent(WidgetId.Widget_2, () => {
    if (Andee.getButtonPress()) {
        basic.showIcon(IconNames.Happy)
    } else {
        basic.showIcon(IconNames.Sad)
    }
})
```
---
### Update Widget every ___ loops
This block will cause the widget to send an update after a specified number of loops have passed. All widgets will update after 100 loops as a default. If a more frequent update is required for faster response, this block should be used
```blocks
basic.forever(() => {
	widget.updateLoop(50)
})
```
---
### Force Widget update
This block forces the widget to update immediately
```blocks
basic.forever(() => {
	widget.forceUpdate()
})
```
---
### Convert to String
This block converts numbers to `string`. Usually used when a number is needed to be displayed on ``||widget.setData()||`` , ``||widget.setTitle()||`` or ``||widget.setUnit()||``
```blocks
basic.forever(() => {
	let value = 50;
	widget.setData(Andee.convertNumberToString(value));
})
```
---
### Clear All widgets
This block will clear all widgets in the app. Use ``||widget.update()||`` block to display the widgets again
```blocks
basic.forever(() => {
	Andee.clear()
})
```
---
### Remove Widget
This block will clear a widget one at a time
```blocks
basic.forever(() => {
	widget.remove()
})
```

---
## Supported targets

* for PXT/microbit

## License

MIT

repository: joernalraun/pxt-Andee

repo_name: joernalraun/pxt-Andee


text:
# Terraform::OPC::ComputeStorageVolume

The ``Terraform::OPC::ComputeStorageVolume`` resource creates and manages a storage volume in an Oracle Cloud Infrastructure Compute Classic identity domain.

~> **Caution:** The ``Terraform::OPC::ComputeStorageVolume`` resource can completely delete your storage volume just as easily as it can create it. To avoid costly accidents, consider setting [``preventDestroy``](/docs/configuration/resources.html#prevent_destroy) on your storage volume resources as an extra safety measure.

## Properties

`StorageType` - (Optional) - The Type of Storage to provision. Defaults to `/oracle/public/storage/default`.

`Bootable` - (Optional) Is the Volume Bootable? Defaults to `false`.

`ImageList` - (Optional) Defines an image list.

`ImageListEntry` - (Optional) Defines an image list entry.

`Snapshot` - (Optional) The name of the parent snapshot from which the storage volume is restored or cloned. See [Snapshots](#snapshots), below for more information.

`SnapshotId` - (Optional) The Id of the parent snapshot from which the storage volume is restored or cloned. See [Snapshots](#snapshots), below for more information.

`SnapshotAccount` - (Optional) The Account of the parent snapshot from which the storage volume is restored. See [Snapshots](#snapshots), below for more information.

`Tags` - (Optional) Comma-separated strings that tag the storage volume.

## Return Values

### Fn::GetAtt

`Hypervisor` - The hypervisor that this volume is compatible with.

`MachineImage` - Name of the Machine Image - available if the volume is a bootable storage volume.

`Managed` - Is this a Managed Volume?.

`Platform` - The OS platform this volume is compatible with.

`Readonly` - Can this Volume be attached as readonly?.

`Status` - The current state of the storage volume.

`StoragePool` - The storage pool from which this volume is allocated.

`Uri` - Unique Resource Identifier of the Storage Volume.

## See Also

* [opc_compute_storage_volume](https://www.terraform.io/docs/providers/opc/r/compute_storage_volume.html) in the _Terraform Provider Documentation_


text:
---
layout: post
title: 305 - Number of Islands II
date: 2015-10-21 03:03:07.000000000 -04:00
tags:
- Leetcode
categories:
- DFS
author: Jason
---
**Given a n,m which means the row and column of the 2D matrix and an array of pair A( size k). Originally, the 2D matrix is all 0 which means there is only sea in the matrix. The list pair has k operator and each operator has two integer A[i].x, A[i].y means that you can change the grid matrix[A[i].x][A[i].y] from sea to island. Return how many island are there in the matrix after each operator.**

``` java
public class Solution {
    class UnionFind {
        HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
        int find (int x) {
            if (!map.containsKey(x)) {
                map.put(x, x);
                return x;
            }
            int result = x;//compress path: add a loop to find() that links every node on the path to the root.
            while (result != map.get(result)) {
                result = map.get(result);
            }
            while (x != map.get(x)) {
                int temp = map.get(x);
                map.put(x, result);
                x = temp;
            }
            return x;
        }
    }
    public int convertToId(int x, int y, int m) {
        return x * m + y;//id must be x * col + y!!!! this is the only way to make it unique!!!
    }
    public List<Integer> numIslands2(int n, int m, Point[] operators) {
        List<Integer> result = new ArrayList<Integer>();
        if (operators == null || operators.length == 0) return result;
        int[] dx = {0, -1, 0, 1}, dy = {-1, 0, 1, 0};
        int[][] grid = new int[n][m];
        UnionFind uf = new UnionFind();
        int count = 0;
        for (Point p : operators) {
            count ++;
            int x = p.x, y = p.y;
            grid[x][y] = 1;
            int id = convertToId(x, y, m);
            for (int i = 0; i < 4; i++) {
                int nx = x + dx[i], ny = y + dy[i];
                if (nx >= 0 && nx < n && ny >= 0 && ny < m && grid[nx][ny] == 1) {//dont forget this condition
                    int nid = convertToId(nx, ny, m);
                    int father = uf.find(id), nfather = uf.find(nid);
                    if (father != nfather) {
                        count --;
                        uf.map.put(father, nfather);
                    }
                }
            }
            result.add(count);
        }
        return result;
    }
}
```

extension: markdown


text:
@title SPARQL-Generate | Java API

# SPARQL-Generate Java API

The reference implementation of SPARQL-Generate is based on Apache Jena. Its binaries, sources and documentation are available for download at [Maven Central](https://search.maven.org/search?q=fr.mines-stetienne.ci.sparql-generate).

The [sources of `sparql-generate-jena`](https://github.com/sparql-generate/sparql-generate) contains project `sparql-generat-example` which can be used as a starting point to use the SPARQL-Generate API.

The [javadoc](http://w3id.org/sparql-generate/apidocs/index.html) contains comprehensive documentations and examples.

### Maven dependency

To use it in your Maven project, add the following dependency declaration to your Maven project file ( `*.pom` file):

```xml
<dependency>
    <groupId>fr.mines-stetienne.ci.sparql-generate</groupId>
    <artifactId>sparql-generate-jena</artifactId>
    <version>x.y.z</version>
</dependency>
```

Separate artifacts contain binding and iterator functions for different file formats. For example:

```xml
<dependency>
    <groupId>fr.mines-stetienne.ci.sparql-generate</groupId>
    <artifactId>sparql-generate-json</artifactId>
    <version>x.y.z</version>
</dependency>
```

Artifact `sparql-generate-all` aggregates binding and iterator functions for all formats:

```xml
<dependency>
    <groupId>fr.mines-stetienne.ci.sparql-generate</groupId>
    <artifactId>sparql-generate-all</artifactId>
    <version>x.y.z</version>
</dependency>
```

### Parsing a Query

```java
 SPARQLGenerateQuery query = (SPARQLGenerateQuery) QueryFactory.create(queryString, SPARQLGenerate.SYNTAX);
```

### Classes `PlanFactory` and `RootPlan`

First use class `PlanFactory` to instantiate a `RootPlan` for a SPARQL-Generate query. Then the `RootPlan` can be executed several times with different initial bindings and using different execution contexts (e.g., where URLs may be mapped to local files)

Call one of the `execGenerate`, `execSelect`, or `execTemplate` methods to trigger the execution. Here is the signature of some of these methods:

```java
RootPlan plan = PlanFactory.create(query);

Context context = ContextUtils.build(...)
    .set...
    .build();

// one of:

Model execGenerate(QuerySolution initialBindings, Context context);
String execTemplate(QuerySolution initialBindings, Context context);
ResultSet execSelect(QuerySolution initialBindings, Context context);
void execGenerateStream(QuerySolution initialBindings, Context context);
void execTemplateStream(QuerySolution initialBindings, Context context);
void execSelectStream(QuerySolution initialBindings, Context context);
```

### The input Dataset

Part of the SPARQL-Generate query execution consists in evaluating a SPARQL 1.1 `SELECT *` query over a RDF Graph, or a SPARQL Dataset. Exactly like in SPARQL 1.1. The corresponding parameters are `inputModel` or `inputDataset`. To instantiate a `Model`, which is the Jena class for a RDF Graph, one may use for example:

```java
Model model = ModelFactory.createDefaultModel();
RDFDataMgr.read(model, inputStream, Lang.TURTLE);
```

### The context

The default behaviour of the implementation is to use the Jena StreamManager to **fetch the queries or sources from their URL**. One may map URIs to local files using [the Jena StreamManager and LocationMapper](http://jena.apache.org/documentation/io/rdf-input.html#streammanager-and-locationmapper).

The following snippet illustrates how this is achieved:

```java
// tell the engine to look into the `resources` directory
LocatorFileAccept locator = new LocatorFileAccept(new File("resources").toURI().getPath());

// initialize the location mapper
LocationMapperAccept mapper = new LocationMapperAccept();

// tell the engine to read `document.csv` instead of looking up URI `https://example.com/document`
mapper.addAltEntry("https://example.com/document", "document.csv");

// tell the engine to read `query.rqg` instead of looking up URI `https://example.com/query`
mapper.addAltEntry("https://example.com/query", "query.rqg");

// initialize the StreamManager
SPARQLExtStreamManager sm = SPARQLExtStreamManager.makeStreamManager(locator, mapper);

// create the execution context from the StreamManager
Context context = ContextUtils.build( ... )
    .setStreamManager(sm)
    . ...
    .build();
```

The context contains other parameterizable execution configuration.

### The initial binding

One may execute the query with initial bindings. This is useful when one wants to pass initial parameters to a query.

The snippet below illustrates the creation of an initial binding with variable `?msg` bound to the string `"mymessage"`.

```java
// create the RDF literal
RDFNode jenaLiteral = initialModel.createLiteral("mymessage");

// create the binding
QuerySolutionMap initialBinding = new QuerySolutionMap();
initialBinding.add("msg", jenaLiteral);
```

### Using a SNAPSHOT version

The most recent SNAPSHOT of SPARQL-Generate are available in the OSS Sonatype snapshots repository:

```
<repositories>
   <repository>
     <id>snapshots-repo</id>
     <url>https://oss.sonatype.org/content/repositories/snapshots</url>
     <releases><enabled>false</enabled></releases>
     <snapshots><enabled>true</enabled></snapshots>
   </repository>
</repositories>
```

And dependency

```xml
<dependency>
    <groupId>fr.mines-stetienne.ci.sparql-generate</groupId>
    <artifactId>sparql-generate-all</artifactId>
    <version>x.y.z-SNAPSHOT</version>
</dependency>
```

### Is the documentation missing important information?

Don't hesitate to [create an issue on GitHub](https://github.com/sparql-generate/sparql-generate/issues/new) to ask for help or suggest improvement.

repository: sparql-generate/sparql-generate

gha_license_id: NOASSERTION

repo_name: sparql-generate/sparql-generate


text:
# Building FAQ

sebrat nejčastější dotazy (z e-mailu, od call centra, vyhledávání na webu, podle analytics)
sepsat si knowledge base
rozdělit do kategorií
začít psát konverzace
na začátek každé konverzace dát rozcestník
intenty ke každé interakci (i k rozcestníkům)
možnost přepojit na operátora

1. **Collecting most frequent questions**

First step is to collect the most frequent questions that your customers (users) are asking. Either you can ask your call centre, ask your web analytic or go to Google Analytics and look what are visitors of your website looking for the most.

At the beginning, try to collect around 20 most frequent questions.

If you have an e-shop it could be the questions about their orders (order didn’t arrive, how can one make a complaint, how to return an order, etc.).

If you are building a bot for your HR department it could be the questions about how to apply for a job, what are the conditions of admissions, where applicant can submit the application, etc.

2. **Building the knowledge base**

When you have enough questions, now it’s time to build your knowledge base. We recommend to build a Google Sheet where you can write all your questions. Than try to figure out the answers. Either by yourself or find help in your company. Try to be as brief as possible but without losing key informations. Every answer should be in a form of a small paragraph.

3. **Sorting into categories**

If you have multiple questions try to sort them out into 3-4 main categories. Try to think as a user that might use your chatbot. What are the most probable categories user can ask? Are they distinguished enough to have their own separate category? Will user know where he can go next?

Separate your categories into several dialogues in Designer. Every category should have its own dialogue.

4. **Building a root menu**

Now as you have figured out your categories, it is time to start to design your bot. Give your categories specific name which you can use as a tag on your quick replies buttons.

5. **Building dialogues**

Now it is time to design your conversation. Use your knowledge base as a source.

6. **Adding intents to quick replies and to every interaction**

We strongly recommend using NLP that potential users can use your chatbot not only with quick replies but also with written language. So add suitable intents to your conversation. Either specific intents for every interaction either for confirming a choice of a user.

7. **Possibility to interact with human**

There are cases when user wants to speak to a human operator - his demand is specific - or he just don’t like to talk to chatbot. You should provide this possibility to a user if possible.

* Rozsekáváme dlouhé FAQ do podkonverzaci

repository: wingbotai/docs

branch_name: refs/heads/gatsby-documentation

repo_name: wingbotai/docs


text:
## To-Width

**The essential building block for command line tables: truncate & pad strings
to given width, taking care of wide characters, accents and ANSI colors.**

![](https://github.com/loveencounterflow/to-width/raw/master/art/Screen%20Shot%202016-07-05%20at%2016.44.59.png)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Usage](#usage)
- [Bugs](#bugs)
- [Why?](#why)
- [How?](#how)
- [Similar](#similar)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Usage

```coffee
{ to_width, width_of, } = require 'to-width'
```

`width_of` is provided by
[sindresorhus/string-width](https://github.com/sindresorhus/string-width); it provides a fairly
reliable way to determine the width of strings on character devices. All people who
deal with `string.length`, encodings and buffers in JavaScript will enjoy the
following table:

| `string`                              | `string.length` | `Buffer.byteLength string` | `width_of string` |
| --------:                            | :--------:      | :--------:          | :--------: |
| `'abcd'`                              | 4     ✅         | 4    ✅              | 4   ✅      |
| `'äöüß'`                              | 4     ✅         | 8    ❌              | 4   ✅      |
| `'äöüß'` (using combining diacritics) | 7     (✅)         | 11    ❌             | 7   ❌      |
| `'北京'`                              | 2     (✅)       | 6    ❌              | 4   ✅      |
| `'𪜀𪜁'`                                | 4   ❌           | 8  ❌                | 4 ✅        |

## Bugs

* `width_of` doesn't correctly count combining characters.
* 32bit Unicode glyphs (those from the 'Astral Planes') may be split by `to_width`, and combining
  diacritics may get lost:

```
'#' + ( to_width 'abcdabcd', 4 ) + '#' # --> #abc…#
'#' + ( to_width 'äöüßäöüß', 4 ) + '#' # --> #äöü…#
'#' + ( to_width 'äöüßäöüß', 4 ) + '#' # --> #äöu…#
'#' + ( to_width '北京北京', 4 ) + '#' # --> #北……#
'#' + ( to_width '𪜀𪜁𪜀𪜁', 4 ) + '#' # --> #𪜀�…#
```

## Why?

When I needed tabular data display on the command line, I got dissatisfied
with existing solutions. There are some promising modules for doing this on
[npm](https://www.npmjs.com/search?q=table), but nothing satisfied me in the end.

I realized that the key requirement for doing tables in the terminal is the
ability to format data so that each chunk of text (that you build table cells
with) has exactly the correct visual width. Actually, string length fitting
seems to have become quite the rage among people these days, at least judging by
the recent [left-pad](https://www.npmjs.com/package/left-pad) hype.

## How?

The core functionality of this module has been implemented using

* https://github.com/sindresorhus/string-width
* https://github.com/martinheidegger/wcstring

These two modules do the heavy lifting (looking for wide characters, combining characters, and
ANSI color codes); `to-width` does only a little bit of glueing (and <strike>fixing</strike>
providing a workaround for a minor bug in `wcstring`).

<!--
In programming languages and fixed-width displays, there are at least three meaningful measures of text 'length':

* **Length**—How many code units are used by a given programming language? In
  JavaScript, this measure is obtained by retrieving the value of `text.length`,
  and indeed, this is often used to implement simple-minded string truncation
  and padding when lines of constant length are desired. Be it said that the only two justifications for considering `text.length`

* **Size**—How long a string is under some special interpretation of its contents; for example, the string
`'a&#98x;c'` has a length of 8, but a size of 3 when NCRs are rendered as their corresponding code
points.

* **Width**—How wide does a given text appear on the screen? This is a tricky
  question, even if we reframe it a bit and try to answer, not "how many
  millimeters does this text take up", but, much more interestingly, "if I
  assume a monospaced (a.k.a fixed-width, non-proportional) font and a 'gauge' of
  (say) ten characters `0123456789`, then how many characters of a given text will
  fit into the exact same horizontal space?".

  Strictly speaking, we can only find out by this must ignore color codes and
  take CJK &c. into account; also, it should support [combining
  characters](https://en.wikipedia.org/wiki/Combining_character)
 -->

## Similar

These packages have also been considered:

* https://github.com/chalk/strip-ansi
* https://github.com/chalk/ansi-styles
* https://github.com/jbnicolai/ansi-256-colors
* https://github.com/nexdrew/ansi-align
* https://github.com/sindresorhus/boxen
* https://github.com/sindresorhus/string-length
* https://github.com/sindresorhus/cli-truncate
* https://github.com/chalk/wrap-ansi
* https://github.com/chalk/slice-ansi
* https://github.com/substack/fixed-width-float

repository: loveencounterflow/to-width

gha_language: CoffeeScript

repo_name: loveencounterflow/to-width


text:
---
layout: layout.pug
navigationTitle: Explore New Cluster
title: Explore New Cluster
menuWeight: 25
excerpt: Learn to interact with your Kubernetes cluster
enterprise: false
---

This guide explains how to use the command line to interact with your newly deployed Kubernetes cluster.

Before you start, make sure you have created a workload cluster, as described in [Create a New Cluster][createnewcluster].

## Explore the new Kubernetes cluster

1.  Get a kubeconfig file for the workload cluster:

    When the workload cluster is created, the cluster lifecycle services generate a kubeconfig file for the workload cluster, and write it to a _Secret_. The kubeconfig file is scoped to the cluster administrator.

    Get the kubeconfig from the _Secret_, and write it to a file, using this command:

    ```bash
    dkp get kubeconfig -c ${CLUSTER_NAME} > ${CLUSTER_NAME}.conf
    ```

1.  List the Nodes using this command:

    ```bash
    kubectl --kubeconfig=${CLUSTER_NAME}.conf get nodes
    ```

    ```sh
    NAME                                         STATUS   ROLES    AGE   VERSION
    ip-10-0-115-179.us-west-2.compute.internal   Ready    <none>   13m   v1.21.5-eks-bc4871b
    ip-10-0-117-5.us-west-2.compute.internal     Ready    <none>   12m   v1.21.5-eks-bc4871b
    ip-10-0-81-221.us-west-2.compute.internal    Ready    <none>   12m   v1.21.5-eks-bc4871b
    ip-10-0-94-48.us-west-2.compute.internal     Ready    <none>   12m   v1.21.5-eks-bc4871b
    ```

NOTE: It may take a few minutes for the Status to move to Ready while the Pod network is deployed. The Nodes' Status should change to Ready soon after the calico-node DaemonSet Pods are Ready.

1.  List the Pods using this command:

    ```bash
    kubectl --kubeconfig=${CLUSTER_NAME}.conf get --all-namespaces pods
    ```

    ```sh
    NAMESPACE                           NAME                                                                 READY   STATUS    RESTARTS   AGE
    calico-system            calico-kube-controllers-6b48c9575d-pvc4w        1/1     Running    0          3m51s
    calico-system            calico-node-4z2cn                               1/1     Running    0          3m51s
    calico-system            calico-node-6j6jt                               1/1     Running    0          3m47s
    calico-system            calico-node-cdzzs                               1/1     Running    0          3m49s
    calico-system            calico-node-ln74k                               1/1     Running    0          3m50s
    calico-system            calico-typha-578fc65f-82cdb                     1/1     Running    0          3m43s
    calico-system            calico-typha-578fc65f-mg59n                     1/1     Running    0          3m51s
    calico-system            calico-typha-578fc65f-qvxnl                     1/1     Running    0          3m43s
    kube-system              cluster-autoscaler-b4789f4bf-ds44f              0/1     Init:0/1   0          4m41s
    kube-system              coredns-85d5b4454c-hjp4h                        1/1     Running    0          7m41s
    kube-system              coredns-85d5b4454c-j26c5                        1/1     Running    0          7m41s
    kube-system              kube-proxy-bwl8s                                1/1     Running    0          3m53s
    kube-system              kube-proxy-gf9sr                                1/1     Running    0          3m49s
    kube-system              kube-proxy-mwcw9                                1/1     Running    0          4m2s
    kube-system              kube-proxy-p5hmm                                1/1     Running    0          3m47s
    node-feature-discovery   node-feature-discovery-master-65dc499cd-c867m   1/1     Running    0          4m44s
    node-feature-discovery   node-feature-discovery-worker-c72vn             1/1     Running    0          3m29s
    node-feature-discovery   node-feature-discovery-worker-n57p9             1/1     Running    0          3m27s
    node-feature-discovery   node-feature-discovery-worker-v7v6q             1/1     Running    0          3m42s
    node-feature-discovery   node-feature-discovery-worker-zd7lf             1/1     Running    0          3m33s
    tigera-operator          tigera-operator-59f4845b57-b5ltk                1/1     Running    0          4m42s
    ```

[install_docker]: https://docs.docker.com/get-docker/
[install_clusterawsadm]: https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases
[install_kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
[aws_credentials]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html
[capa]: https://github.com/kubernetes-sigs/cluster-api-provider-aws
[createnewcluster]: ../new

repository: mesosphere/dcos-docs-site

branch_name: refs/heads/main

gha_language: SCSS

repo_name: mesosphere/dcos-docs-site


text:
Repeat
===
[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]

> Repeat a string a specified number of times and return the concatenated result.

## Installation

``` bash
$ npm install utils-repeat-string
```

## Usage

``` javascript
var repeat = require( 'utils-repeat-string' );
```

#### repeat( str, n )

Repeats a string `n` times and returns the concatenated result.

``` javascript
var str = repeat( 'a', 5 );
// returns 'aaaaa'

str = repeat( '', 100 );
// returns ''

str = repeat( 'beep', 0 );
// returns ''
```

## Examples

``` javascript
var round = require( 'math-round' );
var repeat = require( 'utils-repeat-string' );

var str = 'beep';
var n;
var i;

for ( i = 0; i < 100; i++ ) {
	n = round( Math.random()*3 );
	console.log( repeat( str, n ) );
}
```

To run the example code from the top-level application directory,

``` bash
$ node ./examples/index.js
```

---
## CLI

### Installation

To use the module as a general utility, install the module globally

``` bash
$ npm install -g utils-repeat-string
```

### Usage

``` bash
Usage: repstr [options] str --n repeats

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.
         --n repeats           Number of repetitions.
```

### Examples

``` bash
$ repstr beep -n 5
# => beepbeepbeepbeepbeep
```

---
## Tests

### Unit

This repository uses [tape][tape] for unit tests. To run the tests, execute the following command in the top-level application directory:

``` bash
$ make test
```

All new feature development should have corresponding unit tests to validate correct functionality.

### Test Coverage

This repository uses [Istanbul][istanbul] as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:

``` bash
$ make test-cov
```

Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,

``` bash
$ make view-cov
```

### Browser Support

This repository uses [Testling][testling] for browser testing. To run the tests in a (headless) local web browser, execute the following command in the top-level application directory:

``` bash
$ make test-browsers
```

To view the tests in a local web browser,

``` bash
$ make view-browser-tests
```

<!-- [![browser support][browsers-image]][browsers-url] -->

---
## License

[MIT license](http://opensource.org/licenses/MIT).

## Copyright

Copyright © 2016. Athan Reines.

[npm-image]: http://img.shields.io/npm/v/utils-repeat-string.svg
[npm-url]: https://npmjs.org/package/utils-repeat-string

[build-image]: http://img.shields.io/travis/kgryte/utils-repeat-string/master.svg
[build-url]: https://travis-ci.org/kgryte/utils-repeat-string

[coverage-image]: https://img.shields.io/codecov/c/github/kgryte/utils-repeat-string/master.svg
[coverage-url]: https://codecov.io/github/kgryte/utils-repeat-string?branch=master

[dependencies-image]: http://img.shields.io/david/kgryte/utils-repeat-string.svg
[dependencies-url]: https://david-dm.org/kgryte/utils-repeat-string

[dev-dependencies-image]: http://img.shields.io/david/dev/kgryte/utils-repeat-string.svg
[dev-dependencies-url]: https://david-dm.org/dev/kgryte/utils-repeat-string

[github-issues-image]: http://img.shields.io/github/issues/kgryte/utils-repeat-string.svg
[github-issues-url]: https://github.com/kgryte/utils-repeat-string/issues

[tape]: https://github.com/substack/tape
[istanbul]: https://github.com/gotwarlost/istanbul
[testling]: https://ci.testling.com

repository: kgryte/utils-repeat-string

repo_name: kgryte/utils-repeat-string


text:
# Requirements
 -   Linux server (recommended)
 -   Python >= 3.6
 -   PostgreSQL
# Features
 -  Performs lottery start and delete operations.
# Related projects
 - [LuckSend](https://github.com/necipcanguler/LuckSend) (required)
 - [LuckSend Web](https://github.com/necipcanguler/LuckSend-Web) (optionally)
 - [LuckSend Api](https://github.com/necipcanguler/LuckSend-Api) (required)
 - [LuckSend Admin](https://github.com/necipcanguler/LuckSend-Admin) (required)
# Installation
Edit the database connection in the raffleStart.py and raffleDelete.py files.

repository: canglr/LuckSend-Cronjob

repo_name: canglr/LuckSend-Cronjob


text:
# Overview

In a large project, related files often have similar names, but they tend to be
long and tedious to type when navigating the codebase.
quick-open-related-files is a VS Code extension that launches the quick open
menu with the current filename pre-filled (after applying an optional set of
transformations, e.g. removing the file extension).

For example, if you are viewing `app/views/rocket_launch.html.erb` and trigger
quick-open-related-files, depending on your configuration, you might see:

<img src="https://raw.githubusercontent.com/schreifels/vscode-quick-open-related-files/master/screenshot/screenshot.png" width="550" alt="VS Code quick open menu with 'rocket_launch' pre-populated">

## For end users

### Installation

The easiest way to install is to search for "Quick Open Related Files" in the
vscode extension marketplace.

Alternatively, you can manually install using:

```bash
cd ~/.vscode/extensions/
git clone https://github.com/schreifels/vscode-quick-open-related-files.git
```

### Usage

By default, you can list related files for the currently open file using the
`⌘+.` keyboard shortcut or by selecting "Quick Open Related Files" in the
command palette.

You can customize the keyboard shortcut by adding this to `keybindings.json`:

```json
{
  "command": "quickOpenRelatedFiles.show",
  "key": "cmd+."
}
```

### Configuration

There are a couple options to customize how the extension manipulates the
current path before pre-populating the quick open menu. See the
`contributes.configuration` section of the `package.json` file for more details.

## Changelog

### 1.0.0

* Initial release

## For developers

Clone the repo, `npm install`, and open the directory in VS Code. For your
convenience, it comes preconfigured with the "Launch Extension" and
"Launch Tests" launch configurations.


text:
# Fixed Parameter

The Layout Component can be position outside the normal flow to either the top (`fixed="top"`) or bottom (`fixed="bottom"`) of the page.

## Knobs

Change the fixed parameter from `Top` to `Bottom` to see the different rendering behavior.

## Examples

The [Cards](https://gymnastjs.github.io/gymnast/?selectedKind=%20Examples&selectedStory=Cards) and [Holy Grail](https://gymnastjs.github.io/gymnast/?selectedKind=%20Examples&selectedStory=Holy%20Grail) Examples show how sticky headers implemented using the fixed parameter.

Note that because `fixed` positions Components outside the normal flow of the page and gymnast doesn't know their size, additional CSS will be required to offset the content below.


text:
# [TeXt Theme](https://github.com/kitian616/jekyll-TeXt-theme)

[![Gem Version](https://img.shields.io/gem/v/jekyll-text-theme.svg)](https://github.com/kitian616/jekyll-TeXt-theme/releases)
[![license](https://img.shields.io/github/license/kitian616/jekyll-TeXt-theme.svg)](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/LICENSE)
[![Travis](https://img.shields.io/travis/kitian616/jekyll-TeXt-theme.svg)](https://travis-ci.org/kitian616/jekyll-TeXt-theme)

![TeXt Theme](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/TeXt-home.png)

![TeXt Theme Details](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/TeXt-details.png)

[Demo](https://tianqi.name/jekyll-TeXt-theme/) | [English (Beta)](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README-en.md)

TeXt is a succinct theme for blogging. Similar to iOS 11 style, it has large and prominent titles, round buttons and cards.

## Features

- Responsive
- Paginate ([jekyll-paginate](https://github.com/jekyll/jekyll-paginate))
- Table of contents
- Tag
- Search
- Page views ([LeanCloud](https://leancloud.cn/))
- Emoji ([Jemoji](https://github.com/jekyll/jemoji))
- Comment ([Disqus](https://disqus.com/))
- Google Analytics
- Contact information (Email, Facebook, Twitter, Linkedin, Weibo, Zhihu, etc)
- Semantic HTML
- Icon automation tool ([gulp-svg2png](https://www.npmjs.com/package/gulp-svg2png), [gulp-to-ico](https://www.npmjs.com/package/gulp-to-ico))
- Color Theme
- Mathematical formula ([MathJax](https://www.mathjax.org/))
- Flowchart, Sequence diagram, Gantt diagram ([mermaid](https://mermaidjs.github.io/))
- Line Chart, Bar Chart, Radar Chart, Pie Chart ([chartjs](http://www.chartjs.org/))
- RSS（[jekyll-feed](https://github.com/jekyll/jekyll-feed))
- Multi-language support(English | Simplified Chinese | Traditional Chinese)

## How To Use

The easiest way is making a fork of the repository and rename it to `<username>.github.io`, then you can clone it to local, commit your changes and push.

And also, you can get the source code of the theme at the [release page](https://github.com/kitian616/jekyll-TeXt-theme/releases).

### Configuration

Add your information in the ./_config.yml file, such as your name, contact, title of the site and so on.

Write your brief introduction in the ./about.md file.

### Writing Posts

To create a new post, all you need to do is create a file in the ./_posts directory. the blog post files need to be named as the format `YEAR-MONTH-DAY-title.MARKUP`, for example `2011-12-31-new-years-eve-is-awesome.md`. You can find more info at [Jekyll: Writing Posts](https://jekyllrb.com/docs/posts/).

### Excerpt

There are two excerpt types: TEXT type and HTML type. You can change it by setting the value of `excerpt_type` in the ./\_config.yml file.

| excerpt_type | type | description |
| --- | --- | --- |
| text | TEXT | the excerpt are plain text that filters out all non-text elements (such as title, link, list, table, picture, etc.) and only show 350 characters most. |
| html | HTML | the excerpt are HTML document just like the content of the article, This will show all the content by default, except adding `<!--more-->` in the article Markdown file, You can find more info at [Jekyll: Post#post-excerpts](https://jekyllrb.com/docs/posts/#post-excerpts).  |

### Installation Development Environment (not Necessary)

Find more info at [Jekyll: Installation](https://jekyllrb.com/docs/installation/).

### Development Server (not Necessary)

if you Installed Node.js, you can start a development server by running `npm run dev` at the root path of the repository.

if not, just run:

```console
bundle exec jekyll serve -H <IP_ADDRESS>
```
after the command finished, you can visit [http://localhost:4000/](http://localhost:4000/) to see the page.

You can find more info at [Jekyll: Usage](https://jekyllrb.com/docs/usage/).

## Advanced

### Color Theme

| `default` | `dark` | `forest` |
| --- |  --- | --- |
| ![default](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/colors_default.png) | ![dark](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/colors_dark.png) | ![forest](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/colors_forest.png) |

| `ocean` | `chocolate` | `orange` |
| --- |  --- | --- |
| ![ocean](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/colors_ocean.png) | ![chocolate](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/colors_chocolate.png) | ![orange](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/colors_orange.png) |

### Icons

This theme comes with a "ginkgo leaf" icon, you can replace it with your own icon. The site's icons are located in the ./favicon.ico and ./assets/images/logo directories. You can see the logo directory has a lot of png files and a svg vector file. Those png images are actually images of different sizes generated from svg vector images that may used in some scenes, such as pinned to the screen in OS and Android and tiles in Windows 10.

This theme provides an automated script for automatically generating favicon and png files from svg vector graphics. What you have to do is:

1. Install Node.js

2. Run `npm i` command at the root directory.

3. Replacing the logo.svg file in the ./assets/images/logo directory.

4. Run `npm run artwork` command. after it finished, the favicon and png files will be replaced by the new logo.svg generated files.

### Comment

### Reading Quantity

### Google Analytics

### Front Matter Enhancement

In addition to Jekyll's front matters, the theme adds some unique front matters.

| variable      | option values | description |
| ---           | ---           | ---         |
| key           | | |
| picture_frame | shadow        | |
| modify_date   | | |
| comment       | true/false    | |
| mathjax       | true/false    | |
| mermaid       | true/false    | |
| chart       | true/false    | |

### Other Resource

## Examples

- [Demo](https://tianqi.name/jekyll-TeXt-theme/)
- [Qi's blog](https://tianqi.name/blog/)


text:
# rc4pp
A [RC4](https://en.wikipedia.org/wiki/RC4) C++ implementation.
## Why write this code?
I wrote this code while learning about cryptography and I chose RC4 because of its simplicity.

## Source files
- RC4.cpp and RC4.h are the implementation of the algorithm.
- main.cpp is an example of using the implementation to encrypt and decrypt a string.
## License
The license of this project is the [MIT license](https://opensource.org/licenses/MIT).

This code is by no means perfect and is not meant for encrypting sensitive information, mainly because this is not a software for encrypting anything, this is just an implementation of a cryptography algorithm and secondly because the RC4 algorithm has been found to be [not secure](https://en.wikipedia.org/wiki/RC4#Security) and easily crackable.


text:
![maze solver project created for my IA class](https://github.com/emkis/a-star-maze-solver/blob/master/.github/a-star-maze-solver-demo.png?raw=true)

# :page_with_curl: about
the challenge of my AI class in college was to create a maze solver, so i chose **a\*  algorithm** to solve this problem

basically the app **generates randomly a starting point and a destination** point, the algorithm analyzes this distance using **the manhattan distance** and tries to find the **best possible path**

the ui and the whole color palette was based on the cyberpunk universe, because it is beautiful and super cool 😉

# :hammer: how it was built
this project was developed with the following technologies:

- Vanilla HTML
- Vanilla CSS
- Vanilla JS
- [p5.js (for handling canvas)](https://p5js.org/)

# :electric_plug: how to use/see
just [click here](http://emkis.profissional.ws/a-star-maze-solver) or clone this repo and open the **src/index.html** file, thats all
**easy peasy lemon squeezy 🍋**

# :information_source: note
all comments in **index.js** file was written in portuguese so that my teacher can read, so ignore it 👽

# :memo: license
this project is under the **MIT license**, you can see the **[license](https://github.com/emkis/a-star-maze-solver/blob/master/LICENSE)** for more information.

---

:v: **[say hello](https://www.linkedin.com/in/nicolas-jardim/)** to me on linkedin or send me and **[email](mailto:nicolasemkis@gmail.com)** :mailbox:

repository: emkis/a-star-maze-solver

repo_name: emkis/a-star-maze-solver


text:
## Sembast unique index experimentation.

Everything is in one file so can be copy/pasted or you can import this lib as a git dependency. See [README.md](../README.md).
By default sembast has a single primary key index which can be an int or a String.

Here is a solution to add an additional unique index (a custom key is considered unique here but an alternative solution could support non-unique index)

An index definition can be declared globally on a store:

```dart
import 'package:tekartik_app_sembast/sembast.dart';
import 'package:tekartik_app_sembast/unique_index.dart';

/// our book store
var bookStore = intMapStoreFactory.store('book');

/// Our index on the `code` field which is a String
var codeIndex = bookStore.index<String>('code');
```

An active database index can be created once the database is opened. It will allow quick access by index key.

```dart
var db = await databaseFactory.openDatabase('test.db');

// Create our db active index.
dbCodeIndex = db.index(codeIndex);
```

By default, it does not ensure uniqueness. If you want to throw on conflicts you can use:

```dart
dbCodeIndex = db.index(codeIndex, throwOnConflict: true);
```

Let's add some data for demo purpose

```dart
// Add some data
await bookStore.addAll(db, [
  {'code': 'BOOK001', 'title': 'The great book'},
  {'code': 'BOOK002', 'title': 'The simple book'}
]);
```

Access by index can done the following way:

```dart
  /// Access a book by code
var book = (await dbCodeIndex.record('BOOK001').getSnapshot())!;

/// Should print the great book!
print(book['title']);
```

Or in a transaction:

```dart
/// You can also read in a transaction.
await db.transaction((transaction) async {
  /// Access a book by code
  var book = (await dbCodeIndex
    .transactionRecord(transaction, 'BOOK002')
    .getSnapshot())!;

  /// Should print the simple book!
  print(book['title']);
});
```

gha_language: Dart


text:
### [CVE-2018-19831](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-19831)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

The ToOwner() function of a smart contract implementation for Cryptbond Network (CBN), an tradable Ethereum ERC20 token, allows attackers to change the owner of the contract, because the function does not check the caller's identity.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/SmartContractResearcher/SmartContractSecurity

repository: trickest/cve

repo_name: trickest/cve


text:
+++
date = "2016-12-06T16:41:13+03:00"
title = "From Moscow to St. Petersburg with cheap prices and bonuses"
draft = true

+++

Smart tips for a traveler in Russia for optimal trip from Moscow to St. Petersburg and back, including cheap tickets, checked hostels and free bonuses (which can be useful in your future trips).

...

### Optimal route

At roughly the same prices for a train and plane tickets I'm prefer train. First, it is still cheaper, given the additional cost of the road from/to the Pulkovo airport. Secondly, it is still faster, because when you come to Moskovsky railway station, you are arrive immediately to the center of the St. Petersburg.

### Train

...

### Tickets

For cheapest train tickets buy them directly from Russian Railsways on official site:

[pass.rzd.ru](http://pass.rzd.ru/)

No other ticket site or reseller don't give you such prices. Also, RZD has a bonus program, which allows to pay for some tickets with miles. You can signup online (but site only in Russian):

[rzd-bonus.ru](https://rzd-bonus.ru/)

### Hotels

My personal recommendation is [Friends on Kazanskaya](http://www.booking.com/hotel/ru/friends-on-kazanskaya.xu.html?aid=1320357&no_rooms=1&group_adults=1). 1 bed for 3 nights

repository: osminogin/osminogin-site

repo_name: osminogin/osminogin-site


text:
# libtv

## Overview

libtv is a wrapper library of libuv to solve the problem
when embedding libuv into existing products, like multi-thread calling, transport, and so on.

## Feature highlights

 * Support multi-thread calling.
 * Support IPv6 dual stack.
 * Abstraction of TCP, SSL, WebSocket.

## Build Instructions

### Required tools and Dependencies

 * Python v2.6 or 2.7
   Required if you want to build with gyp.
 * OpenSSL v1.0.1 or later
   Required if you want to use {SSL, WSS} transport.
   If your operating system is Windows,
   download binary distributions from https://www.openssl.org/community/binaries.html and install it.

### Build with autotools

    $ ./bootstrap
    $ ./configure [--with-ssl=/path/to/OpenSSL]
    $ make clean all

### Build with gyp

#### Windows(Visual Studio)

    $ configure.py [-Dtarget_arch=[ia32,x64]] [-Denable_shared] [-Druntime_library=[md,mt]] [-Dwith_ssl=/path/to/OpenSSL]

Launch tv.sln or call msbuild like below

    $ msbuild tv.sln /p:Configuration=[Debug/Release]

#### xNix

    $ ./configure.py [-Denable_shared] [-Dwith_ssl=/path/to/OpenSSL]
    $ cd out
    $ make BUILDTYPE=[Debug/Release]

## License

The MIT License (MIT)
See LICENSE for details.

And see some submodule LICENSEs(exist at deps dir).

repository: linear-rpc/libtv

gha_language: C

repo_name: linear-rpc/libtv


text:
# WiFiID

![Logo](https://raw.githubusercontent.com/ybreza/WiFiID/master/.assets/logo/Logotype.png)

[![release](https://img.shields.io/github/release/dwisiswant0/WiFiID.svg)](https://github.com/dwisiswant0/WiFiID/releases/)
[![license](https://img.shields.io/github/license/dwisiswant0/WiFiID.svg)](https://github.com/dwisiswant0/WiFiID/blob/master/LICENSE)
[![contributions](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwisiswant0/WiFiID/issues)
[![hits](http://hits.dwyl.com/dwisiswant0/WiFiID.svg)](http://hits.dwyl.com/dwisiswant0/WiFiID)

Auto extracting mac address in same network & username, password of @wifi.id account using this API https://gist.github.com/dwisiswant0/c3ac216bc63c6c2fc6129bfd13e60cb0.

![WiFiID Example](https://user-images.githubusercontent.com/25837540/37767629-587ff0cc-2dfd-11e8-888f-bbe063f22e46.png)

---

- [Installation](#installation)
- [Requirements](#requirements)
- [Quick Start and Run](#quick-start-and-run)
- [License](#license)
- [Version](#version)
- [Contribute](#contribute)

---

### Installation

To install WiFiID, simply:

    $ git clone https://github.com/dwisiswant0/WiFiID

For latest update version:

    $ git pull

### Requirements

WiFiID works with PHP 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, and HHVM.

### Quick Start and Run

	$ php WiFiID.php

### Help
If you are still confused/ have suggestions, please [open the issue](https://github.com/dwisiswant0/WiFiID/issues).

### License
**WiFiID** is licensed under the MIT. Take a look at the [LICENSE](https://github.com/dwisiswant0/WiFiID/blob/master/LICENSE) for more information.

### Version
**Current version is 1.0.1** *(beta)* and still development.

### Contribute
1. Check for open issues or open a new issue to start a discussion around a bug or feature.
1. Fork the repository on GitHub to start making your changes.
1. Write one or more tests for the new feature or that expose the bug.
1. Make code changes to implement the feature or fix the bug.
1. Send a pull request to get your changes merged and published.

gha_language: PHP


text:
# stats19-api
Rest API for serving Stats19 Road Safety Accident Data in GB

## Motivation

Road safety data about the circumstances of personal injury road accidents in GB available on [data.gov.uk](https://data.gov.uk/dataset/cb7ae6f0-4be6-4935-9277-47e5ce24a11f/road-safety-data). This dataset contains the types of vehicles involved in accidents and the consequential casualties. The statistics relate only to personal injury accidents on public roads that are reported to the police, and subsequently recorded, using the STATS19 accident reporting form.

This dataset comes in separate zipped excel or csv files by data table and by year.

Analyst most often interested in the details of accidents with the last 5-10 years of certain location. This requires them to download, unzip, combine multiple files and filter it down for a specific geographic area. A web API serving data in response to carefully constructed http requests is a modern way to provide data for users and simplify the proccess. An API will also allow the analysist to build their own static or dynamic applications.

## User guide
- Todo

## Libraries used
- SQLalchemy
- Flask

## Summary of the results of the analysis
- Todo

## Acknowledgements
The road traffic accident data is governed by [Open Government Licence](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)
    http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/

The Flask API is governed by [MIT License](https://github.com/GaborJenei/stats19-api/blob/26d6b57df8639e8677eec194b72cd7223ba37789/LICENSE)


text:
landmarker.io
=============

3D mesh and image annotation in the browser.

Getting set up for development
==============================

The landmarker.io client uses NPM for all dependencies. As a prerequisite, you'll need node.js and NPM installed on your system. With these set up, just `cd` to the top landmarker.io directory and run:

```
> npm install
```

This may take some time as all dependencies are installed.

We use [gulp](http://gulpjs.com/) for handling the build of the code. You'll probably want that installed as a global command line tool:

```
> [sudo] npm install -g gulp
```
You may need the sudo depending on your node installation.

Now you are all set. Run
```
> gulp
````
in the top directory. Any changes to the files will trigger a rebuild by gulp, so you can just edit the JS and reload the page to see the changes.

Note that you edit the individual modules in `src/js` - gulp compiles these all together using [browserify](http://browserify.org) and produces a monolithic JS file called `bundle-SOMEHASH.js`. When debugging in your browser, source maps hide this from you, so you'll be able to place breakpoints and step through code as it looks on disk, not the compiled moonlithic file.

See  [landmarkerio-server](https://github.com/menpo/landmarkerio-server) for
installation instructions for the server.

### Landmark JSON format

Landmarks are served as JSON payloads. See

https://github.com/menpo/landmarker.io/blob/master/api/v2/landmarks/james/ibug68.json

for an example of this format.


text:
## Neural Networks in Numpy

The following repository contains code for training neural networks only in numpy. It is a attempt to encourage an encourage a clear understanding of how neural networks are trained : **Backprop** and **Gradient Descent**

### FC Network - Regression
---
[Function_Regression.ipynb](Function_Regression.ipynb)
The notebook contains code to train a neural network to overfit any function in a given range

### FC Network - Classification
---
[Classification_MNIST.ipynb](Classification_MNIST.ipynb)
The notebook aims at training a neural network to classify the digits in the MNIST dataset

### TODO
---
- [ ] Adam Optimizer
- [ ] CNN in numpy
- [ ] RNN in numpy

repository: avilash/neural-networks-numpy

repo_name: avilash/neural-networks-numpy


text:
# Kython language support in Atom

Adds syntax highlighting and folding to Kython files in Atom.
Currently using old-stye textmate regex syntax.  A tree-sitter
parser has been created, but the implementation descibed in
the atom flight manual has thus far failed to work with it.

Based on python language: https://github.com/atom/language-python

repository: trihedral/language-kython

repo_name: trihedral/language-kython


text:
# go-cd-console-summary
A web page which picks out MSBuild errors and warnings from a go.cd console.log.

Set up:

1. Add the file console-summary.html to your project.
1. In Go.CD add console-summary.html as an artifact to the Job.
1. In Go.CD add console-summary.html as a custom tab for the Job.

Console Summary finds the file cruise-output/console.log relative to its current location, scans the file for errors and warnings, and displays the result in the page.  It is designed to pick out [compiler](https://msdn.microsoft.com/en-us/library/yxkt8b26.aspx) and [MSBuild](https://blogs.msdn.microsoft.com/msbuild/2006/11/02/msbuild-visual-studio-aware-error-messages-and-message-formats/) errors and warnings.

repository: matroberts/go-cd-console-summary

repo_name: matroberts/go-cd-console-summary


text:
---
layout: post
title: "Sugar Utilities"
---

# Sugar Utilities

##[Summary]()

 SubSonic.Sugar is a Utility Class that is our attempt at refactoring the main Utility class that we've been using over the last year, and rather than keep it to ourselves, we thought "why not share with the lovely people". It's also tons of useful utility classes that we think you'll use a lot of.
Note that in SubSonic 3.0, these are now Extension Methods  *
 *
 *
 *
 *
 *
 *


text:
AcmeMotors MessageHub Consumer
==============================

This application on an environment variable `APP_CONFIG` which contains a configuration JSON object as follows:

```
{
   "kafka-rest-url":"https://${YOUR-MESSAGEHUB-KAFKA-REST-ENDPOINT}.messagehub.services.us-south.bluemix.net:443",
   "messagehub-api-key":"${YOUR-MESSAGEHUB-API-KEY}",
   "messagehub-username":"${YOUR-MESSAGEHUB-USERNAME}",
   "messagehub-password":"${YOUR-MESSAGEHUB-PASSWORD}",
   "message-hub-servers":"${YOUR-MESSAGEHUB-SERVERS}",
   "truststore-path":"${YOUR-KESYSTORE-PATH}",
   "truststore-password":"${YOUR-KEYSTORE-PASSWORD}",
   "truststore-type":"${YOUR-KEYSTORE-TYPE}",
   "crm-endpoint":"https://${YOUR-CRM-ENDPOINT}"
}
```

Update your `manifest.yml` to reflect your changes. You can use the following default values for Bluemix

```
"truststore-path":"/home/vcap/app/.java/jre/lib/security/cacerts",
"truststore-password":"changeit",
"truststore-type":"JKS",
```

Running on Bluemix
==================

1. `mvn install` build the war

> **NOTE**: check the `manifest.yml` file and make sure the host matches your Bluemix's container host

2. `cf push` deploy to Bluemix


text:
# NUCLEO_L476RG_DFU_SOCK
MicroPython board definition NUCLEO_L476RG_DFU_SOCK

## Firmware
Clone the board definitions to your MicroPython ports/stm32/boards folder.
```
cd micropython/ports/stm32/boards
git clone https://github.com/zmech/NUCLEO_L476RG_DFU_SOCK
```
Open NUCLEO_L476RG_DFU_SOCK folder, open mpconfigboard.h and uncomment spi flash size line wich you are using.
For exsample 64 Mbit AT25SF641.
```
// SPI Flash(uncomment right size of flash chip)
//#define MICROPY_HW_SPIFLASH_SIZE_BITS (8 * 1024 * 1024)
//#define MICROPY_HW_SPIFLASH_SIZE_BITS (16 * 1024 * 1024)
//#define MICROPY_HW_SPIFLASH_SIZE_BITS (32 * 1024 * 1024)
#define MICROPY_HW_SPIFLASH_SIZE_BITS (64 * 1024 * 1024)
//#define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024)
```
Save and build firmware
```
cd ..
make BOARD=NUCLEO_L476RG_DFU_SOCK
```
## Flashing via DFU
To put the board in DFU mode,connect the BOOT0 (CN7 pin7) to the VDD (CN7 pin5) with jumper and connect USB.
![Jumper position](https://github.com/zmech/NUCLEO_F401RE_DFU_SOCK/blob/master/bootjumper.jpg)
Now you can flash the board using DFU with the command:

`make BOARD=NUCLEO_L476RG_DFU_SOCK deploy`

Once the upload is complete, connect BOOT0 to the GND (CN7 pin8) and press reset button.


text:
## GITNB

**GIT TRACKING FOR PYTHON NOTEBOOKS**

A simple idea: GitNB doesn't actually track python notebooks. Instead, GitNB creates and updates python versions of your notebooks which are in turn tracked by git.

1. [Quick Start](#quick)
2. [But I'm Lazy!!!](#lazy)
3. [Install](#install)
4. [Docs](#docs)
5. [User Config](#config)

_____

### QUICK START:

This quick-start is just an example. It looks long (due to bash-output) but its quick: 1-2 minutes tops.

A. INITIALIZE GIT REPO

```bash
test| $ tree
.
├── A-Notebook.ipynb
├── A_BUGGY_NOTEBOOK.ipynb
├── Py2NB.ipynb
├── another_python_file.py
├── some_python_file.py
└── widget
    ├── I\ have\ spaces\ in\ my\ name.ipynb
    ├── Notebook1.ipynb
    └── widget.py

1 directory, 8 files

test| $ git init
Initialized empty Git repository in /Users/brook/code/jupyter/gitnb/test/.git/

test| $ git add .

test| $ git commit -am "Initial Commit: python files"
[master (root-commit) b29b6c4] ...
```

B. INITIALIZE GitNB, ADD NOTEBOOKS TO GitNB TO BE TRACKED

```bash

# initialize gitnb
test|master $ gitnb init

gitnb: INSTALLED
   - nbpy.py files will be created/updated/tracked
   - install user config with: $ gitnb configure

# lets list our (untracked) notebooks
test|master $ gitnb list

gitnb[untracked]:
  Py2NB.ipynb
  A-Notebook.ipynb
  widget/I have spaces in my name.ipynb
  A_BUGGY_NOTEBOOK.ipynb
  widget/Notebook1.ipynb

# adding an individual file
test|master $ gitnb add A_BUGGY_NOTEBOOK.ipynb
gitnb: add (A_BUGGY_NOTEBOOK.ipynb | nbpy/A_BUGGY_NOTEBOOK.nbpy.py)

# adding all the files in a directory
test|master $ gitnb add widget
gitnb: add (widget/I have spaces in my name.ipynb | nbpy/I have spaces in my name.nbpy.py)
gitnb: add (widget/Notebook1.ipynb | nbpy/Notebook1.nbpy.py)

# the default directory for the python versions of the notebooks is nbpy/
test|master $ tree
.
├── A-Notebook.ipynb
├── A_BUGGY_NOTEBOOK.ipynb
├── Py2NB.ipynb
├── another_python_file.py
├── nbpy
│   ├── A_BUGGY_NOTEBOOK.nbpy.py
│   ├── I\ have\ spaces\ in\ my\ name.nbpy.py
│   └── Notebook1.nbpy.py
├── some_python_file.py
└── widget
    ├── I\ have\ spaces\ in\ my\ name.ipynb
    ├── Notebook1.ipynb
    └── widget.py

2 directories, 11 files

# our list now conatins tracked and untracked notebooks
test|master $ gitnb list

gitnb[tracked]:
  widget/Notebook1.ipynb
  widget/I have spaces in my name.ipynb
  A_BUGGY_NOTEBOOK.ipynb

gitnb[untracked]:
  A-Notebook.ipynb
  Py2NB.ipynb

# note these files are now in our git repo
test|master $ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

  new file:   nbpy/A_BUGGY_NOTEBOOK.nbpy.py
  new file:   nbpy/I have spaces in my name.nbpy.py
  new file:   nbpy/Notebook1.nbpy.py

# git commit the new nbpy.py versions
test|master $ git commit -am "add nbpy.py versions of notebooks"
[master 868b0a2] ...
```

C. QUICK LOOK AT A "NBPY.PY" VERSION OF A NOTEBOOK

```bash
test|master $ cat nbpy/A_BUGGY_NOTEBOOK.nbpy.py

"""[markdown]
## This is a notebook with bugs
"""

"""[code]"""
import numpy as np
""""""

"""[code]"""
def feature(food=True):
    if foo:
        return "I am not a bug"
    else:
        return "I told you I am not a bug"
""""""

"""[code]"""
print("Are you a bug?")
print(feature(True))
""""""

```

D. UPDATE NBPY.PY FILE AFTER EDITING YOUR NOTEBOOK

That notebook is buggy ...[updating python notebook]... I just went to the python-notebook and fixed the bugs. Let's see what happened:

```bash
# note the changes have not appeared in our nbpy.py file
test|master $ git diff

# however, we can see the changes with 'gitnb diff'
test|master $ gitnb diff A_BUGGY_NOTEBOOK.ipynb

gitnb[diff]: A_BUGGY_NOTEBOOK.ipynb[->nbpy.py] - nbpy/A_BUGGY_NOTEBOOK.nbpy.py
--- +++ @@ -1,7 +1,7 @@

 """[markdown]
-## This is a notebook with bugs
+## This is a notebook without bugs
 """

@@ -11,7 +11,7 @@

 """[code]"""
-def feature(food=True):
+def feature(foo=True):
     if foo:
         return "I am not a bug"
     else:

# we now use 'gitnb update' to update the tracked files
# this creates a new nbpy.py version and adds the changes
# to the git repo
test|master $ gitnb update

# now we can see the bug fixes with 'git diff'
test|master $ git diff
diff --git a/nbpy/A_BUGGY_NOTEBOOK.nbpy.py b/nbpy/A_BUGGY_NOTEBOOK.nbpy.py
index e80204b..955b359 100644
--- a/nbpy/A_BUGGY_NOTEBOOK.nbpy.py
+++ b/nbpy/A_BUGGY_NOTEBOOK.nbpy.py
@@ -1,7 +1,7 @@

 """[markdown]
-## This is a notebook with bugs
+## This is a notebook without bugs
 """

@@ -11,7 +11,7 @@ import numpy as np

 """[code]"""
-def feature(food=True):
+def feature(foo=True):
     if foo:
         return "I am not a bug"
     else:

# commit the changes
test|master $ git commit -am "fixed bug: i fixed .ipynb, gitnb fixed .nbpy.py"
[master 812a4f0] ...
```

E. CREATE PYTHON-NOTEBOOK FROM NBPY.PY FILE

Finally, lets say we actually need that buggy notebook after all

```bash
test|master $ git checkout 868b0a2
Note: checking out '868b0a2'.
[... git detached head messaging ...]
HEAD is now at 868b0a2... add nbpy.py versions of notebooks

# create notebook from nbpy.py file
test|(HEAD detached at 868b0a2) $ gitnb tonb nbpy/A_BUGGY_NOTEBOOK.nbpy.py

# the default directory for generated notebooks versions is nbpy/
test|(HEAD detached at 868b0a2) $ tree nbpy_nb
nbpy_nb
└── A_BUGGY_NOTEBOOK.nbpy.ipynb

0 directories, 1 file
```

My bugs are back!

![nbpy_nb/A_BUGGY_NOTEBOOK.nbpy.ipynb](https://github.com/brookisme/gitnb/blob/master/buggy.png)

_____

### LAZY CONFIG:

If the [quick-start](#quick) seemed like too much how about this...

```bash
$ gitnb commit -am "I just updated and commited every notebook in my project"
```

How in the what? Two things are going on here

1. We are [commit](#commit)-ing with `gitnb commit` instead of `git commit`
2. I've [installed](#configure) the user config and set

```bash
# ./gitnb.config.yaml
...
GIT_ADD_ON_GITNB_UPDATE: True
AUTO_TRACK_ALL_NOTEBOOKS: True
...
```

Now each time I `gitnb commit`:

* All new notebooks are [add](#add)-ed to be tracked by gitnb
* All notebooks are [update](#update)-ed
* All changes are added to the git repo
* `git commit --allow-empty` is [called](#commit)

Note: the `--allow-empty` flag is there because the at the time of the commit (before the nbpy.py files are generated there may or may not be changes to commit)

Here's the super-quick-quick-start-example:
```bash
test|master $ git init
Initialized empty Git repository in /Users/brook/code/jupyter/gitnb/test/.git/
test| $ gitnb init

gitnb: INSTALLED
   - nbpy.py files will be created/updated/tracked
   - install user config with: $ gitnb configure

test| $ gitnb configure
gitnb: USER CONFIG FILE ADDED (./gitnb.config.yaml)
```

... go update gitnb.config.yaml ...

```bash
test| $ gitnb commit -am "Initial Commit with everything"
gitnb: add (A-Notebook.ipynb | nbpy/A-Notebook.nbpy.py)
gitnb: add (A_BUGGY_NOTEBOOK.ipynb | nbpy/A_BUGGY_NOTEBOOK.nbpy.py)
gitnb: add (Py2NB.ipynb | nbpy/Py2NB.nbpy.py)
gitnb: add (widget/I have spaces in my name.ipynb | nbpy/I have spaces in my name.nbpy.py)
gitnb: add (widget/Notebook1.ipynb | nbpy/Notebook1.nbpy.py)
[master (root-commit) cb8c106] ...

test|master $ tree
.
├── A-Notebook.ipynb
├── A_BUGGY_NOTEBOOK.ipynb
├── Py2NB.ipynb
├── another_python_file.py
├── gitnb.config.yaml
├── nbpy
│   ├── A-Notebook.nbpy.py
│   ├── A_BUGGY_NOTEBOOK.nbpy.py
│   ├── I\ have\ spaces\ in\ my\ name.nbpy.py
│   ├── Notebook1.nbpy.py
│   └── Py2NB.nbpy.py
├── some_python_file.py
└── widget
    ├── I\ have\ spaces\ in\ my\ name.ipynb
    ├── Notebook1.ipynb
    └── widget.py

2 directories, 14 files
```
_____

### INSTALL:

###### pip:
```bash
pip install gitnb
```

###### github:
```
git clone https://github.com/brookisme/gitnb.git
cd gitnb
sudo pip install -e .
```

_____

### DOCS:

```bash
$ gitnb --help
usage: gitnb [-h] {init,configure,list,update,add,remove,topy,tonb} ...
```

###### methods:

1. [init](#init): initialize gitnb for project
2. [configure](#configure): install gitnb.config.yaml for user config
3. [gitignore](#gitignore): add ipynb \& gitnb files to gitignore
4. [list](#list): list tracked notebooks or nbpy.py files
5. [add](#add): begin tracking notebook
6. [remove](#remove): stop tracking notebook
7. [update](#update): update nbpy.py files with recent notebook edits
8. [commit](#commit): update, followed by add, followed by `git commit`
9. [diff](#diff): perform diff between current notebook version and last [update](#update)-ed version
10. [topy](#topy): convert notebook to nbpy.py file (without [add](#add)-ing)
11. [tonb](#tonb): convert nbpy.py file to python notebook

_____

###### init:
Initialize Project:

* `git init` required before `gitnb init`
* installs .gitnb directory at the project root
* creates or appends .git/hooks/pre-commit for auto-tracking config

```bash
$ gitnb init
```
([back to methods](#methods))

_____

###### configure:
Install Config:

* optional: only necesary if you want to change the [default config](https://github.com/brookisme/gitnb/blob/master/gitnb/default.config.yaml)
* installs gitnb.config.yaml directory at the project root

```bash
$ gitnb configure
```
([back to methods](#methods))

_____

###### gitignore:
Update .gitignore:

Appends (or creates) gitignore with the recommended settings. Namely,

* notebooks: *.ipynb, .ipynb_checkpoints
* gitnb: nbpy_nb/

```bash
$ gitnb gitignore
```
([back to methods](#methods))

_____

###### list:
List Project Notebooks, or nbpy.py files

positional arg (*type*):

* (default) **all**: list tracked and untracked notebooks
* **tracked**: list tracked notebooks
* **untracked**: list untracked notebooks
* **nbpy**: list nbpy.py files

```bash
$ gitnb list --help
usage: gitnb list [-h] [type]

positional arguments:
  type        notebooks: ( all | tracked | untracked ), or nbpy
```
([back to methods](#methods))

_____

###### add:
Add notebook to gitnb:

* converts notebook(s) to nbpy.py file(s)
* adds notebook-nbpy pair to gitnb tracking list
* performs a `git add` on nbpy.py file(s)
* path: path to file or directory
* destination_path: (optional)
    * if path is a file path nbpy file will be at destination_path
    * if destination_path is falsey (recommended) default path is used
    * default path can be changed with [user config](#config)
    * if path is a direcotry path, default config is always used

```bash
$ gitnb add --help
usage: gitnb add [-h] path [destination_path]

positional arguments:
  path              path to ipynb file
  destination_path  if falsey uses default destination path
```
([back to methods](#methods))

_____

###### remove:
Remove notebook from gitnb:

* notebook will no longer be tracked
* nbpy.py file will **not** be deleted
* ipynb file will **not** be deleted

```bash
$ gitnb remove --help
usage: gitnb remove [-h] path

positional arguments:
  path        path to ipynb file
```
([back to methods](#methods))

_____

###### update:
Update nbpy files:

* will update nbpy files with current content from your tracked notebooks
* make sure your notebook has been saved!

```bash
$ gitnb update
```
([back to methods](#methods))

_____

###### commit:
Update and Commit:

* if (UPDATE_ON_GITNB_COMMIT) perform 'gitnb update'
* call `git commit --allow-empty` with optional flags [a|m]:
  - -a flag (add all - same as git commit -a)
  - -m flag (add all - same as git commit -m)
  - note: `--allow-empty` because the nbpy files are not yet updated

```bash
#
# this line of code is equivalent to
# - $ gitnb update
# - $ git add .
# - $ git commit --allow-empty -am "COMMIT MESSAGE"
#
$ gitnb commit [-a] [-m "COMMIT MESSAGE"]
```
([back to methods](#methods))

_____

###### diff:
Diff for recent changes.

Creates a diff between the most recent nbpy.py version of the noteboook
and the nbpy.py version of the notebook in its current state (the working copy).

```bash
$ gitnb diff <PATH-TO-NOTEBOOK(.ipynb)-FILE>
```
([back to methods](#methods))

_____

###### topy:
To-Python:

* converts notebook(s) to nbpy.py file(s)
* similar to [add](#add) but does not gitnb or git track

```bash
$ gitnb topy --help
usage: gitnb topy [-h] path [destination_path]

positional arguments:
  path              path to ipynb file
  destination_path  if falsey uses default destination path
```
([back to methods](#methods))

_____

###### tonb:
To-Notebook:

* creates new notebook from nbpy.py python file
* great for collaborators!
* great for recovering lost work!

```bash
$ gitnb tonb --help
usage: gitnb tonb [-h] path [destination_path]

positional arguments:
  path              path to ipynb file
  destination_path  if falsey uses default destination path
```
([back to methods](#methods))

_____

### USER CONFIG:

The [configure](#configure) method installs `gitnb.config.yaml` in your root directory.  This is a copy of the [default config](https://github.com/brookisme/gitnb/blob/master/gitnb/default.config.yaml). Note at anytime you can go back to the default configuration by simply deleting the user config file (`gitnb.config.yaml`).

There are comment-docs in the config file that should explain what each configuration control. However I thought I'd touch a couple of the perhaps more interesting configurations here.

##### LAZY INSTALL

see [But I'm Lazy!](#lazy)

##### GIT_ADD_ON_GITNB_ADD (defaults to True):

If True the [add](#add) method will perform a `git add` after creating the nbpy file and adding it to the gitnb tracking list.  You can set this to False if you want to explicity call `git add` yourself after looking over the file.

##### UPDATE_ON_COMMIT (defaults to True):

If True, the gitnb [update](#update) method will automatically be called when performing a `git commit` (during pre-commit hook).

##### AUTO_TRACK_ALL_NOTEBOOKS (defaults to False):

If True, `gitnb add .` (see [add](#add) method) will automatically be called when performing a `git commit` (during pre-commit hook). This will add all notebooks in your project to gitnb.

_Note if the only thing that has changed is your notebooks, you'll still need to explicity call `gitnb update` or add the `--allow-empty` flag to your `git commit`._

##### EXCLUDE_DIRS:

A list of directories not to include when searching for notebooks

##### OTHER:

You can also configure, default location for new files, if they include an indentifier (like 'nbpy' in `somefile.nbpy.py`), spacing in nbpy files and more. Check the comment-docs for more info.

repository: brookisme/gitnb

repo_name: brookisme/gitnb


text:
# Action - `unpost`

## Description

The intent of the `unpost` action is to suggest that a previously posted message (through the `post` action), as referred by `post_uuid`, be removed by the different front-ends reading this contract's transaction flow.

I, {{ poster }} understand that this action will not remove the message from circulation, as it will be imprinted in the blockchain.  I also understand that some front-ends might not remove the message, and even highlight the fact that a message was intended to be removed, potentially attracting attention on an undesired message.


text:
---
title: 'Involving Syrian Refugees in Design Research: Lessons Learnt from the Field'
date: 2019-06-01
publishDate: 2019-06-01T11:04:37.665+00:00
authors:
- Reem Talhouk
- Madeline Balaam
- Austin L Toombs
- Andrew Garbett
- Chaza Akik
- Hala Ghattas
- Vera Araujo-Soares
- Balsam Ahmad
- Kyle Montague
publication_types:
- '1'
abstract: With the Syrian crisis entering its 8th year, refugees have become the focus
  of research across multiple disciplines, including design and HCI research. While
  some researchers have reflected upon designing with refugees, these accounts have
  been limited to conducting design workshops in formal spaces. Through reflecting
  on our experiences of conducting design research in informal refugee settlements
  in Lebanon we unpack lessons learnt, design practices and research approaches that
  facilitate design engagements with refugees. We highlight the value in participants
  configuring the design space, using a dialogical approach as well as creating a
  safe space for both participants and the researcher. We also reflect on the roles
  that researchers may take on when conducting similar research. By doing so we contribute
  specific design practices that may be transferrable to other similar contexts.
featured: false
publication: Proceedings of the 2019 Designing Interactive Systems Conference
url_pdf: https://doi.org/10.1145/3322276.3322335
doi: 10.1145/3322276.3322335

---


text:
# sge3: And Implementation of Dynamic Structured Grammatical Evolution in Python 3

Structured Grammatical Evolution (SGE) is a recent Grammatical Evolution (GE) variant that aims at addressing some of its locality and redundancy issues. The SGE distinctive feature is having a one-to-one correspondence between genes and non-terminals of the grammar being used. If you use this code, a reference to the following work would be greatly appreciated:

```
@article{Lourenco2016,
 title={Unveiling the properties of structured grammatical evolution},
  author={Louren{\c{c}}o, Nuno and Pereira, Francisco B and Costa, Ernesto},
  journal={Genetic Programming and Evolvable Machines},
  volume={17},
  number={3},
  pages={251--289},
  year={2016},
  publisher={Springer}
}

@incollection{lourencco2018structured,
  title={Structured grammatical evolution: a dynamic approach},
  author={Louren{\c{c}}o, Nuno and Assun{\c{c}}{\~a}o, Filipe and Pereira, Francisco B and Costa, Ernesto and Machado, Penousal},
  booktitle={Handbook of Grammatical Evolution},
  pages={137--161},
  year={2018},
  publisher={Springer}
}
```

This project corresponds to a new implementation of the SGE engine. SGE has been criticised for the fact that we need to specify the maximum levels of recursion in order to remove it from the grammar beforehand. In this new version we specify the maximum tree depth (similarly to what happens in standard tree-based GP), and the algorithm adds the mapping numbers as required during the evolutionary search. Thus, we do not need to pre-process the grammar to remove the recursive productions. Additionally, we provide mechanisms and operators to ensure that the generated trees are always within the allowed limits.

As in for the SGE framework we provide the implementations of some problems that we used to test the DSGE. Extending it to your own needs should be fairly easy.

When running the framework a folder called *dumps* will be created together with an additional one that corresponds
 to the experience. Inside, there will be directories for each run. Each run folder contains snapshots of the
  population at a given generation, and a file called *progress_report.csv*,  which is updated during the
   evolutionary run
  . By default we take snapshots
   of the population every iteration (SAVESTEP parameter in the configuration file). This can be changed, together with
    all
    the numeric values in the
    *configs
   * folder.

### Requirements
Currently this codebase only works with python 3.

### Installation

To be completed

### Execution

You can run the Symbolic Regression example like this:

```python -m examples.symreg --experiment_name dumps/example --seed 791021 --parameters parameters/standard.yml```

### Support

Any questions, comments or suggestion should be directed to Nuno Lourenço ([naml@dei.uc.pt](mailto:naml@dei.uc.pt))

### Acknowledgments

I am grateful to my advisors Francisco B. Pereira and Ernesto Costa for their guidance during my PhD. I am also grateful to Filipe Assunção and Joaquim Ferrer for their help and comments on the development of this framework.