text:
# AFRo
# Assembly Guide

## Bill of Materials

Make sure you have all of the following parts before you begin.

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
2 | [Dynamixel AX12]() | ![](../vitamins/images/DynamixelAX12_view.png) |
1 | [NEMA11 Stepper Motor]() | ![](../vitamins/images/NEMA11StepperMotor_view.png) |
2 | [NEMA17 Stepper Motor]() | ![](../vitamins/images/NEMA17StepperMotor_view.png) |
1 | [Spoon]() | ![](../vitamins/images/Spoon_view.png) |
1 | [Threaded Rod M6 x 105mm]() | ![](../vitamins/images/ThreadedRodM6x105mm_view.png) |
1 | [Aluminium Angle 10x10x1mm x 420mm]() | ![](../vitamins/images/AluminiumAngle10x10x1mmx420mm_view.png) |
4 | [Aluminium Angle 10x40x1.5mm x 200mm]() | ![](../vitamins/images/AluminiumAngle10x40x15mmx200mm_view.png) |
2 | [Aluminium Angle 10x40x1.5mm x 250mm]() | ![](../vitamins/images/AluminiumAngle10x40x15mmx250mm_view.png) |
1 | [Aluminium Tube 8mm OD 6mm ID x 79mm]() | ![](../vitamins/images/AluminiumTube8mmOD6mmIDx79mm_view.png) |
2 | [Ball Bearing 608]() | ![](../vitamins/images/BallBearing608_view.png) |
2 | [Ball Bearing 6205_2RS]() | ![](../vitamins/images/BallBearing6205_2RS_view.png) |
6 | [Ball Bearing 624]() | ![](../vitamins/images/BallBearing624_view.png) |
1 | [Belt T2p5x6 960mm]() | ![](../vitamins/images/BeltT2p5x6960mm_view.png) |
1 | [Belt T2p5x6 610mm]() | ![](../vitamins/images/BeltT2p5x6610mm_view.png) |
1 | [LM20UU Linear Bearing]() | ![](../vitamins/images/LM20UULinearBearing_view.png) |
1 | [LM8UU Linear Bearing]() | ![](../vitamins/images/LM8UULinearBearing_view.png) |
1 | [T2.5x18 Pulley]() | ![](../vitamins/images/T25x18Pulley_view.png) |
4 | [M2 Nut]() | ![](../vitamins/images/M2Nut_view.png) |
6 | [Nyloc M4 Nut]() | ![](../vitamins/images/NylocM4Nut_view.png) |
1 | [M6 Nut]() | ![](../vitamins/images/M6Nut_view.png) |
1 | [Nyloc M6 Nut]() | ![](../vitamins/images/NylocM6Nut_view.png) |
12 | [M2 pan screw x 6mm]() | ![](../vitamins/images/M2panscrewx6mm_view.png) |
2 | [M4 cap screw x 20mm]() | ![](../vitamins/images/M4capscrewx20mm_view.png) |
1 | [M4 cap screw x 50mm]() | ![](../vitamins/images/M4capscrewx50mm_view.png) |
1 | [M4 hex screw x 30mm]() | ![](../vitamins/images/M4hexscrewx30mm_view.png) |
2 | [M4 hex screw x 40mm]() | ![](../vitamins/images/M4hexscrewx40mm_view.png) |
19 | [M4 Washer 9x0.8]() | ![](../vitamins/images/M4Washer9x08_view.png) |
2 | [M5 Washer 20x1.4]() | ![](../vitamins/images/M5Washer20x14_view.png) |
4 | [M6 Washer 12x1.5]() | ![](../vitamins/images/M6Washer12x15_view.png) |
1 | [M8 Washer 17x1.8]() | ![](../vitamins/images/M8Washer17x18_view.png) |

### Cut Parts

Qty | Part Name | Image
--- | --- | ---
2 | Lower Arm Left Side | ![](../cutparts/images/LowerArmLeftSide_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Base Bracket](../printedparts/stl/BaseBracket.stl) | ![](../printedparts/images/BaseBracket_view.png) |
1 | [Counterweight Bracket](../printedparts/stl/CounterweightBracket.stl) | ![](../printedparts/images/CounterweightBracket_view.png) |
2 | [Counterweight Idler Guide](../printedparts/stl/CounterweightIdlerGuide.stl) | ![](../printedparts/images/CounterweightIdlerGuide_view.png) |
2 | [Counterweight Idler](../printedparts/stl/CounterweightIdler.stl) | ![](../printedparts/images/CounterweightIdler_view.png) |
1 | [Counterweight Line Bracket](../printedparts/stl/CounterweightLineBracket.stl) | ![](../printedparts/images/CounterweightLineBracket_view.png) |
1 | [Elbow Drive Pulley](../printedparts/stl/ElbowDrivePulley.stl) | ![](../printedparts/images/ElbowDrivePulley_view.png) |
1 | [Elbow Driven Gear](../printedparts/stl/ElbowDrivenGear.stl) | ![](../printedparts/images/ElbowDrivenGear_view.png) |
1 | [Elbow Driven Pulley](../printedparts/stl/ElbowDrivenPulley.stl) | ![](../printedparts/images/ElbowDrivenPulley_view.png) |
1 | [Elbow Joint 2](../printedparts/stl/ElbowJoint2.stl) | ![](../printedparts/images/ElbowJoint2_view.png) |
1 | [Elbow Joint](../printedparts/stl/ElbowJoint.stl) | ![](../printedparts/images/ElbowJoint_view.png) |
1 | [Elbow Motor Plate](../printedparts/stl/ElbowMotorPlate.stl) | ![](../printedparts/images/ElbowMotorPlate_view.png) |
2 | [Lower Arm Servo Bracket](../printedparts/stl/LowerArmServoBracket.stl) | ![](../printedparts/images/LowerArmServoBracket_view.png) |
1 | [Shoulder Belt Clamp](../printedparts/stl/ShoulderBeltClamp.stl) | ![](../printedparts/images/ShoulderBeltClamp_view.png) |
1 | [Shoulder Bracket Left](../printedparts/stl/ShoulderBracketLeft.stl) | ![](../printedparts/images/ShoulderBracketLeft_view.png) |
1 | [Shoulder Bracket Right](../printedparts/stl/ShoulderBracketRight.stl) | ![](../printedparts/images/ShoulderBracketRight_view.png) |
1 | [Spoon Holder](../printedparts/stl/SpoonHolder.stl) | ![](../printedparts/images/SpoonHolder_view.png) |
1 | [Torso Base](../printedparts/stl/TorsoBase.stl) | ![](../printedparts/images/TorsoBase_view.png) |
1 | [Torso Bearing Collar](../printedparts/stl/TorsoBearingCollar.stl) | ![](../printedparts/images/TorsoBearingCollar_view.png) |
1 | [Torso Bearing Top Collar](../printedparts/stl/TorsoBearingTopCollar.stl) | ![](../printedparts/images/TorsoBearingTopCollar_view.png) |
1 | [Torso Big Gear](../printedparts/stl/TorsoBigGear.stl) | ![](../printedparts/images/TorsoBigGear_view.png) |
1 | [Torso Cap](../printedparts/stl/TorsoCap.stl) | ![](../printedparts/images/TorsoCap_view.png) |
1 | [Torso Drive Gear](../printedparts/stl/TorsoDriveGear.stl) | ![](../printedparts/images/TorsoDriveGear_view.png) |
1 | [Wrist Bracket](../printedparts/stl/WristBracket.stl) | ![](../printedparts/images/WristBracket_view.png) |

# Cutting Instructions

## Lower Arm Left Side (x2)

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
4 | [Aluminium Angle 10x40x1.5mm x 200mm]() | ![](../vitamins/images/AluminiumAngle10x40x15mmx200mm_view.png) |

### Fabrication Steps

1. Cut aluminium angle to 200mm
![](../cutparts/images/LowerArmLeftSide_step1_view.png)
2. Drill 4mm diameter fixing holes
![](../cutparts/images/LowerArmLeftSide_step2_view.png)

# Assembly Instructions

## Spoon

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
1 | [Dynamixel AX12]() | ![](../vitamins/images/DynamixelAX12_view.png) |
1 | [Spoon]() | ![](../vitamins/images/Spoon_view.png) |
4 | [M2 Nut]() | ![](../vitamins/images/M2Nut_view.png) |
4 | [M2 pan screw x 6mm]() | ![](../vitamins/images/M2panscrewx6mm_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Spoon Holder](../printedparts/stl/SpoonHolder.stl) | ![](../printedparts/images/SpoonHolder_view.png) |

### Assembly Steps

1. Push M2 nuts into the back of the servo fixing tabs
![](../assemblies/AFRo/Spoon_step1_view.png)
2. Attach the spoon holder to the servo
![](../assemblies/AFRo/Spoon_step2_view.png)

## Hand

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
1 | [Dynamixel AX12]() | ![](../vitamins/images/DynamixelAX12_view.png) |
8 | [M2 pan screw x 6mm]() | ![](../vitamins/images/M2panscrewx6mm_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Wrist Bracket](../printedparts/stl/WristBracket.stl) | ![](../printedparts/images/WristBracket_view.png) |

### Sub-Assemblies

Qty | Name
--- | ---
1 | Spoon

### Assembly Steps

1.  Push the spoon assembly into the wrist bracket
![](../assemblies/AFRo/Hand_step2_view.png)
3. Screw through the bracket into the servo fixings
![](../assemblies/AFRo/Hand_step3_view.png)

