text:
<md-whiteframe class="md-whiteframe-1dp" layout="column"
               ng-style="{ 'margin': $mdMedia('gt-md') ? '8px' : '0 0 4px 0' }">
    <md-toolbar flex>

            Announcement: {{ vm.config.cover.title }}

    </md-toolbar>

{{ vm.config.cover.subtitle }}

            <md-button class="md-raised md-accent">
                {{ vm.config.cover.button.text }}
            </md-button>

</md-whiteframe>
<md-card class="description-card"
         ng-style="{ 'margin': $mdMedia('gt-md') ? '8px' : '0 0 4px 0' }">

    <md-card-content>

    </md-card-content>
</md-card>
<md-card layout="column" ng-style="{ 'margin': $mdMedia('gt-md') ? '8px' : '0 0 4px 0' }">
    <md-toolbar>

            Sponsors

    </md-toolbar>

</md-card>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Models\Society;

class SocietiesController extends Controller
{
    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */

    public function show($id)
    {
        $society = Society::find(1);

        $name = '';
        $presentation = '';
        $mentionLegal = '';
        $cgv = '';

        if (!empty($society)) {
            $name = $society->name;
            $presentation = $society->presentation;
            $mentionLegal = $society->mentionLegal;
            $cgv = $society->mentionLegal;
        }

        return response()->json([
            'name' => $name,
            'presentation' => $presentation,
            'mentionLegal' => $mentionLegal,
            'cgv' => $cgv
        ]);
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        $society = Society::find(1);

        $name = '';
        $presentation = '';
        $mentionLegal = '';
        $cgv = '';

        if (!empty($society)) {
            $name = $society->name;
            $presentation = $society->presentation;
            $mentionLegal = $society->mentionLegal;
            $cgv = $society->mentionLegal;
        }

        return response()->json([
            'name' => $name,
            'presentation' => $presentation,
            'mentionLegal' => $mentionLegal,
            'cgv' => $cgv
        ]);
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
//        $society = new Society();
        $society = Society::firstOrCreate(['id' => 1]);
        $society->id = 1;
        $society->name = $request->name;
        $society->presentation = htmlspecialchars_decode($request->presentation);
        $society->mentionLegal = htmlspecialchars_decode($request->mentionLegal);
        $society->cgv = htmlspecialchars_decode($request->cgv);
        $society->save();

        return response()->json([
            'name' => $society->name,
            'presentation' => $society->presentation,
            'mentionLegal' => $society->mentionLegal,
            'cgv' => $society->cgv
        ]);
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
//        $society = Society::firstOrCreate(['id' => 9]);
//        dd($request->name);
//        $society->name = $request->name;
//        $society->presentation = $request->presentation;
//        $society->mentionLegal = $request->mentionLegal;
//        $society->cgv = $request->cgv;
//        $society->save();
//
//        return response()->json([
//            'name' => $society->name,
//            'presentation' => $society->presentation,
//            'mentionLegal' => $society->mentionLegal,
//            'cgv' => $society->cgv
//        ]);
    }
}


text:
name: Feature Request
about: Create a Feature Request for Apache Dubbo docs
title: ''
labels: kind/enhancement
assignees: ''

---
## Describe the feature

## Release Note
<!-- How should this new feature be announced in our release notes? It can be populated later. -->
<!-- Keep it as a single line. Examples: -->

<!-- RELEASE NOTE: **ADD** New feature in Dapr. -->
<!-- RELEASE NOTE: **FIX** Bug in runtime. -->
<!-- RELEASE NOTE: **UPDATE** Runtime dependency. -->

RELEASE NOTE:


text:
package ua.hospes.sample;

import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;

import ua.hospes.sample.base.BaseAdapterFragment;
import ua.hospes.sample.filterable.FilterableAdapterFragment;
import ua.hospes.sample.multi.MultiChoiceAdapterFragment;
import ua.hospes.sample.sectioned.SectionedFragment;
import ua.hospes.sample.single.SingleChoiceAdapterFragment;

public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.addDrawerListener(toggle);
        toggle.syncState();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);

        if (savedInstanceState == null) {
            navigationView.setCheckedItem(R.id.nav_base_adapter);
            getSupportFragmentManager().beginTransaction()
                    .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                    .replace(R.id.content, BaseAdapterFragment.newInstance())
                    .disallowAddToBackStack()
                    .commit();
        }
    }

    @Override
    public void onBackPressed() {
        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        if (drawer.isDrawerOpen(GravityCompat.START)) {
            drawer.closeDrawer(GravityCompat.START);
        } else {
            super.onBackPressed();
        }
    }

    @SuppressWarnings("StatementWithEmptyBody")
    @Override
    public boolean onNavigationItemSelected(MenuItem item) {
        // Handle navigation view item clicks here.
        int id = item.getItemId();

        if (id == R.id.nav_base_adapter) {
            getSupportFragmentManager().beginTransaction()
                    .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                    .replace(R.id.content, BaseAdapterFragment.newInstance())
                    .disallowAddToBackStack()
                    .commit();

        } else if (id == R.id.nav_filterable_adapter) {
            getSupportFragmentManager().beginTransaction()
                    .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                    .replace(R.id.content, FilterableAdapterFragment.newInstance())
                    .disallowAddToBackStack()
                    .commit();

        } else if (id == R.id.nav_single_choice_adapter) {
            getSupportFragmentManager().beginTransaction()
                    .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                    .replace(R.id.content, SingleChoiceAdapterFragment.newInstance())
                    .disallowAddToBackStack()
                    .commit();

        } else if (id == R.id.nav_multi_choice_adapter) {
            getSupportFragmentManager().beginTransaction()
                    .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                    .replace(R.id.content, MultiChoiceAdapterFragment.newInstance())
                    .disallowAddToBackStack()
                    .commit();

        } else if (id == R.id.nav_sectioned) {
            getSupportFragmentManager().beginTransaction()
                    .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                    .replace(R.id.content, SectionedFragment.newInstance())
                    .disallowAddToBackStack()
                    .commit();
        }

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        drawer.closeDrawer(GravityCompat.START);
        return true;
    }
}


text:
Responsive HTML Email Template
========

This template is designed to work on all major email platforms and it is built with media query, making it responsive for smartphones that supports media query. It serves as a foundation that has been tested and thoroughly reviewed for compatibility, very easy to customize and make changes.

Using MailChimp's html email template (blue-print) as the foundation, this template is an improved version with more row options, re-defined structure and many fixes for Outlook, Yahoo, Hotmail, Gmail e.t.c.

**Download with Bower**

`````
$ bower install respmail
`````
If you don't know what Bower is, read more about it here http://bower.io/

