text:
class MemArea
{
    public:
        MemArea(uint8_t *mem, uint8_t *end_) { pos = beg = mem; end = end_;}
        uint8_t *beg;
        uint8_t *pos;
        uint8_t *end;
};

class MemAllocator
{
    public:
        MemAllocator() {}
        MemArea *NewMemArea(uintptr_t min_size);
        uint8_t *MemAlloc(unsigned int max_size);
        void EndAlloc(uint8_t *pos) { current_area->pos = pos; }
        void Reset();

    private:
        vector<MemArea> memory_areas;
        MemArea *current_area;
};

class UnitSearchCache
{
    protected:
        UnitSearchCache() {}
        UnitSearchCache(UnitSearchCache &&other) = default;
        UnitSearchCache& operator=(UnitSearchCache &&other) = default;

        vector<MemAllocator> memory;
};

// Far too tied into UnitSearch::FindUnits_ChooseTarget
class UnitSearchRegionCache : public UnitSearchCache
{
    public:
        class Entry
        {
            public:
                Entry(uint8_t *p, int pl) : ptr(p), players(pl) {}
                Unit **GetRaw() { return (Unit **)(ptr + sizeof(Unit *) + sizeof(Unit *) * players); }
                uintptr_t Size() { return *(Unit ***)(ptr) - GetRaw(); }
                Array<Unit *> PlayerUnits(int player)
                {
                    Assert(player >= 0 && player < players);
                    Unit ***arr = (Unit ***)ptr;
                    uintptr_t len = arr[player + 1] - arr[player];
                    return Array<Unit *>(arr[player], len);
                }

            private:
                uint8_t *ptr;
                int players;
        };
        UnitSearchRegionCache();
        ~UnitSearchRegionCache();

        void SetSize(uint32_t size_);
        Optional<Entry> Find(uint32_t region, bool ground);
        void Clear();

        Entry FinishEntry(Unit **arr, uint32_t entry, bool ground, uint32_t count);
        Unit **NewEntry(uintptr_t max_size);

    private:
        uintptr_t MakeEntry(uintptr_t region, bool ground);
        vector<uint8_t *> cache;
        uint32_t size;
};

class UnitSearchAreaCache : public UnitSearchCache
{
    public:
        // Could use deque-based implementation? Minor performance loss but avoids requiring
        // large buffers which are rarely used
        template <class C>
        class AreaBuffer
        {
            public:
                AreaBuffer() {}
                AreaBuffer(C *b, C *e) : begin(b), end(e) {}
                template<class Cb> void Iterate(Cb callback) const
                {
                    bool stop = false;
                    for (C *pos = begin; !stop && pos != end; ++pos)
                        callback(*pos, &stop);
                }

                uintptr_t Count() const { return end - begin; }
                C *begin;
                C *end;
        };

        template <class C>
        class Area
        {
            public:
                typedef AreaBuffer<C> Buffer;
                Area() : rest(nullptr, nullptr), topleft(nullptr, nullptr),
                    top(nullptr, nullptr), left(nullptr, nullptr) {}
                Buffer &Rest() { return rest; }
                Buffer &TopLeft() { return topleft; }
                Buffer &Top() { return top; }
                Buffer &Left() { return left; }
                const Buffer &Rest() const { return rest; }
                const Buffer &TopLeft() const { return topleft; }
                const Buffer &Top() const { return top; }
                const Buffer &Left() const { return left; }

                uintptr_t Count() const
                {
                    return left.end - rest.begin;
                }

                bool IsEmpty() const
                {
                    return rest.begin == left.end;
                }

                // These waste slightly memory, as one's end is next's begin
                // Could have just the functions calculate begins on fly
                // (rest.begin == this + sizeof(*this))
                Buffer rest;
                Buffer topleft;
                Buffer top;
                Buffer left;
        };

        template <class C>
        struct AreaInfo
        {
            public:
                // Order is important - see FillEntryColumn comment
                AreaInfo(Area<C> *a, C *pos) : area(a), out_rest(pos), out_topleft(pos), out_top(pos), out_left(pos) {}
                Area<C> *area;
                C *out_rest;
                C *out_topleft;
                C *out_top;
                C *out_left;
        };

        // Does not necessarily have to be constant, but currently Unit::GetAutoTarget cache
        // assumes that it can just take an area owned by this and fill its caches with one
        static const int AreaSize = 128;
        UnitSearchAreaCache() {}
        UnitSearchAreaCache(UnitSearchAreaCache &&other) = default;
        UnitSearchAreaCache& operator=(UnitSearchAreaCache &&other) = default;

        void SetSize(xuint x, yuint y);
        void Clear();

        unsigned int AreaAmount(const Rect16 &rect) const
        {
            // Rounds left and top upwards if not 0, right and bottom downwards if not AreaSize -1
            // So it only returns complete areas
            unsigned int w = (((rect.right + 1) & ~(AreaSize - 1)) - (((rect.left - 1) | (AreaSize - 1)) + 1)) / AreaSize;
            unsigned int h = (((rect.bottom + 1) & ~(AreaSize - 1)) - (((rect.top - 1) | (AreaSize - 1)) + 1)) / AreaSize;
            // * 4 is overcautious, as only topleft corner can use 4 area bufs
            return w * h * 4;
        }

        Area<Unit *> *&GetEntry(xuint x, yuint y) { return cache[ToCacheEntry(x, y)]; }
        const Area<Unit *> *FromEntryId(int id) const { return cache[id]; }
        unsigned int ToCacheEntry(xuint x, yuint y) const { return (x / AreaSize) + (y / AreaSize << width_shift); }

        Rect16 GetNonCachedArea(const Rect16 &rect) const;
        template <class Cb>
        void ForNonCachedAreas(const Rect16 &area, Cb callback);

        void FillCache(const Rect16 &rect, Array<Unit *> units);
        void Find(const Rect16 &rect, Unit **out, Unit ***out_end, AreaBuffer<Unit *> *out_bufs, AreaBuffer<Unit *> **out_bufs_end);
        template <class Cb>
        void ForEach(const Rect16 &rect, Cb callback);

        /// Should only be used in cases where you know better and wish to fill the area by yourself
        /// All pointers in the returned area point to same block of memory, which _must_ to be used to
        /// fill the area in order specified by comment in FillEntryColumn.
        /// Before allocating more areas, the allocated area must be finished with FinishArea
        template <class C>
        Area<C> *AllocateNewArea(int raw_id, uintptr_t max_size);
        /// Finishes an allocated area
        template <class C>
        void FinishArea(Area<C> *area);

        // Makes area point to global empty area, obviously assumes that areas will not
        // be modified after creation, they currently are not
        void MarkAreaEmpty(int raw_id)
        {
            cache[raw_id] = &empty_area;
        }

    private:
        static Area<Unit *> empty_area;

        template <int directions>
        Unit **AddMatchingUnits(const Rect16 &rect, const AreaBuffer<Unit *> &in, Unit **out);
        void FillEntry(unsigned int entry, Array<Unit *> units);

        template <class C>
        vector<AreaInfo<C>> AllocateAreaInfos(unsigned int first, unsigned int count, unsigned int max_size);
        template <class C>
        void FinishAreas(unsigned int first, vector<AreaInfo<C>> &&areas);
        void FillEntryColumn(unsigned int first, unsigned int count, Array<Unit *> units);

        vector<Area<Unit *> *> cache;
        // Could be used for other stuff as well
        // Vector is not used due to slower push_back (it always checks if it needs to realloc)
        Common::OwnedArray<Unit *> for_each_buf;
        uint32_t width_shift;
        uint32_t cache_size;
};

/// Cache that is designed to be used in more specialized situations than normal AreaCache,
/// such as caching only flying zerg units owned by players, splitting them to ai/human caches
/// which can be checked separately.
/// N specifies the amount of buckets the cached data is split into.
/// The splitting function is passed separately every time to FillNonCachedAreas.
/// Using the previous example, one would have C = Unit *, N = 2 and call FillNonCachedAreas with
///   filter = [](Unit *u) { return unit->IsFlying() && unit->GetRace == Race::Zerg; }
///   key = [](Unit *u) { return unit->ai ? 0 : 1; }
/// (Though this one considers neutrals etc "non-ai", one would maybe filter them as well)
/// Additionaly, having no filter and having key return values >= N will also filter them out,
/// though with different performance (Might be better if filtering and keying use same, slow operation)
/// (Maybe having separate filter function is a bad idea? Also is STL's sort conservative on key creation?
/// Currently it might call key function unnecessarily often and it would be just better to generate key once
/// during sortable array construction/filter phase)
/// (Also current implementation is just simple wrapper of multiple AreaCaches, a bit wasteful as
/// they always have same areas valid/same sizes etc)
template <class C, int N>
class SecondaryAreaCache
{
    public:
        SecondaryAreaCache() {}
        SecondaryAreaCache(SecondaryAreaCache &&other) = default;
        SecondaryAreaCache& operator=(SecondaryAreaCache &&other) = default;
        void Clear();
        void SetSize(xuint x, yuint y);

        template <class Filter, class Key>
        void FillNonCachedAreas(UnitSearchAreaCache *master_cache, const Rect16 &area, Filter filter, Key key);
        UnitSearchAreaCache &Cache(int n) { return caches[n]; }
    private:

        template <class Filter, class Key, class F, class F2>
        void FillAreaBuffers(const UnitSearchAreaCache::Area<C> *in_area, UnitSearchAreaCache::Area<C> **out_areas, Filter filter, Key key, F GetBuffer, F2 GetConstBuffer);
        UnitSearchAreaCache caches[N];
};

#endif // UNITSEARCH_CACHE_H


text:
import numpy as np

from transformers import Pipeline

def softmax(outputs):
    maxes = np.max(outputs, axis=-1, keepdims=True)
    shifted_exp = np.exp(outputs - maxes)
    return shifted_exp / shifted_exp.sum(axis=-1, keepdims=True)

