text:
package org.assertj.core.internal.objectarrays;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.error.ShouldOnlyHaveElementsOfTypes.shouldOnlyHaveElementsOfTypes;
import static org.assertj.core.test.TestData.someInfo;
import static org.assertj.core.util.Arrays.array;
import static org.assertj.core.util.AssertionsUtil.expectAssertionError;
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.assertj.core.util.Lists.list;

import org.assertj.core.internal.ObjectArraysBaseTest;
import org.junit.jupiter.api.Test;

class ObjectArrays_assertHasOnlyElementsOfTypes_Test extends ObjectArraysBaseTest {

  private static final Object[] ARRAY = { 6, 7.0, 8L };

  @Test
  void should_pass_if_actual_has_only_elements_of_the_expected_types() {
    arrays.assertHasOnlyElementsOfTypes(someInfo(), ARRAY, Number.class);
    arrays.assertHasOnlyElementsOfTypes(someInfo(), ARRAY, Number.class, Long.class, Integer.class);
  }

  @Test
  void should_pass_if_actual_has_only_elements_of_the_expected_types_even_if_some_types_dont_match_any_elements() {
    arrays.assertHasOnlyElementsOfTypes(someInfo(), ARRAY, Number.class, Long.class, Integer.class, String.class);
  }

  @Test
  void should_pass_if_actual_and_given_types_are_empty() {
    Class<?>[] types = new Class<?>[0];
    arrays.assertHasOnlyElementsOfTypes(someInfo(), array(), types);
  }

  @Test
  void should_fail_if_actual_is_null() {
    // GIVEN
    Object[] array = null;
    // GIVEN
    AssertionError error = expectAssertionError(() -> arrays.assertHasOnlyElementsOfTypes(someInfo(), array, String.class));
    // THEN
    assertThat(error).hasMessage(actualIsNull());
  }

  @Test
  void should_fail_if_expected_types_are_empty_but_actual_is_not() {
    // GIVEN
    Class<?>[] types = new Class<?>[0];
    // WHEN
    AssertionError error = expectAssertionError(() -> arrays.assertHasOnlyElementsOfTypes(someInfo(), ARRAY, types));
    // THEN
    assertThat(error).hasMessage(shouldOnlyHaveElementsOfTypes(ARRAY, types, list(ARRAY)).create());
  }

  @Test
  void should_fail_if_one_element_in_actual_does_not_belong_to_the_expected_types() {
    // WHEN
    AssertionError error = expectAssertionError(() -> arrays.assertHasOnlyElementsOfTypes(someInfo(), ARRAY, Long.class,
                                                                                String.class));
    // THEN
    assertThat(error).hasMessage(shouldOnlyHaveElementsOfTypes(ARRAY, array(Long.class, String.class), list(6, 7.0)).create());
  }

  @Test
  void should_throw_assertion_error_and_not_null_pointer_exception_on_null_elements() {
    // GIVEN
    Object[] array = array(null, "notNull");
    // WHEN
    AssertionError error = expectAssertionError(() -> arrays.assertHasOnlyElementsOfTypes(someInfo(), array, Long.class));
    // THEN
    assertThat(error).hasMessage(shouldOnlyHaveElementsOfTypes(array, array(Long.class), list(null, "notNull")).create());
  }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Syll. fung. (Abellini) 5: 1125 (1887)

#### Original name
Agaricus gomphodes Kalchbr.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text: Project at ruby on rails 4.2


text:
package milo.utils.rest.jaxbadapters;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;

public class ZonedDateTimeToLong extends XmlAdapter<Long, ZonedDateTime> {

	@Override
	public Long marshal(ZonedDateTime timestamp) throws Exception {
		return timestamp.toInstant().toEpochMilli();
	}

	@Override
	public ZonedDateTime unmarshal(Long timestamp) throws Exception {
		return ZonedDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault());
	}

}


text:
package vcs.citydb.wfs.config.operation;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

@XmlType(name="OperationsType", propOrder={})
public class Operations {
	private RequestEncoding requestEncoding;
	@XmlElement(name="DescribeFeatureType")
	private DescribeFeatureTypeOperation describeFeatureType;
	@XmlElement(name="GetPropertyValue")
    private GetPropertyValueOperation getPropertyValue;
	@XmlElement(name="GetFeature")
    private GetFeatureOperation getFeature;
	@XmlElement(name="ManageStoredQueries")
	private ManagedStoredQueriesOperation managedStoredQueries;

	public Operations() {
		requestEncoding = new RequestEncoding();
		describeFeatureType = new DescribeFeatureTypeOperation();
		getPropertyValue = new GetPropertyValueOperation();
		getFeature = new GetFeatureOperation();
		managedStoredQueries = new ManagedStoredQueriesOperation();
	}

	public RequestEncoding getRequestEncoding() {
		return requestEncoding;
	}

	public void setRequestEncoding(RequestEncoding requestEncoding) {
		this.requestEncoding = requestEncoding;
	}

	public DescribeFeatureTypeOperation getDescribeFeatureType() {
		return describeFeatureType;
	}

	public void setDescribeFeatureType(DescribeFeatureTypeOperation describeFeatureType) {
		this.describeFeatureType = describeFeatureType;
	}

	public GetPropertyValueOperation getGetPropertyValue() {
		return getPropertyValue;
	}

	public void setGetPropertyValue(GetPropertyValueOperation getPropertyValue) {
		this.getPropertyValue = getPropertyValue;
	}

	public GetFeatureOperation getGetFeature() {
		return getFeature;
	}

	public void setGetFeature(GetFeatureOperation getFeature) {
		this.getFeature = getFeature;
	}

	public ManagedStoredQueriesOperation getManagedStoredQueries() {
		return managedStoredQueries;
	}

	public void setManagedStoredQueries(ManagedStoredQueriesOperation managedStoredQueries) {
		this.managedStoredQueries = managedStoredQueries;
	}

}


text:
begin
  require 'active_support'
rescue LoadError
  activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
  if File.directory?(activesupport_path)
    $:.unshift activesupport_path
    require 'active_support'
  end
end

require 'action_view/template_handlers'
require 'action_view/renderable'
require 'action_view/renderable_partial'

require 'action_view/template'
require 'action_view/inline_template'
require 'action_view/paths'

require 'action_view/base'
require 'action_view/partials'
require 'action_view/template_error'

I18n.load_path << "#{File.dirname(__FILE__)}/action_view/locale/en-US.yml"

require 'action_view/helpers'

ActionView::Base.class_eval do
  include ActionView::Partials
  include ActionView::Helpers
end


text:
#import <Foundation/Foundation.h>
#import "EC2LicenseCapacity.h"
#import "EC2ResponseUnmarshaller.h"
#import "../AmazonValueUnmarshaller.h"
#import "../AmazonBoolValueUnmarshaller.h"
#import "../AmazonSDKUtil.h"

/**
 * License Capacity Unmarshaller
 */
@interface EC2LicenseCapacityUnmarshaller:EC2ResponseUnmarshaller {
    EC2LicenseCapacity *response;
}

@property (nonatomic, readonly) EC2LicenseCapacity *response;

-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict;
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName;

@end


text:
/*
Views allow ConnectorDB to display plots and other visualizations of data. Each view
registers itself using addView from ../datatypes.js

This file is imported at the beginning of the app, and it imports all of the available views
so that they can be registered.
*/

import "./TableView/index";
import "./InfoView";
import "./BoolView";
import "./LineView";
import "./HistogramView";
import "./BarView";
import "./SingleObjectView";
import "./SentimentLineChart";
import "./ScatterView";
import "./Map";
import "./WebHistoryView";
import "./HeatmapView";


text:
local methods = {

  GET = function(self, id, input)

    context.response.status = 204
  end,

  OPTIONS = function(self, id, input)
    context.output = {
      description = "Game API.",
    }
    context.response.status = 200
  end
}

context.response.status = 400
local method = context.request.method
return methods[method] and methods[method](methods, id, context.input)


text:
import time, random
from proton.reactor import Reactor

# Let's try to modify our counter example. In addition to counting to
# 10 in quarter second intervals, let's also print out a random number
# every half second. This is not a super easy thing to express in a
# purely sequential program, but not so difficult using events.

class Counter:

    def __init__(self, limit):
        self.limit = limit
        self.count = 0

    def on_timer_task(self, event):
        self.count += 1
        print self.count
        if not self.done():
            event.reactor.schedule(0.25, self)

    # add a public API to check for doneness
    def done(self):
        return self.count >= self.limit

class Program:

    def on_reactor_init(self, event):
        self.start = time.time()
        print "Hello, World!"

        # Save the counter instance in an attribute so we can refer to
        # it later.
        self.counter = Counter(10)
        event.reactor.schedule(0.25, self.counter)

        # Now schedule another event with a different handler. Note
        # that the timer tasks go to separate handlers, and they don't
        # interfere with each other.
        event.reactor.schedule(0.5, self)

    def on_timer_task(self, event):
        # keep on shouting until we are done counting
        print "Yay, %s!" % random.randint(10, 100)
        if not self.counter.done():
            event.reactor.schedule(0.5, self)

    def on_reactor_final(self, event):
        print "Goodbye, World! (after %s long seconds)" % (time.time() - self.start)

# In hello-world.py we said the reactor exits when there are no more
# events to process. While this is true, it's not actually complete.
# The reactor exits when there are no more events to process and no
# possibility of future events arising. For that reason the reactor
# will keep running until there are no more scheduled events and then
# exit.
r = Reactor(Program())
r.run()


text:
KP Problem Solver using AI

This program is not yet complete. Do not expect it to work, yet.

And if you're wondering, no, I won't upload the completed file until *after* the program is due.


text:
<?php

namespace Petramas\MainBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * LiquidacionMaterialDetalle
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Petramas\MainBundle\Repository\LiquidacionMaterialDetalleRepository")
 */
class LiquidacionMaterialDetalle
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="LiquidacionMaterial", inversedBy="liquidacion_material_detalles")
     * @ORM\JoinColumn(name="liquidacion_material_id", referencedColumnName="id")
     */
    protected $liquidacion_material;

    /**
     * @var float
     *
     * @ORM\Column(name="importe", type="decimal", precision=10, scale=2)
     */
    private $importe;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set importe
     *
     * @param float $importe
     * @return LiquidacionMaterialDetalle
     */
    public function setImporte($importe)
    {
        $this->importe = $importe;

        return $this;
    }

    /**
     * Get importe
     *
     * @return float
     */
    public function getImporte()
    {
        return $this->importe;
    }

    /**
     * Set liquidacion_material
     *
     * @param \Petramas\MainBundle\Entity\LiquidacionMaterial $liquidacionMaterial
     * @return LiquidacionMaterialDetalle
     */
    public function setLiquidacionMaterial(\Petramas\MainBundle\Entity\LiquidacionMaterial $liquidacionMaterial = null)
    {
        $this->liquidacion_material = $liquidacionMaterial;

        return $this;
    }

    /**
     * Get liquidacion_material
     *
     * @return \Petramas\MainBundle\Entity\LiquidacionMaterial
     */
    public function getLiquidacionMaterial()
    {
        return $this->liquidacion_material;
    }
}


text:
<?php

namespace Payward;

/**
 * Reference implementation for Kraken's REST API.
 *
 * See https://www.kraken.com/help/api for more info.
 *
 *
 * The MIT License (MIT)
 *
 * Copyright (c) 2014 Payward, Inc
 *
 * 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.
 */
class KrakenAPIException extends \ErrorException
{
}

class KrakenAPI
{
    protected $key;     // API key
    protected $secret;  // API secret
    protected $url;     // API base URL
    protected $version; // API version
    protected $curl;    // curl handle