## Lower Arm

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
2 | [Nyloc M4 Nut]() | ![](../vitamins/images/NylocM4Nut_view.png) |
2 | [M4 hex screw x 40mm]() | ![](../vitamins/images/M4hexscrewx40mm_view.png) |
4 | [M4 Washer 9x0.8]() | ![](../vitamins/images/M4Washer9x08_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Elbow Joint 2](../printedparts/stl/ElbowJoint2.stl) | ![](../printedparts/images/ElbowJoint2_view.png) |
2 | [Lower Arm Servo Bracket](../printedparts/stl/LowerArmServoBracket.stl) | ![](../printedparts/images/LowerArmServoBracket_view.png) |

### Sub-Assemblies

Qty | Name
--- | ---
1 | Hand

### Assembly Steps

1. Push the servo brackets onto the servo, optionally screw them into place
![](../assemblies/AFRo/LowerArm_step1_view.png)
2. Bolt through the aluminium channels and servo brackets
![](../assemblies/AFRo/LowerArm_step2_view.png)
3. Bolt through the aluminium channels and elbow joint
![](../assemblies/AFRo/LowerArm_step3_view.png)

## Elbow Joint

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
1 | [Threaded Rod M6 x 105mm]() | ![](../vitamins/images/ThreadedRodM6x105mm_view.png) |
1 | [Aluminium Tube 8mm OD 6mm ID x 79mm]() | ![](../vitamins/images/AluminiumTube8mmOD6mmIDx79mm_view.png) |
2 | [Ball Bearing 608]() | ![](../vitamins/images/BallBearing608_view.png) |
2 | [Ball Bearing 624]() | ![](../vitamins/images/BallBearing624_view.png) |
1 | [Belt T2p5x6 610mm]() | ![](../vitamins/images/BeltT2p5x6610mm_view.png) |
1 | [Nyloc M4 Nut]() | ![](../vitamins/images/NylocM4Nut_view.png) |
1 | [M6 Nut]() | ![](../vitamins/images/M6Nut_view.png) |
1 | [Nyloc M6 Nut]() | ![](../vitamins/images/NylocM6Nut_view.png) |
1 | [M4 cap screw x 50mm]() | ![](../vitamins/images/M4capscrewx50mm_view.png) |
3 | [M4 Washer 9x0.8]() | ![](../vitamins/images/M4Washer9x08_view.png) |
4 | [M6 Washer 12x1.5]() | ![](../vitamins/images/M6Washer12x15_view.png) |
1 | [M8 Washer 17x1.8]() | ![](../vitamins/images/M8Washer17x18_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Elbow Driven Gear](../printedparts/stl/ElbowDrivenGear.stl) | ![](../printedparts/images/ElbowDrivenGear_view.png) |
1 | [Elbow Driven Pulley](../printedparts/stl/ElbowDrivenPulley.stl) | ![](../printedparts/images/ElbowDrivenPulley_view.png) |
1 | [Elbow Joint](../printedparts/stl/ElbowJoint.stl) | ![](../printedparts/images/ElbowJoint_view.png) |

### Sub-Assemblies

Qty | Name
--- | ---
1 | Lower Arm

### Assembly Steps

1. Loosely assemble the driven gear set and push fit into the elbow joint
![](../assemblies/AFRo/ElbowJoint_step1_view.png)
2. Assemble the pulley set
![](../assemblies/AFRo/ElbowJoint_step2_view.png)
3. Slide the aluminium tube over the threaded rod and push fit the lower bearing
![](../assemblies/AFRo/ElbowJoint_step3_view.png)
4. Connect the lower arm
![](../assemblies/AFRo/ElbowJoint_step4_view.png)
5. Slip the belt round the pulley - this be connected later
![](../assemblies/AFRo/ElbowJoint_step5_view.png)

## Counterweight Idler (x2)

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
2 | [Ball Bearing 624]() | ![](../vitamins/images/BallBearing624_view.png) |
2 | [Nyloc M4 Nut]() | ![](../vitamins/images/NylocM4Nut_view.png) |
2 | [M4 cap screw x 20mm]() | ![](../vitamins/images/M4capscrewx20mm_view.png) |
8 | [M4 Washer 9x0.8]() | ![](../vitamins/images/M4Washer9x08_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
2 | [Counterweight Idler Guide](../printedparts/stl/CounterweightIdlerGuide.stl) | ![](../printedparts/images/CounterweightIdlerGuide_view.png) |
2 | [Counterweight Idler](../printedparts/stl/CounterweightIdler.stl) | ![](../printedparts/images/CounterweightIdler_view.png) |

## Shoulder

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
1 | [NEMA11 Stepper Motor]() | ![](../vitamins/images/NEMA11StepperMotor_view.png) |
2 | [Aluminium Angle 10x40x1.5mm x 250mm]() | ![](../vitamins/images/AluminiumAngle10x40x15mmx250mm_view.png) |
1 | [LM20UU Linear Bearing]() | ![](../vitamins/images/LM20UULinearBearing_view.png) |
1 | [LM8UU Linear Bearing]() | ![](../vitamins/images/LM8UULinearBearing_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Counterweight Line Bracket](../printedparts/stl/CounterweightLineBracket.stl) | ![](../printedparts/images/CounterweightLineBracket_view.png) |
1 | [Elbow Drive Pulley](../printedparts/stl/ElbowDrivePulley.stl) | ![](../printedparts/images/ElbowDrivePulley_view.png) |
1 | [Elbow Motor Plate](../printedparts/stl/ElbowMotorPlate.stl) | ![](../printedparts/images/ElbowMotorPlate_view.png) |
1 | [Shoulder Belt Clamp](../printedparts/stl/ShoulderBeltClamp.stl) | ![](../printedparts/images/ShoulderBeltClamp_view.png) |
1 | [Shoulder Bracket Left](../printedparts/stl/ShoulderBracketLeft.stl) | ![](../printedparts/images/ShoulderBracketLeft_view.png) |
1 | [Shoulder Bracket Right](../printedparts/stl/ShoulderBracketRight.stl) | ![](../printedparts/images/ShoulderBracketRight_view.png) |

### Sub-Assemblies

Qty | Name
--- | ---
1 | Elbow Joint

## Counterweight

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Counterweight Bracket](../printedparts/stl/CounterweightBracket.stl) | ![](../printedparts/images/CounterweightBracket_view.png) |

## Cable Guide

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
1 | [Aluminium Angle 10x10x1mm x 420mm]() | ![](../vitamins/images/AluminiumAngle10x10x1mmx420mm_view.png) |

## Torso

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
1 | [NEMA17 Stepper Motor]() | ![](../vitamins/images/NEMA17StepperMotor_view.png) |
2 | [Ball Bearing 6205_2RS]() | ![](../vitamins/images/BallBearing6205_2RS_view.png) |
2 | [Ball Bearing 624]() | ![](../vitamins/images/BallBearing624_view.png) |
1 | [Belt T2p5x6 960mm]() | ![](../vitamins/images/BeltT2p5x6960mm_view.png) |
1 | [T2.5x18 Pulley]() | ![](../vitamins/images/T25x18Pulley_view.png) |
1 | [Nyloc M4 Nut]() | ![](../vitamins/images/NylocM4Nut_view.png) |
1 | [M4 hex screw x 30mm]() | ![](../vitamins/images/M4hexscrewx30mm_view.png) |
4 | [M4 Washer 9x0.8]() | ![](../vitamins/images/M4Washer9x08_view.png) |
2 | [M5 Washer 20x1.4]() | ![](../vitamins/images/M5Washer20x14_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Torso Base](../printedparts/stl/TorsoBase.stl) | ![](../printedparts/images/TorsoBase_view.png) |
1 | [Torso Bearing Collar](../printedparts/stl/TorsoBearingCollar.stl) | ![](../printedparts/images/TorsoBearingCollar_view.png) |
1 | [Torso Bearing Top Collar](../printedparts/stl/TorsoBearingTopCollar.stl) | ![](../printedparts/images/TorsoBearingTopCollar_view.png) |
1 | [Torso Big Gear](../printedparts/stl/TorsoBigGear.stl) | ![](../printedparts/images/TorsoBigGear_view.png) |
1 | [Torso Cap](../printedparts/stl/TorsoCap.stl) | ![](../printedparts/images/TorsoCap_view.png) |

### Sub-Assemblies

Qty | Name
--- | ---
2 | Counterweight Idler
1 | Shoulder
1 | Counterweight
1 | Cable Guide

## Torso Drive

### Vitamins

Qty | Vitamin | Image
--- | --- | ---
1 | [NEMA17 Stepper Motor]() | ![](../vitamins/images/NEMA17StepperMotor_view.png) |

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Torso Drive Gear](../printedparts/stl/TorsoDriveGear.stl) | ![](../printedparts/images/TorsoDriveGear_view.png) |

## AFRo

### Printed Parts

Qty | Part Name | Image
--- | --- | ---
1 | [Base Bracket](../printedparts/stl/BaseBracket.stl) | ![](../printedparts/images/BaseBracket_view.png) |

### Sub-Assemblies

Qty | Name
--- | ---
1 | Torso
1 | Torso Drive

repository: Axford/AFRo

repo_name: Axford/AFRo


text:
## Angular MDC

