text:
# Microsoft Display Dock Taskbar Flyout

This utility provides information about a connected Microsoft Display Dock on the system as well as:

- Rebooting capability
- Notifications when the device is connected or disconnected

## Screenshot

 ![Flyout connected](./DisplayDockFlyout/Assets/ConnectedFlyout.png)

 ![Flyout disconnected](./DisplayDockFlyout/Assets/DisconnectedFlyout.png)

 ![Flyout connected notification](./DisplayDockFlyout/Assets/ConnectedNotification.png)

 ![Flyout disconnected notification](./DisplayDockFlyout/Assets/DisconnectedNotification.png)

## Acknowledgements

---

 [File-New-Project/EarTrumpet](https://github.com/File-New-Project/EarTrumpet) for the WindowsTaskbar class.

repository: skyhoshi/DisplayDockFlyout

repo_name: skyhoshi/DisplayDockFlyout


text:
---
title: '4.1.1'
icon: 'ReplaceableTextures\\CommandButtons\\BTNAmbush.blp'
type: 'required'
---

Updates:
Reworks and Overhauls
 - UFF has been reworked completely into [Forsaken].
 - Chaos Orcs has been rethemed into [Outland].
 - [Outland] has had Chaos Shrine, Chaos Kodo, Chaos Pool, and Grom removed.
 - Aforementioned units are now found in the Secondary Race selector as the [Shrine of Buffs]
 - [Outland] has been massively buffed and has a new ultimate tower: Magtheridon

Updates:
Bugfixes and Adjustments
 - Dragon Egg 15 gold -> 20 gold (now a tier 2 tower in Hybrid Random).
 - Blue Dragon Whelp and Drake: Lower attack speed, and ground damage. Whelp now 40 gold instead of 35.
 - Green Dragons: Attack speed and damage up for all. Whelp now 15 gold instead of 20.
 - Chimaeras now lose life properly again
 - Gnoll Poacher: Damage from 500 -> 250
 - [Galaxy] Star Shooter now has a multi-target attack. Damage lowered by 1. AttackSpeed decreased by .1
 - Mutated Frog now sells for the correct amount
 - Fixed description for Beast of Arrrgh!
 - Kick command now closes spawn and removes towers of kicked player
 - Added damage % to armor type descriptions as well as a quest log below the Bugs & Suggestions quest
 - Removed the critical strike item from Ancient Protector
 - fixed several bugs with the votekick command

license: MIT

repository: Promises/Warcraft-Maul-Buildtools

branch_name: refs/heads/master

extension: md

gha_language: TypeScript

gha_license_id: MIT

license_type: permissive

repo_name: Promises/Warcraft-Maul-Buildtools


text:
*"Keep it simple, keep it modular."*

Today I would like to share with you how I build Node.js applications with the hope that someone else will find it useful. This article is  structured in a sequence of steps that I use in my workflow and will attempt to be as detailed as possible.

### Development Process
My development process usually begins with a wireframe illustrating the project requirements. It is very important to plan how you will build your application before writing any code.
Here is a series of steps I like to follow for each project:

 1. Analyse project wireframe and understand domain requirements
 2. Create README file with project documentation
 3. Based on the wireframe, document all routes and API end points
 4. Create a domain model
 5. Go shopping - Select software stack and dependencies
 6. Set up project repo and do necessary installations
 7. Write database schema, and create database
 8. Start Coding, Create Models and Collections
 9. Write unit tests
 10. Create Controllers and Library modules
 11. Create Routes
 12. Write integration tests
 13. Create API
 14. Review code and make adjustments where necessary

### Architecture
My applications are heavily influenced by the MVC architecture which has served me well in my short Software Development career. The MVC architecture is well suited for Node.js development because it promotes modular code and separation of concerns.

Below is my typical directory structure.

    /
     api/
     bin/
     collections/
     config/
     controllers/
     env/
     lib/
     models/
     public/
     routes/
     test/
     views/
     .gitignore
     .jshintrc
     app.js
     package.json
     README.md

I will now zoom-in and look at each first level directory/file in the architecture, describing its role.

### Documentation (./README.md)
The `README.md` is one of the most important files in my projects. I like to practice [Readme Driven Development](http://tom.preston-werner.com/2010/08/23/readme-driven-development.html) because I find it very effective for clarity and project direction.

My `README.md` file usually contains the following information:

 1. Project title and description
 2. Software requirement
 3. Dependencies
 4. Getting started instructions
 5. Required configuration
 6. Tasks commands
 7. Style Guide
 8. Application Architecture
 9. Routes/API End Points
 10. License information

The API and routes  are the entry points to the application, they give us a rough idea about its size. Below is a simple example of how I document my routes/api:

    /**
     *  Routes
    **/

    GET  /items     - get a collection of items
    GET  /items/:id - get one item
    POST /items     - save an item

### ./models
Now that we are armed with some valuable information about all the requests our beloved users will be making to our application, let us create `models` to store and retrieve information. A `model` represents a set of information describing a particular database entity. In a software application, a model usually represents a single record in a database table.

**Please Note:** All examples in this post will use [Bookshelf](http://blog.ragingflame.co.za/2014/7/21/using-nodejs-with-mysql) for database interaction.

**./models/mymodel.js**

    // get config
    var config = require('../config');

    // connect to the database
    var Bookshelf = require('../lib/dbconnect')(config);

    // define model
    var myModel = Bookshelf.Model.extend({
      tableName: 'items'
    });

    // export collection module
    module.exports = myModel;

### ./collections
We also need to be able to handle batch requests for a particular set of data. This is the job for `collections`. If you are familiar with [backbone.js](http://backbonejs.org) then the concept of `collections` should be easy to follow. Collections represent a group of the same `model`, they come with special methods to easily query and fetch data. A `collection` usually represents a complete database table.

**./collections/mycollection.js**

    //require the model for this collection
    var myModel = require('../models/mymodel');

    // define collection
    var myCollection = Bookshelf.Collection.extend({
      model: myModel
    });

    // export collection module
    module.exports = myCollection;

### ./controllers
Controllers, like in any other typical MVC set up, are responsible for the business logic of the application. Our controllers process data passed by routes and then query the database using `models` and `collections`.

**./controllers/items.js**

    var myModel = require('../models/mymodel');
    var myCollection = require('../collections/mycollection');

    module.exports = {

      // GET /items/:id
      getItem: function(req, res, next) {
        var id = req.params.id;

        myModel.forge({id: id})
        .fetch()
        .then(function (model) {
          res.json(model.toJSON());
        })
        .otherwise(function (error) {
          res.status(500).json({msg: error.message});
        });
      },

      // GET /items
      getItems: function(req, res, next) {
        var id = req.params.id;

        myCollection.forge()
        .fetch()
        .then(function (collection) {
          res.json(collection.toJSON());
        })
        .otherwise(function (error) {
          res.status(500).json({msg: error.message});
        });
      },

      // POST /items
      // (Don't forget to validate and sanitize all user input)
      saveItem: function(req, res, next) {
        myModel.forge(req.body)
        .save()
        .then(function (model) {
          res.json(model.toJSON());
        })
        .otherwise(function (error) {
          res.status(500).json({msg: error.message});
        });
      }
    };

### ./routes
Routes are responsible for handling traffic and connecting it to the appropriate controllers, for example, if a user requests for one item, the job of a router would be to direct the request to the `getItem` method of the `itemsController`.

**./routes/items.js**

    var express = require('express');
    var itemsController = require('../controllers/items');

    module.exports = function () {
      var router = express.Router();

      router.get('/items', itemsController.getItems);
      router.get('/items/:id', itemsController.getItem);
      router.post('/items', itemsController.saveItem);

      return router;
    };

### ./config
Earlier, we required the `config` module when we were creating our model. The sole purpose of the `config` directory is to check the environment mode and load the appropriate config file from the `env` directory. The `config` directory contains a single file, `index.js`.

    module.exports = (function (env) {
      var config = {};

      switch (env) {
        case 'production':
          config = require('../env/production');
          break;

        case 'development':
          config = require('../env/development');
          break;

        case 'testing':
          config = require('../env/testing');
          break;

        case 'staging':
          config = require('../env/staging');
          break;

        default:
          console.error('NODE_ENV environment variable not set');
          process.exit(1);
      }

      return config;
    })(process.env.NODE_ENV);

### ./env
The `env` directory contains files representing different environment modes: `development.js`, `production.js`, `test.js`, and `staging.js`.

Here is an example of one file:

    module.exports = {
      pg: {
        host: '<IP_ADDRESS>',
        database: 'test',
        user: 'test',
        password: 'test',
        charset: 'utf8'
      },
      mongodb: {
        url: 'mongodb://localhost:27017/test'
      },
      sessionSecret: 'ninja_cat'
    };

**Heads up:** Do not include any sensitive data in your config file, instead use environment variables.

### ./api
The `api` directory contains the application API files. I create `api` files exactly the same way as I do `controllers`, the only difference being that controllers sometimes load a view template.

### ./lib
The `lib` directory is very common in most Node modules. If your application uses any special algorithms or helpers then the lib directory is the perfect destination for them. In most cases a controller will require a `lib` file to perform a certain special task.

### ./bin
The `bin` directory contains all my command-line scripts. Below is an example:

    #!/usr/bin/env node
    console.log('I am an executable file');

### ./public
The `public` directory contains asset files like images, css, front-end JavaScript, fonts, e.t.c.

### ./views
All my application templates go into the views `directory`.

### ./test
The `test` directory contain all test cases.

### ./.gitignore
The `.gitignore` is used to to inform GIT about which files to ignore and not track. Some of the file and directories that I don't track with git include `node_modules`, PSDs, and temp files.

    *.zip
    *.psd
    *~
    node_modules/
    bower_components/
    build/
    temp/

### ./.jshintrc
The `.jshintrc` is a config file for [jshint](http://jshint.com), it sets the rules for JavaScript quality validation.

    {
      "curly": false,
      "eqeqeq": true,
      "immed": true,
      "latedef": false,
      "newcap": true,
      "noarg": true,
      "sub": true,
      "undef": true,
      "boss": true,
      "eqnull": true,
      "node": true,
      "browser": true,
      "globals": {
        "jQuery": true,
        "define": true,
        "requirejs":true,
        "require": true,
        "describe": true,
        "it": true,
        "beforeEach": true,
        "before": true
      }
    }

### ./package.json
`package.json` is a standard npm file for listing app dependencies and metadata. While Grunt and Gulf serve their purpose, in most cases I find `package.json` scripts adequate for doing command-line tasks.

Example:

    {
        ...

        "scripts": {
          "start": "node app.js",
          "dev": "nodemon app",
          "jshint": "jshint api collections config controllers env lib models public/javascripts routes test app.js",
          "test": "npm run jshint && mocha test",
          "precommit": "npm test",
          "prepush": "npm shrinkwrap && npm test",
          "postmerge": "npm install"
        }

        ...
    }

**Some of my most used modules**

  - Express - App frameworks
  - Bookshelf - Postgres and MySQL ORM
  - lodash - utility library
  - passport - authentication
  - mongoose - MongoDB ODM
  - when.js - promises library
  - moment - parsing, validating, manipulating, and formatting dates

### Conclusion

I have tried to cram in as much information as I can in one post but it is by no means exhaustive. Building Node.js application is constantly evolving and it is important to always be on the lookout for new and better solutions from the community.

I have more posts lined up for this month - [subscribe to my RSS feed](http://blog.ragingflame.co.za/rss) to stay up-to-date.

repository: qawemlilo/blog

gha_language: HTML

repo_name: qawemlilo/blog


text:
---
layout: post
published: true
title: L Divided
date: 2018/07/13
---

>Say you have an “L” shape formed by two rectangles touching each other. These two rectangles could have any dimensions and they don’t have to be equal to each other in any way.
>
>Using only a straightedge and a pencil (no rulers, protractors or compasses), how can you draw a single straight line that cuts the L into exactly two pieces of exactly equal area, no matter what the dimensions of the L are? You can draw as many lines as you want to get to the solution, but the bisector itself can only be one single straight line.

<!--more-->

([fivethirtyeight](https://fivethirtyeight.com/features/can-you-slice-this-in-half/))

## Solution

![We extend the sides to form a rectangle, and then locate the centers of the large rectangle and the rectangular area with in it that is outside of the L. The line contaiing those centers divides those rectangular areas in half, and therefore also the L itself](/img/LDivided.PNG)

<br>


text:
# Database and API call design, Throttle Search

-->Created Business,Customer and Staff tables in Database as follows

Business->id(primary Key), name, description, location

sample data in table:

  [

      {
        "id": 1,
        "name": "omnify",
        "description": "A software Company",
        "location": "Bangalore"
      },
      {
        "id": 2,
        "name": "omnify Mobile Apps",
        "description": "A Mobile Apps software Company",
        "location": "Bangalore"
      }

  ]

Customer->id(pk), email, phone_no, business_id(fk)(references 'id' from business table)

sample data in table:

    [

        {
        "id":1,
        "name": "trendysoft",
        "email"<EMAIL_ADDRESS>        "phone_no": "1235467890",
        "business_id":"1"
        },
        {
        "name": "CustMicrosoft",
        "email"<EMAIL_ADDRESS>        "phone_no": "1234567890",
        "business_id":"1"
        },
       {
        "name": "technotrends1",
        "email"<EMAIL_ADDRESS>        "phone_no": "1234567890",
        "business_id":"2"
       }

    ]

Staff->id(pk), email, phone_no, business_id(fk)(references 'id' from business table)

sample data in the table:

[

    {
        "name": "sam",
        "email"<EMAIL_ADDRESS>        "phone_no": "1234567890",
        "business_id":"1"
    },
    {
        "name": "ram",
        "email"<EMAIL_ADDRESS>        "phone_no": "1235467590",
        "business_id":"1"
    },
    {
        "name": "ramu",
        "email"<EMAIL_ADDRESS>        "phone_no": "1235467591",
        "business_id":"2"
    }

]

API Call Design:

1)List All customers of a business

Method: GET

parameter:id=1(id of business omnify)

URL: http://localhost/rest_services_kohana/index.php/v1/customer?id=1

output:

[

    {

        "name": "trendysoft",
        "email"<EMAIL_ADDRESS>        "phone_no": "1235467890"

    },

    {

        "name": "CustMicrosoft",
        "email"<EMAIL_ADDRESS>        "phone_no": "1234567890"

    }

]

2)List All the staff of a business

Method:GET

parameter:id=1(id of business omnify)

Url: http://localhost/rest_services_kohana/index.php/v1/staff?id=1

output:
[

    {
        "name": "sam",
        "email"<EMAIL_ADDRESS>        "phone_no": "1234567890"
    },
    {
        "name": "ram",
        "email"<EMAIL_ADDRESS>        "phone_no": "1235467590"
    },
    {
        "name": "sagar",
        "email"<EMAIL_ADDRESS>        "phone_no": "1235467591"
    }
]

3)Find out if a particular person is a customer of a business

Method:GET

parameters:id=1(id of business omnify),check_customer(id of a customer)

Url: http://localhost/kohana_rest_services/index.php/v1/customer?id=1&check_customer=1

output:

{
    "message": "trendysoft Is a customer"
}

4)Find out if a particular person is a staff of a business

Method:GET

Url: http://localhost/kohana_rest_services/index.php/v1/staff?id=1&check_staff=3

parameters:id=1(id of business omnify),check_staff(id of a staff)

output:

{
    "message": "ramu Is a staff"
}

5)Edit basic info of a staff

Method:PUT

<EMAIL_ADDRESS>
query parameters: id=1,name=sam,email=sam@omnify.com,business_id=1,phone_no=1234598760

output:

{

    "staff": {
        "id": "1",
        "name": "sam",
        "message": "successfully updated"
    }

}

6)Edit basic info of customer

Method:PUT

Url:http://localhost/kohana_rest_services/index.php/v1/customer?id=2&business_id=1&phone_no=1234598762

query parameters:id=2&business_id=1&phone_no=1234598762

output:

{

    "customer": {
        "id": "2",
        "name": "CustMicrosoft",
        "message": "successfully updated"
    }

}

# Throttle Search using Twitter's typeahead.js

1.Created a Simple html page, that has a search input text bar in views/index.php

2.Used the existing Business table data from the database for search data

3.Url for throttle page

http://localhost/kohana_rest_services/index.php/web/welcome

4.Example :

![Alt text](/public/images/search.png?raw=true "Throttle Search")

repository: vidyaasagar/kohana-rest-services

repo_name: vidyaasagar/kohana-rest-services


text:
# oer-bookr-backendnpm

https://oer-bookr-api.herokuapp.com/books

### Download Project Files

- **Fork** and **Clone** this repository.
- **CD into the folder** where you cloned the repository.

## Test API Endpoints

### Auth Endpoints

| Method | Endpoint      | Description                                                                                |
| ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| POST   | /register | Creates a `user` sent inside the `body` of the request. **Hashes** password before saving to the database.                                                                                |
| POST   | /login    | Uses the credentials sent inside the `body` to authenticate the user. On successful login, creates a JWT token to be used to access restricted endpoints. |

### Book Endpoints

| Method | Endpoint      | Description                                                                                |
| ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GET    | /books    | Retrieves a list of all `books` in the database.                   |
| GET    | /books/:id | Retrieves a `book` specified by the `id` provided, as well as a list of `reviews` for the `book`. |
| POST   | /books    | If all required fields are met, creates a `book`. |
| DELETE | /books/:id | Deletes the `book` with the specified `id`. |
| PUT    | /books/:id | Updates the `book` with the specified `id`.  |

### Review Endpoints

| Method | Endpoint      | Description                                                                                |
| ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GET    | /reviews   | Retrieves a list of all `reviews` in the database. |
| GET    | /reviews/:id | Retrieves a `review` with the specified `id`. |
| POST   | /reviews   | Creates a `review`. |
| DELETE | /reviews/:id | Deletes the `review` with the specified `id`. |
| PUT    | /reviews/:id | Updates the `review` with the specified `id`. |

## Data Models

### Books Data Model

| Field |    Type   | Description                                                                                |
| ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id     | Integer | ID of the newly created book. |
| title  | String  | Title of the newly created book. |
| author | String  | Author of the newly created book. |
| publisher | String | Publisher of the newly created book. |
| license | String | License of the newly created book. |
| subject | String | Subject of the newly created book. |
| image | String | Image of the newly created book. |
| link | String | Link to the newly created book. |
| reviews | Array of Objects | Array of Reviews for the newly created book. |

### Reviews Data Model

| Field |    Type   | Description                                                                                |
| ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id    | Integer | ID of the newly created review. |
| book_id | Integer | ID of the book the review is for. |
| reviewer | String | Name of the reviewer of the new review. |
| review | String | Text review for the book. |
| rating | Integer | Number review 1-5 for the book. |

repository: oer-bookr/oer-bookr-backend

repo_name: oer-bookr/oer-bookr-backend


text:
# `embark-ipfs`

> Implements IPFS support in Embark

Visit [framework.embarklabs.io](https://framework.embarklabs.io/) to get started with
[Embark](https://github.com/embarklabs/embark).


text:
# Lightweight PHP time measurement

Useful for debugging slow scripts and optimizing frameworks.

* Simple __start__ / __stop__ stopwatch
* Supports __nested__ measurements
* __Aggregated__ measurements for __repeating__ functions
* Plain text __report__

Exception handling
--------------------

The Stopwatch will throw an exception on any anomaly. However, by default these exceptions are silently ignored.

In order to set a custom handler use:

StopwatchException::setExceptionHandler(StopwatchExceptionHandling $handler);

For complete list of exceptions, see /src/Exception directory.

API
--------------------

#### Simple usage

Use the pair of methods Stopwatch::start(string $name) and Stopwatch::stop(string $name) to measure elapsed time.

The string $name is used to name and identify the measurement and it must match across the two methods.

Stopwatch::stop(string $name) returns an instance Measurement, which holds the information about the measurement.

Example:

Stopwatch::start('Init');
// ...
$measurement = Stopwatch::stop('Init'); // Returns an instance of Measurement

// Available options
$measurement->getStart();    // The start time of the measurement, in milliseconds
$measurement->getEnd();      // The end time of the measurement in milliseconds
$measurement->getTime();     // The total time elapsed in milliseconds

#### Nested

Nested measurements allow you to get more details where the time is spent, but also to easily know the total time spent. Level of nesting is not limited.

Example:

Stopwatch::start('Total');
    // ...
    Stopwatch::start('Init');
        // ...
    Stopwatch::stop('Init');

    Stopwatch::start('Database');
        Stopwatch::start('Connection');
            // ...
        Stopwatch::stop('Connection');

        Stopwatch::start('Read');
            // ...
            Stopwatch::start('Cache');
            	// ...
            Stopwatch::stop('Cache');
        Stopwatch::stop('Read');
    Stopwatch::stop('Database');
$measurement = Stopwatch::stop('Total');

// The total time elapsed in 'Total', in milliseconds
$measurement->getTime();

// The list of direct children measurements ('Database' and 'Rendering'), with same API as this measurement
$subMeasurements = $measurement->getChildren();

#### Aggregated

If a certain function is called multiple times, measure the total time.

$loops = 10;
while ($loops--) {
	Stopwatch::startAggregate('loop');
		// ...
	Stopwatch::pauseAggregate('loop');
}

// Get the instance of AggregateMeasurment
$aggregateMeasurement = Stopwatch::getAggregatedMeasurements()['loop'];

$aggregateMeasurement->getTotal()	// The total elapsed time, in milliseconds
$aggregateMeasurement->getCount()	// The number of loops

#### Print summary

Print the summary of all measurements as plain text: $measurement->report().

<pre><?php echo $measurement->report() ?></pre>

From the nested example above,  will produce:

Total: 100
├───Init: 9
└───Database: 91
	├───Connection: 76
	└───Read: 15
		└───Cache: 3

TODO
--------------------
1. Tests.
2. Improve the print summary.

Licence
--------------------
MIT License

Copyright (c) 2019 Intellex

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.

Credits
--------------------
Script has been written by the [Intellex](https://intellex.rs/en) team.

repository: IntellexApps/stopwatch

repo_name: IntellexApps/stopwatch


text:
![flowgen logo](./img/flowgen_logo.jpg)

### FlowGen

FlowGen is a renewable energy company that applied its extensive aerodynamic know-how from the automotive racing industry into the wind industry to optimize the design of a 5-meter wind turbine. These turbines can be installed virtually anywhere without the need for high masts or deep foundations. This makes it possible to cost-effectively deliver power nearly anywhere in the world.

Together with FlowGen, ThreeFold can push Internet capacity for a fair price to the most remote places of our planets and empower the unconnected.

Learn more about Flowgen on their [website](http://www.flowgen.com/).


text:
# Upgrading to dotNetRDF 3.0

This page acts as a hub for documentation of the issues and changes you should be prepared to deal with when migrating code written for dotNetRDF 2.x to dotNetRDF 3.x.

Although we aim to provide as much backwards compatibility between releases as possible, the nature of the changes made in dotNetRDF 3.x has meant that in some cases we have had to break our normal [deprecation policy](/developer_guide/deprecation_policy.md).

This section contains the following sections:

  * The [Key Changes](3_0_changelog.md) draws your attention to the main changes in the 3.0 release.
    Some of these are breaking changes that you should be aware of before embarking on code migration.
  * One of the architectural changes we have made is to try to move away from using a lot of global static settings in favour of specifying options more closely to where they are moved (e.g. via constructor injection or method arguments).
    In line with the deprecation policy, we have (where possible) retained the global static as a way of configuring a global default, but marked the property as deprecated.
    In a small number of cases this has not been possible and the static property has been removed.
    The [Global Options Changes](global_options_changes.md) goes through the changes made and how to migrate code that makes use of those properties.

repository: dotnetrdf/dotnetrdf

branch_name: refs/heads/main

gha_license_id: NOASSERTION

repo_name: dotnetrdf/dotnetrdf


text:
Traccar Proto Decoder for Traccar GTS
===============

The Book Chapter 7.5 'Traccar Proto Decoder' describes how to add a Protobuffer Decoder
for the jeets-pu-traccar Entities and the pu-protocols with the Traccar.java Decoder.
The Decoder has been updated to Traccar 4.2 and you can add the Decoder
to your Traccar installation in four steps:

copy two Java files from this directory
----

	org.traccar.protocol.ProtobufferProtocol.java
	org.traccar.protocol.ProtobufferDecoder.java

to the org.traccar.protocol package directory in Traccar.

Note that the files are not compiled in the JeeTS repository
as they depend on many Traccar classes.
Please check for errors in the Traccar environment when adding them.

The actual implementation of the Protobuffer Decoder
can be found in the method

	Object decode(Channel channel, SocketAddress remoteAddress, Object msg)

and should be easy to adopt to your needs or to debug integration problems.

add jeets-protocols to pom.xml
---

See the example file traccar.pom.xml in this directory
where to place the jeets-protocols dependency and version.
If you introduce the dependency as the last one
you will not overrule traccar's dependencies.
The file is only a portion of Traccar's pom.xml and not functional.

	<groupId>org.traccar</groupId>
	<artifactId>traccar</artifactId>
	<version>4.1-SNAPSHOT</version>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>

			...

		<!-- place additional protocols at end -->
		<dependency>
			<groupId>org.jeets</groupId>
			<artifactId>jeets-protocols</artifactId>
			<version>1.2-RC</version>
		</dependency>
	<dependencies>

Also note Traccar's release version at the beginning of the pom file.

The new dependency will raise a slf4j multiple binding problem
but this does not harm the actual binding:

	SLF4J: Class path contains multiple SLF4J bindings.
	SLF4J: Found binding in ...
	SLF4J: Found binding in ...
	SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
	SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]

You can optimize the protocols import by excluding the Hiberate JPA implementation
which is not applied in Traccar and exclude the logging conflict with.

		<dependency>
			<groupId>org.jeets</groupId>
			<artifactId>jeets-protocols</artifactId>
            <version>1.2-RC</version>
            <exclusions>
            	<exclusion>
            		<groupId>org.hibernate</groupId>
            		<artifactId>hibernate-core</artifactId>
            	</exclusion>
            	<exclusion>
            		<groupId>org.slf4j</groupId>
            		<artifactId>slf4j-log4j12</artifactId>
            	</exclusion>
            </exclusions>
		</dependency>

add protocol to Traccar's traccar.xml file
--

Add the line

	<entry key='protobuffer.port'>5200</entry>
	            -----------

Note that the protocol name is derived from the protocol's class name

	ProtobufferProtocol -> protocol: protobuffer
	-----------                      -----------

and has to match the entry of the configuration file.

register the unique Id you are using in the client software
--

If your Traccar installation compiles successfully
you are prepared to receive Device protobuffers with Traccar
and you can send messages with the jeets-tracker or jeets-player.
The default device for tracker tests is 'pb.device' and you
can use the Traccar frontend to create a new device
with name 'jeets-tracker' and uniqueId 'pb.device'

Update, refresh, compile or deploy Traccar as you usually do
and make sure the new protobuffer protocol is bound to its port.
Next you can prepare the jeets-tracker.

Send Traccar Protobuffer Messages to Traccar GTS
===============

	jeets-tracker-1.2-RC-jar-with-dependencies.jar

	tracker.host=localhost
	tracker.port=5200
	tracker.uniqueId=pb.device


text:
# Jekyll Picture Tag

![Tests & Formatting](https://github.com/rbuchberger/jekyll_picture_tag/workflows/Tests%20&%20Formatting/badge.svg)

**Responsive Images done correctly.**

It's simple to throw a photo on a page and call it a day, but doing justice to users on all
different browsers and devices is tedious and tricky. Tedious, tricky things should be automated.

Jekyll Picture Tag automatically builds cropped, resized, and reformatted images, builds several
kinds of markup, offers extensive configuration while requiring none, and solves both the art
direction and resolution switching problems with a little YAML configuration and a simple template
tag.

## Why use Responsive Images?

**Performance:** The fastest sites are static sites, but if you plonk a 2mb picture of your dog at
the top of a blog post you throw it all away. Responsive images allow you to keep your site fast,
without compromising image quality.

**Design:** Your desktop image may not work well on mobile, regardless of its resolution. We often
want to do more than just resize images for different screen sizes, we want to crop them or use a
different image entirely.

## Why use Jekyll Picture Tag?

**Developer Sanity:** If you want to serve multiple images in multiple formats and resolutions, you
have a litany of markup to write and a big pile of images to generate and organize. Jekyll Picture
Tag is your responsive images minion - give it simple instructions and it'll handle the rest.

## Features

* Generate piles of cropped, resized, and converted image files.
* Generate corresponding markup in several different formats.
* Configure it easily, or not at all.
* Make Lighthouse happy.

## Documentation:

https://rbuchberger.github.io/jekyll_picture_tag/

## Changelog:

https://rbuchberger.github.io/jekyll_picture_tag/devs/releases

Latest versions:

* 1.13.0 November 23, 2020
  * Add image quality interpolation; allows for variable image quality based on image size.
  * Bugfix: Perform format, resize, and quality changes simultaneously rather than individually.
    * Allows for actual lossless webp: simply set quality to 100.
    * Improves fresh (no cached images) build times by ~15%
    * Fix problems with poor image quality.

## Help Wanted

Writing code is only part of the job; often the harder part is knowing what needs to be changed. Any
and all feedback is greatly appreciated, especially in regards to documentation. What are your pain
points? See the [contributing
guidelines](https://rbuchberger.github.io/jekyll_picture_tag/devs/contributing), or the
[issues](https://github.com/rbuchberger/jekyll_picture_tag/issues) page for more.

repository: vaheder/jekyll-picture-tag

repo_name: vaheder/jekyll-picture-tag


text:
---
title: CET6：numerous forms of
date: 1000-12-17 23:00:00 +0800
categories: [CET6, Advanced]
tags: [cet6-phrase]     # TAG names should always be lowercase
---

There're numerous forms of marine life in the sea.

<audio id="audio" controls preload="auto">
      <source id="mp3" src="/assets/audio/numerous-forms-of.mp3">
</audio>

> 海洋里生活着多种形式的海洋生物。

gha_language: SCSS


text:
# salary-calculator

Find how much salary after tax

[![Build Status](https://travis-ci.org/auvansang/salary-calculator.svg?branch=master)](https://travis-ci.org/auvansang/salary-calculator)

GitHub Page: https://auvansang.github.io/salary-calculator/

repository: auvansang/salary-calculator

repo_name: auvansang/salary-calculator


text:
# PHP-7-FPM-POSTFIX

This image is the same as PHP-7-FPM, but instead of using SSMTP as email forwarder it starts
Postfix server.

It handles well situation when relay SMTP server is not accepting emails and is much faster then using SSMTP.

To configure Postfix as relay define environment variable XT_MAIL_SERVER. Use `POSTFIX_` prefixed
environemnt variables which will be applied with `postconf -e`.

If you want to execute script you have to:

* start this container with `docker run`
* `docker run` your script inside already running container
* `docker run` shutdown script to make sure that all emails were sent from queue

To make mail queue persistent you have to mount volume `/var/spool/postfix`.

##Start

    # start Docker container
    DID=$(docker run -d -e POSTFIX_relayhost=<my-smtp.example.com> \
      bigm/php-7-fpm-postfix)

    # excute your script
    docker exec -ti $DID php -f /xt/tools/mail_test.php <your email>

    # correctly shutdown the Docker instance to make sure that
    docker exec -ti $DID /xt/tools/shutdown.sh

Or use the XT_RUN functionality of `bigm/base-deb` Docker image:

    docker run --name test -ti --rm -e \
        XT_MAIL_SERVER=xxxx.xtmotion.com \
        -e XT_RUN=/tmp/example.sh -v example.sh:/tmp/example.sh bigm/php-7-fpm-postfix

license: Unlicense


text:
# gargantua
This repository hosts the core code for Gargantua, the megalith backend component of Hobby Farm. Currently, Hobby Farm is being built as a monolith, but will be transitioned into a proper microservices architecture one day™

Gargantua components:
Gargantua is based on K8S controllers, and provisions the following controllers to manage various aspects of HobbyFarm.
- Terraform Provsioner Controller
- VMClaim Controller
- VMSet Controller
- Environment Controller
- Session Controller

Their relationship is better illustrated with the following ERD:

![](./artifacts/diagrams/Workflow.png)

## Contributing

If you're interested in contributing, see [CONTRIBUTING.md](CONTRIBUTING.md)

repository: hobbyfarm/gargantua

gha_language: Go

repo_name: hobbyfarm/gargantua


text:
---
title: Material Themes Blending
page_title: Material Themes Blending - UI for WinForms Tools
description: Visual Style Builder provides a color blending functionality making it easy to completely transform an existing theme.
slug: winforms/tools/visual-style-builder/working-with-visual-style-builder/material-themes-blending
tags: color, blending, material
published: True
position: 8
---

# Material Themes Blending

Telerik UI for WinForms suite offers a touch optimized theme which provides additional features such as custom fonts, built-in animations and shadows. We also have three other themes that are using the [Material]({%slug winforms/themes/touch-enabled-themes%}) theme as a foundation but have different colors:

* MaterialBlueGray
* MaterialPink
* MaterialTeal

>caption Figure 1: Material Themes
![tools-visual-style-builder-working-with-visual-style-builder-material-themes-blending 001](images/tools-visual-style-builder-material-themes-blending001.png)

## Generate Material Variation

[Visual Style Builder]({%slug winforms/tools/visual-style-builder%}) provides an easy way to generate different color variations of the **Material** theme. Material theme blending uses the basic Material theme by executing a series of predefined commands.

Select *Tools >> Generate Material Variation* menu item:

>caption Figure 2: Generate Material Variation
![tools-visual-style-builder-working-with-visual-style-builder-material-themes-blending 002](images/tools-visual-style-builder-material-themes-blending002.png)

![tools-visual-style-builder-working-with-visual-style-builder-material-themes-blending 006](images/tools-visual-style-builder-material-themes-blending006.png)

>note If you already have loaded a customized Material theme (but not a Material variation) it will remain loaded when generating a Material variation.
This will open the **Material Blend Dialog** from which you can choose the **Primary color** and the **Accent color**:

>caption Figure 3: Material Blend Dialog
![tools-visual-style-builder-working-with-visual-style-builder-material-themes-blending 003](images/tools-visual-style-builder-material-themes-blending003.png)

If you click the **Generate theme** button, a new variation of the Material theme will be exported using the selected colors.

>caption Figure 4: Save the Theme
![tools-visual-style-builder-working-with-visual-style-builder-material-themes-blending 004](images/tools-visual-style-builder-material-themes-blending004.png)

After loading the custom theme in [Theme Viewer]({%slug winforms/tools/themeviewer%}) the primary/accent colors are replaced:

>caption Figure 5: Load Material theme's variation
![tools-visual-style-builder-working-with-visual-style-builder-material-themes-blending 005](images/tools-visual-style-builder-material-themes-blending005.png)

# See Also

* [Touch Enabled Themes]({%slug winforms/themes/touch-enabled-themes%})
* [Customizing the Material Theme]({%slug winforms/themes/theme-tutorials/customizing-material-theme%})
* [Color Blending]({%slug winforms/tools/visual-style-builder/working-with-visual-style-builder/color-blending%})
* [Fluent Theme Blending]({%slug winforms/tools/visual-style-builder/working-with-visual-style-builder/fluent-themes-blending%})

repository: telerik/winforms-docs

gha_language: JavaScript

repo_name: telerik/winforms-docs


text:
# NLP For Thai

It's Thai NLP homepage. All is Open Source.

Website: [NLPForThai.com](https://nlpforthai.com) maintained by PyThaiNLP

**Menu**

- [Tasks](./tasks)
- [Other](./other)

**Contributors**

Thanks all the [contributors](https://github.com/PyThaiNLP/nlpforthai.com/graphs/contributors). (Image made with [contributors-img](https://contributors-img.firebaseapp.com))

**How to Contribute**

You can fork and send your pull request at [https://github.com/PyThaiNLP/nlpforthai.com](https://github.com/PyThaiNLP/nlpforthai.com)

We build Thai NLP.

PyThaiNLP


text:
| [Home](home.md) | [News](news.md) | [Gallery](gallery.md) | [Examples](examples.md) | [Downloads](downloads.md) | [Documentation](documentation.md) | [Support](support.md) | [Sources](https://github.com/gammasoft71/xtd) | [Project](https://sourceforge.net/projects/xtdpro/) | [Gammasoft](gammasoft.md) | [Website](https://gammasoft71.github.io/xtd) |

# How to: Write Text to a File

This topic shows different ways to write text to a file for a xtd app.

The following classes and methods are typically used to write text to a file:

* [xtd::io::stream_writer](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1io_1_1stream__writer.html) contains methods to write to a file ([write and write_line).
* [xtd::io::file](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1io_1_1file.html) provides static methods to write text to a file, such as write_all_lines and write_all_text, or to append text to a file, such as append_all_jines, append_all_text, and append_text.
* [xtd::io::path](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1io_1_1path.html) is for strings that have file or directory path information. It contains the combine method and, the join and try_join methods, which allow concatenation of strings to build a file or directory path.

## Notes

The following examples show only the minimum amount of code needed. A real-world app usually provides more robust error checking and exception handling.

## Example: Write text with stream_writer

The following example shows how to use the xtd::io::stream_writer class to write text to a new file one line at a time. Because the xtd::io::stream_writer object is declared and instantiated in a using statement, the destructor automatically flushes and closes the stream.

```cpp
#include <xtd/xtd>

using namespace xtd;
using namespace xtd::io;

class program {
public:
  static auto main() {
    // Create a string array with the lines of text
    std::vector<ustring> lines = { "First line", "Second line", "Third line" };

    // Set a variable to the Documents path.
    ustring doc_path = environment::get_folder_path(environment::special_folder::my_documents);

    // Write the string array to a new file named "write_lines.txt".
    using_ (stream_writer output_file(path::combine(doc_path, "write_lines.txt"))) {
      for (const ustring& line : lines)
        output_file.write_line(line);
    }
  }
};

startup_(program);

// The example creates a file named "write_lines.txt" with the following contents:
// First line
// Second line
// Third line
```

## Example: Append text with stream_writer

The following example shows how to use the xtd::io::stream_writer class to append text to the text file created in the first example.

```cpp
#include <xtd/xtd>

using namespace xtd;
using namespace xtd::io;

class program {
public:
  static auto main() {
    // Set a variable to the Documents path.
    ustring doc_path = environment::get_folder_path(environment::special_folder::my_documents);

    // Append text to an existing file named "write_lines.txt".
    using_ (stream_writer output_file(path::combine(doc_path, "write_lines.txt"), true)) {
      output_file.write_line("Fourth Line");
    }
  }
};

startup_(program);

// The example adds the following line to the contents of "write_lines.txt":
// Fourth Line
```

## Example: Write and append text with the file class

The following example shows how to write text to a new file and append new lines of text to the same file using the xtd::io::file class. The xtd::io::file::write_all_text and xtd::io::file::append_all_lines methods open and close the file automatically. If the path you provide to the xtd::io::file::write_all_text method already exists, the file is overwritten.

```cpp
#include <xtd/xtd>

using namespace xtd;
using namespace xtd::io;

class program {
public:
  static auto main() {
    // Create a string with a line of text.
    ustring text = "First line" + environment::new_line();

    // Set a variable to the Documents path.
    ustring doc_path = environment::get_folder_path(environment::special_folder::my_documents);

    // Write the text to a new file named "write_file.txt".
    file::write_all_text(path::combine(doc_path, "write_file.txt"), text);

    // Create a string array with the additional lines of text
    std::vector<ustring> lines = { "New line 1", "New line 2" };

    // Append new lines of text to the file
    file::append_all_lines(path::combine(doc_path, "write_file.txt"), lines);
  }
};

startup_(program);

// The example creates a file named "write_file.txt" with the contents:
// First line
// And then appends the following contents:
// New line 1
// New line 2
```

## See also

* [Common I/O Tasks](common_io_tasks.md)
* [Tutorials](tutorials.md)
* [Documentation](documentation.md)

______________________________________________________________________________________________

© 2023 Gammasoft.


text:
# COAProject_Graphic_Sim85
A graphics simulator of 8085 microprocessor developed in c++. It includes assembly language commands and displays the states of various registers and memory as each instruction is executed step by step.
Contributors
Abhimanyu Vashisht<EMAIL_ADDRESS>Rahul Sharma<EMAIL_ADDRESS>Sharadh Dhadhich
Vasu Arora<EMAIL_ADDRESS>


text:
# Change Log

## [0.9.9](https://github.com/seethroughtrees/react-ux-password-field/tree/0.9.9) (2015-09-10)
[Full Changelog](https://github.com/seethroughtrees/react-ux-password-field/compare/0.9.8...0.9.9)

**Closed issues:**

- Add license [\#22](https://github.com/seethroughtrees/react-ux-password-field/issues/22)
- option needed: unMaskStyle [\#21](https://github.com/seethroughtrees/react-ux-password-field/issues/21)
- Warning: setState\(...\): Can only update a mounted or mounting component. This usually means you called setState\(\) on an unmounted component. This is a no-op. [\#14](https://github.com/seethroughtrees/react-ux-password-field/issues/14)

## [0.9.8](https://github.com/seethroughtrees/react-ux-password-field/tree/0.9.8) (2015-08-31)
[Full Changelog](https://github.com/seethroughtrees/react-ux-password-field/compare/list...0.9.8)

**Closed issues:**

- Why is v0.9.7 on npm when you are still on v0.9.6? [\#23](https://github.com/seethroughtrees/react-ux-password-field/issues/23)

## [list](https://github.com/seethroughtrees/react-ux-password-field/tree/list) (2015-08-20)
**Implemented enhancements:**

- Hide meter until user starts typing [\#11](https://github.com/seethroughtrees/react-ux-password-field/issues/11)

**Fixed bugs:**

- zxcvbn is not defined [\#13](https://github.com/seethroughtrees/react-ux-password-field/issues/13)

**Closed issues:**

- Pass on the value in changeCb\(\) too [\#17](https://github.com/seethroughtrees/react-ux-password-field/issues/17)
- this.props.onChange\(\) should be called after handleZxcvbn [\#16](https://github.com/seethroughtrees/react-ux-password-field/issues/16)
- using it directly on bower [\#10](https://github.com/seethroughtrees/react-ux-password-field/issues/10)
- Bug: first character I type causes strength meter to disappear [\#8](https://github.com/seethroughtrees/react-ux-password-field/issues/8)
- make this.props.onChange conditional [\#7](https://github.com/seethroughtrees/react-ux-password-field/issues/7)
- Styling of strength meter [\#6](https://github.com/seethroughtrees/react-ux-password-field/issues/6)
- How to add a custom strength / score for repeated password inputs? [\#5](https://github.com/seethroughtrees/react-ux-password-field/issues/5)
- Adding onChange breaks functionality [\#4](https://github.com/seethroughtrees/react-ux-password-field/issues/4)
- Uncaught ReferenceError: zxcvbn is not defined [\#3](https://github.com/seethroughtrees/react-ux-password-field/issues/3)

**Merged pull requests:**

- Add "browser" field to package.json [\#20](https://github.com/seethroughtrees/react-ux-password-field/pull/20) ([brigand](https://github.com/brigand))
- Add more parameters in callbacks and bump packages [\#18](https://github.com/seethroughtrees/react-ux-password-field/pull/18) ([binarykitchen](https://github.com/binarykitchen))
- onChange branch change [\#2](https://github.com/seethroughtrees/react-ux-password-field/pull/2) ([Dignifiedquire](https://github.com/Dignifiedquire))

\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

repository: myhelix/react-ux-password-field

repo_name: myhelix/react-ux-password-field


text:
---
layout: page
title: Constants, Variables and Types
permalink: /manual/chapter-1/
---

Anzen distinguishes
[variables](https://en.wikipedia.org/wiki/Variable_(computer_science)) and
[constants](https://en.wikipedia.org/wiki/Constant_(computer_programming)).
Both are an association between a name and a value.
Variables can have their value modified, whereas constants cannot.

Constants and variables are declared with the keyword `let`,
followed by their name:

```anzen
let pokemon_level = 1
```

Anzen is an opinionated language,
as you will discover thorough this manual.
One of its opinionated choices is to prefer constant to variables,
which is why the above statement declares a **constant**.
To declare a variable, the type modifier `@mut` must be specified at the declaration:

```anzen
let pokemon_level: @mut = 1
pokemon_level = 2
```

> In fact, Anzen assumes you used the `@cst` modifier by default.
> That means declaring a constant can be done explicitly by writing:
> ```
> let pokemon_level: @cst = 1
> ```

Only variables can be mutated.
Trying to mutate a constant will trigger an error:

```anzen
let pokemon_species = "Bulbasaur"
pokemon_species = "Pikachu"
# cannot assign to value: 'pokemon_species' is a constant
```

> You are encouraged to always use the most restrictive construct,
> for instance `@cst` (the default modifier) rather than `@mut`.
> This particular choice is called
> [const correctness](https://isocpp.org/wiki/faq/const-correctness)
> in other languages, and helps to avoid some bugs.

The value of variable and constants can be printed with the built-in function `print(_:)`:

```anzen
let pokemon_level = 1
print(pokemon_level)
# 1
```

> We'll discuss functions (and methods) with their syntax and semantics
> at length later in this manual.
> For the time being, just use them as presented in the examples.

From now on, we will talk about variables and constants under the denomination of "variables".

## References and Shared Variables

In the previous section, we saw that variables in Anzen are names
to which some value can be assigned.
Behind the scenes, those values are stored at some location of the computer's memory,
and the name of a variable simply refers to that location.
Anzen allows several names to refer to the same memory location.
In other languages, this concept is called
[aliasing](https://en.wikipedia.org/wiki/Aliasing_(computing)).

```anzen
let pikachu_level = 1
let bulbasaur_level = 2
let strongest_level &- bulbasaur_level
print(strongest_level)
# 2
```

In the above example, the variable `strongest_level` is a *reference*
to the value associated with `bulbasaur_level`.
That is, both names refer to the same memory location.

Notice the use of a new operator `&-` to initialize the value of `strongest_level`.
This operator is called the **reference assignment operator**,
and as its name suggests, it lets us create references to what's on its right.
Because this operator produces references,
type inference can automatically decide that `strongest_level` should be a reference.
Alternatively, you can use the `@ref` type modifier to explicitly declare a reference:

```anzen
let strongest_level: @ref
```

> The same way Anzen assumes you used the `@cst` modifier by default,
> it also assumes you used the `@val` modifier by default,
> which declares values (i.e. not references).
> That means declaring a value can be done explicitly by writing:
> ```
> let pokemon_level: @val = 1
> ```

Like other variables, references are constant by default.
To declare a mutable reference,
the type modifier `@mut` must be specified at the declaration:

```anzen
let bulbasaur_level: @mut = 2
let strongest_level: @mut &- strongest_level
strongest_level = 3
print(strongest_level)
# 3
print(bulbasaur_level)
# 3
```

Note that it isn't possible to create mutable references to constant values.
That's the reason why we declared `bulbasaur_level` mutable in the above example.
Doing otherwise would have triggered an error:

```anzen
let bulbasaur_level = 2
let strongest_level: @mut &- strongest_level
# cannot assign to reference: 'bulbasaur_level' is a constant
```

A reference always references a memory location,
and not the variable it is associated with.
As a result, it is not possible to create references to references.

```anzen
let bulbasaur_level = 2
let strongest_level &- strongest_level
let weakest_level &- strongest_level
```

In the above example,
`weakest_level` is a reference to the value associated with `bulbasaur_level`.
It has no relationship with `strongest_level`.

> Behind the scenes,
> Anzen keeps track of what variable is the original name a value was associated with.
> We will discuss this at length in the chapter about
> [Anzen's memory model]({{ site.baseurl }}manual/chapter-n).

The same way it isn't possible to create mutable references to constant values,
it isn't possible to create mutable references using constant references,
even if the original value is mutable.

```anzen
let bulbasaur_level: @mut = 2
let strongest_level &- strongest_level
let weakest_level: @mut &- strongest_level
# cannot assign to reference: 'strongest_level' is a constant reference
```

## Types

Although the previous examples do not specify what can be stored in a variable,
the Anzen compiler prevents putting arbitrary values in variables.
For instance, it is impossible to put a floating point number
into a variable that has been initialized with an integer:

```anzen
let pokemon_level: @mut = 1
pokemon_level = 2.3
# error: cannot assign value of type 'Double' to type 'Int'
```

Anzen is [strongly typed](https://en.wikipedia.org/wiki/Strong_and_weak_typing).
Every variable is given a unique [type](https://en.wikipedia.org/wiki/Type_system),
and can only store values that correspond to this type.
Weakly typed languages do not have this restriction.
Static typing also helps to ensure [type safety](https://en.wikipedia.org/wiki/Type_safety),
that prevents bugs in programs.

Type correctness is checked by the Anzen compiler.
Anzen ensures that each variable is unambiguously associated with a single type,
and that each operation on that variable is well defined for that type.
The language is thus said [statically typed](https://en.wikipedia.org/wiki/Type_system#STATIC).
On the contrary, a dynamically typed language performs type checking at runtime,
during the program execution.
Static typing also helps to ensure [type safety](https://en.wikipedia.org/wiki/Type_safety).

The type of a variable may not be explicit, but it always exists.
Anzen provides [type inference](https://en.wikipedia.org/wiki/Type_inference).
If the compiler can infer the type of a variable,
it automatically associates this type with the variable.

It is sometimes necessary to explicitly specify the type of a variable,
with what is called *type annotations*.
In the example below, the variable `pokemon_weight` is explicitly typed with `Double`
(for double precision floating point number),
which tells Anzen that it should consider it as a `Double` value:

```anzen
let pokemon_weight: Double
```

> Type inference should be preferred to explicit type annotation,
> as the latter can impair the code readability with unnecessary information.
> For instance, it is **highly discouraged** to write things like:
> ```anzen
> let weight: Kilogram = Kilogram(5.6)
> ```

The type of an expression can be retrieved with the built-in function `type(of:)`:

```anzen
let pokemon_weight = 5.1
print(type(of: pokemon_weight))
# Double
print(type(of: "Pikachu"))
# String
```

Types are first-class citizen in Anzen.
It means that they are also considered as values.
They can be assigned to variables, like any other value,
and can also be passed as parameters to the `print(_:)` or `type(of:)` functions.

```anzen
let t1 = type(of: "Pikachu")
print(t1)
# String
let t2 = type(of: t1)
print(t2)
# String.Type
let t3 = type(of: t2)
print(t3)
# String.Type.Type
```

First-class types are complex and come with some limitations.
They'll be covered in other parts of this manual.

## Enumerations

An enumeration defines a set of possible values for a type.
It can also be named
[union type](https://en.wikipedia.org/wiki/Union_type) in other programming languages.
An enumeration is used to represent types that can have a *fixed* set of possible contents.
Enumerations are not possible if the set of possible contents can be extended,
for instance by the programmer.
They must be fully defined in only one place of the source code.
Enumerations can represent very abstract concepts, like a set of possible shapes,
or more concrete data, like the possible configurations of a library.

An enumeration type is declared using the keyword `enum`,
and its different values with the keyword `case`:

```anzen
enum SpeciesType {
  case grass
  case fire
  case water
}
```

> An enumeration is a type.
> By convention, all type names start with a capital letter (`Int`, `String`, ...)
> and so should enumerations.
> The name of an enumeration should also be singular rather than plural,
> so that its use makes more sense in the code.

A variable of an enumeration type can only be of *one* of the enumeration cases.
Assignment is written using the qualified name of the case:

```anzen
let bulbasaur_species_type = SpeciesType.grass
```

If the type of the variable is explicitly defined or has already been inferred,
it is possible (and preferred) to omit the name of the enumeration:

```anzen
let bulbasaur_species_type: SpeciesType
bulbasaur_species_type = .grass
```

Enumeration cases can store *associated values*.
This allows to add information to particular cases:

```anzen
enum Consumable {
  case pokeball(catch_rate_multiplier: Double)
  case potion(restoration: Int)
}
let ultra_ball = Consumable.pokeball(catch_rate_multiplier: 2.0)
```

Notice that the above `ultra_ball` variable has type `Consumable`.
Hence, it is not possible to directly consider it as a `pokeball`
and access its `catch_rate_multiplier`.
This manual explains later how to obtain such information.

```anzen
ultra_ball.catch_rate_multiplier
// error: value of type 'Consumable' has no member 'catch_rate_multiplier'
```

Enumeration types can be *recursive*.
This is very useful for naturally recursive data structures,
such as [lists](https://en.wikipedia.org/wiki/List_(abstract_data_type)) or [trees](https://en.wikipedia.org/wiki/Tree_(data_structure)).

```anzen
enum IntList {
  case empty
  case cons(head: Int, tail: IntList)
}
let some_list: IntList = .cons(head: 1, tail: .cons(head: 2, tail: .empty))
```

In all above examples, we declared associated values with a label.
In some situations, it may be desirable to omit such information:

```anzen
enum BinaryTree {
  case leaf
  case node(_: BinaryTree, _: BinaryTree)
}
let some_tree : BinaryTree = .node(.leaf, right: .node(.leaf, .leaf))
```

> The use of labels of associated values is highly encouraged,
> unless their meaning is clearly obvious and would only impair code readability.

Enumerations are a very powerful tool in Anzen, and there is much more to talk about.
We'll cover more use cases in later chapters.

## Optionals

We've seen earlier that Anzen lets us declare references to arbitrary memory locations.
However, Anzen requires references to always refer to a valid and initialized memory location.
This makes sure you can safely use the value they reference at any time,
but the drawback is that it isn't possible to use
to represent memory locations that have yet to be initialized.

> In other programming languages, this is often represented by a
> [null pointer](https://en.wikipedia.org/wiki/Null_pointer).
> For instance, all objects in Java can be initialized with `null`,
> which represent the absence of a value.
> Anzen explicitly disallows this practice, because it is error-prone.

Instead, Anzen provides optional types to explicitly state what can be null.
An [optional type](https://en.wikipedia.org/wiki/Option_type) denotes a value
that may be present or not.
It is specified by appending the operator `?` to any type.
The original type is *wrapped* to add the case where it represents the absence of a value:

```anzen
let trainer1: String? = .nothing
let trainer2: String? = .some("Ash")
```

In the above example, the variable `trainer1` is declared to represent the absence of a value.
The variable `trainer2` is declared to represent a some value,
i.e. the string `"Ash"` in that example.

> The reader will notice that optionals look very similar to enumerations.
> That's because they are!
> In fact, Anzen just comes with a few syntactic sugars around optionals,
> which make their use easier.

Optional types take part in [type safety](https://en.wikipedia.org/wiki/Type_safety).
Their use is not transparent to the programmer: it differs from non-optionals.
Assignment to another variable requires that the other variable is also an optional.

```anzen
let trainer1: String? = .some("Ash")
let trainer2: String? = trainer1
let trainer3: String = trainer1
// error: value of optional type 'String?' not unwrapped; did you mean to use '!' or '?'?
```

Any optional can be converted to a non-optional value using the `!` operator.
Anzen returns the wrapped value if it exists,
or throws a runtime error if the optional value was in fact `.nothing`.
This operation is called *forced-unwrapping*:

```anzen
let trainer1: @mut String? = .some("Ash")
let trainer2: String = trainer1!

trainer1 = .nothing
trainer2 = trainer1!
// fatal error: found .nothing while forcibly unwrapping an optional
```

> Runtime errors are not recoverable.
> Hence you should never force-unwrap an optional
> unless your algorithm makes sure it will be assigned to a value before you do it.
> We'll see a way to do that later.

## Tuple

A [tuple](https://en.wikipedia.org/wiki/Tuple) is a container composed of two or more values.
It is a kind of [record data structure](https://en.wikipedia.org/wiki/Record_(computer_science)).
It can be initialized with a comma-separated list of bindings, enclosed in parentheses:

```anzen
let bulbasaur = (number = 001, name = "Bulbasaur")
```

> Unlike some other languages, adding padding zeros doesn't have any effect in Anzen.
> To seize numbers in binary, octal or hexadecimal,
> prefix your number with respectively `0b`, `0o` and `0x`.

Type inference makes sure that the `bulbasaur` constant is typed consistently
with the tuple type `struct { number: Int, name: String }`.
Nevertheless, such type information can be annotated as well:

```anzen
let bulbasaur: struct { number: Int, name: String }
bulbasaur = (number = 001, name = "Bulbasaur")
```

Assignment of a tuple value to a tuple variable must be valid with respect to typing,
as all other assignments.

```anzen
let pokemon: @mut = (number: 001, name: "Bulbasaur")
pokemon = (number = 002, name = "Ivysaur")
pokemon = (number = "003", name = "Venusaur")
// error: cannot assign value of type 'String' to type 'Int'
```

The values of a tuple are accessed by suffixing a tuple expression with `.label`,
where `label` is the tuple's value:

```anzen
print(bulbasaur.number)
// "Bulbasaur"
```

As with enumerations' associated values, it is possible to omit tuples value labels:

```
let pokemon: struct { _: Int, _: String }
let pokemon = (001, "Bulbasaur")
```

However, doing makes it impossible to retrieve values individually,
as we did with labels in previous examples.
This manual explains later how to obtain such information.

Tuple types (as well as other types) can become quite wordy.
Thanks to type inference, defining the tuple type is implicit in most situations.
But as we have seen, explicit typing may sometimes be desirable.
In order to avoid writing several times the same type (at different places in the code),
it is possible to create type aliases:

```anzen
type Species = struct { number: Int, name: String }
let bulbasaur: Species = (number = 001, name = "Bulbasaur")
let ivysaur: Species = (number = 002, name = "Ivysaur")
```

## Arrays

An array is a [collection](https://en.wikipedia.org/wiki/List_(abstract_data_type))
of values of homogeneous type (e.g. a collection of `String` values).
Arrays are declared with a comma-separated list of expressions, enclosed in square brackets `[]`:

```anzen
let species = [
  (number = 001, name = "Bulbasaur"),
  (number = 004, name = "Charmander"),
  (number = 007, name = "Squirtle"),
]
```

Type inference considers this array as an array of tuples `struct { number: Int, name: String }`,
as we have put values of such tuples within.

If the values of an array are not given upon initialization,
or if the array is initially empty,
it is necessary to explicitly type the array.
This behavior is similar to the declaration of any variable,
and more precisely similar to how optionals work.

```anzen
let species = []
# error: empty collection literal requires an explicit type

type Species = struct { number: Int, name: String }
let species: Array<Species>
species = [
  (number = 001, name = "Bulbasaur"),
  (number = 004, name = "Charmander"),
  (number = 007, name = "Squirtle"),
]
```

> Notice the use of angled brackets `<>` to specify the type of the array.
> This notation is used to denote the specialization of a generic type.
> We'll cover it at length later in this manual.

An empty array can be initialized with explicit type annotation using the following syntax:

```anzen
type Species = struct { number: Int, name: String }
let species = Array<Species>()
```

> Behind the scene, the above line calls an initializer of the Array<Species> type,
> which builds an empty array of Pokemon species.
> Then, the type inference is able to determine the type of the expression
> and thus the type of the variable.

Arrays are collections: they are indexed by `Int` values, starting at 0.
Their values can be accessed by subscripting the array
(i.e. using the square brackets `[]`) with the desired index.
Using a negative number or an index equal to or greater than the size of the array
will trigger a runtime error:

```anzen
let species = [
  (number = 001, name = "Bulbasaur"),
  (number = 004, name = "Charmander"),
  (number = 007, name = "Squirtle"),
]
print(species[1].name)
# Charmander
print(species[3].name)
# fatal error: index out of range
```

Slices are subparts of an array. They are themselves considered as arrays.
They can be accessed using a range rather than an `Int` value as the index of the subscript:

```anzen
print(species[1 .. 2][0])
# Charmander
```

The number of elements in an array is obtained by its `count` property:

```anzen
print(species.count)
# 3
```

> Trying to access or modify a value for an index that is outside of an array’s existing bounds
> will trigger a runtime error.
> Except when the array is empty,
> its valid indices are always comprised between 0
> and the its number of elements (its `count` property) - 1.

Notice that in all the examples above,
the `species` array was declared constant.
As a result, it is an immutable collection.
It is impossible to add or remove values to it, or change the value at a given index:

```anzen
let species = [
  (number = 001, name = "Bulbasaur"),
  (number = 004, name = "Charmander"),
  (number = 007, name = "Squirtle"),
]
species[0] = (number = 025, name = "Pikachu")
// error: cannot assign to value: 'species' is a constant
```

Mutable arrays have to be declared with the `@mut` type modifier:

```anzen
let species: @mut = [
  (number = 001, name = "Bulbasaur"),
  (number = 004, name = "Charmander"),
  (number = 007, name = "Squirtle"),
]
species[2] = (number = 025, name = "Pikachu")
species[1 .. 2] = [
  (number = 043, name = "Oddish"),
  (number = 016, name = "Pidgey")
]
```

Inserting a new value in an array is not possible with a subscript assignment.
Instead, the programmer must use the `Array.insert(element:at:)` function.
It inserts a new element at the position `at` and moves all remaining elements one index after:

```anzen
species[3] = (number = 025, name = "Pikachu")
// fatal error: index out of range
species.insert(element = (number = 025, name = "Pikachu"), at = 0)
```

Similarly, removing a value is performed with the `Array.remove(at:)` function.
It removes the element at index `at` and moves all remaining elements one index before:

```anzen
species.remove(at: 1)
```

## Sets

A [set](https://en.wikipedia.org/wiki/Set_(abstract_data_type))
is a collection of values of homogeneous type.
Arrays are declared with a comma-separated list of expressions suffixed by the symbol `:`,
enclosed in square brackets `[]`:

```anzen
let species_names = ["Bulbasaur":, "Charmander":, "Squirtle":]
```

If the values of a set are not given upon initialization,
or if the set is initially empty,
it is necessary to explicitly type the set.
This behavior is similar to the declaration of any variable,
and more precisely similar to how optionals work.

```anzen
let species_names: Set<String> = [-:]
```

> Notice the use of angled brackets `<>` to specify the type of the set.
> This notation is used to denote the specialization of a generic type.
> We'll cover it at length later in this manual.

An empty set can be initialized with explicit type annotation using the following syntax:

```anzen
let species_name = Set<String>()
```

> Behind the scene, the above line calls an initializer of the Set<String> type,
> which builds an empty array of species names.
> Then, the type inference is able to determine the type of the expression
> and thus the type of the variable.

As arrays, sets are immutable by default, and mutable if declared with the `@mut` type modifier.
They also define similar `Set.insert(_:)` and `Set.remove(_:)` functions,
and the `count` property.
A call to `remove(_:)` does not change anything if the value does not belong to the set.

```anzen
let species_names = ["Bulbasaur":, "Charmander":, "Squirtle":]
speciesNames.insert("Pidgey")
print(speciesNames.count)
# 4
speciesNames.remove("Pidgey")
print(speciesNames.count)
# 3
```

## Dictionaries

A [dictionary](https://en.wikipedia.org/wiki/Associative_array) is a mapping from keys to values.
Each key is associated with exactly one value or nothing.
Like a set, a key cannot appear more than once in a dictionary.
A same value can however be associated with multiple keys.
Dictionaries are written as a comma-separated list of key-value pairs `k: v`,
where `k` is a key and `v` its associated value:

```anzen
enum SpeciesType {
  case grass
  case fire
  case water
}
let species_types = ["Bulbasaur": SpeciesType.grass, "Charmander": SpeciesType.fire]
```

If the values of a dictionary are not given upon initialization,
or if the dictionary is initially empty,
it is necessary to explicitly type the dictionary.
This behavior is similar to the declaration of any variable,
and more precisely similar to how optionals work.

```anzen
let species_names: Dictionary<Key = String, Value = SpeciesType> = [-:]
```

> Notice the use of angled brackets `<>` to specify the type of the dictionary.
> This notation is used to denote the specialization of a generic type.
> We'll cover it at length later in this manual.

An empty dictionary can be initialized with explicit type annotation using the following syntax:

```anzen
let species = Dictionary<Key = String, Value = SpeciesType>()
```

> Behind the scene, the above line calls an initializer of the
> Dictionary<Key = String, Value = SpeciesType> type,
> which builds an empty array of species names.
> Then, the type inference is able to determine the type of the expression
> and thus the type of the variable.

Dictionaries are indexed by their keys.
This differs from arrays that are indexed by integers.
The values of a dictionary can be accessed by subscripting the dictionary,
using the square brackets `[]`, with the desired key.
+
```anzen
enum SpeciesType {
  case grass
  case fire
  case water
}
let species_types = ["Bulbasaur": SpeciesType.grass, "Charmander": SpeciesType.fire]
let bulbasaur_species = species_types["Bulbasaur"]!
```

Notice that the result is an optional.
The values returned by dictionary subscripts are optionals,
because the `.nothing` value is returned if the key does not exist.
This behavior differs from arrays, that raise an error in case of access outside the indices.
If the programmer knows that the key exists,
the `!` operator can be used to get a non-optional value.

As arrays, dictionaries are immutable by default,
and mutable if declared with the `@mut` type modifier.
Modification of the value associated to a key is similar to arrays:

```anzen
species_types["Bulbasaur"] = .water
```

Insertion and deletion differ from arrays,
as they are possible using subscripts:

```anzen
species_types["Oddish"] = .water
species_types["Charmander"] = nil
```

## Structures

Structures are [record types](https://en.wikipedia.org/wiki/Record_(computer_science)).
They allow to group together data.
They are similar to tuples, but have much more powerful features that will be seen later.

A structure is declared with the keyword `struct`,
and contains typed properties declared as variables or constants:

```anzen
type Species = struct { number: Int, name: String }
struct Pokemon {
  let species: Species
  let level: @mut Int
}
```

Structs can be initialized by providing them with a value for all their properties:

```anzen
let rainer = @mut Pokemon(species = (number = 134, name = "Vaporeon"), level = 58)
let sparky = Pokemon(species = (number = 135, name = "Jolteon"), level = 31)
```

> Anzen provides a default initializer for the `Pokemon` struct,
> as there is none explicitly defined.
> This initializer is called *memberwise initializer*,
> and requires to define values for all properties of the struct.
> We will see later how to declare custom initializers.

The `Pokemon` struct initializer is used to initialize the `rainer` variable,
which in turn initializes the properties of the struct (namely `species` and `level`).
Accessing the properties of a type instance is performed using the *dot syntax*:

```azen
print(rainer.level)
# 58
```

The property `rainer.level` can be mutated,
as the `rainer` is mutable **and** the `level` property is also a mutable.
On the contrary, it is impossible to assign `rainer.species`,
because the property declared constant,
or to assign `sparky.level`, because `sparky` is a constant.
If a struct is initialized as a constant, then none of its properties can be mutated,
no matter how they were declared:

```anzen
rainer.level = rainer.level + 1
print(rainer.level)
# 59
rainer.species = (number: 001, name: "Bulbasaur")
# error: cannot assign to property: 'species' is a constant
sparky.level = sparky.level + 1
# error: cannot assign to property: 'sparky' is a constant
```

repository: saucisson/anzen

repo_name: saucisson/anzen


text:
# WeRateDogs
solution for Udacity Data Analysis Professional Nanodegree Program (project #2)
## Reviwer Suggestions

1. Since it is a long notebook, a hyper-linked Table of Contents (TOC) would really help. [Here is how to add a TOC.](https://medium.com/@sambozek/ipython-er-jupyter-table-of-contents-69bb72cf39d3)

2. Here are some more resources that further help you choosing right kind of visualizations to represent various types of data/insights.

[Choosing the right chart type for your insight.](http://www.infographicsblog.com/chart-suggestions-a-thought-starter-andrew-abela/)
[How to pick the right chart type.](https://eazybi.com/blog/data_visualization_and_chart_types)
[When to use line chart vs area chart.](https://www.fusioncharts.com/blog/line-charts-vs-area-charts/)
[The difference between a bar chart and a histogram.](https://stattrek.com/statistics/charts/histogram.aspx)
[Why pie charts are not an ideal choice in most cases.](https://evolytics.com/blog/8-dont-use-pie-charts/)
[Quickly plot correlation between multiple variables is pandas using scatter matrix.](https://pandas.pydata.org/docs/reference/api/pandas.plotting.scatter_matrix.html)

## General Notes
1. With **[python seaborn libray](https://seaborn.pydata.org/tutorial.html)**, you can plot many different kind of charts apart.
2. PEP8 is the style guide for python. This style guide provides guidelines and best practices on how to write Python code to improve the readability of code and make it consistent across the wide spectrum of Python code. [You can take a look at this guide here;](https://www.python.org/dev/peps/pep-0008/) and should strive to adhere to these guidelines.


text:
JavaScript Thermostat
=========================

Have a look at the final version on Heroku: [JavaScript Thermostat](http://js-wall-thermostat.herokuapp.com/)

#### Challenge criteria:

Completion time 2-3 hours.

The challenge is to create a simple interface for a digital thermostat, like so:

![Thermostat](https://github.com/makersacademy/course/raw/master/images/thermostat.png)

Use the specifications below (hint: this could help you plan your Jasmine expectations).

Spec:

- Thermostat starts at 20 degrees
- You can increase the temp with the up button
- You can decrease the temp with the down button
- The minimum temperature is 10 degrees
- If powersaving mode is on, the maximum temperature is 25 degrees
- If powersaving mode is off, the maximum temperature is 32 degrees
- Power saving mode is default
- You can reset the temperature to 20 by hitting the reset button
- The thermostat should color the display based on energy usage - < 18 is green, < 25 is yellow, otherwise red
- After every temperature change, the thermostat makes a POST request to localhost:4567/temperature_change, with the new temperature

##Final version
![](public/images/screenshot_3.png)

##Version 1
![](public/images/screenshot.png)

Technologies and methods used:
- Javascript and JQuery
- Tested in Jasmine
- Styled with HTML and CSS

### Take a look at the code
```sh
git clone git@github.com:jamieallen59/Thermostat.git
cd Thermostat
```

### Run the tests
```sh
open SpecRunner.html
```


text:
[![Build Status](https://travis-ci.org/QianmiOpen/dubbo-rpc-jsonrpc.svg)](https://travis-ci.org/QianmiOpen/dubbo-rpc-jsonrpc)

## Why HTTP
With the rapid iteration of the Internet, more and more companies choose quick script frameworks such as nodejs, Django and rails to develop web-side applications.

Java is the most suitable for back-end service, which resulting in a lot of cross-language invocation requirements.

While HTTP and JSON are naturally suitable as cross-language standards, all languages have mature class libraries for them.

Although Dubbo's asynchronous long connection protocol is efficient, in scripting languages this loss of efficiency is not important.

## Why Not RESTful
Dubbo has made an attempt on the RESTful interface, but there is some difference between the REST architecture and the original RPC architecture of Dubbo.

The difference is that the REST architecture needs the definition of resources and we should operate the resources using the basic HTTP methods —— GET, POST, PUT, DELETE.

Dubbo needs to redefine the properties of the interface, which is a big burden on the original interface migration of Dubbo.

In contrast, RESTful is more appropriate for calls between Internet systems, and RPC is more appropriate for calls within a system, so we used JsonRPC which is more consistent with the Dubbo concept.

dubbo-rpc-jsonrpc
=====================

## maven dependency：
```xml
<dependency>
    <groupId>com.qianmi</groupId>
    <artifactId>dubbo-rpc-jsonrpc</artifactId>
    <version>2.0.0-SNAPSHOT</version>
</dependency>

```

## Configuration：
Define jsonrpc protocol:
```xml
 <dubbo:protocol name="jsonrpc" port="8080" server="jetty" />
```

Set default protocol:
```xml
<dubbo:provider protocol="jsonrpc" />
```

Set service protocol:
```xml
<dubbo:service protocol="jsonrpc" />
```

Multi port:
```xml
<dubbo:protocol id="jsonrpc1" name="jsonrpc" port="8080" />
<dubbo:protocol id="jsonrpc2" name="jsonrpc" port="8081" />
```
Multi protocol:
```xml
<dubbo:protocol name="dubbo" port="20880" />
<dubbo:protocol name="jsonrpc" port="8080" />
```
<!-- use multi protocols to expose the service -->
```xml
<dubbo:service id="helloService" interface="com.alibaba.hello.api.HelloService" version="1.0.0" protocol="dubbo,jsonrpc" />
```

yml文件配置 dubbo协议和jsonrpc协议
```xml
dubbo:
  scan:
    base-packages: com.gjzq.gdsy.modules.*
  protocols:
    dubbo:
      name: dubbo
      port: 12346
    jsonrpc:
      name: jsonrpc
      port: 12347
      server: jetty9
  registry:
    address: zookeeper://<IP_ADDRESS>:2181
```

Jetty Server: (default)
```xml
<dubbo:protocol ... server="jetty" />

or the latest version of jetty:
<dubbo:protocol ... server="jetty9" />

```
Maven:
```xml
<dependency>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty</artifactId>
  <version>6.1.26</version>
</dependency>
```

Servlet Bridge Server: (recommend)
```xml
<dubbo:protocol ... server="servlet" />

```

web.xml：
```xml
<servlet>
         <servlet-name>dubbo</servlet-name>
         <servlet-class>com.alibaba.dubbo.remoting.http.servlet.DispatcherServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
         <servlet-name>dubbo</servlet-name>
         <url-pattern>/*</url-pattern>
</servlet-mapping>
```
Be careful if you are using a servlet to send requests:

The protocol port ```<dubbo:protocol port="8080" />``` must be the same as the port of the servlet container.
The protocol context path ```<dubbo:protocol contextpath="foo" />``` must be the same as the servlet application context path.

CORS(Cross-origin resource sharing):
```xml
<dubbo:protocol name="jsonrpc" ...  />
	<dubbo:parameter key="cors" value="true" />
</dubbo:protocol>
```
--------------
## Example

JAVA API
```java
public interface PhoneNoCheckProvider {
    /**
     * check if the number is limited
     * @param operators  operators
     * @param no  number
     * @param userid  the user identity
     * */
    boolean isPhoneNoLimit(Operators operators, String no, String userid);
}
```
Client
```shell
curl -i -H 'content-type: application/json' -X POST -d '{"jsonrpc": "2.0", "method": "isPhoneNoLimit", "params": [ "MOBILE", "130000", "A001"],
         "id": 1 }' 'http://<IP_ADDRESS>:18080/com.qianmi.api.PhoneNoCheckProvider'
```

Python Client Example
```python
import httplib
import json

__author__ = 'caozupeng'

def raw_client(app_params):
    headers = {"Content-type": "application/json-rpc",
               "Accept": "text/json"}
    h1 = httplib.HTTPConnection('<IP_ADDRESS>', port=18080)
    h1.request("POST", '/com.qianmi.ofdc.api.phone.PhoneNoCheckProvider', json.dumps(app_params), headers)
    response = h1.getresponse()
    return response.read()

if __name__ == '__main__':
    app_params = {
        "jsonrpc": "2.0",
        "method": "isPhoneNoLimit",
        "params": ["MOBILE", "130000", "A001"],
        "id": 1
    }
    print json.loads(raw_client(app_params), encoding='utf-8')
```

## Python client
https://github.com/QianmiOpen/dubbo-client-py

## Node.js client
https://github.com/QianmiOpen/dubbo-node-client

## Examples for Client server
https://github.com/JoeCao/dubbo_jsonrpc_example
run with docker

## Browser call
You need to enable CORS support as described above, see https://github.com/datagraph/jquery-jsonrpc

## Documentation

[JSON-RPC 2.0 Specification](http://www.jsonrpc.org/specification)

[jsonrpc4j](https://github.com/briandilley/jsonrpc4j)

[dubbo procotol](http://www.dubbo.io/Protocol+Reference-zh.htm)

专用 spring boot 的maven依赖
```xml
        <!-- Zookeeper dependencies -->
        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-dependencies-zookeeper</artifactId>
            <version>${dubbo.version}</version>
            <type>pom</type>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j</artifactId>
                    <groupId>log4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.qianmi</groupId>
            <artifactId>dubbo-rpc-jsonrpc</artifactId>
            <version>2.0.0-SNAPSHOT</version>
        </dependency>

        <!-- 引入Jetty容器-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
        </dependency>
```


text:
# fiddle (working title)

<img src="./.github/logo192.png" alt="fiddle logo" align="right" width="100" />

Welcome to the repository for fiddle.
This app helps musicians collaborate rapidly using their smartphone.
The rapid collaboration is enabled by built in microphones and the ability to record over eachothers audio recordings and sending back consolidated audio files.

This is the capstone project of my twelve week web development bootcamp at "neue fische" in Cologne, Germany

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development purposes.

### Installing

After cloning this to your machine, you need to install node_modules on both client and server

Due to `postinstall` you'll only need to do it once in the top level directory.

```
npm install
```

### env Variables you'll need

You will need one .env.development file in your client directory which contains this:

```
REACT_APP_WS_URL=ws://localhost:8080 (Has to match the port in the top level .env)
```

As this application is developed with MongoDB you'll need a .env file in your top level directory with the following content:

```
MONGO_DB_URL = mongodb://<YOUR_MONGO_DB_IP>:<YOUR_MONGO_PORT_PROBABLY_27017>/
MONGO_DB_NAME = <YOUR_MONGO_DB_NAME>
PORT=8080 (Or whatever you prefer)
```

### Running the application

Open two terminals next to eachother

First terminal

```
npm run server
```

Second Terminal

```
npm run client
```

repository: sascharissling/fiddle

repo_name: sascharissling/fiddle


text:
# Security Policy

## Supported Versions
Welcome to our new security policy. It means that anyone could report security issues with csv-safe gem. Below are the versions in which security issues could reported.

| Version | Supported          |
| ------- | ------------------ |
| 3.0.0   | :white_check_mark: |
| < 3.0.0 | :x:                |

## Reporting a Vulnerability

If you found a security issue with csv-safe, you could create an issue on our repository. If possible create a PR with a fix as well.

Your contribution would be acknowledged below:-

| Contributor                  | Contribution                                 | CVE (If Any)   |
| ---------------------------- | -------------------------------------------- | -------------- |
| Danish Tariq & Gabriel Rios  | https://github.com/zvory/csv-safe/issues/7   |                |

repository: zvory/csv-safe

gha_language: Ruby

repo_name: zvory/csv-safe


text:
# SIAM CSE21 Software-Related Events

<!-- deck text start -->
The SIAM Conference on Computational Science and Engineering is a large and well-known event in our community, and includes a growing number of software-related sessions.  Please join us there!
<!-- deck text ends -->

- Date: March 1 - March 5, 2021
- Location: Virtual
- Website: https://www.siam.org/conferences/cm/conference/cse21
- Organizers: The "Software Community"

<!-- Too many contributors, so we'll take a pass
#### Contributed by [Lois Curfman McInnes](https://github.com/curfman "Lois Curfman McInnes GitHub profile"), [Stuart Yates](https://github.com/ "GitHub profile"), [Hai Ah Nam](https://github.com/hnamlanl "Hai Ah Nam GitHub profile"), [Damian Rouson](https://github.com/ "GitHub profile"), [Kyle E. Niemeyer](https://github.com/ "GitHub profile"), [David E. Bernholdt](https://github.com/bernhold "David E. Bernholdt GitHub profile"), [Rene Gassmoeller](https://github.com/ "GitHub profile"), [Sandra Gesing](https://github.com/ "GitHub profile"), [Rinku Gupta](https://github.com/ "GitHub profile"), [Shoaib Sufi](https://github.com/ "GitHub profile"), [Anshu Dubey](https://github.com/ "GitHub profile"), [Boyana Norris](https://github.com/ "GitHub profile"), [Kanika Sood](https://github.com/ "GitHub profile")
-->
#### Contributed by the BSSw Community

#### Publication date: February 5, 2021

**If you know of other events which should be featured here, please let us know by emailing<EMAIL_ADDRESS>
Session | Session Title (see linked program page for full details)
--------|---------------------------------------------------------
MS30 | [Software Productivity and Sustainability for CSE](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70085)
MS68 | [Better Scientific Software Fellowship](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70202)
PD1 | [Panel Discussion on Diversity and Inclusion for Careers in CSE: Challenges and Best Practices - Part I of III](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=71877)
PD2 | [Panel Discussion on Diversity and Inclusion for Careers in CSE: Challenges and Best Practices - Part II of III](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=71878)
PD3 | [Panel Discussion on Diversity and Inclusion for Careers in CSE: Challenges and Best Practices - Part III of III](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=71881)
MS94 | [Building Sustainable Software Communities and Sustainable Software - Part I of II](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70102)
MS125 | [Building Sustainable Software Communities and Sustainable Software - Part II of II](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70103)
PP7 | [Minisymposterium: Software Productivity and Sustainability for CSE](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70380)
MS162 | [Exascale Computing Project Performance Portability Analysis - Part I of II](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=69992)
MS192 | [Exascale Computing Project Performance Portability Analysis - Part II of II](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=69993)
MS187 | [Data-Driven Analysis of Scientific Software Quality, Availability, and Development Productivity](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70248)
MS218 | [Broader Engagement (BE): Surviving Headless State: Sucessful Git/GitHub Workflows](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70303)
MS251 | [Enhancing Sustainability and Productivity for Research Software - Part I of II](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70274)
MS278 | [Enhancing Sustainability and Productivity for Research Software - Part II of II](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70275)
MS298 | [Wash Your Hands, Wear a Mask, Keep the Bugs Out](https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=70066)

The [SIAM CSE21](https://www.siam.org/conferences/cm/conference/cse21) conference seeks to enable in-depth technical discussions on a wide variety of major computational efforts on large-scale problems in science and engineering, foster the interdisciplinary culture required to meet these large-scale challenges, and promote the training of the next generation of computational scientists.

Please check the [CSE21 Program webpage](https://www.siam.org/conferences/cm/program/program-and-abstracts/cse21-program-abstracts) for further details and updates.

<!---
Publish: yes
RSS update: 2021-02-05
Categories: development, collaboration
Topics: software engineering, projects and organizations
Tags: conference
Level: 2
Prerequisites: default
Aggregate: none
--->

gha_language: Python