text:
package net.sourceforge.marathon.javaagent.server;

import java.util.logging.Logger;

import net.sourceforge.marathon.json.JSONObject;

public class Route {

    public static final Logger LOGGER = Logger.getLogger(Route.class.getName());

    private final java.lang.reflect.Method proc;
    private final JSONObject params;
    private final RouteMap map;

    public Route(java.lang.reflect.Method proc, JSONObject params, RouteMap map) {
        this.proc = proc;
        this.params = params;
        this.map = map;
    }

    public java.lang.reflect.Method getProc() {
        return proc;
    }

    public JSONObject getParams() {
        return params;
    }

    public RouteMap getMap() {
        return map;
    }

    @Override
    public String toString() {
        return "proc = " + (proc != null ? proc.getName() : "") + " params = " + params + " map = " + map;
    }
}


text:
package suzaku.ui.layout

import suzaku.ui.UIProtocol.UIChannel
import suzaku.ui._
import suzaku.ui.style.LengthDimension

import scala.language.implicitConversions

object GridLayout extends WidgetProtocolProvider {
  import GridLayoutProtocol._

  class WProxy private[GridLayout] (bd: WBlueprint)(widgetId: Int, uiChannel: UIChannel)
      extends WidgetProxy(GridLayoutProtocol, bd, widgetId, uiChannel) {

    override def process = {
      case message =>
        super.process(message)
    }

    override def initWidget = ChannelContext(bd.grid)

    override def update(newBlueprint: WBlueprint) = {
      if (newBlueprint.grid != blueprint.grid)
        send(SetGrid(newBlueprint.grid))
      super.update(newBlueprint)
    }
  }

  case class WBlueprint private[GridLayout] (grid: GridDef)(content: List[Blueprint]) extends WidgetBlueprint {
    type P     = GridLayoutProtocol.type
    type Proxy = WProxy
    type This  = WBlueprint

    override val children = content

    override def createProxy(widgetId: Int, uiChannel: UIChannel) = new WProxy(this)(widgetId, uiChannel)
  }

  override def widgetProtocol = GridLayoutProtocol

  def apply(grid: GridDef)(content: Blueprint*): WBlueprint = WBlueprint(grid)(content.toList)

  def apply(cols: TrackTemplate, rows: TrackTemplate, slots: Seq[Seq[LayoutId]])(content: Blueprint*): WBlueprint =
    WBlueprint(GridDef(cols, rows, slots))(content.toList)
}

trait GridImplicits {
  import suzaku.ui.layout.GridLayoutProtocol._

  implicit def length2track(size: LengthDimension): TrackTemplate = TrackTemplate(TrackSize(size))

  implicit def minmax2track(minmax: (LengthDimension, LengthDimension)): TrackTemplate =
    TrackTemplate(TrackMinMax(minmax._1, minmax._2))
}

redpajama_set_name: RedPajamaGithub


text:
/* Generated By:JJTree: Do not edit this line. ASTgroup_body.java */

package org.apache.james.mime4j.field.address.parser;

public class ASTgroup_body extends SimpleNode {
  public ASTgroup_body(int id) {
    super(id);
  }

  public ASTgroup_body(AddressListParser p, int id) {
    super(p, id);
  }

  /** Accept the visitor. **/
  public Object jjtAccept(AddressListParserVisitor visitor, Object data) {
    return visitor.visit(this, data);
  }
}


text:
'use strict';

angular.module('av001App')
    .controller('LineItemDetailController', function ($scope, $rootScope, $stateParams, entity, LineItem, Commande, Product) {
        $scope.lineItem = entity;
        $scope.load = function (id) {
            LineItem.get({id: id}, function(result) {
                $scope.lineItem = result;
            });
        };
        var unsubscribe = $rootScope.$on('av001App:lineItemUpdate', function(event, result) {
            $scope.lineItem = result;
        });
        $scope.$on('$destroy', unsubscribe);

    });


text: export Bitrix from "./Bitrix";


text: console.log('base.config');


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

namespace Ex01.HelloAutofac
{
    class SayHelloInEnglish : ISayHello
    {
        public void Run()
        {
            Console.WriteLine("Hello, Autofac!");
        }
    }
}


text:
import { OFFICIAL_PUPPET_DEPENDENCIES } from '../src/puppet-config.js'

async function main () {
  const puppetNameList = Object.keys(OFFICIAL_PUPPET_DEPENDENCIES)
  const publicNameList = puppetNameList.filter(name => /^[^@]/.test(name))
  const urlPath = publicNameList.join('-vs-')
  const url = 'https://www.npmtrends.com/' + urlPath
  console.info(url)
}

main()
  .catch(console.error)


text:
class AddColumnsToBranch < ActiveRecord::Migration
  def self.up
    add_column :branches, :parent_blob_id, :integer
    add_column :branches, :child_blob_id, :integer
  end

  def self.down
    remove_column :branches, :child_blob_id
    remove_column :branches, :parent_blob_id
  end
end


text:
`ts-force` provides a built-in "query builder" that allows generation of SOQL queries via structured data.

There are several advantages of using the SOQL builder over hardcode or templated strings:

* type-safe\*
* reusable
* composable
* consistent

Checkout the [Query Playground](https://stackblitz.com/edit/ts-force-query-playground) to see it in action!

{% hint style="warning" %}
Builder is not fully "type-safe"... It's still possible to generate invalid queries!
{% endhint %}

## Example

```typescript
let qry = buildQuery(Account, fields => ({
    select: [
      fields.select('name'),
      ...fields.parent('owner').select('name', 'phone'),
      fields.subQuery('contacts', subFields => {
        return {
          select: [
            subFields.parent('createdBy').select('managerId'),
            subFields.select('phone')
          ],
          where: [
            { field: subFields.select('otherCity'), op: 'LIKE', val: '%YORK' },
            'OR',
            { field: subFields.select('mailingCity'), op: 'LIKE', val: '%YORK' }
          ]
        }
      })
    ],
    where: [
      { field: fields.select('name'), op: '=', val: 'Acme' }
    ],
    orderBy: { field: fields.select('rating'), order: 'DESC' },
    limit: 5,
    offset: 5
});
```

**Outputs**

```sql
SELECT Name, Owner.Name, Owner.Phone,
 (
    SELECT CreatedBy.ManagerId, Phone
      FROM Contacts
      WHERE OtherCity LIKE '%YORK' OR MailingCity LIKE '%YORK'
 )
FROM Account
WHERE Name = 'Acme'
ORDER BY Rating DESC
LIMIT 5 OFFSET 5
```


text:
@implementation JRSearchResultsList

@synthesize ticketCellNibName = _ticketCellNibName;

- (instancetype)initWithCellNibName:(NSString *)cellNibName {
    if (self = [super init]) {
        _ticketCellNibName = cellNibName;
    }
    return self;
}

#pragma mark - <UITableViewDataSource>
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return [self.delegate tickets].count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"JRResultsTicketCell";

    JRResultsTicketCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {
        cell = [[AVIASALES_BUNDLE loadNibNamed:self.ticketCellNibName owner:self options:nil] objectAtIndex:0];
    }

    cell.flightSegmentsLayoutParameters = self.flightSegmentLayoutParameters;
    cell.ticket = [self ticketAtIndexPath:indexPath];

    return cell;
}

#pragma mark - <UITableViewDelegate>

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    JRSDKTicket *const ticket = [self ticketAtIndexPath:indexPath];
    return [JRResultsTicketCell heightWithTicket:ticket];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    const NSInteger index = indexPath.section;
    [self.delegate didSelectTicketAtIndex:index];
}

#pragma mark - Private

- (JRSDKTicket *)ticketAtIndexPath:(NSIndexPath *)indexPath {
    const NSInteger index = indexPath.section;
    return [[self.delegate tickets] objectAtIndex:index];
}

@end


text:
Django P3P
==========

.. image:: https://travis-ci.org/jjanssen/django-p3p.svg?branch=develop
    :target: http://travis-ci.org/jjanssen/django-p3p
.. image:: https://img.shields.io/pypi/v/django-p3p.svg
    :target: https://pypi.python.org/pypi/django-p3p/
.. image:: https://img.shields.io/pypi/dm/django-p3p.svg
    :target: https://pypi.python.org/pypi/django-p3p/
.. image:: https://img.shields.io/badge/wheel-yes-green.svg
    :target: https://pypi.python.org/pypi/django-p3p/
.. image:: https://img.shields.io/pypi/l/django-p3p.svg
    :target: https://pypi.python.org/pypi/django-p3p/
.. image:: https://img.shields.io/pypi/pyversions/Django.svg
    :target: https://pypi.python.org/pypi/django-p3p/
.. image:: https://coveralls.io/repos/jjanssen/django-p3p/badge.svg?branch=develop
    :target: https://coveralls.io/github/jjanssen/django-p3p?branch=develop

About Django P3P
----------------
If your webpage uses sessions you willl lose your session in Internet Explorer when your page gets embedded into in iFrame. This problem can be solved by setting application specific `P3P headers <http://en.wikipedia.org/wiki/P3P>`_.

Django P3P is an application which makes it easier to set those specific headers for your Django application. You can use an editor like IBM's P3P Policy Editor to configure your website policy to its needs.

Requirements
------------

Django 1.8.x or greater, Python 2.7 or greater.

Installation
------------

Install django-p3p with pip::

    $ pip install django-p3p

Configuration
-------------

Configuring django-p3p
^^^^^^^^^^^^^^^^^^^^^^

Add the following to your settings file:

    * Add ``p3p`` to ``INSTALLED_APPS``
    * Add ``p3p.middleware.P3PMiddleware`` to ``MIDDLEWARE_CLASSES``

URL Configuration
^^^^^^^^^^^^^^^^^

You need to include the `p3p.urls` urlpatterns in your root url configuration, for e.g.::

    (r'^w3c/', include('p3p.urls', namespace='p3p')),
    ...
    (r'^admin/', include(admin.site.urls)),

Overriding templates
^^^^^^^^^^^^^^^^^^^^

You need to override at least 2 templates to configure your project specific HTTP headers and policy:

    * `templates/p3p/headers.txt`

Contains the actual HTTP headers which are sent to the browser. For e.g.: ``CP="NOI CURa ADMa DEVa TAIa CONa OUR DELa BUS IND PHY ONL UNI PUR COM NAV DEM STA"``

    * `templates/p3p/policy.p3p`

Contains the policy as required for the application. You can generate one by using the IBM P3P Policy Editor.

.. note::

    I left the initial templates mostly blank to prevent default usage. Mainly because every application has its own specific policies and it requires you to **THINK** about what policy fits your website.


text:
require 'spec_helper'
require 'eventmachine'
require 'bot/core'
require 'fixtures/bot'

