text:
package net.cfoster.sparrow;

import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;

public class ChangeRequest
{
  public static final int REGISTER  = 1;
  public static final int CHANGEOPS = 2;
  public static final int CANCEL    = 3;

  public SocketChannel socket;
  public int type;
  public int ops;

  public ChangeRequest(SocketChannel socket, int type, int ops)
  {
    if(socket == null)
      throw new IllegalArgumentException("SocketChannel can not be null.");
    this.socket = socket;
    this.type = type;
    this.ops = ops;
  }

  public String toString() {
    String typeStr = null;

    if(type == REGISTER)
      typeStr = "REGISTER";
    else if(type == CHANGEOPS)
      typeStr = "CHANGEOPS";
    else if(type == CANCEL)
      typeStr = "CANCEL";

    String opsStr = null;

    if(ops == SelectionKey.OP_ACCEPT)
      opsStr = "OP_ACCEPT";
    else if(ops == SelectionKey.OP_CONNECT)
      opsStr = "OP_CONNECT";
    else if(ops == SelectionKey.OP_READ)
      opsStr = "OP_READ";
    else if(ops == SelectionKey.OP_WRITE)
      opsStr = "OP_WRITE";
    else
      opsStr = "OP_COMBINED";

    return "[ChangeRequest: type=" +typeStr
      +
      ", ops="+opsStr+", socket="+socket+"]";
  }
}


text:
<bill session="115" type="h" number="2732" updated="2017-09-06T07:13:48Z">
  <state datetime="2017-05-25">REFERRED</state>
  <status>
    <introduced datetime="2017-05-25"/>
  </status>
  <introduced datetime="2017-05-25"/>
  <titles>
    <title type="short" as="introduced">North Korea Travel Control Act</title>
    <title type="short" as="introduced">North Korea Travel Control Act</title>
    <title type="official" as="introduced">To prohibit travel-related transactions to, from, and within North Korea by persons subject to the jurisdiction of the United States, and for other purposes.</title>
    <title type="display">North Korea Travel Control Act</title>
  </titles>
  <sponsor bioguide_id="S001150"/>
  <cosponsors>
    <cosponsor bioguide_id="C001068" joined="2017-06-27"/>
    <cosponsor bioguide_id="C001078" joined="2017-07-26"/>
    <cosponsor bioguide_id="D000628" joined="2017-06-29"/>
    <cosponsor bioguide_id="F000466" joined="2017-06-27"/>
    <cosponsor bioguide_id="F000461" joined="2017-06-29"/>
    <cosponsor bioguide_id="H001047" joined="2017-06-27"/>
    <cosponsor bioguide_id="S001189" joined="2017-06-29"/>
    <cosponsor bioguide_id="S001170" joined="2017-07-11"/>
    <cosponsor bioguide_id="S000344" joined="2017-07-27"/>
    <cosponsor bioguide_id="S000480" joined="2017-06-27"/>
    <cosponsor bioguide_id="V000131" joined="2017-06-27"/>
    <cosponsor bioguide_id="W000795" joined="2017-05-25"/>
    <cosponsor bioguide_id="Z000017" joined="2017-07-26"/>
  </cosponsors>
  <actions>
    <action datetime="2017-05-25">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-05-25" state="REFERRED">
      <text>Referred to the House Committee on Foreign Affairs.</text>
    </action>
    <action datetime="2017-07-20">
      <text>Referred to the Subcommittee on Asia and the Pacific.</text>
    </action>
    <action datetime="2017-07-27">
      <text>Subcommittee Consideration and Mark-up Session Held.</text>
    </action>
    <action datetime="2017-07-27">
      <text>Forwarded by Subcommittee to Full Committee in the Nature of a Substitute (Amended) by Voice Vote .</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSFA" name="House Foreign Affairs" activity="Referral"/>
    <committee subcommittee="Asia and the Pacific" code="HSFA05" name="House Foreign Affairs" activity="Reporting, Markup, Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="International affairs"/>
    <term name="Administrative law and regulatory procedures"/>
    <term name="Asia"/>
    <term name="Department of the Treasury"/>
    <term name="Licensing and registrations"/>
    <term name="North Korea"/>
    <term name="Travel and tourism"/>
  </subjects>
  <amendments/>
  <committee-reports/>
</bill>

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mem. Torrey bot. Club 17: 161 (1918)

#### Original name
Aecidium pisoniae Arthur & J.R. Johnst.

### Remarks
null


text:
module ApplicationHelper

  def asset_url asset
    "#{request.protocol}#{request.host_with_port}#{asset_path(asset)}"
  end

end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package view;

import java.awt.Color;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import model.Simulacion;

import simulacionconjunto.SimulacionConjunto;
import static simulacionconjunto.SimulacionConjunto.getInstance;

/**
 *
 * @author andresgutierrez
 */
public class PanelBotones extends JPanel {
    private JButton salir;
    protected static JButton simular;
    public static int simulaciones;
    private static JButton estadisticas;
    private ImageIcon flecha;
    private ImageIcon imagenEscalada;
    public PanelBotones(){
        this.setLayout(new GridLayout(0, 3));
        this.setBackground(Color.white);
        salir=new JButton("Salir");
        estadisticas = new JButton("Estadisticas");
        flecha = new ImageIcon("/Users/andresgutierrez/NetBeansProjects/Simulacion/src/simulacion/flecha.png");

        imagenEscalada = new ImageIcon(flecha.getImage().getScaledInstance(50, 50, Image.SCALE_SMOOTH));
        simular=new JButton(imagenEscalada);
        simular.setEnabled(false);
        simular.setToolTipText("Apretar para inicir cada simulacion");
        this.add(salir);
        this.add(simular);
        this.add(estadisticas);
        estadisticas.setEnabled(false);
        salir.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });
        estadisticas.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                //TODO
                view.Estadisticas.label.setText("Dinero Perdido: "+Simulacion.perdidas);
                view.Estadisticas.label1.setText("Nº autos(No aten por dia): "+Simulacion.numeroAutos/simulaciones);
                view.Estadisticas.label2.setText("Dinero Perdido por auto: "+(Simulacion.perdidas/Simulacion.numeroAutos));
                view.Estadisticas.label3.setText("Dinero Perdido P: "+Simulacion.perdidasProbabilidad);
                view.Estadisticas.label4.setText("Nº autos(No aten por dia) P: "+Simulacion.numeroAuotosProbabilidad/simulaciones);
                view.Estadisticas.label5.setText("Dinero Perdido por auto P: "+Simulacion.perdidasProbabilidad/Simulacion.numeroAuotosProbabilidad);
                view.Estadisticas.label6.setText("Tamaño maximo promedio de la cola "+(double)Simulacion.tamñoCola/simulaciones);
                SimulacionConjunto ventana=getInstance();
                ventana.pack();
            }
        });
        simular.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                //PanelBotones.simular.setEnabled(false);
                NumeroSimulaciones.entrada.setEnabled(false);
                NumeroSimulaciones.texto.setEditable(false);
                model.Simulacion simulacion = new Simulacion();

                try {
                    if(model.Simulacion.numeroDeSimulaciones>0){
                        simulacion.simulaciones();
                    }

                } catch (InterruptedException ex) {
                    Logger.getLogger(PanelBotones.class.getName()).log(Level.SEVERE, null, ex);
                }
                if(model.Simulacion.numeroDeSimulaciones==0){
                    PanelBotones.simular.setEnabled(false);
                    PanelBotones.estadisticas.setEnabled(true);
                }

            }
        });

    }

}


text:
package com.asakusafw.vanilla.client.util;

import static org.junit.Assert.*;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.asakusafw.vanilla.core.io.ByteChannelDecorator;
import com.asakusafw.vanilla.core.util.Buffers;

/**
 * Test for {@link SnappyByteChannelDecorator}.
 */
public class SnappyByteChannelDecoratorTest {

    /**
     * temporary folder.
     */
    @Rule
    public final TemporaryFolder temporary = new TemporaryFolder();

    private final ByteChannelDecorator decorator = new SnappyByteChannelDecorator();

    private static final int FILE_SIZE = 1024 * 1024;

    private static final int DIVISOR = 256;

    private static final int SMALL_PRIME = 256 + 1;

    private static final int LARGE_PRIME = (256 * 1024) - 1;

    /**
     * simple case.
     * @throws Exception if failed
     */
    @Test
    public void simple() throws Exception {
        test(1, 1);
    }

    /**
     * empty output.
     * @throws Exception if failed
     */
    @Test
    public void empty() throws Exception {
        test(0, DIVISOR);
    }

    /**
     * buffer size is divisor of file size.
     * @throws Exception if failed
     */
    @Test
    public void divisor() throws Exception {
        test(FILE_SIZE, DIVISOR);
    }

    /**
     * small buffer.
     * @throws Exception if failed
     */
    @Test
    public void small_buffer() throws Exception {
        test(FILE_SIZE, SMALL_PRIME);
    }

    /**
     * large buffer.
     * @throws Exception if failed
     */
    @Test
    public void large_buffer() throws Exception {
        test(FILE_SIZE, LARGE_PRIME);
    }

    private void test(int fileSize, int bufferSize) throws IOException, InterruptedException {
        ByteBuffer buffer = Buffers.allocate(bufferSize);
        Path file = temporary.newFile().toPath();
        try (WritableByteChannel c = decorator.decorate(
                (WritableByteChannel) Files.newByteChannel(file, StandardOpenOption.WRITE))) {
            write(c, buffer, fileSize);
        }
        try (ReadableByteChannel c = decorator.decorate(
                (ReadableByteChannel) Files.newByteChannel(file, StandardOpenOption.READ))) {
            verify(c, buffer, fileSize);
        }
    }

    private void write(WritableByteChannel channel, ByteBuffer buffer, int size) throws IOException {
        int position = 0;
        while (position < size) {
            buffer.clear();
            while (position < size && buffer.hasRemaining()) {
                buffer.put((byte) position++);
            }
            buffer.flip();
            while (buffer.hasRemaining()) {
                int remain = buffer.remaining();
                int written = channel.write(buffer);
                assertEquals(buffer.remaining(), remain - written);
            }
        }
    }

