text:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

          <title>DrainSupport - lang-scala.git 1.0.0 API - org.vertx.scala.core.streams.DrainSupport</title>
          <meta name="description" content="DrainSupport - lang - scala.git 1.0.0 API - org.vertx.scala.core.streams.DrainSupport" />
          <meta name="keywords" content="DrainSupport lang scala.git 1.0.0 API org.vertx.scala.core.streams.DrainSupport" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

org.vertx.scala.core.streams

DrainSupport

        trait

        DrainSupport extends Self with AsJava

Allows to set a Handler which is notified once the write queue is
drained again. This way you can stop writing once the write queue consumes
to much memory and so prevent an OutOfMemoryError.

          Linear Supertypes

AsJava, Self, AnyRef, Any

          Known Subclasses

DatagramSocket

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

DrainSupport

AsJava

Self

AnyRef

Any

Hide All

Show all

            Learn more about member selection

            Visibility

Public

All

Type Members

        abstract
        type

        J <: java.core.streams.DrainSupport[_]

The internal type of the Java wrapped class.

The internal type of the Java wrapped class.

Definition Classes

DrainSupport → AsJava

Abstract Value Members

        abstract
        val

        asJava: J

The internal instance of the Java wrapped class.

The internal instance of the Java wrapped class.

Definition Classes

AsJava

