text:
---
permalink: mysql-master-master-replication/
audit_date:
title: Configure MySQL Master-Master Replication
type: article
created_date: '2011-06-07'
created_by: Rackspace Support
last_modified_date: '2018-10-26'
last_modified_by: Cat Lookabaugh
product: Cloud Servers
product_url: cloud-servers
---

**Note**: Rackspace Support cannot assist with master-master replication setups
due to the complexity of configuration and likelihood of error.  As an
alternative to direct MySQL master-master replication, consider either our
[Cloud Databases](http://www.rackspace.com/cloud/databases/) service or a
replication engine like [Tungsten](https://code.google.com/p/tungsten-replicator/)
for more reliable data replication between database instances.

### MySQL Master-Master Replication

This article shows you how to set up
[MySQL Master-Master database replication](http://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-replication-multi-master.html)
between two Cloud Servers. Master-Master data replication enables replicated
data, stored on multiple computers, to be updated by any authorized contributing
member of the group. This enables more open collaboration than
[Master-Slave replication](/how-to/set-up-mysql-master-slave-replication) where
any needed changes identified by a group member must to be submitted to the
designated "master" of the node.

This tutorial uses the Debian 5 (Lenny) operating sytem, built from the Rackspace
Cloud base image.

### Setup Outline

There are two Cloud Servers, `debian501` and `debian502`, in this exercise.
Both servers have two IP addresses (one public, one private). The exercise
configures the replication to be done over the private IP interface so that you
don't incur any bandwidth charges.

### Creating the Cloud Servers

You need to create two Linux Cloud Servers, using the Debian 5 base image. Use
the following steps to create each server separately.

1. Log in to the [Cloud Control Panel](https://login.rackspace.com).
2. In the top navigation bar, click **Select a Product > Rackspace Cloud**.
3. Select **Servers > Cloud Servers**.
4. Click **Create Server**.
5. Name the servers so that you can easily identify them during setup. In this exercise they are named debian501 and debian502.
6. Select the Debian image.
7. Select the RAM configuration (flavor) meets your database requirements.
8. Click **Create Server**.

The following server commands should be run as a privileged (root, sudo group) user.

### Installing MySQL

First we need to install MySQL on both the Debian Cloud Servers. As always,
prior to installing any packages, we need to make sure that our package list is
up to date and our locale/language settings are configured properly.

- Update the package database:

        # aptitude update

- Install locales:

        # aptitude install locales

        # dpkg-reconfigure locales

- The `dpkg-reconfigure locales` command brings up a locales setting window
where you can choose the locales for your system depending on your country and
region. In this case, choose `en\_GB.UTF-8`.

- Now, run the following commands to install MySQL:

        # aptitude install mysql-server mysql-client libmysqlclient15-dev

### Configuring replication

Once the _mysql-server_ package has been installed successfully, start
configuring each of the MySQL nodes in order to enable replication between them.

You need to create the database that will be replicated as well as the
replication username and password to be used with it. You can use the commands
outlined below to set them up, remembering to change all the strings/values in
brackets to apply to your specific configuration.

- First, on debian501, log in to the _mysql console_ (using the mysql root password that you setup during MySQL installation).

        # mysql -u root -p
        mysql>

- Now, create the replication user, which is used to synchronize the changes.

        mysql> grant replication slave on \*.\* to slaveuser@'[private IP of debian502]' identified by '[some password]';
        mysql> flush privileges;
        mysql> exit

- Do the same for debian502.

        mysql> grant replication slave on \*.\* to slaveuser@'[private IP of debian501]' identified by '[some password]';
        mysql> flush privileges;
        mysql> exit

- Back on debian501, edit _/etc/mysql/my.cnf_ and insert, update, or uncomment the following entries:

        bind-address = <IP_ADDRESS>
        server-id = 1
        log-bin = /var/log/mysql/var/bin.log
        log-slave-updates
        log-bin-index = /var/log/mysql/log-bin.index
        log-error = /var/log/mysql/error.log
        relay-log = /var/log/mysql/relay.log
        relay-log-info-file = /var/log/mysql/relay-log.info
        relay-log-index = /var/log/mysql/relay-log.index
        auto_increment_increment = 10
        auto_increment_offset = 1
        master-host = [private IP address of debian502]
        master-user = [replication username]
        master-password = [replication password]
        replicate-do-db = <database name to be replicated>

- Repeat the steps on the debian502 server.

        bind-address = <IP_ADDRESS>
        server-id = 2
        log-bin = /var/log/mysql/bin.log
        log-slave-updates
        log-bin-index = /var/log/mysql/log-bin.index
        log-error = /var/log/mysql/error.log
        relay-log = /var/log/mysql/relay.log
        relay-log-info-file = /var/log/mysql/relay-log.info
        relay-log-index = /var/log/mysql/relay-log.index
        auto_increment_increment = 10
        auto_increment_offset = 2
        master-host =  [private IP address of debian501]
        master-user = [replication username]
        master-password = [replication user password]
        replicate-do-db = [database name to be replicated]

- Now, restart both databases. If the service restart on either server fails,
then check the **/var/log/mysql/error.log** file for any errors. Update the
configuration and check for any typos, and so on.

### Testing the scenarios

For the purpose of testing your replication setup, create the database
specified in the previous configuration section.  Also create a test table on
one of the nodes and watch the log files in **/var/log/mysql** directory. Note
that all database changes should be replicated to your other server immediately.

      mysql> create database [your-db-name];
      mysql> use [your-db-name]
      mysql> create table foo (id int not null, username varchar(30) not null);
      mysql> insert into foo values (1, 'bar');

- As an additional test, stop the MySQL service on debian502, making database
changes on the debian501 server and then restarting the MySQL service on debian502.
The debian502 MySQL service should sync up all the new changes automatically.

- You should also consider changing the default binary log rotation values
(`expire_logs_days` and `max_binlog_size`) in the **/etc/mysql/my.cnf** file,
because, by default, all the binary logs are kept for 10 days. If you have a high
transaction count on your database application, it can cause significant hard
disk space usage in logs. So, consider changing those values to match your server
backup policies. For example, if you have daily backups setup of your MySQL node,
you don't need to keep 10 days worth of binary logs.

repository: rackerlabs/rackspace-how-to

repo_name: rackerlabs/rackspace-how-to


text:
# dotfiles

Here resideth pirtle's dotfiles. It's about time I made it an externally hosted repo.

Dear Future Pirtle, [check this](http://dotfiles.github.io/).

# license

If you find anything here (that I wrote!) useful, feel free to steal and use. It mostly exists for my sanity.
Consider it all [unlicensed](https://unlicense.org/).

I am unable to relicense anything which was released by someone else.

license: Unlicense

repository: pirtleshell/dotfiles

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: pirtleshell/dotfiles


text:
# Shipyard
Make and fly airships in Pocketmine-MP!

##About
This plugin is currently far from getting released.

## How to
select both outer corners of the ship by doing **/shipyard pos1**|**pos2**
To make the ship, do **/shipyard create**.
Now to select your ship, do **/shipyard control**.
Now that you have a ship, do **/shipyard get**.

You should obtain a ship controller. Right-click in the direction you want to go!
Have fun flying!

## Credits
Made by **AndreasHGK**

Under heavy development!

license: MIT

repository: AndreasHGK/Shipyard

repo_name: AndreasHGK/Shipyard


text:
# ἤπερ

<!-- Status: S2=NeedsReview -->
<!-- Lexica used for edits: BDAG, LN  -->

## Word data

* Strongs: G22600

* Alternate spellings:

see below [ἤ];

* Principle Parts:

* Part of speech:

* Instances in Scripture: 1

* All Scriptures cited: Yes

## Etymology:

* LXX/Hebrew glosses:

2Mac 14:42, 4Mac 15:16;

* Time Period/Ancient Authors:

Josephus Wars 5, 10, Antiquities 18, 62.

* Related words:

* Antonyms for all senses

* Synonyms for all senses:

## Senses

### Sense  1.0:

#### Definition:

than;

#### Glosses:

#### Explanation:

emphatic signal of comparison;

#### Citations:

after μᾶλλον Joh 12:43 (Compare Tob 14:4), ἢ γάρ in a variant reading of Luke 18:14 may come from ἤ + παρ᾽)

repository: mandolyte/uw-obsidian

branch_name: refs/heads/main

repo_name: mandolyte/uw-obsidian


text:
Entity ID
======

To provide methods such as `findById`, `save`, `remove` and so on, Slicker
has to determine `id` field of model that used in repository.

There is a type-class `io.slick.core.Entity` that should return
for some type `E` its `id` field value of type `Option[Id]`.

```scala
trait Entity[E, Id] {
  def id(e: E): Option[Id]
}
```

Basically, for each model with field named `id` of type `Option[A]` Slicker is able
to derive this type class automatically using Shapeless library.
So there is no need to inherit some trait or use annotations.

But in case if there is no such optional field or `id` field has another name, it's
possible to implement `Entity` type-class manually with companion object and implicit value:

```scala

case class Catalog(cid: Long, name: String)

object Catalog {

    implicit val entity: Entity[Catalog, Long] = {
        new Entity[Catalog, Long] {
          def id(e: Catalog): Option[Long] = Some(catalog.cid)
        }
    }

}
```

Compiler will automatically resolve this `Entity` instance to use with repository.

More
======

* [Quick start](index.md)
* [Pagination and sorting](pagerequest.md)
* [Slick-pg Driver](slickpg.md)

repository: sergeykolbasov/slicker

repo_name: sergeykolbasov/slicker


text:
![Petri.jl](assets/full-logo.png)

```@meta
CurrentModule = Petri
```

`Petri.jl` is a Petri net modeling framework for the Julia programming language.
`Petri` makes it easy to build complex reaction networks using a simple DSL.
Once a model is defined, `Petri.jl` has support to generate ODE solutions and
stochastic simulations using `DifferentialEquations.jl`.

## Goals

 This is related to the
 [DiffeqBiological](https://github.com/JuliaDiffEq/DiffEqBiological.jl) Reaction
 DSL, but takes a different implementation approach. Instead of building our
 framework around symbolic algebra and standard chemical notion, we are working
 off the Applied Category Theory approach to reaction networks [[Baez Pollard, 2017](http://math.ucr.edu/home/baez/RxNet.pdf)].

There are operations that are easy to do on the `Petri.Model` like "add a
transition from R to S" that require simultaneously changing multiple parts of
the algebraic formulation. Applied Category Theory gives a sound theoretical
framework for manipulating Petri Nets as a model in terms of the given domain.
`Petri` is a Julia package primarily intended to investigate how we can
operationalize this theory into practical scientific software.

See [AlgebraicPetri](https://github.com/AlgebraicJulia/AlgebraicPetri.jl) for
tools that work with Petri net models and manipulating them with higher level
APIs based on Applied Category Theory.

gha_language: Julia

gha_license_id: MIT


text:
# SVD Recommender and Visualization Example

The following set of notebooks contains an example of how to use SVD with Kinetica to build a recommender engine. The notebooks generate result tables and must be executed in-order.

| Notebook | Description |
| ---: | ---: |
| svd_1_ingest.ipynb | Download and ingest Amazon rating data |
| svd_2_calc.ipynb | Calculate SVD matrices and save results |
| svd_3_recommend.ipynb | Demonstration of a recommender |
| svd_4_visualization.ipynb | Clustering and visualization with SVD |

repository: kineticadb/kinetica-jupyterlab

repo_name: kineticadb/kinetica-jupyterlab


text:
# transportation-detection

This project seeks to design effective models for predicting a user's transportation method from smartphone's sensors. It uses the following data set from Kaggle:

https://www.kaggle.com/fschwartzer/tmd-dataset-5-seconds-sliding-window

Currently, I only have the raw R code but I hope to polish it into a more digestible R markdown format. In the future, I will even try to translate to Python and its associated scikit-learn packages.

This was done as a final project for my DS 740 class at the University of Wisconsin Data Science Masters program.

repository: zwerginz/transportation-detection

repo_name: zwerginz/transportation-detection


text:
# Spring Boot on Bluemix with IBM Continuous Delivery

The goal of this lab is to demonstrate deploying a simple Java web application to Bluemix with a DevOps pipeline for managing the application lifecycle.

As part of this deployment, several actions are happening automatically through the use of configuration files found in the [.bluemix](.bluemix) folder. The two primary actions that are automatically configured to occur are deploying two different microservices from two different repositories and integrating multiple Bluemix services into the deployed applications.

## Table of Contents

- [Prerequisites](https://github.com/IBM/spring-boot-continuous-delivery/blob/master/Readme.md#prerequisites)
- [Steps](https://github.com/IBM/spring-boot-continuous-delivery/blob/master/Readme.md#steps)
- [Access Cloudant DB service](https://github.com/IBM/spring-boot-continuous-delivery/blob/master/Readme.md#cloudant-db)
- [Deployment Configuration](https://github.com/IBM/spring-boot-continuous-delivery/blob/master/Readme.md#deployment-configuration)
- [Associated Repositories](https://github.com/IBM/spring-boot-continuous-delivery/blob/master/Readme.md#associated-repositories)

## Prerequisites

1. A Bluemix account is required to complete this lab.

    To sign up for a new account visit [Bluemix.net](https://console.ng.bluemix.net/ "Welcome to Bluemix")

2. A Slack team is an **optional** requirement to complete this lab.

    To sign up for a new team visit [slack.com](https://slack.com/)

## Steps

1. Log into the [Bluemix console](https://console.ng.bluemix.net/) and create a [Cloudant instance](https://console.ng.bluemix.net/catalog/services/cloudant-nosql-db/?taxonomyNavigation=services) named `sample-java-cloudant-cloudantNoSQLDB`.

2. Click the following Deploy to Bluemix button to load the initial toolchain setup:

    [![Deploy to Bluemix](https://github.com/IBM/container-journey-template/blob/master/images/button.png)](https://bluemix.net/deploy?repository=https://github.com/IBM/spring-boot-continuous-delivery)

3. Once the Tool Integrations have loaded, click on each of the four different integrations to see what settings are available to be changed.

    **Note:** that the fields for GitHub, Eclipse Orion Web IDE, and Delivery Pipeline are automatically populated with data and no input should be required by the user unless changes to what was populated are desired.

    **Optional:** Slack Integration. Skip to Step 4 if you choose not to configure it.

    Slack Integration allows your team to be notified of events occuring in your Delivery Pipeline. To configure this integration, create an incoming webhook for your Slack team using the [Slack API](https://api.slack.com/incoming-webhooks). Once created, fill in the three fields listed under the Slack Integration.

4. Click the "Create" button in the bottom right area of the window to instruct Bluemix to create a toolchain for you using the defined settings.

5. The page that loads after clicking create is the application's Toolchain. Here is the overview of all of the integrated services, the flow of the project, and easy navigation to each of the individual components of the application.

6. As soon as the "Create" button was pressed, Bluemix went to work deploying the application via the defined pipeline configurations. Click on the "Delivery Pipeline" box in the Toolchain to view the code deployment pipeline.

7. The pipeline page will dynamically update with the status of each step in the pipeline. When the deployment has finished running the bar on the top of the "Deploy Stage" will turn green.

In Progress                |  Finished
:-------------------------:|:-------------------------:
![](media/PipelineInProgress.png)  |  ![](media/PipelineFinished.png)

8. Once the "Deploy Stage" has turned green, indicating the job is complete, the link to the deployed application can be found in the mid-section of the "Deploy Stage" card.

9. Upon clicking the application's URL, a new tab will open to the application's main page.

Create a New Account                |  Account Created
:-------------------------:|:-------------------------:
![](media/AccountImage1.png)  |  ![](media/AccountImage2.png)

-----

## Cloudant DB

The following steps will show how to access the account that was just created in the Cloudant DB database

1. Return to [Bluemix](https://console.ng.bluemix.net/ "Welcome to Bluemix") and open the [Services Dashboard](https://console.ng.bluemix.net/dashboard).

2. Once on the Services Dashboard, locate your Cloudant DB and click on it to open the service description page.

3. Click on the "LAUNCH" button near the top right of the page to load into the Cloudant DB dashboard.

4. Once the Cloudant DB dashboard has finished loading, select the databases tab on the left.

5. Click on the "Account" database. On the right you will see the account that was created from the web app above.

6. Click on the database entry to view more details.

-----

# Deployment Configuration

In this application we use several different files that each server an important part of customizing our Bluemix deployment. Below we will give a brief overview of each file's function.

## toolchain.yml

File location: [.bluemix/toolchain.yml](.bluemix/toolchain.yml)

The toolchain.yml file is used to define the desired application name, integrated services, descriptions, environment properties, and more. This file is what pulls in the pipeline.yml, deploy.json, and custom Toolchain image used in this application.

For our application we have integrated GitHub as a code repository as well as for issue tracking, Eclipse Orian Web IDE for editing code via the web interface, and a pipeline to deploy the application from the integrated GitHub repository.

## deploy.json

File location: [.bluemix/deploy.json](.bluemix/deploy.json)

The deploy.json file is what allows user customization of the Toolchain via the UI before the user clicks deploy but after the user has clicked the "Deploy to Bluemix" button from the GitHub repository.

For our application we have configured the deploy.son file to capture and require three fields that will be used as environment variables by the toolchain.yml: selected-region, selected-organization, and selected-space. We have created a three column form that allows users to select fields for each of the afore mentioned variables if the defaults are not desired. Finally, we have called a helper function to validate the input variables.

## pipeline.yml

File location: [.bluemix/pipeline.yml](.bluemix/pipeline.yml)

The pipeline.yml file is used to configure the Bluemix Pipeline for an application. A toolchain can have multiple pipeline files. One way to rename the pipeline.yml files is to add a prefix to the pipeline.yml file's name: example-pipeline.yml. In the pipeline.yml file we can specify things such as build steps, environment variables, custom scripts and instructions, etc.

For our application we have configured the pipeline.yml to build our maven project to a custom location and then deploy the built .war file from the custom location. Additionally, in our pipeline.yml file we have specified the application memory limit using the `cf` command:

```cf push "${CF_APP}" -p "springboot-demo.war" -m 256M```

-----

# Associated Repositories

One of the primary aspects of this lab is to demonstrate simplified deployment of microservices from multiple repositories. As part of the setup for the different microservices a unique deployment pipeline cis reated for and connected to each of the individual microservice's repositories. By creating a different pipeline for each repository we are enabling each service to have its code updated and re-deployed completely independent of the operation of the other microservice; that is to say, by having two pipelines we can update the code for one microservice and the other microservice will be completely unaffected and unaware anything happened.

- Admin Dashboard Microservice: [https://github.com/IBM/spring-boot-continuous-delivery-admin](https://github.com/IBM/spring-boot-continuous-delivery-admin)

   **Note:** No direct interaction with the associated repositories is required. All of the deployment interaction is done through the current repository.


text:
# OpenCensus Node.js Example

Note: This code was tested on the following Node versions:
- v6.10.0 (for console exporter only)
- v9.8.0 (for Stackdriver and Zipkin exporters)

At this momment the automatic instrumetation is only for apps using http and mongo-db.

___

## Setup

1. Clone the OpenCensus Node repository https://github.com/census-instrumentation/opencensus-node.git
```bash
git clone https://github.com/census-instrumentation/opencensus-node.git
cd opencensus-node
```

2. Switch to branch `dev` with:
```bash
git checkout dev
```

3. Install the dependencies with:
```bash
npm install
```

4. Compile the TypeScript code into JavaScript with:
```
node_modules/.bin/tsc
```

5. In a different folder, clone the example application to be instrumented (EasyNotes Application)
```bash
 git clone https://github.com/callicoder/node-easy-notes-app
```

6. Navigate to the application folder and install the dependencies with:
```bash
cd node-easy-notes-app
npm install
```

7. Check if the app is running. PS.: a mongodb installation is required
```bash
$ node server.js
Server is listening on port 3000
Successfully connected to the database
```

## Add opencensus instrumentation

To add opencensus instrumetation, follow the steps below:

1. Navigate to the `node_modules` folder inside the EasyNotes application and create a link to OpenCensus Node project folder with:
```bash
cd node_modules
ln -s <your path>/opencensus-node/build/src  opencensus-nodejs
cd ..
```

2. Edit server.js and add the following line, as the first line of the file:
```javascript
 var tracing = require("opencensus-nodejs").start()
 ...
 var express = require('express');
```

## Running the Instrumented Application

Save the file server.js and run the app with debugging option.

```bash
$ DEBUG=opencensus node server.js
opencensus useAsyncHooks = true +0ms
opencensus patching<EMAIL_ADDRESS>module +75ms
opencensus patching http.Server.prototype.emit function +7ms
....
Server is listening on port 3000
Successfully connected to the database
```
This options uses a default exporter to console.

To test de api you can use the commands:
```bash
#To insert a note:
curl -X POST http://localhost:3000/notes --data '{"title": "Note 1", "content": "this is the note content"}' -H "Content-Type: application/json"

#To get notes:
curl http://localhost:3000/notes
```

## Exporting to Zipkins

1. Download Zipkin choosing one of the three available options on [Quickstart](https://zipkin.io/pages/quickstart.html): through Docker, on Java or manually compiling the source code. Tests were executed running Zipkin with Java, through the following commands on terminal:
```bash
    wget -O zipkin.jar 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec'
    java -jar zipkin.jar
```

2. Open the `server.js` file in the EasyNotes application and insert this code on top:
```javascript
var tracing = require("opencensus-nodejs")
              .addZipkin("http://localhost:9411/api/v2/spans", "easy-notes")
              .start()
```

## Exporting to Stackdriver

1. Make sure you enabled Stackdriver Tracing on Google Cloud Platform. More info at <https://cloud.google.com/trace/docs/quickstart>

2. Enable Application Default Credentials for authentication with:
```bash
export GOOGLE_APPLICATION_CREDENTIALS=path/to/your/credential.json
```
More information at <https://cloud.google.com/docs/authentication/getting-started>

3. Open the `server.js` file in the EasyNotes application and insert this code on top:
```javascript
var traceMng = require("opencensus-nodejs")
               .addStackdriver("your-project-id")
               .start();
```

## Exporting to multiple Exporters

It is possible to instrument with more than one code. To achieve this, simply add more than one Exporter in series.

```javascript
var tracing = require("opencensus-nodejs")
              .addZipkin(“http://localhost:9411/api/v2/spans“, "easy-notes")
              .addStackdriver("your-project")
              .start()
```

repository: silvafabiog/opencensus-node

repo_name: silvafabiog/opencensus-node


text:
# #070 Programming an ATtiny With ArduinoISP

Programming an ATTINY85-20PU on a breadboard with Arduino ISP

Here's a quick video of it in action:

[![ProgrammingWithArduinoISP](https://img.youtube.com/vi/eILb11BE6pY/0.jpg)](https://www.youtube.com/watch?v=eILb11BE6pY)

## Notes

The objective here is to setup an ATTINY85-20PU chip on a breadboard, and program it using an Arduino operating as an in-system programmer.

### Adding ATiny support for Arduino IDE

I'm running Arduino 1.6.1 (MacOSX), so I first needed to add [ATiny support for Arduino IDE 1.6.x](https://github.com/damellis/attiny/tree/ide-1.6.x).
I always prefer to clone rather than download zips so I'm able to work on the source if necessary.
In these steps ${sketchbook_folder} refers to my actual sketchbook folder location.

```
git clone git@github.com:damellis/attiny.git
cd attiny
git checkout -b ide-1.6.x origin/ide-1.6.x
mkdir ${sketchbook_folder}/hardware
cp -R attiny ${sketchbook_folder}/hardware
```

After restarting Arduino, I now have new Tools menu options.

### Setup the Arduino ISP

Setup the Arduino ISP. Note in this case I'm using an Arduino Uno as the programmer:

* Select `Tools > Board > Arduino Uno`
* Select `Tools > Port > (correct port for Arduino Uno)`
* Upload Examples/ArduinoISP sketch to Arduino Uno
* Select `Programmer > Arduino as ISP`

### Selecting ATtiny options

I went with the basics:

* `Tools > Board > ATtiny`
* `Tools > Processor > ATtiny85`
* `Tools > Clock > 1MHz (internal)`

### Burning the Bootloader

Depending on the state of the chip, this may not be necessary. But if in doubt, burn it again:

* Select `Tools > Burn Bootloader`

### Uploading a Sketch

I'm testing with [TinyBlink](../TinyBlink) which runs LEDs on digital pins 0 and 1.

* Open desired sketch
* Select `File > Upload Using Programmer` (or shift-click the normal upload icon)

Crickey, it works.

### How Fast is the Clock?

The ATtiny85 can use an external clock, but by default it uses an internal oscillator.
The internal oscillator runs at 8 MHz, prescaled down to 1 MHz by default.

The clock settings are in the fuses. I used avrdude to read the settings:

```
$ avrdude -c stk500v1 -p attiny85 -P /dev/cu.usbmodem14521 -b 19200 -U lfuse:r:-:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: reading lfuse memory:

Reading | ################################################## | 100% 0.02s

avrdude: writing output file "<stdout>"
:01000000629D
:00000001FF

avrdude: safemode: Fuses OK (E:FF, H:DF, L:62)

avrdude done.  Thank you.
```

The [engbedded fusecalc](http://www.engbedded.com/fusecalc) site is invaluable for decoding or calculating fuses values.

It confirms that E:FF, H:DF, L:62 are factory defaults: 8 MHz internal oscillator with CKDIV8 prescaler: so it is running at 1 MHz.

### Programming with avrdude

The Arduino IDE now includes the ability to export the compiled binary.
This option, found in the "Sketch" menu produces [TinyBlink.ino.tiny8.hex](../TinyBlink/TinyBlink.ino.tiny8.hex)
from the [TinyBlink](../TinyBlink) source.

![export_compiled_binary](./assets/export_compiled_binary.png?raw=true)

avrdude can then be used to directly upload the hex file via the Arduino ISP:

```
$ avrdude -v -c stk500v1 -p attiny85 -P /dev/cu.usbmodem14521 -b 19200 -U flash:w:../TinyBlink/TinyBlink.ino.tiny8.hex:i

avrdude: Version 6.3, compiled on Sep 21 2018 at 19:09:46
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/usr/local/Cellar/avrdude/6.3_1/etc/avrdude.conf"
         User configuration file is "/Users/paulgallagher/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem14521
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATtiny85
         Chip Erase delay              : 4500 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as FF
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "../TinyBlink/TinyBlink.ino.tiny8.hex"
avrdude: writing flash (676 bytes):

Writing | ################################################## | 100% 0.99s

avrdude: 676 bytes of flash written
avrdude: verifying flash memory against ../TinyBlink/TinyBlink.ino.tiny8.hex:
avrdude: load data flash data from input file ../TinyBlink/TinyBlink.ino.tiny8.hex:
avrdude: input file ../TinyBlink/TinyBlink.ino.tiny8.hex contains 676 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.50s

avrdude: verifying ...
avrdude: 676 bytes of flash verified

avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:DF, L:62)

avrdude done.  Thank you.
```

### Construction

![The Breadboard](./assets/ProgrammingWithArduinoISP_bb.jpg?raw=true)

![The Schematic](./assets/ProgrammingWithArduinoISP_schematic.jpg?raw=true)

![Build](./assets/ProgrammingWithArduinoISP_build.jpg?raw=true)

NB: in the breadboard, pins 5 and 6 are wired LEDs. These are for a test scketch and not required for programming
(but neither do they interfere with buring the bootloader and uploading a sketch).

## Credits and References

* [LEAP#071 TinyBlink](../TinyBlink) - a simple ATtiny test sketch
* [LEAP#253 ProgrammingShield](../ProgrammingShield) - a programming shield version of this project
* [ATtiny85 datasheet](https://www.microchip.com/en-us/product/ATTINY85)
* [ATtiny microcontroller support for the Arduino IDE](https://github.com/damellis/attiny)
* [Programming an ATtiny w/ Arduino 1.6 (or 1.0)](http://highlowtech.org/?p=1695)
* [Programming an ATtiny with Arduino ISP](http://scuola.arduino.cc/lesson/qX1117g/Programming_an_ATtiny_with_Arduino_ISP)
* [engbedded fusecalc](http://www.engbedded.com/fusecalc)
* [Tiny AVR Programmer Hookup Guide](https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/attiny85-use-hints)

repository: tardate/LittleArduinoProjects

repo_name: tardate/LittleArduinoProjects


text:
---
layout: post
title:      "A Closer Look At Debugging"
date:       2020-09-06 00:44:04 +0000
permalink:  a_closer_look_at_debugging
---

The content of this blog post is [here](https://medium.com/@jackrrye/everyone-has-their-own-method-of-debugging-though-youll-find-there-s-great-overlap-cf86b1952a0f).

Everyone has their own method of debugging, though you’ll find there’s great overlap. Approaching any big project, debugging is most of what you do. Encountering problems in your code or encountering broken code is just part of being a developer.

When I debug I start by searching for the relevant file. You always start by looking at the lines of code the error is coming from. Syntax errors are always the easiest to fix.

The line throwing the error isn’t always the source, though. Sometimes a person has to dig deeper. One example would be a `Uncaught TypeError: Cannot read property ‘map’ of undefined` error. The reason for this error is usually improperly passed data. Finding where the data gets lost goes something like this:

I would start in the file throwing the error. Then, I would use debugger and console.log() to find what value the data has in that file and what it looks like when I pass it around.

If the data is undefined or empty everywhere in the file throwing the error, I go backwards to where the data is being passed from. In my Random Character Generator (RCG) project, this often led me to the ApiCalls.js file where I had all my fetch calls. I keep following the trail of where I passed my data until I find the file where the data is as I want it to be. Then, I know the error is somewhere between that file where it’s the correct type and has all the attributes I need, and the previous file where it isn’t.

The process to debugging data that is incorrectly defined is similar. I work my way backward until I find where the data is the correct type and has all the attributes I need.

Once I find where the passing of data messes up, I analyze.

Maybe I forgot to initialize the variable properly in my reducer. Maybe the way that I’m trying to retrieve the data from the API is inconsistent with how the backend is structured. Maybe I forgot to add the connect function or forgot to pass props to a child component. (All things that I did, in fact, do at one point during my RCG project.)
I was throwing an `Unhandled Rejection (TypeError): Cannot read property 'background_title' of undefined` error at one point in my RCG project. The line it pointed me to read:

`<ListGroup.Item><h5>Background: {props.backgroundInfo.background_title}</h5></ListGroup.Item>`

When I used console.log() to see what my props looked like, I found that {backgroundInfo: undefined. I looked to see where the data was being passed from. My background component was getting props from my CharacterPage.js I was passing d.background as my props in my CharacterPage file. I console logged that and found that d.background was undefined. I console logged my variable d next. That gave me:

[image]

Alas! No background! When I hit this I was thoroughly confounded. Why did I have a full set of data but was missing one piece? That made less sense than having not acquired any data at all. After maybe an hour of bang my head against my wall, I remembered one of the golden rules of code:

**Never sit down and code for too long in one sitting.**

Remember to take a break! Grab a snack, drink some water, etc. So, I took a break. I texted some friends and made lunch. When I got back, it took me five minutes to realize what was wrong.

Was my problem fixed? Unfortunately, not yet! My API looked good, but my console.log(props.backgroundInfo) in my Background.js file still turned up undefined. I backtracked to my CharcterPage.js file where I passed d.background as props to Background.js. I found that when I console.log-ed d.background it came up as an empty object. Why would this be?

The next question is where does d (or this.props.character) get defined?

It comes from the Redux state and is defined in my reducer. I first looked at my GET_CHARACTER case. There, I saw that my character object was populated and had all the attributes I needed. It was another head-scratcher, and, I have to admit, I once again made the mistake of being in the coding zone too long. I spent a good while agonizing over what was causing my error. Another break and another snack later I realized that it was coming from where I was initializing my object. My line initializing my reducer looked like this:

`export default function reducer(state= { players: [], character: {}, player: {characters:[]} }, action) {`

I needed to initialize background! I was trying to access the background attribute of character when a background attribute wasn’t there yet (because the fetch call hadn’t been run yet). I changed my code to:
`export default function reducer(state= { players: [], character: { background: {} }, player: {characters:[]} }, action) {`

and my code was finally working!

Often there is more than one thing causing an error. Maybe you fix one error but your code still isn’t working. Don’t be discouraged! This is a normal part of the coding process. Just take things one error at a time, and keep going (whilst taking breaks when appropriate)!

extension: markdown


text:
#Exploring Agriculture and Education in Sub Saharan Africa

Agriculture has become an industry heavily reliant on science and technology.  This data visualization tool explores the relationship between education and agriculture in Sub Saharan Africa by comparing agriculture value added per worker (a measure of agriculture productivity) with three educational measures: expected years of school, mean years of school, and the difference between expected and mean years of school.

##Variables

Expected Years of Schooling:  The number years of schooling that a child of school entrance age can expect to receive if prevailing patterns of age-specific enrolment rates persist throughout life.
Mean Years of Schooling:  Average number of years of education received by people ages 25 and older, converted from educational attainment levels using official durations of each level.
Difference between Expected and Mean Years of Schooling:  Substraction of mean years from expected years of schooling
Agriculture Value Added per Worker:  A measure of agricultural productivity. Value added in agriculture measures the output of the agriculture sector less the value of intermediate inputs.
Gross National Income per Capita:  The dollar value of a country's final income in a year, divided by its population.

##References
Publications and datasets researched for this data visualization tool include the following:

"Databank:  The World Bank." edited by The World Bank, 2017.

"A Green Evolution." The Economist, March 12 2016.

"Human Development Data." edited by United Nations Development Programme, 2017.

Income Inequality Trends in Sub-Saharan Africa:  Divergence, Determinants, and Consequences. United Nations Development Programme, 2017.
Waha, Katharina, Birgit Zipf, Pradeep Kurukulasuriya, and Rashid M. Hassan. "An Agricultural Survey for More Than 9,500 African Households." Scientific Data 3 (05/24/online 2016): 160020.

gha_language: HTML


text:
# witt-geometry

THREE.js geometry for the [Wittgenstein project](http://burningman.org/event/brc/2016-art-installations/#WittgensteinDaVinciRachmaninoffARecursiveWoodenDesign)

### Install & Usage

1. `package.json` dependency: `"three-hexagon": "git@github.com:Ibuprofen/three-hexagon.git"` or (not likely in npm) `npm install --save witt-geometry`
1. `import WittgensteinGeometry from 'witt-geometry'`
1. `let witt = new WittgensteinGeometry(<radius>, <depth>, <fanDistance>, <hexFaces>)`

### Development

1. Clone repo.
1. `npm install`
1. `npm run watch`

In another project:

1. Point to this repo in `package.json`, either with `npm link` or using the full path.
1. `npm install witt-geometry`

repository: Ibuprofen/witt-geometry

repo_name: Ibuprofen/witt-geometry


text:
% DOCKER(1) Docker User Manuals
% Docker Community
% JUNE 2014
# NAME
docker-kill - Kill a running container using SIGKILL or a specified signal

# SYNOPSIS
**docker kill**
[**--help**]
[**-s**|**--signal**[=*"KILL"*]]
CONTAINER [CONTAINER...]

# DESCRIPTION

The main process inside each container specified will be sent SIGKILL,
 or any signal specified with option --signal.

# OPTIONS
**--help**
  Print usage statement

**-s**, **--signal**="KILL"
   Signal to send to the container

# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
 based on docker.com source material and internal work.
June 2014, updated by Sven Dowideit<EMAIL_ADDRESS>

gha_language: Go


text:
Django SQL Explorer
==================

Django SQL Explorer is inspired by Stack Exchange's [Data Explorer](http://data.stackexchange.com/stackoverflow/queries) and is designed to make the flow of data between people in your company fast, simple, and confusion-free. Quickly write and share SQL queries in a clean, usable query builder, preview the results in the browser, share links to download CSV files, and keep the information flowing baby!

django-sql-explorer is MIT licensed, and pull requests are welcome!

### A view of a query
![](http://www.untrod.com/django-sql-explorer/query1.jpg)

### Viewing all queries
![](http://www.untrod.com/django-sql-explorer/query2.5.jpg)

### Queries can accept parameters. Neato!
![](http://www.untrod.com/django-sql-explorer/query3.5.jpg)

### Quick access to DB schema info
![](http://www.untrod.com/django-sql-explorer/query4.jpg)

Features
========

- **Safety & Security**
    - Let's not kid ourselves - this tool is all about giving people access to running SQL in production. So if that makes you nervous (and it should) - you've been warned. Explorer makes an effort to not allow terrible things to happen, but be careful! Note there is a setting in the tip (master) to use a different SQL connection than the default django connection. It's recommended you use a read-only database role.
    - Admins-only. Nice try randos! You have to pass the is_staff() test to access explorer.
    - No destructive queries. Enforces a SQL blacklist so destructive queries don't get executed (delete, drop, update etc). This is not bulletproof and it's recommended that you instead configure a read-only database role, but when not possible the blacklist provides reasonable protection.
- **Easy to get started**
    - 100% built on Django's ORM, so works with Postgresql, Mysql, and Sqlite.
    - Zero dependencies other than Django and front-end libraries. More detail below.
    - Just want to get in and write some ad-hoc queries? Go nuts with the Playground area.
- **Looks Reasonably Not Crappy**
    - Thanks to CodeMirror and Bootstrap you might actually enjoy this for querying more than pgadmin or phpmyadmin
- **Parameterized Queries**
    - Use $$foo$$ in your queries and Explorer will build a UI to fill out parameters. When viewing a query like 'SELECT * FROM table WHERE id=$$id$$', Explorer will generate UI for the 'id' parameter.
    - Parameters are stashed in the URL, so you can share links to parameterized queries with colleagues
- **Schema Helper**
    - /explorer/schema/ renders a list of your Django apps' table and column names that you can refer to while writing queries. Apps are excludable from this list so users aren't bogged down in tons of irrelevant tables.
    - Note there is an open issue that the schema explorer does not show join tables for m2m relations. It's a work in progres...
- **Django Admin Support**
    - Download multiple queries at once as a zip file through Django's admin interface via a built-in admin action.
- **Meaningful Test Coverage**
    - You can even run them yourself! Just install factory_boy and run "manage.py test"

Install
=======

Requires Python 2.7. No Python 3 support yet.

This has been tested only with Django 1.6, however it should work back to 1.4. Please report an issue if you encounter problems on earlier versions of Django.

Install with pip from github:

    pip install django-sql-explorer

Add to your installed_apps:

    INSTALLED_APPS = (
      ...
      'explorer',
      ...
    )

Add the following to your urls.py (all Explorer URLs are restricted to staff only):

    url(r'^explorer/', include('explorer.urls')),

Run syncdb to create the tables (well...just one table really):

    python manage.py syncdb

Browse to https://yoursite/explorer/ and get exploring!

Dependencies
============

An effort has been made to require no packages other than Django. However a number of front-end dependencies do exist and are documented below. All front-end dependencies are served from CDNJS.com

Name | Version | License
--- | --- | ---
[Twitter Boostrap](http://getbootstrap.com/) | 3.0.3 | MIT
[jQuery](http://jquery.com/) | 2.0.3 | MIT
[Underscore](http://underscorejs.org/) | 1.5.2 | MIT
[Codemirror](http://codemirror.net/) | 3.19.0 | MIT
[floatThead](http://mkoryak.github.io/floatThead/)* | 1.2.0 | Creative Commons

_*Served locally because this is not available on cdnjs_

Factory Boy is needed if you'd like to run the tests, which can you do easily:

    python manage.py test

Settings
========

Setting | Description | Default
--------|-------------|--------
EXPLORER_SQL_BLACKLIST | Disallowed words in SQL queries to prevent destructive actions. | ('ALTER', 'RENAME ', 'DROP', 'TRUNCATE', 'INSERT INTO', 'UPDATE', 'REPLACE', 'DELETE')
EXPLORER_SQL_WHITELIST | These phrases are allowed, even though part of the phrase appears in the blacklist. | ('DROP FUNCTION', 'REPLACE FUNCTION', 'DROP VIEW', 'REPLACE VIEW', 'CREATED', 'DELETED')
EXPLORER_DEFAULT_ROWS | The number of rows to show by default in the preview pane. | 100
EXPLORER_SCHEMA_EXCLUDE_APPS | Don't show schema for these apps in /schema/. This is helpful to clear out cruft that users realistically won't want to refer to for reference. | ('',)  # No apps are excluded

repository: velveteer/django-sql-explorer

repo_name: velveteer/django-sql-explorer


text:
> [Go to French version](/fr/Lois/Lois%20du%20Canada/2001/ch.%2023.md)

# Canada Foundation for Sustainable Development Technology Act

**S.C. 2001, c. 23**

Assented to on 14 June 2001

----------

Her Majesty, by and with the advice and consent of the Senate and House of Commons of Canada, enacts as follows:

## Short Title

**Short title**

**1** This Act may be cited as the Canada Foundation for Sustainable Development Technology Act.

## Interpretation

**Definitions**

**2** The definitions in this section apply in this Act.

***board*** means the board of directors of the Foundation. (*conseil*)

***Chairperson*** means the Chairperson of the board appointed under paragraph 9(2)(a). (*président*)

***corporation*** means the corporation described in the order made under subsection 35(1). (*société*)

***director*** means a person who is on the board and includes the Chairperson. (*administrateur*)

***eligible project*** means a project carried on, or to be carried on, primarily in Canada by an eligible recipient to develop and demonstrate new technologies to promote sustainable development, including technologies to address issues related to climate change and the quality of air, water and soil. (*travaux admissibles*)

***eligible recipient*** means an entity that
- **(a)** is established in Canada and carries on or, in the opinion of the board, is capable of carrying on eligible projects;
- **(b)** meets the criteria of eligibility established in any agreement entered into between Her Majesty in right of Canada and the Foundation for provision of funding by Her Majesty to the Foundation; and
- **(c)** has legal capacity or is composed of organizations, each of which has legal capacity. (*bénéficiaire admissible*)

***employee or agent of Her Majesty in right of a province*** does not include an employee or agent of Her Majesty in right of a province whose duties and functions in that capacity are restricted to work in a university, college or other educational institution. (*fonctionnaire ou mandataire de Sa Majesté du chef d’une province*)

***Foundation*** means the Canada Foundation for Sustainable Development Technology referred to in section 3. (*Fondation*)

***member*** means a person who is a member of the Foundation. (*membre*)

***Minister*** means the member of the Queen’s Privy Council for Canada who is designated by the Governor in Council as the Minister for the purposes of this Act. (*ministre*)

***not-for-profit organization*** means a corporation, society, association, university, research institute, organization or body no part of whose income is payable to or otherwise available for the personal benefit of any of its proprietors, members or shareholders. (*organisation sans but lucratif*)

***special resolution*** means a resolution of the members passed by a majority of not less than two thirds of the votes cast by the members who voted on the resolution at a meeting of members or signed by all the members entitled to vote on the resolution. (*résolution extraordinaire*)

***sustainable development*** means development that meets the needs of the present without compromising the ability of future generations to meet their own needs. (*développement durable*)
> 2001, c. 23, ss. 2, 36; 2004, c. 22, s. 12.

## Continuation of the Corporation

**Continuation**

**3**

- **(1)** The corporation is continued as a corporation without share capital, to be called the Canada Foundation for Sustainable Development Technology, consisting of the Foundation’s members and directors.

**Powers, duties and functions**

- **(2)** If under any Act of Parliament, any instrument made under an Act of Parliament or any contract, licence or other document, a power, duty or function is vested in or exercisable by the corporation, the power, duty or function is vested in or exercisable by the Foundation.

**References**

- **(3)** Every reference to the corporation in any deed, contract, agreement or other document executed by the corporation shall, unless the context otherwise requires, be read as a reference to the Foundation.

**Rights and obligations**

- **(4)** All rights and property of the corporation and all obligations of the corporation are transferred to the Foundation.

**Commencement of legal proceedings**

- **(5)** Any action, suit or other legal proceeding in respect of an obligation or liability incurred by the corporation may be brought against the Foundation in any court that would have had jurisdiction if the action, suit or other legal proceeding had been brought against the corporation.

**Continuation of legal proceedings**

- **(6)** Any action, suit or other legal proceeding to which the corporation is party pending in any court immediately before the day on which this section comes into force may be continued by or against the Foundation in like manner and to the same extent as it could have been continued by or against the corporation.

**By-laws**

- **(7)** Every by-law of the corporation is, to the extent that it is not inconsistent with this Act, a by-law of the Foundation.

**Officers and employees**

- **(8)** Nothing in this Act affects the status of any person who, immediately before the day on which this section comes into force, was an officer or employee of the corporation except that, as of that day, the person is an officer or employee, as the case may be, of the Foundation.
> 2001, c. 23, ss. 3, 37.

**Foundation not agent of Her Majesty**

**4** The Foundation is not an agent of Her Majesty.

**Objects and purposes of Foundation**

**5** The objects and purposes of the Foundation are to provide funding to eligible recipients for eligible projects.

**Capacity**

**6** For the purposes of carrying out its objects and purposes, the Foundation has the capacity and, subject to this Act, the rights, powers and privileges of a natural person.

**Head office**

**7** The head office of the Foundation shall be in a place in Canada designated by the Governor in Council.

**[Canada Business Corporations Act](/en/Acts/Revised%20Statutes%20of%20Canada/C/C-44.md)**

**8**

- **(1)** The following provisions of the [Canada Business Corporations Act](/en/Acts/Revised%20Statutes%20of%20Canada/C/C-44.md) apply, with any modifications that the circumstances require, to the Foundation and its directors, members, officers and employees as if the Foundation were a corporation incorporated under that Act, this Act were its articles of incorporation and its members were its shareholders:
	- **(a)** section 16 (by-law not required to confer powers on Foundation, restriction on powers of Foundation and validity of acts of Foundation);
	- **(b)** subsection 21(1) (access to Foundation’s records by members and creditors);
	- **(c)** section 23 (corporate seal not needed to validate instrument);
	- **(d)** subsections 103(1) to (4) (powers of directors to make and amend by-laws, members’ approval of by-laws and effective date of by-laws);
	- **(e)** subsection 105(1) (qualifications of directors);
	- **(f)** subsection 108(2) (resignation of director);
	- **(g)** section 110 (right of director to attend members’ meetings and statements by retiring directors);
	- **(h)** subsections 114(1) and (2) (place of directors’ meetings and quorum);
	- **(i)** section 116 (validity of acts of directors and officers);
	- **(j)** section 117 (validity of directors’ resolutions not passed at meeting);
	- **(k)** section 120 (conflict of interest of directors);
	- **(l)** subsection 122(1) (duty of care of directors and officers);
	- **(m)** section 123 (directors’ dissents);
	- **(n)** subsections 124(1) to (4) (indemnification of directors and insurance for directors’ liability);
	- **(o)** paragraph 133(b) (special meetings of members);
	- **(p)** section 155 (financial statements);
	- **(q)** section 158 (approval of financial statements by directors);
	- **(r)** section 159 (sending financial statements to members before annual meeting and penalty for failure);
	- **(s)** section 161 (qualifications of auditor);
	- **(t)** section 168 (rights and duties of auditor);
	- **(u)** section 169 (examination by auditor);
	- **(v)** section 170 (right of auditor to information);
	- **(w)** subsections 171(3) to (9) (duty and administration of audit committee and penalty for failure to comply);
	- **(x)** section 172 (qualified privilege in defamation for auditor’s statements); and
	- **(y)** subsections 257(1) and (2) (certificates of Foundation as evidence).

**Description with cross-references**

- **(2)** The descriptive words in parentheses that follow a reference to a provision of the [Canada Business Corporations Act](/en/Acts/Revised%20Statutes%20of%20Canada/C/C-44.md) in subsection (1) form no part of that subsection but are inserted for convenience of reference only.

**[Canada Not-for-profit Corporations Act](/en/Acts/Statutes%20of%20Canada/2009/c.%2023.md)**

- **(3)** The [Canada Not-for-profit Corporations Act](/en/Acts/Statutes%20of%20Canada/2009/c.%2023.md) does not apply to the Foundation.
> 2001, c. 23, s. 8; 2009, c. 23, ss. 315, 349.

## Directors

**Continuation of board of directors of corporation**

**9**

- **(1)** The board of directors of the corporation ceases to exist and there shall be a board of directors of the Foundation that shall supervise the management of the business and affairs of the Foundation and, subject to the by-laws of the Foundation, exercise all its powers.

**Appointment of directors**

- **(2)** Subject to subsection (4), the board consists of
	- **(a)** the Chairperson of the board appointed by the Governor in Council on the Minister’s recommendation;
	- **(b)** six persons appointed by the Governor in Council on the Minister’s recommendation; and
	- **(c)** eight persons appointed by the members in accordance with subsection 13(5) and the by-laws of the Foundation.

**Eligibility for directors**

- **(3)** A person is not eligible to be appointed as a director if the person
	- **(a)** is a member of the Senate, the House of Commons or the legislature of a province;
	- **(b)** is an employee or agent of Her Majesty in right of Canada or in right of a province;
	- **(c)** does not ordinarily reside in Canada; or
	- **(d)** is disqualified under subsection 105(1) of the [Canada Business Corporations Act](/en/Acts/Revised%20Statutes%20of%20Canada/C/C-44.md).

**Initial organization**

- **(4)** If the Chairperson is appointed before directors have been appointed under paragraph (2)(c), the Chairperson and any other directors that may have been appointed under paragraph (2)(b) constitute the board until directors are appointed under paragraph (2)(c) and may
	- **(a)** undertake the organization of the Foundation including the appointment of officers and employees;
	- **(b)** make banking arrangements for the Foundation;
	- **(c)** enact organizational by-laws for the Foundation; and
	- **(d)** receive on behalf of the Foundation any moneys paid to the Foundation.

**Limitation**

- **(5)** Until directors are appointed under paragraph (2)(c), the Foundation shall not provide any funding from the funds of the Foundation or enter into any agreements or arrangements, or review any applications, for or in respect of funding to be provided from the funds of the Foundation.

**Foundation not owned by Crown**

- **(6)** The operation of the Foundation under subsection (4) by the Chairperson and any directors appointed under paragraph (2)(b) shall not, despite subsection 83(2) of the [Financial Administration Act](/en/Acts/Revised%20Statutes%20of%20Canada/F/F-11.md), result in the Foundation being considered, for the purposes of Part X of that Act or for any other purpose, to be wholly owned directly by Her Majesty in right of Canada.
> 2001, c. 23, ss. 9, 38; 2016, c. 7, s. 237.

**Terms of office of directors**

**10**

- **(1)** Subject to subsections (2) and (3), the Chairperson and the directors shall be appointed to hold office during good behaviour for terms not exceeding five years.

**Removal from office**

- **(2)** The Chairperson and any director appointed under paragraph 9(2)(b) may be removed for cause by the Governor in Council. Any director appointed under paragraph 9(2)(c) may be removed for cause by a special resolution.

**Continuation in office**

- **(3)** Except where they cease to be directors under subsection (6), directors shall continue to hold office until their successors are appointed.

**Additional terms of office**

- **(4)** A director is eligible to be reappointed for one or more terms not exceeding five years each.

**Term of replacements**

- **(5)** A person appointed to fill a vacancy in the office of a director who has ceased to hold office before the expiry of the director’s term of office shall be appointed to hold office for the unexpired portion of that term.

**Ceasing to be director**

- **(6)** A director ceases to be a director when the director
	- **(a)** dies;
	- **(b)** resigns;
	- **(c)** is appointed to the Senate;
	- **(d)** is elected to the House of Commons or to the legislature of a province;
	- **(e)** becomes an employee or agent of Her Majesty in right of Canada or in right of a province;
	- **(f)** ceases to be ordinarily resident in Canada;
	- **(g)** becomes disqualified under subsection 105(1) of the [Canada Business Corporations Act](/en/Acts/Revised%20Statutes%20of%20Canada/C/C-44.md); or
	- **(h)** is removed from office under subsection (2).

**Director representation and experience**

**11** The appointment of directors shall be made having regard to the following considerations:
- **(a)** the need to ensure, as far as possible, that at all times the board will be representative of
	- **(i)** persons engaged in the development and demonstration of technologies to promote sustainable development, including technologies to address issues related to climate change and the quality of air, water and soil,
	- **(ii)** the business community, and
	- **(iii)** not-for-profit organizations;
- **(b)** the importance of having a board that is representative of various regions of Canada and includes men and women who are able to contribute to the achievement of the objects and purposes of the Foundation; and
- **(c)** the need for a board that has sufficient knowledge of technologies that promote sustainable development.
> 2001, c. 23, s. 11; 2004, c. 22, s. 13.

**Remuneration and expenses for directors**

**12**

- **(1)** From the funds of the Foundation, the directors
	- **(a)** may be paid remuneration that is fixed by the Foundation’s by-laws; and
	- **(b)** are entitled to be paid reasonable travel and living expenses incurred by them in the performance of their duties under this Act while absent from their ordinary place of residence.

**Directors not to profit**

- **(2)** Except as provided under subsection (1), no director shall profit or gain any income or acquire any property from the Foundation or its activities.

## Members

**Members of the corporation**

**13**

- **(1)** The persons who are members of the corporation cease to be members of the corporation.

**Appointing of members**

- **(1.1)** There shall be 15 members of the Foundation.

**First members**

- **(2)** The Governor in Council shall without delay appoint seven persons as members of the Foundation, on the recommendation of the Minister, as proposed by the Minister of Natural Resources and the Minister of the Environment, after consultation with the Minister of Industry.

**First meeting**

- **(3)** As soon as possible after the appointment of the seven members under subsection (2), the Minister shall make arrangements for a first meeting of those members.

**Appointing balance of first members**

- **(4)** At the first meeting of the seven members appointed under subsection (2), or at a meeting held as soon after that meeting as possible, those members shall appoint eight further members of the Foundation.

**Appointment of first directors under paragraph 9(2)(c)**

- **(5)** The members shall appoint the first directors under paragraph 9(2)(c) at a meeting held as soon as possible after the eight further members are appointed under subsection (4).

**Appointment of successor members**

- **(6)** The appointment of a person as a member to succeed a person whose term as a member expires shall be made by the members at a meeting of members.

**Filling vacancies**

- **(7)** The appointment of a person as a member to fill a vacancy in the membership caused by a person ceasing to be a member before the member’s term as a member expires shall be made by the members at a meeting of members.

**Eligibility for members**

- **(8)** A person is not eligible to be appointed as a member if the person
	- **(a)** is a member of the Senate, the House of Commons or the legislature of a province;
	- **(b)** is an employee or agent of Her Majesty in right of Canada or in right of a province;
	- **(c)** is a director;
	- **(d)** does not ordinarily reside in Canada; or
	- **(e)** is disqualified under subsection 105(1) of the [Canada Business Corporations Act](/en/Acts/Revised%20Statutes%20of%20Canada/C/C-44.md).
> 2001, c. 23, ss. 13, 39.

**Terms of members**

**14**

- **(1)** Subject to subsections (2) and (3), members shall be appointed to hold office during good behaviour for terms not exceeding five years.

**Removal from office**

- **(2)** Any member appointed under subsection 13(2) may be removed for cause by the Governor in Council. Any member appointed under subsection 13(4), (6) or (7) may be removed for cause by a special resolution.

**Continuation in office**

- **(3)** Except where they cease to be members under subsection (6), members shall continue to hold office until their successors are appointed.

**Additional terms of office**

- **(4)** A member is eligible to be reappointed for one or more terms not exceeding five years each.

**Term of Replacements**

- **(5)** A person appointed to fill a vacancy in the office of a member who has ceased to hold the office before the expiry of the member’s term of office shall be appointed to hold office for the unexpired portion of that term.

**Ceasing to be member**

- **(6)** A member ceases to be a member when the member
	- **(a)** dies;
	- **(b)** resigns;
	- **(c)** is appointed to the Senate;
	- **(d)** is elected to the House of Commons or to the legislature of a province;
	- **(e)** is appointed as a director;
	- **(f)** becomes an employee or agent of Her Majesty in right of Canada or in right of a province;
	- **(g)** ceases to be ordinarily resident in Canada;
	- **(h)** becomes disqualified under subsection 105(1) of the [Canada Business Corporations Act](/en/Acts/Revised%20Statutes%20of%20Canada/C/C-44.md); or
	- **(i)** is removed from office under subsection (2).

**Member representation and experience**

**15** The appointment of members shall be made having regard to the following considerations:
- **(a)** the need to ensure, as far as possible, that at all times the membership will be representative of
	- **(i)** persons engaged in the development and demonstration of technologies to promote sustainable development, including technologies to address issues related to climate change and the quality of air, water and soil,
	- **(ii)** the business community, and
	- **(iii)** not-for-profit organizations;
- **(b)** the importance of having membership that is representative of various regions of Canada and includes men and women who are able to contribute to the achievement of the objects and purposes of the Foundation; and
- **(c)** the need for a membership that has sufficient knowledge of technologies that promote sustainable development.
> 2001, c. 23, s. 15; 2004, c. 22, s. 14.

**Expenses for members**

**16**

- **(1)** Members shall serve without remuneration but are entitled to be paid from the funds of the Foundation reasonable travel and living expenses incurred by them in the performance of their duties under this Act while absent from their ordinary place of residence.

**Members not to profit**

- **(2)** Except as provided under subsection (1), no member shall profit or gain any income or acquire any property from the Foundation or its activities.

## Staff

**Staff**

**17**

- **(1)** The board may appoint any officers, employees and agents of the Foundation that it considers necessary to carry out the objects and purposes of the Foundation.

**Designation of offices**

- **(2)** Subject to the by-laws of the Foundation, the board may designate the offices of the Foundation and specify the duties and functions of each office.

**Directors and members not employees or agents**

- **(3)** Directors and members are not eligible to be employees or agents of the Foundation.

**Not part of public service of Canada**

- **(4)** The directors, members, officers, employees and agents of the Foundation are not, because of being directors, members, officers, employees or agents of the Foundation, part of the federal public administration.
> 2001, c. 23, s. 17; 2003, c. 22, s. 224(E).

## Operations

**Administrative expenses**

**18** From its funds, the Foundation may pay salaries and wages of its officers and employees, rent for its accommodation, remuneration for its directors and agents, reimbursement to the directors and members for reasonable travel and living expenses incurred by them in the performance of their duties under this Act while absent from their ordinary place of residence, and other costs and expenses of carrying on the business of the Foundation.

**Funding for eligible projects**

**19**

- **(1)** From its funds, the Foundation may provide funding to eligible recipients to be used by them solely for the purposes of eligible projects in accordance with any terms and conditions specified by the Foundation in respect of the funding, including terms and conditions as to repayment of the funding, intellectual property rights and the maximum amount and proportion of funding for eligible projects to be provided by the Foundation.

**Agreement with eligible recipient**

- **(2)** The Foundation shall enter into an agreement with an eligible recipient respecting, among other things,
	- **(a)** the manner in which the Foundation will make advances in respect of funding to the eligible recipient and when those advances will be made;
	- **(b)** any terms or conditions on which the funding will be provided, including those terms and conditions referred to in subsection (1);
	- **(c)** the evaluation of the eligible recipient’s performance in achieving the objectives of the eligible project and the evaluation of the results of the project, including the potential performance of the technology that is developed and demonstrated by the project; and
	- **(d)** if the eligible recipient is composed of organizations, each of which has legal capacity, the requirement for those organizations to be jointly and severally or solidarily liable for the obligations of that eligible recipient.

**Foundation not to acquire an interest**

- **(3)** In providing funding to an eligible recipient in respect of an eligible project, the Foundation shall not acquire any interest, whether through the acquisition of share capital, a partnership interest or otherwise, in any research infrastructure acquired by the eligible recipient for the project.

**Donations to Foundation**

**20**

- **(1)** Subject to subsection (3), the Foundation may accept conditional or unconditional donations of money.

**Use of donations**

- **(2)** All money donated to the Foundation, and any income arising from the investment of that money, shall be used by the Foundation in carrying out its objects and purposes in accordance with the terms and conditions of any agreement for provision of funding entered into between a donor and the Foundation.

**Conditional donations**

- **(3)** The Foundation shall not accept a donation of money that is made on the condition that the Foundation use the money or any income arising from the investment of the money for any purpose that is not within the objects and purposes of the Foundation.

**Exception**

- **(4)** Subsection (3) does not apply if the conditions of a donation of money merely restrict or direct the manner of investing the money until it can be used to provide funding to eligible recipients for eligible projects.

**Investment policies**

**21** The board shall establish investment policies, standards and procedures that a reasonably prudent person would apply in respect of a portfolio of investments to avoid undue risk of loss and obtain a reasonable return, having regard to the Foundation’s obligations and anticipated obligations.

**Investments**

**22**

- **(1)** Subject to any conditions of a donation restricting the investment of money donated until it can be used to provide funding to eligible recipients for eligible projects, the Foundation shall invest its funds, and reinvest any income from those funds, in accordance with the investment policies, standards and procedures established by the board.

**Incorporation of other corporations**

- **(2)** The Foundation shall not cause any corporation to be incorporated or participate in the incorporation of a corporation or become a partner in a partnership.

**Control of corporation**

- **(3)** Except for the investment of its funds, the Foundation shall not carry on any business for gain or profit and shall not hold or acquire any interest in any corporation or enterprise.

**Borrowing prohibited**

**23**

- **(1)** The Foundation shall not borrow money, issue any debt obligations or securities, give any guarantees to secure a debt or other obligation of another person or mortgage, pledge or otherwise encumber property of the Foundation.

**Real property or immovables**

- **(2)** The Foundation shall not purchase or accept a donation of real property or immovables.

**Delegation by board**

**24**

- **(1)** Subject to subsection (2), the board may delegate to the Chairperson, a committee of directors or an officer of the Foundation any of the powers or rights of the board.

**Restrictions on delegation**

- **(2)** The board shall not delegate any power or right of the board
	- **(a)** to enact, amend or repeal by-laws;
	- **(b)** to authorize the provision of funding to eligible recipients for eligible projects;
	- **(c)** to appoint directors to, or fill vacancies on, a committee of the board;
	- **(d)** to appoint officers of the Foundation or fix their remuneration;
	- **(e)** to accept donations;
	- **(f)** to approve the annual financial statements or reports of the Foundation; or
	- **(g)** to submit to the members any matter requiring the approval of the members.

## Financial Matters and Audit

**Operating and capital budgets**

**25**

- **(1)** The board shall cause an operating budget and a capital budget to be prepared for each fiscal year of the Foundation and shall submit those budgets to the members for consideration at the annual meeting of members.

**Books of account**

- **(2)** The board shall cause books of account and other records to be kept and shall establish financial and management controls, information systems and management practices that will ensure that the business and affairs of the Foundation are carried on, and the financial, human and physical resources of the Foundation are managed effectively, efficiently and economically.

**Information systems**

- **(3)** The books of account and other records of the Foundation shall be maintained in a way that will ensure that the assets of the Foundation are properly protected and controlled and that its business and affairs are carried on in compliance with this Act and, in particular, in such a way that they will show
	- **(a)** descriptions and book values of all investments of the Foundation; and
	- **(b)** the eligible recipients who have received, or are about to receive, funding from the Foundation in respect of eligible projects, the nature and extent of the projects and the amount of the funding.

**Auditor**

**26**

- **(1)** At the first meeting of the members, and in any subsequent fiscal year at the annual meeting, the members shall appoint an auditor for the Foundation for the fiscal year and fix, or authorize the board to fix, the auditor’s remuneration.

**Qualifications of auditor**

- **(2)** The auditor shall be
	- **(a)** a natural person who
		- **(i)** is a member in good standing of an institute or association of accountants incorporated by or under an Act of the legislature of a province,
		- **(ii)** has at least five years experience at a senior level in carrying out audits,
		- **(iii)** is ordinarily resident in Canada, and
		- **(iv)** is independent of the board, the directors, the members and the officers of the Foundation; or
	- **(b)** a firm of accountants of which the member or employee jointly designated by the board and the firm to conduct the audit of the books and records of the Foundation on behalf of the firm meets the qualifications set out in paragraph (a).

**Continuation of auditor**

- **(3)** If an auditor is not appointed at the annual general meeting in any fiscal year, the auditor for the preceding fiscal year continues in office until a successor is appointed.

**Removal of auditor**

- **(4)** The members may by a special resolution remove an auditor from office.

**Ceasing to hold office**

- **(5)** An auditor ceases to hold office when the auditor
	- **(a)** dies;
	- **(b)** resigns;
	- **(c)** is removed from office under subsection (4); or
	- **(d)** no longer meets the requirements under subsection (2).

**Replacement**

- **(6)** The members may, at a meeting of the members, appoint an auditor to fill any vacancy in the office of the auditor but, if the members fail to fill the vacancy at that meeting or if no meeting of the members is convened without delay after the vacancy occurs, the board may appoint an auditor.

**Unexpired term**

- **(7)** An auditor appointed to fill a vacancy in the office holds office for the unexpired term of the predecessor in the office.

**Auditor’s report**

**27** The auditor shall, within four months after the end of each fiscal year, complete the audit of the books and records of the Foundation for the fiscal year and submit a report of the audit to the members.

**Audit committee**

**28**

- **(1)** The board shall appoint an audit committee consisting of not fewer than three directors and fix the duties and functions of the committee.

**Internal audit**

- **(2)** In addition to any other duties and functions that it is required to perform, the audit committee shall cause internal audits to be conducted to ensure compliance by the officers and employees of the Foundation with management and information systems and controls established by the board.

## Annual Meeting

**Annual meeting**

**29** The board shall call an annual meeting of members not later than six months after the end of each fiscal year of the Foundation for the purpose of
- **(a)** examining the audited financial statements and the report of the auditor on those statements for the preceding fiscal year;
- **(b)** examining the annual report of the Foundation for the preceding fiscal year;
- **(c)** examining the operating budget and the capital budget submitted by the board under subsection 25(1);
- **(d)** considering and confirming, rejecting or amending by-laws made by the board or amendments to or the repeal of by-laws made by the board;
- **(e)** appointing an auditor under subsection 26(1); and
- **(f)** considering any other matter respecting the operations of the Foundation.

## Annual Report

**Annual report**

**30**

- **(1)** The Foundation shall, within five months after the end of each fiscal year, prepare an annual report in both official languages of its activities during the preceding fiscal year and include in the report
	- **(a)** its financial statements for the year as approved by the board and the report of the auditor respecting those statements;
	- **(b)** a detailed statement of its investment activities during the year, its investment portfolio as at the end of the year and its investment policies, standards and procedures;
	- **(c)** a detailed statement of its funding activities;
	- **(d)** a statement of its plans for fulfilling its objects and purposes for the next year; and
	- **(e)** an evaluation of the overall results achieved by the funding of eligible projects by the Foundation during the year in review, and since the inception of the Foundation.

**Consideration of report**

- **(2)** Before the annual report of the Foundation for a fiscal year is distributed to the public it shall be approved by the board and examined by the members at a meeting of the members.

**Distribution of report**

- **(3)** After the annual report of the Foundation for a fiscal year is approved as required under subsection (2), the report shall be made public in accordance with the by-laws of the Foundation and a copy shall be sent to the Minister who shall cause a copy of the report to be laid before each House of Parliament on any of the first 15 days on which that House is sitting after the Minister receives it.

**Public meeting**

**31**

- **(1)** After it publishes its annual report for a fiscal year, the Foundation shall convene a public meeting at a city in Canada selected by the board to consider the report and other matters relating to the activities of the Foundation during the year.

**Notice of meeting**

- **(2)** At least 30 days before the date of a meeting convened under subsection (1) to consider the Foundation’s annual report for a fiscal year, the Foundation shall give notice of the time and place of the meeting in accordance with the by-laws of the Foundation.

## Winding-up

**Property to be divided**

**32**

- **(1)** If the Foundation is wound up or dissolved, its property remaining after its debts and obligations have been satisfied shall be liquidated and the moneys arising from the liquidation shall be distributed among all the eligible recipients that have received funding from the Foundation and that are, as of the day the distribution begins, still carrying on projects to develop and demonstrate new technologies to promote sustainable development, to be used by them for the purpose of those projects. Each of those eligible recipients shall receive an amount that is the same proportion of the moneys arising from the liquidation as the total funding received by that eligible recipient from the Foundation is of the total of all funding that has been provided by the Foundation to all of those eligible recipients.

**Repayment out of remaining property**

- **(2)** Despite subsection (1), the Minister may require the Foundation to repay out of the moneys arising from the liquidation to the Receiver General for credit to the Consolidated Revenue Fund any amount that is so repayable under the terms or conditions on which public moneys were provided to the Foundation.
> 2001, c. 23, s. 32; 2003, c. 15, s. 33.

## General

**[Official Languages Act](/en/Acts/Statutes%20of%20Canada/1985/c.%2031%20(4th%20Supp.).md) applies**

**33** The [Official Languages Act](/en/Acts/Statutes%20of%20Canada/1985/c.%2031%20(4th%20Supp.).md) applies to the Foundation as if it were a federal institution.

**Mandatory by-laws**

**34** The Foundation shall include in its by-laws provisions
- **(a)** entitling an eligible recipient that has made an application for funding from the Foundation to request the board to make a ruling as to the possible conflict of interest of a director in the consideration or disposal of the application;
- **(b)** establishing procedures to be followed by the board in responding to the request and giving the ruling;
- **(c)** determining the fiscal year of the Foundation;
- **(d)** requiring the creation of advisory committees, including technical advisory committees, and their mandates; and
- **(e)** fixing the remuneration for directors.

## Designation and Amendments Consequential on It

**Designation by Governor in Council**

**35**

- **(1)** The Governor in Council may, by order, designate, for the purposes of this Act, any corporation incorporated under the [Canada Not-for-profit Corporations Act](/en/Acts/Statutes%20of%20Canada/2009/c.%2023.md).

**Sections 36 to 39 apply**

- **(2)** If an order is made under subsection (1), sections 36 to 39 apply as of the day on which that order is made.
> 2001, c. 23, s. 35; 2009, c. 23, ss. 316, 350.

**36 to 39** [Amendments]

## Coming into Force

**Coming into force**

<sup><a href='#C-5.5_en_1'>[*]</a></sup>**40** This Act comes into force on a day to be fixed by order of the Governor in Council.

<a name='C-5.5_en_1'><sup>*</sup></a>: [Note: Act in force March 22, 2002, *see* SI/2002-57.]<br />

repository: TravisMadill/CanadianLaws

path: /en/Acts/Statutes of Canada/2001/c. 23.md

repo_name: TravisMadill/CanadianLaws


text:
---
layout: inner
title: "manually triggering newrelic errors"
description: ""
category: ""
tags: ["ruby","rails","newrelic"]
---
I triggered an error manually from the console like this:
{% highlight ruby %}
irb(main):008:0> NewRelic::Agent.manual_start
=> [NewRelic::Agent::Samplers::CpuSampler, NewRelic::Agent::Samplers::MemorySampler, NewRelic::Agent::Samplers::ObjectSampler, NewRelic::Agent::
Samplers::DelayedJobSampler]
irb(main):009:0> NewRelic::Agent.notice_error(RuntimeError.new("no way"))
{% endhighlight %}

Of course when running in an environment where the agent is already started,
you'd have to call only notice_error.


text:
# Weatherstation
This is the official respoitory for the project "[Wetterstation](https://hackdash.org/projects/58022d9dd9284f016c047676)", created at the event "Jugend Hackt 2016" in Berlin.

repository: Syndesi/Weatherstation

repo_name: Syndesi/Weatherstation


text:
---
title: Sara Benincasa
summary: Comedian, author
date: 2016-11-03
categories:
- comedian
- mac
- writer
---

### Who are you, and what do you do?

My name is [Sara Benincasa](http://www.sarabenincasa.com/ "Sara's website."), and I'm an author and comedian. I've written five books and am meant to be working on a sixth at present. I've also written one pilot and am working on another. I recently completed the first draft of a feature adaptation of my third book, "DC Trip."

### What hardware do you use?

I bludgeon all who oppress me with a large wooden club I carved myself. The runes upon it summon angels and demons alike. I also have a [MacBook Pro][macbook-pro].

### And what software?

I use [Final Draft][final-draft] and [Microsoft Word][word] and [Safari][].

### What would be your dream setup?

I suppose I'd have access to nature quite easily right outside my door. I'd then ignore it at a comfortable desk with an ergonomic chair that was very comfortable.

[final-draft]: https://www.finaldraft.com/ "Popular screenwriting software."
[macbook-pro]: https://www.apple.com/macbook-pro/ "A laptop."
[safari]: https://www.apple.com/safari/ "A fast web browser."
[word]: https://www.microsoft.com/en-us/microsoft-365/word "A document editor."

repository: waferbaby/usesthis

repo_name: waferbaby/usesthis


text:
## Doing everything manually

Ok, so you have decided to do things manually...
Wise choice.

### Prerequisites

Ensure that NodeJS is installed.
You need it to use the integrated build and test tools.

**Note**: Please, use node version 0.10 for now.

Also, you will need git :)

### Starting new project

1. Clone the project to your working directory:

    ```
    git clone git@github.com:yetu/frontend-library-starter.git <library_name>
    cd <library_name>
    ```

1. Delete `.git` to cleanup the repository linkage and all unnecessary commits:

    ```
    rm -rf .git
    ```

1. Install all node and bower components:

    ```
    npm install
    ```

1. Initialize a new repository:

    ```
    git init
    ```

1. Before hacking, please, change the values marked by `__GLOBAL_NAME__` and `__LIB_NAME__` tokens inside these files:

    ```
    webpack.config.js
    package.json
    bower.json
    ```

   Other things are configurable for your taste.

### Testing things

We have included testing in `Chrome`, `Firefox`, `PhantomJS` and `Safari` by default.
You can turn some of those browsers off in `karma.conf.js`

To run a single test use:

```
npm test
```

To run a continuous tdd session use:

```
npm run tdd
```

This commands will run `karma` test runner with `jasmine` framework.
After the test run you will get **test coverage reports** inside the `/coverage` folder!

### Building dists

To build the AMD/CommonJS/UMD/SystemJS versions of your library for other people just run:

`npm run build-all`

Also, we have added some special magic to make sure you do not commit your code without adding built files :)

### Automated control

Are you afraid of committing "bad quality" code and ruining everything?
Afraid no more!

This project has a **git hooks integration**, which will run tests and check your javascript **before each commit**.

You are safeguarded against silly mistakes by `jshint` and `fixmyjs`!

You will not be able to commit the code with:

1. Failing tests
2. Bad javascript code style

**Node**: In case you very urgently need to overcome the protection and break everything, you can issue this command: `git commit --no-verify `

### Publishing the code

So, you have crafted some nitty-gritty goodness?

Now it's time to publish the thing!

1. Update the versions in `package.json` and `bower.json`, so that they match each other and adhere to [semver specification](http://semver.org/)
1.  Add a git tag matching the version, e.g. `v1.0.1`

    ```
    git tag v1.0.1
    ```

1. Push it!

    ```
    git push && git push --tags
    ```

1. [Optional] Publish the npm package

    ```
    npm publish
    ```

1. [Optional] Publish the bower package

    ```
    bower register <my-lib-name> <my-git-endpoint>
    ```

### Pimp my workflow

Have you seen the [automated workflow suggestion](automate-routine.md)?

Also, you may want to add your github repo to [travis](travis-ci.org) and [coveralls](coveralls.org/).

repository: yetu/frontend-library-starter

gha_language: JavaScript

repo_name: yetu/frontend-library-starter


text:
# ffGif
GUI Helper(on Windows) for using new FFmpeg GIF encoder with color palette generation support. Bundles with AviUtl installer.

## How to use
1. download the VBScript file
2. download FFmpeg (latest)
3. downlaod gifsicle
4. put the above files in a folder
5. drag-and-drop your video file(s) on to the VBScript icon
6. Enjoy!

repository: MaverickTse/ffGif

repo_name: MaverickTse/ffGif


text:
---
title: iDeviceActivationApi constructor
---

Initializes a new instance of the [`iDeviceActivationApi`](../iDeviceActivationApi.md) class

```csharp
public iDeviceActivationApi(ILibiMobileDevice parent)
```

| parameter | description |
| --- | --- |
| parent | The !:ILibiMobileDeviceApi which owns this iDeviceActivation. |

## See Also

* interface [ILibiMobileDevice](../../iMobileDevice/ILibiMobileDevice.md)
* class [iDeviceActivationApi](../iDeviceActivationApi.md)
* namespace [iMobileDevice.iDeviceActivation](../../iMobileDevice-net.md)

<!-- DO NOT EDIT: generated by xmldocmd for iMobileDevice-net.dll -->

repository: qmfrederik/docsy-perf

repo_name: qmfrederik/docsy-perf


text:
# SCSS Template

This is a reusable template for sass files. It follows the SMACSS guidelines for keeping css logical and maintainable. It includes a typical file structure, grid system and usefull mixins.

## Authors

* ** Mike Rockett

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

* SMACSS https://smacss.com/


text:
# Some Animated GIF Hints

An excellent set of background information can be found here:

    http://www.imagemagick.org/Usage/anim_basics/

1. Create source images. GraphViz supports direct GIF output, but its
   white background is not-quite-white and its transparent backgroud is
   hideous---so we output to PNG and then convert to GIF.

        for f in *dot ; do dot -o ${f/.dot}.png -T png $f ; done

2. Create animated GIF using ImageMagick. Manually prefix first frame
   and suffix last frame to provide a brief pause in the animation on
   those frames. This wastes space but the optimization removes all of
   that wasted space except for 3 bytes.

        convert -delay 100 \
          en-merkleblock-parsing-001.gif \
          *gif \
          en-merkleblock-parsing-011.gif \
          -loop 0 \
          animated-en-merkleblock-parsing.gif

3. Compress animated GIF (118 KB -> 15 KB in this example). You may need
   to play with color settings; 8 worked in this example but 4 was too
   few. Fewer colors (base-2) results in much better compression.

        gifsicle -b -O3 --colors 8 --no-background \
          animated-en-merkleblock-parsing.gif

gha_license_id: NOASSERTION


text:
# Module 7: Direct Connectivity

- [Module 7: Direct Connectivity](#module-7-direct-connectivity)
  - [Lab: Direct connectivity](#lab-direct-connectivity)
    - [Exercise 1: Direct connections in Power BI](#exercise-1-direct-connections-in-power-bi)
      - [Task 1: Prepare the lab environment](#task-1-prepare-the-lab-environment)
      - [Task 2: Direct connectivity from the Power BI Desktop](#task-2-direct-connectivity-from-the-power-bi-desktop)
      - [Task 3: Direct connectivity from the Power BI service](#task-3-direct-connectivity-from-the-power-bi-service)

## Lab: Direct connectivity

### Exercise 1: Direct connections in Power BI

#### Task 1: Prepare the lab environment

1. Ensure that the **20778C-MIA-DC**, **20778C-MIA-SQL**, and **MT17B-WS2016-NAT** virtual machines are running, and then log on to **20778C-MIA-SQL** as **ADVENTUREWORKS\\Student** with the password **Pa55w.rd**.

2. Run **Setup.cmd** in the **D:\\Labfiles\\Lab07\\Starter** folder as Administrator.

3. If you do not already have a Power BI login, browse to **https://powerbi.microsoft.com/en-us/documentation/powerbi-admin-signing-up-for-power-bi-with-a-new-office-365-trial**, and then follow the steps to create an account.

4. Create the **AdventureWorksLT** database using the **D:\\Creating an AdventureWorks Database on Azure.docx**.

#### Task 2: Direct connectivity from the Power BI Desktop

1. Start with a blank Power BI Desktop file.

2. Connect to Azure SQL Database **AdventureWorksLT**, using **DirectQuery**.

3. Load the **SalesLT.Product** and **SalesLT.SalesOrderDetail** tables.

4. Create a chart based on the **Card** visualization.

5. Add the **OrderQty** field from the **SalesLT SalesOrderDetail** table to the chart.

6. Create a slicer based on the **Slicer** visualization.

7. Add the **SellStartDate** field from the **SalesLT Product** table to the slicer.

8. Save the desktop file as **D:\\Labfiles\\Lab07\\Starter\\Sales Orders.pbix**.

#### Task 3: Direct connectivity from the Power BI service

1. Publish the report to the Power BI service.

2. Go to **http://www.powerbi.com** and sign in using your account.

3. Go to the newly created dataset and edit the credentials required.

    > To configure the dataset settings for a DirectQuery data source, you need a Power BI Pro account.

4. Sign in using the credentials you used to sign up for Power BI service.

5. Go to the newly created Sales Orders report. You should already have a card visualization for the **OrderQty** and a slicer for the **SellStartDate**.

6. Create a chart based on the **Card** visualization.

7. Add the **LineTotal** field from the **SalesLT SalesOrderDetail** table to the chart.

8. Close Internet Explorer, and Power BI Desktop.