    private void verify(ReadableByteChannel channel, ByteBuffer buffer, int size) throws IOException {
        int position = 0;
        while (true) {
            buffer.clear();
            int read = channel.read(buffer);
            if (read < 0) {
                break;
            }
            buffer.flip();
            while (buffer.hasRemaining()) {
                byte b = buffer.get();
                assertEquals(b, (byte) position++);
            }
        }
        assertEquals(position, size);
    }

}


text:
layout: project
index: 5
title: DisPerSion Lab
meta: Website for research music lab at York University. Completed in May 2016.
category: project
type: Web Design
dates: October 2015 - May 2016
tools: HTML5, CSS3, JavaScript, Weebly
authors: Stefano Onorati
purpose: Work
links_available: 2
top-icon: fa-flask
---

Founded in 2015 by Doug van Nort, the DisPerSion Lab is a research lab for the Digital Media program at York University. It is dedicated to research-creation projects which examine questions surrounding instrumental and gestural expression, embodied perception, time consciousness and performative agency in the context of envisioning new forms of interdisciplinary creative practice.

The backbone of the site was previously built using Weebly, so my main focus for this project was to customize the front-end design of the site. I had discussed with Doug van Nort as to what colour scheme to use and what design changes to make. I also implemented my own code for improving the People page, which included the style of each bio/image combination and the behaviour of opening and closing bios on this page through JavaScript. As well, the page was customized to become responsive, changing how many images to display per line.


text:
var windowReady = false;
var voiceReady = false;

var defaultparams = {
    rate: 1,
    pitch: 1,
    volume: 1,
    text: 'The voice consists of sound made by a human being using the vocal folds for talking, reading, singing, laughing, crying, screaming etc. The human voice is specifically a part of human sound production in which the vocal folds (vocal cords) are the primary sound source.',
    voice: 'UK English Female'
};

$(window).load( function() {

    $('#rate').val(getUrlParameter('rate') || defaultparams.rate);
    $('#pitch').val(getUrlParameter('pitch') || defaultparams.pitch);
    $('#volume').val(getUrlParameter('volume') || defaultparams.volume);
    $('#text').val(getUrlParameter('text') || defaultparams.text);

    $('#rate_slider').on("change",function(){$('#rate').val($('#rate_slider').val());})
    $('#pitch_slider').on("change",function(){$('#pitch').val($('#pitch_slider').val());})
    $('#volume_slider').on("change",function(){$('#volume').val($('#volume_slider').val());})

    windowReady = true;

    $('#voicetestdiv').hide();
    $('#waitingdiv').show();

    playbutton.onclick = function() {

        var parameters = {
            rate: $('#rate').val(),
            pitch: $('#pitch').val(),
            volume: $('#volume').val()
        };

        responsiveVoice.speak($('#text').val(),$('#voiceselection').val(), parameters);

    };

    // btgeneratelink.onclick = function() {

    //     var urlparams = "";

    //     var params = {
    //         rate: $('#rate').val(),
    //         pitch: $('#pitch').val(),
    //         volume: $('#volume').val(),
    //         text: $('#text').val(),
    //         voice: $('#voiceselection').val()
    //     };

    //     if (params.rate != defaultparams.rate)
    //         urlparams += (urlparams==""?'?':'&') + 'rate=' + params.rate;

    //     if (params.pitch != defaultparams.pitch)
    //         urlparams += (urlparams==""?'?':'&') + 'pitch=' + params.pitch;

    //     if (params.volume != defaultparams.volume)
    //         urlparams += (urlparams==""?'?':'&') + 'volume=' + params.volume;

    //     if (params.voice != defaultparams.voice)
    //         urlparams += (urlparams==""?'?':'&') + 'voice=' + params.voice;

    //     if (params.text != defaultparams.text)
    //         urlparams += (urlparams==""?'?':'&') + 'text=' + params.text;

    //     var url = 'http://' + window.location.hostname + window.location.pathname + urlparams;

    //     $('#txtlink').html(encodeURI(url));
    // }

    stopbutton.onclick = function() {

        responsiveVoice.cancel();

    };

    responsiveVoice.AddEventListener("OnLoad",function(){
        console.log("ResponsiveVoice Loaded Callback") ;
    });

    CheckLoading();

});

responsiveVoice.OnVoiceReady = function() {

    voiceReady = true;
    CheckLoading();
}

function CheckLoading() {

    if (voiceReady && windowReady) {

        //$('#voicetestdiv').fadeIn(0.5);
        //$('#waitingdiv').fadeOut(0.5);

        //Populate voice selection dropdown
        var voicelist = responsiveVoice.getVoices();

        var vselect = $("#voiceselection");
        vselect.html("");
        $.each(voicelist, function() {
                vselect.append($("<option />").val(this.name).text(this.name));
        });

            $('#voiceselection').val(getUrlParameter('voice') || defaultparams.voice);

        //getIframeWindow(document.getElementById('framelogo')).responsiveVoice = responsiveVoice;

    }

}

function getIframeWindow(iframe_object) {
  var doc;

  if (iframe_object.contentWindow) {
    return iframe_object.contentWindow;
  }

  if (iframe_object.window) {
    return iframe_object.window;
  }

  if (!doc && iframe_object.contentDocument) {
    doc = iframe_object.contentDocument;
  }

  if (!doc && iframe_object.document) {
    doc = iframe_object.document;
  }

  if (doc && doc.defaultView) {
   return doc.defaultView;
  }

  if (doc && doc.parentWindow) {
    return doc.parentWindow;
  }

  return undefined;
}

var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = decodeURIComponent(window.location.search.substring(1)),
        sURLVariables = sPageURL.split('&'),
        sParameterName,
        i;

    for (i = 0; i < sURLVariables.length; i++) {
        sParameterName = sURLVariables[i].split('=');

        if (sParameterName[0] === sParam) {
            return sParameterName[1] === undefined ? true : sParameterName[1];
        }
    }
};


text:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule, Http, Request, XHRBackend, RequestOptions} from '@angular/http';
import { RouterModule, Routes, Router } from '@angular/router';

import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

import { AppComponent } from './app.component';
import { HomeComponent } from './components/';
import { LoginComponent } from './components/';
import { LogoutComponent } from './components/';
import { SetupComponent } from './components/';
import { NullComponent } from './components/';
import { TopBarModule } from './components/topbar/top-bar.module';
import { CustomerLoginComponent } from './components/customer-login/login.component';

import { AuthGuard } from './utils/index';
import { HttpInterceptor } from './utils/index';
import { SafePipe, SafePipeModule } from 'app/utils/safe.pipe';

import { modules } from './modules';
import { CategoryBarComponent } from './components/category-bar/category-bar.component';
import { CategoryItemComponent } from './components/category-item/category-item.component';
import { CategoryComponent } from './components/category/category.component';

import {UserService} from './services/user.service';
import { RegisterComponent } from './components/register/register.component'

import {InlineEditorModule} from 'ng2-inline-editor';
import { ProductCardComponent } from './components/product-card/product-card.component';
import { ProductNewComponent } from './components/product-new/product-new.component';
import { AccountComponent } from './components/account/account.component';
import { CustomFormsModule } from 'ng2-validation';
import { AdminComponent } from './components/admin/admin.component';
import { AdminManufacturerComponent } from './components/admin-manufacturer/admin-manufacturer.component';
import { AdminShippingComponent } from './components/admin-shipping/admin-shipping.component';
//import { Manufacturer } from './components/manufacturer/manufacturer.component';
import { TruncatePipe } from './utils/truncate.pipe';
import { ProductComponent } from './components/product/product.component';
import { CartComponent } from './components/cart/cart.component';
import { TotalPipe } from './utils/total.pipe';
import { AdminOrdersComponent } from './components/admin-orders/admin-orders.component';
import { AdminOrderDetailComponent } from './components/admin-order-detail/admin-order-detail.component';

export const appRoutes: Routes = [
	{
		path : 'admin/login',
		component : LoginComponent
	},
	{
		path : 'admin/manufacturers',
		component : AdminManufacturerComponent
	},
	{
		path : 'admin/shipping',
		component : AdminShippingComponent
	},
	{
		path : 'admin/orders',
		component : AdminOrdersComponent
	},
	{
		path : 'admin/orders/:id',
		component : AdminOrderDetailComponent
	},
	{
		path : 'login',
		component : CustomerLoginComponent
	},
	{
		path : 'logout',
		component : LogoutComponent,
		canActivate : [AuthGuard]
	},
	{
		path : 'register',
		component : RegisterComponent
	},
	{
		path : 'account',
		component : AccountComponent
	},
    {
        path : 'category/:id',
        component : CategoryComponent
    },
	{
		path : 'category/:categoryid/product/new',
		component : ProductNewComponent,
		canActivate : [AuthGuard],
		data : {
			role: 0
		}
	},
	{
		path : 'product/:id',
		component : ProductComponent
	},
	{
		path: 'admin',
		component : AdminComponent,
		canActivate : [AuthGuard],
		data : {
			role : 0
		}
	},
	{
		path : 'cart',
		component : CartComponent
	},
	{
		path: '',
		component: HomeComponent,
		canActivate : []
	},
	{
		path: '**',
		component: NullComponent
	}
];

export function setFactory (xhrBackend: XHRBackend,
				requestOptions: RequestOptions,
				router: Router) {
	return new HttpInterceptor(xhrBackend, requestOptions, router);
}

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    LoginComponent,
    CustomerLoginComponent,
    LogoutComponent,
    SetupComponent,
    NullComponent,
    CategoryBarComponent,
    CategoryItemComponent,
    CategoryComponent,
    ProductCardComponent,
    ProductNewComponent,
    RegisterComponent,
    AccountComponent,
    AdminComponent,
    AdminManufacturerComponent,
    AdminShippingComponent,
   // Manufacturer,
    TruncatePipe,
    ProductComponent,
    CartComponent,
    TotalPipe,
    AdminOrdersComponent,
    AdminOrderDetailComponent
  ],
  imports: [
	modules,
	TopBarModule,
	SafePipeModule,
    BrowserModule,
	FormsModule,
	HttpModule,
	InlineEditorModule,
	CustomFormsModule,
	NgbModule.forRoot(),
	RouterModule.forRoot(appRoutes)
  ],
  providers: [
	AuthGuard,
	UserService,
	SafePipe,
		{
			provide : Http,
			useFactory: setFactory,
			deps: [XHRBackend, RequestOptions, Router]
		}

  ],
  bootstrap: [AppComponent]
})
export class AppModule { }


