text:
# Calendar

> BootstrapVue's custom `<b-calendar>` component generates a WAI-ARIA compliant calendar style date
> selection widget, which can be used to control other components, or can be used to create
> customized date picker inputs.

## Overview

`<b-calendar>` is WAI-ARIA accessibility compliant, optimized for keyboard control (arrow, page
up/down, home, and end keys). Internationalization is also supported, and default's to the browser's
or page's locale, if no locale(s) are specified.

If you need a date picker as a custom form control input, use the
[`<b-form-datepicker>`](/docs/components/form-datepicker) component instead.

```html
<template>
  <b-row>
    <b-col md="auto">
      <b-calendar v-model="value" @context="onContext" locale="en-US"></b-calendar>
    </b-col>
    <b-col>
      <p>Value: <b>'{{ value }}'</b></p>
      <p class="mb-0">Context:</p>
      <pre class="small">{{ context }}</pre>
    </b-col>
  </b-row>
</template>

<script>
  export default {
    data() {
      return {
        value: '',
        context: null
      }
    },
    methods: {
      onContext(ctx) {
        this.context = ctx
      }
    }
  }
</script>
<!-- b-calendar.vue -->
```

## `v-model` return value

By default, `<b-calendar>` returns dates as a string in the `YYYY-MM-DD` format, which is the same
format returned by native browser `<input type="date">` controls. You can have `<b-calendar>` return
a `Date` object (with no time portion) as the `v-model` value instead by setting the `value-as-date`
prop.

If no date is selected, `<b-calendar>` returns an empty string `''`, or returns `null` if the
`value-as-date` prop is set.

Note that when `value-as-date` prop is set, the returned `Date` object will be in the browser's
default timezone.

## Disabled and readonly states

Setting the `disabled` prop will remove all interactivity of the `<b-calendar>` component.

Setting the `readonly` prop will disable selecting a date, but will keep the component interactive,
allowing for date navigation. The `v-model` will not be updated in the readonly state.