Concrete Value Members

        final
        def

        !=(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

Any

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        def

        drainHandler(handler: ⇒ Unit): DrainSupport.this.type

Set a drain handler on the stream.

Set a drain handler on the stream. If the write queue is full, then the
handler will be called when the write queue has been reduced to
maxSize / 2. See Pump for an example of this being used.

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        def

        setWriteQueueMaxSize(maxSize: Int): DrainSupport.this.type

Set the maximum size of the write queue to maxSize.

Set the maximum size of the write queue to maxSize. You will still be
able to write to the stream even if there is more than maxSize bytes in
the write queue. This is used as an indicator by classes such as Pump
to provide flow control.

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toString(): String

Definition Classes

AnyRef → Any

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        def

        wrap[X](doStuff: ⇒ X): DrainSupport.this.type

Helper method wrapping invocations and returning the Scala type, once
again to help provide fluent return types

Helper method wrapping invocations and returning the Scala type, once
again to help provide fluent return types

Attributes

protected[this]

Definition Classes

Self

        def

        writeQueueFull: Boolean

This will return true if there are more bytes in the write queue than
the value set using org.vertx.scala.core.streams.DrainSupport.setWriteQueueMaxSize

Inherited from AsJava

Inherited from Self

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
		Former Brazilian footballer Ronaldo to learn advertising from WPP's Martin Sorrell
Former Brazilian footballer Ronaldo is moving to the UK to study advertising under WPP chief executive Sir Martin Sorrell.
		 The 36-year-old, who played for Barcelona, Inter Milan and PSV during an 18-year career, could stay in London for more than two years as he looks to benefit from Sir Martin's knowledge.

"Eighteen years have passed and I've hardly studied at all; I feel a great need to become a student again," Ronaldo told Brazil's Meio & Mensagem newspaper.

"I've learnt a lot in life, travelling, living abroad, just in the school of life. But I also have to immerse myself in something.

"Learning from Martin Sorrell will be perfect. I won't leave him alone, I'll be asking him questions the whole day, just like a striker. He's going to have to tell me everything."

Sir Martin confirmed that Ronaldo – who currently runs ad agency 9ine, a joint venture with WPP – would be joining him in the UK. "Ronaldo had already had great success with clients Claro [and] Duracell. He'll be coming to the UK [to] work with us closely there," he told the Financial Times.

Former Brazilian soccer player Ronaldo is hugged by mascot of 2014 FIFA World Cup during the Ballon d'Or 2012 Gala in Zurich on Monday Photo: Reuters
Andy Trotman

By Andrew Trotman

11:42PM GMT 07 Jan 2013

redpajama_set_name: RedPajamaGithub


text:
/*
	TMRh20 2014 - Optimized RF24 Library Fork
*/

/**
 * Example using Dynamic Payloads
 *
 * This is an example of how to use payloads of a varying (dynamic) size.
 */

#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <RF24/RF24.h>

using namespace std;
//
// Hardware configuration
// Configure the appropriate pins for your connections

/****************** Raspberry Pi ***********************/

RF24 radio(22,0); // CE GPIO, CSN SPI-BUS

int interruptPin = 23; // GPIO pin for interrupts

/**************************************************************/

// Radio pipe addresses for the 2 nodes to communicate.
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

const int min_payload_size = 4;
const int max_payload_size = 32;
const int payload_size_increments_by = 1;
int next_payload_size = min_payload_size;

char receive_payload[max_payload_size+1]; // +1 to allow room for a terminating NULL char
bool role_ping_out = 1, role_pong_back = 0;
bool role = 0;

void intHandler(){
  //
  // Pong back role.  Receive each packet, dump it out, and send it back
  //

  if ( role == role_pong_back )
  {
    // if there is data ready
    if ( radio.available() )
    {
      // Dump the payloads until we've gotten everything
      uint8_t len=0;

      while (radio.available())
      {
        // Fetch the payload, and see if this was the last one.
	len = radio.getDynamicPayloadSize();
	radio.read( receive_payload, len );

	// Put a zero at the end for easy printing
	receive_payload[len] = 0;

	// Spew it
	printf("Got payload size=%i value=%s\n\r",len,receive_payload);
      }

      // First, stop listening so we can talk
      radio.stopListening();

      // Send the final one back.
      radio.write( receive_payload, len );
      printf("Sent response.\n\r");

      // Now, resume listening so we catch the next packets.
      radio.startListening();
    }
  }
}

int main(int argc, char** argv){

  // Print preamble:
  cout << "RF24/examples/pingpair_dyn/\n";

  // Setup and configure rf radio
  radio.begin();
  radio.enableDynamicPayloads();
  radio.setRetries(5,15);
  radio.printDetails();

/********* Role chooser ***********/

  printf("\n ************ Role Setup ***********\n");
  string input = "";
  char myChar = {0};
  cout << "Choose a role: Enter 0 for receiver, 1 for transmitter (CTRL+C to exit) \n>";
  getline(cin,input);

  if(input.length() == 1) {
	myChar = input[0];
	if(myChar == '0'){
		cout << "Role: Pong Back, awaiting transmission " << endl << endl;
	}else{  cout << "Role: Ping Out, starting transmission " << endl << endl;
		role = role_ping_out;
	}
  }
/***********************************/

    if ( role == role_ping_out )    {
      radio.openWritingPipe(pipes[0]);
      radio.openReadingPipe(1,pipes[1]);
    } else {
      radio.openWritingPipe(pipes[1]);
      radio.openReadingPipe(1,pipes[0]);
      radio.startListening();
    }
    attachInterrupt(interruptPin, INT_EDGE_FALLING, intHandler); //Attach interrupt to bcm pin 23

// forever loop
	while (1)
	{

if (role == role_ping_out)
  {
    // The payload will always be the same, what will change is how much of it we send.
    static char send_payload[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ789012";

    // First, stop listening so we can talk.
    radio.stopListening();

    // Take the time, and send it.  This will block until complete
    printf("Now sending length %i...",next_payload_size);
    radio.write( send_payload, next_payload_size );

    // Now, continue listening
    radio.startListening();

    // Wait here until we get a response, or timeout
    unsigned long started_waiting_at = millis();
    bool timeout = false;
    while ( ! radio.available() && ! timeout )
      if (millis() - started_waiting_at > 500 )
        timeout = true;

    // Describe the results
    if ( timeout )
    {
      printf("Failed, response timed out.\n\r");
    }
    else
    {
      // Grab the response, compare, and send to debugging spew
      uint8_t len = radio.getDynamicPayloadSize();
      radio.read( receive_payload, len );

      // Put a zero at the end for easy printing
      receive_payload[len] = 0;

      // Spew it
      printf("Got response size=%i value=%s\n\r",len,receive_payload);
    }

    // Update size for next time.
    next_payload_size += payload_size_increments_by;
    if ( next_payload_size > max_payload_size )
      next_payload_size = min_payload_size;

    // Try again 1s later
    delay(100);
  }

}
}


text:
const smash = require("../../../smash");
const logger = smash.logger();
const errorUtil = smash.errorUtil();
const Request = require("./lib/request");
const Response = require("./lib/response");
const Router = require("./lib/router");
const { RESPONSE_HEADERS_DEFAULT } = require("./lib/constant");

class ApiGatewayProxyRest {
	constructor() {
		this.router = new Router();
	}

	_buildRequest(event, context) {
		const request = new Request(event, context);
		return request;
	}

	_buildResponse(request) {
		const response = new Response(this, request);
		const headers = smash.config.get(RESPONSE_HEADERS_DEFAULT);
		response.addHeaders(headers);
		return response;
	}

	_buildErrorResponse({ requestContext }) {
		const request = {};
		if (requestContext.requestId) {
			request.requestId = requestContext.requestId;
		}
		return this._buildResponse(request);
	}

	handleEvent(event, context, callback) {
		if (typeof callback !== 'function') {
			throw new errorUtil.TypeError("Third parameter of handleEvent() must be a function, ", callback);
		}
		try {
			this._callback = callback;
			const request = this._buildRequest(event, context);
			const response = this._buildResponse(request);
			if (typeof event !== "object" || this.isEvent(event) === false) {
				response.handleError(errorUtil.internalServerError("Wrong type of event as argument to ApiGatewayProxy.handleEvent()"));
			} else {
				try {
					this.router.handleRequest(request, response);
				} catch (error) {
					return response.handleError(error);
				}
				this.handleRequest(request, response);
			}
		} catch (error) {
			const response = this._buildErrorResponse(event);
			response.handleError(error);
		}
	}

	getPrintableUser(request) {
		if (request.user) {
			const { id, account, username, region } = request.user;
			return JSON.stringify({ id, username, account, region });
		}
		return "Anonymous";
	}

	async handleRequest(request, response) {
		logger.info("Matched route: " + request.route.method + " " + request.route.path + " => " + request.path + "; version: " + request.route.version + "; user: " + this.getPrintableUser(request));
		smash.setCurrentEvent(request);
		try {
			if (smash.filter.hasInRule(request.route) === true) {
				await smash.filter.cleanIn(request.route, request);
			}
			await request.route.callback.call(smash, request, response);
		} catch (error) {
			response.handleError(error);
		}
		return this;
	}

	handleResponse(response) {
		smash.clearSingleton();
		logger.info("Response code: " + response.code);
		this._callback(null, {
			statusCode: response.code,
			headers: response.headers.toRawObject(),
			body: response.stringifiedBody,
			isBase64Encoded: response.isBase64Encoded,
		});
		return this;
	}

	isEvent(event) {
		return Boolean(event.httpMethod && event.path && !event.type);
	}

	get(route, callback) {
		this.router.get(route, callback);
		return this;
	}

	post(route, callback) {
		this.router.post(route, callback);
		return this;
	}

	put(route, callback) {
		this.router.put(route, callback);
		return this;
	}

	delete(route, callback) {
		this.router.delete(route, callback);
		return this;
	}

	patch(route, callback) {
		this.router.patch(route, callback);
		return this;
	}

	options(route, callback) {
		this.router.options(route, callback);
		return this;
	}

	head(route, callback) {
		this.router.head(route, callback);
		return this;
	}

	sameAs(route, { action, version }) {
		this.router.sameAs(route, { action, version });
		return this;
	}

	getHandlers() {
		return this.getRoutes();
	}

	getRoutes() {
		return this.router.getRoutes();
	}

	expose() {
		return [
			{
				"functionName": "get",
				"function": "get",
			},
			{
				"functionName": "post",
				"function": "post",
			},
			{
				"functionName": "put",
				"function": "put",
			},
			{
				"functionName": "delete",
				"function": "delete",
			},
			{
				"functionName": "patch",
				"function": "patch",
			},
			{
				"functionName": "options",
				"function": "options",
			},
			{
				"functionName": "head",
				"function": "head",
			},
			{
				"functionName": "sameAs",
				"function": "sameAs",
			},
		];
	}
}

module.exports = ApiGatewayProxyRest;


text:
module Fog
  module Compute
    class Brightbox
      class Real
        # Resets the server without disconnecting the console.
        #
        # @param [String] identifier Unique reference to identify the resource
        #
        # @return [Hash] if successful Hash version of JSON object
        #
        # @see https://api.gb1.brightbox.com/1.0/#server_reset_server
        #
        def reset_server(identifier)
          return nil if identifier.nil? || identifier == ""
          wrapped_request("post", "/1.0/servers/#{identifier}/reset", [202])
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
	http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

    <dubbo:application name="demo-provider" owner="shenli" organization="dangdang"/>

    <dubbo:registry address="zookeeper://127.0.0.1:2181"/>

    <!--<dubbo:monitor protocol="registry"/>-->

	<bean id="echoService" class="com.alibaba.dubbo.rpc.benchmark.EchoServiceImpl" />

    <dubbo:protocol name="dubbo" serialization="kryo" optimizer="com.alibaba.dubbo.rpc.benchmark.SerializationOptimizerImpl" threads="20"/>
    <!--<dubbo:protocol name="dubbo" serialization="fst" optimizer="com.alibaba.dubbo.rpc.dubbo.rpc.benchmark.SerializationOptimizerImpl"/>-->

    <!--<dubbo:protocol name="dubbo" serialization="nativejava"/>-->
    <!--<dubbo:protocol name="dubbo" serialization="hessian2"/>-->
    <!--<dubbo:protocol name="dubbo" serialization="fastjson"/>-->
    <!--<dubbo:protocol name="dubbo" serialization="dubbo"/>-->

    <dubbo:protocol name="http" port="8889"  threads="20"/>
    <dubbo:protocol name="hessian" port="8890"  threads="20"/>
    <dubbo:protocol name="webservice" port="8892"  threads="20"/>
    <dubbo:protocol name="rmi" port="8893"  threads="20"/>

    <!--TODO according to the spring convention, we should use something like keep-alive-->
    <!-- use netty server -->
    <!--<dubbo:protocol name="rest" port="8888" keepalive="true" server="netty" threads="20"/>-->

    <!-- use the default jetty server -->
    <dubbo:protocol name="rest" port="8888" threads="20"/>

    <!-- use the external tomcat or other server with the servlet approach; the port and contextpath must be exactly the same as those in external server -->
    <!--<dubbo:protocol name="rest" port="8888" contextpath="services" server="servlet"/>-->

	<dubbo:service interface="com.alibaba.dubbo.rpc.benchmark.EchoService" ref="echoService"  protocol="dubbo, rest, hessian, http, webservice, rmi"/>
</beans>


text:
package edu.stuy.goldfish;

import edu.stuy.goldfish.rules.*;

public class Goldfish {
    private static final String[] RULES = {"Conway", "Conway4", "Life Without Death", "Brian's Brain"};

    private Grid _grid;
    private Render _render;

    public Goldfish() {
        int width = 128;
        int height = 128;
        _grid = new Grid(width, height);
        _render = new Render(width, height, _grid, RULES);
    }

    /* Main method for running the simulator. */
    public void run() {
        setup(_render.rule);
        while (true) {
            if (_render.reset) {
                _render.acquireLock(0);
                setup(_render.rule);
                _render.releaseLock(0);
                _render.reset = false;
            }
            if (!_render.paused) {
                _render.acquireLock(0);
                doLogic(_render.rule);
                _render.releaseLock(0);
            }
            _render.setGrid(_grid);
            _render.run();
            _render.sleep();
        }
    }

    /* Advance the grid one step using the given algorithm. */
    private void doLogic(String rule) {
        if (rule.equals("Conway"))
            _grid = Conway.run(_grid);
        else if (rule.equals("Conway4"))
            _grid = Conway4.run(_grid);
        else if (rule.equals("Life Without Death"))
            _grid = LifeWithoutDeath.run(_grid);
        else if (rule.equals("Brian's Brain"))
            _grid = BriansBrain.run(_grid);
    }

    /* Return the max number of states a patch can be in for the given rule. */
    public static int getMaxStates(String rule) {
        if (rule.equals("Conway"))
            return Conway.states;
        else if (rule.equals("Conway4"))
            return Conway4.states;
        else if (rule.equals("Life Without Death"))
            return LifeWithoutDeath.states;
        else if (rule.equals("Brian's Brain"))
            return BriansBrain.states;
        return 2;
    }

    /* Generate a default shape for the grid based on the given rule. */
    private void setup(String rule) {
        if (rule.equals("Conway"))
            Conway.setup(_grid);
        else if (rule.equals("Conway4"))
            Conway4.setup(_grid);
        else if (rule.equals("Life Without Death"))
            LifeWithoutDeath.setup(_grid);
        else if (rule.equals("Brian's Brain"))
            BriansBrain.setup(_grid);
    }

    public static void main(String[] args) {
        Goldfish g = new Goldfish();
        g.run();
    }
}


text:
`esuf` is a utility for fixing ElasticSearch clusters with lots of UNASSIGNED shards. Its purpose
is to offer a single command to run, which will examine ElasticSearch, and do its best to return
it to a `green` state.

It iterates over all indices, finding any UNASSIGNED shards, and assigns them to an appropriate
data node, based on the assignments of other shards in the index. It will not assign a shard to
a data node that already has a shard. It will not assign replica shards until the corresponding
primary shard is online.

**NOTE:** This takes a heavy-handed approach to bringing things online. If a primary shard is
stuck in an UNASSGINED state, `esuf` will pass the `allow_primary: true` data to ElasticSearch,
telling it to bring the primary online, even if it does not have the data for it. This
may result in data loss to that shard of the index, but will get the cluster into a working
state again.

### Installation

`go get github.com/starkandwayne/esuf`

### Usage

For discovering what's wrong with ElasticSearch:

```
./esuf -H http://ip.of.elasticsearch.box:9200/
```

For fixing ElasticSearch:

```
./esuf -H http://ip.of.elasticsearch.box:9200/ --fix
```


text:
#region Copyright
//  ***********************************************************************
//  Copyright (c) 2016 Jamie Rees
//  File: ThirdPartyService.cs
//  Created By: Jamie Rees
//
//  Permission is hereby granted, free of charge, to any person obtaining
//  a copy of this software and associated documentation files (the
//  "Software"), to deal in the Software without restriction, including
//  without limitation the rights to use, copy, modify, merge, publish,
//  distribute, sublicense, and/or sell copies of the Software, and to
//  permit persons to whom the Software is furnished to do so, subject to
//  the following conditions:
//
//  The above copyright notice and this permission notice shall be
//  included in all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
//  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
//  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
//  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
//  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//  ***********************************************************************
#endregion

using System;
using System.Collections.Generic;
using NZBDash.Common.Interfaces;
using NZBDash.DataAccess.Api.CouchPotato;
using NZBDash.DataAccess.Api.Sonarr;
using NZBDash.ThirdParty.Api.Interfaces;
using NZBDash.ThirdParty.Api.Models.Api;
using NZBDash.ThirdParty.Api.Models.Api.CouchPotato;
using NZBDash.ThirdParty.Api.Models.Api.SabNzbd;
using NZBDash.ThirdParty.Api.Models.Api.Sonarr;

namespace NZBDash.ThirdParty.Api.Service
{
    public class ThirdPartyService : IThirdPartyService
    {
        private ISerializer Serializer { get; set; }

        private const string SabNzbdQueueApiAddress = "api?mode=qstatus&output=json&apikey=";
        private const string SabNzbdHistoryApiAddress = "api?mode=history&start=0&limit=10&output=json&apikey=";
        private const string SonarrApiAddress = "api/system/status?apikey=";
        private const string NzbGetApiAddress = "/jsonrpc/";

        public ThirdPartyService(ISerializer serializer)
        {
            Serializer = serializer;
        }

        public CouchPotatoMediaList GetCouchPotatoMovies(string uri, string api)
        {
            return Serializer.SerializedJsonData<CouchPotatoMediaList>(uri + "api/" + api + "/media.list/");
        }

        public PlexServers GetPlexServers(string uri)
        {
            return Serializer.SerializeXmlData<PlexServers>(uri + "servers");
        }

        public bool SonarrEpisodeSearch(string url, string apiKey, int episodeId)
        {
            var command = Serializer.SerializedJsonData<SonarrCommand,string>(string.Format("{0}api/command?apiKey={1}", url, apiKey), "POST", () => "{ name: 'EpisodeSearch', episodeIds: [" + episodeId + "]}");

            return command != null;
        }

        public SonarrSystemStatus GetSonarrSystemStatus(string uri, string api)
        {
            return Serializer.SerializedJsonData<SonarrSystemStatus>(uri + SonarrApiAddress + api);
        }

        public List<SonarrSeries> GetSonarrSeries(string uri, string api)
        {
            return Serializer.SerializedJsonData<List<SonarrSeries>>(uri + "api/series?apikey=" + api);
        }

        public List<SonarrEpisode> GetSonarrEpisodes(string uri, string api, int seriesId)
        {
            return Serializer.SerializedJsonData<List<SonarrEpisode>>(string.Format("{0}api/episode?seriesId={1}&apikey={2}", uri, seriesId, api));
        }

        public CouchPotatoStatus GetCouchPotatoStatus(string uri, string api)
        {
            return Serializer.SerializedJsonData<CouchPotatoStatus>(uri + "api/" + api + "/app.available/");
        }

        public NzbGetHistory GetNzbGetHistory(string url, string username, string password)
        {
            return Serializer.SerializedJsonData<NzbGetHistory>(string.Format("{0}{1}:{2}{3}history", url, username, password, NzbGetApiAddress));
        }

        public NzbGetList GetNzbGetList(string url, string username, string password)
        {
            return Serializer.SerializedJsonData<NzbGetList>(string.Format("{0}{1}:{2}{3}listgroups", url, username, password, NzbGetApiAddress));
        }

        public NzbGetStatus GetNzbGetStatus(string url, string username, string password)
        {
            return Serializer.SerializedJsonData<NzbGetStatus>(string.Format("{0}{1}:{2}{3}status", url, username, password, NzbGetApiAddress));
        }

        public NzbGetLogs GetNzbGetLogs(string url, string username, string password)
        {
            return Serializer.SerializedJsonData<NzbGetLogs>(string.Format("{0}{1}:{2}{3}/log?IDFrom=0&NumberOfEntries=1000", url, username, password, NzbGetApiAddress));
        }

        public SabNzbdHistory GetSabNzbdHistory(string url, string apiKey)
        {
            return Serializer.SerializedJsonData<SabNzbdHistory>(url + SabNzbdHistoryApiAddress + apiKey);
        }

        public SabNzbdQueue GetSabNzbdQueue(string url, string apiKey)
        {
            return Serializer.SerializedJsonData<SabNzbdQueue>(url + SabNzbdQueueApiAddress + apiKey);
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace PH7\Framework\Analytics;

defined('PH7') or exit('Restricted access');

use PH7\Framework\Mvc\Model\Statistic as StatisticModel;
use PH7\Framework\Pattern\Statik;
use PH7\Framework\Session\Session;

class Statistic
{
    /** pHV = "pH Views" */
    private const SESSION_PREFIX = 'pHV';

    /**
     * Import the trait to set the class static.
     *
     * The trait sets constructor & cloning private to prevent instantiation.
     */
    use Statik;

    /**
     * Set Views (pH Views) Statistics with a verification session to avoid duplication in the number of page views.
     *
     * @param int $iId
     * @param string $sTable
     */
    public static function setView($iId, string $sTable): void
    {
        $oSession = new Session;
        $sSessionName = static::SESSION_PREFIX . $iId . $sTable;

        if (!$oSession->exists($sSessionName)) {
            StatisticModel::setView($iId, $sTable);
            $oSession->set($sSessionName, 1);
        }

        unset($oSession);
    }
}


text:
> Compile ES5 property mutator shorthand syntax to Object.defineProperty

See our website [@babel/plugin-transform-property-mutators](https://babeljs.io/docs/en/next/babel-plugin-transform-property-mutators.html) for more information.

## Install

Using npm:

```sh
npm install --save @babel/plugin-transform-property-mutators
```

or using yarn:

```sh
yarn add --save @babel/plugin-transform-property-mutators
```