Demo
========
http://www.charlesmudy.com/respmail/
![Preview](http://www.charlesmudy.com/respmail/image.png)

Inspiration
========
https://github.com/mailchimp/Email-Blueprints

Contributing
========
Anyone with strong knowledge of html email coding can make a pull request for changes and improvements. Please always clarify and if possible share online resources to prove or view your suggestion.


text:
.mediumBorder {
	border-width: 2px;
}
.thickBorder {
	border-width: 5px;
}
img.thickBorder, img.mediumBorder {
	border-style: solid;
	border-color: #CCC;
}
.important.soMuch {
	margin: 25px;
	padding: 25px;
	background: red;
	border: none;
}

span.redMarker {
	background-color: red;
}
.invisible {
	opacity: 0.1;
}


text:
import Chart from 'common/charts/pie';

function controller() {
  const $ctrl = this;

  // views
  const paramChart = {
    div: 'charts',
    id: 'pie',
    title: 'Pie chart of "layout" node of flare package',
    cutoff: 3000,
    dispatch
  };
  const chart = new Chart(paramChart);

  return Object.assign($ctrl, {
    editorOptions: {
      data: $ctrl.dataPackage,
      onChange: update
    },
    $onInit() {
      draw();
    }
  });

  function draw() {
    chart.init();
    update();
  }

  function update() {
    chart.data($ctrl.dataPackage.resources[0].data);
    chart.update();
  }

  // dispatch all action to all views
  function dispatch(action) {
    chart.consumer(action);
  }
}

export default {
  controller,
  templateUrl: 'components/charts/pie/template.html',
  bindings: {
    dataPackage: '<package'
  }
};


text:
This is the official repo for the Project Ascension client interface. Borderless window system for WinAPI pulled from deimos1877's [BorderlessWindow](http://github.com/deimos1877/BorderlessWindow).

If you have any questions about the project, feel free to jump in our gitter room and ask!

# Useful Links
- [Website](https://projectascension.io)
- [Subreddit](http://reddit.com/r/Project_Ascension)
- [Twitter](https://twitter.com/Proj_Ascension)
- [Twitch](http://twitch.tv/Project_Ascension)

# License
This project is licensed under the MIT License.

Full license can be viewed [here](LICENSE).

# Contributing
If you would like to contribute, please read over [the contributing guidelines](CONTRIBUTING.md)


text:
package com.hencoder.hencoderpracticedraw4.practice;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Camera;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

import com.hencoder.hencoderpracticedraw4.R;

public class Practice11CameraRotateView extends View {
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    Bitmap bitmap;
    Point point1 = new Point(200, 200);
    Point point2 = new Point(600, 200);

    public Practice11CameraRotateView(Context context) {
        super(context);
    }

    public Practice11CameraRotateView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public Practice11CameraRotateView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    {
        bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.maps);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        Camera camera=new Camera();
        canvas.save();
        camera.save();
        camera.rotateX(30); // 旋转 Camera 的三维空间
        camera.applyToCanvas(canvas); // 把旋转投影到 Canvas
        camera.restore();
        canvas.drawBitmap(bitmap, point1.x, point1.y, paint);
        canvas.restore();

        canvas.save();
        camera.save();
        camera.rotateX(20);
        camera.rotateY(30); // 旋转 Camera 的三维空间
        camera.applyToCanvas(canvas); // 把旋转投影到 Canvas
        camera.restore();
        canvas.drawBitmap(bitmap, point2.x, point2.y, paint);
        canvas.restore();
    }
}


text:
__Description__: Should be able to change the `processBy` order, to `'order'`.

__Notes__

+ `processBy` dictates the order that the `ctr` instance is compliled
+ By default the its processed by `level` order which processes the styles by the the scope level, as in how deeply its nested
+ On the other hand, processed by `order` process the styles in the order they are recived, no exceptions, thus, `queueMedia` and such do not work
    * Don't use `processBy: 'order'` unless you know what you're doing, and why you're doing it


text:
@implementation XMGApp

+(instancetype)appWithDict:(NSDictionary *)dict
{
    //字典转模型
    XMGApp *app =[[XMGApp alloc]init];

    [app setValuesForKeysWithDictionary:dict];
    return app;
}
@end


text:
FOUNDATION_EXPORT double SwiftFormValidatorVersionNumber;

//! Project version string for SwiftFormValidator.
FOUNDATION_EXPORT const unsigned char SwiftFormValidatorVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <SwiftFormValidator/PublicHeader.h>


text:
/********************************************************
*
*  i2cmaster.fabduino.c
*
*  Alejandro Escario Méndez
*   03/05/2015
*  MIT license
*********************************************************/

#include <avr/io.h>
#include <util/delay.h>
#include <util/twi.h>

#define output(directions,pin) (directions |= pin) // set port direction for output
#define input(directions,pin) (directions &= (~pin)) // set port direction for input
#define set(port,pin) (port |= pin) // set port pin
#define clear(port,pin) (port &= (~pin)) // clear port pin
#define pin_test(pins,pin) (pins & pin) // test for port pin
#define bit_test(byte,bit) (byte & (1 << bit)) // test for bit set

#define LED_DIRECTION DDRB
#define LED_PORT PORTB
#define LED_PIN (1 << PB5)

unsigned char recipient = 0x28;
unsigned char data = 1;

void i2c_init_master(){
    // SCL freq = F_CPU/(16+2(TWBR)*prescalerValue)
    TWBR = 32;  // Bit rate
    TWSR = (0 << TWPS1) | (0 << TWPS0); // Setting prescalar bits
}

void i2c_start(){
   TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN); // put start condition
   while(!(TWCR & (1 << TWINT))); // wait until start condition is transmitted
   while((TWSR & 0xF8)!= TW_START); // wait for ACK
}

void i2c_repeated_start(){
   TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN); // put start condition
   while(!(TWCR & (1 << TWINT))); // wait until start condition is transmitted
   while((TWSR & 0xF8)!= TW_REP_START); // wait for ACK
}

void i2c_stop(){
    TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);  // put stop condition
    while(!(TWCR & (1<<TWSTO)));  // wait until stop condition is transmitted
}

void i2c_write_address(unsigned char addr)
{
    TWDR = addr;  // write addr to "call"
    TWCR = (1 << TWINT) | (1 << TWEN);    // Enable TWI and clear interrupt flag
    while(!(TWCR & (1 << TWINT))); // Wait until TWDR byte is transmitted
    while((TWSR & 0xF8)!= TW_MT_SLA_ACK);  // Check for the acknowledgement
}

void i2c_write_data(unsigned char data)
{
    TWDR = data;  // write data in TWDR
    TWCR = (1 << TWINT) | (1 << TWEN);    // clc TWI interrupt flag,En TWI
    while (!(TWCR & (1 << TWINT))); // Wait until TWDR byte transmitted
    while((TWSR & 0xF8) != TW_MT_DATA_ACK); // Check for the acknowledgement
}

void i2c_read_address(unsigned char data)
{
    TWDR=data;  // Address and read instruction
    TWCR=(1<<TWINT)|(1<<TWEN);    // clc TWI interrupt flag,En TWI
    while (!(TWCR & (1<<TWINT))); // Wait until TWDR byte transmitted
    while((TWSR & 0xF8)!= TW_MR_SLA_ACK);  // Check for the acknowledgement
}

void i2c_read_data()
{
    TWCR=(1<<TWINT)|(1<<TWEN);    // clc TWI interrupt flag,En TWI
    while (!(TWCR & (1<<TWINT))); // Wait until TWDR byte transmitted
    while((TWSR & 0xF8) != TW_MR_DATA_NACK); // Check for the acknowledgement

    blink(TWDR);
}

void blink(unsigned char num){
  int i;
  for(i = 0; i < num; i++){
     _delay_ms(50);
     set(LED_PORT,LED_PIN);
     _delay_ms(50);
     clear(LED_PORT, LED_PIN);
  }
}

int main() {
   output(LED_DIRECTION, LED_PIN);

   i2c_init_master();

   while (1) {

      i2c_start();
      i2c_write_address(recipient);
      i2c_write_data(data);
      i2c_stop();

      _delay_ms(1000);
      i2c_start();
      i2c_read_address(recipient+1);
      i2c_read_data();
      i2c_stop();
      _delay_ms(1000);

      data ++;
      data %= 10;
   }
}


text:
package io.github.mzmine.modules.io.import_rawdata_all;

import io.github.mzmine.modules.io.import_spectral_library.SpectralLibraryImportParameters;
import io.github.mzmine.parameters.Parameter;
import io.github.mzmine.parameters.impl.SimpleParameterSet;
import io.github.mzmine.parameters.parametertypes.filenames.FileNamesParameter;
import io.github.mzmine.parameters.parametertypes.submodules.OptionalModuleParameter;
import java.util.List;
import javafx.stage.FileChooser.ExtensionFilter;

public class AllSpectralDataImportParameters extends SimpleParameterSet {

  public static final ExtensionFilter ALL_MS_DATA_FILTER = new ExtensionFilter("MS data", "*.mzML",
      "*.mzml", "*.mzXML", "*.mzxml", "*.imzML", "*.imzml", "*.d", "*.raw", "*.RAW", "*.mzData",
      "*.mzdata", "*.aird");

  public static final List<ExtensionFilter> extensions = List.of( //
      ALL_MS_DATA_FILTER, new ExtensionFilter("mzML MS data", "*.mzML", "*.mzml"), //
      new ExtensionFilter("mzXML MS data", "*.mzXML", "*.mzxml"), //
      new ExtensionFilter("imzML MS imaging data", "*.imzML", "*.imzml"), //
      new ExtensionFilter("Bruker tdf files", "*.d"), //
      new ExtensionFilter("Thermo RAW files", "*.raw", "*.RAW"), //
      new ExtensionFilter("Waters RAW folders", "*.raw", "*.RAW"), //
      new ExtensionFilter("mzData MS data", "*.mzData", "*.mzdata"),
      new ExtensionFilter("aird MS data", "*.aird", "*.Aird", "*.AIRD"), //
      new ExtensionFilter("zip", "*.zip", "*.gz"), //
      new ExtensionFilter("All files", "*.*") //
  );

  public static final List<ExtensionFilter> extensionsFolders = List.of( //
      new ExtensionFilter("Bruker tdf files", "*.d"), //
      new ExtensionFilter("Waters RAW folders", "*.raw"), //
      new ExtensionFilter("All files", "*.*") //
  );

  public static final FileNamesParameter fileNames = new FileNamesParameter("File names", "",
      extensions);

  public static final OptionalModuleParameter<AdvancedSpectraImportParameters> advancedImport = new OptionalModuleParameter<>(
      "Advanced import",
      "Caution: Advanced option that applies mass detection (centroiding+thresholding) directly to imported scans (see help).\nAdvantage: Lower memory consumption\nCaution: All processing steps will directly change the underlying data, with no way of retrieving raw data or initial results.",
      new AdvancedSpectraImportParameters(), true);

  public AllSpectralDataImportParameters() {
    super(new Parameter[]{fileNames, //
        advancedImport, // directly process masslists
        // allow import of spectral libraries
        SpectralLibraryImportParameters.dataBaseFiles});
  }

}


text:
<?php

declare(strict_types = 1);

namespace Sop\CryptoTypes\AlgorithmIdentifier\Signature;

/**
 * RSA with SHA-224 signature algorithm identifier.
 *
 * @see https://tools.ietf.org/html/rfc4055#section-5
 */
class SHA224WithRSAEncryptionAlgorithmIdentifier extends RFC4055RSASignatureAlgorithmIdentifier
{
    /**
     * Constructor.
     */
    public function __construct()
    {
        parent::__construct();
        $this->_oid = self::OID_SHA224_WITH_RSA_ENCRYPTION;
    }

    /**
     * {@inheritdoc}
     */
    public function name(): string
    {
        return 'sha224WithRSAEncryption';
    }
}


text:
package org.rioproject.deploy;

import org.rioproject.opstring.ServiceElement;
import org.rioproject.system.ComputeResourceUtilization;

import java.io.Serializable;

/**
 * Provides information about a deployed service.
 */
public class DeployedService implements Serializable {
    static final long serialVersionUID = 1L;
    private ServiceElement serviceElement;
    private ServiceBeanInstance serviceBeanInstance;
    private ComputeResourceUtilization computeResourceUtilization;

    public DeployedService(ServiceElement serviceElement,
                           ServiceBeanInstance serviceBeanInstance,
                           ComputeResourceUtilization computeResourceUtilization) {
        this.serviceElement = serviceElement;
        this.serviceBeanInstance = serviceBeanInstance;
        this.computeResourceUtilization = computeResourceUtilization;
    }

    public ServiceElement getServiceElement() {
        return serviceElement;
    }

    public ServiceBeanInstance getServiceBeanInstance() {
        return serviceBeanInstance;
    }

    public ComputeResourceUtilization getComputeResourceUtilization() {
        return computeResourceUtilization;
    }

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

        DeployedService that = (DeployedService) o;

        return !(serviceBeanInstance != null?
                !serviceBeanInstance.equals(that.serviceBeanInstance):
                that.serviceBeanInstance != null);

    }

    @Override
    public int hashCode() {
        int result = serviceElement != null ? serviceElement.hashCode() : 0;
        result = 31 * result +
                (serviceBeanInstance != null
                        ? serviceBeanInstance.hashCode()
                        : 0);
        result = 31 * result + (computeResourceUtilization != null
                ? computeResourceUtilization.hashCode()
                : 0);
        return result;
    }
}


text:
import 'moment/locale/zh-cn'

import moment from 'moment'

moment.locale('zh-cn')


text:
namespace MassTransit.Services.Timeout.Messages
{
    using System;

	/// <summary>
	/// Used by the Timeout Service, cancels the scheduled timeout with the specified CorrelationId
	/// </summary>
    [Serializable]
    public class CancelTimeout :
        CorrelatedBy<Guid>
    {
    	public Guid CorrelationId { get; set; }
		public int Tag { get; set; }
    }
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="de.fhws.mobapps.vorl8.demodatabase.ResultsActivity" >

    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:showAsAction="never"
        android:title="@string/action_settings"/>

</menu>


text:
package org.nbfx.actions.spi;

import java.util.Collections;
import java.util.List;
import javafx.scene.control.MenuItem;
import javax.swing.JMenuItem;
import org.nbfx.util.NBFxUtilities;

class JMenuItemUtil {