For disabling specific dates or setting minimum and maximum date limits, refer to the
[Date constraints](#date-constraints) section.

```html
<template>
  <div>
    <b-form-group label="Select calendar interactive state" v-slot="{ ariaDescribedby }">
      <b-form-radio-group
        v-model="state"
        :aria-describedby="ariaDescribedby"
        aria-controls="ex-disabled-readonly"
      >
        <b-form-radio value="disabled">Disabled</b-form-radio>
        <b-form-radio value="readonly">Readonly</b-form-radio>
        <b-form-radio value="normal">Normal</b-form-radio>
      </b-form-radio-group>
    </b-form-group>

    <b-calendar
      id="ex-disabled-readonly"
      :disabled="disabled"
      :readonly="readonly"
    ></b-calendar>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        state: 'disabled'
      }
    },
    computed: {
      disabled() {
        return this.state === 'disabled'
      },
      readonly() {
        return this.state === 'readonly'
      }
    }
  }
</script>

<!-- b-form-calendar-disabled-readonly.vue -->
```

## Date constraints

### Minimum and maximum dates

Restrict the calendar range via the `min` and `max` props. The props accept a date string in the
format of `YYYY-MM-DD` or a `Date` object.

```html
<template>
  <div>
    <b-calendar v-model="value" :min="min" :max="max" locale="en"></b-calendar>
  </div>
</template>

<script>
  export default {
    data() {
      const now = new Date()
      const today = new Date(now.getFullYear(), now.getMonth(), now.getDate())
      // 15th two months prior
      const minDate = new Date(today)
      minDate.setMonth(minDate.getMonth() - 2)
      minDate.setDate(15)
      // 15th in two months
      const maxDate = new Date(today)
      maxDate.setMonth(maxDate.getMonth() + 2)
      maxDate.setDate(15)

      return {
        value: '',
        min: minDate,
        max: maxDate
      }
    }
  }
</script>

<!-- b-calendar-min-max.vue -->
```

### Disabling dates

If you need to disable specific dates within the calendar, specify a function reference to the
`date-disabled-fn` prop. The function is passed two arguments:

- `ymd` The date as a `YYYY-MM-DD` string
- `date` The date as a `Date` object

The function should either return `true` if the date _cannot_ be selected (disabled), or `false` if
the date _can_ be selected (enabled). Note that the function **cannot** be asynchronous, and should
return a value as quickly as possible.

```html
<template>
  <div>
    <b-calendar v-model="value" :date-disabled-fn="dateDisabled" locale="en"></b-calendar>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        value: ''
      }
    },
    methods: {
      dateDisabled(ymd, date) {
        // Disable weekends (Sunday = `0`, Saturday = `6`) and
        // disable days that fall on the 13th of the month
        const weekday = date.getDay()
        const day = date.getDate()
        // Return `true` if the date should be disabled
        return weekday === 0 || weekday === 6 || day === 13
      }
    }
  }
</script>

<!-- b-calendar-disabled-dates.vue -->
```

Note the `min` and `max` date constraints are evaluated first, before `date-disabled-fn`.

## Styling

### Variants

The selected date button (background color) defaults to the `'primary'` theme variant. You can
change this to any of the Bootstrap v4 theme variant colors: `'secondary'`, `'success'`, `'danger'`,
`'warning'`, `'info'`, etc, via the `selected-variant` prop.

Today's date will also be highlighted (text color) using the same variant as the selected date by
default. To specify a different theme color to use for today's date, use the `today-variant` prop.

To disable highlighting of today's date altogether, set the `no-highlight-today` prop.

The navigation buttons default to the `'secondary'` theme variant. You can change this via the
`nav-button-variant` prop.

```html
<template>
  <b-calendar
    selected-variant="success"
    today-variant="info"
    nav-button-variant="primary"
  ></b-calendar>
</template>

<!-- b-calendar-variants.vue -->
```

### Width

The `<b-calendar>` renders as an inline-block element with a default width of `270px` (excluding any
padding or border that may be added to it). This width is optimized to fit the width of smaller
mobile devices.

To change the width, set the `width` prop to any valid CSS width (including units).

Optionally, make the calendar full width by setting the prop `block`, which will make it expand to
fit the width of the parent element. The `width` prop has no effect when `block` is set.

```html
<template>
  <b-calendar block locale="en-US"></b-calendar>
</template>

<!-- b-calendar-block.vue -->
```

Note it is _not recommended_ to set a width below `260px`, otherwise truncation and layout issues
with the component may occur.

### Initial open calendar date

By default, when no date is selected, the calendar view will be set to the current month (or the
`min` or `max` date if today's date is out of range of `min` or `max`). You can change this
behaviour by specifying a date via the `initial-date` prop. The initial date prop will be used to
determine the calendar month to be initially presented to the user. It does not set the component's
value.

### Date string format

v2.6.0+

To change format options of the displayed date text inside the component, e.g. in the header, set
the `date-format-options` prop to an object containing the requested format properties for the
`Intl.DateTimeFormat` object (see also [Internationalization](#internationalization)).

```html
<template>
  <div>
    <p>Custom date format:</p>
    <b-calendar
      :date-format-options="{ year: 'numeric', month: 'short', day: '2-digit', weekday: 'short' }"
      locale="en"
    ></b-calendar>
    <p class="mt-3">Short date format:</p>
    <b-calendar
      :date-format-options="{ year: 'numeric', month: 'numeric', day: 'numeric' }"
      locale="en"
    ></b-calendar>
  </div>
</template>

<!-- b-calendar-dateformat.vue -->
```

The following table summarizes the valid options for each format property:

| Property  | Possible values                                              |
| --------- | ------------------------------------------------------------ |
| `year`    | `'numeric'`, or `'2-digit'`                                  |
| `month`   | `'numeric'`, `'2-digit'`, `'long'`, `'short'`, or `'narrow'` |
| `day`     | `'numeric'`, or `'2-digit'`                                  |
| `weekday` | `'long'`, `'short'`, or `'narrow'`                           |

Notes:

- Leaving out certain options may affect the formatted text string, e.g. the `weekday`
- The formatted value will vary according to the resolved locale. Some locales may not support the
  `'narrow'` format and will fall back to `'short'` or `long'` (if `'short'` is not available)
- `year`, `month` and `day` will always be shown. If you need to leave out a value, set the property
  to `undefined`, although this is highly discouraged for accessibility reasons

### Weekday name header format

2.12.0+

The calendar weekday name header format defaults to `'short'`, which is typically a three-character
abbreviation of the weekday, although some [locales](#internationalization) may override this. The
format can be controlled via the prop `weekday-header-format` and accepts one of three values:

- `'long'` the full weekday name (e.g. <samp>Tuesday</samp>). Handy when using a full width
  calendar. Avoid using with the default calendar width.
- `'short'` typically is a 2 or 3 letter abbreviation of the weekday name, depending on the selected
  locale (e.g. "Tue").
- `'narrow'` is typically a single character abbreviation (e.g., <samp>T</samp>). Two weekdays may
  have the same narrow style for some locales (e.g. Tuesday and Thursday's narrow style are both
  <samp>T</samp>). This can be handy for those locales that do not support the `'short'` format,
  such as locales `'ar'` and `'fa'`.

### Hiding the top selected date header

By default, the current selected date will be displayed at the top of the calendar component,
formatted in the locale's language.

You can hide this header via the `hide-header` prop. Note this only _visually hides_ the selected
date, while keeping it available to screen reader users as an `aria-live` region.

For example usage, refer to the [Internationalization section](#internationalization) below.

### Optional decade navigation buttons

Set the prop `show-decade-nav` to enable the previous and next decade buttons in the calendar's date
navigation toolbar.

The props `label-prev-decade` and `label-next-decade` props can be used to provide custom label text
for the decade buttons.

For example usage, refer to the [Internationalization section](#internationalization) below.

### Border and padding

Fancy a calendar with a border with padding? Use Bootstrap's
[border and padding utility classes](/docs/reference/utility-classes) to add borders and padding:

```html
<template>
  <b-calendar class="border rounded p-2" locale="en"></b-calendar>
</template>

<!-- b-calendar-border-padding.vue -->
```

### Default slot

Provide optional content at the bottom of the calendar interface via the use of default slot. The
slot can be used to add buttons such as `Select Today` or `Reset`, etc.

```html
<template>
  <b-calendar v-model="value" value-as-date locale="en">
    <div class="d-flex" dir="ltr">
      <b-button
        size="sm"
        variant="outline-danger"
        v-if="value"
        @click="clearDate"
      >
        Clear date
      </b-button>
      <b-button
        size="sm"
        variant="outline-primary"
        class="ml-auto"
        @click="setToday"
      >
        Set Today
      </b-button>
    </div>
  </b-calendar>
</template>

<script>
  export default {
    data() {
      return {
        value: null
      }
    },
    methods: {
      setToday() {
        const now = new Date()
        this.value = new Date(now.getFullYear(), now.getMonth(), now.getDate())
      },
      clearDate() {
        this.value = ''
      }
    }
  }
</script>

<!-- b-calendar-default-slot.vue -->
```

### Date navigation button slots

2.12.0+

To change the content of the calendar's date navigation buttons, BootstrapVue provides scoped slots
for each button:

- `'nav-prev-decade'`
- `'nav-prev-year'`
- `'nav-prev-month'`
- `'nav-this-month'` (the go to selected/today button)
- `'nav-next-month'`
- `'nav-next-year'`
- `'nav-next-decade'`

All seven slots have the same scoped property available:

| Property | Type    | Description                                                           |
| -------- | ------- | --------------------------------------------------------------------- |
| `isRTL`  | Boolean | Will be `true` when the date navigation bar is rendered right-to-left |

You can use the `isRTL` scoped property to "flip" the prev vs next button content to handle the
left-to-right to right-to-left orientation change — i.e. the previous year button will be on
the right when `isRTL` is `true`, instead of the left.

### Adding CSS classes to specific dates

If you need to highlight a specific date or dates, set the `date-info-fn` prop to a reference to a
function that returns a CSS class string (or array of strings) to apply to the date's cell. The
function is passed two arguments:

- `ymd` The date as a `YYYY-MM-DD` string
- `date` The date as a `Date` object

The function can return a string, or an array of strings. If setting no classes, you can return an
empty string (`''`), empty array (`[]`), or `null`.

In this example we are using the `table-{variant}` color classes to set a background color on the
date cell. The `table-{variant}` color classes work well as they are muted versions of the theme
colors.

```html
<template>
  <div>
    <b-calendar v-model="value" :date-info-fn="dateClass" locale="en"></b-calendar>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        value: ''
      }
    },
    methods: {
      dateClass(ymd, date) {
        const day = date.getDate()
        return day >= 10 && day <= 20 ? 'table-info' : ''
      }
    }
  }
</script>

<!-- b-calendar-date-classes.vue -->
```

Note the function will _not_ be called for [disabled dates](#date-constraints).

**Accessibility note:**

When using classes to convey specific meaning to a date, you should include additional context
outside of the calendar (or via the default slot) as to the dates being highlighted (such as in an
`aria-live` region), specifically for screen reader users.

BootstrapVue may, in the future, add in a feature to add in screen-reader friendly text note on the
highlighted date via this function.

## Events

### `input` event

The `'input'` event is emitted when updating the `v-model`. The event has a single argument which is
the selected date. By default the value is a string in the format of `YYYY-MM-DD` (or an empty
string if no date is selected). If the prop `value-as-date` is set, then the first argument will
instead be a `Date` object (or `null` if no date selected).

If the `disabled` or `readonly` props are set, the `'input'` event will **not** be emitted.

### `selected` event

The `'selected'` event is emitted when the user clicks a non-disabled date. The event passes two
arguments:

- `ymd` The selected date as a `YYYY-MM-DD` string
- `date` The selected date as a `Date` object

If the user clicks the already selected date, the `selected` event will still be emitted, contrary
to the `'input'` event which will _not_ re-emit the already selected date.

If the `disabled` or `readonly` props are set, the `'selected'` event will **not** be emitted.

### `context` event

The `'context'` event is emitted whenever a user selects a date, or the user navigates the calendar
(either via cursor keys, page up/down keys, home or end keys, or uses the calendar navigation
buttons). It will also be emitted when the component is created (just before insertion into the
DOM), or when the resolved locale has changed.

When the `readonly` prop is set, the event will still be emitted when the user navigates the
calendar. It will not be emitted when the `disabled` prop is set (except for the initial emit when
the calendar is created).

The `'context'` event is passed a context object as it's only argument, with the following
properties:

| Property            | Description                                                                                |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `selectedYMD`       | The selected date value (`YYYY-MM-DD` format) or an empty string if no date selected                                                                                |
| `selectedDate`      | The selected date value as a `Date` object or `null` if no date selected                                                                                |
| `selectedFormatted` | The selected date formatted in the current locale. If no date is selected, this will be the value of the `label-no-date-selected` prop                                                                                |
| `activeYMD`         | The current date of the calendar day button that can receive focus as a string (`YYYY-MM-DD` format)                                                                                |
| `activeDate`        | The current date of the calendar day button that can receive focus as a `Date` object                                                                                |
| `activeFormatted`   | The active date formatted in the current locale                                                                                |
| `disabled`          | Will be `true` if active date is disabled, `false` otherwise                                                                                |
| `locale`            | The resolved locale (may not be the same as the requested locale)                                                                                |
| `calendarLocale`    | The resolved locale used by the calendar, optionally including the calendar type (i.e. 'gregory'). Usually this will be the same as `locale`, but may include the calendar type used, such as `fa-u-ca-gregory` when selecting the Persian locale (`'fa'`) |
| `isRTL`             | Will be `true` if the calendar is in a RTL (Right-To-Left) orientation. It will be `false` if LTR (Left-To-Right)                                                                                |

If formatting dates manually via `Intl.DateTimeFormat`, use the `calendarLocale` property value
instead of the `locale` property value to ensure you are using the same calendaring convention that
`<b-calendar>` uses. This is especially true for the IE 11 browser which does not fully implement
all features of `Intl.DateTimeFormat`. Refer to the
[Internationalization section](#internationalization) section below for additional details.

## Internationalization

Internationalization of the calendar is provided via
[`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat),
except for labels applied to elements of the calendar control (aria-labels, selected status, and
help text). You must provide your own translations for these labels. The available locales will be
browser dependant (not all browsers support all locales)

By default `<b-calendar>` will use the browser's default locale, but you can specify the locale (or
locales) to use via the `locale` prop. The prop accepts either a single locale string, or an array
of locale strings (listed in order of preferred locale).

The calendar starts the week on Sunday. This can be changed by setting the `start-weekday` prop to a
number in the range of `0` to `6` where `0` represents Sunday, `1` for Monday, up to `6` for
Saturday.

The emitted `context` event will include which locale the calendar has resolved to (which may not be
the same locale as requested, depending on the supported locales of `Intl`).

```html
<template>
  <b-row>
    <b-col cols="12" class="mb-3">
      <label for="example-locales">Locale:</label>
      <b-form-select id="example-locales" v-model="locale" :options="locales"></b-form-select>
      <label for="example-weekdays" class="mt-2">Start weekday:</label>
      <b-form-select id="example-weekdays" v-model="weekday" :options="weekdays"></b-form-select>
      <b-form-checkbox v-model="showDecadeNav" switch inline class="my-2">
        Show decade navigation buttons
      </b-form-checkbox>
      <b-form-checkbox v-model="hideHeader" switch inline class="my-2">
        Hide the date header
      </b-form-checkbox>
    </b-col>
    <b-col md="auto">
      <b-calendar
        v-model="value"
        v-bind="labels[locale] || {}"
        :locale="locale"
        :start-weekday="weekday"
        :hide-header="hideHeader"
        :show-decade-nav="showDecadeNav"
        @context="onContext"
      ></b-calendar>
    </b-col>
    <b-col>
      <p>Value: <b>'{{ value }}'</b></p>
      <p class="mb-0">Context:</p>
      <pre class="small">{{ context }}</pre>
   </b-col>
  </b-row>
</template>

<script>
  export default {
    data() {
      return {
        value: '',
        context: null,
        showDecadeNav: false,
        hideHeader: false,
        locale: 'en-US',
        locales: [
          { value: 'en-US', text: 'English US (en-US)' },
          { value: 'de', text: 'German (de)' },
          { value: 'ar-EG', text: 'Arabic Egyptian (ar-EG)' },
          { value: 'zh', text: 'Chinese (zh)' }
        ],
        weekday: 0,
        weekdays: [
          { value: 0, text: 'Sunday' },
          { value: 1, text: 'Monday' },
          { value: 6, text: 'Saturday' }
        ],
        labels: {
          de: {
            labelPrevDecade: 'Vorheriges Jahrzehnt',
            labelPrevYear: 'Vorheriges Jahr',
            labelPrevMonth: 'Vorheriger Monat',
            labelCurrentMonth: 'Aktueller Monat',
            labelNextMonth: 'Nächster Monat',
            labelNextYear: 'Nächstes Jahr',
            labelNextDecade: 'Nächstes Jahrzehnt',
            labelToday: 'Heute',
            labelSelected: 'Ausgewähltes Datum',
            labelNoDateSelected: 'Kein Datum gewählt',
            labelCalendar: 'Kalender',
            labelNav: 'Kalendernavigation',
            labelHelp: 'Mit den Pfeiltasten durch den Kalender navigieren'
          },
          'ar-EG': {
            weekdayHeaderFormat: 'narrow',
            labelPrevDecade: 'العقد السابق',
            labelPrevYear: 'العام السابق',
            labelPrevMonth: 'الشهر السابق',
            labelCurrentMonth: 'الشهر الحالي',
            labelNextMonth: 'الشهر المقبل',
            labelNextYear: 'العام المقبل',
            labelNextDecade: 'العقد القادم',
            labelToday: 'اليوم',
            labelSelected: 'التاريخ المحدد',
            labelNoDateSelected: 'لم يتم اختيار تاريخ',
            labelCalendar: 'التقويم',
            labelNav: 'الملاحة التقويم',
            labelHelp: 'استخدم مفاتيح المؤشر للتنقل في التواريخ'
          },
          zh: {
            weekdayHeaderFormat: 'narrow',
            labelPrevDecade: '过去十年',
            labelPrevYear: '上一年',
            labelPrevMonth: '上个月',
            labelCurrentMonth: '当前月份',
            labelNextMonth: '下个月',
            labelNextYear: '明年',
            labelNextDecade: '下一个十年',
            labelToday: '今天',
            labelSelected: '选定日期',
            labelNoDateSelected: '未选择日期',
            labelCalendar: '日历',
            labelNav: '日历导航',
            labelHelp: '使用光标键浏览日期'
          }
        }
      }
    },
    methods: {
      onContext(ctx) {
        this.context = ctx
      }
    }
  }
</script>

<!-- b-calendar-i18n.vue -->
```

Currently `<b-calendar>` only supports the Gregorian (`'gregory'`) calendar.

By default, `<b-calendar>` automatically detects RTL vs LTR via the resolved locale. You can force
the calendar to render right-to-left by setting the `direction` prop to the string `rtl`, or set the
`direction` prop to `'ltr'` to always render left-to-right.

You can listen to the `context` event to determine the locale and directionality that the calendar
has resolved to.

For server side rendering (SSR) when using Node.js, ensure that the Node.js runtime you are using
supports `Intl` and the locales you will be using. Refer to the
[Node `Intl` support documentation](https://nodejs.org/api/intl.html) for details.

## Accessibility

`<b-calendar>` provides many accessibility features, such as `aria-live` regions, roles, aria
labeling, shortcut keys and full keyboard navigation to work with most screen readers.

Keyboard navigation:

- ArrowLeft moves to the previous day (or next day in RTL mode)
- ArrowRight moves to the next day (or previous day in RTL mode)
- ArrowUp moves to the same day in the previous week
- ArrowDown moves to the same day in the next week
- PageUp moves to the same day in the previous month
- PageDown moves to the same day in the next month
- Alt+PageUp moves to the same day and month in the previous year
- Alt+PageDown moves to the same day and month in the next year
- Ctrl+Alt+PageUp moves to the same day and month in the previous
  decade
- Ctrl+Alt+PageDown moves to the same day and month in the next
  decade
- Home moves to today's date
- End moves to the current selected date, or today if no selected date
- Enter or Space selects the currently highlighted (focused) day

Several of the `label-*` props are not visible on screen, but are used to label various elements
within the calendar for screen reader users. e.g. the `label-today` prop is added to the cell that
contains todays date: `'January 28, 2020 (Today)'`, while the `label-selected` prop is added to the
cell that contains the selected date `'January 28, 2020 (Selected date)'` as well as added to the
selected date header as `sr-only` text.

When internationalizing the datepicker, it is important to also update the `label-*` props with
appropriate translated strings, so that international screen reader users will hear the correct
prompts and descriptions.

The features and styling of `<b-calendar>` are intentionally kept minimalistic in order to provide
the best possible accessibility to _all_ users.

## Implementation notes

`<b-calendar>` uses Bootstrap's border and flex utility classes, along with button (`btn-*`) classes
and the `form-control` class. BootstrapVue's custom SCSS/CSS is also required for proper styling.

Accessibility-wise, we chose _not_ to use the ARIA role `grid` for the calendar to minimize
verbosity and to provide consistency across various screen readers (NVDA, when encountering role
`grid`, reads the focused cell as being "selected" which can be misleading to the user).

## See also

- [`<b-form-datepicker>` Date picker custom form input](/docs/components/form-datepicker)
- [`<b-form-timepicker>` Time picker custom form input](/docs/components/form-timepicker)
- [`<b-time>` Time date selection widget](/docs/components/calendar)

repository: bootstrap-vue/bootstrap-vue

repo_name: bootstrap-vue/bootstrap-vue


text:
Article 38

Ti=Codes of conduct

1.0.sec=The Member States, the supervisory authorities and the Commission shall encourage the drawing up of codes of conduct intended to contribute to the proper application of this Regulation, taking account of the specific features of the various data processing sectors, in particular in relation to:

1.1.sec=fair and transparent data processing;

1.2.sec=the collection of data;

1.3.sec=the information of the public and of data subjects;

1.4.sec=requests of data subjects in exercise of their rights;

1.5.sec=information and protection of children;

1.6.sec=transfer of data to third countries or international organisations;

1.7.sec=mechanisms for monitoring and ensuring compliance with the code by the controllers adherent to it;

1.8.sec=out-of-court proceedings and other dispute resolution procedures for resolving disputes between controllers and data subjects with respect to the processing of personal data, without prejudice to the rights of the data subjects pursuant to Articles 73 and 75.

1.=[Z/ol-a/s8]

2.sec=Associations and other bodies representing categories of controllers or processors in one Member State which intend to draw up codes of conduct or to amend or extend  existing codes of conduct may submit them to an opinion of the supervisory authority in that Member State. The supervisory authority may give an opinion whether the draft code of conduct or the amendment is in compliance with this Regulation. The supervisory authority shall seek the views of data subjects or their representatives on these drafts.

3.sec=Associations and other bodies representing categories of controllers in several Member States may submit draft codes of conduct and amendments or extensions to existing codes of conduct to the Commission.

4.sec=The Commission may adopt implementing acts for deciding that the codes of conduct and amendments or extensions to existing codes of conduct submitted to it pursuant to paragraph 3 have general validity within the Union. Those implementing acts shall be adopted in accordance with the examination procedure set out in Article 87(2).

5.sec=The Commission shall ensure appropriate publicity for the codes which have been decided as having general validity in accordance with paragraph 4.

=[Z/ol/s5]

license: MIT

repository: HumanDynamics/BlockCreditUnion

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: HumanDynamics/BlockCreditUnion


text:
---
layout: feature
title: 'PunctSide'
shortdef: 'which side of paired punctuation is this?'
---

Distinguishes between initial and final form of pairwise punctuation
(brackets, quotation marks, question and exclamation in Spanish). Note
that "initial" and "final" are better terms than "left" and
"right". The latter would be confusing in languages writing from right
to left, like Arabic.

### Ini: initial (left bracket in English texts)

### Fin: final (right bracket in English texts)

branch_name: refs/heads/pages-source


text:
Galton : estimate with confidence
=================================

Projects are late more often than not because the people involved fail to take uncertainty into account.
Galton provides a simple interface to calculate confidence curves for risk-based estimation.

A project consists of any number of tasks. Each task has a description, an estimate of effort,
and a risk (low, medium, high). Galton runs a
[Monte Carlo simulation](http://en.wikipedia.org/wiki/Monte_Carlo_method) on the tasks to derive a
probability distribution of possible outcomes, then displays the confidence curve (cumulative
distribution function) and related statistics (mode, median, mean, variance, etc).

Dependencies
------------

Galton depends on these python packages:

 * web.py
 * numpy

The data migration scripts depend on:

 * sqlalchemy
 * sqlalchemy-migrate

repository: nealsanche/galton

repo_name: nealsanche/galton


text:
# Vets API PDF Generation

Vet-API provides PDF generation options that can be used to convert [Form](https://github.com/billfienberg/va.gov-team/tree/5839d463da035612a60148d7f90403dd12c8107e/platform/engineering/backend/vets-website/forms/form-tutorial-basic.md) submissions into PDFs that are more easily handled by existing VA processes. VBA forms may be submitted to the Central Mail API. Built with [pdf-forms](https://github.com/jkraemer/pdf-forms).

1. Add the blank form to `lib/pdf_fill/forms/pdfs/#{form_id}.pdf`
2. Make a class for your form.

   ```ruby
   module PdfFill
   module Forms
    class Va21p530 < FormBase
      KEY = {
        # the key is used to translate your json schema validated form into a hash that can be passed
        # to the pdf-forms library which will write out text onto the pdf
        # the keys in this hash should match the keys in the hash that is submitted from the frontend
        'veteranFullName' => {
          'first' => {
            # the key here is the name of the field in the pdf. you can use acrobat pro or an online
            # editor like https://www.pdfescape.com to find out what the field names are.
            key: 'form1[0].#subform[36].VeteransFirstName[0]',
            # character limit for this field. if a value goes over the character limit extra pages
            # are attached to the end of the pdf that look like this
            # https://github.com/department-of-veterans-affairs/vets-api/blob/master/spec/fixtures/pdf_fill/21P-530/overflow_extras.pdf
            # the field itself will have the text "See add'l info page"
            limit: 12,
            # the question number and question suffix are used to order the questions on the additional
            # information page. the question text is written on the additional information page.
            question_num: 1,
            question_suffix: 'A',
            question_text: "DECEASED VETERAN'S FIRST NAME"
          }
        }
      }

      def merge_fields
        # your class must include this method, it can be used to make changes to the form
        # before final processing
        @form_data
      end
    end
   end
   end
   ```

3. Add your new class to the `PdfFill::Filler::FORM_CLASSES` constant.

```ruby
FORM_CLASSES = {
  '21P-530' => PdfFill::Forms::Va21p530
}.freeze
```

1. Run `PdfFill::Filler.fill_form`

```ruby
burial_claim = SavedClaim::Burial.find(1)
# lib/pdf_fill/forms/pdfs/#{form_id}.pdf must point to the empty pdf
# and PdfFill::Filler::FORM_CLASSES[form_id] must point to the processing class you made
burial_claim.form_id # => '21P-530'
# returns the path to a filled out pdf
PdfFill::Filler.fill_form(burial_claim) # => "tmp/pdfs/21P-530_1.pdf"
```

1. Add your form the the common `filler` spec.
   * Add your form's ID to the list in `spec/lib/pdf_fill/filler_spec.rb`

     ```ruby
     # ...
     `%w[21P-530 21P-527EZ 10-10CG].each do |form_id|`
     # ...
     fact_names = {
     '21P-527EZ' => :pension_claim,
     '21P-530' => :burial_claim,
     '10-10CG' => :caregivers_assistance_claim
     }
     ```

     * Add the related fixtures in `spec/fixtures/pdf_fill/{YOUR_FORM_ID}/`: `simple.json`, `simple.pdf`, `kitchen_sink.json`, `kitchen_sink.pdf`, `overflow.json`, `overflow.pdf`, `overflow_extras.pdf`

## FAQ

* How do I find the field names, or "keys", of my new pdf form? You can call `PdfForms#get_fields` to get a list of the available fields in your pdf.

  ```ruby
  pdftk = PdfForms.new('/usr/local/bin/pdftk')
  fields = pdftk.get_fields '/Users/kevinmircovich/Documents/code/va/vets-api/lib/pdf_fill/forms/pdfs/10-10CG.pdf'
  fields[12] #<PdfForms::Field:0x00007f95884ea938 @type="Text", @name="form1[0].#subform[2].TextField3[9]", @name_alt="Alternate Telephone Number (Including area code).", @flags="8388608", @justification="Left">
  fields[16] #<PdfForms::Field:0x00007f95884fa900 @type="Button", @name="form1[0].#subform[2].FACILITYMEDTREATMENT[0]", @name_alt="Name of facility where you last received medical treatment. Hospital. ", @flags="0", @justification="Left", @value="Off", @options=["2", "Off"]>
  ```

* How do I select a check box on the PDF?

  Boolean values will not select the checkbox \(fields with type "Button"\). Read the field's `options` attribute, it is likely that you'll need to pass it a value of an integer as a string.

* Why have an overflow spec?

  In production, PDFs will be flattened. This may cut off the text in a field if the contents of the field overflows the text area. This spec will move overflowing content to an attached page.

Back: [Vets API Forms](forms.md)

Next: [Vets API Request Processing](request-processing.md)


text:
---
title: "Races"
linkTitle: "Races"
weight: 8n
date: 2017-01-04
description: >
 Races
---

{{% pageinfo %}}
Races
{{% /pageinfo %}}
Races

# Overview

There are currently over 40 defined races in game, of which we have currently locked down to 12 selected at player creation. Over time these races vary, and we sometimes have granted players access to a race not publically available to all.

Each race has their own unique statistics and background, it also affects which classes you can use, for example the  less intelligent races generally cant use magic

There have been many races over the 100,000 years of Solinias lifetime, some are descended from each other and others are completely unique. This is particularly common in the human/elf like races of Solinia who are generally descended from two main branches - Kelderan and Dal

# Human/Elf like Lineage

![](https://www.fallofanempire.com/img/kelderananddallineage.png)

repository: Ferreluke/solinia-docs

repo_name: Ferreluke/solinia-docs


text:
---
title: End to end TFSBuild pattern for BizTalk 2009, part 1 (Environment)
date: 2010-09-26 08:37:58.000000000 +02:00
tags:
  - BizTalk
  - Development Environment
  - Team Build
  - Team Foundation Server
permalink: "/2010/09/26/end-to-end-tfsbuild-pattern-for-biztalk-2009-part-i-environment/"
---

If you read my earlier blog post about a mysterious error from BTSTask you already know that I'm currently helping a customer with automated TFS 2008 builds for BizTalk 2009, if you haven't read my earlier post here's your [chance]({{ site.baseurl }}{% link _posts/2010-09-24-mysterious-error-from-btstask-exe.md %} "mysterious error from btstask").

### Environment

Firstly you'll have to setup some sort of build server and there's at least 3 ways you can do this:

- Have the build server installed separate from the "build BizTalk server"
- Have the build server start a virtual snapshot of a "build BizTalk server"
- Have the build server installed on the "build BizTalk server"
- ???

I typically skip the first option because it usually end up in me having to write some kind of remote execution scripts ([PSExec](http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx)) or starting the scripts with timer jobs.

The second option would be the top choice for me if the customer has [TFS 2010](http://msdn.microsoft.com/en-us/vstudio/ff637362.aspx) and [Lab Management](http://msdn.microsoft.com/en-us/vstudio/ee712698.aspx) in place. I know there are virtualization options for [TFS 2008](http://msdn.microsoft.com/en-us/vstudio/ff637362.aspx) but I've never user them myself.

So this leaves my with the option to have the "build BizTalk server" and the build server on the same box which makes it a lot easier.

Remember that you'll need to install and configure the BizTalk server and remember to install/configure these options during the installation of the BizTalk server:

- **Developer Tools and SDK**
- **Additional Software / Project Build Component** , build component used by TFSBuild.

When the BizTalk server is installed and configured you'll need to make/configure these options:

- The service account for TFSBuild need to be added to the local **Administrators** group, required to install/uninstall assemblies to the GAC.
- The service account for TFSBuild need to be added to the **BizTalk Administrators** group, required to use BTSTask operations.

As a common practice I always create a Hello World build type to test that my build server is working correctly before moving on with any advanced build patterns with automatic deploy for instance.

Hope you'll enjoy this first part of the series!

Hugo

gha_language: HTML

gha_license_id: MIT


text:
# Redux Worker Middleware
[![build status](https://img.shields.io/travis/keyanzhang/redux-worker-middleware/master.svg?style=flat-square)](https://travis-ci.org/keyanzhang/redux-worker-middleware)
[![test coverage](https://img.shields.io/coveralls/keyanzhang/redux-worker-middleware/master.svg?style=flat-square)](https://coveralls.io/github/keyanzhang/redux-worker-middleware?branch=master)
[![npm version](https://img.shields.io/npm/v/redux-worker-middleware.svg?style=flat-square)](https://www.npmjs.com/package/redux-worker-middleware)

Redux + Web Workers = :boom: :construction_worker:

```
npm install --save redux-worker-middleware
```

## Intro

The goal of the middleware is to provide an unopinionated workflow that delegates expensive operations to Web Workers. Thus, please notice that this middleware **doesn't** wrap, transform, or shim Web Workers.

In case you need, webpack's [worker-loader](https://github.com/webpack/worker-loader) is an out of box solution for that.

## ~~API~~ How it works
`redux-worker-middleware` exports a single (default) function `createWorkerMiddleware`. Here are the steps to set it up:

1. Pass it a Web Worker instance and put the returned (curried) function in the middleware chain.
    - Notice that your worker should have the signature of `Action -> Action`; that is, it always takes a complete action and returns a complete action, which can be dispatched right away. It makes the API much simpler.
    - Need to partially update the payload? Sure, just let your worker handle the logic! It has to work anyway.

2. To let the workers work, make sure that your action is [FSA compliant](https://github.com/acdlite/flux-standard-action) and the `action.meta.WebWorker` field is truthy. Otherwise, the middleware will just pass the action along.

3. If an action specifies that it needs to be processed by a worker, The middleware will obey the order. Then when the data comes back, it will be re-dispatched as a new action and be passed through all the middlewares (see [#5](https://github.com/keyanzhang/redux-worker-middleware/pull/5)).

## Demo
I wrote this middleware as part of https://github.com/keyanzhang/repo.cat, where I need to parse a lot of markdown stuff to HTML at runtime. So the real demo can be found there: the Web Worker related parts live in [`actions/DataFetching.js`](https://github.com/keyanzhang/repo.cat/blob/master/src/actions/DataFetching.js), [`middlewares/worker.js`](https://github.com/keyanzhang/repo.cat/blob/master/src/middlewares/worker.js), and [`workers/GFMParserWorker.js`](https://github.com/keyanzhang/repo.cat/blob/master/src/workers/GFMParserWorker.js).

A minimal example can be found as below:

Web Worker: `Add1Worker.js`:
```javascript
self.onmessage = ({ data: action }) => { // `data` should be a FSA compliant action object.
  self.postMessage({
    type: action.type,
    // Notice that we remove the `meta.WebWorker` field from the payload.
    // Since the returned data will be dispatched as a new action and be passed through all the middlewares,
    // keeping the `meta.WebWorker` field may cause an infinite loop.
    payload: {
      num: action.payload.num + 1,
    },
  });
};
```

ActionCreator:
```javascript
export const add1Action = (n) => ({
  type: 'ADD_1',
  meta: {
    WebWorker: true, // This line specifies that the worker should show up and do the job
  },
  payload: {
    num: n,
  },
});

export const add1ActionWithName = (n) => ({
  type: 'ADD_1',
  meta: {
    WebWorker: "named-worker", // This line specifies the exact name of the worker which should handle this action
  },
  payload: {
    num: n,
  },
});
```

Then in your store configuration,
```javascript
import { createStore, combineReducers, applyMiddleware } from 'redux';
import createWorkerMiddleware from 'redux-worker-middleware';

import * as reducers from '../reducers';
import {
  logger,
  thunk,
} from '../middlewares';

const Add1Worker = require('worker!../workers/Add1Worker'); // webpack's worker-loader
const add1Worker = new Add1Worker;

// This unnamed worker will handle all actions with `meta: { WebWorker: true }`
const workerMiddleware = createWorkerMiddleware(add1Worker);

// This named worker will handle all actions with `meta: { WebWorker: "named-worker" }`
const namedWorkerMiddleware = createWorkerMiddleware(add1Worker, "named-worker");

const rootReducer = combineReducers(reducers);

const createStoreWithMiddleware = applyMiddleware(
  workerMiddleware,
  namedWorkerMiddleware,
  thunk,
  logger,
)(createStore);

// ... ...
```

That's it! Now when you fire an `add1Action`, the worker will show up and do the computation. The result (action) will be re-dispatched as a new action and be passed through all the middlewares.

## Notes

For now, we don't really care if you actually pass it a real Worker instance; as long as it look likes a Worker and works like a Worker (i.e., has a `postMessage` method), it _is_ a Worker. The reason behind is that we want to support Web Worker shims in an easy manner.

## License
MIT

repository: bkon/redux-worker-middleware

repo_name: bkon/redux-worker-middleware


text:
  EXPERIMENTAL — WORK-IN-PROGRESS

A pragmatic library for simply connecting [MobX](http://mobxjs.github.io/mobx/) data stores and asynchronous actions to functional stateless React components with a flux-like architecture inspired by `redux`, `react-redux` and `redux-saga`.

![screenshot](screenshot.png)

## Benefits

The intent of the library is to provide straightforward flux-style state management with a pragmatic trade-off between formality and convenience. Keep in mind as you evaluate this approach that your application may be better suited to different trade-offs (i.e. a more formal but less "convenient" alternative).

##### Simple Organization
Conveniently organize state, initializers and action handlers that modify that state together as "models" while retaining the flexibility to keep them separate when that works better.

##### Functional Views
Simply connect your state and actions to pure React components (i.e. props-only) using React context and a straightforward connect wrapper for one-way data flow.

##### Easy Async
Write declarative asynchronous logic naturally using generator functions for managing side effects without forfeiting control.

##### Built-in Efficiency
Built on MobX to efficiently manage the impact of data changes on recalculations and re-renders. MobX makes it easy to write memoizing derived views of your data and structure your application for fine-grained reactive updates without jumping through hoops.

##### Decoupled Testing
Test your functional views independent of your state, test your state independent of your views, and test your actions handlers independent of async dependencies like backend servers elementally without writing extensive mocks.

## Building Blocks

The mobx-reactor building blocks are a `Store`, composed of `Substore` objects, together with `Action` methods connected to React components through a `StoreContext` and a `connect` wrapper.

### Store

A single shared `Store` holds application state and provides a method to `dispatch` actions to affect application logic. The `store` is assembled from `Substore` sub-objects that each define and manage a piece of the application state. A `Store` can be configured with `middleware` that provides an extension point for performing activities like logging and crash reporting.

```javascript
const store = new Store(
  {
    todoList: new TodoList(),
  },
  [
    logger()
  ]
)
```

> The logger currently requires you to first `npm install deep-diff`.

### Substores

A `Substore` provides a construct to organize state in sub-stores with methods that operate on that state in response to relevant actions. A sub-store objects are a vehicle for organization, not encapsulation. While all state is defined through this stores, actions can be defined as part of a store or independently of a store.

```javascript
class TodoList extends Substore {
  @observable todos = map({});

  @computed get unfinishedTodoCount() {
    return this.todos.values().filter(todo => !todo.isFinished).length;
  }

  @action('addTodo')
  addTodo(title) {
    const todo = new Todo(title)
    this.todos.set(todo.id, todo)
    return dispatch('saveTodo')(todo.id)
  }

  @action('saveTodo')
  saveTodo(todoId) {
    return function* () {
      const todo = this.todos.get(todoId)
      try {
        yield call(server.saveTodo)({id: todo.id, title: todo.title})
        return dispatch('todoSaved')({id: todo.id, title: todo.title})
      } catch (error) {
        return dispatch('alertUser')(
          'Your todo could not be saved.',
          {
            detailedMessage: error.toString(),
            onRetry: dispatch('saveTodo')(todoId)
          }
        )
      }
    }.bind(this)()
  }

  @action('toggleTodo')
  toggleTodo(todoId) {
    const todo = this.todos.get(todoId)
    todo.isFinished = !todo.isFinished
  }
}
```

The `@action(type)` decorator declares that the decorated method responds to the named action type. There is no relationship between the method name and the action type.

### Actions

Action handlers may be execute immediately when declared as a regular function or asynchronously when the action handler is defined as a generator function.

> Currently, decorators and generator methods are not cooperating syntactically, but this should be resolved as [the decorator specification is refined and babel incorporates those improvements](https://github.com/babel/babylon/pull/14). The examples show how you can return a bound generator function until the syntactic convenience is available.

#### Generator Actions

Asynchronous tasks are supported in generator actions through an inversion of control that allows the store to step through the yield statements of the generator.

### Store Context

A `StoreContext` component is created to share the store with child components.

```javascript
<StoreContext store={store}>
  <TodoListViewContainer/>
</StoreContext>
```

### Connections

This experiment has as one of its primary goals to enable writing stateless functional ("pure") React components like this one:

```javascript
class TodoListView extends React.Component {
  handleSubmit = (event) => {
    event.preventDefault()
    this.props.addTodo(this.refs.newTodoTitle.value)
    this.refs.newTodoTitle.value = ''
  }
  render() {
    return (
      <div>
        <ul>
          {this.props.todos.values().map(todo =>
            <TodoView
              key={todo.id}
              title={todo.title}
              isFinished={todo.isFinished}
              onToggle={() => this.props.toggleTodo(todo.id)}
            />
          )}
        </ul>
        Tasks left: {this.props.unfinishedTodoCount}
        <form onSubmit={this.handleSubmit}>
          <label><input ref="newTodoTitle" placeholder="Add todo..." /> <button type="submit">Add</button></label>
        </form>
      </div>
    )
  }
}
```

Components written like this can be tested independent of the state management framework and used with other state manage frameworks like Redux.

With `StoreContext` as a parent, child components can be simply and declaratively wrapped with a Connect component that manages the state updates from the Store.

```javascript
const TodoListViewContainer = connect(
  {
    todos: store => store.state.todoList.todos,
    unfinishedTodoCount: store => store.state.todoList.unfinishedTodoCount,
    toggleTodo: store => store.dispatch('toggleTodo'),
    addTodo: store => store.dispatch('addTodo')
  }
)(TodoListView)
```

### Example

Want to try a working example? Here's how!

```
npm install
cd examples/basic
npm install
npm start
```

Note that the `package.json` files in the examples directory do not contain a full list of actual dependencies, but "inherit" dependencies from main mobx-reactor project. This ensures that all modules import the same MobX modules, otherwise there will be an identity crises.

repository: amsb/mobx-reactor

gha_language: JavaScript

repo_name: amsb/mobx-reactor


text:
From the end of July 2020, the following endpoints will no longer be available:

* trigger a tax calculation
* retrieve a tax calculation
* retrieve validation messages associated with a tax calculation

This is because they have been replaced with the [Individual Calculations API](https://developer.service.hmrc.gov.uk/api-documentation/docs/api/service/individual-calculations-api/1.0)

Use these resources to trigger a year-to-date tax calculation for a taxpayer. An update must be provided before a calculation is triggered. When a tax calculation is triggered, a check is made to determine if the taxpayer has met their obligations. To retrieve the status of the taxpayer’s updated obligations, use the obligation endpoints.

A tax calculation must be triggered to assess the update data against obligations. If a tax calculation is not triggered, relevant obligations are not determined even if the update data is valid and complete.
In the sandbox environment, this API returns pre-defined representative responses. These may include fields that are not yet possible to populate via the API.

Here, the developer can:

* trigger a tax calculation
* retrieve the result of a previously performed tax calculation
* retrieve the validation messages associated with a tax calculation

If the tax calculation is successfully triggered, the response _location_ header includes _calculationId_. Use the _calculationId_ to retrieve the tax calculation.

When retrieving a tax calculation returns the HTTP response code 204, the calculation is still in progress and needs to be retrieved again when the `etaSeconds` have elapsed.


text:
# GLOM Kernel Creation

`GLOM` requires latent GP kernels that are at least twice mean-square differentiable in order to ensure that second order derivatives exist for non-trivial model construction. All of the derived versions of the kernels that are necessary can be created using the following function.

```@autodocs
Modules = [GPLinearODEMaker]
Pages   = ["src/kernel_creation_functions.jl"]
```

All of the premade kernels that are included with `GLOM` (in `src/kernels`) were created with this [example script](https://github.com/christiangil/GPLinearODEMaker.jl/blob/master/examples/creating_kernels.jl)

gha_language: Julia


text:
---
title: Transport - JSON response
lang: en-US
---

## Server side

1. Specify HTTP header
`Content-Type` = `application/json`

2. Add `_x_http_debug` object to your json response

This object SHOULD contain all required scheme fields.

You can use any json data protocol, for example [json-rpc](https://www.jsonrpc.org/specification), or
your own.

:::tip example response with json-rpc
```json
{
    "jsonrpc": "2.0",
    "result": 19,
    "id": 4,
    "_x_http_debug": {
        "uuid": "ef95a542-25a3-4f71-a0e9-640c92f43813",
        "version": 1,
        "events": [
            {
                "type": "log",
                "time":<PHONE_NUMBER>177,
                "importance": 1,
                "payload": {
                    "message": "User X is try to login to admin panel",
                    "group": "php:app_03"
                }
            }
        ]
    }
}
```
:::

gha_language: Vue


text:
### Example app

Home component, method

```diff
@@ src/views/Home.vue
-    <button @click="handleExtract">Extract</button>
+    <button @click="extractNumber">Extract</button>

   methods: {
-    handleExtract() {
-      const index = Math.floor(Math.random() * this.availableNumbers.length);
-      const extracted = this.availableNumbers.splice(index, 1);
-      this.extractedNumbers = this.extractedNumbers.concat(extracted);
-    },
+    ...mapMutations(['extractNumber']),
   },
```

<aside class="notes">
Our last change is in the methods, mapping the mutations from the store and using
that mutation as handler of the button click.

When a user clicks on the button, the store will automatically commit
that mutation, changing the store state and triggering a re-render of our component,
because with "mapState" and "mapGetters" we are listening to changes in the store
to our mapped values.
</aside>

branch_name: refs/heads/denny


text:
# Things I Did
* Contemplated AABB collision detection
	* Got as far as sketches and stubs
    * Need more time/awakeness and forthought
* Attempted to implement a "follow" AI behavior
	* Decided *behavior* is a better term than *ai*
    * Needed a way to reference another entity
    	* Did **NOT** want to do more filters/finds!
        * ...but what about hash lookups? (see dicussion below)
* Converted the world from *vector of entities* to *map of entities*, using their "id" as a key.
	* used `reduce-kv`, which gives the added benefit of having access to the in-progress entities in the reduce function
    * Need to investigate
* Used this to implement `follow` as `(follow [entity target offset)` which I *REALLY* like/grok.
* Swapped out the `input` component for this `ai/follow` component and IT WORKED!
	* This feels really good

# Map of Entities versus Vector of Entities
I don't know why I didn't pick this up from [Chocaltier](https://github.com/alexkehayias/chocolatier) and the corresponding talk.

Instead of a vector we need to iterate and map to find a single entity, we can use a map with an identifier as the key. As Clojure uses HashMaps above a certain size, this has the beneits of O(1) lookup.

Iterating hasn't been a problem now with the isolated entities, but is starting to now that they can reference each other, or we need to get certain utility entities we should just be able to reference directly.

## Collision Detection
I have been dreading this as well. I know from my experience with [Chipmunk](https://github.com/slembcke/Chipmunk2D) (this is still active!!!) that a spatial hash-map is a great optimization for rapidly culling the number of pairs of objects to test for collision, however I've been struggling on a way to do this in my ECS/FRP/functional paradigm.

But! Now that I have entities in a hash by their ID, I can make a new component, `space` or something, that holds a spatial hashmap, where each bin holds the keys of the entities in that region.

The `collision` (or a separate `spatial`), will be responsible for updating this component state, grabbing the `:position` and `:bounding` components of entities and computing their binning, storing their keys in each bin.

When permutating pairs, the `collision` system will grab the keys from each bin (O(1)), lookup those entities (O(1)), then call each pair (O(n^2)).

repository: sctincman/cljs-game

repo_name: sctincman/cljs-game


text:
# Timeseries Decomposer

A tool for decomposing arbitrary timeseries into components.

# Author

Daniel Wysocki

# License

MIT License - Copyright (c) 2016

repository: dwysocki/timeseries-decomposer

gha_language: Python

repo_name: dwysocki/timeseries-decomposer


text:
Role Name
=========

Collection of utils to get secrets from an S3 bucket

Requirements
------------

Requires Ansible 2.0 or higher.

Role Variables
--------------

* `ansible_secrets_directory`: The directory in which secrets are stored
* `ansible_secrets_url`: The S3 URL from which to download the file
* `ansible_secrets_file`: The filename in which the above secret is stored
* `ansible_secrets_username`: The username that owns the secret
* `ansible_secrets_groupname`: the groupname that owns the secret

Dependencies
------------

Probably docker :-)

Example Playbook
----------------

    - hosts: foo
      roles:
         - role: dieswaytoofast.ansible_secrets

License
-------

BSD

Author Information
------------------

Mahesh Paolini-Subramanya (@dieswaytoofast)


text:
# Akonus
Eclipse Phase RPG Utilities

These tools are designed to be used by people running the Eclipse Phase Role Playing Game.

https://eclipsephase.com/

https://www.drivethrurpg.com/product/284022/Eclipse-Phase-Second-Edition

The latest published version of this site can be found here: https://theautotard.com/EP/

repository: CodexofRome/Akonus

repo_name: CodexofRome/Akonus


text:
---
layout: page
title: Decision making for disaster response
img: assets/img/IDR3/datavisual.jpg
description: data visualization
category: 2021
---

        {% include figure.html path="assets/img/IDR3/datavisual.jpg" alt = "Glowing globe representing information and data" class="img-fluid" %}

## Overview
**Roles:** Interviewing, Works-like Prototype
**Skills:** User Interviews, Natural Language Processing, Speech Recognition, Data Visualization, Python, Google Cloud API
**Time:** January - May 2021
**Team:** 5 (MechE, CogSci, DataSci, Business)

Developed as part of ME292C, Innovation in Disaster Response, Recovery, and Resilience. I conducted several stakeholder interviews and led the development of the prototype for NLP-based tagging and spatial mapping.

## The Problem
**For this project, we focused on information sharing for decision-makers in disaster response scenarios, working with NIWC Pacific.**
See intro video [here](https://www.youtube.com/watch?v=Ht6Z9KFl1yE).

## The Process

        {% include figure.html path="assets/img/IDR3/AfterExplainer.png" alt = "Description of interviews, pain points, and market research. Introducing final prototype" class="img-fluid" %}

## The Result
See [audio-only prototype](https://www.youtube.com/watch?v=zcWoiJ9FfkA).

        {% include figure.html path="assets/img/IDR3/AfterZachPrototype.png" alt = "NLP Prototype with Audio and Text" class="img-fluid" %}

See [text-only prototype](https://www.youtube.com/watch?v=3I1f-lYJSmY).

        {% include figure.html path="assets/img/IDR3/AfterAnanyaPrototype.png" alt = "Future Steps" class="img-fluid" %}

The integrated example of audio and text tagging and mapping is shown below:

## Reflection
It was interesting to work with NIWC on this project because they had a lot of domain expertise on the technical side, while we took a more user-centric approach to this complex problem. I think we were able to blend together both sides into our final prototypes, although it is likely that some of the problems such as latency and low-bandwidth in communication have to be solved by those with more technical expertise.


text:
# Paste to Apple Note Shortcut

- [**RoutineHub Page**](https://routinehub.co/shortcut/11079)
- [iCloud Share Link](https://www.icloud.com/shortcuts/0e3e7206924f46b1b09d7bc3e0fcb45f)
- [GitHub Issue](https://github.com/extratone/i/issues/144)
- [Showcuts](https://showcuts.app/share/view/0e3e7206924f46b1b09d7bc3e0fcb45f)

## Social
- [Telegram](https://t.me/extratone/10190)
---

## Create a new Apple Note with a set number of items from Paste as a list.

![Paste to Apple Note](https://user-images.githubusercontent.com/43663476/153743276-3fced068-be19-4ea7-96bf-f9bd09e57ca0.png)

## Requirements
- [Paste](https://apps.apple.com/us/app/paste-clipboard-manager/id967805235) (macOS and/or iOS)

This shortcut will copy a set number of items from Paste to a new Apple Note entitled "Paste Backup" with a  timestamp. You will asked to specify the default number of items to copy upon installation as well as the folder for the Apple Note.

It should function on both macOS and iOS.

---

* [Contact Card](https://davidblue.wtf/db.vcf)
* [Telegram](https://t.me/extratone)
*<EMAIL_ADDRESS>
* [Twitter](https://twitter.com/NeoYokel)
* [Mastodon](https://mastodon.social/@DavidBlue)
* [Discord](https://discord.gg/0b9KQUKP858b0iZF)
* [*Everywhere*](https://raindrop.io/davidblue/social-directory-21059174)...

license: Unlicense

url: https://raw.githubusercontent.com/extratone/i/bf415b3d9ed120d9128379b2da2c5d83c5e9da0f/shortcuts/Paste to Apple Note Shortcut.md

repository: extratone/i

branch_name: refs/heads/main

filename: Paste to Apple Note Shortcut.md

repo_name: extratone/i


text:
# Security Policy

## Supported Versions

| Version | Supported          |
| ------- | ------------------ |
| 0.0.2   | :x: |
| 0.0.1   |  :white_check_mark:               |

## Reporting a Vulnerability

Use Issues, please

repository: AirDur/back-end-cuisine

repo_name: AirDur/back-end-cuisine


text:
---
layout: post
title: "Robustness of Generalized Learning Vector Quantization Models against Adversarial Attacks"
date: 2019-02-01 22:28:56
categories: arXiv_AI
tags: arXiv_AI Adversarial
author: Sascha Saralajew, Lars Holdijk, Maike Rees, Thomas Villmann
mathjax: true
---

* content
{:toc}

##### Abstract
Adversarial attacks and the development of (deep) neural networks robust against them are currently two widely researched topics. The robustness of Learning Vector Quantization (LVQ) models against adversarial attacks has however not yet been studied to the same extend. We therefore present an extensive evaluation of three LVQ models: Generalized LVQ, Generalized Matrix LVQ and Generalized Tangent LVQ. The evaluation suggests that both Generalized LVQ and Generalized Tangent LVQ have a high base robustness, on par with the current state-of-the-art in robust neural network methods. In contrast to this, Generalized Matrix LVQ shows a high susceptibility to adversarial attacks, scoring consistently behind all other models. Additionally, our numerical evaluation indicates that increasing the number of prototypes per class improves the robustness of the models.

##### Abstract (translated by Google)

##### URL
[http://arxiv.org/abs/1902.00577](http://arxiv.org/abs/1902.00577)

##### PDF
[http://arxiv.org/pdf/1902.00577](http://arxiv.org/pdf/1902.00577)


text:
RIoT Control is a tool that automates the deployment of your Java code to a Raspberry Pi or similar device. It finds your device on a local network, copies your java archives to it, creates a service configuration file, and starts your application or sets it as a service.

Currently, it is only available as a plugin for the [SBT] build tool.

## Creating an empty RIoT project

The easy way first: There's a template that will create an empty project that's already set up. After [installing sbt], execute the following from your root git directory or similar:

```
sbt new riot-framework/streams.g8
```

Check the template's [github template][streams.g8] for more details.

## Configuring your existing project to use RIoT Control

If you have an existing SBT project, add `sbt-riotctl` to your `project/plugins.sbt`file:

```
addSbtPlugin("org.riot-framework" % "sbt-riotctl" % "0.3")
```

RIoT Control depends on SBT's `JavaServerAppPackaging`, and will only be active if you've enabled it in your `build.sbt`:

```
enablePlugins(JavaServerAppPackaging)
```

In general, RIoT Control will then try to use sane default for everything, including the host name, username, and password used to log in to your Pi (it will use Raspbian's defaults). If you need to override any of them, add the corresponding configuration to your project's settings in `build.sbt`, for example:

```scala
lazy val root = (project in file("."))
  .enablePlugins(JavaServerAppPackaging)
  .settings(

    // Deployment Targets (hostname, username, password):
    riotTargets := Seq(
      riotTarget("raspberrypi", "pi", "raspberry")
      ),

    // Port to use for remote debugging:
    riotDbgPort := 8000,

    // Packages and features needed by your code:
    riotPrereqs := "oracle-java8-jdk wiringpi",
    riotRequiresI2C := false,
    riotRequiresSPI := false

  )
```

## Deploying your application

RIoT Control will deploy the files generated by SBT in the `stage` directory, and use the scripts generated by `JavaServerAppPackaging` to start your Application.

To copy your application to your device and run it:

```
sbt riotRun
```
Then press [Return] twice to terminate it.

To debug your application, similarly run:

```
sbt riotDebug
```
and point your Remote Debugger to the device's address and the port defined in the `riotDbgPort` setting (e.g. `raspberrypi.local:8000`).

If you want run the application in the background:

```
sbt riotStart
```
then stop it with:

```
sbt riotStop
```

Once you're happy with the result, you can enable the Service that RIoT has created for your Application, which will cause it to start automatically when your device boots:

```
sbt riotInstall
```
To disable it, use the command:

```
sbt riotUninstall
```

In general, if issuing more than one command, it's considerably faster to start SBT in interactive mode:

```
sbt
```

then enter the commands above (without sbt, for example just `riotRun`). This allows for quick development: Modify your code in the editor, then change to your terminal and execute `riotRun` in the interactive SBT shell.

Many IDE have some sort of plugin to integrate with SBT, speeding up the development cycle even more.

## Troubleshooting deployment issues

Problems tend to arise most often when installing prerequisite packages. This only happens during the first deployment of an Application, and may take a long time depending on the packages installed.

##### Out of memory when installing prerequisite packages

As the apt-get traffic is proxied through the installation tool (your Pi may not have internet access), it may run out of memory when downloading large packages (such as the Java JDK). The following error is an indication that this is happening:

```
[info] E: Failed to fetch http://debian.anexia.at/raspbian/raspbian/pool/main/o/openjdk-11/openjdk-11-jdk-headless_11.0.3+7-5_armhf.deb  Connection failed [IP: <IP_ADDRESS> 8080]
[info] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
```

If this is the case, make sure `sbt` has enough memory. The easiest way to do this is to add a file named `.jvmopts` in your project's root directory:

```
-Xms1024M
-Xmx4096M
-Xss2M
-XX:MaxMetaspaceSize=1024M
```

##### Message 'Release file ... is not valid yet'

A freshly installed Pi without internet access will have a system date that is far in the past. RIoT tries to detect this and set the time to your development machine's time, but if this fails for some reason, subsequent package installations will fail with rather confusing messages such as:

```
[info] E: Release file for http://raspbian.raspberrypi.org/raspbian/dists/buster/InRelease is not valid yet (invalid for another 80d 10h 26min 56s). Updates for this repository will not be applied.
```

In this case, make sure your Pi's system clock is somewhat correct. It may help to wait for a while after the Raspberry Pi has booted, to allow it to synchronise to internet time sources or others.

## What happens during deployment

RIoT control runs after `JavaServerAppPackaging`, and uses the files it generates.

First, it checks that the **prerequisite packages** defined in the `riotPrereqs` setting are installed (by default the JDK 8 and the WiringPi library), and otherwise installs them with `apt-get`. A local SOCKS5 proxy is started locally through which `apt-get` accesses the package repositories, so this step works even if your Pi has no direct internet access (this is often the case if it's connected directly to your laptop).

Then, it checks that certain **features**, such as **SPI** or **I2C** ports, are enabled, depending on the `riotRequires...` settings.

Next, the `stage` directory is copied, in which `JavaServerAppPackaging` has built or copied all JARs, and generated start scripts. The target directory on the Pi is `/usr/local/` followed by your project's name.

A systemd 'service unit configuration' file is generated in `/etc/systemd/system/` and named after your project (followed by `.service`, as is the convention).

This systemd service is then started, stopped, enabled or disabled depending on the RIoT Control command issued.

## How RIoT Control finds your Pi

RIoT Control will first try to access your Raspberry Pi by Hostname (e.g. if it is called 'raspberrypi', RIoT Control will attempt to connect to `raspberrypi` and `raspberrypi.local`).

If this fails, then RIoT Control will attempt to use **mDNS** (a service provided by **Bonjour** / **Zeroconf**) to discover an SSH service with the name provided. If your Raspberry Pi has the Avahi service installed and running (this is the case by default), it will publish its SSH port this way, as well as its current IP address.

[sbt]: https://www.scala-sbt.org
[installing sbt]: https://www.scala-sbt.org/1.x/docs/Setup.html
[streams.g8]: https://github.com/riot-framework/streams.g8
[riot-core]: https://github.com/riot-framework/riot-core
[sbt-riot]: https://github.com/riot-framework/sbt-riotctl
[riot]: https://riot.community
[akka streams]: https://doc.akka.io/docs/akka/current/stream/stream-quickstart.html
[giter8]: http://www.foundweekends.org/giter8/
[systemctl]: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

repository: riot-framework/sbt-riotctl

repo_name: riot-framework/sbt-riotctl


text:
This is a small python application, meant to run as a CGI script, to memorize names with photos via flashcard.  This is designed to solve a problem of my own: the desire to have pervasive, platform-independent, flashcard capacity for memorizing student names.

There are millions of apps for such purposes, but this one is mine, and it's very simple.  Give it some student names and picture filenames in JSON format.  Stick the files in the same folder.  Then go to it from any web browser.  It'll display pictures at random and a prompt to enter first and last name, or skip.  If you get it wrong, it shows the picture again.  If you get it right, it'll go to the next one.  If you skip, it'll display the answer then go to the next one.

Usage: make a JSON like the example.  Put a password in the beginning.  Stick it in a cgi-bin somewhere with the extension changed to cgi.  Go to that URL, appending ?file=YOURFILENAME&pw=YOURPASSWORD to the end.  (no .json on your filename).  Stick the images in a different, non-cgi, directory (otherwise apache sometimes barfs).  Go to town.

Free to all under the MIT license.

Note: for security and student privacy purposes, all files should be located in password-protected directories if it's on a publicly accessible webserver.  It's your responsibility to adequately secure this stuff.  The password at the beginning of the JSON is an extra layer of security, but it's a really weak and dumb layer (it's stored in clear and passed via http GET for goodness's sakes, although it shouldn't be too hard to change those things), and should not be relied upon.

Why?

New functionality: it will also keep your score, so that you can see the students with whom you're struggling the most.  And there are two modes: uniform pick gives you each student with equal probability, weighted pick gives you the students whose names you have the most trouble with more often.  The weighting function is a little gnarly, so it might blow up, just let me know if it does.  Also, I don't *think* it'll run into horrible basins of attraction that just display the same student over and over, most of the gnarliness of the weights function is an attempt to prevent that, but I haven't actually tested it over large iterations, so if it does, just use uniform.

The MIT License (MIT)

Copyright (c) 2015, Paul Gowder

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

repository: paultopia/memNames

repo_name: paultopia/memNames


text:
.vimrc
===
This repository contains `.vimrc` file which is the configuration file for Vim.
The configuration aims to provide both `Vim` and `NeoVim` config.

Requirements
---
- `git`
- `exuberant-ctags`
- `python`
- `cmake` (optional)
- `clang` (optional)
- `go` (optional)
- `rust` (optional)
- `cargo` (optional)
- `npm`

Installation
---
- Create a symlink from your local `.vimrc`:
  ``` bash
  cd ~
  ln -s <dir>/.vimrc
  ```
- Install [vim-plug](https://github.com/junegunn/vim-plug) - a package manager:
  ``` bash
  curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  ```
- After first run of `vim` you can update your plugins by `:PlugUpdate`.

repository: tlaziuk/vimrc

repo_name: tlaziuk/vimrc


text:
> easy to switch audio(speaker and mic)

[![](https://img.shields.io/badge/version-v2.0-green)](./Switch%20Audio.alfredworkflow)

just input `sound` or `voice`

![](./screenshot.gif)

support switch to airplay

[Please click here](https://gist.github.com/alanhg/21f7fd110e0bdac1d0cce66ca40e78ea) If you want to know how to realize it with Apple Script.

repository: alphajx/alfred-workflows

repo_name: alphajx/alfred-workflows


text:
---
layout: default
---

# 1996-02-22 - Re: BIG JAVA SECURITY HOLE

## Header Data

From: "Perry E. Metzger"<EMAIL_ADDRESS>To: "Robichaux, Paul E"<EMAIL_ADDRESS>Message Hash: 4ee6287f0e0d33b89e0163400974c919ee89840bf781c8f285a607867abb52d1

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-02-22 03:39:07 UTC

Raw Date: Wed, 21 Feb 96 19:39:07 PST

## Raw message

```
{% raw  %}From: "Perry E. Metzger"<EMAIL_ADDRESS>Date: Wed, 21 Feb 96 19:39:07 PST
To: "Robichaux, Paul E"<EMAIL_ADDRESS>Subject: Re: BIG JAVA SECURITY HOLE
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Well, folks, I told you so. Sorry to be nasty about it.

> Date: Sun, 18 Feb 1996 23:57:02 -0500
> From: Drew Dean<EMAIL_ADDRESS>> Subject: Java security problems
>
> We have discovered a serious security problem with Netscape Navigator's 2.0
> Java implementation.  (The problem is also present in the 1.0 release of the
> Java Development Kit from Sun.)  An applet is normally allowed to connect
> only to the host from which it was loaded.  However, this restriction is not
> properly enforced.  A malicious applet can open a connection to an arbitrary
> host on the Internet.  At this point, bugs in any TCP/IP-based network
> service can be exploited.  We have implemented (as a proof of concept) an
> exploitation of an old sendmail bug.
[...]
> A second, also serious, bug exists in javap, the bytecode
> disassembler.  An overly long method name can overflow a stack
> allocated buffer, potentially causing arbitrary native code to be
> executed.  The problem is an unchecked sprintf() call, just like the
> syslog(3) problem last year.
[...]

{% endraw %}
```

## Thread

+ Return to [February 1996](/archive/1996/02)

+ Return to<EMAIL_ADDRESS>(Mike McNally)](/authors/m5_at_dev_tivoli_com_mike_mcnally_)"
+ Return to "["Perry E. Metzger" <perry@piermont.com>](/authors/perry_e_metzger_perry_at_piermont_com_)"
+ Return to "["Robichaux, Paul E" <perobich@ingr.com>](/authors/robichaux_paul_e_perobich_at_ingr_com_)"

+ 1996-02-22 (Thu, 22 Feb 1996 20:03:23 +0800) - [Big Java security hole](/archive/1996/02/f3ddf4816cf1561d27ade08a685cc0fee5a2891f952f7fe14b7e9f3bf5be5fa5) - _"Robichaux, Paul E"<EMAIL_ADDRESS>  + 1996-02-22 (Wed, 21 Feb 96 19:39:07 PST) - Re: BIG JAVA SECURITY HOLE - _"Perry E. Metzger"<EMAIL_ADDRESS>  + 1996-02-22 (Thu, 22 Feb 1996 22:06:17 +0800) - [Re: BIG JAVA SECURITY HOLE](/archive/1996/02/fa10a50f7ea243e451e106ac8edb8f006df76c202d78ece33e74c8fdd2b8031d) -<EMAIL_ADDRESS>(Mike McNally)_