text:
package com.sksamuel.elastic4s.http.search.aggs

import com.sksamuel.elastic4s.http.search.queries.QueryBuilderFn
import com.sksamuel.elastic4s.searches.aggs.{FilterAggregationDefinition, MissingAggregationDefinition}
import org.elasticsearch.common.xcontent.{XContentBuilder, XContentFactory, XContentType}

object FilterAggregationBuilder {
  def apply(agg: FilterAggregationDefinition): XContentBuilder = {
    val builder = XContentFactory.jsonBuilder()
    builder.startObject()
    builder.rawField("filter", QueryBuilderFn(agg.query).bytes, XContentType.JSON)
    SubAggsBuilderFn(agg, builder)
    AggMetaDataFn(agg, builder)
    builder.endObject()
  }
}

object MissingAggregationBuilder {
  def apply(agg: MissingAggregationDefinition): XContentBuilder = {
    val builder = XContentFactory.jsonBuilder()
    builder.startObject()
    builder.startObject("missing")
    builder.field("field", agg.field.get)
    builder.endObject()
    SubAggsBuilderFn(agg, builder)
    AggMetaDataFn(agg, builder)
    builder.endObject()
  }
}


text:
#import "TransportProtocolId.h"

@implementation TransportProtocolId

- (instancetype)initWithId:(int32_t)id version:(int32_t)version {
    self = [super init];
    if (self) {
        _protocolId = id;
        _protocolVersion = version;
    }
    return self;
}

- (id)copyWithZone:(NSZone *)zone {
    return [[[self class] allocWithZone:zone] initWithId:self.protocolId version:self.protocolVersion];
}

- (NSUInteger)hash {
    NSUInteger prime = 31;
    NSUInteger result = 1;
    result = prime * result + self.protocolId;
    result = prime * result + self.protocolVersion;
    return result;
}

- (BOOL)isEqual:(id)object {

    if ([object isKindOfClass:[TransportProtocolId class]]) {
        TransportProtocolId *other = (TransportProtocolId*)object;
        if (other.protocolId == self.protocolId && other.protocolVersion == self.protocolVersion) {
            return YES;
        }
    }

    return NO;
}

- (NSString*)description {
    return [NSString stringWithFormat:@"TransportProtocolId [id:%i, version:%i]", self.protocolId, self.protocolVersion];
}

@end


text:
layout: page
title: Electron Microscopy
---

## Under construction ##

Here will be content about serial block face imaging

*Macrostomum* flatworms are transparant which allows us to study they internal organs - in praticular their genital morphology - in detail without the need for disections or histological preprations. However there always remains the lingering suspicion that some important aspects of morphology might be missed because they are not easily visible in the light microscope. To adress this issue I am using a specialized electron microscopy technique called Serial Block Face Scanning Electron Microscopy (SBFSEM) to produce serial sections of some animals and examine the genital morphology in more detail.
SBFSEM combines a standard SEM with a microtome that is mounted inside the microscope. The machine scans the block with the electron beam and the backscatter is then analyzed yieling images that can rival TEM quality. After scanning the microtome in the machine removes a slice and then repeates the process. This is nicely vizualized in this video from Gatan.

{% include youtubePlayer.html id=page.PWbLA7WMd34 %}

Using this technique we can get images of up to 7nm pixle size.

<picture of an entier worm in section.>