    private JMenuItemUtil() {
    }

    public static List<MenuItem> basicConversion(final JMenuItem jmi) {
        return basicConversion(new MenuItem(), jmi);
    }

    public static List<MenuItem> basicConversion(final MenuItem menuItem, final JMenuItem jmi) {
        menuItem.setText(jmi.getText());
        menuItem.setId(jmi.getActionCommand());
        menuItem.setOnAction(ae -> NBFxUtilities.SWING.runLater(() -> jmi.doClick()));
        return Collections.singletonList(menuItem);
    }
}


text:
namespace PhotoShare.Client.Core
{
    using System;
    using PhotoShare.Client.Interfaces;

    public class Writer : IWriter
    {
        public void WriteLine(string message) => Console.WriteLine(message);
    }
}


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

namespace Santase.Logic
{
    public class InternalGameExceptions: Exception
    {
        public InternalGameExceptions(string message)
            : base(message)
        {

        }
    }
}


text:
package ariba.util.core;

import java.util.Collection;
import java.util.List;
import java.util.SortedSet;

/**
    Convenience class that abstracts the notion of
    processing a collection of objects in chunks of a given size.

    @aribaapi ariba
*/
public abstract class BatchProcessor
{
    /**
        Processes the supplied collection.

        @throws BatchProcessingException if there is an exception procesing
                collection
        @aribaapi ariba
    */
    public abstract void processBatch (Collection collection)
    throws BatchProcessingException;

    /**
        Represents the position "before the first element" in a collection.
        @aribaapi private
    */
    private static final Object InitialSentinel = new Object();

    /**
        Processes the supplied collection which may be of any size.
        This implementation splits collection up into batches
        and repeatedly calls {@link #processBatch} as necessary.

        If collection is a List, then this
        method calls {@link #processBatch} with Lists. Similarly
        for SortedSets.

        Each of the calls to
        process() satisfies the following conditions:

 the size of the collection argument is greater than zero and
             determined by the sizer

 the order of the collection is preserved

 all elements are passed exactly once.

        @throws BatchProcessingException if there is an exception procesing
                the batches
        @aribaapi ariba
    */
    public final void process (Collection collection, BatchSizer sizer)
    throws BatchProcessingException
    {
        if (sizer instanceof BatchSizer.Fixed && collection instanceof List) {
            BatchSizer.Fixed fixed = (BatchSizer.Fixed)sizer;
            if (fixed.currentSize() == 0) {
                process((List)collection, fixed.batchSize());
                return;
            }
        }
        SortedSet set = (collection instanceof SortedSet) ? (SortedSet)collection : null;
        List list = (collection instanceof List) ? (List)collection : null;
        List subList = (set == null && list == null) ? ListUtil.list() : null;
        Object begin = InitialSentinel;
        int beginIdx = 0;
        boolean doProcessBatch = false;
        int idx = 0;
        for (Object object : collection)
        {
            if (doProcessBatch) {
                sizer.reset();
                Collection subCollection;
                if (set != null) {
                    subCollection = (begin == InitialSentinel)
                                    ? set.headSet(object)
                                    : set.subSet(begin, object);
                    begin = object;
                }
                else if (list != null) {
                    subCollection = list.subList(beginIdx, idx);
                    beginIdx = idx;
                }
                else {
                    subCollection = subList;
                    subList = ListUtil.list();
                }
                processBatch(subCollection);
            }
            ++idx;
            if (subList != null) {
                subList.add(object);
            }
            doProcessBatch = sizer.addToBatch(object);
        }
        Collection subCollection;
        if (set != null) {
            subCollection = (begin == InitialSentinel) ? set : set.tailSet(begin);
        }
        else if (list != null) {
            subCollection = list.subList(beginIdx, list.size());
        }
        else {
            subCollection = subList;
        }
        if (!subCollection.isEmpty()) {
            processBatch(subCollection);
        }
    }

    /**
        Processes the supplied collection which may be of any size.
        This implementation splits collection up into batches
        and repeatedly calls {@link #processBatch} as necessary.

        If collection is a List, then this
        method calls {@link #processBatch} with Lists. Similarly
        for SortedSets.

        Each of the calls to
        process() satisfies the following conditions:

 the size of the collection argument is greater than zero and less
             than or equal to the batch size

 the order of the collection is preserved

 all elements are passed exactly once.

        @throws BatchProcessingException if there is an exception procesing
                the batches
        @aribaapi ariba
    */
    public final void process (Collection collection, int batchSize)
    throws BatchProcessingException
    {
        if (collection instanceof List) {
            process((List)collection, batchSize);
        }
        else {
            process(collection, new BatchSizer.Fixed(batchSize));
        }
    }

    /**
        Processes the supplied list which may be of any size.
        This implementation splits list up into batches
        and repeatedly calls {@link #processBatch} as necessary.
        Each of the calls to
        process() satisfies the following conditions:

 the size of the list argument is greater than zero and less
             than or equal to the batch size

 the order of the list is preserved

 all elements are passed exactly once.

        @throws BatchProcessingException if there is an exception procesing
                the batches
        @aribaapi ariba
    */
    public final void process (List list, int batchSize)
    throws BatchProcessingException
    {
        int remaining = list.size();
        if (remaining <= batchSize) {
            processBatch(list);
        }
        else {
            int startIdx = 0;
            do {
                int length = Math.min(batchSize, remaining);
                List subList = list.subList(startIdx, startIdx + length);
                processBatch(subList);
                remaining -= length;
                startIdx += length;
            }
            while (remaining > 0);
        }
    }
}


text:
package pro.jdbc.dao.impl;

import java.util.List;

import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;

import pro.jdbc.JdbcUtils;
import pro.jdbc.dao.BaseDao;

public class DaoSpringImpl implements BaseDao {
	private SimpleJdbcTemplate simple = new SimpleJdbcTemplate(JdbcUtils.getDataSource());
	@Override
	public <T> void add(String[]args, T instance) {
		String sql="insert into goj_"+instance.getClass().getSimpleName().toLowerCase()+" (";
		for(int i=0;i<args.length;i++){
			if(i!=args.length-1)
				sql =sql+args[i]+",";
			else
				sql =sql+args[i]+")";
		}
		for(int i=0;i<args.length;i++){
			if(i==0)
				sql=sql+"values(:"+args[i];
			else
				if(i!=args.length-1)
					sql=sql+",:"+args[i];
				else
					sql=sql+",:"+args[i]+")";
		}
		SqlParameterSource param = new BeanPropertySqlParameterSource(instance);
		KeyHolder keyHolder =new GeneratedKeyHolder();
		this.simple.getNamedParameterJdbcOperations().update(sql, param, keyHolder);
	}

	@Override
	public <T> void delete( T instance) {
		String sql= "delete from goj_"+instance.getClass().getSimpleName().toLowerCase()+" where id=:id";
		SqlParameterSource param = new BeanPropertySqlParameterSource(instance);
		KeyHolder keyHolder =new GeneratedKeyHolder();
		this.simple.getNamedParameterJdbcOperations().update(sql, param, keyHolder);

	}

	@Override
	public <T> List<T> findByProperties(String[]args,Class<T> clazz, Object...objs) {
		String sql="select * from goj_"+clazz.getSimpleName().toLowerCase();
		if(args != null){
			for(int i=0;i<args.length;i++){
				if(i==0)
					sql =sql+" where "+args[i]+"=?";
				else
					sql =sql+" and "+args[i]+"=?";
			}
		}
		List<T> list=this.simple.query(sql,
				ParameterizedBeanPropertyRowMapper.newInstance(clazz), objs);

		return list;
	}