describe Bot::Core do
  include Fixtures::Bot

  before(:each) do
    # Remove prior module constant definintion for each Bot::Core init to kill warnings
    [:ROOT_DIR, :SETTINGS_DIR, :DATABASE_DIR, :SHORT_TRIGGER].each do |const|
      Bot.send(:remove_const, const) if Bot.const_defined?(const)
    end
  end

  context 'Objects' do
    context 'Adapters' do
      it 'loads an adapter' do
        with_em do
          bot = Bot::Core.new(settings_filename_fixture)
          bot.load_adapter(:dummy)
          expect(bot.adapters).to have_key(:dummy)
        end
      end
    end

    context 'Plugins' do
      it 'loads a plugin' do
        with_em do
          bot = Bot::Core.new(settings_filename_fixture)
          bot.load_plugin(:dummy)
          expect(bot.plugins).to have_key(:dummy)
        end
      end
    end
  end

  context 'Settings' do
    it 'loads settings' do
      with_em do
        bot = Bot::Core.new(settings_filename_fixture)
        expect(bot.s).to eq settings_fixture
      end
    end
  end

  context 'Blacklist' do
    before do
      @bot = Bot::Core.new(settings_filename_blacklist_fixture)
      adapter = Bot::Adapter::Irc.new(true)
      handler = Bot::Adapter::Irc::Handler.new(adapter, {})

      blacklisted_user = ':nick!blacklisted_user@test.com PRIVMSG #test :test'
      @blacklisted_user_msg = handler.parse_data(blacklisted_user)
      ok_user = ':nick!ok_user@test.com PRIVMSG #test :test'
      @ok_user_msg = handler.parse_data(ok_user)

      @blacklisted_content_msg = handler.parse_data(ok_user)
      @blacklisted_content_msg.text = 'blacklisted_content'
      @ok_content_msg = handler.parse_data(ok_user)
      @ok_content_msg.text = 'ok_content'
    end

    it 'does not load adapters in blacklist' do
      expect(@bot.adapters).to have_key(:dummy)
      expect(@bot.adapters).to_not have_key(:irc)
    end

    it 'does not load plugins in blacklist' do
      bot = Bot::Core.new(settings_filename_whitelist_fixture)
      expect(bot.plugins).to have_key(:ping)
      expect(bot.plugins).to_not have_key(:dummy)
    end

    it 'checks against blacklist for a given type' do
      expect(@bot.blacklisted?(:user, 'blacklisted_user')).to be true
      expect(@bot.blacklisted?(:user, 'safe user')).to be false
    end

    it 'does not trigger plugins for messages from blacklisted users' do
      expect(@bot.trigger_plugin('not_a_core_trigger', @blacklisted_user_msg)).to be :blacklist
      expect(@bot.trigger_plugin('not_a_core_trigger', @ok_user_msg)).to_not be :blacklist
    end

    it 'does not publish for messages from blacklisted users' do
      expect(@bot.publish(@blacklisted_user_msg)).to be :blacklist
      expect(@bot.publish(@ok_user_msg)).to_not be :blacklist
    end

    it 'does not trigger plugins for messages with blacklisted content' do
      expect(@bot.trigger_plugin('not_a_core_trigger', @blacklisted_content_msg)).to be :blacklist
      expect(@bot.trigger_plugin('not_a_core_trigger', @ok_content_msg)).to_not be :blacklist
    end

    it 'does not publish for messages from blacklisted users' do
      expect(@bot.publish(@blacklisted_content_msg)).to be :blacklist
      expect(@bot.publish(@ok_content_msg)).to_not be :blacklist
    end
  end

  context 'Reload' do
    it 'reloads plugins' do
      with_em do
        bot = Bot::Core.new(settings_filename_blacklist_fixture)
        expect(bot.plugins).to_not have_key(:ping)

        # Load new additions
        bot.instance_variable_set(:@settings_path, settings_filename_whitelist_fixture)
        bot.reload(:plugin)
        expect(bot.plugins).to have_key(:ping)

        # Unload subtractions
        bot.instance_variable_set(:@settings_path, settings_filename_blacklist_fixture)
        bot.reload(:plugin)
        expect(bot.plugins).to_not have_key(:ping)
      end
    end

    # pending 'reloads adapters' do end
  end

  context 'addressing' do
    it 'parses an address' do
      with_em do
        bot = Bot::Core.new(settings_filename_fixture)
        addr = bot.address(:dummy, 'asdf')
        expect(addr).to be_nil
      end
    end
  end
end


text:
package integration.tests.repo;

import dom.todo.ToDoItem;
import dom.todo.ToDoItems;
import fixture.todo.integtests.ToDoItemsIntegTestFixture;
import integration.tests.ToDoIntegTest;

import java.util.List;
import javax.inject.Inject;
import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class ToDoItemsTest_finders extends ToDoIntegTest {

    @Before
    public void setUpData() throws Exception {
        scenarioExecution().install(new ToDoItemsIntegTestFixture());
    }

    @Inject
    private ToDoItems toDoItems;

    private int notYetCompletedSize;
    private int completedSize;

    @Before
    public void setUp() throws Exception {
        final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
        final List<ToDoItem> completedItems = wrap(toDoItems).complete();

        notYetCompletedSize = notYetCompleteItems.size();
        completedSize = completedItems.size();

        assertThat(notYetCompletedSize, is(Matchers.greaterThan(5)));
    }

    @Test
    public void complete_and_notYetComplete() throws Exception {

        // given
        List<ToDoItem> notYetCompleteItems = wrap(service(ToDoItems.class)).notYetComplete();
        final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));

        // when
        toDoItem.completed();

        // then
        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize-1));
        assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize+1));

        // and when
        toDoItem.notYetCompleted();

        // then
        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize));
        assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize));
    }

}


text:
using UnityEngine;

public enum Direction
{
    Left = 1,
    Up = 2,
    Right = 3,
    Down = 4
}

public class GameManager : MonoBehaviour
{
    public bool isMoving { get; private set; }
    public bool isRunning { get; private set; }
    public Direction direction { get; private set; }

    int initialScore;
    Platform platform;
    Score score;

    public void Initialize()
    {
        platform.Initialize();
        score.Initialize();
        UpdateScore(true);
        isRunning = true;
    }

    public void UpdateScore(bool firstRun = false)
    {
        var result = 0;

        foreach (var tile in platform.tiles)
        {
            result += tile.value;
        }

        if (firstRun)
        {
            initialScore = result;
        }

        score.value = result - initialScore;
    }

    void HandleInput()
    {
        if (!isMoving)
        {
            if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow))
            {
                isMoving = true;
                direction = Direction.Left;
            }
            else if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow))
            {
                isMoving = true;
                direction = Direction.Up;
            }
            else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow))
            {
                isMoving = true;
                direction = Direction.Right;
            }
            else if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
            {
                isMoving = true;
                direction = Direction.Down;
            }
        }
    }

    void Awake()
    {
        platform = GameObject.Find("Tile Panel").GetComponent<Platform>();
        score = GameObject.Find("Score").GetComponent<Score>();
    }

    void Start()
    {
        Initialize();
    }

    void Update()
    {
        if (isRunning)
        {
            if (!isMoving)
            {
                // Await input.
                HandleInput();

                if (isMoving)
                {
                    // Calculate changes.
                    Calculator.Compute(platform, direction);

                    // Start animating.
                    platform.StartAnimating();
                }
            }
            else if (platform.animationState == AnimationState.Stopped)
            {
                isMoving = false;
                isRunning = Calculator.CanMove(platform);
            }
        }
        else
        {
            // Debug.Log("The game has ended.");
        }
    }
}


text:
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
    Created on : 15-mar-2016, 18:11:49
    Author     : Aski
*/

#shrinkMe {
    -moz-animation: cssAnimation 0s ease-in 15s forwards;
    /* Firefox */
    -webkit-animation: cssAnimation 0s ease-in 15s forwards;
    /* Safari and Chrome */
    -o-animation: cssAnimation 0s ease-in 15s forwards;
    /* Opera */
    animation: cssAnimation 0s ease-in 15s forwards;
    -webkit-animation-fill-mode: forwards;
    -o-animation-fill-mode:forwards;
    -moz-animation-fill-mode:forwards;
    animation-fill-mode: forwards;

/*    &:hover{
      transition: .5s;
      max-width: 40% !important;
      background: #333;
      flex-grow: 2;
      cursor: pointer;
    }*/
}

@keyframes cssAnimation {
    to {
        width:50px;
        height: auto;
        overflow:hidden;
        flex: 0.5;
    }
}
@-webkit-keyframes cssAnimation {
    to {
        width:50px;
        height:auto;
        flex: 0.5;

       /* visibility:hidden;*/
    }
}

@-moz-keyframes cssAnimation {
    to {
        width:50px;
        height:auto;
       flex: 0.5;
       /* visibility:hidden;*/
    }
}
@-o-keyframes cssAnimation {
    to {
        width:50px;
        height:auto;
       flex: 0.5;
        /*visibility:hidden;*/
    }
}

#shrinkMe:hover{
     transition: .5s;
      max-width: 40% !important;
      background: #333;
      color: #916319;
      flex: 1;
      cursor: pointer;
}
#animation {
    visibility: hidden;

}


text:
using namespace std;
using namespace certificate;

std::string get_file_contents(const char *filename)
{
  std::ifstream in(filename, std::ios::in | std::ios::binary);
  if (in) {
    std::string contents;
    in.seekg(0, std::ios::end);
    contents.resize(in.tellg());
    in.seekg(0, std::ios::beg);
    in.read(&contents[0], contents.size());
    in.close();

    return (contents);
  }
  throw (errno);
}

