text:
package org.elasticsearch.hadoop.integration.cascading;

import java.util.Properties;

import org.elasticsearch.hadoop.HdpBootstrap;
import org.elasticsearch.hadoop.cascading.EsTap;
import org.elasticsearch.hadoop.mr.RestUtils;
import org.elasticsearch.hadoop.util.TestUtils;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import cascading.cascade.CascadeConnector;
import cascading.flow.Flow;
import cascading.flow.FlowConnector;
import cascading.flow.FlowDef;
import cascading.flow.hadoop.HadoopFlowConnector;
import cascading.operation.Identity;
import cascading.pipe.Each;
import cascading.pipe.Pipe;
import cascading.scheme.hadoop.TextDelimited;
import cascading.tap.Tap;
import cascading.tap.hadoop.Hfs;
import cascading.tuple.Fields;

import static org.junit.Assert.assertThat;

import static org.hamcrest.CoreMatchers.is;

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class AbstractCascadingHadoopSaveTest {

    private static final String INPUT = TestUtils.sampleArtistsDat(CascadingHadoopSuite.configuration);

    @Test
    public void testWriteToES() throws Exception {
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-hadoop/artists", new Fields("name", "url", "picture"));
        Pipe pipe = new Pipe("copy");

        FlowDef flowDef = FlowDef.flowDef().addSource(pipe, in).addTailSink(pipe, out);
        StatsUtils.proxy(new HadoopFlowConnector(HdpBootstrap.asProperties(CascadingHadoopSuite.configuration)).connect(flowDef)).complete();
    }

    @Test
    public void testWriteToESMapping() throws Exception {
        assertThat(RestUtils.getMapping("cascading-hadoop/artists").toString(), is("artists=[name=STRING, picture=STRING, url=STRING]"));
    }

    @Test
    public void testWriteToESWithAlias() throws Exception {
        Tap in = sourceTap();
        Tap out = new EsTap("cascading-hadoop/alias", "", new Fields("name", "url", "picture"));
        Pipe pipe = new Pipe("copy");

        // rename "id" -> "garbage"
        pipe = new Each(pipe, new Identity(new Fields("garbage", "name", "url", "picture", "ts")));

        Properties props = HdpBootstrap.asProperties(CascadingHadoopSuite.configuration);
        props.setProperty("es.mapping.names", "url:address");
        StatsUtils.proxy(new HadoopFlowConnector(props).connect(in, out, pipe)).complete();
    }

    @Test
    public void testWriteToESWithAliasMapping() throws Exception {
        assertThat(RestUtils.getMapping("cascading-hadoop/alias").toString(), is("alias=[address=STRING, name=STRING, picture=STRING]"));
    }

    @Test
    public void testIndexPattern() throws Exception {
        Properties props = HdpBootstrap.asProperties(CascadingHadoopSuite.configuration);

        Tap in = sourceTap();
        Tap out = new EsTap("cascading-hadoop/pattern-{id}", new Fields("id", "name", "url", "picture"));
        Pipe pipe = new Pipe("copy");
        StatsUtils.proxy(new HadoopFlowConnector(props).connect(in, out, pipe)).complete();
    }

    @Test
    public void testIndexPatternMapping() throws Exception {
        assertThat(RestUtils.getMapping("cascading-hadoop/pattern-12").toString(), is("pattern-12=[id=STRING, name=STRING, picture=STRING, url=STRING]"));
    }

    @Test
    public void testIndexPatternWithFormat() throws Exception {
        Properties props = HdpBootstrap.asProperties(CascadingHadoopSuite.configuration);

        Tap in = sourceTap();
        Tap out = new EsTap("cascading-hadoop/pattern-format-{ts:YYYY-MM-dd}", new Fields("id", "name", "url", "picture", "ts"));
        Pipe pipe = new Pipe("copy");
        StatsUtils.proxy(new HadoopFlowConnector(props).connect(in, out, pipe)).complete();
    }

    @Test
    public void testIndexPatternWithFormatMapping() throws Exception {
        assertThat(RestUtils.getMapping("cascading-hadoop/pattern-format-2012-10-06").toString(),
                is("pattern-format-2012-10-06=[id=STRING, name=STRING, picture=STRING, ts=DATE, url=STRING]"));
    }

    @Test
    public void testCascadeConnector() {
        Pipe copy = new Pipe("copy");
        Properties cfg = HdpBootstrap.asProperties(CascadingHadoopSuite.configuration);

        FlowDef flow = new FlowDef().addSource(copy, sourceTap())
                .addTailSink(copy, new EsTap("cascading-hadoop/cascade-connector"));

        FlowConnector connector = new HadoopFlowConnector(cfg);
        Flow[] flows = new Flow[] { connector.connect(flow) };

        CascadeConnector cascadeConnector = new CascadeConnector(cfg);
        cascadeConnector.connect(flows).complete();
    }

    private Tap sourceTap() {
        return new Hfs(new TextDelimited(new Fields("id", "name", "url", "picture", "ts")), INPUT);
    }
}


text:
var tabinfo = {};

function unactivateButton(tabId)
{
	tabinfo[tabId]["chrome_button_active"] = false;
	chrome.browserAction.setIcon({tabId: tabId, path: 'images/icon-19-disabled.png'});
	chrome.browserAction.setTitle({tabId: tabId, title: 'Fb Disabled'});
	chrome.tabs.executeScript(tabId, {code:'fbOff();'});
	console.debug('off '+tabId);
}

function activateButton(tabId)
{
	tabinfo[tabId]["chrome_button_active"] = true;
	chrome.browserAction.setIcon({tabId: tabId, path: 'images/icon-19-enabled.png'});
	chrome.browserAction.setTitle({tabId: tabId, title: 'Fb Enabled'});
	chrome.tabs.executeScript(tabId, {code:'fbOn();'});
	console.debug('on '+tabId);
}

chrome.browserAction.onClicked.addListener(function(tab) {
	if(typeof tabinfo[tab.id] != 'undefined')
	{
		if(tabinfo[tab.id]["chrome_button_active"])
		{
			unactivateButton(tab.id);
		}
		else
		{
			activateButton(tab.id);
		}
	}
	else
	{
		tabinfo[tab.id] = {};
		chrome.tabs.executeScript(tab.id, {file:"fbs.js"},function(result){
			activateButton(tab.id);
		});
	}
});

chrome.tabs.onCreated.addListener(function(tab) {
	console.dir('a');
});

chrome.tabs.onActivated.addListener(function(activeInfo) {
	console.dir('b');
});

chrome.tabs.onReplaced.addListener(function(activeInfo) {
	console.dir('c');
});

chrome.tabs.onHighlighted.addListener(function(activeInfo) {
	console.dir('d');
	/*
	chrome.tabs.getCurrent(function(tab){
		console.dir(tab);
		chrome.tabs.executeScript({file:"fbs.js"},function(result){
			//activateButton(tab.id);
		});
	});
	*/
});

chrome.tabs.onAttached.addListener(function(activeInfo) {
	console.dir('e');
});

chrome.tabs.onDetached.addListener(function(activeInfo) {
	console.dir('f');
});

chrome.tabs.onMoved.addListener(function(activeInfo) {
	console.dir('g');
});

chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
	if(typeof tabinfo[tabId] != 'undefined')
	{
		unactivateButton(tabId);
		delete tabinfo[tabId];
	}
});

chrome.tabs.onRemoved.addListener(function(tabId){
	if(typeof tabinfo[tabId] != 'undefined')
	{
		delete tabinfo[tabId];
	}
});

redpajama_set_name: RedPajamaGithub


text:
insert into t1 select * from t2;
insert into some_ship_info
select ship_power.gun_power, ship_info.*
FROM
	(
		select s.name as ship_name, sum(g.power) as gun_power, max(callibr) as max_callibr
		from
			ships s inner join ships_guns sg on s.id = sg.ship_id inner join guns g on g.id = sg.guns_id
		group by s.name
	) ship_power
	inner join
	(
		select s.name as ship_name, sc.class_name, sc.tonange, sc.max_length, sc.start_build, sc.max_guns_size
		from
			ships s inner join ship_class sc on s.class_id = sc.id
	) ship_info using (ship_name);

INSERT INTO l4stal13prema00.`fusion` ( `partition en` , `classe` , `segment` , `F tot` , `F loc` , `indice specif` )
SELECT * FROM f3p1 WHERE 1;
#end
#begin
-- insert base syntax
insert ignore into t1(col1, col2, col3) values ('abc', 0, .12), ('adfasdf',23432, -.12);
-- http://dev.mysql.com/doc/refman/5.6/en/insert.html
INSERT INTO tbl_name (col1,col2) VALUES(col2*2, 15);
INSERT INTO tbl_name (col1,col2) VALUES(15,col1*2);
INSERT INTO logs (`site_id`, `time`,`hits`) VALUES (1,"2004-08-09", 15) ON DUPLICATE KEY UPDATE hits=hits+15;
INSERT INTO t2 (b, c)
	VALUES ((SELECT a FROM t1 WHERE b='Chip'), 'shoulder'),
	((SELECT a FROM t1 WHERE b='Chip'), 'old block'),
	((SELECT a FROM t1 WHERE b='John'), 'toilet'),
	((SELECT a FROM t1 WHERE b='John'), 'long,silver'),
	((SELECT a FROM t1 WHERE b='John'), 'li''l');
INSERT INTO tbl_test (FirstName)
SELECT 'Aleem' UNION ALL SELECT 'Latif' UNION ALL SELECT 'Mughal';

#end
#begin
-- not latin1 literals
insert into t values ('кириллица', 2, 3);
insert INTO `wptests_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`, `menu_order`, `post_mime_type`, `guid`) VALUES (7, '2016-09-06 16:49:51', '2016-09-06 16:49:51', '', '', 'صورة', '', 'inherit', 'attachment', 'open', 'closed', '', '%d8%b5%d9%88%d8%b1%d8%a9', '', '', '2016-09-06 16:49:51', '2016-09-06 16:49:51', 0, 0, 'image/jpeg', '');
#end
insert into sql_log values(retGUID,log_type,log_text,0,0,current_user,now());
insert into sql_log values(retGUID,log_type,log_text,0,0,current_user(),now());


text:
console.log('TD_COAP_CORE_09 Perform GET transaction with a separate response');