	@Override
	public <T> void update(String[]args, T instance) {
		String sql="update goj_"+instance.getClass().getSimpleName().toLowerCase()+" set ";
		for(int i=0;i<args.length;i++){
			if(i!=args.length-1)
				sql =sql+args[i]+"=:"+args[i]+",";
			else
				sql =sql+args[i]+"=:"+args[i];
		}
		sql=sql+" where "+instance.getClass().getSimpleName().toLowerCase()+
				"_id=:"+instance.getClass().getSimpleName().toLowerCase()+"_id";
		SqlParameterSource param = new BeanPropertySqlParameterSource(instance);
		KeyHolder keyHolder =new GeneratedKeyHolder();
		this.simple.getNamedParameterJdbcOperations().update(sql, param, keyHolder);

	}

}


text:
using namespace std;

MenuSDLRenderer::MenuSDLRenderer(SDL_Renderer* renderer, SDL_Window* screen)
{
  init(renderer, screen);
}

Rml::ElementDocument* MenuSDLRenderer::loadMenu(std::string menuRmlFile, bool loadAndShow)
{
  Rml::ElementDocument *doc = EventManager::getInstance()->LoadWindow(menuRmlFile.c_str(), loadAndShow);
  if (! doc)
  {
    MickLogger::getInstance()->error(this, string("Error loading ").append(menuRmlFile));
    throw std::runtime_error(std::string("Menu RML was not found"));
  }
  return doc;
}

void MenuSDLRenderer::init(SDL_Renderer* renderer, SDL_Window *screen)
{
  int windowWidth, windowHeight;
  SDL_GetWindowSize(screen, &windowWidth, &windowHeight);
  //not initialised on start: SDL_GetRendererOutputSize(m_renderer, &windowWidth, &windowHeight);
  MickLogger::getInstance()->debug(this, std::string("MenuRenderer::init window wxh: ").append(std::to_string(windowWidth)).append("x").append(std::to_string(windowHeight)) );
  RmlUiSDL2Renderer* rmluiRenderGlue = new RmlUiSDL2Renderer(renderer, screen);
  RmlUiSDL2SystemInterface* rmluiSystemGlue = new RmlUiSDL2SystemInterface();
  ShellFileInterface* rmluiFileGlue = new ShellFileInterface("assets/menu/");

  Rml::SetFileInterface(rmluiFileGlue);
  Rml::SetRenderInterface(rmluiRenderGlue);
  Rml::SetSystemInterface(rmluiSystemGlue);

  if(!Rml::Initialise())
  {
    throw std::runtime_error(std::string("Unable to init RmlUi."));
  }

  Rml::LoadFontFace("assets/fonts/FreeMono.ttf");
  // These appear to be non-free
  //Rml::LoadFontFace("assets/fonts/Delicious-Bold.otf");
  //Rml::LoadFontFace("assets/fonts/Delicious-BoldItalic.otf");
  //Rml::LoadFontFace("assets/fonts/Delicious-Italic.otf");
  //Rml::LoadFontFace("assets/fonts/Delicious-Roman.otf");

  m_context = Rml::CreateContext("default",
                                   Rml::Vector2i(windowWidth, windowHeight));

#ifndef NDEBUG
  Rml::Debugger::Initialise(m_context);
#endif

  // Initialise the event instancer and handlers.
  EventInstancer* event_instancer = new EventInstancer();
  Rml::Factory::RegisterEventListenerInstancer(event_instancer);

  EventManager::getInstance()->RegisterEventHandler("gameoptions.rml", new EventHandlerOptions());
  loadMenu("mainmenu.rml");
  m_renderer = renderer;
  m_screen = screen;
}

void MenuSDLRenderer::loadScoreBoard(shared_ptr<PlayerCharacterEntity> winner, int gameTotalLength)
{
  m_scoreBinder = new ScoreBoardBinder(m_context, winner, gameTotalLength);
  Rml::ElementDocument *doc = loadMenu("scoreboard.rml", (winner != nullptr));
  if(! winner)
  {
    MickLogger::getInstance()->debug(this, "No winner - hiding winner stats");
    doc->GetElementById("winnerStats")->SetClass("invisible", true);
    doc->Focus();
    doc->Show();
  }
}

void MenuSDLRenderer::clearScoreBoard()
{
  if(m_scoreBinder && m_context)
  {
    m_scoreBinder->RemoveDataBinding(m_context);
    delete m_scoreBinder;
    m_scoreBinder = nullptr;
  }
}

void MenuSDLRenderer::handleWindowResize()
{
  int windowWidth, windowHeight;
  SDL_GetWindowSize(m_screen, &windowWidth, &windowHeight);
  if( m_context->GetDimensions().x != windowWidth || m_context->GetDimensions().y != windowHeight)
  {
    m_context->SetDimensions(Rml::Vector2i(windowWidth, windowHeight));
  }
}

bool MenuSDLRenderer::showMenu()
{
  SDL_Event event;

  bool continueRenderingMenu = true;

  if(! m_renderer)
  {
    MickLogger::getInstance()->error(this, "MenuRenderer::showMenu has nullptr for m_renderer!");
    return false;
  }

  handleWindowResize(); // Check for adjusted window size.

  m_context->Render();
  RmlUiSDL2SystemInterface* systemInterface = (RmlUiSDL2SystemInterface*) Rml::GetSystemInterface();

  while(SDL_PollEvent(&event))
  {
    switch(event.type)
    {
      case SDL_QUIT:
        continueRenderingMenu = false;
        MickLogger::getInstance()->debug(this, "SDL_QUIT");
        GameSettings::getInstance()->setGameState(GameSettings::GAME_QUIT);
        break;

      case SDL_MOUSEMOTION:
        m_context->ProcessMouseMove(event.motion.x, event.motion.y, systemInterface->GetKeyModifiers());
        break;
      case SDL_MOUSEBUTTONDOWN:
        m_context->ProcessMouseButtonDown(systemInterface->TranslateMouseButton(event.button.button), systemInterface->GetKeyModifiers());
        break;

      case SDL_MOUSEBUTTONUP:
        m_context->ProcessMouseButtonUp(systemInterface->TranslateMouseButton(event.button.button), systemInterface->GetKeyModifiers());
        break;

      case SDL_MOUSEWHEEL:
        m_context->ProcessMouseWheel(event.wheel.y, systemInterface->GetKeyModifiers());
        break;

      case SDL_KEYDOWN:
        {
          //printf("keydown: %d, sdl: %d\n", event.key, event.key.keysym.sym);
          // Intercept SHIFT + ~ key stroke to toggle libRmlUi's
          // visual debugger tool
          MickLogger::getInstance()->debug(this, std::string("SDL_KEYDOWN, sym:").append(std::to_string(event.key.keysym.sym)));
          if( event.key.keysym.sym == SDLK_BACKQUOTE &&
              event.key.keysym.mod == KMOD_LSHIFT )
          {
#ifndef NDEBUG
            Rml::Debugger::SetVisible( ! Rml::Debugger::IsVisible() );
#endif
            break;
          }
          else if(event.key.keysym.sym == SDLK_ESCAPE)
          {
            Rml::ElementDocument *document = m_context->GetFocusElement()->GetOwnerDocument();
            if(document)
            {
              MickLogger::getInstance()->debug(this, std::string("current document id: ").append(document ? document->GetId() : "null") );
              Rml::Element* escapeActionElement = MickRmlUIElementUtil::getFirstElementWithAttribute(document, "escapeAction");
              if(escapeActionElement)
              {
                MickLogger::getInstance()->debug(this, std::string("escapeActionElement element id: ").append(escapeActionElement->GetId()) );
                // process the element with the attribute 'escapeAction'
                escapeActionElement->Focus();
                m_context->ProcessKeyDown(systemInterface->TranslateKey(SDLK_RETURN), 0);
              }
            }
            break;
          }
          else if(event.key.keysym.sym == SDLK_DOWN
                  || event.key.keysym.sym == SDLK_UP)
          {
            Rml::Element* focussedElement = m_context->GetFocusElement();
            int currentTabIndex = MickRmlUIElementUtil::getTabIndex(focussedElement);
            Rml::Element* nextElement = MickRmlUIElementUtil::getChildElementWithTabIndex(focussedElement->GetParentNode(), (event.key.keysym.sym == SDLK_DOWN) ? ++currentTabIndex : --currentTabIndex);
            if(nextElement)
            {
              nextElement->Focus();
            }
            break;
          }

          m_context->ProcessKeyDown(systemInterface->TranslateKey(event.key.keysym.sym), systemInterface->GetKeyModifiers());
          break;
        }

      default:
        break;
    }
  }
  m_context->Update();

  return continueRenderingMenu;
}

MenuSDLRenderer::~MenuSDLRenderer()
{
  Rml::Shutdown();
  if(m_scoreBinder)
  {
    delete m_scoreBinder;
    m_scoreBinder = nullptr;
  }
}


text:
using System.Runtime.CompilerServices;

namespace System.Html {
	[IgnoreNamespace, Imported(TypeCheckCode = "{$System.Script}.isInstanceOfType({this}, Element) && {this}.tagName === 'DIR'"), ScriptName("Element")]
	public partial class DirectoryElement : Element {
		internal DirectoryElement() {
		}

		public void AddEventListener(DirectoryElementEvents type, Action listener) {
		}

		public void AddEventListener(DirectoryElementEvents type, Action listener, bool capture) {
		}

		public void AddEventListener(DirectoryElementEvents type, HtmlEventHandler listener) {
		}

		public void AddEventListener(DirectoryElementEvents type, HtmlEventHandler listener, bool capture) {
		}

		public void AddEventListener(DirectoryElementEvents type, HtmlEventHandlerWithTarget<DirectoryElement> listener) {
		}

		public void AddEventListener(DirectoryElementEvents type, HtmlEventHandlerWithTarget<DirectoryElement> listener, bool capture) {
		}

		public void AddEventListener(DirectoryElementEvents type, IEventListener listener) {
		}

		public void AddEventListener(DirectoryElementEvents type, IEventListener listener, bool capture) {
		}

		public void AddEventListener(string type, HtmlEventHandlerWithTarget<DirectoryElement> listener) {
		}

		public void AddEventListener(string type, HtmlEventHandlerWithTarget<DirectoryElement> listener, bool capture) {
		}

		[IntrinsicProperty]
		public bool Compact {
			get {
				return false;
			}
			set {
			}
		}

		public void RemoveEventListener(DirectoryElementEvents type, Action listener) {
		}

		public void RemoveEventListener(DirectoryElementEvents type, Action listener, bool capture) {
		}

		public void RemoveEventListener(DirectoryElementEvents type, HtmlEventHandler listener) {
		}

		public void RemoveEventListener(DirectoryElementEvents type, HtmlEventHandler listener, bool capture) {
		}

		public void RemoveEventListener(DirectoryElementEvents type, HtmlEventHandlerWithTarget<DirectoryElement> listener) {
		}

		public void RemoveEventListener(DirectoryElementEvents type, HtmlEventHandlerWithTarget<DirectoryElement> listener, bool capture) {
		}

		public void RemoveEventListener(DirectoryElementEvents type, IEventListener listener) {
		}

		public void RemoveEventListener(DirectoryElementEvents type, IEventListener listener, bool capture) {
		}

		public void RemoveEventListener(string type, HtmlEventHandlerWithTarget<DirectoryElement> listener) {
		}

		public void RemoveEventListener(string type, HtmlEventHandlerWithTarget<DirectoryElement> listener, bool capture) {
		}
	}
}


text:
using System.Collections.Generic;

namespace Lucene.Net.Index
{

    ///
    /// Common util methods for dealing with <seealso cref="IndexReader"/>s and <seealso cref="IndexReaderContext"/>s.
    ///
    /// @lucene.internal
    ///
    public sealed class ReaderUtil
    {
        private ReaderUtil() // no instance
        {
        }

        ///
        /// Walks up the reader tree and return the given context's top level reader
        /// context, or in other words the reader tree's root context.
        ///
        public static IndexReaderContext GetTopLevelContext(IndexReaderContext context)
        {
            while (context.Parent != null)
            {
                context = context.Parent;
            }
            return context;
        }

        ///
        /// Returns index of the searcher/reader for document n in the
        /// array used to construct this searcher/reader.
        ///
        public static int SubIndex(int n, int[] docStarts) // find
        {
            // searcher/reader for doc n:
            int size = docStarts.Length;
            int lo = 0; // search starts array
            int hi = size - 1; // for first element less than n, return its index
            while (hi >= lo)
            {
                int mid = (int)((uint)(lo + hi) >> 1);
                int midValue = docStarts[mid];
                if (n < midValue)
                {
                    hi = mid - 1;
                }
                else if (n > midValue)
                {
                    lo = mid + 1;
                }
                else // found a match
                {
                    while (mid + 1 < size && docStarts[mid + 1] == midValue)
                    {
                        mid++; // scan to last match
                    }
                    return mid;
                }
            }
            return hi;
        }