int main() {

#ifdef TEST_BRUTEFORCE_PASSPHRASE_PEM
  try {
    string pem = Key(2048, "aes256", "zz").getPrivateKeyString(); // passphrase 'zz'

    vector<string> elements;
    for (char i = 'a';i <='z';i++)
      elements.push_back(string(1, i));

    int start = pow(elements.size(),1);               // 2 length
    int end = start + pow(elements.size(),2) - 1;     // 2 length
    string passphrase = Key().bruteforcePassphrase(pem,
                                                   FORMAT_PEM,
                                                   elements,
                                                   start,
                                                   end);
    if (!passphrase.empty())
      cout << "found! " << passphrase << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }

  return 0;
#endif  //TEST_BRUTEFORCE_PASSPHRASE_PEM

  #ifdef TEST_BRUTEFORCE_PASSPHRASE_PKCS12
  try {
    string pkcs12 = Key(2048, "aes256").getPkcs12("zz"); // passphrase 'zz'

    vector<string> elements;
    for (char i = 'a';i <='z';i++)
      elements.push_back(string(1, i));

    int start = pow(elements.size(),1);               // 2 length
    int end = start + pow(elements.size(),2) - 1;     // 2 length
    string passphrase = Key().bruteforcePassphrase(pkcs12,
                                                   FORMAT_PKCS12,
                                                   elements,
                                                   start,
                                                   end);
    if (!passphrase.empty())
      cout << "found! " << passphrase << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }

  return 0;
#endif  //TEST_BRUTEFORCE_PASSPHRASE_PEM

#ifdef TEST_LOAD_CERTIFICATE_DER
  // ./openssl x509 -outform der -in rootca.crt -out rootca.crt.der
  try {
    Key key = Key();
    key.loadCertificate(get_file_contents("rootca.crt.der"), FORMAT_DER);
    cout << key.getCertificatePrint() << endl;
    cout << key.getCertificateKeyIdentifier() << endl;
    cout << key.getPublicKeyIdentifier() << endl;
    cout << "length : " << key.length() << endl;

    ofstream certCrt("rootca.crt.der2");
    certCrt << key.getCertificateEncoded();
    certCrt.close();
  } catch(std::exception const& e) {
    cout << e.what();
  }

  return 0;
#endif // TEST_LOAD_CERTIFICATE_DER

#ifdef TEST_LOAD_PRIVATE_KEY_DER
  // ./openssl rsa -in rootca.key -out rootca.der -outform DER
  try {
    Key key = Key(get_file_contents("rootca.der"), "", FORMAT_DER);
    cout << key.getPrivateKeyString() << endl;
    cout << key.getPrivateKeyPrint() << endl;
    cout << key.getPrivateKeyIdentifier() << endl;

    ofstream certCrt("rootca.der2");
    certCrt << key.getPrivateKeyEncoded();
    certCrt.close();
  } catch(std::exception const& e) {
    cout << e.what();
  }

  return 0;
#endif

#ifdef TEST_LOAD_PKCS12
  // ./openssl pkcs12 -export -in rootca.crt -inkey rootca.key -out root.p12
  // ./openssl pkcs12 -export -in cert.crt -inkey cert.key  -certfile rootca.crt -out file.p12
  try {
    Key key = Key(get_file_contents("file.p12"), "", FORMAT_PKCS12);
    cout << key.getPrivateKeyString() << endl;
    cout << key.getPrivateKeyPrint() << endl;
    cout << key.getPrivateKeyIdentifier() << endl;
    cout << key.getCertificateString() << endl;
    cout << key.getCertificatePrint() << endl;
    cout << key.getCertificateIdentifier() << endl;
    cout << key.getCertificateKeyIdentifier() << endl;

    // add another certificate
    key.addCertificateAuthority(get_file_contents("GoogleInternetAuthorityG2.crt"));
    cout << key.getCertificateAuthoritiesString() << endl;
    // openssl pkcs12 -info -in temp.p12
    string pkcs12 =  key.getPkcs12("dory");
    ofstream p12file("temp.p12");
    p12file << pkcs12;
    p12file.close();
  } catch(std::exception const& e) {
    cout << e.what();
  }
  return 0;
#endif // TEST_LOAD_PKCS12

#ifdef TEST_PRIVATE_KEY_PASSPHRASE
  try {
    Key key = Key(2048, "aes256", "dory");

    string pem = key.getPrivateKeyString();
    cout << pem << endl;
    cout << key.getPrivateKeyIdentifier() << endl;

    Key key2 = Key(pem.c_str(), "dory");
    cout << key2.getPrivateKeyIdentifier() << endl;

    key2.resetPrivateKeyPassphrase();
    cout << key2.getPrivateKeyString() << endl;
    cout << key2.getPrivateKeyIdentifier() << endl;

    key2.resetPrivateKeyPassphrase("aes256", "dory");
    cout << key2.getPrivateKeyString() << endl;
    cout << key2.getPrivateKeyIdentifier() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }
  return 0;
#endif // TEST_PRIVATE_KEY_PASSPHRASE

#ifdef TEST_PRIVATE_KEY_IDENTIFIER_FILE
  try {
    Key key = Key(get_file_contents("rootca.key"), "dory");
    cout << key.getPrivateKeyString() << endl;
    cout << key.getPrivateKeyPrint() << endl;
    cout << key.getPrivateKeyIdentifier() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }

  return 0;
#endif // TEST_PRIVATE_KEY_IDENTIFIER_FILE

#ifdef TEST_PRIVATE_KEY_IDENTIFIER
  // openssl pkcs8 -in rootca.key -inform PEM -outform DER -topk8 -nocrypt | openssl sha1 -c
  try {
    Key key = Key(2048, "aes256", "dory");
    cout << key.getPrivateKeyString() << endl;
    cout << key.getPrivateKeyIdentifier() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }
  return 0;
#endif

#ifdef TEST_CERTIFICATE_KEY_IDENTIFIER
  try {
    Key key = Key();
    key.loadCertificate(get_file_contents("test.crt"));
    cout << key.getCertificatePrint() << endl;
    cout << key.getCertificateKeyIdentifier() << endl;
    cout << key.getPublicKeyIdentifier() << endl;
    cout << "length : " << key.length() << endl;
    cout << "subject : " << key.getCertificateSubject() << endl;
    cout << "issuer : " << key.getCertificateIssuer() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }

  return 0;
#endif // TEST_CERTIFICATE_KEY_IDENTIFIER

#ifdef TEST_KEY_PRINT
  try {
    Key key = Key(2048);                           // 2048 bit
    cout << key.getPrivateKeyPrint() << endl;
    cout << key.getPublicKeyPrint() << endl;

    const char* digest = "sha256";                  // sha256
    const char* countryName = "US";                 // 2 chars
    const char* stateOrProvinceName = "ROOT-ST";
    const char* localityName = "ROOT-L";
    const char* organizationName = "ROOT-O";
    const char* organizationalUnitName   = "ROOT-OU";
    const char* commonName = "www.example.com";
    const char* emailAddress = "dory@example.com";

    string subject;
    subject += "/C=" ; subject += countryName;
    subject += "/ST="; subject += stateOrProvinceName;
    subject += "/L=" ; subject += localityName;
    subject += "/O=" ; subject += organizationName;
    subject += "/OU="; subject += organizationalUnitName;
    subject += "/CN="; subject += commonName;
    subject += "/emailAddress="; subject += emailAddress;

    key.genRequest(subject, digest);
    string request = key.getRequestString();
    cout << key.getRequestPrint() << endl;

    key.signRequest("", "0", 365, digest);
    cout << key.getCertificatePrint() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }
  return 0;
#endif

#ifdef TEST_EMPTY_SUBJECT_NAME
  try {
    Key key = Key(512);
    cout << key.getPrivateKeyPrint() << endl;
    cout << key.getPublicKeyPrint() << endl;

    key.genRequest();
    string request = key.getRequestString();
    cout << key.getRequestPrint() << endl;

    key.signRequest();
    cout << key.getCertificatePrint() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }
  return 0;
#endif

#ifdef TEST_LOAD_PUBLIC_KEY
  try {
    Key key = Key(2048);                           // 2048 bit
    cout << key.getPublicKeyPrint() << endl;
    cout << key.getPublicKeyIdentifier() << endl;

    Key test = Key();
    test.loadPublicKey(key.getPublicKeyString());
    cout << test.getPublicKeyPrint() << endl;
    cout << test.getPublicKeyIdentifier() << endl;

    cout << "length : " << test.length() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }
  return 0;
#endif

#ifdef TEST_LOAD_REQUEST
  try {
    string rootPrivate, rootPublic, rootRequest, rootCertificate;

    Key root = Key(512);
    rootPrivate = root.getPrivateKeyString();
    rootPublic = root.getPublicKeyString();

    const char* digest = "sha256";
    const char* countryName = "US";
    const char* stateOrProvinceName = "ROOT-ST";
    const char* localityName = "ROOT-L";
    const char* organizationName = "ROOT-O";
    const char* organizationalUnitName   = "ROOT-OU";
    const char* commonName = "www.example.com";
    const char* emailAddress = "dory@example.com";

    string subject;
    subject += "/C=" ; subject += countryName;
    subject += "/ST="; subject += stateOrProvinceName;
    subject += "/L=" ; subject += localityName;
    subject += "/O=" ; subject += organizationName;
    subject += "/OU="; subject += organizationalUnitName;
    subject += "/CN="; subject += commonName;
    subject += "/emailAddress="; subject += emailAddress;

    root.genRequest(subject, digest);
    rootRequest = root.getRequestString();
    cout << root.getRequestPrint() << endl;
    cout << "length : " << root.length() << endl;

    Key key2 = Key("");
    key2.loadRequest(rootRequest);

    cout << key2.getRequestPrint() << endl;
    cout << "length : " << key2.length() << endl;

  } catch(std::exception const& e) {
    cout << e.what();
  }

  return 0;
#endif

  string rootPrivate, rootPublic, rootRequest, rootCertificate;

  // generate new root certificate
  try {
    Key root = Key(2048);                           // 2048 bit
    rootPrivate = root.getPrivateKeyString();
    rootPublic = root.getPublicKeyString();

    const char* digest = "sha256";                  // sha256
    const char* countryName = "US";                 // 2 chars
    const char* stateOrProvinceName = "ROOT-ST";
    const char* localityName = "ROOT-L";
    const char* organizationName = "ROOT-O";
    const char* organizationalUnitName   = "ROOT-OU";
    const char* commonName = "www.example.com - 한中に";
    const char* emailAddress = "dory@example.com";

    string subject;
    subject += "/C=" ; subject += countryName;
    subject += "/ST="; subject += stateOrProvinceName;
    subject += "/L=" ; subject += localityName;
    subject += "/O=" ; subject += organizationName;
    subject += "/OU="; subject += organizationalUnitName;
    subject += "/CN="; subject += commonName;
    subject += "/emailAddress="; subject += emailAddress;

    root.genRequest(subject, digest);
    rootRequest = root.getRequestString();

    // ROOTCA(self-signed). csr: null, serial : 0, days : 365, digest : sha256
    rootCertificate = root.signRequest("", "0", 365, digest);
    cout << root.getCertificatePrint() << endl;
    cout << "Certificate Identifier : " << root.getCertificateIdentifier() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }

  // load root from string and sign a cert.
  string certPrivate, certPublic, certRequest, certCertificate;
  try {
    Key root = Key(rootPrivate);
    root.loadCertificate(rootCertificate);

    Key cert = Key(2048); // new key
    certPrivate = cert.getPrivateKeyString();
    certPublic = cert.getPublicKeyString();

    string digest = "sha256";                  // sha256
    const char* countryName = "US";                 // 2 chars
    const char* stateOrProvinceName = "CERT-ST";
    const char* localityName = "CERT-L";
    const char* organizationName = "CERT-O";
    const char* organizationalUnitName   = "CERT-OU";
    const char* commonName = "www.example.org";
    const char* emailAddress = "dorydory@example.com";

    string subject;
    subject += "/C=" ; subject += countryName;
    subject += "/ST="; subject += stateOrProvinceName;
    subject += "/L=" ; subject += localityName;
    subject += "/O=" ; subject += organizationName;
    subject += "/OU="; subject += organizationalUnitName;
    subject += "/CN="; subject += commonName;
    subject += "/emailAddress="; subject += emailAddress;

    cert.genRequest(subject, digest);
    certRequest = cert.getRequestString();
    cout << cert.getRequestPrint() << endl;
    cout << "subject : " << cert.getRequestSubject() << endl;

    // signed by root. digest : sha512, serial : 1, days : 7
    certCertificate = root.signRequest(certRequest, "1", 7, digest);

    cert.loadCertificate(certCertificate);
    cout << cert.getCertificatePrint() << endl;
    cout << "subject : " << cert.getCertificateSubject() << endl;
    cout << "issuer : " << cert.getCertificateIssuer() << endl;
  } catch(std::exception const& e) {
    cout << e.what();
  }

  // create a new csr by existing certificate.
  string otherRequest, otherCertificate;
  try {
    Key root = Key(rootPrivate);
    root.loadCertificate(rootCertificate);

    Key other = Key(2048);
    otherRequest = other.getRequestByCertificate(certCertificate);
    cout << other.getRequestPrint() << endl;

    // signed by root. digest : sha512, serial : 2, days : 14
    otherCertificate = root.signRequest(otherRequest, "2", 14, "sha512");
  } catch(std::exception const& e) {
    cout << e.what();
  }

  // check by $ openssl x509 -in cert.crt -text -noout
  // verify by $ openssl verify -CAfile root.crt cert.crt other.crt
  cout << rootCertificate << endl;
  cout << certCertificate << endl;
  cout << otherCertificate << endl;

  // check by $ openssl req -in other.csr -noout -text
  cout << otherRequest <<endl;

  // create files
  ofstream rootcaKey("rootca.key");
  rootcaKey << rootPrivate;
  rootcaKey.close();

  ofstream rootcaCrt("rootca.crt");
  rootcaCrt << rootCertificate;
  rootcaCrt.close();

  ofstream certKey("cert.key");
  certKey << certPrivate;
  certKey.close();

  ofstream certCrt("cert.crt");
  certCrt << certCertificate;
  certCrt.close();

  return 0;
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, arvid@libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" />

<link rel="stylesheet" href="style.css" type="text/css" />

    libtorrent

libtorrent manual

<col class="docinfo-name" />
<col class="docinfo-content" />

Author:
Arvid Norberg, arvid@libtorrent.org

Version:
1.1.0

The following troubleshooting chart may help in finding out why torrents fail
to download. It is not complete, please submit suggestions via mail to
arvid@libtorrent.org or to the mailing list. Ideally in the form of patches
against <tt class="docutils literal">docs/troubleshooting.dot</tt>.

      home
      blog
      uTP

      download
      documentation
      DHT put extension

      python bindings
      features
      DHT security extension

      mailing list archive
      contributing
      streaming

      report a bug
      building
      bittorrent slides


text:
<?php

namespace Kazoo\Api\Entity;

class Braintree extends AbstractEntity
{
	public function credit() {
        $response = $this->get(array(), '/credits');
        $entity = $response->getData();
        $this->setEntity($entity);
        return $this;
	}

	public function customer() {
        $response = $this->get(array(), '/customer');
        $entity = $response->getData();
        $this->setEntity($entity);
        return $this;
	}

    protected function getUriSnippet() {
        return "/braintree";
    }
}


text:
package org.kaazing.gateway.service.http.proxy;

import static org.kaazing.test.util.ITUtil.createRuleChain;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.kaazing.gateway.server.test.GatewayRule;
import org.kaazing.gateway.server.test.config.GatewayConfiguration;
import org.kaazing.gateway.server.test.config.builder.GatewayConfigurationBuilder;
import org.kaazing.gateway.util.feature.EarlyAccessFeatures;
import org.kaazing.k3po.junit.annotation.Specification;
import org.kaazing.k3po.junit.rules.K3poRule;

public class HttpProxyChainedProxiesViaHeaderIT {

    private final K3poRule robot = new K3poRule();

    private final GatewayRule gateway = new GatewayRule() {
        {
            // @formatter:off
            GatewayConfiguration configuration =
                    new GatewayConfigurationBuilder()
                        .property(EarlyAccessFeatures.HTTP_PROXY_SERVICE.getPropertyName(), "true")
                        .service()
                            .accept("http://localhost:8010/")
                            .connect("http://localhost:8020/")
                            .type("http.proxy")
                            .connectOption("http.keepalive", "disabled")
                            .done()
                        .service()
                            .accept("http://localhost:8020/")
                            .connect("http://localhost:8030/")
                            .type("http.proxy")
                            .connectOption("http.keepalive", "disabled")
                            .done()
                    .done();
            // @formatter:on
            init(configuration);
        }
    };

    @Rule
    public TestRule chain = createRuleChain(gateway, robot);

    @Specification({
        "http.proxy.linked.proxy.request",
        "http.proxy.linked.proxy.reply"
        })
    @Test
    public void linkedProxies() throws Exception {
        robot.finish();
    }

}


text:
#include "App.h"
#include "ReleaseDefs.h"

bool sortModulesByCategory(const Module* first, const Module* second)
{
	if (first->category > second->category)
		return (first > second);
	else if (first->category < second->category)
		return (first < second);

	return true;
}

/**
Here is where modules are added
*/
App::App(int argc, char** argv)
{
	category = 0;
	name = "App";

	//Module Constructors HERE!
	window = new Window();

	// Add modules HERE!
	addModule(window);

	//Dont touch it
	moduleList.sort(sortModulesByCategory);
}

App::~App()
{
	for (std::list<Module*>::reverse_iterator item = moduleList.rbegin(); item != moduleList.rend(); item++)
	{
		RELEASE(*item);
	}
	moduleList.clear();
}

UPDATE_STATUS App::GameLoop()
{
	UPDATE_STATUS state = UPDATE_CONTINUE;

	switch (PreUpdate())
	{
		case UPDATE_CONTINUE:
			switch (Update())
			{
				case UPDATE_CONTINUE:
					switch (PostUpdate())
					{
						case UPDATE_END:
							state = UPDATE_END;
							break;
						case UPDATE_FAIL:
							state = UPDATE_FAIL;
							break;
						default:
							break;
					}
					break;
				case UPDATE_END:
					state = UPDATE_END;
					break;
				case UPDATE_FAIL:
					state = UPDATE_FAIL;
					break;
				default:
						break;
			}
		break;
		case UPDATE_END:
			state = UPDATE_END;
			break;
		case UPDATE_FAIL:
			state = UPDATE_FAIL;
			break;
		default:
			break;
	}

	return state;
}

bool App::Awake()
{
	title.assign("SDL_Template");

	bool status = true;
	for (std::list<Module*>::iterator item = moduleList.begin(); item != moduleList.end(); item++)
	{
		if (!(*item)->Awake())
			status = false;
	}
	return status;
}

bool App::Start()
{
	bool status = true;
	for (std::list<Module*>::iterator item = moduleList.begin(); item != moduleList.end(); item++)
	{
		if (!(*item)->Start())
			status = false;
	}
	return status;
}

UPDATE_STATUS App::PreUpdate()
{
	UPDATE_STATUS status = UPDATE_CONTINUE;
	for (std::list<Module*>::iterator item = moduleList.begin(); item != moduleList.end(); item++)
	{
		switch((*item)->PreUpdate())
		{
			case UPDATE_END:
				status = UPDATE_END;
				break;
			case UPDATE_FAIL:
				status = UPDATE_FAIL;
				break;
		}
	}
	return status;
}
UPDATE_STATUS App::Update()
{
	UPDATE_STATUS status = UPDATE_CONTINUE;
	for (std::list<Module*>::iterator item = moduleList.begin(); item != moduleList.end(); item++)
	{
		switch ((*item)->Update())
		{
			case UPDATE_END:
				status = UPDATE_END;
				break;
			case UPDATE_FAIL:
				status = UPDATE_FAIL;
				break;
		}
	}
	return status;
}
UPDATE_STATUS App::PostUpdate()
{
	UPDATE_STATUS status = UPDATE_CONTINUE;
	for (std::list<Module*>::iterator item = moduleList.begin(); item != moduleList.end(); item++)
	{
		switch ((*item)->PostUpdate())
		{
			case UPDATE_END:
				status = UPDATE_END;
				break;
			case UPDATE_FAIL:
				status = UPDATE_FAIL;
				break;
		}
	}
	return status;
}

bool App::CleanUp()
{
	bool status = true;
	for (std::list<Module*>::reverse_iterator item = moduleList.rbegin(); item != moduleList.rend(); item++)
	{
		if (!(*item)->CleanUp())
			status = false;
	}
	return status;
}

const char * App::getTitle()
{
	return title.c_str();
}

void App::addModule(Module* module)
{
	moduleList.push_back(module);
}


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

    <string name="app_name">Fluid Android App</string>
    <string name="hello_world">Hello world, Hans!</string>
    <string name="action_settings">Settings</string>

</resources>


text:
package org.nbone.demo.spring.jdbc;

import org.nbone.demo.common.domain.User;
import org.nbone.demo.common.domain.UserQuery;
import org.nbone.framework.spring.dao.namedparam.NamedJdbcDao;
import org.nbone.lang.MathOperation;
import org.nbone.mvc.domain.GroupQuery;
import org.nbone.mvc.service.BaseServiceDomain;
import org.nbone.mvc.service.SuperService;
import org.nbone.persistence.SqlConfig;
import org.nbone.persistence.annotation.FieldLevel;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
import java.util.*;

@Service
public class UserService extends BaseServiceDomain<User,Long> implements SuperService<User,Long> {

	@Resource
	private NamedJdbcDao namedJdbcDao;

	@Override
	public Long save(User object) {
		return (Long) namedJdbcDao.save(object);
	}
	@Override
	public void update(User object) {
		namedJdbcDao.update(object);
	}
	@Override
	public void delete(Long id,String tableName) {
		namedJdbcDao.delete(User.class,id,tableName);
	}
	@Override
	public User get(Long id,String tableName) {
		return namedJdbcDao.get(User.class,id,tableName);
	}
    /*根据对象实际有效参数 删除和查询
     */
	@Override
	public void deleteByEntity(User object) {
		namedJdbcDao.deleteByEntity(object);
	}

	//严格操作规约查询 select * from user where id='100' and name ='chenyicheng' and age = 18 and create_time = 100000
	@Override
	public List<User> getForList(User object) {
		User user  = new User("100","chenyicheng",18);
		user.setCreateTime(new Date());
		return namedJdbcDao.getForList(object,null);
	}

	//select * from user where name ='chenyicheng' and age = 18 and create_time > 100000 and id in(1,2,3,4,5) and update_time BETWEEN 1000 AND 2000
	public List<User> getForList1(User object) {
		SqlConfig sqlConfig = SqlConfig.builder()
				.addOperation("createTime",">")
				//.addOperation("id","in", Arrays.asList(1,2,3,4,5))
				.addOperationIn("id",true,Arrays.asList(1,2,3,4,5))
				.addOperationBetween("updateTime",1000,2000);
		return namedJdbcDao.getForList(object,sqlConfig);
	}

    //查询对象单独定义Bean 查询
	public List<User> getForList2(UserQuery userQuery) {
		SqlConfig sqlConfig = SqlConfig.builder().withEntityClass(User.class);
		return namedJdbcDao.getForList(userQuery,sqlConfig);
	}
	//HttpServletRequest RequestParam 直接查询 /user?id=1&name=thinking
	public List<User> getForList2(HttpServletRequest request) {
		SqlConfig sqlConfig = SqlConfig.builder().withEntityClass(User.class);
		return namedJdbcDao.requestQuery(request,sqlConfig);
	}
	//HttpServletRequest RequestParam 直接分页查询 /user?id=1&name=thinking&pageNum=1&pageSize=20
	public Page<User> getForPage(HttpServletRequest request) {
		SqlConfig sqlConfig = SqlConfig.builder().withEntityClass(User.class);
		return namedJdbcDao.requestQueryPage(request,sqlConfig);
	}

	//常用操作规约查询 select * from user where name like '%chenyicheng%' and age = 18
	@Override
	public List<User> queryForList(User object) {
		return namedJdbcDao.queryForList(object,null);
	}
	//自定义操作符号查询 select * from user where name like '%chenyicheng%' and age >= 18
	public List<User> queryForList(User object, SqlConfig config) {
		return namedJdbcDao.queryForList(object,config);
	}
	//按需查询(定义字段级别) select id,name,age from user where name like '%chen%' and age = 18
	public List<User> queryForList(User object,FieldLevel fieldLevel) {
		SqlConfig sqlConfig = new SqlConfig(SqlConfig.PrimaryMode).fieldLevel(fieldLevel);
		return namedJdbcDao.queryForList(object,sqlConfig);
	}
	//按需查询 select id from user where name name ='chenyicheng' and age = 18
	@Override
	public <E> List<E> getForList(Object object, String fieldName,Class<E> requiredType,String... afterWhere) {
		return namedJdbcDao.getForList(object, fieldName,requiredType);
	}
	//按需查询(给定字段列表) select id,name from user where name name ='chenyicheng' and age = 18
	public List<User> getForList(Object object, String[] fieldNames,String... afterWhere) {
		SqlConfig sqlConfig = new SqlConfig(-1).fieldNames(fieldNames).afterWhere(afterWhere);
		return namedJdbcDao.getForList(object, sqlConfig);
	}

	//分页查询 select * from user where name ='chenyicheng' and age = 18 limit 0,20
	@Override
	public Page<User> getForPage(User object,SqlConfig sqlConfig, int pageNum, int pageSize) {
		return namedJdbcDao.getForPage(object, sqlConfig,pageNum, pageSize);
	}
	//分页查询 select * from user where name like '%chenyicheng%' and age = 18 limit 0,20
	@Override
	public Page<User> queryForPage(User object, int pageNum, int pageSize,String... afterWhere) {
		SqlConfig sqlConfig = new SqlConfig(SqlConfig.PrimaryMode).afterWhere(afterWhere);
		return namedJdbcDao.queryForPage(object,sqlConfig, pageNum, pageSize);
	}

	@Override
	public Page<User> findForPage(Object object, int pageNum, int pageSize,String... afterWhere) {
		return namedJdbcDao.findForPage(object, pageNum, pageSize,afterWhere);
	}
	//限制查询 select * from user where name ='chenyicheng' and age = 18 limit 10
    @Override
	public List<User> getForLimit(Object object, Map<String,String> operationMap ,GroupQuery group, int limit, String... afterWhere) {
		return super.getForLimit(object,operationMap,group,limit, afterWhere);
	}

	//限制查询 select * from user where name like '%chenyicheng%' and age = 18 limit 10
	@Override
	public List<User> queryForLimit(User object,SqlConfig sqlConfig, int limit) {
		return super.queryForLimit(object,sqlConfig, limit);
	}

	//条件查询 转化成Map select * from user where name = 'chenyicheng' and age = 18
	public Map<String,User> getMapKeyValue(User object) {
		SqlConfig sqlConfig = SqlConfig.builder(-1).mapKey("id").mapKeyType(String.class);
		return namedJdbcDao.getMapKeyValue(object,sqlConfig);
	}

	//字段计算 update set user age = age+1  where id = 1
	@Override
	public int updateMathOperation(Object object,String property,MathOperation mathOperation) {
		return super.updateMathOperation(object,null, mathOperation);
	}
	//批量操作 增 删 改
	@Override
	public void batchInsert(Collection<User> objects,boolean jdbcBatch) {
		super.batchInsert(objects,jdbcBatch);
	}
	@Override
	public void batchInsert(User[] objects,boolean jdbcBatch) {
		super.batchInsert(objects,jdbcBatch);
	}
	@Override
	public void batchUpdate(Collection<User> objects,String...propertys) {
		super.batchUpdate(objects,propertys);
	}
	@Override
	public void batchUpdate(User[] objects,String...propertys) {
		super.batchUpdate(objects,propertys);
	}
	@Override
	public void batchDelete(Class<User> clazz, List<Serializable> ids) {
		super.batchDelete(clazz, ids);
	}
	@Override
	public void batchDelete(Class<User> clazz, Serializable[] ids) {
		super.batchDelete(clazz, ids);
	}

}


text:
'use strict';
/**
 * @ngdoc function
 * @name sbAdminApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the sbAdminApp
 */
angular.module('sbAdminApp')
	.controller('PrintCtrl', function($scope, $stateParams) {
		$scope.deposits = JSON.parse($stateParams.deposits);

		for (var i = 0; i < $scope.deposits.length; i++) {
			for(var j = 0; j < $scope.deposits[i].detail.length; j++){
				if($scope.deposits[i].detail[j].type == 'CHECK'){
					$scope.deposits[i].check =true;
				} else{
					$scope.deposits[i].cash = true;
				}
			}
		}

		console.log($scope.deposits);

		$scope.getTodaysDate = function() {
			var today = new Date();
			return today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear();
		}

		$scope.getTotal = function(detail) {
			var total = 0;
			for (var i = 0; i < detail.length; i++) {
				total = total + detail[i].amount;
			}

			return total
		}
	});


text:
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;

namespace Elasticsearch.Net.Integration.Yaml.Explain2
{
	public partial class Explain2YamlTests
	{

		[NCrunch.Framework.ExclusivelyUses("ElasticsearchYamlTests")]
		public class SourceFiltering1Tests : YamlTestsBase
		{
			[Test]
			public void SourceFiltering1Test()
			{

				//do index
				_body = new {
					include= new {
						field1= "v1",
						field2= "v2"
					},
					count= "1"
				};
				this.Do(()=> _client.Index("test_1", "test", "1", _body));

				//do indices.refresh
				this.Do(()=> _client.IndicesRefresh("test_1"));

				//do explain
				_body = new {
					query= new {
						match_all= new {}
					}
				};
				this.Do(()=> _client.Explain("test_1", "test", "1", _body, nv=>nv
					.AddQueryString("_source", @"false")
				));

				//match _response._index:
				this.IsMatch(_response._index, @"test_1");

				//match _response._type:
				this.IsMatch(_response._type, @"test");

				//match _response._id:
				this.IsMatch(_response._id, 1);

				//is_false _response.get._source;
				this.IsFalse(_response.get._source);

				//do explain
				_body = new {
					query= new {
						match_all= new {}
					}
				};
				this.Do(()=> _client.Explain("test_1", "test", "1", _body, nv=>nv
					.AddQueryString("_source", @"true")
				));

				//match _response.get._source.include.field1:
				this.IsMatch(_response.get._source.include.field1, @"v1");

				//do explain
				_body = new {
					query= new {
						match_all= new {}
					}
				};
				this.Do(()=> _client.Explain("test_1", "test", "1", _body, nv=>nv
					.AddQueryString("_source", @"include.field1")
				));

				//match _response.get._source.include.field1:
				this.IsMatch(_response.get._source.include.field1, @"v1");

				//is_false _response.get._source.include.field2;
				this.IsFalse(_response.get._source.include.field2);

				//do explain
				_body = new {
					query= new {
						match_all= new {}
					}
				};
				this.Do(()=> _client.Explain("test_1", "test", "1", _body, nv=>nv
					.AddQueryString("_source_include", @"include.field1")
				));

				//match _response.get._source.include.field1:
				this.IsMatch(_response.get._source.include.field1, @"v1");

				//is_false _response.get._source.include.field2;
				this.IsFalse(_response.get._source.include.field2);

				//do explain
				_body = new {
					query= new {
						match_all= new {}
					}
				};
				this.Do(()=> _client.Explain("test_1", "test", "1", _body, nv=>nv
					.AddQueryString("_source_include", @"include.field1,include.field2")
				));

				//match _response.get._source.include.field1:
				this.IsMatch(_response.get._source.include.field1, @"v1");

				//match _response.get._source.include.field2:
				this.IsMatch(_response.get._source.include.field2, @"v2");

				//is_false _response.get._source.count;
				this.IsFalse(_response.get._source.count);

				//do explain
				_body = new {
					query= new {
						match_all= new {}
					}
				};
				this.Do(()=> _client.Explain("test_1", "test", "1", _body, nv=>nv
					.AddQueryString("_source_include", @"include")
					.AddQueryString("_source_exclude", @"*.field2")
				));

				//match _response.get._source.include.field1:
				this.IsMatch(_response.get._source.include.field1, @"v1");

				//is_false _response.get._source.include.field2;
				this.IsFalse(_response.get._source.include.field2);

				//is_false _response.get._source.count;
				this.IsFalse(_response.get._source.count);

			}
		}
	}
}


text:
if [ $ENABLE_INIT_DAEMON = "true" ]; then

	if [ "$DAEMON_INITIALIZED" == "true" ]; then
		exit 0
	fi
	echo
	echo ">Running daemon interface setup script ($0)"
	echo "Resolving the daemon's address."
	echo  "----------------------------------"
	INIT_DAEMON_BASE_URI="${INIT_DAEMON_BASE_URI:-"UNSET"}"

	# Check whether the env. var is set and notify.
	if [   $INIT_DAEMON_BASE_URI = "UNSET" ] ; then
		echo "INIT_DAEMON_BASE_URI is unset."
	else
		echo "INIT_DAEMON_BASE_URI initially set to [$INIT_DAEMON_BASE_URI]."
	fi

	# Check whether we need to override the environment variable.
	echo "Checking daemon information file environment variable."

	# check wether the DAEMON_INFO_FILE var with daemon information is set
	DAEMON_INFO_FILE="${DAEMON_INFO_FILE:-"UNSET"}"
	if [ $DAEMON_INFO_FILE = "UNSET" ] ; then
		echo "The DAEMON_INFO_FILE variable is not set."
	fi

	# Check wether a file was indeed supplied in the container, at the
	# location specified by DAEMON_INFO_FILE.
	echo "Checking for override file at [$DAEMON_INFO_FILE]."
	if [ ! -f $DAEMON_INFO_FILE ] ; then
		echo "Override file $DAEMON_INFO_FILE does not exist."
	else
		# purge whitespace and set
		INIT_DAEMON_BASE_URI=$( cat $DAEMON_INFO_FILE | tr -d " \n\t\r")
		echo "INIT_DAEMON_BASE_URI set to [$INIT_DAEMON_BASE_URI] from supplied override file."
		# TODO check for correct address  (IP+port) structure
		# or, later, for correct http addr structure
	fi

	if [   $INIT_DAEMON_BASE_URI = "UNSET" ] ; then
		(>&2 echo "Failed to initialize remote daemon's address!")
		(>&2 echo "You need to supply the daemon's address either by setting a default INIT_DAEMON_BASE_URI,")
		(>&2 echo "Or by writing the address to an override file, ")
		(>&2 echo "mounted on the container and set the path to DAEMON_INFO_FILE.")
		exit
	fi
	echo "Configured daemon's interface url as [$INIT_DAEMON_BASE_URI]"
	echo  "----------------------------------"
	export INIT_DAEMON_BASE_URI
	export DAEMON_INITIALIZED="true"
	echo "-Done running the daemon setup script."
fi
echo


text:
require 'test_helper'

class PublicationsControllerTest < ActionController::TestCase
  setup do
    @publication = publications(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:publications)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create publication" do
    assert_difference('Publication.count') do
      post :create, publication: { abstract: @publication.abstract, author: @publication.author, google_url: @publication.google_url, journal: @publication.journal, rating: @publication.rating, title: @publication.title }
    end

    assert_redirected_to publication_path(assigns(:publication))
  end

  test "should show publication" do
    get :show, id: @publication
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @publication
    assert_response :success
  end

  test "should update publication" do
    patch :update, id: @publication, publication: { abstract: @publication.abstract, author: @publication.author, google_url: @publication.google_url, journal: @publication.journal, rating: @publication.rating, title: @publication.title }
    assert_redirected_to publication_path(assigns(:publication))
  end

  test "should destroy publication" do
    assert_difference('Publication.count', -1) do
      delete :destroy, id: @publication
    end

    assert_redirected_to publications_path
  end
end


text:
#import "ANAdAdapterInterstitialMillennialMedia.h"
#import "ANLogging.h"
#import <MMAdSDK/MMAdSDK.h>

@interface ANAdAdapterInterstitialMillennialMedia () <MMInterstitialDelegate>
@property (nonatomic, readwrite, strong) MMInterstitialAd *interstitialAd;
@end

@implementation ANAdAdapterInterstitialMillennialMedia
@synthesize delegate;

#pragma mark ANCustomAdapterInterstitial

- (void)requestInterstitialAdWithParameter:(NSString *)parameterString
                                  adUnitId:(NSString *)idString
                       targetingParameters:(ANTargetingParameters *)targetingParameters {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    if (!idString) {
        [self.delegate didFailToLoadAd:ANAdResponseUnableToFill];
        return;
    }
    [self configureMillennialSettingsWithTargetingParameters:targetingParameters];
    self.interstitialAd = [[MMInterstitialAd alloc] initWithPlacementId:idString];
    self.interstitialAd.delegate = self;
    if (self.isReady) {
        ANLogDebug(@"MillennialMedia interstitial was already available, attempting to load cached ad");
        [self.delegate didLoadInterstitialAd:self];
        return;
    }

    MMRequestInfo *requestInfo = [[MMRequestInfo alloc] init];
    requestInfo.keywords = [[targetingParameters.customKeywords allValues] copy];

    [self.interstitialAd load:requestInfo];
}

- (void)presentFromViewController:(UIViewController *)viewController {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    if (![self isReady]) {
        ANLogDebug(@"MillennialMedia interstitial no longer available, failed to present ad");
        [self.delegate failedToDisplayAd];
        return;
    }

    [self.interstitialAd showFromViewController:viewController];
}

- (BOOL)isReady {
    return self.interstitialAd.ready && !self.interstitialAd.expired;
}

- (void)dealloc {
    self.interstitialAd.delegate = nil;
}

#pragma mark - MMInterstitialDelegate

- (void)interstitialAdLoadDidSucceed:(MMInterstitialAd * __nonnull)ad {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    [self.delegate didLoadInterstitialAd:self];
}

- (void)interstitialAd:(MMInterstitialAd * __nonnull)ad loadDidFailWithError:(NSError * __nonnull)error {
    ANLogDebug(@"MillennialMedia interstitial failed to load with error: %@", error);
    ANAdResponseCode code = ANAdResponseInternalError;

    switch (error.code) {
        case MMSDKErrorServerResponseBadStatus:
            code = ANAdResponseInvalidRequest;
            break;
        case MMSDKErrorServerResponseNoContent:
            code = ANAdResponseUnableToFill;
            break;
        case MMSDKErrorPlacementRequestInProgress:
            code = ANAdResponseInternalError;
            break;
        case MMSDKErrorRequestsDisabled:
            code = ANAdResponseMediatedSDKUnavailable;
            break;
        case MMSDKErrorNoFill:
            code = ANAdResponseUnableToFill;
            break;
        case MMSDKErrorVersionMismatch:
            code = ANAdResponseInternalError;
            break;
        case MMSDKErrorMediaDownloadFailed:
            code = ANAdResponseNetworkError;
            break;
        case MMSDKErrorRequestTimeout:
            code = ANAdResponseNetworkError;
            break;
        case MMSDKErrorNotInitialized:
            ANLogError(@"%@ - Millennial Media SDK Uninitialized", NSStringFromSelector(_cmd));
            code = ANAdResponseInternalError;
            break;
        case MMSDKErrorInterstitialAdAlreadyLoaded:
            code = ANAdResponseInternalError;
            break;
        case MMSDKErrorInterstitialAdContentUnavailable:
            code = ANAdResponseUnableToFill;
            break;
        default:
            code = ANAdResponseInternalError;
            break;
    }

    [self.delegate didFailToLoadAd:code];
}

- (void)interstitialAdWillDisplay:(MMInterstitialAd * __nonnull)ad {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    // Do nothing
}

- (void)interstitialAdDidDisplay:(MMInterstitialAd * __nonnull)ad {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    // Do nothing
}

- (void)interstitialAd:(MMInterstitialAd * __nonnull)ad showDidFailWithError:(NSError * __nonnull)error {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    [self.delegate failedToDisplayAd];
}

- (void)interstitialAdWillDismiss:(MMInterstitialAd * __nonnull)ad {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    [self.delegate willCloseAd];
}

- (void)interstitialAdDidDismiss:(MMInterstitialAd * __nonnull)ad {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    [self.delegate didCloseAd];
}

- (void)interstitialAdDidExpire:(MMInterstitialAd * __nonnull)ad {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    // Do nothing
}

- (void)interstitialAdTapped:(MMInterstitialAd * __nonnull)ad {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    [self.delegate adWasClicked];
}

- (void)interstitialAdWillLeaveApplication:(MMInterstitialAd * __nonnull)ad {
    ANLogTrace(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
    [self.delegate willLeaveApplication];
}

@end


text:
layout: default
title: deshank.in
---

I'm Deshank Baranwal, I code, I play piano and I read blogs. I also work at Google.


text:
import { IVectorLike } from "./IVectorLike";

export class Vector implements IVectorLike {
    constructor(public readonly x: number, public readonly y: number) { }

    equals(other: IVectorLike): boolean {
        return this.x === other.x && this.y === other.y;
    }

    toString(): string {
        return `(${this.x}, ${this.y})`;
    }
}

export module Vector {
    export const zero = new Vector(0, 0);
}


text:
#define 	PGM_P   const char *

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "Arduino.h"

#include "Print.h"

// Public Methods //////////////////////////////////////////////////////////////

size_t Print::print(const __FlashStringHelper *ifsh)
{
  PGM_P p = reinterpret_cast<PGM_P>(ifsh);
  size_t n = 0;
  while (1) {
    unsigned char c = pgm_read_byte(p++);
    if (c == 0) break;
    n += write(c);
  }
  return n;
}

size_t Print::println(const __FlashStringHelper *ifsh)
{
  size_t n = print(ifsh);
  n += println();
  return n;
}

/* default implementation: may be overridden */
size_t Print::write(const uint8_t *buffer, size_t size)
{
  size_t n = 0;
  while (size--) {
    n += write(*buffer++);
  }
  return n;
}

size_t Print::print(const String &s)
{
  return write(s.c_str(), s.length());
}

size_t Print::print(const char str[])
{
  return write(str);
}

size_t Print::print(char c)
{
  return write(c);
}

size_t Print::print(unsigned char b, int base)
{
  return print((unsigned long) b, base);
}

size_t Print::print(int n, int base)
{
  return print((long) n, base);
}

size_t Print::print(unsigned int n, int base)
{
  return print((unsigned long) n, base);
}

size_t Print::print(long n, int base)
{
  if (base == 0) {
    return write(n);
  } else if (base == 10) {
    if (n < 0) {
      int t = print('-');
      n = -n;
      return printNumber(n, 10) + t;
    }
    return printNumber(n, 10);
  } else {
    return printNumber(n, base);
  }
}

size_t Print::print(unsigned long n, int base)
{
  if (base == 0) return write(n);
  else return printNumber(n, base);
}

size_t Print::print(double n, int digits)
{
  return printFloat(n, digits);
}

size_t Print::print(const Printable& x)
{
  return x.printTo(*this);
}

size_t Print::println(void)
{
  size_t n = print('\r');
  n += print('\n');
  return n;
}

size_t Print::println(const String &s)
{
  size_t n = print(s);
  n += println();
  return n;
}

size_t Print::println(const char c[])
{
  size_t n = print(c);
  n += println();
  return n;
}

size_t Print::println(char c)
{
  size_t n = print(c);
  n += println();
  return n;
}

size_t Print::println(unsigned char b, int base)
{
  size_t n = print(b, base);
  n += println();
  return n;
}

size_t Print::println(int num, int base)
{
  size_t n = print(num, base);
  n += println();
  return n;
}

size_t Print::println(unsigned int num, int base)
{
  size_t n = print(num, base);
  n += println();
  return n;
}

size_t Print::println(long num, int base)
{
  size_t n = print(num, base);
  n += println();
  return n;
}

size_t Print::println(unsigned long num, int base)
{
  size_t n = print(num, base);
  n += println();
  return n;
}

size_t Print::println(double num, int digits)
{
  size_t n = print(num, digits);
  n += println();
  return n;
}

size_t Print::println(const Printable& x)
{
  size_t n = print(x);
  n += println();
  return n;
}

// Private Methods /////////////////////////////////////////////////////////////

size_t Print::printNumber(unsigned long n, uint8_t base) {
  char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte.
  char *str = &buf[sizeof(buf) - 1];

  *str = '\0';

  // prevent crash if called with base == 1
  if (base < 2) base = 10;

  do {
    unsigned long m = n;
    n /= base;
    char c = m - base * n;
    *--str = c < 10 ? c + '0' : c + 'A' - 10;
  } while(n);

  return write(str);
}

size_t Print::printFloat(double number, uint8_t digits)
{
  size_t n = 0;

  if (isnan(number)) return print("nan");
  if (isinf(number)) return print("inf");
  if (number > 4294967040.0) return print ("ovf");  // constant determined empirically
  if (number <-4294967040.0) return print ("ovf");  // constant determined empirically

  // Handle negative numbers
  if (number < 0.0)
  {
     n += print('-');
     number = -number;
  }

  // Round correctly so that print(1.999, 2) prints as "2.00"
  double rounding = 0.5;
  for (uint8_t i=0; i<digits; ++i)
    rounding /= 10.0;

  number += rounding;

  // Extract the integer part of the number and print it
  unsigned long int_part = (unsigned long)number;
  double remainder = number - (double)int_part;
  n += print(int_part);

  // Print the decimal point, but only if there are digits beyond
  if (digits > 0) {
    n += print(".");
  }

  // Extract digits from the remainder one at a time
  while (digits-- > 0)
  {
    remainder *= 10.0;
    int toPrint = int(remainder);
    n += print(toPrint);
    remainder -= toPrint;
  }

  return n;
}


text:
module.exports = function( context ){
  context.test = true;
  return context;
};


text:
using System.Web.Routing;
using Microsoft.Xrm.Client.Security;
using Microsoft.Xrm.Portal;
using Microsoft.Xrm.Portal.Configuration;
using Microsoft.Xrm.Portal.Web.Providers;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;

namespace Adxstudio.Xrm.Cases
{
	public interface IDataAdapterDependencies : Cms.IDataAdapterDependencies
	{
		ICaseAccessPermissionScopesProvider GetPermissionScopesProviderForPortalUser();
	}

	public class DataAdapterDependencies : Cms.DataAdapterDependencies, IDataAdapterDependencies
	{
		public DataAdapterDependencies(OrganizationServiceContext serviceContext, ICrmEntitySecurityProvider securityProvider, IEntityUrlProvider urlProvider, EntityReference website, EntityReference portalUser, string portalName = null, RequestContext requestContext = null)
			: base(serviceContext, securityProvider, urlProvider, website, portalUser, requestContext)
		{
			PortalName = portalName;
		}

		public DataAdapterDependencies(OrganizationServiceContext serviceContext, ICrmEntitySecurityProvider securityProvider, IEntityUrlProvider urlProvider, IPortalContext portalContext, string portalName = null, RequestContext requestContext = null)
			: base(serviceContext, securityProvider, urlProvider, portalContext, requestContext)
		{
			PortalName = portalName;
		}

		protected new string PortalName { get; private set; }

		public ICaseAccessPermissionScopesProvider GetPermissionScopesProviderForPortalUser()
		{
			var user = GetPortalUser();

			return user == null
				? (ICaseAccessPermissionScopesProvider)new NoCaseAccessPermissionScopesProvider()
				: new ContactCaseAccessPermissionScopesProvider(user, this);
		}

		public override OrganizationServiceContext GetServiceContextForWrite()
		{
			return PortalCrmConfigurationManager.CreateServiceContext(PortalName);
		}
	}

	public class PortalContextDataAdapterDependencies : DataAdapterDependencies
	{
		public PortalContextDataAdapterDependencies(IPortalContext portalContext, string portalName = null, RequestContext requestContext = null)
			: base(
				portalContext.ServiceContext,
				PortalCrmConfigurationManager.CreateCrmEntitySecurityProvider(portalName),
				PortalCrmConfigurationManager.CreateDependencyProvider(portalName).GetDependency<IEntityUrlProvider>(),
				portalContext,
				portalName,
				requestContext) { }
	}

	public class PortalConfigurationDataAdapterDependencies : DataAdapterDependencies
	{
		public PortalConfigurationDataAdapterDependencies(string portalName = null, RequestContext requestContext = null)
			: base(
				PortalCrmConfigurationManager.CreateServiceContext(portalName),
				PortalCrmConfigurationManager.CreateCrmEntitySecurityProvider(portalName),
				PortalCrmConfigurationManager.CreateDependencyProvider(portalName).GetDependency<IEntityUrlProvider>(),
				PortalCrmConfigurationManager.CreatePortalContext(portalName, requestContext),
				portalName,
				requestContext) { }
	}
}


text:
namespace remoting {

namespace {

#if defined(OS_WIN)
scoped_ptr<base::win::ScopedCOMInitializer> CreateComInitializer(
    AutoThread::ComInitType type) {
  scoped_ptr<base::win::ScopedCOMInitializer> initializer;
  if (type == AutoThread::COM_INIT_MTA) {
    initializer.reset(new base::win::ScopedCOMInitializer(
        base::win::ScopedCOMInitializer::kMTA));
  } else if (type == AutoThread::COM_INIT_STA) {
    initializer.reset(new base::win::ScopedCOMInitializer());
  }
  return initializer.Pass();
}
#endif

}

// Used to pass data to ThreadMain.  This structure is allocated on the stack
// from within StartWithType.
struct AutoThread::StartupData {
  // Fields describing the desired thread behaviour.
  MessageLoop::Type loop_type;

  // Used to receive the AutoThreadTaskRunner for the thread.
  scoped_refptr<AutoThreadTaskRunner> task_runner;

  // Used to synchronize thread startup.
  base::WaitableEvent event;

  explicit StartupData(MessageLoop::Type type)
    : loop_type(type),
      event(false, false) {}
};

// static
scoped_refptr<AutoThreadTaskRunner> AutoThread::CreateWithType(
    const char* name,
    scoped_refptr<AutoThreadTaskRunner> joiner,
    MessageLoop::Type type) {
  AutoThread* thread = new AutoThread(name, joiner);
  scoped_refptr<AutoThreadTaskRunner> task_runner = thread->StartWithType(type);
  if (!task_runner)
    delete thread;
  return task_runner;
}

// static
scoped_refptr<AutoThreadTaskRunner> AutoThread::Create(
    const char* name, scoped_refptr<AutoThreadTaskRunner> joiner) {
  return CreateWithType(name, joiner, MessageLoop::TYPE_DEFAULT);
}

#if defined(OS_WIN)
// static
scoped_refptr<AutoThreadTaskRunner> AutoThread::CreateWithLoopAndComInitTypes(
    const char* name,
    scoped_refptr<AutoThreadTaskRunner> joiner,
    MessageLoop::Type loop_type,
    ComInitType com_init_type) {
  AutoThread* thread = new AutoThread(name, joiner);
  thread->SetComInitType(com_init_type);
  scoped_refptr<AutoThreadTaskRunner> task_runner =
      thread->StartWithType(loop_type);
  if (!task_runner)
    delete thread;
  return task_runner;
}
#endif

AutoThread::AutoThread(const char* name)
  : startup_data_(NULL),
#if defined(OS_WIN)
    com_init_type_(COM_INIT_NONE),
#endif
    thread_(0),
    name_(name),
    was_quit_properly_(false) {
}

AutoThread::AutoThread(const char* name, AutoThreadTaskRunner* joiner)
  : startup_data_(NULL),
#if defined(OS_WIN)
    com_init_type_(COM_INIT_NONE),
#endif
    thread_(0),
    name_(name),
    was_quit_properly_(false),
    joiner_(joiner) {
}

AutoThread::~AutoThread() {
  DCHECK(!startup_data_);

  // Wait for the thread to exit.
  if (thread_) {
    base::PlatformThread::Join(thread_);
  }
}

scoped_refptr<AutoThreadTaskRunner>
AutoThread::StartWithType(MessageLoop::Type type) {
  DCHECK(!thread_);
#if defined(OS_WIN)
  DCHECK(com_init_type_ != COM_INIT_STA || type == MessageLoop::TYPE_UI);
#endif

  StartupData startup_data(type);
  startup_data_ = &startup_data;

  if (!base::PlatformThread::Create(0, this, &thread_)) {
    DLOG(ERROR) << "failed to create thread";
    startup_data_ = NULL;
    return NULL;
  }

  // Wait for the thread to start and initialize message_loop_
  // TODO(wez): Since at this point we know the MessageLoop _will_ run, and
  // the thread lifetime is controlled by the AutoThreadTaskRunner, we would
  // ideally return the AutoThreadTaskRunner to the caller without waiting for
  // the thread to signal us.
  base::ThreadRestrictions::ScopedAllowWait allow_wait;
  startup_data.event.Wait();

  // set it to NULL so we don't keep a pointer to some object on the stack.
  startup_data_ = NULL;

  DCHECK(startup_data.task_runner.get());
  return startup_data.task_runner;
}

#if defined(OS_WIN)
void AutoThread::SetComInitType(ComInitType com_init_type) {
  DCHECK_EQ(com_init_type_, COM_INIT_NONE);
  com_init_type_ = com_init_type;
}
#endif

void AutoThread::QuitThread(
    scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
  if (!task_runner->BelongsToCurrentThread()) {
    task_runner->PostTask(FROM_HERE, base::Bind(&AutoThread::QuitThread,
                                                base::Unretained(this),
                                                task_runner));
    return;
  }

  MessageLoop::current()->Quit();
  was_quit_properly_ = true;

  if (joiner_) {
    joiner_->PostTask(FROM_HERE, base::Bind(&AutoThread::JoinAndDeleteThread,
                                            base::Unretained(this)));
  }
}

void AutoThread::JoinAndDeleteThread() {
  delete this;
}

void AutoThread::ThreadMain() {
  // The message loop for this thread.
  MessageLoop message_loop(startup_data_->loop_type);

  // Complete the initialization of our AutoThread object.
  base::PlatformThread::SetName(name_.c_str());
  ANNOTATE_THREAD_NAME(name_.c_str());  // Tell the name to race detector.
  message_loop.set_thread_name(name_);

  // Return an AutoThreadTaskRunner that will cleanly quit this thread when
  // no more references to it remain.
  startup_data_->task_runner =
      new AutoThreadTaskRunner(message_loop.message_loop_proxy(),
          base::Bind(&AutoThread::QuitThread,
                     base::Unretained(this),
                     message_loop.message_loop_proxy()));

  startup_data_->event.Signal();
  // startup_data_ can't be touched anymore since the starting thread is now
  // unlocked.

#if defined(OS_WIN)
  // Initialize COM on the thread, if requested.
  scoped_ptr<base::win::ScopedCOMInitializer> com_initializer(
      CreateComInitializer(com_init_type_));
#endif

  message_loop.Run();

  // Assert that MessageLoop::Quit was called by AutoThread::QuitThread.
  DCHECK(was_quit_properly_);
}

}  // namespace base


text:
package io.datarouter.virtualnode.replication;

import java.util.List;
import java.util.function.Supplier;

import javax.inject.Inject;
import javax.inject.Singleton;

import io.datarouter.model.databean.Databean;
import io.datarouter.model.key.entity.EntityKey;
import io.datarouter.model.key.primary.EntityPrimaryKey;
import io.datarouter.model.key.primary.RegularPrimaryKey;
import io.datarouter.model.serialize.fielder.DatabeanFielder;
import io.datarouter.scanner.Scanner;
import io.datarouter.storage.Datarouter;
import io.datarouter.storage.client.ReplicationClientIds;
import io.datarouter.storage.node.factory.NodeFactory;
import io.datarouter.storage.node.op.NodeOps;
import io.datarouter.storage.node.op.combo.IndexedSortedMapStorage.IndexedSortedMapStorageNode;
import io.datarouter.storage.node.op.combo.SortedMapStorage.SortedMapStorageNode;
import io.datarouter.storage.node.op.raw.MapStorage.MapStorageNode;
import io.datarouter.virtualnode.replication.ReplicationNodeOptions.ReplicationNodeOptionsBuilder;

@Singleton
public class ReplicationNodeFactory{

	@Inject
	private Datarouter datarouter;
	@Inject
	private NodeFactory nodeFactory;

	/*-------------- build ---------------*/

	public <PK extends RegularPrimaryKey<PK>,
			D extends Databean<PK,D>,
			F extends DatabeanFielder<PK,D>,
			N extends NodeOps<PK,D>>
	N build(
			ReplicationClientIds replicationClientIds,
			Supplier<D> databeanSupplier,
			Supplier<F> fielderSupplier){
		var options = new ReplicationNodeOptionsBuilder().build();
		return build(replicationClientIds, databeanSupplier, fielderSupplier, options);
	}

	public <PK extends RegularPrimaryKey<PK>,
			D extends Databean<PK,D>,
			F extends DatabeanFielder<PK,D>,
			N extends NodeOps<PK,D>>
	N build(
			ReplicationClientIds replicationClientIds,
			Supplier<D> databeanSupplier,
			Supplier<F> fielderSupplier,
			ReplicationNodeOptions options){
		var primaryBuilder = nodeFactory.create(replicationClientIds.primary, databeanSupplier, fielderSupplier);
		options.tableName.ifPresent(primaryBuilder::withTableName);
		options.disableForcePrimary.ifPresent(primaryBuilder::withDisableForcePrimary);
		options.disableIntroducer.ifPresent($ -> primaryBuilder.disableIntroducer());
		options.nodewatchConfigurationBuilder.ifPresent(primaryBuilder::withNodewatchConfigurationBuilder);
		N primary = primaryBuilder.build();
		List<N> replicas = Scanner.of(replicationClientIds.replicas)
				.map(clientId -> {
					var replicaBuilder = nodeFactory.create(clientId, databeanSupplier, fielderSupplier);
					options.tableName.ifPresent(replicaBuilder::withTableName);
					options.disableForcePrimary.ifPresent(replicaBuilder::withDisableForcePrimary);
					options.disableIntroducer.ifPresent($ -> replicaBuilder.disableIntroducer());
					N replicaNode = replicaBuilder.build();
					return replicaNode;
				})
				.list();
		return makeInternal(primary, replicas, options.everyNToPrimary.orElse(null));
	}

	/*------------- build with EntityKey ------------*/

	public <EK extends EntityKey<EK>,
			PK extends EntityPrimaryKey<EK,PK>,
			D extends Databean<PK,D>,
			F extends DatabeanFielder<PK,D>,
			N extends NodeOps<PK,D>>
		N build(
			ReplicationClientIds replicationClientIds,
			Supplier<EK> entityKeySupplier,
			Supplier<D> databeanSupplier,
			Supplier<F> fielderSupplier){
		var options = new ReplicationNodeOptionsBuilder()
				.build();
		return build(replicationClientIds, entityKeySupplier, databeanSupplier, fielderSupplier, options);
	}

	public <EK extends EntityKey<EK>,
			PK extends EntityPrimaryKey<EK,PK>,
			D extends Databean<PK,D>,
			F extends DatabeanFielder<PK,D>,
			N extends NodeOps<PK,D>>
		N build(
			ReplicationClientIds replicationClientIds,
			Supplier<EK> entityKeySupplier,
			Supplier<D> databeanSupplier,
			Supplier<F> fielderSupplier,
			ReplicationNodeOptions options){
		var primaryBuilder = nodeFactory.create(replicationClientIds.primary, entityKeySupplier, databeanSupplier,
				fielderSupplier);
		options.tableName.ifPresent(primaryBuilder::withTableName);
		options.disableForcePrimary.ifPresent(primaryBuilder::withDisableForcePrimary);
		options.disableIntroducer.ifPresent($ -> primaryBuilder.disableIntroducer());
		options.nodewatchConfigurationBuilder.ifPresent(primaryBuilder::withNodewatchConfigurationBuilder);
		N primary = primaryBuilder.build();
		List<N> replicas = Scanner.of(replicationClientIds.replicas)
				.map(clientId -> {
					var replicaBuilder = nodeFactory.create(clientId, entityKeySupplier, databeanSupplier,
							fielderSupplier);
					options.tableName.ifPresent(replicaBuilder::withTableName);
					options.disableForcePrimary.ifPresent(replicaBuilder::withDisableForcePrimary);
					options.disableIntroducer.ifPresent($ -> replicaBuilder.disableIntroducer());
					N replicaNode = replicaBuilder.build();
					return replicaNode;
				})
				.list();
		return makeInternal(primary, replicas, options.everyNToPrimary.orElse(null));
	}

	/*------------ register --------------*/

	public <PK extends RegularPrimaryKey<PK>,
			D extends Databean<PK,D>,
			F extends DatabeanFielder<PK,D>,
			N extends NodeOps<PK,D>>
	N register(
			ReplicationClientIds replicationClientIds,
			Supplier<D> databeanSupplier,
			Supplier<F> fielderSupplier){
		return datarouter.register(build(replicationClientIds, databeanSupplier, fielderSupplier));
	}

	public <PK extends RegularPrimaryKey<PK>,
			D extends Databean<PK,D>,
			F extends DatabeanFielder<PK,D>,
			N extends NodeOps<PK,D>>
	N register(
			ReplicationClientIds replicationClientIds,
			Supplier<D> databeanSupplier,
			Supplier<F> fielderSupplier,
			ReplicationNodeOptions options){
		return datarouter.register(build(
				replicationClientIds,
				databeanSupplier,
				fielderSupplier,
				options));
	}

	/*-------------- private --------------*/

	@SuppressWarnings("unchecked")
	private static <
			PK extends EntityPrimaryKey<?,PK>,
			D extends Databean<PK,D>,
			F extends DatabeanFielder<PK,D>,
			N extends NodeOps<PK,D>>
	N makeInternal(N primary, List<N> replicas, Integer everyNToPrimary){
		if(primary instanceof IndexedSortedMapStorageNode){
			IndexedSortedMapStorageNode<PK,D,F> typedPrimary = (IndexedSortedMapStorageNode<PK,D,F>)primary;
			List<IndexedSortedMapStorageNode<PK,D,F>> typedReplicas = (List<IndexedSortedMapStorageNode<PK,D,F>>)
					replicas;
			return (N)new ReplicationIndexedSortedMapStorageNode<>(typedPrimary, typedReplicas, everyNToPrimary);
		}
		if(primary instanceof SortedMapStorageNode){
			SortedMapStorageNode<PK,D,F> typedPrimary = (SortedMapStorageNode<PK,D,F>)primary;
			List<SortedMapStorageNode<PK,D,F>> typedReplicas = (List<SortedMapStorageNode<PK,D,F>>)replicas;
			return (N)new ReplicationSortedMapStorageNode<>(typedPrimary, typedReplicas, everyNToPrimary);
		}
		if(primary instanceof MapStorageNode){
			MapStorageNode<PK,D,F> typedPrimary = (MapStorageNode<PK,D,F>)primary;
			List<MapStorageNode<PK,D,F>> typedReplicas = (List<MapStorageNode<PK,D,F>>)replicas;
			return (N)new ReplicationMapStorageNode<>(typedPrimary, typedReplicas, everyNToPrimary);
		}
		throw new UnsupportedOperationException("No ReplicationNode implementation found for " + primary.getClass());
	}

}


text:
module I18nize
  module Generators

     class AddLanguageGenerator < Rails::Generators::Base
       source_root File.expand_path("../templates", __FILE__)

       argument :locale, :type => :string, :default => 'es'
       attr_reader :locale

       desc <<DESC
Adds support files for a new language. Spanish (es) default.

Remember to switch to your preferred locale in the config files.

    config.i18n.default_locale = :es

DESC

       def  views
         %w{activerecord devise}.each do |f|
          copy_file(File.join("locales", file_name(f)), "config/locales/i18n_#{ file_name(f) }")
         end
         copy_file(File.join("locales", "#{@locale}.yml"), "config/locales/i18n_#{ @locale}.yml")
       end

       def final_info
         info = <<INFO_F
Remember to switch to your preferred locale in the config files.

    config.i18n.default_locale = :es

INFO_F
       puts info
       end

       private

       def file_name(name, ext="yml")
         "#{name}.#{@locale}.#{ext}"
       end

    end

  end
end


text:
package com.asakusafw.lang.compiler.common;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import java.util.function.Predicate;

import org.hamcrest.FeatureMatcher;
import org.hamcrest.Matcher;
import org.junit.Test;

/**
 * Test for {@link Predicates}.
 */
public class PredicatesTest {

    private static final Predicate<Object> T = Predicates.anything();

    private static final Predicate<Object> F = Predicates.nothing();

    /**
     * anything.
     */
    @Test
    public void anything() {
        assertThat(T.test("a"), is(true));
    }

    /**
     * anything.
     */
    @Test
    public void nothing() {
        assertThat(F.test("a"), is(false));
    }

    /**
     * not.
     */
    @Test
    public void not() {
        assertThat(Predicates.not(T), eq(F));
        assertThat(Predicates.not(F), eq(T));
    }

    /**
     * and.
     */
    @Test
    public void and() {
        assertThat(Predicates.and(T, T), eq(T));
        assertThat(Predicates.and(F, T), eq(F));
        assertThat(Predicates.and(T, F), eq(F));
        assertThat(Predicates.and(F, F), eq(F));
    }

    /**
     * or.
     */
    @Test
    public void or() {
        assertThat(Predicates.or(T, T), eq(T));
        assertThat(Predicates.or(F, T), eq(T));
        assertThat(Predicates.or(T, F), eq(T));
        assertThat(Predicates.or(F, F), eq(F));
    }

    private Matcher<Predicate<Object>> eq(Predicate<Object> p) {
        return new FeatureMatcher<Predicate<Object>, Boolean>(is(p.test(null)), "eq", "eq") {
            @Override
            protected Boolean featureValueOf(Predicate<Object> actual) {
                return actual.test(null);
            }
        };
    }
}


text:
UnityFirmata
============

Unity script to deal with Arduino firmata firmware.


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

<rootTag>
  <Award>
    <AwardTitle>Graduate Research Fellowship Program</AwardTitle>
    <AwardEffectiveDate>07/01/2010</AwardEffectiveDate>
    <AwardExpirationDate>06/30/2015</AwardExpirationDate>
    <AwardAmount>127500</AwardAmount>
    <AwardInstrument>
      <Value>Fellowship</Value>
    </AwardInstrument>
    <Organization>
      11010101
      <Directorate>
        <LongName>Direct For Education and Human Resources</LongName>
      </Directorate>
      <Division>
        <LongName>Division Of Graduate Education</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Gisele T. Muller-Parker</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration/>
    <MinAmdLetterDate>06/21/2010</MinAmdLetterDate>
    <MaxAmdLetterDate>08/15/2013</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>1042806</AwardID>
    <Investigator>
      <FirstName>Brooke</FirstName>
      <LastName>Moyer</LastName>
      <EmailAddress/>
      <StartDate>06/21/2010</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Moyer, Brooke T</Name>
      <CityName>Arlington</CityName>
      <ZipCode>22230</ZipCode>
      <PhoneNumber/>
      <StreetAddress/>
      <CountryName>United States</CountryName>
      <StateName>Virginia</StateName>
      <StateCode>VA</StateCode>
    </Institution>
    <ProgramElement>
      7172
      <Text>GRADUATE RESEARCH FELLOWSHIPS</Text>
    </ProgramElement>
    <ProgramReference>
      7172
      <Text>GRADUATE FELLOWSHIPS</Text>
    </ProgramReference>
    <ProgramReference>
      9179
      <Text>GRADUATE INVOLVEMENT</Text>
    </ProgramReference>
    <ProgramReference>
      SMET
      <Text>SCIENCE, MATH, ENG & TECH EDUCATION</Text>
    </ProgramReference>
  </Award>
</rootTag>


text:
node-http-proxy
===============

a node http(s) proxy server with single process mode or multi process mode(set parameter '-i')

## Install node-http-proxy

```bash
$npm install -g node-http-proxy
```

## Server Start

```bash
$nproxy start -p 9999 -i 1
#start proxy server
#create child process 1 (default 1) or more(limit by cpu cores)
#on port 9999(default 8234)

$nproxy stop #stop server

```

## Use in code
```javascript
var ProxyMaster = require('node-http-proxy').proxyMaster;

var proxymaster = new ProxyMaster({instance:1,port:8123});

proxymaster.start();
```

## Useage
```bash
$curl -x 127.0.0.1:9999 http://www.google.com/
```

## Something need to do

1.finished nproxy command<br>
2.support other http method


text:
package client_actions;

import java.io.Serializable;

/**
 * @summary An action requested by the client
 */
public class Action implements Serializable{
	private static final long serialVersionUID = 3627392075971177604L;
	private String action;

	public Action(String s)
	{
		action = s;
	}

	public String getAction()
	{
		return action;
	}
}


text:
using System.Text.Json.Serialization;
using FluentSpotifyApi.Core.Model;

namespace FluentSpotifyApi.Model.Audio
{
    /// <summary>
    /// The time interval.
    /// </summary>
    public class TimeInterval : JsonObject
    {
        /// <summary>
        /// The start.
        /// </summary>
        [JsonPropertyName("start")]
        public float Start { get; set; }

        /// <summary>
        /// The duration.
        /// </summary>
        [JsonPropertyName("duration")]
        public float Duration { get; set; }

        /// <summary>
        /// The confidence.
        /// </summary>
        [JsonPropertyName("confidence")]
        public float Confidence { get; set; }
    }
}


text:
import * as React from "react"
import styled from "styled-components"
import {
  Flex,
  FlexProps,
  Image,
  HTML,
  ResponsiveBox,
  Text,
  Spacer,
} from "@artsy/palette"
import { createFragmentContainer, graphql } from "react-relay"
import { RouterLink, RouterLinkProps } from "System/Router/RouterLink"
import { FeatureFeaturedLink_featuredLink$data } from "__generated__/FeatureFeaturedLink_featuredLink.graphql"
import { themeGet } from "@styled-system/theme-get"

export type FeaturedLinkSize = "small" | "medium" | "large" | "full"

export interface FeatureFeaturedLinkProps extends FlexProps {
  size: FeaturedLinkSize
  featuredLink: FeatureFeaturedLink_featuredLink$data
}

export const FeatureFeaturedLink: React.FC<FeatureFeaturedLinkProps> = ({
  size,
  featuredLink,
  featuredLink: { href, title, subtitle, description, image },
  ...rest
}) => {
  const img = image && image[size]

  return (
    <Flex flexDirection="column" {...rest}>
      {img && (
        <Figure to={href}>
          <ResponsiveBox
            aspectWidth={img.width ?? 0}
            aspectHeight={img.height ?? 0}
            maxWidth="100%"
            bg="black10"
          >
            <Image
              src={img.src}
              srcSet={img.srcSet}
              alt={title ?? ""}
              width="100%"
              height="100%"
              lazyLoad
            />
          </ResponsiveBox>
        </Figure>
      )}

      {!img && title && (
        <Text variant="lg-display" color="black100" my={2}>
          <RouterLink to={href}>{title || "—"}</RouterLink>
        </Text>
      )}

      <Flex flexDirection={size === "large" ? ["column", "row"] : "column"}>
        <Spacer mt={1} />

        {subtitle && (
          <Text variant="xs" fontWeight="bold">
            {subtitle}
          </Text>
        )}

        <Text variant="lg-display" mt={0.5} lineClamp={3}>
          {title}
        </Text>

        {description &&
          (size === "full" ? (
            <HTML
              variant="lg-display"
              color="black60"
              mt={1}
              html={description}
            />
          ) : (
            <HTML variant="sm" color="black60" mt={0.5} html={description} />
          ))}
      </Flex>
    </Flex>
  )
}

export const FeatureFeaturedLinkFragmentContainer = createFragmentContainer(
  FeatureFeaturedLink,
  {
    featuredLink: graphql`
      fragment FeatureFeaturedLink_featuredLink on FeaturedLink {
        href
        title
        subtitle(format: PLAIN)
        description(format: HTML)
        image {
          # 9:16
          small: cropped(width: 335, height: 240, version: ["main", "wide"]) {
            src
            srcSet
            width
            height
          }
          # 4:5
          medium: cropped(width: 452, height: 324, version: ["main", "wide"]) {
            src
            srcSet
            width
            height
          }
          # 16:9
          large: cropped(width: 904, height: 648, version: ["main", "wide"]) {
            src
            srcSet
            width
            height
          }
          # ?:?
          full: resized(width: 1085, height: 777, version: ["main", "wide"]) {
            src
            srcSet
            width
            height
          }
        }
      }
    `,
  }
)

const Figure = styled(RouterLink)<RouterLinkProps>`
  &:hover + div {
    color: ${themeGet("colors.blue100")};
  }
`


text:
<!DOCTYPE html>

    <title>Bootstrap Example</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Popover Example

Popovers are not CSS-only plugins, and must therefore be initialized with jQuery: select the specified element and call the popover() method.

    Toggle popover

....
....

ventana modal login
https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_modal2&stacked=h
https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_modal2&stacked=h
https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_modal2&stacked=h

https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_modal_js&stacked=h
https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_modal_js&stacked=h
https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_modal_js&stacked=h

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Modal Login Example

    <button type="button" class="btn btn-default btn-lg" id="myBtn">Login</button>

                    <button type="button" class="close" data-dismiss="modal">×</button>

 Login

                    <form role="form">

                             Username
                            <input type="text" class="form-control" id="usrname" placeholder="Enter email">

                             Password
                            <input type="text" class="form-control" id="psw" placeholder="Enter password">

                            <input type="checkbox" value="" checked>Remember me

                        <button type="submit" class="btn btn-success btn-block"> Login</button>
                    </form>

                    <button type="submit" class="btn btn-danger btn-default pull-left" data-dismiss="modal"> Cancel</button>

Not a member? Sign Up

Forgot Password?

.....
....
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#demo">Simple collapsible</button>

    Lorem ipsum dolor sit amet, consectetur adipisicing elit,
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

...
...

https://www.youtube.com/watch?v=9oWre11SLe4
https://www.youtube.com/watch?v=9oWre11SLe4
https://www.youtube.com/watch?v=9oWre11SLe4

Zona Norte

Nivel de lluvia

        <img src="img/<?php echo $string1; ?>.jpg" alt="Lluvia" height="150" width="150">

Temperatura / Hum  <?php echo $estadoHumedad; ?>

        <img src="img/temperatura/<?php echo $estadoTemperatura; ?>.png" alt="Lluvia" height="150" width="150">

Zona Sur

Nivel de lluvia

        <img src="img/<?php echo $string1_zc; ?>.jpg" alt="Lluvia" height="150" width="150">

Temperatura / Hum  <?php echo $estadoHumedad_zc; ?>

        <img src="img/temperatura/<?php echo $estadoTemperatura_zc; ?>.png" alt="Lluvia" height="150" width="150">

Pico Y Placa

Lunes

        <img src="img/<?php echo $string1_zs; ?>.jpg" alt="Lluvia" height="150" width="150">

Martes

        <img src="img/temperatura/<?php echo $estadoTemperatura_zs; ?>.png" alt="Lluvia" height="150" width="150">

Miercoles

        <img src="img/<?php echo$traficoImg; ?>.jpg" alt="Lluvia" height="150" width="150">

Jueves

        <img src="img/<?php echo$traficoImg; ?>.jpg" alt="Lluvia" height="150" width="150">

Viernes

        <img src="img/<?php echo$traficoImg; ?>.jpg" alt="Lluvia" height="150" width="150">

.....................


text:
using Content.Shared.Tools;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.Construction.Components
{
    /// <summary>
    /// Used for something that can be refined by welder.
    /// For example, glass shard can be refined to glass sheet.
    /// </summary>
    [RegisterComponent]
    public sealed class WelderRefinableComponent : Component
    {
        [DataField("refineResult")]
        public HashSet<string>? RefineResult = new();

        [DataField("refineTime")]
        public float RefineTime = 2f;

        [DataField("refineFuel")]
        public float RefineFuel = 0f;

        [DataField("qualityNeeded", customTypeSerializer:typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
        public string QualityNeeded = "Welding";

        public bool BeingWelded;
    }
}