class PairClassificationPipeline(Pipeline):
    def _sanitize_parameters(self, **kwargs):
        preprocess_kwargs = {}
        if "second_text" in kwargs:
            preprocess_kwargs["second_text"] = kwargs["second_text"]
        return preprocess_kwargs, {}, {}

    def preprocess(self, text, second_text=None):
        return self.tokenizer(text, text_pair=second_text, return_tensors=self.framework)

    def _forward(self, model_inputs):
        return self.model(**model_inputs)

    def postprocess(self, model_outputs):
        logits = model_outputs.logits[0].numpy()
        probabilities = softmax(logits)

        best_class = np.argmax(probabilities)
        label = self.model.config.id2label[best_class]
        score = probabilities[best_class].item()
        logits = logits.tolist()
        return {"label": label, "score": score, "logits": logits}

redpajama_set_name: RedPajamaGithub


text:
 <?php echo get_option('company_name'); ?>

                                        Your Purchase Details

                                        Hi <?php echo user_full_name($userData);  ?>,

<?php echo form_error('email_text_product_sales'); ?>

                                            Sl No.
                                            Product Name
                                            Price
                                            Quantity
                                            Subtotal

                                        <?php echo $tableRow; ?>

                                    © <?php echo date('Y').' '.get_option('company_name'); ?>,
                                    All Rights Reserved.


text:
from django.db import models

import datetime
from django.utils import timezone

# Create your models here.
class Post(models.Model):
    def __str__(self):
        return self.post_text

    post_text = models.CharField(max_length=500)
    published_date = models.DateTimeField('published on')

    def waspublishedrecently(self):
        return timezone.datetime.now() >= self.published_date >= timezone.datetime.now() - datetime.timedelta(days=1)

class Comment(models.Model):
    def __str__(self):
        return self.comment_text

    post = models.ForeignKey(Post)
    comment_text = models.CharField(max_length=500)
    comment_like = models.IntegerField(default=0)
    commented_date = models.DateTimeField('commented on')


text:
create table CRUISESAMPLE_WAYPOINT (
    ID varchar(36) not null,
    VERSION integer not null,
    CREATE_TS timestamp,
    CREATED_BY varchar(50),
    UPDATE_TS timestamp,
    UPDATED_BY varchar(50),
    DELETE_TS timestamp,
    DELETED_BY varchar(50),
    --
    POINT LONGVARCHAR not null,
    ETA timestamp,
    ROUTE_ID varchar(36),
    --
    primary key (ID)
);


text:
layout: partner_detail
title: Amadora city - Portugal
description: >-
  The major disaster risks were flash floods (urban area),urban fires,
  industrial fires, landslides, storms (fallen trees, damaged buildings
  infrastructure) and road accidents. Amadora municipality has some
  vulnerability a highly urbanized territory and population insufficiently aware
  and/or sensitized about the risks and hazards.
image: /images/amandora.png
quote: >-
  The risks are a biophysical fragility of the territory. Their impact on the
  infrastructures and population involve a strong strategy. Preparedness,
  mitigation, prevention are the key of success. Our task is promote a campaign
  with maximum possible number of agents from the local,scientific and academic
  communities, demonstrating the relevance of risk reduction and of the amount
  of natural disasters that afflict the territory.
quote_author: Carla Tavares
quote_author_title: Mayor
map:
  latitude: 38.7417991
  longitude: -9.2224606
  address: ' Amadora, Portugal'
  zoom: 10
published: true
---

{% if page.quote %}

{{ page.quote }}

{{ page.quote_author }}

{{ page.quote_author_title }}

{% endif %}

## HAZARD AND VULNERABILITY PROFILE

The major disaster risks were flash floods (urban area), urban fires, industrial fires, landslides, storms (fallen trees, damaged buildings infrastructure) and road accidents. Amadora municipality has some vulnerability: a highly urbanized territory and population insufficiently aware and/or sensitized about the risks and hazards.

![alt text](/images/amandora.png "Amadora - Portugal")

## DISASTER AND RISK REDUCTION ACTIVITIES

In the context of the preparation, it is worth mentioning the training and awareness creation project for the school community, entitled "Civil Protection Club", which addresses the issues of risks that exist in Amadora (e.g., seismic risk, flood areas, etc.) and identifies the self-protection measures. It is worth noting that there has been a continued effort towards a culture of safety and prevention creating in Amadora. The local institutions have made remarkable efforts to reduce the vulnerability of the population by issuing warnings not to occupy areas of risk. The planning for the seismic risk and the mapping of the flood areas, are also good examples of such efforts, including the risk analyses (zoning of critical areas) and planning for emergency situations. The whole structure of civil protection has made remarkable efforts to involve a great number of institutional partners from both civic and scientific academic spheres of life.

## Visit the city's website:
  [Câmara Municipal da Amadora](http://www.cm-amadora.pt/)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Class org.hibernate.ejb.criteria.expression.UnaryArithmeticOperation.Operation (Hibernate JavaDocs)
</TITLE>

<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.hibernate.ejb.criteria.expression.UnaryArithmeticOperation.Operation

Packages that use UnaryArithmeticOperation.Operation

org.hibernate.ejb.criteria.expression

Uses of UnaryArithmeticOperation.Operation in org.hibernate.ejb.criteria.expression

Methods in org.hibernate.ejb.criteria.expression that return UnaryArithmeticOperation.Operation

 UnaryArithmeticOperation.Operation
UnaryArithmeticOperation.getOperation()

static UnaryArithmeticOperation.Operation
UnaryArithmeticOperation.Operation.valueOf(String name)

          Returns the enum constant of this type with the specified name.

static UnaryArithmeticOperation.Operation[]
UnaryArithmeticOperation.Operation.values()

          Returns an array containing the constants of this enum type, in
the order they are declared.

Constructors in org.hibernate.ejb.criteria.expression with parameters of type UnaryArithmeticOperation.Operation

UnaryArithmeticOperation(CriteriaBuilderImpl criteriaBuilder,
                         UnaryArithmeticOperation.Operation operation,
                         Expression<T> operand)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2001-2013 Red Hat, Inc.  All Rights Reserved.


text:
/**
 * RequestBody
 */
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
class RequestBody extends _1.Body {
    constructor(objref, payload) {
        super(new _1.RequestData(objref, payload));
    }
}
exports.RequestBody = RequestBody;
// tslint:disable-next-line:max-classes-per-file
class RequestBodyV extends _1.Body {
    constructor(objref, payload) {
        super(new _1.RequestDataV(objref, payload));
    }
}
exports.RequestBodyV = RequestBodyV;
function makeRequestBody(ref, pl) {
    return _1.makeBody(new _1.RequestData(ref, pl));
}
exports.makeRequestBody = makeRequestBody;
function makeRequestBodyV(ref, pl) {
    return _1.makeBody(new _1.RequestDataV(ref, pl));
}
exports.makeRequestBodyV = makeRequestBodyV;


text:
#include <osquery/core.h>
#include <osquery/logger.h>
#include <osquery/tables.h>

#include "osquery/events/linux/udev.h"

namespace osquery {
namespace tables {

const std::string kUSBKeyVendorID = "ID_VENDOR_ID";
const std::string kUSBKeyVendor = "ID_VENDOR_FROM_DATABASE";
const std::string kUSBKeyModelID = "ID_MODEL_ID";
const std::string kUSBKeyModel = "ID_MODEL_FROM_DATABASE";
const std::string kUSBKeyDriver = "ID_USB_DRIVER";
const std::string kUSBKeySubsystem = "SUBSYSTEM";
const std::string kUSBKeySerial = "ID_SERIAL_SHORT";
const std::string kUSBKeyAddress = "BUSNUM";
const std::string kUSBKeyPort = "DEVNUM";

QueryData genUSBDevices(QueryContext &context) {
  QueryData results;

  auto udev_handle = udev_new();
  if (udev_handle == nullptr) {
    VLOG(1) << "Could not get udev handle";
    return results;
  }

  // Perform enumeration/search.
  auto enumerate = udev_enumerate_new(udev_handle);
  udev_enumerate_add_match_subsystem(enumerate, "usb");
  udev_enumerate_scan_devices(enumerate);

  // Get list entries and iterate over entries.
  struct udev_list_entry *device_entries, *entry;
  device_entries = udev_enumerate_get_list_entry(enumerate);

  udev_list_entry_foreach(entry, device_entries) {
    const char *path = udev_list_entry_get_name(entry);
    auto device = udev_device_new_from_syspath(udev_handle, path);

    Row r;
    // r["driver"] = UdevEventPublisher::getValue(device, kUSBKeyDriver);
    r["vendor"] = UdevEventPublisher::getValue(device, kUSBKeyVendor);
    r["model"] = UdevEventPublisher::getValue(device, kUSBKeyModel);

    // USB-specific vendor/model ID properties.
    r["model_id"] = UdevEventPublisher::getValue(device, kUSBKeyModelID);
    r["vendor_id"] = UdevEventPublisher::getValue(device, kUSBKeyVendorID);
    r["serial"] = UdevEventPublisher::getValue(device, kUSBKeySerial);

    // Address/port accessors.
    r["usb_address"] = UdevEventPublisher::getValue(device, kUSBKeyAddress);
    r["usb_port"] = UdevEventPublisher::getValue(device, kUSBKeyPort);

    // Removable detection.
    auto removable = UdevEventPublisher::getAttr(device, "removable");
    if (removable == "unknown") {
      r["removable"] = "-1";
    } else {
      r["removable"] = "1";
    }

    if (r["usb_address"].size() > 0 && r["usb_port"].size() > 0) {
      results.push_back(r);
    }
    udev_device_unref(device);
  }

  // Drop references to udev structs.
  udev_enumerate_unref(enumerate);
  udev_unref(udev_handle);

  return results;
}
}
}


text:
Documentation
=============

How it works:
- [Getting started](gettingstarted.md)
- [Getting advanced](gettingadvanced.md)

API:
- [Engine](engine.md)
- [Entities](entities.md)
- [Components](components.md)
- [Systems](systems.md)
- [Collections](collections.md)


text:
@interface ViewController ()

@property (strong, nonatomic) NSDictionary* buttonDictionary;
@property (strong,nonatomic) NSString* expressionString;

@property (nonatomic,readwrite) NSInteger cursorPosition; // unused. Useful for enhanced functionality in future

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

 // setup relation Between The buttons and their respective functions
    NSMutableDictionary* dict = [NSMutableDictionary dictionary];

    [dict setObject:@"1" forKey:@"1001"];
    [dict setObject:@"2" forKey:@"1002"];
    [dict setObject:@"3" forKey:@"1003"];
    [dict setObject:@"4" forKey:@"1004"];
    [dict setObject:@"5" forKey:@"1005"];
    [dict setObject:@"6" forKey:@"1006"];
    [dict setObject:@"7" forKey:@"1007"];
    [dict setObject:@"8" forKey:@"1008"];
    [dict setObject:@"9" forKey:@"1009"];
    [dict setObject:@"0" forKey:@"1000"];
    [dict setObject:@"." forKey:@"999"];
    [dict setObject:@"/" forKey:@"1010"];
    [dict setObject:@"*" forKey:@"1011"];
    [dict setObject:@"+" forKey:@"1012"];
    [dict setObject:@"-" forKey:@"1013"];

    self.buttonDictionary = dict;
    self.expressionString= @"";
    self.inputView.text =0;
    // Do any additional setup after loading the view, typically from a nib.
}