        ///
        /// Returns index of the searcher/reader for document n in the
        /// array used to construct this searcher/reader.
        ///
        public static int SubIndex(int n, IList<AtomicReaderContext> leaves) // find
        {
            // searcher/reader for doc n:
            int size = leaves.Count;
            int lo = 0; // search starts array
            int hi = size - 1; // for first element less than n, return its index
            while (hi >= lo)
            {
                int mid = (int)((uint)(lo + hi) >> 1);
                int midValue = leaves[mid].DocBase;
                if (n < midValue)
                {
                    hi = mid - 1;
                }
                else if (n > midValue)
                {
                    lo = mid + 1;
                }
                else // found a match
                {
                    while (mid + 1 < size && leaves[mid + 1].DocBase == midValue)
                    {
                        mid++; // scan to last match
                    }
                    return mid;
                }
            }
            return hi;
        }
    }
}


text:
.styleSans159.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 159.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans152.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 152.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans74.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 74.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans726.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 726.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 8.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 10.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 11.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 5.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 12.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans18.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 18.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans67.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 67.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans725.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 725.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans15.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 15.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans41.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 41.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans29.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 29.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 9.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans129.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 129.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans82.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 82.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans3.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 3.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans155.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 155.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 7.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans334.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 334.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 2.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 12pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans504.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 504.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans699.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 699.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans24.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 24.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans357.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 357.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans20.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 20.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans36.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 36.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans194.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 194.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}


text:
#if !ENABLE_SPARKLE

void initializeSparkle()
{
    // No-op.
}

#else // ENABLE_SPARKLE

#import <Cocoa/Cocoa.h>
#import <Sparkle/SUUpdater.h>
#import <objc/objc-runtime.h>
#import "WebKitNightlyEnabler.h"

// We need to tweak the wording of the prompt to make sense in the context of WebKit and Safari.
static NSString* updatePermissionPromptDescription(id self, SEL _cmd)
{
    return @"Should WebKit automatically check for updates? You can always check for updates manually from the Safari menu.";
}

static NSPanel *updateAlertPanel(id updateItem, id host)
{
    NSString *hostName = objc_msgSend(host, @selector(name));
    NSPanel *panel = NSGetInformationalAlertPanel([NSString stringWithFormat:@"Would you like to download and install %@ %@ now?", hostName, objc_msgSend(updateItem, @selector(displayVersionString))],
                                                  [NSString stringWithFormat:@"You are currently running %@ %@.", hostName, objc_msgSend(host, @selector(displayVersion))],
                                                  @"Install Update", @"Skip This Version", @"Remind Me Later");
    NSArray *subviews = [[panel contentView] subviews];
    NSEnumerator *e = [subviews objectEnumerator];
    NSView *view;
    while ((view = [e nextObject])) {
        if (![view isKindOfClass:[NSButton class]])
            continue;

        NSButton *button = (NSButton *)view;
        [button setAction:@selector(webKitHandleButtonPress:)];
        if ([button tag] == NSAlertOtherReturn)
            [button setKeyEquivalent:@"\033"];
    }
    [panel center];
    return panel;
}

// Sparkle's udpate alert panel looks odd with the release notes hidden, so we
// swap it out with a standard NSAlert-style panel instead.
static id updateAlertInitForAlertPanel(id self, SEL _cmd, id updateItem, id host)
{
    NSPanel *panel = updateAlertPanel(updateItem, host);
    [panel setDelegate:self];

    self = [self initWithWindow:panel];
    if (!self)
        return nil;

    [updateItem retain];
    [host retain];

    object_setInstanceVariable(self, "updateItem", (void*)updateItem);
    object_setInstanceVariable(self, "host", (void*)host);

    [self setShouldCascadeWindows:NO];

    return self;
}

@implementation NSAlert (WebKitLauncherExtensions)

- (void)webKitHandleButtonPress:(id)sender
{
    // We rely on the fact that NSAlertOtherReturn == -1, NSAlertAlternateReturn == 0 and NSAlertDefaultReturn == 1
    // to map the button tag to the corresponding selector
    SEL selectors[] = { @selector(remindMeLater:), @selector(skipThisVersion:), @selector(installUpdate:) };
    SEL selector = selectors[[sender tag] + 1];

    id delegate = [[sender window] delegate];
    objc_msgSend(delegate, selector, sender);
}

@end

static NSString *userAgentStringForSparkle()
{
    NSBundle *safariBundle = [NSBundle mainBundle];
    NSString *safariVersion = [[safariBundle localizedInfoDictionary] valueForKey:@"CFBundleShortVersionString"];
    NSString *safariBuild = [[[safariBundle infoDictionary] valueForKey:(NSString *)kCFBundleVersionKey] substringFromIndex:1];
    NSString *webKitRevision = [[webKitLauncherBundle() infoDictionary] valueForKey:(NSString *)kCFBundleVersionKey];
    NSString *applicationName = [NSString stringWithFormat:@"Version/%@ Safari/%@ WebKitRevision/%@", safariVersion, safariBuild, webKitRevision];
    Class WebView = objc_lookUpClass("WebView");
    return objc_msgSend(WebView, @selector(_standardUserAgentWithApplicationName:), applicationName);
}

void initializeSparkle()
{
    // Override some Sparkle behaviour
    Method methodToPatch = class_getInstanceMethod(objc_getRequiredClass("SUUpdatePermissionPrompt"), @selector(promptDescription));
    method_setImplementation(methodToPatch, (IMP)updatePermissionPromptDescription);

    methodToPatch = class_getInstanceMethod(objc_getRequiredClass("SUUpdateAlert"), @selector(initWithAppcastItem:host:));
    method_setImplementation(methodToPatch, (IMP)updateAlertInitForAlertPanel);

    SUUpdater *updater = [SUUpdater updaterForBundle:webKitLauncherBundle()];
    [updater setUserAgentString:userAgentStringForSparkle()];

    // Find the first separator on the Safari menu…
    NSMenu *applicationSubmenu = [[[NSApp mainMenu] itemAtIndex:0] submenu];
    int i = 0;
    for (; i < [applicationSubmenu numberOfItems]; i++) {
        if ([[applicationSubmenu itemAtIndex:i] isSeparatorItem])
            break;
    }

    // … and insert a menu item that can be used to manually trigger update checks.
    NSMenuItem *updateMenuItem = [[NSMenuItem alloc] initWithTitle:@"Check for WebKit Updates…" action:@selector(checkForUpdates:) keyEquivalent:@""];
    [updateMenuItem setTarget:updater];
    [applicationSubmenu insertItem:updateMenuItem atIndex:i];
    [updateMenuItem release];
}

#endif // ENABLE_SPARKLE


text:
package play.mvc;

/**
 * Binder for path parameters.
 *
 * Any type T that implements this class can be bound to/from a path parameter.  The only requirement is
 * that the class provides a noarg constructor.
 *
 * For example, the following type could be used to bind an Ebean user:
 *
 *

 * @Entity
 * class User extends Model implements PathBindable<User> {
 *     public String email;
 *     public String name;
 *
 *     public User bind(String key, String email) {
 *         User user = findByEmail(email);
 *         if (user != null) {
 *             user;
 *         } else {
 *             throw new IllegalArgumentException("User with email " + email + " not found");
 *         }
 *     }
 *
 *     public String unbind(String key) {
 *         return email;
 *     }
 *
 *     public String javascriptUnbind() {
 *         return "function(k,v) {\n" +
 *             "    return v.email;" +
 *             "}";
 *     }
 *
 *     // Other ebean methods here
 * }
 *

 *
 * Then, to match the URL /user/bob@example.com, you could define the following route:
 *
 *

 * GET  /user/:user     controllers.Users.show(user: User)
 *

 */
public interface PathBindable<T extends PathBindable<T>> {

    /**
     * Bind an URL path parameter.
     *
     * @param key Parameter key
     * @param txt The value as String (extracted from the URL path)
     * @return The object, may be this object
     * @throws RuntimeException if this object could not be bound
     */
    public T bind(String key, String txt);

    /**
     * Unbind a URL path parameter.
     *
     * @param key Parameter key
     * @return a suitable string representation of T for use in constructing a new URL path
     */
    public String unbind(String key);

    /**
     * Javascript function to unbind in the Javascript router.
     *
     * @return The javascript function, or null if you want to use the default implementation.
     */
    public String javascriptUnbind();

}


text:
package net.zomis.combinatorics;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map.Entry;

import net.zomis.minesweeper.analyze.FieldGroup;
import net.zomis.minesweeper.analyze.FieldRule;
import net.zomis.minesweeper.analyze.GroupValues;

public class IntegerPoints {

	public static FieldRule<Integer> positionValue(int x, int y, int i, int size) {
		return new FieldRule<Integer>(pos(x, y, size), Arrays.asList(pos(x, y, size)), i);
	}

	public static List<Integer> createLine(int x, int y, int size, int offsetX, int offsetY) {
		List<Integer> fields = new ArrayList<Integer>();
		while (x < size && y < size && x >= 0 && y >= 0) {
			fields.add(pos(x, y, size));
			y += offsetY;
			x += offsetX;
		}
		return fields;
	}

	public static String map(GroupValues<Integer> values, int size) {
		char[][] fields = new char[size][size];
		for (Entry<FieldGroup<Integer>, Integer> group : values.entrySet()) {
			Integer pos = group.getKey().get(0);
			Integer value = group.getValue();
			char ch = ' ';
			if (value == 1) {
				ch = '1';
			}
			else if (value == 0) {
				ch = '0';
			}
			fields[pos % size][pos / size] = ch;
		}

		StringBuilder str = new StringBuilder();
		for (int y = 0; y < size; y++) {
			for (int x = 0; x < size; x++) {
				if (fields[x][y] == 0) {
					str.append(' ');
				}
				else str.append(fields[x][y]);
			}
			str.append("\n");
		}
		return str.toString();
	}

	public static Integer pos(int x, int y, int size) {
		return y * size + x;
	}

}


text:
<?php

namespace FenzHTTP;

use FenzHelpers\TGetter;

////////////////////////////////////////////////////////////////

class Response
{
	use TGetter;

	/**
	 * Var handle
	 *
	 * @access protected
	 *
	 * @var    resource
	 */
	protected $handle;

