text:
# apimocker [![Build Status](https://api.travis-ci.org/gstroup/apimocker.svg?branch=master)](https://travis-ci.org/gstroup/apimocker)
[![NPM](https://nodei.co/npm/apimocker.svg?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/apimocker/)

This is a node.js module to run a simple http server, which can serve up mock service responses.
Responses can be JSON or XML to simulate REST or SOAP services.
Access-Control HTTP Headers are set by default to allow CORS requests.
Mock services are configured in the config.json file, or on the fly, to allow for easy functional testing.
Apimocker can return different responses or HTTP status codes, based on request parameters - even complex JSON requests.
Using apimocker, you can develop your web or mobile app with no dependency on back end services.
(There are lots of these projects out there, but I wrote this one to support all kinds of responses,
to allow on-the-fly configuration, and to run in node.)

## Installation
		sudo npm install -g apimocker
That will install globally, and allow for easier usage.
(On Windows, you don't need "sudo".)

## Usage
        apimocker \[-c, --config <path>\] \[-q, --quiet\] \[-p <port>\] \[-f, --proxy <proxyURL>\] \[-i, --intercept <proxyIntercept>\]

Out of the box, you can just run "apimocker" with no arguments.
(Except on windows, you'll need to edit config.json first.  See below.)

Then you can visit "http://localhost:7878/first" in your browser to see it work.
The quiet and port options can also be set in the config.json file,
and values from config.json will override values from the command line.
After you get up and running, you should put your config.json and mock responses in a better location.
It's not a good idea to keep them under the "node_modules" directory.
Make sure another process is not already using the port you want.
If you want port 80, you may need to use "sudo" on Mac OSX.

### Windows note
After installing from npm, you may need to edit this file:
        /Users/xxxxx/AppData/Roaming/npm/node_modules/apimocker/config.json
Change the "mockDirectory" to point to this location.
(Or another location where you put the mock responses.)
        mockDirectory: /Users/xxxxx/AppData/Roaming/npm/node_modules/apimocker/samplemocks

### Proxy
Sometimes you only want some service endpoints to be mocked, but have other requests forwarded to real service endpoints.
In this case, provide the proxy URL option on startup e.g.
`apimocker --proxy http://myrealservice.io`
When the proxy option is set, any requests to apimocker with URLs that are not configured with mock files, will be forwarded to the specified URL.

A proxy intercept function can be specified to modify responses, using the proxy intercept option (`apimocker --proxy http://myrealservice.io` --intercept config/proxyResponseCustomizer`). The value of the option should be the path, relative to the current working directory, to a module that exports an intercept function as documented in the [express-http-proxy docs](https://github.com/villadora/express-http-proxy#intercept).

### Uploads
There is a simple support of `multipart` form data upload process of a single or multiple files. A global option `uploadRoot` determines where the files will be saved after successful upload, and another option - `useUploadFieldname` tells apimocker (actually - [multer](https://github.com/expressjs/multer)) whether to save the uploaded file with the original filename found in the request (default), or the name of the field. Although the latter may sound strange, it can make certain testing procedure simpler.

### With Grunt or Gulp
If you're using Grunt for your project, there's a grunt plugin you can use to start up apimocker:
https://github.com/gstroup/grunt-apimocker

For Gulp, there's also a plugin contributed by kent-wu:
https://github.com/kent-wu/gulp-apimocker

### Running in Cloud Foundry
You can deploy apimocker into a cloud foundry instance by running `cf push`.  The port you specify will be ignored, and you'll use the standard port 80 to access apimocker.  When specifying your mockDirectory, you will need to use a relative path, like "samplemocks/".  At this time, you'll need to do another build and push whenever you change a mock file.

### Help
        apimocker -h

## Configuration
On startup, config values are loaded from the config.json file.
During runtime, mock services can be configured on the fly.
See the sample config.json file in this package.

* Config files can be either `.json` format, or in `.js`. When using `.js`, the module should export a config object, or a function that returns a config object.
* Services can be configured to return different responses, depending on a request parameter or request header.
* Content-type for a service response can be set for each service.  If not set, content-type defaults to application/xml for .xml files, and application/json for .json files.
* HTTP Status code can be set for each service.
* Latency (ms) can be set to simulate slow service responses.  Latency can be set for a single service, or globally for all services.
* Allowed domains can be set to restrict CORS requests to certain domains.
* Allowed headers can be set.  (Default is to set "access-control-allow-headers: Content-Type" if not specified in config file.)
* config.json file format has changed with the 0.1.6 release.  See below for the new format.  (Old config.json file format is deprecated and doesn't support new features, but still functioning.)
* mockDirectory value can include tilde (~) for user's home directory.
* A basepath can be specified to set a prefix on all web services.  Preceding slash is required.  For instance if basepath is set to "/apimocker", then all requests must go to "http://localhost:7878/apimocker/..."
* A static route can be opened up to serve up static assets like images.  Both staticDirectory and staticPath must be set.  If either is not set, then nothing happens.
* Additional headers can be defined for responses, in the `headers` object.  Different headers could be returned for different requests, by enabling a switch.
* Request headers can be logged, with the `logRequestHeaders` setting.
* Alternate URL paths can be specified with the `alternatePaths` setting.
* With the `enableTemplate` setting, values from the request can be inserted into the mock response.
* With the `templateSwitch` setting, parameter names and values from the request can be mapped and inserted into the mock response, including POST requests and powerful JSONPath parameter substitution into a JSON POST body.
* Set the `allowAvoidPreFlight` config option to true to allow requests sent with `Content-Type: text/plain` to be processed as json if possible. (default is false).  This allows apimocker to work with servers such as Parse Server.

```json
{
  "note": "This is a sample config file. You should change the mockDirectory to a more reasonable path.",
  "mockDirectory": "/usr/local/lib/node_modules/apimocker/samplemocks/",
  "staticDirectory": "/optional/file/system/path/to/static/directory",
  "staticPath": "/optional/web/path/to/static/directory",
  "quiet": false,
  "port": "7878",
  "latency": 50,
  "logRequestHeaders": false,
  "allowedDomains": ["abc.com"],
  "allowedHeaders": ["Content-Type", "my-custom-header"],
  "corsCredentials": "true",
  "webServices": {
    "first": {
      "mockFile": "king.json",
      "latency": 20,
      "verbs": ["get"],
      "alternatePaths": ["1st"]
    },
    "second": {
      "verbs": ["delete", "post"],
      "responses": {
        "delete": {"httpStatus": 204},
        "post": {
          "contentType": "foobar",
          "mockFile": "king.json"
        }
      }
    },
    "nested/ace": {
      "mockFile": "ace.json",
      "verbs": ["post", "get"],
      "switch": "customerId"
    },
    "nested/ace2": {
      "mockFile": "ace.json",
      "verbs": ["post", "get"],
      "switch": ["customerId","multitest"]
    },
    "var/:id": {
      "mockFile": "xml/queen.xml",
      "verbs": ["all"],
      "switch": "id"
    },
    "login": {
      "verbs": ["post"],
      "switch": ["userId", "password"],
      "responses": {
        "post": {"httpStatus": 401, "mockFile": "sorry.json"}
      },
      "switchResponses": {
        "userIduser1passwordgood": {"httpStatus": 200, "mockFile": "king.json"},
        "userIdadminpasswordgood": {"httpStatus": 200}
      }
    },
    "nested/aceinsleeve": {
      "verbs": [
        "post"
      ],
      "switch": "$..ItemId[(@.length-1)]",
      "responses": {
        "post": {"httpStatus": 200, "mockFile": "aceinsleeve.json"}
      },
      "switchResponses": {
        "$..ItemId[(@.length-1)]4": {"httpStatus": 500, "mockFile": "ItemId4.aceinsleeve.json"}
      }
    },
    "firstheaders": {
      "mockFile": "king.json",
      "contentType": "foobar",
      "headers": {
        "x-requested-by": "4c2df03a17a803c063f21aa86a36f6f55bdde1f85b89e49ee1b383f281d18c09c2ba30654090df3531cd2318e3c",
        "dummyheader": "dummyvalue"
      },
      "verbs": ["get"]
    },
    "template/:Name/:Number" :{
      "mockFile": "templateSample.json",
      "verbs":["get"],
      "enableTemplate": true,
      "contentType":"application/json"
    },
    "raw": {
      "mockBody": "{ \"text\" : \"Good Job!\" }",
      "verbs": ["all"]
    }
  }
}
```
The most interesting part of the configuration file is the webServices section.
This section contains a JSON object describing each service.  The key for each service object is the service URL (endpoint.)  Inside each service object, the `mockFile` (or `mockBody`) and `verbs` are required.  All other attributes of the service objects are optional.
For instance, a GET request sent to "http://server:port/first" will return the king.json file from the samplemocks directory, with a 20 ms delay. Alternatively one can specify the `mockBody` directly, bypassing the need for a specific mock file.
If you'd like to return different responses for a single URL with different HTTP verbs ("get", "post", etc) then you'll need to add the "responses" object.  See above for the "second" service.  The "responses" object should contain keys for the HTTP verbs, and values describing the response for each verb.

### Switch response based on request parameter
In your configuration, you can set up a "switch" parameter for each service.  If set, apimocker will check the request for this parameter, and return a different file based on the value.  (Apimocker will check the request for the parameter in this order: first request body, second query string, third request headers.)  For instance, if you set up a switch as seen above for "nested/ace", then you will get different responses based on the request sent to apimocker.  A JSON POST request to the URL "http://localhost:7878/nested/ace" with this data:
```js
{
  "customerId": 1234
}
```
will return data from the mock file called "customerId1234.ace.json".  Switch values can also be passed in as query parameters:
        http://localhost:7878/nested/ace?customerId=1234
or as part of the URL, if you have configured your service to handle variables, like the "var/:id" service above:
        http://localhost:7878/var/789
If the specific file, such as "customerId1234.ace.json" is not found, then apimocker will attempt to return the base file: "ace.json".

For simple switching, you can use strings as shown in the configuration above.  For more complex switching, using RegExp or JsonPath, you can use switch objects, to describe each switch.
```js
{
	"type": "one of these strings: default|regexp|jsonpath",
	"key": "identifier used in mock file name",
	"switch": "string | regular expression | json path expression"
}
```

#### Multiple switches
You can now also define an array of values to switch on. Given the configuration in "ace2", a request to "nested/ace2" containing:
```js
{
  "multitest": "abc",
  "customerId": 1234
}
```
will return data from the mock file called "customerId1234multitestabc.ace.json".  Note that when using multiple switches, the filename must have parameters in the same order as configured in the "switch" setting in config.json.
Also, apimocker will look for the filename that matches ALL the request parameters.  If one does not match, then the base file will be returned.

#### Switch HTTP Status
To specify a different HTTP status, depending on a request parameter, you'll need to set up the "switchResponses" as shown above for the "login" service.  You can also set a specific mock file using the "switchRespones" configuration.  The switchReponses config section is an object, where the key is a composite of the switch keys specified in the "switch" setting for the service, and the values for each key, passed in as request parameters.  For instance, a post request to "/login" containing:
```js
{
  "userId": "user1",
  "password": "good"
}
```
will return data from the mock file called "king.json", with HTTP status 200.
Any other password will return "sorry.json" with HTTP status 401.

#### JsonPath Support
For complex JSON requests, JsonPath expressions are supported in the switch parameter. If your switch parameter begins with "$." then it will be evaluated as a JsonPath expression.
For example to switch the response based on the value of the last occurence of ItemId in a JSON request, use configuration as shown for "aceinsleeve":
```js
"switch": "$..ItemId[(@.length-1)]",
  "responses": {
    "post": {"httpStatus": 200, "mockFile": "aceinsleeve.json"}
  },
  "switchResponses": {
    "$..ItemId[(@.length-1)]4": {"httpStatus": 500, "mockFile": "ItemId4.aceinsleeve.json"}
  }
```
According to this configuration, if the value of the last occurence of ItemId is 4, the mockFile "ItemId4.aceinsleeve.json" will be retured with a HTTP status code of 500. Otherwise, mockFile "aceinsleeve.json"
will be returned with HTTP status 200. Note: If the JsonPath expression evaluates to more then 1 element (for example, all books cheaper than 10 as in<EMAIL_ADDRESS>< 10)] ) then the first element is considered for testing the value.

#### JsonPath with Switch Response support
For requests that without any params should be returning a list of items (e.g. `/users`), and with some param just single item (e.g. `/users/:id`) there are special configuration options provided to select those single items from prepared mock json file containing list of items. No need to create separate files per each parameter.
Example mock file could look like this:
```js
[
    {
        "name": "Han Solo",
        "role": "pilot",
        "id": 1
    },
    {
        "name": "Chewbacca",
        "role": "first officer",
        "id": 2
    },
    {
        "name": "C3P0",
        "role": "droid",
        "id": 3
    },
    {
        "name": "R2D2",
        "role": "droid",
        "id": 4
    }
]
```

and example configurataion like this:

```js
"users": {
  "mockFile": "users.json",
  "verbs": [
    "get"
  ]
},
"users/:id": {
  "mockFile": "users.json",
  "verbs": [
    "get"
  ],
  "switch": "id",
  "jsonPathSwitchResponse": {
      "jsonpath": "$[?(@.id==#id#)]",
      "mockFile": "users.json",
      "forceFirstObject": true
  }
},
"users/role/:role": {
  "mockFile": "users.json",
  "verbs": [
    "get"
  ],
  "switch": "role",
  "jsonPathSwitchResponse": {
    "jsonpath": "$[?(@.role==\"#role#\")]",
    "mockFile": "users.json",
    "forceFirstObject": false
  }
}
```

The first config property (`users`) contains just a standard `get` for all users. The second (`users/:id`) and third though (`users/role/:role`), contains a proper switch configuration and `jsonPathSwitchResponse` config that contains following parameters:
* jsonpath - this is a JsonPath selector for objects to match inside `mockFile`; parameters values from switch are transferred to it's corresponding names wrapped in `#` characters,
* mockFile - a file name with mocked response to search through,
* forceFirstOject - (default: false) this is a switch telling if we should return all found items as an array, or select first one and return it as an object.

So it is possible to select just a single user by id as an object (`/users/1`), but it is also possible to return multiple users as an array (`users/role/droid`).

#### RegExp Support
As an alternative to JsonPath, Javascript Regular Expressions are supported in the switch parameter.  See unit tests in the test.js file for examples of using Regular Expressions.

### Returning additional headers with the response
To return additional custom headers in the response, set the headers map in the configuration file, like this example:
```js
    "firstheaders": {
      "mockFile": "king.json",
      "contentType": "foobar",
      "headers": {
        "x-requested-by": "4c2df03a17a803c063f21aa86a36f6f55bdde1f85b89e49ee1b383f281d18c09c2ba30654090df3531cd2318e3c",
        "dummyheader": "dummyvalue"
      },
      "verbs": ["get"]
    }
```
In this example the headers x-requested-by and dummy will be returned on the response.  contentType can be specified separately, as it is above, or specified as "content-type" in the "headers" map.

### Templating your response
Templating is a powerful feature which allows values in the route,  request parameters, or POST data to be inserted into the response, be it JSON, HTML, etc.

To utilize this capability, in the request string, insert a colon followed by a variable identifier at the location where the value should be substituted. Then set "enableTemplate" to true, specify a content type, and in the response file, wherever the substitution should appear, insert the '@' symbol followed by the chosen variable identifier. This placeholder can appear anywhere in the mock template file, including in multiple places.

 In this first example, the values represented by Name and Number will be taken from the request and substituted into the response:

config.json
```js
 "template/:Name/:Number" :{
   "mockFile": "templateSample.json",
   "verbs":["get"],
   "enableTemplate": true
   "contentType":"application/json"
 }
```
templateSample.json
```js
{
  "Name": "@Name",
  "Number": "@@Number"
}
```

When you call /John/12345 you will be returned:
```js
{
	"Name": "John"
	"Number": 12345
}
```

### TemplateSwitch your response
Another form of templating uses the `templateSwitch` setting. This feature uses the same structure as the `switch` setting and is similar but more flexible than the `enableTemplate` feature in order to map parameter names and values from the request into the mock  template response. GET and POST requests are supported including powerful JSONPath parameter substitution, even substitution into a JSON POST BODY.

To utilize this capability, add the templateSwitch section, specify a content type for the template file, and in the response file, wherever the substitution should appear, insert the '@' symbol followed by the chosen variable identifier. This placeholder can appear anywhere in the mock template file, including in multiple places.

The two templateSwitch examples show the flexibility of the templateSwitch syntax.

config.json with full switch attributes:
```js
    "referral" : {
      "mockFile": "referral_error.json",
      "verbs": ["post"],
      "templateSwitch": [{"key": "partnerUserId",
                         "switch": "$.data.partner_user_id",
                         "type": "default"},
                         {"key": "affiliateKey",
                          "switch": "$.data.affiliate_key",
                          "type": "default"},
                         {"key": "email",
                          "switch": "$.data.contact_details.email",
                          "type": "default"},
                         {"key": "phone",
                          "switch": "$.data.contact_details.phone_number",
                          "type": "default"}],
      "contentType": "application/json",
      "responses": {
        "post": {"httpStatus": 200, "mockFile": "referral_success.json"}
      }
    },
```

config.json using key == switch, and type as default. This route returns an HTML mock template.
```js
    "partner-join" : {
        "mockFile": "ijd_partner_smartbanner.html",
        "verbs":["get"],
        "templateSwitch": ["partner_user_id",
                           "affiliate_key",
                           "referral_id",
                           "email",
                           "phone"],
        "contentType":"text/html"
    },
```

with referral_success.json:
```js
{
    "data" : {
      "partner_user_id": "@@partnerUserId",
      "referral_id": "21EC2020-3AEA-4069-A2DD-08002B30309D",
      "download_url" : "http://localhost:7878/app-download?affiliate_key=@affiliateKey&partner_user_id=@partnerUserId&referral_id=21EC2020-3AEA-4069-A2DD-08002B30309D&email=@email&phone=@phone"
    }
}
```

A POST request to /referral with a JSON POST body of:
```js
   {
       "data": {
             "partner_user_id": 123456789,
             "affiliate_key": "ABCDEFG12345",
             "contact_details": {
                 "email"<EMAIL_ADDRESS>                 "phone": "800-555-1212"
             }
       }
   }
```

Will  result in the referral_success.json with the POST body parameters inserted as follows:
```js
{
    "data" : {
      "partner_user_id": 123456789,
      "referral_id": "21EC2020-3AEA-4069-A2DD-08002B30309D",
      "download_url" : "http://localhost:7878/app-download?affiliate_key=ABCDEFG12345&partner_user_id=123456789&referral_id=21EC2020-3AEA-4069-A2DD-08002B30309D&email=test%40apimocker.com&phone=800-555-1212"
    }
}
```
NOTE: In the template and templateSwitch examples above, special cases are included which will now be described below:

For a JSON template, if the value for the JSON key to be returned should be a numeric value, not a value wrapped in quotes, it is recommended to use the following convention: prefix the variable identifier with two '@' instead of one and within quotes: (e.g: "@@Number"). This tells the template parser to replace the quotes immediately before and after the placeholder as part of the templating process. This allows the mock JSON templates to remain valid JSON while still providing the ability to return numeric-only values.

### Adding custom middleware
For advanced users, apimocker accepts any custom middleware functions you'd like to add.  The `middlewares` property is an array of middleware functions you can modify.  Here's a basic example:
```
var apiMocker = require("../lib/apimocker.js");
var customMiddleware = function(req, res, next) {
		res.header('foo', 'bar');
		next();
	};
var mocker = apiMocker.createServer({quiet: true}).setConfigFile("test/test-config.json");
mocker.middlewares.unshift(customMiddleware);
mocker.start(null, done);
```

## Runtime configuration
After starting apimocker, mocks can be configured using a simple http api.
This http api can be called easily from your functional tests, to test your code's handling of different responses.

### /admin/setMock
This allows you to set a different response for a single service at any time by sending an http request.
Request can be a post containing a JSON object in the body:
```js
{
	"verb":"get",
	"serviceUrl":"third",
	"mockFile":"queen.xml",
    "latency": 100,
    "contentType": "anythingyouwant"
}
```

or a get with query string parameters:
localhost:7878/admin/setMock?verb=get&serviceUrl=second&mockFile=ace.json

### /admin/reload
If the config.json file is edited, you can send an http request to /admin/reload to pick up the changes.

## Versions
See version history here: [HISTORY.md](HISTORY.md)

## Contributors
Run "grunt watch" in the root "apimocker" directory to start the grunt watch task.  This will run eslint and mocha tests.
All Pull Requests must include at least one test.

## Acknowledgements
Big thanks to magalhas for his httpd-mock project.  This gave me a great starting point.
Also thanks to clafonta and the Mockey project for inspiration.

## License
This projected is licensed under the terms of the MIT license.

repository: gstroup/apimocker

gha_language: JavaScript

repo_name: gstroup/apimocker


text:
# GrpcPool

gRPC Client Pool Library for .Net

*Project Description*

gRPC is a Google remote procedure calling framework.

GrpcPool is base Google.Api.Gax.Grpc.

This sample is a library contains an gRPC client that you can use to connect to any gRPC. It is developed in C# language and works on all the following .Net platforms :

* .Net Framework (up to 4.5)
* not test below:
* .Net Compact Framework 3.5 & 3.9 (for Windows Embedded Compact 7 / 2013)
* .Net Micro Framework 4.2 & 4.3
* Mono (for Linux O.S.)
* .Net Core 1.0

*Bin package install*
```
Install-Package GrpcPool
```

For all information about gRPC, please visit official web site  http://www.grpc.io/.

*Building the source code*

The library is available for the following solution and project files :

* GrpcPool.sln : solution for Visual Studio 2015 that contains projects file for .Net Framework 4.5.2.

*SSL/TLS support*

The SSL/TLS feature, searching the test code please.

*Example*

Following an example of client to sync get pool :

```
IEnumerable<string> emptyScopes = Enumerable.Empty<string>();
ServiceEndpoint endpoint = new ServiceEndpoint(TestCredentials.DefaultHostOverride, Port);
var pool = new GrpcPool(emptyScopes);
var channel = pool.GetChannel(endpoint);
var client = new Greeter.GreeterClient(channel);
String user = "you";

var reply = client.SayHello(new HelloRequest { Name = user });
Console.WriteLine("Greeting: " + reply.Message);

channel.ShutdownAsync().Wait();
```

Following an example of client to sync get SSL pool :

```
IEnumerable<string> emptyScopes = Enumerable.Empty<string>();
ServiceEndpoint endpoint = new ServiceEndpoint(TestCredentials.DefaultHostOverride, SslPort);
var pool = new GrpcPool(emptyScopes);
var channel = pool.GetChannel(endpoint, clientCredentials);
var client = new Greeter.GreeterClient(channel);
String user = "you";

var reply = client.SayHello(new HelloRequest { Name = user });
Console.WriteLine("Greeting: " + reply.Message);

channel.ShutdownAsync().Wait();
```

Following an example of client to async get pool :

```
await Task.Run(async () =>
{
    IEnumerable<string> emptyScopes = Enumerable.Empty<string>();
    ServiceEndpoint endpoint = new ServiceEndpoint(TestCredentials.DefaultHostOverride, Port);
    var pool = new GrpcPool(emptyScopes);
    var channel = await pool.GetChannelAsync(endpoint);
    var client = new Greeter.GreeterClient(channel);
    String user = "you";

    var reply = await client.SayHelloAsync(new HelloRequest { Name = user });
    Console.WriteLine("Greeting: " + reply.Message);

    await channel.ShutdownAsync();
});
```

Following an example of client to async get SSL pool :

```
await Task.Run(async () =>
{
    IEnumerable<string> emptyScopes = Enumerable.Empty<string>();
    ServiceEndpoint endpoint = new ServiceEndpoint(TestCredentials.DefaultHostOverride, SslPort);
    var pool = new GrpcPool(emptyScopes);
    var channel = await pool.GetChannelAsync(endpoint, clientCredentials);
    var client = new Greeter.GreeterClient(channel);
    String user = "you";

    var reply = await client.SayHelloAsync(new HelloRequest { Name = user });
    Console.WriteLine("Greeting: " + reply.Message);

    await channel.ShutdownAsync();
});
```

repository: leenux/GrpcPool

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: leenux/GrpcPool


text:
# DeviceTrackerLib

[![Build Status](https://travis-ci.org/CUTR-at-USF/device-tracker-library.svg?branch=master)](https://travis-ci.org/CUTR-at-USF/device-tracker-library)

Android device tracker library is an Android library that enables devices to send their location
information. After initializing this library, it will automatically start sending location information to given server.
As a GPS tracking server, Traccar server was used. Traccar (http://traccar.org/) is an open source GPS tracking server application.

## Installation

In order to use the DeviceTrackerLib in your Android application the following need to be done in the ```Android Studio```

This library requires three permissions:

```
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
```

Add this into the  ```build.gradle``` file:

```
// Add tracker library
compile project (':trackerlib')
```

## Usage

To initialize the library, the following need to be added in your `Application` class:

Tracker initialize:

 ```
 DeviceTrackerManager.init(ip, port, TrackerType (BATCH or REAL_TIME), useWifiOnly);
```

Tracker start tracking:

```
DeviceTrackerManager.startTracker();
```

Tracker init google analytics (optional):

```
DeviceTrackerManager.initAnalytics(getApplicationContext(), "XXX");
```

### Sample usage
```
/*
* Initialize device tracker library
*/
public void initDeviceTracker() {
        boolean useWifiOnly =  false;
        //Create a Tracker config with ip, port, Tracker type
        TrackerConfig tc = new TrackerConfig("xxx.xxx.xx.x", 5005, TrackerConfig.TrackerType.BATCH,
                useWifiOnly);

        String uuid = mPrefs.getString(APP_UID, null);

        DeviceTrackerManager.init(tc, getApplicationContext(), uuid);

        DeviceTrackerManager.startTracker();

        DeviceTrackerManager.initAnalytics(context, "XXX");
}
```

### LICENSE

```
/*
 * Copyright (C) 2015-2018 University of South Florida<EMAIL_ADDRESS><EMAIL_ADDRESS> *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

 ```

repository: GiovannyMoncayo/device-tracker-library

repo_name: GiovannyMoncayo/device-tracker-library


text:
# Story lifecycle

**Stories** Stories and issues are created to capture work that needs to be done by the team. Our goal is to create multiple smaller stories that can be worked on incrementally rather than one large story that takes significant time to complete.
Our team utilizes four swimlanes to manage our work.

## Backlog

- Prioritized and groomed stories/issues.
- **Entrance**: Weekly prioritization meeting reviews and prioritizes stories to develop a list in rank order of the 10 highest priorities stories/issues.
- **Exit**: The team pulls the next thing to work on from the top of the backlog and into the doing swimlane.

## Doing

- Stories/issues that are in progress/actively being worked on.
- **Entrance**: Team members pull a story into the doing column from the backlog when they begin work on a given story/issue.
- **Exit**: Stories/issues are moved to the closed swimlane once they are complete.

## Blocked

- Work that is blocked by internal or external entities.
- **Entrance**: Stories or issues are moved to blocked if the team is being prevented from completing the work.
- **Exit**: Stories or issues are moved out of blocked once the blocker has been resolved.

## Closed

**Entrance**: Team members move stories/issues to the close swimlane once the work is complete (satisfy the acceptance criteria) OR stories/issues are no longer relevant or a priority.

Related controls: CM-4, CM-9, CM-11, SC-18

repository: RonWilliams/product

repo_name: RonWilliams/product


text:
---
layout: base
title:  'Statistics of DET in UD_Komi_Zyrian-Lattice'
udver: '2'
---

## Treebank Statistics: UD_Komi_Zyrian-Lattice: POS Tags: `DET`

There are 3 `DET` lemmas (0%), 6 `DET` types (1%) and 20 `DET` tokens (1%).
Out of 15 observed tags, the rank of `DET` is: 14 in number of lemmas, 14 in number of types and 13 in number of tokens.

The 10 most frequent `DET` lemmas: став, татшӧм, ас

The 10 most frequent `DET` types:  став, татшӧм, ас, ставыс, ставныс, ставсӧ

The 10 most frequent ambiguous lemmas: ас (<tt>PRON</tt> 5, <tt>DET</tt> 3)

The 10 most frequent ambiguous types:

## Morphology

The form / lemma ratio of `DET` is 2.000000 (the average of all parts of speech is 1.311981).

The 1st highest number of forms (4) was observed with the lemma “став”: став, ставныс, ставсӧ, ставыс.

The 2nd highest number of forms (1) was observed with the lemma “ас”: ас.

The 3rd highest number of forms (1) was observed with the lemma “татшӧм”: татшӧм.

`DET` occurs with 5 features: <tt>Case</tt> (17; 85% instances), <tt>Number</tt> (17; 85% instances), <tt>Number[psor]</tt> (4; 20% instances), <tt>Person[psor]</tt> (4; 20% instances), <tt>PronType</tt> (4; 20% instances)

`DET` occurs with 7 feature-value pairs: `Case=Acc`, `Case=Nom`, `Number=Sing`, `Number[psor]=Plur`, `Number[psor]=Sing`, `Person[psor]=3`, `PronType=Dem`

`DET` occurs with 6 feature combinations.
The most frequent feature combination is `Case=Nom|Number=Sing` (9 tokens).
Examples: став

## Relations

`DET` nodes are attached to their parents using 4 different relations: <tt>det</tt> (15; 75% instances), <tt>nsubj</tt> (3; 15% instances), <tt>nmod</tt> (1; 5% instances), <tt>obj</tt> (1; 5% instances)

Parents of `DET` nodes belong to 4 different parts of speech: <tt>NOUN</tt> (12; 60% instances), <tt>VERB</tt> (6; 30% instances), <tt>ADV</tt> (1; 5% instances), <tt>PRON</tt> (1; 5% instances)

16 (80%) `DET` nodes are leaves.

3 (15%) `DET` nodes have one child.

1 (5%) `DET` nodes have two children.

The highest child degree of a `DET` node is 2.

Children of `DET` nodes are attached using 3 different relations: <tt>punct</tt> (3; 60% instances), <tt>advcl</tt> (1; 20% instances), <tt>advmod</tt> (1; 20% instances)

Children of `DET` nodes belong to 3 different parts of speech: <tt>PUNCT</tt> (3; 60% instances), <tt>ADV</tt> (1; 20% instances), <tt>PART</tt> (1; 20% instances)

repository: LoicGrobol/docs

branch_name: refs/heads/pages-source

repo_name: LoicGrobol/docs


text:
# Bookstore_Light
Individual Angular Project of Emanuil Nikolov
\n
Angular Project Assignment
Your task is to design and implement a web application using Angular. Use a service like Kinvey or Firebase for your back-end or create your own with Node.js and MongoDB or a framework in another language (ASP.NET, Spring, Symfony). It can be a discussion forum, blog system, e-commerce site, online gaming site, social network, or any other web application by your choice.
1.	Application Structure
The application should have:
•	public part (accessible without authentication)
•	private part (available for registered users) and
1.1 Public Part
The public part of your projects should be visible without authentication. This public part could be the application start page, the user login and user registration forms, as well as the public data of the users, e.g. the blog posts in a blog system, the public offers in a bid system, the products in an e-commerce system, etc.
1.2 Private Part (User Area)
Registered users should have personal area in the web application accessible after successful login. This area could hold for example the user's profiles management functionality, the user's offers in a bid system, the user's posts in a blog system, the user's photos in a photo sharing system, the user's contacts in a social network, etc.
2.	General Requirements
Your Web application should use the following technologies, frameworks and development techniques:
•	At least 3 different dynamic pages (pages like about, contacts, login, register do not count towards that figure). If your project doesn’t cover this condition you will not be graded.
•	Use Angular for the client-side
•	Communicate to a remote service (via REST, sockets, GraphQL, or a similar client-server technique).
•	Implement authentication
•	Use a source control system like GitHub, Bitbucket etc. Commit inside the repository for at least 3 days.
3.	Other Requirements
•	Apply error handling and data validation to avoid crashes when invalid data is entered
•	Brief documentation on the project and project architecture (as .md file)
•	Good usability. Good UI and UX. (Bootstrap, MDL, CSS Grids or another method of your choice)
4.	Project Defense
Each student will have to deliver a defense of their work in front of one other student, trainer or mentor. Students will have only 10-15 minutes for the following:
•	Demonstrate how the application works (very shortly)
•	Show the source code and explain how it works
Please be strict in timing! On the 15th minute you will be interrupted! It is good idea to leave the last 2-3 minutes for questions from the trainers.
Be well prepared for presenting maximum of your work for minimum time. Open the project assets beforehand to save time.
The project defense will be happening online through Skype.
5.	Bonuses
•	Deploy the application in a cloud environment
•	Use a file storage cloud API, e.g. Dropbox, Google Drive or other for storing the files.
•	Use of features of HTML 5 like Geolocation, Local Storage, SVG, Canvas, etc.
•	Use Angular Animations somewhere in your application
•	Write unit tests for your components
•	Use RxJS powered state management for Angular applications, inspired by Redux (ngRx store)
•	Anything that is not described in the assignment is a bonus if it has some practical use.
6.	Assessment Criteria
General Requirements – 25 %
Functionality Presentation – 50 %
Adequately and clearly demonstrate the requested functionality. Know your way around the application and quickly demonstrate the code. Evaluation in this section is also based on the structure of your code.
Answering Questions – 25 %
Answer questions about Angular specifics and potential functionality outside the scope of the project.
Bonuses – Up to 10 %
Additional functionality or libraries outside the general requirements, with motivated usage.
7.	Submission Deadline
A poll will be provided to you on the SoftUni page sometime during the defense week (it will end on the 19th February) where you must submit a link to your repository. A presentation schedule will be available on the 21st and will include only the projects that were submitted beforehand. Non-submitted projects will NOT be evaluated.
8.	Restrictions
You can use parts (some components, routing configurations, form validation etc...) of the course workshop, but you are NOT allowed to use the whole workshop as your project assignment.

license: MIT

gha_language: TypeScript

gha_license_id: MIT


text:
Info
----

A lighter version of [mv](https://www.npmjs.com/package/mv) without the support for directory moving between devices (directory moving within same device works as well as files between devices).

This means this project has no dependancy to [rimraf](https://www.npmjs.com/package/rimraf) or [ncp](https://www.npmjs.com/package/ncp) making it a lot lighter and smaller.

Usage:
------

```js
var mv = require('mv-lite');

mv('source/file', 'dest/file', function(err) {
  // done. it tried fs.rename first, and then falls back to
  // piping the source file to the dest file and then unlinking
  // the source file.
});
```

Another example:

```js
mv('source/dir', 'dest/a/b/c/dir', {mkdirp: true}, function(err) {
  // done. it first created all the necessary directories, and then
  // tries fs.rename
});
```

Another example:

```js
mv('source/file', 'dest/file', {clobber: false}, function(err) {
  // done. If 'dest/file' exists, an error is returned
  // with err.code === 'EEXIST'.
});
```

repository: nfp-projects/node-mv-lite

repo_name: nfp-projects/node-mv-lite


text:
# purbeurre-app

Purbeurre is a Django application whose concept is to offer the users the possibility of looking for healthy substitutes for everyday products. This project is part of a learning path "Python application developper" which you can find on OpenClassrooms web site.

## Structure

this project contains several apps :
- **core** : the base components
- **favorite** : handle the feature that allows users to add products to their favorites list
- **openFoodFacts** : handle the products views, models, and scripts to populate database
- **user** : handle signup and authentication

## Tests

To run the tests install the packages with pipenv then starts shell

```
pipenv install
pipenv shell
```

Then you can run the tests :

```
python manage.py test
```

Use the coverage tool :

```
coverage run --source='.' manage.py test
coverage html
```

To run the functional test script :

```
python functional_tests.py
```

repository: loictessier/purbeurre-app

gha_language: CSS

repo_name: loictessier/purbeurre-app


text:
# [Felix - A Boilerplate Theme](https://github.com/StJoeWeb/Felix)

A custom quick start theme for WordPress built on top of HTML5 Boilerplate and SASS-flavored Twitter Bootstrap 3.1.1. Built in support for Bower, Grunt and SASS. Named for Marcus Minucius Felix, of which very little is known, other than he is the author of Octavius.

* Project: [https://github.com/StJoeWeb/Felix](https://github.com/StJoeWeb/Felix)
* Website: [St.Joe Web](http://stjoeweb.com)
* Twitter: [@StJoeWeb](http://twitter.com/stjoeweb)
* Authors : [Caleb Zahnd](http://calebzahnd.com) // [@CalebZahnd](http://twitter.com/calebzahnd) & [Nate Arnold](http://natearnold.me) // [@arnonate](http://twitter.com/arnonate)

### Getting Started

Felix is an attempt at creating the best possible environment for custom WordPress Theme development. Grunt automates many tasks for us such as compiling SCSS files, concatenating and minifying CSS and JS, and compressing images. The first step to activating this environment is installing [Node](http://nodejs.org) and [Grunt CLI](http://gruntjs.com) tools. We have found [NVM](https://github.com/creationix/nvm) to be the easiest way to get started with Node. Support for Bower is built in, letting you grab and update web packages with ease. Adding custom metaboxes or a custom admin panel to the WordPress wp-admin screen is a cinch, using the files included in the /functions/ directory. Documentation coming soon, but we bet you can figure it out.

***

#### Installing Node Modules

After downloading or cloning this repo, you will need to install the necessary Node Modules using a simple npm command `npm install`. You can view the necessary dependencies by cracking open the included package.json file.

#### Defining tasks with Grunt

Check out the included Gruntfile.js to see how we have currently configured Grunt to run with Felix.

To simplify things we have only included the following 2 tasks:

```
grunt
```
This will compile SCSS and concatenate JS and run the compile CSS through an autoprefixer. It will also set grunt in watch mode. This task will run every time there is a change to a SCSS, JS, PHP, or HTML file.

```
grunt pro
```
This will compile SCSS and concatenate JS. It will also add prefixes and minify CSS and minify JS. Images are also compressed and exported during this step. All compiled and compressed output is placed in the /assets/ directory

***

Enjoy Felix and let us know how we can improve it :)

repository: elneto/special-events

repo_name: elneto/special-events


text:
Evaluate a definite integral using the Fundamental Theorem of Calculus.

![](.IN3.md.upload/paste-0.6858408950414712)

### June 8:

Hannah Burson, Laura Kinnel, Jean-Sebastien Turcotte, and Sarah Nelson worked on the check it implementation.

We wrote 4 parts: a polynomial, an exponential, a trig function, and a root function. Ideally, we would like the root to show as a root instead of a power, but we don't know how to do that with sage.

We discussed reducing it to three parts and decided against it, but instructors have options for editing:
  - add a term with a root to the polynomial
  - choose between the exponential/(1/x) function and the trig function.

branch_name: refs/heads/main


text:
# bw

> A CLI to access and manage a Bitwarden vault.
> Homepage: <https://help.bitwarden.com/article/cli/>.

- Log in to a Bitwarden user account:

`bw login`

- Log out of a Bitwarden user account:

`bw logout`

- Search and display items from Bitwarden vault:

`bw list items --search {{github}}`

- Display a particular item from Bitwarden vault:

`bw get item {{github}}`

- Create a folder in Bitwarden vault:

`{{echo -n '{"name":"My Folder1"}' | base64}} | bw create folder`

repository: chrillebile/tldr

repo_name: chrillebile/tldr


text:
# Machine Learning (ML) library

A standard ml library written in Java.
It contains several pieces of code/methods/functions that are related to ML and useful
for my research. More functions and algorithms are being developed (mostly when I need them).
Nevertheless, if someone uses the code and requires a specific method or optimization, just ask.

## Prerequisites

Most of my code requires a library named [utils](https://github.com/mariolpantunes/utils).
This library is no exception.
Currently, it requires Java 8.

## Installation

The whole project was done in Maven, as such to install this library just run:
```
mvn install
```

## Authors

* **Mário Antunes** - [mariolpantunes](https://github.com/mariolpantunes)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

repository: mariolpantunes/ml

gha_language: Java

repo_name: mariolpantunes/ml


text:
# Q-based Promise API for mysql

This module provides a small wrapper around mysql connection pools that turns
the callback-based API into a promise-based API using the Q library.

This module is similar to the mysql-promise module. Q's ninvoke makes it easy
to wrap the typical node APIs of the mysql module and release the connections
after use.

This module does not directly depend on the mysql module, but expects a
connection pool following the mysql API and was only tested with the mysql
module.

Besides the generic query method, the database wrapper offers two convenience
methods for selecting a single row and multiple rows with a limit (for
pagination).

  selectRow(sql, params, options)
  selectRows(sql, param, limit)

## Install

```bash
npm install mysqlq
```

### Setup and Plain Query

```javascript
var mysql = require('mysql'),
    mysqlq = require('mysqlq'),
    db = mysqlq(mysql.createPool({host: ...}));

db.query('select * from foo where id = ?', id).then(function (data) {
  var rows = data[0];
  ...
}, function (err) {
  // handle error
});
```

repository: gssblib/librarian

gha_license_id: NOASSERTION

repo_name: gssblib/librarian


text:
---
title: Blog post for 17th October 2016.
layout: post
author: william.howells
permalink: /blog-post-for-17th-october-2016./
source-id: 1xT7xIo4A0v0FWm6QZUrwh45QyZ3pZATkRlghrAAYNOQ
published: true
---

    Title
    WE DON'T HAVE LIGHTS
    Date
    17/10/16

    Starting point:
    More of the manual

    Target for this lesson
    To finish the manual

    Did I reach my target?
(add details to "Lesson Review")
     Yes

    Lesson Review

    How did I learn? What strategies were effective?

    I learnt that you can use the code to control things like a robot with a moving arm, elbow, wrist, and lights that turn on and off according to the code did actually work.  Different lights would be needed for different things, and code would have to say things like ARMWRIST, ARMELBOW, ARMFINGER, and other parts of the body.  It could be made much easier by copying part of the code because it was practically the same thing repeatedly, so that could be pasted loads.

    What limited my learning? Which habits do I need to work on?

     Because part of it apparently needed lights, I was unsure whether to continue in the manual or not.  I asked whether or not to do it, and the answer was yes.  So we kept on doing it, but because the people next to us had asked the other teacher who had told them not to, we went a bit more slowly, a little bit annoyed.

    What will I change for next time? How will I improve my learning?

    I will set up incredibly quickly, so that I can have the maximum possible time to do the coding which I find quite fun anyway. I will try to get the coding correct, so that no time is wasted.  It would be even better if it was done correctly first time so that it gets done even more quickly, because then even more would get done.


text:
---
title: Release Notes - 12/06/2019
date: "2019-06-12T23:46:37.121Z"
description: "Release Notes"
---

### Changes

- Only allow members of the 'accounting' group to mark invoices as complete.
- Add a link to the project's client in the project profile.
- Remove requirement of selecting project when adding a test request.
- Add a link back to the invoices page in the invoice profile.

### Fixes

- When invoices are marked as completed, all jobs associated to it, without an 'Actual Finish Date', will have it updated to the current date.

### New

- You can now add a 'Role Description' to all roles in the organisation.

repository: ProtestSoftware/boss-info

repo_name: ProtestSoftware/boss-info


text:
# 📅 goCalendar - Open Source iCalendar Library

**goCalendar** is simply golang library for generating **iCalendar** format

You can find more information in [specification](https://icalendar.org/RFC-Specifications/iCalendar-RFC-5545/)
### Usage
```go
	//creating new Calendar
	cal := createCalendar()

	//creating new Event
	start := time.Now().Add(time.Hour) //start of event
	end := start.Add(time.Minute*45) //end of event

	simpleEvent := createEvent(start, end)
	simpleEvent.setTitle("Music lesson") //title
	simpleEvent.setDescription("Learning musical notes") //description
	simpleEvent.setLocation("School") //location

	//adding Event to Calendar
	cal.addEvent(simpleEvent)

	//saving Calendar with Events to file
	err := cal.save("example.ics")
```

Written under [MIT License](https://en.wikipedia.org/wiki/MIT_License)

repository: nxm/goCalendar

repo_name: nxm/goCalendar


text:
## Doge Ball - Assembly Game in Motorola 68K

A game in Motorola 68000 assembly language (developed in EASy68K IDE) for a project in the Programming-1 curriculum at FIEA, UCF.

**Demo video** - [YouTube](https://youtu.be/2zrnzTrPqpE)

### The project was supposed to have the following features as per instruction:

- User input control of game entity
- Bitmap background with entities moving around over it
- Physics update of game entity, including acceleration (gravity would be good example)
- Fixed point arithmetic
- Collision detection between game entities
- A score indicator as a 7-segment LED
- Randomness

### How To Play:

1. Download EASy68K emulator from the following link - [EASy68K](http://www.easy68k.com/).
2. Clone this repository.
3. Open main.X68 in EAS68K, and execute the program.

### Additional Information:
- main.X68 is the file where the program's execution starts.
- randomizationFunctions.X68 has a subroutine for generating random numbers.
- ledDisplaySubroutine.X68 has a subroutine for displaying a 7-segment LED display for a given number and position as input.
- bmpLoader.X68 has a subroutine for rendering a chunk of a BMP image at a specific position based on input.


text:
# getent

> Get entries from Name Service Switch libraries.

- Get list of all groups:

`getent group`

- See the members of a group:

`getent group {{group_name}}`

- Get list of all services:

`getent services`

- Find a username by UID:

`getent passwd 1000`

- Perform a reverse DNS lookup:

`getent hosts {{host}}`


text:
# Rocket Commands

Work in progress. Please contribute if you see an area that needs more detail.

## Downloading Images (ACIs)

[aci-images]: https://github.com/appc/spec/blob/master/SPEC.md#app-container-image
[appc-discovery]: https://github.com/appc/spec/blob/master/SPEC.md#app-container-image-discovery

Rocket runs containers packaged as [Application Container Images (ACI)][aci-images] an open-source specification. ACIs consist of the root filesystem of the container, a manifest and an optional signature.

ACIs are named with a URL-like structure. This naming scheme allows for a decentralized discovery of ACIs, related signatures and public keys. Rocket uses these hints to execute [meta discovery][appc-discovery].

### rkt trust

Before executing a remotely fetched container, Rocket will verify it based on attached signatures generated by the ACI creator.

Before this can happen, Rocket needs to know which creators you trust, and therefore are trusted to run containers on your machine. The identity of each ACI creator is established with a public key, which is placed in Rocket's key store on disk.

When adding a trusted key, a prefix can scope the level of established trust to a subset of containers. A few examples:

```
$rkt trust --prefix storage.coreos.com
```

```
$rkt trust --prefix coreos.com/etcd
```

To trust a key for an entire root domain, you must use the `--root` flag.

```
$rkt trust --root --prefix coreos.com
```

#### Trust a Key Using Meta Discovery

The easiest way to trust a key is through meta discovery. Rocket will find and download a public key that the creator has published on their website. This process is detailed in the [Application Container specification][appc-discovery]. The TL;DR is Rocket will find a meta tag that looks like:

```
<meta name="ac-discovery-pubkeys" content="coreos.com/etcd https://coreos.com/dist/pubkeys/aci-pubkeys.gpg">
```

And use it to download the public key and present it to you for approval:

```
[insert output]

```

If Rocket can't find a key using meta discovery, an error will be printed:

```
$ rkt trust --prefix coreos.com
Error determining key location: --prefix meta discovery error: found no ACI meta tags
```

#### Trust a Key From Specific Location

If you know where a public key is located, you can request it directly from disk or via HTTPS:

```
$ sudo ./rkt trust --prefix coreos.com/etcd https://coreos.com/dist/pubkeys/aci-pubkeys.gpg
Prefix: "coreos.com/etcd"
Key: "https://coreos.com/dist/pubkeys/aci-pubkeys.gpg"
GPG key fingerprint is: 8B86 DE38 890D DB72 9186  7B02 5210 BD88 8818 2190
  CoreOS ACI Builder<EMAIL_ADDRESS>Are you sure you want to trust this key (yes/no)? yes
Trusting "https://coreos.com/dist/pubkeys/aci-pubkeys.gpg" for prefix "coreos.com/etcd".
Added key for prefix "coreos.com/etcd" at "/etc/rkt/trustedkeys/prefix.d/coreos.com/etcd/8b86de38890ddb7291867b025210bd8888182190"
```

#### Pre-Populating Trusted Keys on Disk

Trusted public keys can be pre-populated by placing them in the appropriate location on disk for the desired prefix.

```
$ ls -l /etc/rkt/trustedkeys/
[insert example of root key vs prefixed key]
```

### rkt fetch

Rocket uses HTTPS to locate and download remote ACIs and their attached signatures. If the ACI exists locally, it won't be re-downloaded.

#### Fetch with Meta Discovery

The easiest way to fetch an ACI is through meta discovery. Rocket will find and download the ACI and signature from a location that the creator has published on their website. This process is detailed in the [Application Container specification][appc-discovery].

If you have previously trusted the container creator, it will be downloaded and verified:

```
$ rkt fetch coreos.com/etcd:v2.0.0
rkt: searching for app image coreos.com/etcd:v2.0.0
rkt: fetching image from https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.aci
Downloading aci: [=======================================      ] 3.25 MB/3.7 MB
Downloading signature from https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.sig
rkt: signature verified:
  CoreOS ACI Builder<EMAIL_ADDRESS>sha512-fa1cb92dc276b0f9bedf87981e61ecde
```

If you haven't trusted the creator, it will be downloaded but not verified:

```
$ sudo ./rkt fetch coreos.com/etcd:v2.0.0
rkt: searching for app image coreos.com/etcd:v2.0.0
rkt: fetching image from https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.aci
Downloading aci: [=======================================      ] 3.25 MB/3.7 MB
Downloading signature from https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.sig
rkt: fetching image from https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.aci
sha512-fa1cb92dc276b0f9bedf87981e61ecde
```

#### Fetch from Specific Location

If you already know where an image is stored, you can fetch it directly:

```
$ rkt fetch https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.aci
rkt: fetching image from https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.aci
Downloading aci: [=======================================      ] 3.25 MB/3.7 MB
Downloading signature from https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.sig
rkt: fetching image from https://github.com/coreos/etcd/releases/download/v2.0.0/etcd-v2.0.0-linux-amd64.aci
sha512-fa1cb92dc276b0f9bedf87981e61ecde
```

## Running Containers

Work in progress. Please contribute!

### rkt run

 - command examples
 - if not found locally, will be fetched
 - example of failed validation
 - how to disable verification

### rkt status

Work in progress. Please contribute!

### rkt enter

Work in progress. Please contribute!

## Metadata Service

Work in progress. Please contribute!

### rkt metadatasvc

Work in progress. Please contribute!

## Other Commands

### rkt gc

Work in progress. Please contribute!

repository: yoshuawuyts/rocket

repo_name: yoshuawuyts/rocket


text:
\mainpage Main Page

---
# Thermo 21 click

> Thermo 21 Click is a compact add-on board that provides an accurate temperature measurement. This board features the ADT7301, a high-precision digital temperature sensor from Analog Devices. The ADT7301 houses an on-chip temperature sensor, a 13-bit A/D converter, a reference circuit, and serial interface logic functions in one package. Characterized by its high accuracy (up to ±0.5°C typical) and high resolution of 0.03125°C, this temperature sensor provides temperature data to the host controller with a configurable SPI interface. This Click board™ is appropriate for process control, environmental monitoring, domestic appliances, electronic test equipment, or other temperature measurement applications.

[click Product page](https://www.mikroe.com/thermo-21-click)

---

#### Click library

- **Author**        : Luka Filipovic
- **Date**          : Sep 2021.
- **Type**          : SPI type

# Software Support

We provide a library for the Thermo21 Click
as well as a demo application (example), developed using MikroElektronika
[compilers](https://www.mikroe.com/necto-studio).
The demo can run on all the main MikroElektronika [development boards](https://www.mikroe.com/development-boards).

Package can be downloaded/installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks).

## Library Description

> This library contains API for Thermo21 Click driver.

#### Standard key functions :

- `thermo21_cfg_setup` Config Object Initialization function.
```c
void thermo21_cfg_setup ( thermo21_cfg_t *cfg );
```

- `thermo21_init` Initialization function.
```c
err_t thermo21_init ( thermo21_t *ctx, thermo21_cfg_t *cfg );
```

#### Example key functions :

- `thermo21_temperature_read` Temperature reading function.
```c
err_t thermo21_temperature_read ( thermo21_t *ctx, float *data_out );
```

- `thermo21_generic_read` Data reading function.
```c
err_t thermo21_generic_read ( thermo21_t *ctx, uint8_t *data_out, uint8_t len );
```

## Example Description

> This example application showcases ability of the click board to read temperature data.

**The demo application is composed of two sections :**

### Application Init

> Initialization of communication modules(SPI, UART).

```c

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    thermo21_cfg_t thermo21_cfg;  /**< Click config object. */

    /**
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX
     * are defined as HAL_PIN_NC, you will
     * need to define them manually for log to work.
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    thermo21_cfg_setup( &thermo21_cfg );
    THERMO21_MAP_MIKROBUS( thermo21_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == thermo21_init( &thermo21, &thermo21_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

```

### Application Task

> Read and log temperautre every half second.

```c

void application_task ( void )
{
    float temperature = 0;
    if ( !thermo21_temperature_read( &thermo21, &temperature ) )
    {
        log_printf( &logger, " > Temperature[degC]: %.2f\r\n", temperature );
    }
    Delay_ms( 500 );
}

```

The full application code, and ready to use projects can be installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks).

**Other Mikroe Libraries used in the example:**

- MikroSDK.Board
- MikroSDK.Log
- Click.Thermo21

**Additional notes and informations**

Depending on the development board you are using, you may need
[USB UART click](http://shop.mikroe.com/usb-uart-click),
[USB UART 2 Click](http://shop.mikroe.com/usb-uart-2-click) or
[RS232 Click](http://shop.mikroe.com/rs232-click) to connect to your PC, for
development systems with no UART to USB interface available on the board. The
terminal available in all MikroElektronika
[compilers](http://shop.mikroe.com/compilers), or any other terminal application
of your choice, can be used to read the message.

---

gha_language: C


text:
Mentors and Coaches

What is Mentoring and Coaching

Definitions online that differentiate mentoring coaching are...interesting. The bottom line is that you are getting outside help.
        This can be to help with a specific issue (communication, patience, etc...), or something you can't yet define (perhaps
        to expanding your vision, think and dream bigger, be more optimistic). Can be a formal or an informal relationship. Either way,
        look to others for help.

What the Relationship Looks Like

Can be formal (they agree to be your coach / mentor)

Can be paid

Can meet with regular frequency

Can be limited in scope

Can be painful

Doesn't have to be exclusive

What to Expect from Your Mentor / Coach

Expect their time and attention

Expect their stories and biases

Expect confidentiality (state this upfront)

Expect frank advice

Expect them to have expectation of you (follow-up!)

Expect to do a lot of work between sessions

Expect more from yourself than from them

Where to Find a Coach or Mentor

In your company

In your industry

At networking events

Through introductions

On LinkedIn

From past professional relationships

Let people know you are looking for a relationship

How to Ask for the Relationship

Note: sometimes you won't ask for a relationship

"Would you be open to a mentoring relationship?"

"Could we meet once a month for a few months?"

"Will you coach me through this situation?"

NO:"can I pick your brain" ("over lunch")

Be clear about your expectations, and their commitment

Defining Roles and Expectations

Define the ideal results of this relationship

Define meeting frequency and length

Define length of the relationship

Define what you hope to get from them, and what they can expect from you (work, honesty, punctuality, respect for their time, etc.)

Define your follow-up and follow-through procedures

Ending the Relationship

Make it easy to end the relationship

No hard feelings or ruined relationships

Leave the door open for future meetings

Follow-up with gratitude

Maintain the relationship with continual communication

Help your contact when you can (referrals, information, etc.)

Specialized Coaching/Mentoring

Sometimes the relationship is informal. You can be mentored by someone you read (book or articles), or learn from (podcasts, webinars). Consider these mini
        mentoring sessions for help with very small, specific tasks or goals.  Role play that you are them, and ask
        yourself question that you think they would ask you.

url: https://raw.githubusercontent.com/jonesca/Leadership/b983b46698dedfaf662c6b2f72dfd84879c06108/02 Management 101/02e Mentors and Coaches.md

repository: jonesca/Leadership

filename: 02e Mentors and Coaches.md

repo_name: jonesca/Leadership


text:
# Filter by Length FASTA

A simple application named `flfasta` to filter FASTA files based on sequence length (minimum or maximum).

## Compiling

You need a compiler capable of compiling C source-code written in at least the C89 standard. For GCC, the compilation can be done with the command `gcc main.c -o flfasta`.

## Usage

Execute the application `flfasta` to see the usage manual.

```
flfasta (Filter by Length FASTA) version YYYY.MM.DD.micro.
Created by Felipe Ferreira da Silva.

Usage:
  flfasta [1] [2] [3] [4] [5]

  1: Path to input file.
  2: Path to output file.
  3: Minimum length.
  4: Maximum length (0 to ignore maximum length).
  5: Show progress (0 for no, 1 for yes).

File input must be in single-line FASTA format.
```

For example, executing `flfasta input.fasta output.fasta 300 0 1` will generate a file `output.fasta` containing only the sequences from `input.fasta` that are longer than 300. Since the argument of maximum length is `0`, this there will be no filtering based on the maximum length. The application will output the progress because the final argument is `1`.

## License

Copyright (c) 2019 Felipe Ferreira da Silva

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

license: Zlib

repository: felselva/flfasta

repo_name: felselva/flfasta


text:
## Install and configure web application

- Copy the github [www folder content](https://github.com/diving91/web-radio/tree/master/www) under /srv/www/home.fr/public/
> sudo chown -R pi:www-data /srv/www

> sudo chmod -R 755 /srv/www

> chmod 664/srv/www/home.fr/public/conf/cron.txt

- Install the crontab (as such it also will remain after a reboot)
>sh /srv/www/home.fr/public/conf/cron.sh

- Define your playlist
> sudo nano /srv/www/home.fr/public/station/station.txt

````
1 http://stream1.chantefrance.com/stream_chante_france.mp3 #Chante France
0 http://cdn.nrjaudio.fm/audio1/fr/30001/mp3_128.mp3?origine=fluxradios #NRJ
0 http://cdn.nrjaudio.fm/audio1/fr/30601/mp3_128.mp3?origine=fluxradios #Nostalgie
0 http://cdn.nrjaudio.fm/audio1/fr/30201/mp3_128.mp3?origine=fluxradios #Cherie FM
0 http://roo8ohho.cdn.dvmr.fr/live/franceinfo-midfi.mp3?ID=f9fbk29m84 #France Info
0 http://icepe2.infomaniak.ch/impactfm-128.mp3 #Impact FM
0 http://radioclassique.ice.infomaniak.ch/radioclassique-high.mp3 #Radio Classique
````
File structure is "favorite \<space> radio_stream_url \<space> #radio_nickname"

favorite = 1 for only one station (the one that will be started when radio is put ON)

Note: with the  web app, you can change it later at your convenience
> chmod 664/srv/www/home.fr/public/station/station.txt

- Define default settings of the application
> sudo nano /srv/www/home.fr/public/conf/config.php
```php
<?php
$config = [
	//"web" => ["base_url" => ""],
	"layout_title" => ["title" => "Satellite Audio 1"],
	"tts" => [ "voiceRSSkey" => '#your VoiceRSS API key#',
		"vol" => 70,
		"localTTS" => true,
		"weatherUrl" => 'https://www.prevision-meteo.ch/services/json/#your city name#',
		"jeedomUrl" => 'http://#your jeedom IP#/core/api/jeeApi.php?apikey=#your Jeedom API key#&type=interact&query=#your interaction query#'],
	"cron" => [ "path" => '/srv/www/home.fr/public/conf/cron.txt'],
	"station" => [ "path" => '/srv/www/home.fr/public/station/station.txt',
			"local" => '/srv/www/home.fr/public/conf/clocher-x12-SF.mp3',
			"default" => 'http://stream1.chantefrance.com/stream_chante_france.mp3'],
	"snooze" => [ "delay" => '+5 minutes'],
	"jeedom" => [ "scenario"=> 'http://#your jeedom IP#/core/api/jeeApi.php?apikey=#your Jeedom API key#&type=scenario&id="#Scenario ID#&action=start'],
			"active" => false]
];
````

|field|field|Description|
|--|--|--|
|**layout_title**|**title**| The name that will appear in the apps header|
|**tts**|**voiceRSSkey**| Replace #your VoiceRSS API key# by your API key|
||**vol**|Volume for TTS audio - Tune it to adapt the volume for your needs|
||**localTTS**|*true* to use local picoTTS or *false* to use VoiceRSS|
||**weatherUrl**| Replace #your city name# by the name of you city - see [www.prevision-meteo.ch](https://www.prevision-meteo.ch)|
||**jeedomUrl**| Replace #your jeedom IP#, #your Jeedom API key#, #your interaction query# (this last one is the interaction "Demande" field you've defined in jeedom (suggested one = tts)|
|**cron**|**path**|do not change unless you know what you're doing|
|**station**|**path**|do not change unless you know what you're doing|
||**local**|path of the local file that will be played when no internet is available when Radio is turned on - The one provided with this project is a nice country farmhouse bell|
||**default**|url of the default radio stream when you have no favorite in station.txt file, or when the file is corrupted after an upload|
||**snooze**|define you own snooze time|
|**jeedom**|**scenario**|Replace #your jeedom IP#, #your Jeedom API key#, #Scenario ID#. This last one is the Jeedom' scenario ID to call at each alarm event (recurring or not). It is activated when active is set to true (see below)|
||**active**|_true_\|_false_ to activate jeedom callback at each alarm event.|

- Where to find internet radio stream urls?

[http://www.listenlive.eu/](http://www.listenlive.eu/)
This is for EU stations. it is regularly updated when the urls are changed.
[https://fluxradios.blogspot.com/p/flux-radios-francaise.html](https://fluxradios.blogspot.com/p/flux-radios-francaise.html)
This is for FR stations.
- Where to find nice and fun local music file (if you do not like the country farmhouse bell) ?

[https://www.sound-fishing.net/bruitages_sonnerie-sonnette.html](https://www.sound-fishing.net/bruitages_sonnerie-sonnette.html)
Many file are free, other are available for relative low cost

__You're finished and can test__ [http://IP of your audio satellite](http://IP_of_your_audio_satellite) - __Enjoy !__
- reboot to check the defined alarms are effectively permanent
>sudo shutdown -r now


text:
These patches are based off of the android12-release branch
at this revision of `platform/manifest`:
8e7a52179c1704bc445f83efde08a6025acbf358

Here are the paths that the patches apply to:

`frameworks/base`:
- 0001-Add-logging-for-SP800-derived-passwords-too.patch
- 0001-DO-NOT-SUBMIT-log-personalized-keys.patch
- 0001-Dump-synthetic-password-related-keys.patch

`system/vold`:
- 0001-DO-NOT-SUBMIT-log-disk-encryption-keys.patch

`system/security`:
- 0001-Dump-master-key-when-generated-and-read.patch

`external/wpa_supplicant_8`:
- 0001-Dump-security-key.patch


text:
sanity.go provides functions for sanity checking whether a reprocessed
partition is similar to the original partition.

SanityCheckAndCopy checks that various metrics are sensible, then copies
the table into the corresponding partition in __destination_table__.

## Useful bits:

1. bq show --format=prettyjson mlab-oti.batch.ndt_* will give
 the summary for the whole set.  Using HTTP, this would be a get request:
 ```
GET https://www.googleapis.com/bigquery/v2/projects/projectId/datasets/datasetId/tables/tableId

 ```

## Other considerations:
1. Should run the task count check?  Unfortunately, there may be task
files that don't result in any rows.  How to deal with that?


text:
---
layout: post
title: Solving Wordament
draft: true
author: Karthik Abram
tags: java game puzzle
---

_Statutory Disclaimer: This post is simply an exercise in algorithm development. It is not a warrant to attempt to cheat while playing Wordament. Any attempt to cheat the game will get you booted. The booting will be well deserved and this blog takes no responsibility for it._

### Game Time
[Wordament](http://www.wordament.com/) is a very popular word puzzle that is available on all the mobile app stores. The object of the game is to identify as many words as possible from a 4x4 grid of letters. Words are formed by sliding your finger on the letters. You can form words by moving in any direction as long as you don't repeat the letters. You get points for your words - longer words earn more points and there are special bonuses for uncommon words and words that contain letter sequences that are specifically called out.

![Wordament for XBox](http://www.wordament.com/wp-content/uploads/2013/01/wordament_512x512.png)

A first time casual player will be simultaneously astounded at the number of words identified by the winners of any given round and embarrassed by their own dismal  performance. In fact, the winners are jaw-droppingly fast. Have a look at this video of a face-off (or is that word-off?):

Some of us speed-challenged folks, especially the geeks at heart may consider instead the challenge of algorithmically finding all the words. The problem is relatively straightforward and with adequate setup may even make a great interview question. If you do use this as an interview question, I would strongly suggest letting the candidate program on a computer with an IDE/language of their choice and not on a whiteboard.

### Word Bank

First we need a database of valid words. Here are a couple of sources to get such a list of words:

- [SIL English Wordlist](http://www-01.sil.org/linguistics/wordlists/english/)
- [SCOWL](http://wordlist.aspell.net/) dictionary

At a high-level, our task will be to navigate the grid adding letters to a sequence and testing if what we have is a valid word. Our challenge is to:

1. Ensure that we navigate all permutations of the letters.
2. Not visit any letter more than once.
3. Determine if the sequence of letters we have is a valid word.

The last step is straightforward. We can simply load the entire list of valid words into a HashMap and check to see if the word we've assembled is valid. However, for our purpose, we are going to eschew the HashMap based approach and instead construct a tree of valid words such that we can more efficiently figure out if a word is valid or not. From a practical computational standpoint, this extra optimization is not going to make a material difference. However, the optimization does have academic value.

### From Word Bank to Word Tree

We will construct our word tree by creating nodes that have two properties:

1. A letter value.
1. An index of up to 26 child nodes, one per letter that can follow the current node.
2. A flag that indicates if the path from the root to the current node represents a valid word.

We use two classes to construct the nodes, a `NodeLoader` and the `Node` itself. The code for these classes is shown below:

{% highlight java linenos %}

public class NodeLoader {

	public static Node init() throws IOException {
        // LineIterator and FileUtils are from apache commons io.
		LineIterator iterator = FileUtils.lineIterator(new File("src/main/resources/dict.txt"));

		Node root = new Node();
		root.setWord(false);

		while (iterator.hasNext()) {
			String line = iterator.next().toLowerCase().trim();
			createNodes(line, root, 0).setWord(true);
		}

		return root;
	}

	private static Node createNodes(String line, Node current, int index) {
		if (index != line.length()) {
			Node next = current.createOrGet(line.charAt(index));
			return createNodes(line, next, index+1);
		} else {
			return current;
		}
	}
}

{% endhighlight %}

Notice that root node does not represent a letter. In fact, the Nodes don't explicitly represent a letter. The letter representation is implicit from their position in the parent. For example, the sequence from the root node of the first child node, its second child node and its third child node represent the letter sequence 'abc'.

The Node is a simple class of mostly boilerplate code (please Oracle, if you are listening, at least add [Lombok](http://projectlombok.org/) style @Getter/@Setter annotations to Java 9?)

{% highlight java linenos %}

public class Node {

    private boolean word;

    private Node[] branches = new Node[26];

    public boolean isWord() {
        return word;
    }

    public void setWord(boolean word) {
        this.word = word;
    }

    public Node getNode(char c) {
        int i = c - 'a';
        return branches[i];
    }

    public Node createOrGet(char c) {
        Node n = getNode(c);
        if (n == null) {
            n = new Node();
            branches[c - 'a'] = n;
        }

        return n;
    }
}

{% endhighlight %}

### "Wording" it together

Armed with our word-tree, we can now write the grid input and traverse logic. For reading in the input, we will require the user to type in four lines of letters with each line containing 4 letters. We can then parse the letters and put them into a two-dimensional array:

{% highlight java linenos %}

        	Node root = NodeLoader.init();
        Scanner scanner = new Scanner(System.in);
        char grid[][] = new char[4][4];
        String parts[] = new String[4];

        parts[0] = scanner.nextLine();
        parts[1] = scanner.nextLine();
        parts[2] = scanner.nextLine();
        parts[3] = scanner.nextLine();

        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 4; j++) {
                grid[i][j] = parts[i].charAt(j);
            }
        }

{% endhighlight %}

With the grid initialized we now have to traverse the grid. Our grid traversal must consider every location in the grid as a starting point. As we traverse the grid and identify valid words, we add it to a set (thus eliminating duplicates). Once the words have all been identified, we can sort them by length and print them. At a high level, assuming a "traverse" method, the code required is:

{% highlight java linenos %}

       for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 4; j++) {
                traverse(grid, new boolean[4][4], i, j, root, "");
            }
        }

        List<String> temp = new ArrayList<String>(wordsFound);
        Collections.sort(temp, new Comparator<String>() {

            public int compare(String o1, String o2) {
                return o2.length() - o1.length();
            }
        });
        for (String word : temp) {
            System.out.println(word);
        }

{% endhighlight %}

The variable `wordsFound` is simple HashSet. The only thing left to flush out is the traverse routine. Grid traversal is easily written as a recursive routine. Our job is to consider the current location, add the letter to the sequence by grabbing the appropriate child node of the current node (indexed by the letter) and seeing if the node represents a complete word. If it does, we add it to our list of valid words and then try to traverse by moving in each of the 8 different directions we can head in (left, right, up, down, diagonally to the top-right, top-left, bottom-right and bottom-left).

{% highlight java linenos %}

/**
     * @param grid The grid of letters representing the game.
     * @param visited A grid of indicators telling us which letters have already been visited.
     * @param i Our current location in the grid. x-axis
     * @param j Our current location in the grid. y-axis
     * @param node The node we have just visited.
     * @param current The currently formulated word.
     */
    private static void traverse(char[][] grid, boolean[][] visited, int i, int j, Node node, String current) {
        char c = grid[i][j];
        String newStr = current + Character.toString(c);
        Node next = node.getNode(c);

        if (next != null) {
            visited[i][j] = true;
            if (next.isWord() && newStr.length() > 2) {
                wordsFound.add(newStr);
            }

            if (j < 3 && !visited[i][j + 1]) {
                traverse(grid, visited, i, j + 1, next, newStr);
            }
            if (i < 3 && !visited[i + 1][j]) {
                traverse(grid, visited, i + 1, j, next, newStr);
            }
            if (j > 0 && !visited[i][j - 1]) {
                traverse(grid, visited, i, j - 1, next, newStr);
            }
            if (i > 0 && !visited[i - 1][j]) {
                traverse(grid, visited, i - 1, j, next, newStr);
            }
            if (i < 3 && j < 3 && !visited[i + 1][j + 1]) {
                traverse(grid, visited, i + 1, j + 1, next, newStr);
            }
            if (i < 3 && j > 0 && !visited[i + 1][j - 1]) {
                traverse(grid, visited, i + 1, j - 1, next, newStr);
            }
            if (i > 0 && j > 0 && !visited[i - 1][j - 1]) {
                traverse(grid, visited, i - 1, j - 1, next, newStr);
            }
            if (i > 0 && j < 3 && !visited[i - 1][j + 1]) {
                traverse(grid, visited, i - 1, j + 1, next, newStr);
            }
            visited[i][j] = false;
        }

    }

{% endhighlight %}

Here is a sample run. The letters entered are:

`abcd`

`efgh`

`ijkl`

`mnop`

This gives us the following words:

- knife
- plonk
- glop
- mink
- jink
- fink
- fab
- ink
- fin
- lop

The complete code is available at [Github](https://github.com/eclecticlogic/wordament). The code comes with a plea to use it to further academic interest in such puzzle solvers and not to get cheap thrills from cheating in the real game.


text:
# compe-zsh

Zsh completion source for [nvim-compe](https://github.com/hrsh7th/nvim-compe)

## Requirements

* [Neovim](https://github.com/neovim/neovim/)
* [nvim-compe](https://github.com/hrsh7th/nvim-compe)
* zsh/zpty module

```zsh
zmodload zsh/zpty
```

## Installation

```vim
Plug 'hrsh7th/nvim-compe'
Plug 'tamago324/compe-zsh'
Plug 'nvim-lua/plenary.nvim'
Plug 'Shougo/deol.nvim'      " recommended to use together.

lua << EOF
require'compe'.setup {
  -- ...
  source = {
    -- ...
    zsh = true,
  }
}
EOF
```

## Configuration

It saves compdump file in `$COMPE_ZSH_CACHE_DIR` or `$XDG_CACHE_HOME` or
`$HOME/.cache` directory.

NOTE: In my case, I had to add the directory of the complete function to `$FPATH` in `~/.zshenv`.

```zsh
# completions
if [ -d $HOME/.zsh/comp ]; then
    export FPATH="$HOME/.zsh/comp:$FPATH"
fi
```

## Credit

* [deoplete-zsh](https://github.com/deoplete-plugins/deoplete-zsh)
* [zsh-capture-completion](https://github.com/Valodim/zsh-capture-completion)

## License

MIT

gha_language: Shell


text:
# Awesome Lists

> Collection of awesome resources on various topics.

---

- [`awesome`](https://github.com/sindresorhus/awesome) Awesome lists about all kinds of interesting topics.
- [`lists`](https://github.com/jnv/lists) The definitive list of lists (of lists) curated on GitHub and elsewhere.

---

## Android

- [`awesome-adb`](https://github.com/mzlogin/awesome-adb) ADB Usage Complete.

---

## Azure

- [`awesome-azure`](https://github.com/kristofferandreasen/awesome-azure)
- [`awesome-azure-learning`](https://github.com/ddneves/awesome-azure-learning)

---

## Bash

- [`awesome-bash`](https://github.com/awesome-lists/awesome-bash) A curated list of delightful Bash scripts and resources.

---

- [`awesome-cheatsheets`](https://github.com/LeCoupa/awesome-cheatsheets) Awesome cheatsheets for popular programming languages, frameworks and development tools.
- [`awesome-checker-services`](https://github.com/Brunty/awesome-checker-services)

---

## Command Line

- [`awesome-cli-apps`](https://github.com/agarrharr/awesome-cli-apps)
- [`awesome-command-line-apps`](https://github.com/herrbischoff/awesome-command-line-apps)
- [`awesome-console-services`](https://github.com/chubin/awesome-console-services)
- [`You-Dont-Need-GUI`](https://github.com/you-dont-need/You-Dont-Need-GUI) Stop relying on GUI; CLI **ROCKS**

---

- [`Awesome-Design-Tools`](https://github.com/LisaDziuba/Awesome-Design-Tools)
- [`awesome-devenv`](https://github.com/jondot/awesome-devenv)

---

## Dart

- [`awesome-dart`](https://github.com/yissachar/awesome-dart) Curated list of awesome Dart frameworks, libraries, and software.

---

## DevOps

- [`devops-resources`](https://github.com/bregman-arie/devops-resources)

---

## Docker

- [`awesome-docker`](https://github.com/veggiemonk/awesome-docker) A curated list of Docker resources and projects.

---

## Fonts

- [`dev-fonts`](https://github.com/Gaafar/dev-fonts) List of the best fonts for coding.

---

## Git

- [`awesome-git`](https://github.com/dictcp/awesome-git)
- [`awesome-git-addons`](https://github.com/stevemao/awesome-git-addons) 😎 A curated list of add-ons that extend/enhance the git CLI.
- [`tips`](https://github.com/git-tips/tips) Most commonly used git tips and tricks.

---

- [`Awesome-Hacking`](https://github.com/Hack-with-Github/Awesome-Hacking)
- [`awesome-investing`](https://github.com/mr-karan/awesome-investing)
- [`awesome-linux`](https://github.com/aleksandar-todorovic/awesome-linux) Awesome projects and resources that make Linux even more awesome.

---

## Java

- [`awesome-java`](https://github.com/akullpp/awesome-java) Awesome frameworks, libraries and software for the Java programming language.
- [`Java`](https://github.com/TheAlgorithms/Java) All Algorithms implemented in Java.

---

## JavaScript

- [`javascript`](https://github.com/TheAlgorithms/Javascript) All algorithms implemented in Javascript (for educational purposes only).
- [`javascript-algorithms`](https://github.com/trekhleb/javascript-algorithms) 📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings.

---

## Kubernetes

- [`awesome-kubernetes`](https://github.com/ramitsurana/awesome-kubernetes) A curated list for awesome kubernetes sources.

---

- [`awesome-landing-page`](https://github.com/nordicgiant2/awesome-landing-page) A series of beautiful and practical landing page templates.

---

- [`market-toolkit`](https://github.com/ckz8780/market-toolkit) A collection of stock market resources and tools.

---

## Music

- [`awesome-music`](https://github.com/ciconia/awesome-music) Awesome Music Projects.

---

## Neovim

- [`awesome-neovim`](https://github.com/rockerBOO/awesome-neovim) Awesome neovim plugins.

---

## NodeJS & NPM

- [`awesome-micro-npm-packages`](https://github.com/parro-it/awesome-micro-npm-packages)
- [`awesome-npm`](https://github.com/sindresorhus/awesome-npm)
- [`awesome-npm-scripts`](https://github.com/RyanZim/awesome-npm-scripts)
- [`nodejs-cli-apps-best-practices`](https://github.com/lirantal/nodejs-cli-apps-best-practices) Curated best practices on how to build successful, empathic and user-friendly Node.js CLI applications.
- [`nodejs-integration-tests-best-practices`](https://github.com/testjavascript/nodejs-integration-tests-best-practices) ✅ Master the art of the most powerful testing technique for Node.js: Component tests.

---

- [`awesome-pentest`](https://github.com/enaqx/awesome-pentest)
- [`awesome-piracy`](https://github.com/Igglybuff/awesome-piracy)
- [`awesome-portfolio-websites`](https://github.com/smaranjitghose/awesome-portfolio-websites) Free and beautiful templates for building a portfolio website.

## PowerShell

- [`awesome-powershell`](https://github.com/janikvonrotz/awesome-powershell)

---

- [`awesome-github-profile-readme`](https://github.com/abhisheknaiidu/awesome-github-profile-readme) A curated list of awesome Github Profile READMEs.
- [`awesome-pinned-gists`](https://github.com/matchai/awesome-pinned-gists) A collection of awesome dynamic pinned gists for GitHub.
- [`Awesome-Profile-README-templates`](https://github.com/kautukkundan/Awesome-Profile-README-templates) A collection of awesome readme templates to display on your profile.

---

## React

- [`awesome-react`](https://github.com/enaqx/awesome-react)
- [`awesome-react-patterns`](https://github.com/kentcdodds/advanced-react-patterns) Learn how to build simple and flexible React Components and Hooks using modern patterns.
- [`react-demos`](https://github.com/ruanyf/react-demos) A collection of simple demos of React.js

## React Native

- [`awesome-react-native`](https://github.com/jondot/awesome-react-native)
- [`awesome-react-native-native-modules`](https://github.com/prscX/awesome-react-native-native-modules) A curated list of Awesome ReactNative: Native Modules.
- [`awesome-reactnative-ui`](https://github.com/madhavanmalolan/awesome-reactnative-ui) Awesome React Native UI components.

---

## Ruby

- [`awesome-ruby`](https://github.com/markets/awesome-ruby) Awesome Ruby libraries, tools, frameworks and software.
- [`awesome-ruby`](https://github.com/sdogruyol/awesome-ruby) Awesome Ruby frameworks, libraries and resources.
- [`ruby-bookmarks`](https://github.com/dreikanter/ruby-bookmarks) Curated collection of essential Ruby and Ruby on Rails resources.

---

## Ruby on Rails

- [`awesome-rails`](https://github.com/gramantin/awesome-rails) Awesome things related to Ruby on Rails.
- [`awesome-rails-gems`](https://github.com/hothero/awesome-rails-gem) Awesome Ruby Gems for Rails development.

---

- [`awesome-seo`](https://github.com/teles/awesome-seo)
- [`awesome-stock-resources`](https://github.com/neutraltone/awesome-stock-resources)
- [`awesome-terminal-commands`](https://github.com/ankurparihar/Awesome-Terminal-Commands) An awesome resource listing and explaining various commonly used *nix commands.
- [`awesome-unity`](https://github.com/RyanNielson/awesome-unity)
- [`awesome-web-security`](https://github.com/qazbnm456/awesome-web-security)
- [`awesome-windows`](https://github.com/Awesome-Windows/Awesome)
- [`awesome-wsl`](https://github.com/sirredbeard/Awesome-WSL)

---

## Shell

- [`awesome-shell`](https://github.com/alebcay/awesome-shell)

---

- [`app-ideas`](https://github.com/florinpop17/app-ideas) A Collection of application ideas which can be used to improve your coding skills.
- [`awesome-opensource-apps`](https://github.com/unicodeveloper/awesome-opensource-apps) 🏠ℹ Curated list of awesome open source crafted web & mobile applications.
- [`the-art-of-the-command-line`](https://github.com/jlevy/the-art-of-command-line)
- [`search-engine-optimization`](https://github.com/marcobiedermann/search-engine-optimization)
- [`javascript-development-environment`](https://github.com/coryhouse/javascript-development-environment)
- [`system-design-primer`](https://github.com/donnemartin/system-design-primer)
- [`learn-regex`](https://github.com/ziishaned/learn-regex)
- [`Resources-for-Beginner-Bug-Bounty-Hunters`](https://github.com/nahamsec/Resources-for-Beginner-Bug-Bounty-Hunters)
- [`coding-interview-university`](https://github.com/jwasham/coding-interview-university)
- [`developer-roadmap`](https://github.com/kamranahmedse/developer-roadmap)
- [`build-your-own-x`](https://github.com/danistefanovic/build-your-own-x)
- [`javascript-algorithms`](https://github.com/trekhleb/javascript-algorithms)
- [`public-apis`](https://github.com/public-apis/public-apis)
- [`cosmos`](https://github.com/OpenGenus/cosmos)
- [`free-programming-books`](https://github.com/EbookFoundation/free-programming-books)
- [`tech-interview-handbook`](https://github.com/yangshun/tech-interview-handbook)
- [`Front-End-Checklist`](https://github.com/thedaviddias/Front-End-Checklist)
- [`js-stack-from-scratch`](https://github.com/verekia/js-stack-from-scratch)
- [`pure-bash-bible`](https://github.com/dylanaraps/pure-bash-bible)
- [`Front-End-Performance-Checklist`](https://github.com/thedaviddias/Front-End-Performance-Checklist)
- [`hacker-roadmap`](https://github.com/sundowndev/hacker-roadmap)
- [`HEAD`](https://github.com/joshbuchea/HEAD)
- [`solved-by-flexbox`](https://github.com/philipwalton/solved-by-flexbox)
- [`android-ecosystem-cheat-sheet`](https://github.com/igorwojda/android-ecosystem-cheat-sheet)
- [`PowerShellPracticeAndStyle`](https://github.com/PoshCode/PowerShellPracticeAndStyle)
- [`SecLists`](https://github.com/danielmiessler/SecLists) Collection of multiple types of lists used during security assessments.
- [`react-typescript-cheatsheet`](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet) Cheatsheets for experienced React developers getting started with TypeScript.
- [`emoji-cheat-sheet`](https://github.com/ikatyang/emoji-cheat-sheet) A markdown version emoji cheat sheet
- [`Powershell-Scripts`](https://github.com/stank58/Powershell-Scripts) Helpful list of powershell scripts I have found/created.
- [`degoogle`](https://github.com/tycrek/degoogle) List of alternatives to Google products. Privacy tips, tricks, and links.
- [`modern-unix`](https://github.com/ibraheemdev/modern-unix) A collection of modern/faster/saner alternatives to common unix commands.

---

repository: patevs/awesome-lists

repo_name: patevs/awesome-lists


text:
# Installation

## Install ElasticSearch

The sulu article bundle requires a running elasticsearch `^2.2` or `^5.0`.

There is an different installation and configuration depending on which version of ElasticSearch you are using.

If you use version `^2.2` read: [Installation for ElasticSearch 2.2](installation_es2.md)
else read: [Installation for ElasticSearch 5.0](installation_es5.md)

## Configure the routing

```yml
# app/config/admin/routing.yml

sulu_arictle_api:
    resource<EMAIL_ADDRESS>    type: rest
    prefix: /admin/api

sulu_article:
    resource<EMAIL_ADDRESS>    prefix: /admin/articles
```

## Create Template

Add xml template for structure in configured folder:

```
%kernel.root_dir%/Resources/templates/articles/article_default.xml
```

Example is located in Bundle
[article_default.xml](https://github.com/sulu/SuluArticleBundle/blob/master/Resources/doc/article_default.xml).

Add template for article type in configured folder:

```
%kernel.root_dir%/Resources/views/articles/article_default.html.twig
```

Example is located in Bundle
[article_default.html.twig](https://github.com/sulu/SuluArticleBundle/blob/master/Resources/doc/article_default.html.twig).

## Initialize bundle

Create assets:

```bash
php bin/console assets:install
```

Create translations:

```bash
php bin/console sulu:translate:export
```

Create required phpcr nodes:

```bash
php bin/console sulu:document:init
```

Create elasticsearch index:

```bash
php bin/console ongr:es:index:create
php bin/console ongr:es:index:create --manager=live
```

## Possible bundle configurations:

```yml
# app/config/config.yml

sulu_article:
    documents:
        article:
            view: Sulu\Bundle\ArticleBundle\Document\ArticleViewDocument
    types:

        # Prototype
        name:
            translation_key:      ~

    # Display tab 'all' in list view
    display_tab_all:      true
```

repository: rflorent/SuluArticleBundle

repo_name: rflorent/SuluArticleBundle


text:
# narchaic
Angular 2 UI and Node.js REST API code generator

Config folder contains 3 files:
1.  database.config.js consists database url. Replace the 'notes' in the url to your database name.
2.  entity_constants.config.js consists entities to be added as rest endpoints. 'name' field is the name of the entity and fields are the database schemas. The name field is appended with an 's' when accessing the endpoint, for example 'task' will give an endpoint http://localhost:port/tasks
3.  port.config.js consists port number on which the server will run. Replace 8080 with the desired port number.

After making changes in these files run 'node narchaic.js'
This will create all the necessary files and folders. You'll find servertest.js at the same level of narchaic.js
Running 'node servertest.js' will start the server at http://localhost:port/'your entity's

UI is still WIP :)

repository: Snappyie/narchaic

repo_name: Snappyie/narchaic


text:
# elm-semigroup

## Summary

A module to define a equal typeclass

The Eq typeclass provides an interface for testing for equality. Any type where it makes sense to test for equality between two values of that type should be a member of the Eq class. All standard Haskell types except for IO (the type for dealing with input and output) and functions are a part of the Eq typeclass.

Eq is used for types that support equality testing. The functions its members implement are == and /=. So if there's an Eq class constraint for a type variable in a function, it uses == or /= somewhere inside its definition. All the types we mentioned previously except for functions are part of Eq, so they can be tested for equality.

ghci> 5 == 5
True
ghci> 5 /= 5
False
ghci> 'a' == 'a'
True
ghci> "Ho Ho" == "Ho Ho"
True
ghci> 3.432 == 3.432
True

See [documentation](http://learnyouahaskell.com/types-and-typeclasses#typeclasses-101)