text:
# CHANGELOG

## v0.21.0

- Support Google's ptypes in Mutation response [#47](https://github.com/ysugimoto/grpc-graphql-gateway/pull/46)
- Fix misspelling in example [#46](https://github.com/ysugimoto/grpc-graphql-gateway/pull/46) (@day112)

## v0.20.1

- Support marshaling map type of Protocol Buffers [#38](https://github.com/ysugimoto/grpc-graphql-gateway/pull/38)

## v0.20.0

- Enable to specify Google's ptype in request message [#36](https://github.com/ysugimoto/grpc-graphql-gateway/pull/36)
- Support protobuf v3.14.0 [#36](https://github.com/ysugimoto/grpc-graphql-gateway/pull/36)

## v0.19.2

Bugifxes

- Fix input object when message has dependency of extermal package [#35](https://github.com/ysugimoto/grpc-graphql-gateway/pull/35)

## v0.19.1

Bugifxes

- Fix Input message type generation for nested resolver [#33](https://github.com/ysugimoto/grpc-graphql-gateway/pull/33)

## v0.19.0

Bugifxes

- Fix Input message type generation [#32](https://github.com/ysugimoto/grpc-graphql-gateway/pull/32)
- Fix Query argument field type [#30](https://github.com/ysugimoto/grpc-graphql-gateway/pull/30) (@tarunvelli)

## v0.18.1, v0.18.2

- Fix Google's ptypes package and generation [#27](https://github.com/ysugimoto/grpc-graphql-gateway/pull/27) [#29](https://github.com/ysugimoto/grpc-graphql-gateway/pull/29)

## v0.18.0

- Enable to parse enums within message [#26](https://github.com/ysugimoto/grpc-graphql-gateway/pull/26) (@hychrisli)

## v0.17.0

- Add default error handler which add `code` extension via gRPC error [#25](https://github.com/ysugimoto/grpc-graphql-gateway/pull/25)

## v0.16.0

## New graphql.proto option

- Add new graphql option of `resolver` [#24](https://github.com/ysugimoto/grpc-graphql-gateway/pull/24)

```protobuf
message GraphqlField {
    bool required = 1;
    string name = 2;
    string default = 3;
    bool omit = 4;
    string resolver = 5;
}
```

A new field of `resolve` which resolves as a nested query.

## v0.15.0

Add `omit` option in graphql.field option.

## v0.14.6

Bugfixes

- enum: use protobuf enum type for value [#18](https://github.com/ysugimoto/grpc-graphql-gateway/pull/18) (@bmkessler)

## v0.14.5

Bugfixes

- Implement request transformation from CamelCase to SnakeCase.

## v0.14.3, v0.14.4

Bugfixes

- Fix unexpected panic caused by reflect package in marshaling JSON response with camel-case

## v0.14.1, v0.14.2

Bugfixes

- Fix tiny syntax error
- Fix field camelcase generation
- Fix required sign in repeated array and input object

## v0.14.0

### Partially support google's type

Implement specific types and provide from this repository:

- google.protobuf.Timestamp
- google.protobuf.Wrappers
- google.protobuf.Empty

Note that we could only support the above types hence if a user imports other types e.g. google.protobuf.Any will raise an error.

And for GraphQL spec, google.protobuf.Empty defined empty field like `_: Boolean` because GraphQL raises error when type fields are empty.

### Fix map type in proto3

In proto3, map type can define as `map<string, string>` but PB parse as xxxEntry message. This PR also can use as graphql type with required key and value.

### Version printing in plugin binary

`protoc-gen-graphql` accepts `-v` option for print build version.

## v0.13.0

### Add infix typename

Add infix typename to GraphQL typename in order to avoid conflicting name between `Type` and `Input`.
After this version, GraphQL typename is modified that `[PackageName]_[Type]_[MessageName]` for example:

```
package user

message User {
  int64 user_id = 1;
}
```

Then typename is `User_Type_User`.

### Convert field name to CamelCase option

In protocol buffers, all message field name should define as *lower_snake_case* referred by [Style Guide](https://developers.google.com/protocol-buffers/docs/style#message_and_field_names). But in GraphQL Schema, typically each field name should define as *lowerCamelCase*, so we add more option in `protoc-gen-graphql`:

```shell
protoc -I.
    --graphql_out=field_camel=true:.
    --go_out=plugins=grpc:.
    example.proto
```

The new option, `field_camel=true` converts all message field name to camel case like:

```
// protobuf
message User {
    int64 user_id = 1 [(graphql.field).required = true];
    string user_name = 2 [(graphql.field).required = true];
}

// Graphql Schema
type User_Type_User {
    userId Int!
    userName String!
}
```

To keep backward compatibility, compile as *lower_snake_case* as default. If you want to define any graphql field as lowerCamelCase, please supply this option.

## v0.12.0

### Define MiddlewareError and respond with error code

We defined `MiddleWareError` which can return in Middleware function. If middleware function returns that pointer instead of common error,
The runtime responds error with that field data.

The definition is:

```go
type MiddlewareError struct {
  Code string
  Message string
}

// generate error
return runtime.NewMiddlewareError("CODE", "MESSAGE")
```

If middleware returns common error, the runtime error will be:

```
{"data": null, "errors": [{"message": "error message of err.Error()", "extensions": {"code": "MIDDLEWARE_ERROR"}]}
```

If middleware returns `MiddlewareError`, the runtime error will be:

```
{"data": null, "errors": [{"message": "Message field value of MiddlewareError", "extensions": {"code": "Code field value of MiddlewareError"}]}
```

## v0.9.1

### Changed middleware fucntion type

On MiddlewareFunc, you need to return `context.Context` as first return value. this is because we need to make custom metadata to gRPC on middleware process.
If you are already using your onw middleware, plase change its interface. see https://github.com/ysugimoto/grpc-graphql-gateway/pull/10

repository: MoritzGruber/grpc-graphql-gateway

repo_name: MoritzGruber/grpc-graphql-gateway


text:
wecs_null_project
=================

You want to develop a game, using Python, Panda3D, and WECS? (If you
don't know one or more of those, there's a section on them after this
one.) You don't want to write all the stuff that every game has to have?
You want to get working on what makes your game *your* game? **Now**?
Well, then do!

1. Fork this project and rename it.
2. Run `main.py` to see what you've got right now (see below).
3. Run `python setup.py bdist_apps` to build distributable packages, and
   test them.
   CAVEAT: Still buggy. Sorry.
   NOTE: You can run `python setup.py build_apps` to build your project
   without packaging it. This is faster, and allows you check whether a
   bug occurs due to building alone, or due to packaging.

But I don't know...
-------------------

### Python

It's a popular and easy to learn programming language, and, dare I say
it, aesthetically pleasing. You can install it via your platform's
package manager, or from https://www.python.org/ where you also find the
official documentation, including a tutorial. If that's not your
preferred way of learning, there's hundreds of courses, tutorials, every
kind of resource imaginable.

### Panda3D

Panda3D is a 3D engine that is used most often for games, but has also
been used for engineering and visualization applications, art
installations, amusement park rides, amusement park ride design, ...

Originally developed by Disney, it has been open sourced, and is now
developed by its community. Despite rumors to the contrary, it is very
much alive and close to the state of the art of graphics technology.

Panda3D can be used with Python or C++. If C++ is your thing, I'm afraid
that this boilerplate project is not for you, it's aimed at Python
developers.

Unlike popular 3D engines, Panda3D does *not* come with an interactive
game creation and editing toolchain. It is a library that offers you
lots and lots of tools and building blocks, but you have to string them
together with code. The reasoning is that any editor would make
assumptions about how a game should be structured, limiting the design
space of its user. Since flexibility is very high on the priority list
of Panda3D development, designing an editor is a task that so far has
not been tackled with confidence.

Model assets for Panda3D are usually created with Blender, though
converters for other formats do exist, and Panda3D also reads glTF,
which may become the de facto standard in the near future. Sound assets
can be used as long as FFMPEG can read them.

You can find further information at https://www.panda3d.org/

### WECS

WECS is a set of strong assumptions about how a game should be
structured, usually called ECS, "Entity, Component, System", or
"Component System". Specifically, it assumes (and implements) these
ideas:

* A game object, called an `Entity`, consists of a set of `Components`,
  and nothing more.
* Each `Component` describes the state of the `Entity` with regard to
  some aspect of its existence. A `Component` only stores data. It does
  not implement any functionality to manipulate that data.
* For each tick / frame of the game, there is a list of `System`s that
  are run in order. Consider them as a kind of Panda3D `Task`.
  * Each `System` has a set (actually a dictionary in code) of
    `entity_filters` that specify what `Component`s an `Entity` has to
    have to be processed.
  * When a `System` is being run, it receives a list of `Entity`s for
    each `entity_filter`, which contain all `Entity`s that match a given
    `entity_filter`.

This is an approach to game architecture that allows both a high degree
of flexibility, and keeps each `System` manageably simple and isolated
from other `System`s. That means less effort to maintain code, and that
it is easy to combine separately developed game mechanics in the the
same game. That also means that WECS can contain a lot of pre-made
`System`s and `Component`s that you can just plug into your game.

You can find further information at
[GitHub](https://github.com/TheCheapestPixels/wecs)

### panda3d-stageflow

FIXME

### panda3d-keybindings

FIXME

Let's get going!
----------------

Everything good so far? Then you're ready for development.

1. Replace this `README.md` with something more appropriate.
2. grep for `STARTPROJECT` (or use whatever other way to find that
   word). It marks places where game-specific edits have to be made.

With the paperwork out of the way, you should now have a game with...

* a basic stage flow that...
  * by defaults resizes the window to borderless fullscreen, shows a
    Panda3D splash, and starts the main game loop,
  * also has an entry point for development which skips the splashes,
    and is used by starting the game with
    `python main.py --stage debug`,
  * is set up in `game/__init__.py`
* a `WECS` world at `base.ecs_world`
* the `panda3d-keybindings` device listener, configured in
  `keybindings.toml`,
* the `MainGameLoop` stage, which...
  * has one `System`, `wecs.panda3d.debug.DebugTools`, providing debug
    keys that by default are mapped to...
    * `escape` to exit the game (via `sys.exit()`)
    * `f10`: toggle the frame rate meter
    * `f11`: drop into a pdb session
    * `f12`: connect to the `pstats` server
  * no entities
  * is defined in `game/main_loop.py`

You can home in further on your prototype by adding premade systems that
ship with WECS, and now you *really* should be ready to implement your
own mechanics.
CAVEAT: I'm not happy at all with WECS' standard library of generic
mechanics yet...

That's it already: Plug together all the things that you have and need,
then write the ones that you don't have, but need. Develop, test, build,
distribute, done.

Coming soon(-ish)
-----------------

As you saw in the introductory section, things are... not quite ready
for prime time. There's one problem with this project itself right now:

* Deployment: I'm pushing that one forward one bug at a time...

There's also a few major features missing in my software toolbelt to
consider things ready for said prime time:

* Loading / saving games: There's no automatism yet to serialize the
  state of all `Component`s in the world that should be saved). Once
  that (and the corresponding deserialization) is added, saving and
  loading a game state should be a breeze.
* Networking: Networked play is essentially the same as saving a game
  state to the network instead of to disk, and loading from it. Thing is
  that once you do that, you also want to check that data for malformed
  data structure, value validity, game-mechanical validity, and so on.
  You also want to separate code that a client runs from that which a
  server runs (or, in the case of P2P, you want to distinguish between
  you and everyone else). You also want to do all of that with minimal
  development overhead.

   But
  it predates WECS and has to be updated and completed.
* Modding support: I have some foggy ideas about this. Nothing concrete.
  But it needs to be done.
* GUI and game spec files: We need a bunch of consoles, in particular a
  Python REPL, an overview over systems and entities, and one to edit
  entities. Premade WECS mechanics should also have tools. Since there
  are now a lot of strong assumptions, editors become possible, and
  their state can be saved and loaded. This means that eventually, any
  work that doesn't involve writing new mechanics can be done
  graphically.

And finally, there's a few documentation issue. `wecs_null_project`
draws upon lots of projects:
* `panda3d-stageflow`: Coarse game structure
* `panda3d-logos`: Contains Panda3D splash screen stage
* `wecs`: Gameplay
* `panda3d-keybindings`: Easier input management and keybinding files
* `panda3d-gltf`: Let Panda3D read glTF
* `blend2bam`: Another way to get assets from Blender into Panda3D
* `panda3d-simplepbr`: Physics-based rendering
* `pman`: CAVEAT: Nothing yet, but eventually, I want `pman init wecs`

Each of them should be documented well individually; Also, there should
be a unified tutorial showing how they interact. Revamping the Pong
example would be a good start.

In conclusion and repetition, `wecs_null_project` isn't ready for prime
time, meaning that it (or rather, many of the projects it uses) doesn't
*yet* do what aims to do: Making the creation and deployment of a
generic game a matter of five minutes. What is there so far however
demonstrates that with enough development effort, this is a perfectly
achievable goal.

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
date: '2013-03-20'
title: Correspondence
speakers:
  - Michael Perry
location: Lone Star College - Montgomery
sponsor: Improving Enterprises
---
Correspondence is SkyDrive for your objects. When you build an app using the Correspondence framework, it stores your objects locally and in the cloud. The same app running on another device pulls down those objects. When you change data on one device, the UI on the other is refreshed. It works online, it works offline, and you don't need to care. The API to make all this possible is clean and simple.

license: MIT

branch_name: refs/heads/main

gha_language: SCSS

gha_license_id: MIT


text:
## Simple demo for the RPi written in Python

The Python script work/switch/send_text.py just checks the status of the switch. When the switch is pressed, it reads the DHT11 and sends a text to the phone number it gets from the config file.

* Requires python 3
* and the Adafruit DHT11 library installed https://github.com/adafruit/DHT-sensor-library.git

If you want to run the daemon, install the etc_systemd_system-start_test.service file in (as you may have guessed by the name) /etc/systemd/system and enable it with `systemctl enable`

### Make sure that everything points to the right place:
* start_test.service contains the path to the bash script
* The bash script contains the path to the python script

send_text.py gets the account info from send_text.cfg. Where:

* account = the name of the email account you'll be sending from e.g<EMAIL_ADDRESS>* password = the email account password
* target = the phone's email address - varies by carrier
* server = the smtp address of the mail server
* port = the port you want to use (25 or 587)

repository: mule-ear/cocopidemo

repo_name: mule-ear/cocopidemo


text:
# Insert Just The Defaults

If you are constructing an `INSERT` statement for a table whose required
columns all have default values, you may just want to use the defaults. In
this situation, you can break away from the standard:

```
> insert into table_name (column1, column2) values (value1, value2);
```

Instead, simply tell Postgres that you want it to use the default values:

```
> insert into table_name default values;
```

repository: jbranchaud/til

gha_language: Vim Script

repo_name: jbranchaud/til


text:
# Reclone

Recently installed your Local Environment? Purchased a new computer? Wiped and reinstalled your OS?

Reclone is an easy way to `reclone` your most recent 100 respositories.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'reclone'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install reclone

## Usage

  - run: gem install reclone

  - Navigate to the directory you would like to clone your repositories to.

  - run: `reclone`
  - enter github user name
  - confirm you are in the right directory and would like to clone; type y

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/<github username>/reclone. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/<github username>/reclone/blob/master/CODE_OF_CONDUCT.md).

## License

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

repository: dwyn/reclone

repo_name: dwyn/reclone


text:
## pgr01: summary of steps 01

1. basic REST request

····   $ curl http://localhost:8080/rest/todos?select=id ``

2. authorized REST request

····   $ export JWT_TOKEN=... ``

····   $ curl -H "{{c1::Authorization}}: Bearer $JWT_TOKEN" http:... ``

3. Edit `sample_data/my_data.sql`:

····   {{c2::COPY}} client (id,name,address) ``

····   1 Apple address_1_·· ``

4. Create `data/my_schema.sql`

····   {{c3::create table}} client ( ... ``

5. Edit `data/schema.sql`: `{{c4::\ir}} `my_schema.sql``

%

%

clozeq

---

## pgr01: summary of steps 02

6. Create `api/my_views.sql`

····   create or replace {{c1::view}} clients as... ``

7. Edit `reset.sql`

····   {{c2::truncate}} data.client restart identity cascade; ``

8. Edit `authorization/privileges.sql`

····   {{c3::grant}} select, insert, update, delete ... ``

9. Make request to new API:

····   $ curl -H "Authorization: Bearer $JWT_TOKEN" http... ``

%

%

clozeq

---

## pgr02: import dependencies 03

····   {{c1::sample_data/reset.sql}}··``

······   {{c2::truncate}} plan ... ``

······   {{c3::sample_data/data.sql}}··``

········   COPY plan (id,name,...) ``

········   1,plan_1,... ``

····   {{c4::init.sql}} ``

······   {{c5::data}}/schema.sql ``

········   ddl.sql ``

··········   {{c6::CREATE TABLE}} enum_var (...) ``

······   {{c7::api}}/schema.sql ``

········   {{c8::views.sql}} ``

··········   CREATE VIEW clients as ... ``

······   {{c9::authorization}}/privileges.sql ``

········   grant select ... on api.clients ``

······   sample_data/data.sql ``

%

%

clozeq

---

## pgr02: import dependencies 04

····   sample_data/{{c1::reset.sql}}··``

······   truncate plan ... ``

······   sample_data/data.sql··``

····   init.sql ``

······   data/{{c2::schema.sql}} ``

········   {{c3::ddl.sql}} ``

······   api/schema.sql ``

········   {{c4::views.sql}} ``

······   authorization/{{c5::privileges.sql}} ``

······   sample_data/data.sql ``

%

%

clozeq

---

## pgs01: psk: authorized request

Nologin request

··  `` $ curl http://localhost:8080/rest/{{c1::todos?select=id}}  ``

··  `` [{"id":1},{"id":3},{"id":6}]  ``

Make an authorized request

··  `` $ export {{c2::JWT_TOKEN}}=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJyb2xlIjoid2VidXNlciJ9.uSsS2cukBlM6QXe4Y0H90fsdkJSGcle9b7p_kMV1Ymk  ``

··  `` $ curl _H "Authorization: Bearer $JWT_TOKEN" http://localhost:8080/rest/todos?select=id,todo  ``

··  `` [{"id":1,"todo":"item_1"},{"id":3,"todo":"item_3"},{"id":6,"todo":"item_6"}]  ``

%

%

active

---

## pgs01: psk sql file structure

··  `` db/  ``

····  `` {{c1::src}}: schema definition  ``

······  `` {{c2::data}}: definition of source tables  ``

········  `` schema.sql tables.sql  ``

······  `` {{c3::api}}: api entities  ``

········  `` schema.sql views_and_procedures.sql  ``

······  `` {{c4::libs}}:  ``

········  `` auth pgjwt rabbitmq request settings util  ``

······  `` {{c5::authorization}}: roles and privileges  ``

········  `` privileges.sql roles.sql  ``

······  `` {{c6::sample_data}}   ``

········  `` data.sql reset.sql  ``

······  `` {{c7::init.sql}}: entry point  ``

····  `` {{c8::tests}}: pgTap tests  ``

······  `` rls.sql structure.sql  ``

%

%

active

---

## pgs01: psk: generated sql code 03

··  `` {{c1::coalesce}}(  ``

····  `` {{c2::array_to_json}}(  ``

······  `` {{c3::array_agg}}(  ``

········  `` {{c4::row_to_json}}(_postgrest_t)))  ``

%

%

active

---

## pgs01: psk non-sql file structure 02

··  `` openresty: reverse proxy and lua code  ``

····  `` {{c1::lualib}}/user_code: application lua code  ``

····  `` {{c2::nginx}}/  ``

······  `` conf  ``

······  `` html  ``

····  `` {{c3::tests}}  ``

······  `` rest: rest interface tests  ``

······  `` common.js: helper functions  ``

····  `` Dockerfile  ``

····  `` entrypointsh: custom entrypoint  ``

··  `` postgrest  ``

····  `` {{c4::tests}}: bash based integration tests  ``

······  `` {{c5::all.sh}} assert.sh  ``

%

%

active

---

## pgs01: pgr: API ex 01

··  `` GET /{{c1::people}}?age=gte.18&student=is.true  ``

··  `` GET /people?{{c2::and=}}(grade.{{c2::gte}}.90,student.{{c3::is}}.true,{{c4::or}}(age.gte.14,age.{{c5::is}}.null))  ``

··  `` ?a{{c6::=in}}."hi there","yes"  ``

··  `` ?tags{{c7::=cs}}.{example, new}  ``

··  `` verbs: OPTIONS, GET, {{c8::POST}}, PATCH, DELETE  ``

%

%

active

---

## pgs01: pgr: API ex 02

··  `` GET /view  ``

····  `` CREATE {{c1::VIEW}} fresh_stories AS  ``

······  `` SELECT *  ``

········  `` FROM stories  ``

······   `` WHERE pinned = true  ``

··········  `` OR published > now() _ interval '1 day'  ``

······  `` ORDER BY pinned DESC, published DESC;  ``

······  `` -->  ``

······  `` GET /{{c2::fresh_stories}} HTTP/1.1  ``

%

%

active

---

## pgs01: pgr: API ex 03

··  `` GET /entity?function /entity?order  ``

····  `` GET /people?{{c1::select=}}*,full_name  ``

····  `` CREATE FUNCTION full_name(people) RETURNS text AS $$  ``

······  `` SELECT $1.fname || ' ' || $1.lname;  ``

····  `` GET /people?{{c2::full_name}}=fts.Beckett  ``

····  `` GET /people?{{c3::order=}}age.desc,height.asc  ``

%

%

active

---

## pgs01: pgr: API ex 04

··  `` Range pagination  ``

····  `` GET /people HTTP/1.1  ``

······  `` Range_Unit: items  ``

······  `` {{c1::Range}}: 0_19  ``

····  `` GET /people?{{c2::limit=}}15&{{c3::offset=}}30  ``

%

%

active

---

## pgs01: pgr: API ex 05

··  `` single item ?id=eq.1 Accept: vnd.pgrst  ``

····  `` /items?{{c1::id}}={{c2::eq}}.1  ``

······  `` [ {"id":1} ]  ``

····  `` /items?id=eq.1  ``

······  `` Accept: application/{{c3::vnd.pgrst}}.object+json  ``

······  `` {{c4::{"id":1}}}  ``

%

%

active

---

## pgs01: pgr: API ex 06

··  `` joins items?select=id,{{c1::subitems}}(id,field)  ``

····  `` curl http://localhost:8080rest/items?id=gt.1&select=id,name,{{c2::subitems}}(id,name)  ``

····  `` /films?{{c3::select}}=title,directors(id,last_name)  ``

····  `` GET /films?select=*,actors(*)&actors.order=last_name,first_name  ``

%

%

active

---

## pgs01: pgr: API ex 07

··  `` {{c1::POST}} /{{c2::rpc}}/function {args}  ``

··  `` POST /rpc/function_name  ``

··  `` CREATE FUNCTION add_them(a integer, b integer)  ``

····  `` -->  ``

····  `` POST /rpc/{{c3::add_them}}  ``

······  `` {"a":1, {{c4::"b"}}:2}  ``

%

%

active

---

## pgs01: pgr: API ex 08

··  `` request.header.XYZ  ``

····  `` SELECT {{c1::current_setting}}('{{c2::request.header.origin}}', true);  ``

%

%

active

---

## pgs01: pgr: API ex 09

··  `` insert = {{c1::POST}}, update = {{c2::PATCH}}, delete = DELETE  ``

····  `` POST /table_name   ``

······  `` {{{c3::"col1": "value"}}, "col2": "value"}  ``

····  `` PATCH /people?age=lt.13  ``

······  `` {{c4::{"category": "child"}}}  ``

····  `` POST /people  ``

······  `` Content_Type: {{c5::text/csv}}  ``

······  `` name,age  ``

······  `` J Doe,62   ``

······  `` Jonas,10  ``

····  `` POST /people  ``

······  `` Content_Type: application/{{c6::json}}  ``

······  `` [  ``

········  `` {"name":"J Doe", "age":62},  ``

········  `` ..  ``

······  `` ]  ``

%

%

active

---

## pgs01: Run pgcli with existing env variables

··  `` pgcli {{c1::app}}  ``

··  `` set {{c2::search_path}} = {{c3::data}}, public;  ``

%

%

active

---

## pgs01: Env variables for postgresql database clients

··  `` export {{c1::PGHOST}}=localhost  ``

··  `` export {{c2::PGPORT}}=5432  ``

··  `` export {{c3::PGUSER}}=superuser  ``

··  `` export {{c4::PGDATABASE}}=app  ``

%

%

active

---

## pgs01: what are the repl tools for sql?

··  `` {{c1::franchise}} notebook  ``

··  `` {{c2::psql}}  ``

··  `` {{c3::jupyter}}: %load_ext sql  ``

··  `` {{c4::pgcli}}  ``

··  `` {{c5::DataGrip}}  ``

··  `` {{c6::rmarkdown}}: sql engine  ``

%

%

active

---

## pgs01: postgresql connection string example?

··  `` {{c1::postgresql}}://{{c2::superuser}}:{{c3::superuserpass}}@localhost/{{c4::app}}  ``

%

%

active

---

## pgs01: how to create new database from terminal

··  `` psql -c '{{c1::CREATE DATABASE}} library OWNER = {{c2::superuser}}'  ``

%

%

active

---

## pgs01: how to connect to pgs db from R?

··  `` con <_ DBI::{{c1::dbConnect}}({{c2::RPostgreSQL}}::PostgreSQL()  ``

····  `` , user = Sys.{{c3::getenv}}("SUPER_USER")  ``

····  `` , password = Sys.getenv("SUPER_USER_PASSWORD")  ``

····  `` , {{c4::dbname}} = "app"  ``

····  `` , host = "localhost"  ``

····  `` , port = "5432"  ``

··  `` )  ``

%

%

active

---

## pgs01: sql grant

··  `` GRANT {{c1::some_privilege}} TO {{c2::some_role}}  ``

··  `` CREATE ROLE todo_user NOLOGIN;  ``

··  `` GRANT {{c3::todo_user}} TO {{c3::group1}};  ``

%

%

active

---

## pgs01: sql privilege list

··  `` ALL {{c1::ON ALL}}  ``

··  `` ON {{c2::ALL TABLES}}/SEQUENCES  ``

····  `` {{c3::SELECT}}  ``

····  `` {{c4::REFERENCES}}  ``

····  `` {{c5::TRIGGER}}  ``

····  `` {{c6::UPDATE}}  ``

····  `` {{c7::DELETE}}  ``

··  `` {{c8::USAGE}} ON SCHEMA  ``

··  `` ON ALL TABLES IN {{c9::SCHEMA}} <my_schema>  ``

··  `` ON {{c10::<schema>}}.
  ``

%

%

active

---

## pgs01: backup and restore

··  `` {{c1::pg_dump}}: selective backup  ``

··  `` {{c2::pg_dumpall}}: all  ``

··  `` {{c3::CREATE DATABASE}} mydb  ``

····  `` {{c4::pg_restore}} __dbname=mydb __jobs=4 __verbose mydb.backup  ``

····  `` __section=pre_data  ``

%

%

active

---

## pgs01: password stored in

··  `` ~/{{c1::.pgpass}}  ``

%

%

active

---

## pgs01: the path of disk space to store db in pgs?

··  `` {{c1::TABLESPACE}}  ``

··  `` CREATE {{c1::TABLESPACE}} secondary LOCATION 'path'  ``

··  `` pg_default  ``

··  `` pg_global  ``

%

%

active

---

## pgs01: psql arguments

··  `` psql {{c1::-d}} app {{c2::-h}} localhost {{c3::-p}} 5432 {{c4::-U}} superuser  ``

%

%

active

---

## pgs01: psql commands 01

··  `` {{c1::\c}} <dbname> <username>  ``

··  `` list tables: {{c2::\dt}}  ``

··  `` more: {{c3::\dt+}}  ``

··  `` describe a table: {{c4::\d}} <table_name>  ``

··  `` list schemas: {{c5::\dn}}  ``

··  `` list functions: {{c6::\df}}  ``

··  `` list views: {{c7::\dv}}  ``

··  `` list users and roles: {{c8::\du}}  ``

%

%

active

---

## pgs01: pgs: what are main data types?

··  `` {{c1::numeric}}: integer bigint decimal numeric real double precision  ``

··  `` serials  ``

··  `` {{c2::character}}: varchar(n), char(n), text  ``

··  `` {{c3::temporals}}: timestamptz timestamp  ``

··  `` enum  ``

··  `` {{c4::Arrays}}: integer[] character[]  ``

··  `` {{c5::Range}}: (_2,2] '[2012_04_24, infinity)'::daterange  ``

··  `` {{c6::json}}: json jsonb  ``

%

%

active

---

## pgs01: pgs: add uniqueness constraint

··  `` {{c1::ALTER TABLE}} logs_2011 ADD {{c2::CONSTRAINT}} uq   ``

····  `` {{c3::UNIQUE}} (user_name, log_ts);  ``

%

%

active

---

## pgs01: pgs: constraint all chars as lowercase

··  `` ALTER TABLE logs ADD {{c1::CONSTRAINT}} chk   ``

····  `` {{c2::CHECK}} (user_name = {{c3::lower}}(user_name));  ``

%

%

active

---

## pgs01: pgs: fk constraint

··  `` ALTER TABLE facts ADD CONSTRAINT fk_facts_f   ``

····  `` {{c2::FOREIGN KEY}} (fact_type_id) {{c1::REFERENCES}} lu_fact_types (fact_type_id)  ``

%

%

active

---

## pgs01: pgs: view examples

··  `` CREATE {{c1::view_name}} {{c1::AS}} query  ``

··  `` CREATE {{c2::RECURSIVE VIEW}} view_name({{c3::columns}}) AS query  ``

··  `` CREATE VIEW census.vw_facts_2011 AS  ``

····  `` SELECT fact_type_id, ... FROM
 WHERE yr = 2011;  ``

··  `` WITH {{c4::CHECK OPTION}}  ``

····  `` keep data in view always  ``

··  `` UPDATE {{c5::<view>}} SET val = 1 WHERE val = 0;  ``

··  `` DELETE FROM <view> WHERE val = 0  ``

%

%

active

---

## pgs01: pgs: handy 01

··  `` {{c1::DISTINCT}} ON  ``

··  `` {{c2::LIMIT}} and OFFSET  ``

··  `` {{c3::CAST}}('2011_1_11' AS date)  ``

····  `` '2011_1_1'::{{c4::date}}  ``

··  `` INSERT INTO
 (<cols>)  ``

····  `` {{c5::VALUES}}  ``

······  `` (<row1>),  ``

······  `` (<row2>);  ``

%

%

active

---

## pgs01: pgs: handy02

··  `` SELECT .. WHERE <col1> {{c1::ILIKE}} '%duke%'  ``

··  `` DELETE FROM census.facts  ``

····  `` {{c2::USING}} census.lu_fact_types As ft  ``

····  `` {{c3::WHERE}} facts.fact_type_id = ft.fact_type_id AND ft_short_name = 's01'  ``

··  `` UPDATE census.lu_fact_types AS f  ``

····  `` {{c4::SET}} short_name = ..  ``

····  `` {{c5::WHERE}} ..  ``

····  `` {{c6::RETURNING}} fact_type_id, short_name  ``

%

%

active

---

## pgs01: pgs: handy 03

··  `` SELECT x FROM census.lu_fact_types As x {{c1::LIMIT}} 2;  ``

··  `` SELECT {{c2::array_to_json}}({{c3::array_agg}}(f)) As cat FROM (  ``

····  `` SELECT MAX(fact_type_id) As max_type, category FROM census.lu_fact_types  ``

····  `` GROUP BY category  ``

····  `` ) As f  ``

··  `` SELECT student,  ``

······  `` AVG(score) {{c4::FILTER}} ({{c5::WHERE}} subject ='algebra') As algebra,   ``

······  `` AVG(score) FILTER (WHERE subject ='physics') As physics  ``

····  `` FROM test_scores   ``

····  `` GROUP BY student;  ``

%

%

active

---

## pgs01: pgs: window ex 01

··  `` SELECT tract_id, val, {{c1::AVG}}(val) {{c2::OVER}} () as val_avg  ``

····  `` FROM census.facts  ``

····  `` WHERE fact_type_id = 86;  ``

··  `` SELECT tract_id, val, AVG(val) OVER ({{c3::PARTITION BY}} {{c4::left}}(tract_id,5)) as val_avg_county  ``

····  `` FROM census.facts  ``

····  `` WHERE fact_type_id = 86 ORDER BY tract_id;  ``

··  `` SELECT {{c5::ROW_NUMBER}}() OVER ({{c6::ORDER BY}} tract_name) As rnum, tract_name  ``

%

%

active

---

## pgs01: pgs: window ex 02

··  `` SELECT   ``

····  `` ROW_NUMBER() OVER ({{c1::wt}}) As rnum,   ``

····  `` substring(tract_id,1,5) As county_code,  ``

····  `` tract_id,  ``

····  `` {{c2::LAG}}(tract_id,2) OVER wt As tract_2_before,  ``

····  `` {{c3::LEAD}}(tract_id) OVER wt As tract_after,  ``

··  `` FROM census.lu_tracts  ``

··  `` {{c4::WINDOW}} wt AS ({{c5::PARTITION BY}} substring(tract_id,1,5) ORDER BY tract_id)  ``

%

%

active

---

## pgs01: pgs: cte ex 01

··  `` {{c1::WITH}}   ``

····  `` {{c2::cte1}} AS (  ``

······  `` SELECT * FROM <table1>  ``

····  `` ),   ``

····  `` cte2 {{c3::AS}} (  ``

······  `` SELECT * FROM <table2>  ``

····  `` )  ``

····  `` SELECT *  ``

····  `` FROM {{c4::cte1}}  ``

····  `` WHERE ..  ``

%

%

active

---

## pgs01: pgs: recursive cte ex 01

··  `` WITH {{c1::RECURSIVE}} subordinates AS (  ``

····  `` SELECT employee_id, manager_id, full_name  ``

······  `` FROM employees  ``

······  `` WHERE employee_id = 2  ``

····  `` {{c2::UNION}}  ``

····  `` SELECT e.employee_id, e.manager_id, e.full_name  ``

······  `` FROM employees e  ``

······  `` {{c3::INNER JOIN}} {{c4::subordinates}} s ON s.employee_id = e.manager_id  ``

····  `` )   ``

····  `` SELECT * FROM {{c5::subordinates}};  ``

%

%

active

---

## pgs01: pgs: define function 01

··  `` CREATE OR REPLACE FUNCTION func_name(arg1 {{c1::arg1_datatype}} {{c2::DEFAULT}} arg1_default)  ``

····  `` {{c3::RETURNS}} <some type> | set of <some type> | {{c4::TABLE}} (..) AS  ``

%

%

active

---

## pgs01: pgs: define function 02

··  `` CREATE OR REPLACE FUNCTION write_to_log(param_user_name varchar, param_description text)  ``

····  `` RETURNS integer AS  ``

····  `` $$  ``

····  `` INSERT INTO logs(user_name, description) VALUES({{c1::$1, $2}})  ``

····  `` {{c2::RETURNING}} log_id;  ``

····  `` $$  ``

····  `` LANGUAGE '{{c3::sql}}' VOLATILE;  ``

··  `` SELECT {{c4::write_to_log}}('alejandro', 'Woke up') As new_id;  ``

%

%

active

---

## pgs01: pgs: builtin functions 01: between

··  `` a {{c1::BETWEEN}} x AND y  ``

··  `` a <= x AND a <= y  ``

··  `` a {{c2::NOT BETWEEN}} x AND y  ``

%

%

active

---

## pgs01: pgs: builtin functions 02: IS check null

··  `` <expression> IS [NOT] {{c1::NULL}}  ``

%

%

active

---

## pgs01: pgs: builtin functions 03: character funs

··  `` {{c1::char_length}}(string)  ``

··  `` __ length  ``

··  `` {{c2::substring}}(string, int, int)  ``

··  `` __ part of string  ``

··  `` 'thomas' {{c3::~}} '.*thomas.*'  ``

··  `` __ regex match  ``

··  `` {{c4::to_char}}(current_timestamp, 'HH12:MI:SS')  ``

··  `` __ to string  ``

··  `` {{c5::to_date}}('05 Dec 2000', 'DD Mon YYYY')  ``

··  `` __ convert string to date  ``

%

%

active

---

## pgs01: pgs: builtin functions 04: temporals

current date funs:

··  `` {{c1::current_date}}()  ``

··  `` {{c2::current_time}}()  ``

··  `` SELECT {{c3::now}}();  ``

··  `` SELECT {{c4::CURRENT_TIMESTAMP}};  ``

extract:

··  `` {{c5::date_part}}('{{c6::hour}}', timestamp '2011_02_16 20:38:40')  ``

··  `` SELECT {{c7::EXTRACT}}(DAY FROM TIMESTAMP '2001_02_16 20:38:40');  ``

%

%

active

---

## pgs01: pgs: builtin functions 05: case

··  `` SELECT a,  ``

····  `` {{c1::CASE}} WHEN a=1 THEN 'one'  ``

······  `` {{c2::WHEN}} a=2 {{c2::THEN}} 'two'  ``

······  `` {{c3::ELSE}} 'other'  ``

····  `` END  ``

····  `` FROM test;  ``

··  `` __ return first not null argument:  ``

··  `` SELECT {{c4::COALESCE}}(description, short_description, '(none)') ...  ``

%

%

active

---

## pgs01: pgs: builtin functions 06: arrays

··  `` {{c1::array_append}}(ARRAY[1,2], 3)   ``

··  `` {{c2::array_cat}}(ARRAY[1,2,3], ARRAY[4,5])   ``

··  `` array_ndims(ARRAY[[1,2,3], [4,5,6]])··  ``

··  `` {{c3::array_length}}(array[1,2,3], 1)  __ 3  ``

··  `` {{c4::unnest}}(ARRAY[1,2])··  ``

····  `` 1  ``

····  `` 2  ``

····  `` (2 rows)  ``

··  `` {{c5::array_agg}}(expression)   ``

··  `` __ convert any set to array  ``

%

%

active

---

## pgs01: pgs: builtin functions 07: aggregate

··  `` avg(expr)  ``

··  `` {{c1::bool_and}}(expr)  ``

··  `` __ and  ``

··  `` {{c2::bool_or}}(expr)  ``

··  `` __ or  ``

··  `` {{c3::count}}(*)  ``

··  `` __ number of elements  ``

··  `` count(expr)  ``

··  `` max  ``

··  `` min  ``

··  `` sum(expr)  ``

%

%

active

---

## pgs01: pgs: builtin functions 08: window

··  `` {{c1::row_number}}()  ``

··  `` __ row no  ``

··  `` {{c2::rank}}()  ``

··  `` __ row no as ranks  ``

··  `` dense_rank()  ``

··  `` percent_rank()  ``

··  `` {{c3::cume_dist}}()  ``

··  `` __ dist  ``

··  `` ntile  ``

··  `` {{c4::lag}}  ``

··  `` lead  ``

··  `` {{c5::first_value}}  ``

··  `` last_value  ``

··  `` nth_value  ``

····  ``  ``

%

%

active

---

## pgs01: aggregate functions 01

    string_agg(expr, delimiter)
      description: input values concatenated into an {{c1::string}}
    array_agg(expression)
      description: input values concatenated into an {{c2::array}}
    json_agg(expression)
      description: aggregates values as {{c3::json array}}
    json_object_agg(name, value)
      description: aggregates name/value pairs as json object

%

%

clozeq

---

## pgs01: aggregate functions 02

		select movie, STRING_AGG(actor, ', ') as actor_list from tbl group  by 1;
			--> ali, veli, hasan
		select ARRAY_AGG('{a,b,c}'::text[],'{d,e,f}'::text[]);
			--> {{a,d},{b,e},{c,f}}
		select company_id, ARRAY_AGG(employee order by company_id desc)::text from tbl group  by 1;
			--> 1 | {ali, veli}

%

%

clozeq

---

### pgr101: where are postgres conf files?

		SELECT name, setting FROM {{c1::pg_settings}} WHERE category = 'File Locations';
		##>        name        |                 setting
		##> -------------------+------------------------------------------
		##>  config_file       | /etc/postgresql/9.5/main/postgresql.conf
		##>  data_directory    | /var/lib/postgresql/9.5/main
		##>  external_pid_file | /var/run/postgresql/9.5-main.pid
		##>  hba_file          | /etc/postgresql/9.5/main/pg_hba.conf
		##>  ident_file        | /etc/postgresql/9.5/main/pg_ident.conf
		##> (5 rows)

%

%

clozeq

---

### pgr101: start/stop postgres

		sudo {{c1::systemctl}} {{c1::start/start/status}} postgresql

%

%

clozeq

---

repository: mertnuhoglu/study

gha_language: HTML

repo_name: mertnuhoglu/study


text:
![pqcom](pqcom/img/pqcom-logo-expanded.png)
===========================================

[![Build status](https://ci.appveyor.com/api/projects/status/qnaototfk70rc7w5?svg=true)](https://ci.appveyor.com/project/xiongyihui/pqcom)
[![Pypi](https://img.shields.io/pypi/v/pqcom.svg)](https://pypi.python.org/pypi/pqcom)

A simple serial port tool for Linux/Windows/Mac. It's written by Python and Qt (PySide6).

![pqcom](preview/pqcom.png)

### Features
+ auto-detect available serial ports
+ supports all baud rates
+ EOL (End Of Line) can be "\n", "\r", or "\r\n"
+ extra EOL can be appended
+ supports 3 output formats
  1. Normal
  2. Hex: Hex data will be converted
  3. Extend: `\t`, `\r` and `\n` are escape characters, each of them is a single character
+ supports 2 display formats
  1. Normal
  2. Hex: left part displays hex string, right part displays normal string
+ frequently used strings can be saved
+ history is included
+ data can be sent repeatedly
+ keyboard shortcut `Ctrl+Enter` to send data in the TX textedit, `Ctrl+[1~9]` to send stared list item.
+ Support "Stay On Top"

```
+------------------------------------------------------------------+
|                         pqcom                              - + x |
+------------------------------------------------------------------+
| + | > | = | H | X | i |                                          |
+------------------------------------------------------------------+
| |   |   |   |   |   |                                            |
| |   |   |   |   |   +---> Open about dialog                      |
| |   |   |   |   |                                                |
| |   |   |   |   +-------> Clear received message                 |
| |   |   |   |                                                    |
| |   |   |   +-----------> Enable/Disable Hex View                |
| |   |   |                                                        |
| |   |   +---------------> Open settings dialog                   |
| |   |                                                            |
| |   +-------------------> Open/Close serial port                 |
| |                                                                |
| +-----------------------> Open a new window                      |
|                                                                  |
|                                                                  |
|                                                                  |
|                                                                  |
|                                                                  |
|                                                                  |
+------------------------------------------------------------------+
|                                                                  |
|  Keyboard Shortcut                                               |
|      Ctrl + Enter: Send                                          |
|                                                                  |
+------------------------------------------------------------------+
| + Normal | O Hex | O Extended | * | History |  | # Repeat | Send |
+------------------------------------------------------------------+

```

### Requirements

-	python
-	pyserial
-	pyside6

### Installation

-	Linux/Mac

	1. install pyqt5
	2. use pip to install pqcom - `pip install pqcom`

-	Windows

	Download it from [Google Drive](https://drive.google.com/open?id=0BwQmZU7Kqh7RR3JCRWUzLWhlb28) or [Baidu Pan](http://pan.baidu.com/s/1ski1RUt).

The icons are from [KDE Plasma Breeze Icons](https://github.com/NitruxSA/plasma-next-icons/)

repository: xiongyihui/pqcom

gha_language: Python

repo_name: xiongyihui/pqcom


text:
WordPress no js socialshare
====================

A WordPress plugin to allow you to share your content with social networks without needing JavaScript

This is based largely on some work I have done here: http://tosbourn.com/replacing-social-media-share-buttons-with-non-javascript-counterparts/

repository: tosbourn/wp-no-js-socialshare

gha_language: PHP

repo_name: tosbourn/wp-no-js-socialshare


text:
# POLLib

PHP library developed in [ParsOnline data center][1].

This library was developed by me and my colleagues over time by extracting shared functionality between internal applications developed in ParsOnline. ParsOnline released the library as an open source project.

The project includes a loosely coupled set of modules useful for a variety of general use tasks and are not bound to or related to business logic of ParsOnline applications.
The ZF name space is used for those modules that were used by applications based on [Zend Framework][2] (version 1.x) and require the framework libraries to be available.

## Modules in brief

 * Common: data models to represent hosts and domains and servers.
 * Converter: Helper classes to create different format of string representation.
 * Exception: A set of useful exception classes. All the modules in this library use these exceptions.
 * File operations: High level and easy to use file operations
 * Html: Utility to fetch HTML files with their resources, and a class to create HTML tables with pagination and sorting.
 * Iterator: Sample directory iterator implementations to iterate over all videos in a directory.
 * Network: High level well designed and easy to use classes for SSH2, FTP and Telnet.
 * Parser: Utilities to parse data from domain whois information, HTML, and syslog messages.
 * Streams: Easy to use class to fetch data over streams (files, sockets, etc), a stream wrapper that uses curl:// scheme to proxy requests through cURL library, and a SOAP client that extends PHP internal SOAP client and uses this stream wrapper to use cURL for SOAP calls. This overcomes the shortcomings of PHP internal SOAP client to use services that require NTLM authentication.
 * System: Easy to use and high level classes to get system information, execute processes and create a process pool.
 * UserSession: A full session handling code implemented, could be used to manage sessions for web services.
 * Utils: High level array functionality.
 * ZF: Zend Framrwork specific modules that provide application resources, controller plugins, view helpers, advanced email validator, a powerful data mapper to connect data models to RDBMS using Zend\_Db. An extended Zend\_Form with element modifiers and more.

## Examples

### Parsonline_Network_Telnet

Using the telnet client follows this process:

 * instantiate a telnet client object (might pass configuration options to constructor as an array)
 * extra configurations using setter methods
 * connecting
 * writing commands and reading responses
 * disconnect

```php
<?php
require_once("Parsonline\Network\Telnet.php");
require_once("Parsonline\Network\Telnet\Exception.php");

$telnet = new Parsonline_Network_Telnet("<IP_ADDRESS>"); // use any hostname or IP address instead of <IP_ADDRESS>
$telnet->setPort(23); // If you want to connect to TCP ports other than Telnet default (23), (optional)
$telnet->setConnectionTimeout(60); // if you want to change the connection timeout (optional)
$telnet->setPrompt(">>>"); // this is the prompt string of the remote device. this will help telnet library to detect if output of previous command is finished and reached to the command prompt or not.

try {
    $telnet->connect();
    $telnet->write("command to execute on host"); // send the command to be executed on remote host
    $response = $telnet->waitForPrompt(); // read output of the command from remote host
    $telnet->disconnect();
} catch (Parsonline_Network_Telnet_Exception $e) {
    // handle connection or IO error
    $telnet->disconnect();
    die("Error occurred: " . $e);
}
```

[1]: http://www.parsonline.net/en/
[2]: http://framework.zend.com/

repository: farzadghanei/POLlib

repo_name: farzadghanei/POLlib


text:
#Followers

Channel followers can have different roles.

Role       | User sees      | Description
-----------|----------------|-------------
`owner`    |`owner`         |add/remove moderators
`moderator`|`moderator`     |approve subscription requests & delete posts
`publisher`|`follower+post` |create posts
`member`   |`follower`      |only view posts
`pending`  |`pending`       |nothing
`outcast`  | `null`         |only visibile to the `owner` and `moderator` roles.

The `outcast` role is useful for dealing with abusive users.

Once a user is `outcast`, they can no longer post or generate subscripion requests to that channel. Only the channel's `owner` and `moderator`s can view users with the `outcast` role.

<aside class="warning">
Users follow channels. You should never see a _topic_ channel with the metadata `channeltype=topic` following a channel.
</aside>

##Fetch Followers

```shell
#GET https://demo.buddycloud.org/api/{channelId}/subscribers/{nodeId}

curl<EMAIL_ADDRESS>\
     -X GET \
     -u romeo@buddycloud.org:juliet-forever \
     -H "Content-Type: application/json"

#Response would be as follows:

200 OK
Content-Type: application/json

{
<EMAIL_ADDRESS>"owner",
<EMAIL_ADDRESS>"publisher"
}
```

```javascript

```

This request returns a list of channel followers and their role in the channel.

Public channels | Private Channels
----------------|------------------
Return the list without authentication | requesting user must also be an `owner` `moderator` `publisher` or `member` of the channel

???we really need a way to query by role type - eg show me just the moderators of this channel???

##Retrieve Pending Followers

```shell
#GET https://demo.buddycloud.org/api/{channelId}/subscribers/{nodeId}/approve

curl<EMAIL_ADDRESS>\
     -X GET \
     -u romeo@buddycloud.org:juliet-forever \
     -H "Content-Type: application/json"

#Response would be as follows:

200 OK
Content-Type application/json

[
    {
        "subscription": "subscribed",
        "jid"<EMAIL_ADDRESS>    },
    {
        "subscription": "pending",
        "jid"<EMAIL_ADDRESS>    },
    {
        "subscription": "pending",
        "jid"<EMAIL_ADDRESS>    }
]
```

```javascript

```

Retrieves the list of subscriptions of a node. Returns a list of objects containing the subscriber JID and the values of its subscription state (`subscribed` or `pending`).

Subscription State | Description
-------------|--------------
`pending`    | No action taken by `owner` or `moderator`.
`subscribed` | Permission to follow channel granted.
`none`       | Permission to follow channel denied.

 By setting a subscription to `outcast`, the user is banned.


text:
Exercise 2 - Theory questions
-----------------------------

### What is an atomic operation?
> Atomic operations are program operations that run completely independently of any other processes.

### What is a critical section?
> Is a segment of code where shared variables can be accessed and can't be executed by more than one thread at the same time.

### What is the difference between race conditions and data races?
> Data race is when two instructions from different threads access the same memory location.
  Race condition occurs when a program depends on the timing of one mor multiple processes to function correcly, if a thread     finishes at an unexpected time, it might cause an error.

### What are the differences between semaphores, binary semaphores, and mutexes?
> Semaphore is a variable that is non-negative and shared between threads.
  Binary semaphore only have the value 0 or 1, which are used for implementing locks by signalling for acheving mutual           exclusion.
  Mutex provides that only one thread can enter into critical section at a time.

### What are the differences between channels (in Communicating Sequential Processes, or as used by Go, Rust), mailboxes (in the Actor model, or as used by Erlang, D, Akka), and queues (as used by Python)?
> Channels are a model for interprocess communication and synchronization. The messages will be sent over a channel, and then a another thread is able to receive that message.
Queues provides a FIFO implementation for mutli-treaded programming. Queue is used for passing messages or data safely.
### List some advantages of using message passing over lock-based synchronization primitives.
> Message passing algorithms tend to be simpler.
  Avoids problems as deadlock, but can problems may appears anyway.

### List some advantages of using lock-based synchronization primitives over message passing.
> It is faster than message passing.

license: Unlicense


text:
# CopEnt.jl: Copula Entropy in Julia

This package is a Julia fork of the original author's R package ([copent](https://github.com/majianthu/copent)) and the Python package ([pycopent](https://github.com/majianthu/pycopent))

## WARNING

The function `copula_entropy` in the package *indeed* returns the copula entropy instead of the negative copula entropy, which is done by the corresponding `copent` function in copent or pycopent.

## Example

```julia
using Distributions, CopEnt
ρ = 0.6
μ = zeros(2)
Σ = [1 ρ; ρ 1]
x = rand(MvNormal(μ, Σ), 2_000)
mi = -copent(x) # this gives us 0.1849467947096306
                # true value is 0.2231435513142097
```

Also see the [example notebook](docs/example.ipynb) for some visualizations.


text:
# ior
Bindings for liburing. These bindings are not intended to be safe, or
to replace the built-in ways of doing IO in Crystal. Rather this is
intended to be the base other libraries and applications use so that
they can accomplish that.

## Installation

0. Install liburing ( https://github.com/axboe/liburing ) and a recent Linux kernel.

1. Add the dependency to your `shard.yml`:

   ```yaml
   dependencies:
     ior:
       github: yxhuvud/ior
   ```

2. Run `shards install`

## Usage
The basic abstraction is the uring. A uring consists of a submission
queue and a completion queue. A user writes to the submission queue
and reads from the completion queue. An instance can be created by
calling `IOR::IOUring.new` (there is also a block version available).

Operations on a ring include:

* `ring.submit`: Submits the currently unsubmitted events in the submission
queue. Multiple events can be submitted at once.

* `ring.wait`, `ring.wait(n)` : Wait until there is at least one (`n`) entry in the
completion queue. Then it returns the first of those.

Both variants supports a timeout parameter.

* `ring.submit_and_wait(n = 1)`: Do both submit and wait at once

* `ring.peek`, `ring.peek(buf)`: If there is an unprocessed entry in the submission queue,
return it. Otherwise return `nil`.

If a block is supplied, then the entry will be yielded and then marked
as seen.

If a block and buffer is supplied, then peek will fill as much of the
buffer with completed entries as possible and then yield them and mark
them as seen.

* `ring.seen(cqe)`: Marks the given completion queue event as seen.

* `ring.sqe`, `ring.sqe!`: Fetches a submission queue event. Note that
  it can return `nil` if submission queue is full.

  The following operations are then supported to configure the sqe.
  See `sqe.cr` for detailed parameter options.

  * `sqe.nop`: Submit an event and get it back in the completion
    queue, without actually doing anything.
  * `sqe.read`, `sqe.write`: Reads and writes. Same as `read` and `write` syscalls.
    If no offset is provided it will read from current position.
  * `sqe.readv`, `sqe.writev`: Vectored writes. Same as `readv` and
    `writev` syscalls.
  * `sqe.fsync`: File sync. Same as `fsync` syscall, but note that the
                queue doesn't promise to handle events in order, by
                default.
  * `sqe.poll_add`: Similar to `poll` and `epoll`.
  * `sqe.send`, `sqe.recv`: Similar to `send` and `recv` syscalls.
  * `sqe.sendmsg`, `sqe.recvmsg`: Network read/write. Same as
    `sendmsg` and `recvmsg` syscalls.
  * `sqe.splice`: Similar to `splice` syscall.
  * `sqe.timeout`: Wait until the specified amount of events have
    completed, or until the given time has elapsed.
  * `sqe.link_timeout`: Timeout the previous op. Requires the `io_link`
    flag to be set in previous message.
  * `sqe.timeout_remove`: Remove a previously specified timeout.
  * `sqe.async_cancel`: Cancel a previously submitted operation (identified by userdata).
  * `sqe.accept`, `sqe.connect`: Similar to `accept` and `connect` syscalls.
  * `sqe.fallocate`: Similar to `fallocate` syscall.
  * `sqe.openat`: Similar to `openat` syscall.
  * `sqe.close`, `sqe.shutdown`: Similar to `close` and `shutdown` syscalls.
  * `sqe.renameat`, `sqe.unlinkat`: Similar to `renameat` and `unlinkat` syscalls.
  * `sqe.files_update`: Update the list of registred files. Similar to
    `#register_files` on the ring, but async.

  All SQEs supports the following options:
    * `fixed_file` : Use one of the previously registered files. See `IOR::IOUring#register_files`.
    * `io_drain`: Process all other entries in the ring before processing this.
    * `io_link`: If this is set, then the next event will not be
      started before the processing of this even is done.
    * `io_hardlink`: Same as above but different. See `man` pages for description.

  See https://github.com/yxhuvud/ior/blob/master/src/ior/sqe.cr and
  `man io_uring_enter` for details.

* `ring.close`: Tear down the ring.

* `ring.register_files`, `ring.unregister_files`: In addition to
working with normal file descriptors, IOUring can avoid the cost of
setting up internal structures for each and every call by registering
a list of files in advance. To make use of these files, the submission
queue event (sqe) must have the `fixed_file` flag set.

* `ring.sq_ready`: Shows how many unsubmitted events are present in the submission queue.

* `ring.space_left`: Shows how many more events can be sent before `submit` is necessary.

* `ring.cq_ready`: Shows how many events are waiting in the completion queue.

* `ring.unsubmitted?`: Returns true if there are any unsubmitted events.

* `ring.full_submission_queue?`: Returns true if the submission queue
  needs to be submitted.

Example:
```crystal
require "ior"

fh = File.open(".test/readv")
buf = Slice(UInt8).new(32) { 0u8 }
vec = LibC::IOVec.new
vec.base = buf.to_unsafe
vec.len = buf.size
iovecs = Slice(LibC::IOVec).new(1, vec)

# First create a ring:
ring = IOR::IOUring.new

# Set up a submission queue event. Multiple submissions can be sent
# out at once. They will be executed in undefined order by default,
# but it is possible to define the order if need be.

# The user_data field that is set is also set on the corresponding
# completion event, and can for example contain a pointer to something
# that instructs the program on how to handle the result.
ring.sqe.readv(fh, buf, 0, user_data: 4711)

# Then tell the kernel about it. This is a syscall that doesn't block.
ring.submit

# Then wait for the result. This will return immediately without
# having to do any syscall if there is already events ready to
# consume, and if not it will block until there is at least one event
# ready.

# wait returns an event from the completion queue.
cqe = ring.wait

# These contain the user_data and and result from the call. In this
# case the content of the file.
string = String.new(buf[0, cqe.value.res])
cqe.value.user_data # => 4711

# When processed a completion event should be marked as consumed:
ring.seen(cqe)

# Cleanup:
fh.close
ring.close
```

## Read more
Additional resources can be found in the `man` pages, and at
https://kernel.dk/io_uring.pdf or https://github.com/axboe/liburing .

## Development
See installation instructions. Additionally some specs need the
`-Dpreview_mt` flag set or they will block forever.

## Contributing

1. Fork it (<https://github.com/yxhuvud/ior/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

## Contributors

- [Linus Sellberg](https://github.com/yxhuvud) - creator and maintainer

repository: yxhuvud/ior

repo_name: yxhuvud/ior


text:
---
sidebar: auto
---

# Examples

A few examples are available on [Glitch.com](https://glitch.com/@marcelle.crew/marcelle-examples).

## Basic dashboard

A project implementing a simple image classifier using Mobilenet embeddings for feature extraction and a Multilayer perceptron for classification. The application allows you to record examples, train the model and test its performance, and play with real-time image classification.

[Edit on Glitch](https://glitch.com/~marcelle-v2-dashboard)

![Screenshot of an example marcelle Application](./images/marcelle-dashboard.png)

## Model comparison

An extension of the previous example featuring a dashboard dedicated to model comparison. The application allows to train and evaluate two models in parallel: a MLP and a KNN.

[Edit on Glitch](https://glitch.com/~marcelle-v2-mlp-vs-knn)

![Screenshot of an example marcelle Application](./images/marcelle-mlp-vs-knn.png)

## Wizard

With an image recognition scenario similar to [the first example](#basic-dashboard), except that instead of a dashboard, the application features a step-by-step guide using a Wizard.

[Edit on Glitch](https://glitch.com/~marcelle-v2-wizard)

![Screenshot of an example marcelle Application](./images/marcelle-wizard.png)

## Sketching

An incremental learning example where users can build a sketch recognizer from their own drawings. This example illustrates how to program alternative workflows.

[Edit on Glitch](https://glitch.com/~marcelle-v2-sketch)

![Screenshot of an example marcelle Application](./images/marcelle-sketch.png)

## Model Testing

A prototype dedicated to the interactive testing of a pre-trained model (in this case Mobilenet). The dashboard allows the user to upload images and inspect the associated predictions.

[Edit on Glitch](https://glitch.com/~marcelle-v2-testing)

repository: piptouque/marcelle

repo_name: piptouque/marcelle


text:
# PostIT client

These are the setup instructions for the client application for PostIT. This is a React application. You can start a development server by doing the following:

1. Navigate to the `postit-client` folder on the terminal/command prompt
2. Run the command `npm install` to install all required dependencies
3. Create a new file called `.env` in the root directory of `postit-client` (or use an existing one)
4. If you don't have a set of vapid keys, use [web-push](https://www.npmjs.com/package/web-push) to generate these. Follow the tutorial in the file `generate_vapid_keys.md`.
5. Set the following environment variables in this file:

| Variable | Context |
|----------|---------|
REACT_APP_SERVER_PORT=3010 | Port of the PostIT server
REACT_APP_SERVER_URL=localhost | URL of the PostIT server
REACT_APP_SERVER_PROTOCOL=http | Protocol of the PostIT server
REACT_APP_OWN_URL=http://localhost:3000 | The URL that the client is being served on
REACT_APP_ENV=dev | Environment that the app is running in, can be dev or prod and has impact on the CORS settings when sending requests to the server, devtools and logging
REACT_APP_MAX_IMAGE_SIZE=1000000 | 1000000 = 1mb, max image size for uploading images to the Postit server
VAPID_PUBLIC_KEY=345tgf | Needed for notification support, used for authenticating with the PostIT server when using web-push. The public key you generated earlier

5. When all env variables are set, run the command `npm start` while still in the `postit-client` folder

You're done! You can access your development server via the URL displayed in the console.

# PostIT server

This is the server application for PostIT. This is a NodeJS Express application. You can start a development server by doing the following:

1. Navigate to the `postit-server` folder on the terminal/command prompt
2. Run the command `npm install` to install all required dependencies
3. Create a new file called `.env` in the root directory of `postit-server` (or use an existing one)
4. If you don't have a set of vapid keys, use [web-push](https://www.npmjs.com/package/web-push) to generate these. Follow the tutorial in the file `generate_vapid_keys.md`.
5. Set the following environment variables in this file:

| Variable | Context |
|----------|---------|
DB_URL=databaseurl.com | URL of the MongoDB database server
DB_PORT=27017 | Port of the MongoDB database server
DB_USER=username | Username to authenticate with the database. Can be omitted for MongoDB database servers without authentication
DB_PASSWORD=secretpass | Password to authenticate with the database. Can be omitted for MongoDB database servers without authentication
DB_NAME=postit | Name of the database that the server should use
DB_AUTH=admin | Authentication database for the username and password. Can be omitted if the server does not have any authentication
DB_SRV=true/false | Toggle srv for the MongoDB server. Required for Mongo Atlas to be true
APP_PORT=3010 | Port that the server should listen on
SECRET_KEY=C6HS@+RhbJL7E{^c | Encryption key used for the session parser
EMAIL_HOST=smtp.gmail.com | SMTP server for sending e-mails
EMAIL_PORT=587 | Port that is used for the SMTP server
<EMAIL_ADDRESS>| E-mail address that is used for authenticating with the SMTP server and sending e-mails
EMAIL_PASSWORD=password | Password for the SMTP server
EMAIL_BASE_URL_TO_PAGE=https://url.com | URL used to link to the client application from e-mails
IMAGE_SERVER_URL=localhost | URL of the image server, this directs the client to the right server for getting images (for when you want to use a seperate server for storing images, currently points to the API server)
IMAGE_SERVER_PORT=3010 | URL of the image server, this directs the client to the right server for getting images (for when you want to use a seperate server for storing images, currently points to the API server)
IMAGE_SERVER_PROTOCOL=http | Protocol to communicate with the image server
IMAGE_MAX_SIZE_IN_MB=5 | Max size of images being uploaded to this server
<EMAIL_ADDRESS>| Required for web push, contact e-mail
VAPID_PUBLIC_KEY=234dswf | Needed for notification support, used for authenticating with the PostIT client when using web-push. The public key you generated earlier
VAPID_PRIVATE_KEY=234kb | Needed for notification support, used for authenticating with the PostIT client when using web-push. The private key you generated earlier

6. When all env variables are set, run the command `npm start` while still in the `postit-server` folder

You're done! You can access your development server via http://localhost:3000.

repository: goingjulian/PostIT

gha_license_id: NOASSERTION

repo_name: goingjulian/PostIT


text:
# Mango

Mango is an application process tracking and measurement service especially useful for tracking distributed systems and services.

## Installation

Mango currently supports ZMQ as its RPC mechanism. The following installation assumes you have composer installed.

    $ git clone git://github.com/phpfour/mango.git
    $ cd mango
    $ composer install

Once the components are downloaded, run the server using the following command:

    $ cd scripts
    $ ./server.php

In a separate terminal, run the following to see it in action:

    $ cd scripts
    $ ./client.php

The messages should appear in your local MongoDB server, within a database called "mango".

## Roadmap

* YAML based configuration
* REST based API
* More storage backend (MySQL, Redis)
* Metrics (Statsd)
* Silex based web app

repository: kananMahmud/mango

repo_name: kananMahmud/mango


text:
# Rapid7VmConsole::ScanTemplateServiceDiscoveryUdp

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additional_ports** | **Array<Object>** | Additional UDP ports to scan. Individual ports can be specified as numbers or a string, but port ranges must be strings (e.g. `\"7892-7898\"`). Defaults to empty. | [optional]
**excluded_ports** | **Array<Object>** | UDP ports to exclude from scanning. Individual ports can be specified as numbers or a string, but port ranges must be strings (e.g. `\"7892-7898\"`). Defaults to empty. | [optional]
**links** | [**Array<Link>**](Link.md) | Hypermedia links to corresponding or related resources. | [optional]
**ports** | **String** | The UDP ports to scan. Defaults to `well-known`. | [optional]

repository: ewb-infosec/vm-console-client-ruby

repo_name: ewb-infosec/vm-console-client-ruby


text:
# kryo-tools

These are shared classes enabling and supporting Kryo serialization and deserialization in a couple of projects (OpenTripPlanner and Conveyal R5).

In package `com.conveyal.kryo` we define some custom serializers for Guava and Trove collections which are used in both projects. This introduces transitive dependencies on Trove, Guava, and Kryo itself.

The package `com.conveyal.object_differ` contains library classes that check whether two Java object graphs are identical, for use in serialization round-trip tests. This diffing functionality is actually independent of Kryo and should remain so, but we only use it in serialization tests so it's bundled here with Kryo serializers in a single module.

This performs a semantic equality check between two object graphs in Java. This is intended for use in testing that a round trip through serialization and deserialization reproduces an identical transportation network representation, and that the processs of building that transportation network is reproducible. A system that can do a generalized semantic comparison of any tree of objects is quite complex. Here we try to implement only the minimum feature set needed for our use case in serialization tests.

This code used to be embedded in the R5 project but is now a separate Maven / Git project so that it can be reused in
multiple projects, starting with OpenTripPlanner/opentripplanner and conveyal/r5. The object differ started out as a copy of the one supplied by @csolem via the Entur OTP branch at
https://github.com/entur/OpenTripPlanner/tree/protostuff_poc but has been mostly rewritten at this point.

It would be possible to factor the object differ out into a separate project, allowing it to be used without depending on a specific version of Kryo. However, the object differ depends on Guava and Trove (as it takes special steps to compare types defined by those libraries), and the Kryo serializers are also for Guava and Trove types. Splitting into two projects would require us to keep the Guava and Trove dependencies in sync and across these two tiny libraries and in all client projects, in addition to the usual effort of tagging and signing releases etc. For this reason, we've always made a well-considered decision not to split them into two projects.

## Usage

To use kryo-tools in a Maven project include the following dependency:

```XML
<dependency>
    <groupId>com.conveyal</groupId>
    <artifactId>kryo-tools</artifactId>
    <version>1.4.0</version>
    <scope>test</scope>
</dependency>
```

To use it in a Gradle project include the following dependency:

`implementation 'com.conveyal:kryo-tools:1.4.0`

Or if using it only in tests:

`testImplementation 'com.conveyal:kryo-tools:1.4.0`

This project was renamed from object-differ when serializers were added, so artifacts with versions 1.0 and 1.1 exist with that name.

TODO: configuration and usage information, testing on complex objects within OTP.

## Using object-differ with Java 11+ Modules

The object differ works by reflection, which is by default not allowed under the Java module system. Applications
depending on the kryo-tools object differ will not work without some adjustments. Rather than simply opening large
amounts of classes to reflection all the time, a more targeted solution is to add exceptions only when running your
tests (since object-differ is only really intended for testing and not needed during normal program execution). See
this article:

https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html#white-box-modular-testing-with-extra-java-command-line-options

In Gradle this might look like:
```Groovy
test {
    useJUnitPlatform()
    jvmArgs = ['--add-opens=java.base/java.io=ALL-UNNAMED',
               '--add-opens=java.base/java.time=ALL-UNNAMED',
               '--add-opens=java.base/java.time.zone=ALL-UNNAMED',
               '--add-opens=java.base/java.lang=ALL-UNNAMED']
}
```

In Maven:
```xml
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.0.0-M7</version>
    <configuration>
        <!-- we have to fork the JVM during tests so that the argLine is passed along -->
        <forkCount>3</forkCount>
        <!-- enable the restricted reflection under Java 11 so that the ObjectDiffer works
             the @{argLine} part is there to allow jacoco to insert its arguments as well
        -->
        <argLine>
            @{argLine}
            -Xmx2G
            -Dfile.encoding=UTF-8
            --add-opens java.base/java.io=ALL-UNNAMED
            --add-opens java.base/java.lang=ALL-UNNAMED
            --add-opens java.base/java.math=ALL-UNNAMED
            --add-opens java.base/java.net=ALL-UNNAMED
        </argLine>
    </configuration>
</plugin>
```

repository: conveyal/kryo-tools

gha_language: Java

repo_name: conveyal/kryo-tools


text:
# Nano Gestures

This is a minimalistic mouse gesture WebExtension supporting four basic gestures:

1. Hold right mouse button + drag left
2. Hold right mouse button + drag right
3. Hold right mouse button + drag up
4. Hold right mouse button + drag down

The gestures can also be modified by the `ctrl` key, yielding a maximum of 8 distinct possible assignable actions.

Gesture assignment is fully configurable. The following actions are currently supported:

1. Navigate back
2. Navigate forward
3. Create a new tab
4. Reload current page
5. Close current tab
6. Switch to left tab
7. Switch to left tab (skip special pages)
8. Switch to right tab
9. Switch to right tab (skip special pages)
10. Restore last closed tab

# Installation

* **Chrome**: [Chrome Web Store](https://chrome.google.com/webstore/detail/jmiagganalpdjkbgmmhjmpckacldiegp).
* **Firefox** (58+): [Mozilla add-on Repository](https://addons.mozilla.org/en-US/firefox/addon/nano-gestures/).

repository: sharpsteve/NanoGestures

repo_name: sharpsteve/NanoGestures


text:
# Role Name

This role is used for smoketest.

# Requirements

The prerequisite for this role is to have DUT with OPX installed and have optic in one of the port.

# Role Variables

The role variable file is defined in vars/main.yml. The file and the description of each variable is defined below.

```
test_route1:    <IP_ADDRESS>
test_route2:    <IP_ADDRESS>
test_mac   :    00:11:22:33:44:55
test_vlan  :    100
test_prefix:    24
test_cps_prefix: 32
test_route2hex: 14000000
test_via:       <IP_ADDRESS>
```
* `test_int,test_int1` defines the interfaces used for smoketest
* `test_route1,test_route2` defines the IP addresses used to verify/configure
* `test_mac` defines the variable used for L2 functionality test in smoketest
* `test_vlan` defines the VLAN used for L2 functionality in smoketest
* `test_prefix` defines the variable used for prefix length used for L3 test in smoketest
* `test_cps_prefix` defines the variable used for host prefix check for L3 test in smoketest
* `test_route2hex`defines the variable used for converted IP address to hexadecimal value to check on CPS get
* `test_via` defines the Static route variable
* `test_mgmtint` defines the Management interface

# Dependencies

DUT with OPX installed and have optic in one of the port.

# Example Playbook

1host is the group created in `/etc/ansible/hosts` file which has DUT mentioned.

```
- hosts: 1host
  gather_facts: false
  pre_tasks:
    - setup:
  become: true
  roles:
    - {role: General/roles/smoketest, tags: ['smoketest']}
```
# TestCases

* Disable the logging on to syslog
* Dump the management interface
* Dump the kernel routing table
* Check the opx-cps service is up
* Check the redis-server service is up
* Check the opx-pas service is up
* Check the opx-nas service is up
* Check the number of ports present with respect to the platform
* CPS get on the base-pas entity to check platform-related entities
* CPS get on the base-pas chassis to check burned MAC address
* Check the opx-acl-init service is up
* Check the opx-qos-init service is up
* Configure static route from kernel using "ip route" and check the route is programmed on the kernel
* CPS get on NAS to check whether the static route gets programmed on NAS
* Unconfiguring the static route in kernel
* Configure static MAC entry with VLAN using CPS Set
* Verify the MAC entry is present in NAS by using CPS Get
* Delete the static MAC entry with VLAN using CPS Set
* Verify the MAC entry is deleted in NAS by using CPS Get
* Add VLAN with untagged ports using CPS Set
* Verify VLAN with untagged ports on NAS using CPS Get
* Update the untagged ports on VLAN using CPS Set
* Verify the VLAN with updated ports on NAS using CPS Get
* Delete the VLAN using CPS set
* Verify the VLAN is removed from NAS using CPS Get
* Verify the system is up and running using systemctl is-system-running
* Verify the failed services using systemctl --all --state=failed list-units
* Dump the packages installed using apt-list --installed
* Verify the power supply, fan, and so on using opx-show-env which uses CPS Get
* Verify the media/optics present on the system using opx-show-transceivers which uses CPS Get

# License

BSD

# Author Information

Madhusudhanan Santhanam -<EMAIL_ADDRESS>

repository: open-switch/opx-test

repo_name: open-switch/opx-test


text:
---
layout: post
title: Fight like dogs, hunt like a pack
published: true
categories: startup
section: thoughts
---

That's the first rule for your startup if you are starting up with few friends. And there are few simple reasons for this, I learned it hardway, I think I should spell out. We started CodeIgnition with friends, few of them stayed, few of them disagreed, but the way we reached some decisions, it was not a nice journey, all of us could have dealt with it in a better fashion. Well, we are learning...

## Everyone has an agenda
If they don't they there is no reason that they will work with you. If they have come together and if you have brought them together, both of you or everyone of your have some agenda, spend time to understand that.

## There is a hierarchy
Ofcourse there is, within partners, among partners, among shareholders, make it clear, understand and adhere to it. If you are challenging the status quo, make sure that you have an action plan to challenge the status quo, you must have an idea which is inclusive, which is better in terms of what can be done next.

## Authority is earned, not taken
Many a times, partners think that they should have a say in a business, well that's true, but you know what - it's not as easy as it seems, there are always misunderstanding around what's going on. Earn that authority to question something, earn the authority to make sure that you can take that baton and move ahead with it. Eg, questioning finances to partners is not a right thing, instead ask the accountant, if accounts are not shared, figure out how can they be shared, may be your partner did not get time? help him with that - but not questioning his/her authority but being an assistant to achieve that transparency.

## Play your role
Ask the question, what's your role as co-founder? You are a technology guy, but as a co-founder what's your role apart from being co-founder, people can play multiple roles, and your leading partner might be playing those, but if you are not playing more than your role as developer or business analyst, then what are you expecting your leading partner to do?

## Empathy
Sit and discuss your problems, this really goes a long way, if you don't understand your partners, their issues, their expectations from you, then what are you expecting? what are you dealing with? what are you looking forward to?

## Figure out your shares
Not in equal terms, but realise where you are, ask questions - can you do this business alone? well more than that, can you start this business alone and bring it where it is? Can your partner do this alone and bring it to state where it is? If both answers are yes, then go ahead and do equal partnership, but if one of the answer is yes, then you know you are not equal partner, rememebr and respect that fact. And when getting these numbers, you might think it does make huge difference, but listen to your heart, figure out what's right and move on.

## Ask your existence
Ask for your existence in the company, the company changes rules over the period of time, time changes everything. If that's changed over period of time and made you uncomfortable, then ask this question again and again. You should collectively with help of your partners try to find the answer. Keep asking this to yourself every 6 months.

## Don't take it to heart
Life is too short to get angry on people. Life is way too short to loose friends, have a clear demarcated line between personal and professional life. Friends comes together for personal reasons, but they might leave for professional reason, so why should personal life suffer?

## What brings you together, may not keep your together
People look for common interests and then work together, but working together has many more challenges, working together means giving up lot of freedom for people. Look for reasons to stay together and stay together. If you can't figure it out what do you want to do next, see if that's possible within current framework, if not then only look for other options. The chances are you will just stay!

## Fight like Dog, hunt like a pack
Wild dogs have amazing synchronised hunt, they play their small or big role beautifully, startup is like that, but they fight among themselves in show of strength and put a social hierarchy into system. We can learn from them, there are many thing we can take to practical implementations

* when in doubt, ask a question.
* don't worry that some one will feel bad, there is chance that you might be assuming something wrong?
* don't assume anything, walk straight up and talk
* publish your agenda, discuss that
* if you don't agree, put your thoughts infront, but not on the cost of business
* communicate, as much as you can do
* build up your strengths, work towards it


text:
# MinecraftDataExtractor

This tool it useful to dump every Minecraft data like blocks ID and his blockstates, items, translations, ...

MinecraftDumper require Java 8 or upper.

# Command

    -version <version> : Minecraft version (ex: 1.13, last) default: last
    -out <dir> : Output directory, default: Minecraft

# Data extracted
* blocks (ID and blockstates)
* items
* entities
* languages
* advancements
* loot tables
* recipes
* structures (.nbt)
* tags
* effects
* enchantments
* particles
* sounds (sound definition, not sound files)

repository: Mondemen/MinecraftDataExtractor

repo_name: Mondemen/MinecraftDataExtractor


text:
Backtory Storage PHP SDK
==========================

# installation:
with composer:

``composer require backtory/storage-php``

# usage:
# exception handling

repository: backtory/storage-php

repo_name: backtory/storage-php


text:
[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
## CPEForWanZ
CPEForWanZ is a **CPE 410 Project** that follows the following criteria:

* Generate a program that will incorporate the following details (in any code platform)
* Accepts any character input (minimum of 10 to infinity) that will initially translates into its equivalent binary data (ASCII/EBCDIC)
* Another number system translation of choice
* Accepts the concepts of endians
* Graphical plot/illustration of any digital signal-to-digital data encoding scheme:

    * Manchester Encoding (required)
    * Bipolar NRZL
    * Bipolar NRI
    * Differential Manchester
    * Bipolar AMI

### License
This software is licensed under the MIT License, quoted below.

Copyright (c) 2016 John Joshua Ferrer

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

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

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

repository: ferrerojosh/cpeforwanz

repo_name: ferrerojosh/cpeforwanz


text:
# Advanced Spatial Analysis
# Module 09: Spatial weights and ESDA

### Overview:

This week we will learn about exploratory spatial analysis with geopandas and pysal. We will focus on exploratory data analysis, spatial weights matrices, calculating spatial lag, moran's I, moran plots, and LISAs.

### Readings:

https://pysal.org/

### Class Session:

Run through the Jupyter notebook

### After-Class Assignment:

Described in the notebook

url: https://raw.githubusercontent.com/aseemdeodhar/asa/bc9f6cc2bac09a54867b28f64b048c22b9a73a54/modules/module09 - spatial weights and esda/README.md

repository: aseemdeodhar/asa

gha_language: Jupyter Notebook

repo_name: aseemdeodhar/asa


text:
# Capitals
Configures whether or not automod should punish a user for having higher than a set percentage of capitals in their message.

## Usage
`automod-capitals [enable | disable] [warn | mute | kick | soft-ban | temp-ban | ban] [percentage]`

## Aliases
`automodcapitals` and `capitals`

## Examples
- `automod-capitals enable soft-ban 50%` This will [soft-ban](/commands/moderation/soft-ban) a user if their message consists of a ratio of half or more capitals to lowercase letters. For example: *WHAT IS this?!*
- `automod-capitals enable ban 90%` This will [ban](/commands/moderation/ban) a user if their message consists of a ratio of 90% or more capitals to lowercase letters. For example: *AGHHHHHHHh*
- `automod-capitals disable` This will disable this command and will allow a user to post a message with any ratio of capital to lowercase letters without being punished.

## Permissions
For this command to work, you are required to have the **Manage Server** (`manageGuild`)  permission within the server you wish to use this command.

----

**Last updated: {docsify-updated}**


text:
---
layout: default
---

# 1993-04-19 - Re: Article from Knight/Ridder Wire

## Header Data

From<EMAIL_ADDRESS>(Joe Thomas)

To<EMAIL_ADDRESS>Message Hash: d8856ad99b3e72559450dc4f9bee0d83fed39809a57394e531a91c810da13259

Message ID: \<9304191709.AA04224@coconut\>

Reply To: _N/A_

UTC Datetime: 1993-04-19 17:09:58 UTC

Raw Date: Mon, 19 Apr 93 10:09:58 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Joe Thomas)
Date: Mon, 19 Apr 93 10:09:58 PDT
To<EMAIL_ADDRESS>Subject: Re: Article from Knight/Ridder Wire
Message-ID: <9304191709.AA04224@coconut>
MIME-Version: 1.0
Content-Type: text/plain

<EMAIL_ADDRESS>(Matthew Lyle) writes:
> New Scrambler Designed to Protect Privacy, But Allow Police
Monitoring By
> Christopher Drew, Chicago Tribune

Oh, well, if only Chris can do it, I guess it's okay.  I trust him
with my keys... ;^)

Joe

{% endraw %}
```

## Thread

+ Return to [April 1993](/archive/1993/04)

+ Return to<EMAIL_ADDRESS>(Joe Thomas)](/authors/jthomas_at_coconut_mitre_org_joe_thomas_)"

+ 1993-04-19 (Mon, 19 Apr 93 10:09:58 PDT) - Re: Article from Knight/Ridder Wire -<EMAIL_ADDRESS>(Joe Thomas)_


text:
---
author: jcarouth
date: '2010-01-13 12:05:18'
layout: post
slug: coding-to-an-interface
status: publish
title: Coding to an Interface
wordpress_id: '153'
comments: true
categories:
- Software Development
tags:
- Best Practice
- Design by Contract
---

In a recent user group presentation the topic of using interfaces to enforce coding standards, ensure component compatibility, etc. was touched upon. The inevitable discussion about the definition of coding to an interface commenced.

## The Literal Definition

Most people when first introduced to the concept of coding to an interface or even "design by contract" type concepts take the literal definition. At this basic level the technique means to use your programming languages OOP interface to define the behavior of the objects you will be using and accept objects that implement that interface where necessary, as illustrated in the following listing.

[code language="php"]interface Deleteable { //some methods }

class Book implements Deleteable { //implementation }

class BookDataSource { public function delete(Deleteable $book) {
$this->purge($book); } }[/code]

With this arrangement any methods that are necessary to prepare an object for deletion will be implemented in the Book class and the data source will only allow objects that implement the Deleteable interface to be purged from existence.

This technique is employed to allow better unit testing, for polymorphism, to ensure that objects have certain behavior, and a variety of other reasons. Coding to the contract provided by the interface is a great practice.

## An Expanded Definition

While the literal definition above is definitely accurate and valuable, the interface extends into other areas. In modern software projects there are a variety of resourced one can call upon to learn about the behavior and properties of software components. Each of these resources is a part of the contract and useful as an interface to which developers should code.

### Documentation

The most obvious resource for defining behavior and properties is documentation. Whether this is some sort of specification document in a wiki, in a binder, on notecards, on napkins, etc., or code comments documentation is a useful interface as long as it is maintained. Maintenance is the pitfall of using documentation as a contract because it is so often and so easily neglected.

Because documentation is most likely out of date — hey, I code in the real world — it is my last choice for an interface-defining resource. However it's better than having nothing.

### Unit Tests

Thinking about it, unit tests are the ultimate supplemental contract for code. They will immediately notify the developer if the terms of the contract (the assertions) are broken. They also provide usage documentation that will help integration efforts.

## In Your Code

The message I hope to get across with this post is that the concept of design by contract or coding to an interface is broader than the literal implications. Using supplemental contracts for your projects will make your projects better if only for that day in the future when you wonder why you made the decision you did.

extension: markdown

gha_language: JavaScript


text:
---
layout: default
---

# 1996-10-01 - [ADVICE] Dimitri Vilus`s personal attacks

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: a72b593464ce9eecd5f5367b8fc9d8e4ca4a62de61c6eb910855ae79ffa82079

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-10-01 22:31:26 UTC

Raw Date: Wed, 2 Oct 1996 06:31:26 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Wed, 2 Oct 1996 06:31:26 +0800
To<EMAIL_ADDRESS>Subject: [ADVICE] Dimitri Vilus`s personal attacks
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

> Hmm...never heard that one before.  Care to produce
> a reference?
>
> (Or am I supposed to be ignoring this guy when he
> makes ridiculous claims?)

I shouldn`t take any notice, he`s a loon who posts rants, lies, off
topic rubbish and personal attacks to the mailing list. just ignore
him, hopefully he`ll soon realise he`s not wanted and leave...

  Datacomms Technologies web authoring and data security
       Paul Bradley<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
       Http://www.cryptography.home.ml.org/
      Email for PGP public key, ID: 5BBFAEB1
     "Don`t forget to mount a scratch monkey"

{% endraw %}
```

## Thread

+ Return to [October 1996](/archive/1996/10)

+ Return to "[paul@fatmans.demon.co.uk](/authors/paul_at_fatmans_demon_co_uk)"

+ 1996-10-01 (Wed, 2 Oct 1996 06:31:26 +0800) - [ADVICE] Dimitri Vilus`s personal attacks -<EMAIL_ADDRESS>


text:
**Author:** [Sjshovan (LoTekkie)](https://github.com/Ap0gee)
**Version:** v0.9.0

# Omega Renamer

> Official Omega private server Windower 4 addon that fixes npc names through automatic updates.

### Table of Contents

- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Aliases](#aliases)
- [Usage](#usage)
- [Commands](#commands)
- [Support](#support)
- [Change Log](#change-log)
- [Known Issues](#known-issues)
- [TODOs](#todos)
- [License](#license)

___
### Prerequisites
1. [Final Fantasy 11 Online](http://www.playonline.com/ff11us/index.shtml)
2. [Windower 4](http://windower.net/)

___
### Installation

This addon is part of the Omega private server ecosystem and comes with the offical Omega server install.
If you are using a separate Final Fantasy 11 install you will need to follow the manual install instructions below.

**Manual:**
1. Navigate to <https://github.com/Ap0gee/Windower-OmegaRenamer>.
2. Click on `Releases`.
3. Click on the `Source code (zip)` link within the latest release to download.
4. Extract the zipped folder to `Windower4/addons/`.
5. Rename the folder to remove the version tag (`-v0.9.0`). The folder should be named `OmegaRenamer`.

___
### Aliases
The following aliases are available to Omega Renamer commands:

**omegarenamer:** orenamer | oren
**reload:** r
**about:** a
**help:** h

___
### Usage

Manually load the addon by using one of the following commands:

    //lua load omegarenamer
    //lua l omegarenamer

___
### Commands

**help**

Displays the available Omega Renamer commands. Below are the equivalent ways of calling the command:

    //omegarenamer help
    //orenamer help
    //oren help

    //omegarenamer h
    //orenamer h
    //oren h

**reload**

Reloads the Omega Renamer addon. Below are the equivalent ways of calling the command:

    //omegarenamer reload
    //orenamer reload
    //oren reload

    //omegarenamer r
    //orenamer r
    //oren r

**about**

Displays information about the Omega Renamer addon. Below are the equivalent ways of calling the command:

    //omegarenamer about
    //orenamer about
    //oren about

    //omegarenamer a
    //orenamer a
    //oren a

___
### Support
**Having Issues with this addon?**
* Please let me know [here](https://github.com/Ap0gee/Windower-OmegaRenamer/issues/new).

**Have something to say?**
* Send me some feedback here<EMAIL_ADDRESS>
**Want to stay in the loop with my work?**
* You can follow me at: <https://twitter.com/Sjshovan>

**Want to toss a coin to your modder?**
* You can do so here: <https://www.paypal.me/Sjshovan>

___
### Change Log

**v0.9.0** - 3/29/2020
- Initial release

___
### Known Issues

- **None**
___
### TODOS

- **TODO:** Consider versioning the map files.
___

### License

Copyright © 2020, [Sjshovan (LoTekkie)](https://github.com/Ap0gee).
Released under the [BSD License](LICENSE).

***

repository: LoTekkie/Windower-OmegaRenamer

repo_name: LoTekkie/Windower-OmegaRenamer


text:
---
title: "Airflow"
meta_title: "Airflow"
meta_description: "Polyaxon provides an Airflow plugin for creating builds, jobs, and experiments."
custom_excerpt: "Airflow is a platform to programmatically author, schedule and monitor workflows."
image: "../../content/images/integrations/airflow.png"
author:
  name: "Polyaxon"
  slug: "Polyaxon"
  website: "https://polyaxon.com"
  twitter: "polyaxonAI"
  github: "polyaxon"
tags:
  - automation
  - pipelines
  - scheduling
  - dags
featured: false
popularity: 0
class_name: instruction
visibility: public
status: published
---

Polyaxon provides a rich [Python library](/docs/core/python-library/polyaxon-client/) that can be used with
scheduling tools such as Airflow to submit jobs to Polyaxon.

## Creating a custom operator

In order to use Polyaxon with airflow you just need to create a custom Airflow operator.

Here's a simple operator that will submit a job and can wait for the job to finish based on a flag.

```python
import os

from airflow.models import BaseOperator
from polyaxon.client import RunClient

class PolyaxonOperator(BaseOperator):
    ui_color = "#2ea44f"
    ui_fgcolor = "#fff"

    def __init__(
        self,
        project_name=None,
        polyaxonfile=None,
        watch=False,
        **kwargs,
    ):
        super().__init__(**kwargs)
        self.polyaxonfile = polyaxonfile
        self.watch = watch
        self.project_name = project_name or os.environ.get("POLYAXON_PROJECT_NAME")

    def execute(self, context):
        client = RunClient(project=self.project_name)
        client.create_from_polyaxonfile(polyaxonfile=self.polyaxonfile)
        if self.watch:
            client.wait_for_condition()
            self.log.info(f"Last status: {client.run_data.status}")
```

> **Tip**: Polyaxon provides a native [DAG](/docs/automation/) runtime for managing your operations and their dependencies in a simple and efficient way.

repository: polyaxon/polyaxon

repo_name: polyaxon/polyaxon


text:
# Code of Conduct

## Discord Community
Please review and comply with the **Discord Server** rules in the `#rules` channel. Thank you!

## Behavioral Guidelines

### Positive
- Please use welcoming and inclusive language.
- Please be respectful of differing viewpoints and experiences of others.
- Accept constructive criticism gracefully.
- Focus on what is best for the community.
- Show empathy towards other community members.

### Negative
- The use of sexualized language, imagery in communications with others in public channels, group chats or private messages.
- Giving unwanted attention to, or making unwanted advances, on others.
- Trolling, insulting or derogatory comments.
- Making personal or political attacks on others.
- Public or private harassment of others.
- Publishing others' private information, such as physical or electronic address, without explicit permission (i.e. doxxing).
- Any other conduct that could reasonably be considered inappropiate in a professional setting.

## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Attribution
Many thanks to [Skill Board](https://github.com/devscollab/skill-board) project for the base of our **Code of Conduct**.

repository: YorozuyaDev/compiler

gha_language: Rust

repo_name: YorozuyaDev/compiler