	/**
	 * Var version
	 *
	 * @access protected
	 *
	 * @var    string
	 */
	protected $version= '1.1';

	/**
	 * Var statusCode
	 *
	 * @access protected
	 *
	 * @var    int
	 */
	protected $statusCode= 100;

	/**
	 * Var statusMessage
	 *
	 * @access protected
	 *
	 * @var    string
	 */
	protected $statusMessage= '';

	/**
	 * Var request
	 *
	 * @access protected
	 *
	 * @var    Request
	 */
	protected $request;

	/**
	 * Var headers
	 *
	 * @access protected
	 *
	 * @var    array
	 */
	protected $headers= [];

	/**
	 * Var body
	 *
	 * @access protected
	 *
	 * @var    string
	 */
	protected $body= '';

	/**
	 * Var raw
	 *
	 * @access private
	 *
	 * @var    string
	 */
	private $raw;

	/**
	 * Method __construct
	 *
	 * @access public
	 *
	 * @param  Request $request
	 * @param  resource $handle
	 */
	public function __construct( Request$request, $handle )
	{
		$this->request= $request;
		$this->handle= $handle;

		$this->parsMessageLine($this->getLine());

		while( $headerLine= $this->getLine() ){
			$this->parseHeader($headerLine);
		}

		$this->readBody();
	}

	/**
	 * Method getRequest
	 *
	 * @access public
	 *
	 * @return Request
	 */
	public function getRequest():Request
	{
		return $this->request;
	}

	/**
	 * Method getStatus
	 *
	 * @access public
	 *
	 * @return int
	 */
	public function getStatus():int
	{
		return $this->statusCode;
	}

	/**
	 * Method getStatusCode
	 *
	 * @access public
	 *
	 * @return int
	 */
	public function getStatusCode():int
	{
		return $this->getStatus();
	}

	/**
	 * Method getStatusMessage
	 *
	 * @access public
	 *
	 * @return string
	 */
	public function getStatusMessage():string
	{
		return $this->getStatusMessage;
	}

	/**
	 * Method header
	 *
	 * @access public
	 *
	 * @param  string $key
	 *
	 * @return mixed
	 */
	public function header( string$key=null )
	{
		return ( isset($key) ?
			$this->headers[ucwords( strtolower($key), '-' )]
			:
			$this->getHeaders()
		);
	}

	/**
	 * Method getHeaders
	 *
	 * @access public
	 *
	 * @return array
	 */
	public function getHeaders():array
	{
		return $this->headers;
	}

	/**
	 * Method getBody
	 *
	 * @access public
	 *
	 * @return string
	 */
	public function getBody():string
	{
		return $this->body;
	}

	/**
	 * Method getJson
	 *
	 * @access public
	 *
	 * @return mixed
	 */
	public function getJson()
	{
		try{
			return json_decode( $this->body, true );
		}
		catch( \Throwable$e )
		{
			return null;
		}
	}

	/**
	 * Method __toString
	 *
	 * @access public
	 *
	 * @return string
	 */
	public function __toString():string
	{
		return $this->raw;
	}

	/**
	 * Method getLine
	 *
	 * @access private
	 *
	 * @return string
	 */
	private function getLine():string
	{
		$line= fgets( $this->handle );

		$this->raw.= $line;

		return trim( $line );
	}

	/**
	 * Method parsMessageLine
	 *
	 * @access private
	 *
	 * @param  string $messageLine
	 *
	 * @return void
	 */
	private function parsMessageLine( string$messageLine )
	{
		preg_replace_callback( '/^HTTP\\/(\\S+) (\\S+) (.+)$/', function( array$matches ){
			list( $null, $this->version, $this->statusCode, $this->statusMessage )= $matches;
		}, $messageLine );
	}

	/**
	 * Method parseHeader
	 *
	 * @access private
	 *
	 * @param  string $headerLine
	 *
	 * @return void
	 */
	private function parseHeader( string$headerLine )
	{
		list( $key, $value, )= explode(': ', $headerLine);

		$this->headers[ucwords( strtolower($key), '-' )]= $value;
	}

	/**
	 * Method readBody
	 *
	 * @access private
	 *
	 * @return void
	 */
	private function readBody()
	{
		$body= '';

		while( !feof($this->handle) )
		{
			$body.= fgets($this->handle);
		}

		if( isset( $this->headers['Transfer-Encoding'] ) && $this->headers['Transfer-Encoding']==='chunked' )
		{
			$this->body= $this->unchunk( $body );
		}else{
			$this->body= $body;
		}
	}

	/**
	 * Method unchunk
	 *
	 * @access private
	 *
	 * @param  string $chunked
	 *
	 * @return string
	 */
	private function unchunk( string$chunked ):string
	{
		return preg_replace_callback(
			'/(?:(?:\r\n|\n)|^)([0-9A-F]+)(?:\r\n|\n){1,2}(.*?)((?:\r\n|\n)(?:[0-9A-F]+(?:\r\n|\n))|$)/si'
		,
			function( array$matches ){
				return hexdec( $matches[1] )==strlen( $matches[2] )? $matches[2] : $matches[0];
			}
		,
			$chunked
		);
	}

}


text:
Todo List and Notes
===================

Tools
-----
Preproccessors(SASS)

Grunt

Tabula
------
Latest release of Tabula click 'archive' on http://jazzido.github.io/tabula/ ) tries to automatically detect tables, lets you select multiple pages at once.

Also this: https://github.com/jazzido/tabula-extractor which is the sort of back end detection library which you can use in other jruby projects, basically tabula without the web UI.

CrossFilter
-----------

http://square.github.io/crossfilter/

SVG Group
---------

Add groups to svg tutorial? used in d3 later on.

The group element in SVG? http://www.w3.org/TR/SVG/struct.html

Add compatibility tables to all Day 1 modules

More resources for canvas
-------------------------

http://www.informationisbeautifulawards.com/2013-winners/


text:
local scbase = G.require("sc_base")

BaseClass = "U_Scene"
InitialState = "st_idle"
function Ctor(self, ...)
	self.bCube = false
	self._base.Ctor(self, InitialState, ...)
end

st_idle = {
	OnEnter = function(self, slc, ...)
	end
}


text:
.. Sphinx ResiBots theme demo documentation master file, created by
   sphinx-quickstart on Sun Nov  3 11:56:36 2013.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

=================================================
Demo Docs
=================================================

:Page Status: Incomplete
:Last Reviewed: 2013-10-29

Contents:

.. toctree::
    :maxdepth: 2
    :caption: Sweet Docs

    demo
    list

.. toctree::
    :titlesonly:

    toc

.. toctree::
    :maxdepth: 2
    :caption: This is an incredibly long caption for a long menu

    long
    api

Maaaaath!
=========

This is a test.  Here is an equation:
:math:`X_{0:5} = (X_0, X_1, X_2, X_3, X_4)`.
Here is another:

.. math::

    \nabla^2 f =
    \frac{1}{r^2} \frac{\partial}{\partial r}
    \left( r^2 \frac{\partial f}{\partial r} \right) +
    \frac{1}{r^2 \sin \theta} \frac{\partial f}{\partial \theta}
    \left( \sin \theta \, \frac{\partial f}{\partial \theta} \right) +
    \frac{1}{r^2 \sin^2\theta} \frac{\partial^2 f}{\partial \phi^2}

Giant tables
============

+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+
| Header 1   | Header 2   | Header 3  | Header 1   | Header 2   | Header 3  | Header 1   | Header 2   | Header 3  | Header 1   | Header 2   | Header 3  |
+============+============+===========+============+============+===========+============+============+===========+============+============+===========+
| body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+
| body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+
| body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+
| body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  | body row 1 | column 2   | column 3  |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+

Optional parameter args
-----------------------

At this point optional parameters `cannot be generated from code`_.
However, some projects will manually do it, like so:

This example comes from `django-payments module docs`_.

.. class:: payments.dotpay.DotpayProvider(seller_id, pin[, channel=0[, lock=False], lang='pl'])

   This backend implements payments using a popular Polish gateway, `Dotpay.pl <http://www.dotpay.pl>`_.

   Due to API limitations there is no support for transferring purchased items.

   :param seller_id: Seller ID assigned by Dotpay
   :param pin: PIN assigned by Dotpay
   :param channel: Default payment channel (consult reference guide)
   :param lang: UI language
   :param lock: Whether to disable channels other than the default selected above

.. _cannot be generated from code: https://groups.google.com/forum/#!topic/sphinx-users/_qfsVT5Vxpw
.. _django-payments module docs: http://django-payments.readthedocs.org/en/latest/modules.html#payments.authorizenet.AuthorizeNetProvider

Code test
=========

.. parsed-literal::

    # parsed-literal test
    curl -O http://someurl/release-|version|.tar-gz

.. code-block:: json

    {
    "windows": [
        {
        "panes": [
            {
            "shell_command": [
                "echo 'did you know'",
                "echo 'you can inline'"
            ]
            },
            {
            "shell_command": "echo 'single commands'"
            },
            "echo 'for panes'"
        ],
        "window_name": "long form"
        }
    ],
    "session_name": "shorthands"
    }

Sidebar
=======

.. sidebar:: Ch'ien / The Creative

    .. image:: static/yi_jing_01_chien.jpg

    *Above* CH'IEN THE CREATIVE, HEAVEN

    *Below* CH'IEN THE CREATIVE, HEAVEN

The first hexagram is made up of six unbroken lines. These unbroken lines stand for the primal power, which is light-giving, active, strong, and of the spirit. The hexagram is consistently strong in character, and since it is without weakness, its essence is power or energy. Its image is heaven. Its energy is represented as unrestricted by any fixed conditions in space and is therefore conceived of as motion. Time is regarded as the basis of this motion. Thus the hexagram includes also the power of time and the power of persisting in time, that is, duration.

The power represented by the hexagram is to be interpreted in a dual sense in terms of its action on the universe and of its action on the world of men. In relation to the universe, the hexagram expresses the strong, creative action of the Deity. In relation to the human world, it denotes the creative action of the holy man or sage, of the ruler or leader of men, who through his power awakens and develops their higher nature.

Code with Sidebar
=================

.. sidebar:: A code example

    With a sidebar on the right.

.. literalinclude:: test_py_module/test.py
    :language: python
    :linenos:
    :lines: 1-40

Boxes
=====