On this image we see a cross section through an entier animal. The thin spaghetti like appendages on the perifery of the animal are [cilia](https://en.wikipedia.org/wiki/Cilium) that cover the entier surface of the worms body. Smaller cilia are used for locomotion and beat in a synchronized wave front and larger cilia are immotile and are used for the detection of sensory stimulus.
Below the cilia we see the epidermis cells with very prominent [nuclei](https://en.wikipedia.org/wiki/Cell_nucleus). These nuclei are not round like in most other cells but multi lobed which sometimes gives them a strange appearance. Centrally we can also see some cilia again but this time they are actually on the inside ofthe animal ligning the gut. Cilia in the gut are longer than the ones on the epidermis and they are less synchronized in their beating. They are used to transport food particles up and down the digestive tract.

<image of femal opening>
this image shows a cross section though the female genital opening. Note that it is also ciliated and the chamber below it (the femal antrum) also bears cilia.

<image of sv>
Here we see the seminal vesicle. THis is where sperm is stored before copulation. The seminal vesicle is surounded by large circular musculature.

<image of reconstructed stylet>
since the serial sections allow us to trace structures along the animal we an also reconstruct them. Here you can see a 3d reconstruction of the male copulatory organ - the stylet. It has quite a complex structure with a complicate slightly corkscrew shaped curve to it. From 2D images it is difficulte to completely grasp the sutelties of this turn but we can see it quite easily in the reconstruction.
The stylet morphology varies drastically across the phylogeny as illustrated nicely when we compare the stylets of several species:


text:
class MediaDelegateChromeOS : public ash::MediaDelegate,
                              MediaCaptureDevicesDispatcher::Observer {
 public:
  MediaDelegateChromeOS();
  ~MediaDelegateChromeOS() override;

  // ash::MediaDelegate:
  void HandleMediaNextTrack() override;
  void HandleMediaPlayPause() override;
  void HandleMediaPrevTrack() override;
  ash::MediaCaptureState GetMediaCaptureState(ash::UserIndex index) override;

  // MediaCaptureDevicesDispatcher::Observer:
  void OnRequestUpdate(int render_process_id,
                       int render_frame_id,
                       content::MediaStreamType stream_type,
                       const content::MediaRequestState state) override;

 private:
  void NotifyMediaCaptureChange();

  base::WeakPtrFactory<MediaDelegateChromeOS> weak_ptr_factory_;

  DISALLOW_COPY_AND_ASSIGN(MediaDelegateChromeOS);
};

#endif  // CHROME_BROWSER_UI_ASH_MEDIA_DELEGATE_CHROMEOS_H_


text:
require 'open-uri'
require 'uri'
require 'nokogiri'

require 'multi_translate/language_pairs.rb'
require 'multi_translate/languages.rb'
require 'multi_translate/engines.rb'

module MultiTranslate
  # Performs a translation between "from" and "to" languages, using "text" as the input, and using "engine"
  # as translation engine.
  # You must check that the input and output languages are supported by the selected translation engine. Otherwise
  # this method will raise an exception.
  def self.translate(engine, from, to, text)
    if from == Languages::AUTODETECT && engine !=  Engines::GOOGLE
      raise "The autodetect feature is only available for the Google engine"
    end

    raise "You can't use autodetect for the destination laguage" if to ==  Languages::AUTODETECT
    raise "There is no engine called #{engine}" unless LANGUAGE_PAIRS[engine]
    unless LANGUAGE_PAIRS[engine].include?([from, to])
      raise "There is no such language pairs (#{from}, #{to}) for the engine #{engine}"
    end

    begin
      case engine
      when Engines::APERTIUM
        url = "http://xixona.dlsi.ua.es/webservice/ws.php?mode=#{from}-#{to}&format=txt&text=#{text}"
        result = open(URI.escape(url), {'User-Agent' => 'apertium2perl'}).read.strip
        return result
      when Engines::GOOGLE
        url =  "http://translate.google.com/?langpair=#{from}|#{to}&text=#{text}"
        doc = Nokogiri::HTML(open(URI.escape(url)))
        result = doc.search('//span[@id="result_box"]').text
        return result
      end
     rescue OpenURI::HTTPError
      return ''
    end
  end
end


text:
namespace net {

MappedHostResolver::MappedHostResolver(scoped_ptr<HostResolver> impl)
    : impl_(impl.Pass()) {
}

MappedHostResolver::~MappedHostResolver() {
}

int MappedHostResolver::Resolve(const RequestInfo& info,
                                AddressList* addresses,
                                const CompletionCallback& callback,
                                RequestHandle* out_req,
                                const BoundNetLog& net_log) {
  return impl_->Resolve(ApplyRules(info), addresses, callback, out_req,
                        net_log);
}

int MappedHostResolver::ResolveFromCache(const RequestInfo& info,
                                         AddressList* addresses,
                                         const BoundNetLog& net_log) {
  return impl_->ResolveFromCache(ApplyRules(info), addresses, net_log);
}

void MappedHostResolver::CancelRequest(RequestHandle req) {
  impl_->CancelRequest(req);
}

void MappedHostResolver::ProbeIPv6Support() {
  impl_->ProbeIPv6Support();
}

HostCache* MappedHostResolver::GetHostCache() {
  return impl_->GetHostCache();
}

HostResolver::RequestInfo MappedHostResolver::ApplyRules(
    const RequestInfo& info) const {
  RequestInfo modified_info = info;
  HostPortPair host_port(info.host_port_pair());
  if (rules_.RewriteHost(&host_port))
    modified_info.set_host_port_pair(host_port);
  return modified_info;
}

}  // namespace net


text:
<!--

   Copyright (c) 2013 Research In Motion Limited.

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

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

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

-->
<project default="all">
	<property name="jde.path" value="c:/Program Files/Research In Motion/BlackBerry JDE 7.1.0" />
	<target name="all" depends="sign,deploy">
	</target>

	<target name="sign">
		<java failonerror="true" fork="true"
			jar="c:/Program Files/Research In Motion/BlackBerry JDE 7.1.0/bin/SignatureTool.jar" args="-p s0ftc0ck -a -c deliverables/Standard/7.0.0/TargetEmulation.cod">
		</java>
	</target>
	<target name="deploy">
		<exec executable="${jde.path}/bin/JavaLoader.exe">
			<arg value="-wpasscc" />
			<arg value="load" />
			<arg value="deliverables/Standard/7.0.0/TargetEmulation.cod" />
		</exec>
	</target>
</project>


text:
module FP.Pretty.Console where

import FP.Prelude
import FP.Pretty.Color
import FP.Pretty.Pretty

sgrLeader ∷ 𝕊
sgrLeader = "\ESC["

sgrCloser ∷ 𝕊
sgrCloser = "m"

sgrReset ∷ 𝕊
sgrReset = sgrLeader ⧺ "0" ⧺ sgrCloser

sgrFg ∷ Color → 𝕊
sgrFg = (⧺) "38;5;" ∘ 𝕤 ∘ show ∘ colorCode

sgrBg ∷ Color → 𝕊
sgrBg = (⧺) "48;5;" ∘ 𝕤 ∘ show ∘ colorCode

sgrUl ∷ 𝕊
sgrUl = "4"

sgrBd ∷ 𝕊
sgrBd = "1"

data FormatState = FormatState
  { formatFG ∷ Maybe Color
  , formatBG ∷ Maybe Color
  , formatUL ∷ Bool
  , formatBD ∷ Bool
  }

sgrFormat ∷ FormatState → 𝕊
sgrFormat (FormatState fg bg ul bd) = concat
  [ sgrLeader
  , concat $ intersperse ";" $ mconcat
      [ elimMaybe [] return $ sgrFg ^$ fg
      , elimMaybe [] return $ sgrBg ^$ bg
      , if ul then [sgrUl] else []
      , if bd then [sgrBd] else []
      ]
  , sgrCloser
  ]

updateFormat ∷ Format → FormatState → FormatState
updateFormat (FormatFG c) fmt = fmt { formatFG = Just c }
updateFormat (FormatBG c) fmt = fmt { formatBG = Just c }
updateFormat FormatUL fmt = fmt { formatUL = True }
updateFormat FormatBD fmt = fmt { formatBD = True }

formatConsole ∷ [Format] → ReaderT FormatState (Writer 𝕊) () → ReaderT FormatState (Writer 𝕊) ()
formatConsole fmt aM = do
  local (compose $ map updateFormat fmt) $ do
    tell *$ sgrFormat ^$ ask
    aM
  tell $ sgrReset
  tell *$ sgrFormat ^$ ask

renderConsoleM ∷ PrettyOut → ReaderT FormatState (Writer 𝕊) ()
renderConsoleM (ChunkOut c) = tell $ renderChunk c
renderConsoleM (FormatOut f o) = formatConsole f $ renderConsoleM o
renderConsoleM NullOut = tell ""
renderConsoleM (AppendOut o₁ o₂) = renderConsoleM o₁ ≫ renderConsoleM o₂

renderConsole ∷ PrettyOut → 𝕊
renderConsole = execWriter ∘ runReaderTWith (FormatState Nothing Nothing False False) ∘ renderConsoleM

pprintWith ∷ (Pretty a) ⇒ (PrettyM () → PrettyM ()) → a → IO ()
pprintWith f = printLn ∘ renderConsole ∘ renderDoc ∘ ppFinal ∘ Doc ∘ f ∘ runDoc ∘ pretty

pprintWidth ∷ (Pretty a) ⇒ ℕ → a → IO ()
pprintWidth = pprintWith ∘ local ∘ update maxColumnWidthL

pprintRibbon ∷ (Pretty a) ⇒ ℕ → a → IO ()
pprintRibbon = pprintWith ∘ local ∘ update maxRibbonWidthL

pprint ∷ (Pretty a) ⇒ a → IO ()
pprint = pprintWith id

ptrace ∷ (Pretty a) ⇒ a → b → b
ptrace a b = unsafePerformIO $ do
  pprint a
  return b

ptraceM ∷ (Monad m,Pretty a) ⇒ a → m ()
ptraceM x = ptrace x $ return ()


text:
<?php

namespace Bitheater\DummyImage\Generator;

use Bitheater\DummyImage\Model\Color;
use Bitheater\DummyImage\Model\Dimension;
use Guzzle\Http\Client;

class RemoteGeneratorIntegrationTest extends \PHPUnit_Framework_TestCase
{
    private $file;

    public function setUp()
    {
        $this->file = __DIR__ . '/generated/remote.png';
    }

    public function testImageGetsGenerated()
    {
        $generator = new RemoteGenerator(new Client());
        $result = $generator->generate($this->file);

        $this->assertInstanceOf('Bitheater\DummyImage\Result', $result);
        $this->assertEquals('http://dummyimage.com/500x500/000000/ffffff.png&text=500+%C3%97+500', $result->getUrl());
        $this->assertFileExists($this->file);
    }

    public function testImageWithOptionsGetsGenerated()
    {
        $generator = new RemoteGenerator(new Client());

        $generator
            ->setDimensions(new Dimension(800, 900))
            ->setText('Hello World!')
            ->setStringColor(new Color('000000'))
            ->setBackgroundColor(new Color('efefef'));

        $result = $generator->generate($this->file);

        $this->assertInstanceOf('Bitheater\DummyImage\Result', $result);
        $this->assertEquals('http://dummyimage.com/800x900/efefef/000000.png&text=Hello+World%21', $result->getUrl());
        $this->assertFileExists($this->file);
    }

    public function testExceptionIsThrownWithInvalidData()
    {
        $this->setExpectedException('InvalidArgumentException');

        $generator = new RemoteGenerator(new Client());
        $generator->setDimensions(new Dimension(40000, 40));
    }

    public function tearDown()
    {
        if (file_exists($this->file)) {
            unlink($this->file);
        }
    }
}


text:
require 'rake'
require 'jsdoc-toolkit'
require 'jsdoc-toolkit/generator'
require 'pathname'

module JsDocToolkit
  class DocTask
    attr_reader :jsdoc_files

    def initialize(task_name)
      @jsdoc_files = []
      yield(self)
      task(task_name) { build }
    end

    def jsdoc_dir=(path)
      @jsdoc_dir = Pathname(path)
    end

  private

    def build
      generator = JsDocToolkit::Generator.new
      generator.build(:src_files => @jsdoc_files, :doc_dir => @jsdoc_dir.to_s)
    end

  end # DocTask
end   # JsDocToolkit


text:
\hypertarget{classgofxmath_1_1_vec2}{}\section{gofxmath\+:\+:Vec2 Class Reference}
\label{classgofxmath_1_1_vec2}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}

A 2\+D Vector.

{\ttfamily \#include $<$vec2.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hyperlink{classgofxmath_1_1_vec2_a917bbdd7578961e5fab8ca6a754f4d7f}{Vec2} ()
\begin{DoxyCompactList}\small\item\em Constructs a \hyperlink{classgofxmath_1_1_vec2}{Vec2} with both components being initialized to 0.\+0f. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2_a025393dfeb09f6fc937e92b62280430f}{Vec2} (float xy)
\begin{DoxyCompactList}\small\item\em Constructor taking a single float argument that will be copied into both component values. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2_a10d14900df4ac8ee70be65399677d665}{Vec2} (float \hyperlink{classgofxmath_1_1_vec2_a09ebe2a3b8bdcfe220849bebb45a7e73}{x}, float \hyperlink{classgofxmath_1_1_vec2_ac182a240fd0c4d554b970a1247d796d5}{y})
\begin{DoxyCompactList}\small\item\em Constructs a \hyperlink{classgofxmath_1_1_vec2}{Vec2} with the given x and y values assigned to their respective components. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2_a7278bf6d729b6fc7450832d722476ae1}{operator Vec3} () const
\begin{DoxyCompactList}\small\item\em Explicit cast that converts the given to a \hyperlink{classgofxmath_1_1_vec3}{Vec3}. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2_a949ce7bfa411ce89c4b6673562c9014c}{operator Vec4} () const
\begin{DoxyCompactList}\small\item\em Explicit cast that converts the given to a \hyperlink{classgofxmath_1_1_vec4}{Vec4}. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec4}{Vec4} \hyperlink{classgofxmath_1_1_vec2_ac6d67e7a1efea2e66b63eda0e36aa069}{To\+Col\+Vec} () const
\begin{DoxyCompactList}\small\item\em Creates the 4-\/component column vector version of this \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hypertarget{classgofxmath_1_1_vec2_a303bfc61730279ddc16ff03fb6a80df3}{}static \hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{classgofxmath_1_1_vec2_a303bfc61730279ddc16ff03fb6a80df3}{Right} ()\label{classgofxmath_1_1_vec2_a303bfc61730279ddc16ff03fb6a80df3}

\begin{DoxyCompactList}\small\item\em The right direction \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \end{DoxyCompactList}\item
\hypertarget{classgofxmath_1_1_vec2_aa092215329d9058bc940557300fb3011}{}static \hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{classgofxmath_1_1_vec2_aa092215329d9058bc940557300fb3011}{Up} ()\label{classgofxmath_1_1_vec2_aa092215329d9058bc940557300fb3011}

\begin{DoxyCompactList}\small\item\em The up direction \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \end{DoxyCompactList}\item
\hypertarget{classgofxmath_1_1_vec2_aa67eb3cad4d0263d51738559ac2d04f1}{}static \hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{classgofxmath_1_1_vec2_aa67eb3cad4d0263d51738559ac2d04f1}{Left} ()\label{classgofxmath_1_1_vec2_aa67eb3cad4d0263d51738559ac2d04f1}

\begin{DoxyCompactList}\small\item\em The left direction \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \end{DoxyCompactList}\item
\hypertarget{classgofxmath_1_1_vec2_a6d9b1ac0a454ea198547bbf21b7b4438}{}static \hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{classgofxmath_1_1_vec2_a6d9b1ac0a454ea198547bbf21b7b4438}{Down} ()\label{classgofxmath_1_1_vec2_a6d9b1ac0a454ea198547bbf21b7b4438}

\begin{DoxyCompactList}\small\item\em The down direction \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \end{DoxyCompactList}\item
\hypertarget{classgofxmath_1_1_vec2_a48fb8bacc181a011e8cd7f7d5c093c56}{}static \hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{classgofxmath_1_1_vec2_a48fb8bacc181a011e8cd7f7d5c093c56}{One} ()\label{classgofxmath_1_1_vec2_a48fb8bacc181a011e8cd7f7d5c093c56}

