text:
[Source](http://dotnetcodr.com/2014/10/13/using-a-windows-service-in-your-net-project-part-3-the-application-service-layer/ "Permalink to Using a Windows service in your .NET project part 3: the application service layer")

# Using a Windows service in your .NET project part 3: the application service layer

**Introduction**

In the [previous post][1] we built the Domain and Repository layers of the demo app. We'll now build the application service layer that connects the two with the consumer layer which we'll build in the next post.

Normally the consumer layer, such as a Web UI should not directly contact the repository for its data. The application service is responsible for joining all necessary repositories and other services to provide the data that the consumer layer needs to show.

We'll build upon the demo app we've been working on so far in this series so have it ready in Visual Studio.

**Short return to Infrastructure**

Before we begin we'll need two new elements in the Infrastructure layer. You'll recall from the previous post that the abstract MongoDbRepository class will need an IDatabaseConnectionSettingsService interface to read the connection string and database name. We'll store those in the app.config file which we'll create in the next post. However, these settings could potentially be stored in various different places: a database, a web service, etc.

We saw in [this][2] post how reading settings can be hidden behind an interface. We'll take a similar approach here.

Add a new folder called ConfigurationService to the Infrastructure layer. Insert the following interface into it:

    public interface IConfigurationRepository
    {
    	T GetConfigurationValue<T>(string key);
    	T GetConfigurationValue<T>(string key, T defaultValue);
    	string GetConnectionString(string connectionStringName);
    }

Normally settings come in name-value pairs so we pass some key value and expect the corresponding setting value back.

For the implementation we'll take the ConfigurationManager class located in the System.Configuration namespace. You'll need to add this dll to the references list of the Infrastructure layer. Here's the implementing class:

    public class ConfigFileConfigurationRepository : IConfigurationRepository
    {
    	public T GetConfigurationValue<T>(string key)
    	{
    		string value = ConfigurationManager.AppSettings[key];
    		if (value == null)
    		{
    			throw new KeyNotFoundException("Key " + key + " not found.");
    		}
    		try
    		{
    			if (typeof(Enum).IsAssignableFrom(typeof(T)))
    				return (T)Enum.Parse(typeof(T), value);
    			return (T)Convert.ChangeType(value, typeof(T));
    		}
    		catch (Exception ex)
    		{
    			throw ex;
    		}
    	}

    	public T GetConfigurationValue<T>(string key, T defaultValue)
    	{
    		string value = ConfigurationManager.AppSettings[key];
    		if (value == null)
    		{
    			return defaultValue;
    		}
    		try
    		{
    			if (typeof(Enum).IsAssignableFrom(typeof(T)))
    				return (T)Enum.Parse(typeof(T), value);
    			return (T)Convert.ChangeType(value, typeof(T));
    		}
    		catch (Exception ex)
    		{
    			return defaultValue;
    		}
    	}

    	public string GetConnectionString(string connectionStringName)
    	{
    		return ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
    	}
    }

We'll see shortly how this abstraction is used.

**The service layer**

Add a new C# library called Demo.ApplicationService to the solution. Add a project reference to the Domain and Infrastructure layers. Insert 3 folders:

* Messaging
* JobServices
* DatabaseConnectionService

Let's get the database connection service out of the way first. The implementation will need a dependency of type IConfigurationRepository to read the connection string and database name values. Insert the following class into the DatabaseConnectionService folder:

    public class HttpJobDatabaseConnectionService : IDatabaseConnectionSettingsService
    {
    	private readonly IConfigurationRepository _configurationRepository;

    	public HttpJobDatabaseConnectionService(IConfigurationRepository configurationRepository)
    	{
    		if (configurationRepository == null) throw new ArgumentNullException("IConfigurationRepository");
    		_configurationRepository = configurationRepository;
    	}

    	public string GetDatabaseConnectionString()
    	{
    		return _configurationRepository.GetConnectionString(Constants.HttpJobsConnectionStringKeyName);
    	}

    	public string GetDatabaseName()
    	{
    		return _configurationRepository.GetConfigurationValue<string>(Constants.HttpJobsDatabaseNameSettingKeyName);
    	}
    }

This class reads the setting key names from another class called Constants:

    public static class Constants
    {
    	public static string HttpJobsConnectionStringKeyName = "HttpJobsConnectionString";
    	public static string HttpJobsDatabaseNameSettingKeyName = "HttpJobsDatabaseName";
    }

So we'll store the connection string with the key "HttpJobsConnectionString" and the database name with the key "HttpJobsDatabaseName". Remember, these settings could be stored anywhere hence the need to inject the service which actually reads the settings. We'll fill in the app settings file shortly.

**Service abstractions**

OK, let's create the abstractions for the Job related services. An IHttpJobService should be able to retrieve a specific job, retrieve all new jobs, insert a new job and update an existing job. Add the following interface to the JobServices folder:

    public interface IHttpJobService
    {
    	InsertHttpJobResponse InsertHttpJob(InsertHttpJobRequest request);
    	GetHttpJobResponse GetHttpJob(GetHttpJobRequest request);
    	UpdateHttpJobResponse UpdateHttpJob(UpdateHttpJobRequest request);
    	GetHttpJobsResponse GetNewHttpJobs();
    }

We have several new but simple RequestResponse objects here. They are used to relay all necessary inputs to the Service instead of creating many overloaded variants of the same methods. Insert the following classes to the Messaging folder:

    public abstract class BaseResponse
    {
    	public Exception OperationException { get; set; }
    }

    public class InsertHttpJobResponse : BaseResponse
    {
    	public Guid JobCorrelationId { get; set; }
    }

    public class InsertHttpJobRequest
    {
    	private List<Uri> _urisToRun;

    	public InsertHttpJobRequest(List<Uri> urisToRun)
    	{
    		if (urisToRun == null || !urisToRun.Any())
    		{
    			throw new ArgumentException("The URI list cannot be empty.");
    		}
    		_urisToRun = urisToRun;
    	}

    	public List<Uri> UrisToRun
    	{
    		get
    		{
    			return _urisToRun;
    		}
    	}
    }

    public class GetHttpJobResponse : BaseResponse
    {
    	public HttpJob Job { get; set; }
    }

    public class GetHttpJobRequest
    {
    	public Guid CorrelationId { get; set; }
    }

    public class UpdateHttpJobResponse : BaseResponse
    {}

    public class UpdateHttpJobRequest
    {
    	private HttpJob _updatedJob;
    	public UpdateHttpJobRequest(HttpJob updatedJob)
    	{
    		_updatedJob = updatedJob;
    	}

    	public HttpJob UpdatedHttpJob
    	{
    		get
    		{
    			return _updatedJob;
    		}
    	}
    }

    public class GetHttpJobsResponse : BaseResponse
    {
    	public IEnumerable<HttpJob> HttpJobs { get; set; }
    }

Those were the elements needed for the HttpJob service. We'll need a separate service to carry out a single JobUrl within a HttpJob object. Add the following interface to the JobServices folder:

    public interface IHttpJobUrlService
    {
    	Task<JobUrlProcessResponse> CarryOutSingleJobUrl(Uri uri);
    }

Carrying out a HTTP call can take some time so we'll go for an asynchronous model using the [Task library][3]. JobUrlProcessResponse is similar to the above Response objects. Insert the following class to the Messaging folder:

    public class JobUrlProcessResponse : BaseResponse
    {
    	public int HttpResponseCode { get; set; }
    	public string HttpContent { get; set; }
    	public TimeSpan TotalResponseTime { get; set; }
    }

You'll recognise the properties from the JobUrl domain object: we'll need to read the HTTP response code, the HTML content and the response time from a single URL call.

We need one final abstraction: an interface which co-ordinates the functions of IHttpJobService and IHttpJobUrlService. In other words we need a service that carries out a complete job. Insert the following interface into the JobServices folder:

    public interface IHttpJobExecutionService
    {
    	Task Execute(HttpJob httpJob);
    }

Again, it takes time to carry out a job so we'll go for asynchronous calls here as well.

If you don't understand why these methods are meant to be asynchronous and why they return Task objects then start [here][4].

**Concrete service classes**

OK, enough of abstractions, let's look at the implementations now. HttpJobService which implements IHttpJobService will work with the IJobRepository interface to carry out the repository-related actions such as insertions and updates. Insert the following class to the JobServices folder:

    public class HttpJobService : IHttpJobService
    {
    	private readonly IJobRepository _jobRepository;

    	public HttpJobService(IJobRepository jobRepository)
    	{
    		if (jobRepository == null) throw new ArgumentNullException("Job repository!!");
    		_jobRepository = jobRepository;
    	}

    	public InsertHttpJobResponse InsertHttpJob(InsertHttpJobRequest request)
    	{
    		InsertHttpJobResponse response = new InsertHttpJobResponse();
    		HttpJob job = new HttpJob();
    		job.StatusMessage = "Inserted";
    		List<JobUrl> jobUrls = new List<JobUrl>();
    		foreach (Uri uri in request.UrisToRun)
    		{
    			jobUrls.Add(new JobUrl() { Uri = uri });
    		}
    		job.UrlsToRun = jobUrls;
    		try
    		{
    			Guid correlationId = _jobRepository.InsertNewHttpJob(job);
    			response.JobCorrelationId = correlationId;
    		}
    		catch (Exception ex)
    		{
    			response.OperationException = ex;
    		}
    		return response;
    	}

    	public GetHttpJobResponse GetHttpJob(GetHttpJobRequest request)
    	{
    		GetHttpJobResponse response = new GetHttpJobResponse();

    		try
    		{
    			response.Job = _jobRepository.FindBy(request.CorrelationId);
    		}
    		catch (Exception ex)
    		{
    			response.OperationException = ex;
    		}

    		return response;
    	}

    	public UpdateHttpJobResponse UpdateHttpJob(UpdateHttpJobRequest request)
    	{
    		UpdateHttpJobResponse response = new UpdateHttpJobResponse();
    		try
    		{
    			_jobRepository.Update(request.UpdatedHttpJob);
    		}
    		catch (Exception ex)
    		{
    			response.OperationException = ex;
    		}
    		return response;
    	}

    	public GetHttpJobsResponse GetNewHttpJobs()
    	{
    		GetHttpJobsResponse response = new GetHttpJobsResponse();
    		try
    		{
    			response.HttpJobs = _jobRepository.GetUnhandledJobs();
    		}
    		catch (Exception ex)
    		{
    			response.OperationException = ex;
    		}
    		return response;
    	}
    }

I think the code is really simple and straightforward, there's nothing magic in it.

HttpJobUrlService which implements IHttpJobUrlService will need an IHttpService interface to carry out the HTTP calls. We saw the IHttpService interface in the [first post][5] of this series. Insert the following class into the JobServices folder:

    public class HttpJobUrlService : IHttpJobUrlService
    {
    	private readonly IHttpService _httpService;

    	public HttpJobUrlService(IHttpService httpService)
    	{
    		if (httpService == null) throw new ArgumentNullException("HttpService");
    		_httpService = httpService;
    	}

    	public async Task<JobUrlProcessResponse> CarryOutSingleJobUrl(Uri uri)
    	{
    		JobUrlProcessResponse response = new JobUrlProcessResponse();

    		try
    		{
    			MakeHttpCallRequest httpCallRequest = new MakeHttpCallRequest();
    			httpCallRequest.HttpMethod = HttpMethodType.Get;
    			httpCallRequest.Uri = uri;
    			DateTime start = DateTime.UtcNow;
    			MakeHttpCallResponse httpCallResponse = await httpService.MakeHttpCallAsync(httpCallRequest);
             		DateTime stop = DateTime.UtcNow;
    			TimeSpan diff = stop - start;
    			response.TotalResponseTime = diff;
    			if (!string.IsNullOrEmpty(httpCallResponse.ExceptionMessage))
    			{
    				response.HttpContent = httpCallResponse.ExceptionMessage;
    				response.HttpResponseCode = -1;
    			}
    			else
    			{
    				response.HttpContent = httpCallResponse.HttpResponse;
    				response.HttpResponseCode = httpCallResponse.HttpResponseCode;
    			}
    		}
    		catch (Exception ex)
    		{
    			response.OperationException = ex;
    		}

    		return response;
    	}
    }

We initiate a HTTP request through the injected IHttpService service and note the time between the start and end of the call. This might not be the most precise way to measure the response time of a URL but it's good enough for the demo. Then we populate the HttpContent and HttpResponseCode properties of the JobUrlProcessResponse object based on the result stored in MakeHttpCallResponse.

Finally, we have an implementation of the IHttpJobExecutionService interface. This implementation will use IHttpJobService and IHttpJobUrlService to carry out its work. Insert the following class into the JobServices folder:

    public class HttpJobExecutionService : IHttpJobExecutionService
    {
    	private readonly IHttpJobService _httpJobService;
    	private readonly IHttpJobUrlService _httpJobUrlService;

    	public HttpJobExecutionService(IHttpJobService httpJobService, IHttpJobUrlService httpJobUrlService)
    	{
    		if (httpJobService == null) throw new ArgumentNullException("HttpJobService");
    		if (httpJobUrlService == null) throw new ArgumentNullException("HttpJobUrlService");
    		_httpJobService = httpJobService;
    		_httpJobUrlService = httpJobUrlService;
    	}

    	public async Task Execute(HttpJob httpJob)
    	{
    		httpJob.Started = true;
    		httpJob.StatusMessage = string.Format("Starting job {0}.", httpJob.CorrelationId);
    		_httpJobService.UpdateHttpJob(new UpdateHttpJobRequest(httpJob));
    		TimeSpan totalTime = new TimeSpan(0, 0, 0);
    		foreach (JobUrl jobUrl in httpJob.UrlsToRun)
    		{
    			jobUrl.Started = true;
    			httpJob.StatusMessage = string.Concat("Starting url ", jobUrl.Uri);
    			_httpJobService.UpdateHttpJob(new UpdateHttpJobRequest(httpJob));
    			JobUrlProcessResponse jobUrlProcessResponse = await _httpJobUrlService.CarryOutSingleJobUrl(jobUrl.Uri);
    			jobUrl.Finished = true;
    			jobUrl.HttpContent = jobUrlProcessResponse.HttpContent.Length > 30 ? jobUrlProcessResponse.HttpContent.Substring(0, 30) : jobUrlProcessResponse.HttpContent;
    			jobUrl.HttpResponseCode = jobUrlProcessResponse.HttpResponseCode;
    			jobUrl.TotalResponseTime = jobUrlProcessResponse.TotalResponseTime;
    			httpJob.StatusMessage = string.Concat("Finished url ", jobUrl.Uri);
    			_httpJobService.UpdateHttpJob(new UpdateHttpJobRequest(httpJob));
    			totalTime += jobUrlProcessResponse.TotalResponseTime;
    		}
    		httpJob.Finished = true;
    		httpJob.TotalJobDuration = totalTime;
    		httpJob.StatusMessage = string.Format("Job {0} finished.", httpJob.CorrelationId);
    		_httpJobService.UpdateHttpJob(new UpdateHttpJobRequest(httpJob));
    	}
    }

In the Execute method we first update the job status to Started. Then we go through each URL in the UrlsToRun list of the HttpJob object. In the for-each loop we update the status of the URL to started and then save the HTTP response code and content. We also add the response time of the URL to the total response time of the job. Finally we update the job status to Finished and assign the total response time to the appropriate property.

That's it, we have the service layer ready to go.

In the [next post][6] we'll build the consumer layer which will be a simple Console app.

View the list of posts on Architecture and Patterns [here][7].

### Like this:

Like Loading...

### _Related_

[1]: http://dotnetcodr.com/2014/10/09/using-a-windows-service-in-your-net-project-part-2-the-domain-and-repository/ "Using a Windows service in your .NET project part 2: the domain and repository"
[2]: http://dotnetcodr.com/2014/09/08/externalising-dependencies-with-dependency-injection-in-net-part-3-configuration/ "Externalising dependencies with Dependency Injection in .NET part 3: configuration"
[3]: http://dotnetcodr.com/task-parallel-library/ "Task Parallel Library"
[4]: http://dotnetcodr.com/2012/12/31/await-and-async-in-net-4-5-with-c/ "Await and async in .NET 4.5 with C#"
[5]: http://dotnetcodr.com/2014/10/06/using-a-windows-service-in-your-net-project-part-1-foundations/ "Using a Windows service in your .NET project part 1: foundations"
[6]: http://dotnetcodr.com/2014/10/16/using-a-windows-service-in-your-net-project-part-4-the-consumer-layer/ "Using a Windows service in your .NET project part 4: the consumer layer"
[7]: http://dotnetcodr.com/architecture-and-patterns/ "Architecture and patterns"

repository: forcewake/articles-for-translation

path: /en/Architecture and patterns/Using a Windows service/Part_3_the_application_service_layer.md

repo_name: forcewake/articles-for-translation


text:
# Spitfire

![](https://i.imgur.com/XFsqa6I.png)

# Installing

For projects targeting x64

```
Install-Package Spitfirex64
```

For projects targeting x86
```
Install-Package Spitfirex86
```

To install the utilities

```
Install-Package SpitfireUtils
```

# What is this?

Spitfire is a wrapper around the WebRTC native code that allows .NET applications to take advantage of data channels. The goal of this is to allow people to build awesome P2P applications and to make it easier to use WebRTC in a server-like fashion.

# What is a data channel?

A WebRTC data channel lets you send text or binary data over an active connection to a peer. In the context of a game, this lets players send data to each other, whether text chat or game status information. Data channels come in two flavors.

Reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent. This is analogous to a TCP socket.

Unreliable channels make no such guarantees; messages aren't guaranteed to arrive in any particular order and, in fact, aren't guaranteed to arrive at all. This is analogous to a UDP socket.

For a quick reminder on the differences between UDP and TCP, look [here](https://support.holmsecurity.com/hc/en-us/articles/212963869-What-is-the-difference-between-TPC-and-UDP-)

# What about audio/video?

This library does not currently support audio and video, however if there is enough demand we may consider adding it. To ensure this code runs in all environments we implement fake audio/video devices during initialization.

# Size limitations

Data channels only support sending tiny fragments of data, while it is possible to send complete files through it, they must first be chunked. We provide some functions that will allow you to do this quickly without unnecessary copying in ```DataChannelUtils```. It is recommended you chunk all messages larger than 10KB to avoid hitting the 16 KB limit.

# Signaling

![](https://i.imgur.com/tY0yv7M.png)

Signaling is the process of coordinating communication. In order for a WebRTC application to set up a data channel, its clients need to exchange information. Spitfire does not currently provide a signaling server, however this isn't a complex process and you can find more information on it [here](https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/).

# Messaging

If you're looking to maximize speed for your application, we recommend pairing Spitfire with [Sachiel](https://github.com/RainwayApp/sachiel-net), our fast network messaging framework.

# Contributing & Building

If you wish to contribute documentation, code examples or fixes we are more than happy to accept pull request.

To build the C++, you can find the precompiled WebRTC libraries on the release page [here](https://github.com/RainwayApp/spitfire/releases). Building WebRTC itself can be quite the headache so we provide scripts for that as well.

repository: Terricide/spitfire

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: Terricide/spitfire


text:
# Contributing to SaronaHub's server

All kind of contribution is more than welcome, thanks for taking the time to contribute!

The following is a set of guidelines for contributing to SaronaHub's server. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

## Style Guides

### JavaScript Style Guide

All JavaScript must adhere to [Airbnb's JavaScript Style Guide][1] with the following exceptions.

- You can ignore comma dangle
- You can use unnamed function expressions
- Camle case is not necessary but recommended
- Don't use underscore dangle if not necessary

[1]: https://github.com/airbnb/javascript

### Git Commit Messages

- Use the past tense("added feature" not "add feature")

license: MIT

repository: saronahub/server

repo_name: saronahub/server


text:
---
layout: post
title: Poker Goals
published: true
---

### Background
- Started poker May 22nd, 2019, my 21st birthday.
	* Got torched twice at my dad's home game.
- Started playing on Ignition Casino
	* Burned many a Buy in
- Started reading "Harrington on Cash Games"
	* Started reading Mike Matteo's "Fundamentals of Playing online Texas Hold 'em"
	* Texas Hold 'em for Dummies
	* "The mental game of poker"
- Purchased and installed Poker Tracker 4
- Currently grinding at 0.02/0.05 microstakes as of Febuary 3rd, 2020.

### Game Plan
- Goal: Side income. $10,000 USD/Year.
	* Time frame: Within 2 Years.
	* Will need to transition to $1/3 Live games.
	* Very ambitious, and $10,000 is not a life changing amount of money.
- Action: How to get there?
	* Ignition 2/5NL Zone is probably not where I should be.
	* Be more disciplined with bankroll management

### Progress (Statistics)
- Graph of time spent playing
- Overall money trend

### Is it worth it?
- Poker is not scaleable, and has extremely high variance.
- Anything more than a ~$10,000


text:
# [Code Clusters Models](https://github.com/Aalto-LeTech/CodeClustersModeling)

Repository for the models used by the [CodeClusters](https://github.com/Aalto-LeTech/CodeClusters)

We are using Jupyter to prototyping our models.

## How to install locally

You should have Python >=3.5 installed, pyenv or mkvirtualenv for creating virtual environments. Also you need Java JDK >=11 to be able to run Checkstyle Java library to generate metrics. **NOTE:** as of 5.8.2022 the `dev-requirements.txt` were not updated although `requirements.txt` were. `psycopg2` might work better now but the situation is still not ideal regarding Python's package management.

1. Generate virtual environment eg: `mkvirtualenv cc`
2. Install requirements: `pip install -r dev-requirements.txt`
3. Due to some weird unimaginable things, installation of psycopg2 didn't work directly on macOS. So following this [thread](https://stackoverflow.com/questions/26288042/error-installing-psycopg2-library-not-found-for-lssl) what I had to do was: `env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2`. But first try just `pip install psycopg2` to see if it works
4. Install Checkstyle to `./tmp`: `mkdir tmp && cd tmp && curl -OL https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.2/checkstyle-10.3.2-all.jar && cd ..`
5. Copy the example environment variables: `cp .example.env .env`
6. Launch the notebook: `jupyter notebook`
7. In http://localhost:8888 open the `notebooks` folder to find the models
8. You can also start the model server with: `./dev.sh` NOTE: there is some problems with Flask not triggering properly on code changes

You can install new dependencies without stopping the notebook, just open another terminal and remember to activate the virtualenv eg: `workon cc`. Then just use pip: `pip install tensorflow`. **Remember** to save the new library if you use it in some models: `pip freeze > dev-requirements.txt`

## How to install with Docker

This is the setup used for production.

1. Copy the example env: `cp .modeling.env.example .modeling.env`. Change variables if necessary
2. Build the image: `docker-compose -f prod-docker-compose.yml build`
3. Start it: `docker-compose -f prod-docker-compose.yml up`

## Installing ANTLR

I have already added the required files to run ANTLR locally, but if you for some reason need to reinstall ANTLR this is how I did it (1.8.2022).

```bash
# Executed with macOS Big Sur

# needs Java 11
brew install openjdk@11
sudo ln -sfn<EMAIL_ADDRESS>/Library/Java/JavaVirtualMachines/openjdk-11.jdk

# Download the JAR file
wget http://www.antlr.org/download/antlr-4.8-complete.jar
wget https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java/JavaLexer.g4
wget https://raw.githubusercontent.com/antlr/grammars-v4/master/java/java/JavaParser.g4
java -jar ./antlr-4.8-complete.jar -Dlanguage=Python3 ./JavaLexer.g4
java -jar ./antlr-4.8-complete.jar -Dlanguage=Python3 ./JavaParser.g4
```

repository: Aalto-LeTech/CodeClustersModeling

gha_language: Jupyter Notebook

gha_license_id: MIT

repo_name: Aalto-LeTech/CodeClustersModeling


text:
# ActionResponseTypeAnalyzer

[![Build status](https://ci.appveyor.com/api/projects/status/hmxmmk7wi4ibmk5e/branch/master?svg=true)](https://ci.appveyor.com/project/NCREngage/actionresponsetypeanalyzer/branch/master)

## Problem

WebApi's HttpResponseMessage is not a generic type. It was at the beginning, but before the release it was decided that it should not be and so we stuck with non-descriptive action method calls like

```
public HttpResponseMessage Get([FromUri] int someId) { ... }
```

Creators of WebApi documentation needed to know what the type is, so they invented ``System.Web.Http.Description.ResponseTypeAttribute``. So now there are two sources of truth about what the method returns - method body decides what is being run by computers and attribute decides whay is being read by humans. This leads to mismatches.

## Solution

This analyzer is a patch that compares actual types with the declared ones. It contains two diagnostics:

* ARTA001: Value type declared in ResponseType should match to actual response type.
* ARTA002: Public controller method specify their response type in the ResponseType attribute.

repository: NCR-Engage/ActionResponseTypeAnalyzer

repo_name: NCR-Engage/ActionResponseTypeAnalyzer


text:
SciRuby is a collaborative effort to bring scientific computation to Ruby. If you want to help, please do so!

This guide covers way in which you can contribute.

## How to help

There are various ways in which you can improve SciRuby. Coding and documentation are the two primary possibilities, but you can also contribute to one of ours subprojects (listed below) and participate in the [mailing list][mailing-list] -- suggesting ideas and changes is very important!

Apart from adding features and functionality, you can also create tests (we use RSpec), guides on how to do something using SciRuby, document the libraries and help find and fix bugs.

Start by visiting our [issue tracker] if you want to start contributing, there's probably something with which you can help.

## Projects

SciRuby is an umbrella for many other projects in Ruby. There's not much hierarchy or anything, but we believe that the most important one at the time is [NMatrix][nmatrix], as it's very hard to create some scientific library that doesn't need a good numerical linear algebra library to deal with vectors and matrices.

So, the SciRuby subprojects are, in no particular order:

- [NMatrix][nmatrix]: A fast numerical linear algebra library
- [Statsample][statsample]: A suite for basic and advanced statistics
- [Distribution][distribution]: Diverse statistical distributions. Uses C (statistics2/GSL) or Java extensions when available.
- [Integration][integration]: Integration methods.
- [Minimization][minimization]: Various minimization algorithms in pure Ruby.

## Documentation

Documentation is something most developers don't want to create, but everyone likes to use (well, most of the time). We can't possibly have a big community without proper guides and API docs.

Our current idea is to write guides (that can be initially created as blog posts, for example) and put them into a single place -- the [sciruby.com][sciruby] website. This enables people to start using the library without much friction.

For API documentation, we're using the [RDoc format][rdoc] in the source code. It works with both Ruby and C, so we should be able to have a very good coverage. We want to put the whole API documentation in one single place; again, the [sciruby.com][sciruby] website.

If you solved a problem or created an application that uses SciRuby or its subprojects, please say so in our mailing list and send us a pull request!

## Conclusion

Before commiting any code, you *MUST* read our {Contributor Agreement}[http://github.com/SciRuby/sciruby/wiki/Contributor-Agreement]. This is meant to protect both us and the users of SciRuby, as there are lots of scientific packages (or code found in books) that aren't so "open" as we would like them to be.

[mailing-list]: https://groups.google.com/forum/?fromgroups#!forum/sciruby-dev
[sciruby]: http://sciruby.com
[nmatrix]: https://github.com/sciruby/nmatrix
[statsample]: https://github.com/SciRuby/statsample
[distribution]: https://github.com/SciRuby/distribution
[integration]: https://github.com/SciRuby/integration
[minimization]: https://github.com/SciRuby/minimization
[rdoc]: http://rdoc.rubyforge.org/


text:
# Testing AngularJS Small Project

AngularJS small app unit testing course, with Jasmine, Karma, PhantomJS & Istanbul

## Getting Started

This project was developed during the
[*Unit Testing AngularJS: Build Bugfree Apps That Always Work!*](https://www.udemy.com/unit-testing-angularjs/
"Unit Testing AngularJS Course") Course in Udemy. Some adaptations were made to follow John Papa's design pattern.

### Prerequisites

To run this project you'll need to have instaled npm and bower to install the dependencies. It's recommended Javascript
and Angular JS intermediate knowledge, specially through the directives section.

### Installing

With the npm installed, just run the command bellow to pull all the dependencies from package.json:

```
npm install -g
```

In the app/ folder you'll need to also pull dependencies, this time with bower:

```
bower install -g
```

To run a local server you'll need to install the http-server package. If it hasn't been downloaded with npm install,
run the following command:

```
npm install http-server -g
```

And to run the server just execute the [http-server](https://www.npmjs.com/package/http-server "Http-server package")
command, resulting in the following:

```
Starting up http-server, serving ./
Available on:
  http://<IP_ADDRESS>:8080
  http://<IP_ADDRESS>:8080
Hit CTRL-C to stop the server
```

With all configured, you can run the unit tests in the app/js/test folders.

## Running the tests

To run all the unit tests, run the following command:

```
karma start app/js/test/karma.conf.js
```

Then, the karma will run the automate unit tests in the headless-browser PhantomJS, reporting the results with the
mocha coverage report.

To see the code coverage with Istanbul, access the following path:

localhost:8080/app/js/test/coverage/<PhantomJSversion-OSversion>/

## Built With

* [AngularJS 1.6.1](https://angularjs.org/) - The web javascript framework used
* [Jasmine 2.5.3](https://jasmine.github.io/) - BDD-testing tool
* [Karma 1.4.0](https://karma-runner.github.io/1.0/index.html) - Javascript Automated Test Runner
* [Karma PhantomJS Launcher 1.0.2](http://phantomjs.org/) - Headless Website Testing

## Authors

* **Matthias Kentzia** - *Course Professor* - [Twitter](https://twitter.com/mattkentz)
* **Davi Kawasaki** - *Course Student* - [Twitter](https://twitter.com/davikawasaki)

See also the [course](https://www.udemy.com/unit-testing-angularjs/) where most of this code was developed.

## License

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

## Acknowledgments

* Hat tip to Matthias, who developed a dense and complete unit testing course for AngularJS
* John Papa Design Pattern

repository: davikawasaki/testing-angularjs

repo_name: davikawasaki/testing-angularjs


text:
![Homelab](../../logo.png)

# Lab Management Cookbook

## About

This is a wrapper cookbook that intends to configure the desired state of servers under management.  The content and function of this cookbook is defined in the project root [README](../../README.md).

See the [recipes](./recipes) and [attributes](./attributes) for more detail of the objects managed by this cookbook.

**NOTICE** *These cookbooks do not have a default.rb, this is intentional.  Use wrapper
cookbooks to consume the recipes instead.  See the lab_management cookbook and
the readme in the root of this project for more information.*

**WARNING:** *These cookbooks should not be used for production without additional modification.*

**WARNING** *The decom and rebuild recipes are destructive, they will
decommission and destroy a node as soon as the node checks into the Chef server.
This includes removing the node from AD, deleting the node's DNS records,
removing it from Chef, deleting the partition table, and powering it down or
rebooting it.*

## License

Copyright 2013-2018, Andrew Wyatt

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: andrewwyatt/homelab

branch_name: refs/heads/main

repo_name: andrewwyatt/homelab


text:
---
title = "Play à la Rails (ActiveRecord, Cucumber, ...)"
speaker = Sebastian Nozzi
twitter = sebnozzi
meetupEventId = 133130112
meetupMemberId = 75099292
homepage = "http://www.sebnozzi.com/"
tags = "Scala,Play Framework"
slides = "https://speakerdeck.com/sebnozzi/play-a-la-rails/"
---
My attempts to make my experience developing Play 2 web-applications (in Scala) more Rails-like.

I show 3 frameworks employed that draw nearer to the Ruby/Rails spirit than Play's default offerings

repository: scala-vienna/scala-vienna-web

gha_language: JavaScript

repo_name: scala-vienna/scala-vienna-web


text:
---
layout: post
title: "iPad Pro Mini-Review"
date: 2016-01-03T08:53:53-07:00
category:
tags: ipad, review
---

> This was originally posted on Facebook on 2015-12-01. It's not a very detailed review as it was intended for my non-technical friends and family. Reposting here as the size comparison with the MacBook will probably be interesting to others.

Talked with my dad earlier today and was raving to him how much I love the new iPad Pro. I've used every iPad since the original but this is the first one that has the potential to replace a laptop IMHO, at least for casual users or casual use by pro users. Case in point: it's pretty much all I've been using for the last week and a half while I've been laid up at home recovering from my [accident]({% post_url 2016-01-06-accident %}). The only things I've broken out my MacBook for are for Xcode, a second set of browser tabs for some Black Friday and Cyber Monday shopping and to do some general maintenance on my development tools.

{% twitter https://twitter.com/phatblat/status/674332881938833408 align='center' %}

So, what's so great about this? It's "just" a bigger iPad, right? That's exactly why!

I don't even have my Apple Pencil or Smart Keyboard yet (both of which only work with the Pro), but this device finally makes sense because of the big screen.

## Multiple Apps

iOS 9 introduces a new Split View feature where you can have two apps onscreen at the same time. The last 3 pictures in this set show this in action. This is only fully supported on the [iPad Pro, Air 2 and Mini 4](http://gadgets.ndtv.com/mobiles/features/ios-9-how-to-use-split-screen-multitasking-and-picture-in-picture-741244?site=classic) right now. Developers do have to add Split View support to their apps, otherwise the 2nd app is only a temporary flyover (Apple calls Slide Over). Adding this support is trivial (took me 15 minutes to add it to a Kaiser app), but even Facebook hasn't updated their app with support for this yet. Expect it to be added very soon.

## Readability

I use glasses to see a computer screen clearly and without eye strain, even on a laptop. This is because the distance to the screen is right between near sight and far sight. An iPad (or any mobile device) is held nearer to the eyes so I don't need glasses. Where a device this big excels is that everything is bigger and more readable. The size is so big that I can pull up a photo full screen and show it to someone across the room.

OK, enough selling, here are the pics. The smaller device is the 2015 12" MacBook. The gray silicone iPad Pro cover is top quality with plush microfiber inside.

# Pictures

![](/images/ipro-review-01.jpg)

Glorious display. Also, this setup has a blue bias.

![](/images/ipro-review-02.jpg)

Not very exciting to look at, but I'm expecting this case to take the wear so the iPad can stay shiny.

![](/images/ipro-review-03.jpg)

So soft

![](/images/ipro-review-04.jpg)

Silicone case on left, naked iPad Pro on right

![](/images/ipro-review-05.jpg)

Huge 12.9" screen

![](/images/ipro-review-06.jpg)

I can't wait until my Smart Keyboard arrives so I'll have a stand+keyboard. I paired a normal Apple Bluetooth keyboard with the Pro earlier for some emails, but had to prop the iPad up on a book to use at a desk.

![](/images/ipro-review-07.jpg)

2 pound (.9 kg) laptop, 1.5 pound (.68 kg) iPad

![](/images/ipro-review-08.jpg)

The smaller one can be used to make apps for the bigger one. The odd shine is a cheap skin to prevent scratches.

![](/images/ipro-review-09.jpg)

Safari on the left and Notes app on the right.

![](/images/ipro-review-10.jpg)

Safari on the left and Mail on right composing an email with the split in the middle.

![](/images/ipro-review-11.png)

Again, Safari on the left and Mail on the right composing and email, but with the split moved to the right. Mail adapts to more of the UI on the iPhone.

repository: phatblat/reflog

extension: markdown

gha_language: SCSS

repo_name: phatblat/reflog


text:
---
layout: post
title:  "US measles cases data"
description: "Historical data for the yearly number of cases of measles in the USA from 1944 to the current day, collated from the US CDC data."
date:   2018-12-09 00:39:22 -0600
categories: data datasets epidemiology
---

I am currently finishing up some work started ages ago that deals with spatial aspects in vaccination. The work was motivated by an outbreak of polio that started in northern Nigeria in 2002-2003, following a vaccine scare episode. In order to illustrate the benefits of vaccination, in these days of elevated anti-vaccine activity, I like to use the example of measles. The US data is available online, although like the SARS data that I discussed elsewhere, getting the entire dataset requires a bit of editing. So this post will serve as a means to disseminate the result of my editing of that data. And produce a graph of said data.

Measles strikes close to home for me: as a six year old kid, despite having received vaccination, I caught measles. (The vaccine, especially in early years, was not always most efficacious. This is one of the reasons it was later recommended to administer a booster shot, which makes the vaccine extremely efficacious; see below.)

**Update:** In 2019, there were a total of 1,282 cases of measles in the US, occurring in 31 states. That is the most cases since the effect of the double dose of vaccine kicked in in the early nineties!

**Update:** In 2020, COVID-19 and resulting social distanciation and restriction of international travel oblige, there were very few cases, the fewest ever.

## Two plots

The first plot is of the reported measles cases in the US during the entire period covered by the data.

        {% include figure.html path="/assets/img/measles_US_1944_2019.png" title="Reported cases of measles in the USA 1944-2019" class="img-fluid rounded z-depth-1" %}

Illustrated are the three main eras in measles in this data:
1. The pre-vaccine era, which lasted until vaccination started in earnest in 1963.
2. The single-dose vaccine era, from 1963 to 1989.
3. After 1989, it was recommended to use two shots (an initial shot and a booster shot).

The second plot focuses on recent events, with particular focus on one of the roots of anti-vaccine activism.

        {% include figure.html path="/assets/img/measles_US_1992_2019.png" title="Reported cases of measles in the USA 1992-2019" class="img-fluid rounded z-depth-1" %}

Here, I show the behaviour of measles since 1992. Of particular note here is the publication in the 28 February 1998 issue of The Lancet of an infamous paper by Wakefield and others that purported to show a link between the MMR vaccine and autism.
It took a few years for the effect to be felt, but now, we see regular small outbreaks. The situation is often the following: unvaccinated (US) individual goes abroad, gets infected, comes home and infects a few unvaccinated people.

The Wakefield paper has since been retracted, Wakefield himself has been discredited (although he does retain some influential supporters) and banned from practicing medicine in the UK (his country), but as often with vaccine scares, the scars remain.

## Data files

+ Concatenated US Centers for Disease Control and Prevention Morbidity and Mortality Weekly Report for notifiable diseases, aggregated by year, from 1944 to 1993 and by month for 1994 and 1995: [file](https://raw.githubusercontent.com/julien-arino/datasets/master/CDC_MMWR_notifiableDiseasesYearly_1944_1995.txt). This file contains the raw data.
+ Yearly number of reported cases of measles in the USA from 1944 to 2020: [file](https://raw.githubusercontent.com/julien-arino/datasets/master/measles_reportedCases_USA_1944_2019.csv). For the period 1944 to 1995, the data comes from the file above. For the years following, data originates from more dynamic pages at [CDC](https://www.cdc.gov/measles/cases-outbreaks.html).

## Some remarks about making the plots

I recently split this post in two. The part explaining how to make axes legible by humans is now [here](/blog/2018/US-plotting-nice-axes-and-cropping).


text:
---
layout:      post
title:       Puppeteer 101
category:    Web Tools
description: How to Install Puppeteer on Ubuntu 18.04 LTS.
---

## Introduction ##

Puppeteer is one kind of browser testing frameworks. It support headless browser testing.
A headless browser is a great tool for automated testing and server environments where you don't need a visible UI shell. You can run some tests on a web page and get snapshot pictures of web page behaviour on a Linux server.

## Prerequisites ##

- An Ubuntu 18.04 LTS x64 server instance.
- A new `non-root` user account with `sudo` access and switch to it.
  Create user: `adduser username`
  Add access: `adduser username sudo`
- Update your system.
  `apt-get update && apt-get upgrade`

## Installation ##

- **Step 1:** Download and Unzip Node.js
  We download the Node.js from the [official site](https://nodejs.org/en/download/). The Latest LTS Version: 8.11.2 (includes npm 5.6.0). We get the 64-bit Linux Binaries here.
  `wget https://nodejs.org/dist/v8.11.2/node-v8.11.2-linux-x64.tar.xz`
  Unzip the package.
  `tar xvJf node-v8.11.2-linux-x86.tar.xz`
  Then we will get a folder named `node-v8.11.2-linux-x64`.

- **Step 2:** Environment Variable Setting
  Add the node.js `bin` folder to `PATH`.
  `export PATH=/path/to/nodejs/node-v8.11.2-linux-x64/bin:$PATH`
  Then check the `node` and `npm` version.
  `node -v`
  `npm -v`

- **Step 3:** Install Puppeteer via `npm`
  `npm i puppeteer`
  The result will look like this:
  `+<EMAIL_ADDRESS>
  `updated 1 package in 2.371s`

- **Step 4:** Install Chromium Browser
  `sudo apt install chromium-browser`

## Usage Examples ##

Here is an example about login the github web page.

    /**
    * @name Github
    *
    * @desc Logs into Github. Provide your username and password as environment variables when running the script, i.e:
    * `GITHUB_USER=myuser GITHUB_PWD=mypassword node github.js`
    *
    */
    const puppeteer = require('puppeteer')
    const screenshot = 'github.png';
    (async () => {
        const browser = await puppeteer.launch()
        const page = await browser.newPage()
        await page.goto('https://github.com/login')
        await page.type('#login_field', process.env.GITHUB_USER)
        await page.type('#password', process.env.GITHUB_PWD)
        await page.click('[name="commit"]')
        await page.waitForNavigation()
        await page.screenshot({ path: screenshot })
        browser.close()
        console.log('See screenshot: ' + screenshot)
    })()

Then execute the test via command:
`GITHUB_USER=myuser GITHUB_PWD=mypassword node github.js`
After that, we will get a picture named `github.png` in the working directory.

## FAQ ##

- **Q**: Why we need a new `non-root` user account with `sudo` access?
  **A**: Running as root without `--no-sandbox` is not supported. But it is not recommended to turn off the `sandbox` because of  security issues. So we do not use the `root` account to run puppeteer test.

- **Q**: Can we use the Chrome browser?
  **A**: Yes, the default browser of puppeteer is the open source Chromium, we can change to Chrome via modify code:
  `const browser = await puppeteer.launch({executablePath: '/path/to/Chrome'})`

- **Q**: Puppeteer will download a Chromium to the current directory by default, why we need `apt install chromium-browser`?
  **A**: The Chromium downloaded by puppeteer did not install the full package dependencies, so we need `apt install chromium-browser` to resolve all the dependencies.

gha_language: HTML


text:
QParser
=======
[![Build Status](https://travis-ci.org/kilbot/Query-Parser.svg)](https://travis-ci.org/kilbot/Query-Parser)

A parsing library intended to parse complex user input with logical operators, grouping, prefixes and flags.

## [Demo](http://kilbot.github.io/Query-Parser/)

Usage
=====

The library is intended for parsing an arbitrary user text input into tokens that can be easily
converted to a query to a database. User text input is much like the thing you write
in Google to do a complex search, e.g. "animals -bears" or "bears OR monkeys". The parser
allows the logical expressions like OR and AND as well as grouping like in math equations.
It also allows prefixes, range queries, quoted strings and various flags.

QParser can be used both in NodeJS and in browser.

You feed the parser with the text string and it returns an array of objects, each object describing
one token. Tokens can be of the following types:
 -  range - a range query, e.g. "20-30" or "-50" or "45-"
 -  prefix - a string with a prefix separated by colon, e.g. "site:wikipedia.org"
 -  prange - prefixed range, e.g. "price:100-200"
 -  string - any other input, e.g. arbitrary strings and numbers
 -  or - a group of queries that should be logically ORed, e.g. "love|hate"
 -  and - a group of queries that should be logically ANDed, e.g. "(jim morrisson)"

 It's your choice how to process this array of objects. It can be converted to an SQL query,
 to a query to a NoSQL database, etc.

Simple cases of search input
----------------------------

### 1 Simple Strings
```javascript
parse('bears monkeys');
// Output:
// [
//   { type: "string", query: "bears" },
//   { type: "string", query: "monkeys" }
// ]
```

### 2 Flags
```javascript
parse('bears !monkeys');
// Output:
// [
//   { type: "string", query: "bears" },
//   { type: "string", query: "monkeys", flags: ["!"] }
// ]
```

### 3 Prefixes
```javascript
parse('animal:bears');
// Output:
// [
//   { type: "prefix", prefix: "animal", query: "bears" }
// ]
```

### 4 Range
```javascript
parse('bears 300-500');
// Output:
// [
//   { type: "string", query: "bears" },
//   { type: "range", from: 300, to: 500 }
// ]
```

### 5 Prefixed Range

will produce
```javascript
parse('bears price:20-30');
// Output:
// [
//   { type: "string", query: "bears" },
//   { type: "prange", prefix: "price", from: 20, to: 30 }
// ]
```

All special symbols can be screened with backslash.

Grouping
--------

Round brackets group everything inside them into a single logical term. The content
is ANDed. Example:

```javascript
parse('(sex drugs)|rocknroll');
// Output:
// [
//   {
//     type: "or",
//     queries: [
//       {
//         type: "and",
//         queries: [
//           {
//             type: "string",
//             query: "sex"
//           },
//           {
//             type: "string",
//             query: "drugs"
//           }
//         ]
//       },
//       {
//         type: "string",
//         query: "rocknroll"
//       }
//     ]
//   }
// ]
```

Square brackets also group everything inside them, but the content is ORed. Example:

```javascript
parse('[sex drugs] rocknroll');
// Output:
// [
//   {
//     type: "or",
//     queries: [
//       {
//         type: "string",
//         query: "sex"
//       },
//       {
//         type: "string",
//         query: "drugs"
//       }
//     ]
//   },
//   {
//     type: "string",
//     query: "rocknroll"
//   }
// ]
```

More on flags, strings and spaces
---------------------------------

Each token in an input string can be prefixed by an arbitrary number of flags. By default,
flags are symbols from the following list: ~, \, +, #, !, *, /, \
Default list can be altered, see API.
Example:

```javascript
parse('~\+#!*\/animal:bear');
// Output:
// [
//   {
//     type: "prefix",
//     prefix: "animal",
//     query: "bear",
//     flags: ["~", "\", "", "+", "#", "!", "*\", "/"]
//   }
// ]
```

Flags in the array will appear in the same order as in the input string. Flags are not interpreted in any
way, it is up to you to decide what does each flag mean.

Everywhere where a string can appear, a quoted string can be used. E.g.

```javascript
parse('"bears monkeys"');
// Output:
// [
//   {
//     type: "string",
//     query: "bears monkeys"
//   }
// ]

parse('animal:"white bears"');
// Output:
// [
//   {
//     type: "prefix",
//     prefix: "animal",
//     query: "white bears"
//   }
// ]
```

By default, the following symbols are recognized as quotes: ", ', `
This can be changed through API. If the quote is not closed, then
the string will take everything until the end of the input.

Spaces divide tokens, if not inside quotes. E.g.

```javascript
parse('bears monkeys');
```

will produce two tokens. The same input in quotes will produce one token. By default,
the following symbols are recognized as spaces: \r, \n, \t and space itself. This can be
changed, ses API.

API
===

First you should require the library:

```javascript
var qparser = require('qparser');
```

Next, you should instantiate the parser:

```javascript
var parser = new qparser();
```

Finally, you can use it to parse strings:

```javascript
var tokens = parser('arbitrary user input');
```

So, require returns a class, instantiating with 'new' returns a parser function. The latter is not common case,
usually 'new' returns a new instance. If you require an instance of the parser, you can pass an argument:

```javascript
var parserInstance = new qparser({ instance: true });
```

This can be used as followes:

```javascript
var tokens = parserInstance.parse('user input');
```

Besides 'instance', constructor accepts the following options:

 -  quotes           - symbols that are recognized as quotes (defaults are ', " and `)
 -  spaces           - symbols that are recognized as spaces (defaults are <space>, '\t', '\r' and '\n' )
 -  flags            - symbols that are recognized as flags (defaults are '~', '+', '#', '!', '*' and '/' )
 -  screen           - symbols that are recognized as screen (default is '\' )
 -  group_open       - symbols that are recognized as group openers (default is '(' )
 -  group_close      - symbols that are recognized as group endings (default is ')' )
 -  or               - symbols that are recognized as logical OR (default is '|' )
 -  prefix           - symbols that are recognized as divider between prefix and value (default is ':' )
 -  range            - symbols that are recognized as divider between first and second values in range (default is ':' )
 -  or_open          - symbols that are recognized as OR group openers (default is '[')
 -  or_close         - symbols that are recognized as OR group endings (default is ']')

Each of these options can be either a regular expression or a string containing all symbols
that will be treated as quotes, spaces, flags etc respectively. Unfortunately, special symbols should be
characters, therefore, you can not use, for example, ' OR ' for logical ORs.
If an option is a regular expression, than it will be used to test if a symbol is something special. E.g.

```javascript
var parser = new qparser({ quotes: '"', spaces: "\t" });
```

will produce a parsing function that will only recognize " as a quote and \t as token delimeter.

Thanks
======

This library was originally forked from [QParser](https://github.com/vne/qparser) by Vladimir Neverov <sanguini@gmail.com>

repository: kilbot/Query-Parser

repo_name: kilbot/Query-Parser


text:
# gaudit - Github Audit Tool for Organizations

This is a command line tool to help you organize and analyze your github
repositories in your organization. You can create some basic rules to look
for conditions in your repositories and output the results as a CSV.

### Commands

```
gaudit

  gaudit update - Update working list of github repos
  gaudit list - List of working github repos
	gaudit team <team> [permission] - List of repos available to a team
  gaudit diff <old> <new> - Difference since last update
  gaudit details [filter] - Detail list of github repos
  gaudit analyze - Analyze rules against working repos
  gaudit results [--verbose] - Show results of analysis
  gaudit append - Creates or updates the append file
  gaudit stats - Summarizes statistics data on the audit
  gaudit csv - Outputs to csv format
```

### Environment Variables

`GAUDIT_GITHUB_TOKEN` - The Github Token for your account.

`GAUDIT_ORGANIZATION` - Specify the Github Organization (does not work with personal accounts)

`GAUDIT_STORAGE` - The file to store state in (defaults to audit.store)

`GAUDIT_RULES` - Rules file for analysis (defaults to rules.yml)

`GAUDIT_APPEND` - Append file for annotating (defaults to append.yml)

`GAUDIT_DEBUG` - Set debug mode (defaults to false)

### Rules File

You can create a rules file to analyze your Github repositories.

Example:
```
-
  name: CircleCI Config
  action: exists
  resource: .circleci/config.yml
-
  name: TravisCI Config
  action: not_exists
  resource: .travis.yml
-
  name: README File
  action: exists
  resource: README.md
-
  name: License
  action: exists
  resource: LICENSE
-
  name: Copyright Notice
  action: exists
  resource: NOTICE.md
  type: public
-
  name: Copyright Date
  action: contains
  resource: NOTICE.md
  match: 2019
  type: public
```

### Releases

NEXT
- Added rules results to details
- Added rules results to stats
- Updated diff to exclude size/updated date
- Updated the stats date output
- Added list of teams on each repo
- Added team command to list by team
- Added team output for details and csv
- Switching Org ownership

v0.1.1
- Added a Stats command

v0.1.0
- Initial release

repository: Urs-Bruelhart/gaudit

repo_name: Urs-Bruelhart/gaudit


text:
API Starter

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

	<img<EMAIL_ADDRESS>alt="NPM Version" />
	<img<EMAIL_ADDRESS>alt="Package License" />

Table of Contents:

1. [Description](#-description)
2. [Prerequisites](#%EF%B8%8F-prerequisites)
3. [Deployment](#-deployment)
4. [Environment Configuration](#-environment-configuration)
5. [Choosing a Web Framework](#-choosing-a-web-framework)
6. [HTTP2](#-http2)
7. [Choosing a Database](#-choosing-a-database)
8. [Testing](#-testing)
9. [TypeDocs](#-typedocs)
10. [Logs](#-logs)

🔎 This repo was created with [Nx](https://nx.dev/).

### 📚 Description

This boilerplate is made to quickly prototype backend applications. It comes with authentication/authorization, logging, crud features and database persistence out of the box.

---

### 🛠 Prerequisites

#### Non Docker

- Please make sure to have [Node.js](https://nodejs.org/en/download/) (16+) locally by downloading the Javascript runtime via `brew`, `choco`, or `apt-get`.

- Please make sure to have MYSQL locally by deploying a web server stack like [XAMPP](https://www.apachefriends.org/). The control panel can then trigger MYSQL to start on localhost. MYSQL can be downloaded standalone via `brew`, `choco`, or `apt-get`.

#### Docker 🐳

- Please make sure to have [Docker Desktop](https://www.docker.com/products/docker-desktop/) operational to quickly compose the required dependencies. Then follow the docker procedure outlined below.

---

### 🚀 Deployment

#### Manual Deployment without Docker

- Clone the repo via `git clone https://github.com/msanvarov/nest-rest-typeorm-boilerplate`.

- Download dependencies via `npm i` or `yarn`.

- Create a **.env file** via the `cp .env.example .env` command and replace the existing environment variable placeholders with valid responses.

- Start the api in development mode by using `npm run start` (the app will be exposed on http://localhost:3333; not to conflict with React, Angular, or Vue ports).

Optional deployment of the UI

- This repo comes with a UI built with [Angular](https://angular.io/) - that can be accessed via `http://localhost:4200`.

- To start the UI, start a new terminal window and run `npm run start --project ui`.

> Remark: In the docker deployment, the UI is automatically started and served by the API.

#### Deploying with Docker 🐳

- Execute the following command in-app directory:

```bash
# creates and loads the docker container in detached mode with the required configuration
$ docker-compose up -d
```

- The following command will download dependencies and execute the web application on http://localhost:80 (deployed behind a Nginx reverse proxy).

---

### 🔒 Environment Configuration

By default, the application comes with a config module that can read in every environment variable from the `.env` file.

**APP_ENV** - the application environment to execute as, either in development or production. Determines the type of logging options to utilize. Options: `development` or `production`.

**WEBTOKEN_ENCRYPTION_KEY** - the key to encrypt/decrypt web tokens with. Make sure to generate a random alphanumeric string for this.

**WEBTOKEN_EXPIRATION_TIME** - **the time in seconds** when the web token will expire; by default, it's 2400 seconds which is 40 mins.

**DB_TYPE** - the type of [database connection to use](https://github.com/typeorm/typeorm/blob/master/docs/connection-options.md).

**DB_USERNAME** - username for authenticating against the database.

**DB_PASSWORD** - password for authenticating against the database, can be left empty if a password is not needed (**not safe**).

**DB_HOST** - the endpoint where this database sits (default is localhost but can be set explicitly).

**DB_PORT** - default ports for different types of database connections.

**DB_DATABASE** - the actual database name to perform operations on.

---

### 🏗 Choosing a Web Framework

This boilerplate comes with [Fastify](https://github.com/fastify/fastify) out of the box as it offers [performance benefits](https://github.com/nestjs/nest/blob/master/benchmarks/all_output.txt) over Express. But the Express adapter is still accessible on a [different branch](https://github.com/msanvarov/nest-rest-typeorm-boilerplate/tree/express).

---

### 💾 Choosing a Database

By default **MYSQL/MariaDB** are the database of choice but TypeORM supports other database types like SQLite, Postgres, MongoDB, and MSSQL. To use anything other than MYSQL/MariaDB, change the configuration in the `.env` file, and download the corresponding wrapper library, like [SQLite3](https://www.npmjs.com/package/sqlite3).

> Check https://typeorm.io/ for supported database types.

**Remark: For MongoDB, TypeORM is not as feature-rich as Mongoose. Thus, I created a boilerplate for [Nest and Mongoose](https://github.com/msanvarov/nest-rest-mongo-boilerplate)**.

---

### 🦾 HTTP/2

Luckily, Fastify can enable HTTP2 over either HTTPS (h2) or plaintext (h2c) out of the box. This boilerplate makes use of this on the [feat/http2 branch](https://github.com/msanvarov/nest-rest-typeorm-boilerplate/tree/feat/http2) where a self-signed certificate was created for testing this capability. The certificate is located in the [certs folder](https://github.com/msanvarov/nest-rest-typeorm-boilerplate/tree/feat/http2/apps/api/src/assets/certs). **For production, please use a valid certificate.**

The self signed certificate can be generated via OpenSSL:

```bash
$ openssl req -x509 -newkey rsa:4096 -keyout api-key.pem -out api-cert.pem -days 365 -nodes

```

> Remark: Express can be ran with HTTP/2 by employing the [spdy](https://www.npmjs.com/package/spdy) library.

---

### ✅ Testing

#### Docker 🐳

```bash
# Start the docker container if it's not running
$ docker start nest-rest-typeorm-api

# unit tests
$ docker exec -it nest-rest-typeorm-api npm run test

```

#### Non-Docker

```bash
# execute test
$ npm run test
```

---

### 💡 TypeDocs

The documentation for this boilerplate can be found [on Github pages](https://msanvarov.github.io/nest-rest-typeorm-boilerplate/).

The docs can be generated on-demand, by typing `npm run typedocs:api:start`. This will produce a **docs/api** folder with the required front-end files and **start hosting on [localhost](http://localhost:8080/)**.

> Remark: The docs for the ui are generated on-demand, by typing `npm run typedocs:ui:start`. This will produce a **docs/ui** folder with the required front-end files and **start hosting on [localhost](http://localhost:8080/)**.

```bash
# generate docs for api code
$ npm run typedocs:api:start
```

---

### 📝 Open API

Out of the box, the web app comes with Swagger; an [open api specification](https://swagger.io/specification/), that is used to describe RESTful APIs. Nest provides a [dedicated module to work with it](https://docs.nestjs.com/openapi/introduction).

The configuration for Swagger can be found at this [location](https://github.com/msanvarov/nest-rest-typeorm-boilerplate/blob/master/apps/api/src/main.ts).

---

### ✨ TypeORM

TypeORM is an object-relational mapping that acts as an abstraction layer over operations on databases. Please view the [documentation](https://typeorm.io/#/) for further details.

The configuration for TypeORM can be found in the [app module](https://github.com/msanvarov/nest-rest-typeorm-boilerplate/blob/master/apps/api/src/app.module.ts#L33-L51).

---

### 🔊 Logs

This boilerplate comes with a Winston module for **extensive logging**, the configurations for Winston can be found in the [app module](https://github.com/msanvarov/nest-rest-typeorm-boilerplate/blob/master/apps/api/src/app.module.ts#L52-L89).

---

### 🏗 Progress

|                                                                       Branches | Status |
| -----------------------------------------------------------------------------: | :----- |
|             [main](https://github.com/msanvarov/nest-rest-typeorm-boilerplate) | ✅     |
| [feat/\*](https://github.com/msanvarov/nest-rest-typeorm-boilerplate/branches) | 🚧     |

---

### 👥 Support

PRs are appreciated, I fully rely on the passion ❤ of the OS developers.

---

## License

This starter API is [MIT licensed](LICENSE).

[Author](https://sal-anvarov.tech/)

repository: msanvarov/nest-rest-typeorm-boilerplate

gha_language: TypeScript

repo_name: msanvarov/nest-rest-typeorm-boilerplate


text:
# BLS signature

## Overview
The groups for verification key and message and signature are configurable by using feature flag.
When using feature `SignatureG1`, signature and message are in G1, verification key in G2 which makes signing cheaper but verification expensive.
When using feature `SignatureG2`, signature and message are in G2, verification key in G1 which makes signing expensive but verification cheaper.
The default feature is `SignatureG2` to keep the verification fast.
2 variatons of creating multi-sigs are provided, one that requires proof of possesion to avoid rogue key attack and is fast. The other does not
require proof of possesion but is slower. The former is present in `multi_sig_fast.rs` and latter in `multi_sig_slow.rs`. Both variations differ in
signature and verkey aggregation only. The signing algorithms for each signer remains same. The verification algorithm remains same as well.
Batch verification is supported as well.
Threshold signatures can be created but the currently implemented key generation requires a trusted third party but key generation mechanisms without
needing a trusted third party can be used without changing the signature aggregation or verkey aggregation mechanisms.

## API

#### Generate parameters which will be used by all signers and verifiers in the system. To simulate a random oracle, a publicly known string is hashed to a generate group element
```rust
let params = Params::new("some publicly known string".as_bytes());
```

#### Generate keys
```rust
let mut rng = thread_rng();
let keypair = Keypair::new(&mut rng, &params);

let sk = keypair.sig_key;
let vk = keypair.ver_key;
```

#### Sign
```rust
let msg = "Message to sign";
let b = msg.as_bytes();
let sig = Signature::new(&b, &sk);
```

#### Verify
```rust
sig.verify(&b, &vk, &params)
```

### Multi-Signature and Verification (Not vulnerable to rogue public key attack but slow)
#### Multi-Signature
```rust
let keypair1 = Keypair::new(None);
let keypair2 = Keypair::new(None);
let msg = "Small msg";
let b = m.as_bytes();
let sig1 = Signature::new(&b, &keypair1.sig_key);
let sig2 = Signature::new(&b, &keypair2.sig_key);
let sigs_and_ver_keys: Vec<(&Signature, &VerKey)> = vec![(&sig1, &keypair1.vk), (&sig2, &keypair2.vk)]
let asig = MultiSignature::from_sigs(sigs_and_ver_keys);
```

#### Multi-Signature Verification
```rust
let vks = vec![&keypair1.vk, &keypair2.vk]
MultiSignature::verify(&asig, &b, vks, &params)
        OR
let vks = vec![&keypair1.vk, &keypair2.vk]
let avk = AggregatedVerKey::from_verkeys(vks);
assert!(asig.verify(&b, &avk, &params));
```

### Multi-Signature and Verification (vulnerable to rogue public key attack but fast)
#### Proof of possession of secret key (signature over verification key)
##### Generate proof of possession of signing key
```rust
let keypair = Keypair::new(None);
let sk = keypair.sig_key;
let vk = keypair.ver_key;

let proof = ProofOfPossession::generate(&vk, &sk);
```

##### Verify proof of possession of signing key
```rust
ProofOfPossession::verify(&proof, &vk, &params)
```

#### Multi-Signature
```rust
let keypair1 = Keypair::new(None);
let keypair2 = Keypair::new(None);
let msg = "Small msg";
let b = m.as_bytes();
let sig1 = Signature::new(&b, &keypair1.sig_key);
let sig2 = Signature::new(&b, &keypair2.sig_key);
let sigs: Vec<&Signature> = vec![&sig1, &sig2]
let asig = MultiSignatureFast::from_sigs(sigs);
```

#### Multi-Signature Verification
```rust
let vks = vec![&keypair1.vk, &keypair2.vk]
MultiSignatureFast::verify(&asig, &b, vks, &params)
        OR
let vks = vec![&keypair1.vk, &keypair2.vk]
let avk = AggregatedVerKeyFast::from_verkeys(vks);
assert!(asig.verify(&b, &avk, &params));
```

#### Batch Verification of signatures
Use `Signature::batch_verify` and `Signature::batch_verify_distinct_msgs` for batch verification. The former
does not assume messages are distinct but the latter does. For their speed comparison, run test `batch_verify`

#### Threshold signature
```rust
// To generate keys using a trusted third party
let threshold = 3;
let total = 5;
let params = Params::new("test".as_bytes());
let (_, signers) = trusted_party_SSS_keygen(threshold, total, &params);

// Once threshold no of signatures are present, use ThresholdScheme::aggregate_sigs
let threshold_sig = ThresholdScheme::aggregate_sigs(threshold, sigs);

// Once threshold no of keys are present, use ThresholdScheme::aggregate_vk
let threshold_vk = ThresholdScheme::aggregate_vk(
            threshold,
            signers
                .iter()
                .map(|s| (s.id, &s.verkey))
                .collect::<Vec<(usize, &VerKey)>>(),
        );

// Now the threshold sig can be verified like a regular signature
assert!(threshold_sig.verify(&msg, &threshold_vk, &params));
```

#### Serialization and Deserialization
```rust
let bs: Vec<u8> = vec![1, 5, 190, 200, ......];

let sk = SigKey::from_bytes(&bs);
let sk_bytes = sk.tobytes();

let vk = VerKey::from_bytes(&bs);
let vk_bytes = vk.tobytes();

let sig = Signature::from_bytes(&bs).unwrap();
let sig_bytes = sig.tobytes();
```
Similar for other objects like AggregatedVerKey, MultiSignature, AggregatedVerKeyFast, MultiSignatureFast

repository: lovesh/signature-schemes

gha_language: Rust

repo_name: lovesh/signature-schemes


text:
---++ MGeneric - Data objects

MGeneric now consists of two sets of objects. Those living under
MGeneric:DB:\* contain the code that makes up the MGeneric systems.
Those that exist under MGeneric:Data:\* contain theater specific data
that allows individual games to tailor the functionality provided by the
MGeneric systems.

---+++ Data object naming

Data objects are named MGeneric:Data:\[theaterID\]:\[dbname\].

i.e. MGeneric:Data:Marrach:Death or MGeneric:Data:Oasis:Death

If a theater specific data object is not present the MGeneric code will
use MGeneric:Data:default:\* instead.

---+++ The Data objects

Currently the data objects are:

    * [[MgenericDatadeath][Death]]
    * [[MgenericDatawound][WoundDB]]
    * [[MgenericDatahealing][Healing]]
    * [[MgenericDatamorph][Morph]]
    * [[MgenericDatadatadb][DataDB]]

-- Main.CarlGriffiths - 25 Feb 2004

repository: ChatTheatre/mgeneric-plugin

repo_name: ChatTheatre/mgeneric-plugin


text:
---
name: Documenation improvement
about: Use this if some action isn't documented correctly
title: 'Documentation: '
labels: docs
assignees: ''

---

### System info

- Sonos version (S1 or S2):
- Software version:

### Service details

<!-- What service isn't documented correctly -->

- Service name:
- Action name(s):

### Link to current documentation

<!-- Add link to page where the information isn't correct -->

### Proposed change

<!-- What do you suggest we change -->

repository: joepv/sonos-api-docs

repo_name: joepv/sonos-api-docs


text:
# lita-jira

[![Build Status](https://img.shields.io/travis/esigler/lita-jira/master.svg)](https://travis-ci.org/esigler/lita-jira)
[![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://tldrlegal.com/license/mit-license)
[![RubyGems :: RMuh Gem Version](http://img.shields.io/gem/v/lita-jira.svg)](https://rubygems.org/gems/lita-jira)
[![Code Climate](https://img.shields.io/codeclimate/github/esigler/lita-jira.svg)](https://codeclimate.com/github/esigler/lita-jira)
[![Gemnasium](https://img.shields.io/gemnasium/esigler/lita-jira.svg)](https://gemnasium.com/esigler/lita-jira)

A [JIRA](https://www.atlassian.com/software/jira) plugin for [Lita](https://github.com/jimmycuadra/lita).

## Installation

Add lita-jira to your Lita instance's Gemfile:

``` ruby
gem "lita-jira"
```

## Configuration

Add the following variables to your lita config file:

``` ruby
config.handlers.jira.username = 'your_jira_username'
config.handlers.jira.password = 'a_password'
config.handlers.jira.site     = 'https://your.jira.instance.example.com/'
```

### Optional attributes
* `context` (string) - If your instance is in a /subdirectory, put that here. Default: `''`
* `format` (string) - You can select a compact one line issue summary by setting this parameter to `one-line`. Default: `verbose`
* `ambient` (boolean) - When set to `true`, Lita will show JIRA issue details when a JIRA issue key is mentioned in chat, outside the context of a command. Default: `false`
* `ignore` (array) - Prevent ambient JIRA issue detection in certain users' messages. Accepts user names, mention names, and IDs. Default: `[]`
* `rooms` (array) - Limit ambient JIRA issue detection to a certain list of rooms. If unspecified, the bot will respond to detected issues in all rooms.
* `use_ssl` (boolean) - When set to `true`, an SSL connection will be used to JIRA. Set to `false` if you run JIRA over plain http.

``` ruby
config.handlers.jira.context = '/myjira'
config.handlers.jira.format = 'one-line'
config.handlers.jira.ambient = true
config.handlers.jira.ignore = ['Jira', 'Github', 'U1234']
config.handlers.jira.rooms = ['devtools', 'engineering']
config.handlers.jira.use_ssl = false
```

## Usage

### Shortcuts

```
todo <project> "<subject>" ["<summary>"] - Creates an issue in <project> with <subject> and optionally <summary>
```

```
jira <issue>                             - Shows a short summary <issue>
jira details <issue>                     - Shows all details about <issue>
jira comment on <issue> <comment text>   - Adds <comment text> to <issue>
jira myissues                            - Displays a list of issues assigned to identified user
```

### Misc

```
jira identify <email address> - Associate your chat user with your email address
jira forget                   - Remove your chat user / email association
jira whoami                   - Show your chat user / email association
```

## CHANGELOG

[CHANGELOG](https://github.com/esigler/lita-jira/releases)

## License

[MIT](http://opensource.org/licenses/MIT)

repository: newrelic-forks/lita-jira

gha_language: Ruby

repo_name: newrelic-forks/lita-jira


text:
# Class : Computer Software, OCR - the webtoon the world of dog, TA : Ikhwan Song

## Preparation
- Download the custom_area_GT.zip from https://drive.google.com/open?id=1VfarXgLSFoXyMQcUUM3v2mLQovx3KQzP and extract at `./data`
- Download the checkpoints.zip and extract at ./
- Download the checkpoints_find_area.zip and extract at ./
- Install necessary dependencies:
```
Just following presentation

```

## Testing
```
>> python find_area_text.py
>> python find_character.py
```

## Reference
- Single Shot Multibox Detector paper: [paper](https://arxiv.org/abs/1512.02325)
- Caffe original implementation: [code](https://github.com/weiliu89/caffe/tree/ssd)
- Pytorch implementation: [code] (https://github.com/ChunML/ssd-pytorch)
- simple tensorflow implementation: [code] (hhttps://github.com/ChunML/ssd-tf2)


text:
# A command line tool to execute WIQL and pull the heirarchy

This tool allows you to execute ad-hoc WIQL from the command line and returns JSON for usage with tools like `jq`.

The result takes the form of the original work items returned from Azure DevOps but with added hierarchy of their parent items.

```json
[
    {
        "Object": {the object from the wiql},
        "Url": {url from Azure DevOps}
        "Parents": [
            {
                "Object": {the object from the wiql},
                "Url": {url from Azure DevOps}
            },
            {
                "Object": {the object from the wiql},
                "Url": {url from Azure DevOps}
            }
        ]
    }
]
```

Parents are flat, but ordered from most senior to immediate. I.e. the first item is the top of the hierarchy.

## Requirements

You'll need to install the .NET Core 2.2 SDK (for now - still working on builds etc).

[.NET Core 2.2](https://dotnet.microsoft.com/download/dotnet-core/2.2)

You'll need an Azure DevOps account and will need to grab a [PAT](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops)

You'll need your Organization, Project and Team name from Azure DevOps. The easiest way to get these I find is to navigate to your sprint board and look at the url:

```
https://dev.azure.com/<org>/<project>/_backlogs/backlog/<team name>/Stories
```

## Docker

I've popped a docker container up that you can use to run this

```
cat  SimpleQuery.txt |  docker run -i jakkaj/wiql ./wiql --pat <pat> --user-email<EMAIL_ADDRESS>--org <org> --project <project> --team "<team>" >> out.json
```

## Usage

For now you'll need to run with the dotnet command

```
dotnet run -- --help
```

Note the -- after `dotnet run` which means to pass whatever follows to the app that is being run as parameters.

```
Options:
  --pat <PAT>                  Azure DevOps Personal Access token - see https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops
  --user-email <USER-EMAIL>    Email address of Azure DevOps user
  --org <ORG>                  The organization from Azure DevOps
  --project <PROJECT>          The project from Azure DevOps
  --team <TEAM>                The team from Azure DevOps
  --query <QUERY>              A WIQL query. Do not use with teh workItems flag
  --version                    Display version information
```

You can pass in a query here with the --query option, but it's best to pass in as a piped input.

## Alternative inputs.

This project supports `.env` files:

```
AzureDevOpsSettings__PersonalAccessToken=
AzureDevOpsSettings__UserEmail=
AzureDevOpsSettings__Organization=
AzureDevOpsSettings__Project=
AzureDevOpsSettings__Team=

```

Any of these can be set as regular environment variables then omitted from the console input parameters.

As a last resort you can use the regular .net style ```appsettings.json``` file:

```json
{
  //please do not set these here, use this -> https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-2.2&tabs=windows or environment vars for tests and command line options for runtime
  "AzureDevOpsSettings": {
    "PersonalAccessToken": "PAT info: https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops",
    "UserEmail": "",
    "Organization": "",
    "Project": "",
    "Project": ""
  }
}

```

repository: jakkaj/wiql

repo_name: jakkaj/wiql


text:
# EF23-PPS-Ledstrip
Piece of coding to control some RGBW Ledstrips used in the Eurofurence 2017 Pawpetshow

# Hardware
Adafruit Feather Huzzah (ESP8266 / Arduino)

Pinout:
  * Powered by USB
  * LED-Strip "+" on (USB) (which gives 5V from the external battery) and "-" on (GND), "data in" is (2)
  * Push Button: connects (4) to (GND)
  * Rotary Encoder: connects to (GND) with Rotary contacts at (12) and (14) and rotary push on (13)

gha_language: Arduino


text:
Remove Parallels from OS X
==========================

**sudo rm -rf : for parallels**

------

Formerely known as "Remove Parallels All Versions". Renamed because I fixed up the original script, compiled an AppleScript that does the hard work for you, and then bundled it into a self-contained Mac OSX app.  Now has a feature that will save your **Parallels** licence to the Desktop in a folder with a ReadMe file so you don't forget what it is.

#### Installation #
Download the `Remove Parallels` script to the `/usr/bin` directory _(requires **cURL** and **sudo**)_:
``` bash
sudo curl "https://raw.github.com/danijeljames/remparallels/master/remprls.sh" -o "/usr/bin/remprls" && sudo chmod +x /usr/bin/remprls
```
Run script from Terminal:
``` bash
remprls [-s | -r]
```
Download the `Remove Parallels` Mac GUI application instead:
[`Remove_Parallels-2.1.1.zip`](http://snipurl.com/280pjei)
#### Usage #
| man2pdf | [-h]   [-r]   [-s]   [--remove]   [--save-license] |
|---------|---------------------|
| `-h` | Displays the help file |
| `-r` | Totally removes Parallels including license |
| `-s` | Saves licence to Desktop and removes Parallels |
| `--remove` | Implies `-r` |
| `--save-license` | Implies `-s` |

#### Contribution #
- Log a [bug report](https://github.com/danijeljames/remparallels/issues/new)
- Send tweet to [@danijeljames](https://twitter.com/danijeljames)

#### Checksums #
**Download:** [`Remove_Parallels-2.1.1.zip`](http://snipurl.com/280pjei)
**SHA1:** `e1d9c682c7fc45030c0b0e8f625ddec5c90708c5`
**MD5:** `7ee5205d0f27ca34bee020b0d87963c2`

repository: wesny/remparallels

repo_name: wesny/remparallels


text:
# trbial

tribial creates digests of current events using the Wikipedia Current Events portal. You can use this tool to create your own news digests. Or, say, create a weekly digest to study up for the current events trivia round at your local pub.

## Requirements

This tool depends on a few gems to make the magic happen. Here's a quick command that you can run to install the necessary ones:

    $ gem install mediawiki_api activesupport redcarpet mail

This tool has been tested against Ruby 2.3.0, but should work with most stable 2.x versions.

trbial is not a gem itself, so please clone the repository to use it:

    $ git clone https://github.com/jontec/trbial.git

## Usage

Once the prerequisites are satisfied, running trbial is quite, well, trivial:

```ruby
require_relative 'trbial'

t = Trbial.new # Defaults to a 7 day digest (inclusive of today)
t.retrieve_events
t.export_events
t.send_events # Sends the digest e-mail. See configuration details below
````

## Configuring the Mail Client

The mail client uses configuration settings in the `mail_options.yml` file. A sample is provided as `mail_options.yml.sample`, tailormade for working with a personal GMail address.

Get started right away by renaming the sample, entering your user name, and updating the message details. You can choose to enter your password, or as is the default, let trbial prompt you on the command line when it's ready to send your digest.

repository: jontec/trbial

repo_name: jontec/trbial


text:
# Smashing the Stack Old School!
Date: August 19, 2015

Nehalem: https://en.wikipedia.org/wiki/Nehalem_%28microarchitecture%29

Pre-Nehalem:
-No randomization

Idea: pour in more bytes, then manipulate return address to point to shell code (controlled crash)

Stack frames designate beginning and end function

Step 1: run program to buffer overflow
Step 2: find any open sockets, etc
Step 3: send buffer
Step 4: find where buffer is overflowing
Step 5: Have point to shell code

Prevention: GNU Stack Elf

repository: frankcash/notes

gha_language: Python

repo_name: frankcash/notes


text:
---
published: true
title: Why SCP and DD from an ESX(i) Host are not Good Performance Tools
author: Karim Elatov
layout: post
categories: ['networking', 'storage', 'vmware']
tags: ['dd', 'performance']
---

I am sure many have noticed that whenever you try to scp a file to or from an ESX(i) host the performance is a little slow. Let's take the following example, here is an scp between two hosts on the same switch utilizing links that are 1GB.

	~# scp 1gb_File <IP_ADDRESS>:/vmfs/volumes/datastore_1
<EMAIL_ADDRESS>password:
	1gb_File                                       100% 1000MB  24.4MB/s   00:41

Now running a test with netperf from within two VMs on those two sames host, going through the same path (ie: using the same vmnics), we see the following:

	~ # /tmp/netserver
	Starting netserver at port 12865

	~ # /tmp/netperf -H <IP_ADDRESS> -t TCP_STREAM -l 30
	TCP STREAM TEST to <IP_ADDRESS>
	Recv Send Send
	Socket Socket Message Elapsed
	Size Size Size Time Throughput
	bytes bytes bytes secs. 10^6bits/sec
	65536 32768 32768 30.00 939.59

So we are capable of utilizing the full 1GB but the hypervisor is limiting the userworlds other than VMs (ie: dd, scp). I do understand that this is not an apples-to-apples comparison (scp is actually reading and writing data to and from the local disks) but we are seeing scp transferring at 195Mb/s while netperf reaches 939Mb/s.

This is by design and makes perfect sense. We want all our resources dedicated to the VMs and not to any of the tools within the hypervisor. There is a pretty good article entitled [ I/O Analyzer](https://www.quora.com/What-is-the-architecture-of-VMWare-ESX-like-and-how-does-it-compare-to-other-operating-systems). It's a VMware appliance that comes pre-installed with a Linux distro and has IOmeter preloaded on it. I might do a post on how to use that tool, as well. :)

### Related Posts

- [Recover Files from an SD Card Using Linux Utilities](/2012/11/recover-files-from-an-sd-card-using-linux-utilities/)
- [Can't Set X520 10GbE Intel NIC to Auto Negotiate on ESX(i)](/2012/10/cant-set-x520-10gbe-intel-nic-to-auto-negotiate-on-esxi/)

gha_language: CSS


text:
# Contributing to Pension Guidance

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Keep your feature branch focused and short lived
4.  Push to the branch (`git push origin my-new-feature`)
6. Create new Pull Request

It’s worth doing each channel in pension_guidance in separate PRs to make the
deploys easier to roll out in stages, as they need to be synchronised per
booking channel.


text:
---
layout: post
title: "LQ Vol 2 Issue 4 Article 4: Reading Study"
date: 2013-11-27 17:03
comments: true
categories: [LQ Autoethno Field Notes, research, Author-Iiams, Affil-Huntington Library]
---

For an explanation of this post, see:
[Preface](/blog/2013/08/14/lq-autoethnography-research-journal-preface/)

---

This entry is about:

Iiams, Thomas M. (1932). Preservation of Rare Books and
Manuscripts in the Huntington Library. *The Library Quarterly,
2*(4), 375-386.
url:[http://www.jstor.org/stable/4301922](http://www.jstor.org/stable/4301922)

---

**Note:** The fourth article of the fourth issue of the second
volume of *The Library Quarterly* is titled "Preservation of Rare
Books and Manuscripts in the Huntington Library."

It was written by Thomas M. Iiams, who was affiliated with:

**Affiliation:** The Huntington Library

**Note:** The first page of the article contains a photograph of a
"vacuum fumigator" that was designed by the library. Incredible
photo. Kind of illustrates how self-sufficient libraries must have
been at the time.

**Note:** This is a particularly interesting comment with regards
to the future development and mission concerning special
collections:

> The creation of "treasure rooms" in several large public and
> university libraries during recent years shows a definite trend
> toward conservation for posterity, making it clear that
> librarians in research institutions are become definitely
> receptive to ideas other than those mainly governing the purchas
> and circulation of books (p. 375).

**Note:** The article is about bookworms, or the treatment of
books that are plagued by bookworms. I did not expect this.

**Note:** When the librarians at Huntington started searching for
a solution to the pest, they sometimes received this humorous
response:

> Others reported that their libraries were free from all insect
> pests, and seemed a bit surprised to learn that there was a
> bookworm other than the human variety (p. 376).

**Note:** The bookworms (a kind of beetle) were a serious problem
(not just for the library but for the sake of preserving
knowledge). While the article is written with some humor at times,
it does also reflect the gravity the situation and what is at
stake. Consider:

> Bear in mind, also, that in each case we had to satisfy
> ourselves that there would be no deleterious effects on the
> materials fumigated, either now or two centuries from now. This,
> of course, necessitated months of research which would have been
> difficult without the very kind co-operation of the California
> Institute of Technology (p. 381).

**Note:** The article does go beyond the issue of bookworms and
discusses climate and other atmospheric concerns, including mold
as well as air polution in industrial cities, related to the
long-term preservation of books. For example:

> Our own investigation indicated that a temperature of 70 F. and
> a relative humidity of 50 per cent, maintained day in and day
> out, are ideal for the proper preservation of books and
> manuscripts. These precise conditions we have been able to
> maintain for about two years. Vellum manuscripts that curled and
> cracked when the humidity was low can now be conveniently
> handled with assurance that gold illuminations will not peel off
> (p. 385).

**Note:** Mentions more work needed with the issue of
[foxing](https://en.wikipedia.org/wiki/Foxing).

repository: cseanburns/research-notebook

repo_name: cseanburns/research-notebook


text:
# StarWar People

This app developed to get StarWar series characters info from https://swapi.dev and consolidate selected information into single json response(API). Then search in frontend search peeople name and display this information.

## Requirement
To run this  you need to install
- NodeJS
- PM2

## Start All Applications

To start all aplication you need to run bash script file as below:

### For Windows:
run from command prompt
``` bash
start-all.bat
```
or double click on start-all.bat located in project root folder.

### For Linux:

``` bash
sh ./start-all.sh
```

license: Unlicense

repository: hrmohseni/starwar

repo_name: hrmohseni/starwar


text:
# TaskPaper themes

Some of my themes for the amazing [TaskPaper][1] app.

## Jellybeans Theme

![Jellybeans sample][jellybeans]

![Jellybeans sample with dark sidebar][jellybeans-dark]

## Tomorrow Night Theme

![Tomorrow night sample][tomorrow-night]

## Installation

- From your Mac, open the Terminal application, and run the following single command to download the theme:

```bash
bash <(curl -fsSL https://raw.githubusercontent.com/mattmc3/taskpaper-themes/main/install.sh)
```

- Close Terminal.

- From TaskPaper, open the _Window_ menu, and choose the _Stylesheet_ submenu and pick jellybeans.

### Notes

To make the sidebar theme dark or light, remove the leading slashes (ie: uncomment) the following
in your stylesheet:

```css
window {
    // uncomment whichever line below for a dark or light sidebar
    // appearance: NSAppearanceNameVibrantDark;
    // appearance: NSAppearanceNameVibrantLight;
}
```

Big thanks to other theme contributers, especially Atom One Dark. More themes can be found [here][2].

[1]: https://www.taskpaper.com
[2]: http://support.hogbaysoftware.com/t/taskpaper-extensions-wiki/1628
[jellybeans]: https://raw.githubusercontent.com/mattmc3/taskpaper-themes/main/resources/jellybeans-sample.png
[jellybeans-dark]: https://raw.githubusercontent.com/mattmc3/taskpaper-themes/main/resources/jellybeans-sample-dark.png
[tomorrow-night]: https://raw.githubusercontent.com/mattmc3/taskpaper-themes/main/resources/tomorrow-night-sample.png


text:
## Contributing

1. Fork and clone the repo.
1. Run `npm install` to install all build dependencies(including Grunt).
1. Create a new branch, please DON'T work in your master branch directly.
1. Run `grunt` so that you can see the impact of your changes on the browser while developing.
1. Fix stuff or add new feature.
1. Update the documentation to reflect any changes.
1. Push to your fork and submit a pull request.


text:
---
title: SPSS dialog boxes for linear regression models
author: Steve Simon
date: 2002-06-21
categories:
- Blog post
tags:
- Linear regression
output: html_document
---

This handout will show the SPSS dialog boxes that I used to create linar regression examples. I will capitalize variable names, field names and menu picks for clarity.

**Fit a general linear model**

Select ANALYZE | GENERAL LINEAR MODEL from the menu. For most simple models, you would then select UNIVARIATE from the menu. Select MULTIVARIATE if you wanted to examine the simultaneous effect of more than one dependent variable. Select REPEATED MEASURES if you have multiple measurements per subject with each measurement in its own column. Select VARIANCE COMPONENTS from the menu if you want to estimate multiple sources of variation (e.g., between and within subjects).

When we select UNIVARIATE, we get the following dialog box.

![Figure 1. Dialog box for glm](http://www.pmean.com/new-images/02/lin_spss01.gif)

Insert your outcome variable in the DEPENDENT VARIABLE field. If you are examining how a categorical variable influences your outcome, insert that categorical variable in the FIXED FACTOR(S) field. If you are examining how a continuous varaibles influences your outcome, insert that continuous variable in the COVARIATES(S) field.

Some of the tables discussed in this presentation require you to select additional options. Click on the OPTIONS button to get the following dialog box.

![Figure 2. Dialog box for glm options](http://www.pmean.com/new-images/02/lin_spss02.gif)

Add your categorical variable to the DISPLAY MEANS FOR field and check the DESCRPTIVE STATISTICS and PARAMETER ESTIMATES options.

**Compute residuals.**

Residuals are useful for examining the assumptions of your general linear model. Select ANALYZE | GENERAL LINEAR MODEL | GLM - GENERAL FACTORIAL from the SPSS menu. After you have defined your model, click on the SAVE button. You will see the following dialog box:

![Figure 3. Dialog box for saving variables](http://www.pmean.com/new-images/02/lin_spss03.gif)

Check any or all of the option boxes for information that you want stored in your data set. The UNSTANDARDIZED RESIDUALS have the simplest definition, but some of the other types of residuals, especially the STUDENTIZED RESIDUALS and the DELETED RESIDUALS provide a clearer picture when your data set has outliers and influential observations. When you have selected all your options, click the CONTINUE button in this dialog box and the OK button on the previous dialog box.

Here is the data set after we have saved the residuals and predicted variables.

![Figure 4. Dialog box for data editor](http://www.pmean.com/new-images/02/lin_spss04.gif)

SPSS numbers the newly created columns of data, in case you want to compute residuals from several competing models.

**Draw a normal probability plot.**

Select GRAPHS | Q-Q from the SPSS menu. You will see the following dialog box:

![Figure 5. Dialog box for Q-Q plots](http://www.pmean.com/new-images/02/lin_spss05.gif)

Select the continuous variable that you want to examine normality for and add it to the VARIABLES box.

You can find an [earlier version][sim1] of this page on my [original website][sim2].

[sim1]: http://www.pmean.com/02/lin_spss.html
[sim2]: http://www.pmean.com/original_site.html

repository: pmean/build-website

repo_name: pmean/build-website


text:
Raphael Toolbox
===============

Raphael Toolbox add some useful helpers to RaphaelJS that allow you to draw mathematical curves.
I made this tools because I had a lot of mathemetical project where I needed to draw mathematical curve, therefore I could use this to easily draw curves in my projects.

Api
---

### Raphael#axes(x, y, w, h, nx, ny)

Similar to the grid method. This one draw x and y axes according to a size, a position, and a proportion.

#### Arguments

- the x position
- the y position
- the height of the grid
- the height of the grid
- the x proportion
- the y proportion

### Raphael#cross(x, y, w, h)

Draw a simple cross according a position and a size.

#### Arguments

- the x position
- the y position
- the width
- the height

### Raphael#curve(pts, type, color, shape)

Draw a curve from an array of points. You can choose the type, the color and the shape.

#### Arguments

- an array of pts ({x: value, y: value})
- the type of the curve (smoothe, line...)
- the color of the curve
- the shape of each pts of the array

### Raphael#equation(equa, min, max, width, height, precision)

Generates a points array from an equation (_ex: y = ax + b_). The result is between a min and max x.

#### Arguments

- the equation function
- the minimal x position
- the maximal x position
- the width of the grid
- the height of the grid
- the precision of the curve (0 --> 1)

### Raphael#grid(x, y, w, h, nx, ny)

Generates a configurable grid.

#### Arguments

- the x position into the canvas
- the y position into the canvas
- the width of the grid
- the height of the grid
- the horizontal step between each line
- the vertical step between each line


text:
This dataset contains ILSVRC-2012 (ImageNet) validation images augmented with a
new set of "Re-Assessed" (ReaL) labels from the "Are we done with ImageNet"
paper, see https://arxiv.org/abs/2006.07159. These labels are collected using
the enhanced protocol, resulting in multi-label and more accurate annotations.

Important note: about 3500 examples contain no label, these should be
[excluded from the averaging when computing the accuracy](https://github.com/google-research/reassessed-imagenet#numpy).
One possible way of doing this is with the following NumPy code:

```python
is_correct = [pred in real_labels[i] for i, pred in enumerate(predictions) if real_labels[i]]
real_accuracy = np.mean(is_correct)
```

repository: tensorflow/datasets

repo_name: tensorflow/datasets


text:
Spring Boot starter
==================

A simple command line program with Hibernate/MySQL integration. It will insert/delete rows as passed in main program.

Following are used

- JDK8
- Spring Boot 1.5.11
- Hibernate
- MySql

### Usage

mvn clean

mvn compile

mvn install -DskipTests

java -jar `<jar file name> <number of rows>`

### ToDo

- Add Unit tests

repository: schiluka/spring-boot-hibernate-starter

repo_name: schiluka/spring-boot-hibernate-starter