text:
---
layout: post
title: "Cycling from Canberra to Melbourne"
categories: posts
excerpt: "A test post copied from my old blog"
tags: [cycling, endurance, test]
comments: true
image:
  feature: 2010-bike/bike-title.jpg
---

### D-Day minus 5 weeks
According to my employer I have too much leave. I've been directed to take four weeks off before the beginning of June, and as a result will be taking all of May off.

 Caddy has an exhibition opening in Melbourne in the last week of May, and I've been talking about doing a long distance bicycle ride a bit over the past nine months or so. So the obvious answer seems to be a bike ride from Canberra to Melbourne.

A bit of experimentation with Google Maps results in the following itinerary:

* Canberra - Gundagai - 154km
* Gundagai - Holbrook - 117km
* Holbrook - Wodonga - 70km
* Wodonga - Benalla - 110km
* Benalla - Seymour - 103km
* Seymour - Melbourne - 111km
* Total - 665km

Is this possible? My longest ride to date has been a little over 140km, but I figure if I maintain a relatively low speed of about 25km/h and be sure to stay aerobic the whole time I should be able to keep going indefinitely. And worst case I have very slow days with lots of breaks.

So what do I need to do before I embark on my first ever long distance ride?

1. Make sure my legs can handle it. Use the ANZAC Day long weekend as a chance to do four consecutive 110km+ rides. If I can survive four days I'm sure I can survive six, particularly with a short 70km day in the middle.
2. Figure out how to take things with me. Being a pretty fancy bike I don't have any braze-ons to attach a rack, and the idea of attaching a trailer to a racing bike seems a bit ... improper. So I need to figure out a way to jury-rig a rack and get panniers that are big enough to carry my floor pump and a lot of spare tubes.
3. Figure out how to take enough calories with me. Over long rides I average about 29kCal/km. So this ride will be 3000+kCal per day, bringing my daily calorie needs to about 5000kCal. Which is an awful lot. I've never been terribly concerned about calorie intake on my longer rides to date, being satisfied with about 150kCal an hour, or a 2500kCal deficit at the end of a ride. This isn't going to be sensible over six days of cycling, and nutrition will become a pretty major consideration. Roughly, this equates to 193 energy gels, or about 5.75L of the sticky stuff, if I want to stay calorie neutral. In addition to a regular diet.