\begin{DoxyCompactList}\small\item\em The \hyperlink{classgofxmath_1_1_vec2}{Vec2} with both components set to 1.\+0f. \end{DoxyCompactList}\item
\hypertarget{classgofxmath_1_1_vec2_af99c0a21b945e7cf075e2ee56aea2108}{}static \hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{classgofxmath_1_1_vec2_af99c0a21b945e7cf075e2ee56aea2108}{Neg\+One} ()\label{classgofxmath_1_1_vec2_af99c0a21b945e7cf075e2ee56aea2108}

\begin{DoxyCompactList}\small\item\em The \hyperlink{classgofxmath_1_1_vec2}{Vec2} with both components set to -\/1.\+0f. \end{DoxyCompactList}\item
\hypertarget{classgofxmath_1_1_vec2_a923f7a4f3c16d673e7eda2b7edfbe3c2}{}static \hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{classgofxmath_1_1_vec2_a923f7a4f3c16d673e7eda2b7edfbe3c2}{Zero} ()\label{classgofxmath_1_1_vec2_a923f7a4f3c16d673e7eda2b7edfbe3c2}

\begin{DoxyCompactList}\small\item\em The zero \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item
float \hyperlink{classgofxmath_1_1_vec2_ab958b7bde2c40040f45d4fac9cd8217b}{vals} \mbox{[}2\mbox{]}
\begin{DoxyCompactList}\small\item\em The 2 components of the \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \end{DoxyCompactList}\item
float \hyperlink{classgofxmath_1_1_vec2_a09ebe2a3b8bdcfe220849bebb45a7e73}{x}
\begin{DoxyCompactList}\small\item\em The x-\/coordinate. \end{DoxyCompactList}\item
float \hyperlink{classgofxmath_1_1_vec2_ac182a240fd0c4d554b970a1247d796d5}{y}
\begin{DoxyCompactList}\small\item\em The y-\/coordinate. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item
std\+::ostream \& \hyperlink{classgofxmath_1_1_vec2_a4318103522da957a7fea3f3454f663fa}{operator$<$$<$} (std\+::ostream \&stream, const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&vec)
\begin{DoxyCompactList}\small\item\em A function that writes the given 2\+D vector to the given output stream. \end{DoxyCompactList}\item
std\+::istream \& \hyperlink{classgofxmath_1_1_vec2_ae05b41fed2d1147f95d2e43e75463fa4}{operator$>$$>$} (std\+::istream \&input, \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&vec)
\begin{DoxyCompactList}\small\item\em A function that reads in the a 2\+D vector from the given input stream. \end{DoxyCompactList}\item
bool \hyperlink{classgofxmath_1_1_vec2_abed4a0c0a66b1b50c31c8448ddb2384d}{operator==} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&left, const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&right)
\begin{DoxyCompactList}\small\item\em Equality operator. \end{DoxyCompactList}\item
bool \hyperlink{classgofxmath_1_1_vec2_a95f55509aeacabec75d0a5289c57cfcc}{operator!=} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&left, const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&right)
\begin{DoxyCompactList}\small\item\em Inequality operator. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Related Functions}
(Note that these are not member functions.) {\bf }\par
\begin{DoxyCompactItemize}
\item
\hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{group___s_i_s_d_vec_math_gac9d2c898c69c771b9d9993a4c4f1a146}{Vec2\+Add} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&first, const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&second)
\begin{DoxyCompactList}\small\item\em Add the two given Vec2s. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{group___s_i_s_d_vec_math_gabc910528ba2f4f4c3b69bf432e5c7731}{Vec2\+Sub} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&first, const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&second)
\begin{DoxyCompactList}\small\item\em Subtract the two given Vec2s. \end{DoxyCompactList}\item
float \hyperlink{group___s_i_s_d_vec_math_gaf722c71a1e9ef7bf97d9489b1cf561e0}{Vec2\+Dot} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&first, const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&second)
\begin{DoxyCompactList}\small\item\em \hyperlink{classgofxmath_1_1_vec2}{Vec2} dot product. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{group___s_i_s_d_vec_math_ga8e4fd4586284706a28625b0fca6c85e7}{Vec2\+Mul\+Scalar} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&vec, float factor)
\begin{DoxyCompactList}\small\item\em Multiply the components of the given \hyperlink{classgofxmath_1_1_vec2}{Vec2} by the given scalar. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{group___s_i_s_d_vec_math_ga8686be4c3f0ee27b05363661fb75a228}{Vec2\+Div\+Scalar} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&vec, float divisor)
\begin{DoxyCompactList}\small\item\em Divide the components of the given \hyperlink{classgofxmath_1_1_vec2}{Vec2} by the given scalar. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{group___s_i_s_d_vec_math_gaa0125e18e221531bfc7d72d47cdf42d9}{Vec2\+Normalize} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&vec)
\begin{DoxyCompactList}\small\item\em Normalize the given \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \end{DoxyCompactList}\item
\hyperlink{classgofxmath_1_1_vec2}{Vec2} \hyperlink{group___s_i_s_d_vec_math_ga55959c707ef1b444eb2d71009a201aa2}{Vec2\+Negate} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&vec)
\begin{DoxyCompactList}\small\item\em Negate the given \hyperlink{classgofxmath_1_1_vec2}{Vec2} components. \end{DoxyCompactList}\item
{\footnotesize template$<$Float\+Precision precision = Float\+Precision\+::\+H\+I\+G\+H$>$ }\\bool \hyperlink{group___s_i_s_d_vec_math_gae2e5df24e56917013fefa17579bb8749}{Vec2\+Approx\+Equal} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&first, const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&second)
\begin{DoxyCompactList}\small\item\em Determines whether the two Vec2s are approximately equal, based on the given Precision template argument (defaults to H\+I\+G\+H precision). \end{DoxyCompactList}\item
bool \hyperlink{group___s_i_s_d_vec_math_ga7b340b1e4dd88d99aba27f41cd0c1d17}{Vec2\+Has\+Na\+N} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&vec)
\begin{DoxyCompactList}\small\item\em Vector 2 has a Na\+N component value. \end{DoxyCompactList}\item
bool \hyperlink{group___s_i_s_d_vec_math_ga6eb96a6532361189c7cacdbd9ae95c90}{Vec2\+Has\+Infinite} (const \hyperlink{classgofxmath_1_1_vec2}{Vec2} \&vec)
\begin{DoxyCompactList}\small\item\em Determines whether or not the given \hyperlink{classgofxmath_1_1_vec2}{Vec2} has an infinite value component. \end{DoxyCompactList}\end{DoxyCompactItemize}

\subsection{Detailed Description}
A 2\+D Vector.

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classgofxmath_1_1_vec2_a917bbdd7578961e5fab8ca6a754f4d7f}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!Vec2@{Vec2}}
\index{Vec2@{Vec2}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{Vec2}]{\setlength{\rightskip}{0pt plus 5cm}gofxmath\+::\+Vec2\+::\+Vec2 (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{classgofxmath_1_1_vec2_a917bbdd7578961e5fab8ca6a754f4d7f}

Constructs a \hyperlink{classgofxmath_1_1_vec2}{Vec2} with both components being initialized to 0.\+0f.

\begin{DoxyDate}{Date}
2/21/2015
\end{DoxyDate}
\hypertarget{classgofxmath_1_1_vec2_a025393dfeb09f6fc937e92b62280430f}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!Vec2@{Vec2}}
\index{Vec2@{Vec2}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{Vec2}]{\setlength{\rightskip}{0pt plus 5cm}gofxmath\+::\+Vec2\+::\+Vec2 (
\begin{DoxyParamCaption}
\item[{float}]{xy}
\end{DoxyParamCaption}
)}\label{classgofxmath_1_1_vec2_a025393dfeb09f6fc937e92b62280430f}

Constructor taking a single float argument that will be copied into both component values.

\begin{DoxyDate}{Date}
2/21/2015
\end{DoxyDate}

\begin{DoxyParams}{Parameters}
{\em xy} & The value of the x and y-\/coordinate components of this \hyperlink{classgofxmath_1_1_vec3}{Vec3}. \\
\hline
\end{DoxyParams}
\hypertarget{classgofxmath_1_1_vec2_a10d14900df4ac8ee70be65399677d665}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!Vec2@{Vec2}}
\index{Vec2@{Vec2}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{Vec2}]{\setlength{\rightskip}{0pt plus 5cm}gofxmath\+::\+Vec2\+::\+Vec2 (
\begin{DoxyParamCaption}
\item[{float}]{x, }
\item[{float}]{y}
\end{DoxyParamCaption}
)}\label{classgofxmath_1_1_vec2_a10d14900df4ac8ee70be65399677d665}

Constructs a \hyperlink{classgofxmath_1_1_vec2}{Vec2} with the given x and y values assigned to their respective components.

\begin{DoxyDate}{Date}
2/21/2015
\end{DoxyDate}

\begin{DoxyParams}{Parameters}
{\em x} & The x coordinate of the resulting \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \\
\hline
{\em y} & The y coordinate of the resulting \hyperlink{classgofxmath_1_1_vec2}{Vec2}. \\
\hline
\end{DoxyParams}

\subsection{Member Function Documentation}
\hypertarget{classgofxmath_1_1_vec2_a7278bf6d729b6fc7450832d722476ae1}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!operator Vec3@{operator Vec3}}
\index{operator Vec3@{operator Vec3}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{operator Vec3}]{\setlength{\rightskip}{0pt plus 5cm}gofxmath\+::\+Vec2\+::operator {\bf Vec3} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [explicit]}}\label{classgofxmath_1_1_vec2_a7278bf6d729b6fc7450832d722476ae1}

Explicit cast that converts the given to a \hyperlink{classgofxmath_1_1_vec3}{Vec3}.

\begin{DoxyDate}{Date}
2/22/2015
\end{DoxyDate}
\begin{DoxyReturn}{Returns}
The result of the operation.
\end{DoxyReturn}
\hypertarget{classgofxmath_1_1_vec2_a949ce7bfa411ce89c4b6673562c9014c}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!operator Vec4@{operator Vec4}}
\index{operator Vec4@{operator Vec4}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{operator Vec4}]{\setlength{\rightskip}{0pt plus 5cm}gofxmath\+::\+Vec2\+::operator {\bf Vec4} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [explicit]}}\label{classgofxmath_1_1_vec2_a949ce7bfa411ce89c4b6673562c9014c}

