text:
---
layout: page
title: Lean Prover Zulip Chat Archive
permalink: archive/113489newmembers/91335Commutativityofmultiplicationininductivetype.html
---

## [new members](index.html)
### [Commutativity of multiplication in inductive type](91335Commutativityofmultiplicationininductivetype.html)

#### [Carlesso Diego (Jan 05 2019 at 15:24)](https://leanprover.zulipchat.com/#narrow/stream/113489-new%20members/topic/Commutativity%20of%20multiplication%20in%20inductive%20type/near/154475123):
Hi! As it is suggested in exercise n1 chapter 7 of "theorem Proving in Lean" I'm trying to define some operations(such as multiplication, predecessor etc.) with the inductive type and then prove some theorem about them as they did with addition. I'm struggling at the moment with trying to prove commutativity of multiplication, in the following code my problems start at the proper comment "HERE".

```lean
namespace hidden

inductive nat : Type
| zero : nat
| succ : nat → nat
namespace nat

instance : has_zero nat := has_zero.mk zero
instance : has_one nat := has_one.mk (succ zero)

-- addition
def add (m n : nat) : nat :=
nat.rec_on n m (λ (n add_m_n: nat ), succ add_m_n)

instance : has_add nat := has_add.mk add

-- properties add
theorem add_zero (m : nat) : m + 0  = m := rfl

theorem add_succ (m n : nat) : m + succ n = succ (m + n) := rfl

theorem zero_add (n : nat) : 0 + n = n :=
nat.rec_on n
  (show 0 + zero = 0, from rfl)
  (assume n,
    assume ih : 0 + n = n,
    show 0 + succ n = succ n, from
      calc
        0 + succ n = succ (0 + n) : rfl
          ... = succ n : by rw ih)

theorem add_assoc (m n k : nat) : m + n + k = m + (n + k) :=
nat.rec_on k
  (show m + n + 0 = m + (n + 0), from rfl)
  (assume k,
    assume ih : m + n + k = m + (n + k),
    show m + n + succ k = m + (n + succ k), from
      calc
        m + n + succ k = succ (m + n + k) : rfl
          ... = succ (m + (n + k)) : by rw ih
          ... = m + succ (n + k) : rfl
          ... = m + (n + succ k) : rfl)

theorem succ_add (m n : nat) : succ m + n = succ (m + n) :=
nat.rec_on n
  (show succ m + 0 = succ (m + 0), from rfl)
  (assume n,
    assume ih : succ m + n = succ (m + n),
    show succ m + succ n = succ (m + succ n), from
      calc
        succ m + succ n = succ (succ m + n) : rfl
          ... = succ (succ (m + n)) : by rw ih
          ... = succ (m + succ n) : rfl)

theorem add_comm (m n : nat) : m + n = n + m :=
nat.rec_on n
  (show m + 0 = 0 + m, by rw [nat.zero_add, nat.add_zero])
  (assume n,
    assume ih : m + n = n + m,
    calc
        m + succ n = succ (m + n) : rfl
        ... = succ (n + m) : by rw ih
        ... = succ n + m :  by rw succ_add )

-- multiplication
def mult (m n: nat) : nat :=
nat.rec_on n zero (λ n mult_m_n, add mult_m_n m )

instance : has_mul nat := has_mul.mk mult

-- properties mult

theorem mul_zero (m: nat) : mult m 0 = 0 := rfl  -- m * 0 = 0

theorem zero_mul (m : nat) : mult 0 m = 0 :=     -- 0 * m = 0
nat.rec_on m
    (show  0 * zero = 0, from rfl)
    (assume m,
     assume ih: 0 * m = 0,
     show  0 * (succ m) = 0, from
        calc
             0 * (succ m) =    0 * m + 0: rfl
            ... = 0 * 0 : ih
            ... = 0: rfl
    )

theorem succ_mul (n m : nat) : ( n + 1 ) * m = ( n * m ) + m :=  -- ( n + 1 ) * m = ( n * m ) + m
    nat.rec_on m
        (show (n + 1) * 0 = (n * 0) + 0, from rfl)
        (assume m,
         assume ih: (n + 1) * m = ( n * m ) + m,
         show (n + 1) * (m + 1) = ( n *(m + 1) ) + (m + 1), from
         calc
            (n + 1) * (m + 1) = ((n + 1) * m) + (n + 1) : rfl
            ... = (n * m) + m + (n + 1) : by rw ih
            ... = (n * m) + (m + (n + 1)) : by rw add_assoc
            ... = (n * m) + ((n + 1) + m) : by rw add_comm -- HERE
            ... = n * m + (n + (m + 1)) : nat.succ_add_eq_succ_add -- ((n + 1) + m) = ( n + (m + 1))
            ... = n * m + n + (m + 1) : add_assoc
            ... = n * (m + 1) + (m + 1): rfl

        )

theorem mul_comm (m n : nat) :  m * n = n * m :=        -- m * n = n * m
nat.rec_on n
    (show  m * 0 =  0 * m , from  eq.symm (zero_mul m) )
    (assume n ,
     assume ih : m * n = n * m,
     show m * n + 1 = ( n + 1) * m, from
        calc m * (n + 1) =  m * n + m : by rw mul_add,
            ... =  (n * m) + m : by rw ih,
            ... =  ( n + 1) * m : by rw succ_mul

            )

end nat
end hidden
```
I think that the proof is correct, or at least I can't see the error, maybe I'm using  ```rw ``` in```calc``` in a wrong way.
The errors I got are in ```succ_mul``` and in ```mul_comm```.
(the ```instance``` command I use is something I shouldn't know from the tutorial but as they use it once I adapt it to my needs, maybe I did it in a wrong way, but I don't think that that is the main problem. From what I understand is just a way, for example, to let me use ```m * n```instead of ```mult m n```  ).

#### [Chris Hughes (Jan 05 2019 at 15:27)](https://leanprover.zulipchat.com/#narrow/stream/113489-new%20members/topic/Commutativity%20of%20multiplication%20in%20inductive%20type/near/154475186):
`rw add_comm m` works at `HERE`. There are two places where it's possible to `rw add_comm` so you have to give the correct one.

#### [Chris Hughes (Jan 05 2019 at 15:29)](https://leanprover.zulipchat.com/#narrow/stream/113489-new%20members/topic/Commutativity%20of%20multiplication%20in%20inductive%20type/near/154475231):
On the next line you use a lemma about `nat` in the core library, which doesn't apply to the `nat` that you defined.

#### [Carlesso Diego (Jan 06 2019 at 11:23)](https://leanprover.zulipchat.com/#narrow/stream/113489-new%20members/topic/Commutativity%20of%20multiplication%20in%20inductive%20type/near/154510669):
```quote
`rw add_comm m` works at `HERE`. There are two places where it's possible to `rw add_comm` so you have to give the correct one.
```
 thank you, you are right! I wasn't considering it. Solved, even the next line I succeeded with an ```add_assoc``` and another  ```add_comm m ```  in order to avoid the problem with the lemma about ```nat``` in the core library  , it was easier than I thought .
 Now I have solved everything simply adding :
```lean
theorem mul_succ (n m : nat) : m * ( n + 1 ) = ( m * n ) + m :=
    nat.rec_on m
        (show 0 * (n + 1) = (0 * n) + 0, from rfl)
        (assume m,
         assume ih: m * (n + 1) = ( m * n ) + m,
         show (m + 1) * ( n+ 1) = ( (m + 1) * n ) + (m + 1), from
         calc
            (m + 1) * (n + 1) = ((m + 1) * n) + (m + 1) : rfl
            ... = (m * n) + n + (m + 1) : by rw succ_mul
            ... = ( (m + 1) * n) + (m + 1) : by rw ←succ_mul
```
and with ```mul_comm``` becoming:
```lean
theorem mul_comm (m n : nat) :  m * n = n * m :=        -- m * n = n * m
nat.rec_on n
    (show  m * 0 =  0 * m , from  eq.symm (zero_mul m) )
    (assume n,
     assume ih : m * n = n * m,
     show m * (n + 1) = ( n + 1 ) * m, from
        calc m * (n + 1) =  (m * n) + m : by rw mul_succ
            ... =  (n * m) + m : by rw ih
            ... =  ( n + 1) * m : by rw succ_mul

            )
```
Thanks again!


text:
# _Project 3_

#### _PingPong, 4/1/2016_

#### By _**Jacob Hefley**_

## Description

_user inputs an integer and it displays a list of the numbers, excpet when they are multiples of 3, 5 or both_

## Setup/Installation Requirements

* _web browser with CSS, javascript and HTML5 capability_

## Known Bugs

_none_

## Support and contact details

_n/a<EMAIL_ADDRESS>
## Technologies Used

_HTML, CSS, Bootstrap, JavaScipt, JQuery_

### License

*Copyright (c) 2016 Jacob Hefley*

**MIT license**

license: MIT

repository: jacobhefley/pingpong

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: jacobhefley/pingpong


text:
### Project Information:
MRV driver

___
This is the default driver for MRV switches. The driver package contains the manifest file
and a single test case. We encourage you to use the test case's structure (main procedures
and functional procedures) as a stub for implementing drivers for other devices.

___
The driver implements the Layer 1 Switch interface and requires the following resource
properties:
* ipAddress (optional, but either ipAddress or Hostname must be specified)
* Hostname (optional, but either ipAddress or Hostname must be specified)
* username
* password

___

repository: nneul/Velocity-assets

repo_name: nneul/Velocity-assets


text:
###1.2.2
- Thanks to Kimmo Kujansuu for the finnish translation
- fredcw added support for libsup 3
- Support for Kosovo holidays

### 1.2.1
- move to multiversion setup. This ensures event manager is only started
  on Cinnamon 5.2+.

### 1.2.0
- Merged the event manager from<EMAIL_ADDRESS>- Updated layout to match changes in<EMAIL_ADDRESS>- Thanks to haggen88 for the spanish translation and to Dragone2 for
  the italian translation.

### 1.1.7
- Thanks to serkan-master for the turkish translation, to ViniciusQueirozVQ
  for the portuguese/brazilian translation, and to FabienRCT for his work
  on the french translation
- Support for Spanish holidays including regional data

### 1.1.6
- Thanks to bossbob88 for the hungarian translation
- Support for Belarus holidays

### 1.1.5
- Thanks to Alan01 for the danish translation, and to eson57 for the swedish translation.
- Bugfix: align world clock times correctly

### 1.1.4
- Display holidays/weekends in bold even outside of the selected month
- Move "Date and Time Settings" to context menu
- Put uncategorized timezones into the list of World Clocks (thanks to **@sphh**)

### 1.1.3

- Support for Turkish holidays
- Support for multiday holidays
- Holidays that are only halfdays are only shown if a two-day weekend is selected

### 1.1.2

- Bugfix: reload stale data after update period

### 1.1.1

- Bugfix: read country settings early enough

### 1.1.0

- implement world clock display

### 1.0.0

- initial release

repository: linuxmint/cinnamon-spices-applets

gha_language: JavaScript

repo_name: linuxmint/cinnamon-spices-applets


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Parallax in selection screen
### Changed
- Refactoring species - All the reference to a species will be encapsulated in a resource, while all the references are just enums (SPECIES0, SPECIES1, etc.)

## [v0.0.2] - 2018-01-16
### Added
- Crown mode
### Changed
- Refactoring code
### Removed
- Screens and singleton

[Unreleased]: https://github.com/notapixelstudio/superstarfighter/compare/v0.2-alpha...HEAD
[v0.0.2]: https://github.com/notapixelstudio/superstarfighter/compare/v0.1-alpha...v0.2-alpha

gha_license_id: MIT


text:
# Introduction to pytube library
- We know YouTube is very popular video sharing platform in the entire world.
- At times we wants to download a video which we can play in offline mode.
For that, we download any online youtube downloader or any sites that saves the video into our computer.
- Our work is done, but while adoptiong this way we come across many multiple sites which gets open in our background which is unsafe.
- But have you ever think of creating our own program to download youtube videos?
-  Python program with fewer number of lines of code which makes our job easier.
- It has a library named as ‘pytube’ to download youtube videos directly.
>What is pytube library in python?

#### ***pytube*** is a lightweight, dependency-free Python library which is used for downloading videos from the web.
>Why pytube to be adopted?
- No Third-Party Dependencies
- Extensively Documented Source Code
- Ability to Capture Thumbnail URL
- Caption Track Support
- Outputs Caption Tracks to .srt format (SubRip Subtitle)
- Command-line Interfaced Included
- Makes pipelining easy

## Installation
Installation is easy when you have **pip** via **pypi**. In the Terminal or Command Prompt, type the following command to install pytube.

	 $ pip install pytube3

 ## Lets get started!!!
 *Let’s start by importing the youtube class:*

	from pytube import YouTube