### D-Day minus 2.5 weeks
Post ANZAC Day long weekend. Successfully completed 445km over four days. Due to wind and rain on day two this included 110km on my indoor roller trainer, which resulted in day 3 beginning very hesitatingly on tired and sore hamstrings (you can't stop pedalling on rollers). Felt tired but good at the end of day four, which bodes well for my ability to last an extra couple of days.

### D-Day minus 1 week
The end of my first week of leave. Still not 100% certain I'm going to do this thing, but I've now bought a rack and a pair of panniers so I'm at least semi-committed. A couple of hours of Googling and I've identified accommodation at the towns I'd planned to stop at, but still not sufficiently convinced that this isn't an absurd idea to actually book the accommodation.

Incidentally, this week was a build week - With no work I set a schedule of a full time triathlete, with somewhere between 25 and 30 hours of training. Focusing on the bike, of course. I could grow to love more weeks like this!

### D-Day minus 3 days
Accommodation booked. 2.5 litres of energy gel made. Not much chance of turning back now. Weigh-in on the luggage is just under 15kg, reconsidering the contents to pack as little as possible and I've come up with:

* Tubes x6
* Tyre levers x2
* Rubber cement
* Patches x6
* Superglue
* Floor pump
* CO2 canister x3
* CO2 inflator
* Toolkit
* Spanner
* Light
* Bike lock
* Phone charger
* Printed directions for each leg
* Ziplock bags (directions, phone, wallet = 3 )
* Toothbrush
* Toothpaste
* Aussie Butt Cream
* Electrolytes
* Calcium, magnesium, iron, multivitamins
* Razor
* Sunscreen
* Cash (4x$20)
* Knicks x3
* Jerseys x3
* Socks x6
* Arm warmers
* Leg warmers
* Shoe covers
* Balaclava
* Thermal top x2
* Thermal pants
* Boxers x3
* Thick socks
* Shoes (squash and tie together old runners)
* T-shirt x3
* Pants x2

### D-Day. Sunday, May 16
Time for my longest ride ever. At the beginning of my longest stretch of cycling ever. It still seems pretty silly, but getting Caddy to drive me to Yass to start the journey seems like a bit of a cop-out. 158km from Gungahlin to Gundagai. I dealt with it fairly capably, with a short break for real food (a sandwich) about 4 hours into the 6 hour ride.
On arrival at Gundagai River Caravan Park I discovered that the clamps attaching my rack to the seat stay on my bike's frame had slipped down the frame and were chipping away at the welds on the frame. After a short time panicking and considering calling Caddy for a rescue I confirmed that the weld was structurally sound, cut up a spare tube and wrapped the seat stay in rubber to protect it and prevent slippage.
With repairs completed I showered (this was soon to become a highlight of my days), cleaned my tyres, stretched and ate a tremendous amount before wondering what I should do next. After spending a couple of hours reading H.P. Lovecraft's 'Call of Cthulu' on my iPhone I walked into town to find more food.
A cold night on an uncomfortable bed followed.

### Monday, May 17
The plan for today is 116km from Gundagai to Holbrook. After about 75km I was seriously fatigued and had another food break. With Caddy at work calling her for a rescue was a pretty embarrassing option (You may have realised by now that my ANAC weekend test ride was done *without* luggage. Oops.), so after a good stretch I completed the last 40km to Holbrook.
After checking into my motel, cleaning my tyres and, most importantly, showering I gave a generous donation to the Holbrook Bakery and spent some quality eating time walking around the museum and submarine. After getting some fruit (and, I admin, chips) from the supermarket I walked back to the motel and read while eating more. Shortly after this I walked back into town for a pub dinner. After about ten minutes discussing what 'vegan' meant I found myself with a massive bowl of veggies and another bowl full of hot chips.

### Tuesday, May 18
Today, I cross the border! A short day (74km) today, and only 2.5 hours got me into Wodonga. After discovering there really isn't much to do in Wodonga I spent a long afternoon sitting in the sun drinking tea and coffee and reading more Lovecraft. I've now passed the halfway point of my trip, which feels pretty good!

### Wednesday, May 19
109km today takes me to Benalla. A mostly uneventful ride ended by being forced off the narrow highway running from the Hume Freeway into Benalla when two semis passed me travelling in opposite directions. The resulting couple of metres cycling on gravel made me regret having 23mm racing tyres as I fishtailed before getting the bike back under control.
The all-important shower and tyre-cleaning is followed by a short cycle into town and the discovery of delicious date scones at a local bakery. Walking around the town I discover that Benalla is famous not only for being the town of Caddy's birth but also for having something to do with Ned Kelly.

...A less-interesting stretch of freeway

### Thursday, May 20
The temptation to forego my vegan diet for the sake of delicious calories hit me when the owner of the Benalla caravan park told me they served complimentary pancakes for breakfast, but I managed to motivate myself to get on the road before they started cooking and avoid the allure of a hot breakfast.
105km into Seymour today, during which I realised that my impression of Canberra to Melbourne being more or less entirely downhill was perhaps a little incorrect. Eventually, after about four hours of continual rolling hills, I made it into Seymour.
The once-more obligatory shower and tyre-cleaning was followed by an uneventful but enjoyable wander around the streets of Seymour. As the afternoon grew cold and it began drizzling I realised how lucky I'd been for the entire trip, with just about perfect weather every day.
A slightly frustrating afternoon trying to find decent vegan food ended with some hot chips (perfect for the cold, rainy weather) and take away Chinese followed by an evening listening to a Cory Doctorow audiobook and figuring out how to install a C compiler on my iPhone (my mind was obviously starting to tire of not having any technical challenges).

### Friday, May 21
Waking up today was a little depressing, realising that the relaxing (mentally) and adventurous (visiting new towns every day) days were coming to an end, with today taking me the final 100km into Melbourne.
After yesterday's endless rolling hills I was initially heartened to find that the road to Melbourne was mostly flat. Unfortunately it happened to be blowing an absolute gale on Friday morning. And not in a direction that would make me happy.
After temptations to stop for a break at every service station along the way (which I avoided), and temptations to get on a train to Melbourne at the two or three train stations I passed (also avoided...just) I eventually arrived at a sign announcing "Welcome to Melbourne"!

Under this was a second sign, this one labelled "Melbourne 34km".

I was not happy. Obviously getting tired.
But before too long I was cycling with the traffic through the busy streets of Melbourne, and after a couple of stops to check my route sheet and figure out where I was going I'd reached my destination.
Once there it struck me that, after a 665km ride, my "epic" 140ish km weekend rides seemed a bit pathetic, and I began wondering what I could do next - 840km to Coffs Harbour? 1500km to the Sunshine Coast? We'll see...

###The stats

* Distance: 660.88km
* Time: 25-26 hours
* Calories while riding: 14 472kCal
* Energy gel: About 900mL, or 3000kCal
* Peanut butter/vegemite wholemeal sandwiches: 3 loaves
* Total weight: 9.9kg (bike) + 64kg (me) + ~15kg (luggage - varied with food and water) + 1.5kg (water bottles) = ~90.4kg
* Audiobooks consumed: 3 (About 28 hours)
* Podcasts consumed: >100
* Punctures: 0 (Made up for by four during my first week back at work)

repository: chris-bc/site

repo_name: chris-bc/site


text:
# Release History

## TBC

* **Change**: Virtual machine identifier is now optional

## July 2017

Critical (but small) fixes to the SDK.

* **Change**: Permit the inclusion of a path as part of the Azure Batch account URL.

* **Change**: Validate the Azure Batch URL to ensure it doesn't include any query parameters prior to use.

* **Fix**: The API version query parameter of the URL used to request software entitlement should have been specified as `api-version`.

* **Fix**: The API version passed on the URL requesting software entitlement should have been `2017-05-01.5.0`.

* **Fix**: The response from `sestest server` for a successful entitlement should use `vmid` to pass the identifier for the entitled virtual machine.

* **Fix**: Change the contentType header from `application-json`, to `application/json; odata=minimalmetadata` as required by the Azure Batch services.

## May 2017

Initial public release of the Software Entitlement Service SDK for Azure Batch, including:

* [Software entitlement library code](src/Microsoft.Azure.Batch.SoftwareEntitlement.Client.Native) for integration into applications.

* The [sestest](src/sestest) commandline testing tool.

* Reference documentation on the [REST API](src/Microsoft.Azure.Batch.SoftwareEntitlement.Server.

* [Guide to compilation](docs/build-guide.md).

* [Full walk-through](docs/walk-through.md) documentation.

license: MIT

repository: Azure/azure-batch-software-entitlement

branch_name: refs/heads/develop

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: Azure/azure-batch-software-entitlement


text:
# TIC TAC TOE
This is the classic tic tac toe game implemented in Android as part of the ALC 2.0 Take a Climb Challenge.

## Installation
Install the apk file in your phone **(app-debug.apk)**.

The apk file is located in the [release](https://github.com/sheilambadi/tic-tac-toe/releases "Tic Tac Toe Game") section as illustrated

## Usage
After installing a take the following steps to play the game.
1. Choose the number of players.
  * Single player ~ play against computer
  * Multi player ~ play against a human player on the same phone in turns

2. After selecting either singleplayer or multiplayer:
  * Select whether to play with X or O
  * Choose board size

**NB: In multiplayer mode, only player one picks X or O and the other is assigned to player 2 automatically**

3. The different boards for the **single player** board are as shown:

***NOTE: The score card is displayed next to the Player 1 and Player 2 texts***

4. The boards for **multiplayer mode** are as show with a _player turn_ text displayed for the two players to know who is to play.

 5. There are Toast messages at the bottom of the screen to show the player that *wins and if there is a draw*

 6. There is also the reset button that resets the board and score card

 ## License

**MIT License**

© 2018 Sheila Mbadi

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

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

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

repository: sheilambadi/tic-tac-toe

branch_name: refs/heads/master

repo_name: sheilambadi/tic-tac-toe


text:
# Challenge 14 - Circular Array Single Cycle
## Description
>
Given an array of integers, determine if there exists a single complete cycle.

## Assumptions
- the value at each index indicates the next relative index to traverse to.
- a single cycle is that all indices within the array are touched once.

## Labels
- Array
- Graph
- HashSet

## References
- Interview Cake

## Considerations
### Consideration 1
- keep track of all the indices that are visited in a set.
- iterate for only the total number of elements within the list.
- at the end, check to see if the total number of indices visited is equal to the length.

### Consideration 2
- instead of keeping track of a set of indices that been visited, just determine if at the end if returned to the same index that was started at.
- during the looping, need to see if the starting index is returned to early, if so break out.
- if the total count of indices visited and the final index is the original then return true, else false.


text:
---
title: Vert.x 3.2.1 is released !
date: 2016-02-05
template: post.html
author: cescoffier
---

We are pleased to announce the release of Vert.x 3.2.1!

The release contains many bug fixes and a ton of small improvements, such as future composition, improved Ceylon support, Stomp virtual host support, performance improvements... Full release notes can be found here:

https://github.com/vert-x3/wiki/wiki/3.2.1---Release-Notes

Breaking changes are here:

https://github.com/vert-x3/wiki/wiki/3.2.1---Breaking-Changes

The event bus client using the SockJS bridge are available from NPM, Bower and as a WebJar:

* https://www.npmjs.com/package/vertx3-eventbus-client
* https://github.com/vert-x3/vertx-bus-bower
* http://www.webjars.org/

Dockers images are also available on the [Docker Hub](https://hub.docker.com/u/vertx/)
The vert.x distribution is also available from [SDKMan](http://sdkman.io/index.html).

Many thanks to all the committers and community whose contributions made this possible.

Next stop is Vert.x 3.3.0 which we hope to have out in May 2016.

The artifacts have been deployed to [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.vertx%22%20AND%20v%3A%223.2.1%22)
 and you can get the distribution on [Bintray](https://bintray.com/vertx/downloads/distribution/3.2.1/view).

Happy coding !

gha_language: HTML


text:
## FusionAuth .NET Core Client
![semver 2.0.0 compliant](http://img.shields.io/badge/semver-2.0.0-brightgreen.svg?style=flat-square)

If you're integrating FusionAuth with a .NET Core application, this library will speed up your development time.

Here's a small Example showing how to use this client: [Example.cs](https://github.com/FusionAuth/fusionauth-netcore-client/blob/master/fusionauth-netcore-client-test/fusionauth-netcore-client-test/test/io/fusionauth/Example.cs)

For additional information and documentation on FusionAuth refer to [https://fusionauth.io](https://fusionauth.io).

https://www.nuget.org/packages/FusionAuth.Client/

Refer to the FusionAuth API documentation for request and response formats.
* https://fusionauth.io/docs/v1/tech/apis/
* https://fusionauth.io/docs/v1/tech/client-libraries/netcore

## Supported Frameworks
* .NET Standard 2.0, 2.1
* .NET Core 2.1, 3.1
* .NET 5

## Tests

There are some tests. Most require a running FusionAuth instance.

To run them:

* `cd fusionauth-netcore-client-test/fusionauth-netcore-client-test`
* `dotnet build && dotnet test` # or, to run only a few
* `dotnet build && dotnet test --filter CorrectlyD`

## Questions and support

If you have a question or support issue regarding this client library, we'd love to hear from you.

If you have a paid edition with support included, please [open a ticket in your account portal](https://account.fusionauth.io/account/support/). Learn more about [paid editions here](https://fusionauth.io/pricing/).

Otherwise, please [post your question in the community forum](https://fusionauth.io/community/forum/).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/FusionAuth/fusionauth-netcore-client.

If you find an issue with syntax, etc - this is likely a bug in the template. Feel free to submit a PR against the Client Builder project.
- [Client Builder](https://github.com/FusionAuth/fusionauth-client-builder)
- [netcore.client.interface.ftl](https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/netcore.client.interface.ftl)
- [netcore.client.ftl](https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/netcore.client.ftl)
- [netcore.client.sync.ftl](https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/netcore.client.sync.ftl)
- [netcore.domain.ftl](https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/netcore.domain.ftl)

## License

The code is available as open source under the terms of the [Apache v2.0 License](https://opensource.org/licenses/Apache-2.0).

repository: asimmon/fusionauth-netcore-client

repo_name: asimmon/fusionauth-netcore-client


text:
<!--
 * @Author: SpadeXiao
 * @Date: 2021-09-03 10:27:06
 * @LastEditTime: 2021-09-07 12:04:59
-->
# rob_the_seat
We can rob the seat!

## How to use it?
python3 searchSeat.py.

## Attention!
You should get your cookie first！

# Update logs
## v1.0.0
[2021.9.3]

Realize basic functions：Rob the Seat.

## v1.0.1
[2021.9.7]

Add the random number option to avoid being shielded by the server.
Add time module.

## v1.0.2
[2021.9.7]

Set two cookies: polling and seat grabbing.


text:
# Normalizer subgroups

```agda
module group-theory.normalizer-subgroups where
```

<details><summary>Imports</summary>

```agda
open import foundation.dependent-pair-types
open import foundation.identity-types
open import foundation.logical-equivalences
open import foundation.propositions
open import foundation.subtypes
open import foundation.universe-levels

open import group-theory.conjugation
open import group-theory.groups
open import group-theory.subgroups
open import group-theory.subsets-groups
```

</details>

## Idea

Consider a [subgroup](group-theory.subgroups.md) `H` of a
[group](group-theory.groups.md) `G`. The **normalizer subgroup** `Nᴳ(H)` of `G`
is the largest subgroup of `G` of which `H` is a
[normal subgroup](group-theory.normal-subgroups.md). The normalizer subgroup
consists of all elements `g : G` such that `h ∈ H ⇔ (gh)g⁻¹ ∈ H` for all
`h ∈ G`. In other words, the normalizer subgroup consists of all elements `g`
such that `(gH)g⁻¹ ＝ H`.

The weaker condition that `(gH)g⁻¹ ⊆ H` is
[not sufficient](https://math.stackexchange.com/q/107862) in the case of
infinite groups. In this case, the group elements satisfying this weaker
condition may not be closed under inverses.

Note: The normalizer subgroup should not be confused with the
[normal closure](group-theory.normal-closures-subgroups.md) of a subgroup, or
with the [normal core](group-theory.normal-cores-subgroups.md) of a subgroup.

## Definitions

### The universal property of the normalizer subgroup

```agda
module _
  {l1 l2 l3 : Level} (G : Group l1) (H : Subgroup l2 G)
  (N : Subgroup l3 G)
  where

  is-normalizer-Subgroup : UUω
  is-normalizer-Subgroup =
    {l : Level} (K : Subgroup l G) →
    ( {x y : type-Group G} → is-in-Subgroup G K x →
      is-in-Subgroup G H y →
      is-in-Subgroup G H (conjugation-Group G x y)) ↔
    leq-Subgroup G K N
```

### The construction of the normalizer subgroup

```agda
module _
  {l1 l2 : Level} (G : Group l1) (H : Subgroup l2 G)
  where

  subset-normalizer-Subgroup : subset-Group (l1 ⊔ l2) G
  subset-normalizer-Subgroup x =
    Π-Prop'
      ( type-Group G)
      ( λ y →
        iff-Prop
          ( subset-Subgroup G H y)
          ( subset-Subgroup G H
            ( conjugation-Group G x y)))

  is-in-normalizer-Subgroup : type-Group G → UU (l1 ⊔ l2)
  is-in-normalizer-Subgroup =
    is-in-subtype subset-normalizer-Subgroup

  is-closed-under-eq-normalizer-Subgroup :
    {x y : type-Group G} →
    is-in-normalizer-Subgroup x → x ＝ y → is-in-normalizer-Subgroup y
  is-closed-under-eq-normalizer-Subgroup =
    is-closed-under-eq-subtype subset-normalizer-Subgroup

  restrict-conjugation-Subgroup :
    (x : type-Group G) → is-in-normalizer-Subgroup x →
    type-Subgroup G H → type-Subgroup G H
  pr1 (restrict-conjugation-Subgroup x u (y , h)) = conjugation-Group G x y
  pr2 (restrict-conjugation-Subgroup x u (y , h)) = forward-implication u h

  contains-unit-normalizer-Subgroup :
    contains-unit-subset-Group G subset-normalizer-Subgroup
  pr1 contains-unit-normalizer-Subgroup u =
    is-closed-under-eq-Subgroup' G H u (compute-conjugation-unit-Group G _)
  pr2 contains-unit-normalizer-Subgroup u =
    is-closed-under-eq-Subgroup G H u (compute-conjugation-unit-Group G _)

  is-closed-under-multiplication-normalizer-Subgroup :
    is-closed-under-multiplication-subset-Group G subset-normalizer-Subgroup
  pr1 (is-closed-under-multiplication-normalizer-Subgroup x y u v) w =
    is-closed-under-eq-Subgroup' G H
      ( forward-implication u (forward-implication v w))
      ( compute-conjugation-mul-Group G x y _)
  pr2 (is-closed-under-multiplication-normalizer-Subgroup x y u v) w =
    backward-implication v
      ( backward-implication u
        ( is-closed-under-eq-Subgroup G H w
          ( compute-conjugation-mul-Group G x y _)))

  is-closed-under-inv-normalizer-Subgroup :
    is-closed-under-inv-subset-Group G subset-normalizer-Subgroup
  pr1 (is-closed-under-inv-normalizer-Subgroup x u {y}) h =
    backward-implication u
      ( is-closed-under-eq-Subgroup' G H h
        ( is-section-conjugation-inv-Group G x y))
  pr2 (is-closed-under-inv-normalizer-Subgroup x u {y}) h =
    is-closed-under-eq-Subgroup G H
      ( forward-implication u h)
      ( is-section-conjugation-inv-Group G x y)

  normalizer-Subgroup : Subgroup (l1 ⊔ l2) G
  pr1 normalizer-Subgroup =
    subset-normalizer-Subgroup
  pr1 (pr2 normalizer-Subgroup) =
    contains-unit-normalizer-Subgroup
  pr1 (pr2 (pr2 normalizer-Subgroup)) =
    is-closed-under-multiplication-normalizer-Subgroup
  pr2 (pr2 (pr2 normalizer-Subgroup)) =
    is-closed-under-inv-normalizer-Subgroup

  forward-implication-is-normalizer-normalizer-Subgroup :
    {l : Level} (K : Subgroup l G) →
    ( {x y : type-Group G} → is-in-Subgroup G K x →
      is-in-Subgroup G H y →
      is-in-Subgroup G H (conjugation-Group G x y)) →
    leq-Subgroup G K normalizer-Subgroup
  pr1 (forward-implication-is-normalizer-normalizer-Subgroup K u x k {y}) h =
    u k h
  pr2 (forward-implication-is-normalizer-normalizer-Subgroup K u x k {y}) h =
    is-closed-under-eq-Subgroup G H
      ( u (is-closed-under-inv-Subgroup G K x k) h)
      ( is-retraction-conjugation-inv-Group G x y)

  backward-implication-is-normalizer-normalizer-Subgroup :
    {l : Level} (K : Subgroup l G) → leq-Subgroup G K normalizer-Subgroup →
    {x y : type-Group G} → is-in-Subgroup G K x →
    is-in-Subgroup G H y →
    is-in-Subgroup G H (conjugation-Group G x y)
  backward-implication-is-normalizer-normalizer-Subgroup K u {x} {y} k h =
    forward-implication (u x k) h

  is-normalizer-normalizer-Subgroup :
    is-normalizer-Subgroup G H normalizer-Subgroup
  pr1 (is-normalizer-normalizer-Subgroup K) =
    forward-implication-is-normalizer-normalizer-Subgroup K
  pr2 (is-normalizer-normalizer-Subgroup K) =
    backward-implication-is-normalizer-normalizer-Subgroup K
```

## See also

- [Centralizer subgroups](group-theory.centralizer-subgroups.md)
- [Normal closures of subgroups](group-theory.normal-closures-subgroups.md)
- [Normal cores of subgroups](group-theory.normal-cores-subgroups.md)

repository: UniMath/agda-unimath

gha_language: Agda

repo_name: UniMath/agda-unimath


text:
# Lykos community modes
This repository contains unofficial game modes made by the lykos community.

## Using these modes
To use these modes in your own bot, download the mode files you want and put them
into the `gamemodes/` directory of your bot (**NOT** `src/gamemodes`). Then, copy
`gamemodes/__init__.py.example` to `gamemodes/__init__.py` so your bot loads them.

At this time, community mode files will not be updated when you run the `!update`
command; we're working on how best to make that happen.

## File descriptions
The following files are available in this repository:

- classicfire.py: A twist on default reflecting changes made in April Fools 2020.
- shootout.py: Everyone has a gun, try to be the last one standing! For 2+ players.
- totemfire.py: 3 unique modes each with lots of crazed shamans and lots of totems.

## Contributing
If you would like to contribute modes to this repository, please adhere to the
following guidelines:

- Mode files should be self-contained, including any messages and metadata keys
  they may need to add. See existing files for an example.
- Test your mode before submitting on the latest version of the bot to ensure it
  works correctly. Remember that the bot supports Python 3.7 and later, so your
  mode should as well.
- Add an entry into the "File descriptions" section of this README describing your
  mode.
- Try to choose distinctive mode names that do not override built-in modes or other
  modes present in this repository.

branch_name: refs/heads/main


text:
# Python - MagnumBI Dispatch Client Library

MagnumBI Dispatch manages microservice communication and interaction simply.
It is easy to develop and integrate with your small to medium sized development teams.
To see more about MagnumBI Dispatch and download the server [click here](https://github.com/OptimalBI/magnumbi-dispatch-server)

This is the client library for python. Too use see below.
For the repository used to develop this libary [see here](https://github.com/OptimalBI/magnumbi-dispatch-python-development)

## Requirements
Python 3.3 or greater. Python 2.x not supported.

## Getting started
Clone this project into a subfolder of your project. See the example below for more details.

PyPI coming soon!

## Examples

```python
import magnumbi_depot

client = magnumbi_depot.DispatchClient(
    uri='<IP_ADDRESS>',
    port=6883,
    access_key='test',
    secret_key='token',
    ssl_verify=False
)

status_result = client.check_status() # Will return True if connection to the server functioned correctly.
```


text:
# Transaction Propagation Delays

This write-up intends to share some knowledge on how transactions propagate and why it sometimes takes a lot of time.

## Inbound vs Outbound

Unlike other p2p technologies bitcoin separates `inbound` and `outbound` connections:

Outbound connection is initiated by the node itself. While inbound is initiated by someone else "from outside"

```
  Inbound   +-----+   Outbound
----------->| YOU |---------------->
            +-----+
```

The reason for this separation is security. An adversary can connect as `inbound` to almost any node. But it
can not force _you_ to connect to him.

This leads to a few peculiarities in how inbound and outbound data is handled.
We are going to concentrate on transaction propagation.

It is worth noting that data flows in both directions. I.e. nodes send transactions to both their inbound and outbound
peers.

## Diffusion and transaction delays

When bitcoin node decides to send a transaction to its neighbour - it never sends this transaction directly.
Instead, it puts the transaction into the buffer associated with this peer; then relays this buffer with some random
exponential intervals. This mechanism is called `diffusion`. It is intended to make it difficult for an adversary to
find the source of the transaction.

For `outbound` peers the relay interval is `Poisson(2)` seconds. For inbound peers it is `Poisson(5)` seconds.
Although on average those are 2 and 5 seconds respectively, in some cases this delay might be several minutes.

We can show this by looking at the underlying function from bitcoin:

```cpp
int64_t PoissonNextSend(int64_t nNow, int average_interval_seconds) {
    return nNow + (int64_t)(log1p(GetRand(1ULL << 48) * -0.0000000000000035527136788 /* -1/2^48 */) * average_interval_seconds * -1000000.0 + 0.5);
}
```

If we substitute output of random generator here with its maximum value we will get:

`max(Poisson(2)) =~ 59 seconds`

`max(Poisson(5)) =~ 148 seconds`

Note: You can roughly estimate maximum possible delay by multiplying Poisson argument by 30.

We often use functions like `wait_for_transaction` in functional tests. The above numbers mean that there is always a
small chance that this wait function fails (unless timeout is several minutes).

We now estimate this chance for some of the popular timeout values:

Timeout | Prob(Poisson(5) > Timeout) | Prob(Poisson(2) > Timeout)
--------|----------------------------|--------------------------
3s      |0.548812                    |0.22313
10s     |0.135335                    |0.00673795
15s     |0.0497871                   |0.000553085
30s     |0.00247875                  |3.05902e-07
60s     |6.14421e-06                 |0

Please note that those computations are only valid for a single connection. In a real world each node would have lots of
connections with lots of alternative routes between nodes, so overall propagation time will be different.

# Whitelisting

It is possible to completely disable diffusion for a selected node. Just add
it to the white list. In functional tests that can be achieved with
`-whitelist=<IP_ADDRESS>` extra argument.

## Simulations

To expand results on a slightly more complicated network topologies several simulations were run.
We start timer when node 0 sends a transaction. We stop timer when node 1 has this transaction in its mempool.
Below are recorded values for several small networks:

   | 0<->1 | 0->1 | 0<-1 | 0<->2<->1 | 0<->2<->1; 0<->3<->1 | 0<-1 + whitelist
--------|-------|------|------|-----------|-------------|-----------------
Average | 1.7   | 2.25 | 5    | 3.15      | 2.29        | 0.76
Min     | 0.48  | 1.46 | 0.47 | 0.49      | 0.56        | 0.59
Max     | 11.8  | 20.86| 40.1 | 14.25     | 8.59        | 1.03
Samples | 1000  | 1000 | 1000 | 501       | 3625        | 1000

Note: `0<->1` denotes bidirectional connection. Which is in fact two connections: inbound `0<-1` and outbound `0->1`.

Note: simulations were run on a local machine using functional tests framework.

[Raw data](https://docs.google.com/spreadsheets/d/1E5O0dCuLyzHj0BebIj1mpz3nh-rUEZ99TnzX6TYyGqM/edit?usp=sharing)

From the above table we can see that sends to an inbound node indeed take ~5 seconds, and ~2 seconds for outbound.
If a connection is bidirectional - transactions propagate even faster. Because they are being sent through both
inbound and outbound connections.

We can also clearly see alarmingly high maximum values in a networks with just 2 nodes. They decrease when more
alternative routes exist in the network. However be careful: maximum propagation time stays the same as the number of
alternative routes grows. It is the probability of getting it decreases.

## Recommendations to avoid flakiness in functional tests
- Use whitelisting to completely disable diffusion
- Prefer bidirectional connections
- Prefer fully-connected network topologies
- Avoid using `sleep` to wait for the transaction effects. You can use one of the special functions with timeouts instead:
  - `wait_for_transaction` - waits for specified transaction across all nodes in the test run
  - `sync_mempools` - waits until all of the passed nodes have equal mempools
  - `sync_blocks` - waits until all of the passed nodes have the same tip
  - `sync_all` - is a combination of `sync_mempools` and `sync_blocks`
  - `wait_until` - waits until a passed predicate is true

repository: cornelius/unit-e-project

repo_name: cornelius/unit-e-project


text:
# PA to give P.7M to quake victims

Published at: **2019-11-06T09:39:47+00:00**

Author: **Zaida Delos Reyes**

Original: [Journal Online](https://journal.com.ph/news/provincial/pa-give-p7m-quake-victims)

This was confirmed yesterday by Philippine Army (PA) spokesman Lt. Col. Ramon Zagala.
Zagala said the move is in addition to the Army’s on-going Humanitarian Assistance and Disaster Response operations in the province of Cotabato and other affected areas in the region.
He explained that the donation will be deducted from each Army personnel’s subsistence allowance for the month of November, which is equivalent to two meals or P100.
The Army spokesman said each soldier has P150 allowance everyday  for three meals or  P 50 per meal.It was learned that the Philippine Army has 97,000 forces.
Other contributions will also be accepted either in cash or in kind.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# React - Using .env files

This is a basic app that uses `.env` files for configuration. This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Project setup

The .env files should not exist in the repo. Create a file named `.env.local` in the root of the project. Set the contents of that file to:

```
REACT_APP_TEST_PHRASE=This one goes to eleven

```
Install the dependencies then run the project.

```
npm install

npm run start
```

The test phrase from the `.env.local` file should show on the page. This file will not be included if you build the app for deployment.

repository: davetrux/js-app-configuration

gha_language: JavaScript

repo_name: davetrux/js-app-configuration


text:
---
layout: post
title:  "SPACEKIT Builder: convolutional neural networks"
date:   2021-02-02 02:02:02 -1111
categories: datascience
tags: spacekit astrophysics
author: Ru Keïn
---

# spacekit.builder
building and fitting convolutional neural networks

- build_cnn: builds keras 1D CNN classifier
- batch_maker: pass equal number of class samples rotating randomly
- fit_cnn: trains keras CNN classifier

### build_cnn
Builds and compiles linear CNN using Keras

### batch_maker
pass equal number of class samples rotating randomly

### fit_cnn
fit and train convolutional neural network

```python

           /\    _       _                           _                      *
/\_/\_____/  \__| |_____| |_________________________| |___________________*___
[===]    / /\ \ | |  _  |  _  | _  \/ __/ -__|  \| \_  _/ _  \ \_/ | * _/| | |
 \./    /_/  \_\|_|  ___|_| |_|__/\_\ \ \____|_|\__| \__/__/\_\___/|_|\_\|_|_|
                  | /             |___/
                  |/
```

repository: alphasentaurii/alphasentaurii

gha_license_id: NOASSERTION

repo_name: alphasentaurii/alphasentaurii


text:
---
layout: post
title:      "SQL is Amazing "
date:       2020-03-24 02:32:03 +0000
permalink:  sql_is_amazing
---

After learning the basics of SQL, I am amazed at how powerful and friendly the language is! Every line that you type makes sense and is extremely intuitive. I read a recent article that described the different types of database system engines and it was amazing to see how many types that exist! The top ones were Oracle, mySQL, Microsoft SQL server, and PostgreSQL. Number 10 on the list was SQLite. It is refreshing to hear that we are learning relevant database management systems and that this course is preparing us for the real world! Combining a knowledge of the inner join, left join, and outer join calls with some basic database information it is exciting to think that information can be pulled up from an extremely large database in just a fraction of a second !

extension: markdown


text:
# spring-boot-cxf-jaxws-camel-proxy

An example project to create proxy service to real soap service using spring-boot-camel

## Run

- First start real server. go to cxf-jaxws-server directory and run below command

```
	mvn spring-boot:run
```

- Next start camel proxy server. go to camel-proxy-server directory and run below command

```
	mvn spring-boot:run
```
- Proxy webservice can be accessed from below url.

```
	http://localhost:8082/services/mathproxy
```

## Useful links

| Service                 	| Url                                      	|
|-------------------------	|------------------------------------------	|
| admin server jaxws      	| http://localhost:8080                    	|
| admin server proxy      	| http://localhost:8082                    	|
| cxf services list jaxws 	| http://localhost:8080/services           	|
| cxf services list proxy 	| http://localhost:8082/services           	|
| Soap Endpoint jaxws     	| http://localhost:8080/services/math      	|
| Soap Endpoint proxy     	| http://localhost:8082/services/mathproxy 	|

gha_language: Java


text:
# ComputerVision
Computer Vision Studies

BLG 453E Computer Vision course assignments given in 2020 at ITU

For the description of the projects, please see the pdf files given in the folders.
In addition, you can find the report files in each folder.

## Topics of First Study
(Histogram Matching & Segmentation)
Pointwise Image Processing
Image Intensity Transformations, Image Histograms
Point Operations Using Look-up Tables
The Probability Distribution Function(PDF) of an Image
Cumulative Distribution Function(CDF) of an Image
Multi-Band Histogram Calculation
Histogram equalization
Histogram matching
Look Up Table for Histogram Matching
Image Enhancement

## Topics of Second Study
(Landmark, Triangulation & Face Morphing)

Geometric Image transforms

Image Warping

Coordinate Mapping

Forward & Backward Mapping

Translation, Scaling & Rotation

Image morphing

Image Rectification

## Topics of Third Study
(Sobel Filter, Edge Detector and Corner Detector)

Smoothing Spatial & Sharpening Spatial Filters

Morphological Image Filters

Gaussian Smoothing

Mean-Median Filter

Image Filtering and Enhancement

Edge Detection

Roberts Operator, Sobel Operator

Line Detection Masks/Filters

Point Detection

The Canny edge detector

## Topics of Fourth Study
(Lucas-Kanade Algorithm & Find the Celebrities who are most Similar to You)

K means Clustering

Segmentation as a Clustering Problem

Motion Estimation

## Topics of Fifth Study
(Hough Circle Detection, 3D Image Segmentation)

Region Growing

Pixel Connectivity

Recall Segmentation based on Thresholding

repository: cansuynk/ComputerVision

repo_name: cansuynk/ComputerVision


text:
# Luigi Client

## Overview

This project contains a library that allows your application to use all features of the [Luigi framework](../core).

## Installation

Install the client in your project using npm:
```bash
npm install luigi-client
```

Import the client in places where you want to use it:
```javascript
// es5
var LuigiClient = require('@kyma-project/luigi-client').LuigiClient;

// es6 and beyond
import { LuigiClient } from '@kyma-project/luigi-client';`
```

You can see the Luigi Client in action by running the [Angular example application](/core/examples/luigi-sample-angular).

repository: aartek/luigi

repo_name: aartek/luigi


text:
---
layout: post
title: "Niagara Falls"
date: 2019-06-23
location: Niagara Falls, Ontario
---
Niagara Falls is a group of three waterfalls at the southern end of Niagara Gorge, between the Canadian province of Ontario and the US state of New York. The largest is Horseshoe Falls, also known as Canadian Falls, which straddles the international border between Canada and the United States.

I stayed at the Sheraton on the Falls hotel, which has a direct view of Horseshoe Falls. I also recommend visiting the town Niagara-on-the-lake, a small town with colonial-style buildings, wineries, and Fort George.

One of my favorite Canadian products is ice wine. I also visited a local ice winery but forgot the name already.

 Crater Lake

When I first arrived at the Crater Lake National Park, it started snowing at the end of May! Just moved from Boston to San Fransisco, I reunited with winter snows after 9 months. Luckily, I still had my snow brush in my car and was able to clean 7 inches of snow. It was extremely foggy after a whole night of snowing; I couldn't see the lake at all even standing just at the edge of the lake! Luckily, Oregon is incredibly beautiful. I especially recommend driving [The Volcanic Legacy Scenic Byway](https://en.wikipedia.org/wiki/Volcanic_Legacy_Scenic_Byway). It is roughly 500 miles long and the section near Crater Lake National Park is dotted with cattle farms, beautiful lagoons, and national forests.

 Driving through Umpqua National Forest

On my way back, I took a detour to visit the Redwood National and States Parks.

 Moose at Prairie Creek Redwoods State Park

repository: tianwei-zhang/travel

repo_name: tianwei-zhang/travel


text:
# Changelog

## v1.9.6

### Feature

- Update Dockerfile base image to `rclone/rclone:1.57.0`
- Display the time of running the backup program

## v1.9.5

### Feature

- Update Dockerfile base image to `rclone/rclone:1.56.2`

## v1.9.4

### Fixed

- Fix the wrong rsa_key compressed file name for searching when restoring (fixed [#32](https://github.com/ttionya/vaultwarden-backup/issues/32))

## v1.9.3

### Feature

- Update Dockerfile base image to `rclone/rclone:1.56.1`

### Chore

- On the 10th, 20th and 30th of every month, republish the Docker image to update the alpine packages

## v1.9.2

### Feature

- Update Dockerfile base image to `rclone/rclone:1.56.0` (close [#31](https://github.com/ttionya/vaultwarden-backup/issues/31))

## v1.9.1

### Feature

- Increase the number of ping retries and timeout time

## v1.9.0

### Feature

- Support for pinging, such as healthchecks.io (close [#30](https://github.com/ttionya/vaultwarden-backup/issues/30))

### Chore

- Don't support linux/386 platform anymore because vaultwarden not support it

## v1.8.1

### Feature

- Update the `docker-compose.yml` file to use the new docker image
- Add Rclone configuration verification (fixed [#29](https://github.com/ttionya/vaultwarden-backup/issues/29))

## v1.8.0

**Reminder**: If you are still using the `ttionya/bitwardenrs-backup` Docker images, you need to migrate to the new `ttionya/vaultwarden-backup` image.

### Feature

- Rename the Docker image to `vaultwarden-backup`

### Chore

- Build both `bitwardenrs-backup` and `vaultwarden-backup` Docker images

## before v1.8.0

outdated.

repository: srgsf/vaultwarden-backup

gha_language: Shell

repo_name: srgsf/vaultwarden-backup


text:
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
![Hireable](https://cdn.rawgit.com/hiendv/hireable/master/styles/default/yes.svg)

Dog Sitter Services API Final Capstone project

    This project is part of the Microverse curriculum!

    Explore the docs »

    Report Bug
    ·
    Request Feature

## Table of Contents

* [About the Project](#about-the-project)
  * [Documentation](#documentation)
  * [Getting Started](#getting-started)
  * [Prerequisites](#prerequisites)
  * [Setup](#setup)
  * [Usage](#usage)
  * [Run Test](#run-test)
  * [Deployment](#deployment)
  * [Built With](#built-with)
* [Authors](#authors)
* [Contributing](#contributing)
* [Show your support](#show-support)
* [Acknowledgements](#acknowledgements)
* [License](#license)

## About The Project

This API matches dog care services (Dog sitting, walking, grooming, etc.) with different users!
Many sellers can offer the same service, but who do you trust to care for your furry friend?
Add those services you prefer to your favorites and easily keep track of them.

This is the final Capstone project of the Microverse Curriculum.

### Documentation

The [documentation](https://quiet-cove-56221.herokuapp.com/docs) was built using raddocs, deployed in Heroku

## Deployment

Its only a back end, so you wont see anything! Check out the deployed app at [Heroku](https://quiet-cove-56221.herokuapp.com/)

### Getting Started

To get a local copy up and running follow these simple example steps.

### Prerequisites

Install [RVM](https://rvm.io/rvm/install)

### Setup

Install gems with:

```
bundle install
```

Setup database with:

```
rails db:migrate
```

### Usage

Start server with:

```
rails server
```

Install [httpie](https://httpie.org/)
Don't know where to [start using httpie?](https://httpie.org/docs#usage)

#### Signup

The following command will create an login a new user in the database, fill in your name, email and password

```bash
$ http :3000/signup name=Eduardo<EMAIL_ADDRESS>password=foobar password_confirmation=foobar
```
#### Login

Users Log in with their email and password

```bash
$ http :3000/login<EMAIL_ADDRESS>password=foobar
```

#### Register a service

Only Admins can register a service! We do this to guarantee all dog handlers have insurance and are properly identified.

To add services locally open a rails console and update the user you want to set as admin this way:

```bash
$ rails c
> User.find_by(email: 'eduardo@email.com').update(admin: true)
> exit
```
After that login the user and keep the auth_token safe!

```bash
$ http :3000/login<EMAIL_ADDRESS>password=foobar
```

Finally we'll create a new service this way (paste the auth_token in the Authorization header)

```bash
$ http :3000/services name=grooming user_id=1 \
Authorization:'paste your auth token here'
```

#### Services index

To see all the services available

```bash
$ http :3000/services
```

#### To see the details of a Service

Once you have seen the list of all services, choose and and replace the service id in *:id* too see its details.

```bash
$ http :3000/service/:id
```
#### Create Favorite

To create a favorite login the user (admin or not) and keep the auth_token safe
```bash
$ http :3000/login<EMAIL_ADDRESS>password=foobar
```
Now we'll enter the service_id and the Authentication header

```bash
$ http :3000/users/2/favorites service_id=1 \
Authorization:'yourtoken'
```
#### All Favorites

To see all your favorites you must log in, we'll use the same authentication steps as before

```bash
$ http :3000/users/2/favourites Authorization:'yourtoken'
```

### Run tests

to run the test:

```
rspec
```

### Built With
This project was built using these technologies.
* Ruby
* Rails
* Rspec
* raddocs
* Rubocop
* VsCode

## Authors

[Eduardo Gutierrez](https://github.com/fedgut) -<EMAIL_ADDRESS>
Project [Link](https://github.com/fedgut/dog_sitter_API/)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the [issues page](issues/).

## Show your support

Give a ⭐ if you like this project!

## Acknowledgements
* [Microverse](https://www.microverse.org/)
* [The Best readme Template](https://github.com/othneildrew/Best-README-Template)

## 📝 License

This project is [MIT](https://opensource.org/licenses/MIT) licensed.

[contributors-shield]: https://img.shields.io/github/contributors/fedgut/Dog-care-services-API.svg?style=flat-square
[contributors-url]: https://github.com/fedgut/Dog-care-services-API/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/fedgut/Dog-care-services-API.svg?style=flat-square
[forks-url]: https://github.com/fedgut/Dog-care-services-API/network/members
[stars-shield]: https://img.shields.io/github/stars/fedgut/Dog-care-services-API.svg?style=flat-square
[stars-url]: https://github.com/fedgut/Dog-care-services-API/stargazers
[issues-shield]: https://img.shields.io/github/issues/fedgut/Dog-care-services-API.svg?style=flat-square
[issues-url]: https://github.com/fedgut/Dog-care-services-API/issues
[product-screenshot]: /app/assets/images/exercises-index.png

repository: fedgut/Dog-care-services-API

repo_name: fedgut/Dog-care-services-API


text:
---
title: Picturesg
permalink: /research-resource/picturesg/
breadcrumb: PictureSG
---

PictureSG is a collection of pictures, be it photographs or artworks, which provide information about Singapore. It contains NLB’s own pictures, pictures donated to NLB by respective donors and others contributed by our partners.

Click [here](http://eresources.nlb.gov.sg/pictures/) or scan below to visit PictureSG.

![QR for PictureSG](/images/qr-picturesg.png)

repository: isomerpages/nlb-curiocity

branch_name: refs/heads/staging

gha_language: SCSS

repo_name: isomerpages/nlb-curiocity


text:
# Pseudomycena codoniceps (Cooke) Cejp, 1930 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Spisy Prirod. Karlovy Univ. 104: 146 (1930)

#### Original name
Agaricus codoniceps Cooke, 1888

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Mycenaceae/Mycena/Mycena codoniceps/ Syn. Pseudomycena codoniceps/README.md

repo_name: mdoering/backbone


text:
# Handcar

A Rack-based Ruby web framework.

> "Like Rails, if 'opinionated' meant 'non-functional.'"

I made this framework to follow along with Noah Gibb's lovely book [Rebuilding Rails](https://rebuilding-rails.com/). While I'm sure you could probably use it in production, don't.

## Getting Started

    $ gem build handcar.gemspec
    $ gem install handcar-0.0.5.gem
    $ handcar new my_app
    $ cd my_app
    $ bundle install
    $ handcar serve

## Features

* Rails-style MVC action.
* Integrates with SQLite.
* Provides a CLI utility to generate a new project.

## License

This code is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). It's very much derived from the [original project](https://github.com/noahgibbs/rulers), which is also available under the MIT license at the time of writing.

repository: jsrn/handcar

repo_name: jsrn/handcar


text:
## Kraken Bot

An open source bot for Discord.

## What does it do?

![Image](.github/poll.png)

This is an example of a poll that Kraken can make.

## How do I run it?

1. Make a discord bot in the discord developer portal
2. Create a file named, `tokenfile` and copy paste your bot token into it
3. Run `./run.sh`

## How do I use it?

Run k!help. It'll tell you everything there is to know about all of the commands.

[Yes.](https://gitlab.com/Vresod/KrakenBot)

repository: Vresod/KrakenBot

repo_name: Vresod/KrakenBot


text:
# Shapes Cython-C++ Examples

### Purpose
Simple examples for Cython C++ API from [Using C++ in Cython](http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html). The website doesn't illustrate the complete program. This leads to difficulty understanding the placement of information in files. The shapes example remedies those problems.

### Compilation
To compile code, change directory to folder containing setup.py and type the following at command prompt:
```
python setup.py build_ext --inplace
```

### Example
```
import rect
myRect = rect.PyRectangle(1,2,3,4)
myRect.getArea()
```

### Known Caveats (Subject to Change)

C++ functions external to any class **must** be included in separate .pyx file and wrapped in a pure Python function to be called from Python.


text:
# FuntastyKit

![Cocoapods](https://img.shields.io/cocoapods/v/FuntastyKit.svg)
![Cocoapods platforms](https://img.shields.io/cocoapods/p/FuntastyKit.svg)
![License](https://img.shields.io/cocoapods/l/FuntastyKit.svg)
![Continuous integration](https://img.shields.io/bitrise/b2201bef8986b898.svg?label=ci&token=55zmQOJfJyHGQ2nOwaQ23Q)

FuntastyKit iOS framework contains:

- MVVM-C architecture used at The Funtasty, the template for this architecture can be found at https://github.com/thefuntasty/MVVM-C-Template
- Service holder for code injection of services
- Some regularly used UIKit extensions
- Protocols for simple initialization from XIB files, storyboards and for handling keyboard
- Hairline constraint for one-pixel designs

## Installation

If you want to use CocoaPods for dependency management, add following line to your `Podfile`:

```ruby
pod 'FuntastyKit', '~> 1.4'
```

repository: angelcam/FuntastyKit

repo_name: angelcam/FuntastyKit


text:
Building Packages
===
## Prev: [Local Packages](2_local_packages.md), Next: [Image Generation](4_image_generation.md)
## Initial Dependency Information
Once the intermediate SPEC files are extracted (see [Creating SPECS](#2_local_packages.md#creating_specs)) the dependency information from them needs to be extracted. The `specreader` tool scans each SPEC file in the intermediate SPECs folder and uses `rpmspec -q` to list the dependencies for each package found in the SPEC file.

Each SPEC file will have one base package, and may have additional virtual packages. Each of these packages is recorded as a `Provides` entry, along with a version and release if set.

All packages from a SPEC file share the same build requirements (as builds occur at the granularity of a SPEC file), but may have different run-time requirements. For each package a list of `BuildRequires` enumerates all the packages which much be available before building the current package. A `Requires` list similarly enumerates all the packages which must be available to install the package.

For example, a very simple SPEC may be parsed to give:
```json
{
    "Provides": {
        "Name": "example",
        "Version": "1.0.0-1.cm1",
        "Condition": "=",
        "SVersion": "",
        "SCondition": ""
    },
    "SrpmPath": "build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm",
    "SourceDir": "build/INTERMEDIATE_SPECS/example-1.0.0-1.cm1",
    "SpecPath": "build/INTERMEDIATE_SPECS/example-1.0.0-1.cm1/example.spec",
    "Architecture": "x86_64",
    "Requires": [
        {
            "Name": "nano",
            "Version": "",
            "Condition": "",
            "SVersion": "",
            "SCondition": ""
        }
    ],
    "BuildRequires": null
},
{
    "Provides": {
        "Name": "example-devel",
        "Version": "1.0.0-1.cm1",
        "Condition": "=",
        "SVersion": "",
        "SCondition": ""
    },
    "SrpmPath": "build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm",
    "SourceDir": "build/INTERMEDIATE_SPECS/example-1.0.0-1.cm1",
    "SpecPath": "build/INTERMEDIATE_SPECS/example-1.0.0-1.cm1/example.spec",
    "Architecture": "x86_64",
    "Requires": null,
    "BuildRequires": null
}
```
The single SPEC provides the base package `example`, but also provides a virtual package `example-devel`. Both packages share the same input files and build requirements, and will be produced as a single atomic operation.

All package dependency information is written to `./../build/pkg_artifacts/specs.json`.

### Or Clauses
Spec files can have `(a or b)` style requirements. When the build system encounters such a requirement it will record both options into the graph so that all possible requirements will be made available to pick from during package install allowing for maximum flexibility. This means that the build system requires all optional RPMs to be available to build/download even if they will not be used for a specific configuration.

#### Warning:
The build system will print a warning (`'OR' clause found (...), please refer to 'docs/how_it_works/3_package_building.md#or-clauses' for explanation of limitations.`) when it encounters an `or` clause. If be build fails make sure all conditional packages are available locally/online, or remove the unavailable conditional packages from the SPEC file.

## Dependency Graphing

A critical component of package building is ensuring that the packages are built in such a way that:
1) no package build is started before its build dependencies are available
2) no package is used as a dependency before its run-time requirements are satisfied

### Types of Nodes
The graph contains several types of nodes, with various states. As the graph is processed by each tool nodes are updated, pruned, or added as needed.
#### TypeBuild
> This represents a local package which may be passed to the build worker to generate an RPM from.
> It can be either:
>
> `StateBuild`: Should be built
>
> `StateUpToDate`: Package is already available locally

#### TypeRun
> This node represents a package which is may be installed or used as a dependency.
> Run nodes are always:
>
> `StateMeta`: Organizational node used to impose ordering on other nodes

#### TypeGoal
> Special node which is used to group packages together. If the goal node is satisfied then all the packages which are part of the goal are available to install.
> Goal nodes are always:
>
> `StateMeta`: Organizational node used to impose ordering on other nodes

#### TypeRemote
> This node represents a package which is unknown to the local build system, but has been requested as a dependency. It will need to be resolved from a remote source. `TypeRemote` nodes are considered equivalent to `TypeRun` nodes in most cases.
> Remote nodes may be either:
>
> `StateUnresolved`: No known source has been found yet
>
> `StateCached`: A remote source was found and the package should now be available locally.

#### TypePureMeta
> This is a purely organizational node with no special meaning. Used to do things like resolve intra-package cycles which would normally break the dependency graph.
> PureMeta nodes are always:
>
> `StateMeta`: Organizational node used to impose ordering on other nodes

### File Format
The graphs are exported as `graphviz` `dot` formatted files. These files are exported in such a way as to offer enough human readable information to help debugging.

The files can be ingested into the `graphviz` tools to visualize them, although the graphs of a large build are often impractically large.
```bash
# Visualize the file 'graph.dot' using the basic dot tool
dot -Tpng -o visualized.png < graph.dot
```

### Stage 1: Grapher

The `grapher` tool reads the `specs.json` file and converts it into an acyclic directed graph. Inter-package dependencies are represented by directed edges in the graph.

The `grapher` tool outputs `./../build/pkg_artifacts/graph.dot`

#### Graph Generation

Each `provides` entry in `specs.json` is converted to two vertices in the graph, a `build` node and a `run` node. Each node represents exactly one package (with specific version if available). Two packages cannot both provide a node with the same name and version (same name with different versions is fine).

Edges in the graph represent dependencies. A package cannot be installed (`run`) until it has been compiled (`build`). An edge is automatically added from the `run` node to the `build` node of each package to represent this dependency.

Once all packages have been added to the graph, the inter-package dependencies are added. For each `BuildRequires` in a package an edge is created from the current `build` node to the `run` node associated with the required package. The same is done for each `Requires`, but from the current `run` node instead of the `build` node.

#### Package Lookup
A critical part of adding edges is finding the correct node to connect to. Package dependencies can specify their requirements with varying levels of detail. The most basic dependency is just a package name. The dependency can be further refined by setting a limit on the version (`Requires: example >= 1.0.0`), or double conditionals (`Requires: example >= 1.0.0`, `Requires: example < 2.0.0 `). A dependency can also require a specific version (`Requires: example = 1.0.0`)

The `grapher` program will try to find the best matching package it knows about to satisfy dependencies. To assist with this a set of sorted lookup lists are maintained for each package, storing every version encountered so far. The highest version package which satisfies the requirements is selected. If no node in the lookup list satisfies the version requirements an unresolved node is added to the graph.

##### Version Compare
Versions are split into two components: the version and the release number. Generally packages do not specify a specific release number in their requirements, so the release is not considered unless both versions under comparison explicitly contain one.

Versions are stored internally as intervals with maximum and minimum supported versions (versions must be a single range, ex. `ver < 3, ver > 4` is not supported). Each interval records an upper and lower bound. Those bounds may be inclusive or exclusive depending on the version comparison operator (`<, <=, =, >=, >`)

#### Cycle Resolving
In general cycles in the dependency graph are considered an unrecoverable error, but there are special cases where they can be fixed. Some packages create cycles with their own virtual packages which are not an issue. Since all the packages from a given SPEC file build at the same time the fact they rely on each other is not a problem.

To solve this a `TypePureMeta` node is inserted which consolidates all the dependencies of the cycle nodes into a single node. The nodes in the cycle are then disconnected from each other and instead depend on the new meta node. This only works if all the nodes in the cycle are from the same SPEC file, and the dependencies are all run-time dependencies.

In the example below nodes `A-a` and `A-b` are from the same spec file and require each other. Since they are part of the same package this cycle can be fixed. A meta node (`ID=8`) is added which consolidates all the requirements. Notice that `A-a` required `B`, while `A-b` required `C`. Now the meta node requires both `B` and `C` and the two `A` packages require the meta node instead.

![Cycle Before](images/cycle_before.png)
![Cycle Before](images/cycle_after.png)

#### Default Goal Node
The `grapher` tool automatically adds an "ALL" goal node to the graph which links to every node. Building this node will case every known package to be built.

### Stage 2: Graphoptimizer
The `grapher` tool makes no attempt to avoid rebuilds of up-to-date or unneeded packages. The `graphoptimizer` tool takes a pair of arguments which are used to narrow the focus of the build: `--packages` and `--image-config-file`.

The `graphoptimizer` tool outputs `./../build/pkg_artifacts/scrubbed_graph.dot`

##### `--packages`
This is a space separated list of package names which should be built. The build system will make sure these packages, and all runtime dependencies for them, are built. Normally blank, this can be set via the `Make` argument `PACKAGE_BUILD_LIST=` at build time.

##### `--image-config-file`
The `graphoptimizer` tool will parse the currently selected config file to determine what packages are needed to compose the image. It will only build the subset of packages needed for the image. This is set with `CONFIG_FILE=` at build time.

#### Trimming
Depending on which packages have been selected for building only some parts of the full graph are needed. The `graphoptimizer` tool adds a `TypeGoal` node to the graph which depends on all the high level packages it has been asked to make available. It then creates a sub-graph rooted at that goal node and continues processing the sub-graph.

#### Marking as Up-To-Date
A node which is `TypeBuild`/`StateBuild` will be marked as `StateUpToDate` if `graphoptimizer` is able to find all the expected output packages with the correct version numbers. `Graphoptimizer` WILL NOT trigger rebuilds due to changes in the timestamps of SPEC files and packages. If a package must be rebuilt its base package name (name of SPEC file) should be passed via the variable `PACKAGE_REBUILD_LIST=`. This will cause `graphoptimizer` to never mark the packages as up-to-date.

`Graphoptimizer` is also able to detect changes in dependencies which should trigger a rebuild of other packages. For example if package `A` depends on package `B`, and package `B` is rebuilt, then package `A` will also be marked for rebuild.

Sometimes packages fail to build correctly, or are otherwise not suitable for building in the build system. `Graphoptimizer` would normally complain that they are missing, possibly causing undesired rebuilds. The `PACKAGE_IGNORE_LIST=` variable can be used to set the `--ignore-packages` argument which instructs `graphoptimizer` to never worry about the listed packages (again using the package base name).

### Stage 3: Graphpkgfetcher
The `graphpkgfetcher` tool's job is to resolve unresolved remote nodes. Unresolved nodes occur when a local package has `Requires` or `BuildRequires` which are not available from another local package.

The tool uses the `worker_chroot` (see [Chroot Worker](1_initial_prep.md#chroot_worker)) to locate packages. The worker will search in six locations: 1) the local chroot environment, 2) already build RPMs in `./../out/RPMS/`, 3) the upstream base repository 4) the upstream update repository if `$(USE_UPDATE_REPO)` is set to `y` 5) the upstream preview repository if `$(USE_PREVIEW_REPO)` is set to `y` 6) any remote repo listed in `REPO_LIST ?=`. If `$(DISABLE_UPSTREAM_REPOS)` is set to `y`, any repo that is accessed through the network is disabled.

The worker will run the `tdnf` command to search for each missing package. `tdnf` will prioritize local packages over pulling them from a remote location.

The worker is able to access the local packages through a mounted overlay in the chroot environment, and output newly cached RPMs through another writable mount. For `tdnf` to read the local packages the folder must be converted into a repository, but since it is mounted as an overlay the changes are not persisted out of the chroot.

Once the packages are cached they are copied into `./../out/RPMs` for use in further stages of the build and any satisfied nodes are marked as `StateCached`.

The `graphpkgfetcher` tool outputs `./../build/pkg_artifacts/cached_graph.dot`

### Stage 4: Unravel
The `unravel` tool's job is to convert the dependency graph into something which can be consumed by a build system to successfully build the requested packages.

`Unravel` implements a modular setup which can output different formats. The most basic format is a simple topologically sorted list of packages which can be build sequentially. Only `TypeBuild` nodes need to be printed as all other node types are simply to enforce ordering in the grpah.

The more useful system, and what is used in further steps by the build system, is a recursive `Makefile`. Since the build system is already using `Make` it is reasonably straight forward to make recursive calls into `Make`, and use its own build ordering algorithms.

The `unravel` tool outputs `./../build/pkg_artifacts/workplan.mk`

#### Workplan Makefile
`Unravel` creates a workplan which encodes both the ordering information and the build instructions for each package to be built. It creates a `.PHONY` target and recipe for every node in the graph. Many of these recipes are empty (i.e. `GOAL_PackagesToBuild: ;`), but any `TypeBuild` node with `StateBuild` will be given an actual build command invoking the `pkgworker` tool. The dependencies between nodes are encoded as dependencies between targets.

A very simple workplan might look like:
```makefile
.PHONY: GOAL_PackagesToBuild
GOAL_PackagesToBuild: ;
GOAL_PackagesToBuild:  RUN_0_./../build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm_example

.PHONY: RUN_0_./../build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm_example
RUN_0_/home/damcilva/repos/demo/build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm_example: ;
RUN_0_/home/damcilva/repos/demo/build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm_example:  BUILD_./../build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm

.PHONY: BUILD_./../build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm
BUILD_./../build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm:
	MAKEFLAGS= $(go-pkgworker) --input=./../build/INTERMEDIATE_SRPMS/x86_64/example-1.0.0-1.cm1.src.rpm --work-dir=$(CHROOT_DIR) ... >> $(LOGS_DIR)/pkggen/failures.txt
```

The entry point is `GOAL_PackagesToBuild`, which depends on the run node for the desired package (since run nodes indicate a package can be installed). Each run node will list its dependencies.

In this case the example package has no other dependencies, so it only depends on its own build node. That build node invokes the `pkgworker` tool to actually build the `*.rpm` file.

### Stage 5: Pkgworker
The `pkgworker` tool is not invoked directly by the build system, instead it is invoked from a recursive `Make` call to the dynamically generated `workplan.mk` file.

`Pkgworker` uses the `worker_chroot` (see [Chroot Worker](1_initial_prep.md#chroot_worker)) environment to build each package independently. First it creates an empty folder to build in (one for each package to build) and extracts the chroot archive into it. This preps the environment with all the toolchain packages which were made available during the prep stage (see [Toolchain](1_initial_prep.md#toolchain)). It then mounts the local RPM folder into the environment so the worker can access any build dependencies it has. Using `tdnf` and `rpmbuild` the worker installs the build dependencies from the local packages, then builds the require package. Once the build is complete the freshly build pacakge is placed into the `./../out/RPMS/` folder to be available to future workers.

Because the dependency information has been encoded in `workplan.mk` it is possible to build multiple pacakges in parallel. `Make` will guarantee that no package is built before its `BuildRequires` are all satisfied as encoded in the graph.

## Prev: [Initial Prep](2_local_packages.md), Next: [Image Generation](4_image_generation.md)

repository: CBL-Mariner-Bot/CBL-Mariner

repo_name: CBL-Mariner-Bot/CBL-Mariner


text:
---
title:  "Multispecies Interactions Spatio-Temporal (MIST) model now public"
excerpt: "MIST model now public"
layout: default
---

I have two updates to regarding FishStats:

1.  A new R package for a Multispecies Interactions Spatio-temporal (MIST) model is now public at www.FishStats.org, and is described in Thorson Munch Swain (2017) Ecology, abstract [here](http://onlinelibrary.wiley.com/doi/10.1002/ecy.1760/abstract?campaign=wolacceptedarticle).  This biomass-dynamic model allows estimates of (1) local asymmetric impacts of each species on per-capita productivity of other species, (2) symmetric covariance to shared environmental drivers, and (3) fishing impacts using spatial harvest information. It has identical input/output, plotting, and Rmarkdown tutorial as other FishStats packages.

2.  The first FishStats training workshop is next week.  We have a full room, but people can attend remotely using details below.  Please contact Sarah Stein with any connection questions.  I'll post recordings of the workshop and presentation slides later this month.

Webinar Information:

To officially register for the webinar, please follow the webex links below for each day's workshop registration. Upon completing the online form for each day, you will receive a confirmation email with additional information including operating system requirements. The daily schedule is 8:30am - 4:30pm Pacific Time Wednesday, Feb. 8th through Friday, Feb. 10th.
NMFS OCIO invites you to attend a Web seminar using WebEx. This event requires registration.

Day 1:

Topic: AFSC Training Workshop

Host: NMFS OCIO

Date and Time:
Wednesday, February 8, 2017 11:00 am, Eastern Standard Time (New York, GMT-05:00)

-------------------------------------------------------
To register for the online event
-------------------------------------------------------
1. Go to https://noaaevents2.webex.com/noaaevents2/onstage/g.php?MTID=e2e5d9b203b660ef59f8f53b1219f1e41
2. Click "Register".
3. On the registration form, enter your information and then click "Submit".

Day 2:

Topic: AFSC Training Workshop (Day 2)
Host: NMFS OCIO
Date and Time:
Thursday, February 9, 2017 11:00 am, Eastern Standard Time (New York, GMT-05:00)
-------------------------------------------------------
To register for the online event
-------------------------------------------------------
1. Go to https://noaaevents2.webex.com/noaaevents2/onstage/g.php?MTID=e3e750409c9c3aa7eb4e1d0f5d4098eb2
2. Click "Register".
3. On the registration form, enter your information and then click "Submit".

Day 3

Topic: AFSC Training Workshop (Day 3)
Host: NMFS OCIO
Date and Time:
Friday, February 10, 2017 11:00 am, Eastern Standard Time (New York, GMT-05:00)

-------------------------------------------------------
To register for the online event
-------------------------------------------------------
1. Go to https://noaaevents2.webex.com/noaaevents2/onstage/g.php?MTID=ef414c4c68d644d3738cb8e1f2ddfd916
2. Click "Register".
3. On the registration form, enter your information and then click "Submit".

Once the host approves your registration, you will receive a confirmation email message with instructions on how to join the event.

-------------------------------------------------------
For assistance
-------------------------------------------------------
You can contact NMFS OCIO at:
<EMAIL_ADDRESS>


text:
[![Build Status](https://travis-ci.org/marnen/pivotal-tracker-pr-hook.svg?branch=master)](https://travis-ci.org/marnen/pivotal-tracker-pr-hook)

# pivotal-tracker-pr-hook

This is a GitHub webhook that will make story comments on Pivotal Tracker when pull requests are opened (or reopened) on GitHub.

## Installation

1. Clone this repository (it's a [Sinatra](http://www.sinatrarb.com) application).
2. Host it somewhere. [Heroku](http://www.heroku.com) should be fine.
3. Set it up as a GitHub [webhook](https://developer.github.com/webhooks/creating/), with the URL of http://[my-awesome-webhost.com]/hook. Set "pull request" as the event type. Enter a random string in the "secret" field.
4. On the server, set the following environment variables:
  * `PIVOTAL_TRACKER_API_TOKEN`: your Pivotal Tracker API token.
  * `SECRET_TOKEN`: the random string you entered in the "secret" field in step 3.

## Usage

Open a pull request on GitHub with a Pivotal Tracker story number in the title, and a comment will get created on the appropriate Pivotal Tracker story.

The syntax expected is the same as for the [Pivotal Tracker commit hook][commit_hook]: the commit message has to include `[#123456]` somewhere (where `123456` is the story ID). Multiple story IDs are allowed in one pull request; see the [commit hook documentation][commit_hook] for more details.

[commit_hook]: https://www.pivotaltracker.com/help/api?version=v5#Tracker_Updates_in_SCM_Post_Commit_Hooks

repository: marnen/pivotal-tracker-pr-hook

gha_language: Ruby

repo_name: marnen/pivotal-tracker-pr-hook


text:
# Amauroderma brasiliense (Singer) Ryvarden, 2004 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Syn. Fung. (Oslo) 19: 44 (2004)

#### Original name
Scutiger brasiliensis Singer, 1983

### Remarks
null


text:
# Virtual Assistant

Virtual Assistant is build using following open source components.

- Angular Ui - To build, train and deploy a chat bot project
- Python API gateway - connecting to rasa for deploying and persisting training data
- Mongodb - for storing training data and editing training data

### Using Rasa

We use rasa 1.0 (combined repo for nlu + core) as a ML framework to train and deploy chat bots.
We would keep updating the code base to support latest versions of rasa.

We intent to support all features provided by rasa framework, in case you find any feature missing please report to us.

## 1. Installation
   Installation instructions [click here](installation/Readme.md)

## 2. Usage
   Usage instructions : [click here](usage/Readme.md)

repository: navigateconsulting/virtual-assistant

gha_language: TypeScript

repo_name: navigateconsulting/virtual-assistant


text:
---
id: createApi
title: createApi
sidebar_label: createApi
hide_title: true
---

# `createApi`

The main point where you will define a service to use in your application.

## Parameters

`createApi` accepts a single configuration object parameter with the following options:

```ts no-transpile
  baseQuery(args: InternalQueryArgs, api: QueryApi): any;
  endpoints(build: EndpointBuilder<InternalQueryArgs, EntityTypes>): Definitions;
  entityTypes?: readonly EntityTypes[];
  reducerPath?: ReducerPath;
  serializeQueryArgs?: SerializeQueryArgs<InternalQueryArgs>;
  keepUnusedDataFor?: number; // value is in seconds
  refetchOnMountOrArgChange?: boolean | number; // value is in seconds
  refetchOnFocus?: boolean;
  refetchOnReconnect?: boolean;
```

### `baseQuery`

```ts title="Simulating axios-like interceptors with a custom base query"
const baseQuery = fetchBaseQuery({ baseUrl: '/' });

function baseQueryWithReauth(arg, api) {
  let result = baseQuery(arg, api);
  if (result.error && result.error.status === '401') {
    // try to get a new token
    const refreshResult = baseQuery('/refreshToken');
    if (refreshResult.data) {
      // store the new token
      dispatch(setToken(refreshResult.data));
      // retry the initial query
      result = baseQuery(arg, api);
    } else {
      dispatch(loggedOut());
    }
  }
  return result;
}
```

### `entityTypes`

Specifying entity types is optional, but you should define them so that they can be used for caching and invalidation. When defining an entity type, you will be able to add them with `provides` and [invalidate](../concepts/mutations#advanced-mutations-with-revalidation) them with `invalidates` when configuring [endpoints](#endpoints).

### `reducerPath`

The `reducerPath` is a _unique_ key that your service will be mounted to in your store. If you call `createApi` more than once in your application, you will need to provide a unique value each time. Defaults to `api`.

```js title="apis.js"
import { createApi, fetchBaseQuery } from '@rtk-incubator/rtk-query';

const apiOne = createApi({
  reducerPath: 'apiOne',
  baseQuery: fetchBaseQuery('/'),
  endpoints: (builder) => ({
    // ...endpoints
  }),
});

const apiTwo = createApi({
  reducerPath: 'apiTwo',
  baseQuery: fetchBaseQuery('/'),
  endpoints: (builder) => ({
    // ...endpoints
  }),
});
```

### `serializeQueryArgs`

Accepts a custom function if you have a need to change the creation of cache keys for any reason. Defaults to:

```ts no-compile
export const defaultSerializeQueryArgs: SerializeQueryArgs<any> = ({ endpoint, queryArgs }) => {
  // Sort the object keys before stringifying, to prevent useQuery({ a: 1, b: 2 }) having a different cache key than  useQuery({ b: 2, a: 1 })
  return `${endpoint}(${JSON.stringify(queryArgs, Object.keys(queryArgs || {}).sort())})`;
};
```

### `endpoints`

Endpoints are just a set of operations that you want to perform against your server. You define them as an object using the builder syntax. There are two basic endpoint types: [`query`](../concepts/queries) and [`mutation`](../concepts/mutations).

#### Anatomy of an endpoint

- `query` _(required)_
  - `query` is the only required property, and can be either a `string` or an `object` that is passed to your `baseQuery`. If you are using [fetchBaseQuery](./fetchBaseQuery), this can be a `string` or an object of properties in `FetchArgs`. If you use your own custom `baseQuery`, you can customize this behavior to your liking
- `transformResponse` _(optional)_

  - A function to manipulate the data returned by a query or mutation
  - ```js title="Unpack a deeply nested collection"
    transformResponse: (response) => response.some.nested.collection;
    ```
    ```js title="Normalize the response data"
    transformResponse: (response) =>
      response.reduce((acc, curr) => {
        acc[curr.id] = curr;
        return acc;
      }, {});
    ```

- `provides` _(optional)_
  - Used by `queries` to provide entities to the cache
  - Expects an array of entity type strings, or an array of objects of entity types with ids.
    1.  `['Post']` - equivalent to 2
    2.  `[{ type: 'Post' }]` - equivalent to 1
    3.  `[{ type: 'Post', id: 1 }]`
- `invalidates` _(optional)_

  - Used by `mutations` for [cache invalidation](../concepts/mutations#advanced-mutations-with-revalidation) purposes.
  - Expects the same shapes as `provides`

- `onStart`, `onError` and `onSuccess` _(optional)_ - Available to both [queries](../concepts/queries) and [mutations](../concepts/mutations)
  - Can be used in `mutations` for [optimistic updates](../concepts/optimistic-updates).
  - ```ts title="Mutation lifecycle signatures"
    function onStart(arg: QueryArg, mutationApi: MutationApi<ReducerPath, Context>): void;
    function onError(arg: QueryArg, mutationApi: MutationApi<ReducerPath, Context>, error: unknown): void;
    function onSuccess(arg: QueryArg, mutationApi: MutationApi<ReducerPath, Context>, result: ResultType): void;
    ```
  - ```ts title="Query lifecycle signatures"
    function onStart(arg: QueryArg, queryApi: QueryApi<ReducerPath, Context>): void;
    function onError(arg: QueryArg, queryApi: QueryApi<ReducerPath, Context>, error: unknown): void;
    function onSuccess(arg: QueryArg, queryApi: QueryApi<ReducerPath, Context>, result: ResultType): void;
    ```

#### How endpoints get used

When defining a key like `getPosts` as shown below, it's important to know that this name will become exportable from `api` and be able to referenced under `api.endpoints.getPosts.useQuery()`, `api.endpoints.getPosts.initiate()` and `api.endpoints.getPosts.select()`. The same thing applies to `mutation`s but they reference `useMutation` instead of `useQuery`.

```ts
const api = createApi({
  baseQuery: fetchBaseQuery('/'),
  endpoints: (build) => ({
    getPosts: build.query<PostsResponse, void>({
      query: () => 'posts',
      provides: (result) => result.map(({ id }) => ({ type: 'Posts', id })),
    }),
    addPost: build.mutation<Post, Partial<Post>>({
      query: (body) => ({
        url: `posts`,
        method: 'POST',
        body,
      }),
      invalidates: ['Posts'],
    }),
  }),
});

// Auto-generated hooks
export { useGetPostsQuery, useAddPostMutation } = api;

// Possible exports
export const { endpoints, reducerPath, reducer, middleware } = api;
// reducerPath, reducer, middleware are only used in store configuration
// endpoints will have:
// endpoints.getPosts.initiate(), endpoints.getPosts.select(), endpoints.getPosts.useQuery()
// endpoints.addPost.initiate(), endpoints.addPost.select(), endpoints.addPost.useMutation()
// see `createApi` overview for _all exports_
```

#### Transforming the data returned by an endpoint before caching

In some cases, you may want to manipulate the data returned from a query before you put it in the cache. In this instance, you can take advantage of `transformResponse`.

By default, the payload from the server is returned directly.

```ts
function defaultTransformResponse(baseQueryReturnValue: unknown) {
  return baseQueryReturnValue;
}
```

To change it, provide a function that looks like:

```ts
transformResponse: (response) => response.some.deeply.nested.property;
```

```ts title="GraphQL transformation example"
export const api = createApi({
  baseQuery: graphqlBaseQuery({
    baseUrl: '/graphql',
  }),
  endpoints: (builder) => ({
    getPosts: builder.query({
      query: () => ({
        body: gql`
          query {
            posts {
              data {
                id
                title
              }
            }
          }
        `,
      }),
      transformResponse: (response) => response.posts.data,
    }),
  }),
});
```

### `keepUnusedDataFor`

Defaults to `60` _(this value is in seconds)_. This is how long RTK Query will keep your data cached for **after** the last component unsubscribes. For example, if you query an endpoint, then unmount the component, then mount another component that makes the same request within the given time frame, the most recent value will be served from the cache.

### `refetchOnMountOrArgChange`

Defaults to `false`. This setting allows you to control whether RTK Query will only serve a cached result, or if it should `refetch` when set to `true` or if an adequate amount of time has passed since the last successful query result.

- `false` - Will not cause a query to be performed _unless_ it does not exist yet.
- `true` - Will always refetch when a new subscriber to a query is added. Behaves the same as calling the `refetch` callback or passing `forceRefetch: true` in the action creator.
- `number` - **Value is in seconds**. If a number is provided and there is an existing query in the cache, it will compare the current time vs the last fulfilled timestamp, and only refetch if enough time has elapsed.

If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.

:::note
You can set this globally in `createApi`, but you can also override the default value and have more granular control by passing `refetchOnMountOrArgChange` to each individual hook call or when dispatching the [`initiate`](#initiate) action.
:::

### `refetchOnFocus`

Defaults to `false`. This setting allows you to control whether RTK Query will try to refetch all subscribed queries after the application window regains focus.

If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.

:::note
You can set this globally in `createApi`, but you can also override the default value and have more granular control by passing `refetchOnFocus` to each individual hook call or when dispatching the [`initiate`](#initiate) action.

If you specify `track: false` when manually dispatching queries, RTK Query will not be able to automatically refetch for you.
:::

### `refetchOnReconnect`

Defaults to `false`. This setting allows you to control whether RTK Query will try to refetch all subscribed queries after regaining a network connection.

If you specify this option alongside `skip: true`, this **will not be evaluated** until `skip` is false.

:::note
You can set this globally in `createApi`, but you can also override the default value and have more granular control by passing `refetchOnReconnect` to each individual hook call or when dispatching the [`initiate`](#initiate) action.

If you specify `track: false` when manually dispatching queries, RTK Query will not be able to automatically refetch for you.
:::

## Return value

- [`reducerPath`](#reducerpath)
- [`reducer`](#reducer)
- [`middleware`](#middleware)
- [`endpoints`](#endpoints-returned-by-createapi)
  - **[endpointName]**
    - [`initiate`](#initiate)
    - [`select`](#select)
    - [`useQuery or useMutation`](#hooks)
- [`internalActions`](#internalactions)
- [`util`](#util)
- [`injectEndpoints`](#injectendpoints)
- [`enhanceEndpoints`](#enhanceendpoints)
- [`usePrefetch`](../concepts/prefetching#prefetching-with-react-hooks)
- [`Auto-generated hooks`](#auto-generated-hooks)

```ts title="All returned properties"
const api = createApi({
  baseQuery: fetchBaseQuery('/'),
  endpoints: (builder) => ({
    // ...
  }),
});

export const {
  reducerPath,
  reducer,
  middleware,
  endpoints,
  internalActions,
  util,
  injectEndpoints,
  usePrefetch,
  ...generatedHooks
} = api;
```

#### middleware

This is a standard redux middleware and is responsible for things like [polling](../concepts/polling), [garbage collection](#keepunuseddatafor) and a handful of other things. Make sure it's [included in your store](../introduction/getting-started#add-the-service-to-your-store).

#### reducer

A standard redux reducer that enables core functionality. Make sure it's [included in your store](../introduction/getting-started#add-the-service-to-your-store).

### `endpoints` returned by `createApi`

#### initiate

React Hooks users will most likely never need to use these in most cases. These are redux action creators that you can `dispatch` with `useDispatch` or `store.dispatch()`.

:::note Usage of actions outside of React Hooks
When dispatching an action creator, you're responsible for storing a reference to the promise it returns in the event that you want to update that specific subscription. Also, you have to manually unsubscribe once your component unmounts. To get an idea of what that entails, see the [Svelte Example](../examples/svelte) or the [React Class Components Example](../examples/react-class-components)
:::

#### select

`select` is how you access your `query` or `mutation` data from the cache. If you're using Hooks, you don't have to worry about this in most cases. There are several ways to use them:

```js title="React Hooks"
const { data, status } = useSelector(api.getPosts.select());
```

```js title="Using connect from react-redux"
const mapStateToProps = (state) => ({
  data: api.getPosts.select()(state),
});
connect(null, mapStateToProps);
```

```js title="Svelte"
$: ({ data, status } = api.getPosts.select()($store));
```

#### hooks

Hooks are specifically for React Hooks users. Under each `api.endpoint.[endpointName]`, you will have `useQuery` or `useMutation` depending on the type. For example, if you had `getPosts` and `updatePost`, these options would be available:

```ts title="Hooks usage"
const { data } = api.endpoints.getPosts.useQuery();
const { data } = api.endpoints.updatePost.useMutation();

const { data } = api.useGetPostsQuery();
const [updatePost] = api.useUpdatePostMutation();
```

#### action matchers

These are action matchers for each endpoint to allow you matching on redux actions for that endpoint - for example in slice `extraReducers` or a custom middleware. Those are implemented as follows:

```ts
 matchPending: isAllOf(isPending(thunk), matchesEndpoint(endpoint)),
 matchFulfilled: isAllOf(isFulfilled(thunk), matchesEndpoint(endpoint)),
 matchRejected: isAllOf(isRejected(thunk), matchesEndpoint(endpoint)),
```

### Auto-generated Hooks

React users are able to take advantage of auto-generated hooks. By default, `createApi` will automatically generate type-safe hooks (TS 4.1+ only) for you based on the name of your endpoints. The general format is `use(Endpointname)(Query|Mutation)` - `use` is prefixed, the first letter of your endpoint name is capitalized, then `Query` or `Mutation` is appended depending on the type.

```js title="Auto-generated hooks example"
const api = createApi({
  baseQuery,
  endpoints: (build) => ({
    getPosts: build.query({
      query: () => 'posts',
    }),
    addPost: build.mutation({
      query: (body) => ({
        url: `posts`,
        method: 'POST',
        body,
      }),
    }),
  }),
});

// Automatically generated from the endpoint names
export { useGetPostsQuery, useAddPostMutation } = api;
```

### `internalActions`

:::danger
These may change at any given time and are not part of the public API for now
:::

- `updateSubscriptionOptions: ActionCreatorWithPayload<{ endpoint: string; requestId: string; options: SubscriptionOptions; queryCacheKey: QueryCacheKey }, string>;`
- `queryResultPatched: ActionCreatorWithPayload<{ queryCacheKey: QueryCacheKey, patches: Patch[]; }, string>`
- `removeQueryResult: ActionCreatorWithPayload<{ queryCacheKey: QueryCacheKey }, string>`
- `unsubscribeQueryResult: ActionCreatorWithPayload<{ queryCacheKey: QueryCacheKey, requestId: string }, string>`,
- `unsubscribeMutationResult: ActionCreatorWithPayload<MutationSubstateIdentifier, string>`,

### `util`

- **prefetchThunk** - used for [prefetching](../concepts/prefetching).
- **patchQueryResult** - used for [optimistic updates](../concepts/optimistic-updates).
- **updateQueryResult** - used for [optimistic updates](../concepts/optimistic-updates).

### `injectEndpoints`

See [Code Splitting](../concepts/code-splitting)

### `enhanceEndpoints`

See [Code Generation](../concepts/code-generation)

repository: Shrugsy/rtk-query

repo_name: Shrugsy/rtk-query


text:
---
name: Question template
about: Question regarding assignment x
title: ''
labels: ''
assignees: ''

---

I have a question regarding the following equation
<img src="https://render.githubusercontent.com/render/math?math=\large e^{i \pi} = -1">
I have a question regarding the following MATLAB code
```MATLAB
disp("Hello, world!")
```
I have a question regarding the following Python code
```Python
print("Hello, world!")
```


text:
# Assignment: Conditional Probability

## Objectives

- Conditional Probability
- Bayes formula

_______________________________________

## Questions & Answers

### 1. Stock prices

A simplified model for the movement of the price of a stock supposes that on each day the stock’s price either moves up 1 unit with probability `p` or moves down 1 unit with probability `1 − p`. The changes on different days are assumed to be independent.

(a) What is the probability that after 2 days the stock will be at its original price?

(b) What is the probability that after 3 days the stock’s price will have increased by 1 unit?

(c) Given that after 3 days the stock’s price has increased by 1 unit, what is the probability that it went up on the first day?

   Getting a new job

A worker has asked her supervisor for a letter of recommendation for a new job. She estimates that there is an 80 percent chance that she will get the job if she receives a strong recommendation, a 40 percent chance if she receives a moderately good recommendation, and a 10 percent chance if she receives a weak recommendation. She further estimates that the probabilities that the recommendation will be strong, moderate, and weak are .7, .2, and .1, respectively.

(a) How certain is she that she will receive the new job offer?

(b) Given that she does receives the offer, how likely should she feel that she received a strong recommendation? a moderate recommendation? a weak recommendation?

(c) Given that she does not receive the job offer, how likely should she feel that she received a strong recommendation? a moderate recommendation? a weak recommendation?

   Medical study and some code

A medical study is looking at a test to detect disease that impacts 1 individual in 10. The data collected has shown that
- when a patient has the disease, the test is positive in 90% of the cases
- when a patient does not have the disease, the test is positive in 1% of the cases.

If the test is positive, what is the probability that the patient as that disease?
What if it is a rare disease, that impacts 1 in 10 000 individuals?

Extra credit: How about if the test is negative?

  YOUR ANSWER:

  YOUR EXPLANATION:

  YOUR CODE:

  ```python
  def positive_test(TP, FP, perc_population):
      '''
      parameters
      ----------
      TP: true positive
          percentage of tests that were positive
          for the sample of subjects that had the disease
      FP: false positive
          percentage of tests that were positive
          for the control population (disease-free subjects)

      percent_population: percentage of the population that has the disease

      returns
      -------
      probability of having the disease for a person with a positive test result
      '''
      pass
  ```

_______________________________________
## Extra resources

- [conditional probability](../resources/conditional_probability_lecture.pdf)