-(void)evaluateEnteredExpression:(NSString *) string
{
// Evaluates if the expression is valid. Else shows the error
    @try
    {

        NSExpression *expression = [NSExpression expressionWithFormat:string];
            NSPredicate * parsed = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"1.0 * %@ = 0", expression]];
            NSExpression * left = [(NSComparisonPredicate *)parsed leftExpression];
           id calculatedResult = [left expressionValueWithObject:nil context:nil];

        self.resultView.text = [NSString stringWithFormat:@"%@", calculatedResult];
        self.expressionString = @"";

    }
    @catch (NSException *exception)
    {
        NSLog(@"%@",exception);

        if (exception.name == NSInvalidArgumentException) {

            self.resultView.text = @"Invalid Entry. Please Check the Syntax";

        }

    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

// Modifies
- (IBAction)numberTapped:(UIButton*)button
{
    self.inputView.text = [self.expressionString stringByAppendingString:[NSString stringWithFormat:@"%@",self.buttonDictionary[[NSString stringWithFormat:@"%@",@(button.tag
                                                                                )]]]];

    self.expressionString= self.inputView.text;

}

- (IBAction)backSpaceTapped:(id)sender
{
    if (self.expressionString.length>1) {

    self.expressionString = [self.expressionString substringToIndex:self.expressionString.length-1];
        self.inputView.text = self.expressionString;

    }
    else
    {
        self.expressionString = @"";
        self.inputView.text = @"0";
    }
}

#pragma Future Methods

- (IBAction)backTapped:(id)sender {
}

- (IBAction)forwardTapped:(id)sender {
}

- (IBAction)solveTapped:(id)sender
{
    [self evaluateEnteredExpression:self.expressionString];
}
- (IBAction)resetTapped:(id)sender
{
    self.inputView.text = @"0";
    self.expressionString = @"";
    self.resultView.text= @"";
}
@end


text:
package org.cf.smalivm.opcode;

import gnu.trove.map.TIntObjectMap;

import org.cf.smalivm.VirtualMachine;
import org.jf.dexlib2.builder.MethodLocation;

public interface OpFactory {

    Op create(MethodLocation location, TIntObjectMap<MethodLocation> addressToLocation, VirtualMachine vm);
}


text:
require 'concurrent/executor/ruby_fixed_thread_pool'

module Concurrent

  if RUBY_PLATFORM == 'java'
    require 'concurrent/executor/java_fixed_thread_pool'
    # @!macro [attach] fixed_thread_pool
    #
    #   A thread pool with a set number of threads. The number of threads in the pool
    #   is set on construction and remains constant. When all threads are busy new
    #   tasks `#post` to the thread pool are enqueued until a thread becomes available.
    #   Should a thread crash for any reason the thread will immediately be removed
    #   from the pool and replaced.
    #
    #   The API and behavior of this class are based on Java's `FixedThreadPool`
    #
    #   @note When running on the JVM (JRuby) this class will inherit from `JavaFixedThreadPool`.
    #     On all other platforms it will inherit from `RubyFixedThreadPool`.
    #
    #   @see Concurrent::RubyFixedThreadPool
    #   @see Concurrent::JavaFixedThreadPool
    #
    #   @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html
    #   @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html
    #   @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html
    class FixedThreadPool < JavaFixedThreadPool
    end
  else
    # @!macro fixed_thread_pool
    class FixedThreadPool < RubyFixedThreadPool
    end
  end
end


text:
--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = dis, pg_catalog;

--
-- Name: raises(text, text, text); Type: FUNCTION; Schema: dis; Owner: postgres
--

CREATE OR REPLACE FUNCTION raises(call text, want text DEFAULT NULL::text, message text DEFAULT ''::text) RETURNS score
    LANGUAGE plpgsql
    AS $_$
/*  Function:     dis.raises(call text, want text DEFAULT NULL, message text DEFAULT '')
    Description:  Test if "call" results in the error "want"
    Affects:      nothing
    Arguments:    call (text): SQL to execute
                  want (text): SQLSTATE (equal) or SQLERRM (match) expected if NULL any Error is a success (Optional)
                  message (text): Message to include (Optional)
    Returns:      dis.score
*/
DECLARE
    _score      dis.score;
    _state      text := NULL;
    _errm       text := NULL;
BEGIN
    IF want IS NULL THEN
        NULL;
    ELSEIF want ~ '^[A-Z0-9]{5}$' THEN
        _state := want;
    ELSE
        _errm  := want;
    END IF;

    BEGIN
        EXECUTE call;
    EXCEPTION
        WHEN OTHERS THEN
            IF want IS NULL OR SQLSTATE = _state OR SQLERRM ~* _errm THEN
                _score := ('OK', message, '{}')::dis.score;
            ELSE
                _score := (
                    'FAIL',
                    message,
                    ARRAY[
                        ('call: ' || call),
                        ('have: ' || SQLSTATE || '/' || SQLERRM || ' (SQLSTATE/SQLERRM)'),
                        ('want: ' || COALESCE(_state || ' (SQLSTATE)', _errm || ' (SQLERRM)', 'Any Error'))
                    ]
                );
            END IF;
            RETURN _score;
    END;

    _score := (
        'FAIL',
        message,
        ARRAY[
            ('call: ' || call),
            ('have: no error raised'),
            ('want: ' || COALESCE(_state || ' (SQLSTATE)', _errm || ' (SQLERRM)', 'Any Error'))
        ]
    )::dis.score;
    RETURN _score;
END;
$_$;

ALTER FUNCTION dis.raises(call text, want text, message text) OWNER TO postgres;

--
-- Name: FUNCTION raises(call text, want text, message text); Type: COMMENT; Schema: dis; Owner: postgres
--

COMMENT ON FUNCTION raises(call text, want text, message text) IS 'Test if "call" results in the error "want" (2012-04-11)';

--
-- PostgreSQL database dump complete
--


text:
import * as v1 from './v1';
import * as v1alpha from './v1alpha';
import * as v1alpha2 from './v1alpha2';
import * as v1beta from './v1beta';
import * as v1beta1 from './v1beta1';

const GkeHubClient = v1.GkeHubClient;
type GkeHubClient = v1.GkeHubClient;

export {v1, v1alpha, v1alpha2, v1beta, v1beta1, GkeHubClient};
export default {v1, v1alpha, v1alpha2, v1beta, v1beta1, GkeHubClient};
import * as protos from '../protos/protos';
export {protos};


text:
title: '**Fanny Howe, Richard Hoffman, Lloyd Schwartz, Ha Jin and the Terezín Music Foundation  Liberation**: New Works on Freedom from Internationally Renowned Poets'
published: false
start_at: 2015-11-17T00:00:00.000Z
ticketed: true
book_category: 'poetrymusic'
book_isbn:
  - '9780807000274'
---
In honor of the 70th anniversary this year of the liberation of the Nazi camps, the Terezin Music Foundation's director Mark Ludwig invited some of the world's top contemporary voices to write poems on the theme of freedom for the anthology Liberation. This event will feature contributors Fanny Howe, Richard Hoffman, Lloyd Schwartz, Ha Jin and a musical performance by the Terezín Music Foundation. **This event will take place at the Coolidge Corner Theatre.**Tickets are $5.00 each or free with the purchase of Liberation.


text:
package framework_manager_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"testing"
)

func TestFrameworkManager(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "FrameworkManager Suite")
}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>amp-bind: Performance</title>
  <link rel="canonical" href="amps.html">
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
  <link href="https://fonts.googleapis.com/css?family=Questrial" rel="stylesheet" type="text/css">


text:
/*****************************************************************************************

***		CMD5Checksum.h: interface for the CMD5Checksum class.

***		Developed by Langfine Ltd.
***		Released to the public domain 12/Nov/2001.
***		Please visit our website www.langfine.com

***		Any modifications must be clearly commented to distinguish them from Langfine's
***		original source code. Please advise Langfine of useful modifications so that we
***		can make them generally available.

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

#if !defined(AFX_CMD5Checksum_H__2BC7928E_4C15_11D3_B2EE_A4A60E20D2C3__INCLUDED_)
#define AFX_CMD5Checksum_H__2BC7928E_4C15_11D3_B2EE_A4A60E20D2C3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/****************************************************************************************
This software is derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.
Incorporation of this statement is a condition of use; please see the RSA
Data Security Inc copyright notice below:-

Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
rights reserved.

RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
documentation and/or software.

Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
documentation and/or software.
*****************************************************************************************/

/****************************************************************************************
This implementation of the RSA MD5 Algorithm was written by Langfine Ltd.

Langfine Ltd makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

In addition to the above, Langfine make no warrant or assurances regarding the
accuracy of this implementation of the MD5 checksum algorithm nor any assurances regarding
its suitability for any purposes.

This implementation may be used freely provided that Langfine is credited
in a copyright or similar notices (eg, RSA MD5 Algorithm implemented by Langfine
Ltd.) and provided that the RSA Data Security notices are complied with.

Langfine may be contacted at mail@langfine.com
*/