.. tip::
    Equations within a note
    :math:`G_{\mu\nu} = 8 \pi G (T_{\mu\nu}  + \rho_\Lambda g_{\mu\nu})`.

.. note::
    Equations within a note
    :math:`G_{\mu\nu} = 8 \pi G (T_{\mu\nu}  + \rho_\Lambda g_{\mu\nu})`.

.. danger::
    Equations within a note
    :math:`G_{\mu\nu} = 8 \pi G (T_{\mu\nu}  + \rho_\Lambda g_{\mu\nu})`.

.. warning::
    Equations within a note
    :math:`G_{\mu\nu} = 8 \pi G (T_{\mu\nu}  + \rho_\Lambda g_{\mu\nu})`.

Inline code and references
==========================

`reStructuredText`_ is a markup language. It can use roles and
declarations to turn reST into HTML.

In reST, ``*hello world*`` becomes ``hello world``. This is
because a library called `Docutils`_ was able to parse the reST and use a
``Writer`` to output it that way.

If I type ````an inline literal```` it will wrap it in ``<tt>``. You can
see more details on the `Inline Markup`_ on the Docutils homepage.

Also with ``sphinx.ext.autodoc``, which I use in the demo, I can link to
:class:`test_py_module.test.Foo`. It will link you right my code
documentation for it.

.. _reStructuredText: http://docutils.sourceforge.net/rst.html
.. _Docutils: http://docutils.sourceforge.net/
.. _Inline Markup: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup

.. note:: Every other line in this table will have white text on a white background.
            This is bad.

    +---------+
    | Example |
    +=========+
    | Thing1  |
    +---------+
    | Thing2  |
    +---------+
    | Thing3  |
    +---------+

Emphasized lines with line numbers
==================================

.. code-block:: python
   :linenos:
   :emphasize-lines: 3,5

   def some_function():
       interesting = False
       print 'This line is highlighted.'
       print 'This one is not...'
       print '...but this one is.'

Citation
========

Here I am making a citation [1]_, another [2]_ and another [3]_

.. [1] This is the citation I made, let's make this extremely long so that we can tell that it doesn't follow the normal responsive table stuff.

.. [2] This citation has some ``code blocks`` in it, maybe some **bold** and
       *italics* too. Heck, lets put a link to a meta citation [3]_ too.

.. [3] This citation will have two backlinks.

======
Images
======

.. figure:: static/yi_jing_01_chien.jpg

    This is a caption for a figure.

Download links
==============

:download:`This long long long long long long long long long long long long long long long download link should be blue with icon, and should wrap white-spaces <static/yi_jing_01_chien.jpg>`


text:
package com.secucard.connect.product.general;

import com.secucard.connect.client.ProductService;
import com.secucard.connect.event.AbstractEventListener;
import com.secucard.connect.event.Events;
import com.secucard.connect.product.general.model.AccountDevice;
import com.secucard.connect.product.general.model.Event;

/**
 * Implements the general/account devices operations.
 */

public class AccountDevicesService extends ProductService<AccountDevice> {

  public static final ServiceMetaData<AccountDevice> META_DATA = new ServiceMetaData<>("general", "accountdevices", AccountDevice.class);

  @Override
  public ServiceMetaData<AccountDevice> getMetaData() {
    return META_DATA;
  }

  /**
   * Set a callback to get notified when a device has changed.
   */
  public void onAccountDevicesChanged(AccountDevicesListener listener) {
    context.eventDispatcher.registerListener(getMetaData().getObject() + Events.TYPE_CHANGED, listener);
  }

  public static abstract class AccountDevicesListener extends AbstractEventListener<AccountDevice> {

    @Override
    public boolean accept(Event<AccountDevice> event) {
      return Events.TYPE_CHANGED.equals(event.getType()) && META_DATA.getObject().equals(event.getTarget());
    }
  }
}


text:
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: >
    When a `yield` token appears within the DestructuringAssignmentTarget of a
    nested destructuring assignment outside of strict mode, it behaves as an
    IdentifierReference.
es6id: 12.14.5.3
flags: [onlyStrict]
negative: SyntaxError
---*/

[[x[yield]]] = value;


text:
using System;
using System.Transactions;

namespace NTF.Uow
{
    /// <summary>
    /// 设置或者获取工作单元默认值
    /// </summary>
    public interface IUnitOfWorkDefaultOptions
    {
        /// <summary>
        /// 事务作用域选项
        /// </summary>
        TransactionScopeOption Scope { get; set; }
        /// <summary>
        /// 是否工作单元事务
        /// Default:true
        /// </summary>
        bool IsTransactional { get; set; }
        /// <summary>
        /// 超时时间
        /// </summary>
        TimeSpan? Timeout { get; set; }
        IsolationLevel? IsolationLevel { get; set; }
    }

    internal class UnitOfWorkDefaultOptions : IUnitOfWorkDefaultOptions
    {
        public TransactionScopeOption Scope { get; set; }

        public bool IsTransactional { get; set; }

        public TimeSpan? Timeout { get; set; }

        public IsolationLevel? IsolationLevel { get; set; }
        public UnitOfWorkDefaultOptions()
        {
            IsTransactional = true;
            Scope = TransactionScopeOption.Required;
        }
    }
}


text:
package org.wso2.andes.client;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;

import org.wso2.andes.jms.BrokerDetails;
import org.wso2.andes.url.URLHelper;
import org.wso2.andes.url.URLSyntaxException;

public class AMQBrokerDetails implements BrokerDetails
{
    private String _host;
    private int _port;
    private String _transport;

    private Map<String, String> _options = new HashMap<String, String>();

    private SSLConfiguration _sslConfiguration;

    public AMQBrokerDetails(){}

    public AMQBrokerDetails(String url) throws URLSyntaxException
    {

        // URL should be of format tcp://host:port?option='value',option='value'
        try
        {
            URI connection = new URI(url);

            String transport = connection.getScheme();

            // Handles some defaults to minimise changes to existing broker URLS e.g. localhost
            if (transport != null)
            {
                //todo this list of valid transports should be enumerated somewhere
                if (!(transport.equalsIgnoreCase(BrokerDetails.TCP)))
                {
                    if (transport.equalsIgnoreCase("localhost"))
                    {
                        connection = new URI(DEFAULT_TRANSPORT + "://" + url);
                        transport = connection.getScheme();
                    }
                    else
                    {
                        if (url.charAt(transport.length()) == ':' && url.charAt(transport.length() + 1) != '/')
                        {
                            //Then most likely we have a host:port value
                            connection = new URI(DEFAULT_TRANSPORT + "://" + url);
                            transport = connection.getScheme();
                        }
                        else
                        {
                            throw URLHelper.parseError(0, transport.length(), "Unknown transport", url);
                        }
                    }
                }
                else if (url.indexOf("//") == -1)
                {
                    throw URLHelper.parseError(transport.length()+1, 1, "Missing '//' after the transport In broker " +
                            "URL", url);
                }
            }
            else
            {
                //Default the transport
                connection = new URI(DEFAULT_TRANSPORT + "://" + url);
                transport = connection.getScheme();
            }

            if (transport == null)
            {
                throw URLHelper.parseError(-1, "Unknown transport in broker URL:'"
                        + url + "' Format: " + URL_FORMAT_EXAMPLE, "");
            }

            setTransport(transport);

            String host = connection.getHost();

            // Fix for Java 1.5
            if (host == null)
            {
                host = "";

                String auth = connection.getAuthority();
                if (auth != null)
                {
                    // contains both host & port myhost:5672
                    if (auth.contains(":"))
                    {
                        host = auth.substring(0,auth.indexOf(":"));
                    }
                    else
                    {
                        host = auth;
                    }
                }

            }

            setHost(host);

            int port = connection.getPort();

            if (port == -1)
            {
                // Fix for when there is port data but it is not automatically parseable by getPort().
                String auth = connection.getAuthority();

                if (auth != null && auth.contains(":"))
                {
                    int start = auth.indexOf(":") + 1;
                    int end = start;
                    boolean looking = true;
                    boolean found = false;
                    // Throw an URL exception if the port number is not specified
                    if (start == auth.length())
                    {
                        throw URLHelper.parseError(connection.toString().indexOf(auth) + end - 1,
                                connection.toString().indexOf(auth) + end, "Port number must be specified",
                                connection.toString());
                    }
                    //Walk the authority looking for a port value.
                    while (looking)
                    {
                        try
                        {
                            end++;
                            Integer.parseInt(auth.substring(start, end));

                            if (end >= auth.length())
                            {
                                looking = false;
                                found = true;
                            }
                        }
                        catch (NumberFormatException nfe)
                        {
                            looking = false;
                        }

                    }
                    if (found)
                    {
                        setPort(Integer.parseInt(auth.substring(start, end)));
                    }
                    else
                    {
                        throw URLHelper.parseError(connection.toString().indexOf(connection.getAuthority()) + end - 1,
                                             "Illegal character in port number", connection.toString());
                    }

                }
                else
                {
                    setPort(DEFAULT_PORT);
                }
            }
            else
            {
                setPort(port);
            }

            String queryString = connection.getQuery();

            URLHelper.parseOptions(_options, queryString);

            //Fragment is #string (not used)
        }
        catch (URISyntaxException uris)
        {
            if (uris instanceof URLSyntaxException)
            {
                throw(URLSyntaxException) uris;
            }

            throw URLHelper.parseError(uris.getIndex(), uris.getReason(), uris.getInput());
        }
    }

    public AMQBrokerDetails(String host, int port, SSLConfiguration sslConfiguration)
    {
        _host = host;
        _port = port;
        _sslConfiguration = sslConfiguration;
    }

    public String getHost()
    {
        return _host;
    }

    public void setHost(String _host)
    {
        this._host = _host;
    }

    public int getPort()
    {
        return _port;
    }

    public void setPort(int _port)
    {
        this._port = _port;
    }

    public String getTransport()
    {
        return _transport;
    }

    public void setTransport(String _transport)
    {
        this._transport = _transport;
    }

    public String getProperty(String key)
    {
        return _options.get(key);
    }

    public void setProperty(String key, String value)
    {
        _options.put(key, value);
    }

    public long getTimeout()
    {
        if (_options.containsKey(OPTIONS_CONNECT_TIMEOUT))
        {
            try
            {
                return Long.parseLong(_options.get(OPTIONS_CONNECT_TIMEOUT));
            }
            catch (NumberFormatException nfe)
            {
                //Do nothing as we will use the default below.
            }
        }

        return BrokerDetails.DEFAULT_CONNECT_TIMEOUT;
    }

