text:
# Home-Assistant Custom Components

Some of my custom components for home-assistant. (http://www.home-assistant.io)

[![Buy me a coffee via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.me/cyberjunkynl/)

Component Overview
------------------
  * [TOON Thermostat climate component](#toon-thermostat-climate-component)
  * [TOON Smart Meter sensor component](#toon-smart-meter-sensor-component)
  * [TOON Boiler Status sensor component](#toon-boiler-status-sensor-component)
  * [SolarPortal sensor component](#solarportal-sensor-component)
  * [Battefield1 Stats component](#battefield1-stats-component)
  * [P2000 Emergency Services component](#p2000-emergency-services-component)
  * [Fritzbox_callmonitor Notification example](#fritzbox_callmonitor-notification-example)
  * [Remarks component](#remarks-component)
  * [arp-scan Device Tracker component](#arp-scan-device-tracker-component)
  * [Plugwise component](#plugwise-component)
  * [TheThingsNetwork Gateway status component](#thethingsnetwork-gateway-status-component)
  * [HVCGroep Garbage Collect sensor component](#hvcgroep-garbage-collect-sensor-component)
  * [Volkswagen Carnet component](#volkswagen-carnet-component)

## TOON Thermostat climate component

NOTE: This component only works with rooted TOON devices.
Toon's are Thermostats sold by Eneco a Dutch energy company.

More information about preparing for usage with this component can be found here:
[Eneco TOON as Domotica controller](http://www.domoticaforum.eu/viewforum.php?f=87)

This component reads the Thermostat Mode, Current Temperature and it's Setpoint.
You can also control the thermostat Mode and Setpoint. (target temperature)

### Installation

- Copy directory `toon_climate` to your `<config dir>/custom_components` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

climate:
  - platform: toon_climate
    name: Toon Thermostat
    host: IP_ADDRESS
    port: 10080
    scan_interval: 10
```

Configuration variables:

- **name** (*Optional*): Name of the device. (default = 'Toon Thermostat')
- **host** (*Required*): The hostname or IP address on which the Toon can be reached.
- **port** (*Optional*): Port used by your Toon. (default = 10080)
- **scan_interval** (*Optional*): Number of seconds between polls. (default = 60)

### Screenshot

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/toon.png "Screenshot")

## TOON Smart Meter sensor component

NOTE: This component only works with rooted TOON devices.

It reads Smart Meter data from your TOON, gathered by the meteradapter.

### Installation

- Copy directory `toon_smartmeter` to your `<config dir>/custom_components` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

sensor:
  - platform: toon_smartmeter
    host: IP_ADDRESS
    port: 10080
    scan_interval: 10
    resources:
      - gasused
      - gasusedcnt
      - elecusageflowpulse
      - elecusagecntpulse
      - elecusageflowlow
      - elecusagecntlow
      - elecusageflowhigh
      - elecusagecnthigh
      - elecprodflowlow
      - elecprodcntlow
      - elecprodflowhigh
      - elecprodcnthigh
      - elecsolar
      - elecsolarcnt
      - heat
```

Configuration variables:

- **host** (*Required*): The hostname or IP address on which the TOON can be reached.
- **port** (*Optional*): Port used by your TOON. (default = 10080)
- **scan_interval** (*Optional*): Number of seconds between polls. (default = 10)
- **resources** (*Required*): This section tells the component which values to display, you can leave out the elecprod values if your don't generate power and the elecusage*pulse types if you use the P1 connection.

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/toon-smartmeter-badges.png "Toon SmartMeter Badges")

If you want them grouped instead of having the separate sensor badges, you can use this in your `groups.yaml`:

```yaml
# Example groups.yaml entry

Smart meter:
  - sensor.toon_gas_used_last_hour
  - sensor.toon_gas_used_cnt
  - sensor.toon_power_use_cnt
  - sensor.toon_power_use
  - sensor.toon_p1_power_prod_low
  - sensor.toon_p1_power_prod_high
  - sensor.toon_p1_power_prod_cnt_low
  - sensor.toon_p1_power_prod_cnt_high
  - sensor.toon_p1_power_use_cnt_pulse
  - sensor.toon_p1_power_use_cnt_low
  - sensor.toon_p1_power_use_cnt_high
  - sensor.toon_p1_power_use_low
  - sensor.toon_p1_power_use_high
  - sensor.toon_p1_power_solar
  - sensor.toon_p1_power_solar_cnt
  - sensor.toon_p1_heat
```

### Screenshots

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/toon-smartmeter.png "Screenshot Toon SmartMeter")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/toon-smartmeter-graph-gasused.png "Graph Gas Used")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/toon-smartmeter-graph-poweruselow.png "Graph Power Use Low")

## TOON Boiler Status sensor component

NOTE: This component only works with rooted TOON devices. And installed BoilerStatus app via ToonStore.

It reads OpenTherm Boiler data from your TOON, gathered by the thermostat adapter.

### Installation

- Copy directory `toon_boilerstatus` to your `<config dir>/custom_components` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

sensor:
  - platform: toon_boilerstatus
    host: IP_ADDRESS
    port: 10080
    scan_interval: 10
    resources:
      - boilersetpoint
      - boilerintemp
      - boilerouttemp
      - boilerpressure
      - boilermodulationlevel
      - roomtemp
      - roomtempsetpoint
```

Configuration variables:

- **host** (*Required*): The hostname or IP address on which the TOON can be reached.
- **port** (*Optional*): Port used by your TOON. (default = 10080)
- **scan_interval** (*Optional*): Number of seconds between polls. (default = 10)
- **resources** (*Required*): This section tells the component which values to display and monitor.

By default the values are displayed as badges.

If you want them grouped instead of having the separate sensor badges, you can use this in your `groups.yaml`:

```yaml
# Example groups.yaml entry

Boiler Status:
  - sensor.toon_boiler_intemp
  - sensor.toon_boiler_outtemp
  - sensor.toon_boiler_setpoint
  - sensor.toon_boiler_pressure
  - sensor.toon_boiler_modulation
  - sensor.toon_room_temp
  - sensor.toon_room_temp_setpoint
```

### Screenshots

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/toon-boilerstatus.png "Screenshot Toon Boiler Status")

## SolarPortal sensor component

NOTE: API seem to have changed, need new reverse engineering!

> Dear Customers,

> Omnik old version APP has removed,and no running anymore. Please
> download new APP version (Omnik Portal) from the App Store.

> If you use Android system, please go to Google play download:
> "Omnik Portal"
> https://play.google.com/store/apps/details?id=com.jialeinfo.omniksolar&hl=en

> If you use iOS system, please go to iOS App store download:
> "Omnik Portal"
> https://itunes.apple.com/cn/app/id1246117091

> Thank you so much for your notice.

> Omnik Team

There are several solarpower portals storing you power generation data using the same API.
You can query the information uploaded by your solarpanels.
I have a Omnik inverter and so I'm using it with omnikportal, only one I tested it with.

### Installation

- Copy directory `solarportal` to your `<config dir>/custom_components` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

sensor:
  - platform: solarportal
    host: www.omnikportal.com
    port: 10000
    username: PORTAL_LOGIN
    password: PORTAL_PASSWORD
    scan_interval: 30
    resources:
      - actualpower
      - energytoday
      - energytotal
      - incometoday
      - incometotal
```

Configuration variables:

- **host** (*Required*): The website url of the portal to query for the list below.
 * [www.omnikportal.com](http://www.omnikportal.com)
 * [www.ginlongmonitoring.com](http://www.ginlongmonitoring.com)
 * [log.trannergy.com](http://log.trannergy.com)
 * [www.solarmanpv.com](http://www.solarmanpv.com)
- **port** (*Optional*): Port in use by the portal API. (default = 10000)
- **username** (*Required*): The login name for the website, normally this is an email address.
- **password** (*Required*): Your password for the website.
- **scan_interval** (*Optional*): Number of seconds between polls. (default = 30)
- **resources** (*Required*): This section tells the component which values to display.

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/solarportal-badges.png "SolarPortal Badges")

If you want them grouped instead of having the separate sensor badges, you can use this in your `groups.yaml`:

```yaml
# Example groups.yaml entry

OmnikPortal Solar:
  - sensor.solar_actual_power
  - sensor.solar_energy_today
  - sensor.solar_energy_total
  - sensor.solar_income_today
  - sensor.solar_income_total
```

### Screenshots

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/solarportal.png "Screenshot SolarPortal")

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/solarportal-graph.png "Graph Actual Power")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/solarportal-graph-income.png "Graph Total Income")

## Battefield1 Stats component

I'm playing BF1 sometimes, and notices there was an bf1stats api available, so I wrote a small component to query and log the number of online players.
I could have done this with a few rest sensor type sensors, but I didn't find out a way to calculate a total count this way, from all the different platform counters.
So this is what this component does and combine them into one sensor.

### Installation

- Copy directory `bf1stats` to your `<config dir>/custom_components` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

sensor:
  - platform: bf1stats
```

Configuration variables:

- **None**

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/bf1stats-badge.png "BF1Stats Badge")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/bf1stats-graph.png "BF1Stats Graph")

## P2000 Emergency Services component

This component queries the portal http://feeds.livep2000.nl every interval seconds, and check it's output against the parameters set in the config.
It's only based on Dutch services.
When matched service calls are found the sensor state gets filled, so you can trigger automation, display sensor data, and even plot in on map (see example below)

### Installation
- Copy directory `p2000` to your `<config dir>/custom_components` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

sensor:
  - platform: p2000
    regios: 18
    disciplines: 1,2,3,4
    radius: 15000
    scan_interval: 20

  - platform: p2000
    name: Amsterdam
    regios: 13
    disciplines: 1,2,3,4
    radius: 10000
    scan_interval: 10
    latitude: 52.3680
    longitude: 4.9036
```

Configuration variables:

- **regios** (*Required*): You have to specify at least one, if you want more seperate them by commas.
 * 1 = Groningen
 * 2 = Friesland
 * 3 = Drenthe
 * 4 = IJsselland
 * 5 = Twente
 * 6 = Noord en Oost Gelderland
 * 7 = Gelderland Midden
 * 8 = Gelderland Zuid
 * 9 = Utrecht
 * 10 = Noord Holland Noord
 * 11 = Zaanstreek-Waterland
 * 12 = Kennemerland
 * 13 = Amsterdam-Amstelland
 * 14 = Gooi en Vechtstreek
 * 15 = Haaglanden
 * 16 = Hollands Midden
 * 17 = Rotterdam Rijnmond
 * 18 = Zuid Holland Zuid
 * 19 = Zeeland
 * 20 = Midden- en West-Brabant
 * 21 = Brabant Noord
 * 22 = Brabant Zuid en Oost
 * 23 = Limburg Noord
 * 24 = Limburg Zuid
 * 25 = Flevoland
- **disciplines** (*Optional*): Disciplines to display, separate them by commas. (default = 1,2,3,4)
 * 1 = Brandweer
 * 2 = Ambulance
 * 3 = Politie
 * 4 = KNRM
- **radius** (*Optional*): Only display on calls within this range in meters, it uses the lat/lon from your home-assistant.conf file as center or the optional values. (default = 5000)
- **scan_interval** (*Optional*): Check every x seconds. (default = 30)
- **name** (*Optional*): Name for sensor.
- **lat** (*Optional*): Latitude of center radius.
- **lon** (*Optional*): Longitude of center radius.

It triggers only on new messages, at a home-assistant restart old messages are skipped.

You can use a state trigger event to send a push notification like this:
```yaml
# Example automation.yaml entry

automation:
  - alias: 'P2000 Bericht'
    trigger:
      platform: state
      entity_id: sensor.p2000
    action:
      - service_template: notify.html5
        data_template:
          title: "P2000 Bericht"
          message: "{{ states.sensor.p2000.state}}"
          data:
            url: "https://www.google.com/maps/search/?api=1&query={{ states.sensor.p2000.attributes.latitude }},{{ states.sensor.p2000.attributes.longitude }}"
```

Above is for html5 nofity, you can click the notify message to open google maps with the lat/lon location if available in the p2000 message.

### Screenshots

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/p2000sensor.png "Screenshot")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/p2000map.png "Screenshot")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/p2000multi.png "Screenshot")

NOTE: When migrating from old P2000 platform component do the following:
- Delete <config dir>/custom_components/p2000.py
- Copy p2000 directory to <config dir>/custom_components
- Change your configuration entry move p2000: to sensor section.
- Give platform name p2000.
- Rename 'distance' to 'radius' and 'interval' to 'scan_interval'.
- Add optional extra sensors with different lat/lon and regios/disciplines entries.
- Change automation to use state triggers instead of event trigger.

Lovelace cards:

```yaml
cards:
      - entity: sensor.p2000
        icon: 'mdi:ambulance'
        name: P2000 Dordrecht
        type: sensor
      - entity: sensor.amsterdam
        icon: 'mdi:fire-truck'
        name: P2000 Amsterdam
        type: sensor
      - default_zoom: 7
        entities:
          - entity: sensor.p2000
          - entity: zone.home
          - entity: sensor.amsterdam
        title: P2000 Dordrecht & Amsterdam
        type: map
```

## Fritzbox_callmonitor Notification example

This is not a new component but an example automation config useable together with the fritzbox_callmonitor component.
The example below will generate several messages depending on status of the event.

```yaml
# Example configuration.yaml entry

- platform: fritzbox_callmonitor
```

```yaml
# Example automation.yaml entry

- alias: 'Phone Status'
  trigger:
    platform: state
    entity_id: sensor.phone
  action:
    - service: notify.pushover
      data:
        title: "Phone"
        message: >
          {% if is_state( "sensor.phone", "ringing" ) %}
            {% if states.sensor.phone.attributes.from %}
              Ringing on incoming call from {{ states.sensor.phone.attributes.from }}.
            {% else %}
              Ringing on incoming call from an Unknown or Hidden number.
            {% endif %}
          {%-elif is_state( "sensor.phone", "talking" ) %}
            Call answered.
          {%-elif is_state( "sensor.phone", "dialing" ) %}
            Calling {{ states.sensor.phone.attributes.to }} with {{ states.sensor.phone.attributes.device }}.
          {%-elif is_state( "sensor.phone", "idle" ) %}
            {% if states.sensor.phone.attributes.duration | int > 59 %}
              Phone call ended, duration was {{ (float(states.sensor.phone.attributes.duration) / 60) | round }} Minute(s).
            {% else %}
              Phone call ended, duration was {{ states.sensor.phone.attributes.duration }} Second(s).
            {% endif %}
          {% endif %}
```

## Remarks component

This component fetches random tags from files to be tweeted.
The data files are taken from misterhouse, so al courtesy goes to that project.
Currently there are two types of remarks implemented, random daily one taken from file specified in config.
And outside temperature based.

### Installation

- Copy file `remarks.py` to your `<config dir>/custom_components` directory.
- Copy the data directory `remarks` to your `<config dir>` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

remarks:
   file: 1100tags.txt
   hour: 9
   minute: 0
   outside_temp_sensor: sensor.pws_temp_c
   cold_threshold: 5
   freeze_threshold: -5
   temp_hour: 6
   temp_minute: 30
```

Configuration variables:

- **file** (*Optional*): The file we want to pick a random tag from, one from the `remarks` directory. (default = 1100tags.txt)
- **hour** (*Optional*): The hour on which we want to generate a random tag. (default = 9)
- **minute** (*Optional*): The minute on which we want to generate a random tag. (default = 0)
- **outside_temp_sensor** (*Optional*): Sensor device to use to get the outside temperature. (default = sensor.pws_temp_c)
- **cold_threshold** (*Optional*): Below this temperature a tag will be picked from the `list_temp_below_20.txt`. (default = 5)
- **freeze_threshold** (*Optional*): Below this temperature a tag will be picked from the file `list_temp_below_0.txt`. (default = -5)
- **temp_hour** (*Optional*): The hour on which we want to generate a temperature remark if it is below thresholds. (default = 6)
- **temp_minute** (*Optional*): The minute on which we want to generate a temperature remark. (default = 30)

Now for both tags an event will be fired.

You can trigger on this with automation rules.
For example you can send them as tweets, to do so place this in your `automation.yaml`

```yaml
# Example automation.yaml entry

- alias: Tweeting Remarks
  trigger:
    platform: event
    event_type: remarks
  action:
  - service_template: notify.twitter
    data_template:
      message: "{{ trigger.event.data.text }}"
```

## arp-scan Device Tracker component

This component tracks devices using the arp-scan command, it's very fast, and reasonably accurate.

### Installation

- Copy directory `arpscan_tracker` to your `<config dir>/custom_components` directory.
- Install the arp-scan command and set it's sticky bit, so it can be run as root.

  **NOTE: This is not needed on Hass.io, it contains the arp-scan command already.**
```
$ sudo apt-get install arp-scan
$ sudo chmod +s /usr/bin/arp-scan
```
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

device_tracker:
  - platform: arpscan_tracker
    interval_seconds: 15
    consider_home: 60
    track_new_devices: true
    exclude:
      - <IP_ADDRESS>
      - <IP_ADDRESS>
```

Configuration variables:

- **interval_seconds** (*Optional*) Seconds between each scan for new devices. (default = 12)
- **consider_home** (*Optional*): Seconds to marking device as 'not home' after not being seen (default = 180)
- **track_new_device** (*Optional*): If new discovered devices are tracked by default. (default = True)
- **exclude** (*Optional*): List of IP addresses to skip tracking for.
- **scan_options** (*Optional*): Configurable scan options for arp-scan. (default is `-l -g -t1 -q`)

## Plugwise component

This component can read values from and control Plugwise circles/plugs.

Although it works rather well, it is still work in progress, it uses the older python-plugwise code.
And it must be made async so it plays nice when it cannot reach a plug it queries resulting in timeouts.

### Installation

- Copy directory `plugwise` to your `<config dir>/custom-components` directory.
- It has as dependency the 'plugwise' module from PyPi, but it will be installed automatically.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

switch:
  - platform: plugwise
    port: /dev/ttyUSB0
    circles:
      CirclePlus: 000D6F000023711C
      Koelkast: 000D6F00001C8F33
```

Configuration variables:

- **port** (*Optional*): Port used by your plugwise stick. (default = /dev/ttyUSB0)
- **circles** (*Required*): This section tells the component which mac addresses your plugs have and which device names you want to use.

If you want to graph power consumption values you can convert the attribute of the switch into a sensor using template platform like so:

```yaml
# Example sensor.yaml entry

- platform: template
  sensors:
    circleplus_power_usage:
      friendly_name: "CirclePlus Power Usage"
      unit_of_measurement: 'Watt'
      value_template: "{{ states.switch.circleplus.attributes.current_consumption }}"
```
NOTE: works in Hass.io

### Screenshots

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/plugwise-switches.png "Screenshot Plugwise Switches")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/plugwise-switch.png "Screenshot Plugwise Switch")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/plugwise-graph.png "Screenshot Plugwise Graph")

## TheThingsNetwork Gateway status component

This component can read status values from a local TTN Gateway.

### Installation

- Copy directory `ttn_gateway` to your `<config dir>/custom-components` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

sensor:
  - platform: ttn_gateway
    host: IP_ADDRESS
    scan_interval: 10
    resources:
      - gateway
      - hwversion
      - blversion
      - fwversion
      - uptime
      - connected
      - interface
      - ssid
      - activationlocked
      - configured
      - region
      - gwcard
      - brokerconnected
      - packetsup
      - packetsdown
      - estore
```

Configuration variables:

- **host** (*Required*): The IP address of the gateway you want to monitor.
- **scan_interval** (*Optional*): Number of seconds between polls. (default = 30)
- **resources** (*Required*): This section tells the component which values to monitor.

If you want them grouped instead of having the separate sensor badges, you can use this in your `groups.yaml`:

```yaml
# Example groups.yaml entry

TTN Gateway:
  - sensor.ttn_gw_hardware_version
  - sensor.ttn_gw_bootloader_version
  - sensor.ttn_gw_firmware_version
  - sensor.ttn_gw_uptime
  - sensor.ttn_gw_connected
  - sensor.ttn_gw_interface
  - sensor.ttn_gw_gateway
  - sensor.ttn_gw_ssid
  - sensor.ttn_gw_activation_locked
  - sensor.ttn_gw_configured
  - sensor.ttn_gw_region
  - sensor.ttn_gw_gateway_card
  - sensor.ttn_gw_broker_connected
  - sensor.ttn_gw_packets_up
  - sensor.ttn_gw_packets_down
  - sensor.ttn_gw_external_storage
```

### Screenshots

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/ttn-gw-badges.png "Screenshot TTN Gateway Badges")
![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/ttn-gw-status.png "Screenshot TTN Gateway Status")

## HVCGroep Garbage Collect sensor component

Gets garbage pickup dates straight from HVC Groep's rest API.

### Installation

- Copy directory `hvcgroep` to your `<config dir>/custom_components` directory.
- Configure with config below.
- Restart Home-Assistant.

### Usage
To use this component in your installation, add the following to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry

sensor:
  - platform: hvcgroep
    postcode: 1234AB
    huisnummer: 1
    resources:
      - gft
      - plastic
      - papier
      - restafval
```

Configuration variables:

- **postcode** (*Required*): Your postal code.
- **huisnummer** (*Required*): Your house number.
- **resources** (*Required*): This section tells the component which types of garbage to get pickup dates for.

You can create 2 extra sensors which hold the type of garbage to pickup today and tomorrow:
```
  - platform: template
    sensors:
      afval_vandaag:
        friendly_name: 'Vandaag'
        value_template: >-
          {% if is_state_attr('sensor.hvc_groep_gft', 'day', 'Vandaag') %}
          {% set gft = 'Groene Bak' %}
          {% endif %}
          {% if is_state_attr('sensor.hvc_groep_papier', 'day', 'Vandaag') %}
          {% set papier = 'Blauwe Bak' %}
          {% endif %}
          {% if is_state_attr('sensor.hvc_groep_plastic', 'day', 'Vandaag') %}
          {% set plastic = 'Plastic' %}
          {% endif %}
          {% if is_state_attr('sensor.hvc_groep_restafval', 'day', 'Vandaag') %}
          {% set restafval = 'Grijze Bak' %}
          {% endif %}
             {{gft}} {{papier}} {{plastic}} {{restafval}}

  - platform: template
    sensors:
      afval_morgen:
        friendly_name: 'Morgen'
        value_template: >-
          {% if is_state_attr('sensor.hvc_groep_gft', 'day', 'Morgen') %}
          {% set gft = 'Groene Bak' %}
          {% elif is_state_attr('sensor.hvc_groep_papier', 'day', 'Morgen') %}
          {% set papier = 'Blauwe Bak' %}
          {% if is_state_attr('sensor.hvc_groep_plastic', 'day', 'Morgen') %}
          {% set plastic = 'Plastic' %}
          {% endif %}
          {% if is_state_attr('sensor.hvc_groep_restafval', 'day', 'Morgen') %}
          {% endif %}
          {% set restafval = 'Grijze Bak' %}
          {% endif %}
             {{gft}} {{papier}} {{plastic}} {{restafval}}
```

And you can group them like so:
```
Afval Ophaaldagen:
  - sensor.hvc_groep_gft
  - sensor.hvc_groep_papier
  - sensor.hvc_groep_plastic
  - sensor.hvc_groep_restafval
  - sensor.afval_vandaag
  - sensor.afval_morgen
```
Thing to fix/add is multiple pickups per day for 'today' and 'tomorrow' sensor.

### Screenshots

![alt text](https://raw.githubusercontent.com/cyberjunky/home-assistant-custom-components/master/screenshots/hvcgroep.png "Screenshot HVCGroep")

## Volkswagen Carnet component

Cloned from https://github.com/robinostlund/homeassistant-volkswagencarnet

So all credits to Robin Ostlund.

I stripped out non supported stuff to get it to work with my VW T-ROC.

This also needs a modified volkswagencarnet python module!

```yaml
# Example configuration.yaml entry

volkswagencarnet:
    username<EMAIL_ADDRESS>    password: yourpassword
    update_interval:
      minutes: 5
    resources:
      - last_connected
      - position
      - distance
      - fuel_level
      - service_inspection
      - oil_inspection
      - parking_light
      - doors_locked
      - trunk_locked
      - combined_range
```

Configuration variables:

- **username** (*Required*): Your email address for carnet portal.
- **password** (*Required*): Your password for carnet portal.
- **minutes** (*Required*): Update every x minutes, minimum is 3.
- **resources** (*Required*): Values to fetch.

## TODO for most of above components
- Make the components work async.


text:
---
layout: page
section: how
subsection: questions
categories: Admin
tags:
title: What happens at my six-month review?
---

After you've been at Wunderkraut for your first six months, you'll have a progress review.

This is a pretty straightforward thing. You'll meet with either your managing director, probably, and have a chance to talk about various aspects of your first six months:

- your successes;
- your challenges;
- how you've settled into your role;
- how you're getting on with colleagues;
- how you're finding the projects your work on and clients your work for;
- how you're getting on with the distributed working thing;
- plans for the next six months;
- about your equipment and other practical support stuff;
- anything that's on your mind;
- etc.

After that, you should receive a written review. This will be completed by at least two people, probably your mentor and the Managing Director, Steve Parks, but it might also include comments by others as appropriate to your role and projects.

The written review will include things like a summary of your review meeting, an overview from your two (or more) reviewers, and number of points for action.

license: MIT

repository: mattshilden/WunderWay

branch_name: refs/heads/gh-pages

extension: md

license_type: permissive

repo_name: mattshilden/WunderWay


text:
# Unity Coin
In the interests of public disclosure and security, we're pleased to present the [Unity Coin][unity coin] token and crowdsale contracts.

![Unity Coin](unitycoin-logo.png)

Built on the Ethereum blockchain, the main purpose and function of Unity Coin will be as a fungible medium of exchange for goods and services in the wedding industry. Collaborators and contributors within the Unity ecosystem will receive rewards through Unity Rewards for value-added actions.

Ultimately, the governance of Unity Coin will be decentralized, and facilitated by the Unity Coin Foundation.

~Visit the [Unity Coin ICO site][unity coin] for more information on the presale and primary crowdsale details.~

Our crowdsale has been postphoned until 2018. Thank you to everyone interested and excited in our vision.

## Contracts
Please see the [contracts/](contracts) directory.

## Bounty Program
~We want your input! If you're interested, please see the [Unity Coin bounty program][bounty program] for participation details and instructions.~

Our crowdsale has been postphoned until 2018. All bug bounty submissions already received (thank you!) will be included for consideration at that time. We will be reviewing our bounty reward structure at that time as well, due to feedback received.

## Overview
There are two primary contracts: `UnityToken.sol` (ERC-20 compliant token) and `UnitySale.sol` (the crowdsale contract). Additionally, there is a simple shared interface defined in `IRefundHandler.sol` that allows `UnityToken` and `UnitySale` to communicate refund requests and exchange wei contributions for received tokens. This refund mechanism will be triggered in the event that our sale goals are not met.

### UnityToken
Deriving from OpenZeppelin's ERC-20 compliant base contracts, `UnityToken` has the same core functionality the Ethereum ecosystem has come to expect, with minor modifications:
1. Upon initial deployment, the token has no `symbol` or `name` set; it is set via `ownerSetVisible()`
1. Token transfers are disabled until after the crowdsales are successfully completed, at which point the token will be 'activated' via `ownerActivateToken()`
1. To ensure that contributors receive their tokens during the sale, the ability to `ownerSetOverride()` addresses has been added (allows override addresses to use `transfer()`)
1. In the event that refunds are enabled in the sale contract, token holders can exchange their tokens for ether by calling the `claimRefund()` method

### UnitySale
While not directly deriving from existing crowdsale contracts, `UnitySale` is based on the simplest combination of [OpenZeppelin code][openzeppelin], other successful crowdsale contracts, [best practices][best practices], as well as [security considerations][security concerns]. `UnitySale` functionality includes:
1. Flexible deployment options allows multiple sale scenarios (presale + primary ICO)
1. Time-based tranche discounting
1. Minimum ether goal restriction (optional)
1. Minimum and maximum individual contribution restrictions
1. Emergency break/pause functionality
1. Ability to enable refunds (in the case where minimum ether goal was not met)
1. Ability to transfer wei to beneficiary (after sale end and if optional min goal has been met)
1. Ability to recover (transfer) unsold tokens
1. Contributions via contract default/fallback function for user simplicity

## Develop
Contracts are written in [Solidity][solidity] and tested using [Truffle][truffle] and [testrpc][testrpc]. ERC20-related and other base contracts sourced from [OpenZeppelin.org][openzeppelin].

### Dependencies
```bash
# Install Truffle, testrpc, and dependency packages:
$ npm install
```

### Test
```bash
# Initialize a testrpc instance in one terminal tab
$ node_modules/.bin/testrpc

# This will run the contract tests using truffle
$ node_modules/.bin/truffle test
```
**Note that there is an [outstanding testrpc issue][testrpc bug 390]** which, until fixed and released, will cause some tests to fail; it is related to the `testrpc` `evm_increaseTime` operation and its interaction with `testrpc` snapshot/revert behaviour. A [custom `testrpc` build][testrpc custom build workaround] can be made that addresses this problem in the meantime.

## Build
For easy deployment via Mist, simply concatenate all contracts using [`solidity_flattener`][solidity flattener].
```
solidity_flattener --solc-paths "zeppelin-solidity=<absolute path to your files>/node_modules/zeppelin-solidity" contracts/UnityToken.sol > UnifiedUnityToken.sol
solidity_flattener --solc-paths "zeppelin-solidity=<absolute path to your files>/node_modules/zeppelin-solidity" contracts/UnitySale.sol > UnifiedUnitySale.sol
```
Use the concatenated contracts in these 'unified' .sol files to deploy in [Mist][mist]. Note that these 'unified' files are also useful when [verifying your contract on Etherscan.io][etherscan verifycontract].

[unity coin]: https://www.unitycoin.onewed.com/
[ethereum]: https://www.ethereum.org/
[openzeppelin]: https://openzeppelin.org/
[solidity]: https://solidity.readthedocs.io/
[truffle]: http://truffleframework.com/
[testrpc]: https://github.com/ethereumjs/testrpc
[mist]: https://github.com/ethereum/mist
[solidity flattener]: https://github.com/BlockCatIO/solidity-flattener
[testrpc bug 390]: https://github.com/ethereumjs/testrpc/issues/390
[testrpc custom build workaround]: https://github.com/ethereumjs/testrpc/issues/390#issuecomment-336917098
[best practices]: http://solidity.readthedocs.io/en/develop/common-patterns.html
[security concerns]: http://solidity.readthedocs.io/en/develop/security-considerations.html
[etherscan verifycontract]: https://etherscan.io/verifyContract
[bounty program]: https://www.onewed.com/unitycoin-bounty-program/
[unitycoin whitepaper]: https://www.onewed.com/unitycoin-whitepaper/

repository: emmonspired/unitycoin

branch_name: refs/heads/master

repo_name: emmonspired/unitycoin


text:
# Resources

Third party examples and tutorials available are listed here. Please contribute
if you find good information, application or tutorial.

## Tutorial

* [demosembast](https://github.com/alextekartik/flutter_app_example/tree/master/demosembast): Bare minimum flutter application working on all platforms (iOS/Android/Mac/Web) (+ Linux/Windows with some additionnal setup)
* [notepad_sembast](https://github.com/alextekartik/flutter_app_example/tree/master/notepad_sembast): Simple notepad on all platforms
  ([online demo](https://alextekartik.github.io/flutter_app_example/notepad_sembast/))
* [Reso Coder tutorial](https://www.youtube.com/watch?v=LcaOULash7s): Flutter NoSQL Database – SEMBAST Tutorial (w/ BLoC), 2019-04-06
* [Tensor Programming live coding](https://www.youtube.com/watch?v=r3Ju2GSislE): Live Coding a Flutter Application -- Learning the Sembast Database Plugin, 2019-04-17
* [Persist data with sembast](https://medium.com/@hrishikesh.deshmukh445/persist-data-with-sembast-nosql-database-in-flutter-2b6c5110170f): Persist data with Sembast NoSQL database in flutter, 2020-01-04

## Third party applications:

* [auToDo](https://github.com/autodo-app/autodo): A flexible, intuitive ToDo list app for keeping track of your cars' maintenance needs, 2020-02-27

gha_language: Dart


text:
# Terminology

#### A program the contains links to resource for learn  Javascript, Java, HTML, and CSS terminology. User will be able to create term and their definition for future use. 3/1/17

#### By **Edgar Hernandez Ortiz**

## Description
A web application that will help user learn different programming language terminology. User will be able to create flashcard and use it to study for the next test, job interview or just to show-off your knowledge.

### Application Features

1. User should be able to create a new flashcard with term and definition.
2. User should be able to view flashcard.
3. User should be able to change flashcard with information.

### Future additions

## Setup/Installation Requirements

1. Clone this repository link.
`https://github.com/Edgarcho/Terminology.git`
2. Run these commands in terminal.
`$ npm install`
 `$ bower install`
3. When you are ready to get the project up and running, use the following commands.
`$ gulp build`
 `$ gulp serve`

## Known Bugs
* No known bugs at this time.

## Technologies Used
 * Javascript
  * Jquery
  * Gulp
  * Bower
  * TypeScript
  * Angular
 * HTML
 * CSS
 * BootStrap

## Support and contact details

_Email no one with any questions, comments, or concerns._

### License

*This software is licensed under the MIT license*

Copyright (c) 2018 **_Edgar Hernandez Ortiz_**

repository: Edgarcho/Terminology

repo_name: Edgarcho/Terminology


text:
# Deploying an API for Cloud SQL using Cloud Run

## Overview
This tutorial has example scripts to deploy a Cloud SQL database and an API to Cloud Run, forked from [momander/serverlesstoolbox](https://github.com/momander/serverlesstoolbox/tree/master/rest-api-sql).

The database houses appointments made to a social services government agency, and the API enables GET, POST, and DELETE to the database ([example API endpoint](https://social-service-appointments-6vabcavgiq-ue.a.run.app/1)).

## How to deploy
Run the following scripts from your terminal (e.g., "source ./create-database.sh"):
 - create-database.sh
 - deploy-rest-api.sh

 making sure to replace the variable names with the GCP configuration you desire.

repository: WandLZhang/serverlesstoolbox

repo_name: WandLZhang/serverlesstoolbox


text:
---
layout: shared/narrow
title: "Customize the video player"
description: "Different platforms display video differently. Mobile solutions need to consider device orientation. Use Fullscreen API to control the fullscreen view of video content."
published_on: 2014-04-16
updated_on: 2014-04-29
order: 3
authors:
  - samdutton
translation_priority: 1
key-takeaways:
  add-a-video:
    - "Use the video element to load, decode, and play video on your site."
    - "Produce video in multiple formats to cover a range of mobile platforms."
    - "Size videos correctly; ensure they don't overflow their containers."
    - "Accessibility matters; add the track element as a child of the video element."
notes:
  media-fragments:
    - "The Media Fragments API is supported on most platforms, but not on iOS."
    - "Make sure Range Requests are supported by your server. Range Requests are enabled by default on most servers, but some hosting services may turn them off."
  dont-overflow:
    - "Don't force element sizing that results in an aspect ratio different from the original video. Squashed or stretched looks bad."
  accessibility-matters:
    - "The track element is supported on Chrome for Android, iOS Safari, and all current browsers on desktop except Firefox (see caniuse.com/track). There are several polyfills available too. We recommend Playr or Captionator."
  construct-video-streams:
    - "MSE is supported by Chrome and Opera on Android, and in Internet Explorer 11 and Chrome for desktop, with support planned for Firefox."
  optimize:
    - "Images"
    - "Optimizing content efficiency"
---

  Different platforms display video differently. Mobile solutions need to consider device orientation. Use Fullscreen API to control the fullscreen view of video content.

{% include shared/toc.liquid %}

Different platforms display video differently. Mobile solutions need to
consider device orientation. Use Fullscreen API to control the fullscreen view
of video content.

## How device orientation works across devices

Device orientation isn't an issue for desktop monitors or laptops, but is
hugely important when considering web page design for mobile and tablets.

Safari on iPhone does a good job of switching between portrait and landscape
orientation:

Screenshot of video playing in Safari on iPhone, portrait

Screenshot of video playing in Safari on iPhone, landscape

Device orientation on an iPad and Chrome on Android can be problematic.
For example, without any customization a video playing on an iPad in landscape
orientation looks like this:

Setting the video `width: 100%` or `max-width: 100%` with CSS can resolve
many device orientation layout problems. You may also want to consider
fullscreen alternatives.

## Inline or fullscreen display

Different platforms display video differently. Safari on an iPhone displays a
video element inline on a web page, but plays video back in fullscreen mode:

On Android, users can request request fullscreen mode by clicking the
fullscreen icon. But the default is to play video inline:

Safari on an iPad plays video inline:

## Control fullscreening of content

For platforms that do not force fullscreen video playback, the Fullscreen API
is [widely supported](//caniuse.com/fullscreen). Use this API to control
fullscreening of content, or the page.

To full screen an element, like a video:
{% highlight javascript %}
elem.requestFullScreen();
{% endhighlight %}

To full screen the entire document:
{% highlight javascript %}
document.body.requestFullScreen();
{% endhighlight %}

You can also listen for fullscreen state changes:
{% highlight javascript %}
video.addEventListener("fullscreenchange", handler);
{% endhighlight %}

Or, check to see if the element is currently in fullscreen mode:
{% highlight javascript %}
console.log("In full screen mode: ", video.displayingFullscreen);
{% endhighlight %}

You can also use the CSS `:fullscreen` pseudo-class to change the way
elements are displayed in fullscreen mode.

On devices that support the Fullscreen API, consider using thumbnail
images as placeholders for video:

<video autoplay loop class="center">
  <source src="video/fullscreen.webm" type="video/webm">
  <source src="video/fullscreen.mp4" type="video/mp4">

This browser does not support the video element.

</video>

To see this in action, check out the {% link_sample _code/fullscreen.html %}demo{% endlink_sample %}.

**NOTE:** `requestFullScreen()` is currently vendor prefixed and may require
extra code for full cross browser compatibility.

repository: JcChimjj/WebFundamentals

extension: markdown

gha_language: HTML

repo_name: JcChimjj/WebFundamentals


text:
---
layout: news
title: "Article on Type-Checking in FEM from Dirichlet Boundary Conditions accepted to IDETC 2019"
author: "Kevin Chiu"
author_handle: "knchiu"
image: /assets/images/news/default-news.png
category: news
tags: [publication,IDETC]
---

Our article entitled "Checking the Automated Construction of Finite Element Simulations from Dirichlet Boundary Conditions" was accepted to this year’s IDETC. Check out the [publications](/papers/) page for more information.


text:
---
layout: page
title: "Trigonometry Review"
mathjax: true
permalink: /trig-review/
---

## Table of Contents

* intro about complex numbers
* some properties
* take a vector
* rotate
* derive equation
* derive eulers
* v' = eitheta v
* give intuition about complex exponentials

In this section, we'll be reviewing a few trig properties as well as examples of how to derive them. The purpose isn't to cover them all, but to get you acclimated to the math for the first module.

A handy mnemonic to remember the cosine, sine and tangent relationships in a right triangle is "soh-cah-toa".

That is, $\sin\theta = \frac{\textbf{o}\text{pposite}}{\textbf{h}\text{ypotenuse}}$, $\cos\theta = \frac{\textbf{a}\text{djacent}}{\textbf{h}\text{ypotenuse}}$ and $\tan\theta = \frac{\textbf{o}\text{pposite}}{\textbf{a}\text{djacent}}$.

We can apply these definitions in a unit circle to derive useful properties of these functions.

In the figure above, let OP be a radius of the circle with $\angle POA = \theta$. From the definition of sine and cosine, we have that $\cos \theta = OA$ and  $\sin \theta = AP$ since $OP = 1$. Thus, the coordinates of the point P are $(\cos \theta, \sin \theta)$. Similarly, we can see that the point drawn at $-\theta$ has the same $x$ value as P but the negative of its $y$ value. This means that we can write an expression relating the cosine/sine of an angle with its negative:

$$
\cos (- \theta) = \cos \theta \\
\sin (- \theta) = - \sin \theta
$$

In fact, cosine is an even function and sine is an odd function. Next, consider the point Q, drawn with an angle of $\theta + 90$ from the origin. In the right triangle QPO, the angle Q is equal to $\theta$ and O equal to $90 - \theta$. This means that QBO and OAP are similar triangles. As such,

$$
\cos(90 - \theta) = OB = AP = \sin \theta \\
\sin(90 - \theta) = QB = OA = \cos \theta
$$

from which we can derive the expressions for $90 + \theta$:

$$
\cos(90 + \theta) = \cos(90 - (-\theta)) = \sin(-\theta) = - \sin \theta \\
\sin(90 + \theta) = \sin(90 - (-\theta)) = \cos(-\theta) = \cos \theta
$$

For more formulas, check out the following [cheatsheat](http://tutorial.math.lamar.edu/pdf/trig_cheat_sheet.pdf).


text:
# kyoka - Reinforcement Learning framework

### What is Reinforcement Learning
>Reinforcement learning is an area of machine learning inspired by behaviorist psychology, concerned with how software agents ought to take actions in an environment so as to maximize some notion of cumulative reward. (wikipedia)

In reinforcement learning, the player to learn how to get good result in some task is called as **agent**.
Agent learns which action is good or bad at each situation through large number of simulation.
(The essential factor to characterize reinforcement learning is **learning from trial-and-error**.)

## Why *kyoka* is creted
The steps to solve your learning problem (ex. playing Go) by reinforcement learning algorithms would be

1. **Define your learning problem** in Reinforcement Learning format.
2. Select learning algorithm(ex. QLearning) and **implement it for your learning problem**.

We have a lots of things to do before start learning.
This library is created to ease implementing these steps.

Sorry, I talked too much. Let's see the code with simple example !!

## Hello Reinforcement Learning
We will find the shortest path to escape from below maze by `QLearning`.
```bash
S: start, G: goal, X: wall

-------XG
--X----X-
S-X----X-
--X------
-----X---
---------
```

### Step1. Define Maze Task
First we define our learning problem as reinforcement learning task.
*kyoka* provides `kyoka.task.BaseTask` template class. This class has 5 abstracted methods you need to implement.

1. `gegenerate_inital_state` : define start state of our problem
2. `is_terminal_state` : define when is the finish of our problem
3. `transit_state` : define the rule of state transition in our problem
4. `generate_possible_actions` : define what action is possible in each state
5. `calculate_reward` : define how good each state is

Here is the `MazeTask` class which represents our learning problem.

```python
from kyoka.task import BaseTask

class MazeTask(BaseTask):

    ACTION_UP = 0
    ACTION_DOWN = 1
    ACTION_RIGHT = 2
    ACTION_LEFT = 3

    # We use current position of the agent in the maze as "state".
    # So we return start position of the maze (row=2, col=0).
    def generate_initial_state(self):
        return (2, 0)

    # The position of the goal is (row=0, column=8).
    def is_terminal_state(self):
        return (0, 8) == state

    # We can always move towards 4 directions.
    def generate_possible_actions(self, state):
        return [self.ACTION_UP, self.ACTION_DOWN, self.ACTION_RIGHT, self.ACTION_LEFT]

    # Agent can get reward +1 only when he reaches to the goal.
    def calculate_reward(self, state):
        return 1 if self.is_terminal_state(state) else 0

    # Returns next state after moved toward direction of passed action.
    # If destination is out of the maze or block cell, do not move.
    def transit_state(self, state, action):
        row, col = state
        wall_position = [(1,2), (2,2), (3,2), (4,5), (0,7), (1,7), (2,7)]
        height, width = 6, 9
        if self.ACTION_UP == action:
            row = max(0, row-1)
        elif self.ACTION_DOWN == action:
            row = min(height-1, row+1)
        elif self.ACTION_RIGHT == action:
            col= min(width-1, col+1)
        elif self.ACTION_LEFT == action:
            col = max(0, col-1)
        if (row, col) not in wall_position:
            return (row, col)
        else:
            return state  # Stay current position if destination is not a path.

```

### Step2. Setup QLearning for MazeTask
Next we implement **value function** of our `MazeTask` for `QLearning`.

**value function** is the function which receives **state-action** pair and estimates **how good** for the agent to take the action at the state.
So value function would work like this

```python
value_of_action = value_function.predict_value(state=(1, 5), action=ACTION_UP)
# value_of_action should be 1 because (1,6) is the goal of the maze.
```

The most important part of reinforcement learning is to **learn correct value function** of the task.

Each algorithm in this library has different base class of value function
(ex. `QLearningTabularActionValueFunction`, `DeepQLearningApproxActionValueFunction`).
Now we need to implement abstracted method of `QLearningTabularActionValueFunction`.

Here is the `MazeTabularValueFunction` class for `QLearning`.
```python
class MazeTabularValueFunction(QLearningTabularActionValueFunction):

    # We use table(array) to store the value of state-action pair.
    # Ex. the value of action=ACTION_RIGHT at state=(0,3) is stored in table[0][3][2].
    def generate_initial_table(self):
        maze_width, maze_height, action_num = 6, 9, 4
        return [[[0 for a in range(action_num)] for j in range(width)] for i in range(height)]

    # Define how to fetch value from the table which
    # initialized by "generate_initial_table" method.
    def fetch_value_from_table(self, table, state, action):
        row, col = state
        return table[row][col][action]

    # Define how to update the value of table.
    def insert_value_into_table(self, table, state, action, new_value):
        row, col = state
        table[row][col][action] = new_value
```

### Final Step. Run `QLearning` and see its result
Ok, we prepared everything. Next code starts the learning.
```python
task = MazeTask()
policy = EpsilonGreedyPolicy(eps=0.1)
value_function = MazeTabularValueFunction()
algorithm = QLearning()
algorithm.setup(task, policy, value_function)  # setup before calling "run_gpi"
algorithm.run_gpi(nb_iteration=100)  # starts the learning
```

That's all !! Now `value_function` stores how good each action is. Let's visualize what agent learned.
(We prepared helper method `examples.maze.helper.visualize_policy`.)

```python
>>> print visualize_policy(task, value_function)

     -------XG
     --X-v-vX^
S -> v-X-vvvX^
     vvX>>>>>^
     >>>>^-^^^
     ->^<^----
```

Great!! Agent found the shortest path to the goal. (14 step is the minimum step to the goal !!)

## Installation
You can use pip like this.
```
pip install kyoka
```

repository: ishikota/kyoka

gha_language: Python

repo_name: ishikota/kyoka


text:
## GitHub Plagarism Detector
  [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fssp4all%2FGitHub-Plagiarism-Detector&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)

This is an automation tool for detecting plagarism in the code assignments.

Note: This project uses MOSS software by Standford Univerity
### Demo
![demo](./media/GPD.gif)

![demo](./media/GPD2.gif)

![Stats](./media/stats.png)
### Tech Stack
- Flask
- React
- Postgresql

### Execution
- cd to root dir ie. GPD
- `npm run start`

- cd to GPD/server
- `flask run`

- Start postgresql server using `pg_ctl -D /usr/local/var/postgres start`

### Installation

<b> > Back End </b>

`pip install Flask`

`cd server`

`pip install -r requirements.txt`

<b> > Front End </b>

Install Npm, React

<b> > Postgres</b>

For Mac, postgresql DB installation

Get homebrew

`brew update then brew  doctor `

`brew install postgresql`

start server using `pg_ctl -D /usr/local/var/postgres start`

Enter  `psql postgres` to get started

Some handy command for Postgres

- `CREATE DATABASE gpd_dev;`
- Dump .pgsql into DB `psql gpd_dev < /Users/spawar2/Desktop/GitHub-Plagiarism-Detector/server/db.pgsql`

Useful commands in psql command line
- to use DB `\c gpd_dev `
- To list all DBS `\list`
- To list all Tables use  `\dt`
- To Empty table  `truncate [table_name] cascade; #if foreign keys are there`

gha_language: JavaScript

gha_license_id: MIT


text:
# Automated enterprise BI with SQL Data Warehouse and Azure Data Factory

### This content has been moved to the following location:

### [https://github.com/mspnp/azure-data-factory-sqldw-elt-pipeline](https://github.com/mspnp/azure-data-factory-sqldw-elt-pipeline)

repository: sedlavac/reference-architectures

repo_name: sedlavac/reference-architectures


text:
# GitHub Trending (2021-03-19)

![](https://img.shields.io/badge/Swift-New%20131-green?style=flat-square&logo=appveyor)
- [pointfreeco/isowords](https://github.com/pointfreeco/isowords): Open source game built in SwiftUI and the Composable Architecture.

![](https://img.shields.io/badge/Python-New%2052-green?style=flat-square&logo=appveyor)
- [openai/DALL-E](https://github.com/openai/DALL-E): PyTorch package for the discrete VAE used for DALL·E.

![](https://img.shields.io/badge/Python-New%20100-green?style=flat-square&logo=appveyor)
- [DavidBuchanan314/tweetable-polyglot-png](https://github.com/DavidBuchanan314/tweetable-polyglot-png): Pack up to 3MB of data into a tweetable PNG polyglot file.

![](https://img.shields.io/badge/Swift-New%2018-green?style=flat-square&logo=appveyor)
- [pointfreeco/swift-composable-architecture](https://github.com/pointfreeco/swift-composable-architecture): A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.

![](https://img.shields.io/badge/Python-New%20117-green?style=flat-square&logo=appveyor)
- [3b1b/manim](https://github.com/3b1b/manim): Animation engine for explanatory math videos

![](https://img.shields.io/badge/HTML-New%20615-green?style=flat-square&logo=appveyor)
- [ChartsCSS/charts.css](https://github.com/ChartsCSS/charts.css): Open source CSS framework for data visualization.

![](https://img.shields.io/badge/Ruby-New%20335-green?style=flat-square&logo=appveyor)
- [chatwoot/chatwoot](https://github.com/chatwoot/chatwoot): Open-source customer engagement suite, an alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬

![](https://img.shields.io/badge/JavaScript-New%2071-green?style=flat-square&logo=appveyor)
- [microsoft/Web-Dev-For-Beginners](https://github.com/microsoft/Web-Dev-For-Beginners): 24 Lessons, 12 Weeks, Get Started as a Web Developer

![](https://img.shields.io/badge/TeX-New%2022-green?style=flat-square&logo=appveyor)
- [paulgp/applied-methods-phd](https://github.com/paulgp/applied-methods-phd): Repo for Yale Applied Empirical Methods PHD Course

![](https://img.shields.io/badge/none-New%20263-green?style=flat-square&logo=appveyor)
- [tuvtran/project-based-learning](https://github.com/tuvtran/project-based-learning): Curated list of project-based tutorials

![](https://img.shields.io/badge/JavaScript-New%2015-green?style=flat-square&logo=appveyor)
- [simo8102/88-AutoSignMachine](https://github.com/simo8102/88-AutoSignMachine): 联通挂机任务积分脚本

![](https://img.shields.io/badge/TypeScript-New%2019-green?style=flat-square&logo=appveyor)
- [grafana/grafana](https://github.com/grafana/grafana): The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.

![](https://img.shields.io/badge/Jupyter%20Notebook-New%20300-green?style=flat-square&logo=appveyor)
- [stefan-jansen/machine-learning-for-trading](https://github.com/stefan-jansen/machine-learning-for-trading): Code for Machine Learning for Algorithmic Trading, 2nd edition.

![](https://img.shields.io/badge/TypeScript-New%2017-green?style=flat-square&logo=appveyor)
- [backstage/backstage](https://github.com/backstage/backstage): Backstage is an open platform for building developer portals

![](https://img.shields.io/badge/Python-New%20106-green?style=flat-square&logo=appveyor)
- [521xueweihan/GitHub520](https://github.com/521xueweihan/GitHub520): 😘 让你“爱”上 GitHub，解决访问时图裂、加载慢的问题。

![](https://img.shields.io/badge/JavaScript-New%20130-green?style=flat-square&logo=appveyor)
- [discordjs/discord.js](https://github.com/discordjs/discord.js): A powerful JavaScript library for interacting with the Discord API

![](https://img.shields.io/badge/none-New%2058-green?style=flat-square&logo=appveyor)
- [florinpop17/app-ideas](https://github.com/florinpop17/app-ideas): A Collection of application ideas which can be used to improve your coding skills.

![](https://img.shields.io/badge/TSQL-New%205-green?style=flat-square&logo=appveyor)
- [MicrosoftLearning/DA-100-Analyzing-Data-with-Power-BI](https://github.com/MicrosoftLearning/DA-100-Analyzing-Data-with-Power-BI):

![](https://img.shields.io/badge/JavaScript-New%2023-green?style=flat-square&logo=appveyor)
- [cypress-io/cypress](https://github.com/cypress-io/cypress): Fast, easy and reliable testing for anything that runs in a browser.

![](https://img.shields.io/badge/JavaScript-New%2037-green?style=flat-square&logo=appveyor)
- [facebook/react-native](https://github.com/facebook/react-native): A framework for building native apps with React.

![](https://img.shields.io/badge/none-New%2028-green?style=flat-square&logo=appveyor)
- [github/roadmap](https://github.com/github/roadmap): GitHub public roadmap

![](https://img.shields.io/badge/Python-New%2011-green?style=flat-square&logo=appveyor)
- [lucidrains/big-sleep](https://github.com/lucidrains/big-sleep): A simple command line tool for text to image generation, using OpenAI's CLIP and a BigGAN

![](https://img.shields.io/badge/JavaScript-New%20143-green?style=flat-square&logo=appveyor)
- [sudheerj/reactjs-interview-questions](https://github.com/sudheerj/reactjs-interview-questions): List of top 500 ReactJS Interview Questions & Answers....Coding exercise questions are coming soon!!

![](https://img.shields.io/badge/Haskell-New%2012-green?style=flat-square&logo=appveyor)
- [input-output-hk/cardano-node](https://github.com/input-output-hk/cardano-node): The core component that is used to participate in a Cardano decentralised blockchain.

![](https://img.shields.io/badge/C-New%20150-green?style=flat-square&logo=appveyor)
- [TheAlgorithms/C](https://github.com/TheAlgorithms/C): Collection of various algorithms in mathematics, machine learning, computer science, physics, etc implemented in C for educational purposes.

repository: Hsins/Daily-GitHub-Trending

branch_name: refs/heads/main

repo_name: Hsins/Daily-GitHub-Trending


text:
---
number: 430
title: Creator of Wordle - Josh Wardle
date:<PHONE_NUMBER>914
url: https://traffic.libsyn.com/syntax/Syntax_-_430.mp3
---

In this episode of Syntax, Wes and Scott talk with the creator of Wordle, Josh Wardle. What's the tech stack for Wordle? Does he care about the clones of Wordle? And how did selling Wordle work?

## Sentry - Sponsor

If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for  free by visiting [Sentry.io](https://sentry.io) and using the coupon code TASTYTREAT during sign up.

## Sanity - Sponsor

Sanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at [sanity.io/get-started](https://www.sanity.io/get-started). Get an awesome supercharged free developer plan on [sanity.io/syntax](https://www.sanity.io/syntax).

## Freshbooks - Sponsor

Get a 30 day free trial of Freshbooks at [freshbooks.com/syntax](https://freshbooks.com/syntax).

## Show Notes

* **[00:27:02](#t=00:27:02)** Guest introduction
* [Wordle](https://www.powerlanguage.co.uk/wordle/)
* **[02:45:13](#t=02:45:13)** How did Wordle go viral initially?
* **[05:27:14](#t=05:27:14)** Where did the idea for Wordle come from?
* **[07:07:06](#t=07:07:06)** What's your background?
* [Reddit.com](https://www.reddit.com)
* **[12:52:23](#t=12:52:23)** Writing just HTML CSS and JavaScript
* **[15:58:24](#t=15:58:24)** Wordle has 2 external dependancies
* **[16:41:06](#t=16:41:06)** Sponsor: Sentry
* **[17:40:23](#t=17:40:23)** The tech stack of Wordle
* [Lit Elements](https://lit.dev)
* [just-merge](https://www.npmjs.com/package/just-merge)
* [gzip](https://www.gnu.org/software/gzip/)
* [Cloudflare](https://www.cloudflare.com/)
* [AWS S3](https://aws.amazon.com/s3/)
* **[22:21:04](#t=22:21:04)** Would you use web components again?
* **[29:36:08](#t=29:36:08)** How much did hosting cost?
* **[29:55:01](#t=29:55:01)** How does Wordle remember my streak?
* **[33:56:07](#t=33:56:07)** Do you play Wordle everyday?
* **[36:28:11](#t=36:28:11)** Sponsor: Sanity
* **[37:16:07](#t=37:16:07)** How do you land on internet hits so often?
* **[40:33:15](#t=40:33:15)** Are you aware of the clones?
* [Gordle](https://gordle.herokuapp.com)
* **[44:33:15](#t=44:33:15)** Sponsor: Freshbooks
* **[45:17:10](#t=45:17:10)** Selling Wordle to the New York Times
* **[49:05:20](#t=49:05:20)** Dealing with the domain name
* **[54:15:09](#t=54:15:09)** What's his opener word?
* **[56:03:03](#t=56:03:03)** Juice
* [Juice it or Lose it talk](https://www.youtube.com/watch?v=Fy0aCDmgnxg)
* **[59:10:06](#t=59:10:06)** Sick Picks!

## ××× SIIIIICK ××× PIIIICKS ×××

* Josh: Tupperware
* Scott: [Giant tub of Epsom Salt](https://amzn.to/3GmkAmt)
* Wes: [Air Fryer](https://amzn.to/3J1eUQv)

## Shameless Plugs

* Josh: [Wordle](https://www.powerlanguage.co.uk/wordle/)
* Scott: [KeystoneJS Course](https://leveluptutorials.com/tutorials/keystone-js)
* Wes: [All Courses](https://wesbos.com/courses/)

## Tweet us your tasty treats

* [Scott's Instagram](https://www.instagram.com/stolinski/)
* [LevelUpTutorials Instagram](https://www.instagram.com/LevelUpTutorials/)
* [Wes' Instagram](https://www.instagram.com/wesbos/)
* [Wes' Twitter](https://twitter.com/wesbos)
* [Wes' Facebook](https://www.facebook.com/wesbos.developer)
* [Scott's Twitter](https://twitter.com/stolinski)
* Make sure to include [@SyntaxFM](https://twitter.com/SyntaxFM) in your tweets

url: https://raw.githubusercontent.com/barrymcgee/Syntax/2b236a550ab54aea5639cb37b052e88eb74b402b/shows/430 - Creator of Wordle.md

repository: barrymcgee/Syntax

path: /shows/430 - Creator of Wordle.md

filename: 430 - Creator of Wordle.md

repo_name: barrymcgee/Syntax


text:
---
layout: default
---

# 1996-08-14 - Verisign CA practices documents

## Header Data

From: Paul Robichaux<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 2ffa24d2d45fbc2dc66fb2bb5c03e9cfe3d534bd7781879039b4e66e9d12f872

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-08-14 22:35:44 UTC

Raw Date: Thu, 15 Aug 1996 06:35:44 +0800

## Raw message

```
{% raw  %}From: Paul Robichaux<EMAIL_ADDRESS>Date: Thu, 15 Aug 1996 06:35:44 +0800
To<EMAIL_ADDRESS>Subject: Verisign CA practices documents
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Verisign's put their Certification Practice Statement up at
<http://www.verisign.com/repository/CPSNEW>. This document appears to set
forth the policies Verisign's implementing when it acts as a CA.

I haven't fully reviewed it yet, but my hat's off to Verisign for coming
clean and clearly stating their policies.

-Paul

--
Paul Robichaux		LJL Enterprises, Inc.
<EMAIL_ADDRESS>Be a cryptography user. Ask me how.

{% endraw %}
```

## Thread

+ Return to [August 1996](/archive/1996/08)

+ Return to "[Paul Robichaux <paul@ljl.COM>](/authors/paul_robichaux_paul_at_ljl_com_)"

+ 1996-08-14 (Thu, 15 Aug 1996 06:35:44 +0800) - Verisign CA practices documents - _Paul Robichaux<EMAIL_ADDRESS>


text:
---
layout: post
title: "Cargo changes how arrays in config are merged"
author: Arlo Siemsen
team: the Cargo team <https://www.rust-lang.org/governance/teams/dev-tools#cargo>
---

Cargo will be changing the order of merged configuration arrays, and we are looking for people to help test this change and provide feedback.

When an array in Cargo's configuration is defined in multiple places, the elements are merged together. The order that the elements were merged was inconsistent with how other configuration types were merged together, and was not working as expected.

The new merging order will match the precedence order of non-array [configuration], with higher-precedence configuration being placed later in the array.

In the case of `build.rustflags`, this resolves the confusing situation where higher precedence flags (in a project's `config.toml`) are overridden with lower precedence flags (in the global `$CARGO_HOME`, for example).

This may result in behavior changes if a project depends on the existing merging order. If you have an environment that involves merging configuration arrays, please consider testing your project with nightly to ensure it will continue to work once this change stabilizes. If you encounter a problem, please file an [issue].

The change is included in Cargo starting with `nightly-2023-08-24` toolchain.

## Merging Order

The previous merging order was unspecified, but in practice it was the following, with earlier entries appearing first in the array:
* `config.toml` in the current directory
* `config.toml` in a parent directory
* `config.toml` in `$CARGO_HOME`
* command-line (`--config`)
* environment variable (`CARGO_*`)

The new merging order is:
* `config.toml` in `$CARGO_HOME`
* `config.toml` in a parent directory
* `config.toml` in the current directory
* environment variable (`CARGO_*`)
* command-line (`--config`)

The implementation is in [cargo#12515].

## Impacted configuration settings

The following configuration settings have arrays of strings that will be impacted by this change:

* [`alias`] entries
* [`build.rustflags`]
* [`build.rustdocflags`]
* [`target.<triple>.rustflags`]
* [`net.ssh.known-hosts`]

[`alias`]: https://doc.rust-lang.org/nightly/cargo/reference/config.html#alias
[`build.rustflags`]: https://doc.rust-lang.org/nightly/cargo/reference/config.html#buildrustflags
[`build.rustdocflags`]: https://doc.rust-lang.org/nightly/cargo/reference/config.html#buildrustdocflags
[`target.<triple>.rustflags`]: https://doc.rust-lang.org/nightly/cargo/reference/config.html#targettriplerustflags
[`net.ssh.known-hosts`]: https://doc.rust-lang.org/nightly/cargo/reference/config.html#netsshknown-hosts

## Example

The following example shows how this change may impact you and why we are making this change.

With the following in your Cargo home directory (usually `~/.cargo/config.toml`):

```toml
[build]
rustflags = ["-C", "target-cpu=x86-64-v2"]
```

and then inside a project directory there is a `.cargo/config.toml` configuration file with:

```toml
[build]
rustflags = ["-C", "target-cpu=x86-64-v3"]
```

when you run `cargo build` within that project, cargo would previously merge these so that it passes `-C target-cpu=x86-64-v3 -C target-cpu=x86-64-v2` to `rustc`. Because `rustc` ignores options earlier on the command-line and only honors the last one, the result would end up using `x86-64-v2`. This would effectively cause the merged config settings in the current directory to be ignored.

This was not the intended behavior, since config merging should always start with the lowest precedence (things in the Cargo home directory) and have more-specific config locations override those.

[cargo#12515]: https://github.com/rust-lang/cargo/pull/12515
[configuration]: https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure
[issue]: https://github.com/rust-lang/cargo/issues/new/choose


text:
---
layout: post
title: "Perform an update using Angular's $resource and Spring Data REST"
date:   2015-09-21 09:26:45
comments: true
categories:
description:
tags:
- spring data rest
- angular js
---

Using Spring Data REST with Angular's $resource object is very useful and convenient, but I've faced a problem with CRUD update.
First you need to create such method while creating $resource object:

{% highlight javascript %}
angular.module('myApp.services',[]).factory('Something',function($resource){
  return  $resource('http://giveMeSomeRest.nom/please/:id',{id:'@_id'},{
      update: {
        method: 'PUT'
      }
  });
});
{% endhighlight javascript %}

But when this method was called I got `405 Method Not Allowed` error. The problem is Spring expects to have an id in the URL. To add it modify creation of a $resource object:

{% highlight javascript %}
angular.module('myApp.services',[]).factory('Something',function($resource){
  return  $resource('http://giveMeSomeRest.nom/please/:id',{id:'@_id'},{
      update: {
        method: 'PUT',
        params: {id: "@id"},
      }
  });
});
{% endhighlight javascript %}

Please note that `@id` refers to the parameter defined above, so no underscore is needed.


text:
# Slapme

Slapme generates a batman comic panel where batman slaps robin using the given text lines. This is the original:

![batman](http://goodcomics.comicbookresources.com/wp-content/uploads/2009/01/batslapper.jpg)

Slapme accepts POST requests with two parameters, ``robin`` and ``batman`` and returns a JSON response including the url of the generated image.

Here is an example request:

    POST /slaps.json

    robin=Hi%20Batman&batman=Shut%20Up

and here is an example response:

    HTTP/1.1 200 OK

    {"url":"http://<host>/slaps/d1104c6999b9262610ad15967e1b7e357dcef53e.jpg"}

## Settings

Copy ``config/examples/settings.yml`` into ``config/settings.yml`` and modify to customize the following:

* ``base_uri`` used to generate slap urls
* ``storage`` section containing settings for the storage to use (file_system or s3)
  * ``file_system`` stores image files locally
  * ``s3`` stores image files in AWS S3

The storage is automatically selected based on configuration.

File system storage requires a ``path`` setting indicating where to store image files in the server.

AWS S3 storage requires ``access_key_id``, ``secret_access_key`` and ``bucket_name``, optional ``path`` setting allows to store images within a specific path inside the bucket.

Example:

```
base_uri: http://localhost:9292

storage:
  file_system:
    path: '/tmp/slapme/files'
```

Check ``config/examples`` for more setting file examples.

repository: alvarobp/slapme

repo_name: alvarobp/slapme


text:
# AdditionalRecipientReceivable

### Description

Represents a monetary distribution of part of a [Transaction](#type-transaction)'s amount for Transactions which included additional recipients. The location of this receivable is that same as the one specified in the [AdditionalRecipient](#type-additionalrecipient).
**Note: This model is deprecated.**

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | The additional recipient receivable's unique ID, issued by Square payments servers. |
**transactionId** | **String** | The ID of the transaction that the additional recipient receivable was applied to. |
**transactionLocationId** | **String** | The ID of the location that created the receivable. This is the location ID on the associated transaction. |
**amountMoney** | [**Money**](Money.md) | The amount of the receivable. This will always be non-negative. |
**createdAt** | **String** | The time when the additional recipient receivable was created, in RFC 3339 format. |  [optional]
**refunds** | [**List<AdditionalRecipientReceivableRefund>**](AdditionalRecipientReceivableRefund.md) | Any refunds of the receivable that have been applied. |  [optional]

repository: square/connect-java-sdk

gha_language: Java

repo_name: square/connect-java-sdk


text:
# Quickly Fix A Misspelled Word

In [Fix The Spelling Of A Word](fix-the-spelling-of-a-word.md), I describe how
to use Vim's built-in spell files to fix a misspelling. After turning on
`:spell` and navigating the cursor to a typo, you can open a prompt with dozens
of spelling replacement options.

You generally don't need dozens of options to choose from. If you were remotely
close in the spelling of the word, you will likely end up choosing the first
option.

Instead of the multi-step open and choose, you can tell Vim to replace the
misspelled word with its top suggestion.

Navigate the cursor over the misspelled word and hit:

```
1z=
```

This skips the prompt and tells Vim to grab the first spelling suggestion.

If it's not what you were looking for, you can always hit `u` (to undo) and
then `z=` to open the full prompt.

See `:h z=` for more details.

repository: jbranchaud/til

gha_language: Vim Script

repo_name: jbranchaud/til


text:
# PC-component-stock-watcher

[![GitHub Super-Linter](https://github.com/rekolae/PC-component-stock-watcher/workflows/Linter/badge.svg?branch=master)](https://github.com/marketplace/actions/super-linter)
[![Coverage Status](https://coveralls.io/repos/github/rekolae/PC-component-stock-watcher/badge.svg?branch=master)](https://coveralls.io/github/rekolae/PC-component-stock-watcher?branch=master)

Thanks to the combined terror of COVID, scalpers and overall global shortage, especially GPUs are really hard to come by. This program aims to help you find out when there actually is stock only to get to the page and start to cry when the scalper bots have already hogged all of the stock.

Idea for this project was created out of my own frustration as well as interest in trying new things and combining them together.

The project consist of several independant components:
* Database for storing product information (might be overkill but wanted to learn using SQLite with python)
* Requesting store pages and crawling through them to get product data
* CLI/GUI that shows current product status
* Email daemon that can send email's about products with stock

# Commit messages and format

Commit messages should be clearly written in english and be compact to ensure easy reading e.g.
* `"[258-ESC-BSOD-FIX] Fixed BSOD when pressing ESC exactly 666 times"`

When it comes to commits the more the merrier compared to one huge commit with a message that spans 5 rows.

To automate adding the `[<Issue ID>-<branch description>]` to the beginning of a commit messages have a look at [this gist](https://gist.github.com/rekolae/28b2b0d27cff688b77f1642989e1cc24).

It can be installed by renaming `.git/hooks/prepare-commit-msg.sample` to `prepare-commit-msg` and pasting the script in the gist to the file and making it executable (if needed).

This way `$ git commit -m "[<Issue ID>-<branch description>] Fixed this and..."` can be written without the issue id and branch part as: `$ git commit -m "Fixed this and..."` saving many many key presses and your nerves.

# Branching

## Quick Legend

            Instance
            Branch
            Notes

            Stable
            stable
            Accepts merges from Working and Hotfixes

            Working
            master
            Accepts merges from Features and Bugfixes

            Feature
            feature/<Issue ID>-<short description>
            Always branch off HEAD of Working

            Bugfix
            bugfix/<Issue ID>-<short description>
            Always branch off HEAD of Working

            Hotfix
            hotfix/<Issue ID>-<short description>
            Always branch off Stable

Couple of example branch names:
* `feature/123-GUI-refactoring`
* `bugfix/666-fix-BSOD-on-click`

## Main Branches

The main repository will always hold two evergreen branches:

* `master`
* `stable`

The main branch should be considered `origin/master` and will be the main branch where the source code of `HEAD` always reflects a state with the latest delivered development changes for the next release.

Consider `origin/stable` to always represent the latest code which could be deployed to production.

When the source code in the `master` branch is considered stable, all of the changes will be merged into `stable`. If `stable` has gained enough significant changes, the changes are tagged with a release number.

## Supporting Branches

Supporting branches are used to aid parallel development, ease tracking of features, and to assist in quickly fixing production problems. Unlike the main branches, these branches always have a limited life time, since they will be removed eventually.

The different types of branches used are:

* Feature branches
* Bug branches
* Hotfix branches

Each of these branches have a specific purpose and are bound to strict rules as to which branches may be their originating branch and which branches must be their merge targets.

## Tagging releases and hotfixes

When a stable branch has gotten to the point that a release should be made, it has to be tagged with a corresponding version number. The version number should follow semantic versioning format i.e. `MAJOR.MINOR.PATCH` where incrementing conforms to the following:

* `MAJOR` number increment when you make incompatible API changes
* `MINOR` number increment when you add functionality in a backwards compatible manner
* `PATCH` number increment when you make backwards compatible bug fixes

See [Semantic Versioning](https://semver.org/) for more infomation.

In practise tagging works as follows:

```
$ git checkout stable                               // Change to the stable branch
$ git merge --no-ff master                          // Forces creation of commit object during merge
$ git tag                                           // List tags to check latest version number
V1.0.0
V1.0.1
$ git tag -a <V1.1.0> -m <msg, e.g "Release...">    // Tags the fix
$ git push origin stable --tags                     // Push tag changes
```

or when a hotfix was issued:

```
$ git commit -m "Hotfix for..."                     // Commit changes
$ git checkout stable                               // Change to the stable branch
$ git merge --no-ff <hotfix-branch-name>            // Forces creation of commit object during merge
$ git tag                                           // List tags to check latest version number
V1.0.0
V1.0.1
V1.1.0
$ git tag -a <V1.1.1> -m <msg, e.g "Hotfix...">     // Tags the fix
$ git push origin stable --tags                     // Push tag changes
```

## Working with a feature branch

If the branch does not exist yet, create the branch locally and then push to GitHub. A feature branch should always be 'publicly' available. That is, development should never exist in just one developer's local branch.

```
$ git checkout -b <feature-branch-name>             // Creates a local branch for the new feature
$ git push origin <feature-branch-name>             // Makes the new feature remotely available
```

Periodically, changes made to `master` (if any) should be merged back into the current feature branch.

```
$ git merge master                                  // Merges changes from master into feature branch
```

When development on the feature is complete, the lead (or engineer in charge) should merge changes into `master` and then make sure the remote branch is deleted.

```
$ git checkout master                               // Change to the master branch
$ git merge --no-ff <feature-branch-name>           // Makes sure to create a commit object during merge
$ git push origin master                            // Push merge changes
$ git push origin :<feature-branch-name>            // Deletes the remote branch, git push origin --delete <feature-branch-name> works as well
```

## Working with a hotfix branch

If the branch does not exist yet, create the branch locally and then push to GitHub. A hotfix branch should always be 'publicly' available. That is, development should never exist in just one developer's local branch.

```
$ git checkout -b <hotfix-branch-name> stable       // Creates a local branch for the new hotfix
$ git push origin <hotfix-branch-name>              // Makes the new hotfix remotely available
```

When development on the hotfix is complete, merge changes into `stable` and then update the tag.

```
$ git checkout stable                               // Change to the stable branch
$ git merge --no-ff <hotfix-branch-name>            // Forces creation of commit object during merge
$ git tag -a <tag> -m <msg>                         // Tags the fix
$ git push origin stable --tags                     // Push tag changes
```

Merge changes into `master` so not to lose the hotfix and then delete the remote hotfix branch.

```
$ git checkout master                               // Change to the master branch
$ git merge --no-ff <hotfix-branch-name>            // Forces creation of commit object during merge
$ git push origin master                            // Push merge changes
$ git push origin :<hotfix-branch-name>             // Deletes the remote branch, git push origin --delete <hotfix-branch-name> works as well
```

repository: rekolae/PC-component-stock-watcher

repo_name: rekolae/PC-component-stock-watcher


text:
# LuaCombinator
This is a updated version of James OFarrell's original LuaCombinator Mod for Factorio.
You can download it at: https://mods.factorio.com/mod/LuaCombinator
Or, just copy the folder in this repo to your Factorio mods folder.
Thanks for downloading, and enjoy!

Text from mod page listing:
This is the 0.16 updated version of the LuaCombinator mod by James O'Farrell. Thanks to him for the idea and original mod! I really wanted this mod in 0.16 instead of 0.12, so I patched it!
Sorry that this took so long to update - I was busy with many other things.

This mod adds combinators which can execute lua scripts ingame. Use it however you want :)
If you have a problem, please leave a comment or bug report, I will get to it as soon as I can!

Some examples to get you started:
IMPORTANT: Make sure to set the combinator enabled condition, otherwise the combinator will not run.

-- floating text (no loop, repeat, post)
banner("Hello World", output.entity.position, {r=0,g=0,b=1},player)

--Wagon Inventory detector (no loop, repeat, post)
if (condition.value) then output:clear() for _,entity in pairs(entities) do ; if entity.name == "cargo-wagon" then inv = entity.get_inventory(1); for name,count in pairs(inv.get_contents()) do output:set_count("item",name,count); end end end elseif (not condition.value) then output:clear() end

--locomotive-detector (no loop, repeat, post)
if (condition.value) then output:clear() for _,entity in pairs(entities) do if entity.name == "diesel-locomotive" then output:set_count("item","diesel-locomotive",1) end end else output:clear() end

--locomotive pause(loop, repeat, post)
if entity.name == "diesel-locomotive" then entity.train.manual_mode = condition.value end

--rocket launch (loop, repeat)
if (entity.name == "rocket-silo") then player.print("lift off!"); entity.launch_rocket() end

--Power detector (no loop, repeat, post)
if (condition.value) then output:clear() for _,entity in pairs(entities) do if entity.type == "accumulator" then output:set_count("virtual","signal-E",math.floor(entity.energy/1000 + 0.5)) end end elseif not condition.value then output:clear() end

--lock the gate - signal (no loop, repeat, post)
output:clear(); for _,entity in pairs(entities) do if entity.name == "rail-signal" and entity.signal_state == 1 then output:set_count("item","rail-signal",1) end end

-- lock the gate- gate (loop, repeat, post)
if entity.name == "gate" then entity.active = not condition.value end

Disclaimer: If there is any problem with licensing or copyright I will take this down immediately. Please file a report if so. However, the original mod was listed as MIT Licensing (free to modify/publish), so it should be fine.

I am including the original comment here:

Using the Lua Combinator requires lua scripting knowledge. A good way to start with this mod is by basing away in the console and editing the examples.

The Lua Combinator will trigger a lua script when a logistics condition is met. It has option to repeat the script, to run it once after the condition changes and it to loop over entities.
This can be used for smart trains, accumulator, gates signals, roboports. logistics networks. Anything ht emod API can touch you can script with a Lua Combinator.
Repeat, will cause your command to run every half second
Post, run-once, will run your script once after the condition turns to false
Loop, will run your script once for every entity around it (in the 9x9 square)

Your script has access to the following variables (subject to change, sorry)

global: global table shared between all Lua Combinators
condition.value: the condition valu (true if it is met)
condition.changed: has the condition changed?
output: object to write to the wire network
output.entity:, constant-combinator entity
output:clear():, clear output
output:get_count(item): count of item
output:set_count(type,name,count): count of type name. see signals
state: persistent state of Lua Combinator
player: player who built combinator
game: factorio game object (have fun!)
entities: out of loop mode, this is the surrounding entities
entity: in loop mode, this is one of the surrounding entities

Original page: https://forums.factorio.com/viewtopic.php?f=93&t=15352

Enjoy :)

repository: aaroexxt/LuaCombinator

repo_name: aaroexxt/LuaCombinator


text:
MeshBuilder
===========

Simple WebGL modelling/procedural generation  suite. First stop: fences!

TODO:
- fence transformations:
	- scale
	- translate
	- rotate (about the bottom.
	- twist
	- crossbarHeightsNormalized // ratios in [0,1] of how far up to place the crossbar joints
	- topScale
- textbox with contents describing a json object that describes the fence to be built
- Build button that jquery parseJSON's the fence and builds it

object heirarchy:
fence

	posts[]
	crossbeams[]

post
	add

repository: rlar/MeshBuilder

repo_name: rlar/MeshBuilder


text:
# Leviticus 23 General Notes
## Structure and formatting

### The feasts
The people should celebrate the Sabbath, the Passover, the Feast of First Fruits, the Feast of Weeks, the Feast of Trumpets, the Day of Atonement and the Feast of Booths. These feasts were important for the religious life of Israel. They were a part of proper worship of Yahweh and the identity of Israel. (See: [[../bible/kt/sabbath]], [[../bible/kt/passover]] and [[../bible/other/firstfruit]] and [[../bible/kt/atonement]])

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
Powerline Gitstatus theme
===
This is theme for the [Powerline](https://github.com/powerline/powerline) project including [Gitstatus](https://github.com/jaspernbrouwer/powerline-gitstatus) segment

1. To install above projects just invoke:
  - dnf install powerline
  - pip install powerline-gitstatus
2. To activate theme just copy the ```powerline``` into your ```~/.config``` directory and enjoy

![Theme preview](theme.png)

repository: metyl/powerline-git-theme

repo_name: metyl/powerline-git-theme


text:
## Number to string in arbitrary base
Originally published: 2005-02-02 04:56:21
Last updated: 2005-02-02 04:56:21
Author: Nick Coghlan

The function num_in_base can be used to print a number using an arbitrary base. It allows numbers to be padded to a minimum field width, and can display negative numbers in a complemented format instead of with a leading negative sign.

The digits used can be overriden with an arbitrary sequence.


text:
# ngrock webpack plugin

Port ngrock to webpack-dev-server
localhost tunnel for your static build

[![Build Status](https://api.travis-ci.org/edtoken/ngrock-webpack-plugin.svg?branch=master)](https://travis-ci.org/edtoken/ngrock-webpack-plugin)
[![npm version](https://badge.fury.io/js/ngrock-webpack-plugin.svg)](https://badge.fury.io/js/ngrock-webpack-plugin)
[![Maintainability](https://api.codeclimate.com/v1/badges/e5d9c3dff376764b7763/maintainability)](https://codeclimate.com/github/edtoken/ngrock-webpack-plugin/maintainability)
[![HitCount](http://hits.dwyl.com/edtoken/ngrock-webpack-plugin.svg)](http://hits.dwyl.com/edtoken/ngrock-webpack-plugin)

[![NPM](https://nodei.co/npm/ngrock-webpack-plugin.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/ngrock-webpack-plugin/)

[![NPM](https://nodei.co/npm-dl/ngrock-webpack-plugin.png?height=3)](https://nodei.co/npm/ngrock-webpack-plugin/)

## Install
```
npm install ngrock-webpack-plugin --save-dev
```

## Basic Usage

### 1. Include plugin

```
var NgrockWebpackPlugin = require('ngrock-webpack-plugin')
var webpackConfig = {
    entry: 'index.js',
    output: {
        path: __dirname + '/dist',
        filename: 'index_bundle.js'
    },
    devServer: {
        hot: true,
        inline: true,
        headers: {'Access-Control-Allow-Origin': '*'},
        historyApiFallback: {
            index: 'http://localhost:8080/index.html'
        }
    },
    plugins: [new NgrockWebpackPlugin()]
}

webpack-dev-server --progress --port=8080 --hot --inline --config=webpack.config.js
```

### 2. Open and send link to your friend
![LogMessage](/log.png)

## Unit testing
```
npm test
```

## License
[MIT](https://github.com/edtoken/ngrock-webpack-plugin/blob/master/LICENSE)

repository: gerasev-kirill/ngrock-webpack-plugin

repo_name: gerasev-kirill/ngrock-webpack-plugin


text:
# Tensorflow models
In this repository you can find Tensorflow-keras implementations of ResNeXt and dual path network model architectures.

### Instructions
In order to be able to use these models tensorflow version at least 2.1 needs to be installed on your environment.
Follow the instructions at https://www.tensorflow.org/install to see available options for installation.

In order to load the models onto your code follow the steps listed below.

Open a terminal and paste the following code to make a local copy of this repository:
```
# Clone the repository onto a local folder
git clone https://github.com/PathofData/Tensorflow-models.git
```

Then inside your python code import the model of your choice:

```
# Import the DPN module
from DPN50 import DPN50

# Initiallize a new model instance where the image dimension
# is (224, 224, 3) and we wish to predict 1000 classes
vision_model = DPN50(include_top=True,
                     weights=None,
                     input_tensor=None,
                     input_shape=(224, 224, 3),
                     pooling=None,
                     classes=1000)
```

Optionally print a summary of the model:
```
# Print each layere input, output shapes and number of parameters
vision_model.summary()
```

Once you have prepared a dataset for training use this model like how one would use any instance of keras models
```
# Compile the model with an optimizer and a loss function
vision_model.compile(optimizer='adam', loss='sparse_categorical_crossentropy')

# Train the model on some data
vision_model.fit(X_train, y_train)
```

repository: PathofData/Tensorflow-models

repo_name: PathofData/Tensorflow-models


text:
---
layout: post
title: First speakers confirmed
lang: en
author: Fernando Briano
---
After a long night of decisions, we are in the position to confirm you our first 3 speakers:

## Jano González

Developer, amateur musician and addicted to talks. He's created from small webapps to complex enterprisey architectures, actually the CTO of [HopIn](http://hop.in). During his free time he plays music and tries to practice sports (withouth much success).

Jano is crossing the Andes from Chile to join us for RubyConf for the second time. He spoke at RubyConf Uruguay 2011 and also at our sister conference [RubyConf Argentina 2012](http://rubyconfargentina.org). Due to the shared love of Jano by Argentinians and Uruguayans alike, he's been also known as "Jano Of America" since then.

## Vicent Martí

[Vicent Martí](http://twitter.com/vmg) used to make videogames, but he sold out because he likes to wear expensive clothes. Or any clothes at all. He now works full time as a systems engineer at GitHub, focusing on security and performance issues on the backend. He's also the maintainer of libgit2, the Git library that powers GitHub's backend and native clients. He takes long showers because he enjoys smelling nice.

He used to live in Finland doing Research on Computer Graphics at the same university as Linus Torvalds. After he core dumped an alpha version of the Death Star, he moved to San Francisco to be a unicorn tamer at GitHub.

## Bryan Helmkamp

[Bryan](http://twitter.com/brynary) is the founder of Code Climate, an automated code review tool for Ruby apps, and the lead organizer of the Gotham Ruby Conference in NYC. For the last seven years, he's been an active in the Ruby community as an acclaimed speaker, author and open source contributor. In 2009, he received a Ruby Hero Award for his efforts.

We are very proud of being able to have such a Ruby Hero among our speakers, we thank people like Bryan for using their superpower for good, making this world a better place.

Stay tuned, we will be announcing more speakers next week.


text:
# Super Graph

## Instant GraphQL API for Rails. Zero code.

Get an high-performance GraphQL API for your Rails app in seconds. Super Graph will auto-learn your database structure and relationships. Built in support for Rails authentication and JWT tokens.

![Super Graph Web UI](docs/.vuepress/public/super-graph-web-ui.png?raw=true "Super Graph Web UI for web developers")

## Why I built Super Graph?

Honestly, cause it was more fun than my real work. After working on several product though my career I found myself hating building CRUD APIs (Create, Update, Delete, List, Show). It was always the same thing figure out what the UI needs then build an endpoint for it, if related data is needed than join with another table. I didn't want to write that code anymore I wanted the computer to just do it.

I always liked GraphQL it sounded friendly, but it still required me to write all the same database query code. Sure the API was nicer but it took a lot of work sometime even more than a simple REST API would have. I wanted a GraphQL server that just worked the second you deployed it without having to write a line of code.

And so after a lot of coffee and some Avocado toasts __Super Graph was born, a GraphQL server that just works, is high performance and easy to deploy__. I hope you find it as useful as I do and there's a lot more coming so hit that :star: to stay in the loop.

## Features
- Works with Rails database schemas
- Automatically learns schemas and relationships
- Belongs-To, One-To-Many and Many-To-Many table relationships
- Full text search and Aggregations
- Rails Auth supported (Redis, Memcache, Cookie)
- JWT tokens supported (Auth0, etc)
- Highly optimized and fast Postgres SQL queries
- Configure with a simple config file
- High performance GO codebase
- Tiny docker image and low memory requirements

## Documentation

[supergraph.dev](https://supergraph.dev)

## Contact me

[twitter.com/dosco](https://twitter.com/dosco)

## License

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

Copyright (c) 2019-present Vikram Rangnekar

repository: davincilchen/super-graph

repo_name: davincilchen/super-graph