    /**
     * Constructor for KrakenAPI.
     *
     * @param string $key       API key
     * @param string $secret    API secret
     * @param string $url       base URL for Kraken API
     * @param string $version   API version
     * @param bool   $sslverify enable/disable SSL peer verification.  disable if using beta.api.kraken.com
     */
    public function __construct($key, $secret, $url = 'https://api.kraken.com', $version = '0', $sslverify = true)
    {

        /* check we have curl */
        if (!function_exists('curl_init')) {
            echo "[ERROR] The Kraken API client requires that PHP is compiled with 'curl' support.\n";
            exit(1);
        }

        $this->key = $key;
        $this->secret = $secret;
        $this->url = $url;
        $this->version = $version;
        $this->curl = curl_init();

        curl_setopt_array(
            $this->curl,
            [
                CURLOPT_SSL_VERIFYPEER => $sslverify,
                CURLOPT_SSL_VERIFYHOST => 2,
                CURLOPT_USERAGENT      => 'Kraken PHP API Agent',
                CURLOPT_POST           => true,
                CURLOPT_RETURNTRANSFER => true, ]
        );
    }

    public function __destruct()
    {
        if (function_exists('curl_close')) {
            curl_close($this->curl);
        }
    }

    /**
     * Query public methods.
     *
     * @param string $method  method name
     * @param array  $request request parameters
     *
     * @throws KrakenAPIException
     *
     * @return array request result on success
     */
    public function QueryPublic($method, array $request = [])
    {
        // build the POST data string
        $postdata = http_build_query($request, '', '&');

        // make request
        curl_setopt($this->curl, CURLOPT_URL, $this->url.'/'.$this->version.'/public/'.$method);
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, []);
        $result = curl_exec($this->curl);
        if ($result === false) {
            throw new KrakenAPIException('CURL error: '.curl_error($this->curl));
        }
        // decode results
        $result = json_decode($result, true);
        if (!is_array($result)) {
            throw new KrakenAPIException('JSON decode error');
        }

        return $result;
    }

    /**
     * Query private methods.
     *
     * @param string $method  method path
     * @param array  $request request parameters
     *
     * @throws KrakenAPIException
     *
     * @return array request result on success
     */
    public function QueryPrivate($method, array $request = [])
    {
        if (!isset($request['nonce'])) {
            // generate a 64 bit nonce using a timestamp at microsecond resolution
            // string functions are used to avoid problems on 32 bit systems
            $nonce = explode(' ', microtime());
            $request['nonce'] = $nonce[1].str_pad(substr($nonce[0], 2, 6), 6, '0');
        }

        // build the POST data string
        $postdata = http_build_query($request, '', '&');

        // set API key and sign the message
        $path = '/'.$this->version.'/private/'.$method;
        $sign = hash_hmac('sha512', $path.hash('sha256', $request['nonce'].$postdata, true), base64_decode($this->secret), true);
        $headers = [
            'API-Key: '.$this->key,
            'API-Sign: '.base64_encode($sign),
        ];

        // make request
        curl_setopt($this->curl, CURLOPT_URL, $this->url.$path);
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $postdata);
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, $headers);
        $result = curl_exec($this->curl);
        if ($result === false) {
            throw new KrakenAPIException('CURL error: '.curl_error($this->curl));
        }
        // decode results
        $result = json_decode($result, true);
        if (!is_array($result)) {
            throw new KrakenAPIException('JSON decode error');
        }

        return $result;
    }
}


text:
layout: post
date:	2011-01-29 23:13:00
title:  In Delhi, briefly....
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
Drove to Delhi from Chambal, and by the time we'd dropped off some of the members of our group and meandered through the BJP Rally, we were dog-tired, and didn't even think of any shopping or visiting. Am at a friend's home, and we're taking the early morning train to Haridwar.

Meanwhile, I've been able to get my hands on KM's laptop and Reliance card, so I've posted some pics to Facebook:

<a href="http://www.facebook.com/profile.php?id=587058877"> click here </a>

to see some of them.