    public boolean getBooleanProperty(String propName)
    {
        if (_options.containsKey(propName))
        {
            return Boolean.parseBoolean(_options.get(propName));
        }

        return false;
    }

    public void setTimeout(long timeout)
    {
        setProperty(OPTIONS_CONNECT_TIMEOUT, Long.toString(timeout));
    }

    public SSLConfiguration getSSLConfiguration()
    {
        return _sslConfiguration;
    }

    public void setSSLConfiguration(SSLConfiguration sslConfig)
    {
        _sslConfiguration = sslConfig;
    }

    public String toString()
    {
        StringBuffer sb = new StringBuffer();

        sb.append(_transport);
        sb.append("://");
        sb.append(_host);
        sb.append(':');
        sb.append(_port);

        sb.append(printOptionsURL());

        return sb.toString();
    }

    public boolean equals(Object o)
    {
        if (!(o instanceof BrokerDetails))
        {
            return false;
        }

        BrokerDetails bd = (BrokerDetails) o;

        return _host.equalsIgnoreCase(bd.getHost()) &&
               (_port == bd.getPort()) &&
               _transport.equalsIgnoreCase(bd.getTransport()) &&
               compareSSLConfigurations(bd.getSSLConfiguration());
        //todo do we need to compare all the options as well?
    }

    @Override
    public int hashCode()
    {
        int result = _host != null ? _host.hashCode() : 0;
        result = 31 * result + _port;
        result = 31 * result + (_transport != null ? _transport.hashCode() : 0);
        return result;
    }

    private String printOptionsURL()
    {
        StringBuffer optionsURL = new StringBuffer();

        optionsURL.append('?');

        if (!(_options.isEmpty()))
        {

            for (String key : _options.keySet())
            {
                optionsURL.append(key);

                optionsURL.append("='");

                optionsURL.append(_options.get(key));

                optionsURL.append("'");

                optionsURL.append(URLHelper.DEFAULT_OPTION_SEPERATOR);
            }
        }

        //removeKey the extra DEFAULT_OPTION_SEPERATOR or the '?' if there are no options
        optionsURL.deleteCharAt(optionsURL.length() - 1);

        return optionsURL.toString();
    }

    // Do we need to do a more in-depth comparison?
    private boolean compareSSLConfigurations(SSLConfiguration other)
    {
        boolean retval = false;
        if (_sslConfiguration == null &&
                other == null)
        {
            retval = true;
        }
        else if (_sslConfiguration != null &&
                other != null)
        {
            retval = true;
        }

        return retval;
    }

    public static String checkTransport(String broker)
    {
        if ((!broker.contains("://")))
        {
            return "tcp://" + broker;
        }
        else
        {
            return broker;
        }
    }

    public Map<String, String> getProperties()
    {
        return _options;
    }

    public void setProperties(Map<String, String> props)
    {
        _options = props;
    }
}


text:
package org.apache.storm.metric.util;

import com.google.common.collect.Lists;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.apache.storm.metric.api.IMetricsConsumer;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class DataPointExpanderTest {

    @Test
    public void testExpandDataPointWithExpandDisabled() {
        DataPointExpander populator = new DataPointExpander(false, ".");
        Map<String, Object> value = getDummyMetricMapValue();
        IMetricsConsumer.DataPoint point = new IMetricsConsumer.DataPoint("test", value);

        Collection<IMetricsConsumer.DataPoint> expandedDataPoints = populator.expandDataPoint(point);
        assertEquals(1, expandedDataPoints.size());
        assertEquals(point, expandedDataPoints.iterator().next());
    }

    @Test
    public void testExpandDataPointsWithExpandDisabled() {
        DataPointExpander populator = new DataPointExpander(false, ".");
        Map<String, Object> value = getDummyMetricMapValue();
        IMetricsConsumer.DataPoint point = new IMetricsConsumer.DataPoint("test", value);

        Collection<IMetricsConsumer.DataPoint> expandedDataPoints =
            populator.expandDataPoints(Collections.singletonList(point));
        assertEquals(1, expandedDataPoints.size());
        assertEquals(point, expandedDataPoints.iterator().next());
    }

    @Test
    public void testExpandDataPointWithVariousKindOfMetrics() {
        DataPointExpander populator = new DataPointExpander(true, ".");

        IMetricsConsumer.DataPoint point = new IMetricsConsumer.DataPoint("point", getDummyMetricMapValue());

        Collection<IMetricsConsumer.DataPoint> expandedDataPoints =
            populator.expandDataPoints(Collections.singletonList(point));
        assertEquals(4, expandedDataPoints.size());
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point.a", 1.0)));
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point.b", 2.5)));
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point.c", null)));
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point.d", "hello")));
    }

    @Test
    public void testExpandDataPointsWithVariousKindOfMetrics() {
        DataPointExpander populator = new DataPointExpander(true, ":");

        IMetricsConsumer.DataPoint point1 = new IMetricsConsumer.DataPoint("point1", 2.5);
        IMetricsConsumer.DataPoint point2 = new IMetricsConsumer.DataPoint("point2", getDummyMetricMapValue());

        Collection<IMetricsConsumer.DataPoint> expandedDataPoints =
            populator.expandDataPoints(Lists.newArrayList(point1, point2));
        // 1 for point1, 4 for point2
        assertEquals(5, expandedDataPoints.size());
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point1", 2.5)));
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point2:a", 1.0)));
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point2:b", 2.5)));
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point2:c", null)));
        assertTrue(expandedDataPoints.contains(new IMetricsConsumer.DataPoint("point2:d", "hello")));
    }

    @Test
    public void testExpandDataPointWithNullValueMetric() {
        DataPointExpander populator = new DataPointExpander(true, ".");

        IMetricsConsumer.DataPoint point = new IMetricsConsumer.DataPoint("point", null);
        Collection<IMetricsConsumer.DataPoint> expandedDataPoints = populator.expandDataPoint(point);

        assertEquals(0, expandedDataPoints.size());
    }

    private Map<String, Object> getDummyMetricMapValue() {
        Map<String, Object> value = new HashMap<>();
        value.put("a", 1.0);
        value.put("b", 2.5);
        value.put("c", null);
        value.put("d", "hello"); // yes it's just a test purpose
        return value;
    }

}


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportHeight="10.0"
        android:viewportWidth="10.0">
    <path
            android:fillColor="#FFFFFFFF"
            android:pathData="m0,7.356 l5,-5 5,5z"/>
</vector>


text:
<!DOCTYPE html>
<style>
.test::after {
    content:"::after content";
}
</style>

<fieldset>
  Fieldset contents
</fieldset>
<script>
  var td = document.querySelector("fieldset");
  td.offsetWidth;
  td.className = "test";
</script>


text:
package cmd

import "log"

var cmdApi = &Command{
	UsageLine: "api [appname]",
	Short:     "auto-generate code for the ego app, Creates a ego API application",
	Long: `

`, Run: createApi,
}

func createApi(cmd *Command, args []string) int {
	gopath := GetGOPATHs()
	log.Println("gopath: ", gopath)

	// githubsrc := gopath[0] + "/src/github.com/go-ego/re/api/"
	githubsrc := hasFile(gopath, "/src/github.com/go-ego/re/api")
	newDir(githubsrc, args)

	return 0
}


text:
layout: post
title:  "Apple Rain"
date:   2017-08-30
thumbnail:
---

Apple Rain is my pet project to commemorate the few surviving comfort women in WW2.

Since this is my first attempt at making a VR experience, I will try to keep it simple.
Apple Rain will comprise of simple controller interactions with apples that "rain" from a mesh emitter.
Upon the user picking up the apples, the apples will explode into butterflies which then will congregate to make up a part of the "peace statue".

To make it rain apples, I first modelled the apple in blender.

		Stemless Apple

I then imported it to ue4 as a .fbx and the stem and apple were separated.

I then went back to blender and ctrl+j to join the stem and apple into one mesh. The result was better.

I managed to make a mesh emitter that rains apples that collide as they hit the floor. No problem there.

		It's raining apples!

I then wanted the apples to have random colors as they spawn but I cannot change the color of the apples without also tempering with the brown stem, which
I do not want to do. I think the solution is to UV unwrap the apple in blender then import the UV map to ue4 then make the material in ue4 instead of trying to import from blender. Will try that later.


text:
package be.ac.ulg.montefiore.run.jahmm;

import java.util.*;

/**
 * This class represents the centroid of a set of {@link ObservationInteger
 * ObservationInteger}.
 */
public class CentroidObservationInteger
implements Centroid<ObservationInteger>
{
	private double value;

	public CentroidObservationInteger(ObservationInteger o)
	{
		this.value = o.value;
	}

	public void reevaluateAdd(ObservationInteger e,
			List<? extends ObservationInteger> v)
	{
		value = ((value * (double) v.size()) +
				((double) (e.value))) / (v.size()+1.);
	}

	public void reevaluateRemove(ObservationInteger e,
			List<? extends ObservationInteger> v)
	{
		value = ((value * (double) v.size()) -
				((double) e.value)) / (v.size()-1.);
	}

	/**
	 * Returns the distance from this centroid to a given element.
	 * This distance is the absolute value of the difference between the
	 * value of this centroid and the value of the argument.
	 *
	 * @param e The element, which must be an {@link ObservationInteger
	 *          ObservationInteger}.
	 * @return The distance to the centroid.
	 */
	public double distance(ObservationInteger e)
	{
		return Math.abs(e.value-value);
	}
}


text:
/* global describe, expect, test */

const Tuple = require('../../src/tuple');

describe('Data.Tuple', () => {
  test('Tuple#toString()', () => {
    const tuple = Tuple(1, 2);

    expect(tuple.toString()).toBe('(1, 2)');
  });
});


text:
package net.hydromatic.optiq.model;

import java.util.List;

/**
 * View schema element.
 *
 * @see JsonRoot Description of schema elements
 */
public class JsonView extends JsonTable {
  /** SQL query that is the definition of the view. */
  public String sql;

  /** Schema name(s) to use when resolving query. If not specified, defaults
   * to current schema. */
  public List<String> path;

  public void accept(ModelHandler handler) {
    handler.visit(this);
  }

  @Override
  public String toString() {
    return "JsonView(name=" + name + ")";
  }
}

// End JsonView.java