var common = require('./common.js');
erbium = require('node-erbium');
udpApp = common.udpBearer();
coapServerApp = common.server();
coapClientApp = common.client();

var firstTimeA = true;
function check1(raw) {
    var pkt = new erbium.Erbium(raw);
    if (firstTimeA) {
        common.checkStep(2);
        if (pkt.getHeaderType() != 0)
            throw new Error('Wrong type');
        if (pkt.getHeaderStatusCode() != 1)
            throw new Error('Wrong code');
        if (pkt.getHeaderMID() != 0x1234)
            throw new Error('Wrong MID');
        firstTimeA = false;
    } else {
        common.checkStep(5);
        if (pkt.getHeaderType() != 2)
            throw new Error('Wrong type');
        if (pkt.getHeaderMID() != 0x1234)
            throw new Error("Wrong MID");
        if (pkt.getPayload().length != 0)
            throw new Error('Wrong payload');
    }
}

var firstTimeB = true;
function check2(raw) {
    var pkt = new erbium.Erbium(raw);
    if (firstTimeB) {
        common.checkStep(3);
        if (pkt.getHeaderType() != 2)
            throw new Error('Wrong type');
        if (pkt.getHeaderMID() != 0x1234)
            throw new Error('Wrong MID '+pkt.getHeaderMID());
        if (pkt.getPayload().length != 0)
            throw new Error('Wrong payload');
        firstTimeB = false;
    } else {
        common.checkStep(4);
        if (pkt.getHeaderType() != 0)
            throw new Error('Wrong type');
        if (pkt.getHeaderStatusCode() != 69)
            throw new Error('Wrong code');
        if (pkt.getPayload().length == 0)
            throw new Error('Wrong payload');
    }
}

coapServerApp.get(common.TEST_ENDPOINT, function(req, res) {
    setTimeout(function() {
        res.setContentType('text/plain');
        res.send(erbium.CONTENT_2_05, 'Hello world', function(pkt) {
            // got ack
        });
    }, 100);
    res.defer();
});

function stimulus1() {
    common.checkStep(1);
    coapClientApp.get(erbium.COAP_TYPE_CON, common.TEST_URL_BASE + common.TEST_ENDPOINT, {
        mid: 0x1234,
        beforeSend: check1,
        beforeReceive: check2,
        success: function(inpkt, payload) {
            common.checkStep(6);
            console.log(payload.toString());
            process.exit(0);
        }
    });
}

udpApp.start(5683, coapClientApp, coapServerApp, function(err) {
    if (err) {
        console.log(err);
        process.exit(1);
    }
    coapServerApp.start();
    stimulus1();
});


text:
"""

"""
import pygame
from pygame.locals import *

class PyGameMouseController:
    def __init__(self,model):
        self.model = model

    def handle_mouse_event(self,event):
        if event.type == MOUSEMOTION:
            self.model.paddle.x = event.pos[0] - self.model.paddle.width/2.0

class PyGameKeyboardController:
    def __init__(self,model):
        self.model = model

    def handle_key_event(self, event):
        if event.type != KEYDOWN:
            return
        if event.key == pygame.K_LEFT:
            self.model.paddle.x += -10
        if event.key == pygame.K_RIGHT:
            self.model.paddle.x += 10


text:
goog.module('grrUi.semantic.primitiveDirective');
goog.module.declareLegacyNamespace();

/**
 * Directive that displays Primitive values.
 *
 * @return {!angular.Directive} Directive definition object.
 * @ngInject
 * @export
 */
exports.PrimitiveDirective = function() {
  return {
    scope: {
      value: '='
    },
    restrict: 'E',
    template: '{$ ::value.value $}'
  };
};

/**
 * Name of the directive in Angular.
 *
 * @const
 * @export
 */
exports.PrimitiveDirective.directive_name = 'grrPrimitive';

/**
 * Semantic type corresponding to this directive.
 *
 * @const
 * @export
 */
exports.PrimitiveDirective.semantic_types = [
  'RDFBool', 'bool', 'RDFInteger', 'int', 'long', 'float', 'RDFString',
  'basestring', 'str', 'unicode'
];


text:
This plugin adds the ability for a merchant to accept bitcoin payments in their PrestaShop eCommerce store via BitPay.

## Detail Description

Bitcoin is a powerful new peer-to-peer payment platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for a highly resilient value transfer infrastructure, and this allows merchants to gain greater profits.

This is because there are little to no fees for transferring Bitcoins from one person to another. Unlike other payment methods, Bitcoin payments cannot be reversed, so once you are paid you can ship!  No waiting days for a payment to clear.