Explicit cast that converts the given to a \hyperlink{classgofxmath_1_1_vec4}{Vec4}.

\begin{DoxyDate}{Date}
2/22/2015
\end{DoxyDate}
\begin{DoxyReturn}{Returns}
The result of the operation.
\end{DoxyReturn}
\hypertarget{classgofxmath_1_1_vec2_ac6d67e7a1efea2e66b63eda0e36aa069}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!To\+Col\+Vec@{To\+Col\+Vec}}
\index{To\+Col\+Vec@{To\+Col\+Vec}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{To\+Col\+Vec}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Vec4} gofxmath\+::\+Vec2\+::\+To\+Col\+Vec (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}\label{classgofxmath_1_1_vec2_ac6d67e7a1efea2e66b63eda0e36aa069}

Creates the 4-\/component column vector version of this \hyperlink{classgofxmath_1_1_vec2}{Vec2}.

\begin{DoxyDate}{Date}
3/20/2015
\end{DoxyDate}
\begin{DoxyReturn}{Returns}
The resulting \hyperlink{classgofxmath_1_1_vec4}{Vec4} representing a transformable 2\+D column vector.
\end{DoxyReturn}
\begin{DoxyRemark}{Remarks}
Sets the fourth component to 1.\+0f. Otherwise identical to the explicit cast from \hyperlink{classgofxmath_1_1_vec2}{Vec2} to \hyperlink{classgofxmath_1_1_vec4}{Vec4};
\end{DoxyRemark}

\subsection{Friends And Related Function Documentation}
\hypertarget{classgofxmath_1_1_vec2_a95f55509aeacabec75d0a5289c57cfcc}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{operator"!=}]{\setlength{\rightskip}{0pt plus 5cm}bool operator!= (
\begin{DoxyParamCaption}
\item[{const {\bf Vec2} \&}]{left, }
\item[{const {\bf Vec2} \&}]{right}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [friend]}}\label{classgofxmath_1_1_vec2_a95f55509aeacabec75d0a5289c57cfcc}

Inequality operator.

\begin{DoxyDate}{Date}
2/22/2015
\end{DoxyDate}

\begin{DoxyParams}{Parameters}
{\em left} & The first instance to compare. \\
\hline
{\em right} & The second instance to compare.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the parameters are not considered equivalent.
\end{DoxyReturn}
\hypertarget{classgofxmath_1_1_vec2_a4318103522da957a7fea3f3454f663fa}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!operator$<$$<$@{operator$<$$<$}}
\index{operator$<$$<$@{operator$<$$<$}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{operator$<$$<$}]{\setlength{\rightskip}{0pt plus 5cm}std\+::ostream\& operator$<$$<$ (
\begin{DoxyParamCaption}
\item[{std\+::ostream \&}]{stream, }
\item[{const {\bf Vec2} \&}]{vec}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [friend]}}\label{classgofxmath_1_1_vec2_a4318103522da957a7fea3f3454f663fa}

A function that writes the given 2\+D vector to the given output stream.

\begin{DoxyDate}{Date}
2/22/2015
\end{DoxyDate}

\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em stream} & The output stream to be written to. \\
\hline
 & {\em vec} & The \hyperlink{classgofxmath_1_1_vec2}{Vec2} to write to the stream.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Writes the value of the given \hyperlink{classgofxmath_1_1_vec2}{Vec2} to the given output stream.
\end{DoxyReturn}
\hypertarget{classgofxmath_1_1_vec2_abed4a0c0a66b1b50c31c8448ddb2384d}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!operator==@{operator==}}
\index{operator==@{operator==}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{operator==}]{\setlength{\rightskip}{0pt plus 5cm}bool operator== (
\begin{DoxyParamCaption}
\item[{const {\bf Vec2} \&}]{left, }
\item[{const {\bf Vec2} \&}]{right}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [friend]}}\label{classgofxmath_1_1_vec2_abed4a0c0a66b1b50c31c8448ddb2384d}

Equality operator.

\begin{DoxyDate}{Date}
2/22/2015
\end{DoxyDate}

\begin{DoxyParams}{Parameters}
{\em left} & The first instance to compare. \\
\hline
{\em right} & The second instance to compare.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the parameters are considered equivalent.
\end{DoxyReturn}
\hypertarget{classgofxmath_1_1_vec2_ae05b41fed2d1147f95d2e43e75463fa4}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!operator$>$$>$@{operator$>$$>$}}
\index{operator$>$$>$@{operator$>$$>$}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{operator$>$$>$}]{\setlength{\rightskip}{0pt plus 5cm}std\+::istream\& operator$>$$>$ (
\begin{DoxyParamCaption}
\item[{std\+::istream \&}]{input, }
\item[{{\bf Vec2} \&}]{vec}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [friend]}}\label{classgofxmath_1_1_vec2_ae05b41fed2d1147f95d2e43e75463fa4}

A function that reads in the a 2\+D vector from the given input stream.

\begin{DoxyDate}{Date}
2/22/2015
\end{DoxyDate}

\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em input} & The input stream to be read from. \\
\hline
\mbox{\tt in,out}  & {\em vec} & The \hyperlink{classgofxmath_1_1_vec2}{Vec2} to read values into from the stream.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Reads the value of the given input stream to the given \hyperlink{classgofxmath_1_1_vec2}{Vec2}.
\end{DoxyReturn}

\subsection{Member Data Documentation}
\hypertarget{classgofxmath_1_1_vec2_ab958b7bde2c40040f45d4fac9cd8217b}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!vals@{vals}}
\index{vals@{vals}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{vals}]{\setlength{\rightskip}{0pt plus 5cm}float gofxmath\+::\+Vec2\+::vals\mbox{[}2\mbox{]}}\label{classgofxmath_1_1_vec2_ab958b7bde2c40040f45d4fac9cd8217b}

The 2 components of the \hyperlink{classgofxmath_1_1_vec2}{Vec2}.

\begin{DoxyRemark}{Remarks}
Points to the same values as the x, and y components (at indices 0 and 1, respectively).
\end{DoxyRemark}
\hypertarget{classgofxmath_1_1_vec2_a09ebe2a3b8bdcfe220849bebb45a7e73}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!x@{x}}
\index{x@{x}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{x}]{\setlength{\rightskip}{0pt plus 5cm}float gofxmath\+::\+Vec2\+::x}\label{classgofxmath_1_1_vec2_a09ebe2a3b8bdcfe220849bebb45a7e73}

The x-\/coordinate.

\begin{DoxyRemark}{Remarks}
Equivalent to {\bfseries vals\mbox{[}0\mbox{]}}.
\end{DoxyRemark}
\hypertarget{classgofxmath_1_1_vec2_ac182a240fd0c4d554b970a1247d796d5}{}\index{gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}!y@{y}}
\index{y@{y}!gofxmath\+::\+Vec2@{gofxmath\+::\+Vec2}}
\subsubsection[{y}]{\setlength{\rightskip}{0pt plus 5cm}float gofxmath\+::\+Vec2\+::y}\label{classgofxmath_1_1_vec2_ac182a240fd0c4d554b970a1247d796d5}

The y-\/coordinate.

\begin{DoxyRemark}{Remarks}
Equivalent to {\bfseries vals\mbox{[}1\mbox{]}}.
\end{DoxyRemark}

The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item
\hyperlink{vec2_8h}{vec2.\+h}\item
\hyperlink{vecmath_8h}{vecmath.\+h}\end{DoxyCompactItemize}


text:
/*--------------------------------------------------------
   EDRTEST.C -- Program using EDRLIB dynamic-link library
                (c) Charles Petzold, 1998
  --------------------------------------------------------*/

#include <windows.h>
#include "edrlib.h"

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{
     static TCHAR szAppName[] = TEXT ("StrProg") ;
     HWND         hwnd ;
     MSG          msg ;
     WNDCLASS     wndclass ;

     wndclass.style         = CS_HREDRAW | CS_VREDRAW ;
     wndclass.lpfnWndProc   = WndProc ;
     wndclass.cbClsExtra    = 0 ;
     wndclass.cbWndExtra    = 0 ;
     wndclass.hInstance     = hInstance ;
     wndclass.hIcon         = LoadIcon (NULL, IDI_APPLICATION) ;
     wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
     wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
     wndclass.lpszMenuName  = NULL ;
     wndclass.lpszClassName = szAppName ;

     if (!RegisterClass (&wndclass))
     {
          MessageBox (NULL, TEXT ("This program requires Windows NT!"),
                      szAppName, MB_ICONERROR) ;
          return 0 ;
     }

     hwnd = CreateWindow (szAppName, TEXT ("DLL Demonstration Program"),
                          WS_OVERLAPPEDWINDOW,
                          CW_USEDEFAULT, CW_USEDEFAULT,
                          CW_USEDEFAULT, CW_USEDEFAULT,
                          NULL, NULL, hInstance, NULL) ;

     ShowWindow (hwnd, iCmdShow) ;
     UpdateWindow (hwnd) ;

     while (GetMessage (&msg, NULL, 0, 0))
     {
          TranslateMessage (&msg) ;
          DispatchMessage (&msg) ;
     }
     return msg.wParam ;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
     HDC         hdc ;
     PAINTSTRUCT ps ;
     RECT        rect ;

     switch (message)
     {
     case WM_PAINT:
          hdc = BeginPaint (hwnd, &ps) ;

          GetClientRect (hwnd, &rect) ;

          EdrCenterText (hdc, &rect,
                         TEXT ("This string was displayed by a DLL")) ;

          EndPaint (hwnd, &ps) ;
          return 0 ;

     case WM_DESTROY:
          PostQuitMessage (0) ;
          return 0 ;
     }
     return DefWindowProc (hwnd, message, wParam, lParam) ;
}


text:
//
//  GJAssetsPickerViewController.m
//  GJAssetsPickerViewController
//
//  Created by ZYVincent on 14-9-8.
//  Copyright (c) 2014年 ganji. All rights reserved.
//

#import "GJCFAssetsPickerViewController.h"
#import "GJCFAlbumsViewController.h"

#define kGJPhotoViewControllerCustomKey      @"kGJPhotoViewControllerCustomKey"
#define kGJAlbumsViewControllerCellCustomKey @"kGJAlbumsViewControllerCellCustomKey"
#define kGJAlbumsViewControllerCellCustomHeightKey @"kGJAlbumsViewControllerCellCustomHeightKey"