[![Build Status](https://travis-ci.org/trimox/angular-mdc-web.svg?branch=master)](https://travis-ci.org/trimox/angular-mdc-web)
[![codecov](https://codecov.io/gh/trimox/angular-mdc-web/branch/master/graph/badge.svg)](https://codecov.io/gh/trimox/angular-mdc-web)
[![npm version](https://badge.fury.io/js/%40angular-mdc%2Fweb.svg)](https://badge.fury.io/js/%40angular-mdc%2Fweb)

[Demo App](https://trimox.github.io/angular-mdc-web/) with API, documentation and examples

Our Angular library integrates with [Google's Material Design Components](https://material.io/components/), providing a faithful and accurate representation of Material Design as it is envisioned on the web platform by Google's Material Design team. Our goal is to equip Angular developers with modular, straightforward and production-ready Material Design components.

Want to help? [Contributing](https://github.com/trimox/angular-mdc-web/blob/master/CONTRIBUTING.md)

Want to view recent changes? [Changelog](https://github.com/trimox/angular-mdc-web/blob/master/CHANGELOG.md)

## Installation
```
npm install --save @angular-mdc/web
```

## Getting started
### Include all components
```ts
import { MaterialModule } from '@angular-mdc/web';
```
### Include individual components
```ts
import { FabModule, MenuModule } from '@angular-mdc/web';
```

### Material Design Components
* WIP = work in progress
* TBI = to be implemented

| Component | Status        |
| ----------------- | --------------|
| button | Available |
| card | Available |
| checkbox | Available |
| dialog | TBI |
| drawer | TBI |
| elevation | WIP |
| fab | Available |
| form-field | Available |
| grid-list | TBI |
| icon-toggle | TBI |
| linear-progress | Available |
| list | TBI |
| menu | Available |
| radio | Available |
| ripple | Available |
| select | TBI |
| slider | TBI |
| snackbar | Available |
| switch | Available |
| tabs | TBI |
| textfield | Available |
| theme | WIP |
| toolbar | Available |
| typography | Available |

## Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
guidelines for [Contributing](https://github.com/trimox/angular-mdc-web/blob/master/CONTRIBUTING.md) and then check out one of our issues in the [help wanted](https://github.com/trimox/angular-mdc-web/issues?q=is%3Aopen+is%3Aissue+label%3A"help+wanted").

## Code of conduct

Help us keep Angular MDC open and inclusive. Please read and follow our [Code of Conduct](https://github.com/trimox/angular-mdc-web/blob/master/CODE_OF_CONDUCT.md).

license: MIT

repository: pvamshi/angular-mdc-web

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: pvamshi/angular-mdc-web


text:
---
title: "Drifter: Writing interactive fiction with ink"
tags:
    - writing
    - ink
    - tech
    - interactive fiction
excerpt: First attempt at writing a text adventure using Inkle's open source scripting language. Play it here.
---
**tldr**: I recently wrote a text adventure game called [Drifter](http://theconfused.me/drifter).  Source code is [here](https://github.com/lingxz/drifter) and feedback and bug reports are welcome!

---

I recently got inspired to write interactive fiction, after playing [The Train](https://herringblue.github.io/content/train/index.html) by [Ivan Chuang](https://herringblue.github.io/), shared by someone on Facebook.

It's an intriguing game, but I wasn't satisfied, and the natural response was to make my own.

The one I read used `ink` (the language, not the real one), and it looks easy enough, so I just decided to stick with it.

## Using ink
Inkle's scripting language [`ink`](https://github.com/inkle/ink) was easy enough to learn. The [tutorial](https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md) covered most of the use cases. The [inky IDE](https://github.com/inkle/inky) even supports converting to a web version--a folder with its `html`, `css`, `js` files all ready to be uploaded to a server.

 This is not a problem if you don't intend to revisit the knot, but if you do, you see your options disappearing after every visit. The way to fix this is to use `+` instead of `*`, that way options persist.

The documentation mentions shuffling briefly, but since `ink` now supports `LISTS`, what if you want to shuffle from a list?

From what I know, there are 2 ways to go about doing this. Say you want to get a random item from [apple, orange, pear].
- Without using a list:

```
=== function shuffle_fruits ===
{shuffle:
    - ~ return "apple"
    - ~ return "orange"
    - ~ return "pear"
}
```

- Choose a random number between 1 and the length of the list, then use that number to access the list element.

```
LIST fruits = apple, orange, pear
VAR fruit = false
=== function get_random_index ===
    ~ temp length = LIST_COUNT(LIST_ALL(names))
    ~ temp x = RANDOM(1, length)
    ~ return x
~ temp index = get_random_index()
~ fruit = fruits(index)
```

But another problem I faced was that using `LIST` wasn't very friendly for converting to javascript. Whenever I used a `LIST`, the browser complains about `Uncaught Error: Failed to find LIST called undefined`. I couldn't find a way around this, so I resorted to using the first method. Fortunately none of the items I have to shuffle are too long, so it wasn't too tedious.

Another thing I noiced when writing was that the inky editor didn't seem to ship with the latest `inky.js` file. Sometimes it terminated knots prematurely. I spent some time trying to figure out what's wrong with my code, before I just decided to try downloading the newest `inky.js` file from [here](https://github.com/y-lohse/inkjs), and after that it seemed to work fine.

The inky editor also crashes a bit too often for my liking. But it is, after all, still in alpha. The fact that it lets you play the game and rewind choices while editing was something I found really useful.

There are probably more advanced features, but I found that I survived quite well on just basic knots and stitches and some gathering. Perhaps used too many global variables in the process.

But all in all, a very gentle learning curve.

## Coming up with the plot

#### Spoiler alert
If you want to play the game without any prior knowledge of the plot, don't read below. This section is pretty general in terms of the elements of interactive fiction, but still might reveal some aspects of the plot.

Interactive fiction is actually quite different from most of the other forms of writing I've been doing. To be honest, I've never written anything of the sort, and before this, I have been woefully ignorant of the tools available. I don't play much of it either. I didn't even know about the term interactive fiction at first, oops.

But I have read those choose your own adventure books. So I gathered some of my ideas from there, and went around the web looking for resources. [Emily Short's blog](https://emshort.blog/), especially [this post](https://emshort.blog/how-to-play/writing-if/) was quite helpful.

After some poking around and deep soul searching (not really), these are some of the elements I felt I really wanted to include:
- some sort of escape room element
- a kind of side quest that might provide some benefit to the player in late game stage but is not essential to game development
- some kind of point system and delayed choice consequences
- a really exciting plot(!!!) that makes the reader want to know what is going on

### Escape room element
I play escape room games often (though I'm not good at it at all). Escape rooms are fun! But I also dislike a game having too much of it. This is a text adventure, after all. It would be confusing. Maybe some poking around for the player, with a few things to take, and not something full fledged escape room style.

### Side quests
Side quests are what I imagine to be those plot point which are not essential to the main plot development, but may or may not confer a certain benefit to the player in later gameplay.

For example, in an action game, I would have romance as a sort of side quest. A player can get through the game without it, but perhaps a player who has gone through the romance side quest (by chance or because he happens to carry a certain item) might have increased stat points that allow him to fight certain monsters with ease. Or that there is an alternative happy ending.

### Points system and delayed choice
I don't really like games where there is an obvious bad choice, or there is a choice which makes you die immediately. I like decisions that build up.

 Or if you chose A previously, then some of the NPCs are more likely to be suspicious, and if you get yourself into another dangerous situation, then you'll die.

Also, I think having sensible choices are important. I have played games where I think to myself, "those definitely aren't the things I would do in real life." But the problem, of course, is that writer does often want to push a plot--you can't allow the player to keep choosing to not participate (although knowing me, that is probably what I would do if given the choice).

### Exciting plot
I say this because some of the text adventures games I played in preparing to write this game gave me the feeling of making you choose for the sake of choosing, without pushing the plot.

Personally, I feel it is important most choices have a real consequence, and they affect the plot in some way or another.

## Conclusion
I'm sure there are more bugs to fix. But this is a good mix of writing and coding, and there is instant gratification in that there is something you can show your friends immediately. I mostly write novels, so this is something that I get rarely.

Perhaps next time, I could try a parser. They give a greater illusion of freedom / choice than CYOA kind of stories where you are choosing from a predefined set of options. But it is still an illusion, isn't it?


text:
{
"title"       : "Withdrawing DAO tokens",
"sort"        : "26",
"category"    : "FAQ",
"description" : "FAQ",
"date_published" : "2017-06-20T08:00:00+08:00",
"date_modified"  : "2017-06-20T08:00:00+08:00"
}

---%

### The old DAO MyEtherWallet doesn't seem to want to stay online & functioning. We're sorry.

**New instructions & where you can go to get help: [https://www.reddit.com/r/ethereum/comments/7ojy4h/there_are_still_200_million_unclaimed_funds_in/dsap0gr/](https://www.reddit.com/r/ethereum/comments/7ojy4h/there_are_still_200_million_unclaimed_funds_in/dsap0gr/)**

- Check which funds you can withdraw: [https://refunds.thedao.fund/](https://refunds.thedao.fund/)

- A general over view of what you can collect is here:
[https://medium.com/curator-multisig-phf-official-channel/dao-token-holders-come-claim-your-money-b428f186572a#.9ur5tfm26](https://medium.com/curator-multisig-phf-official-channel/dao-token-holders-come-claim-your-money-b428f186572a#.9ur5tfm26)

#### Walkthru for DAO Main withdraw

0. Have ETH in the account that has DAO tokens in it so you can collect the refund.

1. Go to https://www.myetherwallet.com/#send-transaction (the current version)

2. Make sure the ETH node in the top right corner is selected (Try out Giveth.io's donated node ;-) )

3. At the top of the screen there is a slider for gasPrice. Make sure you have selected a gasPrice that will make your tx go thru. If the CryptoKitties are still breeding like CryptoBunnies this might need to be 61 Gwei or more! If the network isnt under much load 1 Gwei or less will work, check https://ethgasstation.info/ to find the Standard gasPrice that will work immediately.

4. Access the key for the address holding your DAO tokens (this usu means selecting "Keystore / JSON File" finding your keystore file on your computer and then typing in the password) and then put this info into the boxes that pop up on the screen to approve the withdraw token contract to take your DAO tokens:

4a. TO `0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413`

4b. Value: `0`!!!!!!!

4c. gasLimit: `100000`

4d. DATA: `0x095ea7b3000000000000000000000000bf4ed7b27f1d666546e30d74d50d173d20bca7540000000000000000000000000000000000000000da0da0da0da0da0da0da0da0`

4e. Click Generate Tx and then click Send Tx

5. Stay on this screen and make a second tx, but this time with:

5a. TO `0xbf4ed7b27f1d666546e30d74d50d173d20bca754`

5b. Value: `0`!!!!!!!

5c. gasLimit: `100000`

5d. DATA: `0x3ccfd60b`

5e. Click Generate Tx and then click Send Tx

Now wait for the Ethereum Blockchain to work its magic and you will have a bunch of ETH delivered to you :-) Remember that a lot of people worked hard to make this possible, the whole Ethereum network hard forked for this! Pay it forward to the people around you, if this was built on Bitcoin, you would have lost all your funds #gratitude ;-D

#### Walk thru for ExtraBalance Refund

This short explainer is to help you understand what is happening in the code, if you don't really care and just want that sweet sweet ether, dont worry about it and skip to the numbered steps.

Withdrawing from the ExtraBal Withdraw contract is a 2 step process. There were ExtraBal Tokens sent to everyone that contributed to The DAO's ExtraBalance contract, these tokens are the accounting for the ExtraBal Withdraw contract (Special thx goes to Bokky Poobah, Nick Johnson, Beltran Berrocal, and Alexey Akunhov for setting this all up). The first tx tells the ExtraBal TOKEN contract to `approve()` the ExtraBal WITHDRAW contract to take all your ExtraBal tokens , the second transaction tells the ExtraBal WITHDRAW contract to count your tokens and give you the money.

0. Have ETH in the account that can collect the refund.

1. Go to https://www.myetherwallet.com/#send-transaction (the current version)

2. Make sure the ETH node in the top right corner is selected (Try out Giveth.io's donated node ;-) )

3. At the top of the screen there is a slider for gasPrice. Make sure you have selected a gasPrice that will make your tx go thru. If the CryptoKitties are still breeding like CryptoBunnies this might need to be 61 Gwei or more! If the network isnt under much load 1 Gwei or less will work, check https://ethgasstation.info/ to find the Standard gasPrice that will work immediately.

4. Access your key (this usu means selecting "Keystore / JSON File" finding your keystore file on your computer and then typing int he password) and then put this info into the boxes that pop up on the screen to approve the withdraw token contract to take your tokens:

4a. TO `0x5c40eF6f527f4FbA68368774E6130cE6515123f2`

4b. Value: `0`!!!!!!!

4c. gasLimit: `100000`

4d. DATA: `0x095ea7b3000000000000000000000000755cdba6ae4f479f7164792b318b2a06c759833b0000000000000000000000000000000000000000000000da0da0da0da0da0da0`

4e. Click Generate Tx and then click Send Tx

5. Stay on this screen and make a second tx, but this time with:

5a. TO `0x755cdba6ae4f479f7164792b318b2a06c759833b`

5b. Value: `0`!!!!!!!

5c. gasLimit: `100000`

5d. DATA: `0x3ccfd60b`

5e. Click Generate Tx and then click Send Tx

Now wait for the Ethereum Blockchain to work its magic and you will have a bunch of ETH delivered to you :-) Remember that a lot of people worked hard to make this possible, the whole Ethereum network hard forked for this! Pay it forward to the people around you, if this was built on Bitcoin, this wouldn't have happened ;-D

##### Walk thru for ETC (don't be afraid to tip the whitehats)

0. Have ETC in the account that you are using to interact with your wallet account.

1. Go to https://www.myetherwallet.com/#send-transaction (the current version)

2. Select the ETC node in the top right corner

3. Access your key (this usually means selecting "Keystore / JSON File" finding your keystore file on your computer and then typing int he password)

4. TO `0x9f5304da62a5408416ea58a17a92611019bd5ce3`

5. Value: `0`!!!!!!!

6. gasLimit: `100000`

7. DATA: insert something that looks like this BUT IS NOT THIS DATA:

`0xf3fef3a3000000000000000000000000839395e20bbB182fa440d08F850E6c7A8f6F0780000000000000000000000000000000000000000000000000000000000000000a`

--------pause---------

I am going to use this as a chance to explain what you are doing. so this isnt just annoying but hopefully you get something fun out of it :-)

https://github.com/BitySA/whetcwithdraw/blob/master/whetcwithdraw.sol#L155

you are calling that line ^^^. The data breaks down like this:

- `0x` is in front of everything always

- `f3fef3a3` is actually the withdraw function (in bytecode)

- `000000000000000000000000839395e20bbB182fa440d08F850E6c7A8f6F0780` is the address that should receive the ETC (without 0x in front).  This can be an exchange address, but I recommend you send it to your DAO Token address and then send it to an exchange from there using MEW.

- `000000000000000000000000000000000000000000000000000000000000000a` is the donation % but in hex, so if you wanted to donate 1% the last digit would be `1`, 10% the last digit would be `a`,  15% the last digit would be `f`, and 17% the last two digits would be `11` (Crazy right!)

-------continue--------

8. Click Generate Transaction and then Sign Transaction

9. All Done

### Old Instructions (probably doesn't work anymore)

#### You need to run the older version of MyEtherWallet (v3.3.7) to access the old DAO pages:

*   [MyEtherWallet (v3.3.7)](https://github.com/kvhnuke/etherwallet/releases/tag/v3.3.7)
*   Click on `dist-v3.3.7.zip`
*   Unzip it
*   Double-click `index.html`
*   MyEtherWallet is now running entirely on your computer

In case you are not familiar, you need to keep the entire folder in order to run the website, not just `index.html`. Don't touch or move anything around in the folder.

#### Once you've got the site up:

*  Click the **Withdraw DAO page** in the footer
*  You will see three tabs:
	*  1 for withdrawing ETH
	*  1 for withdrawing ETC
	*  1 for withdrawing your ExtraBalance
*  Click the three red buttons on the three DAO tabs to withdraw.
*  Done!

**Note: You will need minimum 0.01 ETH and 0.01 ETC in order to cover the cost of gas necessary to process the withdrawals.**

---

*Etherscan.io was kind enough to host this older version of MyEtherWallet on their site for 1.5 years. Thank you etherscan! [https://etherscan.io/myetherwallet/](https://etherscan.io/myetherwallet/)*


text:
# Relative Time

Formats JavaScript dates to relative time strings (e.g., "3 hours ago").

Based on the [Unicode CLDR][] locale data. Powered by [globalizejs/globalize][].

[Unicode CLDR]: http://cldr.unicode.org/
[globalizejs/globalize]: http://globalizejs.com/

## Why

### Leverages Unicode CLDR

Leverages Unicode CLDR (via [Globalize](http://globalizejs.com)), the largest and most extensive standard repository of locale data available.

It also means messages like `"today"`, `"yesterday"`, `"last month"` are available and properly localized in the various CLDR supported locales.

              N |   .  .                |
PDT  .   .  Mar 21 PDT       .   .  Mar 23, 00:00 PDT
EDT  .   Mar 21 EDT          .   Mar 22, 00:00 EDT
UTC  Mar 21                  Mar 22, 00:00
```
The relative time between `x` and now `N` is:

| time zone           | relative-time result |
| ------------------- | -------------------- |
| America/New_York    | `"yesterday"`        |
| America/Los_Angeles | `"21 hours ago"`     |

### What you get is correct

#### day

```
       Mar 21, 00:00           Mar 22, 00:00           Mar 23, 00:00           Mar 24, 00:00
hr.  | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
day    |                    b  |          a            |        N              |
       Mar 21                  Mar 22                  Mar 23                  Mar 24

```

Let's assume now (`N`) is *Mar 23, 9 AM*.

|                       | relative-time  | moment.js       |
| --------------------- | -------------- | --------------- |
| *Mar 22, 11 AM* (`a`) | `"yesterday"`  | `"a day ago"`   |
| *Mar 21, 8 PM* (`b`)  | `"2 days ago"` | `"a day ago"` ❓ |

Note `relative-time` checks for the actual day change instead of counting on approximate number of hours to turn the unit.

#### month

```
    Feb 1                        Mar 1                           Apr 1
day  | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
mo.  |       d                  c|b   a                         N|
```

Let's assume now (`N`) is *Mar 31*.

|                | relative-time   | moment.js          |
| -------------- | --------------- | ------------------ |
| *Mar 5* (`a`)  | `"26 days ago"` | `"a month ago"` ❓  |
| *Mar 1* (`b`)  | `"30 days ago"` | `"a month ago"` ❓  |
| *Feb 28* (`c`) | `"last month"`  | `"a month ago"`    |
| *Feb 9* (`d`)  | `"last month"`  | `"2 months ago"` ❓ |

Note `relative-time` checks for the actual month change instead of counting on approximate number of days to turn the unit.

## Usage

    npm install --save relative-time globalize cldr-data

```js
var cldrData = require("cldr-data");
var Globalize = require("globalize");
var RelativeTime = require("relative-time").default;

// Feed Globalize on CLDR.
Globalize.load(cldrData.entireSupplemental(), cldrData.entireMainFor("en"));
Globalize.locale("en");

var relativeTime = new RelativeTime();
console.log(relativeTime.format(new Date()));
// > now
```

### IANA time zone support

In addition to the above, install `iana-tz-data`.

```
npm install --save iana-tz-data
```

The example below assume now is `2016-04-10T12:00:00Z`, i.e.,

|      | UTC                  | America/Los_Angeles             | Europe/Berlin                            |
| ---- | -------------------- | ------------------------------- | ---------------------------------------- |
| date | 2016-04-10T00:00:00Z | 2016-04-09 17:00:00 GMT-7 (PDT) | 2016-04-10 14:00:00 GMT+2 (Central European Summer Time) |
| now  | 2016-04-10T12:00:00Z | 2016-04-10 05:00:00 GMT-7 (PDT) | 2016-04-10 14:00:00 GMT+2 (Central European Summer Time) |

```js
var ianaTzData = require("iana-tz-data");
var date = new Date("2016-04-10T00:00:00Z");

// Target: 2016-04-09 17:00:00 GMT-7 (PDT)
// Now: 2016-04-10 05:00:00 GMT-7 (PDT)
relativeTime.format(date, {
  timeZoneData: ianaTzData.zoneData.America.Los_Angeles
});
// > "yesterday"

// Target: 2016-04-10 14:00:00 GMT+2 (Central European Summer Time)
// Now: 2016-04-10 14:00:00 GMT+2 (Central European Summer Time)
relativeTime.format(date, {
  timeZoneData: ianaTzData.zoneData.Europe.Berlin
});
// > "12 hours ago"
```

## API

### `format(date{, options})`

### date

A [JavaScript date object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date), i.e., `new Date()`.

### options.unit (optional)

Unit for formatting. If the unit is not provided, `"best-fit"` is used.

- `"best-fit"` (default)
- `"second"`
- `"minute"`
- `"hour"`
- `"day"`
- `"month"`
- `"year"`

#### The `"best-fit"` unit

It automatically picks a unit based on the relative time scale. Basically, it looks like this:

- If `absDiffYears > 0 && absDiffMonths > threshold.month`, return `"year"`.
- If `absDiffMonths > 0 && absDiffWeeks > threshold.week`, return `"month"`.
- If `absDiffWeeks > 0 && absDiffDays > threshold.day`, return `"week"`.
- If `absDiffDays > 0 && absDiffHours > threshold.hour`, return `"day"`.
- If `absDiffHours > 0 && absDiffMinutes > threshold.minute`, return `"hour"`.
- If `absDiffMinutes > 0 && absDiffSeconds > threshold.second`, return `"minutes"`.
- Return `"second"`.

### options.timeZoneData (optional)

The *zdumped* IANA timezone data (found on the [iana-tz-data](https://github.com/rxaviers/iana-tz-data) package) for the desired timeZoneId.

If not provided, the user's environment time zone is used (default).

### Return

Returns the formatted relative time string given `date` and `options`.

## Appendix

### Relative time

In this library, we'll define relative time as what makes sense for expressions like "now", "2 days ago", "in 3 months", "last year", "yesterday", and so on. In a more formal definition, *relative time* is an approximate date distance given a unit. This is, *relative time* is the date distance of *a* and *b* ± error, where error < unit.

## License

MIT © [Rafael Xavier de Souza](http://rafael.xavier.blog.br)

repository: rxaviers/relative-time

gha_language: JavaScript

gha_license_id: MIT

repo_name: rxaviers/relative-time


text:
#PyOEIS
PyOEIS is a module for interfacing with the [Online Encyclopedia of Integer Sequences](http://oeis.org)

##Installation
The easiest way to install is with [pip](https://pip.pypa.io/en/latest/).

    $ pip install pyoeis

##Documentation
Documentation can be found in the following places:

* [Read The Docs](http://pyoeis.readthedocs.org)
* [Python Hosted](https://pythonhosted.org/pyoeis)

repository: whonut/PyOEIS

repo_name: whonut/PyOEIS


text:
# Gtfs Api for Rails

This gem is a ruby on rails [engine](http://guides.rubyonrails.org/engines.html) that is able to import and export a [Google Transit Feed Specification
[(GTFS)](https://developers.google.com/transit/gtfs/reference) feed into a database. It has the ActiveRecords

## Status of the project.

* The engine is in an early version of development.
* The engine includes tools to import a GTFS feed.
* Models perform validations to comply with the GTFS specification.
* The model is tested.

* Import needs some more testing.
* Export is not already done.

## Who can use this engine.

If you plan to build a public transport mobile app or web, based on a GTFS feed, this gem may help you to forget about all the server side.

If you plan to build a GTFS feed editor this gem may help you.

If you are part of the development team of a transport agency this can
help you to populate your data and make it available for developers
to create mobile and web apps.

Note: This project is still on an early stage, so keep in mind that
if you plan to set it on a production environment.

## The [why of Fry](https://en.wikipedia.org/wiki/The_Why_of_Fry)?
The author and contributors of this software believe in open source
as a key of innovation as well as public transportation as a
democratic path to freedom and development. Please, __abstain to use
this software if you don't share this belief__.

"An advanced city is not one where even the poor use cars, but
rather one where even the rich use public transport" - Enrique Peñalosa
former Mayor of Bogotá (Colombia)
[see Ted Talk](https://www.ted.com/talks/enrique_penalosa_why_buses_represent_democracy_in_action)

## Install

Add the following line to your `Gemfile`

```
gem 'gtfs-reader', :git=>"https://github.com/merlos/gtfs-reader.git", :branch => 'master'
gem 'gtfs_api'
```

Then run

```
bundle install
```

Copy the migrations and migrate the database

```
rake gtfs:migrate
```

<!--
Edit your `routes.rb`, and add this line

```
mount GtfsApi::Engine => "/gtfs/"
```

This will add the API routes under the /gtfs/ namespace
-->

##Importing a feed

To import a feed you just need to copy the feed zipped
in `db/gtfs/feed.zip` and run this task:

```
rake gtfs:import

```
Optionally you can download the feed directly from a URL:

```
rake gtfs:import[http://www.site.com/gtfs_file.zip]
```
You can find many GTFS feeds on [GTFS data Exchange](http://www.gtfs-data-exchange.com/)

### Importing Notes
GtfsApi supports multiple feed imports. That is, you can import
several feeds into the same database. But in order to do you should
care about id clashing (feed one has route "Route1" and feed two has
route_id "Route1").

__TODO__
If you want to include more than one feed without worrying about the
name clashing, just add the column `feed_id` with a unique value in each
`feed_info.txt` file of all your feeds.

__TODO__ GtfsApi importer will add the value of the column `feed_id` as prefix on all the ids of all the files of the feed. For example, in a feed that has feed_id= "CA" and an `agency.txt` has
`agency_id="CADE"` then the stored value for agency will be `"CA_CADE"`.

Some feeds may not include `agency_id` in `agency.txt`. In those cases `agency_id`
is auto generated during import.

Also, in order to support multiple agencies, `fare_attribute.txt` should
include the `agency_id`.

##Updating a feed
__TODO__ At this moment you need to clean the database and upload the feed again.
__TODO__ Add docummentation

##Exporting a feed
__TODO__ Not implemented yet.

###Google Transit Extensions Support
Google Inc. has defined a set of fields with its partners that
[extend the GTFS Specification](https://support.google.com/transitpartners/answer/2450962?hl=en)

GtfsApi supports the following extensions:

  1. column agency_id in fare_attributes.txt (for multi-agency support)
  2. additional route types (https://support.google.com/transitpartners/answer/3520902)
  3. column vehicle_type in stops.txt
  4. set location_type = 2 in stops.txt where 2 indicates an entrance. Note that: In this case stop_id must also specify parent_station. (partially supported __TODO_Validate_parent_station___)
  5.- on fare_attributes.txt, the field transfers accepts the range 0 to 5. In GTFS Spec is defined from [0..2]

Not supported yet:
  1.- optional column field platform_code in stops.txt
  2.- translations.txt
  3.- route-to-route and trip-to-trip transfers additional values

## Sample App

- [panatrans-api](https://github.com/merlos/panatrans-api/tree/features/gtfs-to-panatrans) Simple implementation of an API for displaying transportation stops and routes of Panama. This link points to the branch in which this engine is being used (testing).
- [panatrans-web](https://github.com/merlos/panatrans-web) Web client based on AngularJS and Bootstrap that works with panatrans-api.

## Notes for developers

### Models

On model attributes names we got rid of all non informative prefixes of some tables. For example "agency_name" column in agency.txt was renamed to "name" in the Agency model.

Because rails ids are in general integers and to keep consistency among imports and exports internally string "whatever_ids" defined in the GTFS spec have been converted into "io_id" on each model and the primary key is the rails id. Also, keeping an integer id it may help on performance for large

To make it easy update and delete feeds from different feeds, all models that hold GTFS data include a relation to the model Feed. Whenever you import a feed a new feed a reference to the feed is added.

 Currently, only English strings are provided.

```
# Example of i18m paths for errors in English.
en:
  activerecord:
    errors:
      models:
        gtfs_api/route:
          attributes:
            short_name:
              short_and_long_name_blank: "and long name both cannot be blank"
```

## Testing
GtfsApi relies heavily in tests. It uses the standard test suite that comes with rails. To run the tests:

```
rake test
```

If you see many useless warnings run:

```
RUBYOPT=-W0 rake test
```

### Testing Import/Export
__TODO__

There is a set of fake feeds to run some tests. These feeds are available on the folder `/test/fixtures/feed/`

 * `feed_panama/`: Basic feed with two agencies (metro,mibus), each agency has a route (linea1, alb-mar) and each route has two trips (linea1-i,linea1-r | alb-mar-i, alb-mar-r).

 * `full_feed/`: A feed with all the files.

## Generating the API documentation

Some parts of the code are documented with [yardoc](http://yardoc.org/). To generate the HTML, run the following comand:

```
yard doc
```

This generates some html documents in the `doc/` folder.

## Author & contributors

(C) Juan Manuel Merlos http://www.merlos.org | [@merlos](http://twitter.com/merlos)

Want to contribute? Fork the project and make pull a request :)

## License
This project rocks and uses MIT-LICENSE.

##Acknowledgements

Thanks to Sangster for creating the gem [gtfs-reader](https://github.com/sangster/gtfs-reader/)

## Related Projects

  - [panatrans-api](https://github.com/merlos/panatrans-api) Simple implementation of an API for displaying transportation stops and routes
  - [panatrans-web](https://github.com/merlos/panatrans-web) Web client based on AngularJS and Bootstrap that works with panatrans-api
  - [panatrans-dataset](https://github.com/merlos/panatrans-dataset) Dataset that works with panatans-api. This dataset includes a collaborative database of the Panamenian bus system information.

Other projects:

  - [Transit Feeds](http://transitfeeds.com/) A public repository of GTFS feeds
  - [Transit land ](https://transit.land/) Another public repository of GTFS feeds and API
  - [gtfs_engine](https://github.com/sangster/gtfs_engine) another engine for rails.
  - [Open Trip Planner](http://www.opentripplanner.org/)

repository: merlos/gtfs-api

repo_name: merlos/gtfs-api


text:
# kubectl-trace Release Process

Our release process is automated using [goreleaser](https://github.com/goreleaser/goreleaser).

When we release we do the following process:

1. We decide together (usually in the #kubectl-trace channel in Kubernetes slack) what's the next version to tag
2. A person with repository rights does the tag
3. The same person runs goreleaser in their machine
4. The tag is live on Github with the artifacts
5. Travis builds the tag and push the related docker images

## Release commands

Tag the version:

```bash
git tag -a v0.1.0-rc.0 -m "v0.1.0-rc.0"
git push origin v0.1.0-rc.0
```

From there, github actions should automatically create the release, as it sets
the `GITHUB_TOKEN`.

In case you need to run a release manually, so long as you are an administrator:

```
export GITHUB_TOKEN=<YOUR_GH_TOKEN>
make release
```

repository: dalehamel/kubectl-trace

gha_language: Go

repo_name: dalehamel/kubectl-trace


text:
# Make a Project from the command line CLI

be aware the project ID must be globally unique, that means no one in all of google land cound have used that name before

So be creative, or add so random characters on the end.

`gcloud projects create project-id-unique`

repository: gregorydillon/data-science-on-gcp

repo_name: gregorydillon/data-science-on-gcp


text:
---
layout: post
title: Andrew Ng Coursera Machine Learning(vII)
date: 2017-9-3
author: Kaiyuan Chen
catalog: true
tags:
    - Machine Learning
    - Study Notes
---

## Anomaly detection
We model p(x) and p(x_test) < \eps, then flag anomaly

### Gaussian Distribution
x ~ N(\mu, \standard deviation^2)

p(x) =
p(x1; mu1, sq1) * p(x2; m2, sq2) ... = product of all p

Algorithm:
1. choose features that you might think indicative
2. fit parameters
3. compute p(x)
the product(of two pdfs) is the result

#### Developing and evaluating an anomaly detection system
Assume we have some labelled data, of anomalous and non-anomalous examples,
for training set, unlabeled and it's ok to let anomalous to slip in
then use labelled set to test cross validation and test

algorithm
1. fit model p(x) on training set
1. predict on cross validation / test example

evaluation metrics: big-four / precision, recall / F score

#### Choosing features
we use different features, like **different order, log** to make data distributed more Gaussian
we choose feature that make usually large/small value in event of anomaly

### Recommender System

#### Content-based Recommender system
use a vector to describe the degree of class(like romance, action)
we can treat every user as a linear regression problem
to learn all users(all thetas)
just add a summation to all linear regressions

#### Collaborative Filtering
feature learning:
when we have a series of theta for every users, we can infer the features (which are how romantic a movie is)

##### algorithm
instead of switching between estimating x and estimating theta, we optimize a general equation such that

J(x, theta) = 1/2 * sum(theta*x - y)^2 + regulation term of theta + regulation term of x

1. initialize x and theta to small random values
2. minimize using gradient descent

#### low rank matrix factorization
we can have a matrix that contain all the predictive rating for users/movies
and we compute it as
X * Theta'
>In mathematics, low-rank approximation is a minimization problem, in which the cost function measures the fit between a given matrix (the data) and an approximating matrix (the optimization variable), subject to a constraint that the approximating matrix has reduced rank.

##### finding movies j related to i
we use Euclidean distance

##### Implementation Details
If we do predictive matrix and collaborative filtering directly, for a new user without any information will minimize J by setting every parameter to 0.

To solve this problem, we use mean normalization.
we subtract average rating of every matrix and learn theta and x through this new matrix.


text:
[:arrow_backward:](depth-of-field.md)
[:arrow_double_up:](../README.md)
[:arrow_up_small:](#)
[:arrow_down_small:](#copyright)
[:arrow_forward:](pixelization.md)

# 3D Game Shaders For Beginners

## Posterization

![Posterization](https://i.imgur.com/KHQr4XG.gif)

Posterization or color quantization is the process of reducing the number of unique colors in an image.
You can use this shader to give your game a comic book or retro look.
Combine it with [outlining](outlining.md) for a full-on cartoon art style.

```c
  // ...

  float levels = 10;

  // ...
```

The `levels` parameter controls how many discrete bands or steps there are.
This will break up the continuous values from zero to one into chunks.
With two levels, zero to one becomes zero, 0.5, and one.

```c
  // ...

  fragColor = texture(posterizeTexture, texCoord);

  // ...
```

Sample the current fragment's color.

```c
  // ...

  float unquantized = dot(fragColor.rgb, vec3(0.3, 0.59, 0.11));
  float quantized   = floor(unquantized * levels) / levels;
  float adjustment  = quantized / max(unquantized, 0.0001);

  fragColor.rgb *= adjustment;

  // ...
```

There are various different ways to implement posterization.
I find this method produces nicer results than the more typical methods you'll find.

To reduce the color palette, first convert the color to a greyscale value.
Quantize the color by mapping it to one of the levels.
Calculate the ratio between the quantized greyscale value and the non-quantized greyscale value.
Multiply the fragment's color by this ratio.
This adjusts the fragment's color to have the same greyscale value as the quantized greyscale value.
Or in other words, this maps the quantized greyscale value back to a red, green, and blue vector.

### Pre-blurring

![Pre-blurring Posterization](https://i.imgur.com/tXVNGxY.gif)

While not a requirement, blurring the input texture first can produce a nicer result.
Refer to the [blur](blur.md) section for more details.

### Cel Shading

![Cel Shaded](https://i.imgur.com/PXWFrEZ.gif)

Posterization can produce the cel shaded look as cel shading or toon shading is the process of quantizing
the diffuse and specular colors into discrete shades.
For the best results,
use only solid diffuse colors,
no to subtle normal mapping,
and a small value for `levels`.

### Source

- [main.cxx](../demo/src/main.cxx)
- [basic.vert](../demo/shaders/vertex/basic.vert)
- [posterize.frag](../demo/shaders/fragment/posterize.frag)

## Copyright

(C) 2019 David Lettier
<br>
[lettier.com](https://www.lettier.com)

[:arrow_backward:](depth-of-field.md)
[:arrow_double_up:](../README.md)
[:arrow_up_small:](#)
[:arrow_down_small:](#copyright)
[:arrow_forward:](pixelization.md)


text:
# sre-agent
## Compiling this package for multiple platforms
In order to compile the agent, is it good to retrieve from Github along with all the dependencies.
The Go programming language comes with a rich toolchain that makes obtaining packages and building executables incredibly easy.
One of Go's most powerful features is the ability to cross-build executables for any Go-supported foreign platform.
This makes testing and package distribution much easier, because you don't need to have access to a specific platform in order to distribute your package for it.

In this particular case, our `sre-agent` (for monitoring compute environments with extensibility via plugins) present interesting opportunities for building.

I will assume your working laptop is running Mac OS X (Mojave as of this version), with GoLang (version go1.11.2 as of this writing) installed. Docker (18.09 CE) is useful for some aspects and testing to support the cross-platform versions.

### Docker images needed
Download the docker images for the supported operating systems:
- Ubuntu
  - 18.04 (bionic)
  - 18.10 (cosmic)
  - 19.04 (disco)
  - 14.04 (trusty)
  - 16.04 (xenial)
- Alpine
  - 3.6
  - 3.7
  - 3.8
- CentOS
  - centos:7.6.1810
  - centos:7.5.1804
  - centos:6.10

Verify all are properly loaded:
```
docker images|grep -e REPO -e ^ubuntu -e ^alpine -e ^centos
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
alpine              3.6                 94627dfbdf19        2 months ago        4.03MB
alpine              3.7                 34ea7509dcad        2 months ago        4.21MB
alpine              3.8                 196d12cf6ab1        2 months ago        4.41MB
centos              6.10                30e66b619e9f        8 weeks ago         194MB
centos              7.5.1804            76d6bc25b8a5        8 weeks ago         200MB
centos              7.6.1810            d5f224905a66        2 days ago          202MB
ubuntu              14.04               f17b6a61de28        2 weeks ago         188MB
ubuntu              16.04               a51debf7e1eb        2 weeks ago         116MB
ubuntu              18.04               93fd78260bd1        2 weeks ago         86.2MB
ubuntu              18.10               0bfd76efee03        2 weeks ago         73.7MB
ubuntu              19.04               d861a21f6090        2 weeks ago         74.9MB
```
### Installing from Version Control
Before we can create executables from a Go package, we have to obtain its source code. The go get tool can fetch packages from version control systems like GitHub.
Under the hood, go get clones packages into subdirectories of the $GOPATH/src/ directory.
Then, if applicable, it installs the package by building its executable and placing it in the $GOPATH/bin directory.
If you configured Go as described in the prerequisite tutorials, the $GOPATH/bin directory is included in your $PATH environmental variable, which ensures that you can use installed packages from anywhere on your system.
We will use your home directory for this instructions.

It's common to use go get with the -u flag, which instructs go get to obtain the package and its dependencies, or update those dependencies if they're already present on the machine.
This command can take a little to finish, since it needs to validate and download all the dependencies.
No output actually indicates that the command executed successfully.

```
mkdir -p ~/go/src
export GOPATH=~/go
export PATH=$GOPATH/bin:$PATH
go get -u github.com/gus-maurizio/sre-agent
```
The command also builds the executable and places it in the $GOPATH/bin.

In order to build the plugins (either those provided with the distribution, or the ones you can create to extend the agent), a special script has been included in the `scripts` directory.
Executing the following command will compile **just for the architecture of your build system**, in this case Mac OS X. The last parameter to the `buildplugins.bash` script is the directory where the plugin source code resides. The plugin source **must start with plugin_**. The plugins can reside (*.so) in any directory. This can be specified in the YAML configuration file for the agent.
```
bash scripts/buildplugins.bash plugins darwin amd64
```

#### Rebuild the executable
To specify a different name or location for the executable, use the -o flag. Let's build an executable called sreagent
and place it in a build directory (will be created if it does not exist) within the current working directory:
```
$ GOOS=`echo "$(uname -s)"| tr '[:upper:]' '[:lower:]'`
$ GOARCH=amd64
$ go build -o $GOOS/$GOARCH/sreagent github.com/gus-maurizio/sre-agent
$ file $GOOS/$GOARCH/sreagent
darwin/amd64/sreagent: Mach-O 64-bit executable x86_64
$ otool -L  $GOOS/$GOARCH/sreagent
darwin/amd64/sreagent:
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1560.12.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1560.12.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.220.15)
```

### Building for a different OS and architecture
The go build command lets you build an executable file for any Go-supported target platform, on your platform.
This means you can test, release and distribute your application without building those executables on the target platforms you wish to use.

Cross-compiling works by setting required environment variables that specify the target operating system and architecture.
We use the variable GOOS for the target operating system, and GOARCH for the target architecture.
To build an executable, the command would take this form:
```
GOOS=target-OS GOARCH=target-architecture;go build -o $GOOS/$GOARCH/sreagent github.com/gus-maurizio/sre-agent
```
In our case we will build for the `linux` OS and `amd64` architecture:
```
GOOS=linux GOARCH=amd64;go build -o $GOOS/$GOARCH/sreagent github.com/gus-maurizio/sre-agent
```
Unfortunately this will only work in Mac OS X if you **do not have the need for CGO**.
If your plugin requires C code (like we indeed do), this will not work. Fortunately there is a solution!

### Using Docker to cross compile (and test!)
#### Use an ubuntu image to compile from scratch:
```
$ docker run --rm -it -v $GOPATH:/mnt --name goubuntu ubuntu:18.04 /bin/bash
# apt update && apt install -y gcc file git curl wget
# curl -O https://storage.googleapis.com/golang/go1.11.2.linux-amd64.tar.gz
# tar -xvf go1.11.2.linux-amd64.tar.gz && mv go /usr/local
# export GOROOT=/usr/local/go
# export GOPATH=/tmp
# export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
# mkdir $GOPATH/src
# go get -u github.com/gus-maurizio/sre-agent
# go get -u github.com/gus-maurizio/plugin_cpu
# go get -u github.com/gus-maurizio/plugin_mem
# go get -u github.com/gus-maurizio/plugin_disk
# cd $GOPATH/src/github.com/gus-maurizio
# bash sre-agent/scripts/build.bash
```
#### Use an ubuntu image to compile from existing:
```
$ docker run --rm -it -v $GOPATH:/mnt --name goubuntu ubuntu:18.04 /bin/bash
# apt update && apt install -y gcc file git curl wget
# curl -O https://storage.googleapis.com/golang/go1.11.4.linux-amd64.tar.gz
# tar -xvf go1.11.4.linux-amd64.tar.gz && mv go /usr/local
# export GOROOT=/usr/local/go
# export GOPATH=/mnt
# export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
# cd $GOPATH/src/github.com/gus-maurizio
# bash sre-agent/scripts/build.bash
```

#### Alpine special case (needs review)
For some (unknown to me) reason, Alpine does not exactly behave like other Unixes.
```
$ docker run --rm -it -v $GOPATH:/mnt --name golang golang:1.11.4-alpine3.8 /bin/sh
# apk update && apk add -y gcc file git curl wget musl-dev
# go get -u github.com/gus-maurizio/sre-agent
# cd $GOPATH/src/github.com/gus-maurizio/sre-agent
# sh scripts/buildplugins.bash plugins linux amd64
# find /mnt/src/github.com/gus-maurizio/sre-agent/alpine -type f | xargs rm
# mkdir -p /mnt/src/github.com/gus-maurizio/sre-agent/alpine/
# cp -r linux/* /mnt/src/github.com/gus-maurizio/sre-agent/alpine/
# find /mnt/src/github.com/gus-maurizio/sre-agent/alpine -type f | xargs file
```

## Testing in different version of Unix
For this purpose we will ensure the agent loads and runs a basic configuration.
We will use containers to perform the tests.  Started",
  "time": "2018-12-08T21:02:55Z"
}
...
Ctrl-C
```
### CentOS 6
```
$ docker run --rm -it \
    -v $GOPATH/src/github.com/gus-maurizio/sre-agent/linux/amd64:/sreagent \
    -v $GOPATH/src/github.com/gus-maurizio/sre-agent/config/agent.yaml:/etc/agent.yaml \
    --name centos6 centos:6.10 /bin/bash -c "cd /sreagent && ./sreagent -f /etc/agent.yaml"
{
  "level": "info",
  "msg": "Program sreagent [from .] Started",
  "time": "2018-12-08T21:02:55Z"
}
...

Ctrl-C
```

### Alpine 3.8
```
$ docker run --rm -it \
    -v $GOPATH/src/github.com/gus-maurizio/sre-agent/alpine/amd64:/sreagent \
    -v $GOPATH/src/github.com/gus-maurizio/sre-agent/config/agent.yaml:/etc/agent.yaml \
    --name alpine38 alpine:3.8 /bin/sh -c "cd /sreagent && ./sreagent -f /etc/agent.yaml"
...
Ctrl-C
```

## Monitoring Memory Usage
The package net/http/pprof can be used.
```
go tool pprof http://localhost:9000/debug/pprof/heap
go tool pprof http://localhost:9000/debug/pprof/profile?seconds=30
go tool pprof http://localhost:9000/debug/pprof/block
wget http://localhost:9000/debug/pprof/trace?seconds=5
go tool pprof http://localhost:9000/debug/pprof/mutex
```
To view all available profiles, open http://localhost:9000/debug/pprof/ in your browser.
### Using Prometheus to monitor
The simplest way is to use the container version.

```
mkdir ~/prometheus-data

docker run --rm -it -p 9090:9090 --name prom -v ~/prometheus-data:/prometheus \
       prom/prometheus  --config.file=/prometheus/prometheus.yml

docker exec -ti prom /bin/sh
```
Where the configuration file will perform the collection as defined below:
```
global:
  scrape_interval:     5s
  evaluation_interval: 5s

scrape_configs:
  - job_name: 'sre-agent'
    metrics_path: /metrics
    scheme: http
    static_configs:
      - targets:
        - docker.for.mac.host.internal:9000

```
### Grafana for Dashboards
You can run Grafana in a container!
```
mkdir ~/grafana-data

#           -v ~/grafana-data/grafana.ini:/etc/grafana/grafana.ini \
docker run --rm -it -p 3000:3000 \
           --name grafana \
           -v ~/grafana-data:/var/lib/grafana \
            grafana/grafana
```
Add the Prometheus data source and load the dashboard: https://grafana.com/dashboards/6671.
Make sure you *DO NOT USE* localhost if you are running in Mac, use *docker.for.mac.host.internal* as the hostname (assuming you are running native the sre-agent). The Data Source for Prometheus must be defined the same way!.

repository: gus-maurizio/sre-agent

repo_name: gus-maurizio/sre-agent


text:
# One Server API

This is the API for the single server setup. All the build / run scripts for the demo are in here.

To run this example, start from this folder and run:
```bash
npm install # if necessary
npm start
```


text:
# drawchange Volunteer & Event Management System
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![CircleCI](https://circleci.com/gh/GTBitsOfGood/drawchange.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/GTBitsOfGood/drawchange)
[![Known Vulnerabilities](https://snyk.io/test/github/gtbitsofgood/drawchange/badge.svg)](https://snyk.io/test/github/gtbitsofgood/drawchange)

## Overview

This portal is meant to be used by Atlanta nonprofit drawchange to manage their volunteers and events. New volunteers will register an account, be vetted by an administrator, then sign up for volunteer events through this portal.

## Running

Install dependencies: `$ npm install` or `$ yarn`

Fire up a development server: `$ npm run dev`

Once the server is running, you can visit `http://localhost:3000/`

## File layout

- **Frontend React**
    - The top level application Container is in `frontend/containers/AppContainer.js`
    - CSS styles are in `frontend/assets/stylesheets/base.scss`
- **Backend Express**
    - Entry point is `server.js`
    - API routes are under `backend/routes.js`
    - API routes are served under `http://localhost:3000/api`

## Production Build

To build your production assets and run the server:

```
$ npm start
```

## Deploying to Heroku

This app is set up for deployment to Heroku!

_This assumes you have already have a Heroku account and have the
[Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) installed_

```
$ heroku login
$ heroku create -a name-of-your-app
$ git push heroku master
$ heroku open
```

Heroku will follow the `build` command in your `package.json` and compile assets with `webpack.prod.config.js`. It runs the Express web server in `server.js`.

If you're unfamiliar with Heroku deployment (or just need a refresher), they have a really great walkthrough [here](https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction).

## Running on Glitch

1. Go to https://glitch.com/edit/#!/horizons-hackathon-react and click
  `Remix this 🎤`
1. Click `Show` at the top to preview your app!

repository: krrishdholakia/drawchange

repo_name: krrishdholakia/drawchange


text:
---
description: >-
  Here you can find information about getting started working with Umbraco Cloud.
---

# What is Umbraco Cloud?

Umbraco Cloud is our hosting option for your favorite Umbraco CMS. Built on the Microsoft Azure Cloud and encompassing web standard approaches, Umbraco Cloud is familiar to Umbraco's new and old users. With Umbraco Cloud, there are no limits to what you can accomplish. Anything you can do with Umbraco and web technology you can do with Umbraco Cloud.

Getting Started	Learn how to get started working with Umbraco Cloud.	the-umbraco-cloud-portal	arm_with_u_logo.png

Setup	Learn how you can set up your Umbraco Cloud projects.	set-up.md	code_too.png

Deployments	Learn how Deployments on Umbraco Cloud works.	Deployments	arrow.png

{% embed url="https://www.youtube.com/embed/TcmuTpJT1Kw?rel=0" %}
How to create Umbraco Cloud trial
{% endembed %}

## Umbraco Cloud Plans

Umbraco Cloud offers shared hosting in 3 different plans:

* Starter
* Standard
* Professional

You can [learn more about quotas](getting-started/umbraco-cloud-plans.md) that are put in place to ensure the stability of your website.

## Umbraco Cloud Project

The easiest way to get started with an Umbraco Cloud project is to take a [14-day free trial](https://umbraco.com/?product\_tour\_id=103162). The project is automatically created and you are ready to get started within a few minutes.

Since we set up the entire project, we recommend that you get to know your project before you start building.

To start working with and building your site, you can either work directly in the backoffice on the Cloud environment or you can [clone down the project to your local machine](set-up/working-locally.md). For Linux or macOS users, see [Working with Linux/macOS](set-up/working-with-linux-macos.md).

### Umbraco Cloud Portal Project

To create a project in Umbraco Cloud Portal:

1. Log in to the [Umbraco Cloud Portal](https://www.s1.umbraco.io/projects) with your credentials.
2.  Click **Create New Project**.

3. Select **Umbraco Cloud** from the list of projects.
4. Choose a **Plan Selection** as per your choice.
5. Choose the Umbraco version for your Project.
6. Enter the **Project Name**.
7. Choose a **Region**.
8. Choose a **Project Owner** and add **Technical Contacts**.
9. Click **Continue**.
10. Verify that everything looks correct and check **I have read and agree to the terms and conditions and the Data Processing Agreement**.
11. Click **Create Project**.

### Naming a Project

When you create a:

* Trial project for the first time - a unique project name will be generated for you.
* Project from the Umbraco Cloud Portal - you will get to choose a name for the project.

To rename the project file and folder, see the [Renaming the Project file and folder](set-up/project-settings/#renaming-the-project-file-and-folder) article.

An Umbraco Cloud project name is unique, which means if a project with the name you choose already exists, you will need to choose another name before you can create the project.

### Project Overview

Once a project is created, you can view its overview in Umbraco Cloud Portal:

1. Log in to the [Umbraco Cloud Portal](https://www.s1.umbraco.io/projects) with your credentials.
2. Select your Project from the **Projects** dashboard.
3.  Go to Project **Settings** and click **Overview**.

The Overview Page consists of:

* Name - The name of the project.
* Alias - The alias of the project.
* Plan - The plan selected for the project. Available plans are Starter, Standard, or Professional.
* Payment status - The payment status of the project.
* Created by - The name and email of the project creator.
*   Creation date - The date the project was created.

    ![Project Overview Page](getting-started/images/Cloud\_Overview\_Page.png)

Umbraco Cloud takes care of installation, infrastructure, and security. You will also get the tools to work with your project in the Cloud or locally. Local development starts with cloning the project down to your PC or Linux/macOS.

When you are ready to show your work to the world, Umbraco Cloud provides a safe deployment mechanism that lets you publish to the web. When you have changes or updates to your site, Umbraco Cloud follows the process of moving, testing, and deploying your changes to your public site.

## Different ways to start an Umbraco Cloud project

{% content-ref url="getting-started/migrate-existing-site/" %}
[migrate-existing-site](getting-started/migrate-existing-site/)
{% endcontent-ref %}

{% content-ref url="getting-started/baselines/" %}
[baselines](getting-started/baselines/)
{% endcontent-ref %}

repository: umbraco/UmbracoDocs

branch_name: refs/heads/main

repo_name: umbraco/UmbracoDocs


text:
# CHANGELOG

## 0.0.23

- Added `emu` tool for spawning an emulator instance given a Fuchsia QEMU build,
  the Fuchsia SDK, and an Android emulator executable.
- Fixed homepage link.

## 0.0.18 - 0.0.22

- Add retries to paving operations.
- Add timeouts to paving and ssh operations.
- Add arguments parameter to test command.

## 0.0.17

- Add "push-packages" option.

## 0.0.16

- Refactor usages of `amberctl` to its own class.

## 0.0.9 - 0.0.15

- Various improvements including support for Fuchsia tests.

## 0.0.8

- Use fuchsiapkg URLs to launch test target

## 0.0.7

- Set error code in wrapper script

## 0.0.6

- Use random port for PM serving.
- Add more error logging on failures.

## 0.0.5

- Fix SSH command input so that correct exit code is returned when a command
  fails.

## 0.0.4

- Fix issue where tests results were not printing.

## 0.0.3

- Publish correct binaries for Linux

## 0.0.2

- Published with mac binaries tagged as Linux. Do not use.

## 0.0.1

- Initial pre-release for testing. Do not use.

repository: Melvin-Abraham/packages

repo_name: Melvin-Abraham/packages


text:
<div align="center">

## LastFMAddon

#### An addon providing LastFM data to MediaMod

</div>

### Notes

- [IntelliJ IDEA](https://www.jetbrains.com/idea/) is the recommended IDE to use for MediaMod Addons
- This addon uses Kotlin ``1.4.31`` and the ``rewrite`` branch of MediaMod
- At the moment, the MediaMod Addon API is still very experimental and subject to change

repository: ChachyDev/LastFMAddon

repo_name: ChachyDev/LastFMAddon


text:
---
title: Change WordPress Customizer Control Value Programmatically
date: "2015-09-03T17:46:37.121Z"
---

Since the WordPress Customizer is built using the [Underscore.js](http://underscorejs.org/) and [Backbone.js](http://backbonejs.org/) libraries, the values of all the customizer controls are not stored in the DOM, but rather in a discrete model. This means that if you use JavaScript to change the value of a control in the DOM, it will look like it has changed visually, but that value will not be saved. Underscore has two-way data binding, so if you update the value in the model (which is what WILL be saved when the user clicks `Save and Publish`), it will also be updated visually in the DOM.

In order to change the value of a control, you need to bind a JavaScript function to it (see lines 5 & 6 of the code below), then use Backbone’s `.set()` method to save a new value for it (see line 16).

```js
(function ($) {
  $(window).load(function () {
    // When 'Use Portal Color Controls' customizer control is toggled
    wp.customize("portal_color_control", function (value) {
      value.bind(function (newval) {
        // If toggled off, warn user that portal color settings will be deleted
        if ("off" == newval) {
          var confirmation = window.confirm(
            "WARNING: turning this off will delete all the portal color settings. Continue?"
          );

          if (true == confirmation) {
            // If user confirms, run code here to delete all portal color settings
          } else {
            // If user does not confirm, reset the customizer control to 'on'
            this.set("on");
          }
        }
      });
    });
  });
})(jQuery);
```

The example above is for on/off radio buttons. If the user clicks the `off` radio button, they see a JavaScript confirm box pop up telling them that if they turn it off, some of their settings will be deleted. If they click `Cancel`, the radio button control is automatically changed back to the `on` value.

## Debugging

To help you determine what the value of a customizer control is at a given point, you can:

1. Open the Sources tab of Chrome’s dev tools.
1. Find the JavaScript file.
1. Click in the margin to set a breakpoint right after `value.bind()`.
1. Click the Scope dropdown in the right pane and view the value of this (the customizer control you bound the current function to).
1. You can also set another break point after your `this.set()` code to make sure the value has been successfully changed.

![Customizer control value](./customizer-control-value.png)

## Enqueue Your JS

And of course, don’t forget to enqueue your JavaScript file with code similar to this:

```php
function km_enqueue_customizer_scripts() {
    global $wp_customize;

    if ( ! isset( $wp_customize ) ) {
        return;
    }

    wp_enqueue_script( 'customizer_scripts', PLUGIN_URL . 'assets/js/customizer_scripts.js', 'jquery' );
}
add_action( 'admin_enqueue_scripts', 'km_enqueue_customizer_scripts' );
```


text:
# Dlt-Item_Mask
this script allows you to have items that, if used, make a mask appear on the head of the ped, which is also configurable on the server side.
for info:
https://discord.gg/UYSbwt9uTM