text:
# JRuby Gradle plugin

[![Build Status](https://travis-ci.org/jruby-gradle/jruby-gradle-plugin.svg?branch=master)](https://travis-ci.org/jruby-gradle/jruby-gradle-plugin) [ ![Download](https://api.bintray.com/packages/jruby-gradle/plugins/jruby-gradle-plugin/images/download.png) ](https://bintray.com/jruby-gradle/plugins/jruby-gradle-plugin/_latestVersion) [![Gitter chat](https://badges.gitter.im/jruby-gradle/jruby-gradle-plugin.png)](https://gitter.im/jruby-gradle/jruby-gradle-plugin)

Join us on the [jruby-gradle mailing list](https://groups.google.com/forum/#!forum/jruby-gradle)!

The purpose of plugin is to encapsulate useful [Gradle](http://www.gradle.org/)
functionality for JRuby projects. Use of this plugin replaces the need for both
[Bundler](http://bundler.io/) and [Warbler](https://github.com/jruby/warbler)
in JRuby projects.

The Ruby gem dependency code for this project relies on the [Rubygems Maven
proxy](http://rubygems-proxy.torquebox.org/) provided by the
[Torquebox](http://torquebox.org) project.

This is the base plugin. If you are interesting in doing the following then consult the pages for the appropriate
plugins:

* Building JRuby-based Java JARs, including making them executable -
[jruby-gradle-jar-plugin](http://github.com/jruby-gradle/jruby-gradle-jar-plugin)
* Building JRuby-based Java Web Applications (WARs),  -
[jruby-gradle-war-plugin](http://github.com/jruby-gradle/jruby-gradle-war-plugin)

## Compatilibity

This plugin requires Gradle 2.0 or better

## Getting Started

```groovy
buildscript {
    repositories { jcenter() }

    dependencies {
      classpath group: 'com.github.jruby-gradle', name: 'jruby-gradle-plugin', version: '0.1.2'
    }
}

apply plugin: 'com.github.jruby-gradle.base'
```

### Adding gems

You can also add Ruby gem dependencies in your `build.gradle` file under the
`gem` configuration, e.g.:

```groovy
dependencies {
    gems group: 'rubygems', name: 'sinatra', version: '1.4.5'
    gems group: 'rubygems', name: 'rake', version: '10.3.+'
}
```

## Default Tasks

The plugin provides the following tasks:

 * `jrubyPrepareGems` - Extract GEMs declared as dependencies under `gems` to `jruby.gemInstallDir`. This is as instance
 of `JRubyPrepareGems`.
 * `jrubyPrepare` - Call `jrubyPrepareGems`. Also copies the
   content of Java-based dependencies into `.jarcache/` for interpreted use

## JRubyExec - Task for Executing a Ruby Script

In a similar vein to ```JavaExec``` and ```RhinoShellExec```, the ```JRubyExec``` allows for Ruby scripts to be executed
in a Gradle script using JRuby.

```groovy
import com.github.jrubygradle.JRubyExec

dependencies {
    jrubyExec 'rubygems:credit_card_validator:1.2.0'
}

task runMyScript( type: JRubyExec ) {
    script 'scripts/runme.rb'
    scriptArgs '-x', '-y'
}
```

Common methods for ```JRubyExec``` for executing a script

* ```script``` - ```Object``` (Usually File or String). Path to the script.
* ```scriptArgs``` - ```List```.  List of arguments to pass to script.
* ```workingDir``` - ```Object``` (Usually File or String).  Working directory for script.
* ```environment``` - ```Map```.  Environment to be set. Do not set ```GEM_HOME``` or ```GEM_PATH``` with this method.
* ```standardInput``` - ```InputStream```.  Set an input stream to be read by the script.
* ```standardOutput``` - ```OutputStream```.  Capture the output of the script.
* ```errorOutput``` - ```OutputStream```.  Capture the error output of the script.
* ```ignoreExitValue``` - ```Boolean```.  Ignore the JVm exit value. Exit values are only effective if the exit value of the Ruby script is correctly communicated back to the JVM.
* ```configuration``` - ```String```.  Configuration to copy gems from. (*)
* ```classpath``` - ```List```.  Additional Jars/Directories to place on classpath.
* ```jrubyVersion``` - ```String```.  JRuby version to use if not the same as ```project.jruby.execVersion```.
* ```gemWorkDir``` - ```File```. Provide a custom working directory for unpacking GEMs. By default each `JRubyExec` task
  uses it's own work directory. Use this to set a common work directory for a number of tasks.

(*) If ```jRubyVersion``` has not been set, ```jrubyExec``` will used as
configuration. However, if ```jRubyVersion``` has been set, no gems will be used unless an explicit configuration has been provided

Additional ```JRubyExec``` methods for controlling the JVM instance

* ```jvmArgs``` - ```List```. See [jvmArgs](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:jvmArgs)
* ```allJvmArgs``` - ```List```. See [allJvmArgs](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:allJvmArgs)
* ```systemProperties``` - ```Map```. See [systemProperties](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:systemProperties)
* ```bootstrapClassPath``` - ```FileCollection``` or ```List```. See [bootstrapClassPath](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:bootstrapClasspath)
* ```minHeapSize``` - ```String```. See [minHeapSize](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html)
* ```maxHeapSize``` - ```String```. See [maxHeapSize](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:maxHeapSize)
* ```defaultCharacterEncoding``` - ```String```. See [defaultCharacterEncoding](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html)
* ```enableAssertions``` - ```Boolean```. See [enableAssertions](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:enableAssertions)
* ```debug``` - ```Boolean```. See [debug](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:debug)
* ```copyTo``` - ```JavaForkOptions```. See [copyTo](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html)
* ```executable``` - ```Object``` (Usually ```File``` or ```String```). See [executable](http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:executable)

## jrubyexec extension

Similar to ```javaexec``` and ```exec``` it is possible to add the execution of a jruby script within another task

```groovy
task needSomeRubyLove {
  jrubyexec {
    script 'scripts/runme.rb'
    scriptArgs '-x', '-y'
  }
}
```

The behaviour of `project.jrubyexec` is slightly different to that of `JRubyExec`.

* The version of `jruby-complete` is strictly tied to the `jruby.execVersion`. Therefore trying to set `jrubyVersion`
in the ```jrubyexec``` closure will cause a failure
* GEMs and additional JARs are only taken from the `jrubyExec` configuration.
* It is not possible to supply a `configuration` parameter to the `jrubyexec` closure.
* GEMs will be installed to `jruby.gemInstallDir`. Existing gems will not be overwritten.

As with `JRubyExec`, `args`, `setArgs` and `main` are illegal within the `jrubyexec` closure.
All other methods should work.

### Running a Ruby PATH command

Because `JRubyExec` checks for the existence of the script, it might look at first whether running Ruby commands from
`PATH` could be difficult. However, this is totally possible by utilising `jrubyArgs` and passing `-S` as one would do
 when using `ruby` or `jruby` on the command-line. Here is an example of running
`rake` as task.

```groovy
task rake( type : JRubyExec ) {
    jrubyArgs '-S'
    script 'rake'
    scriptArgs '/path/to/Rakefile', 'target1', 'target2'
}
```

or even

```groovy
ext {
    rake = { String target ->
        jrubyexec {
            jrubyArgs '-S'
            script 'rake'
            scriptArgs '/path/to/Rakefile', target
        }
    }
}
```

## JRubyPrepareGems - A task for unpacking GEMs

Unpacking occurs using the default `jruby` version as set by `jruby.execVersion`.

```groovy
import com.github.jrubygradle.JRubyPrepareGems

task unpackMyGems( type : JRubyPrepareGems ) {

  // Parent directory for unpacking GEMs.
  // Gems will end up in a subdirectory 'gems/GemName-GemVersion'
  outputDir buildDir

  // Add one or more gems
  // Can be String(s), File(s), FileCollection(s) or Configuration(s)
  gems project.configuration.gems

}
```

## Advanced Usage

### Using a custom Gem repository

By default the jruby plugin will use
[rubygems-proxy.torquebox.org](http://rubygems-proxy.torquebox.org) as its
source of Ruby gems. This is a server operated by the Torquebox project which
presents [rubygems.org](https://rubygems.org) as a Maven repository.

If you **do not** wish to use this repository, you can run your own Maven
proxy repository for either rubygems.org or your own gem repository by
running the [rubygems-servlets](https://github.com/torquebox/rubygems-servlets)
server.

You can then use that custom Gem repository with:

```groovy
jruby {
    defaultRepositories = false
}

repositories {
    maven { url : 'http://localhost:8989/releases' }
}

dependencies {
    gems group: 'com.lookout', name: 'custom-gem', version: '1.0.+'
}
```

## Using the Ruby interpreter

There are still plenty of cases, such as for local development, when you might
not want to create a full `.war` file to run some tests. In order to use the
same gems and `.jar` based dependencies, add the following to the entry point
for your application:

```ruby
# Hack our GEM_HOME to make sure that the `rubygems` support can find our
# unpacked gems in build/gems/
vendored_gems = File.expand_path(File.dirname(__FILE__) + '/build/gems')
if File.exists?(vendored_gems)
  ENV['GEM_HOME'] = vendored_gems
end
```

**Note:** in the example above, the `.rb` file is assuming it's in the top
level of the source tree, i.e. where `build.gradle` is located

repository: emilong/jruby-gradle-plugin

repo_name: emilong/jruby-gradle-plugin


text:
---
title: Versioning
---

# {{$frontmatter.title}}

<TocHeader />
[[toc]]

All versions of the docs are inside the api3-docs repo. Versioning of the docs is not implemented using traditional tags in a GitHub repo.

## Understand Versions

Different versions of the documentation live in the project's api3-docs/docs folder.

```text
docs/
 |- 0.1.0/
 |- dev
 |- next/
 |- pre-alpha/
```

### Declaring Versions

A folder in **/docs** is declared as a version in the .vuepress/config.json file (versions key) along with its *url* (entry path). The versions are used to populate the versions pick-list in the navbar. Note that the folder **/dev** is not declared as a version and as such is just another route on the documentation website. It will not appear in the versions pick-list.

```json
versions:[
  {name:'next', url:'/next/'},
  {name:'0.1.0', url:'/0.1.0/'},
  {name:'pre-alpha', url:'/pre-alpha/'},
],
```

### next

The **/next** folder is a _working/future_ version. It is never shown in the production website on gh-pages. The next release can be accessed in production by changing the browser URL to **.../api3-doc/next/**.

## Create a Version

It is assumed that the **next** folder is the work in progress that will become the new version.

1. Make a copy of the **next** folder and name it (e.g. 0.2.0).

1. Update the **versions** key in .vuepress/config.json. Provide the version name and url. The url is the first markdown file to show when a version is selected in the navbar. A url without a file will load the README.md by default.

    ```json
    versions:[
      {name:'next', url:'/next/'},
      {name:'0.2.0', url:'/0.2.0/'},
      ...
    ],
    ```

1. The **next** version probably contained hyperlinks to remote GitHub repos. More than likely these link will need updating in the version just created.

## Update Older Versions

Older versions can be updated at any time, even will work progresses on the **next** version. It should be noted that such updates will not be reflected in the next version, if needed they must be added separately.

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
### TensorFlow Makefile

The recommended way to build TensorFlow from source is using the Bazel
open-source build system. Sometimes this isn't possible though:

 - The system may not have the RAM or processing power to support Bazel.
 - Bazel dependencies might not be available.
 - You may want to cross-compile for an unsupported target system.

This experimental project supplies a Makefile automatically derived from the
dependencies listed in the Bazel project, that can be used with GNU's make tool.
It offers the ability to compile the core C++ runtime into a static library, but
doesn't include more advanced features like Python or other language bindings,
or GPU support.

## Building

To compile the library and an example program using it, first pull the
dependencies:

```bash
tensorflow/contrib/makefile/download_dependencies.sh
```

You should only need to do this step once, it puts required libraries like Eigen
in the `tensorflow/contrib/makefile/downloads/` folder. You will also need to
make sure you have a version of [protobuf 3](https://github.com/google/protobuf)
installed on your system, either through package management or building from
source.

Then you can build the project:

```bash
make -f tensorflow/contrib/makefile/Makefile
```

This should compile a static library in
`tensorflow/contrib/makefile/gen/lib/tf_lib.a`, and create an example executable
at `tensorflow/contrib/makefile/gen/bin/benchmark`. To run the executable, use:

```bash
tensorflow/contrib/makefile/gen/bin/benchmark --graph=tensorflow_inception_graph.pb
```

You should download the example graph from [http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz](http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz).

## Supported Systems

The script has been tested on Ubuntu and OS X. If you look in the Makefile
itself, you'll see it's broken up into host and target sections. If you are
cross-compiling, you should look at customizing the target settings to match
what you need for the system you're aiming at.

## Dependencies

The Makefile loads in a list of dependencies stored in text files. These files
are generated from the main Bazel build by running
`tensorflow/contrib/makefile/gen_file_lists.sh`. You'll need to re-run this i
you make changes to the files that are included in the build.

Header dependencies are not automatically tracked by the Makefile, so if you
make header changes you will need to run this command to recompile cleanly:

```bash
make -f tensorflow/contrib/makefile/Makefile clean
```

repository: alanamarzoev/tensor

branch_name: refs/heads/master

repo_name: alanamarzoev/tensor


text:
```yamlmeta
{
  "namespace": "HH\\Asio"
}
```

An *awaitable* is the key construct in `async` code. An awaitable is a first-class object that represents a possibly asynchronous
operation that may or may not have completed. We `await` the awaitable until the operation has completed.

## `Awaitable`

Awaitables are represented by the interface called `Awaitable`. While there are several classes that implement `Awaitable`, there is no
need to concern ourselves with their implementation details. `Awaitable` is the only interface we need.

The type returned from an async function is `Awaitable<T>`, where `T` is the final result type (e.g., `int`) of the awaited value.

```Hack
async function foo(): Awaitable<int> { ... }

$x = foo();         // $x will be an Awaitable<int>
$x = await foo();   // $x will be an int
```

@@ awaitables-examples/awaitable-return.php @@

All `async` functions must return an `Awaitable<T>`. Calling an `async` function will therefore yield an object implementing the `Awaitable`
interface, and we must `await` or `join` it to obtain an end result from the operation. When we `await`, we are pausing the current task until
the operation associated with the `Awaitable` handle is complete, leaving other tasks free to continue executing. `join` is similar; however it
blocks all other operations from completing until the `Awaitable` has returned.

## Awaiting

In most cases, we will prefer to `await` an `Awaitable`, so that other tasks can execute while our blocking operation completes.  Note however,
that only `async` functions can yield control to other asyncs, so `await` may therefore only be used in an `async` function.  For other locations,
such as a `main` block, we will need to use `join`, as will be shown below.

### Batching Awaitables

Many times, we will `await` on one `Awaitable`, get the result, and move on. For example:

@@ awaitables-examples/single-awaitable.php @@

We will normally see something like `await f();` which combines the retrieval of the awaitable with the waiting and retrieving of the result
of that awaitable. The example above separates it out for illustration purposes.

Here we are using one of the library helper-functions in order to batch a bunch of awaitables together to then `await` upon:
* `HH\Lib\Vec\from_async`: vec of awaitables with consecutive integer keys
* `HH\Lib\Dict\from_async`: dict of awaitables with integer or string keys

@@ awaitables-examples/multiple-awaitables.php @@

## Join

Sometimes we want to get a result out of an awaitable when the function we are in is *not* `async`. For this there is `HH\Asio\join`, which
takes an `Awaitable` and blocks until it resolves to a result.

This means that invocations of async functions from the top-level scope cannot be awaited, and must be joined.

@@ awaitables-examples/join.php @@

We should **not** call `join` inside an `async` function. This would defeat the purpose of `async`, as the awaitable and any dependencies will
run to completion synchronously, stopping any other awaitables from running.

repository: carlendev/user-documentation

gha_license_id: NOASSERTION

repo_name: carlendev/user-documentation


text:
# ldpc
## A simple small library for experimenting with LDPC codes

This codec uses the quasi-cyclic (QC) LCPC checksum arrays used in
IEEE Std 802.11-2016, Annex F.  These are currently used for forward error correction
for 802.11 n, ac, and h devices.  Why?  Not only because they have of course been
tested extensively, but the spec also has test data to validate any new software
implementation.

The codec uses the Log Likelihood Sum-Product algorithm, so should prove to
be very effective in signal reconstruction and sensitivity.

### Adding to your npm project

```
npm i --save https://github.com/ishmal/ldpc
```

### Using in an app
```
import { Ldpc } from "ldpc";

const codec = new Ldpc.LdpcCodec();
codec.withCrc = true/false;   //defaults to true
```
#### Pick a code rate and length
```
codec.setCode("1/2", "648");  // default
codec.setCode("1/2", "1296");
codec.setCode("1/2", "1944");

codec.setCode("2/3", "648");
codec.setCode("2/3", "1296");
codec.setCode("2/3", "1944");

codec.setCode("3/4", "648");
codec.setCode("3/4", "1296");
codec.setCode("3/4", "1944");

codec.setCode("3/4", "648");
codec.setCode("3/4", "1296");
codec.setCode("3/4", "1944");
```

#### Encode
```
codec.encodeBytes(byteArray);
```
or
```
codec.encodeText(string);
```

will break the input data into chunks that fit in codewords,
encode each one, are return an array of bit arrays for
transmitting over an AWGN channel.

#### Decode
This kind of transport is called a "binary input channel."
What comes out of the encoder as 1's and 0's is turned into
analog levels for transmission.

On the receiving side,  we expect arrays of floats for each
message,  centered around 0, < 0 for 1,  >= 0 for 0.

```
codec.decode(array of bits);  //returns an array of bytes
```
or
```
codec.decodeText(array of bits); // returns a string
```

### More information
*  Look at the tests to see how it is done.
*  Feel free to ask me any questions.

### Final
Hope that this helps you in your signal processing project.  If you have any
ideas on how to improve this library, please let me know.

Thanks!


text:
# Migration

## DSL

Generator will create template file for you with next name  pattern "timestamp_your_underscored_migration_name.cr". Empty file looks like this:

```crystal
class YourCamelCasedMigrationName < Jennifer::Migration::Base
  def up
  end

  def down
  end
end
```

`up` method is needed for placing your db changes there, `down` - for reverting your changes back.

Regular example for creating table:

```crystal
create_table(:addresses) do |t|
  # creates field contact_id with Int type, allows null values and creates foreign key
  t.reference :contact

  t.string :street, {:size => 20, :sql_type => "char"} # creates string field with CHAR(20) db type
  t.bool :main, {:default => false} # sets false as default value
end
```

There are next methods which presents corresponding types:

| Method | PostgreSQL | MySql | Crystal type |
| --- | --- | --- | --- |
| `#integer` | `int` | `int` | `Int32` |
| `#short` | `SMALLINT` | `SMALLINT` | `Int16` |
| `#bigint` | `BIGINT` | `BIGINT` | `Int64` |
| `#tinyint` | - | `TINYINT` | `Int8` |
| `#float` | `real` | `float` | `Float32` |
| `#double` | `double precision` | `double` | `Float64` |
| `#numeric` | `NUMERIC` | - | `PG::Numeric` |
| `#decimal` | `DECIMAL` | `DECIMAL` | `PG::Numeric` (pg); `Float64` (mysql) |
| `#string` | `varchar(254)` | `varchar(254)` | `String` |
| `#char` | `char` | - | `String` |
| `#text` | `TEXT` | `TEXT` | `String` |
| `#bool` | `boolean` | `bool` | `Bool` |
| `#timestamp` | `timestamp` | `datetime` | `Time` |
| `#date_time` | `timestamp` | `datetime` | `Time` |
| `#date` | `date` | `date` | `Time` |
| `#blob` | `blob` | `blob` | `Bytes` |
| `#json` | `json` | `json` | `JSON::Any` |
| `#enum` | - | `ENUM` | `String` |

In Postgres enum type is defined using custom user datatype which also is mapped to the `String`.

PostgreSQL specific datatypes:

| Method | Datatype | Type |
| --- | --- | --- |
| `#oid` | `OID` | `UInt32` |
| `#jsonb` | `JSONB` | `JSON::Any` |
| `#xml` | `XML` | `String` |
| `#blchar` | `BLCHAR` | `String` |
| `#uuid` | `UUID` | `UUID` |
| `#timestampz` | `TIMESTAMPZ` | `Time` |
| `#point` | `POINT` | `PG::Geo::Point` |
| `#lseg` | `lseg` | `PG::Geo::LineSegment` |
| `#path` | `PATH` | `PG::Geo::Path` |
| `#box` | `BOX` | `PG::Geo::Box` |
| `#polygon` | `POLYGON` | `PG::Geo::Polygon` |
| `#line` | `LINE` | `PG::Geo::Line` |
| `#circle` | `CIRCLE` | `PG::Geo::Circle` |

Also if you use postgres array types are available as well: `Array(Int32)`, `Array(Char)`, `Array(Float32)`,  `Array(Float64)`, `Array(Int16)`, `Array(Int32)`, `Array(Int64)`, `Array(String)`, `Array(Time)`, `Array(UUID)`. Currently only plain (1 dimensional) arrays are supported. Also take into account that to be able to use `Array(String)` you need to use `text :my_column, {:array => true}` in your migration.

All those methods accepts additional options:

- `:sql_type` - gets exact (except size) field type;
- `:null` - present nullable if field (by default is `false` for all types and field);
- `:primary` - marks field as primary key field (could be several ones but this provides some bugs with query generation for such model - for now try to avoid this).
- `:default` - default value for field
- `:auto_increment` - marks field to use auto increment (properly works only with `Int32 | Int64` fields, another crystal types have cut functionality for it);
- `:array` - mark field to be array type (postgres only)

Also there is `#field` method which allows to directly define SQL type.

To define reference to other table you can use `#reference`:

```crystal
create_table :pictures do |t|
  t.reference :user
  t.reference :attachable, { :polymorphic => true } # for polymorphic relation
end
```

For more details about this and other methods see [`Jennifer::Migration::TableBuilder::CreateTable`](https://imdrasil.github.io/jennifer.cr/latest/Jennifer/Migration/TableBuilder/CreateTable.html)

To drop table just write:

```crystal
drop_table(:addresses)
```

To create materialized view (postgres only):

```crystal
create_materialized_view("female_contacts", Contact.all.where { _gender == "female" })
```

And to drop it:

```crystal
drop_materialized_view("female_contacts")
```

To alter existing table use next methods:

 - `#change_column` - to change column definition;
 - `#add_column` - adds new column;
 - `#drop_column` - drops existing column;
 - `#add_index` - adds new index;
 - `#drop_index` - drops existing index;
 - `#add_foreign_key` - adds foreign key constraint;
 - `drop_foreign_key` - drops foreign key constraint;
 - `#rename_table` - renames table.

 For more details about this and other methods see [`Jennifer::Migration::TableBuilder::CreateTable`](https://imdrasil.github.io/jennifer.cr/latest/Jennifer/Migration/TableBuilder/ChangeTable.html)

Also next support methods are available:

- `#table_exists?`
- `#index_exists?`
- `#column_exists?`
- `#foreign_key_exists?`
- `#enum_exists?` (for postgres ENUM only)
- `#material_view_exists?`

Here is a quick example:

```crystal
def up
  change_table(:contacts) do |t|
    t.change_column(:age, :short, {:default => 0})
    t.add_column(:description, :text)
    t.add_index(:description, type: :uniq, order: :asc)
  end

  change_table(:addresses) do |t|
    t.add_column(:details, :json)
  end
end

def down
  change_table(:contacts) do |t|
    t.change_column(:age, :integer, {:default => 0})
    t.drop_column(:description)
  end

  change_table(:addresses) do |t|
    t.drop_column(:details)
  end
end
```

Also plain SQL could be executed as well:

```crystal
exec("ALTER TABLE addresses CHANGE street st VARCHAR(20)")
```

All changes are executed one by one so you also could add data changes here (in `#up` and/or `#down`).

To be sure that your db is up to date, add `Jennifer::Migration::Runner.migrate` in `spec_helper.cr`.

#### Enum

Now enums are supported as well but each adapter has own implementation. For mysql is enough just write down all values:

```crystal
create_table(:contacts) do |t|
  t.enum(:gender, ["male", "female"])
end
```

Postgres provides much more flexible and complex behavior. Using it you need to create enum firstly:

```crystal
create_enum(:gender_enum, ["male", "female"])

create_table(:contacts) do |t|
  t.string :name, {:size => 30}
  t.integer :age
  t.field :gender, :gender_enum
  t.timestamps
end

change_enum(:gender_enum, {:add_values => ["unknown"]})
change_enum(:gender_enum, {:rename_values => ["unknown", "other"]})
change_enum(:gender_enum, {:remove_values => ["other"]})
```

For more details check source code and PostgreSQL docs.

## Micrate

If it is more convenient to you to store migrations in a plain SQL it is possible to use [micrate](https://github.com/amberframework/micrate) together with Jennifer. To do so you need to:
- add it to you dependencies

```yml
# shard.yml
dependencies:
  micrate:
    github: "amberframework/micrate"
    version: "= 0.15.0"
```
- add an override for a `crystal-db` to enforce latest version

```yml
# shard.override.yml
dependencies:
  db:
    github: crystal-lang/crystal-db
    version: ~> 0.11.0
```

- ensure your Jennifer configuration has `pool_size` set to at least 2
- add `micrate.cr` file at the root (or any other convenient place) of your project with the following content:

```crystal
require "micrate"
# Load here the part your your app responsible for Jennifer initialization
# require "./config/db.cr"

# These overrides are required to specify custom `db_dir`
module Micrate
  # Add here the path from your app root to the directory with `migration` folder
  # inside
  def self.db_dir
    "db"
  end

  private def self.migrations_by_version
    Dir.entries(migrations_dir)
      .select { |name| File.file?(File.join(migrations_dir, name)) }
      .select { |name| /^\d+_.+\.sql$/ =~ name }
      .map { |name| Migration.from_file(name) }
      .index_by { |migration| migration.version }
  end
end

Micrate::DB.connection_url = Jennifer::Adapter.default_adapter.connection_string(:db)
Micrate::Cli.run
```

After this all migration files located in the specified directory is accessible for Micrate and you can use commands like

```sh
$ crystal micrate.cr -- up
```

gha_language: Crystal

gha_license_id: MIT


text:
## Installation

To get started, make sure you have [Docker installed](https://docs.docker.com/docker-for-mac/install/) on your system, and then clone this repository.

Navigate in your terminal screen to the directory you cloned this, and spin up the containers for the web server by running `docker-compose up -d --build`.

The following are built for our web server, with their exposed ports detailed:

Three additional containers are included that handle Composer, NPM, and Artisan commands *without* having to have these platforms installed on your local computer. Use the following command examples from your project root, modifying them to fit your particular use case.

- `docker-compose run --rm composer install`
- `docker-compose run --rm artisan migrate`
- `docker-compose run --rm artisan db:seed`

Front-end side does not developed by me but i append npm container to docker-compose in case you want to develop it
- `docker-compose run --rm npm run dev`

## Usage

###   Register

Endpoint : http://localhost/api/auth/register

Request Payload Without Reference Code

    {
    	"name": "test",
    	"email"<EMAIL_ADDRESS>    	"password": "password",
    	"password_confirmation": "password"
    }

Response

    {
      "status": "success",
      "data": {
        "user": {
          "name": "test",
          "email"<EMAIL_ADDRESS>          "updated_at": "2021-07-15T17:04:51.000000Z",
          "created_at": "2021-07-15T17:04:51.000000Z",
          "id": 2
        },
        "token": "2|SRy5v4ZayHKqiDtX4Piz5Z81kXZl9MSgCKghHLsZ"
      }
    }

------

### Login

Endpoint : http://localhost/api/auth/login

Request

    {
<EMAIL_ADDRESS>        "password":"password"
    }

Response

    {
      "status": "success",
      "message": null,
      "data": {
        "token": "7|OmBtd1sRSqAcNI4SbN9a31zSfTBvGDwMwka5Obcs"
      }
    }

------

### Profile

Endpoint: http://localhost/api/me

Response

    {
      "id": 1,
      "name": "test",
      "email"<EMAIL_ADDRESS>      "email_verified_at": null,
      "created_at": "2021-07-11T20:10:24.000000Z",
      "updated_at": "2021-07-11T20:10:24.000000Z"
    }

------

### Logout

Endpoint : http://localhost/api/auth/logout

Response

    {
      "message": "Tokens Revoked"
    }

------

### I-AM-ALIVE

Endpoint : http://localhost/api/i-am-alive

Response

    "OK"

### List Meditations

Endpoint : http://localhost/api/meditations

Response

    {
      "status": "success",
      "data": [
        {
          "id": 1,
          "name": "Yam",
          "image": null,
          "description": "Yam Description",
          "producer": "Yam Producer",
          "duration": 1200
        },
        {
          "id": 2,
          "name": "Yin",
          "image": null,
          "description": "Yin Description",
          "producer": "Yin Producer",
          "duration": 1200
        },
        {
          "id": 3,
          "name": "Full Moon",
          "image": null,
          "description": "Full Moon Description",
          "producer": "Full Moon Producer",
          "duration": 60
        },
        {
          "id": 4,
          "name": "New Moon",
          "image": null,
          "description": "New Moon Description",
          "producer": "New Moon Producer",
          "duration": 90
        }
      ]
    }

### Play Meditation

Endpoint : http://localhost/api/play

Request

    {
        "meditation_id": 2,
        "duration": 20
    }

Response

    {
      "status": "success",
      "data": {
        "meditation_id": 2,
        "duration": 20,
        "updated_at": "2021-07-15T17:02:27.000000Z"
      }
    }

### History

Endpoint : http://localhost/api/play/history

Response

    {
      "status": "success",
      "data": [
        {
          "date": "2021-07-15",
          "total_duration": "2570"
        }
      ]
    }

### Calendar

Endpoint: http://localhost/api/play/calendar

Response

    {
      "status": "success",
      "data": {
        "2021-07-01": false,
        "2021-07-02": false,
        "2021-07-03": false,
        "2021-07-04": false,
        "2021-07-05": false,
        "2021-07-06": false,
        "2021-07-07": false,
        "2021-07-08": false,
        "2021-07-09": false,
        "2021-07-10": false,
        "2021-07-11": false,
        "2021-07-12": false,
        "2021-07-13": false,
        "2021-07-14": false,
        "2021-07-15": true,
        "2021-07-16": false,
        "2021-07-17": false,
        "2021-07-18": false,
        "2021-07-19": false,
        "2021-07-20": false,
        "2021-07-21": false,
        "2021-07-22": false,
        "2021-07-23": false,
        "2021-07-24": false,
        "2021-07-25": false,
        "2021-07-26": false,
        "2021-07-27": false,
        "2021-07-28": false,
        "2021-07-29": false,
        "2021-07-30": false,
        "2021-07-31": false
      }
    }

### Monthly Report

Endpoint : http://localhost/api/report/monthly

Response

    {
      "status": "success",
      "data": {
        "total_duration": 3750,
        "total_meditation": 5,
        "daily_series": 1
      }
    }

### Yearly Report

Endpoint : http://localhost/api/report/yearly

Response

    {
      "status": "success",
      "data": {
        "total_duration": 3750,
        "total_meditation": 5,
        "daily_series": 1
      }
    }

repository: ercancavusoglu/balbazar

repo_name: ercancavusoglu/balbazar


text:
# OPL-compatible Yamaha YMF825 driver

This is an OPL-compatible driver for Yamaha's [YMF825](https://device.yamaha.com/en/lsi/products/sound_generator/) FM synthesizer chip (also known as SD-1). It allows playback of OPL2 or OPL3 music on SD-1 by translating OPL register writes to their SD-1 equivalents.

See this video for a demonstration of OPL PC game and tracker music played back on SD-1: https://youtu.be/BEgAx0jngKQ

This repository consists of:

- `hardware/` - breadboard wiring diagram and schematic for a USB to SD-1 interface based on Raspberry Pi Pico
- `firmware/` - firmware for the above device
- `vgmplay/` - a Python program that plays back .VGM, .VGZ and .DRO files via a connected USB to SD-1 device

## Building the firmware

The firmware is written in C++ using the [Raspberry Pi Pico SDK](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf). After installing, build the firmware as follows:

```
$ cd firmware
$ mkdir build
$ cd build
$ cmake ..
$ make
```

## Playing VGM files

The included `vgmplay` program requires Python 3 and [pyserial](https://pypi.org/project/pyserial/). I have used it successfully on Linux and macOS, and it might also work on Windows.

Install pyserial as follows:

```
$ pip3 install pyserial
```

To play a file:

```
$ cd vgmplay
$ python3 vgmplay.py -d <serial port device> <path to .vgm/.vgz/.dro file>
```

`<serial port device>` will be, for example, `/dev/ttyACM0` on Linux or `/dev/tty.usbmodem1234561` on macOS.

## Notes on the OPL to SD-1 translation

The SD-1 has a number of significant differences to the OPL series that prevent a direct 1:1 mapping of registers:

### 1. Voices

The OPL3 has up to 18 2-operator voices, or up to 6 4-operator voices. Two 2-op voices are combined to make each 4-op voice. Most tunes will use 16 voices or fewer, but may still play sounds on voices 17 and 18. Therefore, the translator allocates SD-1 voices dynamically to OPL3 voices as required. In the event that all 18 2-op voices are used, the least recently allocated voice is re-assigned and some notes may be cut off.

### 2. Register layout

The OPL3 registers contain a bank of FM parameters for each voice, and the sound playing on a particular voice can be modified simply by writing to the registers.

On the SD-1, FM parameters are not associated directly with any particular voice. Instead, there is an array of 16 banks of tone data that must be written to sequentially, and a tone within this array is selected when a note is played.

As the SD-1 has 16 voices and 16 tones, the translator simply reserves a tone for each voice. However, the SD-1 tone data must still be written sequentially starting at the first position in the array - therefore the OPL registers are cached in memory, and all tones converted and re-written up to the location of the changed tone, any time an OPL register changes.

### 3. Sample rate

The SD-1 uses a sample rate of 48000Hz, compared to the OPL3's sample rate of 49716Hz. As a result, by default the same block and frequency numbers produce a lower pitched note on the SD-1. The translator sets the global frequency multiplier register of the SD-1 to compensate for this difference.

### 4. Envelope generator

The OPL3 has an 'envelope type' parameter that determines whether a note is held at its sustain level while the key is on, or whether it transitions immediately from the decay to release phase. The SD-1 instead has a sustain rate parameter that determines the rate at which the level is reduced during the sustain phase. The translator sets the sustain rate either to the release rate or 0 according to the value of the envelope type parameter, to mimic the OPL behaviour.


text:
# Flashcards

![](flashcards.gif)

This is the third project of the Nanodegree React Developer course, from Udacity Brasil

The goal is to create one app of flashcards, for create decks and cards for study
* The project was emulated in  Expo app in a dispositive Android

## Installation
Open the [GitBash](https://git-scm.com/) and input the commands:

`git clone https://github.com/danieladuarteng/flashcards.git`

## Run:

To run the project

Access the folder: *flashcards*
and input in GitBash:

`yarn install`

and after installation, input:

`yarn start`

## License

This project uses the license [MIT](https://choosealicense.com/licenses/mit/)

repository: danieladuarteng/flashcards

gha_language: JavaScript

repo_name: danieladuarteng/flashcards


text:
# Installation
1.complie
```
sudo python3 setup.py install
```

2.you can import in Python
```
import RotateRoIAlign_cuda
```

3.if you want to recompile, run clean.sh
```
bash clean.sh
```

4.check gradient
```
python3 grad_check.py
```


text:
# MS1FingerPrinter

MS1FingerPrinter reads MS1 data from mass spectrometry data files in mzML format and identifies ions that match peptides from in silico digestion of a specified protein. The intensities of these peptides are then averaged across all spectra and clustered into groups that have common patterns of abundance changes across the analysis samples.

Note that MS1FingerPrinter should be used with mass spectrometry data acquired from direct infuction of a protein digest - i.e. not LCMS data.

# Setting up the analysis

MS1Fingerprinter required mass spectrometry data files to be in the open mzML format. These can be produced from instrument vendor-specific file formats using MsConvert - part of ProteoWizard which can be obtained here. The default MsConvert parameters should be fine for most applications. Once generated, place all your mzML files in the same directory and then copy the path to this directory.

Next, obtain a Fasta file containing the protein sequence(s) of interest. These can be obtained from UniProt by finding the appropriate protein and then selecting Format > FASTA (cannonical) or, alternatively, scrolling down to the "sequence" section of a protein entry and sownloading the specific isoform needed. An example for BSA is included in the repository.

# Usage Examples

MS1FingerPrinter takse 2 required parameters for the minimal usage. First a fasta file containing one or more protein sequences to be digested and considered in the analysis, and 2) the path to a directory containing mzML files to be analysed. The basic usage is therefore:

    python ms1FingerPrinter.py <FASTA FILE> <MZML FILE DIRECTORY>

Eg:

    python ms1FingerPrinter.py /home/user/project/myprotein.fasta /home/user/project/mzml_files

The additional parameters can be varied as per above>. For example, to change the maximum charge state considered:

    python ms1FingerPrinter.py /home/user/project/myprotein.fasta /home/user/project/mzml_files --maxCharge 6

The default analysis will treat each sample independently. To create groups of replicate treatments:

    python ms1FingerPrinter.py /home/user/project/myprotein.fasta /home/user/project/mzml_files --groups additive HexC DMSO

The above will attempt to create three treatment groups (i.e. 'additive', 'HhexC' and 'DMSO') by matching these terms to the mzML file names in the provided mzML file directory. A mild statistical filter is then applied to retain only peptides reproducibly detected. The stringency of this filter can be altered as below:

    python ms1FingerPrinter.py /home/user/project/myprotein.fasta /home/user/project/mzml_files --groups additive HexC DMSO --pvalThreshold 2

Note that this is a -Log10 p-value. Set this threshold to 0 to remove the filter.

Note that, by default, only the most abundant charge state for each peptide in each treatment group is reported. To include all charge states of all peptides in the output table, add the --reportAll flag:

    python ms1FingerPrinter.py /home/user/project/myprotein.fasta /home/user/project/mzml_files --groups additive HexC DMSO --reportAll

# Options
    usage: ms1FingerPrinter.py [-h] [--outDirectory OUTDIRECTORY]
                               [--outPrefix OUTPREFIX]
                               [--groups GROUPS [GROUPS ...]] [--ppm PPM]
                               [--minFrac MINFRAC] [--missed MISSED]
                               [--minLength MINLENGTH] [--maxCharge MAXCHARGE]
                               [--minCharge MINCHARGE] [--numClusters NUMCLUSTERS]
                               [--noZtransform] [--normaliseIntensities] [--noLog]
                               [--pvalThreshold PVALTHRESHOLD] [--reportAll]
                               fasta mzml

    Find signals in MS1 data matching tryptic peptides

    positional arguments:
      fasta                 FASTA sequence file for target protein
      mzml                  Directory containing one or more mzML files to be
                            analysed

    optional arguments:
      -h, --help            show this help message and exit
      --outDirectory OUTDIRECTORY
                            Directory to which output file should be written.
                            Defaults to mzml directory if not specified
      --outPrefix OUTPREFIX
                            File name prefix given to generated outputs. Defaults
                            to a timestamp if not specified
      --groups GROUPS [GROUPS ...]
                            Treatment group labels used for determination of
                            statistical significance. These labels are compared to
                            the input mzML file names to assign individual files
                            to treatment groups. If not given, all files are
                            treated independently and statistical testing not
                            applied. Group labels must not contin spaces.
      --ppm PPM             MS1 ppm tolerance for expected monoisotopic masses.
                            Window is +/- ppm
      --minFrac MINFRAC     Minimum fraction (0-1) of MS1 spectra in which a given
                            target ion must be present for further consideration
                            in the analysis
      --missed MISSED       Number of missed enzymatic cleavages to allow for in
                            silico protein digestion
      --minLength MINLENGTH
                            Minimum peptide length for consideration in analysis
      --maxCharge MAXCHARGE
                            Maximum peptide charge to be considered in analysis
      --minCharge MINCHARGE
                            Minimum peptide charge to be considered in analysis
      --numClusters NUMCLUSTERS
                            Number of clusters to produce in HCA analysis
      --noZtransform        Do not perform z-transform on peptide intensity values
      --normaliseIntensities
                            Normalise target intensity values to spectral maxima
      --noLog               Do not log-transform target intensity values.
      --pvalThreshold PVALTHRESHOLD
                            Negative Log 10 p-value threshold required of peptides
                            for inclusion
      --reportAll           If given, all charge states for all peptides will be
                            listed separately in the outputs. Otherwise, only the
                            most abundant charge state of each peptide in each
                            group will be reported
# Requirements

MS1FingerPrinter requires Python >=3.5 and specific package dependencies are listed in requirements.txt

# License

MIT License

Copyright (c) 2020 Michael Gerard Leeming

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.


text:
# Busy

## The next-gen social network platform based on the Steem Blockchain

## Our mission
Connect everyone to the next-gen decentralized social network that gives voice and value back to people, by building together a true sharing economy, a more free and trustworthy world without middlemen.

## Contribution
So you found a bug? Or perhaps you just want to improve something? Patches are welcome! If you would like to contribute, but don't know what to work on, check the issues list.

## Issues
When you find issues, please report them!

## License
MIT

repository: sespinosa/busy

repo_name: sespinosa/busy


text:
# Tests

## Library

This test suite uses [node-red-test-helper](https://github.com/node-red/node-red-node-test-helper) to implement [mocha](https://github.com/mochajs/mocha) unit tests.

* Test all nodes: npm test
* Test database node: npm run test-database
* Test player node: npm run test-player
* Test league node: npm run test-league
* Test team node: npm run test-team
* Test game node: npm run test-game


text:
GeoJSON Geoprocessing Tool for ArcGIS
=

GeoJSON is some new upstart format that's come around in the past few weeks. Here's a set of tools to get GeoJSON in/out of ArcGIS.

Usage should be self-explanatory: open up the toolbox in ArcCatalog/ArcMap, select your features to export or import, and there you go. Easy in/out of most GeoJSON you'll find out there on the internet.

This tool _always_ exports to WGS 1984, because most people on the internet shuffling GeoJSON around are barbarians who don't know the first thing about spatial reference systems*. The same applies for import, right now it assumes coordinates are all in WGS 1984.

\* This is tongue-in-cheek, you guys. Who outside of the geospatial professions knows about this stuff? Or even needs to? Some software developer who found a GeoJSON Gist on GitHub just wants to look at it on a map without needing to take a semester long course to understand the theory behind the dang coordinate  pair numbers in the dang data that's just dang old sitting there.

Theoretically Asked Questions (TAQ)
-

_Nobody has asked me these yet, but these are the questions I anticipate coming up at some point. Now you don't need to ask them. You're welcome, I've just saved both of us some time._

1. **What is this?**

    This conversion tool is meant to do one thing quickly, smoothly, and well. I have a feature layer in my ArcMap table of contents I want to make into GeoJSON. I have GeoJSON somewhere on the internet and want a feature layer in my table of contents to do some geoprocessing on. Ok. Here you go. Do it with this tool.

2. **Why GeoJSON?**

    GeoJSON is a format that is obviously missing from the ArcGIS stack. I wanted to provide a stupidly easy way of getting this format in and out so we could all go back and live our lives without the specter of "well what about GeoJSON???" hanging over us.

3. **Why not other formats like WKT or WKB?**

    As of 10.1 SP1, `arcpy.da` cursors have `SHAPE@WKT`/`SHAPE@WKB` tokens, and `arcpy` geometry has `.WKT`/`.WKT` attributes, and the `arcpy.FromWKT` and `arcpy.FromWKB` functions, and as of 10.2 you can make SpatialLite databases and they even show up in the ArcCatalog window with all their feature classes. So there's enough other open formats already there and ready to go. GeoJSON's mostly just to fill the lightweight-data-shuffled-over-HTTP niche.

4. **What about [Esri2Open](https://github.com/project-open-data/esri2open)? Doesn't that accomplish the same goals?**

    I was not aware that project existed until after I'd written this. Esri2Open seems to be quite a bit more ambitious with what sorts of format it supports and what it does (merge/append) and is therefore quite a bit more complex. Some of the formats it does like the aforementioned WKT and WKB are trivially handled by ArcGIS' Python functions in new versions of ArcGIS so I fail to see the utility except as a stopgap for users on 10.0 waiting to upgrade to 10.1 or 10.2.

License
-

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

repository: nmpeterson/geojson-madness

repo_name: nmpeterson/geojson-madness


text:
# Meet Our Contributors - Ask Us Anything!

When Slack seems like it’s going too fast, and you just need a quick answer from a human...

Meet Our Contributors gives you a monthly one-hour opportunity to ask questions about our upstream community, watch interviews with our contributors, and participate in peer code reviews.

## When:
Every first Wednesday of the month at the following times -
* 03:30pm UTC [calendar link](https://calendar.google.com/event?action=TEMPLATE&tmeid=MGw2OHM5bGRranJwZjI3OHN1MTk2Y2pjYjggcGFyaXNwaXR0bWFuQGdvb2dsZS5jb20&tmsrc=parispittman%40google.com)
* 09:00pm UTC [calendar link](https://calendar.google.com/event?action=TEMPLATE&tmeid=N3M4dnZ0dGZwYTZzdXBuM3FndHRybGY0MTlfMjAxODAyMDdUMjEwMDAwWiBwYXJpc3BpdHRtYW5AZ29vZ2xlLmNvbQ&tmsrc=parispittman%40google.com&scp=ALL)

Tune into the [Kubernetes YouTube Channel](https://www.youtube.com/c/KubernetesCommunity/live) to follow along with video and [#meet-our-contributors](https://kubernetes.slack.com/messages/meet-our-contributors) on Slack for questions and discourse.

## What’s on-topic:
* How our contributors got started with k8s
* Advice for getting attention on your PR
* GitHub tooling and automation
* Your first commit
* kubernetes/community
* Testing

## What’s off-topic:
* End-user questions (Check out [#office-hours](https://kubernetes.slack.com/messages/office-hours) on slack and details [here](/events/office-hours.md))

## Submitting questions and/or code for review/walk through:
### Questions:
* Day of on twitter - use the hashtag [#k8smoc](https://twitter.com/hashtag/k8smoc) after your question
* Slack - Ask your question in [#meet-our-contributors](https://kubernetes.slack.com/messages/meet-our-contributors)

Questions will be on a first-come, first-served basis. First half will be dedicated to questions for contributors and the second half, we will pick a problem (in advance) for peer code review.

### Code snip / PR for peer code review / Suggestion for part of codebase walk through:
* At least 24 hours before the session to slack channel (#meet-our-contributors)

Problems will be picked based on time commitment needed, skills of the reviewer, and if a large amount are submitted, need for the project.

## Call for Volunteers:
Contributors - [sign up to answer questions!](https://goo.gl/uhEJ33)

Expectations of volunteers:
* Be on 5 mins early
* Be prepared to give advice on contribution process, membership, navigating the kubernetes seas, testing, and general questions about you and your path to open source/kubernetes.
* We will be using video chat (zoom but live streaming through YouTube) but voice only is fine if you are more comfortable with that
* Be willing to provide suggestions and feedback to make this better!

repository: rajansandeep/community

gha_language: Go

repo_name: rajansandeep/community


text:
---
name: Feature Request
about: Propose a new feature
title: 'feature: '
labels: enhancement
---

Please read our [contributor guide](https://github.com/Netflix/dgs-framework/blob/master/CONTRIBUTING.md) before
creating an issue. Also consider discussing your idea on
the [discussion forum](https://github.com/Netflix/dgs-framework/discussions) first.

## Describe the Feature Request
<!-- A clear and concise description of what the feature request is. -->

## Describe Preferred Solution
<!-- A clear and concise description of what you want to happen. -->

## Describe Alternatives
<!-- A clear and concise description of any alternative solutions or features you've considered. -->


text:
ZJS API for Bluetooth Low Energy (BLE)
======================================

* [Introduction](#introduction)
* [Web IDL](#web-idl)
* [API Documentation](#api-documentation)
* [Sample Apps](#sample-apps)

Introduction
------------
The BLE API is based off the [bleno API]
(https://github.com/sandeepmistry/bleno). Bluetooth Low Energy (aka
[Bluetooth Smart](https://www.bluetooth.com/what-is-bluetooth-technology/bluetooth-technology-basics/low-energy)) is a power-friendly version of Bluetooth
intended for IoT devices. It provides the ability to support low-bandwidth data
services to nearby devices.

A note about UUIDs. The BLE standard lets you have full 128-bit UUIDs or short
16-bit UUIDs (4 hex chars). We only support the short ones so far.

Based on the bleno API, these UUIDs are specified as a hexadecimal string, so
"2901" really means 0x2901. *NOTE: This seems like a bad practice and we should
perhaps require these numbers to be specified as "0x2901" instead, or else
treat them like decimals.*

Web IDL
-------
This IDL provides an overview of the interface; see below for documentation of
specific API functions.

```javascript
// require returns a BLE object
// var ble = require('ble');

[NoInterfaceObject]
interface BLE {
    void disconnect();
    void on(string eventType, EventCallback callback);
    void startAdvertising(string name, string[] uuids, string url);
    void stopAdvertising();
    void setServices();
    PrimaryService PrimaryService(PrimaryServiceInit init);
    Characteristic Characteristic(CharacteristicInit init);
    Descriptor Descriptor(DescriptorInit init);
};

callback EventCallback = void (various);  // callback arg depends on event

dictionary PrimaryServiceInit {
    string uuid;
    Characteristic[] characteristics;
};

dictionary CharacteristicInit {
    string uuid;
    string[] properties;                // 'read', 'write', 'notify'
    Descriptor[] descriptors;
    ReadCallback onReadRequest;         // optional
    WriteCallback onWriteRequest;       // optional
    SubscribeCallback onSubscribe;      // optional
    UnsubscribeCallback onUnsubscribe;  // optional
    NotifyCallback onNotify;            // optional
};

callback ReadCallback = void (unsigned long offset, FulfillReadCallback);
callback WriteCallback = void (Buffer data, unsigned long offset,
                               boolean withoutResponse, FulfillWriteCallback);
callback SubscribeCallback = void (unsigned long maxValueSize,
                                   FulfillSubscribeCallback);
callback FulfillReadCallback = void (CharacteristicResult result, Buffer data);
callback FulfillWriteCallback = void (CharacteristicResult result);
callback FulfillSubscribeCallback = void (Buffer data);

dictionary DescriptorInit {
    string uuid;
    string value;
};

[NoInterfaceObject]
interface Characteristic {
    attribute ReadCallback onReadRequest;
    attribute WriteCallback onWriteRequest;
    attribute SubscribeCallback onSubscribe;
    attribute UnsubscribeCallback onUnsubscribe;
    attribute NotifyCallback onNotify;
    unsigned long RESULT_SUCCESS;
    unsigned long RESULT_INVALID_OFFSET;
    unsigned long RESULT_INVALID_ATTRIBUTE_LENGTH;
    unsigned long RESULT_UNLIKELY_ERROR;
};
```

API Documentation
-----------------
### BLE.disconnect

`void disconnect();`

Disconnect the remote client.

### BLE.on

`void on(string eventType, EventCallback callback);`

The `eventType` can be one of the following:
* 'accept' - a BLE client has connected
  * callback should expect a string state:
    * 'poweredOn' - the BLE stack is now ready to be used
    * no others supported at this time
* 'advertisingStart' - BLE services have begun to be advertised
  * callback should currently expect an error integer (0 for success)
  * *NOTE: this may change*
* 'disconnect' - a BLE client has disconnected
  * *NOTE: callback currently receives a 0 but it should be "clientAddress"*
* 'stateChange' - state of BLE stack has changed
  * *NOTE: callback currently receives a 0 but it should be "clientAddress"*

### BLE.startAdvertising

`void startAdvertising(string name, string[] uuids, string url);`

The `name` is limited to 26 characters and will be advertised as the device
name to nearby BLE devices.

The `uuids` array may contain at most 7 16-bit UUIDs (four hex digits each).
These UUIDs identify available services to nearby BLE devices.

The `url` is optional and limited to around 24 characters (slightly more
if part of the URL is able to be [encoded]
(https://github.com/google/eddystone/tree/master/eddystone-url)). If provided,
this will be used to create a physical web advertisement that will direct users
to the given URL. At that URL they might be able to interact with the
advertising device somehow.

### BLE.stopAdvertising

`void stopAdvertising();`

Currently does nothing.

### BLE.setServices

`void setServices(PrimaryService[]);`

Pass an array of PrimaryService objects to set up the services that are
implemented by your app.

*NOTE: Currently this function only looks at the first service, but this will be
expanded.*

### BLE.PrimaryService constructor

`PrimaryService(PrimaryServiceInit init);`

The `init` object should contain a `uuid` field with a 16-bit service UUID (4
hex chars) and a `characteristics` field with an array of Characteristic
objects.

### BLE.Characteristic constructor

`Characteristic(CharacteristicInit init);`

The `init` object should contain:
* `uuid` field with a 16-bit characteristic UUID (4 hex chars)
* `properties` field with an array of strings that may include 'read', 'write',
  and 'notify', depending on what is supported
* `descriptors` field with an array of Descriptor objects

It may also contain these optional callback fields:
* `onReadRequest` function(offset, callback(result, data))
  * Called when the client is requesting to read data from the characteristic.
  * See below for common argument definitions
* `onWriteRequest` function(data, offset, withoutResponse, callback(result))
  * Called when the client is requesting to write data to the characteristic.
  * `withoutResponse` is true if the client doesn't want a response
    * *TODO: verify this*
* `onSubscribe` function(maxValueSize, callback(data))
  * Called when a client signs up to receive notify events when the
      characteristic changes.
  * `maxValueSize` is the maximum data size the client wants to receive.
* `onUnsubscribe` function()
  * *NOTE: Never actually called currently.*
* `onNotify` function()
  * *NOTE: Never actually called currently.*

Explanation of common arguments to the above functions:
* `offset` is a 0-based integer index into the data the characteristic
    represents.
* `result` is one of these values defined in the Characteristic object.
  * RESULT_SUCCESS
  * RESULT_INVALID_OFFSET
  * RESULT_INVALID_ATTRIBUTE_LENGTH
  * RESULT_UNLIKELY_ERROR
* `data` is a [Buffer](./buffer.md) object.

### BLE.Descriptor constructor

`Descriptor(DescriptorInit init);`

The `init` object should contain:
* `uuid` field with a 16-bit descriptor UUID (4 hex chars)
  * Defined descriptors are listed here in [Bluetooth Specifications](https://www.bluetooth.com/specifications/gatt/descriptors)
* `value` field with a string supplying the defined information
  * *NOTE: Values can also be Buffer objects, but that's not currently supported.*

Sample Apps
-----------
* [BLE sample](../samples/BLE.js)
* [WebBluetooth Demo](../samples/WebBluetoothDemo.js)

gha_language: C


text:
# Changelog

## [Unreleased]

## [1.1.0] - 2021-04-11
## Added
- W6402 `useless-pytest-mark-decorator`: add warning for [using pytest.mark on fixtures](https://docs.pytest.org/en/stable/reference.html#marks) (thanks to @DKorytkin)
- W6403 `deprecated-positional-argument-for-pytest-fixture`: add warning for [positional arguments to pytest.fixture()](https://docs.pytest.org/en/stable/deprecations.html#pytest-fixture-arguments-are-keyword-only) (thanks to @DKorytkin)
- F6401 `cannot-enumerate-pytest-fixtures`: add fatal error when the plugin cannot enumerate and collect pytest fixtures for analysis (#27)

## [1.0.3] - 2021-03-13
## Fixed
- Fix #13 regression caused by mangling `sys.modules`

## [1.0.2] - 2021-03-10
### Fixed
- Fix pytest **Module already imported so cannot be rewritten** warning when the package being linted was used by pytest/conftest already (#10)
- Fix missing Python version constraint (#11)

## [1.0.1] - 2021-03-03
### Added
- Suppressing FP `unused-import` when fixtures defined elsewhere are imported into `conftest.py` but not directly used (#2)

## [1.0.0] - 2021-03-02
### Added
- Python 3.9 support

### Removed
- Python 2.7 & 3.5 support

### Fixed
- Fix not able to work with `pytest-xdist` plugin when `--dist loadfile` is set in configuration file (#5)

## [0.3.0] - 2020-08-10
### Added
- W6401 `deprecated-pytest-yield-fixture`: add warning for [yield_fixture functions](https://docs.pytest.org/en/latest/yieldfixture.html)

### Fixed
- Fix incorrect path separator for Windows (#1)

## [0.2.0] - 2020-05-25
### Added
- Suppressing FP `no-member` from [using workaround of accessing cls in setup fixture](https://github.com/pytest-dev/pytest/issues/3778#issuecomment-411899446)

### Changed
- Refactor plugin to group patches and augmentations

## [0.1.2] - 2020-05-22
### Fixed
- Fix fixtures defined with<EMAIL_ADDRESS>decorator still showing FP
- Fix crashes when using fixture + if + inline import
- Fix crashes when relatively importing fixtures (`from ..conftest import fixture`)

## [0.1.1] - 2020-05-19
### Fixed
- Fix crashes when `*args` or `**kwargs` is used in FuncDef

## [0.1] - 2020-05-18
### Added
- Suppressing FP `unused-import` with tests
- Suppressing FP `unused-argument` with tests
- Suppressing FP `redefined-outer-scope` with tests
- Add CI/CD configuration with Travis CI

repository: skshetry/pylint-pytest

repo_name: skshetry/pylint-pytest


text:
# Typhula micans (Pers.) Berthier, 1976 SPECIES

#### Status
ACCEPTED

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

#### Published in
Bull. mens. Soc. linn. Lyon 45: 172 (1976)

#### Original name
Clavaria micans Pers., 1797

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Sphaerocybe concentrica Magrou & Marneffe, 1946 SPECIES

#### Status
ACCEPTED

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

#### Published in
C. r. hebd. Séanc. Acad. Sci. , Paris 220: 222 (1946)

#### Original name
Sphaerocybe concentrica Magrou & Marneffe, 1946

### Remarks
null


text:
---
title: Anticipated Questions
---

## How do I use your simulator?

Please see this [short guide](https://docs.google.com/presentation/d/e/2PACX-1vSOgrZXj_BpvBUEFg8sfUhxwtOsJu1gZ9c643KSaH8mTf57MJvCDtmz6QyxRDDV_S-gSlcdz4C8b7tw/pub?start=false&loop=false&delayms=3000).

## Is this real data? If not, then what?

*Absolutely Not.* We are only showing the *projections* from a simulator which
is based on two standard mathematical models. The SEIR model for epidemic time
evolution and the Gravity Model for movement of people between regions for
daily work. Once the user enters the seed data (her guess on the number of
infectious people in each region on Day-0), and selects the mitigation
strategies to enforce, we run the simulator and show the predicted number
of infectious people (the I in the SEIR model) in each region.  The numbers are
indicated by a colour scale in the map.

## Where can I see real data?

One good place to see regularly updated real data on the Covid-19 situation in Kerala is <https://covid19kerala.info>.

## Do you use any real data at all?

*Yes*. We use the population and area of each LSG (from 2011 census data) and
the pairwise aerial distance between LSGs (extracted from GIS maps).  We also
make an indirect use of the statistics on daily commute distance of
non-agricultural workers in Kerala (from 2011 census data).

## Do you use any patient data?

*No.* The simulator runs based on the initial seed given by the user.

## What are the factors which influence the projections?

The simulator's output is heavily dependent on the model parameters, the
mitigation strategies and the initial seed of region-wise infectious people.

## What exactly are you projecting?

We are projecting the future number of Covid-19 infectious people in each grama
panchayath, municipality and muncipal corporation in Kerala.

We say that a person is *infectious* if she can potentially infect another
person through contact. The person may or may not be showing symptoms during
this stage. Even those who show symptoms are not infectious towards the later
stages of the infection.

Currently, we are not projecting the number of positive cases or the number of
people who might require hospitalisation. We can modify the SEIR model to do
these projections also. We might do that in the future releases.

## Will these projections come true?

*No.*

## How can you be so sure?

There are multiple projections but only one truth. So surely not all these projections can be true.

## Then what's the use of this simulator?

1.	If you are a policy maker or an expert in community health (which we are
	not) from Kerala, then you may already have an intution on how Covid-19
	will spread in Kerala under various scenarios. You can use this simulator
	to test your intution against a mathematical projection. This portal is
	developed mainly for you.  If you need any help with running the simulator
	with complex initial seeds and mitigation strategies, feel free to contact
	us at<EMAIL_ADDRESS>
2.	If you are an academician with a recent (that's some of us :) or a long
	standing interest in epidemiology, then we hope this simulator may be
	useful for you as a research tool.  The advanced controls in the portal are
	designed to give you complete control of the simulator. The only thing you
	will not be able change from the portal are the underlying models
	themselves.  For that, you are free to fork and modify [the source
	code](https://github.com/srhariha/SpatioTemporalSEIR). We hope that you
	will make those better simulators available to the first group.

3.	If you are neither of the above, you can use this portal to build your
	intution on the effectiveness of various mitigation strategies and the
	dangers of violating them. We have also created a few sample scenarios
	to get you started.

## Do you consider the effect of people coming from outside Kerala?

*Not yet*. This is the highest priority item in our to-do list. We will try to
model this based on the quarantine policies that will be put in place by the
state government this week.

## Why is it slow?

We start running the simulator only after the visitor enters the seed and
mitigations. This has to be done separately for each visitor to our portal.  We
are working on optimising the code and upgrading our server to make this
faster.

## Can I see the code behind the simulator?

*Yes*, you are most welcome to fork and improve our
[git-repo](https://github.com/srhariha/SpatioTemporalSEIR).

## Can I see the math behind the code?

*Yes*, you are most welcome to read the [mathematical description of our model](./model.html)

repository: srhariha/SpatioTemporalSEIR

gha_language: Jupyter Notebook

repo_name: srhariha/SpatioTemporalSEIR


text:
# Forwarding Qlik Sense event notifications to MQTT messages

This repository is all about making it as easy as possible to get started with and using the Qlik Sense notification API.

## Rationale

[Qlik Sense](https://www.qlik.com/us/products/qlik-sense) offers a very powerful, but somewhat hard to use [notification API](https://help.qlik.com/en-US/sense-developer/September2018/Subsystems/RepositoryServiceAPI/Content/Sense_RepositoryServiceAPI/RepositoryServiceAPI-Notification-Create-Change-Subscription.htm).

Through this API you can get notified when all kinds of events happen in a Sense environment.
The API is in fact extremely rich, you can get notified when almost *anything* happens...
Notifications examples include

* Task failures
* Reload task progress
* Apps being published, updated or deleted
* Sheets being updated
* The details of a specific user are changed
* ...

This is all good, except that the notification API is somewhat hard to get started with and use.
You need to set up some kind of authentication to QRS, set up a REST server which QRS can call/notify when the subscribed to events occur, you also need to register callbacks for all QRS events you are interested in etc.

Fine if you have a well defined project that you want to create an optimized program for, but somwhat of a pain if you just want to try out the Qlik Sense notification features.

The "Butler Notifier" makes it a lot easier to set up and use Qlik Sense notifications in both prototype and production contexts:

* All configuration is done in YAML config files
  * One file defines QRS specific parameters like certificates, IP addresses of the QRS server etc
  * One file defines what QRS events to subscribe to
* The application handles everything around setting up callbacks that QRS will use to notify about the subscribed to events
* All events are forwarded as MQTT messages, which can be acted upon by downstream services.

Running the gateway and having it subscribe to reload task events looks like this:

![reload-task-verbose.png](doc/img/reload-task-verbose.png "Running the gateway")

Setting the debug level to 'debug' will greatly increase the information logged to console and disk log files.

### Limitations

As of this writing, you can get MQTT notifications for the following Qlik Sense object types:

* ExecutionResult
* User

Please note that the app itself can subscribe to notifications for any object type - it's just the forwarding to MQTT messages that is currently limited to the above object types.
Support for additional object types can be added if/when needed.

## The config files

Both config files are in YAML, which makes them easy to read and understand.
Event subscriptions are defined in notification.yaml, which can look like this:

![notification.yaml](doc/img/notification-yaml.png "Setting up event subscriptions")

The syntax used in `notification.yaml` is the same as in the underlying Qlik Sense notification API. Thus, [Qlik's help pages](https://help.qlik.com/en-US/sense-developer/September2018/Subsystems/RepositoryServiceAPI/Content/Sense_RepositoryServiceAPI/RepositoryServiceAPI-Notification-Create-Change-Subscription.htm) come in handy when defining what notifications are of interest.

The file where more general settings are defined looks like this:

![development.template.yaml](doc/img/development-template-yaml.png "Main config file")

### Running in Docker

New releases of Butler Notifier are automatically packaged as Docker images and pushed to [Docker Hub](https://hub.docker.com/u/ptarmiganlabs/).
This together with the supplied `docker-compose.yml` file makes it easy to run Butler Notifier as a Docker container.

Before using `docker-compose` to start Butler Notifier in a Docker container, you must edit the NODE_ENV setting in the `docker-compose.yml` file. The value of that setting should match the name of your main config file.

For example, if you main config file is called `production.yaml`, the NODE_ENV variable should be set to `production` in the `docker-compose.yml` file.

## What is MQTT

[MQTT](https://en.wikipedia.org/wiki/MQTT) is a machine-to-machine messaging protocol. It is widely used in Internet of Things applications, but works equally well for server based messaging.

By *publishing* the QRS events as MQTT *messages* in well defined *topics*, other applications or services can then *subscribe* to the topics of interest, and be notified in real time when new messages arrive.
MQTT thus uses a "publish-subscribe", or pub-sub concept.

In order to use MQTT an "MQTT broker" is needed. [Mosquitto](https://mosquitto.org/) is a good open source option - it has been around for some years and is mature and stable.

A good intro to MQTT is found [here](https://www.hivemq.com/blog/how-to-get-started-with-mqtt).

## MQTT topics used in Butler Notifier

The base MQTT topic root used by Butler Notifier is defined in the `mqttConfig.baseTopic` section of the main configuration file (production.yaml, development.yaml or similar).

If in doubt what to use as the base topic, "qliksense/notification/" is a good start.

The following MQTT topics are used by Butler Notifier:

### Object type: Execution result

    # A task's most recent reported reload status (triggered, queued, running, failed etc)
    qliksense/notification/executionResult/<appId>/<taskId>/lastKnownStatus

    # A task's most recent, complete reload state. This is usually a fairly large JSON
    qliksense/notification/executionResult/<appId>/<taskId>/lastKnownFullState

    # The complete reload state, published to a topic specific for the current result code
    qliksense/notification/executionResult/<appId>/<taskId>/<resultCode>

### Object type: User

    # A user's most recent, complete state
    qliksense/notification/user/<userDirectory>/<userId>/lastKnownFullState

    # The most recent user notification received
    qliksense/notification/user/lastMessage

## Using MQTT messages

There are lots of good client side libraries for MQTT, making it easy to use the MQTT messages (or rather the QRS events!) in your applications.

### Node-RED

A great way to get started is to use [Node-RED](https://nodered.org/), which is an open source visual development environment with great MQTT support.
While Node-RED is promoted as a prototyping tool for IoT applications, it is very stable and lots of people use it in prodcution settings. But as always - try these things in a sandbox/lab environment before deploying into production environments.

A sample Node-RED flow showing the last execution result info for Qlik Sense tasks can look like this:

![notification.yaml](doc/img/node-red-1.png "Setting up event subscriptions")

### MQTT.fx

[MQTT.fx](https://mqttfx.jensd.de/) a nice cross platform MQTT client. Works well on most popular operating systems.

On Mac OS this app seems to be quite resource hungry, but that may just as well be some issue with the computer the app was tested on.

### MQTTBox

[MQTTBox](http://workswithweb.com/mqttbox.html) is another cross platform MQTT client. It uses a pane-based UI concept, which in some cases works great, while in other cases can be a bit limiting.

## Links and references

* The [QRS help pages](https://help.qlik.com/en-US/sense-developer/September2018/Subsystems/RepositoryServiceAPI/Content/Sense_RepositoryServiceAPI/RepositoryServiceAPI-Notification-Create-Change-Subscription.htm) provide info on the syntax used to define what QRS events to subscribe to
* The fine folks in Qlik's enterprise architecture team has a good [blog post](https://eablog.qlikpoc.com/2018/11/01/qlik-sense-repository-notification-api/) describing the concepts of the notification API, including some good examples. Highly recommended reading.

repository: ptarmiganlabs/butler-notifier

repo_name: ptarmiganlabs/butler-notifier


text:
---
id: 459
title: PirateBox Offline FileSharing Dead Drop
date: 2014-08-16T10:29:43+00:00
author: James Wade
layout: post
guid: /?p=459
permalink: /2014/08/16/piratebox-offline-filesharing-dead-drop/
spacious_page_layout:
  - default_layout
image: /wp-content/uploads/2014/08/2014-06-04-12.18.53.jpg
categories:
  - Projects
tags:
  - dead drop
  - deaddrop
  - piratebox
  - projects
---
There’s now a PirateBox Dead Drop setup at Potteries Hackspace.

**What are dead drops?

** A USB dead drop is a USB device installed in a public space. For example, a USB flash drive might be mounted in an outdoor brick wall and fixed in place with fast concrete or cement. The name comes from the dead drop method of espionage communication. The devices can be regarded as an anonymous, offline, peer-to-peer file sharing network.

**What’s a PirateBox?**

A PirateBox is a portable electronic device, often consisting of a Wi-Fi router and a device for storing information, creating a wireless network that allows users who are connected to share files anonymously and locally. By definition, this device is disconnected from the Internet.

**Setting up a TL-WR703N as a PirateBox**

If like me you managed to aquire one of the TP-Link TL-WR703N, the Chinese version of the TP-Link MR3020, then you’re going to had a bad time, without a guide at least…

The official PirateBox website has instructions on [how to install PirateBox 1.0 on the TL-WR703N](http://piratebox.de/openwrt:diy#install_piratebox_10) on their website. I strongly advise that you follow those instructions as closely as possible.

Below are some instructions that may help you with some snags along the way…

[](/wp-content/uploads/2014/08/2013-03-18-20.54.05.jpg)

**Prerequisites**

First, let’s figure out what we need:

  * TL-WR703N
  * USB Flash Drive (formatted FAT32 with a single partition)
  * Ethernet cable
  * 5V USB Power cable and source

Warning: If you buy the TL-WR703N it is the model designed for the Chinese market unlike the TP-Link MR3020.

**Getting OpenWRT firmware installed**

Warning: Flashing your device may “brick” your device, preventing it from booting up normally. You can unbrick the device by accessing it via a serial port by following the instructables instructions on [how to add a serial port to a TL-WR703N](http://www.instructables.com/id/TL-WR703N-serial-port/?ALLSTEPS).

The first thing we need to do is switch from the TP-Link interface to OpenWRT. To do this, you need to connect to your TL-WR703N (usually on http://<IP_ADDRESS>/) via your web browser and update the firmware from there.

Sounds easy? It’s not. Why? Because it’s all Chinese!

If your Chinese is as good as mine, then you’re going to need some help…

To flash from the web interface, from the menu on the left, select the last menu item and then the third submenu item.

Warning: this will reset your flash and remove all your settings so you can start from scratch.

I tried to use the OpenWRT firmware for the WR703N but it reported as a

Download the openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin firmware file to upgrade from the web interface.

If like me you already installed (the wrong version of) OpenWRT, rewrite it from command line:

  cd /tmp
 wget http://stable.openwrt.piratebox.de/auto/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin
 mtd write openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin firmware
 reboot

Once you’ve got OpenWRT installed on the device and you’ve connected to the internet again you’re ready for the next steps…

**Setup basic USB Support**

  opkg update && opkg install kmod-usb-uhci kmod-usb-ohci
 insmod usbcore
 insmod uhci
 insmod usb-ohci

Note: If you get an error “insmod: can’t insert ‘usbcore’: File exists” you can safely ignore this.

**Brick your PirateBox**

At this point I somehow managed to brick my PirateBox. It would not boot at all.

If you followed these instructions closely, then it’s likely that you did too! Sorry, but at least it’s a good excuse to get hacking…

**Add a serial port**

[](/wp-content/uploads/2014/08/2014-08-16-11.11.00.jpg)

With the help of the guys down at the hackspace and a few bits off eBay (such as a USB to RS232 TTL PL2303HX Converter Module) I managed to follow the instructables instructions on [how to add a serial port to a TL-WR703N](http://www.instructables.com/id/TL-WR703N-serial-port/?ALLSTEPS) in order to unbrick the device and access it via a serial port.

Once I had restored the device back to normal via the serial port I was able to follow the PrivateBox install instructions correctly.

The downside was that I had to add this step in, but the upside was I got to hack the device!

Unfortunately I didn’t take a note of exactly the steps I took to send the image over the serial port, but it did involve using RealTerm and TFPD. There’s some instructions on the OpenPilot forum, entitled “[Unbrick wr703n wifi route](http://forums.openpilot.org/blog/52/entry-92-unbrick-wr703n-wifi-router/)r” which seem to be the same instructions I followed.

**Install PirateBox**

Follow the instructions on the official “PirateBox” website, titled, [how to install PirateBox 1.0 on the TL-WR703N](http://piratebox.de/openwrt:diy#install_piratebox_10).

**Check your Wireless**

If you’ve followed the instructions correctly then you should see an SSID broadcast that says: “PirateBox – Share Freely”…

There’s a 16GB memory stick in there which you’re welcome to use via the wifi access.

[](/wp-content/uploads/2014/08/2014-07-08-21.30.07.jpg)

**Useful Resources**

  * [OpenWRT:DIY instructions](http://piratebox.cc/openwrt:diy)
  * [TL-WR703N serial port](http://www.instructables.com/id/TL-WR703N-serial-port/?ALLSTEPS)
  * [PirateBox creation based on TP-Link MR3020](http://www.disk91.com/2012/technology/networks/piratebox-creation-based-on-tp-link-mr3020/)
  * [Piratebox on TP-Link MR 3020](https://sites.google.com/site/cookingcomputersandmore/home/computers-electronics-and-gadgets/piratebox-on-tp-link-mr-3020)
  * [Reverse-Engineering work on the TL-WR703N 150M 802.11n Wi-Fi Router](http://squonk42.github.io/TL-WR703N/)
  * [TP-Link TL-WR703N – OpenWrt Wiki](http://wiki.openwrt.org/toh/tp-link/tl-wr703n)
  * [TP-LINK TL-WR703N Configuration & Hack](http://www.siongboon.com/projects/2013-10-06_tl-wr703n_setup/index.html)
  * [Unbrick wr703n wifi router – OpenPilot Forums](http://forums.openpilot.org/blog/52/entry-92-unbrick-wr703n-wifi-router/)
  * [Hacking the TP-Link TL-WR703N](http://www.rs-online.com/designspark/electronics/blog/hacking-the-tp-link-tl-wr703n)
  * [cave’s tinker pit : unbrick WR703n](http://cavebeat.blogspot.co.uk/2012/09/unbrick-wr703n.html)

gha_language: CSS


text:
---
layout: default
---

# 1993-03-05 - Re: Encrypted voice protocol?

## Header Data

From<EMAIL_ADDRESS>(Bill_Stewart(HOY002)1305)

To<EMAIL_ADDRESS>Message Hash: dd1d41cf5eae2daf6f9d54ec424ed6ceebb82b7ece8f972c128ba3f6b556e909

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-03-05 19:55:09 UTC

Raw Date: Fri, 5 Mar 93 11:55:09 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Bill_Stewart(HOY002)1305)
Date: Fri, 5 Mar 93 11:55:09 PST
To<EMAIL_ADDRESS>Subject: Re: Encrypted voice protocol?
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

(Carl - this is a reply to a cypherpunks mailing list mention of your
program.  Way to go, and good luck!)

Internet Talk Radio also made the Front Page of the New York Times 3/4/93.
The picture of Carl Malamud showed him in his office, with a computer near the
front with "Internet Talk Radio" running on it, and a poster on the
back wall saying "Freedom of the Press belongs to those who own one",
put out by some computer company or other.   Story by John Markoff, of course.

It's basically going to be a half-hour audio segment, with interviews
("Geek of the Week") plus miscellaneous news and stories, kind of in the
style of All Things Considered.  Folks with high-end systems will be able to
listen in real-time; folks with lower-end will need to download slowly and
listen later.  Size is about 15 MB, data rate 64 kb/s, estimated 2400-baud time
14 hours.  I'm surprised he's not doing better compression than that,
but (speculation) this may be broadcast-quality audio with ADPCM rather than
telephone-quality 3kHz audio uncompressed?  The broadcast will be split up
into segments, so you can get pieces without downloading the whole thing.
Initially it's audio-only but may add some multi-media stuff, especially for
navigation through the sound files.  GIFs of the guest would be an obvious
extension....

Some good interviews with Nicholas Negroponte of MIT Media Lab and
Paul Saffo of Institute for the Future.  No mention of encryption, MIME,
pricing, retransmission policy, etc.  Some nice commentary on the relationship
between this and the broadcast industry.

Computer fu.  Gratuitous NREN fu.  No blood but a little Gore.
Joe Bob says "Check it out!"

				Bill Stewart<EMAIL_ADDRESS>

{% endraw %}
```

## Thread

+ Return to [March 1993](/archive/1993/03)

+ Return to<EMAIL_ADDRESS>(Bill_Stewart(HOY002)1305)](/authors/wcs_at_anchor_ho_att_com_bill_stewart_hoy002_1305_)"

+ 1993-03-05 (Fri, 5 Mar 93 11:55:09 PST) - Re: Encrypted voice protocol? -<EMAIL_ADDRESS>(Bill_Stewart(HOY002)1305)_


text:
# Asset Loader

Public asset files loader.

## Installation

`composer require heavenproject/asset-loader`

## How It Works

Asset Loader is [Latte macro](http://latte.nette.org/en/).

After the asset file is loaded in the Asset Loader, it reads the asset url,
saves this information in temporary file and appends a version number
after this url in a form of query string,
e.g. `http://example.com/images/image.jpg?v=1`. After the asset file has been
modified, Asset Loader registers this during a new request and increases
version number in url query string,
e.g. `http://example.com/images/image.jpg?v=2`. This will force the web browser
to download a new version of this asset file from server instead of using
it from browser cache.

> **NOTE:** Asset files can be loaded either just by specifiyng its absolute filepath
from the website document root directory,
e.g. `/images/image.jpg` or by using its external url,
e.g. `http://example.com/images/image.jpg`, but if using the later form (external url), keep in mind,
that trying to work with assets from different domains will not work, because in this case Asset Loader
checks the domain in url and if it does not match the website url, it will
only return the original url that was given to it, so browser can work with the given resource as usual.
So please only load your website local assets.

## Requirements

- [Nette Framework](https://github.com/nette/nette)

## Documentation

In order to use Asset Loader you must register it as extension in configuration file:

```neon
extensions:
    asset: HeavenProject\AssetLoader\AssetLoaderExtension
```

Then you must configure it:

```neon
asset:
    publicDir: %wwwDir%
    targetDir: %tempDir%/assets
```

After this you are ready to use the Asset Loader:

```latte
<img src="{asset $basePath . '/images/image.jpg'}" alt="Image">
```

## License

This source code is [free software](http://www.gnu.org/philosophy/free-sw.html)
available under the [MIT license](license.md).

repository: CSHH/asset-loader

repo_name: CSHH/asset-loader


text:
## An Act to authorize a Loan to the Government of New Brunswick in respect of the Beechwood Power Project (S.C. 1957-58, c. 26)
  *[S.C.]: Statutes of Canada

repository: JasonMWhite/gitlawca-copy

repo_name: JasonMWhite/gitlawca-copy


text:
---
comments: true
date: 2009-05-02 22:02:38
layout: post
slug: flex-3-bouncing-marquee
title: Flex 3 Bouncing Marquee
wordpress_id: 73
categories:
- projects
tags:
- actionscript
- coding
- flex
---

I was working on a secret flex project (Shh!) the other week that required some scrolling text. "I wonder how to implement that in flex?" I thought. I've been working with flex [at work](http://macadamian.com) for about 9 months now, but I've never encountered the need for such a component before.

A quick Google search revealed this: [Marquee Component](http://butterfliesandbugs.wordpress.com/2007/09/06/marquee-component/). Fantastic! One of my favourite things about working with flex is that there's a huge community out there who have already written the component you need in 90% of cases.

Still, I needed to adapt the component to fit my needs. The 'secret project' involves a media player, and the marquee was for the song title. I wanted it to display the artist and title at a fixed width, but scroll back and forth if the text was too long. I call it a 'bounce' marquee. [Here's the demo](http://theflyingdeveloper.com/code_examples/bounce_marquee/BounceMarqueeDemo.html).

The first modification I made was to change the way in which the component defined the movement. The original marquee had a property defining the duration of the scrolling. This was unsuitable because it meant that longer text scrolled faster. Make the string long enough, and the text would scroll past too fast to read. Instead, the bouncing marquee has a scrollSpeed property that defines the speed in pixels per second. The length of the string (in pixels) is divided by this number to produce the duration of the scroll, which is then passed to the Move effect.

Secondly I changed the effects to match my desired behaviour. I simply defined to Move effects with Pause effects between inside a Sequence. The first move takes the text from it's initial position to and scrolls it until the end of the string can be seen. The second move takes it back. The length of the pauses can be changed by overriding the pauseDuration property on the component.

This was all well and good, but there was still a problem. Updating the properties of an Effect whilst it's playing does not take effect until the effect is stopped and restarted. Therefore I needed a public update() method to be called that would reset the effects and allow the changes to take place.

All in all I'm pretty pleased with how the component turned out. The hardest part was figuring out why the effects weren't updating properly when I changed the text. It seems there was a timing issue that judicious application of the validateNow() method fixed.

extension: markdown


text:
# ckmeans
A consensus K-Means clustering R package.

## Installation
```R
# install.packages('devtools')
library(devtools)

# On UNIX you might have to run the following line if you are not a sudo user:
# Sys.setenv(TAR = "/bin/tar")
install_github('https://github.com/TankredO/ckmeans')
```

## Example
```R
library(ckmeans)

ckms <- multickmeans(iris[,1:4], ks = 1:10, p_pred = 0.8, p_samp = 0.8, n_rep = 500)

plotDist(ckms$ckms[[3]])
plot(ckms$bics, type='l')
```

repository: TankredO/ckmeans

repo_name: TankredO/ckmeans


text:
# generator-awesome-aurelia [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
> An aurelia generator

## Installation

First, install [jspm](http://jspm.io), [gulp](http://gulpjs.com), [Yeoman](http://yeoman.io) and generator-awesome-aurelia using [npm](https://www.npmjs.com/) (we assume you have pre-installed the newest (min 6.0.0) [node.js](https://nodejs.org/)).

```bash
npm install -g jspm
npm install -g gulp
npm install -g yo
npm install -g generator-awesome-aurelia
```

Then generate your new project:

```bash
yo awesome-aurelia
```

## Adding a route
Run:

```bash
yo awesome-aurelia:route
```

This will generate the necessary files and folders, based on your answers (only jspm without dotnet)

## Adding a language
Run the command and replace LANGUAGE with the shortform of the language

```bash
yo awesome-aurelia:i18n LANGUAGE
```

This will generate the necessary files and folders

## Getting To Know Yeoman

 * Yeoman has a heart of gold.
 * Yeoman is a person with feelings and opinions, but is very easy to work with.
 * Yeoman can be too opinionated at times but is easily convinced not to be.
 * Feel free to [learn more about Yeoman](http://yeoman.io/).

## License

Apache-2.0 © [Matthias Feldmann](https://github.com/MatthiasF999)

[npm-image]: https://badge.fury.io/js/generator-awesome-aurelia.svg
[npm-url]: https://npmjs.org/package/generator-awesome-aurelia
[travis-image]: https://travis-ci.org/MatthiasF999/generator-awesome-aurelia.svg?branch=master
[travis-url]: https://travis-ci.org/MatthiasF999/generator-awesome-aurelia
[daviddm-image]: https://david-dm.org/MatthiasF999/generator-awesome-aurelia.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/MatthiasF999/generator-awesome-aurelia
[coveralls-image]: https://coveralls.io/repos/github/MatthiasF999/generator-awesome-aurelia/badge.svg
[coveralls-url]: https://coveralls.io/github/MatthiasF999/generator-awesome-aurelia


text:
# Service proxies

## Use case
Services defined within a Dynamic Extension (Bundle), run within their own private Spring ApplicationContext.

This means they are not visible from the global Alfresco Spring context. (much like Alfresco subsystems)

In some cases you want your service to be visible to other beans running in the global Alfresco context:
* you want to override an existing bean
* you want to integrate with a non-dynamic extension

## Proxy to the rescue
Alfresco subsystems like the Solr context, are wired into the global context via a Proxy: a proxy bean is defined in the global context and configured with the target bean name and target subcontext. (search -> solr/search)

This approach can almost be reused for Dynamic Extensions. We configure a proxy with a service filter (ie. all beans implementing com.IReplicator) and all calls to that proxy are forwarded to the embedded service.

Note: some exposure to OSGi terminology lies ahead

## Caveats
Unlike Alfresco subsystems, Dynamic Extensions are started asynchronously + they come and go as they please: you can uninstall, update or install alternative implementations of a particular service. So we cannot guarantee that a service will be available when the proxy is invoked.

Dependencies can be expressed between extensions, but not between the 2 worlds. (Alfresco global context & DE)

This is a limitation we have to accept. Any calls to the proxy, when the service is not available, will fail with an `IllegalStateException`

## Registering a proxy
### Publication
By default, any bean tagged with `@Component` is registered within the local Spring context, but remains private to the extension.

An additional step is required to export it: `@OsgiService`
```java
@Component
@OsgiService
public class DefaultReplicator implements IReplicator {
   ...
}
```

### Consumption
In an Alfresco X-context.xml file (where X is the name of your service), register a proxy:
```xml
<bean id="replicator" parent="abstractBundleServiceProxy">
  <property name="targetInterfaces">
    <list>
      <value>com.IReplicator</value>
    </list>
  </property>
</bean>
```

## Matching
If exactly 1 `IReplicator` implementation is published using the `@OsgiService` annotation, we are done.

In some scenarios, you can have multiple implementations for a service running at the same time. (ie. lucene & solr)

We now need a more specific filter, to link both components.

### Publication
Add extra details to the service publication:
```java
@OsgiService(headers = @OsgiService.ExportHeader(key = "transactional", value = "true"))
public class LuceneSearch implements SearchService {}
```

### Consumption
```xml
<bean id="search" parent="abstractBundleServiceProxy">
  <property name="targetInterfaces">
    <list>
      <value>SearchService</value>
    </list>
  </property>
  <property name="filterString" value="(&(objectClass=SearchService)(transactional=true))"/>
</bean>
```
**objectClass** selects by implemented interface

## Update filter at runtime
You can update the configured filter at runtime, by casting the proxy to a `FilterModel`.

## Classloader constraints
As Alfresco's classloader is the parent of all extension classloaders, classes defined in the web application classpath (WEB-INF/lib or WEB-INF/classes) are visible to both. Classes implemented within an extension, are only visible to that extension (or other extensions), not to Alfresco.

For this reason, you should provide your proxy interfaces (IReplicator) to the webapp classpath. (deployed via regular AMP file)
Of course, if you're using interfaces defined by Alfresco, the JDK or WEB-INF/lib libraries, this is already the case.

The implementation classes can remain inside your extension.

gha_language: Java


text:
---
name: lichess
logo_url: https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Lichess_Logo.svg/1024px-Lichess_Logo.svg.png
source_url: https://github.com/niklasf/stockfish.wasm
website: https://lichess.org/analysis
description: lichess is an open source chess server, that is in Alexa's top 2000 sites. lichess uses WebAssembly for it's chess engine analysis.
keywords: game gaming emscripten c c++ chess port porting production
---

lichess is an open source chess server, that is in Alexa's top 2000 sites. lichess uses [WebAssembly port of stockfish](https://github.com/niklasf/stockfish.wasm) for it's chess engine analysis.

![lichess screen shot](https://pbs.twimg.com/media/DyQmdcRX4AAROCH.jpg)