/*****************************************************************************************
CLASS:			CMD5Checksum
DESCRIPTION:	Implements the "RSA Data Security, Inc. MD5 Message-Digest Algorithm".
NOTES:			Calculates the RSA MD5 checksum for a file or congiguous array of data.

Below are extracts from a memo on The MD5 Message-Digest Algorithm by R. Rivest of MIT
Laboratory for Computer Science and RSA Data Security, Inc., April 1992.

   1. Executive Summary
   This document describes the MD5 message-digest algorithm. The
   algorithm takes as input a message of arbitrary length and produces
   as output a 128-bit "fingerprint" or "message digest" of the input.
   It is conjectured that it is computationally infeasible to produce
   two messages having the same message digest, or to produce any
   message having a given prespecified target message digest. The MD5
   algorithm is intended for digital signature applications, where a
   large file must be "compressed" in a secure manner before being
   encrypted with a private (secret) key under a public-key cryptosystem
   such as RSA.

   The MD5 algorithm is designed to be quite fast on 32-bit machines. In
   addition, the MD5 algorithm does not require any large substitution
   tables; the algorithm can be coded quite compactly.
   The MD5 algorithm is an extension of the MD4 message-digest algorithm
   1,2]. MD5 is slightly slower than MD4, but is more "conservative" in
   design. MD5 was designed because it was felt that MD4 was perhaps
   being adopted for use more quickly than justified by the existing
   critical review; because MD4 was designed to be exceptionally fast,
   it is "at the edge" in terms of risking successful cryptanalytic
   attack. MD5 backs off a bit, giving up a little in speed for a much
   greater likelihood of ultimate security. It incorporates some
   suggestions made by various reviewers, and contains additional
   optimizations. The MD5 algorithm is being placed in the public domain
   for review and possible adoption as a standard.

   2. Terminology and Notation
   In this document a "word" is a 32-bit quantity and a "byte" is an
   eight-bit quantity. A sequence of bits can be interpreted in a
   natural manner as a sequence of bytes, where each consecutive group
   of eight bits is interpreted as a byte with the high-order (most
   significant) bit of each byte listed first. Similarly, a sequence of
   bytes can be interpreted as a sequence of 32-bit words, where each
   consecutive group of four bytes is interpreted as a word with the
   low-order (least significant) byte given first.
   Let x_i denote "x sub i". If the subscript is an expression, we
   surround it in braces, as in x_{i+1}. Similarly, we use ^ for
   superscripts (exponentiation), so that x^i denotes x to the i-th   power.
   Let the symbol "+" denote addition of words (i.e., modulo-2^32
   addition). Let X <<< s denote the 32-bit value obtained by circularly
   shifting (rotating) X left by s bit positions. Let not(X) denote the
   bit-wise complement of X, and let X v Y denote the bit-wise OR of X
   and Y. Let X xor Y denote the bit-wise XOR of X and Y, and let XY
   denote the bit-wise AND of X and Y.

   3. MD5 Algorithm Description
   We begin by supposing that we have a b-bit message as input, and that
   we wish to find its message digest. Here b is an arbitrary
   nonnegative integer; b may be zero, it need not be a multiple of
   eight, and it may be arbitrarily large. We imagine the bits of the
   message written down as follows:          m_0 m_1 ... m_{b-1}
   The following five steps are performed to compute the message digest
   of the message.

   3.1 Step 1. Append Padding Bits
   The message is "padded" (extended) so that its length (in bits) is
   congruent to 448, modulo 512. That is, the message is extended so
   that it is just 64 bits shy of being a multiple of 512 bits long.
   Padding is always performed, even if the length of the message is
   already congruent to 448, modulo 512.
   Padding is performed as follows: a single "1" bit is appended to the
   message, and then "0" bits are appended so that the length in bits of
   the padded message becomes congruent to 448, modulo 512. In all, at
   least one bit and at most 512 bits are appended.

   3.2 Step 2. Append Length
   A 64-bit representation of b (the length of the message before the
   padding bits were added) is appended to the result of the previous
   step. In the unlikely event that b is greater than 2^64, then only
   the low-order 64 bits of b are used. (These bits are appended as two
   32-bit words and appended low-order word first in accordance with the
   previous conventions.)
   At this point the resulting message (after padding with bits and with
   b) has a length that is an exact multiple of 512 bits. Equivalently,
   this message has a length that is an exact multiple of 16 (32-bit)
   words. Let M[0 ... N-1] denote the words of the resulting message,
   where N is a multiple of 16.

   3.3 Step 3. Initialize MD Buffer
   A four-word buffer (A,B,C,D) is used to compute the message digest.
   Here each of A, B, C, D is a 32-bit register. These registers are
   initialized to the following values in hexadecimal, low-order bytes   first):
          word A: 01 23 45 67          word B: 89 ab cd ef
          word C: fe dc ba 98          word D: 76 54 32 10

   3.4 Step 4. Process Message in 16-Word Blocks
   We first define four auxiliary functions that each take as input
   three 32-bit words and produce as output one 32-bit word.
          F(X,Y,Z) = XY v not(X) Z          G(X,Y,Z) = XZ v Y not(Z)
          H(X,Y,Z) = X xor Y xor Z          I(X,Y,Z) = Y xor (X v not(Z))
   In each bit position F acts as a conditional: if X then Y else Z.
   The function F could have been defined using + instead of v since XY
   and not(X)Z will never have 1's in the same bit position.) It is
   interesting to note that if the bits of X, Y, and Z are independent
   and unbiased, the each bit of F(X,Y,Z) will be independent and   unbiased.
   The functions G, H, and I are similar to the function F, in that they
   act in "bitwise parallel" to produce their output from the bits of X,
   Y, and Z, in such a manner that if the corresponding bits of X, Y,
   and Z are independent and unbiased, then each bit of G(X,Y,Z),
   H(X,Y,Z), and I(X,Y,Z) will be independent and unbiased. Note that
   the function H is the bit-wise "xor" or "parity" function of its   inputs.
   This step uses a 64-element table T[1 ... 64] constructed from the
   sine function. Let T[i] denote the i-th element of the table, which
   is equal to the integer part of 4294967296 times abs(sin(i)), where i
   is in radians. The elements of the table are given in the appendix.
   Do the following:

	 //Process each 16-word block.
     For i = 0 to N/16-1 do     // Copy block i into X.
		For j = 0 to 15 do
			Set X[j] to M[i*16+j].
        end //of loop on j

		 // Save A as AA, B as BB, C as CC, and D as DD.
		 AA = A     BB = B
		 CC = C     DD = D

		 // Round 1.
		 // Let [abcd k s i] denote the operation
		 // a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s).
		 // Do the following 16 operations.
		 [ABCD  0  7  1]  [DABC  1 12  2]  [CDAB  2 17  3]  [BCDA  3 22  4]
		 [ABCD  4  7  5]  [DABC  5 12  6]  [CDAB  6 17  7]  [BCDA  7 22  8]
		 [ABCD  8  7  9]  [DABC  9 12 10]  [CDAB 10 17 11]  [BCDA 11 22 12]
		 [ABCD 12  7 13]  [DABC 13 12 14]  [CDAB 14 17 15]  [BCDA 15 22 16]

		 // Round 2.
		 // Let [abcd k s i] denote the operation
		 // a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s).
		 // Do the following 16 operations.
		 [ABCD  1  5 17]  [DABC  6  9 18]  [CDAB 11 14 19]  [BCDA  0 20 20]
		 [ABCD  5  5 21]  [DABC 10  9 22]  [CDAB 15 14 23]  [BCDA  4 20 24]
		 [ABCD  9  5 25]  [DABC 14  9 26]  [CDAB  3 14 27]  [BCDA  8 20 28]
		 [ABCD 13  5 29]  [DABC  2  9 30]  [CDAB  7 14 31]  [BCDA 12 20 32]

		 // Round 3.
		 // Let [abcd k s t] denote the operation
		 // a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s).
		 // Do the following 16 operations.
		 [ABCD  5  4 33]  [DABC  8 11 34]  [CDAB 11 16 35]  [BCDA 14 23 36]
		 [ABCD  1  4 37]  [DABC  4 11 38]  [CDAB  7 16 39]  [BCDA 10 23 40]
		 [ABCD 13  4 41]  [DABC  0 11 42]  [CDAB  3 16 43]  [BCDA  6 23 44]
		 [ABCD  9  4 45]  [DABC 12 11 46]  [CDAB 15 16 47]  [BCDA  2 23 48]

		 // Round 4.
		 // Let [abcd k s t] denote the operation
		 // a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s).
		 // Do the following 16 operations.
		 [ABCD  0  6 49]  [DABC  7 10 50]  [CDAB 14 15 51]  [BCDA  5 21 52]
		 [ABCD 12  6 53]  [DABC  3 10 54]  [CDAB 10 15 55]  [BCDA  1 21 56]
		 [ABCD  8  6 57]  [DABC 15 10 58]  [CDAB  6 15 59]  [BCDA 13 21 60]
		 [ABCD  4  6 61]  [DABC 11 10 62]  [CDAB  2 15 63]  [BCDA  9 21 64]

		 // Then perform the following additions. (That is increment each
		 //   of the four registers by the value it had before this block
		 //   was started.)
		A = A + AA     B = B + BB     C = C + CC  D = D + DD

	end // of loop on i

   3.5 Step 5. Output
   The message digest produced as output is A, B, C, D. That is, we
   begin with the low-order byte of A, and end with the high-order byte of D.
   This completes the description of MD5.

   Summary
   The MD5 message-digest algorithm is simple to implement, and provides
   a "fingerprint" or message digest of a message of arbitrary length.
   It is conjectured that the difficulty of coming up with two messages
   having the same message digest is on the order of 2^64 operations,
   and that the difficulty of coming up with any message having a given
   message digest is on the order of 2^128 operations. The MD5 algorithm
   has been carefully scrutinized for weaknesses. It is, however, a
   relatively new algorithm and further security analysis is of course
   justified, as is the case with any new proposal of this sort.

   5. Differences Between MD4 and MD5
   The following are the differences between MD4 and MD5:
       1.   A fourth round has been added.
       2.   Each step now has a unique additive constant.
       3.   The function g in round 2 was changed from (XY v XZ v YZ) to
       (XZ v Y not(Z)) to make g less symmetric.
       4.   Each step now adds in the result of the previous step.  This
       promotes a faster "avalanche effect".
       5.   The order in which input words are accessed in rounds 2 and
       3 is changed, to make these patterns less like each other.
       6.   The shift amounts in each round have been approximately
       optimized, to yield a faster "avalanche effect." The shifts in
       different rounds are distinct.

   References
   [1] Rivest, R., "The MD4 Message Digest Algorithm", RFC 1320, MIT and
       RSA Data Security, Inc., April 1992.
   [2] Rivest, R., "The MD4 message digest algorithm", in A.J.  Menezes
       and S.A. Vanstone, editors, Advances in Cryptology - CRYPTO '90
       Proceedings, pages 303-311, Springer-Verlag, 1991.
   [3] CCITT Recommendation X.509 (1988), "The Directory -
       Authentication Framework."APPENDIX A - Reference Implementation

   The level of security discussed in this memo is considered to be
   sufficient for implementing very high security hybrid digital-
   signature schemes based on MD5 and a public-key cryptosystem.
   Author's Address
   Ronald L. Rivest   Massachusetts Institute of Technology
   Laboratory for Computer Science   NE43-324   545 Technology Square
   Cambridge, MA  02139-1986   Phone: (617) 253-5880
   EMail: rivest@theory.lcs.mit.edu

*****************************************************************************************/
class CMD5Checksum
{
public:
	//interface functions for the RSA MD5 calculation
	//static CString GetMD5(BYTE* pBuf, UINT nLength);
	//static CString GetMD5(CFile& File);
	//static CString GetMD5(const CString& strFilePath);
	//--> by xushiweizh@gmail.com: require MFC, so I don't need.
	// I change interface as follow:
	friend STDMETHODIMP_(void) GetCMD5Checksum(
		IN const BYTE* pBuf, IN UINT nLength, OUT BYTE nChecksum[16]);

//protected:
//--> by xushiweizh@gmail.com: I public constructor and Update, Final method.
public:
	//constructor/destructor
	CMD5Checksum();
	//--> by xushiweizh@gmail.com: don't derive from me!
	//virtual ~CMD5Checksum() {};