*Now get any link from the youtube you want to download*:

	yt = YouTube('https://www.youtube.com/watch?v=WvhQhj4n6b8')
*The pytube API makes all information intuitive to access. For example, this is how you would get the video's title:*

	>>>yt.title
		What is Python? | Introduction to Python | Python Programming For Beginners | Edureka

*We can also get the thumbnail url of the video:*

	>>>yt.thumbnail_url
		https://i.ytimg.com/vi/WvhQhj4n6b8/maxresdefault.jpg

*Now, we need to select the media format. Pytube module provides different media formats to download video which we wish to:*

	>>>stream = yt.streams.all()
		[<Stream: itag="18" mime_type="video/mp4" res="360p"fps="30fps" vcodec="avc1.42001E" acode
	c="mp4a.40.2" progressive="True" type="video">, <Stream: itag="22" mime_type="video/mp4" re
	s="720p" fps="30fps" vcodec="avc1.64001F" acodec="mp4a.40.2" progressive="True" type="video
	">, <Stream: itag="137" mime_type="video/mp4" res="1080p" fps="30fps" vcodec="avc1.640028"
	progressive="False" type="video">, <Stream: itag="248" mime_type="video/webm" res="1080p" f
	ps="30fps" vcodec="vp9" progressive="False" type="video">, <Stream: itag="136" mime_type="v
	ideo/mp4" res="720p" fps="30fps" vcodec="avc1.4d401f" progressive="False" type="video">]

*The video will be downloaded into your destination path:*

	>>>stream.download('**specific location**')
*The video will be downloaded into your current directory:*

	>>>stream.download()

> **The above steps explains breifly to use the python library pytube easily to download multiple videos from the youtube.**

branch_name: refs/heads/main


text:
# Ruby MPD client

[![Gem Version](https://badge.fury.io/rb/ruby-mpd-client.svg)](https://badge.fury.io/rb/ruby-mpd-client)

[![Build Status](https://travis-ci.org/Nondv/ruby-mpd-client.svg?branch=master)](https://travis-ci.org/Nondv/ruby-mpd-client) **master**

[![Build Status](https://travis-ci.org/Nondv/ruby-mpd-client.svg?branch=develop)](https://travis-ci.org/Nondv/ruby-mpd-client) **develop**

Yet another ruby mpd client.

It does not really provide you some object model for interacting with MPD.
Mostly it's just collection of MPD commands with different names.

There's `MPD::Connection` wrapper over `Socket`, `MPD::ServerResponse` - string
with some useful methods, `MPD::Playlist` - verypoor abstraction over song list
and `MPD::Commands` module that contains all implemented commands.

See on [rubydoc](http://www.rubydoc.info/gems/ruby-mpd-client).

## Installation

```ruby
gem 'ruby-mpd-client'
```

## Usage

```ruby
require 'ruby-mpd-client'

MPD::Commands::SetVolume.new(host: 'localhost') # :host can be ommited
                        .execute(75)
MPD::Commands::Next.new.execute

#
# to use one connection
#
conn = MPD::Connection.new(host: 'localhost', port: 6600)
conn.connect
conn.gets # first MPD response is always "OK <version>\n"
MPD::Commands::Next.new(connection: conn).execute
MPD::Commands::Pause.new(connection: conn).execute
```

For available commands see `MPD::Comands` subclasses on
[rubydoc.info](http://www.rubydoc.info/github/Nondv/ruby-mpd-client/MPD/Commands).

## Contributing

I guess your contribution would be a some command implementation or some models
better than `MPD::Playlist` and `MPD::Song`. Feel free to create pull requests,
issues or contact me.

[Link to github repo](https://github.com/Nondv/ruby-mpd-client)

## License

The gem is available as open source under the terms of the
[MIT License](http://opensource.org/licenses/MIT).

repository: Nondv/ruby-mpd-client

repo_name: Nondv/ruby-mpd-client


text:
---
description: Used by JobLogDetial/assetType.
solution: Experience Manager
title: Job Log File Types
feature: Dynamic Media Classic,SDK/API
role: Developer,Admin
exl-id: a6dce340-0dc4-4ecf-9aa1-0ed8f446fb8c
---
# Job Log File Types{#job-log-file-types}

Used by JobLogDetial/assetType.

 Syntax

## Values {#section-6abb6143e2cb4319b5f0eff37129fa9d}

* [!DNL `NoType`]
* [!DNL `PublishCatalog`]
* [!DNL `OptimizedImage`]
* [!DNL `MasterImage`]
* [!DNL `SealedImage`]
* [!DNL `Mask`]
* [!DNL `Vignette`]
* [!DNL `Thumbnail`]
* [!DNL `ImageMap`]
* [!DNL `IccProfile`]
* [!DNL `Font`]
* [!DNL `Xsl`]
* [!DNL `Cabinet`]
* [!DNL `WindowCovering`]
* [!DNL `Video`]
* [!DNL `ViewerSwf`]
* [!DNL `Icon`]
* [!DNL `Video`]
* [!DNL `ViewerSwf`]
* [!DNL `Icon`]
* [!DNL `VideoEncodingXml`]
* [!DNL `ViewerConfigXml`]
* [!DNL `Template`]
* [!DNL `Catalog`]
* [!DNL `Xml`]
* [!DNL `ImageSet`]
* [!DNL `RenderSet`]
* [!DNL `SpinSet`]
* [!DNL `Svg`]
* [!DNL `Watermark`]
* [!DNL `Pdf`]
* [!DNL `Aco`]
* [!DNL `PsdTemplate`]
* [!DNL `Zip`]


text:
[![Docker Pulls](https://img.shields.io/docker/pulls/evanbuss/openbooks.svg)](https://hub.docker.com/r/
evanbuss/openbooks/)

The OpenBooks docker image allows you to run [Server Mode](../modes/server.md). A multi-platform Docker container is published to Docker Hub for each release.

## Docker Compose

For advanced configuration, I recommend using Docker Compose to keep track of container setup.

```yaml title="docker-compose.yml"
version: "3.3"
services:
  openbooks:
    container_name: OpenBooks
    image: evanbuss/openbooks:latest
    restart: unless-stopped
    ports:
      - "8080:80"
    volumes:
      - "~/Downoads/openbooks:/books"
    command: --persist --name
    environment:
      - BASE_PATH=/openbooks/
```

## Configuration

See the [configuration docs](../configuration.md) for a complete list of Server mode configuration options. Pass the configuration flags into the `command` property.

Use the `environment` property to optionally set a custom base path for the server.

## Image Tags

`evanbuss/openbooks:latest`

: The majority of users will want this image and will always be up to date with the latest release. Note that auto-updating between version could break configuration.[^1]

`evanbuss/openbooks:X.X.X`

: Version specific tags. Each time a new release is cut, a new version tagged image is published.

`evanbuss/openbooks:edge`

: Built from the latest development build. This image is best if you want to test the latest changes but be warned that it could be unstable and not work at all.

## Image Platforms

- `linux/amd64`
- `linux/arm64`
- `linux/arm`

[^1]: I personally auto-update all of my docker containers and haven't experienced many issues. Tools like [Watchtower](https://containrrr.dev/watchtower/) can check for updates, pull images, and restart containers automatically.

repository: evan-buss/openbooks

gha_language: Go

repo_name: evan-buss/openbooks


text:
# Change Log

# 0.3.3

- Minor linting fix

# 0.3.1

- Fixed `ac_webhook` sensor stuck with timeouts by enabling Flask app threading #3

# 0.3.0

- Updated action `runner_type` from `run-python` to `python-script`

# 0.2.0

- Rename `config.yaml` to `config.schema.yaml` and update to use schema.

# 0.1.0

- First release

repository: ibsonlima/stackstorm-activecampaign

repo_name: ibsonlima/stackstorm-activecampaign


text:
# Example IV: Diffusion equation on a square plate

*Warning*: Much of the code in this example takes a very long time, e.g. the MLEs take just under an hour. The total runtime is around six hours on my machine (mostly coming from the mesh for the PDE being very dense).

The packages we use in this example are:

```julia
using FiniteVolumeMethod
using ProfileLikelihood
using DelaunayTriangulation
using Random
using LinearSolve
using OrdinaryDiffEq
using CairoMakie
using LaTeXStrings
using StaticArraysCore
using Optimization
using OptimizationNLopt
```

Let us now consider the problem of estimating parameters defining a diffusion equation on a square plate. In particular, consider

```math
\begin{equation*}
\begin{array}{rcll}
\displaystyle
\frac{\partial u(x, y, t)}{\partial t} &=& \dfrac{1}{k}\boldsymbol{\nabla}^2 u(x, y, t) & (x, y) \in \Omega,t>0, \\
u(x, y, t) &= & 0 & (x, y) \in \partial \Omega,t>0, \\
u(x, y, 0) &= & u_0\mathbb{I}(y \leq c) &(x,y)\in\Omega,
\end{array}
\end{equation*}
```

where $\Omega = [0, 2]^2$. This problem extends the corresponding example given in FiniteVolumeMethod.jl, namely [this example](https://github.com/DanielVandH/FiniteVolumeMethod.jl#diffusion-equation-on-a-square-plate), and so not all the code used in defining this PDE will be explained here; refer to the FiniteVolumeMethod.jl documentation. We will take the true values $k = 9$, $c = 1$, $u_0 = 50$, and let the standard deviation of the noise, $\sigma$, in the data be $0.1$. We are interested in recovering $(k, c, u_0)$; we do not consider estimating $\sigma$ here, estimating it leads to identifiability issues that distract from the main point of our example here, i.e. to just show how to setup a problem.

## Building the FVMProblem

Let us start by defining the PDE problem, and then we will discuss profiling.

```julia
using FiniteVolumeMethod, DelaunayTriangulation, LinearSolve
a, b, c, d = 0.0, 2.0, 0.0, 2.0
r = 0.022
GMSH_PATH = "./gmsh-4.9.4-Windows64/gmsh.exe" # set this to whatever your path is
tri = generate_mesh(a, b, c, d, r; gmsh_path=GMSH_PATH)
mesh = FVMGeometry(tri)
bc = ((x, y, t, u::T, p) where {T}) -> zero(T)
type = :D
BCs = BoundaryConditions(mesh, bc, type)
c = 1.0
u₀ = 50.0
f = (x, y) -> y ≤ c ? u₀ : 0.0
D = (x, y, t, u, p) -> p[1]
flux = (q, x, y, t, α, β, γ, p) -> (q[1] = -α / p[1]; q[2] = -β / p[1])
R = ((x, y, t, u::T, p) where {T}) -> zero(T)
points = get_points(tri)
initc = @views f.(points[1, :], points[2, :])
iip_flux = true
final_time = 0.1
k = [9.0]
prob = FVMProblem(mesh, BCs; iip_flux,
    flux_function=flux, reaction_function=R,
    initial_condition=initc, final_time,
    flux_parameters=k)
```

Our problem has now been defined. Notice that we wrap `k` in a vector so that we can easily mutate the `flux_parameters` field of `prob`; if `k` were a scalar, we could not mutate it.

Now let's generate some data. We start by solving the PDE.

```julia
alg = TRBDF2(linsolve=KLUFactorization(; reuse_symbolic=false))
sol = solve(prob, alg; specialization=SciMLBase.FullSpecialize, saveat=0.01)
```

(We use `reuse_symbolic=false` due to https://github.com/JuliaSparse/KLU.jl/issues/12 causing issues with multithreading later.)

## Defining a summary statistic

Now, one complication with a PDE compared to the scalar ODE cases that we considered previously is that we have data at $(x_i, y_j, t_k)$ for many indices $(i, j, k)$. Rather than defining our objective function in terms of these data points, we will instead use a summary statistic. The summary statistic we use in this example is the average density,

```math
\tilde M(t) = \frac{1}{\mathrm{Area}(\Omega)}\iint_\Omega u(x, y, t)\mathrm{dA}.
```

We need to be able to compute this integral efficiently and accurately. For this, recall that the finite volume method discretises the domain into triangles. If $\mathcal T$ is this set of triangles, then

```math
\tilde M(t) = \frac{1}{\mathrm{Area}(\Omega)}\sum_{T_k \in \mathcal T} \iint_{T_k} u(x, y, t)\mathrm{dA}.
```

Then, recall that $u$ is represented as a linear function $\alpha_k x + \beta_k y + \gamma_k$ inside the triangle $T_k$, thus

```math
\tilde M(t) \approx \frac{1}{\mathrm{Area}(\Omega)}\sum_{T_k \in \mathcal T} \left[\alpha_k \iint_{T_k} x\mathrm{dA} + \beta_k \iint_{T_k} y\mathrm{dA} + \gamma_k\iint_{T_k}\mathrm{dA}\right]
```

Now factoring out an $\mathrm{Area}(T_k) = \iint_{T_k}\mathrm{dA}$,

```math
\tilde M(t) \approx \sum_{T_k \in \mathcal T} \frac{\mathrm{Area}(T_k)}{\mathrm{Area}(\Omega)}\left[\alpha_k \dfrac{\iint_{T_k} x\mathrm{dA}}{\iint_{T_k} \mathrm{dA}} + \beta_k \dfrac{\iint_{T_k} y\mathrm{dA}}{\iint_{T_k} \mathrm{dA}} + \gamma_k\right].
```

Notice that the two ratios of integrals shown are simply $\hat x_k$ and $\hat y_k$, where $(\hat x_k, \hat y_k)$ is the centroid of $T_k$. Thus, the term in brackets is $\alpha_k \hat x_k + \beta_k \hat y_k + \gamma_k$, which is the approximation to $u$ at the centroid, $\tilde u(\hat x_k, \hat y_k, t)$. Thus, our approximation to the average density is

```math
\tilde M(t) \approx \sum_{T_k \in \mathcal T} w_k \tilde u(\hat x_k, \hat y_k, t), \qquad w_k = \frac{\mathrm{Area}(T_k)}{\mathrm{Area}(\Omega)}.
```

The following function provides a method for computing this mass.

```julia
function compute_mass!(M::AbstractVector{T}, αβγ, sol, prob) where {T}
    mesh_area = prob.mesh.mesh_information.total_area
    fill!(M, zero(T))
    for i in eachindex(M)
        for V in FiniteVolumeMethod.get_elements(prob)
            element = FiniteVolumeMethod.get_element_information(prob.mesh, V)
            cx, cy = FiniteVolumeMethod.get_centroid(element)
            element_area = FiniteVolumeMethod.get_area(element)
            interpolant_val = eval_interpolant!(αβγ, prob, cx, cy, V, sol.u[i])
            M[i] += (element_area / mesh_area) * interpolant_val
        end
    end
    return nothing
end
```

Let's now compute this mass and add some noise onto it.

```julia
using Random
M = zeros(length(sol.t))
αβγ = zeros(3)
compute_mass!(M, αβγ, sol, prob)
true_M = deepcopy(M)
Random.seed!(29922881)
σ = 0.1
true_M .+= σ * randn(length(M))
```

## Defining the LikelihoodProblem

We now need to define the likelihood problem. We need to use the method for `LikelihoodProblem` that takes the `integrator` as an argument explicitly, so we must somehow construct an integrator from an `FVMProblem`. Here is one way that this can be done. Notice that we use `parallel=true` so that the PDE is solved with multithreading. For an isolated solution, this seems to solve the PDE twice as fast on my machine (eight threads).

```julia
function ProfileLikelihood.construct_integrator(prob::FVMProblem, alg; ode_problem_kwargs, kwargs...)
    ode_problem = ODEProblem(prob; no_saveat=false, ode_problem_kwargs...)
    return ProfileLikelihood.construct_integrator(ode_problem, alg; kwargs...)
end
jac = float.(FiniteVolumeMethod.jacobian_sparsity(prob))
fvm_integrator = construct_integrator(prob, alg; ode_problem_kwargs=(jac_prototype=jac, saveat=0.01, parallel=true))
```

Now we define the likelihood function.

```julia
function loglik_fvm(θ::AbstractVector{T}, param, integrator) where {T}
    _k, _c, _u₀ = θ
    ## Update and solve
    (; prob) = param
    prob.flux_parameters[1] = _k
    pts = FiniteVolumeMethod.get_points(prob)
    for i in axes(pts, 2)
        pt = get_point(pts, i)
        prob.initial_condition[i] = gety(pt) ≤ _c ? _u₀ : zero(T)
    end
    reinit!(integrator, prob.initial_condition)
    solve!(integrator)
    if !SciMLBase.successful_retcode(integrator.sol)
        return typemin(T)
    end
    ## Compute the mass
    (; mass_data, mass_cache, shape_cache, sigma) = param
    compute_mass!(mass_cache, shape_cache, integrator.sol, prob)
    if any(isnan, mass_cache)
        return typemin(T)
    end
    ## Done
    ℓ = @views gaussian_loglikelihood(mass_data, mass_cache, sigma, length(mass_data))
    return ℓ
end
```

Finally, here is the `LikelihoodProblem`.

```julia
likprob = LikelihoodProblem(
    loglik_fvm,
    [8.54, 0.98, 29.83],
    fvm_integrator;
    syms=[:k, :c, :u₀],
    data=(prob=prob, mass_data=true_M, mass_cache=zeros(length(true_M)), shape_cache=zeros(3), sigma=σ),
    f_kwargs=(adtype=Optimization.AutoFiniteDiff(),),
    prob_kwargs=(lb=[3.0, 0.0, 0.0],
        ub=[15.0, 2.0, 250.0])
)
```

## Parameter estimation

Now that we have the problem completely setup, we are in a position for maximum likelihood estimation and profiling. For the maximum likelihood estimates, we first use a global optimiser and then we refine the solution with a local optimiser.

```julia
mle_sol = mle(likprob, (NLopt.GN_DIRECT_L_RAND(), NLopt.LN_BOBYQA); ftol_abs=1e-8, ftol_rel=1e-8, xtol_abs=1e-8, xtol_rel=1e-8) # global, and then refine with a local algorithm
LikelihoodSolution. retcode: Failure
Maximum likelihood: 11.046014040624534
Maximum likelihood estimates: 3-element Vector{Float64}
     k: 7.847020395441574
     c: 1.1944331289720689
     u₀: 41.667309553688305
```

Next, let us profile. For interest, we show the difference in runtime when we use multithreading for profiling vs. when we do not use multithreading. I am using eight threads.

```julia
@time prof = profile(likprob, mle_sol; alg=NLopt.LN_BOBYQA,
    ftol_abs=1e-4, ftol_rel=1e-4, xtol_abs=1e-4, xtol_rel=1e-4,
    resolution=60)
5131.960778 seconds (133.61 M allocations: 948.495 GiB, 0.13% gc time, 0.04% compilation time)
```

```julia
@time _prof = profile(likprob, mle_sol; alg=NLopt.LN_BOBYQA,
    ftol_abs=1e-4, ftol_rel=1e-4, xtol_abs=1e-4, xtol_rel=1e-4,
    resolution=60, parallel=true)
3324.605865 seconds (131.24 M allocations: 948.598 GiB, 0.40% gc time, 0.01% compilation time)
```

The results are about twice as fast in this example. The reason it's not even faster is because we are also using multithreading in solving the PDE. If we had no used multithreading in solving the PDE, these results would take a significantly longer time. Here are the results from `prof` (same for `_prof`):

```julia
ProfileLikelihoodSolution. MLE retcode: Failure
Confidence intervals:
     95.0% CI for k: (7.4088716591304715, 8.574442050142432)
     95.0% CI for c: (0.6478281377475628, 2.0)
     95.0% CI for u₀: (33.78499567791489, 79.47955668442242)
```

See that all the true parameter intervals are inside these confidence intervals except for $k$, although $c$'s upper bound is right at the bounds we gave it in the problem. Let's now view the profile curves.

```julia
using CairoMakie, LaTeXStrings
fig = plot_profiles(prof; nrow=1, ncol=3,
    latex_names=[L"k", L"c", L"u_0"],
    true_vals=[k[1], c, u₀],
    fig_kwargs=(fontsize=38, resolution=(2109.644f0, 444.242f0)),
    axis_kwargs=(width=600, height=300))
scatter!(fig.content[1], get_parameter_values(prof, :k), get_profile_values(prof, :k), color=:black, markersize=9)
scatter!(fig.content[2], get_parameter_values(prof, :c), get_profile_values(prof, :c), color=:black, markersize=9)
scatter!(fig.content[3], get_parameter_values(prof, :u₀), get_profile_values(prof, :u₀), color=:black, markersize=9)
xlims!(fig.content[1], 7.0, 9.5)
```

![PDE profiles](https://github.com/DanielVandH/ProfileLikelihood.jl/blob/main/test/figures/heat_pde_example.png?raw=true)

See that the profile curves for $c$ and $u_0$ are very flat, and we have not recovered $k$. This means that the parameters $c$ and $u_0$ are not *identifiable*, essentially meaning the data is not enough to recover these parameters. This is most likely because the mass $\tilde M(t)$ alone is not enough to uniquely define the solution. We could consider a summary statistic like

```math
\mathcal S(t) = w\tilde M(t) + (1-w)\tilde A(t),
```

for some $0 \leq w \leq 1$, where $\tilde A(t)$ is the area of the region below the leading edge of the solution, i.e. the area of the non-zero part of the solution. We do not consider this here. What we do consider is fixing $c$, keeping the summary statistic $\tilde M(t)$, and seeing what we can do with only two parameters $k$ and $u_0$.

## Reducing to two parameters and grid searching

Let us now fix $c$ at its true value, $c = 1$, and consider estimating only $k$ and $u_0$. Since we have only $k$ and $u_0$ to estimate, it may be worthwhile to perform a grid search over our likelihood function so that we can (1) visualise the likelihood surface and (2) see reasonable estimates for $k$ and $u_0$.

First, we redefine the problem.

```julia
using StaticArraysCore
@inline function loglik_fvm_2(θ::AbstractVector{T}, param, integrator) where {T}
    _k, _u₀, = θ
    (; c) = param
    new_θ = SVector{3,T}((_k, c, _u₀))
    return loglik_fvm(new_θ, param, integrator)

end
likprob_2 = LikelihoodProblem(
    loglik_fvm_2,
    [8.54, 29.83],
    fvm_integrator;
    syms=[:k, :u₀],
    data=(prob=prob, mass_data=true_M, mass_cache=zeros(length(true_M)), shape_cache=zeros(3), sigma=σ, c=c),
    f_kwargs=(adtype=Optimization.AutoFiniteDiff(),),
    prob_kwargs=(lb=[3.0, 0.0],
        ub=[15.0, 250.0])
)
```

Now let's do our grid search. We show the timing when we use a multithreaded grid search vs. a serial grid search.

```julia
grid = RegularGrid(get_lower_bounds(likprob_2), get_upper_bounds(likprob_2), 50)
@time gs, lik_vals = grid_search(likprob_2, grid; save_vals = Val(true), parallel=Val(true))
1529.393520 seconds (91.55 M allocations: 606.223 GiB, 2.10% gc time)
```

```julia
@time _gs, _lik_vals = grid_search(likprob_2, grid; save_vals = Val(true), parallel=Val(false))
3454.357503 seconds (86.48 M allocations: 605.468 GiB, 0.14% gc time)
```

Here are the results from the grid search.

```julia
LikelihoodSolution. retcode: Success
Maximum likelihood: -24.399451875029165
Maximum likelihood estimates: 2-element Vector{Float64}
     k: 7.408163265306122
     u₀: 51.0204081632653
```

Let us now visualise the likelihood function.

```julia
fig = Figure(fontsize=38)
k_grid = get_range(grid, 1)
u₀_grid = get_range(grid, 2)
ax = Axis(fig[1, 1],
    xlabel=L"k", ylabel=L"u_0",
    xticks=0:3:15,
    yticks=0:50:250)
co = heatmap!(ax, k_grid, u₀_grid, lik_vals, colormap=Reverse(:matter))
contour!(ax, k_grid, u₀_grid, lik_vals, levels=40, color=:black, linewidth=1 / 4)
scatter!(ax, [k[1]], [u₀], color=:white, markersize=14)
scatter!(ax, [gs[:k]], [gs[:u₀]], color=:blue, markersize=14)
clb = Colorbar(fig[1, 2], co, label=L"\ell(k, u_0)", vertical=true)
```

![Likelihood function for the PDE](https://github.com/DanielVandH/ProfileLikelihood.jl/blob/main/test/figures/heat_pde_contour_example.png?raw=true)

The true parameter values are shown at the white marker, while the results from the grid search are shown in blue, and these two markers are reasonably close. We see that the likelihood function is quite flat around these values, so this might be an indicator of further identifiability issues. Let us now use the grid search results to update our initial guess and compute the MLEs, and then we profile.

```julia
likprob_2 = update_initial_estimate(likprob_2, gs)
mle_sol = mle(likprob_2, NLopt.LN_BOBYQA; ftol_abs=1e-8, ftol_rel=1e-8, xtol_abs=1e-8, xtol_rel=1e-8)
LikelihoodSolution. retcode: Failure
Maximum likelihood: 11.016184577792082
Maximum likelihood estimates: 2-element Vector{Float64}
     k: 9.40527352240195
     u₀: 49.741093700294336
```

```julia
@time prof = profile(likprob_2, mle_sol; ftol_abs=1e-4, ftol_rel=1e-4, xtol_abs=1e-4, xtol_rel=1e-4, parallel=true)
612.723061 seconds (25.45 M allocations: 155.874 GiB, 0.41% gc time)
ProfileLikelihoodSolution. MLE retcode: Failure
Confidence intervals:
     95.0% CI for k: (8.788003299163778, 10.094019297587579)
     95.0% CI for u₀: (49.44377511158833, 50.03883730450469)
```

The confidence intervals contain the true values. We can now visualise.

```julia
fig = plot_profiles(prof; nrow=1, ncol=3,
    latex_names=[L"k", L"u_0"],
    true_vals=[k[1], u₀],
    fig_kwargs=(fontsize=38, resolution=(1441.9216f0, 470.17322f0)),
    axis_kwargs=(width=600, height=300))
scatter!(fig.content[1], get_parameter_values(prof, :k), get_profile_values(prof, :k), color=:black, markersize=9)
scatter!(fig.content[2], get_parameter_values(prof, :u₀), get_profile_values(prof, :u₀), color=:black, markersize=9)
```

![Second set of profiles](https://github.com/DanielVandH/ProfileLikelihood.jl/blob/main/test/figures/heat_pde_example_2.png?raw=true)

See that we've recovered the parameters in the confidence intervals, and the profiles are smooth -- the identifiability issues are gone. So, it seems like $c$ was the problematic parameter, since our summary statistic does not really give us any information about it. Our idea of using the summary statistic $\mathcal S(t)$ from above would likely ameliorate this issue, since it will give information directly relating to $c$.

## Comparing methods for constructing initial estimates when profiling

In the mathematical details section at the end of this README, it is mentioned that initial values for $\boldsymbol\omega_j$ (the parameters to be optimised while an interest parameter is held fixed) can currently be set in two ways:

- Method 1: Simply starting $\boldsymbol\omega_j$ at $\boldsymbol\omega_{j-1}$. This is the `next_initial_estimate_method = :prev` option in `profile`, and is the default.
- Method 2: Using linear interpolation, we can use the previous two values and set $\boldsymbol\omega_j = [\boldsymbol\omega_{j-2}(\psi_{j-1} - \psi_j) + \boldsymbol\omega_{j-1}(\psi_j - \psi_{j-2})] / (\psi_{j-1} - \psi_{j-2})$ (if $\boldsymbol\omega_j$ then starts outside of the parameter bounds, we fall back to the first method). This is the `next_initial_estimate_method = :interp` option in `profile`.

Is there a big difference in these methods? Let's demonstrate if there is any difference by doing some benchmarking. We will also compare multithreading versus no multithreading.

```julia
bnch_prev_serial = @benchmark profile($likprob_2, $mle_sol; ftol_abs=$1e-4, ftol_rel=$1e-4, xtol_abs=$1e-4, xtol_rel=$1e-4, parallel=$false, next_initial_estimate_method=$:prev)
bnch_interp_serial = @benchmark profile($likprob_2, $mle_sol; ftol_abs=$1e-4, ftol_rel=$1e-4, xtol_abs=$1e-4, xtol_rel=$1e-4, parallel=$false, next_initial_estimate_method=$:interp)
bnch_prev_parallel = @benchmark profile($likprob_2, $mle_sol; ftol_abs=$1e-4, ftol_rel=$1e-4, xtol_abs=$1e-4, xtol_rel=$1e-4, parallel=$true, next_initial_estimate_method=$:prev)
bnch_interp_parallel = @benchmark profile($likprob_2, $mle_sol; ftol_abs=$1e-4, ftol_rel=$1e-4, xtol_abs=$1e-4, xtol_rel=$1e-4, parallel=$true, next_initial_estimate_method=$:interp)
```

Here are the results:

```julia
julia> bnch_prev_serial
BenchmarkTools.Trial: 1 sample with 1 evaluation.
 Single result which took 855.578 s (0.23% GC) to evaluate,
 with a memory estimate of 155.70 GiB, over 24670284 allocations.
```

```julia
julia> bnch_interp_serial
BenchmarkTools.Trial: 1 sample with 1 evaluation.
 Single result which took 757.444 s (0.24% GC) to evaluate,
 with a memory estimate of 144.34 GiB, over 22976564 allocations.
```

```julia
julia> bnch_prev_parallel
BenchmarkTools.Trial: 1 sample with 1 evaluation.
 Single result which took 548.814 s (0.34% GC) to evaluate,
 with a memory estimate of 155.87 GiB, over 25443078 allocations.
```

```julia
julia> bnch_interp_parallel
BenchmarkTools.Trial: 1 sample with 1 evaluation.
 Single result which took 498.408 s (0.36% GC) to evaluate,
 with a memory estimate of 144.52 GiB, over 23809418 allocations.
```

We see that linear interpolation is a significant help to the algorithm, saving 100 seconds when we profile without multithreading, and 50 seconds when we profile with multithreading. In summary, profiling with the `:interp` method was about 12% faster than `:prev` without multithreading, and about 10% faster with multithreading --- interpolation is certainly a big help. For problems where the likelihood function is much faster to compute, these results may be opposite -- it is worth thinking about this for your applications.

## Prediction intervals for the mass

Let us now consider propagating the uncertainty in $k$ and $u_0$ into computing prediction intervals for $\tilde M(t)$ at each $t$. This is done using the `get_prediction_intervals` function introduced in the second example. First, we must define our prediction function.

```julia
@inline function compute_mass_function(θ::AbstractVector{T}, data) where {T}
    k, u₀ = θ
    (; c, prob, t, alg, jac) = data
    prob.flux_parameters[1] = k
    pts = FiniteVolumeMethod.get_points(prob)
    for i in axes(pts, 2)
        pt = get_point(pts, i)
        prob.initial_condition[i] = gety(pt) ≤ c ? u₀ : zero(T)
    end
    sol = solve(prob, alg; saveat=t, parallel=true, jac_prototype=jac)
    shape_cache = zeros(T, 3)
    mass_cache = zeros(T, length(sol.u))
    compute_mass!(mass_cache, shape_cache, sol, prob)
    return mass_cache
end
```

Now let's get the intervals.
```julia
t_many_pts = LinRange(prob.initial_time, prob.final_time, 250)
jac = FiniteVolumeMethod.jacobian_sparsity(prob)
prediction_data = (c=c, prob=prob, t=t_many_pts, alg=alg, jac=jac)
parameter_wise, union_intervals, all_curves, param_range =
    get_prediction_intervals(compute_mass_function, prof, prediction_data; parallel=true)
```

Now we can visualise the curves. We will also show the mass curve from the exact parameter values, as well as from the MLE.

```julia
exact_soln = compute_mass_function([k[1], u₀], prediction_data)
mle_soln = compute_mass_function(get_mle(mle_sol), prediction_data)
fig = Figure(fontsize=38, resolution=(1360.512f0, 848.64404f0))
alp = join('a':'z')
latex_names = [L"k", L"u_0"]
for i in 1:2
    ax = Axis(fig[1, i], title=L"(%$(alp[i])): Profile-wise PI for %$(latex_names[i])",
        titlealign=:left, width=600, height=300)
    [lines!(ax, t_many_pts, all_curves[i][:, j], color=:grey) for j in eachindex(param_range[1])]
    lines!(ax, t_many_pts, exact_soln, color=:red)
    lines!(ax, t_many_pts, mle_soln, color=:blue, linestyle=:dash)
    lines!(ax, t_many_pts, getindex.(parameter_wise[i], 1), color=:black)
    lines!(ax, t_many_pts, getindex.(parameter_wise[i], 2), color=:black)
end
ax = Axis(fig[2, 1:2], title=L"(c):$ $ Union of all intervals",
    titlealign=:left, width=1200, height=300)
band!(ax, t_many_pts, getindex.(union_intervals, 1), getindex.(union_intervals, 2), color=:grey)
lines!(ax, t_many_pts, getindex.(union_intervals, 1), color=:black)
lines!(ax, t_many_pts, getindex.(union_intervals, 2), color=:black)
lines!(ax, t_many_pts, exact_soln, color=:red)
lines!(ax, t_many_pts, mle_soln, color=:blue, linestyle=:dash)
```

Let us also add onto these plots the intervals coming from the full likelihood. (The reason to just not do this everytime in applications is because the code below takes a *very* long time to compute - a lifetime compared to the profile-wise intervals above.)

```julia
lb = [8.0, 45.0]
ub = [11.0, 50.0]
N = 1e4
grid = [[lb[i] + (ub[i] - lb[i]) * rand() for _ in 1:N] for i in 1:2]
grid = permutedims(reduce(hcat, grid), (2, 1))
ig = IrregularGrid(lb, ub, grid)
gs, lik_vals = grid_search(likprob_2, ig; parallel=Val(true), save_vals=Val(true))
lik_vals .-= get_maximum(mle_sol) # normalised
feasible_idx = findall(lik_vals .> ProfileLikelihood.get_chisq_threshold(0.95)) # values in the confidence region
parameter_evals = grid[:, feasible_idx]
q = [compute_mass_function(θ, prediction_data) for θ in eachcol(parameter_evals)]
q_mat = reduce(hcat, q)
q_lwr = minimum(q_mat; dims=2) |> vec
q_upr = maximum(q_mat; dims=2) |> vec
lines!(ax, t_many_pts, q_lwr, color=:magenta)
lines!(ax, t_many_pts, q_upr, color=:magenta)
```

![Prediction intervals for the mass](https://github.com/DanielVandH/ProfileLikelihood.jl/blob/main/test/figures/heat_pde_example_mass.png?raw=true)

The exact curve has been recovered by our profile likelihood results, and the uncertainty is extremely small. Moreover, the intervals are indeed close to the interval obtained the full profile likelihood as we would hope.

## Just the code

Here is all the code used for obtaining the results in this example, should you want a version that you can directly copy and paste.

```julia
## Step 1: Define the problem. See FiniteVolumeMethod.jl
using DelaunayTriangulation, FiniteVolumeMethod
a, b, c, d = 0.0, 2.0, 0.0, 2.0
r = 0.022
GMSH_PATH = "./gmsh-4.9.4-Windows64/gmsh.exe"
tri = generate_mesh(a, b, c, d, r; gmsh_path=GMSH_PATH)
mesh = FVMGeometry(tri)
bc = ((x, y, t, u::T, p) where {T}) -> zero(T)
type = :D
BCs = BoundaryConditions(mesh, bc, type)
c = 1.0
u₀ = 50.0
f = (x, y) -> y ≤ c ? u₀ : 0.0
D = (x, y, t, u, p) -> p[1]
flux = (q, x, y, t, α, β, γ, p) -> (q[1] = -α / p[1]; q[2] = -β / p[1])
R = ((x, y, t, u::T, p) where {T}) -> zero(T)
points = get_points(tri)
initc = @views f.(points[1, :], points[2, :])
iip_flux = true
final_time = 0.1
k = [9.0]
prob = FVMProblem(mesh, BCs; iip_flux,
    flux_function=flux, reaction_function=R,
    initial_condition=initc, final_time,
    flux_parameters=deepcopy(k))

## Step 2: Generate some data.
using LinearSolve, OrdinaryDiffEq
alg = TRBDF2(linsolve=KLUFactorization(; reuse_symbolic=false))
sol = solve(prob, alg; specialization=SciMLBase.FullSpecialize, saveat=0.01)

## Step 3: Let us compute the mass at each time and then add some noise to it
using Random
function compute_mass!(M::AbstractVector{T}, αβγ, sol, prob) where {T}
    mesh_area = prob.mesh.mesh_information.total_area
    fill!(M, zero(T))
    for i in eachindex(M)
        for V in FiniteVolumeMethod.get_elements(prob)
            element = FiniteVolumeMethod.get_element_information(prob.mesh, V)
            cx, cy = FiniteVolumeMethod.get_centroid(element)
            element_area = FiniteVolumeMethod.get_area(element)
            interpolant_val = eval_interpolant!(αβγ, prob, cx, cy, V, sol.u[i])
            M[i] += (element_area / mesh_area) * interpolant_val
        end
    end
    return nothing
end
M = zeros(length(sol.t))
αβγ = zeros(3)
compute_mass!(M, αβγ, sol, prob)
true_M = deepcopy(M)
Random.seed!(29922881)
σ = 0.1
true_M .+= σ * randn(length(M))

## Step 4: We need to now construct the integrator. Here's a method for converting an FVMProblem into an integrator.
function ProfileLikelihood.construct_integrator(prob::FVMProblem, alg; ode_problem_kwargs, kwargs...)
    ode_problem = ODEProblem(prob; no_saveat=false, ode_problem_kwargs...)
    return ProfileLikelihood.construct_integrator(ode_problem, alg; kwargs...)
end
jac = float.(FiniteVolumeMethod.jacobian_sparsity(prob))
fvm_integrator = construct_integrator(prob, alg; ode_problem_kwargs=(jac_prototype=jac, saveat=0.01, parallel=true))

## Step 5: Now define the likelihood problem
using Optimization
@inline function loglik_fvm(θ::AbstractVector{T}, param, integrator) where {T}
    _k, _c, _u₀ = θ
    ## Update and solve
    (; prob) = param
    prob.flux_parameters[1] = _k
    pts = FiniteVolumeMethod.get_points(prob)
    for i in axes(pts, 2)
        pt = get_point(pts, i)
        prob.initial_condition[i] = gety(pt) ≤ _c ? _u₀ : zero(T)
    end
    reinit!(integrator, prob.initial_condition)
    solve!(integrator)
    if !SciMLBase.successful_retcode(integrator.sol)
        return typemin(T)
    end
    ## Compute the mass
    (; mass_data, mass_cache, shape_cache, sigma) = param
    compute_mass!(mass_cache, shape_cache, integrator.sol, prob)
    if any(isnan, mass_cache)
        return typemin(T)
    end
    ## Done
    ℓ = @views gaussian_loglikelihood(mass_data, mass_cache, sigma, length(mass_data))
    @show ℓ
    return ℓ
end
likprob = LikelihoodProblem(
    loglik_fvm,
    [8.54, 0.98, 29.83],
    fvm_integrator;
    syms=[:k, :c, :u₀],
    data=(prob=prob, mass_data=true_M, mass_cache=zeros(length(true_M)), shape_cache=zeros(3), sigma=σ),
    f_kwargs=(adtype=Optimization.AutoFiniteDiff(),),
    prob_kwargs=(lb=[3.0, 0.0, 0.0],
        ub=[15.0, 2.0, 250.0])
)

## Step 6: Find the MLEs
using OptimizationNLopt
mle_sol = mle(likprob, (NLopt.GN_DIRECT_L_RAND(), NLopt.LN_BOBYQA); ftol_abs=1e-8, ftol_rel=1e-8, xtol_abs=1e-8, xtol_rel=1e-8) # global, and then refine with a local algorithm

## Step 7: Profile
prof = profile(likprob, mle_sol; alg=NLopt.LN_BOBYQA,
    ftol_abs=1e-4, ftol_rel=1e-4, xtol_abs=1e-4, xtol_rel=1e-4,
    resolution=60)

## Step 8: Visualise
using CairoMakie, LaTeXStrings
fig = plot_profiles(prof; nrow=1, ncol=3,
    latex_names=[L"k", L"c", L"u_0"],
    true_vals=[k[1], c, u₀],
    fig_kwargs=(fontsize=38, resolution=(2109.644f0, 444.242f0)),
    axis_kwargs=(width=600, height=300))
scatter!(fig.content[1], get_parameter_values(prof, :k), get_profile_values(prof, :k), color=:black, markersize=9)
scatter!(fig.content[2], get_parameter_values(prof, :c), get_profile_values(prof, :c), color=:black, markersize=9)
scatter!(fig.content[3], get_parameter_values(prof, :u₀), get_profile_values(prof, :u₀), color=:black, markersize=9)
xlims!(fig.content[1], 7.0, 9.5)

### Now consider profiling only two parameters
## Step 9: Define the problem
using StaticArraysCore
@inline function loglik_fvm_2(θ::AbstractVector{T}, param, integrator) where {T}
    _k, _u₀, = θ
    (; c) = param
    new_θ = SVector{3,T}((_k, c, _u₀))
    return loglik_fvm(new_θ, param, integrator)

end
likprob_2 = LikelihoodProblem(
    loglik_fvm_2,
    [8.54, 29.83],
    fvm_integrator;
    syms=[:k, :u₀],
    data=(prob=prob, mass_data=true_M, mass_cache=zeros(length(true_M)), shape_cache=zeros(3), sigma=σ, c=c),
    f_kwargs=(adtype=Optimization.AutoFiniteDiff(),),
    prob_kwargs=(lb=[3.0, 0.0],
        ub=[15.0, 250.0])
)

## Step 10: Grid search
grid = RegularGrid(get_lower_bounds(likprob_2), get_upper_bounds(likprob_2), 50)
gs, lik_vals = grid_search(likprob_2, grid; save_vals=Val(true), parallel=Val(true));

## Step 11: Visualise
fig = Figure(fontsize=38)
k_grid = get_range(grid, 1)
u₀_grid = get_range(grid, 2)
ax = Axis(fig[1, 1],
    xlabel=L"k", ylabel=L"u_0",
    xticks=0:3:15,
    yticks=0:50:250)
co = heatmap!(ax, k_grid, u₀_grid, lik_vals, colormap=Reverse(:matter))
contour!(ax, k_grid, u₀_grid, lik_vals, levels=40, color=:black, linewidth=1 / 4)
scatter!(ax, [k[1]], [u₀], color=:white, markersize=14)
scatter!(ax, [gs[:k]], [gs[:u₀]], color=:blue, markersize=14)
clb = Colorbar(fig[1, 2], co, label=L"\ell(k, u_0)", vertical=true)

## Step 12: Find the MLEs and profile
likprob_2 = update_initial_estimate(likprob_2, gs)
mle_sol = mle(likprob_2, NLopt.LN_BOBYQA; ftol_abs=1e-8, ftol_rel=1e-8, xtol_abs=1e-8, xtol_rel=1e-8)
prof = profile(likprob_2, mle_sol; ftol_abs=1e-4, ftol_rel=1e-4, xtol_abs=1e-4, xtol_rel=1e-4, parallel=true)

## Step 13: Visualise the profile
fig = plot_profiles(prof; nrow=1, ncol=3,
    latex_names=[L"k", L"u_0"],
    true_vals=[k[1], u₀],
    fig_kwargs=(fontsize=38, resolution=(1441.9216f0, 470.17322f0)),
    axis_kwargs=(width=600, height=300))
scatter!(fig.content[1], get_parameter_values(prof, :k), get_profile_values(prof, :k), color=:black, markersize=9)
scatter!(fig.content[2], get_parameter_values(prof, :u₀), get_profile_values(prof, :u₀), color=:black, markersize=9)

## Step 14: Compute prediction intervals for the mass
@inline function compute_mass_function(θ::AbstractVector{T}, data) where {T}
    k, u₀ = θ
    (; c, prob, t, alg, jac) = data
    prob.flux_parameters[1] = k
    pts = FiniteVolumeMethod.get_points(prob)
    for i in axes(pts, 2)
        pt = get_point(pts, i)
        prob.initial_condition[i] = gety(pt) ≤ c ? u₀ : zero(T)
    end
    sol = solve(prob, alg; saveat=t, parallel=true, jac_prototype=jac)
    shape_cache = zeros(T, 3)
    mass_cache = zeros(T, length(sol.u))
    compute_mass!(mass_cache, shape_cache, sol, prob)
    return mass_cache
end
t_many_pts = LinRange(prob.initial_time, prob.final_time, 250)
jac = FiniteVolumeMethod.jacobian_sparsity(prob)
prediction_data = (c=c, prob=prob, t=t_many_pts, alg=alg, jac=jac)
parameter_wise, union_intervals, all_curves, param_range =
    get_prediction_intervals(compute_mass_function, prof, prediction_data; parallel=true)

## Step 15: Visualise the prediction intervals
exact_soln = compute_mass_function([k[1], u₀], prediction_data)
mle_soln = compute_mass_function(get_mle(mle_sol), prediction_data)

fig = Figure(fontsize=38, resolution=(1360.512f0, 848.64404f0))
alp = join('a':'z')
latex_names = [L"k", L"u_0"]
for i in 1:2
    ax = Axis(fig[1, i], title=L"(%$(alp[i])): Profile-wise PI for %$(latex_names[i])",
        titlealign=:left, width=600, height=300)
    [lines!(ax, t_many_pts, all_curves[i][:, j], color=:grey) for j in eachindex(param_range[1])]
    lines!(ax, t_many_pts, exact_soln, color=:red)
    lines!(ax, t_many_pts, mle_soln, color=:blue, linestyle=:dash)
    lines!(ax, t_many_pts, getindex.(parameter_wise[i], 1), color=:black)
    lines!(ax, t_many_pts, getindex.(parameter_wise[i], 2), color=:black)
end
ax = Axis(fig[2, 1:2], title=L"(c):$ $ Union of all intervals",
    titlealign=:left, width=1200, height=300)
band!(ax, t_many_pts, getindex.(union_intervals, 1), getindex.(union_intervals, 2), color=:grey)
lines!(ax, t_many_pts, getindex.(union_intervals, 1), color=:black)
lines!(ax, t_many_pts, getindex.(union_intervals, 2), color=:black)
lines!(ax, t_many_pts, exact_soln, color=:red)
lines!(ax, t_many_pts, mle_soln, color=:blue, linestyle=:dash)

lb = [8.0, 45.0]
ub = [11.0, 50.0]
N = 1e4
grid = [[lb[i] + (ub[i] - lb[i]) * rand() for _ in 1:N] for i in 1:2]
grid = permutedims(reduce(hcat, grid), (2, 1))
ig = IrregularGrid(lb, ub, grid)
gs, lik_vals = grid_search(likprob_2, ig; parallel=Val(true), save_vals=Val(true))
lik_vals .-= get_maximum(mle_sol) # normalised
feasible_idx = findall(lik_vals .> ProfileLikelihood.get_chisq_threshold(0.95)) # values in the confidence region
parameter_evals = grid[:, feasible_idx]
q = [compute_mass_function(θ, prediction_data) for θ in eachcol(parameter_evals)]
q_mat = reduce(hcat, q)
q_lwr = minimum(q_mat; dims=2) |> vec
q_upr = maximum(q_mat; dims=2) |> vec
lines!(ax, t_many_pts, q_lwr, color=:magenta)
lines!(ax, t_many_pts, q_upr, color=:magenta)
```

gha_language: Julia


text:
## GLOM - Pytorch (wip)

An attempt at the implementation of Glom, Geoffrey Hinton's new idea that integrates neural fields, predictive coding, top-down-bottom-up, and attention (consensus between columns) for emergent part-whole heirarchies from data.

## Citations

```bibtex
@misc{hinton2021represent,
    title   = {How to represent part-whole hierarchies in a neural network},
    author  = {Geoffrey Hinton},
    year    = {2021},
    eprint  = {2102.12627},
    archivePrefix = {arXiv},
    primaryClass = {cs.CV}
}
```

repository: Harphies/glom-pytorch

repo_name: Harphies/glom-pytorch


text:
---
title: 'Coming soon!'
description:
  "This guide is still under active development, and you should expect regular updates to the guide. This chapter lets you know what's on our mind for what to write next, and tells you how to let us know what you'd like to see."
type: chapter
---

<textblock>

Let us know what tasks you'd like to see us write about, and we'll prioritize accordingly.

</textblock>

<exercise id="1" title="Coming soon to part 2">

Is there a part of AllenNLP that you find confusing, or would like to learn more about, and we don't
have a chapter on it yet?  [Let us
know!](https://github.com/allenai/allennlp-guide#requesting-new-chapters)

These are chapters that are currently under construction for part 2:

* Testing your code: Recommendations and utilities for testing NLP code
* Building a demo: Predictors, and designing code with demos in mind
* Writing your own script as an entry point to AllenNLP

These are chapters that we'd like to write soon:

* Training and evaluating your model (Trainer, Optimizers, and related abstractions)
* Interpreting your model’s predictions (How to use AllenNLP Interpret)

</exercise>

<exercise id="2" title="Coming soon to part 3">

Is there an NLP task that you would like to do with AllenNLP, but you're not sure how?
[Let us know!](https://github.com/allenai/allennlp-guide#requesting-new-chapters)

These are some of the things that we could write about for part 3:

* Semantic parsing (in progress)
* Zero-shot text classification
* GANs and other alternating losses
* Sequence labeling
* Language modeling
* Sentence pair classification
* Span classification
* Syntactic parsing
* Reading comprehension
* Sequence to sequence models

If there is one of these that you'd particularly like to see, or one that's not on this list that
you'd like to have added, we'd like to know about it.

</exercise>

repository: jacobdanovitch/allennlp-guide

gha_license_id: NOASSERTION

repo_name: jacobdanovitch/allennlp-guide


text:
# Java/Spring OpenID Connect Sample

### Overview

The project is a Java/Spring sample of the [OpenID Connect Authorization Code Flow](http://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth) with Ping Federate.

### Configuration

This website is meant to work with [Heroku](https://www.heroku.com/) and requires a `.env` file with the following values:

* AUTHORIZATION_ENDPOINT - the authorization endpoint for Ping Federate
* TOKEN_ENDPOINT - the token endpoint for Ping Federate
* CLIENT_ID - your configured client ID for this website
* CLIENT_SECRET - your configured client secret for this website
* ADAPTER_ID - the adapter ID to be used by this website
* REDIRECT_URI - the redirect URI. This should be the `/authentication/login` endpoint
* SCOPES - the scopes to be sent to Ping Federate. If including multiple scopes, separate with a space; this string is URL encoded before being sent to the server

```
AUTHORIZATION_ENDPOINT=https://localhost:9031/as/authorization.oauth2
TOKEN_ENDPOINT=https://localhost:9031/as/token.oauth2
CLIENT_ID=<your client id>
CLIENT_SECRET=<your client secret>
ADAPTER_ID=<your adapter id>
REDIRECT_URI=http://localhost:5000/authentication/login
SCOPES=openid profile
```

### Disclaimer

This software is open sourced by Ping Identity but not supported commercially as such. Any questions/issues should go to the Github issues tracker or discuss on the [Ping Identity Developer Communities](https://community.pingidentity.com/collaborate). See also the DISCLAIMER file in this directory.

Ping Identity Developer Communities: https://community.pingidentity.com/collaborate
<br/>
Ping Identity Developer Site: https://developer.pingidentity.com/connect

repository: hyperdom/java-spring-oidc

repo_name: hyperdom/java-spring-oidc


text:
---
layout: tutorial
key: architecture
title: "Creating Tomcat Image with Docker File"
index: 3524
subcategory: docker
date: 2017-10-25
tags: [Docker, Dockerfile, Tomcat]
---

> Tutorial for how to create tomcat image with Dockerfile.

## 1. What is Dockerfile?
Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Using docker build users can create an automated build that executes several command-line instructions in succession.

## 2. What We've Done Until Now?
In posting [Serving JSP Application With Tomcat In Docker]({% link _architecture/docker/serving-jsp-application-with-tomcat-in-docker.md %}) and [Enabling Tomcat Debugging in Docker for Eclipse]({% link _architecture/docker/enabling-tomcat-debugging-in-docker-for-eclipse.md %}), we deployed the JSP Tutorial application to Tomcat container with enabling the remote debugging. Below is the command we used.
```raw
$ docker run --name=jsptomcat -d -v ~/Documents/jsptomcat:/usr/local/tomcat/webapps/jsptutorial -p 31020:8080 -p 8000:8000 -e JPDA_ADDRESS=8000 tomcat catalina.sh jpda run
```
What is this command doing?
* Create a tomcat container named `jsptomcat`.
* Map local folder `~/Documents/jsptomcat` to `/usr/local/tomcat/webapps/jsptutorial` in Tomcat container.
* Expose `8080` for outside world to connect to the website.
* Expose `8000` to enable remote debugging for tools like eclipse.
* Set environment variable `JPDA_ADDRESS` to 8000.
* Start tomcat via command `catalina.sh jpda run`.

In this posting, we will use Dockerfile to create a tomcat image with the same configuration mentioned above. Before moving forward, make sure you’ve already setup folder ~/Documents/jsptomcat in local machine, which will be volumed to tomcat container later. And all jsp and class files have been deployed into this folder.
![image](/assets/images/architecture/3524/localfolder.png){:width="800px"}

## 3. Creating Tomcat Image with Dockerfile
### 3.1 Creating Docker File
Create one file named `Dockerfile` in any directory on local machine.
```raw
$ cd ~/Johnny
$ mkdir DockerTomcat
$ cd DockerTomcat
$ vim Dockerfile
```
Edit Dockerfile, fill with following content.
```raw
#Create Tomcat Image for JSP Tutorial Application
FROM tomcat
MAINTAINER<EMAIL_ADDRESS>
ENV JPDA_ADDRESS 8000
EXPOSE 8000
EXPOSE 8080
ENTRYPOINT ["catalina.sh", "jpda","run"]
CMD echo "jsptomcat is launched"
```
The following points need to be noted about the above file.
* The first line is a comment. You can add comments to the Docker File with the help of the # command
* The FROM keyword tells which base image you want to use. In our example, we are creating an image from the tomcat image.
* The next command is the person who is going to maintain this image.
* The ENV command is used to set environment variable. We set JPDA_ADDRESS to 8000 to enable remote debugging in tomcat container.
* The EXPOSE command exposes port of the image.
* The ENTRYPOINT command launch tomcat with running jpda for remote debugging. Notice, ENTRYPOINT only executes for container not image. To run command when creating image, use CMD keyword.
* The last line prints message to screen indicating container is running.

### 2.2 Creating Image with Dockerfile
Open Docker terminal, navigate to the folder where the Dockerfile locates. Run the following command.
```raw
$ docker build -t jsptomcat:0.2 .
```
Here, `jsptomcat` is the name we are giving to the Image and `0.2` is the tag number. The last dot `.` indicates the current location. Check whether the image is created.
```raw
$ docker images
```
As you see, the new image is created with tag 0.2.
![image](/assets/images/architecture/3524/imagecreated.png){:width="800px"}

## 3. Testing Tomcat Image
### 3.1 Running Container
In docker terminal, run the following command. (Make sure remove the tomcat container we created before.)
```raw
$ docker run --name=jsptomcat -d -v ~/Documents/jsptomcat:/usr/local/tomcat/webapps/jsptutorial -p 31020:8080 -p 8000:8000 jsptomcat:0.2
```
Notice we don't need to set the environment variable `JPDA_ADDRESS`, and execute `catalina.sh jpda run` any more. They are already set in the Dockerfile.
### 3.2 Verifying Container in Kitematic
A tomcat container named jsptomcat is running now. Notice, its source image is 'jsptomcat:0.2'. And environment variable JPDA_ADDRESS has been added to the container.
![image](/assets/images/architecture/3524/general.png)
Port 8000 and port 8080 are also exposed.
![image](/assets/images/architecture/3524/ports.png)
Volume is also configured correctly.
![image](/assets/images/architecture/3524/volume.png)

### 3.3 Verifying JSP Tutorial Website
Access http://<IP_ADDRESS>:31020/jsptutorial/productlist.jsp in web browser. JSP Tutorial application is launched successfully!
![image](/assets/images/architecture/3524/deployed.png)

In Eclipse, enable debugging and set breakpoint to `productlist.jsp`. Refresh the page in web browser. Switch back to Eclipse, the breakpoint is activated. The remote debugging function is working now.
![image](/assets/images/architecture/3524/breakpointdt.png)

## 4. Source Files
* [Source files for JSPTutorialDockerfile on GitHub](https://github.com/jojozhuang/Tutorials/tree/master/JSPTutorialDockerfile)

## 5. References
* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/)
* [Docker - File](https://www.tutorialspoint.com/docker/docker_file.htm)
* [How to publish ports in docker files](https://stackoverflow.com/questions/32740344/how-to-publish-ports-in-docker-files)


text:
# Salesforce-Einstein-Predictions-vs-SKLearn
Files supporting blog post at https://www.neuralfizz.com/home/can-salesforce-einstein-help-you-make-better-predictions

Jupyter Notebook contains full walk-through of project and results.

`LICENSE.TXT` - MIT Open License

`Einstein vs SKLearn.ipynb` - Jupyter Notebook for comparison of SalesForce Einstein predictions vs. using the same data with SKLearn and RandomForestClassifier

`SF Prediction Data.csv` - Data set used in blog post and by notebook


text:
---
layout: post
title: SQL
author: Jim Vanderveen
category: upcoming
tags: meeting sql
---

## Attending

Anyone interested in learning about structured databases for storing and
organizing your data.

## SQL with Jim Vanderveen

This will be a short "hands-on" introduction to SQLite, demonstrating basic CRUD (Create, Read, Update, Delete) operations and your new best friend, the Data Dictionary. If time permits, we'll also cover additional topics such as NULL values, logically linking multiple tables using JOIN, and some aggregations, e.g. COUNT and SUM.

### Short bio

I've been hacking computers since 1976 when I taught myself BASIC. I started working with SQL and relational databases circa 1995. Lately I've been doing database programming for the UC Davis Library, and playing with network- and database "Internet of Things" projects in my spare time.

### Prerequisites

Attendees should have followed the [Software Carpentry Standard Installation]({{ site.url }}/swc-installation.html) on their laptops. In particular, you will need to have SQLite installed.

Attendees should also be familiar with a text editor on their laptops.

### Installation

The linked installation instructions will setup a basic environment on your
operating system of choice (Windows, Mac, Linux) that will give you access to
BASH, Python, Git, and R. In addition, you will need an up-to-date web browser.

[Software Carpentry Standard Installation]({{ site.url }}/swc-installation.html)

### Materials

[https://github.com/DavisDaddy/hacker-talks/tree/master/internals](https://github.com/DavisDaddy/hacker-talks/tree/master/internals)

## Lightning Talks

Please let us know if you'd like to give and informal 3-5 minute lightning
talk. Post and issue or a pull request at:

[https://github.com/thehackerwithin/davis](https://github.com/thehackerwithin/davis)

TBA

## Meeting Materials

[materials](https://github.com/thehackerwithin/davis/tree/gh-pages/meeting-materials/2016-03-10)

repository: jimvanderveen/davis

branch_name: refs/heads/gh-pages

extension: markdown

gha_language: Jupyter Notebook

repo_name: jimvanderveen/davis


text:
# bazo-client

The command line interface for interacting with the Bazo blockchain implemented in Go.

## Setup Instructions

The programming language Go (developed and tested with version >= 1.9) must be installed, the properties `$GOROOT` and `$GOPATH` must be set.
For more information, please check out the [official documentation](https://github.com/golang/go/wiki/SettingGOPATH).

Furthermore, the `configuration.json` in the root directory of the bazo-client must be properly configured before
interacting with the CLI.

Contents of `configuration.json`:
```json
{
  "this_client": {
    "ip": "<IP_ADDRESS>",
    "port": "8010"
  },
  "bootstrap_server": {
    "ip": "<IP_ADDRESS>",
    "port": "8000"
  },
  "multisig_server": {
    "ip": "<IP_ADDRESS>",
    "port": "8020"
  }
}
```

## Getting Started

The Bazo client provides an intuitive and beginner-friendly command line interface.

```bash
bazo-client [global options] command [command options] [arguments...]
```

Options
* `--help, -h`: Show help
* `--version, -v`: Print the version

### Accounts

While everybody can check the state of accounts, only somebody in possession of the root private key can
create accounts or add existing accounts to the network.

#### Check Account State

```bash
bazo-client account check [command options] [arguments...]
```

Options
* `--file`: Load the 128 byte address from a file
* `--address`: Instead of passing the account's address by file with `--file`, you can also directly pass the 128 byte address

Examples

```bash
bazo-client account check b978...<120 byte omitted>...e86ba
bazo-client account check myaccount.txt
```

#### Create Account

Create a new account and add it to the network. Save the public-private keypair to a file.

```bash
bazo-client account create [command options] [arguments...]
```

Options
* `--header`: (default: 0) Set header flag
* `--fee`: (default: 1) Set transaction fee
* `--rootwallet`: Load root's private key from this file
* `--file`: Save the new account's public and private key to this file

Examples

```bash
bazo-client account create --rootwallet root.txt --wallet newaccount.txt
bazo-client account create --rootwallet root.txt --wallet newaccount.txt --fee 5
```

#### Add Account

Add an existing account to the network.

```bash
bazo-client account add [command options] [arguments...]
```

Options
* `--header`: (default: 0) Set header flag
* `--fee`: (default: 1) Set transaction fee
* `--rootwallet`: Load root's private key from this file
* `--address`: Existing account's 128 byte address

```bash
bazo-client account create --rootwallet root.txt --address b978...<120 byte omitted>...e86ba
bazo-client account create --rootwallet root.txt --address b978...<120 byte omitted>...e86ba --fee 5
```

### Funds

Send Bazo coins from one account to another.

```bash
bazo-client funds [command options] [arguments...]
```

Options
* `--header`: (default: 0) Set header flag
* `--fee`: (default: 1) Set transaction fee
* `--txcount`: The sender's current transaction counter
* `--amount`: The amount to transfer from sender to recipient
* `--from`: The file to load the sender's private key from
* `--to`: The file to load the recipient's public key from
* `--toAddress`: Instead of passing the recipient's address by file with `--to`, you can also directly pass the recipient's address with this option
* `--multisig`: (optional) The file to load the multisig's private key from.

Examples

```bash
bazo-client funds --from myaccount.txt --to recipient.txt --txcount 0 --amount 100
bazo-client funds --from myaccount.txt --to recipient.txt --txcount 1 --amount 100 --multisig myaccount.txt
bazo-client funds --from myaccount.txt --toAddress b978...<120 byte omitted>...e86ba --txcount 2 --amount 100 --fee 15
```

### Network

Configure network settings.

```bash
bazo-client network [command options] [arguments...]
```

Options
* `--header`: (default: 0) Set header flag
* `--fee`: (default: 1) Set transaction fee
* `--txcount`: The sender's current transaction counter
* `--rootwallet`: Load root's private key from this file
* `--setBlockSize`: Set the size of blocks (in bytes)
* `--setDifficultyInterval`: Set the difficulty interval (in number of blocks)
* `--setMinimumFee`: Set the minimum fee (in Bazo coins)
* `--setBlockInterval`: Set the block interval (in seconds)
* `--setBlockReward`: Set the block reward (in Bazo coins)

Examples

```bash
bazo-client network --txcount 0 --rootwallet root.txt --setBlockSize 2048
bazo-client network --txcount 1 --rootwallet root.txt --setDifficultyInterval 10
bazo-client network --txcount 2 --rootwallet root.txt --setMinimumFee 10
bazo-client network --txcount 3 --rootwallet root.txt --setBlockInterval 120
bazo-client network --txcount 4 --rootwallet root.txt --setBlockReward 5
```

Note that each setting broadcasts one `ConfigTx` to the network.

### Staking

Join or leave the pool of validators by enabling or disabling staking.

```bash
 bazo-client staking [command options] [arguments...]
```

Options:
* `--header`: (default: 0) Set header flag
* `--fee`: (default: 1) Set transaction fee
* `--wallet`: The file to load the validator's private key from

#### Enable Staking

Join the pool of validators.

```bash
bazo-client staking enable [command options] [arguments...]
```

Options
* `--commitment`: The file to load the validator's commitment key from. A new commitment key is generated if it does not exist yet.

Example

```bash
bazo-client staking enable --wallet mywallet.txt --commitment commitment.txt
```

 #### Disable Staking

Leave the pool of validators.

```bash
bazo-client staking disable [command options] [arguments...]
```

Example

```bash
bazo-client staking disable --wallet myaccount.txt
```

### REST

Start the REST service.

```bash
bazo-client rest
```


text:
# cargo-fuzz-sourcer

Enhance [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz) output with your
source code. Caution this is only a PoC.

## Case study

Have you ever played with `cargo-fuzz` and found a memory leak? If not, this is what it
looks like:

![before](./img/before.png)

So, what do I do with this trace? How do I know what code triggers it? From the
offsets? Using `objdump` manually is painful way. However, you can use this tool
to help you.

![after](./img/after.png)

The tool will parse the output of the `cargo-fuzz` and try to determine the
lines that cause memory leaks. Also, the code is highlighted using
[pygments](https://pygments.org/).

## Instructions

Installation:

```bash
git clone https://github.com/MatejKastak/cargo-fuzz-sourcer
pip install .

# Or install into virtual env
```

Usage:

```bash
cargo fuzz <your_target> --dev 2>&1 | cargo-fuzz-sourcer
```

## I want to try it

I have prepared a simple Rust library that contains a obvious memory leak. You
can fuzz it and quickly find it. The output will be annotated if you use the
following command.

```bash
cd leak
cargo fuzz run fuzz_target_1 --dev 2>&1 | cargo-fuzz-sourcer
```

repository: MatejKastak/cargo-fuzz-sourcer

repo_name: MatejKastak/cargo-fuzz-sourcer


text:
lua-policies
============

Example business policies, implemented in the Momentum Business Policy Framework.

These Lua modules only work within the Momentum messaging server, and are provided by Message Systems as a way to help build your own custom policy.  Suggested changes or forks are encouraged.

These policies are loaded by loading the included policy.lua file into Momentum:

scriptlet "scriptlet" {
  script "policy" {
    source = "policy"
  }
}

And then adding your policy to this array in policy.lua:

-- This is the list of policies to load, a Lua array
local policies = {
  "inbound.limits",
  "inbound.rbl",
  "inbound.fcdns",
};

gha_language: Lua


text:
# govy-bot

> A GitHub App built with [Probot](https://github.com/probot/probot) that A Probot app

## Decision Flow

### Assigning influence points

## Development

### Setup

```sh
# Install dependencies
npm install

# Run the bot
npm start
```

### Docker

```sh
# 1. Build container
docker build -t govy-bot .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> govy-bot
```

## Contributing

If you have suggestions for how govy-bot could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the [Contributing Guide](CONTRIBUTING.md).

## License

[MIT](LICENSE) © 2021 Francisco Miguel Aramburo Torres<EMAIL_ADDRESS>

repository: VledicFranco/govy-bot

repo_name: VledicFranco/govy-bot


text:
# Programming Exercises

Various programming exercises for my college courses.

## Index

1. [Intelligent Systems](https://github.com/nirantak/Programming_Exercises/tree/master/Intelligent_Systems)
   - State Space Search, Intelligent Agents in Python
2. [Soft Computing](https://github.com/nirantak/Programming_Exercises/tree/master/Soft_Computing)
   - Machine Learning, Neural Networks using Numpy
3. [Data Mining](https://github.com/nirantak/Programming_Exercises/tree/master/Data_Mining)
   - Classification, Clustering using Pandas
4. [Image Processing](https://github.com/nirantak/Programming_Exercises/tree/master/Image_Processing)
   - Greyscale image processing in MATLAB
5. [Miscellaneous Coding Problems](https://github.com/nirantak/Programming_Exercises/tree/master/Misc)

repository: nirantak/programming-exercises

repo_name: nirantak/programming-exercises


text:
# {Portfolio}
#### {Portfolio for student Munge,of Moringa school}, {17/03/2019}
#### By **{Munge Kevin}**
## Description
{This portfolio describe my week one journey at Moringa School ,it includes background information about me and samples of work}
## Setup/Installation Requirements
* git for version control
* atom text editor
* html and css language
* server space
* registered domain name or github pages
{you will require a simple server space for hosting to the web for your clients to view}
## Known Bugs
{the website is still on development and so far we have no known bugs recorded}
## Technologies Used
{HTML, CSS, GIT}
## Support and contact details
{contact : munge kevin<PHONE_NUMBER>, github.com/kmunge}
### License
*{MIT License

Copyright (c) [2019] [munge kevin]

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.}*
Copyright (c) {2019} **{wayokenya limited}**

repository: kmunge/my-portfolio

repo_name: kmunge/my-portfolio


text:
# Magic: The Gathering Arena Log Parser #
[![Build Status](https://travis-ci.org/gathering-gg/parser.svg?branch=master)](https://travis-ci.org/gathering-gg/parser)
[![GoDoc](https://godoc.org/github.com/gathering-gg/parser?status.svg)](https://godoc.org/github.com/gathering-gg/parser)

_Parser_ is a Go library and command line interface to parse the
`output_log.txt` created by MTGA. Cross platform with minimal dependencies, the
executable is _small_. The CLI is currently used to send the parsed data to
[Gathering.gg](https://gathering.gg), and you need an account to use it. Future
work can be done to parse the data to local files.

## Usage ##
To use the parser, you'll need a [Go dev
environment](https://golang.org/doc/install). To use the parser locally:

```
$ go get github.com/gathering-gg/parser
```

If you want to install the CLI and use that:
```
$ go install github.com/gathering-gg/parser/cli
```
You can then execute it by running (You may need to add [Go's bin to your
path](https://github.com/golang/go/wiki/GOPATH)):
```
$ gathering -token=YOUR_GATHERING_GG_TOKEN
```
You can get your token from [Gathering.gg](https://gathering.gg).

#### Binaries ####
If you just want to execute a binary, you can get them from the
[releases](https://github.com/gathering-gg/parser/releases) page.

## Development ##
Once you have your Go dev environment setup, fetch the library:

```
$ go get github.com/gathering-gg/parser
$ cd $GOPATH/src/github.com/gathering-gg/parser
```

You can the start hacking on the library. To build the library, you run `go
build`, however there are some compile time variables that should be set. The
current command used to build is:

```
go build -ldflags "-X 'github.com/gathering-gg/gathering/config.Root=https://api.gathering.gg' -X 'github.com/gathering-gg/gathering/config.Version=0.0.1'" -o gathering ./cli
```
You can also build for specific platforms by appending `GOOS` and `GOARCH`
environment variables.

Tests:
```
$ go test -v ./...
```

## Changelog ##
See the [releases](https://github.com/gathering-gg/parser/releases) page.

## Contributing ##
Please contribute! If you have a problem with the parser you can [open an
issue](https://github.com/gathering-gg/parser/issues/new). Feel free to ask for
new features as well!

## Profiling ##
https://blog.golang.org/profiling-go-programs

```
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
var memprofile = flag.String("memprofile", "", "write memory profile to this file")

//

if *cpuprofile != "" {
  f, err := os.Create("cpu.prof")
    if err != nil {
      log.Fatal(err)
    }
  pprof.StartCPUProfile(f)
    defer pprof.StopCPUProfile()
}
if *memprofile != "" {
  f, err := os.Create(*memprofile)
    if err != nil {
      log.Fatal(err)
    }
  defer func() {
    pprof.WriteHeapProfile(f)
      f.Close()
  }()
}

// Add onChange(file) to bottom of main()
```

repository: gathering-gg/parser

repo_name: gathering-gg/parser


text:
---
layout: post
title:  Internships in laptop.bg
category: posts
---

[laptop.bg][] is organizing a 3 month internship program focused on Ruby on
Rails.

The internship is suitable for students interested in Ruby, Rails and are
seeking a professional web development career. Previous experience is **not**
required.

The internship offers you a 4 hour workday with a flexible schedule,
personalized for your lectures and exams.

[laptop.bg][] is working successfully with Ruby on Rails for 5 years. In that
time, they have learnt that sharing the experience, the meeting of new people
and the joy of programming lead to wonderful results.

The internship programs are a great way to introduce young software developers
into a real working environment, while still being able to focus on their
studies.

If this sounds tempting, send [laptop.bg] a message on<EMAIL_ADDRESS>until
15th of February 2015.

[laptop.bg]: http://laptop.com/

gha_language: CSS


text:
# Xamarin.BluetoothLE

To get started, register the IAdapter implementation in AppDelegate.cs and MainActivity.cs:

```
DependencyService.Register<IAdapter, Adapter>
```

Then, to retrieve the implementation from your cross-platform code:

```
DependencyService.Get<IAdapter>();
```

**Note:** You should only ever instantiate one instance of `IAdapter`. I have used the following code to use a single instance throughout my code:

```
private static readonly IAdapter _bluetoothAdapter;
public static IAdapter BluetoothAdapter { get { return _bluetoothAdapter; } }

static App() {
	_bluetoothAdapter = DependencyService.Get<IAdapter>();

	_bluetoothAdapter.ScanTimeout = TimeSpan.FromSeconds(10);
	_bluetoothAdapter.ConnectionTimeout = TimeSpan.FromSeconds(10);
}
```

Then, the `IAdapter` can be retrieved with:

```
App.BluetoothAdapter
```

Once you have an `IAdapter`, see the documentation [here](https://github.com/tbrushwyler/Xamarin.BluetoothLE/wiki/N_BluetoothLE_Core) for usage.

##Nuget
The library can be installed as a [nuget](https://www.nuget.org/packages/XamarinBluetoothLE/1.0.1-alpha-4) package. Currently can be found as a pre-release.


text:
# Michelin 3 star Restaurant Backend
This is the backend code for Michelin 3 Star Restaurant. Please refer to the main README on how to get started.

## Available Scripts
`yarn start` - Runs the app in the development mode. Open [http://localhost:3001](http://localhost:3001) to view it in the browser.
`yarn test` - Launches the test runner in the interactive watch mode.
`yarn build` - Builds the app for production to the `build` folder. It correctly bundles React in production mode and optimizes the build for the best performance.

repository: eqfy/three-star-restaurant

repo_name: eqfy/three-star-restaurant


text:
# Node Architecture

> V2 release

## System Overview

<img src="_img/node.png">

A single Orbs node is built from multiple subsystems and may span multiple physical machines. The diagram above ignores allocation of subsystems/services to physical machines and focuses on which services are part of the node and how data flows between them.

### Boyar

This daemon service is the main orchestrator of the node. This is the first service to run and its purpose is to execute all the other services, provide their launch configuration, upgrade their software version, etc. Boyar relies on [Docker Swarm](https://docs.docker.com/engine/swarm/) to execute all other services as docker containers across all available physical machines and monitor their liveness. Since Boyar instructs Docker Swarm itself, it is running outside of Docker.

Architecture: [BOYAR.md](BOYAR.md)

Source code: https://github.com/orbs-network/boyarin

### ONG (Orbs-network-go)

An Orbs node runs multiple virtual chains side by side. Each virtual chain is an isolated blockchain instance that has its own consensus and blocks. Every virtual chain has an owner paying for its subscription and is normally focused around a specific decentralized app running on top of this virtual chain as a set of smart contracts. Every virtual chain instance runs in its own isolated docker container managed by Boyar.

Architecture: [Virtual Chain (ONG) Architecture](../vchain-architecture/)

Source code: https://github.com/orbs-network/orbs-network-go

### Node Services

Various daemon services are required for an Orbs node to operate. They usually have a single instance that serves the node in its entirety. These services are dockerized and managed by Boyar. These services include:

* **HTTP API gateway** - HTTP server that provides the external [API endpoint](https://www.nginx.com/blog/building-microservices-using-an-api-gateway/) to end-users for virtual chain Public API (eg. a virtual chain end-user trying to perform a transaction or make a query). Proxies the HTTP request to the relevant ONG instance. This is an off-the-shelf HTTP proxy server (Nginx) configured by Boyar to be aligned with the state of the other node services.

    Source code: https://github.com/nginx/nginx

* **Management Service** - Reads ongoing node management configuration from its external source of truth (eg. Ethereum) and serves it to Boyar and ONG instances. Management configuration includes for example: elected committee (which nodes are authorized to validate blocks per VC), subscriptions (which virtual chains should be active), topology (network addresses of all committee and candidate nodes), the list of node services, and their configurations and binary versions.

    Architecture: [MGMT-SERVICE.md](MGMT-SERVICE.md)

    Source code: https://github.com/orbs-network/management-service

* **Ethereum Writer** - In order for an Orbs node to participate in the Proof-of-Stake process on Ethereum, various Ethereum transactions must be sent routinely. For example, sending an aggregated peer reputation decision to Ethereum to support automatic vote outs.

    Architecture: [ETH-WRITER.md](ETH-WRITER.md)

    Source code: https://github.com/orbs-network/ethereum-writer

* **Signer** - Manages the node private keys (Orbs and Ethereum) securely and signs transactions on behalf of the node. Used by ONG to sign blocks and protocol messages. Also used by Ethereum Writer to sign Ethereum transactions.

    Source code: https://github.com/orbs-network/signer-service

* **Logs Service** - Simple HTTP server to explose rotating log files written by the various node services/ONG. All log files are written by the services to persistent disk storage in known locations which this service makes available to query.

    Source code: https://github.com/orbs-network/logs-service

* **Ethereum Client** - Since a public Orbs node relies on Ethereum as the source of truth for management configuration, such as elected validators (based on Proof-of-Stake taking place on Ethereum), connection to the Ethereum blockchain is crucial for continuous operation. Many validators rely on an external Ethereum client using a third-party service such as [Infura](https://infura.io/) or [Alchemy](https://alchemyapi.io/).

    Source code: https://github.com/ethereum/go-ethereum

## Creating a New Node

When running an Orbs node on a cloud service like [AWS](https://aws.amazon.com/), a convenience CLI tool named [Polygon](https://github.com/orbs-network/polygon) can provision all node resources automatically (compute machines, storage, etc). Polygon relies on [Terraform](https://www.terraform.io/) to interact with popular cloud providers. Polygon configures the Boyar daemon and ensures it is launched after boot.

When running an Orbs node on-premise, all resources must be provisioned manually. The Boyar daemon must be configured and launched manually as well.

## Monitoring and Logging

Logging is a cross-cutting concern of the entire system since each of its parts (Boyar, all ONG instances, all node services) generates its own separate log. In addition, the entire network (all validators) can be monitored using a Status Page backend which can be executed and deployed by anyone.

Architecture: [LOGGING.md](LOGGING.md)

Source code: https://github.com/orbs-network/status-page-v2

## Ethereum Contracts

Most of the Orbs Proof-of-Stake logic (staking, elections, rewards, subscriptions) is implemented over Ethereum as an independent source of truth, using a set of Solidity smart contracts. Orbs nodes communicate with these smart contracts via Management Service and Ethereum Writer service.

Architecture: [Orbs PoS Architecture](../pos-architecture/)

Source code: https://github.com/orbs-network/orbs-ethereum-contracts-v2

repository: orbs-network/orbs-spec

repo_name: orbs-network/orbs-spec


text:
## How to Open a Ticket

- Before you open a ticket or send a pull request,
  [search](https://github.com/mixmaxhq/neckbone/issues) for previous discussions
  about the same feature or issue. Add to the earlier ticket if you find one.

- Before sending a pull request for a feature or bug fix, be sure to have
  [tests](http://backbonejs.org/test/).

- Use the same coding style as the rest of the
  [codebase](https://github.com/mixmaxhq/neckbone/tree/master).

- All pull requests should be made to the `master` branch.

repository: skeggse/neckbone

repo_name: skeggse/neckbone


text:
---
layout: post
title: One-liner to test the requirements for building the Linux Kernel
---

I applied to a program at the Linux Foundation, and even though it didn't go exactly well (I was too
slow to complete a challenge) I learned a lot of things. But I found it tiresome to check manually if
each program in Documentation/Changes is installed, so I came up with this one-liner.

```head -n 58 Changes | tail -n 27 | awk  '{print " "$(NF-1)" " " "$NF""}' | paste -sd\; | sh```

# head -n 58 Documentation/Changes | tail -n 27

Get the lines 32 to 58 in the Documentation/Changes file.

# awk  '{print " "$(NF-1)" " " "$NF""}'

Get the last column (either -V or --version) and the column before that (the program name).

# paste -sd\;

Format a bit separating them with semi colons.

# sh

Send everything to the shell, and just watch the output to know what you need to install.

gha_language: SCSS


text:
---
layout: default
---

# 1993-08-12 - Making the World Safe for Steganography

## Header Data

From<EMAIL_ADDRESS>(Timothy C. May)

To<EMAIL_ADDRESS>Message Hash: ee348db0acbcec72836b199029daa64adc9548da5d12813ec230743c078f44f7

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-08-12 19:08:12 UTC

Raw Date: Thu, 12 Aug 93 12:08:12 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Timothy C. May)
Date: Thu, 12 Aug 93 12:08:12 PDT
To<EMAIL_ADDRESS>Subject: Making the World Safe for Steganography
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

How do we make steganography safer to use?

An anonymous comentator wrote about my point (in the essay "Libertaria in
Cyberspace"), and then Eric Hughes responded:

>>Alice better not be carrying any software that could retrieve that
>>data.
>
>Q: What do you call a store that sells 'cryptographic paraphernilia?'
>
>A: A mind shop.
>
>If crypto is outlawed, then random numbers will be probable cause for
>search for illegal cryptographic devices, software or hardware.
>
>Q: What is a random number?
>
>A: Anything I don't understand.

With steganographic (data-hiding) schemes, how is the "unhiding" scheme to
be stored? If the user has a diskette labelled "Steganography" sitting
prominently near his computer, for example, and this diskette has just a
single algorithm on it--perhaps for stripping the LSBs out of GIFs--then it
is fairly obvious which algorithm is being used, and that steganography is
in fact being used in the first place. (However, what comes out of the
de-stegging, to coin a phrase, should still be meaningless without the
actual decryption, so I'm not sure what the authorities can or will try to
do. During wartime, or in many countries, I'm sure that possessing such
steganographic software would be a serious matter, but the U.S. has not
(yet) reached this point. And there's enough bits to play with on a DAT to
make the data bits look almost exactly like audio/microphone noise, with
the same statistics, spectrum, etc.)

One good way to further confuse the issue is to make certain steganographic
schemes *widely available* by wide distribution on CD-ROMs (to ensure that
nearly everyone can feign innocense when the Data Patrol asks them some
questions) or by easy access by ftp-type approaches (though this has limits
which are discussed later).

In other words, there is no obvious "smoking gun" pointing to the use of
steganography. Or encryption, for that matter, as PGP-like crypto programs
could be similary distributed, someday, and only the secret key/passphrase
would be "incriminating" to the user. I'll leave it for another time to
discuss ways to hide the secret key/passphrase (perhaps in things like
Newton PDAs which implement "digital flash paper" in their flash memories,
or are carried with the person at all times, etc.).

A Cypherpunks CD-ROM?

Perhaps the Cypherpunks could someday even make such a CD-ROM widely
available, along with rants, source code, whatever. (*Very* speculatively,
someday "Wired" may even distribute a CD-ROM in one of their issues.)

Remember, the point about steganography schemes, like hiding message bits
in the LSBs of music tapes or images, is *not* to make the bits
"undetectable," but only to hide them sufficiently to make a case for
"plausible deniability." Thus, if the Data Patrol uses "Algorithm A6" (one
of many on the CD-ROM) on a DAT you are carrying, and the sequence "1 0 1 1
1 0 1 0 ...." emerges, you just shrug and claim ignorance. "Sounds like
noise to me." However, when the Patrol is not around, you apply, say,
"Algorithm Z1" to the DAT and then use your private key to decrypt the
bits. (How you secure your private key is another issue, of course, as
mentioned above.)

Some may quibble that this is a kind of low-level encryption...after all,
the CD-ROM may contain only a few dozen algorithms for stripping bits out
of DATs and images, so the NSA or FBI can simply apply them all, trivially.
This method would indeed be low-level (nonexistent, actually) security if
the resulting bits were a plaintext message. But the resulting bits are in
fact meaningless noise without the private key.

I suspect that such wide distribution of steganographic schemes will be
enough to ensure that users can safely retrieve "their" bits (using one of
the algorithms) without the authorities being able to prove anything.

If this analysis is correct, then getting various steganographic schemes
out in the public domain is important. Executable code--to allow users to
run the programs right off the CD-ROM and thus not have the code copied
(incriminatingly) to their hard disks--would be best. This code could be
tucked away in a small part of CD-ROMs.

What I envision is a CD-ROM (or whatever other distribution modes are
popular) containing this steganogrophic and cryptographic software  and
lots of other stuff, in other domains. That is, the crypto/stego part could
just be a tiny fraction of this "Hackers Disc." Speculatively, we could do
this ourselves, or work with "Wired," EFF, the Gnu folks, etc., to get
these programs tucked in someplace amongst their files. (There are issues
of platform compatitibility, which systems can read which CD-ROMs, etc.
Details.)

Making the algorithms available by ftp is of course already common
practice. The reason I don't emphasize this is that users must download the
programs to their systems, thus decreasing plausible deniability.

(However, if the programs are just part of a larger collection of files,
like a "News Magazine" of a bunch of files, then these algorithms will be
just some of the _many_ files downloaded, and the user can once again feign
ignorance. This would be a kind of "stego stego," where the stegonographic
algorithms are themselves hidden amongst a bunch of unrelated files.)

I realize all this may be too complicated, that the stego programs
themselves  are barely starting to appear (I know of a couple of efforts
going on), and that the problem of how to claim ignorance may not be
important for a few years yet, if ever.

On the other hand, there may be value in getting these stego schemes
distributed long in advance of their being needed.

Comments?

-Tim May
--
Timothy C. May         | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>     | anonymous networks, digital pseudonyms, zero
408-688-5409           | knowledge, reputations, information markets,
W.A.S.T.E.: Aptos, CA  | black markets, collapse of governments.
Higher Power: 2^756839 | Public Key: by arrangement
Note: I put time and money into writing this posting. I hope you enjoy it.

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Timothy C. May)](/authors/tcmay_at_netcom_com_timothy_c_may_)"

+ 1993-08-12 (Thu, 12 Aug 93 12:08:12 PDT) - Making the World Safe for Steganography -<EMAIL_ADDRESS>(Timothy C. May)_


text:
# I&S Security Gruppe 1 - dev2dev

## Content

* [Contributors](#contributors)
* [Code](#code)
* [Documents](#documents)
    * [Graphs](#graphs)
    * [Informations](#informations)
    * [Journals](#journals)
    * [Presentations](#presentations)
* [Ressources](#ressources)

## Contributors

Mateusz Palasz ([@MateuszPalasz](https://github.com/MateuszPalasz))
Oliver Weinmeier ([@oliverweinm](https://github.com/oliverweinm))
Tim Keller ([@TK5-Tim](https://github.com/TK5-Tim))

## Code
Beinhaltet alle Code Ressourcen. Including the Pseudo Code as first implementation of our concepts:
* [Pseudocode for FreedomDrop](Code/FreedomDrop_Pseudocode.md)
* [Pseudocode for FreedomDrop - Connection Establishment w/ Bluetooth](Code/FreedomDrop-Connection_Pseudocode.md)

## Documents
### Graphs
![Big Picture](Documents/Graphs/Gesamtbild.png)
This picture shows the main parts of the project fit into the big Picture of the whole project.

![Workflow Log Exchange](Documents/Graphs/Workflow_Log_Exchange.png)
Flow Diagram to show how two Peers exchange logs to be synchronized.
### Informations
All the Research made for the project is documentated in there:
[Research Informations](Documents/Informations/ResearchInformations.md)

### Journals
Journals of all meetings that took place:
* [Journal Meeting 24.03.2020](Documents/Journals/Journal_Meeting_24_03_20.md)
* [Journal Meeting 14.04.2020](Documents/Journals/Journal_Meeting_14_04_20.md)
* [Journal Meeting 15.04.2020](Documents/Journals/Journal_Meeting_15_04_20.md)

### Presentations
* [Status Präsentation 16.04.2020](Documents/Presentations/Status/Status_presentation.pptx)

## Ressources
All Ressources that might be Helpful for the project are stored in there.