text:
# Polynomials.jl

Basic arithmetic, integration, differentiation, evaluation, and root finding over dense univariate [polynomials](https://en.wikipedia.org/wiki/Polynomial).

[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaMath.github.io/Polynomials.jl/stable)
[![CI](https://github.com/JuliaMath/Polynomials.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/JuliaMath/Polynomials.jl/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/JuliaMath/Polynomials.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaMath/Polynomials.jl)

## Installation

```julia
(v1.6) pkg> add Polynomials
```

## Available Types of Polynomials

* `Polynomial` – standard basis polynomials, `a(x) = a₀ + a₁ x + a₂ x² + … + aₙ xⁿ`,  `n ∈ ℕ`
* `ImmutablePolynomial` – standard basis polynomials backed by a [Tuple type](https://docs.julialang.org/en/v1/manual/functions/#Tuples-1) for faster evaluation of values
* `SparsePolynomial` – standard basis polynomial backed by a [dictionary](https://docs.julialang.org/en/v1/base/collections/#Dictionaries-1) to hold  sparse high-degree  polynomials
* `LaurentPolynomial` – [Laurent polynomials](https://docs.julialang.org/en/v1/base/collections/#Dictionaries-1), `a(x) = aₘ xᵐ + … + aₙ xⁿ` `m ≤ n`, `m,n ∈ ℤ` backed by an [offset array](https://github.com/JuliaArrays/OffsetArrays.jl); for example, if `m<0` and `n>0`, `a(x) = aₘ xᵐ + … + a₋₁ x⁻¹ + a₀ + a₁ x + … +  aₙ xⁿ`
* `FactoredPolynomial` – standard basis polynomials, storing the roots, with multiplicity, and leading coefficient of a polynomial
* `ChebyshevT` – [Chebyshev polynomials](https://en.wikipedia.org/wiki/Chebyshev_polynomials) of the first kind
* `RationalFunction` - a type for ratios of polynomials.

## Usage

```jldoctest
julia> using Polynomials
```

### Construction and Evaluation

Construct a polynomial from an array (a vector) of its coefficients, lowest order first.

```jldoctest
julia> Polynomial([1,0,3,4])
Polynomial(1 + 3*x^2 + 4*x^3)
```

Optionally, the variable of the polynomial can be specified.

```jldoctest
julia> Polynomial([1,2,3], :s)
Polynomial(1 + 2*s + 3*s^2)
```

Construct a polynomial from its roots.

```jldoctest
julia> fromroots([1,2,3]) # (x-1)*(x-2)*(x-3)
Polynomial(-6 + 11*x - 6*x^2 + x^3)
```

Evaluate the polynomial `p` at `x`.

```jldoctest
julia> p = Polynomial([1, 0, -1]);
julia> p(0.1)
0.99
```

### Arithmetic

Methods are added to the usual arithmetic operators so that they work on polynomials, and combinations of polynomials and scalars.

```jldoctest
julia> p = Polynomial([1,2])
Polynomial(1 + 2*x)

julia> q = Polynomial([1, 0, -1])
Polynomial(1 - x^2)

julia> p - q
Polynomial(2*x + x^2)

julia> p = Polynomial([1,2])
Polynomial(1 + 2*x)

julia> q = Polynomial([1, 0, -1])
Polynomial(1 - x^2)

julia> 2p
Polynomial(2 + 4*x)

julia> 2+p
Polynomial(3 + 2*x)

julia> p - q
Polynomial(2*x + x^2)

julia> p * q
Polynomial(1 + 2*x - x^2 - 2*x^3)

julia> q / 2
Polynomial(0.5 - 0.5*x^2)

julia> q ÷ p # `div`, also `rem` and `divrem`
Polynomial(0.25 - 0.5*x)
```

Operations involving polynomials with different variables will error.

```jldoctest
julia> p = Polynomial([1, 2, 3], :x);
julia> q = Polynomial([1, 2, 3], :s);
julia> p + q
ERROR: ArgumentError: Polynomials have different indeterminates
```

#### Construction and Evaluation

While polynomials of type `Polynomial` are mutable objects, operations such as
`+`, `-`, `*`, always create new polynomials without modifying its arguments.
The time needed for these allocations and copies of the polynomial coefficients
may be noticeable in some use cases. This is amplified when the coefficients
are for instance `BigInt` or `BigFloat` which are mutable themself.
This can be avoided by modifying existing polynomials to contain the result
of the operation using the [MutableArithmetics (MA) API](https://github.com/jump-dev/MutableArithmetics.jl).
Consider for instance the following arrays of polynomials
```julia
using Polynomials
d, m, n = 30, 20, 20
p(d) = Polynomial(big.(1:d))
A = [p(d) for i in 1:m, j in 1:n]
b = [p(d) for i in 1:n]
```
In this case, the arrays are mutable objects for which the elements are mutable
polynomials which have mutable coefficients (`BigInt`s).
These three nested levels of mutable objects communicate with the MA
API in order to reduce allocation.
Calling `A * b` requires approximately 40 MiB due to 2 M allocations
as it does not exploit any mutability. Using
```julia
using MutableArithmetics
const MA = MutableArithmetics
MA.operate(*, A, b)
```
exploits the mutability and hence only allocate approximately 70 KiB due to 4 k
allocations. If the resulting vector is already allocated, e.g.,
```julia
z(d) = Polynomial([zero(BigInt) for i in 1:d])
c = [z(2d - 1) for i in 1:m]
```
then we can exploit its mutability with
```julia
MA.mutable_operate!(MA.add_mul, c, A, b)
```
to reduce the allocation down to 48 bytes due to 3 allocations. These remaining
allocations are due to the `BigInt` buffer used to store the result of
intermediate multiplications. This buffer can be preallocated with
```julia
buffer = MA.buffer_for(MA.add_mul, typeof(c), typeof(A), typeof(b))
MA.mutable_buffered_operate!(buffer, MA.add_mul, c, A, b)
```
then the second line is allocation-free.

The `MA.@rewrite` macro rewrite an expression into an equivalent code that
exploit the mutability of the intermediate results.
For instance
```julia
MA.@rewrite(A1 * b1 + A2 * b2)
```
is rewritten into
```julia
c = MA.operate!(MA.add_mul, MA.Zero(), A1, b1)
MA.operate!(MA.add_mul, c, A2, b2)
```
which is equivalent to
```julia
c = MA.operate(*, A1, b1)
MA.mutable_operate!(MA.add_mul, c, A2, b2)
```

*Note that currently, only the `Polynomial` implements the API and it only
implements part of it.*

### Integrals and Derivatives

Integrate the polynomial `p` term by term, optionally adding a constant
term `k`. The degree of the resulting polynomial is one higher than the
degree of `p` (for a nonzero polynomial).

```jldoctest
julia> integrate(Polynomial([1, 0, -1]))
Polynomial(1.0*x - 0.3333333333333333*x^3)

julia> integrate(Polynomial([1, 0, -1]), 2)
Polynomial(2.0 + 1.0*x - 0.3333333333333333*x^3)
```

Differentiate the polynomial `p` term by term. The degree of the
resulting polynomial is one lower than the degree of `p`.

```jldoctest
julia> derivative(Polynomial([1, 3, -1]))
Polynomial(3 - 2*x)
```

### Root-finding

Return the roots (zeros) of `p`, with multiplicity. The number of
roots returned is equal to the degree of `p`. By design, this is not type-stable, the returned roots may be real or complex.

```jldoctest
julia> roots(Polynomial([1, 0, -1]))
2-element Vector{Float64}:
 -1.0
  1.0

julia> roots(Polynomial([1, 0, 1]))
2-element Vector{ComplexF64}:
 0.0 - 1.0im
 0.0 + 1.0im

julia> roots(Polynomial([0, 0, 1]))
2-element Vector{Float64}:
 0.0
 0.0
```

### Fitting arbitrary data

Fit a polynomial (of degree `deg` or less) to `x` and `y` using a least-squares approximation.

```jldoctest
julia> xs = 0:4; ys = @. exp(-xs) + sin(xs);

julia> fit(xs, ys) |> p -> round.(coeffs(p), digits=4) |> Polynomial
Polynomial(1.0 + 0.0593*x + 0.3959*x^2 - 0.2846*x^3 + 0.0387*x^4)

julia> fit(ChebyshevT, xs, ys, 2) |> p -> round.(coeffs(p), digits=4) |> ChebyshevT
ChebyshevT(0.5413⋅T_0(x) - 0.8991⋅T_1(x) - 0.4238⋅T_2(x))
```

Visual example:

![fit example](https://user-images.githubusercontent.com/14099459/70382587-9e055500-1902-11ea-8952-3f03ae08b7dc.png)

### Other methods

Polynomial objects also have other methods:

* 0-based indexing is used to extract the coefficients of `[a0, a1, a2, ...]`, coefficients may be changed using indexing
  notation.

* `coeffs`: returns the entire coefficient vector

* `degree`: returns the polynomial degree, `length` is number of stored coefficients

* `variable`: returns the polynomial symbol as polynomial in the underlying type

* `norm`: find the `p`-norm of a polynomial

* `conj`: finds the conjugate of a polynomial over a complex field

* `truncate`: set to 0 all small terms in a polynomial;

* `chop` chops off any small leading values that may arise due to floating point operations.

* `gcd`: greatest common divisor of two polynomials.

* `Pade`: Return the
  [Pade approximant](https://en.wikipedia.org/wiki/Pad%C3%A9_approximant) of order `m/n` for a polynomial as a `Pade` object.

## Related Packages

* [StaticUnivariatePolynomials.jl](https://github.com/tkoolen/StaticUnivariatePolynomials.jl) Fixed-size univariate polynomials backed by a Tuple

* [MultiPoly.jl](https://github.com/daviddelaat/MultiPoly.jl) for sparse multivariate polynomials

* [DynamicPolynomals.jl](https://github.com/JuliaAlgebra/DynamicPolynomials.jl) Multivariate polynomials implementation of commutative and non-commutative variables

* [MultivariatePolynomials.jl](https://github.com/JuliaAlgebra/MultivariatePolynomials.jl) for multivariate polynomials and moments of commutative or non-commutative variables

* [PolynomialRings.jl](https://github.com/tkluck/PolynomialRings.jl) A library for arithmetic and algebra with multi-variable polynomials.

* [AbstractAlgebra.jl](https://github.com/wbhart/AbstractAlgebra.jl), [Nemo.jl](https://github.com/wbhart/Nemo.jl) for generic polynomial rings, matrix spaces, fraction fields, residue rings, power series, [Hecke.jl](https://github.com/thofma/Hecke.jl) for algebraic number theory.

* [CommutativeAlgebra.jl](https://github.com/KlausC/CommutativeRings.jl) the start of a computer algebra system specialized to discrete calculations with support for polynomials.

* [PolynomialRoots.jl](https://github.com/giordano/PolynomialRoots.jl) for a fast complex polynomial root finder. For larger degree problems, also [FastPolynomialRoots](https://github.com/andreasnoack/FastPolynomialRoots.jl) and [AMRVW](https://github.com/jverzani/AMRVW.jl).

* [SpecialPolynomials.jl](https://github.com/jverzani/SpecialPolynomials.jl) A package providing various polynomial types beyond the standard basis polynomials in `Polynomials.jl`. Includes interpolating polynomials, Bernstein polynomials, and classical orthogonal polynomials.

* [ClassicalOrthogonalPolynomials.jl](https://github.com/JuliaApproximation/ClassicalOrthogonalPolynomials.jl) A Julia package for classical orthogonal polynomials and expansions. Includes `chebyshevt`, `chebyshevu`, `legendrep`, `jacobip`, `ultrasphericalc`, `hermiteh`, and `laguerrel`. The same repository includes `FastGaussQuadrature.jl`, `FastTransforms.jl`, and the `ApproxFun` packages.

## Legacy code

As of v0.7, the internals of this package were greatly generalized and new types and method names were introduced. For compatability purposes, legacy code can be run after issuing `using Polynomials.PolyCompat`.

## Contributing

If you are interested in contributing, feel free to open an issue or pull request to get started.


text:
React Native Air Progress Bar

Pretty customizable and animated progress-bar component for React Native.

We often need to customize our mobile application according to our brand style needs. The easiest solution is to grab some UI kit, make some fast customizations, add custom styling etc. But some components is hard for customizing. I mean progress-bars, you know. So this is react-native progress-bar component, which could be useful when you need to customize default progress-bar with different icons of current progress.

This feature could be really killer in you mobile application brand style. You could use icons from react-native-vector-icons repo or even your own. Currently you have plane icon by default. Also cool thing is that you have animation from initial progress to the current progress value. So progress bar could be determinate or indeterminate. Useful when you need the progress indicator for some step by step activities.

Project uses React Native Animated API. Each time you update props, you will see the animation of progress-bar. The project is in search for contributors.

The source for this module is in the main repo.

Install

```
npm install react-native-air-progress-bar --save
```

Usage

```javascript
import ProgressBar from 'react-native-air-progress-bar';

<ProgressBar progress={0} />
<ProgressBar progress={25} />
<ProgressBar progress={50} initialProgress={25} />
<ProgressBar progress={75} initialProgress={50} />
<ProgressBar progress={100} initialProgress={75} />
```

License

The MIT License (MIT) Copyright (c) 2017

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Link Checker

Link Checker is a crawler to check link status written in python scrapy framework.

## Dependencies

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.

```
Python >=3.6
pipenv

urllib3
scrapy >=1.5
```

## Activate env
```bash
pipenv shell
```

## Run

```bash
scrapy crawl link_checker_spider -a manifest_url=https://www.sangam.com/asset-manifest.json -a input_url=https://www.sangam.com -a fetch_from_file=true -a only_broken=true -a filepath=sangam-domains.json -o items.json
```

```python
-o output-file
-a command-line arguments

# Command-line Arguments:
manifest_url
input_url
only_broken
fetch_from_file
filepath (required only when fetch_from_file=true)
*** add your own domain list json in shared directory and provide name in filepath ***
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: shivamsupr/link-checker

gha_language: Python

repo_name: shivamsupr/link-checker


text:
# Template Method Design Pattern
Template method defines the steps to execute an algorithm and it can provide default implementation that might be common for all or some of the subclasses.
Suppose we want to provide an algorithm to build a house. The steps need to be performed to build a house are – building foundation, building pillars, building walls and windows. The important point is that the we can’t change the order of execution because we can’t build windows before building the foundation. So in this case we can create a template method that will use different methods to build the house.

Now building the foundation for a house is same for all type of houses, whether its a wooden house or a glass house. So we can provide base implementation for this, if subclasses want to override this method, they can but mostly it’s common for all the types of houses.

To make sure that subclasses don’t override the template method, we should make it final.

# Design Pattern UML
![Template Method Pattern](example/uml1.png)

This pattern is useful anytime you have an algorithm that has one or more steps that need to vary, or when you have a couple algorithms that are very nearly the same but differ by just a step or two.
Rather than having multiple classes that implement a nearly identical set of instructions, or trying to mash up methods that are really different responsibilities into one class, you can cleanly seperate concerns into their own implementations.

# Java Example
In the example we have a Basic ERP System which creates a transaction for Purchase, Sale and Payroll.
- [Purchase.java](example/Purchase.java) is a Concrete class which implements the Transaction class.
- [Sale.java](example/Sale.java) is a Concrete class which implements the Transaction class.
- [Payroll.java](example/Payroll.java) is a Concrete class which implements the Transaction class.
- [ERP_System.java](example/ERP_System.java) is the Client which runs the ERP System.

In this example, every Transaction has fixed steps and remain same for Purchase, Sale, and Payroll.
Each of the concrete class has a private function which calculates the transaction amount.

# Example UML
![ERP System](example/uml2.png)

# Use of Design Pattern
- The template method is used in frameworks, where each implements the invariant parts of a domain's architecture, while providing hook methods for customization. This is an example of inversion of control. The template method is used for the following reasons.
- It lets subclasses implement varying behavior (through overriding of the hook methods).
- It avoids duplication in the code: the general workflow of the algorithm is implemented once in the abstract class's template method, and necessary variations are implemented in the subclasses.
- It controls the point(s) at which specialization is permitted. If the subclasses were to simply override the template method, they could make radical and arbitrary changes to the workflow. In contrast, by overriding only the hook methods, only certain specific details of the workflow can be changed, and the overall workflow is left intact.

repository: ChicoState/DesignAndMaintenance

gha_language: Java

gha_license_id: MIT

repo_name: ChicoState/DesignAndMaintenance


text:
[TOC](Readme.md) [Prev](packages.md) [Next](operators.md)

_Modules, Packages, and Instances_

# Imports

A CUE file may import definitions from builtin or user-defined packages.
A CUE file does not need to be part of a package to use imports.

The example here shows the use of builtin packages.

This code groups the imports into a parenthesized, "factored" import statement.

You can also write multiple import statements, like:

```
import "encoding/json"
import "math"
```

But it is good style to use the factored import statement.

<!-- CUE editor -->
_imports.cue:_
```
import (
	"encoding/json"
	"math"
)

data: json.Marshal({ a: math.Sqrt(7) })
```

<!-- result -->
`$ cue eval imports.cue`
```
data: "{\"a\":2.6457513110645907}"
```

repository: timbyr/cue

repo_name: timbyr/cue


text:
# Introduction

Welcome to the HonestContract.This API is used for the contract between the company.

This API is provided following features:

1. User can create his/her company profile with some details.

2. With his/her company user can create contracts (as a buyer or seller) and send a request to another company for the contract.

3. With this API he/she create purpose for contract for business.Our API provides the features to upload
   the purpose image,description & agreement.

4. We provide user can renew his/her business contract with this API.

5. The user can terminate the contract with another company those between his/her contract.

repository: mayank-cdac/HonestContract

repo_name: mayank-cdac/HonestContract


text:
## Blackhole
![image](https://github.com/JustNikhill/Black-Hole-/blob/main/Screenshot%20(765).png)

## Live demo
- [Blackhole](https://justnikhill.github.io/Black-Hole-/)

## Calculations
![image](https://github.com/JustNikhill/Black-Hole-/blob/main/BlackHole%20calculations.jpeg)

## How to run in your machine?
- Clone or download [ZIP file](https://github.com/JustNikhill/Black-Hole-/archive/refs/heads/main.zip)
- Then open  HTML file in VS code and run with live server

## Want some help?
- Feel free to contact [LinkedIn](https://www.linkedin.com/in/nikhil-yadav-609435203/)

repository: JustNikhill/Black-Hole-

branch_name: refs/heads/main

repo_name: JustNikhill/Black-Hole-


text:
#
 AWS specific components for Node.js

This framework is a part of [Pip.Services](https://github.com/pip-services/pip-services) project.
It contains components for AWS cloud platform:

- **clients** - LambdaClient and CommandableLambdaClient
- **container** - LambdaFunction and CommandableLambdaFunction
- **connect** - AwsConnectionParams and AwsConnectionResolver

Quick Links:

* [Downloads](https://github.com/pip-services-node/pip-services-aws-node/blob/master/doc/Downloads.md)
* [API Reference](https://rawgit.com/pip-services-node/pip-services-aws-node/master/doc/api/globals.html)
* [Building and Testing](https://github.com/pip-services/pip-services-aws-node/blob/master/doc/Development.md)
* [Contributing](https://github.com/pip-services/pip-services-aws-node/blob/master/doc/Development.md/#contrib)

## Acknowledgements

The Node.js version of Pip.Services is created and maintained by **Sergey Seroukhov**

repository: pip-services-node/pip-services-aws-node

repo_name: pip-services-node/pip-services-aws-node


text:
# PDF Certificate Generator
This is a simple OSGi bundle to generate an award certificate and render it to
PDF.

## WARNING
A major refactor is coming that will significantly change the workflow of this
library. You have been warned.

## How To Use
Get a `CertificateFactory` and a `CertificateRenderer` via OSGi, and follow the
API and the JavaDoc. I know, I know, code isn't its own documentation, just
keep your eyes peeled for more to follow. There are a couple of examples in the
localtest package, knock yourself out.

## Before You Say It...
It has been pointed out to me that this library stands to be much more
format-independent than its name implies, since XML can be rendered to pretty
much anything with XSLT and an appropriate rendering library, e.g., Apache POI.
These changes are on the horizon as well, so thanks for your support.

repository: seemikehack/pcg

gha_license_id: NOASSERTION

repo_name: seemikehack/pcg


text:
---
id: firstchecks
title: Writing your first suite of checks
sidebar_label: Writing your first suite of checks
---
## Introduction to ChecksSuite
The entry point for any SDQ job is a `ChecksSuite`. You can pass in some metadata about the checksuite, details of the
checks to perform, your repositories for storing metrics and results, and rules about how to calculate an overall
check status. For example:
```scala mdoc:compile-only
import com.github.timgent.sparkdataquality.checkssuite.ChecksSuite
val myFirstChecksSuite = ChecksSuite(
    checkSuiteDescription = "myFirstChecksSuite",
    tags = ???,
    singleDsChecks = ???,
    dualDsChecks = ???,
    arbitraryChecks = ???,
    metricsToTrack = ???,
    metricsPersister = ???,
    qcResultsRepository = ???,
    checkResultCombiner = ???
)
```

Check out the [API docs](/spark-data-quality/api/index.html) for full details of the arguments for a ChecksSuite. The most important thing
to know is that all of these arguments except for checkSuiteDescription are optional. We recommend just specifying the
items you are interested in. Where you don't provide arguments either no checks of that type will be run or the metrics
or the QC Results won't be stored. The default value for `tags` is an empty map. The default `checkResultCombiner` will
use the worst status for any individual checks as the overall status for the `ChecksSuiteResult`.

## A simple ChecksSuite
Let's look at a simple example where we run some performant metric-based checks a single Dataset.
```scala mdoc:compile-only
  import java.time.Instant

  import com.github.timgent.sparkdataquality.checks.metrics.SingleMetricCheck
  import com.github.timgent.sparkdataquality.checkssuite._
  import com.github.timgent.sparkdataquality.thresholds.AbsoluteThreshold
  import org.apache.spark.SparkConf
  import org.apache.spark.sql.{Dataset, SparkSession}

  import scala.concurrent.ExecutionContext.Implicits.global
  import scala.concurrent.Future
  val sparkConf = new SparkConf().setAppName("SimpleChecksSuite").setMaster("local")
  val spark = SparkSession.builder().config(sparkConf).getOrCreate()
  import spark.implicits._
  case class NumberString(num: Int, string: String)
  val ds: Dataset[NumberString] = List(
    NumberString(1, "a"),
    NumberString(2, "b"),
    NumberString(3, "c")
  ).toDS
  val numberStrings: DescribedDs = DescribedDs(ds, "numberStrings")
  val simpleChecksSuite: ChecksSuite = ChecksSuite(
    checkSuiteDescription = "simpleChecksSuite",
    singleDsChecks = Map(
        numberStrings ->
        Seq(
          SingleMetricCheck.sizeCheck(AbsoluteThreshold(3, 5)),
          SingleMetricCheck.distinctValuesCheck(AbsoluteThreshold(2, 5), List("num")))
      )
  )
  val qcResults: Future[ChecksSuiteResult] = simpleChecksSuite.run(Instant.now)
```
In this case we're defining a ChecksSuite that does just 2 checks, both on the same Dataset. One checks the size
of the Dataset is between 3 and 5, and the other checks that there are between 2 and 5 distinct numbers. Because no
repository is provided for the results, and no Persister is provided for the metrics, no persistence of results or
metrics will take place.

You'll find some more details about the different types of checks you can do, and how to persist your results and your
metrics in the other sections of the documentation.

## Showing your results
We've built in pretty printing of your `ChecksSuiteResult` as a quick way to get started seeing the results of your
checks, and to help you in understanding reasons for any failures.
```scala mdoc:compile-only
import com.github.timgent.sparkdataquality.checkssuite.ChecksSuiteResult
val someCheckSuiteResult: ChecksSuiteResult = ???
println(someCheckSuiteResult.prettyPrint)
```
Instances of the cats `Show` typeclass are also provided in the companion object for `ChecksSuiteResult`.

repository: timgent/spark-data-quality

repo_name: timgent/spark-data-quality


text:
#### Training project on [web-technologies course](https://stepic.org/course/154/) at [Stepic](https://stepic.org)

###### Starting environment

Run ```bash ./init.sh``` in cloned project to copy files, create folders, link configs and restart daemons. Script also updates django framework.

###### Reading logs
```
sudo less /var/log/gunicorn/hello.log
```
```
sudo less /var/log/gunicorn/ask.log
```

###### Checking server
```
wget localhost
```
```
wget "localhost:8080/?a=1&b=2&c=3"
cat "index.html?a=1&b=2&c=3"
```
```
wget localhost:8000/ask//popular/
```
_(one or more tests are wrong at 2.1.11 step)_

repository: igRo/django-sandbox

repo_name: igRo/django-sandbox


text:
# Social Media Link Preview

Social Media Link Preview is a browser extension that shows a sample preview of how the webpage appears when it's link is shared on a social media platform such as Facebook and Twitter.

The extension fetches the open graph and twitter tags to replicate the behaviour.

![Sample Screenshot](./screenshot.png)

## Download

Check releases, or [click here](https://chrome.google.com/webstore/detail/social-media-link-preview/dlmoajpiphhokgbbfaiiekhlgpjnjfei/) to download the latest version.

## Development

Clone the repository.
For development version run

```
yarn start
```

For production build.

```
yarn build
```

### Adding extension to chromium based browser

-   Open options and select extensions
-   Turn on Developer Mode
-   Choose "Load unpacked"
-   Navigate to the extension directory and select the "build" directory

## Contributing

Any kind of contributions are welcome. Makes sure to add a relevant emoji before your commit message, refer https://github.com/cooperka/emoji-commit-messages

---

Made with [Chrome Extension React Boilerplate](https://github.com/lxieyang/chrome-extension-boilerplate-react)

repository: akzhy/social-media-link-preview

repo_name: akzhy/social-media-link-preview


text:
# Fleece Performance

The Fleece test suite comes with a few simple [benchmarks](Tests/PerfTests.cc). And if run on Mac OS or iOS, there are [comparative benchmarks](Tests/ObjCTests.mm) that perform the same operations using the Foundation framework's JSON parser (`NSJSONSerialization`) and collection classes.

## What's Tested

The tests operate on a data set of 1000 fake people, that is, an array of 1000 dictionaries, each of which has the same schema consisting of a mix of primitive fields and nested objects. (Here's what one such "person" [looks like](Tests/1person.json).)

Data size
: The size of the JSON (no whitespace) and the resulting Fleece.

Convert JSON to Fleece
: The time it took to directly convert JSON to Fleece, using the `JSONConverter` class.

Parse
: Time to parse JSON to Foundation objects using `NSJSONSerialization`, and then free the objects afterwards, vs. the time to scan the Fleece data for validity and return the root object pointer.

Parse trusted
: Time to parse if the data is known to be syntactically valid. No difference for JSON, but with Fleece the scan can be skipped almost entirely.

Look up one name
: Time to retrieve the `name` property of the 123rd array element, including validation that each object (array, dictionary, string) is of the correct type, to avoid crashes.

## The Results

These come from the above test suites, run on a Macbook Pro with a 2.3 GHz Intel Core i7. (These are sizes and times, so smaller numbers are better.)

|                           | JSON      | Fleece|
|---------------------------|----------:|------:|
|Data size (bytes)          |1,303,317  |911,920|
|Convert JSON to Fleece (µs)|--         |6,400  |
|Parse (µs)                 |17,000     |750    |
|Parse trusted (µs)         |17,000     |0.6    |
|Look up one name (ns)      |960        |49     |

## Analysis

The Fleece data is 30% smaller than the JSON, thanks to coalescing multiple copies of the same string (every one of the 1,000 person dictionaries has the same keys!)

"Parsing" Fleece is _22 times_ faster than parsing the JSON, because it simply requires a quick in-place scan for validity, which does not allocate any memory or interact with platform libraries.

If the Fleece data is trusted to be syntactically valid (e.g. it just came out of a database record that's known to have a CRC checksum), the scan can be skipped, leading to a near-zero parse time (really just some pointer arithmetic plus decoding an integer.)

Once the data is parsed, a typical sequence of operations — array lookup plus dictionary lookup — is 20 times faster with Fleece.

It is twice as fast to convert JSON to Fleece in memory, and use the Fleece objects, than it is to parse the JSON to Foundation objects!


text:
---
title: Functions Returning Functions
---

"**Functions are first class citizens** in Swift", triumphantly announced by Apple following the introduction of their new language. On a linguistic level I have no idea what this means or what constitutes a "*second class citizen*". On a practical level, it simply means that functions can be treated like those variable things we all know and love.
{% highlight swift linenos %}
let someNumber: Int
let someBool: Bool
let someFunctionReturningInt: () -> Int
let someFunctionTakingIntReturningBool: (Int) -> Bool

let overkill: (Int) -> (Int) -> (Int) -> Bool)?
{% endhighlight %}

This is a bizarre thing to wrap your head around if you're more familiar with C++, Java, and the like, but it can be mighty useful.

I'll start with the pointless, but simple, code that everybody uses to demonstrate this:
{% highlight swift linenos %}
func adder (withIncrement increment: Int) -> (Int) -> Int
{
    return { $0 + increment }
}

let addFive = adder(withIncrement: 5)

print ("\(addFive(3))") // 8
print ("\(addFive(4))") // 9
print ("\(addFive(6))") // 11
{% endhighlight %}

NB: If you're having trouble with line 3, the version of the closure without any inference is `return { value in return value + increment }`.

We could have easily made a function of the form: `add(increment: to:)`, but if we know we're always going to add 5, or add a set of numbers, this saves a lot of time at the expense of very little mental capacity. Granted, it's highly unlikely you'll use the code above in any real code.

So here's an example that might actually do something for you 😊. I came across a [StackOverflow post](https://stackoverflow.com/questions/44252932/how-to-create-a-generator-in-swift/) looking for a generator-like structure in Swift. While Swift doesn't support python's `yield` keyword, we can muddle together this kind of behaviour with a function returning function.

{% highlight swift linenos %}
struct Countdown
{
    static func generator(startingAt: Int) -> () -> Int?
    {
        var start = startingAt
        return {
            start = start - 1
            return start > 0 ? start : nil
        }
    }
}

let countdown = Countdown.generator(withStart: 10)

while let i = b() { print ("\(i)") } // 10 9 8 7 6 .....
{% endhighlight %}

The ability to pass functions into other functions, and return functions from those functions is a strange construct to comprehend, and a delightful sentence to type. Use it well, and it allows for better structured code, as responsibilities can be further spread across your codebase to make things a lot [SMART](https://en.wikipedia.org/wiki/S.M.A.R.T.)er.

I've got a few posts coming up related to how I used this in a JSON parser, so sit tight for that.

In the meantime: thanks for Reading,
Chris


text:
# Password Generator

Password generation is an increasingly important part of internet security. Many websites only accept certain parameters for their passwords such as excluding special characters or only allowing lower case letters.

I was tasked with creating a website that can generate a novel password depending on the user's needs. The following website takes the user's input in the form of prompts and confirms, and generates a random password. The user input accepts the following character types:
* special characters ```~`!@#$%^&*()_-+={}[]|':;<>,.?/```
* lower case letters ```a-z```
* upper case letters ```A-Z```
* digits ```0-9```

In addition the user can set the length of the password within a limit of 8 to 128 characters. The underlying JavaScript uses ```Math.random()``` to randomly select one of the user selected character types and randomly select a character within that character type.

![Digital Marketing Meeting](03-javascript-homework-demo.png)

## Usage
The site can be accessed with the following link:

[Password Generator](https://dgtlctzn.github.io/password-generator/)

## Credits
Special thanks to GA Tech Bootcamp for providing the necessary materials and information.

## License
MIT License

Copyright (c) 2020 Joseph Perry

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

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

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

repository: dgtlctzn/password-generator

repo_name: dgtlctzn/password-generator


text:
# cas-postgres

[![CircleCI](https://circleci.com/gh/bcgov/cas-postgres.svg?style=svg)](https://circleci.com/gh/bcgov/cas-postgres)

This repository contains the [Spilo](https://github.com/zalando/spilo/) + [pgtap](https://pgtap.org/) docker container and helm chart used by the various applications deployed by the CAS team.

## Docker container

The docker container adds the `pgtap` extension (unit testing for PostgreSQL) and a couple of utility scripts to the official Spilo container developed by Zalando.

BATS tests for the aforementioned scripts can be run using the corresponding `make` commands (run `make help` for more information).

## Helm Charts

The [`helm/patroni`](helm/patroni) folder contains a fork of the patroni helm chart that was in the (now deprecated) helm charts incubator, and can be reused by other teams.
The [`helm/cas-patroni](helm/cas-patroni) folder contains helm values used by the CAS team, as well as a job definition for the [`cas-shelf`](https://github.com/bcgov/cas-shelf/) image, which provisions object storage buckets when [WAL-G](https://github.com/wal-g/wal-g) backups are enabled.

### Installation

Installation of the cas-postgres helm chart is simply done via the `helm install` command. See [`helm/cas-postgres/values.yaml`](helm/cas-postgres/values.yaml) for more information on the values that should be provided

### Steps for a complete fresh install (will lose all data)

- helm delete the cas-ciip-portal release `ex: helm delete --namespace wksv3k-dev cas-ciip-portal`
- delete the cas-ciip-portal patroni pvcs's `(can be done from the openshift ui under storage)`
- delete the cas-ciip-portal patroni configmaps `(can be done from the openshift ui under Resources -> Configmaps)`
- the trigger-dag job may possibly need to be deleted as well. Look for the job in the openshift ui under `Resources -> Other Resources`, if you find the job, delete it.
- clear the namespace's gcs ciip-backup box in google storage `ex: wksv3k-dev-ciip-backups`

### Point in Time Recovery

In the event a database needs to be recovered from a backup to a specific point in time, these are the steps to follow. Spilo is shipped with a [clone_with_wale](https://github.com/zalando/spilo/blob/30977cc4bb041dcf2d461d39e109eef4d377272f/postgres-appliance/scripts/configure_spilo.py#L227) method that we can leverage to handle this for us with the addition of a few environment variables.

These steps assume you are using Google Cloud to store backups. If you are using something else (like S3), the process should be similar for other providers and the necessary environment variables are described in the `configure_spilo` script [here](https://github.com/zalando/spilo/blob/30977cc4bb041dcf2d461d39e109eef4d377272f/postgres-appliance/scripts/configure_spilo.py#L753).

#### Steps

- Scale the patroni statefulset down to 0
- Delete the patroni configmaps (any configmaps prefixed by your patroni-cluster-name)
  - example: \<patroni-cluster\>-leader, \<patroni-cluster\>-config, \<patroni-cluster\>-failover
- Delete the patroni PVCs relating to your cluster
  - example: storage-volume-\<patroni-cluster\>-0, storage-volume-\<patroni\>-1
- Add the following environment variables to your patroni statefulset:
  - `CLONE_SCOPE`: \<patroni-cluster-name\>
  - `CLONE_METHOD`: CLONE_WITH_WALE
  - `CLONE_TARGET_TIME`: \<timestamp-with-timezone-to-recover-to\>
    - example: 2022-06-05 08:00:00-08:00
  - `CLONE_WALG_GS_PREFIX`: \<google-cloud-prefix\>
    - example: gs://[bucket-name]/[folder-name]
  - `CLONE_GOOGLE_APPLICATION_CREDENTIALS`: \<path-to-json-credentials\>
    - documentation: [Google Cloud Authentication](https://cloud.google.com/docs/authentication/production#passing_variable)
  - `PGVERSION`: \<major-postgres-version-to-restore-to\> example: 12
    - `PGVERSION` is optional, but if the major version of your postgres backup is older than the psql version you are using, then it will automatically upgrade Posgtgres during restore and begin an entirely new timeline starting at 00000001. This will cause issues with replication as the replica will become confused about what timeline to bootstrap from when starting up.

  Note: You likely already have `WALG_GS_PREFIX` and `GOOGLE_APPLICATION_CREDENTIALS` set as environment variables since they're needed to perform backups. The `clone_with_wale` method specifically looks for these variables with the `CLONE_` prefix, so just copying the contents of these existing environment variables into new variables prefixed with `CLONE_` is all that is needed here.

  **Do not forget to save your environment variables. The SAVE button is at the bottom of the page**

- Scale up the patroni statefulset

Patroni will then start up your database and restore to the point defined in `CLONE_TARGET_TIME`.

If successful you will see something like this in your logs:
(docs/images/success.png)

Patroni will begin bootstrapping your backup. You will see a lot "Not Healthy..bootstrap in progress..rejecting connections" in your logs for a while as shown below. **This is normal, do not stop the process**.
(docs/images/bootstrapping.png)
This will repeat for a few moments. Once the bootstrap is finished you'll see a bunch of SQL statements followed eventually by your pod declaring it is `the leader with the lock`. At this point you're all done!

##### Command-Line Walkthrough

**Esure you are in the correct namespace!**
- `oc project` will show you what namespace you are in

1. `oc scale statefulset <statefulset-name> --replicas=0`
  - This will scale your statefulset to 0
  - The statefulset name is probably the same as your patroni cluster
  - To get a list of all statefulsets use `oc get statefulsets`

2. `oc delete configmap <configmap-name>`
  - You'll need to do this for each configmap prefixed by the name of your patroni cluster
  - example: \<patroni-cluster\>-leader, \<patroni-cluster\>-config, \<patroni-cluster\>-failover
  - To get a list of all configmaps use `oc get configmaps`

3. `oc delete pvc <pvc-name>`
  - Again, you'll need to do this for each PVC that contains the name of your patroni cluster
  - example: storage-volume-\<patroni-cluster\>-0, storage-volume-\<patroni\>-1
  - To get a list of all PVCs use `oc get pvc`

4. `oc set env statefulset/<statefulset-name> CLONE_SCOPE=<patroni-cluster-name> CLONE_METHOD=CLONE_WITH_WALE CLONE_WALG_GS_PREFIX=<google-cloud-prefix> CLONE_GOOGLE_APPLICATION_CREDENTIALS=<path-to-credentials> CLONE_TARGET_TIME='<target-restore-time-with-timezone>' PGVERSION=<major-postgres-version-to-restore-with>`
  - To get a list of all environment variables in your statefulset use `oc set env statefulset/<statefulset-name> --list`
  - Examples of values between`< >` are above in the **steps** section

5. `oc scale statefulset <statefulset-name> --replicas=<n>` with 'n' being desired number of pods.

##### Openshift UI Walkthrough

1. Scale your statefulset to 0
  - Under `Workloads` in the left pane, go to `StatefulSets`
  (docs/images/ss.png)
  - Use the arrows to scale your pods down to 0
  (docs/images/scaled-down.png)

2. Delete configmaps
  - Under `Workloads` in the left pane, go to `ConfigMaps`
  (docs/images/config.png)
  - Delete all configmaps in the list that are prefixed by your patroni cluster name
    - example: \<patroni-cluster\>-leader, \<patroni-cluster\>-config, \<patroni-cluster\>-failover

3. Delete PVCs
  - Under `Storage` in the left pane, go to `PersistentVolumeClaims`
  (docs/images/pvc.png)
  - Delete all PVCs in the list that contain your patroni cluster name
    - example: storage-volume-\<patroni-cluster\>-0, storage-volume-\<patroni\>-1

4. Set environment variables
  - Under `Workloads` in the left pane, go back to `StatefulSets`
  (docs/images/ss.png)
  - Select your statefulset & go to the `Environment` tab
  - Add the environment variables described in the `Steps` section above
  - **Save your environment variables with the save button at the bottom of the page**

5.

repository: bcgov/cas-postgres

branch_name: refs/heads/develop

gha_language: Shell

repo_name: bcgov/cas-postgres


text:
# smsapi
A server that exposes the SMS functionality of the SIMCom SIM800 cellular modem to the Internet, allowing you to write applications that connect to it.

Some of this code could be rewritten to be better and more reliable (maybe using functions on structs...), but it does _work_.

## Setup
The first time you run it, a file called `config.toml` will be created in the current directory, with contents like this:

```toml
# smsapi configuration
[server]
Port = 4725
Token = "hello"
SerialPort = "/dev/ttyUSB0"
```

You should stop the server (control-C) and change these settings.
* `Port` determines the port the web server should listen on.
* `Token` is a secret token that is required for all requests. This is how requests are authenticated.
* `SerialPort` is the serial port the SIM800 is connected to. On Windows, this will be in the format `COM1` (with the exact number depending on your system). On Linux and Mac, this will probably be in the format `/dev/ttyUSB1` or `/dev/ttyACM1`.

## Usage
There are currently five available API routes. All of them except for `GET /` return information as JSON (with the `Content-Type` header set appropriately).

All API routes require the token defined in the `config.toml` file to be sent with your request (as either a GET parameter in the URL, or, in the case of POST requests, as a form value).

* `GET /` - returns the string "hello there\n\ni am a server\n\ni can send text messages" (with `\n` being actual newlines)
* `GET /modem/battery` - returns information about the battery level of the modem, in the format `{ "status": "ok", "percentage": 100, "voltage": 4123 }`. (voltage is in millivolts)
* `GET /modem/ccid` - returns the CCID code for the current SIM card, in the format `{ "status": "ok", "ccid": "<ccid goes here>" }`
* `GET /modem/carrier` - returns the current cell carrier the SIM800 is connected to, in the format `{ "status": "ok", "carrier": "T-Mobile USA" }`
* `POST /sms/send` - requires parameters `to` and `msg`. Sends an SMS message to the given phone number. Returns either `{ "status": "ok" }` on success or `{ "status": "error", "error": "<error string>" }` on failure.

repository: thatoddmailbox/smsapi

repo_name: thatoddmailbox/smsapi


text:
# [94. Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/description/)

## Description

Given a binary tree, return the _inorder_ traversal of its nodes' values.

For example:

Given binary tree `[1,null,2,3]`,
```
   1
    \
     2
    /
   3
```

return `[1,3,2]`.

**Note:** Recursive solution is trivial, could you do it iteratively?

## Solution
- [Code](binarytreeinordertraversal.go)
- [Testing](binarytreeinordertraversal_test.go)

## Note
- [中文](NOTE_Ch-zh.md)

gha_language: Go


text:
# Spotify Polymer Element

This is an example of a [Polymer Web Component](www.polymer-project.org) that implements
a simple widget for previewing Spotify tracks.

It uses the new [Spotify Web API](https://developer.spotify.com/spotify-web-api/)
to get the track metadata, cover art and the preview MP3 file.

## Usage

You just need to include the polymer platform and this element in the head of
your html page.

Then, you can start using the `spotify-previewbutton` element as any other HTML element
in your page:

```html
<html>
<head>
  <script type="text/javascript" src="bower_components/platform/platform.js"></script>

  <link rel="import" href="bower_components/spotify-previewbutton/index.html">
</head>
<body>
  <spotify-previewbutton uri="spotify:track:0eGsygTp906u18L0Oimnem"></spotify-previewbutton>
</body>
</script>
```

## Running the example

To launch the example, install the `spotify-previewbutton` bower component:

```sh
$ bower install spotify-previewbutton
```

Then launch a web server:

```sh
$ ruby -run -e httpd . -p 5000 # "python -m SimpleHTTPServer 5000" will also do the trick
```

Then, you only need to navigate to [http://localhost:5000/bower_components/spotify-previewbutton/demo.html](http://localhost:5000/bower_components/spotify-previewbutton/demo.html) from any modern browser.

repository: JMPerez/spotify-previewbutton

repo_name: JMPerez/spotify-previewbutton


text:
[![Upload Python Package](https://github.com/anirudhpnbb/Pyostie/actions/workflows/python-publish.yml/badge.svg?branch=2.4.5)](https://github.com/anirudhpnbb/Pyostie/actions/workflows/python-publish.yml)
[![release](https://img.shields.io/github/release/anirudhpnbb/Pyostie)](https://img.shields.io/github/release/anirudhpnbb/Pyostie)

## Table of Contents

* [About the Project](#about-the-project)
* [Installation](#installation)
* [Usage](#usage)
* [Future Work](#Futurework)
* [Contact](#contact)

## About The Project

PYOSTIE is short for Python Open Source Text Information Extractor.

A very elegant and simple library to extract text from many file formats.

This module can extract text from PDfs, Office files, text files, Image files.
Also, we generate an excel file that gives you some deeper insights into the text. We are now only extracting insights for Image and PDF formats.( More to come soon.)

## Installation

1. Clone the repo
```sh
git clone https://github.com/anirudhpnbb/Pyostie.git
```

2. Install using pip or pip3
```commandline

pip3 install Pyostie

(or)

pip install Pyostie

```

## Usage

```python
import pyostie
```

# For image files with insights.

```python
output = pyostie.extract(filename, insights=True, extension="jpg") #### Format of the extension can also be "tif" or "pnb"
df, text = output.start()
```

# For image files without insights.

```python
output = pyostie.extract(filename, insights=False, extension="jpg")
text = output.start()
```

# For PDF files:

```python
output = pyostie.extract(filename, extension="pdf")
text = output.start()
```

# For PDF files with insights:

```python
output = pyostie.extract(filename, insights=True, extension="pdf")
text = output.start()
```

# For Excel files

```python
output = pyostie.extract(filename, extension="xlsx")
text = output.start()
```

# For word files

image_folder(optional): Address where image needs to be written
```python
output = pyostie.extract(filename, image_folder, extension="docx")
text = output.start()
```

# For audio files
```python
output = pyostie.extract(filename, extension="mp3")
text = output.start()
```

## Future Works

In this version, we can only extract text from PDFs, Excel, TXT, CSV and MP3 formats. Soon, we will be adding doc, ppt, pptx, and many more. Watch this space for more updates.

## Contact

Anirudh Palaparthi - [@anirudh8889](https://twitter.com/anirudh8889) - [pnbbanirudh](https://www.linkedin.com/in/pnbbanirudh/) -<EMAIL_ADDRESS>
Project Link: [PYOSTIE](https://github.com/anirudhpnbb/Pyostie)

repository: Pavan-Bellam/Pyostie

repo_name: Pavan-Bellam/Pyostie


text:
---
layout: post
title: "Strimzi survey: we want to hear from you!"
date: 2022-06-03
author: paolo_patierno
---

With the help of the CNCF, we're running another survey of the Strimzi community.
The main purpose is to hear from Strimzi users in order to know how they are using Strimzi.
This is really useful to the maintainers and contributors to make better decisions in terms of new features and define the roadmap of the project itself.

It would be great if you could spare the 5–10 minutes needed to [take the survey](https://www.surveymonkey.com/r/Strimzi-2022).

<!--more-->

## What we are interested in

We are interested in knowing about your usage of Strimzi, whether it's for development, evaluation or already in production.
In order to provide better support and backward compatibility, it is important to have an understanding of what Kubernetes versions our users are deploying Strimzi on.
Kubernetes API changes and deprecations can have an impact on the Strimzi project as well.

Similarly, it's helpful to the project to understand how quickly users adopt new Strimzi releases, and what prompts them to upgrade.

One of the most interesting features was the Kafka Connect Build. You can read more about it [here](https://strimzi.io/blog/2021/03/29/connector-build/).
It allows to build a new Kafka Connect image including the connectors you need, from different sources.
Maybe not all the users in the community know about it or others are already using it.
It is really useful for us to know.

We also introduced several Feature Gates in the recent versions.
These gates enable you to try new functionality and test it before it gets enabled by default.
But right now we don't know how many users are actually making use of them.

There are different ways to be engaged within the community and with the maintainers directly.
Reading the documentation, blog posts or the source code can be valuable to solve your issues. But sometime users require more interactive help. So we'd like to know which of the these options people find most useful when learning about how to use Strimzi effectively.

Regarding our blog, we would like to know what are the topics of most interest to you.
We want to write useful content which could help the community to use the project or to learn more about Apache Kafka as well.

If you are willing to take it, [here](https://www.surveymonkey.com/r/Strimzi-2022) is the survey that will be open until July 1st.

gha_language: HTML


text:
```
## User Order Show Page
The show page for an order will be shared between users, merchants and admins.
### User Control
- Users can cancel an order if at least one item in the order is NOT yet fulfilled
- When an order is cancelled, any fulfilled items have their inventory returned to their respective merchants
### Merchant Control
- Merchants only see items in the order that are sold by that merchant
- Items from other merchants are hidden
### Admin Control
- Admins can cancel an order on behalf of a user
- Admins can fulfill items on order on behalf of a merchant
```

license: ISC

repository: iandouglas/littleshop-cardcannon-small

repo_name: iandouglas/littleshop-cardcannon-small


text:
# Vim Syncthing

Adds syntax highlighting for Syncthing ignore files. Currently matches all files
starting with `.stignore`, so it will also match files such as
`.stignore-synced` if you use synced ignore files.

## Installation ##

### Using [Vundle][v] ###

1. Add `Plugin 'brgmnn/vim-syncthing'` to your `.vimrc`.
2. Run `vim +PluginInstall +qall`.

### Using [Pathogen][p] ###

Clone this repo into Vim's bundle directory.

    git clone https://github.com/brgmnn/vim-syncthing ~/.vim/bundle

## Syncing ignore files between machines

You can use Syncthing to sync ignore patterns between machines. Syncthing does
not sync `.stignore` files but you can use the `#include` to point to a file
that is synced.  You also
don't need to restart when adding patterns to your synced ignore list.

## License

MIT.

[p]: https://github.com/tpope/vim-pathogen
[v]: https://github.com/gmarik/vundle

repository: brgmnn/vim-syncthing

repo_name: brgmnn/vim-syncthing


text:
---
layout: "post.11ty.js"
title: "LWC - Using a Child Component"
date: "2019-08-26"
tags:
  - "Blog"
  - "LWC"
  - "Salesforce"
  - "SalesforceDeveloper"
  - "SalesforceDX"
slug: "lwc-using-a-child-component"
coverImage: "Screen-Shot-2019-08-25-at-10.18.01-PM.png"
---

* * *

Hi, I'm Brett with WIPDeveloper.com, I wanted to take a quick look at using a child component and a custom Lightning web component.

So the first thing we have to do is make a component to hold the child component. So I'm going to make a new lightning web component.

I'm going to call this one parent. And then I will make a new one. The first thing we're going to do is give it some markup. Give it a title of parent. So we know where we so we can see it on the page. And I misspelled parent, so let's change that, or let me spell component.

So I'm going to deploy this, it doesn't have the proper targets. So

first, I'm going to take the targets from the other one just so I don't have to.

Deploy it.

Now we have to add a tour page. So refresh our list of components.

Drop it in there. So momentarily saw, it's a child component, and that's because of a dry run I did earlier. Now we refresh our page, we should see our parent component.

Now, we need to add a child component. So let's go to to add a new Lightning web component called child.

And we're going to mark this one as exposed, create it, give it some HTML. Going to give it a panning around small.

Now, this is deployed to our org, but we have to get it so that it shows up in the body of the parent component. And so what we need to do in the parent component is we're going to add it like we would a normal HTML element.

So all custom web components require two names separated by or two words separated by a dash in the tag. Since we're using Lightning Web Components, all our tags are prefixed with the namespace. So our child component that has one name is actually has a prefix of our namespace. So in this case, it's `c`, and then `c-child`.

And we've added our child component to our parent component when we refresh the page again.

We will see our child of course it doesn't look very good. Why does it not look very good?

Oh, because it's outside of the card.

Oops.

No, it'll be inside the card. Everything will be fine.

Now it's our

Doesn't look fine, the child isn't padded enough.

Wrong. Oops. Wrong autocomplete.

`slds-p-around_small`.

Refresh the page.

There padding is a little better. Why don't we make that medium

Now we can see the child lined up with parent.

And there you go. We are now using a child component in our parent component.

## That’s it for now.

Remember to sign up for **[The Weekly Stand-Up!](https://wipdeveloper.wpcomstaging.com/newsletter/)**  and you can get updated with any new information we have on WIPDeveloper.com.

repository: BrettMN/wipdeveloper-wordpress-archive

repo_name: BrettMN/wipdeveloper-wordpress-archive


text:
# Sequiencial target charactors for MetaJumper

## Ripple Level
* 3 levels based on target chars number:
    - 1: surrounding paragraph(seperated by empty lines) in view port, if cursor at empty line, use para nearer(uper search first)
    - 2: viewport of current doc
    - 3...: all visible editors

> for 2,3... target chars: if the target is at the line end, use <dbd>Enter</kbd> to make it as three target chars.

show decorators only for current level, encorder charactors get by revmove charactors follows last target char of all levels, ~~note following chars in current level is usable if there is only one: code and fallowing char is the same.~~ deleted because if type fast for several following chars, would edit by mistake, so following chars are just used to narrow down search range, and user have to type decorator codes to go to target location;

when high level decorators shows low levels always show.

repository: metaseed/metaGo

gha_language: TypeScript

repo_name: metaseed/metaGo


text:
# @atlauncher/babel-preset-atlauncher

This is the babel preset to use for all JavaScript based projects using Babel at ATLauncher.

## Installation

To install simply run:

```bash
npm install --save-dev @atlauncher/babel-preset-atlauncher
```

And then create (or replace) a `.babelrc` file in the root directory of your project with the following contents:

```json
{
  "presets": ["@atlauncher/babel-preset-atlauncher"]
}
```

## Building

An important step towards building is to provide a `FINAL_ENVIRONMENT` environment variable when running babel to build.

Setting this to a value of `node` or simply leaving it out, will build for a NodeJS environment.

Setting it to `browser` will ensure that it's built with our browserlist in mind.

You should also always make sure to pass through the `NODE_ENV` environment variable for the appropriate environment
that you're building in, so that correct optimisations are made.


text:
### [CVE-2008-1451](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-1451)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

The WINS service on Microsoft Windows 2000 SP4, and Server 2003 SP1 and SP2, does not properly validate data structures in WINS network packets, which allows local users to gain privileges via a crafted packet, aka "Memory Overwrite Vulnerability."

### POC

#### Reference
- https://docs.microsoft.com/en-us/security-updates/securitybulletins/2008/ms08-034

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
# Type E thermocouples linearization library for Arduino

Provides support for [ITS-90](https://srdata.nist.gov/its90/download/type_e.tab) thermocouple linearization,
[Type E](https://en.wikipedia.org/wiki/Thermocouple#Type_E) thermocouples.

### Includes functions to:
 - convert a mV reading into an absolute temperature (C or F)
 - convert a mV reading + ambient temp reading to a compensated sensor temperature
 - convert a temperature (C or F) into the corresponding mV value


text:
#### Ex1.35

Show that the golden ratio φ (1.2.2) is a fixed point of the transformation x ↦ 1 + 1 / x , and use this fact to compute φ by means of the fixed-point procedure.

_Solution_ :
φ is the root of equation `x^2 = x + 1`
```
φ^2 = φ + 1
=> φ = 1 + 1 / φ
```
=> φ is the fixed point of `f(x) = 1 + 1/x `

φ is computed in script _golden_ratio_fixed_pt.scm_ = 1.6180 (rounded).

#### Ex1.36

Modify fixed-point so that it prints the sequence of approximations it generates, using the newline and display primitives. Then find a solution to x x = 1000 by finding a fixed point of x ↦ log  ( 1000 ) / log  ( x ) . (Use Scheme’s primitive log procedure, which computes natural logarithms.) Compare the number of steps this takes with and without average damping. (Note that you cannot start fixed-point with a guess of 1, as this would cause division by log  ( 1 ) = 0 .)

_Solution_ : Check script _fixed_pt_steps.scm_ .
Without avg damping, the solution took ~ 36 steps starting with 2 .
With avg damping, it only took 8 steps starting with 2 as the first guess !!

#### Ex1.37

An infinite continued fraction is an expression of the form
f = N 1 D 1 + N 2 D 2 + N 3 D 3 + … .
As an example, one can show that the infinite continued fraction expansion with the N i and the D i all equal to 1 produces 1 / φ , where φ is the golden ratio (described in 1.2.2). One way to approximate an infinite continued fraction is to truncate the expansion after a given number of terms. Such a truncation—a so-called finite continued fraction k-term finite continued fraction—has the form
N 1 D 1 + N 2 ⋱ + N k D k .
Suppose that n and d are procedures of one argument (the term index i ) that return the N i and D i of the terms of the continued fraction. Define a procedure cont-frac such that evaluating (cont-frac n d k) computes the value of the k -term finite continued fraction. Check your procedure by approximating 1 / φ using

(cont-frac (lambda (i) 1.0)
           (lambda (i) 1.0)
           k)

for successive values of k. How large must you make k in order to get an approximation that is accurate to 4 decimal places?
If your cont-frac procedure generates a recursive process, write one that generates an iterative process. If it generates an iterative process, write one that generates a recursive process.

_Solution_ :
Part - I :
When all Ni & Di are 1, we get,
```
f = 1 / (1 + f)   (since it is an infinite loop, taking one term out of it will still be equal to f)
=> f + f^2-1 = 0
=> 1/phi + 1/phi^2 - 1 = 0 (replacing f by 1/phi as said in the problem)
=> phi + 1 - phi^2 = 0
=> phi^2 = phi + 1
```
We already know phi is the root of the equation `x^2 = x+1`. Hence, the above statement `(f = 1 / phi)` is true !

Now, `1/phi = 0.6180`

Check script _continued_fraction.scm_ for a tail recursive (iterative) solution.
For k as low as 11, we are getting accurate approximation upto 4 decimal places.

Part - II :
For a recursive solution, check script _continued_fraction_rcrsn.scm_ .
From community of scheme wiki,
"The number of steps would be k. Now, the tricky part is sequence of the count from 1 to k.
For the recursive process, the fraction is built, in a way, from the outside to the inside.
So the count should go from 1 to k.
For the iterative process, however, the fraction accumulates from the inside to the outside,
and the count should consequently go from k to 1."

For the recursive process as well, the min no of iterations to get 4 decimal accuracy was 11 !

#### Ex1.38

In 1737, the Swiss mathematician Leonhard Euler published a memoir De Fractionibus Continuis, which included a continued fraction expansion for `e − 2` , where e is the base of the natural logarithms. In this fraction, the Ni are all 1, and the Di are successively 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, …. Write a program that uses your cont-frac procedure from Exercise 1.37 to approximate e, based on Euler’s expansion.

_Solution_ : Check script _approx_euler_no.lsp_ .
We get euler's no (2.71828) accurate upto 5 decimal places with a value of k = 10 !

#### Ex1.39

A continued fraction representation of the tangent function was published in 1770 by the German mathematician J.H. Lambert:
`tan  x = x / 1 − x^2 /  3 − x^2 / 5 − … ,`
where x is in radians. Define a procedure (tan-cf x k) that computes an approximation to the tangent function based on Lambert’s formula. k specifies the number of terms to compute, as in Exercise 1.37.

_Solution_ : Check script _tangent_approx.lisp_ .


text:
---
layout: post
title: "CanCan - make up your mind!"
date: 2010-08-25 15:05:00
comments: true
categories: Rails
author: Glenn Roberts
headline: If you're using CanCan and came across an error like this...
avatar: /images/avatars/glenn.jpg
image: /images/artwork/vim.jpg
---
``` bash
The :class option has been renamed to :resource for specifying the class in CanCan.
```

And you duly updated your controller code from;

``` ruby
authorize_resource :class => FundingFlow
```

To something like this;

``` ruby
authorize_resource :resource => FundingFlow
```

Since, like all good programmers, you do what you're told by error-messages.
1. cancan 1.1.1
2. cancan 1.3.2
```

Ah ha. And if you're using RVM like we do, then your default.gems might be specifying a different version (which in our case manifested in our staging server, not on local development).

So by making sure you're using the latest version (>= 1.3.2), and using the :class syntax i.e.

``` ruby
authorize_resource :class => FundingFlow
```

, you might save yourself a murder (or at the very least a weapons) charge.

repository: siyelo/blog

extension: markdown

repo_name: siyelo/blog


text:
Betwixt - Easy Tweening Library for .Net
============================

Betwixt is a quick way to ease and tween between any generic types, and provides a robust API.

# Download

You can get the latest repository here, or download precompiled library files from the [releases tab](https://github.com/Jewelots/Betwixt/releases)

You can also get this package using Nuget!

For x86: PM > Install-Package betwixt

# Usage

Please reference the documentation located in the [/doc](/doc) folder. Here is a very small overview, however:

General Use:
```csharp
// Initialisation
Tweener<float> tweener = new Tweener<float>(0, 10, 2, Ease.Elastic.Out);
// Update
tweener.Update(deltaTime);
// Anywhere
float newValue = tweener.Value;
```

You can also use your own custom type, with it's own lerp function (or let generics handle it)

```csharp
TimeSpan length = TimeSpan.FromSeconds(3);
Tweener<Vector2> tweener = new Tweener<Vector2>(startVector, endVector, length, Ease.Linear, Vector2.Lerp);
```

You can also specify your own ease function and make it into a set (or use the function directly)

```csharp
IEase myEaseSet = Generic.CreateFromOut(myEaseOutFunction);
Tweener<float> tweener = new Tweener<float>(0, 10, 2, myEaseSet.InOut);
```

Betwixt is flexible, and as long as your ease function matches the correct signature, you can use anything you want!

If you had a custom graph curve which had a "float GetValueAtTime(float time)" function you could even use:

```csharp
CustomGraphCurve myCustomGraphCurve = new CustomGraphCurve(graphPoints);

Tweener<float> tweener = new Tweener<float>(0, 10, 2, myCustomGraphCurve.GetValueAtTime);
```

Hopefully this inspires you to think of creative ways to use Betwixt!

repository: Jewelots/Betwixt

repo_name: Jewelots/Betwixt


text:
![](https://github.com/13r0ck/Space-Rocks-/blob/readme_update/Images/gif/main_menu.GIF?raw=true)

Space Rocks was a personal project to become more proficient with Python.
The goal of the project was to create a 3d clone of the classic game Asteroids.

### Personal Lessons from the Project
While by no means a fun game, Space Rocks! did accomplish its goal of teaching me parts of progamming that cannot be learned from a textbook. The main lesson was developing without the help of Stack Overflow. While I was able to learn many parts of Python through Stack Overflow, the game engine, Panda3d, have few and limited questions answered there. Most of the developemnt of the game involved reading the questionably written documentation and having to brute force my way to working code.

### Features of the Game
#### GUI
This project was my first foray into programing a GUI. The GUI uses the Panda3d API.
![](https://github.com/13r0ck/Space-Rocks-/blob/readme_update/Images/gif/ui_demo.GIF?raw=true)
#### Procedural Asteroid Generation
All asteroids are uniquely generated in 3d space via opensimplex noise with epoch time of each asteroid generation as the seed. Panda3d does not make 3d model creation/manipulation as simple as most modern game engines. Each vertex must have a unique coordinate in 3d space, and then the list of all verteces must be parsed manually and told (in the correct order) what other related verteces make each individual polygon of the asteroid. The texture of all asteroids is also procedurally generated, with deeper pits in the model being a darker gray.
![](https://github.com/13r0ck/Space-Rocks-/blob/readme_update/Images/gif/procedural-generation.GIF?raw=true)
#### Infinite Space Flight
The player can fly in any direction forever, and asteroids will populate the space around them. The same asteroids used at game launch are moved around the player as the player moves. Generation new asteroids would be possible but not computationaly fast enough for smooth gameplay.
![](https://github.com/13r0ck/Space-Rocks-/blob/readme_update/Images/gif/infinite-spaceflight.GIF?raw=true)
#### Space-Like Player Controls
The player can move freely with six degrees of freedom. All movement is relative to the players view. Similar to actual space, and the game Asteroids, the lack of friction will keep the player floating in any direction that force was given in. To maintain some arcade like gameplay there is a maximum velocity. Side note: The infinite spaceflight mechanic continues to work correctly when speed is unlocked even up to millions of m/s (Largest asteroid is ~10,000m in diameter.)
![](https://github.com/13r0ck/Space-Rocks-/blob/readme_update/Images/gif/space-lime-motion.GIF?raw=true)
#### Missles
It wouldn't bw an Asteroids clone if you couldn't shoot asteroids! Asteroids can be shot and will break from 1 Large -> 2 Medium -> 4 Small asteroids, exacxtly like the game Asteroids. Breaking a small asteroid create a "pointball" that is atracted to the player once the player gets close enough. The value of each pointball is realtive to the amount of time since the last small asteroid was shot. With a max value of 100 and a min of 20.
![](https://github.com/13r0ck/Space-Rocks-/blob/readme_update/Images/gif/missles.GIF?raw=true)
#### Space Death
It is possible to die is Space Rocks!  Unlike real space the universe turns red when you die.

![](https://github.com/13r0ck/Space-Rocks-/blob/readme_update/Images/gif/death_state.GIF?raw=true)

# How To Play
Download the repository and then run `python3 "/path/to/repository/space-rocks!.py"`
The game is tested to run in both Windows and Linux (Fedora + Pop!_OS)

## Dependencies
`pip install opensimplex`

`pip install panda3d`

Future updates should not break the game, but if so, tested versions are:
opensimplex version 0.3
Panda3d 1.10.6.post2

### Controls
#### Camera Relative Controls
w - forward

a - left

s - right

d - left

q - rotate left

e - rotate right

ctrl/shift - down

space - up
#### Gameplay Controls
move mouse - move the mouse to point the camera
mouse1 - fire missle
#### Dev Controls
0 - Stop all spaceship movement


text:
---
---

Some personal wikis and sites that I've been inspired by:

[buster.wiki/](https://buster.wiki/) - Strong design and everything has a date by the looks of it which enables an RSS feed. Very polished and thought through.

[are.na](https://are.na) - A platform that all the cool kids use for building personal knowledge libraries. Lightly social, perhaps the right answer but slightly questionable if they'll be around for a long time. Ymmv.

[Brendan's /canon](https://www.brendanschlagel.com/2017/11/05/canonize-creating-personal-canon-template/) - this was part of the original inspiration for me. A curated list of pure stock - things that Brendan returns to again and again. He has a template you can copy too.

[Worrydream's quotes page](http://worrydream.com/#!/quotes) - just a massive list of interesting quotes collected by Brett Victor. Notice how being one giant page makes it instantly searchable.

[daywreckers.com](http://daywreckers.com/) - from Ben Pieratt, not quite a wiki but a very minimal site designed to collect the dots. A daily visit from me.

[derek sivers' daily journal](https://sivers.org/dj) - a post from Derek Sivers on how to keep a text-file long-term store for your ideas and notes.

And there's lots more too - [this twitter thread](https://twitter.com/tomcritchlow/status/1083823277712248832) has a whole bunch of interesting rabbit holes.

repository: cunning-folk/pointingout

repo_name: cunning-folk/pointingout


text:
# java-4d

A 3D model editor for Codename Panzers game.
This is my first "complex" Java project, it dates back to 2009. At that time, writing this helped me a lot to learn Java. The reverse engineering of 4D file structure was a funny and exciting experience (I started from scratch, by changing some bytes around in the files and checking in-game effects), you can find some txt files with my notes (in Italian).

## Build & run

I used Netbeans to build this project, but everything supports maven should work (of course, command line too). With a `mvn clean install` you should be able to build a jar in the target directory. It contains all dependencies so you can run it with `java -jar java-4d-editor-<<version here>>.jar`

## Status & License

This project is not maintained anymore, if you want to expand it feel free to fork the repo.

The code is released under MIT license.


text:
# ἐξ-αιρέω -ῶ

<!-- Status: S2=NeedsEdits -->
<!-- Lexica used for edits:   -->

## Word data

* Strongs: G18070

* Alternate spellings:

* Principle Parts:

* Part of speech:

* Instances in Scripture: 8

* All Scriptures cited: Yes

## Etymology:

* LXX/Hebrew glosses:

in LXX chiefly for [נָצַל](//en-uhl/H5337) hi. ;

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses

* Synonyms for all senses:

## Senses

### Sense  1.0:

#### Definition:

#### Glosses:

to take out;

#### Explanation:

#### Citations:

to take out: c. acc, [ὀφθαλμόν](), [Mt 5:29](Mat 5:29) [18:9](Mat 18:9); mid.

### Sense  1.1:

#### Definition:

#### Glosses:

to take out for oneself, choose;

#### Explanation:

#### Citations:

to take out for oneself, choose: [Ac 26:17](Act 26:17) (Thayer, s.v.; Page, Ac., l.c., but v. infr.);

### Sense  1.2:

#### Definition:

#### Glosses:

to deliver;

#### Explanation:

#### Citations:

to deliver: [Ac 7:10](Act 7:10), [34](Act 7:34) (LXX) [12:11](Act 12:11) [23:27](Act 23:27) [26:17](Act 26:17) (EV, but v. supr.), [Ga 1:4](Gal 1:4).†

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
# What can be shared on MR-Pub?

MR-Pub currently welcomes interactive [Jupyter Books](https://jupyterbook.org/intro.html) along two tracks:
 - **Education** notebooks related to a workshop in the MRI field.
 - **Research** notebooks for articles published in Magnetic Resonance in Medicine.

# How to submit?

1. Create a public repository on [GitHub](https://github.com/) which will host the files.
2. Create a `content` folder at the root of your repository:
> * Place your [Jupyter](https://jupyter.org/) notebook(s) (`.ipynb`) and markdown files (optional)
> * Create a [`_toc.yml`](https://jupyterbook.org/customize/toc.html) to structure your book with the table of contents.
> * Create a [`_config.yml`](https://jupyterbook.org/customize/config.html) to configure book settings.
5. Create a `binder` folder at the root of your repository:
> * Add your [configuration files](https://mybinder.readthedocs.io/en/latest/using/config_files.html) to capture all the software dependencies.
> * For a list of sample repositories for use with Binder, see the [Sample Binder Repositories](https://mybinder.readthedocs.io/en/latest/examples/sample_repos.html) page.
6. Go to https://mybinder.org
7. Fill the repository name and save the given URL. This will be used to share your binder notebooks with others.
8. Click on `launch` and wait for the build. Please be patient, as the first build may take a long time depending on your setup. When your notebook loads, you are ready to share your notebooks!
9. [Create an issue](https://github.com/neurolibre/submit/issues/new?assignees=pbellec&labels=&template=submission.md&title=%5BSUBMISSION%5D) in this repository, using the "Submission" template, and fill in all the information.
10. Our team will fork your repository on https://github.com/neurolibre. We will test that everything is working, and contact you using your github handle for any issue we identify. The issues will be open on our fork of the repo, and you will be expected to submit pull request to this fork to address any issue.

–

repository: ISMRM/mrpub

repo_name: ISMRM/mrpub


text:
---
layout: post
title: 'bateson: vision of heaven by kipling is my vision of liberation'
date: '2017-09-24T08:18:00-04:00'
tags:
- mary catherine bateson
- rudyard kipling
- krista tippett
- liberation
---

in the [mary catherine bateson episode of on being][onbeing], bateson cites her mom's love of a particular poem, _when earth's picture is painted_ by rudyard kipling. the full poem is at the end, but i really liked the conversation krista had with bateson about the poem's vision of heaven.

in a sense, it is one way of describing what i imagine an ideal world would be like. in fact, in a sense, it's the world i'm working towards with my all of my support work: coaching, website building, and personal storytelling.

i'm working towards a world where, as the poem says, people get to exercise "tireless creativity." where people just get to do their passion whenever they want but can rest as long as they want and also have great supplies (a ten league canvas with brushes made of comet hair). my work about personal storytelling is about helping us understand ourselves so we can better understand how to relate to each other. my work on identity and portfolios is about supporting people to present themselves to the world as they wish to engage in it. and my coaching work is about supporting folks (mostly poc but not exclusively) to be and move and work in the world in ways that align with their identity while also moving towards real goals.

heaven is a place on earth, right?

### When Earth's Last Picture Is Painted

> When Earth's last picture is painted

> And the tubes are twisted and dried

> When the oldest colors have faded

> And the youngest critic has died

> We shall rest, and faith, we shall need it

> Lie down for an aeon or two

> 'Till the Master of all good workmen

> Shall put us to work anew

> And those that were good shall be happy

> They'll sit in a golden chair

> They'll splash at a ten league canvas

> With brushes of comet's hair

> They'll find real saints to draw from

> Magdalene, Peter, and Paul

> They'll work for an age at a sitting

> And never be tired at all.

> And only the Master shall praise us.

> And only the Master shall blame.

> And no one will work for the money.

> No one will work for the fame.

> But each for the joy of the working,

> And each, in his separate star,

> Will draw the thing as he sees it.

> For the God of things as they are!

[onbeing]: https://onbeing.org/programs/mary-catherine-bateson-composing-a-life-aug2017/

**words / writing / post-processing**
229w / 11min / 10min


text:
# steemitphilippines.com
Repository for Steemit Philippines Website

Steem Philippines, also known as SteemPH is an organization focused on growing the Filipino Steemit Blogging Community through support and positivity and empowerment. The goal is to also help spread awareness of Steemit, Utopian.io, and other technologies and applications built on the Steem blockchain across the various regions in the Philippines where we believe the power of the Steem blockchain can do the most good.

As we continue to grow, our mission is to provide tools and resources which will help the community grow and help them better understand and utilize the technology they have available to them to prosper, grow, and drive awareness to others in the community.

This Homepage is a resource that will help our community grow and serve as a place where all community members can go for information and support.  The project is constantly evolving based on the needs of the community and is an open-source tool which we would like to seek help in developing.

Below are the Installation Instructions to install Condenser - the back-end components for the website

## Installation

#### Docker

We highly recommend using docker to run condenser. This is how we run the
live steemit.com site and it is the most supported (and fastest) method of
both building and running condenser. We will always have the latest version
of condenser (master branch) available on Docker Hub. Configuration settings
can be set using environment variables (see configuration section below for
more information). If you need to install docker, you can get it at
https://get.docker.com

To bring up a running container it's as simple as this:

```bash
docker run -it -p 8080:8080 steemit/condenser
```

Environment variables can be added like this:

```bash
docker run -it --env SDC_DATABASE_URL="mysql://user:pass@hostname/databasename" -p 8080:8080 steemit/condenser
```

If you would like to modify, build, and run condenser using docker, it's as
simple as pulling in the github repo and issuing one command to build it,
like this:

```bash
git clone https://github.com/steemit/condenser
cd condenser
docker build -t="myname/condenser:mybranch" .
docker run -it -p 8080:8080 myname/condenser:mybranch
```

## Building from source without docker (the 'traditional' way):

#### Clone the repository and make a tmp folder

```bash
git clone https://github.com/steemit/condenser
cd condenser
mkdir tmp
```

#### Install dependencies

Install at least Node v8.7 if you don't already have it. We recommend using
`nvm` to do this as it's both the simplest way to install and manage
installed version(s) of node. If you need `nvm`, you can get it at
[https://github.com/creationix/nvm](https://github.com/creationix/nvm).

Condenser is known to successfully build using node 8.7, npm 5.4.2, and
yarn 1.3.2.

Using nvm, you would install like this:

```bash
nvm install v8.7
```

We use the yarn package manager instead of the default `npm`. There are
multiple reasons for this, one being that we have `steem-js` built from
source pulling the github repo as part of the build process and yarn
supports this. This way the library that handles keys can be loaded by
commit hash instead of a version name and cryptographically verified to be
exactly what we expect it to be. Yarn can be installed with `npm`, but
afterwards you will not need to use `npm` further.

```bash
npm install -g yarn
yarn global add babel-cli
yarn install --frozen-lockfile
yarn run build
```
To run condenser in production mode, run:

```bash
yarn run production
```

When launching condenser in production mode it will automatically use 1
process per available core. You will be able to access the front-end at
http://localhost:8080 by default.

To run condenser in development mode, run:

```bash
yarn run start
```

It will take quite a bit longer to start in this mode (~60s) as it needs to
build and start the webpack-dev-server.

By default you will be connected to steemit.com's public steem node at
`wss://steemd.steeemit.com`. This is actually on the real blockchain and
you would use your regular account name and credentials to login - there is
not an official separate testnet at this time. If you intend to run a
full-fledged site relying on your own, we recommend looking into running a
copy of `steemd` locally instead
[https://github.com/steemit/steem](https://github.com/steemit/steem).

#### Debugging SSR code

`yarn debug` will build a development version of the codebase and then start the
local server with `--inspect-brk` so that you can connect a debugging client.
You can use Chromium to connect by finding the remote client at
`chrome://inspect/#devices`.

#### Configuration

The intention is to configure condenser using environment variables. You
can see the names of all of the available configuration environment
variables in `config/custom-environment-variables.json`. Default values are
stored in `config/defaults.json`.

Environment variables using an example like this:

```bash
export SDC_CLIENT_STEEMD_URL="wss://steemd.steemit.com"
export SDC_SERVER_STEEMD_URL="wss://steemd.steemit.com"
```

Keep in mind environment variables only exist in your active session, so if
you wish to save them for later use you can put them all in a file and
`source` them in.

If you'd like to statically configure condenser without variables you can
edit the settings directly in `config/production.json`. If you're running
in development mode, copy `config/production.json` to `config/dev.json`
with `cp config/production.json config/dev.json` and adjust settings in
`dev.json`.

If you're intending to run condenser in a production environment one
configuration option that you will definitely want to edit is
`server_session_secret` which can be set by the environment variable
`SDC_SESSION_SECRETKEY`. To generate a new value for this setting, you can
do this:

```bash
node
> crypto.randomBytes(32).toString('base64')
> .exit
```

## Install mysql server

If you've followed the instructions up until this point you will already
have a running condenser installation which is entirely acceptable for
development purposes. It is *not required to run a SQL server for
development*. If you're running a full-fledged site however, you will want
to set one up.

Once set up, you can set the mysql server configuration option for
condenser using the environment variable `SDC_DATABASE_URL`, or
alternatively by editing it in `config/production.json`. You will use the
format `mysql://user:pass@hostname/databasename`.

Example:

```bash
export<EMAIL_ADDRESS>```

Here are instructions for setting up a mysql server and running the
necessary migrations by operating system:

OS X:

```bash
brew update
brew doctor
brew upgrade
brew install mysql
mysql.server restart
```

Debian based Linux:

```bash
sudo apt-get update
sudo apt-get install mysql-server
```

On Ubuntu 16.04+ you may be unable to connect to mysql without root access,
if so update the mysql root user as follows:

```
sudo mysql -u root
DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
```

Now launch mysql client and create steemit_dev database:
```bash
mysql -u root
> create database steemit_dev;
> quit
```

### Database migrations

This is a required step in order for the database to be 'ready' for
condenser's use.

Edit the file `src/db/config/config.json` using your favorite command line
text editor being sure that the username, password, host, and database name
are set correctly and match your newly configured mysql setup.

Run `sequelize db:migrate` in `src/db` directory, like this:

```bash
cd src/db
yarn exec sequelize db:migrate
```

## Style Guides For Submitting Pull Requests

### File naming and location

- Prefer CamelCase js and jsx file names
- Prefer lower case one word directory names
- Keep stylesheet files close to components
- Component's stylesheet file name should match component name

#### Js & Jsx

We use [prettier](https://github.com/prettier/prettier) to autofromat the
code, with [this configuration](.prettierrc). Run `yarn run fmt` to format
everything in `src/`, or `yarn exec -- prettier --config .prettierrc
--write src/whatever/file.js` for a specific file.

#### CSS & SCSS

If a component requires a css rule, please use its uppercase name for the
class, e.g. "Header" class for the header's root div.  We adhere to BEM
methodology with exception for Foundation classes, here is an example for
the Header component:

```html
<!-- Block -->
<ul class="Header">
  ...
  <!-- Element -->
  <li class="Header__menu-item">Menu Item 1</li>
  <!-- Element with modifier -->
  <li class="Header__menu-item--selected">Element with modifier</li>
</ul>
```

## Storybook

`yarn run storybook`

## Testing

### Run test suite

`yarn test`

will run `jest`

### Test endpoints offline

If you want to test a server-side rendered page without using the network, do this:

```
yarn build
OFFLINE_SSR_TEST=true<EMAIL_ADDRESS>NODE_ENV=production node --prof lib/server/index.js
```

This will read data from the blobs in `api_mockdata` directory. If you want to use another set of mock data, create a similar directory to that one and add an argument `OFFLINE_SSR_TEST_DATA_DIR` pointing to your new directory.

gha_language: JavaScript


text:
# Problem Space

## Writing Specs
### 1 - Syntax for defining specs

* [x] Descriptions of expected behavior(s): `JavaSpec#it`.
* [x] Procedures to verify those expectations `JavaSpec#it`.
* [x] Description of what (class, method, or function) is being tested: `JavaSpec#describe`.
* [x] Description of any particular circumstances, during which those expectations apply:
  `JavaSpec#context`.
* [x] Disabled spec, that should not be run: `JavaSpec#disabled`.
* [x] Pending spec, that lacks a verification: `JavaSpec#pending`.

`StaticMethodSyntax` shows concise JavaSpec syntax by using static imports for JavaSpec methods.
It's more concise–and there are fewer opportunities to mix up scope–than with passing scope/context
parameters back to the lambdas.

The syntax for `disabled` is nice to write, but running it is quite misleading.  Could JavaSpec
create the `DyanmicTest` as always, but also add a `TestFilter` to ignore it?

### 2 - Syntax to help Arrange and Clean

* [x] Common instance/factory for generating the test subject: `JavaSpec<S>#subject`.
* [x] Declaration of reused variables: Class fields, local variables (immutable), local atomic
  variables (mutable).
* [x] Creating common data or instantiating collaborators: Extract helper functions.
* [x] Defining a common setup procedure that runs before each spec in a container:
  `JavaSpec#beforeEach`.
* [x] Defining a common teardown procedure that runs after each spec in a container:
  `JavaSpec#afterEach`.

Declaring and instantiating the test subject was a point of friction with declaration-only syntax
with static methods. There isn't a way to add static methods that return type-safe subjects in their
own type, so this pushed the design towards instantiating a `JavaSpec<S>` instance and using that to
declare all specs.  This allowed for the addition of generic methods to declare and create test
subjects.

What is the impact of using a `JavaSpec` instance instead of static methods?  While it is a little
more verbose to declare and use the instance, it's not as distracting as I thought it would be.  It
still remains possible to make a static wrapper (that tracks a thread- or class-local `JavaSpec`
instance), if a more compact syntax is needed.  Such a wrapper would sacrifice the type-safe subject
methods, however.

It is possible to extend the instance-based (and likely also static-based) flavor of `JavaSpec` to
support lambdas that run `beforeEach` and `afterEach`, just like you would see in Jasmine and RSpec.
This supports arbitrary setup and teardown work to DRY test code and maintain a clean, known state
for each spec.  It also has all the usual downsides of this approach, by making it harder to
determine which code executes for any given spec.

`ExUnit` does not allow [nested describe blocks](https://hexdocs.pm/ex_unit/ExUnit.Case.html), and
that design pressure was pretty helpful during my tenure in Elixir.

> Note describe blocks cannot be nested. Instead of relying on hierarchy for composition, developers
> should build on top of named setups.
> ...
> By forbidding hierarchies in favor of named setups, it is straightforward for the developer to
> glance at each describe block and know exactly the setup steps involved.

The downside, is that it's not clear how to implement such careful scoping without having distinct
objects per scope (a top-level one that allows `#describe` and all others which omit `#describe`),
without the kind of fine-grained syntax that seems to be possible with Elixir.  While that behavior
could be implemented at runtime, that seems like a recipe for lots of unexpected exceptions (and
frustration) when using `JavaSpec`.  So I think the right balance here is to advocate for less
nesting while still allowing developers full flexibility to develop their own style.

Finally, the whole thing with setting a variable's value in one lambda (`beforeEach`) and accessing
it in a spec (`it`) is more of a cognitive load–at least in theory–than I was hoping.  In practice,
it seems like a simple call to `AtomicReference#set` and `AtomicReference#get` is enough to get by,
by this will need some verification in cases where Jupiter runs specs in parallel (does it just
_run_ them in parallel, or does it _declare_ them in parallel too?).  It will also require an
example or two for developers–like me–who never had to use `AtomicReference` before.

`#subject` is still the way I prefer to declare the instance under test, but this `AtomicReference`
usage is likely to come up when instantiating collaborators, at the very least.  And not everybody
is on the `subject` train.

### Where in a spec class to use this syntax, to declare specs

* [ ] Jupiter-tagged test factory method
* [ ] Implement a method from a `JavaSpec` base class, that is wired up to a Jupiter-tagged test
  factory method
* [ ] Constructor
* [ ] Instance initializer
* [ ] Static initializer (ew)

----
## Running Specs
### How to run specs, in IntelliJ

* [ ] Gradle test runner: Does not show `@DisplayName`, for regular Jupiter syntax.
* [ ] IntelliJ test runner: Works for `@DisplayName` in Jupiter syntax, and working so far for
  `DynamicTest`.

### How to run specs, on the command line

* [ ] Use the `junit-jupiter-standalone` jar
* [ ] Make our own CLI, for JavaSpec (hard)

### How to run specs, in CI

> Is running in CI _exactly_ the same as regular, command-line usage, or are could there be subtle
> differences?

### How to report results

* [ ] Finding exceptions that happen in the production code and exceptions that happen in the test
  code, and tracing back from the stack trace to both.
* [ ] On the command-line: The Jupiter standalone jar would be best
* [ ] When running on the command-line, during CI
* [ ] When running in Gradle: Uhh...use the built-in test reporter?  Compatible with custom
  reporters? Write our own custom reporter?
* [ ] When running in IntelliJ: IntelliJ Test Runner seems to be handling Jupiter syntax ok, so far.

### How to trace back to failed assertions and/or failures in production code

* [ ] Pass a `URI` to the `DynamicNode` factory methods, with a URI to the related spec syntax.

----
## Interface with `jupiter-engine`
### How to get `junit-jupiter-engine` to ask JavaSpec for `DynamicNodes` (tests and containers)

* [ ] Tag the factory method with `@TestFactory`
* [ ] Tag the test/spec class with an extension: Is there an extension for test factories?
* [ ] Call a Jupiter registration method?  Does it need to be tagged with something else?

### How to represent specs, as Jupiter tests

* [ ] `DynamicNode` base class for all test-related constructs
* [ ] `Stream<DynamicNode>` for any number of tests and/or containers
* [ ] `DynamicTest` for test descriptions and verification procedures
* [ ] `DynamicContainer` for what is being tested and contextual circumstances

### Where to store specs and/or Jupiter test objects (`DynamicNode`)

* [ ] JavaSpec singleton: Might work as long as only 1 spec class is declaring at a time.
* [ ] JavaSpec "class-local": Something like `ThreadLocal`, but tied to the calling test class
  instead of to a thread.

repository: kkrull/javaspec

repo_name: kkrull/javaspec


text:
---
layout: post
title: Ditch Install Scripts, give me Chef.
excerpt: It's time to end the install.sh and move towards chef or puppet.
category: blog
---

Project maintainers usually have an install wiki, or document, or book on how to install their software package. Everyone who wants to try it runs into the same issues and same decisions while installing. Oh it's ruby1.8 on Ubuntu 12.10, well then compile it yourself, or worse yet there is a install.sh that works only on one distro, only one time, if you answer all the questions right...

This is many times a huge barrier to evaluating new software.

What I'm proposing is software projects start to make chef and puppet recipes first class citizens of their project repository instead of waiting for opscode, puppet, or the community to build them for their project.

Currently there are many recipes available from the community but these are usually lagging behind releases. In the case opscode and tomcat7 (released in 2010), a release can be held up by copyright issues of a community patch.

Cutting down the barrier to entry and allowing people to try your software project, on their own OS/Cloud/Infrastructure almost instantly in a testable, repeatable, maintainable  recipe cuts down that barrier to next to nothing.

gha_language: CSS