	void Update(const BYTE* Input, size_t nInputLen);
	//BYTE* Final();
	//--> by xushiweizh@gmail.com: I change interface as follow:
	void Final(OUT BYTE nChecksum[16]);

protected:
	//RSA MD5 implementation
	void Transform(const BYTE Block[64]);
	inline DWORD RotateLeft(DWORD x, int n);
	inline void FF( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
	inline void GG( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
	inline void HH( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
	inline void II( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);

	//utility functions
	inline void DWordToByte(BYTE* Output, const DWORD* Input, UINT nLength);
	inline void ByteToDWord(DWORD* Output, const BYTE* Input, UINT nLength);

private:
	BYTE  m_lpszBuffer[64];		//input buffer
	DWORD m_nCount[2];			//number of bits, modulo 2^64 (lsb first)
	DWORD m_lMD5[4];			//MD5 checksum
};

#endif // !defined(AFX_CMD5Checksum_H__2BC7928E_4C15_11D3_B2EE_A4A60E20D2C3__INCLUDED_)


text:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Naspinski.Utilities.Tests
{
    [TestClass]
    public class UrlTest
    {
        [TestMethod]
        public void BasicTest()
        {
            var url = Url.Combine("http://naspinski.net/", "directory/", "////image.png");
            var url2 = new Uri("http://naspinski.net/directory/image.png");
            Assert.AreEqual(url, url2);

            url = Url.Combine("http://naspinski.net/", "directory/image.png");
            Assert.AreEqual(url, url2);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void NoArgs()
        {
            var url = Url.Combine();
        }

        [TestMethod]
        [ExpectedException(typeof(UriFormatException))]
        public void BadUri()
        {
            var url = Url.Combine("not a uri");
        }

        [TestMethod]
        [ExpectedException(typeof(UriFormatException))]
        public void BadUri2()
        {
            var url = Url.Combine("not_a_uri", "something_else");
        }
    }
}


text:
package de.plushnikov.intellij.plugin.psi;

import com.intellij.lang.ASTNode;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiClassType;
import com.intellij.psi.PsiCodeBlock;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementFactory;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiIdentifier;
import com.intellij.psi.PsiManager;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiModifier;
import com.intellij.psi.PsiParameter;
import com.intellij.psi.PsiReferenceList;
import com.intellij.psi.PsiType;
import com.intellij.psi.PsiTypeParameter;
import com.intellij.psi.impl.CheckUtil;
import com.intellij.psi.impl.light.LightMethodBuilder;
import com.intellij.psi.impl.light.LightModifierList;
import com.intellij.psi.impl.light.LightTypeParameterListBuilder;
import com.intellij.util.IncorrectOperationException;
import de.plushnikov.intellij.plugin.icon.LombokIcons;
import de.plushnikov.intellij.plugin.util.ReflectionUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author Plushnikov Michail
 */
public class LombokLightMethodBuilder extends LightMethodBuilder {
  private PsiMethod myMethod;
  private ASTNode myASTNode;
  private PsiCodeBlock myBodyCodeBlock;

  public LombokLightMethodBuilder(@NotNull PsiManager manager, @NotNull String name) {
    super(manager, JavaLanguage.INSTANCE, name,
      new LombokLightParameterListBuilder(manager, JavaLanguage.INSTANCE),
      new LombokLightModifierList(manager, JavaLanguage.INSTANCE),
      new LombokLightReferenceListBuilder(manager, JavaLanguage.INSTANCE, PsiReferenceList.Role.THROWS_LIST),
      new LightTypeParameterListBuilder(manager, JavaLanguage.INSTANCE));
    setBaseIcon(LombokIcons.METHOD_ICON);
  }

  public LombokLightMethodBuilder withNavigationElement(PsiElement navigationElement) {
    setNavigationElement(navigationElement);
    return this;
  }

  public LombokLightMethodBuilder withModifier(@PsiModifier.ModifierConstant @NotNull @NonNls String modifier) {
    addModifier(modifier);
    return this;
  }

  public LombokLightMethodBuilder withModifier(@PsiModifier.ModifierConstant @NotNull @NonNls String... modifiers) {
    for (String modifier : modifiers) {
      addModifier(modifier);
    }
    return this;
  }

  public LombokLightMethodBuilder withMethodReturnType(PsiType returnType) {
    setMethodReturnType(returnType);
    return this;
  }

  public LombokLightMethodBuilder withParameter(@NotNull String name, @NotNull PsiType type) {
    return withParameter(new LombokLightParameter(name, type, this, JavaLanguage.INSTANCE));
  }

  public LombokLightMethodBuilder withParameter(@NotNull PsiParameter psiParameter) {
    addParameter(psiParameter);
    return this;
  }

  public LombokLightMethodBuilder withException(@NotNull PsiClassType type) {
    addException(type);
    return this;
  }

  public LombokLightMethodBuilder withException(@NotNull String fqName) {
    addException(fqName);
    return this;
  }

  public LombokLightMethodBuilder withContainingClass(@NotNull PsiClass containingClass) {
    setContainingClass(containingClass);
    return this;
  }

  public LombokLightMethodBuilder withTypeParameter(@NotNull PsiTypeParameter typeParameter) {
    addTypeParameter(typeParameter);
    return this;
  }

  public LombokLightMethodBuilder withConstructor(boolean isConstructor) {
    setConstructor(isConstructor);
    return this;
  }

  public LombokLightMethodBuilder withBody(@NotNull PsiCodeBlock codeBlock) {
    myBodyCodeBlock = codeBlock;
    return this;
  }

  // add Parameter as is, without wrapping with LightTypeParameter
  public LightMethodBuilder addTypeParameter(PsiTypeParameter parameter) {
    ((LightTypeParameterListBuilder) getTypeParameterList()).addParameter(parameter);
    return this;
  }

  @Override
  public PsiCodeBlock getBody() {
    return myBodyCodeBlock;
  }

  @Override
  public PsiIdentifier getNameIdentifier() {
    return new LombokLightIdentifier(myManager, getName());
  }

  @Override
  public PsiElement getParent() {
    PsiElement result = super.getParent();
    result = null != result ? result : getContainingClass();
    return result;
  }

  @Nullable
  @Override
  public PsiFile getContainingFile() {
    PsiClass containingClass = getContainingClass();
    return containingClass != null ? containingClass.getContainingFile() : null;
  }

  @Override
  public String getText() {
    ASTNode node = getNode();
    if (null != node) {
      return node.getText();
    }
    return "";
  }

  @Override
  public ASTNode getNode() {
    if (null == myASTNode) {
      myASTNode = getOrCreateMyPsiMethod().getNode();
    }
    return myASTNode;
  }

  @Override
  public TextRange getTextRange() {
    TextRange r = super.getTextRange();
    return r == null ? TextRange.EMPTY_RANGE : r;
  }

  private String getAllModifierProperties(LightModifierList modifierList) {
    final StringBuilder builder = new StringBuilder();
    for (String modifier : modifierList.getModifiers()) {
      if (!PsiModifier.PACKAGE_LOCAL.equals(modifier)) {
        builder.append(modifier).append(' ');
      }
    }
    return builder.toString();
  }

  private PsiMethod rebuildMethodFromString() {
    final StringBuilder methodTextDeclaration = new StringBuilder();
    methodTextDeclaration.append(getAllModifierProperties((LightModifierList) getModifierList()));
    PsiType returnType = getReturnType();
    if (null != returnType) {
      methodTextDeclaration.append(returnType.getCanonicalText()).append(' ');
    }
    methodTextDeclaration.append(getName());
    methodTextDeclaration.append('(');
    if (getParameterList().getParametersCount() > 0) {
      for (PsiParameter parameter : getParameterList().getParameters()) {
        methodTextDeclaration.append(parameter.getType().getCanonicalText()).append(' ').append(parameter.getName()).append(',');
      }
      methodTextDeclaration.deleteCharAt(methodTextDeclaration.length() - 1);
    }
    methodTextDeclaration.append(')');
    methodTextDeclaration.append('{').append("  ").append('}');

    final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(getManager().getProject());

    final PsiMethod methodFromText = elementFactory.createMethodFromText(methodTextDeclaration.toString(), getContainingClass());
    if (null != getBody()) {
      methodFromText.getBody().replace(getBody());
    }
    return methodFromText;
  }

  public PsiElement copy() {
    return getOrCreateMyPsiMethod().copy();
  }

  private PsiElement getOrCreateMyPsiMethod() {
    if (null == myMethod) {
      myMethod = rebuildMethodFromString();
    }
    return myMethod;
  }

  @NotNull
  @Override
  public PsiElement[] getChildren() {
    return getOrCreateMyPsiMethod().getChildren();
  }

  public String toString() {
    return "LombokLightMethodBuilder: " + getName();
  }

  @Override
  public PsiElement replace(@NotNull PsiElement newElement) throws IncorrectOperationException {
    // just add new element to the containing class
    final PsiClass containingClass = getContainingClass();
    if (null != containingClass) {
      CheckUtil.checkWritable(containingClass);
      return containingClass.add(newElement);
    }
    return null;
  }

  @Override
  public PsiElement setName(@NotNull String name) throws IncorrectOperationException {
    ReflectionUtil.setFinalFieldPerReflection(LightMethodBuilder.class, this, String.class, name);
    return this;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    LombokLightMethodBuilder that = (LombokLightMethodBuilder) o;

    if (!getName().equals(that.getName())) {
      return false;
    }
    if (isConstructor() != that.isConstructor()) {
      return false;
    }
    final PsiClass containingClass = getContainingClass();
    final PsiClass thatContainingClass = that.getContainingClass();
    if (containingClass != null ? !containingClass.equals(thatContainingClass) : thatContainingClass != null) {
      return false;
    }
    if (!getModifierList().equals(that.getModifierList())) {
      return false;
    }
    if (!getParameterList().equals(that.getParameterList())) {
      return false;
    }
    final PsiType returnType = getReturnType();
    final PsiType thatReturnType = that.getReturnType();
    if (returnType != null ? !returnType.equals(thatReturnType) : thatReturnType != null) {
      return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    // should be constant because of RenameJavaMethodProcessor#renameElement and fixNameCollisionsWithInnerClassMethod(...)
    return 1;
  }

  @Override
  public void delete() throws IncorrectOperationException {
    // simple do nothing
  }

  @Override
  public void checkDelete() throws IncorrectOperationException {
    // simple do nothing
  }
}


text:
/**
 * The Generator object is returned by a generator function
 * and it conforms to both the iterable protocol and the iterator protocol.
 *
 * ```
 * function* gen() {
 *   yield 1;
 *   yield 2;
 *   yield 3;
 * }
 *
 *  var g = gen(); // "Generator { }"
 * ```
 */


text:
#ifndef CPPNOTESMAIN_FIND_DUPLICATE_SUBTREES_HPP
#define CPPNOTESMAIN_FIND_DUPLICATE_SUBTREES_HPP

/*
https://leetcode.com/problems/find-duplicate-subtrees/
Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only
need to return the root node of any one of them.

Two trees are duplicate if they have the same structure with same node values.

Example 1:

        1
       / \
      2   3
     /   / \
    4   2   4
       /
      4

The following are two duplicate subtrees:

      2
     /
    4

and

    4

Therefore, you need to return above trees' root in the form of a list.
*/

#include <set>
#include <unordered_map>
#include "types/ds/binary_tree_nodes.hpp"

namespace Algo::DS::BT {
    class FindDuplicateSubtrees {
        using Node = Types::DS::NodeBT<int>;
        std::unordered_map<std::string, std::pair<Node*, size_t>> m_nodes_map;

        std::string traverse(Types::DS::NodeBT<int>* head) {
            if (head == nullptr) { return "#"; }

            const auto left_pattern = traverse(head->left);
            const auto right_pattern = traverse(head->right);
            const auto node_pattern = std::to_string(head->value);

            const auto pattern = left_pattern + "-" + right_pattern + "-" + node_pattern;
            const auto iter = m_nodes_map.find(pattern);
            if (iter == m_nodes_map.end()) {
                m_nodes_map[pattern] = {head, 1};
            }
            else {
                m_nodes_map[pattern].second += 1;
            }

            return pattern;
        }

    public:
        std::vector<Types::DS::NodeBT<int>*> find(Types::DS::NodeBT<int>* head) {
            traverse(head);

            std::vector<Types::DS::NodeBT<int>*> result;
            for (const auto& [_, pair] : m_nodes_map) {
                if (pair.second > 1) {
                    result.push_back(pair.first);
                }
            }

            return result;
        }
    };
}

#endif //CPPNOTESMAIN_FIND_DUPLICATE_SUBTREES_HPP


text:
class AddConnentsCountToJob < ActiveRecord::Migration
  def change
    add_column :jobs, :comments_count, :integer, :default=>0
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="?android:attr/activatedBackgroundIndicator">
    <TextView
        android:id="@+id/filename_item"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="20sp"/>
</RelativeLayout>


text:
#import <Social/SLFacebookRequest.h>

@class SLFacebookRegistrationInfo;

@interface SLFacebookRegistrationRequest : SLFacebookRequest
{
    SLFacebookRegistrationInfo *_registrationInfo;
}

- (void).cxx_destruct;
- (id)_urlEncodedString:(id)arg1;
- (id)_tokenSecret;
- (void)performRequestWithHandler:(id)arg1;
- (id)_sha1HashForString:(id)arg1;
- (void)_prepareRequestForValidation;
- (id)initWithRegistrationInfo:(id)arg1;

@end


text:
Certain older versions of the ixgbevf prior to 2.14.2 can cause network communication issues, including packet loss, link flapping, and gray failures.

## Detecting with EC2 Rescue for Linux

EC2 Rescue for Linux includes a diagnostic module which will check the ixgbevf.  This is provided by the 'ixgbevfversion' diagnostic module.  This module will run by default, and can be run individually.

```commandline
$ sudo ./ec2rl run --only-modules=ixgbevfversion
```

Passing output:

```commandline
----------[Diagnostic Results]----------
module run/ixgbevfversion             [SUCCESS] You are running the recommended ixgbevf driver or newer.
```

Warning output:

```commandline
----------[Diagnostic Results]----------
module run/ixgbevfversion       [WARN] You are running $VERSION which is older than $GOODVER.
```

**Note**: Intel updates the in-kernel tree driver with many of their bugfixes but does not bump the version. Not all bugfixes and changes make it into the in-kernel tree driver. This is why this defaults to warning, as it is not within the scope of this module to determine what exact fixes are present in the driver you are running.

## Detecting Manually

This can also be detected manually via grepping the output of ethtool as follows

```commandline
$ ethtool -i eth0 | grep version
```

## Resolution

You will need to upgrade the ixgbevf driver. Documentation for this is available at <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sriov-networking.html>


text:
SQLNado (SQLite Not ADO) is a .NET lightweight bloat free object persistence framework based on SQLite.

SQLNado supports all of SQLite features when using SQL commands, and also supports most of SQLite features through .NET:

* Automatic class-to-table mapping (Save, Delete, Load, LoadAll, LoadByPrimaryKey, LoadByForeignKey, etc.)
* Automatic synchronization of schema (tables, columns) between classes and existing table
* Designed for thread-safe operations
* Where and OrderBy LINQ/IQueryable .NET expressions are supported (work is still in progress in this area), also with collation support
* SQLite database schema (tables, columns, etc.) exposed to .NET
* SQLite custom functions can be written in .NET
* SQLite incremental BLOB I/O is exposed as a .NET Stream to avoid high memory consumption
* SQLite  collation support, including the possibility to add custom collations using .NET code
* SQLite Full Text Search engine (FTS3/4) support, including the possibility to add custom FTS3 tokenizers using .NET code
* Automatic support for Windows 'winsqlite3.dll' to avoid shipping any binary file.

## Requirements
The only requirement is netstandard 2.0 or .NET Framework 4.6, so it works fine with .NET Core and .NET 5 too. It's 100% dependency free! Well, of course it requires an SQLite native dlls corresponding to the bitness (x86 vs x64) of the executing app. Note that it's only been validated on the Windows 32 and 64-bit platforms.

## Installation
If you're running on a recent Windows 10 or Windows Server 2016, there is a good chance that there's already a winsqlite3.dll present in \Windows\System32. If this is the case, you won't need to install any native dll, whatever the bitness (x86 vs x64) of your app is!
Note this is true on Azure Web Apps, you don't need to add anything to be able to work with SQLite if you use SQLNado.

Otherwise, you can use the sqlite dll files from https://www.sqlite.org/download.html. We recommend to rename the original sqlite.dll for 32 *and* 64-bit to sqlite.x86.dll and sqlite.x64.dll respectively.
Or you can get them from here already renamed: https://github.com/smourier/SQLNado/tree/master/SqlNado.
Once you have these files, you can copy them aside your running executable (or *bin* directory for a web site).

SQLNado source code expects that and this way your program will be able to run as 32-bit or as 64-bit without having to change the native sqlite.dll. You won't have to build two setups either.

If you don't like all this and want to keep the original SQLite dll untouched, you can just copy the corresponding standard sqlite.dll aside your running executable also, but make sure you use the proper 32 or 64-bit version.

## Amalgamation
Although SQLNado can be used as a Nuget, we also provide it as a single, 100% independent, C# file located here https://github.com/smourier/SQLNado/tree/master/Amalgamation

The amalgamation contains everything an application needs to embed SQLNado. Combining all the code for SQLNado into one big file makes it easier to deploy — there is just one file to keep track of (yeah, I borrowed that phrase from SQLite's site https://www.sqlite.org/amalgamation.html page because it's cool)

## Nuget
Due to popular request, SQLNado is now also provided as a Nuget. You can download here from https://www.nuget.org/packages/SqlNado/

## Get Started
Here is a simple Console App that should get you started:

```csharp
// this will create the my.db file if it does not exists
using (var db = new SQLiteDatabase("my.db"))
{
    var customer = new Customer();
    customer.Email = "killroy@example.com";
    customer.Name = "Killroy";

    // updates or Insert (choice is made if there is already a primary key on the object).
    // by default, the Save operation synchronize the table schema.
    // if this is run for the first time, it will create the table using Customer type definition (properties).
    db.Save(customer);

    // dumps the customer list to the console
    db.LoadAll<Customer>().ToTableString(Console.Out);

    // dumps the sql query result to the console (should be the same as previous)
    db.LoadRows("SELECT * FROM Customer").ToTableString(Console.Out);

    // dumps the Customer table schema to the console
    TableStringExtensions.ToTableString(db.GetTable<Customer>(), Console.Out);

    // dumps the Customer table columns definitions to the console
    db.GetTable<Customer>().Columns.ToTableString(Console.Out);
}

public class Customer
{
    [SQLiteColumn(IsPrimaryKey = true)]
    public string Email { get; set; }
    public string Name { get; set; }
}
```
When you run it, you should see this on the console.
![Console Output](/Doc/Images/TableString1.png?raw=true)

These nice table outputs are created automatically by the [TableString](/SqlNado/Utilities/TableString.cs) utility that's part of SQLNado (but the file can be copied in any other C# project as it's self-sufficient).

`TableString` computes tables from any `IEnumerable` instance. It works also for any object, like the Customer table schema example, but for object that are not IEnumerable there's not extension method, you have to use TableString or TableStringExtensions). What's cool is it computes columns widths so can fit within the console bounds. When working with tables from a database, it's *very* useful.

## FTS custom tokenizer support
SQLNado offers the possibility to use a custom FTS3 tokenizer to SQLite FTS engine. This allows you to code a stop word tokenizer for example. Here is a sample code:

```csharp
using (var db = new SQLiteDatabase(":memory:"))
{
    // we must enable custom tokenizers
    db.Configure(SQLiteDatabaseConfiguration.SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1);
    var tok = new StopWordTokenizer(db);
    db.SetTokenizer(tok);

    // insert data as in SQLite exemple
    db.Save(new Mail { docid = 1, Subject = "software feedback", Body = "found it too slow" });
    db.Save(new Mail { docid = 2, Subject = "software feedback", Body = "no feedback" });
    db.Save(new Mail { docid = 3, Subject = "slow lunch order", Body = "was a software problem" });

    // check result
    db.LoadAll<Mail>().ToTableString(Console.Out);

    // this shall report the same as in SQLite example
    db.Load<Mail>("WHERE Subject MATCH 'software'").ToTableString(Console.Out);
    db.Load<Mail>("WHERE body MATCH 'feedback'").ToTableString(Console.Out);
    db.Load<Mail>("WHERE mail MATCH 'software'").ToTableString(Console.Out);
    db.Load<Mail>("WHERE mail MATCH 'slow'").ToTableString(Console.Out);

    // this should display nothing as 'no' is a stop word
    db.Load<Mail>("WHERE mail MATCH 'no'").ToTableString(Console.Out);
}

[SQLiteTable(Module = "fts3", ModuleArguments = nameof(Subject) + ", " + nameof(Body) + ", tokenize=" + StopWordTokenizer.TokenizerName)]
public class Mail
{
    public long docid { get; set; }
    public string Subject { get; set; }
    public string Body { get; set; }

    public override string ToString() => Subject + ":" + Body;
}

public class StopWordTokenizer : SQLiteTokenizer
{
    public const string TokenizerName = "unicode_stopwords";

    private static readonly HashSet<string> _words;
    private readonly SQLiteTokenizer _unicode;
    private int _disposed;

    static StopWordTokenizer()
    {
        // define some stop words here
        _words = new HashSet<string> {
            "a",
            "it",
            "no",
            "too",
            "was",
            };
    }

    public StopWordTokenizer(SQLiteDatabase database, params string[] arguments)
        : base(database, TokenizerName)
    {
        // we reuse SQLite's unicode61 tokenize
        _unicode = database.GetUnicodeTokenizer(arguments);
    }

    public override IEnumerable<SQLiteToken> Tokenize(string input)
    {
        foreach (var token in _unicode.Tokenize(input))
        {
            if (!_words.Contains(token.Text))
                yield return token;
        }
    }

    // we need this because SQLite's unicode61 tokenizer aggregates unmanaged resources
    protected override void Dispose(bool disposing)
    {
        var disposed = Interlocked.Exchange(ref _disposed, 1);
        if (disposed != 0)
            return;

        if (disposing)
        {
            _unicode.Dispose();
        }

        base.Dispose(disposing);
    }
}
```
When you run it, you should see this on the console.
![Console Output](/Doc/Images/Fts.png?raw=true)


text:
package com.coolweather.app.service;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.IBinder;
import android.os.SystemClock;
import android.preference.PreferenceManager;

import com.coolweather.app.receiver.AutoUpdateReceiver;
import com.coolweather.app.util.HttpCallbackListener;
import com.coolweather.app.util.HttpUtil;
import com.coolweather.app.util.Utility;

/**
 * Created by lab on 15-8-6.
 */
public class AutoUpdateService extends Service {
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                updateWeather();
            }
        }).start();
        AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
        int eightHours = 8 * 60 * 60 * 1000;
        long triggerAtTime = SystemClock.elapsedRealtime() + eightHours;
        Intent receiverIntent = new Intent(this,AutoUpdateReceiver.class);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(this,0,receiverIntent,0);
        alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,triggerAtTime,pendingIntent);
        return super.onStartCommand(intent, flags, startId);
    }

    //更新天气信息
    private void updateWeather(){
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
        String weatherCode = preferences.getString("weather_code", "");
        String address = "http://www.weather.com.cn/data/cityinfo/" +
                weatherCode + ".html";
        HttpUtil.sendHttpRequest(address, new HttpCallbackListener() {
            @Override
            public void onFinish(String response) {
                Utility.handlerWeatherResponse(AutoUpdateService.this,response);
            }

            @Override
            public void onError(Exception e) {
                e.printStackTrace();
            }
        });
    }
}