[![Build Status](https://travis-ci.org/bitpay/prestashop-plugin.svg?branch=master)](https://travis-ci.org/bitpay/prestashop-plugin)

## Quick Start Guide

To get up and running with our plugin quickly, see the GUIDE here: https://github.com/bitpay/prestashop-plugin/blob/master/GUIDE.md

## Support

### BitPay Support

* [BitPay Labs](https://labs.bitpay.com/c/plugins/prestashop)
  * Post a question in our discussion forums.
* [GitHub Issues](https://github.com/bitpay/prestashop-plugin/issues)
  * Open an issue if you are having issues with this plugin.
* [Support](https://support.bitpay.com)
  * BitPay merchant support documentation and knowledgebase.

## PrestaShop Support

* [Homepage](http://www.prestashop.com)
* [Documentation](http://doc.prestashop.com/)
* [Support Forums](http://www.prestashop.com/forums/)

## Troubleshooting

1. Ensure a valid SSL certificate is installed on your server. Also ensure your root CA cert is updated. If your CA cert is not current, you will see curl SSL verification errors.
2. Verify that your web server is not blocking POSTs from servers it may not recognize. Double check this on your firewall as well, if one is being used.
3. Check the version of this plugin against the official plugin repository to ensure you are using the latest version. Your issue might have been addressed in a newer version! See the [Releases](https://github.com/bitpay/prestashop-plugin/releases) page for the latest.
4. If all else fails, enable debug logging in the plugin options and send the log along with an email describing your issue **in detail** to support@bitpay.com.

**TIP**: When contacting support it will help us is you provide:

* The versions of Prestashop, PHP and this plugin
* Other plugins you have installed
  * Some plugins do not play nicely with others!
* Configuration settings for the plugin (most merchants take screenshots)
* Any log files that will help
  * Web server error logs are best!
* Screenshots of any error messages, if applicable

## Contribute

Would you like to help with this project?  Great!  You don't have to be a developer, either.  If you've found a bug or have an idea for an improvement, please open an [issue](https://github.com/bitpay/prestashop-plugin/issues) and tell us about it.

If you *are* a developer wanting contribute an enhancement, bugfix or other patch to this project, please fork this repository and submit a pull request detailing your changes.  We review all PRs!

This open source project is released under the [MIT license](http://opensource.org/licenses/MIT) which means if you would like to use this project's code in your own project you are free to do so.  Speaking of, if you have used our code in a cool new project we would like to hear about it!  Please send us an email or post a new thread on [BitPay Labs](https://labs.bitpay.com).

## License

This project is released under the MIT License and Copyright (c) 2014-2015, [BitPay](https://bitpay.com), Inc. Please refer to the [LICENSE](https://github.com/bitpay/prestashop-plugin/blob/master/LICENSE) file that came with this project for the specific text or, if a copy was not provided with these files, you can view the text of this license here: http://opensource.org/licenses/MIT.


text:
require 'money'
require_dependency 'lib/payatron_4000'

module TradoStripeModule

    class Striper

        # Creates a charge for the Stripe API; receives a response and in turn creates the relevant transaction records,
        # sends a confirmation email and redirects the user.
        #
        # @param order [Object]
        # @param session [Object
        def self.complete order, session, ip_address
            order.transfer(order.cart)
            charge = Stripe::Charge.create(
                amount: Store::Price.new(price: order.gross_amount, tax_type: 'net').singularize,
                currency: Store.settings.currency_code,
                customer: order.stripe_customer_id,
                description: "Order ID ##{order.id} | #{order.billing_address.full_name} | #{order.email}",
                metadata: Hash[ *order.order_items.collect { |item| [ "order_item_#{item.id}", "#{item.product.name} - #{item.sku.full_sku}" ] }.flatten ],
                statement_descriptor: Store.settings.stripe_statement_descriptor,
                expand: ['balance_transaction']
            )
            if charge.paid
                TradoStripeModule::Striper.successful(charge, order)
                Payatron4000.destroy_cart(session)
                Payatron4000.decommission_order(order)
                order.reload
                Mailatron4000::Orders.confirmation_email(order)
                return Rails.application.routes.url_helpers.success_orders_url(host: Trado::Application.config.action_mailer.default_url_options[:host])
            end
        rescue Stripe::CardError => e
            body = e.json_body
            err  = body[:error]
            TradoStripeModule::Striper.failed(err, order)
            order.reload
            Mailatron4000::Orders.confirmation_email(order)
            return Rails.application.routes.url_helpers.failed_orders_url(host: Trado::Application.config.action_mailer.default_url_options[:host])
        end

        # Upon successfully completing an order with a Stripe payment option a new transaction record is created, stock is updated for the relevant SKU
        #
        # @param charge [Object]
        # @param order [Object]
        def self.successful charge, order
            Transaction.new(  :fee                      => TradoStripeModule::Striper.format_currency(charge),
                              :order_id                 => order.id,
                              :payment_status           => 'completed',
                              :transaction_type         => 'Credit',
                              :tax_amount               => order.tax_amount,
                              :stripe_charge_id         => charge.id,
                              :payment_type             => 'stripe',
                              :net_amount               => order.net_amount,
                              :gross_amount             => order.gross_amount
            ).save(validate: false)
            Payatron4000.update_stock(order)
            Payatron4000.increment_product_order_count(order.products)
        end

        # When an order has failed to complete, a new transaction record is created with a logged status reason
        #
        # @param error [Object]
        # @param order [Object]
        def self.failed error, order
            Transaction.new(  :fee                        => 0,
                              :gross_amount               => order.gross_amount,
                              :order_id                   => order.id,
                              :payment_status             => 'failed',
                              :transaction_type           => 'Credit',
                              :tax_amount                 => order.tax_amount,
                              :stripe_charge_id           => nil,
                              :payment_type               => 'stripe',
                              :net_amount                 => order.net_amount,
                              :status_reason              => error[:message],
                              :error_code                 => error[:code].to_i
            ).save(validate: false)
            Payatron4000.increment_product_order_count(order.products)
        end

        def self.format_currency charge
          Money.new(charge.balance_transaction.fee, charge.currency.upcase)
        end
    end
end


text:
Remove-VisualStudioProduct `
    -PackageName 'visualstudio2022buildtools' `
    -Product 'BuildTools' `
    -VisualStudioYear '2022' `
    -Preview $false


text:
/*

	nohup node my_app.js &
	pkill node

	T: W&GXk/Jt,7#5j}"}
	Mask: a2ls5.a2hosting.com

*/
var express = require('express'),
	middleware = require('./middleware/middleware'),
	routes = require('./routes/route'),
	app = express();

middleware(express, app, __dirname);

routes(express, app);

app.listen(5280, function () {
  console.log('Juliano Loaded on port 5280');
});


text:
from proteus import *
from proteus.default_so import *
import cylinder

from proteus.SplitOperator import Sequential_FixedStep_Simple, defaultSystem

pnList = [("twp_navier_stokes_p", "twp_navier_stokes_n"),]#3

name = "cylinder"

#modelSpinUpList = [cylinder.VOF_model, cylinder.LS_model, cylinder.V_model, cylinder.PINIT_model]
#modelSpinUpList = [cylinder.PINIT_model]

# class Sequential_MinAdaptiveModelStepPS(Sequential_MinAdaptiveModelStep):
#     def __init__(self,modelList,system=defaultSystem,stepExact=True):
#         Sequential_MinAdaptiveModelStep.__init__(self,modelList,system,stepExact)
#         self.modelList = modelList[:len(pnList)-1]

class Sequential_MinAdaptiveModelStepPS(Sequential_FixedStep):
    def __init__(self,modelList,system=defaultSystem,stepExact=True):
        Sequential_FixedStep.__init__(self,modelList,system,stepExact)
        self.modelList = modelList[:len(pnList)]####without minus 1

dt_system_fixed = cylinder.dt_fixed
systemStepControllerType = Sequential_MinAdaptiveModelStepPS

# stepController = StepControl.Min_dt_cfl_controller
# systemStepExact=False

# systemStepControllerType = Sequential_FixedStep #Sequential_FixedStep_Simple # uses time steps in so.tnList
# dt_system_fixed = 0.01;
# systemStepExact=False;

needEBQ_GLOBAL = False
needEBQ = False

tnList = cylinder.tnList

info = open("TimeList.txt","w")
#archiveFlag = ArchiveFlags.EVERY_SEQUENCE_STEP


text:
[![Gem Version](https://img.shields.io/gem/v/normalize_url.svg)](https://rubygems.org/gems/normalize_url)
[![Build Status](https://img.shields.io/travis/rwz/normalize_url.svg)](http://travis-ci.org/rwz/normalize_url)
[![Code Climate](https://img.shields.io/codeclimate/github/rwz/normalize_url.svg)](https://codeclimate.com/github/rwz/normalize_url)

This gem can normalize HTTP(S) URLs by applying a certain set of
transformations. After normalization, two different URLs that point to the same
resource should look exactly the same.

For example:

- `http://example.com/products?product_id=123`
- `HTTP://EXAMPLE.COM/products/?product_id=123`
- `http://example.com/products/?product_id=123`
- `http://example.com/foo/../products?product_id=123`
- `http://example.com/products?product_id=123#comments-section`
- `http://example.com//products/?product_id=123`
- `http://example.com/products/?product_id=123&`
- `http://example.com/products?utm_source=whatever&product_id=123&utm_medium=twitter&utm_campaign=blah`

will all become `http://example.com/products?product_id=123` after normalization.

Some of the transformations are potentially dangerous, since not all webservers
comform to standards and some of them are just plain weird. So there is no
guarantee that the URL will still work.

## Installation

Add this line to your application's Gemfile:

```ruby
gem "normalize_url"
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install normalize_url

## Usage

```ruby
NormalizeUrl.process("http://example.com/products/?foo=bar&baz") # => "http://example.com/products?baz&foo=bar"
```

Some tranformations could be skipped by demand. All you need is to pass its
name as a optional value to `normalize` method:

```ruby
NormalizeUrl.process("http://example.com/foo/") # => "http://example.com/foo"
NormalizeUrl.process("http://example.com/foo/", remove_trailing_slash: false) # => "http://example.com/foo/"
```

## Transformations

- Remove trailing slash. Option `:remove_trailing_slash`.

    Example:

    `http://example.com/products/` -> `http://example.com/products`

- Remove repeating slashes. Option `:remove_repeating_slashes`.

    Example:

    `http://example.com/foo//bar` -> `http://example.com/foo/bar`

- Remove hash fragment. Option `:remove_hash`.

    Example:

    `http://example.com/foo#bar` -> `http://example.com/foo`

- Remove known commonly used tracking query parameters. Option `:remove_tracking`.

    Example:

    `http://example.com/?utm_source=whatever` -> `http://example.com/`

- Sort query string. Option `:sort_query`.

    Example:

    `http://example.com/products/?foo=bar&baz` -> `http://example.com/products?baz&foo=bar`

## Contributing

1. Fork it (https://github.com/rwz/normalize_url/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request


text:
package org.skfiy.typhon.spi.war;

import java.util.ArrayList;
import java.util.List;
import org.skfiy.typhon.domain.item.IFightItem;

/**
 *
 * @author Kevin Zou <kevinz@skfiy.org>
 */
public class MultiAttackResult {

    private IFightItem.Shot shot;

    private AttackEntry source;
    private List<Object> targets = new ArrayList<>();

    public IFightItem.Shot getShot() {
        return shot;
    }

    public void setShot(IFightItem.Shot shot) {
        this.shot = shot;
    }

    public AttackEntry getSource() {
        return source;
    }

    public void setSource(AttackEntry source) {
        this.source = source;
    }

    public List<Object> getTargets() {
        return targets;
    }

    public boolean addTarget(Object target) {
        return targets.add(target);
    }

    public void setTargets(List<Object> targets) {
        this.targets = targets;
    }

}


text:
namespace syncer {

// static
std::unique_ptr<ModelTypeChangeProcessor> FakeModelTypeChangeProcessor::Create(
    ModelType type,
    ModelTypeSyncBridge* bridge) {
  return base::WrapUnique(new FakeModelTypeChangeProcessor());
}

FakeModelTypeChangeProcessor::FakeModelTypeChangeProcessor() {}
FakeModelTypeChangeProcessor::~FakeModelTypeChangeProcessor() {}

void FakeModelTypeChangeProcessor::Put(
    const std::string& client_tag,
    std::unique_ptr<EntityData> entity_data,
    MetadataChangeList* metadata_change_list) {}

void FakeModelTypeChangeProcessor::Delete(
    const std::string& client_tag,
    MetadataChangeList* metadata_change_list) {}

void FakeModelTypeChangeProcessor::OnMetadataLoaded(
    SyncError error,
    std::unique_ptr<MetadataBatch> batch) {}

void FakeModelTypeChangeProcessor::OnSyncStarting(
    std::unique_ptr<DataTypeErrorHandler> error_handler,
    const StartCallback& callback) {
  if (!callback.is_null()) {
    callback.Run(SyncError(), nullptr);
  }
}

void FakeModelTypeChangeProcessor::DisableSync() {}

bool FakeModelTypeChangeProcessor::IsTrackingMetadata() {
  return true;
}

SyncError FakeModelTypeChangeProcessor::CreateAndUploadError(
    const tracked_objects::Location& location,
    const std::string& message) {
  return SyncError();
}

}  // namespace syncer


text:
<?php
use common\modules\admin\models\Admin;
use common\modules\admin\models\forms\AccountForm;
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\AdminMenus */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'username')->textInput()->label(Yii::t('backend/user','Username')) ?>

    <?php $model->password = ''; ?>
    <?= $form->field($model, 'password')->passwordInput()->label(Yii::t('backend/account','Password')) ?>

    <?= $form->field($model, 'email')->textInput()->label(Yii::t('backend','Email')) ?>

    <?= $form->field($model, 'mobile')->textInput()->label(Yii::t('backend','Mobile')) ?>

    <?= $form->field($model, 'remark')->textInput()->label(Yii::t('backend/account','Remark')) ?>

    <?php
    $roles = [];
    foreach(AccountForm::getRoles() as $role) {
        $roles[$role] = $role;
    }
    ?>
    <?= $form->field($model, 'role')->dropdownList($roles)->label(Yii::t('backend','Role')) ?>

    <?php
    //如果当前为创建账号,则默认设置status为开启
    if($model->isNewRecord) {
        $model->status = Admin::STATUS_ACTIVE;
    }
    ?>
    <?= $form->field($model, 'status')->dropdownList(Admin::getStatus())->label(Yii::t('backend','Status')) ?>

        <?= Html::submitButton($model->isNewRecord ? Yii::t('backend', 'Create') : Yii::t('backend', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
import {capitalize, wordCount} from "./utils";
import {get_line} from "./readData.js";

console.log(capitalize("foo"));
console.log(wordCount("f\no f"));

get_line('./sampleNumbers.txt', 0, function(err, line){ // calls the function on the defined file
  console.log('The line: ' + line);
});


text:
import * as React from 'react';

import { BoxProps } from '../Box';

export interface RatingProps extends BoxProps {
  /** The rating value, accepts decimal to represent half rating */
  value: number;
  /** Maxium level, used to fill in the empty stars */
  max: number;
  /** Associated text */
  children?: React.ReactNode;
  /** The icon to show, defaults to star icon */
  character?: React.ReactNode | React.FC<RatingItemProps>;
  /** Direction */
  direction?: 'ltr' | 'rtl';
  /** Unit, used for labeling, default to "stars" */
  unit?: string;
  ratingItemClassName?: string;
  activeRatingItemClassName?: string;
  activeHalfRatingItemClassName?: string;
}

export interface InternalRatingItemProps extends BoxProps {
  /** Index */
  index: number;
  /** Total count */
  count: number;
  /** The icon to show, defaults to star icon */
  character: RatingProps['character'];
  /** Is half */
  half?: boolean;
  /** Is the current item active */
  active: boolean;
  /** Flip the half side around */
  flipped?: boolean;
}

export interface RatingItemProps {
  /** Its self pos */
  index: number;
  /** Total count */
  count: number;
}

export enum ItemType {
  Filled = 1,
  HalfFilled,
  Empty,
}

export class RatingMaxmiumExceededError extends Error {
  constructor() {
    super('Rating value exceeded the maximum threshold. Please specify a higher max value or lower the input value.');
  }
}


text:
package de.kaufhof.hajobs.testutils

import com.datastax.driver.core._
import com.typesafe.config.ConfigFactory
import play.api.Logger

import scala.util.control.NonFatal

object TestCassandraConnection {

  private lazy val config = ConfigFactory.load()

  private var sessionCache: Option[Session] = None

  private def createSessionAndInitKeyspace(uri: CassandraConnectionUri, isDev: Boolean,
                                           defaultConsistencyLevel: ConsistencyLevel = ConsistencyLevel.LOCAL_QUORUM):
  Session = sessionCache.synchronized {
    sessionCache.getOrElse {
      Logger.info(s"Connecting cassandra on ${uri.hosts.mkString("(", ",", ")")}:$uri.port (keyspace ${uri.keyspace})")
      val cluster = new Cluster.Builder().
        addContactPoints(uri.hosts.toArray: _*).
        withPort(uri.port).
        withQueryOptions(new QueryOptions().setConsistencyLevel(defaultConsistencyLevel)).build
      val session = cluster.connect

      // This is just here until we remove it finally when the SBT pillar plugin really works, i.e. with RUN hooks
      if (isDev) {
        if (Option(cluster.getMetadata.getKeyspace(uri.keyspace)).isEmpty) {
          Logger.debug("keyspace does not exist yet. creating it and running migrations.")
          Pillar.initialize(session, uri.keyspace, 1)
        }
        try {
          session.execute(s"USE ${uri.keyspace}")
          Pillar.migrate(session)
        } catch {
          case NonFatal(e) => Logger.error("exception running migrations", e); throw e
        }
        // END ...... sbt pillar hack
      } else {
        session.execute(s"USE ${uri.keyspace}")
      }

      sessionCache = Some(session)

      sessionCache.get
    }
  }

  private val cassandraUrl = CassandraConnectionUri(config.getString("cassandra.url"))
  lazy val Session = createSessionAndInitKeyspace(cassandraUrl, true, ConsistencyLevel.LOCAL_QUORUM)

}

trait TestCassandraConnection {

   protected lazy val session = TestCassandraConnection.Session

 }


text:
set -euo pipefail

cd "$(dirname $0)/app"
source '../../test-helpers.sh'

declare -r output='whitespace_0.1.0_all'

finish() {
  rm -rf "$output" *.deb
}

trap 'finish' EXIT

../../../node-deb --no-delete-temp \
                  --verbose \
                  -- 'whitespace file.js' 'whitespace folder'

declare -ar files=("whitespace file.js"
                   "whitespace folder/"
                   "whitespace folder/file1.js"
                   "whitespace folder/file 2.js"
                   "whitespace folder/\"file 3\".js"
                   "whitespace folder/'file 4'.js")

for file in "${files[@]}"; do
  stat "$output/usr/share/whitespace/app/whitespace file.js" > /dev/null || \
    die "White space file missing: \`$file\`"
done

dpkg -i "$output.deb"
apt-get purge -y whitespace


text:
@implementation UdeskDateFormatter

+ (UdeskDateFormatter *)sharedFormatter
{
    static UdeskDateFormatter *_sharedFormatter = nil;

    static dispatch_once_t onceToken = 0;
    dispatch_once(&onceToken, ^{
        _sharedFormatter = [[UdeskDateFormatter alloc] init];
    });

    return _sharedFormatter;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        _dateFormatter = [[NSDateFormatter alloc] init];
        [_dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    }
    return self;
}

- (void)dealloc
{
    _dateFormatter = nil;
}

#pragma mark - Formatter

- (NSString *)ud_styleDateForDate:(NSDate *)date
{

    if (!date) return @"";

    NSString *dateText = nil;
    NSString *timeText = nil;

    NSDate *today = [NSDate date];

    NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:date];
    NSDateComponents *todayComponents = [[NSCalendar currentCalendar] components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:today];

    if (dateComponents.year == todayComponents.year && dateComponents.month == todayComponents.month && dateComponents.day == todayComponents.day) {
        dateText = getUDLocalizedString(@"udesk_today");
    } else {
        dateText = [NSDateFormatter localizedStringFromDate:date dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterNoStyle];
    }

    timeText = [NSDateFormatter localizedStringFromDate:date dateStyle:NSDateFormatterNoStyle timeStyle:NSDateFormatterShortStyle];

    return [NSString stringWithFormat:@"%@ %@",dateText,timeText];
}

@end


text:
package com.owlike.genson;

public class Timer {
	private long start;
	private long end;
	private long sum;
	private int cnt;
	private boolean paused;

	public Timer start() {
		end = 0;
		sum = 0;
		cnt = 0;
		paused = false;
		start = System.currentTimeMillis();
		return this;
	}

	public Timer stop() {
		end = System.currentTimeMillis();

		return this;
	}

	public Timer pause() {
		paused = true;
		end = System.currentTimeMillis();
		return this;
	}

	public Timer unpause() {
		if (paused) {
			long t = System.currentTimeMillis();
			start = t - (end - start);
			paused = false;
		}
		return this;
	}

	public Timer cumulate() {
		cnt++;
		end = System.currentTimeMillis();
		sum += end - start;
		start = end;

		return this;
	}

	public String printMS() {
		if (cnt > 0)
			return ((double) sum / cnt) + " ms";

		return end - start + " ms";
	}

	public String printS() {
		if (cnt > 0)
			return ((double) sum / (cnt * 1000)) + " ms";

		return ((double) (end - start) / 1000) + " s";
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<artifactId>em-endpoint</artifactId>
	<packaging>jar</packaging>

	<name>em-endpoint</name>
	<description>Endpoints for em</description>

	<parent>
		<groupId>com.mbrull</groupId>
		<artifactId>em</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path-assert</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.mbrull</groupId>
			<artifactId>em-core</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>

		<dependency>
			<groupId>com.mbrull</groupId>
			<artifactId>em-persistence</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>

		<dependency>
			<groupId>com.mbrull</groupId>
			<artifactId>em-commons</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
			</plugin>

		</plugins>
	</build>

</project>


text:
import { pageRatingModel } from './pageRating.model.js';
import { userModel } from './user.model.js';
import { permissionsModel } from './permissions.model.js';

const pageModel = [
    { field: '@id', name: 'id', transform: 'number' },
    { field: 'title' },
    { field: '@guid', name: 'guid' },
    { field: 'uri.ui', name: 'uri' },
    { field: '@href', name: 'href' },
    { field: '@state', name: 'state' },
    { field: '@draft.state', name: 'draftState' },
    { field: 'article' },
    { field: 'language' },
    { field: 'namespace' },
    { field: 'language.effective', name: 'languageEffective' },
    { field: 'timeuuid' },
    { field: [ 'path', '#text' ] },
    { field: 'restriction' },
    { field: '@revision', name: 'revision', transform: 'number' },
    { field: 'path.original', name: 'originalPath', transform: decodeURIComponent },
    { field: '@deleted', name: 'deleted', transform: 'boolean' },
    { field: '@publish', name: 'publish', transform: 'boolean' },
    { field: '@unpublish', name: 'unpublish', transform: 'boolean' },
    { field: '@deactivate', name: 'deactivate', transform: 'boolean' },
    { field: '@virtual', name: 'virtual', transform: 'boolean' },
    { field: '@subpages', name: 'hasSubpages', transform: 'boolean' },
    { field: '@terminal', name: 'terminal', transform: 'boolean' },
    { field: 'overview' },
    { field: 'user.author', name: 'userAuthor', transform: userModel },
    { field: 'date.created', name: 'dateCreated', transform: 'date' },
    { field: 'date.modified', name: 'dateModified', transform: 'date' },
    { field: 'date.edited', name: 'dateEdited', transform: 'date' },
    { field: [ 'revisions', '@count' ], name: 'revisionCount', transform: 'number' },
    { field: [ 'comments', '@count' ], name: 'commentCount', transform: 'number' },
    { field: [ 'permissions', 'permissions.page' ], name: 'permissions', transform: permissionsModel },
    {
        field: 'rating',
        constructTransform(rating) {
            if(typeof rating === 'object' && rating !== null) {
                return pageRatingModel;
            }
        }
    },
    {
        field: 'metrics',
        transform: [
            { field: 'metric.charcount', name: 'charCount', transform: 'number' },
            { field: 'metric.views', name: 'views', transform: 'number' }
        ]
    },
    {
        field: [ 'tags', 'tag' ],
        isArray: true,
        transform: [
            { field: '@href', name: 'href' },
            { field: '@id', name: 'id', transform: 'number' },
            { field: '@value', name: 'value' },
            { field: 'title' },
            { field: 'type' },
            { field: 'uri' }
        ]
    }
];
pageModel.push({ field: 'page.parent', name: 'pageParent', transform: pageModel });
pageModel.push({ field: 'draft', transform: pageModel });
export { pageModel };


text:
Window* window;
BitmapLayer* bitmap_layer;
GBitmap* bitmap;
uint32_t resource;

static void switch_bitmap(int8_t value) {
    resource += value;
    gbitmap_destroy(bitmap);
    bitmap = gbitmap_create_with_resource(resource);
    if (bitmap == NULL) {
        switch_bitmap(-value);
    }
    else {
        bitmap_layer_set_bitmap(bitmap_layer, bitmap);
        layer_mark_dirty(bitmap_layer_get_layer(bitmap_layer));
    }
}

static void up_click_handler(ClickRecognizerRef recognizer, void *context) {
    switch_bitmap(-1);
}

static void down_click_handler(ClickRecognizerRef recognizer, void *context) {
    switch_bitmap(+1);
}

static void click_handlers(void *context) {
    window_single_click_subscribe(BUTTON_ID_UP, up_click_handler);
    window_single_click_subscribe(BUTTON_ID_DOWN, down_click_handler);
}

static void window_load(Window *window) {
    Layer *window_layer = window_get_root_layer(window);
    GRect bounds = layer_get_bounds(window_layer);
    bitmap_layer = bitmap_layer_create(bounds);
    resource = 1;
    bitmap = gbitmap_create_with_resource(resource);
    bitmap_layer_set_bitmap(bitmap_layer, bitmap);
    bitmap_layer_set_alignment(bitmap_layer, GAlignCenter);
    layer_add_child(window_layer, bitmap_layer_get_layer(bitmap_layer));
    bitmap_layer_set_compositing_mode(bitmap_layer, GCompOpSet);
}

static void window_unload(Window *window) {
    bitmap_layer_destroy(bitmap_layer);
    gbitmap_destroy(bitmap);
}

static void init() {
    window = window_create();
    window_set_click_config_provider(window, click_handlers);
    window_set_window_handlers(window, (WindowHandlers) {
            .load = window_load,
            .unload = window_unload,
    });
    window_stack_push(window, true);
}

static void deinit(void) {
    window_destroy(window);
}

int main(void) {
    init();
    app_event_loop();
    deinit();
    return 0;
}


text:
<?php

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
      // $this->call(UserTableSeeder::class);
      DB::table('content_categories')->delete();
      $this->call('Content_categoriesTableSeeder');

      DB::table('roles')->delete();
      $this->call('RolesTableSeeder');

      DB::table('permissions')->delete();
      $this->call('PermissionsTableSeeder');

      DB::table('disciplines')->delete();
      $this->call('DisciplinesTableSeeder');

      DB::table('sports')->delete();
      $this->call('SportsTableSeeder');

      DB::table('regions')->delete();
      $this->call('RegionsTableSeeder');

      DB::table('oevent_tracks')->delete();
      $this->call('Oevent_tracksTableSeeder');

      DB::table('oevent_types')->delete();
      $this->call('Oevent_typesTableSeeder');

      DB::table('anotification_channels')->delete();
      $this->call('Anotification_channelsTableSeeder');

      DB::table('anotifications')->delete();
      $this->call('AnotificationsTableSeeder');

    }
}


text:
package com.github.pozo.lastfm.health;

import com.codahale.metrics.health.HealthCheck;
import com.github.pozo.lastfm.core.ArtistBio;
import com.github.pozo.lastfm.resources.lastfm.LastfmService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.runners.MockitoJUnitRunner;

import javax.validation.constraints.NotNull;

import java.net.ConnectException;
import java.util.regex.Matcher;

import static org.junit.Assert.*;
import static org.mockito.Mockito.when;

/**
 * Created by pozo on 2015.10.11..
 */
@RunWith(MockitoJUnitRunner.class)
public class LastfmServiceHeathCheckTest {
    @Mock
    private LastfmService lastfmService;

    private LastfmServiceHeathCheck underTest;

    @Before
    public void setUp() throws Exception {
        underTest = new LastfmServiceHeathCheck(lastfmService);
    }
    @Test
    public void testCheck_ShouldBeUnhealthy_WhenServiceThrowAnException() throws Exception {
        //GIVEN
        //WHEN
        when(lastfmService.getArtistInfo(Matchers.anyString())).thenThrow(ConnectException.class);
        HealthCheck.Result result = underTest.execute();
        //THEN
        assertFalse(result.isHealthy());
    }
    @Test
    public void testCheck_ShouldBeUnhealthy_WhenServiceIsNull() throws Exception {
        //GIVEN
        underTest = new LastfmServiceHeathCheck(null);
        //WHEN
        HealthCheck.Result result = underTest.execute();
        //THEN
        assertFalse(result.isHealthy());
    }
    @Test
    public void testCheck_ShouldBeHealthy_WhenServiceHasResponse() throws Exception {
        //GIVEN
        //WHEN
        when(lastfmService.getArtistInfo(Matchers.anyString())).thenReturn(new ArtistBio());
        HealthCheck.Result result = underTest.execute();
        //THEN
        assertTrue(result.isHealthy());
    }
}


text:
<?php
// Heading
$_['heading_title']       = 'Carousel';

// Text
$_['text_module']         = 'Modules';
$_['text_success']        = 'Success: You have modified module carousel!';
$_['text_content_top']    = 'Content Top';
$_['text_content_bottom'] = 'Content Bottom';
$_['text_column_left']    = 'Column Left';
$_['text_column_right']   = 'Column Right';

// Entry
$_['entry_banner']        = 'Banner:';
$_['entry_limit']         = 'Limit:';
$_['entry_scroll']        = 'Scroll:';
$_['entry_image']         = 'Image (W x H) and Resize Type:';
$_['entry_layout']        = 'Layout:';
$_['entry_position']      = 'Position:';
$_['entry_status']        = 'Status:';
$_['entry_sort_order']    = 'Sort Order:';

// Error
$_['error_permission']   = 'Warning: You do not have permission to modify module carousel!';
$_['error_image']        = 'Image width & height dimensions required!';
?>


text:
/**
 * DocuSign REST API
 * The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
 *
 * OpenAPI spec version: v2.1
 * Contact: devcenter@docusign.com
 *
 * NOTE: This class is auto generated. Do not edit the class manually and submit a new issue instead.
 *
 */

(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['ApiClient', 'model/ErrorDetails'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    module.exports = factory(require('../ApiClient'), require('./ErrorDetails'));
  } else {
    // Browser globals (root is window)
    if (!root.Docusign) {
      root.Docusign = {};
    }
    root.Docusign.TextCustomField = factory(root.Docusign.ApiClient, root.Docusign.ErrorDetails);
  }
}(this, function(ApiClient, ErrorDetails) {
  'use strict';

  /**
   * The TextCustomField model module.
   * @module model/TextCustomField
   */

  /**
   * Constructs a new TextCustomField.
   * @alias module:model/TextCustomField
   * @class
   */
  var exports = function() {
    var _this = this;

  };

  /**
   * Constructs a TextCustomField from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from data to obj if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {module:model/TextCustomField} obj Optional instance to populate.
   * @return {module:model/TextCustomField} The populated TextCustomField instance.
   */
  exports.constructFromObject = function(data, obj) {
    if (data) {
      obj = obj || new exports();

      if (data.hasOwnProperty('configurationType')) {
        obj['configurationType'] = ApiClient.convertToType(data['configurationType'], 'String');
      }
      if (data.hasOwnProperty('errorDetails')) {
        obj['errorDetails'] = ErrorDetails.constructFromObject(data['errorDetails']);
      }
      if (data.hasOwnProperty('fieldId')) {
        obj['fieldId'] = ApiClient.convertToType(data['fieldId'], 'String');
      }
      if (data.hasOwnProperty('name')) {
        obj['name'] = ApiClient.convertToType(data['name'], 'String');
      }
      if (data.hasOwnProperty('required')) {
        obj['required'] = ApiClient.convertToType(data['required'], 'String');
      }
      if (data.hasOwnProperty('show')) {
        obj['show'] = ApiClient.convertToType(data['show'], 'String');
      }
      if (data.hasOwnProperty('value')) {
        obj['value'] = ApiClient.convertToType(data['value'], 'String');
      }
    }
    return obj;
  }

  /**
   * If merge field's are being used, specifies the type of the merge field. The only  supported value is **salesforce**.
   * @member {String} configurationType
   */
  exports.prototype['configurationType'] = undefined;
  /**
   * @member {module:model/ErrorDetails} errorDetails
   */
  exports.prototype['errorDetails'] = undefined;
  /**
   * An ID used to specify a custom field.
   * @member {String} fieldId
   */
  exports.prototype['fieldId'] = undefined;
  /**
   * The name of the custom field.
   * @member {String} name
   */
  exports.prototype['name'] = undefined;
  /**
   * When set to **true**, the signer is required to fill out this tab
   * @member {String} required
   */
  exports.prototype['required'] = undefined;
  /**
   * A boolean indicating if the value should be displayed.
   * @member {String} show
   */
  exports.prototype['show'] = undefined;
  /**
   * The value of the custom field.
   * @member {String} value
   */
  exports.prototype['value'] = undefined;

  return exports;
}));


text:
Launch, configure, and manage the SSSD service for communication with an AD backend such as Amazon Directory Service (Simple AD)

## Supported Platforms

- Ubuntu 14.04 LTS
- CentOS 6.6

## Attributes

    Key
    Type
    Description
    Default

    <tt>['sssd']['join_domain']</tt>
    Boolean
    whether or not to join the domain (mostly useless to change unless testing)
    <tt>true</tt>

    <tt>['sssd']['enumerate']</tt>
    Boolean
    whether or not to enable enumeration (increased load on Simple AD servers, but some setups may need it)
    <tt>true</tt>

    <tt>['sssd']['packages']</tt>
    Array
    list of packages to install prior to adcli join
    <tt>varies by OS</tt>

    <tt>['sssd']['computer_name']</tt>
    String
    an optional alternate computer name to use when joining the domain (IE: ec2 instance ID)
    <tt>nil</tt>

    <tt>['sssd']['directory_name']</tt>
    String
    the directory name, as specified in "Directory Details" in the AWS console
    <tt>nil</tt>

    <tt>['sssd']['realm']['credentials_source']</tt>
    String
    source of the realm credentials. see "Realm Credentials" below
    <tt>data_bag</tt>

    <tt>['sssd']['realm']['databag']</tt>
    String
    databag that contains the username and password used in "adcli join" or "realm join"
    <tt>nil</tt>

    <tt>['sssd']['realm']['databag_item']</tt>
    String
    databag item that contains the username and password used in "adcli join" or "realm join"
    <tt>nil</tt>

    <tt>['sssd']['service_actions']</tt>
    Symbol | Array of symbols
    the actions to run on the <tt>sssd</tt> service
    <tt>[:enable]</tt>

    <tt>['sssd']['encypted_data_bag_secret']</tt>
    String
    The encrypted databag secret
    <tt>nil</tt>

    <tt>['sssd']['basedir']</tt>
    String
    The base directory under which users home directory should be created
    <tt>/home</tt>

## Usage

### sssd::default

Include `sssd` in your node's `run_list`:

```json
{
  "run_list": [
    "recipe[sssd::default]"
  ]
}
```

## Realm Credentials

This cookbook natively supports passing the realm credentials in via a data bag.
For those not using data bags or an alternate credential manager, you can implement
a wrapper cookbook and pass the realm credentials in via ```node.run_state```.

Example:

```ruby
node.run_state['realm_username'] = 'Administrator'
node.run_state['realm_password'] = 'N0TaR34lPassw0rd'

include_recipe 'sssd'
```

## Testing

See .kitchen.yml and .kitchen.local.yml.EXAMPLE.

To create a local databag for use with test kitchen's with-registration suite, do:

  ```bash
  $ openssl rand -base64 512 | tr -d '\r\n' > test/integration/with-registration/encrypted_data_bag_secret_key
  $ knife solo data bag create sssd_credentials realm -c .chef/solo.rb
  ```

## License and Authors

Author:: Localytics (oss@localytics.com)

```text
Copyright:: 2015, Localytics

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```


text:
import AbstractBehavior = require('./AbstractBehavior');
import DisplayObject = require('../display/DisplayObject');
import Stage = require('../display/Stage');
import Container = require('../display/Container');
import PointerEvent = require('../event/PointerEvent');
import DisplayType = require('../enum/DisplayType');

class FollowMouseBehavior extends AbstractBehavior
{
	private _stage:Stage;

	public initialize(displayObject:DisplayObject):void
	{
		super.initialize(displayObject);

		this.owner.enableMouseInteraction();
		this.owner.cursor = 'pointer';

		this._stage = this.owner.stage;
		if(!this._stage){
			throw new Error('stage must be known before adding this behavior to a component.')
		}

		this._stage.addEventListener(Stage.EVENT_STAGE_MOUSE_MOVE, this.onMouseMove );
	}

	public onMouseMove = (e:PointerEvent) => {
		var owner = this.owner;
		owner.x = e.stageX;
		owner.y = e.stageY;
	}

	public destruct():void
	{
		this._stage.removeEventListener(Stage.EVENT_STAGE_MOUSE_MOVE, this.onMouseMove );
		this._stage = null;
		super.destruct();
	}
}

export = FollowMouseBehavior;


text:
require "cs_capacityretriever/version"

module CsCapacityretriever
  # Your code goes here...
end


text:
package org.kuali.kfs.module.bc.businessobject;

import org.kuali.rice.krad.bo.TransientBusinessObjectBase;

/**
 * Used to represent a dynamic options selection using explicitly typed key/label pair
 */
public class BCKeyLabelPair extends TransientBusinessObjectBase {
    public String key;
    public String label;

    public BCKeyLabelPair() {
    }

    public BCKeyLabelPair(String key, String label) {
        this.key = key;
        this.label = label;
    }

    public String getKey() {
        return key;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public void setKey(String key) {
        this.key = key;
    }

}


text:
controller.request('put', [ midleware, ... ]);
controller.query('get', [ ... ]);
controller.document('delete', [ ... ]);

controller.document([ ... ]); // all verbs
controller.document('put get delete', [ ... ]); // some verbs

// ---

var requestMiddleware = {
  all: [],
  post: [],
  put: [],
  get: [],
  delete: [],
  head: []
};

function configureControllerRequest (controller) {
  Object.keys(requestMiddleware).forEach(function (verb) {
    controller[verb](basePath, requestMiddleware[verb]);
  });
}

function request (controller, verbs, middleware) {
  if (middleware === undefined) {
    middleware = verbs;
    verbs = 'all';
  }

  if (typeof verbs === 'string') verbs = verbs.split(' ');

  verbs.forEach(function (verb) {
    requestMiddleware[verb].push(middleware);
  });

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <groupId>com.communote.plugins</groupId>
        <artifactId>communote-plugins-parent</artifactId>
        <version>3.6-SNAPSHOT</version>
        <relativePath></relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>communote-plugins-content-types-extractor</artifactId>
    <packaging>bundle</packaging>
    <name>Communote - Plugins - Content Types Extractor</name>
    <description></description>
    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.communote.plugins</groupId>
            <artifactId>communote-plugins-core</artifactId>
            <scope>provided</scope>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.communote.server</groupId>
			<artifactId>communote-server-persistence</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.ipojo</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.ipojo.annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <defaultGoal>package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>com.communote.plugins.contenttypes,com.communote.plugins.mediaparser,com.communote.plugins.mediaparser.mediatype</Export-Package>
                        <Bundle-Activator>com.communote.plugins.ContentTypeExtractorActivator</Bundle-Activator>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-ipojo-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>ipojo-bundle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>yuicompressor-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>compress</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TwitchLib.Models.API.Video
{
    /// Class representing FPS data.
    public class FPS
    {
        /// FPS can return data either in "high", or in "1080p". IF this boolean is set, it means that the integer values (1080p, 144p, etc) properties are being used.
        public bool UsingIntegerQualities = false;
        ///
        public string p1080 { get; protected set; }
        ///
        public string p144 { get; protected set; }
        ///
        public string p240 { get; protected set; }
        ///
        public string p360 { get; protected set; }
        ///
        public string p480 { get; protected set; }
        ///
        public string p720 { get; protected set; }

        ///
        public double Chunked { get; protected set; }
        ///
        public double High { get; protected set; }
        ///
        public double Low { get; protected set; }
        ///
        public double Medium { get; protected set; }
        ///
        public double Mobile { get; protected set; }

        ///
        /// FPS data constructor
        ///
        /// <param name="json"></param>
        public FPS(JToken json)
        {
            if(json.SelectToken("chunked") != null)
            {
                UsingIntegerQualities = false;
                Chunked = double.Parse(json.SelectToken("chunked").ToString());
                High = double.Parse(json.SelectToken("high").ToString());
                Low = double.Parse(json.SelectToken("low").ToString());
                Medium = double.Parse(json.SelectToken("medium").ToString());
                Mobile = double.Parse(json.SelectToken("mobile").ToString());
            } else
            {
                UsingIntegerQualities = true;
                p1080 = json.SelectToken("1080p")?.ToString();
                p144 = json.SelectToken("144p")?.ToString();
                p240 = json.SelectToken("240p")?.ToString();
                p360 = json.SelectToken("360p")?.ToString();
                p480 = json.SelectToken("480p")?.ToString();
                p720 = json.SelectToken("720p")?.ToString();
            }

        }
    }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.ctc.wstx.dtd (Woodstox 6.3.0 API)</title>
<meta name="date" content="2022-06-27">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package com.ctc.wstx.dtd

Package that contains Woodstox classes that implement DTD handling.

See: Description

Interface Summary

Interface
Description

DTDEventListener

Class Summary

Class
Description

ChoiceContentSpec

Content specification that defines content model that has
 multiple alternative elements; including mixed content model.

ChoiceModel

Model class that encapsulates set of sub-models, of which one (and only
 one) needs to be matched.

ConcatModel

Model class that represents sequence of 2 sub-models, needed to be
 matched in the order.

ContentSpec

Abstract base class for classes that contain parts of a content
 specification of an element defined in DTD.

DefaultAttrValue

Simple container class used to contain information about the default
 value for an attribute.

DFAState

Class that represents a state in DFA used for validating complex
 DTD content models.

DFAValidator

Validator class that is based on a DFA constructed from DTD content
 specification.

DTDAttribute

Base class for objects that contain attribute definitions from DTD.

DTDCdataAttr

Simple DTDAttribute sub-class used for plain vanilla CDATA
 valued attributes.

DTDElement

Class that contains element definitions from DTD.

DTDEntitiesAttr

Specific attribute class for attributes that contain (unique)
 identifiers.

DTDEntityAttr

Specific attribute class for attributes that contain (unique)
 identifiers.

DTDEnumAttr

Specific attribute class for attributes that have enumerated values.

DTDId

Simple key object class, used for accessing (external) DTDs when stored for
 caching.

DTDIdAttr

Specific attribute class for attributes that contain (unique)
 identifiers.

DTDIdRefAttr

Attribute class for attributes that contain references
 to elements that have matching identifier specified.

DTDIdRefsAttr

Attribute class for attributes that contain multiple references
 to elements that have matching identifier specified.

DTDNmTokenAttr

Specific attribute class for attributes that contain (unique)
 identifiers.

DTDNmTokensAttr

Specific attribute class for attributes that contain (unique)
 identifiers.

DTDNotationAttr

Specific attribute class for attributes that are of NOTATION type,
 and also contain enumerated set of legal values.

DTDSchemaFactory

Factory for creating DTD validator schema objects (shareable stateless
 "blueprints" for creating actual validators).

DTDSubset

This is the abstract base class that implements the standard Stax2
 validation schema base class (XMLValidationSchema, as well
 as specifies extended Woodstox-specific interface for accessing
 DTD-specific things like entity expansions and notation properties.

DTDSubsetImpl

The default implementation of DTDSubset

DTDTypingNonValidator

This class is a "non-validating validator"; a validator-like object
 that handles DTD-based non-validation functionality: determining type
 information and default values.

DTDValidator

Woodstox implementation of XMLValidator; the class that
 handles DTD-based validation.

DTDValidatorBase

Shared abstract base class for Woodstox implementations
 of XMLValidator for DTD validation.

EmptyValidator

Simple content model validator that accepts no elements, ever; this
 is true for pure #PCDATA content model as well as EMPTY content model.

FullDTDReader

Reader that reads in DTD information from internal or external subset.

LargePrefixedNameSet

Implementation of PrefixedNameSet suitable for storing large number
 of entries; basically anything above trivially small sets (4 or less).

MinimalDTDReader

Minimal DTD reader implementation that only knows how to skip
 internal DTD subsets.

ModelNode

Abstract base class for classes constructed from ContentSpec
 objects, when they get rewritten (when their ContentSpec.rewrite()
 gets called).

OptionalModel

Content specification class that represents an optional specification.

PrefixedNameSet

SeqContentSpec

Content specification that defines model that has sequence of one or more
 elements that have to come in the specified order.

SmallPrefixedNameSet

PrefixedNameSet implementation suitable for storing small set of PrefixedName
 values (generally 8 or less).

StarModel

Model class that represents any number of repetitions of its submodel
 (including no repetitions).

StructValidator

Base class for validator Objects used to validate tree structure of an
 XML-document against DTD.

TokenContentSpec

Content specification that defines content model consisting of just
 one allowed element.

TokenModel

Model class that encapsulates a single (obligatory) token instance.

Package com.ctc.wstx.dtd Description

Package that contains Woodstox classes that implement DTD handling.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2022 FasterXML. All rights reserved.


text:
FOUNDATION_EXPORT double Pods_LLVCS_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_LLVCS_TestsVersionString[];


text:
package com.amazonaws.services.iotanalytics.model;

import javax.annotation.Generated;

/**
 * <p>
 * The request was denied due to request throttling.
 * </p>
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ThrottlingException extends com.amazonaws.services.iotanalytics.model.AWSIoTAnalyticsException {
    private static final long serialVersionUID = 1L;

    /**
     * Constructs a new ThrottlingException with the specified error message.
     *
     * @param message
     *        Describes the error encountered.
     */
    public ThrottlingException(String message) {
        super(message);
    }

}


text:
package com.cfcc.deptone.excel;

import com.cfcc.deptone.excel.gen.POIException;
import com.cfcc.deptone.excel.util.POIExcelUtil;

/**
 * Created by wanghuanyu on 2015/6/9.
 */
public class ExcelUtilTest {

    public void mergeExcelTest() throws POIException {
        POIExcelUtil.mergeExcel(new String[]{"D:\\temp\\merge\\source-a.xlsx", "D:\\temp\\merge\\source-b.xlsx", "D:\\temp\\merge\\监控统计报表.xlsx"}, "D:\\temp\\merge\\creatReport-merge.xlsx");
    }

    public void mergeExcelTest2003() throws POIException {
        POIExcelUtil.mergeExcel(new String[]{"D:\\temp\\merge\\source-a.xls", "D:\\temp\\merge\\source-b.xls", "D:\\temp\\merge\\监控统计报表.xls"}, "D:\\temp\\merge\\creatReport-merge.xls");
    }
}


text:
package org.yeastrc.nrseq_fasta_importer.taxonomy_id_determination.webservice_clients.ncbi.by_protein.webservice_response_dto;

import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;

@XmlRootElement(name="eSummaryResult")
public class NCBIProteinResponseDTO {

	private String error;

	private DocSum docSum;

	@XmlElement(name="DocSum")
	public DocSum getDocSum() {
		return docSum;
	}

	public void setDocSum(DocSum docSum) {
		this.docSum = docSum;
	}

	@XmlElement(name="ERROR")
	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}

	/**
	 *
	 *
	 */
	public static class DocSum {

		List<Item> items;

		@XmlElement(name="Item")
		public List<Item> getItems() {
			return items;
		}

		public void setItems(List<Item> items) {
			this.items = items;
		}
	}

	/**
	 *
	 *
	 */
	public static class Item {

		private String name;

		private String value;

		@XmlAttribute(name="Name")
		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		@XmlValue //  value/content of <Item> element
		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

	}
}


text:
require 'helper'

class TestGetEntry < ActiveSupport::TestCase
  context "A SugarCRM.connection" do
    setup do
      @response = SugarCRM.connection.get_entry(
        "Users",
        1,
        {:fields => ["first_name", "last_name", "deleted", "date_modified"]}
      )
    end
    should "return an object when #get_entry" do
      assert_instance_of SugarCRM::User, @response
    end
    should "typecast boolean fields properly" do
      assert_instance_of FalseClass, @response.deleted
    end
    should "typecast date_time fields properly" do
      assert_instance_of DateTime, @response.date_modified
    end
  end
end


text:
#ifndef FREERDP_LIB_CORE_CONNECTION_H
#define FREERDP_LIB_CORE_CONNECTION_H

#include "rdp.h"
#include "tpkt.h"
#include "tpdu.h"
#include "nego.h"
#include "mcs.h"
#include "activation.h"
#include "state.h"

#include <freerdp/settings.h>
#include <freerdp/api.h>

enum CLIENT_CONNECTION_STATE
{
	CLIENT_STATE_INITIAL,
	CLIENT_STATE_PRECONNECT_PASSED,
	CLIENT_STATE_POSTCONNECT_PASSED
};

FREERDP_LOCAL BOOL rdp_client_connect(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_disconnect(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_disconnect_and_clear(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_reconnect(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_redirect(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_client_connect_auto_detect(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL state_run_t rdp_client_connect_license(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL state_run_t rdp_client_connect_demand_active(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL state_run_t rdp_client_connect_confirm_active(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_client_transition_to_state(rdpRdp* rdp, CONNECTION_STATE state);

FREERDP_LOCAL CONNECTION_STATE rdp_get_state(const rdpRdp* rdp);
FREERDP_LOCAL const char* rdp_state_string(CONNECTION_STATE state);

FREERDP_LOCAL BOOL rdp_server_accept_nego(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_server_accept_mcs_connect_initial(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_server_accept_mcs_erect_domain_request(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_server_accept_mcs_attach_user_request(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_server_accept_confirm_active(rdpRdp* rdp, wStream* s, UINT16 pduLength);
FREERDP_LOCAL BOOL rdp_server_establish_keys(rdpRdp* rdp, wStream* s);
FREERDP_LOCAL BOOL rdp_server_reactivate(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_server_transition_to_state(rdpRdp* rdp, CONNECTION_STATE state);
FREERDP_LOCAL const char* rdp_get_state_string(const rdpRdp* rdp);

FREERDP_LOCAL const char* rdp_client_connection_state_string(int state);

FREERDP_LOCAL BOOL rdp_channels_from_mcs(rdpSettings* settings, const rdpRdp* rdp);

#endif /* FREERDP_LIB_CORE_CONNECTION_H */


text:
FROM nginx:stable-alpine

RUN apk --no-cache add bash ca-certificates

# delete default nginx html
RUN rm -rf /usr/share/nginx/html/*

# copy in pre-built site content
COPY  ./build/ /usr/share/nginx/html/

# configure nginx
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]


text:
using System;

namespace _09.Multiply_Evens_by_Odds
{
    public class Program
    {
        public static void Main()
        {
            var number = int.Parse(Console.ReadLine());
            number = Math.Abs(number);
            Print(number);
        }

        public static void Print(int number)
        {
            int oddDigitsSum = SumOfOddDigits(number);
            int evenDigitsSum = SumOfEvenDigits(number);
            Console.WriteLine(oddDigitsSum * evenDigitsSum);
        }

        public static int SumOfOddDigits(int number)
        {
            var sumOfOddDigits = 0;
            while (number > 0)
            {
                var lastDigit = number % 10;
                if (lastDigit % 2 != 0)
                {
                    sumOfOddDigits += lastDigit;
                }
                number /= 10;
            }
            return sumOfOddDigits;
        }

        public static int SumOfEvenDigits(int number)
        {
            var sumOfEvenDigits = 0;
            while (number > 0)
            {
                var lastDigit = number % 10;
                if (lastDigit % 2 == 0)
                {
                    sumOfEvenDigits += lastDigit;
                }
                number /= 10;
            }
            return sumOfEvenDigits;
        }
    }
}


text:
package org.apache.spark.sql.hbase

import org.apache.hadoop.hbase.{HBaseTestingUtility, MiniHBaseCluster}
import org.apache.spark.{SparkConf, SparkContext}

object TestHbase extends HBaseSparkSession(
  new SparkContext("local[2]", "TestSQLContext", new SparkConf(true)
    .set("spark.hadoop.hbase.zookeeper.quorum", "localhost"))) {

  @transient val testUtil: HBaseTestingUtility =
    new HBaseTestingUtility(sparkContext.hadoopConfiguration)

  testUtil.getConfiguration.set("hbase.fs.tmp.dir", System.getProperty("java.io.tmpdir"))

  testUtil.startMiniZKCluster
  logDebug(s"Spin up hbase minicluster with 1 master, 1 RS, 1 dataNode")

  @transient val cluster: MiniHBaseCluster = testUtil.startMiniHBaseCluster(1, 1)
  logInfo(s"Started HBaseMiniCluster with regions = ${cluster.countServedRegions}")

  logInfo(s"Configuration zkPort="
    + s"${sparkContext.hadoopConfiguration.get("hbase.zookeeper.property.clientPort")}")

  // The following operation will initialize the HBaseCatalog.
  // And it should be done after starting MiniHBaseCluster
  sharedState.externalCatalog.asInstanceOf[HBaseCatalog].deploySuccessfully_internal = Some(true)
  sharedState.externalCatalog.asInstanceOf[HBaseCatalog].pwdIsAccessible = true

  def hbaseAdmin = sharedState.externalCatalog.asInstanceOf[HBaseCatalog].admin
}


text:
#include <aws/cloudformation/model/DescribeAccountLimitsRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::CloudFormation::Model;
using namespace Aws::Utils;

DescribeAccountLimitsRequest::DescribeAccountLimitsRequest() :
    m_nextTokenHasBeenSet(false)
{
}

Aws::String DescribeAccountLimitsRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=DescribeAccountLimits&";
  if(m_nextTokenHasBeenSet)
  {
    ss << "NextToken=" << StringUtils::URLEncode(m_nextToken.c_str()) << "&";
  }
  ss << "Version=2010-05-15";
  return ss.str();
}


text:
package org.oscm.billingservice.business.model.mpownershare;

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

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "marketplace", "revenuesOverAllMarketplaces" })
@XmlRootElement(name = "Currency")
public class Currency {

    @XmlElement(name = "Marketplace", required = true)
    protected List<Marketplace> marketplace;

    @XmlElement(name = "RevenuesOverAllMarketplaces", required = true)
    protected RevenuesOverAllMarketplaces revenuesOverAllMarketplaces = new RevenuesOverAllMarketplaces();

    @XmlAttribute(name = "id", required = true)
    protected String id;

    public Currency() {
    }

    public Currency(String id) {
        setId(id);
    }

    public List<Marketplace> getMarketplace() {
        if (marketplace == null) {
            marketplace = new ArrayList<Marketplace>();
        }
        return this.marketplace;
    }

    public Marketplace getMarketplace(long key) {
        for (Marketplace marketplace : getMarketplace()) {
            if (marketplace.getKey().longValue() == key) {
                return marketplace;
            }
        }
        return null;

    }

    public void addMarketplace(Marketplace marketplace) {
        getMarketplace().add(marketplace);
    }

    public RevenuesOverAllMarketplaces getRevenuesOverAllMarketplaces() {
        return revenuesOverAllMarketplaces;
    }

    public void setRevenuesOverAllMarketplaces(
            RevenuesOverAllMarketplaces revenuesOverAllMarketplaces) {
        this.revenuesOverAllMarketplaces = revenuesOverAllMarketplaces;
    }

    public String getId() {
        return id;
    }

    public void setId(String value) {
        this.id = value;
    }

    public void calculate() {
        for (Marketplace marketplace : getMarketplace()) {
            marketplace.calculate();
        }
        calculateRevenuesAllMarketplaceForModels();
    }

    private void calculateRevenuesAllMarketplaceForModels() {
        revenuesOverAllMarketplaces.calculate();
    }
}


text:
install_dir = node['package']['install-dir']
server_dir = node['unifiedpush']['aerobase-server']['dir']
server_etc_dir = "#{server_dir}/etc"
server_cli_dir = "#{server_dir}/cli"
server_mssql_dir = "#{server_dir}/bin/mssql"

account_helper = AccountHelper.new(node)
os_helper = OsHelper.new(node)
mssql_helper = MsSQLHelper.new(node)
mysql_helper = MySQLHelper.new(node)
pgsql_helper = PgHelper.new(node)

aerobase_user = account_helper.aerobase_user
aerobase_group = account_helper.aerobase_group

keycloak_vars = node['unifiedpush']['keycloak-server'].to_hash

database_host = node['unifiedpush']['keycloak-server']['db_host']
database_port = node['unifiedpush']['keycloak-server']['db_port']
database_name = node['unifiedpush']['keycloak-server']['db_database']
database_username = node['unifiedpush']['keycloak-server']['db_username']
database_password = node['unifiedpush']['keycloak-server']['db_password']
database_adapter = node['unifiedpush']['aerobase-server']['db_adapter']

ruby_block 'copy_keycloak_sources' do
  block do
    FileUtils.cp_r "#{install_dir}/embedded/apps/keycloak-server/keycloak/.", "#{server_dir}"
  end
  action :run
end

# Additional aerobase config dirs
[
  server_etc_dir,
  server_cli_dir,
  server_mssql_dir
].each do |dir_name|
  directory dir_name do
    owner aerobase_user
    group aerobase_group
    mode 0775
    recursive true
  end
end

# Aggreagate all server realms
if node['unifiedpush']['keycloak-server']['realm_default_enable']
  server_realms = server_dir + "/standalone/configuration/keycloak-server-aerobase-realm.json,"
else
  server_realms = ""
end

node['unifiedpush']['keycloak-server']['realm_files'].each do |file|
  server_realms = server_realms + file + ","
end

# Always include modules since they are statically referenced from war file.
include_recipe "aerobase::postgresql-module-wildfly-conf"
include_recipe "aerobase::mssql-module-wildfly-conf"
include_recipe "aerobase::mysql-module-wildfly-conf"
include_recipe "aerobase::mariadb-module-wildfly-conf"

if database_adapter == 'postgresql'
  jdbc_url = pgsql_helper.psql_jdbc_url(database_host, database_port, database_name)
  jdbc_hbm_dialect = "org.hibernate.dialect.PostgreSQL95Dialect"
  jdbc_driver_name = "postgresql"
  jdbc_driver_module_name = "org.postgresql"
  jdbc_driver_class_name = "org.postgresql.xa.PGXADataSource"
end

if database_adapter == 'mssql'
  jdbc_url = mssql_helper.mssql_jdbc_url(database_host, database_port, database_name, database_username, database_password)
  jdbc_hbm_dialect = "org.hibernate.dialect.SQLServer2012Dialect"
  jdbc_driver_name = "sqlserver"
  jdbc_driver_module_name = "com.microsoft"
  jdbc_driver_class_name = "com.microsoft.sqlserver.jdbc.SQLServerXADataSource"
end

if mysql_helper.is_mysql_type
  jdbc_url = mysql_helper.mysql_jdbc_url(database_host, database_port, database_name)
  jdbc_hbm_dialect = mysql_helper.mysql_jdbc_hbm_dialect
  jdbc_driver_name = mysql_helper.mysql_type
  jdbc_driver_module_name = mysql_helper.mysql_jdbc_driver_module_name
  jdbc_driver_class_name = mysql_helper.mysql_jdbc_driver_class_name
end

# install keycloak-server-wildfly-cli.erb to cli directory
# update keycloak-server-wildfly-cli.erb on KC version upgrade
# source template 'keycloak-overlay-X.X.X.Final/bin/keycloak-install-ha.cli'
template "#{server_dir}/cli/keycloak-server-wildfly.cli" do
  owner aerobase_user
  group aerobase_group
  mode 0755
  source "keycloak-server-wildfly-cli.erb"
  variables(keycloak_vars.merge({
      :server_dir => "#{server_dir}",
	  :jdbc_url => jdbc_url,
	  :jdbc_driver_name => jdbc_driver_name,
	  :jdbc_driver_module_name => jdbc_driver_module_name,
	  :jdbc_driver_class_name => jdbc_driver_class_name
    }
  ))
end

template "#{server_dir}/cli/keycloak-server-aerobase-realms.cli" do
  owner aerobase_user
  group aerobase_group
  mode 0755
  source "keycloak-server-aerobase-realms-cli.erb"
  variables(keycloak_vars.merge({
      :server_realms => "#{server_realms}"
    }
  ))
end

if os_helper.is_windows?
  cli_cmd = "jboss-cli.bat"
else
  cli_cmd = "jboss-cli.sh"
end

execute 'KC datasource and config cli script' do
  command "#{server_dir}/bin/#{cli_cmd} --file=#{server_dir}/cli/keycloak-server-wildfly.cli"
end

execute 'KC datasource and config cli script' do
  command "#{server_dir}/bin/#{cli_cmd} --file=#{server_dir}/cli/keycloak-server-aerobase-realms.cli"
end

# Copy spi resources
ruby_block 'copy_aerobase_keycloak_spi' do
  block do
    FileUtils.cp_r "#{install_dir}/embedded/apps/aerobase-keycloak-spi/.", "#{server_dir}/standalone/deployments/"
  end
  action :run
  only_if { node['unifiedpush']['keycloak-server']['aerobase_spi'] }
end

# Copy spi resources
ruby_block 'copy_aerobase_keycloak_patch' do
  block do
    FileUtils.cp_r "#{install_dir}/embedded/apps/aerobase-keycloak-patch/keycloak-services/.", "#{server_dir}/modules/system/layers/keycloak/org/keycloak/keycloak-services/main/"
	FileUtils.cp_r "#{install_dir}/embedded/apps/aerobase-keycloak-patch/keycloak-server-spi/.", "#{server_dir}/modules/system/layers/keycloak/org/keycloak/keycloak-server-spi/main/"
	FileUtils.cp_r "#{install_dir}/embedded/apps/aerobase-keycloak-patch/keycloak-ldap-federation/.", "#{server_dir}/modules/system/layers/keycloak/org/keycloak/keycloak-ldap-federation/main/"
	FileUtils.cp_r "#{install_dir}/embedded/apps/aerobase-keycloak-patch/keycloak-kerberos-federation/.", "#{server_dir}/modules/system/layers/keycloak/org/keycloak/keycloak-kerberos-federation/main/"
  end
  action :run
  only_if { node['unifiedpush']['keycloak-server']['aerobase_patch'] }
end


text:
import {Injectable} from '@angular/core';
import {AdState, AdStateItem} from '../redux/interfaces';

export const VK_API_VERSION = 5.68;
export const GROUP_ID = -151485063; // vk.com/arendahashtag

@Injectable()
export class VkApiService{

  constructor() {}

  createSearchQuery(adState: AdState): string {
    return this.createHashtagString(adState) || '#arendahashtag';
  }
  createWallPostMessage(adState: AdState): string {
    let tags = this.createHashtagString(adState);

    return `${adState.description}

#arendahashtag ${tags}`;
  }

  private createHashtagString(adState: AdState): string {
    let tags: string = Object.keys(adState)
      .map(key => adState[key])
      .filter(Array.isArray)
      .map(x => x[0])
      .filter(x => x.tag != null)
      .map(x => x.tag)
      .join(' ');

    return `${tags}`;
  }

  static createCityHashtag(city: AdStateItem): string {
    const ID_PREFIX = 'cid';
    let title = city.title.replace(/[-()\s]/gi, '');

    //TODO: return when get many users
    // return `#${ID_PREFIX + city.id} #${title}`;
    return `#${title}`;
  }
}


text:
package com.dream.android.sample.lib.utils;

import android.app.Activity;
import com.dream.android.sample.lib.R;

public class ActivityAnimator {

	public void flipHorizontalAnimation(Activity a) {
		a.overridePendingTransition(R.anim.flip_horizontal_in, R.anim.flip_horizontal_out);
	}

	public void flipVerticalAnimation(Activity a) {
		a.overridePendingTransition(R.anim.flip_vertical_in, R.anim.flip_vertical_out);
	}

	public void fadeAnimation(Activity a) {
		a.overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
	}

	public void disappearTopLeftAnimation(Activity a) {
		a.overridePendingTransition(R.anim.disappear_top_left_in, R.anim.disappear_top_left_out);
	}

	public void appearTopLeftAnimation(Activity a) {
		a.overridePendingTransition(R.anim.appear_top_left_in, R.anim.appear_top_left_out);
	}

	public void disappearBottomRightAnimation(Activity a) {
		a.overridePendingTransition(R.anim.disappear_bottom_right_in, R.anim.disappear_bottom_right_out);
	}

	public void appearBottomRightAnimation(Activity a) {
		a.overridePendingTransition(R.anim.appear_bottom_right_in, R.anim.appear_bottom_right_out);
	}

	public void unzoomAnimation(Activity a) {
		a.overridePendingTransition(R.anim.unzoom_in, R.anim.unzoom_out);
	}

    public void PullRightPushLeft(Activity a) {
        a.overridePendingTransition(R.anim.pull_in_right, R.anim.push_out_left);
    }

    public void PullLeftPushRight(Activity a) {
        a.overridePendingTransition(R.anim.pull_in_left, R.anim.push_out_right);
    }

	public void BottomIn(Activity a) {
		a.overridePendingTransition(R.anim.dialog_bottom_enter, R.anim.hold);
	}

	public void BottomExit(Activity a) {
		a.overridePendingTransition(R.anim.hold, R.anim.dialog_bottom_exit);
	}
}


text:
var
  classTransformation = require('./../lib/transformation/classes'),
  Transformer = require('./../lib/transformer'),
  transformer = new Transformer();

module.exports = function (program, file) {
  transformer.readFile(file[0]);
  transformer.applyTransformation(classTransformation);
  transformer.writeFile(program.outFile);

  console.log('The file "' + program.outFile + '" has been written.');
};