@interface GJCFAssetsPickerViewController ()<GJCFAlbumsViewControllerDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate>

@property (nonatomic,strong)GJCFAssetsPickerStyle *customStyle;
@property (nonatomic,strong)GJCFAlbumsViewController *albumsViewController;
@property (nonatomic,strong)NSMutableDictionary *customClassDict;

@end

@implementation GJCFAssetsPickerViewController

#pragma mark - 生命周期

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.customClassDict = [[NSMutableDictionary alloc]init];

        [self initAlbums];
    }
    return self;
}
- (id)init
{
    if (self = [super init]) {

        self.customClassDict = [[NSMutableDictionary alloc]init];

        [self initAlbums];

    }
    return self;
}

- (void)dealloc
{
    [[NSNotificationCenter defaultCenter]removeObserver:self];
}

- (void)viewDidLoad
{

    [super viewDidLoad];
    // Do any additional setup after loading the view.

    //是否有自定义的UI
    if (!self.customStyle) {

        if (self.pickerDelegate && [self.pickerDelegate respondsToSelector:@selector(pickerViewShouldUseCustomStyle:)]) {
            self.customStyle = [self.pickerDelegate pickerViewShouldUseCustomStyle:self];
        }else{
            self.customStyle = [GJCFAssetsPickerStyle defaultStyle];
        }

    }

    self.albumsViewController.mutilSelectLimitCount = self.mutilSelectLimitCount;

    //观察必要通知
    [self observeAssetsPickerNotis];
}

#pragma mark - 初始化相册
- (void)initAlbums
{
    self.albumsViewController = [[GJCFAlbumsViewController alloc]init];
    self.albumsViewController.shouldInitSelectedStateAssetArray = self.shouldInitSelectedStateAssetArray;
    self.albumsViewController.delegate = self;

    /* 是否有自定义UI */
    if ([self.customClassDict objectForKey:kGJPhotoViewControllerCustomKey]) {
        [self.albumsViewController registPhotoViewControllerClass:NSClassFromString([self.customClassDict objectForKey:kGJPhotoViewControllerCustomKey])];
    }
    if ([self.customClassDict objectForKey:kGJAlbumsViewControllerCellCustomKey]) {
        NSDictionary *customCellDict = [self.customClassDict objectForKey:kGJAlbumsViewControllerCellCustomKey];
        [self.albumsViewController registAlbumsCustomCellClass:NSClassFromString([customCellDict objectForKey:kGJAlbumsViewControllerCellCustomKey]) withCellHeight:[[customCellDict objectForKey:kGJAlbumsViewControllerCellCustomHeightKey] floatValue]];
    }

    [self setViewControllers:@[self.albumsViewController] animated:NO];
}

#pragma mark - GJCFAssetsPickerAlbumsViewController delegate
- (GJCFAssetsPickerStyle*)albumsViewControllerShouldUseCustomStyle:(GJCFAlbumsViewController *)albumsViewController
{
    return self.customStyle;
}

#pragma mark - NSNotification 通知处理

//观察所有必要的通知
- (void)observeAssetsPickerNotis
{
    /*
     * 观察GJPhotosViewController多选时候已选择照片数量的变化
     */
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(observePhotoControllerMutilSelectLimitCountChange:) name:kGJAssetsPickerPhotoControllerDidReachLimitCountNoti object:nil];

    /*
     * 观察发生错误的消息
     */
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(observeComeAcrossAnErrorNoti:) name:kGJAssetsPickerComeAcrossAnErrorNoti object:nil];

    /*
     * 观察图片预览消息
     */
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(observePhotoControlleRequirePreviewButNoSelectedImages:) name:kGJAssetsPickerRequirePreviewButNoSelectPhotoTipNoti object:nil];

    /*
     * 观察图片选择退出消息
     */
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(observePickerControllerNeedCancel:) name:kGJAssetsPickerNeedCancelNoti object:nil];

    /*
     * 观察图片选择已经完成的消息
     */
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(observeChooseMediaDidFinishNoti:) name:kGJAssetsPickerDidFinishChooseMediaNoti object:nil];
}

/*
 * 处理当图片选择达到限制数量的消息
 */
- (void)observePhotoControllerMutilSelectLimitCountChange:(NSNotification*)noti
{
    NSNumber *limitCount = (NSNumber*)noti.object;

    if (self.pickerDelegate && [self.pickerDelegate respondsToSelector:@selector(pickerViewController:didReachLimitSelectedCount:)]) {
        [self.pickerDelegate pickerViewController:self didReachLimitSelectedCount:[limitCount intValue]];
    }
}

/*
 * 图片想要预览却没有选中图片
 */
- (void)observePhotoControlleRequirePreviewButNoSelectedImages:(NSNotification*)noti
{
    if (self.pickerDelegate && [self.pickerDelegate respondsToSelector:@selector(pickerViewControllerRequirePreviewButNoSelectedImage:)]) {
        [self.pickerDelegate pickerViewControllerRequirePreviewButNoSelectedImage:self];
    }
}

/*
 * 图片选择已经完成了的消息
 */
- (void)observeChooseMediaDidFinishNoti:(NSNotification*)noti
{
    NSArray *resultArray = (NSArray*)noti.object;

    if (resultArray.count > 0) {

        if (self.pickerDelegate && [self.pickerDelegate respondsToSelector:@selector(pickerViewController:didFinishChooseMedia:)]) {
            [self.pickerDelegate pickerViewController:self didFinishChooseMedia:resultArray];
        }

    }else{

        if (self.pickerDelegate && [self.pickerDelegate respondsToSelector:@selector(pickerViewController:didFaildWithErrorMsg:withErrorType:)]) {
            [self.pickerDelegate pickerViewController:self didFaildWithErrorMsg:@"至少选择一张照片" withErrorType:GJAssetsPickerErrorTypePhotoLibarayChooseZeroCountPhoto];
        }
    }

}

/*
 * 发生了错误的消息
 */
- (void)observeComeAcrossAnErrorNoti:(NSNotification*)noti
{
    NSError *error = (NSError*)noti.object;

    //如果是本身的错误
    NSString *errorDomain = [error domain];
    if ([errorDomain isEqualToString:kGJAssetsPickerErrorDomain]) {

        GJAssetsPickerErrorType errorType = error.code;

        switch (errorType) {
            case GJAssetsPickerErrorTypePhotoLibarayNotAuthorize:
            {
                if (self.pickerDelegate && [self.pickerDelegate respondsToSelector:@selector(pickerViewControllerPhotoLibraryAccessDidNotAuthorized:)]) {

                    [self.pickerDelegate pickerViewControllerPhotoLibraryAccessDidNotAuthorized:self];
                }
            }
                break;

            default:
                break;
        }
    }
}

/*
 * 图片选择需要退出
 */
- (void)observePickerControllerNeedCancel:(NSNotification*)noti
{
    [self dismissPickerViewController];
}

#pragma mark - 对外接口

- (void)dismissPickerViewController
{
    if (self.pickerDelegate && [self.pickerDelegate respondsToSelector:@selector(pickerViewControllerWillCancel:)]) {
        [self.pickerDelegate pickerViewControllerWillCancel:self];
    }

    [self dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - 公开自定义UI接口

- (void)registAlbumsCustomCellClass:(Class)aAlbumsCustomCellClass
{
    if (!aAlbumsCustomCellClass) {
        return;
    }
    [self registAlbumsCustomCellClass:aAlbumsCustomCellClass withCellHeight:44.f];
}

- (void)registAlbumsCustomCellClass:(Class)aAlbumsCustomCellClass withCellHeight:(CGFloat)cellHeight
{
    NSDictionary *customCellDict = @{kGJAlbumsViewControllerCellCustomKey:NSStringFromClass(aAlbumsCustomCellClass),kGJAlbumsViewControllerCellCustomHeightKey:@(cellHeight)};
    [self.customClassDict setObject:customCellDict forKey:kGJAlbumsViewControllerCellCustomKey];
}

- (void)registPhotoViewControllerClass:(Class)aPhotoViewControllerClass
{
    if (!aPhotoViewControllerClass) {
        return;
    }
    [self.customClassDict setObject:NSStringFromClass(aPhotoViewControllerClass) forKey:kGJPhotoViewControllerCustomKey];
}

- (void)setCustomStyle:(GJCFAssetsPickerStyle *)aCustomStyle
{
    if (!aCustomStyle) {
        return;
    }

    if (_customStyle == aCustomStyle) {
        return;
    }

    _customStyle = aCustomStyle;
}

- (void)setCustomStyleByKey:(NSString *)aExistCustomStyleKey
{
    if (!aExistCustomStyleKey) {
        return;
    }

    NSMutableDictionary *styles = [GJCFAssetsPickerStyle persistStyleDict];
    if (!styles) {
        return;
    }

    self.customStyle = [styles objectForKey:aExistCustomStyleKey];
}

@end


text:
<?php
/**
 * JSON Exporter
 *
 * @package WP_Stream
 */

namespace WP_Stream;

/**
 * Class - Exporter_JSON
 */
class Exporter_JSON extends Exporter {
	/**
	 * Exporter name
	 *
	 * @var string
	 */
	public $name = 'JSON';

	/**
	 * Exporter slug
	 *
	 * @var string
	 */
	public $slug = 'json';

	/**
	 * Outputs JSON data for download
	 *
	 * @param array $data Array of data to output.
	 * @param array $columns Column names included in data set.
	 * @return void
	 */
	public function output_file( $data, $columns ) {
		if ( ! defined( 'WP_STREAM_TESTS' ) || ( defined( 'WP_STREAM_TESTS' ) && ! WP_STREAM_TESTS ) ) {
			header( 'Content-type: text/json' );
			header( 'Content-Disposition: attachment; filename="stream.json"' );
		}

		if ( function_exists( 'wp_json_encode' ) ) {
			$output = wp_json_encode( $data );
		} else {
			$output = json_encode( $data ); // @codingStandardsIgnoreLine fallback to discouraged function
		}

		echo $output; // @codingStandardsIgnoreLine text-only output

		if ( ! defined( 'WP_STREAM_TESTS' ) || ( defined( 'WP_STREAM_TESTS' ) && ! WP_STREAM_TESTS ) ) {
			exit;
		}
	}
}


text:
'use strict';

module.exports = {
    friendlyName: 'Clear Sel Via Sel Usage',
    injectableName: 'Task.Clear.Sel.By.Usage',
    implementsTask: 'Task.Base.Clear.Sel.By.Usage',
    optionsSchema: 'clear-sel-by-usage.json',
    options: {},
    properties: {}
};


text:
dbmail
======

sendmail like but in java


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

namespace _04.Rotate_Array_of_Strings
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] words = Console.ReadLine().Split();
            int numberOfRotatedWords = int.Parse(Console.ReadLine());
            string[] rotatedWords = new string[words.Length];

            for (int i = 0; i < words.Length - numberOfRotatedWords; i++)
            {
                rotatedWords[i + numberOfRotatedWords] = words[i];
            }

            int indexOfRotatedWords = 0;
            for (int i = (words.Length - numberOfRotatedWords; i < words.Length; i++)
            {
                string lastWord = words[i];
                rotatedWords[indexOfRotatedWords] = lastWord;

                indexOfRotatedWords++;
            }

            Console.WriteLine(string.Join(" ", rotatedWords));
        }
    }
}