text:
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include "unity.h"
#include "rom/ets_sys.h"
#include "rom/uart.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "esp_clk.h"
#include "soc/cpu.h"
#include "esp_heap_caps.h"
#include "test_utils.h"

#ifdef CONFIG_HEAP_TRACING
#include "esp_heap_trace.h"
#endif

#define unity_printf ets_printf

// Pointers to the head and tail of linked list of test description structs:
static struct test_desc_t* s_unity_tests_first = NULL;
static struct test_desc_t* s_unity_tests_last = NULL;

// Inverse of the filter
static bool s_invert = false;

static size_t before_free_8bit;
static size_t before_free_32bit;

/* Each unit test is allowed to "leak" this many bytes.

   TODO: Make this value editable by the test.

   Will always need to be some value here, as fragmentation can reduce free space even when no leak is occuring.
*/
const size_t WARN_LEAK_THRESHOLD = 256;
const size_t CRITICAL_LEAK_THRESHOLD = 4096;

/* setUp runs before every test */
void setUp(void)
{
// If heap tracing is enabled in kconfig, leak trace the test
#ifdef CONFIG_HEAP_TRACING
    const size_t num_heap_records = 80;
    static heap_trace_record_t *record_buffer;
    if (!record_buffer) {
        record_buffer = malloc(sizeof(heap_trace_record_t) * num_heap_records);
        assert(record_buffer);
        heap_trace_init_standalone(record_buffer, num_heap_records);
    }
#endif

    printf("%s", ""); /* sneakily lazy-allocate the reent structure for this test task */
    get_test_data_partition();  /* allocate persistent partition table structures */

    before_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT);
    before_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT);