Alas, it is SO much easier to post photos to Facebook than to load them to Photobucket, title them, and then post to LJ.... :(


text:
namespace google {
namespace cloud {
namespace bigquery {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

class DataTransferServiceConnectionIdempotencyPolicy {
 public:
  virtual ~DataTransferServiceConnectionIdempotencyPolicy();

  /// Create a new copy of this object.
  virtual std::unique_ptr<DataTransferServiceConnectionIdempotencyPolicy>
  clone() const;

  virtual google::cloud::Idempotency GetDataSource(
      google::cloud::bigquery::datatransfer::v1::GetDataSourceRequest const&
          request);

  virtual google::cloud::Idempotency ListDataSources(
      google::cloud::bigquery::datatransfer::v1::ListDataSourcesRequest
          request);

  virtual google::cloud::Idempotency CreateTransferConfig(
      google::cloud::bigquery::datatransfer::v1::
          CreateTransferConfigRequest const& request);

  virtual google::cloud::Idempotency UpdateTransferConfig(
      google::cloud::bigquery::datatransfer::v1::
          UpdateTransferConfigRequest const& request);

  virtual google::cloud::Idempotency DeleteTransferConfig(
      google::cloud::bigquery::datatransfer::v1::
          DeleteTransferConfigRequest const& request);

  virtual google::cloud::Idempotency GetTransferConfig(
      google::cloud::bigquery::datatransfer::v1::GetTransferConfigRequest const&
          request);

  virtual google::cloud::Idempotency ListTransferConfigs(
      google::cloud::bigquery::datatransfer::v1::ListTransferConfigsRequest
          request);

  virtual google::cloud::Idempotency ScheduleTransferRuns(
      google::cloud::bigquery::datatransfer::v1::
          ScheduleTransferRunsRequest const& request);

  virtual google::cloud::Idempotency StartManualTransferRuns(
      google::cloud::bigquery::datatransfer::v1::
          StartManualTransferRunsRequest const& request);

  virtual google::cloud::Idempotency GetTransferRun(
      google::cloud::bigquery::datatransfer::v1::GetTransferRunRequest const&
          request);

  virtual google::cloud::Idempotency DeleteTransferRun(
      google::cloud::bigquery::datatransfer::v1::DeleteTransferRunRequest const&
          request);

  virtual google::cloud::Idempotency ListTransferRuns(
      google::cloud::bigquery::datatransfer::v1::ListTransferRunsRequest
          request);

  virtual google::cloud::Idempotency ListTransferLogs(
      google::cloud::bigquery::datatransfer::v1::ListTransferLogsRequest
          request);

  virtual google::cloud::Idempotency CheckValidCreds(
      google::cloud::bigquery::datatransfer::v1::CheckValidCredsRequest const&
          request);

  virtual google::cloud::Idempotency EnrollDataSources(
      google::cloud::bigquery::datatransfer::v1::EnrollDataSourcesRequest const&
          request);
};

std::unique_ptr<DataTransferServiceConnectionIdempotencyPolicy>
MakeDefaultDataTransferServiceConnectionIdempotencyPolicy();

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace bigquery
}  // namespace cloud
}  // namespace google

#endif  // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_DATA_TRANSFER_CONNECTION_IDEMPOTENCY_POLICY_H


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>

  <title>Primeiro Ano</title>
  <meta name="author" content="" />
  <meta name="description"
        content="Um filme sobre o tema vestibular teria tudo para se tornar monótono, mas aqui não é o caso. Montado de maneira dinâmica e oscilando momentos viscerais, de lutas por espaço na biblioteca e nas..."/>

  <meta name="yandex-verification" content="48a8210fc043c5e8" />

  <meta name="generator" content="Hugo 0.54.0" />

  <meta itemprop="name" content="Primeiro Ano"/>
  <meta itemprop="description"
        content="Um filme sobre o tema vestibular teria tudo para se tornar monótono, mas aqui não é o caso. Montado de maneira dinâmica e oscilando momentos viscerais, de lutas por espaço na biblioteca e nas..."/>
  <meta itemprop="image"
        content="/img/logo.svg"/>

  <meta property="og:title" content="Primeiro Ano"/>
  <meta property="og:type"
        content="article"/>
  <meta property="og:url" content="http://www.cinetenisverde.com.br/primeiro-ano/"/>
  <meta property="og:image"
        content="/img/logo.svg"/>
  <meta property="og:description"
        content="Um filme sobre o tema vestibular teria tudo para se tornar monótono, mas aqui não é o caso. Montado de maneira dinâmica e oscilando momentos viscerais, de lutas por espaço na biblioteca e nas..."/>
  <meta property="og:site_name" content="Cine Tênis Verde"/>
  <meta property="article:published_time"
        content="2019-02-15T16:02:23-02:00"/>
  <meta property="article:section" content="post"/>

  <meta name="twitter:card" content="summary"/>
  <meta name="twitter:site"
        content=""/>
  <meta name="twitter:title" content="Primeiro Ano"/>
  <meta name="twitter:description"
        content="Um filme sobre o tema vestibular teria tudo para se tornar monótono, mas aqui não é o caso. Montado de maneira dinâmica e oscilando momentos viscerais, de lutas por espaço na biblioteca e nas..."/>
  <meta name="twitter:creator"
        content=""/>
  <meta name="twitter:image:src"
        content="/img/logo.svg"/>

  <link rel="stylesheet" type="text/css" href="/css/capsule.min.css"/>
  <link rel="stylesheet" type="text/css" href="/css/custom.css"/>

  <link rel="apple-touch-icon" href="/img/apple-touch-icon.png"/>
  <link rel="icon" href="/img/favicon.ico"/>

 Cine Tênis Verde

    <input type="checkbox" id="navbar-burger-state"/>

      search

      twitter

      rss

Primeiro Ano

    ★★★★☆

 Wanderley Caloni, February 15, 2019

Um filme sobre o tema vestibular teria tudo para se tornar monótono, mas aqui não é o caso. Montado de maneira dinâmica e oscilando momentos viscerais, de lutas por espaço na biblioteca e nas carteiras das salas, com pausas necessárias, como a troca de comida entre Benjamin e sua vizinha estrangeira, Primeiro Ano consegue colocar o espectador no lugar daquelas pessoas e os fazer quase que relembrar os esforços passados para tentar passar no vestibular. Parte disso está em uma edição fuida, que harmoniza um filme contemplativo ao mesmo tempo que intenso. Ele fará o espectador se segurar na poltrona em alguns momentos, e em outros até torcer. E tudo isso com uma importante reflexão sobre o valor da amizade, que mais do que o próprio sacrifício feito, é o pilar que segura esse filme sobre competitidade extrema, por mais paradoxal que seja. É quando um amigo massageia a carótida do outro, esperando por um dia melhor.

           Imagens e créditos no IMDB. O texto de estreia será publicado no CinemAqui.

    ★★★★☆

 Primeiro Ano ● Première année (aka The Freshman) (França, 2018), escrito e dirigido por Thomas Lilti, com Vincent Lacoste e William Lebghil. ● Nota: 4/5. Categoria: movies.  Visto em cabine de imprensa pelo cinemaqui. Publicado em 2019-02-15.  Texto escrito por Wanderley Caloni.

Quer comentar?

      Share


text:
package formatters_test

import (
	. "github.com/cloudfoundry/cli/cf/formatters"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("memoryLimit formatting", func() {
	It("returns 'Unlimited' when limit is -1", func() {
		Expect(InstanceMemoryLimit(-1)).To(Equal("Unlimited"))
	})

	It("formats original value to <val>M when limit is not -1", func() {
		Expect(InstanceMemoryLimit(100)).To(Equal("100M"))
	})
})


text:
import m from 'mithril';
import tippy from "tippy.js";
import $ from 'jquery';

function Button() {

    let enabled = false;
    let iconOnTheLeft = true;
    let tooltip;
    let dataTippyContent;

    return {
        oncreate: function(vnode) {
            let button = $('#' + vnode.attrs.id + '[data-tippy-content]');
            if (button.length > 0) {
                tooltip = tippy(button[0]);
            }
        },
        onremove: function(vnode) {
            if (tooltip !== undefined && tooltip !== null) {
                tooltip.destroy();
            }
        },
        view: function (vnode) {
            enabled = vnode.attrs.enabled === undefined || vnode.attrs.enabled;
            if (vnode.attrs.iconOnTheLeft === false) {
                iconOnTheLeft = false;
            }
            let attrs = {
                ...vnode.attrs.attrs,
                id: vnode.attrs.id,
                type: vnode.attrs.type !== undefined ? vnode.attrs.type : "button",
                class: `${enabled ? 'enabled' : 'disabled'} btn ${vnode.attrs.class ? vnode.attrs.class : ''}`,
                onclick: enabled ? vnode.attrs.onclick : function () {
                    /*noop*/
                }
            };
            if (vnode.attrs["data-tippy-content"]) {
                let previousTippyContent = dataTippyContent;
                dataTippyContent = vnode.attrs["data-tippy-content"];
                attrs["data-tippy-content"] = dataTippyContent;
                if (tooltip !== undefined && previousTippyContent !== dataTippyContent) {
                    tooltip.setContent(dataTippyContent);
                }
            }
            if (vnode.attrs["data-tippy-placement"]) {
                attrs["data-tippy-placement"] = vnode.attrs["data-tippy-placement"];
            }
            if (iconOnTheLeft) {
                return m("button",
                    attrs, vnode.attrs.text ? [
                            m('i', {
                                class: (vnode.attrs.icon ?
                                    (['fas ', 'far ', 'fad ', 'fal '].some(e => vnode.attrs.icon.includes(e)) ? vnode.attrs.icon : "fas " + vnode.attrs.icon) : '')
                            },
                            ), " " + vnode.attrs.text
                        ] :
                        m('i', {
                            class: (vnode.attrs.icon ? (['fas ', 'far ', 'fad ', 'fal '].some(e => vnode.attrs.icon.includes(e)) ? vnode.attrs.icon : "fas " + vnode.attrs.icon) : '')
                        })
                );
            } else {
                return m("button", attrs, [
                    m("span", vnode.attrs.text + " "),
                    m('i', {
                        class: (vnode.attrs.icon ? (['fas ', 'far ', 'fad ', 'fal '].some(e => vnode.attrs.icon.includes(e)) ? vnode.attrs.icon : "fas " + vnode.attrs.icon) : '')
                    })
                ]);
            }
        }
    }
}

export default Button;


text:
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { E2EImportsModule } from 'e2e-imports.module';

import { UserStatisticsComponent } from './user-statistics.component';

describe('UserStatisticsComponent', () => {
    let component: UserStatisticsComponent;
    let fixture: ComponentFixture<UserStatisticsComponent>;

    beforeEach(
        waitForAsync(() => {
            TestBed.configureTestingModule({
                imports: [E2EImportsModule]
            }).compileComponents();
        })
    );

    beforeEach(() => {
        fixture = TestBed.createComponent(UserStatisticsComponent);
        component = fixture.componentInstance;
        fixture.detectChanges();
    });

    it('should create', () => {
        expect(component).toBeTruthy();
    });
});


text:
/*
 * $Id$
 */

/*

 Copyright (c) 2014 Board of Trustees of Leland Stanford Jr. University,
 all rights reserved.

 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
 STANFORD UNIVERSITY 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.

 Except as contained in this notice, the name of Stanford University shall not
 be used in advertising or otherwise to promote the sale, use or other dealings
 in this Software without prior written authorization from Stanford University.

 */
package org.lockss.ws.entities;

import java.util.Map;

/**
 * Container for the information related to a plugin that is the result of a
 * query.
 */
public class PluginWsResult {
  private String pluginId;
  private String name;
  private String version;
  private String type;
  private Map<String, String> definition;
  private String registry;
  private String url;
  private Integer auCount;
  private String publishingPlatform;

  /**
   * Provides the plugin identifier.
   *
   * @return A String with the identifier.
   */
  public String getPluginId() {
    return pluginId;
  }
  public void setPluginId(String pluginId) {
    this.pluginId = pluginId;
  }

  /**
   * Provides the plugin name.
   *
   * @return A String with the name.
   */
  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }

  /**
   * Provides the plugin version.
   *
   * @return A String with the version.
   */
  public String getVersion() {
    return version;
  }
  public void setVersion(String version) {
    this.version = version;
  }

  /**
   * Provides the plugin type.
   *
   * @return A String with the type.
   */
  public String getType() {
    return type;
  }
  public void setType(String type) {
    this.type = type;
  }

  /**
   * Provides the plugin definition properties.
   *
   * @return A Map<String, String> with the properties.
   */
  public Map<String, String> getDefinition() {
    return definition;
  }
  public void setDefinition(Map<String, String> definition) {
    this.definition = definition;
  }

  /**
   * Provides the plugin registry name.
   *
   * @return A String with the registry name.
   */
  public String getRegistry() {
    return registry;
  }
  public void setRegistry(String registry) {
    this.registry = registry;
  }

  /**
   * Provides the plugin URL.
   *
   * @return A String with the URL.
   */
  public String getUrl() {
    return url;
  }
  public void setUrl(String url) {
    this.url = url;
  }

  /**
   * Provides the count of Archival Units configured with this plugin.
   *
   * @return An Integer with the count.
   */
  public Integer getAuCount() {
    return auCount;
  }
  public void setAuCount(Integer auCount) {
    this.auCount = auCount;
  }

  /**
   * Provides the plugin publishing platform name.
   *
   * @return a String with the publishing platform name.
   */
  public String getPublishingPlatform() {
    return publishingPlatform;
  }
  public void setPublishingPlatform(String publishingPlatform) {
    this.publishingPlatform = publishingPlatform;
  }

  @Override
  public String toString() {
    return "PluginWsResult [pluginId=" + pluginId + ", name=" + name
	+ ", version=" + version + ", type=" + type + ", definition="
	+ definition + ", registry=" + registry + ", url=" + url + ", auCount="
	+ auCount + ", publishingPlatform=" + publishingPlatform + "]";
  }
}


text:
'use strict';

var os = require('os');
var nodeStatic = require('node-static');
var https = require('https');
var socketIO = require('socket.io');
var fs = require('fs');

var options = {
  key: fs.readFileSync('./ssl/file.pem'),
  cert: fs.readFileSync('./ssl/file.crt')
};

/*const pkey = fs.readFileSync('./ssl/key.pem'),
  pcert = fs.readFileSync('./ssl/cert.pem'),
  options = {key: pkey, cert: pcert, passphrase: '123456789'};
*/
var fileServer = new(nodeStatic.Server)();

var app = https.createServer(options, function(req, res) {
  fileServer.serve(req, res);
}).listen(443);

var io = socketIO.listen(app);
io.sockets.on('connection', function(socket) {

  // convenience function to log server messages on the client
  function log() {
    var array = ['Message from server:'];
    array.push.apply(array, arguments);
    socket.emit('log', array);
  }

  socket.on('message', function(message) {
    log('Client said: ', message);
    // for a real app, would be room-only (not broadcast)
    socket.broadcast.emit('message', message);
  });

  socket.on('create or join', function(room) {
    log('Received request to create or join room ' + room);

    var numClients = io.sockets.sockets.length;
    log('Room ' + room + ' now has ' + numClients + ' client(s)');

    if (numClients === 1) {
      socket.join(room);
      log('Client ID ' + socket.id + ' created room ' + room);
      socket.emit('created', room, socket.id);
    } else if (numClients === 2) {
      log('Client ID ' + socket.id + ' joined room ' + room);
      // io.sockets.in(room).emit('join', room);
      socket.join(room);
      socket.emit('joined', room, socket.id);
      io.sockets.in(room).emit('ready', room);
      socket.broadcast.emit('ready', room);
    } else { // max two clients
      socket.emit('full', room);
    }
  });

  socket.on('ipaddr', function() {
    var ifaces = os.networkInterfaces();
    for (var dev in ifaces) {
      ifaces[dev].forEach(function(details) {
        if (details.family === 'IPv4' && details.address !== '127.0.0.1') {
          socket.emit('ipaddr', details.address);
        }
      });
    }
  });

  socket.on('bye', function(){
    console.log('received bye');
  });

});


text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.

#pragma once

#include <limits>
#include <memory>
#include <random>
#include <string>
#include <utility>
#include <vector>

#include "arrow/array.h"
#include "arrow/array/builder_binary.h"
#include "arrow/array/builder_decimal.h"
#include "arrow/array/builder_primitive.h"
#include "arrow/testing/gtest_util.h"
#include "arrow/testing/random.h"
#include "arrow/type_fwd.h"
#include "arrow/type_traits.h"
#include "arrow/util/decimal.h"
#include "parquet/column_reader.h"

namespace parquet {

using internal::RecordReader;

namespace arrow {

using ::arrow::Array;
using ::arrow::ChunkedArray;
using ::arrow::Status;

template <int32_t PRECISION>
struct DecimalWithPrecisionAndScale {
  static_assert(PRECISION >= 1 && PRECISION <= 38, "Invalid precision value");

  using type = ::arrow::Decimal128Type;
  static constexpr ::arrow::Type::type type_id = ::arrow::Decimal128Type::type_id;
  static constexpr int32_t precision = PRECISION;
  static constexpr int32_t scale = PRECISION - 1;
};

template <int32_t PRECISION>
struct Decimal256WithPrecisionAndScale {
  static_assert(PRECISION >= 1 && PRECISION <= 76, "Invalid precision value");

  using type = ::arrow::Decimal256Type;
  static constexpr ::arrow::Type::type type_id = ::arrow::Decimal256Type::type_id;
  static constexpr int32_t precision = PRECISION;
  static constexpr int32_t scale = PRECISION - 1;
};

template <class ArrowType>
::arrow::enable_if_floating_point<ArrowType, Status> NonNullArray(
    size_t size, std::shared_ptr<Array>* out) {
  using c_type = typename ArrowType::c_type;
  std::vector<c_type> values;
  ::arrow::random_real(size, 0, static_cast<c_type>(0), static_cast<c_type>(1), &values);
  ::arrow::NumericBuilder<ArrowType> builder;
  RETURN_NOT_OK(builder.AppendValues(values.data(), values.size()));
  return builder.Finish(out);
}

template <class ArrowType>
::arrow::enable_if_integer<ArrowType, Status> NonNullArray(size_t size,
                                                           std::shared_ptr<Array>* out) {
  std::vector<typename ArrowType::c_type> values;
  ::arrow::randint(size, 0, 64, &values);

  // Passing data type so this will work with TimestampType too
  ::arrow::NumericBuilder<ArrowType> builder(std::make_shared<ArrowType>(),
                                             ::arrow::default_memory_pool());
  RETURN_NOT_OK(builder.AppendValues(values.data(), values.size()));
  return builder.Finish(out);
}

template <class ArrowType>
::arrow::enable_if_date<ArrowType, Status> NonNullArray(size_t size,
                                                        std::shared_ptr<Array>* out) {
  std::vector<typename ArrowType::c_type> values;
  ::arrow::randint(size, 0, 24, &values);
  for (size_t i = 0; i < size; i++) {
    values[i] *= 86400000;
  }

  // Passing data type so this will work with TimestampType too
  ::arrow::NumericBuilder<ArrowType> builder(std::make_shared<ArrowType>(),
                                             ::arrow::default_memory_pool());
  RETURN_NOT_OK(builder.AppendValues(values.data(), values.size()));
  return builder.Finish(out);
}

template <class ArrowType>
::arrow::enable_if_base_binary<ArrowType, Status> NonNullArray(
    size_t size, std::shared_ptr<Array>* out) {
  using BuilderType = typename ::arrow::TypeTraits<ArrowType>::BuilderType;
  BuilderType builder;
  for (size_t i = 0; i < size; i++) {
    RETURN_NOT_OK(builder.Append("test-string"));
  }
  return builder.Finish(out);
}

template <typename ArrowType>
::arrow::enable_if_fixed_size_binary<ArrowType, Status> NonNullArray(
    size_t size, std::shared_ptr<Array>* out) {
  using BuilderType = typename ::arrow::TypeTraits<ArrowType>::BuilderType;
  // set byte_width to the length of "fixed": 5
  // todo: find a way to generate test data with more diversity.
  BuilderType builder(::arrow::fixed_size_binary(5));
  for (size_t i = 0; i < size; i++) {
    RETURN_NOT_OK(builder.Append("fixed"));
  }
  return builder.Finish(out);
}

static void random_decimals(int64_t n, uint32_t seed, int32_t precision, uint8_t* out) {
  std::default_random_engine gen(seed);
  std::uniform_int_distribution<uint32_t> d(0, std::numeric_limits<uint8_t>::max());
  const int32_t required_bytes = ::arrow::DecimalType::DecimalSize(precision);
  int32_t byte_width = precision <= 38 ? 16 : 32;
  std::fill(out, out + byte_width * n, '\0');

  for (int64_t i = 0; i < n; ++i, out += byte_width) {
    std::generate(out, out + required_bytes,
                  [&d, &gen] { return static_cast<uint8_t>(d(gen)); });

    // sign extend if the sign bit is set for the last byte generated
    // 0b10000000 == 0x80 == 128
    if ((out[required_bytes - 1] & '\x80') != 0) {
      std::fill(out + required_bytes, out + byte_width, '\xFF');
    }
  }
}

template <typename ArrowType, int32_t precision = ArrowType::precision>
::arrow::enable_if_t<
    std::is_same<ArrowType, DecimalWithPrecisionAndScale<precision>>::value, Status>
NonNullArray(size_t size, std::shared_ptr<Array>* out) {
  constexpr int32_t kDecimalPrecision = precision;
  constexpr int32_t kDecimalScale = DecimalWithPrecisionAndScale<precision>::scale;

  const auto type = ::arrow::decimal(kDecimalPrecision, kDecimalScale);
  ::arrow::Decimal128Builder builder(type);
  const int32_t byte_width =
      static_cast<const ::arrow::Decimal128Type&>(*type).byte_width();

  constexpr int32_t seed = 0;

  ARROW_ASSIGN_OR_RAISE(auto out_buf, ::arrow::AllocateBuffer(size * byte_width));
  random_decimals(size, seed, kDecimalPrecision, out_buf->mutable_data());

  RETURN_NOT_OK(builder.AppendValues(out_buf->data(), size));
  return builder.Finish(out);
}

template <typename ArrowType, int32_t precision = ArrowType::precision>
::arrow::enable_if_t<
    std::is_same<ArrowType, Decimal256WithPrecisionAndScale<precision>>::value, Status>
NonNullArray(size_t size, std::shared_ptr<Array>* out) {
  constexpr int32_t kDecimalPrecision = precision;
  constexpr int32_t kDecimalScale = Decimal256WithPrecisionAndScale<precision>::scale;

  const auto type = ::arrow::decimal256(kDecimalPrecision, kDecimalScale);
  ::arrow::Decimal256Builder builder(type);
  const int32_t byte_width =
      static_cast<const ::arrow::Decimal256Type&>(*type).byte_width();

  constexpr int32_t seed = 0;

  ARROW_ASSIGN_OR_RAISE(auto out_buf, ::arrow::AllocateBuffer(size * byte_width));
  random_decimals(size, seed, kDecimalPrecision, out_buf->mutable_data());

  RETURN_NOT_OK(builder.AppendValues(out_buf->data(), size));
  return builder.Finish(out);
}

template <class ArrowType>
::arrow::enable_if_boolean<ArrowType, Status> NonNullArray(size_t size,
                                                           std::shared_ptr<Array>* out) {
  std::vector<uint8_t> values;
  ::arrow::randint(size, 0, 1, &values);
  ::arrow::BooleanBuilder builder;
  RETURN_NOT_OK(builder.AppendValues(values.data(), values.size()));
  return builder.Finish(out);
}

// This helper function only supports (size/2) nulls.
template <typename ArrowType>
::arrow::enable_if_floating_point<ArrowType, Status> NullableArray(
    size_t size, size_t num_nulls, uint32_t seed, std::shared_ptr<Array>* out) {
  using c_type = typename ArrowType::c_type;
  std::vector<c_type> values;
  ::arrow::random_real(size, seed, static_cast<c_type>(-1e10), static_cast<c_type>(1e10),
                       &values);
  std::vector<uint8_t> valid_bytes(size, 1);

  for (size_t i = 0; i < num_nulls; i++) {
    valid_bytes[i * 2] = 0;
  }

  ::arrow::NumericBuilder<ArrowType> builder;
  RETURN_NOT_OK(builder.AppendValues(values.data(), values.size(), valid_bytes.data()));
  return builder.Finish(out);
}

// This helper function only supports (size/2) nulls.
template <typename ArrowType>
::arrow::enable_if_integer<ArrowType, Status> NullableArray(size_t size, size_t num_nulls,
                                                            uint32_t seed,
                                                            std::shared_ptr<Array>* out) {
  std::vector<typename ArrowType::c_type> values;

  // Seed is random in Arrow right now
  (void)seed;
  ::arrow::randint(size, 0, 64, &values);
  std::vector<uint8_t> valid_bytes(size, 1);

  for (size_t i = 0; i < num_nulls; i++) {
    valid_bytes[i * 2] = 0;
  }

  // Passing data type so this will work with TimestampType too
  ::arrow::NumericBuilder<ArrowType> builder(std::make_shared<ArrowType>(),
                                             ::arrow::default_memory_pool());
  RETURN_NOT_OK(builder.AppendValues(values.data(), values.size(), valid_bytes.data()));
  return builder.Finish(out);
}

template <typename ArrowType>
::arrow::enable_if_date<ArrowType, Status> NullableArray(size_t size, size_t num_nulls,
                                                         uint32_t seed,
                                                         std::shared_ptr<Array>* out) {
  std::vector<typename ArrowType::c_type> values;

  // Seed is random in Arrow right now
  (void)seed;
  ::arrow::randint(size, 0, 24, &values);
  for (size_t i = 0; i < size; i++) {
    values[i] *= 86400000;
  }
  std::vector<uint8_t> valid_bytes(size, 1);

  for (size_t i = 0; i < num_nulls; i++) {
    valid_bytes[i * 2] = 0;
  }

  // Passing data type so this will work with TimestampType too
  ::arrow::NumericBuilder<ArrowType> builder(std::make_shared<ArrowType>(),
                                             ::arrow::default_memory_pool());
  RETURN_NOT_OK(builder.AppendValues(values.data(), values.size(), valid_bytes.data()));
  return builder.Finish(out);
}

// This helper function only supports (size/2) nulls yet.
template <typename ArrowType>
::arrow::enable_if_base_binary<ArrowType, Status> NullableArray(
    size_t size, size_t num_nulls, uint32_t seed, std::shared_ptr<::arrow::Array>* out) {
  std::vector<uint8_t> valid_bytes(size, 1);

  for (size_t i = 0; i < num_nulls; i++) {
    valid_bytes[i * 2] = 0;
  }

  using BuilderType = typename ::arrow::TypeTraits<ArrowType>::BuilderType;
  BuilderType builder;

  const int kBufferSize = 10;
  uint8_t buffer[kBufferSize];
  for (size_t i = 0; i < size; i++) {
    if (!valid_bytes[i]) {
      RETURN_NOT_OK(builder.AppendNull());
    } else {
      ::arrow::random_bytes(kBufferSize, seed + static_cast<uint32_t>(i), buffer);
      if (ArrowType::is_utf8) {
        // Trivially force data to be valid UTF8 by making it all ASCII
        for (auto& byte : buffer) {
          byte &= 0x7f;
        }
      }
      RETURN_NOT_OK(builder.Append(buffer, kBufferSize));
    }
  }
  return builder.Finish(out);
}

// This helper function only supports (size/2) nulls yet,
// same as NullableArray<String|Binary>(..)
template <typename ArrowType>
::arrow::enable_if_fixed_size_binary<ArrowType, Status> NullableArray(
    size_t size, size_t num_nulls, uint32_t seed, std::shared_ptr<::arrow::Array>* out) {
  std::vector<uint8_t> valid_bytes(size, 1);

  for (size_t i = 0; i < num_nulls; i++) {
    valid_bytes[i * 2] = 0;
  }

  using BuilderType = typename ::arrow::TypeTraits<ArrowType>::BuilderType;
  const int byte_width = 10;
  BuilderType builder(::arrow::fixed_size_binary(byte_width));

  const int kBufferSize = byte_width;
  uint8_t buffer[kBufferSize];
  for (size_t i = 0; i < size; i++) {
    if (!valid_bytes[i]) {
      RETURN_NOT_OK(builder.AppendNull());
    } else {
      ::arrow::random_bytes(kBufferSize, seed + static_cast<uint32_t>(i), buffer);
      RETURN_NOT_OK(builder.Append(buffer));
    }
  }
  return builder.Finish(out);
}

template <typename ArrowType, int32_t precision = ArrowType::precision>
::arrow::enable_if_t<
    std::is_same<ArrowType, DecimalWithPrecisionAndScale<precision>>::value, Status>
NullableArray(size_t size, size_t num_nulls, uint32_t seed,
              std::shared_ptr<::arrow::Array>* out) {
  std::vector<uint8_t> valid_bytes(size, '\1');

  for (size_t i = 0; i < num_nulls; ++i) {
    valid_bytes[i * 2] = '\0';
  }

  constexpr int32_t kDecimalPrecision = precision;
  constexpr int32_t kDecimalScale = DecimalWithPrecisionAndScale<precision>::scale;
  const auto type = ::arrow::decimal(kDecimalPrecision, kDecimalScale);
  const int32_t byte_width =
      static_cast<const ::arrow::Decimal128Type&>(*type).byte_width();

  ARROW_ASSIGN_OR_RAISE(auto out_buf, ::arrow::AllocateBuffer(size * byte_width));

  random_decimals(size, seed, precision, out_buf->mutable_data());

  ::arrow::Decimal128Builder builder(type);
  RETURN_NOT_OK(builder.AppendValues(out_buf->data(), size, valid_bytes.data()));
  return builder.Finish(out);
}

template <typename ArrowType, int32_t precision = ArrowType::precision>
::arrow::enable_if_t<
    std::is_same<ArrowType, Decimal256WithPrecisionAndScale<precision>>::value, Status>
NullableArray(size_t size, size_t num_nulls, uint32_t seed,
              std::shared_ptr<::arrow::Array>* out) {
  std::vector<uint8_t> valid_bytes(size, '\1');

  for (size_t i = 0; i < num_nulls; ++i) {
    valid_bytes[i * 2] = '\0';
  }

  constexpr int32_t kDecimalPrecision = precision;
  constexpr int32_t kDecimalScale = Decimal256WithPrecisionAndScale<precision>::scale;
  const auto type = ::arrow::decimal256(kDecimalPrecision, kDecimalScale);
  const int32_t byte_width =
      static_cast<const ::arrow::Decimal256Type&>(*type).byte_width();

  ARROW_ASSIGN_OR_RAISE(auto out_buf, ::arrow::AllocateBuffer(size * byte_width));

  random_decimals(size, seed, precision, out_buf->mutable_data());

  ::arrow::Decimal256Builder builder(type);
  RETURN_NOT_OK(builder.AppendValues(out_buf->data(), size, valid_bytes.data()));
  return builder.Finish(out);
}

// This helper function only supports (size/2) nulls yet.
template <class ArrowType>
::arrow::enable_if_boolean<ArrowType, Status> NullableArray(size_t size, size_t num_nulls,
                                                            uint32_t seed,
                                                            std::shared_ptr<Array>* out) {
  std::vector<uint8_t> values;

  // Seed is random in Arrow right now
  (void)seed;

  ::arrow::randint(size, 0, 1, &values);
  std::vector<uint8_t> valid_bytes(size, 1);

  for (size_t i = 0; i < num_nulls; i++) {
    valid_bytes[i * 2] = 0;
  }

  ::arrow::BooleanBuilder builder;
  RETURN_NOT_OK(builder.AppendValues(values.data(), values.size(), valid_bytes.data()));
  return builder.Finish(out);
}

/// Wrap an Array into a ListArray by splitting it up into size lists.
///
/// This helper function only supports (size/2) nulls.
Status MakeListArray(const std::shared_ptr<Array>& values, int64_t size,
                     int64_t null_count, const std::string& item_name,
                     bool nullable_values, std::shared_ptr<::arrow::ListArray>* out) {
  // We always include an empty list
  int64_t non_null_entries = size - null_count - 1;
  int64_t length_per_entry = values->length() / non_null_entries;

  auto offsets = AllocateBuffer();
  RETURN_NOT_OK(offsets->Resize((size + 1) * sizeof(int32_t)));
  int32_t* offsets_ptr = reinterpret_cast<int32_t*>(offsets->mutable_data());

  auto null_bitmap = AllocateBuffer();
  int64_t bitmap_size = ::arrow::BitUtil::BytesForBits(size);
  RETURN_NOT_OK(null_bitmap->Resize(bitmap_size));
  uint8_t* null_bitmap_ptr = null_bitmap->mutable_data();
  memset(null_bitmap_ptr, 0, bitmap_size);

  int32_t current_offset = 0;
  for (int64_t i = 0; i < size; i++) {
    offsets_ptr[i] = current_offset;
    if (!(((i % 2) == 0) && ((i / 2) < null_count))) {
      // Non-null list (list with index 1 is always empty).
      ::arrow::BitUtil::SetBit(null_bitmap_ptr, i);
      if (i != 1) {
        current_offset += static_cast<int32_t>(length_per_entry);
      }
    }
  }
  offsets_ptr[size] = static_cast<int32_t>(values->length());

  auto value_field = ::arrow::field(item_name, values->type(), nullable_values);
  *out = std::make_shared<::arrow::ListArray>(::arrow::list(value_field), size, offsets,
                                              values, null_bitmap, null_count);

  return Status::OK();
}

// Make an array containing only empty lists, with a null values array
Status MakeEmptyListsArray(int64_t size, std::shared_ptr<Array>* out_array) {
  // Allocate an offsets buffer containing only zeroes
  const int64_t offsets_nbytes = (size + 1) * sizeof(int32_t);
  ARROW_ASSIGN_OR_RAISE(auto offsets_buffer, ::arrow::AllocateBuffer(offsets_nbytes));
  memset(offsets_buffer->mutable_data(), 0, offsets_nbytes);

  auto value_field =
      ::arrow::field("item", ::arrow::float64(), false /* nullable_values */);
  auto list_type = ::arrow::list(value_field);

  std::vector<std::shared_ptr<Buffer>> child_buffers = {nullptr /* null bitmap */,
                                                        nullptr /* values */};
  auto child_data =
      ::arrow::ArrayData::Make(value_field->type(), 0, std::move(child_buffers));

  std::vector<std::shared_ptr<Buffer>> buffers = {nullptr /* bitmap */,
                                                  std::move(offsets_buffer)};
  auto array_data = ::arrow::ArrayData::Make(list_type, size, std::move(buffers));
  array_data->child_data.push_back(child_data);

  *out_array = ::arrow::MakeArray(array_data);
  return Status::OK();
}

std::shared_ptr<::arrow::Table> MakeSimpleTable(
    const std::shared_ptr<ChunkedArray>& values, bool nullable) {
  auto schema = ::arrow::schema({::arrow::field("col", values->type(), nullable)});
  return ::arrow::Table::Make(schema, {values});
}

std::shared_ptr<::arrow::Table> MakeSimpleTable(const std::shared_ptr<Array>& values,
                                                bool nullable) {
  auto carr = std::make_shared<::arrow::ChunkedArray>(values);
  return MakeSimpleTable(carr, nullable);
}

template <typename T>
void ExpectArray(T* expected, Array* result) {
  auto p_array = static_cast<::arrow::PrimitiveArray*>(result);
  for (int i = 0; i < result->length(); i++) {
    EXPECT_EQ(expected[i], reinterpret_cast<const T*>(p_array->values()->data())[i]);
  }
}

template <typename ArrowType>
void ExpectArrayT(void* expected, Array* result) {
  ::arrow::PrimitiveArray* p_array = static_cast<::arrow::PrimitiveArray*>(result);
  for (int64_t i = 0; i < result->length(); i++) {
    EXPECT_EQ(reinterpret_cast<typename ArrowType::c_type*>(expected)[i],
              reinterpret_cast<const typename ArrowType::c_type*>(
                  p_array->values()->data())[i]);
  }
}

template <>
void ExpectArrayT<::arrow::BooleanType>(void* expected, Array* result) {
  ::arrow::BooleanBuilder builder;
  ARROW_EXPECT_OK(
      builder.AppendValues(reinterpret_cast<uint8_t*>(expected), result->length()));

  std::shared_ptr<Array> expected_array;
  ARROW_EXPECT_OK(builder.Finish(&expected_array));
  EXPECT_TRUE(result->Equals(*expected_array));
}

}  // namespace arrow

}  // namespace parquet


text:
require 'spacebunny'

# Prerequisites: you have created a device through the SpaceBunny's web interface. See our Getting Started [link]
# for a quick introduction to SpaceBunny's base concepts.

# Once everything is set up get your device's API key from SpaceBunny's web application: on the web interface,
# go to devices section and create or pick an existing device. Click on the 'SHOW CONFIGURATION' link, copy the API key
# and substitute it here:

key = 'your_awesome_device_key'

# Let's instantiate a SpaceBunny (AMQP by default) client, providing the device's API key, that's the fastest and simplest method
# to create a new client. If, for some reason, you need to customize the settings, take a look at
# examples/manual_config.rb for an example of connection settings customization.

dev = Spacebunny::Device.new key

# An equivalent method for providing the API key is through options: Spacebunny::Device.new(key: key)

# We need to call 'connect' in order to open the communication with SpaceBunny platform

dev.connect

# At this point the SDK is auto-configured and ready to use.
# Configurations are automatically lazy-fetched by the SDK itself when calling 'connect'.

# RECEIVING MESSAGES

puts "Waiting for messages. Publish some from SpaceBunny's web interface to try this out:"

# Receiving messages is trivial:

dev.inbox(wait: true, ack: :auto) do |message|
  puts "Received: #{message.payload}"
end

# A Ruby block must be supplied to the 'inbox' method. It yields a Device::Message object containing
# all the useful data:
#
# dev.inbox do |message|
#   puts "payload: #{message.payload}"
#
#   # metadata that can be accessed as an Hash.
#   # metadata[:headers] contains the message's headers for instance
#   puts "metadata: #{message.metadata}"
#
#   # sender_id (id of the device that sent the message)
#   puts "sender_id: #{message.sender_id}"
#
#   # channel name i.e. the name of the channel on which the message has been published
#   puts "channel_name: #{message.channel_name}"
#
#   # Connection and other low level info
#   puts "delivery_info: #{message.delivery_info}"
# end

# inbox method's options:
# 'wait' (default false) causes the script to wait forever on the receive block. This is useful
# for 'read-only' scripts like workers or similar.
# 'ack' option can have two values: :manual (default) or :auto. When :manual you are responsible to ack the messages,
# for instance:
#
# dev.inbox(block: true, ack: :manual) do |message|
#   puts "Received: #{message.payload}"
#   message.ack
# end
# When 'ack' is :auto then the SDK will automatically ack the messages when the code provided in the inbox block
# has terminated execution. This behaviour is useful in cases in which the code executed inside the inbox block
# will always lead to an acked message (no matter the operations' result).
# If your code can lead to errors and, for instance, the message must be reprocessed, you must use :manual ack
# and manually call 'ack' as seen in the example above.
# Call 'nack' in case the message needs to be reprocessed and it will remain on SpaceBunny until successfully
# acked. For instance:

# dev.inbox(block: true, ack: :manual) do |message|
#   puts message.payload
#
#   begin
#     # Do something nasty...
#     raise
#
#     # If everything is ok, ack
#     # (note that this code will never be reached)
#     message.ack
#   rescue Exception => e
#     message.nack
#   end
# end

# ack options are:
#   multiple: false   ack multiple messages at once. Ack all the unacked
#                     messages up to the current one

# nack options are:
#   multiple: false   nack multiple messages at once. Nack all the messages up
#                     to the current one
#   requeue: false    requeue message. If false (default), the message will be
#                     discarded by SpaceBunny. If true message will made
#                     requeued and made available for delivery again

# Other 'inbox' options:
# 'discard_from_api' (default false) causes the SDK to filter out messages published through APIs (or WEB UI) or
# generally sent directly through SpaceBunny's platform.
# 'discard_mine' (default false) causes the SKD to filter out auto-messages i.e. messages sent from this device
# and, for some reason, returned to the sender. This can happen in some particular situation such as when using m2m
# groups.


text:
//
//  ExamplesListViewController.m
//  POPDemo
//
//  Created by Hossam Ghareeb on 10/20/14.
//  Copyright (c) 2014 Hossam Ghareeb. All rights reserved.
//

#import "ExamplesListViewController.h"

@interface ExamplesListViewController ()
@property (weak, nonatomic) IBOutlet UITableView *examplesTableView;

@property (nonatomic, strong) NSArray *examples;

@end

@implementation ExamplesListViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.examples = @[@"Facebook Like & Send", @"Wrong Password", @"Custom VC Transition", @"Example 4", @"Example 5"];
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row) {
        case 0:
            [self performSegueWithIdentifier:@"openFB" sender:self];
            break;
        case 1:
            [self performSegueWithIdentifier:@"openWrongPass" sender:self];
            break;
        case 2:
            [self performSegueWithIdentifier:@"openCustomTransition" sender:self];
            break;

        default:
            break;
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.examples.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    ExampleCell *cell = [tableView dequeueReusableCellWithIdentifier:@"exampleCell"];
    cell.textLabel.text = self.examples[indexPath.row];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 50.0;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
namespace Host.UnitTests.Routing.Captures
{
    using System;
    using Crest.Host.Routing;
    using Crest.Host.Routing.Captures;
    using FluentAssertions;
    using NSubstitute;
    using Xunit;

    public class GenericCaptureNodeTests
    {
        private const string Parameter = "parameter";
        private readonly GenericCaptureNode node = new GenericCaptureNode(Parameter, typeof(int));

        public new sealed class Equals : GenericCaptureNodeTests
        {
            [Fact]
            public void ShouldReturnFalseForDifferentParameters()
            {
                var other = new GenericCaptureNode(Parameter + "New", typeof(int));
                this.node.Equals(other).Should().BeFalse();
            }

            [Fact]
            public void ShouldReturnFalseForDifferentTypes()
            {
                var other = new GenericCaptureNode(Parameter, typeof(Guid));
                this.node.Equals(other).Should().BeFalse();
            }

            [Fact]
            public void ShouldReturnFalseForNonGenericCaptureNodes()
            {
                IMatchNode other = Substitute.For<IMatchNode>();
                this.node.Equals(other).Should().BeFalse();
            }

            [Fact]
            public void ShouldReturnTrueForTheSameParameter()
            {
                var other = new GenericCaptureNode(Parameter, typeof(int));
                this.node.Equals(other).Should().BeTrue();
            }
        }

        public sealed class Match : GenericCaptureNodeTests
        {
            [Fact]
            public void ShouldReturnNoneIfTheConversionErrored()
            {
                NodeMatchInfo result = this.node.Match("Not an integer".AsSpan());

                result.Success.Should().BeFalse();
            }

            [Fact]
            public void ShouldReturnSuccessIfTheConversionSucceeded()
            {
                NodeMatchInfo result = this.node.Match("1".AsSpan());

                result.Success.Should().BeTrue();
            }

            [Fact]
            public void ShouldReturnTheConvertedParameter()
            {
                NodeMatchInfo result = this.node.Match("123".AsSpan());

                result.Parameter.Should().Be(Parameter);
                result.Value.Should().Be(123);
            }
        }

        public sealed class ParameterName : GenericCaptureNodeTests
        {
            [Fact]
            public void ShouldReturnTheValuePassedInTheConstructor()
            {
                this.node.ParameterName.Should().Be(Parameter);
            }
        }

        public sealed class Priority : GenericCaptureNodeTests
        {
            [Fact]
            public void ShouldReturnAPositiveValue()
            {
                this.node.Priority.Should().BePositive();
            }
        }

        public sealed class TryConvertValue : GenericCaptureNodeTests
        {
            [Fact]
            public void ShouldReturnFalsefTheConversionFailed()
            {
                bool result = this.node.TryConvertValue("Not an integer".AsSpan(), out object value);

                result.Should().BeFalse();
                value.Should().BeNull();
            }

            [Fact]
            public void ShouldReturnTrueIfTheConversionSucceeded()
            {
                bool result = this.node.TryConvertValue("1".AsSpan(), out object value);

                result.Should().BeTrue();
                value.Should().Be(1);
            }
        }
    }
}


text:
Saw https://github.com/di/divspl, wrote a response in racket

# Installation
DrRacket -> File -> Install Packages -> <Path to fizzbuzz>
or
`raco pkg install <Path to fizzbuzz>`

# Usage
```racket
#lang fizzbuzz

1...100

fizz=3
buzz=5
```

Run with DrRacket or
`racket example.rtk` from commandline


text:
package co.uk.niadel.napi.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Marks an annotation as being internal and not to use. Useful if you want to use a field only in your packages but want
 * a field in package block to be used in package render.
 * @author Niadel
 *
 */
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Internal
{
	/**
	 * The package that owns this and that calls to this outside of it are removed. N-API's would be co.uk.niadel.napi at time
	 * of writing.
	 */
	public String owningPackage() default "";

	/**
	 * If false, it removes calls/usages outside of owningPackage. Otherwise, it's documentation only.
	 * @return Whether or not this is documentation only.
	 */
	public boolean documentationOnly() default true;
}


text:
import sys
import os
import urllib
import unittest

web_site = "http://tw.widget.yahoo.com/keykey/help/"
phrase_editor_help = "http://tw.widget.yahoo.com/keykey/help/phraseeditor.html"

VERSION_FOR_INSTALLER="2382"
beacon_start = "http://tw.rd.yahoo.com/referurl/keykey/client/installer/start/%(VERSION_FOR_INSTALLER)s%(OS)s/*http://tw.yimg.com/i/tw/download/ykkimg/blank.gif"

version_info = "http://tw.widget.yahoo.com/ykk/VersionInfo.php"
version_info_sig = "http://tw.widget.yahoo.com/ykk/VersionInfo.sig"
one_key_plist = "http://tw.widget.yahoo.com/ykk/OneKey.plist"
canned_message = "http://tw.widget.yahoo.com/ykk/CannedMessages.plist"
dict_gen = "http://tw.widget.yahoo.com/keykey/dict_gen_xmls.php?p=Test"

class TestAPI(unittest.TestCase):
	def doTestURL(self, url):
		try:
			f = urllib.urlopen(url)
			self.assertTrue(f, "")
			self.assertTrue(len(f.read()) > 0, "")
		except Exception as e:
			self.fail(str(e))
	def testAPI(self):
		self.doTestURL(web_site)
		self.doTestURL(phrase_editor_help)
		self.doTestURL(version_info)
		self.doTestURL(version_info_sig)
		self.doTestURL(one_key_plist)
		self.doTestURL(canned_message)
		self.doTestURL(dict_gen)
		self.doTestURL(beacon_start % {"VERSION_FOR_INSTALLER": VERSION_FOR_INSTALLER, "OS": "M105"})
		self.doTestURL(beacon_start % {"VERSION_FOR_INSTALLER": VERSION_FOR_INSTALLER, "OS": "M104"})
		self.doTestURL(beacon_start % {"VERSION_FOR_INSTALLER": VERSION_FOR_INSTALLER, "OS": "W32"})
		self.doTestURL(beacon_start % {"VERSION_FOR_INSTALLER": VERSION_FOR_INSTALLER, "OS": "W64"})

def main():
	unittest.main()
	pass

if __name__ == '__main__':
	main()


text:
    <video preload="auto" class="video-js vjs-default-skin vjs-big-play-centered"
           autoplay="false" data-sly-attribute.autoplay="${properties.autoplay}"
           loop="true" data-sly-attribute.loop="${properties.loopVideo}"
           controls="true" data-sly-attribute.controls="${properties.showControls}"
           poster="http://video-js.zencoder.com/oceans-clip.png" data-sly-attribute.poster="${properties.posterImage}">
        <source src="${videoComponent.videoBasePath}" type='video/mp4' />

        <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
        <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />

To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video

    </video>


text:
(function(){
	var wd = util.isObject("Widget.Device") ? Widget.Device : {},
		wdp = util.isObject("PowerInfo", wd) ? wd.PowerInfo : {};

	dohx.add({name:"PowerInfo",
		mqcExecutionOrderBaseOffset:220000, // This number is the base offset for the execution order, the test ID gets added. Never change this number unless you know what you are doing.
		requiredObjects:["Widget.Device.PowerInfo"],
		tests:[
			//
			//	Properties
			//
			{
				id:100,
				name:"isCharging - Verify reported state.",
				requiredObjects:["Widget.Device.PowerInfo.isCharging"],
				instructions:[
					'Unplug the charger!',
					'Then press "GO".'],
				test:function(t){
					var val = wdp.isCharging;
					t.assertFalse(val);
					return val;
				}
			},
			{
				id:200,
				name:"isCharging - Verify reported state.",
				requiredObjects:["Widget.Device.PowerInfo.isCharging"],
				instructions:[
					'Make sure the battery is NOT FULLY charged!',
					'Plug in the charger!',
					'Then press "GO".'],
				test:function(t){
					var val = wdp.isCharging;
					t.assertTrue(val);
					return val;
				}
			},
			{
				id:300,
				name:"percentRemaining - Verify value.",
				requiredObjects:["Widget.Device.PowerInfo.percentRemaining"],
				instructions:[
					'Look up the current battery capacity.',
					'Then press "GO".'],
				expectedResult:"Is the battery level value correct?",
				test:function(){
					dohx.showInfo("API reports battery level is: ", wdp.percentRemaining+"%.");
				}
			},
			{
				id:400,
				name:"percentRemaining - Verify changed value.",
				requiredObjects:["Widget.Device.PowerInfo.percentRemaining"],
				instructions:[
					'Wait a bit until you are sure the battery capacity has changed (maybe unplug the charger).',
					'Look up the current battery capacity.',
					'Then press "GO".'],
				expectedResult:"Is the battery level value correct?",
				test:function(){
					dohx.showInfo("API reports battery level is: ", wdp.percentRemaining+"%.");
				}
			},
			//
			//	Methods
			//
			{
				id:500,
				name:"onChargeLevelChange - Verify that callback fires.",
				requiredObjects:["Widget.Device.PowerInfo.percentRemaining"],
				instructions:[
					'Make sure the phone is NOT FULLY charged.',
					'Plug in the charger.',
					'Then press "GO" and wait.'
				],
				timeout:30 * 60 * 1000,
				test:function(t){
					_interval = setInterval(function(){
						dohx.showInfo("Current battery level: "+wdp.percentRemaining+"%.");
					}, 5000);
					var oldCapacity = wdp.percentRemaining;
					wdp.onChargeLevelChange = function(newCapacity){
						t.success("Callback was fired (oldCapacity="+oldCapacity+", newCapacity="+newCapacity+"%).");
					};
				},
				tearDown:function(){
					clearInterval(_interval);
					delete wdp.onChargeLevelChange;
				}
			},
			{
				id:600,
				name:"onChargeLevelChange - Verify changing value.",
				requiredObjects:["Widget.Device.PowerInfo.percentRemaining"],
				instructions:[
					'Make sure the phone is NOT FULLY charged.',
					'Plug in the charger.',
					'Then press "GO" and wait.'
				],
				timeout:30 * 60 * 1000,
				test:function(t){
					var oldCapacity = wdp.percentRemaining;
					wdp.onChargeLevelChange = function(newCapacity){
						t.assertNotEqual(oldCapacity, newCapacity);
						t.result = 'oldCapacity='+oldCapacity+', newCapacity='+newCapacity;
					};
					_interval = setInterval(function(){
						dohx.showInfo("Current battery level: "+wdp.percentRemaining+"%.");
					}, 5000);
				},
				tearDown:function(){
					clearInterval(_interval);
					delete wdp.onChargeLevelChange;
				}
			},
			{
				id:700,
				name:"onChargeStateChange - Verify callback.",
				instructions:[
					"Click 'GO'.",
					"Change the charge stage, either by unplugging or plugging in the charger."
				],
				timeout:60 * 60 * 1000,
				test:function(t){
					wdp.onChargeStateChange = function(stage){
						t.success("Callback fired (stage="+stage+").");
					};
				},
				tearDown:function(){
					delete wdp.onChargeStateChange;
				}
			},
			{
				id:800,
				name:"onChargeStateChange - Verify change to 'discharging'.",
				instructions:[
					'Plug in the charger.',
					"Press 'GO'.",
					'Unplug the charger.'
				],
				timeout:60 * 60 * 1000,
				test:function(t){
					wdp.onChargeStateChange = function(stage){
						t.assertEqual(stage, "discharging");
						t.result = stage;
					};
				},
				tearDown:function(){
					delete wdp.onChargeStateChange;
				}
			},
			{
				id:900,
				name:"onChargeStateChange - Verify change to 'charging'.",
				instructions:[
					'Unplug the charger.',
					"Press 'GO'.",
					'Plug in the charger.'],
				timeout:60 * 60 * 1000,
				test:function(t){
					wdp.onChargeStateChange = function(stage){
						t.assertEqual(stage, "charging");
						t.result = stage;
					};
				},
				tearDown:function(){
					delete wdp.onChargeStateChange;
				}
			},
			{
				id:1000,
				name:"onChargeStateChange - Verify change to 'full'.",
				instructions:[
					'Plug in charger.',
					"Press 'GO'.",
					'Wait until fully charged (test waits max. 2h).'],
				timeout:2 * 60 * 60 * 1000,
				test:function(t){
					wdp.onChargeStateChange = function(stage){
						t.assertEqual(stage, "full");
						t.result = stage;
					};
				},
				tearDown:function(){
					delete wdp.onChargeStateChange;
				}
//			},{
//				id:1100,
//				name:"onLowBattery",
//				test:function(t){
//// TODO
//				}
			}
		]
	});
})();


text:
import React from 'react';
import { create } from 'react-test-renderer';
// import { matcher, serializer } from 'jest-styled-components';
import Wrapper from './Wrapper';

// expect.extend(matcher);
// expect.addSnapshotSerializer(serializer);

test('Wrapper', () => {
  const tree = create(<Wrapper />).toJSON();
  expect(tree).toMatchSnapshot();
});


text:
<BroadcastMonitor>
  <updated>2015-08-06T01:08:21</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime></startTime>
    <itemId></itemId>
    <titleId></titleId>
    <itemCode></itemCode>
    <itemReference></itemReference>
    <titleName></titleName>
    <artistName></artistName>
    <albumName></albumName>
    <CategoryCode></CategoryCode>
    <CategoryName></CategoryName>
    <itemDuration></itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-06T01:08:21</startTime>
    <itemId>1000079344:1219728</itemId>
    <titleId>216134803</titleId>
    <itemCode>10053</itemCode>
    <itemReference></itemReference>
    <titleName>Keep Coming Back To You</titleName>
    <artistName>Melissa McMillan</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>209</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
						<?php if( is_category() ):
							echo __( 'Category archive: ', LANGUAGE_ZONE ).single_cat_title( null, false );
						elseif( is_tag() ):
							echo __( 'Tag archive: ', LANGUAGE_ZONE ).single_tag_title( null, false );
						elseif( is_author() ):
							$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
							echo __( 'Author archive: ', LANGUAGE_ZONE ).$curauth->nickname;
						elseif( is_date() ):
							_e( 'Date archive: ', LANGUAGE_ZONE );
							single_month_title( ' ', true );
						else:
							echo __( 'Archive: ', LANGUAGE_ZONE ).get_post_format_string(get_post_format());
						endif ?>

					<?php if( have_posts() ): ?>
						<?php
						global $dt_post_first;
						$dt_post_first = true;
						?>

						<?php while( have_posts() ): the_post(); ?>
							<?php get_template_part('content-masonry', get_post_format()) ?>
						<?php endwhile ?>

							<?php
						     if( function_exists('wp_pagenavi') ) wp_pagenavi();
							 else wp_link_pages();
							?>

					<?php else:?>
					<?php endif ?>


text:
<?php
/**
 * Calendar
 *
 * @package SimpleCalendar/Calendars
 */
namespace SimpleCalendar\Abstracts;

use Carbon\Carbon;
use SimpleCalendar\Events\Event;
use SimpleCalendar\Events\Event_Builder;
use SimpleCalendar\Events\Events;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * The Calendar.
 *
 * Displays events from events feed.
 */
abstract class Calendar {

	/**
	 * Calendar Id.
	 *
	 * @access public
	 * @var int
	 */
	public $id = 0;

	/**
	 * Calendar post object.
	 *
	 * @access public
	 * @var \WP_Post
	 */
	public $post = null;

	/**
	 * Calendar Type.
	 *
	 * @access public
	 * @var string
	 */
	public $type = '';

	/**
	 * Calendar Name.
	 *
	 * @access public
	 * @var string
	 */
	public $name = '';

	/**
	 * Feed type.
	 *
	 * @access public
	 * @var string
	 */
	public $feed = '';

	/**
	 * Calendar start.
	 *
	 * @access public
	 * @var int
	 */
	public $start = 0;

	/**
	 * Calendar end.
	 *
	 * @access public
	 * @var int
	 */
	public $end = 0;

	/**
	 * Static calendar.
	 *
	 * @access public
	 * @var bool
	 */
	public $static = false;

	/**
	 * Today.
	 *
	 * @access public
	 * @var int
	 */
	public $today = 0;

	/**
	 * Time now.
	 *
	 * @access public
	 * @var int
	 */
	public $now = 0;

	/**
	 * Timezone offset.
	 *
	 * @access public
	 * @var int
	 */
	public $offset = 0;

	/**
	 * Timezone
	 *
	 * @access public
	 * @var string
	 */
	public $timezone = 'UTC';

	/**
	 * Site timezone.
	 *
	 * @access public
	 * @var string
	 */
	public $site_timezone = 'UTC';

	/**
	 * Date format.
	 *
	 * @access public
	 * @var string
	 */
	public $date_format = '';

	/**
	 * Time format.
	 *
	 * @access public
	 * @var string
	 */
	public $time_format = '';

	/**
	 * Date-time separator.
	 *
	 * @access public
	 * @var string
	 */
	public $datetime_separator = '@';

	/**
	 * First day of the week.
	 *
	 * @access public
	 * @var int
	 */
	public $week_starts = 0;

	/**
	 * Events to display.
	 *
	 * @access public
	 * @var array
	 */
	public $events = array();

	/**
	 * Errors.
	 *
	 * @access public
	 * @var array
	 */
	protected $errors = array();

	/**
	 * Earliest event.
	 *
	 * @access public
	 * @var int
	 */
	public $earliest_event = 0;

	/**
	 * Latest event.
	 *
	 * @access public
	 * @var int
	 */
	public $latest_event = 0;

	/**
	 * Event builder content.
	 *
	 * @access public
	 * @var string
	 */
	public $events_template = '';

	/**
	 * Calendar Views.
	 *
	 * The calendar available views.
	 *
	 * @access public
	 * @var array
	 */
	public $views = array();

	/**
	 * Calendar View.
	 *
	 * The current view.
	 *
	 * @access public
	 * @var Calendar_View
	 */
	public $view = null;

	/**
	 * Calendar settings.
	 *
	 * @access protected
	 * @var array
	 */
	protected $settings = array();

	/**
	 * Constructor.
	 *
	 * @since 3.0.0
	 *
	 * @param int|object|\WP_Post|Calendar $calendar
	 * @param string $view
	 */
	public function __construct( $calendar, $view = '' ) {

		// Set the post object.
		$this->set_post_object( $calendar );

		if ( ! is_null( $this->post ) ) {

			// Set calendar type and events source.
			$this->set_taxonomies();

			// Set calendar default datetime properties.
			$this->set_timezone();
			$this->set_start_of_week();
			$this->set_static();

			// Set calendar start.
			$this->set_start();

			// Set the events template.
			$this->set_events_template();

			// Get events source data.
			$feed = simcal_get_feed( $this );
			if ( $feed instanceof Feed ) {
				if ( ! empty( $feed->events ) ) {
					if ( is_array( $feed->events ) ) {
						$this->set_events( $feed->events );
						if ( 'use_calendar' == get_post_meta( $this->id, '_feed_timezone_setting', true ) ) {
							$this->timezone = $feed->timezone;
							$this->set_start();
						}
					} elseif ( is_string( $feed->events ) ) {
						$this->errors[] = $feed->events;
					}
				}
			}

			// Set general purpose timestamps.
			$now = Carbon::now( $this->timezone );
			$this->now    = $now->getTimestamp();
			$this->today  = $now->startOfDay()->getTimestamp();
			$this->offset = $now->getOffset();

			// Set date time formatting.
			$this->set_date_format();
			$this->set_time_format();
			$this->set_datetime_separator();

			// Set earliest and latest event timestamps.
			if ( $this->events && is_array( $this->events ) ) {
				$this->earliest_event = intval( current( array_keys( $this->events ) ) );
				$this->latest_event   = intval( key( array_slice( $this->events, -1, 1, true ) ) );
			}

			// Set calendar end.
			$this->set_end();

			// Set view.
			if ( ! $view ) {

				$calendar_view = get_post_meta( $this->id, '_calendar_view', true );
				$calendar_view = isset( $calendar_view[ $this->type ] ) ? $calendar_view[ $this->type ] : '';

				$view = esc_attr( $calendar_view );
			}
		}

		// Get view.
		$this->view = $this->get_view( $view );
	}

	/**
	 * Overloading __isset function with post meta.
	 *
	 * @since  3.0.0
	 *
	 * @param  mixed $key Post meta key.
	 *
	 * @return bool
	 */
	public function __isset( $key ) {
		return metadata_exists( 'post', $this->id, '_' . $key );
	}

	/**
	 * Overloading __get function with post meta.
	 *
	 * @since  3.0.0
	 *
	 * @param  string $key Post meta key.
	 *
	 * @return mixed
	 */
	public function __get( $key ) {
		$value = get_post_meta( $this->id, '_' . $key, true );
		if ( ! empty( $value ) ) {
			$this->$key = $value;
		}
		return $value;
	}

	/**
	 * Set post object and id.
	 *
	 * @since 3.0.0
	 *
	 * @param int|object|\WP_Post|Calendar $calendar
	 */
	public function set_post_object( $calendar ) {
		if ( is_numeric( $calendar ) ) {
			$this->id   = absint( $calendar );
			$this->post = get_post( $this->id );
		} elseif ( $calendar instanceof Calendar ) {
			$this->id   = absint( $calendar->id );
			$this->post = $calendar->post;
		} elseif ( $calendar instanceof \WP_Post ) {
			$this->id   = absint( $calendar->ID );
			$this->post = $calendar;
		} elseif ( isset( $calendar->id ) && isset( $calendar->post ) ) {
			$this->id   = $calendar->id;
			$this->post = $calendar->post;
		}
	}

	/**
	 * Return the calendar title.
	 *
	 * @since  3.0.0
	 *
	 * @return string
	 */
	public function get_title() {
		$title = isset( $this->post->post_title ) ? $this->post->post_title : '';
		return apply_filters( 'simcal_calendar_title', $title );
	}

	/**
	 * Get the calendar post data.
	 *
	 * @since  3.0.0
	 *
	 * @return \WP_Post
	 */
	public function get_post_data() {
		return $this->post;
	}

	/**
	 * Set taxonomies.
	 *
	 * @since 3.0.0
	 * @access protected
	 */
	protected function set_taxonomies() {
		// Set calendar type.
		if ( $type = wp_get_object_terms( $this->id, 'calendar_type' ) ) {
			$this->type = sanitize_title( current( $type )->name );
		} else {
			$this->type = apply_filters( 'simcal_calendar_default_type', 'default-calendar' );
		}
		// Set feed type.
		if ( $feed_type = wp_get_object_terms( $this->id, 'calendar_feed' ) ) {
			$this->feed = sanitize_title( current( $feed_type )->name );
		} else {
			$this->feed = apply_filters( 'simcal_calendar_default_feed', 'google' );
		}
	}

	/**
	 * Get events.
	 *
	 * @since  3.0.0
	 *
	 * @return Events
	 */
	public function get_events() {
		return new Events( $this->events, $this->timezone );
	}

	/**
	 * Set events.
	 *
	 * @since 3.0.0
	 *
	 * @param array $array
	 */
	public function set_events( array $array ) {

		$events = array();

		if ( ! empty( $array ) ) {
			foreach ( $array as $tz => $e ) {
				foreach ( $e as $event ) {
					$events[ $tz ][] = $event instanceof Event ? $event : new Event( $event );
				}
			}
		}

		$this->events = $events;
	}

	/**
	 * Get the event builder template.
	 *
	 * @since  3.0.0
	 *
	 * @param  string $template
	 *
	 * @return string
	 */
	public function set_events_template( $template = '' ) {
		if ( empty( $template ) ) {
			$template = isset( $this->post->post_content ) ? $this->post->post_content : '';
		}

		// TODO: Removed wpautop() call.

		$event_formatting = get_post_meta( $this->id, '_event_formatting', true );

		switch( $event_formatting ) {
			case 'none':
				$this->events_template =  wp_kses_post( trim( $template ) );
				break;
			case 'no_linebreaks':
				$this->events_template =  wpautop( wp_kses_post( trim( $template ) ), false );
				break;
			default:
				$this->events_template =  wpautop( wp_kses_post( trim( $template ) ), true );
		}

		//$this->events_template =  wpautop( wp_kses_post( trim( $template ) ), true );
	}

	/**
	 * Set the timezone.
	 *
	 * @since 3.0.0
	 *
	 * @param string $tz Timezone.
	 */
	public function set_timezone( $tz = '' ) {

		$site_tz = esc_attr( simcal_get_wp_timezone() );

		if ( $this->feed === 'grouped-calendars' ) {
			$this->timezone = $site_tz;
			return;
		}

		if ( empty( $tz ) ) {

			$timezone_setting = get_post_meta( $this->id, '_feed_timezone_setting', true );

			if ( 'use_site' == $timezone_setting ) {
				$tz = $site_tz;
			} elseif ( 'use_custom' == $timezone_setting ) {
				$custom_timezone = esc_attr( get_post_meta( $this->id, '_feed_timezone', true ) );
				// One may be using a non standard timezone in GMT (UTC) offset format.
				if ( ( strpos( $custom_timezone, 'UTC+' ) === 0 ) || ( strpos( $custom_timezone, 'UTC-' ) === 0 ) ) {
					$tz = simcal_get_timezone_from_gmt_offset( substr( $custom_timezone, 3 ) );
				} else {
					$tz = ! empty( $custom_timezone ) ? $custom_timezone : 'UTC';
				}
			}

			$this->timezone = empty( $tz ) ? 'UTC' : $tz;
			return;
		}

		$this->site_timezone = $site_tz;
		$this->timezone = simcal_esc_timezone( $tz, $this->timezone );
	}

	/**
	 * Set date format.
	 *
	 * @since 3.0.0
	 *
	 * @param string $format PHP datetime format.
	 */
	public function set_date_format( $format = '' ) {

		$date_format_custom = $date_format_default = $format;

		if ( empty( $date_format_custom ) ) {

			$date_format_option  = esc_attr( get_post_meta( $this->id, '_calendar_date_format_setting', true ) );
			$date_format_default = esc_attr( get_option( 'date_format' ) );
			$date_format_custom  = '';

			if ( 'use_custom' == $date_format_option ) {
				$date_format_custom = esc_attr( get_post_meta( $this->id, '_calendar_date_format', true ) );
			} elseif ( 'use_custom_php' == $date_format_option ) {
				$date_format_custom = esc_attr( get_post_meta( $this->id, '_calendar_date_format_php', true ) );
			}
		}

		$this->date_format = $date_format_custom ? $date_format_custom : $date_format_default;
	}

	/**
	 * Set time format.
	 *
	 * @since 3.0.0
	 *
	 * @param string $format PHP datetime format.
	 */
	public function set_time_format( $format = '' ) {

		$time_format_custom = $time_format_default = $format;

		if ( empty( $time_format_custom ) ) {

			$time_format_option  = esc_attr( get_post_meta( $this->id, '_calendar_time_format_setting', true ) );
			$time_format_default = esc_attr( get_option( 'time_format' ) );
			$time_format_custom  = '';

			if ( 'use_custom' == $time_format_option ) {
				$time_format_custom = esc_attr( get_post_meta( $this->id, '_calendar_time_format', true ) );
			} elseif ( 'use_custom_php' == $time_format_option ) {
				$time_format_custom = esc_attr( get_post_meta( $this->id, '_calendar_time_format_php', true ) );
			}
		}

		$this->time_format = $time_format_custom ? $time_format_custom : $time_format_default;
	}

	/**
	 * Set date-time separator.
	 *
	 * @since 3.0.0
	 *
	 * @param string $separator A UTF8 character used as separator.
	 */
	public function set_datetime_separator( $separator = '' ) {

		if ( empty( $separator ) ) {
			$separator = get_post_meta( $this->id, '_calendar_datetime_separator', true );
		}

		$separator_spacing = get_post_meta( $this->id, '_calendar_datetime_separator_spacing', true );
		if ( empty( $separator_spacing ) ) {
			$separator = ' ' . trim( $separator ) . ' ';
		} else {
			$separator = str_replace( ' ', ' ', $separator );
		}
		$this->datetime_separator = esc_html( $separator );
	}

	/**
	 * Set start of week.
	 *
	 * @since 3.0.0
	 *
	 * @param int $weekday From 0 (Sunday) to 6 (Friday).
	 */
	public function set_start_of_week( $weekday = -1 ) {

		$week_starts = is_int( $weekday ) ? $weekday : -1;

		if ( $week_starts < 0 || $week_starts > 6 ) {

			$week_starts_setting = get_post_meta( $this->id, '_calendar_week_starts_on_setting', true );
			$week_starts         = intval( get_option( 'start_of_week' ) );

			if ( 'use_custom' == $week_starts_setting ) {
				$week_starts_on = get_post_meta( $this->id, '_calendar_week_starts_on', true );
				$week_starts    = is_numeric( $week_starts_on ) ? intval( $week_starts_on ) : $week_starts;
			}
		}

		$this->week_starts = $week_starts;
	}

	/**
	 * Set calendar start.
	 *
	 * @since 3.0.0
	 *
	 * @param int $timestamp
	 */
	public function set_start( $timestamp = 0 ) {

		if ( is_int( $timestamp ) && $timestamp !== 0 ) {
			$this->start = $timestamp;
			return;
		}

		$start_dt = Carbon::now( $this->timezone );

		$calendar_begins = esc_attr( get_post_meta( $this->id, '_calendar_begins', true ) );
		$nth = max( absint( get_post_meta( $this->id, '_calendar_begins_nth', true ) ), 1 );

		if ( 'today' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone );
		} elseif ( 'days_before' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone )->subDays( $nth );
		} elseif ( 'days_after' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone )->addDays( $nth );
		} elseif ( 'this_week' == $calendar_begins ) {
			$week = new Carbon( 'now', $this->timezone );
			$week->setWeekStartsAt( $this->week_starts );
			$start_dt = $week->startOfWeek();
		} elseif ( 'weeks_before' == $calendar_begins ) {
			$week = new Carbon( 'now', $this->timezone );
			$week->setWeekStartsAt( $this->week_starts );
			$start_dt = $week->startOfWeek()->subWeeks( $nth );
		} elseif ( 'weeks_after' == $calendar_begins ) {
			$week = new Carbon( 'now', $this->timezone );
			$week->setWeekStartsAt( $this->week_starts );
			$start_dt = $week->startOfWeek()->addWeeks( $nth );
		} elseif ( 'this_month' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone )->startOfMonth();
		} elseif ( 'months_before' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone )->subMonths( $nth )->startOfMonth();
		} elseif ( 'months_after' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone )->addMonths( $nth )->startOfMonth();
		} elseif ( 'this_year' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone )->startOfYear()->addHour();
		} elseif ( 'years_before' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone )->subYears( $nth )->startOfYear();
		} elseif ( 'years_after' == $calendar_begins ) {
			$start_dt = Carbon::today( $this->timezone )->addYears( $nth )->startOfYear();
		} elseif ( 'custom_date' == $calendar_begins ) {
			if ( $date = get_post_meta( $this->id, '_calendar_begins_custom_date', true ) ) {
				$start_dt = Carbon::createFromFormat( 'Y-m-d', esc_attr( $date ), $this->timezone )->setTimezone( $this->timezone )->startOfDay();
			}
		}

		$this->start = $start_dt->timestamp;
	}

	/**
	 * Set calendar end.
	 *
	 * @since 3.0.0
	 *
	 * @param int $timestamp
	 */
	public function set_end( $timestamp = 0 ) {
		$latest = is_int( $timestamp ) && $timestamp !== 0 ? $timestamp : $this->latest_event;
		$this->end = $latest > $this->start ? $latest : $this->start;
	}

	/**
	 * Set the calendar to static.
	 *
	 * @since 3.0.0
	 *
	 * @param string|bool $static
	 */
	public function set_static( $static = '' ) {

		if ( ! empty( $static ) && is_bool( $static ) ) {
			$this->static = $static;
			return;
		}

		if ( 'yes' == get_post_meta( $this->id, '_calendar_is_static', true ) ) {
			$this->static = true;
			return;
		}

		$this->static = false;
	}

	/**
	 * Input fields for settings page.
	 *
	 * @since 3.0.0
	 *
	 * @return array
	 */
	public function settings_fields() {
		return $this->settings;
	}

	/**
	 * Get a calendar view.
	 *
	 * @since 3.0.0
	 *
	 * @param  string $view
	 *
	 * @return Calendar_View
	 */
	abstract public function get_view( $view = '' );

	/**
	 * Get event HTML parsed by template.
	 *
	 * @since  3.0.0
	 *
	 * @param  Event  $event    Event object to be parsed.
	 * @param  string $template (optional) To use another template or a partial.
	 *
	 * @return string
	 */
	public function get_event_html( Event $event, $template = '' ) {
		$event_builder = new Event_Builder( $event, $this );
		// Use the event template to parse tags; if empty, fallback to calendar post content.
		$template = empty( $template ) ? ( empty( $event->template ) ? $this->events_template : $event->template ) : $template;
		return $event_builder->parse_event_template_tags( $template );
	}

	/**
	 * Get "Add to Google Calendar" link.
	 *
	 * @since  3.1.3
	 *
	 * @param  Event  $event    Event object to be parsed.
	 *
	 * @return string
	 */
	public function get_add_to_gcal_url( Event $event ) {
		$base_url = 'https://calendar.google.com/calendar/render';
		// Was https://www.google.com/calendar/render

		// Start & end date/time in specific format for GCal.
		// &dates=20160504T110000/20160504T170000
		// No "Z"s tacked on to preserve source timezone.
		// All day events remove time component, but need to add a full day to show up correctly.
		$is_all_day     = ( true == $event->whole_day );
		$gcal_dt_format = $is_all_day ? 'Ymd' : 'Ymd\THi00';
		$gcal_begin_dt  = $event->start_dt->format( $gcal_dt_format );
		$end_dt_raw     = $is_all_day ? $event->end_dt->addDay() : $event->end_dt;
		$gcal_end_dt    = $end_dt_raw->format( $gcal_dt_format );
		$gcal_dt_string = $gcal_begin_dt . '/' . $gcal_end_dt;

		// "details" (description) should work even when blank.
		// "location" (address) should work with an address, just a name or blank.
		$params = array(
			'action'   => 'TEMPLATE',
			'text'     => urlencode( strip_tags( $event->title ) ),
			'dates'    => $gcal_dt_string,
			'details'  => urlencode( $event->description ),
			'location' => urlencode( $event->start_location['address'] ),
			'trp'      => 'false',
		);

		// "ctz" (timezone) arg should be included unless all-day OR 'UTC'.
		if ( ! $is_all_day && ( 'UTC' !== $event->timezone ) ) {
			$params['ctz'] = urlencode( $event->timezone );
		}

		$url = add_query_arg( $params, $base_url );

		return $url;
	}

	/**
	 * Output the calendar markup.
	 *
	 * @since 3.0.0
	 *
	 * @param string $view The calendar view to display.
	 */
	public function html( $view = '' ) {

		$view = empty( $view ) ? $this->view : $this->get_view( $view );

		if ( $view instanceof Calendar_View ) {

			if ( ! empty( $this->errors ) ) {

				if ( current_user_can( 'manage_options' )  ) {
					echo '
';
					foreach ( $this->errors as $error ) { echo $error; }
					echo '
';
				}

			} else {

				// Get a CSS class from the class name of the calendar view (minus namespace part).
				$view_name  = implode( '-', array_map( 'lcfirst', explode( '_', strtolower( get_class( $view ) ) ) ) );
				$view_class = substr( $view_name, strrpos( $view_name, '\\' ) + 1 );

				$calendar_class = trim( implode( ' simcal-', apply_filters( 'simcal_calendar_class', array(
					'simcal-calendar',
					$this->type,
					$view_class,
				), $this->id ) ) );

				echo '
id . '" '
									. 'data-timezone="'       . $this->timezone . '" '
									. 'data-offset="'         . $this->offset . '" '
									. 'data-week-start="'     . $this->week_starts . '" '
									. 'data-calendar-start="' . $this->start .'" '
									. 'data-calendar-end="'   . $this->end . '" '
									. 'data-events-first="'   . $this->earliest_event .'" '
									. 'data-events-last="'    . $this->latest_event . '"'
									. '>';

				do_action( 'simcal_calendar_html_before', $this->id );

				$view->html();

				do_action( 'simcal_calendar_html_after', $this->id );

				//$settings = get_option( 'simple-calendar_settings_calendars' );
				$poweredby = get_post_meta( $this->id, '_poweredby', true );

				if ( 'yes' == $poweredby ) {
					$align = is_rtl() ? 'left' : 'right';
					echo '' .
					     sprintf( __( 'Powered by Simple Calendar', 'google-calendar-events' ), simcal_get_url( 'home' ) ) .
					     '';
				}

				echo '
';

			}

		}

	}

}


text:
package com.github.andrewapj.simplehelpdesk.web;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(strict = true,
        features = "src/test/resources/features",
        plugin = {"pretty", "html:target/cucumber"})

public class CucumberIT {
}


text:
#region License

#endregion

namespace Spring.Northwind.Domain
{
    public class Product
    {
        protected int _id;
        protected string _productName;
        protected string _quantityPerUnit;
        protected decimal _unitPrice;
        protected short _unitsInStock;
        protected short _unitsOnOrder;
        protected short _reorderLevel;
        protected bool _discontinued;
        //protected Category _category;
        //protected Supplier _supplier;
        protected OrderDetail _orderDetail;
    }
}