text:
class DateHelper

  @@default_start_date =  DateTime.new(2012,04,20)
  @@default_end_date =  DateTime.new(2012,05,01)

  def self.current_configuration
    configuration = Configuration.find_by_name 'current'
    if configuration.nil?
      configuration = Configuration.create :name => 'current', :start_date => @@default_start_date, :end_date => @@default_end_date
      if !configuration.save
        raise configuration.errors.inspect
      end
    end
    configuration
  end

  def self.election_starts_at= datetime
    configuration = current_configuration()
    configuration.update_attribute :start_date, datetime
  end

  def self.election_ends_at= datetime
    configuration = current_configuration()
    configuration.update_attribute :end_date, datetime
  end

  def self.election_starts_at
    current_configuration().start_date
  end

  def self.election_ends_at
    current_configuration().end_date
  end

  def self.election_running?
    now = DateTime.now
    config = current_configuration
    config.start_date < now && now < config.end_date
  end

  def self.election_closed?
     DateTime.now > current_configuration.end_date
  end

  def self.election_started?
     DateTime.now > current_configuration.start_date
  end

  def self.set_election_time start_date, end_date
     current_configuration.update_attributes :start_date => start_date, :end_date => end_date
  end

  def self.format datetime
    I18n.l datetime, :locale => :fr
  end
  def self.format_start
    self.format self.election_starts_at
  end
  def self.format_end
    self.format self.election_ends_at
  end

end


text:
tinyMCE.addI18n('en.image_tools',{

    alt : 'Edit / Insert alternative text',
    float_left : 'Align this image left to the content',
    float_right : 'Align this image right to the content',
    float_none : 'Don\'t wrap any text around this image',
    width_plus : 'Grow',
    width_original : 'Origanl size',
    width_min : 'Shrink',
    remove : 'Remove this image',
    edit : 'Edit this image',
    alt_label : 'Alt text',

    width_original_label : 'Original size',
    float_left_label : 'Float left',
    float_right_label : 'Float right',
    float_none_label : 'Float none',
    width_orignal_label : 'Origanal size',
    width_plus_label : 'Grow',
    width_min_label : 'Shrink',
    remove_label : 'Remove image',
    edit_label : 'Edit image'

});


text:
namespace ui {
class InputMethod;
}

namespace aura {
namespace client {

// Alphabetical sort.

// A property key to store always-on-top flag.
AURA_EXPORT extern const WindowProperty<bool>* const kAlwaysOnTopKey;

// A property key to store whether animations are disabled for the window. Type
// of value is an int.
AURA_EXPORT extern const WindowProperty<bool>* const kAnimationsDisabledKey;

// A property key to store the can-maximize flag.
AURA_EXPORT extern const WindowProperty<bool>* const kCanMaximizeKey;

// A property key to store the can-resize flag.
AURA_EXPORT extern const WindowProperty<bool>* const kCanResizeKey;

// A property key to store if a window is a constrained window or not.
AURA_EXPORT extern const WindowProperty<bool>* const kConstrainedWindowKey;

// A property key to indicate that a window should show that it deserves
// attention.
AURA_EXPORT extern const aura::WindowProperty<bool>* const kDrawAttentionKey;

// A property key to store the window modality.
AURA_EXPORT extern const WindowProperty<ui::ModalType>* const kModalKey;

// A property key to store the restore bounds for a window.
AURA_EXPORT extern const WindowProperty<gfx::Rect*>* const kRestoreBoundsKey;

// A property key to store ui::WindowShowState for restoring a window.
// Used in Ash to remember the show state before the window was minimized.
AURA_EXPORT extern const WindowProperty<ui::WindowShowState>* const
    kRestoreShowStateKey;

// A property key to store an input method object that handles a key event.
AURA_EXPORT extern const WindowProperty<ui::InputMethod*>* const
    kRootWindowInputMethodKey;

// A property key to store ui::WindowShowState for a window.
// See ui/base/ui_base_types.h for its definition.
AURA_EXPORT extern const WindowProperty<ui::WindowShowState>* const
    kShowStateKey;

// Alphabetical sort.

}  // namespace client
}  // namespace aura

#endif  // UI_AURA_CLIENT_AURA_CONSTANTS_H_


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

namespace HashTag.NetLog.DemoWeb.Services
{
    public class CompositeService
    {
        IEventLogger _log = EventLogger.GetLogger<CompositeService>();

        public void SaveRecords(List<int> records)
        {
            _log.Start.Write("Saving records");
            var currentRecordId = -1;
            try
            {
                for(var x =0;x<records.Count;x++)
                {
                    _log.Info.Write("Processing and saving record: id: {0}, index: {1}", records[x], x);
                    currentRecordId = records[x];
                }
            }
            catch(Exception ex)
            {
                _log.Error.Reference(currentRecordId).Catch(ex).Write();
                _log.Error.Reference(currentRecordId).Write(ex);
                _log.Error.Reference(currentRecordId).Write();
                throw;
            }
            _log.Stop.Write("Finished saving records");

        }
    }
}


text:
cask 'music-manager' do
  version '1.0.243.1116'
  sha256 'e425d1724d092ae5ddfb28ad4304439754394b91ab3ff3063b66196d2ffe4bee'

  url "https://dl.google.com/dl/androidjumper/mac/#{version.sub(%r{^\d+\.\d+\.}, '').delete('.')}/musicmanager.dmg"
  name 'Google Play Music Manager'
  homepage 'https://play.google.com/music/'
  license :unknown # TODO: change license and remove this comment; ':unknown' is a machine-generated placeholder

  # Renamed for consistency: app name is different in the Finder and in a shell.
  # Original discussion: https://github.com/caskroom/homebrew-cask/pull/4282
  app 'MusicManager.app', target: 'Music Manager.app'
  prefpane 'MusicManager.app/Contents/Helpers/MusicManager.prefPane'
end


text:
from __future__ import print_function
import numpy as np

from genomic_neuralnet.config import PARALLEL_BACKEND
from genomic_neuralnet.methods import get_lasso_prediction
from genomic_neuralnet.analyses import run_optimization

def main():
    alphas = list(np.arange(0.01, 1.01,0.01))
    params = {'alpha': alphas}
    run_optimization( get_lasso_prediction, params
                    , 'optimal_lasso.shelf', 'LASSO', backend=PARALLEL_BACKEND)

if __name__ == '__main__':
    main()


text:
      <cr-checkbox id="checkbox" checked="{{installed_app.isChecked}}"
          disabled="[[disabled]]">

          <site-favicon url="[[installed_app.registerableDomain]]">
          </site-favicon>

[[installed_app.appName]]

            &nbsp([[installed_app.registerableDomain]])

      </cr-checkbox>


text:
package com.intellij.psi.impl.light;

import com.intellij.lang.Language;
import com.intellij.psi.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

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

/**
 * @author peter
 */
public class LightParameterListBuilder extends LightElement implements PsiParameterList {
  private final List<PsiParameter> myParameters = new ArrayList<>();
  private PsiParameter[] myCachedParameters;

  public LightParameterListBuilder(PsiManager manager, Language language) {
    super(manager, language);
  }

  public void addParameter(PsiParameter parameter) {
    myParameters.add(parameter);
    myCachedParameters = null;
  }

  @Override
  public String toString() {
    return "Light parameter list";
  }

  @Override
  public PsiParameter @NotNull [] getParameters() {
    if (myCachedParameters == null) {
      if (myParameters.isEmpty()) {
        myCachedParameters = PsiParameter.EMPTY_ARRAY;
      }
      else {
        myCachedParameters = myParameters.toArray(PsiParameter.EMPTY_ARRAY);
      }
    }

    return myCachedParameters;
  }

  @Nullable
  @Override
  public PsiParameter getParameter(int index) {
    if (index < 0) {
      throw new IllegalArgumentException("index is negative: " + index);
    }
    if (index < myParameters.size()) return myParameters.get(index);
    return null;
  }

  @Override
  public int getParameterIndex(@NotNull PsiParameter parameter) {
    return myParameters.indexOf(parameter);
  }

  @Override
  public int getParametersCount() {
    return myParameters.size();
  }

  @Override
  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof JavaElementVisitor) {
      ((JavaElementVisitor) visitor).visitParameterList(this);
    }
  }

}


text:
package nl.xillio.xill.docgen.data;

import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;

/**
 * Test the code cleaner for ExampleNodeTest
 */
public class ExampleNodeTest {

    @Test
    public void testCodeCleaner() throws Exception {
        String code =
                "			Test Line		\n" +
                        "			Other Line\n" +
                        "				Indented Line\n" +
                        "\n" +
                        "			root again";
        String cleanCode =
                "Test Line\n" +
                        "Other Line\n" +
                        "	Indented Line\n" +
                        "\n" +
                        "root again";

        ExampleNode node = new ExampleNode("code", code);

        assertEquals(node.getContent(), cleanCode);
    }
}