#ifdef CONFIG_HEAP_TRACING
    heap_trace_start(HEAP_TRACE_LEAKS);
#endif
}

static void check_leak(size_t before_free, size_t after_free, const char *type)
{
    if (before_free <= after_free) {
        return;
    }
    size_t leaked = before_free - after_free;
    if (leaked < WARN_LEAK_THRESHOLD) {
        return;
    }

    printf("MALLOC_CAP_%s %s leak: Before %u bytes free, After %u bytes free (delta %u)\n",
           type,
           leaked < CRITICAL_LEAK_THRESHOLD ? "potential" : "critical",
           before_free, after_free, leaked);
    fflush(stdout);
    TEST_ASSERT_MESSAGE(leaked < CRITICAL_LEAK_THRESHOLD, "The test leaked too much memory");
}

/* tearDown runs after every test */
void tearDown(void)
{
    /* some FreeRTOS stuff is cleaned up by idle task */
    vTaskDelay(5);

    /* We want the teardown to have this file in the printout if TEST_ASSERT fails */
    const char *real_testfile = Unity.TestFile;
    Unity.TestFile = __FILE__;

    /* check if unit test has caused heap corruption in any heap */
    TEST_ASSERT_MESSAGE( heap_caps_check_integrity(MALLOC_CAP_INVALID, true), "The test has corrupted the heap");

    /* check for leaks */
#ifdef CONFIG_HEAP_TRACING
    heap_trace_stop();
    heap_trace_dump();
#endif
    size_t after_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT);
    size_t after_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT);

    check_leak(before_free_8bit, after_free_8bit, "8BIT");
    check_leak(before_free_32bit, after_free_32bit, "32BIT");

    Unity.TestFile = real_testfile; // go back to the real filename
}

void unity_putc(int c)
{
    if (c == '\n')
    {
        uart_tx_one_char('\r');
        uart_tx_one_char('\n');
    }
    else if (c == '\r')
    {
    }
    else
    {
        uart_tx_one_char(c);
    }
}

void unity_flush()
{
    uart_tx_wait_idle(0);   // assume that output goes to UART0
}

void unity_testcase_register(struct test_desc_t* desc)
{
    if (!s_unity_tests_first)
    {
        s_unity_tests_first = desc;
        s_unity_tests_last = desc;
    }
    else
    {
        struct test_desc_t* temp = s_unity_tests_first;
        s_unity_tests_first = desc;
        s_unity_tests_first->next = temp;
    }
}

static void unity_run_single_test(const struct test_desc_t* test)
{
    printf("Running %s...\n", test->name);
    Unity.TestFile = test->file;
    Unity.CurrentDetail1 = test->desc;
    UnityDefaultTestRun(test->fn, test->name, test->line);
}

static void unity_run_single_test_by_index(int index)
{
    const struct test_desc_t* test;
    for (test = s_unity_tests_first; test != NULL && index != 0; test = test->next, --index)
    {
    }
    if (test != NULL)
    {
        unity_run_single_test(test);
    }
}

static void unity_run_single_test_by_index_parse(const char* filter, int index_max)
{
    if (s_invert)
    {
        printf("Inverse is not supported for that kind of filter\n");
        return;
    }
    int test_index = strtol(filter, NULL, 10);
    if (test_index >= 1 && test_index <= index_max)
    {
        uint32_t start;
        RSR(CCOUNT, start);
        unity_run_single_test_by_index(test_index - 1);
        uint32_t end;
        RSR(CCOUNT, end);
        uint32_t ms = (end - start) / (esp_clk_cpu_freq() / 1000);
        printf("Test ran in %dms\n", ms);
    }
}

static void unity_run_single_test_by_name(const char* filter)
{
    if (s_invert)
    {
        printf("Inverse is not supported for that kind of filter\n");
        return;
    }
    char tmp[256];
    strncpy(tmp, filter + 1, sizeof(tmp) - 1);
    tmp[strlen(filter) - 2] = 0;
    for (const struct test_desc_t* test = s_unity_tests_first; test != NULL; test = test->next)
    {
        if (strcmp(test->name, tmp) == 0)
        {
            unity_run_single_test(test);
        }
    }
}

void unity_run_all_tests()
{
    if (s_invert)
    {
        printf("Inverse is not supported for that kind of filter\n");
        return;
    }
    for (const struct test_desc_t* test = s_unity_tests_first; test != NULL; test = test->next)
    {
        unity_run_single_test(test);
    }
}

void unity_run_tests_with_filter(const char* filter)
{
    if (s_invert)
    {
        ++filter;
    }
    printf("Running tests %smatching '%s'...\n", s_invert ? "NOT " : "", filter);

    for (const struct test_desc_t* test = s_unity_tests_first; test != NULL; test = test->next)
    {
        if ((strstr(test->desc, filter) != NULL) == !s_invert)
        {
            unity_run_single_test(test);
        }
    }
}

static void trim_trailing_space(char* str)
{
    char* end = str + strlen(str) - 1;
    while (end >= str && isspace((int) *end))
    {
        *end = 0;
        --end;
    }
}

static int print_test_menu(void)
{
    int test_counter = 0;
    unity_printf("\n\nHere's the test menu, pick your combo:\n");
    for (const struct test_desc_t* test = s_unity_tests_first;
         test != NULL;
         test = test->next, ++test_counter)
    {
        unity_printf("(%d)\t\"%s\" %s\n", test_counter + 1, test->name, test->desc);
    }
    return test_counter;
}

void unity_run_menu()
{
    int test_count = print_test_menu();
    while (true)
    {
        char cmdline[256] = { 0 };
        while(strlen(cmdline) == 0)
        {
            /* Flush anything already in the RX buffer */
            while(uart_rx_one_char((uint8_t *) cmdline) == OK) {
            }
            /* Read input */
            UartRxString((uint8_t*) cmdline, sizeof(cmdline) - 1);
            trim_trailing_space(cmdline);
            if(strlen(cmdline) == 0) {
                /* if input was newline, print a new menu */
                print_test_menu();
            }
        }

        UNITY_BEGIN();

        size_t idx = 0;
        if (cmdline[idx] == '!')
        {
            s_invert = true;
            ++idx;
        }
        else
        {
            s_invert = false;
        }

        if (cmdline[idx] == '*')
        {
            unity_run_all_tests();
        }
        else if (cmdline[idx] =='[')
        {
            unity_run_tests_with_filter(cmdline + idx);
        }
        else if (cmdline[idx] =='"')
        {
            unity_run_single_test_by_name(cmdline + idx);
        }
        else if (isdigit((unsigned char)cmdline[idx]))
        {
            unity_run_single_test_by_index_parse(cmdline + idx, test_count);
        }

        UNITY_END();

        printf("Enter next test, or 'enter' to see menu\n");
    }
}


text:
using System;

namespace OpenCS.BinCodec
{

	/// <summary>
	/// This interface is used by all character sequences.
	/// </summary>
	public interface ICharSequence
	{
		/// <summary>
		/// The number of characters inside this character sequence.
		/// </summary>
		/// <value>The size.</value>
		int Length
		{
			get;
		}

		/// <summary>
		/// Return the character at a given position.
		/// </summary>
		/// <returns>The character at a given position.</returns>
		/// <param name="idx">The character position.</param>
		int CharAt(int idx);
	}
}


text:
resp = s3.get_object(bucket: 'bucket-name', key: 'object-key')

# call #read or #string on the response body
resp.body.read
#=> '...'


text:
const { expect } = require('chai')
const { always: K, compose, pick } = require('ramda')
const http    = require('http')
const request = require('supertest')

const { json, mount, routes } = require('..')

describe('routes', () => {
  const getUser =
    compose(json, pick(['params', 'route']))

  const app = routes({
    '/users':     K(json([])),
    '/users/:id': getUser
  })

  const server = http.createServer(mount({ app }))
  const agent  = request.agent(server)

  it('routes to handler matching the request url', () =>
    agent.get('/users').expect(200, [])
  )

  it('parses the route params for matched routes', () =>
    agent.get('/users/bob').expect(200, {
      params: { id: 'bob' },
      route: '/users/:id'
    })
  )

  it('404 Not Founds for unmatched routes', () =>
    agent.get('/not-found')
      .expect(404)
      .then(res => {
        expect(res.body).to.eql({
          error: 'Not Found',
          message: 'Not Found',
          statusCode: 404
        })
      })
  )
})


text:
package com.crazyhitty.chdev.ks.rssmanagerlib;

import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;

import java.util.ArrayList;
import java.util.List;

/**
 * Author:      Kartik Sharma
 * Email Id:    cr42yh17m4n@gmail.com
 * Created:     2/27/2017 11:24 PM
 * Description: Unavailable
 */

public class UrlRecyclerAdapter extends RecyclerView.Adapter<UrlRecyclerAdapter.ViewHolder> {
    private static final String[] FEED_URLS = new String[]{"http://feeds.arstechnica.com/arstechnica/index?format=xml",
            "http://feeds.reuters.com/reuters/topNews?format=xml",
            "http://feeds.ign.com/ign/all?format=xml"};
    private List<Url> urls = new ArrayList<>();

    public UrlRecyclerAdapter() {
        for (String feedUrl : FEED_URLS) {
            urls.add(new Url(feedUrl, false));
        }
    }

    public void addNewUrl() {
        urls.add(new Url());
        notifyItemInserted(getItemCount() - 1);
    }

    public String[] getUrls() {
        List<String> urls = new ArrayList<String>();
        for (Url url : this.urls) {
            if (!TextUtils.isEmpty(url.getUrl())) {
                urls.add(url.getUrl());
            }
        }
        return urls.toArray(new String[urls.size()]);
    }

    @Override
    public UrlRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
        View view = layoutInflater.inflate(R.layout.item_url, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(final UrlRecyclerAdapter.ViewHolder holder, int position) {
        holder.eTxtUrl.setText(urls.get(position).getUrl());
        holder.eTxtUrl.setEnabled(urls.get(position).isEditing());
        holder.btnEdit.setText(urls.get(position).isEditing() ? R.string.save : R.string.edit);

        holder.btnEdit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (urls.get(holder.getAdapterPosition()).isEditing()) {
                    // Save.
                    urls.get(holder.getAdapterPosition()).setEditing(false);
                    urls.get(holder.getAdapterPosition()).setUrl(holder.eTxtUrl.getText().toString());
                } else {
                    // Edit.
                    urls.get(holder.getAdapterPosition()).setEditing(true);
                }
                notifyItemChanged(holder.getAdapterPosition());
            }
        });

        holder.btnRemove.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                urls.remove(holder.getAdapterPosition());
                notifyItemRemoved(holder.getAdapterPosition());
            }
        });
    }

    @Override
    public int getItemCount() {
        return urls.size();
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        private EditText eTxtUrl;
        private Button btnEdit, btnRemove;

        public ViewHolder(View itemView) {
            super(itemView);
            eTxtUrl = (EditText) itemView.findViewById(R.id.edit_text_feed_url);
            btnEdit = (Button) itemView.findViewById(R.id.button_edit);
            btnRemove = (Button) itemView.findViewById(R.id.button_remove);
        }
    }

    private static class Url {
        private String url;
        private boolean isEditing;

        public Url() {
        }

        public Url(String url, boolean isEditing) {
            this.url = url;
            this.isEditing = isEditing;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public boolean isEditing() {
            return isEditing;
        }

        public void setEditing(boolean editing) {
            isEditing = editing;
        }
    }
}


text:
using System;
using System.Globalization;
using System.Windows.Data;

namespace Msiler.Converters
{
    public class IsGreaterThenConverter : IValueConverter
    {
        public static readonly IValueConverter Instance = new IsGreaterThenConverter();

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
            return (int)value > Int32.Parse((string)parameter);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
            return null;
        }
    }
}