text:
import * as character from '../../src/generators/character';
import * as phrase from '../../src/generators/phrase';
import State from './state';

const state = new State(stateChanged);

const outputField = document.getElementById('output') as HTMLInputElement;
const regenerateButton = document.getElementById('regenerate') as HTMLButtonElement;
const typeOptions = document.querySelectorAll('.generator');
const lengthField = document.getElementById('length') as HTMLInputElement;
const lengthPicker = document.getElementById('length-picker') as HTMLElement;
const copiedMessage = document.getElementById('copied-message') as HTMLElement;

state.load(); // calls stateChanged
registerEvents();

/**
 * Link up events for user-initiated actions.
 */
function registerEvents() {
  outputField.addEventListener('focus', () => {
    outputField.select();
    document.execCommand('copy');
    copiedMessage.style.visibility = 'visible';
  });
  outputField.addEventListener('blur', () => {
    copiedMessage.style.visibility = 'hidden';
  });

  regenerateButton.addEventListener('click', generate);

  for (let i = 0; i < typeOptions.length; i++) {
    const opt = typeOptions.item(i);
    opt.addEventListener('click', e => {
      const ele = e.currentTarget as HTMLInputElement;
      const lengths = showType(ele);
      state.passtype = ele.id;
      state.length = lengths[1];
      state.persist();
    });
  }

  lengthField.addEventListener('input', e => {
    state.length = parseInt(lengthField.value);
    state.persist();
  });
  lengthField.addEventListener('focus', e => {
    lengthField.select();
  });
}

/**
 * Generate a new password whenever the state changes & update UI.
 */
function stateChanged() {
  if (!state.passtype || !state.length) {
    return;
  }

  const radio = document.getElementById(state.passtype) as HTMLInputElement;
  radio.checked = true;
  showType(radio);
  lengthField.value = state.length.toString();
  generate();
}

/**
 * Generate a password from the current state.
 */
function generate() {
  if (state.passtype == null || state.length == null) {
    return;
  }

  // load up the selected type
  const typeRadio = document.getElementById(state.passtype) as HTMLInputElement;
  if (typeRadio == null) {
    return;
  }
  const data = typeRadio.dataset as any;

  // generate something
  let out = '';
  const type = data.type;
  if (type === 'character') {
    out = character.generate(state.length, (<any>character.alphabets)[data.alphabet], data.exhaustive === 'true');
  } else if (type === 'phrase') {
    out = phrase.generate(state.length, false, '-');
  }

  // show generated password
  const outputArea = document.getElementById('output-area') as HTMLElement;
  outputArea.style.visibility = 'visible';
  outputField.value = out;
}

/**
 * Show details of a selected password type.
 *
 * Does not change state.
 */
function showType(radio: HTMLInputElement): number[] {
  const data = radio.dataset as any;
  const passtype = radio.id;

  // show description
  const descs = document.querySelectorAll('#description > .type');
  for (let i = 0; i < descs.length; i++) {
    const txt = descs.item(i) as HTMLElement;
    txt.style.display = 'none';
  }
  const desc = document.getElementById(`desc_${passtype}`) as HTMLElement;
  desc.style.display = 'block';

  // make some length presets & show the picker
  const lengths = data.length.split(',').map((x: string) => parseInt(x));
  renderLengthOptions(lengths);
  lengthPicker.style.visibility = 'visible';

  return lengths;
}

/**
 * Given a list of numbers, update the length picker appropriately.
 */
function renderLengthOptions(lengths: Array<number>) {
  // remove existing buttons
  const container = document.getElementById('length-presets') as HTMLElement;
  while (container.firstChild) {
    container.removeChild(container.firstChild);
  }

  // make quick-select buttons
  for (let l of lengths) {
    const btn = document.createElement('button');
    btn.textContent = l.toString();
    btn.addEventListener('click', e => {
      state.length = l;
      state.persist();
    });
    container.appendChild(btn);
  }

  // set appropriate minimum for range field
  lengthField.min = lengths[0].toString();
}


text:
Cuotas de Disco

Introducción

Las cuotas son un método de controlar cuánto espacio en disco pueden usar
los usuarios y los grupos. Para cada sistema de archivos puedes colocar
límites de cuánto espacio en disco y cuántos archivos puede utilizar cada
usuario. Algunos sistemas Unix pueden tambien permitirte limitar el espacio
y los archivos utilizados por todos los miembros de algún grupo.

Las cuotas pueden configurarse sólamente para sistemas de archivo Unix
locales. Los sistemas de archivo NFS montados desde otros sistemas utilizan
las cuotas de su servidor, si tienen. Los sistemas de archivo no Unix como
MS-DOS o ISO9660 no pueden soportar ningún tipo de cuotas.

Para cada usuario se imponen cuatro límites:

Límite de bloque por soft

El número de bloques de disco permitidos antes de que se muestre un
    mensaje de aviso.

Límite de bloque por hard

El máximo número de bloques que un archivo de usuario puede ocupar.

Límite de archivo por soft

El número de archivos permitidos antes de que se muestre un mensaje
    de aviso.

Límite de archivo por Hard

El máximo número de archivos que un usuario puede tener.

Los bloques de disco son típicamente de 512 o 1024 bytes de tamaño, dependiendo
del sistema operativo. Cuando se calculan las cuotas, todas las medidas
de los archivos son redondeadas al siguiente bloque por encima. Por ello,
incluso los archivos vacíos usan al menos un bloque.

Para propósito de cuotas de archivo, cada directorio, dispositivo, enlace
simbólico o archivo normal es tenido en cuenta para el máximo número de
archivos que puede tener un usuario. Técnicamente, la cuota de archivos es
actualmente una cuenta de i-nodos.

El Módulo de Cuotas de Disco

La página principal de este modulo muestra una lista de sistemas de archivo
locales que pueden soportar cuotas. Si las cuotas están activadas en este
momento en tu sistema, puedes hacer click en su trayectoria para mostrar
las cuotas de cada usuario. Si no, haciendo click en <tt>Activar Cuotas</tt>
activará las cuotas de ese sistema de archivos.

<if $gconfig{'os_type'} =~ /linux/>
El sistema operativo Linux no permite activar las cuotas a menos que el
sistema de archivos tenga la opción <tt>Usar Cuotas</tt> puesta en el
módulo de los Discos y en el de los Sistemas de archivo. Si ninguno de
tus sistemas de archivo tiene esta opción puesta, no se lista a nadie en la
página principal.

</if>

Bajo la lista de sistemas de archivo hay un botón para mostrar todas las
cuotas de un usuario seleccionado. Esto será sólamente mostrado si al menos
un sistema de archivos tiene activadas las cuotas de usuario. De forma
similar, si al menos un sistema de archivos tiene grupos de cuotas activadas
habrá un botón para mostrar todas las cuotas del grupo seleccionado.

redpajama_set_name: RedPajamaGithub


text:
package com.bigfat.dotsview;

import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bigfat.library.DotsView;

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

public class MainActivity extends AppCompatActivity {
    private ViewPager viewPager;
    private DotsView dotsViewVertical;
    private DotsView dotsViewHorizontal;

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

        viewPager = (ViewPager) findViewById(R.id.viewPager);
        dotsViewVertical = (DotsView) findViewById(R.id.dv_vertical);
        dotsViewHorizontal = (DotsView) findViewById(R.id.dv_horizontal);

        final List<View> viewList = generateViewList();

        PagerAdapter adapter = new PagerAdapter() {
            @Override
            public int getCount() {
                return viewList.size();
            }

            @Override
            public Object instantiateItem(ViewGroup container, int position) {
                container.addView(viewList.get(position));
                return viewList.get(position);
            }

            @Override
            public boolean isViewFromObject(View view, Object object) {
                return view == object;
            }

            @Override
            public void destroyItem(ViewGroup container, int position, Object object) {
                container.removeView(viewList.get(position));
            }
        };
        ViewPager.OnPageChangeListener listener = new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

            }

            @Override
            public void onPageSelected(int position) {
                dotsViewVertical.setCurrent(position);
                dotsViewHorizontal.setCurrent(position);
            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        };
        viewPager.setAdapter(adapter);
        viewPager.addOnPageChangeListener(listener);

        dotsViewHorizontal.setCount(adapter.getCount());
        dotsViewVertical.setCount(adapter.getCount());

        listener.onPageSelected(0);
    }

    private List<View> generateViewList() {
        List<View> viewList = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            TextView textView = new TextView(MainActivity.this);
            textView.setText("page" + i);
            textView.setTextSize(30);
            textView.setPadding(100, 100, 100, 100);
            viewList.add(textView);
        }
        return viewList;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>Authorization Server</title>

  <link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill.c7c6310f.js">
  <link rel="modulepreload" crossorigin href="/assets/base.026863a6.js">
  <link rel="stylesheet" href="/assets/index.0898a340.css">

Auth Server Application


text:
module Gitlab
  module Kubernetes
    class Node
      def initialize(cluster)
        @cluster = cluster
      end

      def all
        {
          nodes: metadata.presence,
          node_connection_error: nodes_from_cluster[:connection_error],
          metrics_connection_error: nodes_metrics_from_cluster[:connection_error]
        }.compact
      end

      private

      attr_reader :cluster

      def metadata
        nodes.map do |node|
          base_data(node).merge(node_metrics(node))
        end
      end

      def nodes_from_cluster
        @nodes_from_cluster ||= graceful_request { cluster.kubeclient.get_nodes }
      end

      def nodes_metrics_from_cluster
        @nodes_metrics_from_cluster ||= graceful_request { cluster.kubeclient.metrics_client.get_nodes }
      end

      def nodes
        @nodes ||= nodes_from_cluster[:response].to_a
      end

      def nodes_metrics
        @nodes_metrics ||= nodes_metrics_from_cluster[:response].to_a
      end

      def node_metrics_from_node(node)
        nodes_metrics.find do |node_metric|
          node_metric.metadata.name == node.metadata.name
        end
      end

      def graceful_request(&block)
        ::Gitlab::Kubernetes::KubeClient.graceful_request(cluster.id, &block)
      end

      def base_data(node)
        {
          'metadata' => {
            'name' => node.metadata.name
          },
          'status' => {
            'capacity' => {
              'cpu' => node.status.capacity.cpu,
              'memory' => node.status.capacity.memory
            },
            'allocatable' => {
              'cpu' => node.status.allocatable.cpu,
              'memory' => node.status.allocatable.memory
            }
          }
        }
      end

      def node_metrics(node)
        node_metrics = node_metrics_from_node(node)
        return {} unless node_metrics

        {
          'usage' => {
            'cpu' => node_metrics.usage.cpu,
            'memory' => node_metrics.usage.memory
          }
        }
      end
    end
  end
end


text:
Subscribe the given object to events.

#### Arguments

- subscriber (*Object*): object to subscribe

#### Returns

(*Function*): A function that unsubscribe the given subscriber. This is the equivalent of `unsubscribe(subscriber)`

#### Example

```js
// subscribe to 'newChatPartecipant' channel
// set priority to 90 (default 100)
const subscriber = {
  refractionLevel: 90,
  newChatPartecipant: (payload) => {
    const { username } = payload;
    alert(`Hi ${username}!`);
  },
};
const unsubscribe = refractionInstance.subscribe(subscriber);
unsubscribe(); // subscriber no longer available in Refraction
```


text:
<?php

namespace Vardius\Bundle\ListBundle\Paginator;

use Doctrine\ORM\QueryBuilder;
use Elastica\Query;
use Symfony\Bridge\Twig\TwigEngine;

/**
 * PaginatorInterface
 *
 * @author Rafał Lorenz <vardius@gmail.com>
 */
interface PaginatorInterface
{
    /**
     * Paginate the results
     *
     * @return mixed
     */
    public function paginate();

    /**
     * Renders view
     *
     * @return string
     */
    public function render():string;

    /**
     * Returns last page number
     *
     * @return float
     */
    public function getLastPage():float;

    /**
     * Returns current page number
     *
     * @return int
     */
    public function getCurrentPage():int;

    /**
     * Returns previous page number
     *
     * @return int
     */
    public function getPreviousPage():int;

    /**
     * Returns next page number
     *
     * @return float
     */
    public function getNextPage():float;

    /**
     * @return TwigEngine
     */
    public function getTemplating():TwigEngine;

    /**
     * @param TwigEngine $templating
     * @return PaginatorInterface
     */
    public function setTemplating(TwigEngine $templating):self;

    /**
     * @return string
     */
    public function getTemplatePath():string;

    /**
     * @param string $templatePath
     * @return PaginatorInterface
     */
    public function setTemplatePath(string $templatePath):self;
}


text:
external help file: Posh-SSH.psm1-Help.xml
Module Name: Posh-SSH
online version: https://github.com/darkoperator/Posh-SSH/tree/master/docs
schema: 2.0.0
---

# Remove-SFTPSession

## SYNOPSIS
Close and Remove a SFTP Session

## SYNTAX

### Index (Default)
```
Remove-SFTPSession [-SessionId] <Int32[]> [<CommonParameters>]
```

### Session
```
Remove-SFTPSession [[-SFTPSession] <SftpSession[]>] [<CommonParameters>]
```

## DESCRIPTION
Close and Remove a SFTP Session specified by Index or SFTP Session Object.

## EXAMPLES

### EXAMPLE 1
```
Remove-SFTPSession -SessionId 0 -Verbose
 VERBOSE: 0
 VERBOSE: Removing session 0
 True
 VERBOSE: Session 0 Removed
```

## PARAMETERS

### -SessionId
SFTP Session Id of an exiting session.

```yaml
Type: Int32[]
Parameter Sets: Index
Aliases: Index

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -SFTPSession
SFTP Session Object of an exiting session.

```yaml
Type: SftpSession[]
Parameter Sets: Session
Aliases: Session

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### System.Int32[]
### SSH.SftpSession[]
## OUTPUTS

## NOTES

## RELATED LINKS


text:
package net.ripe.db.whois.common.rpsl.attrs;

public class AttributeParseException extends IllegalArgumentException {
    public AttributeParseException(final String message, final String value) {
        super(message + " (" + value + ")");
    }
}


text:
package BoulderDash.Modele.Animation;

/**
 * Enumération des états du personnage
 *
 * @author 4r3
 */
public enum Etats
{
	MarcheHaut,
	MarcheBas,
	MarcheGauche,
	MarcheDroite,
	StopHaut,
	StopBas,
	StopGauche,
	StopDroite,
	StopIdle,
	Mort;
}


text:
Emmaus House Food Pantry Inventory Management
=============================================

Food Pantry inventory management program for Emmaus House Episcopal Church.

Designed for use with modern USB barcode scanners.

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

Simply download the program to your desktop and double-click.

`Click here <https://github.com/downloads/grantjenks/emmaus_house_food_pantry/pantry.exe>`_ to download the latest version of the program.

Development
-----------

Building
........

::

    python setup.py --help
    usage: setup.py [-h] [-c] [-p] [-b]

    Emmaus House Food Pantry Setup

    optional arguments:
      -h, --help   show this help message and exit
      -c, --clean  Clean all built files.
      -p, --pack   Pack app files into archive.
      -b, --build  Build executable.

Webapp Testing
..............

::

    python webapp.py --package food_pantry.zip


text:
layout: page
title: CV
title_head: Curriculum Vitae
permalink: /CV/
---
Tara N. Furstenau, Ph.D.
============

[<i class="glyphicon glyphicon-download-alt" style="color:myblue"></i> Download PDF Version]({{ "/assets/TaraFurstenauCV.pdf" | absolute_url }})

| Contact Information |                   |
|-----------|-----------------------------|
| Email     | [tara.furstenau@nau.edu](mailto:tara.furstenau@nau.edu)      |
| Website   | [tfursten.github.io](http://tfursten.github.io)          |
| Github    | [github.com/tfursten](https://github.com/tfursten)         |
| Bitbucket | [bitbucket.org/TaraFurstenau](https://bitbucket.org/TaraFurstenau) |

Research Experience
----------
2018-Present
:   **Assistant Research Professor**
The School of Informatics, Computing, and Cyber Systems
Northern Arizona University · Flagstaff, AZ

2016-2017
:   **Postdoctoral Scholar** in Viacheslav Fofanov's lab
The School of Informatics, Computing, and Cyber Systems
Northern Arizona University · Flagstaff, AZ

2013-2016
:   **Graduate Student** in Reed A. Cartwright's lab
Center for Human and Comparative Genomics · The Biodesign Institute
Arizona State University · Tempe, AZ

2010–2013
:   **Research Associate** in Roberto Gaxiola's lab
School of Life Sciences · Arizona State University · Tempe, AZ

2009–2010
:   **Undergraduate Student Researcher** in Lei Lei's lab
School of Life Sciences · Arizona State University · Tempe, AZ

Education
---------

2010-2016
:   **PhD, Molecular and Cellular Biology** · Arizona State University · Tempe, AZ
    Advisor: Reed A. Cartwright

    Dissertation title: *Spatial Genetic Structure under Limited Dispersal: Theory, Methods and Consequences of Isolation-by-Distance*

2008-2010
:   **BSc, Bioinformatics and Genomics** · Arizona State University · Tempe, AZ

    Dean's List · *magna cum laude*

Publications
--------------------
Hepp, CM, Cocking, JH, Valentine, M, Young, SJ, Damian, D, Sheridan-Crow, K, Fofanov, VY, **Furstenau, TN**, Busch JD, Erickson DE, Lancione, RC, Smith, K. Will, J, Townsend, J, Keim, PS, Engelthaler, DM. Phylogenetic analysis of West Nile Virus in Maricopa County, Arizona: Evidence of endemic and ephemeral circulation of strains in two major lineages.  *PLOS ONE*. 13(11): e0205801. [doi:10.1371/journal.pone.0205801](https://doi.org/10.1371/journal.pone.0205801)

**Furstenau, TN**, Cocking, J, Sahl, JW, and VY Fofanov. (2018). Variant site strain typer (VaST): Efficient strain typing using a minimal number of variant genomic sites. *BMC Bioinformatics*. 19:222:1-13. [doi:10.1186/s12859-018-2225-z](https://doi.org/10.1186/s12859-018-2225-z)

Fofanov, VY*, **Furstenau, TN***, Sanchez D, Hepp, C, Cocking, J, Sobek, C, Pagel, N, Walker, F, and CL Chambers. (2018). Guano exposed: Impact of aerobic conditions on bat fecal microbiota. *Ecology and Evolution*. 00:1-12. [doi:10.1002/ece3.4084](https://doi.org/10.1002/ece3.4084) (Cover Article)

**Furstenau, TN**, and RA Cartwright. (2017) The impact of self-incompatibility systems on the prevention of biparental inbreeding. *PeerJ* 5:e4085 [doi:10.7717/peerj.4085](https://doi.org/10.7717/peerj.4085)

**Furstenau, TN**, and RA Cartwright (2016). The effect of the dispersal kernel on isolation-by-distance in a continuous population. *PeerJ* 4:e1848. [doi:10.7717/peerj.1848](https://doi.org/10.7717/peerj.1848)

Pizzio GA, Paez-Valencia J, Khadilkar AS, Regmi K, Patron-Soberano A, Zhang S, Sanchez-Lares J, **Furstenau T**, Li J, Sanchez-Gomez C, Valencia-Mayoral P, Yadav UP, Ayre BG, and RA Gaxiola (2015). *Arabidopsis* proton-pumping pyrophosphatase AVP1 expresses strongly in phloem where it is required for PPi metabolism and photosynthate partitioning. *Plant Physiology* 167:1541-1553. [doi:10.1104/pp.114.254342](http://dx.doi.org/10.1104/pp.114.254342)

Scientific Software
---------------------

| Name    | Description                                                                                | Language |                  Repository                  |
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:|:--------------------------------------------:|
| MTSv    | Metagenomic binning and analysis tool  | Python/Rust  |  [Github](https://github.com/FofanovLab/MTSv) [Conda](https://anaconda.org/Tara_Furstenau/mtsv) |
| VaST    | **Va**riant Site **S**train **T**yper: An algorithm which finds the minimum number of variant genomic sites for strain differentiation.                                                                                |  Python  | [Github](https://github.com/FofanovLab/VaST) |
| NbMCMC  | Bayesian inference of neighborhood size using composite marginal likelihoods                                                                                |  Python  | [Github](https://github.com/tfursten/nbmcmc) |
| SI-Sim  | Self-Incompatibility Simulation:    A spatially explicit individual-based model of a diploid plant population that reproduces according   to five different models of self-incompatibility. |    C++   | [Github](https://github.com/tfursten/SI-cpp) |
| IBD-Sim | Isolation-by-distance simulation:   A spatially explicit individual-based   simulation to model dispersal on a    lattice using different dispersal distribution   functions.               |    C++   |   [Github](https://github.com/tfursten/IBD)  |

Presentations
---------------------
### Talks

May 2017
:   **Strain-level pathogen identification using targeted PCR amplicon sequencing**
The Biodefense and Disease Ecology Center Meeting
The Pathogen and Microbiome Institute · Flagstaff, AZ

December 2015
:   **Spatial genetic structure under limited dispersal**
Job Talk
Informatics and Computing Program · Flagstaff, AZ

September 2015
:   **Bayesian estimation of neighborhood size using composite marginal likelihoods**
Molecular and Cellular Biology Colloquium
The Biodesign Institute · Tempe, AZ

July 2015
:   **Bayesian estimation of neighborhood size using composite marginal likelihoods**
Society for Molecular Biology and Evolution Meeting
Hofburg Imperial Palace · Vienna, Austria

September 2014
:   **Evolution of Self-Incompatibility: Investigating the role of self-incompatibility systems in the prevention of biparental inbreeding**
Molecular and Cellular Biology Colloquium
The Biodesign Institute · Tempe, AZ

October 2013
:   **Evolution of Self-Incompatibility: Investigating the role of self-incompatibility systems in the prevention of biparental inbreeding**
Molecular and Cellular Biology Colloquium
The School of Life Sciences · Arizona State University · Tempe, AZ

March 2012
:   **The roll of the H+-pyrophosphatase in the regulation of sucrose transport in plants**
Molecular and Cellular Biology Colloquium
The School of Life Sciences · Arizona State University · Tempe, AZ

### Posters
June 2018
: **Strain level characterization of select pathogens from complex shotgun metagenomic sequence data.**
American Society for Microbiology Microbe
Atlanta, GA

June 2018
: **Efficient bacterial strain typing using highly multiplexed amplicon sequencing panels**
American Society for Microbiology Microbe
Atlanta, GA

April 2018
: **Tracing lineages of *Staphylococcus aureus* using minority variant approaches**
Arizona/Southern Nevada Chapter of the American Society for Microbiology Annual Meeting
Las Vegas, NV
(Presented by Undergraduate Mentee, Ryan Lancione)

April 2018
: **Tracing lineages of *Staphylococcus aureus* using minority variant approaches**
College of Engineering, Forestry, and Natural Sciences Undergraduate Research and Design Symposium
Flagstaff, AZ
(Presented by Undergraduate Mentee, Ryan Lancione)

April 2018
:   **Culturing and Sequencing Causative Agents of Early Childhood Caries**
College of Engineering, Forestry, and Natural Sciences Undergraduate Research and Design Symposium
Flagstaff, AZ
(Presented by Undergraduate Mentee, Daryn Erickson)

June 2017
:   **Effects of Exposure on Bat Guano Microbiome**
Microbiome Bioinformatics with QIIME 2 Workshop
Las Vegas, NV

June 2017
:   **Preemptive establishment of baseline bat microbiome diversity before White-Nose Syndrome strikes the Southwest**
Microbiome Bioinformatics with QIIME 2 Workshop
Las Vegas, NV
(Presented by Graduate Student Mentee, Nicole Pagel)

June 2014
:   **The effect of the dispersal distribution on isolation-by-distance in a continuous population**
Society for the Study of Evolution Meeting
Raleigh, NC

March 2014
:   **Characterization of Transgenic *Arabidopsis thaliana* overexpressing *AVP1* and *PLAFP***
Arizona State University Undergraduate Research Poster Symposium
The School of Life Sciences · Arizona State University · Tempe, AZ
(Presented by Undergraduate Student Mentee, Sean Wilson)

Aug 2012
:   **H+-PPase AVP1 is necessary for phloem development in *Arabidopsis thaliana***
Molecular and Cellular Biology Graduate Student Retreat
The School of Life Sciences · Arizona State University · Tempe, AZ

July 2012
:   **H+-PPase AVP1 is necessary for phloem development in *Arabidopsis thaliana***
American Society of Plant Biologists Annual Meeting
Austin, TX

Teaching Experience
----------------------

### Courses
#### Arizona State University

Fall 2014
:   **BIO340** General Genetics
Head Teaching Associate

Spring 2014
:   **BIO355** Introduction to Computational Molecular Biology
Innovative Teaching Associate

Fall 2013
:   **PLB108** Concepts in Plant Biology iCourse
Instructor/Developer

Spring 2013
:   **BIO340** General Genetics
Teaching Associate

Fall 2012
:   **BIO340** General Genetics
Teaching Associate

Spring 2012
:   **BIO340** General Genetics
Teaching Associate

Fall 2011
:   **BIO340** General Genetics
Teaching Associate

Summer 2011
:   **BIO181** General Biology I Laboratory
Teaching Associate

Spring 2011
:   **BIO182** General Biology II Laboratory
Teaching Associate

Fall 2010
:   **MBB343** Genetic Engineering and Society Laboratory
Teaching Associate

#### Northern Arizona University

Spring 2017
:   **INF503** Large-Scale Data Structures and Organization
2 Guest Lectures

### Workshops
May 2016
:   **Software Carpentry**
Instructor
Biodesign Institute · Arizona State University · Tempe, AZ

June 2015
:   **Software Carpentry**
Helper
Wrigley Institute of Sustainability · Arizona State University · Tempe, AZ

### Mentoring
2018
:   **Honor's Thesis Committee Member**
Shelby Prestwich
Thesis: A Review of the Human Vermiform Appendix and its Proposed Function

2011-2013
:   **Honor's Thesis**
Sean Wilson
Thesis: Characterization of Transgenic *Arabidopsis thaliana* Overexpressing a Type I H+-Pyrophosphatase and the Phloem Lipid-Associated Family Protein.

Service and Outreach
---------------------
- Software Carpentry Certified Instructor
- ASU's Night of the Open Door Volunteer
- Ask-A-Biologist Volunteer Corespondent
- Green Labs Initiative Coordinator and Promoter
- Phosphorus Sustainability Research Coordination Network Core Participant
- Obama Scholars Mentor

Professional Development
--------------------------
April 2018
:   **AnacondaCon**
Anaconda, Inc. · Austin, TX

June 2017
:   **Microbiome Bioinformatics with QIIME 2 Workshop**
QIIME Development Team · Las Vegas, NV

July 2013
:   **Next Generation Population Genomics for Non-model Taxa Workshop**
American Genetics Association · Cornell University · Ithica, NY

Dec 2011
:   **Univector Plasmid-Fusion System Training**
Childrens Nutritional Research Center · Baylor College of Medicine · Houston, TX


text:
require 'bigdecimal'

describe :bigdecimal_clone, shared: true do
  before :each do
    @obj = BigDecimal("1.2345")
  end

  it "returns self" do
    copy = @obj.public_send(@method)

    copy.should equal(@obj)
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="20dp" >

    <TextView
        android:id="@+id/addsocial_connect_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:text="@string/connect_with_your_friends"
        android:textColor="@color/text"
        android:textSize="18sp"
        android:gravity="center" />

    <LinearLayout
        android:id="@+id/addsocial_twitter"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/addsocial_connect_text"
        android:layout_gravity="center_vertical"
        android:layout_margin="20dp"
        android:background="@drawable/twitter_background"
        android:orientation="horizontal"
        android:padding="5dp" >

        <ImageView
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_marginRight="15dp"
            android:scaleType="centerInside"
            android:src="@drawable/twitter_logo" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:text="@string/twitter"
            android:id="@+id/addsocial_twitter_text"
            android:textColor="@color/white"
            android:textSize="16sp" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/addsocial_facebook"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/addsocial_twitter"
        android:layout_gravity="center_vertical"
        android:layout_margin="20dp"
        android:background="@drawable/facebook_background"
        android:orientation="horizontal"
        android:padding="5dp" >

        <ImageView
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_marginRight="15dp"
            android:scaleType="centerInside"
            android:src="@drawable/facebook_logo" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:text="@string/facebook"
            android:id="@+id/addsocial_facebook_text"
            android:textColor="@color/white"
            android:textSize="16sp" />
    </LinearLayout>

    <TextView
        android:id="@+id/addsocial_autofollow_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/addsocial_facebook"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="30dp"
        android:textSize="16sp"
        android:text="@string/auto_follow_friends"
        android:textColor="@color/text" />

    <CheckBox
        android:id="@+id/addsocial_autofollow_checkbox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="true"
        android:layout_below="@id/addsocial_facebook"
        android:layout_alignBaseline="@id/addsocial_autofollow_text"
        android:layout_toRightOf="@id/addsocial_autofollow_text" />

</RelativeLayout>


text:
package org.apache.spark.deploy.master

import java.util.Date

import org.apache.spark.deploy.DriverDescription
import org.apache.spark.resource.ResourceInformation
import org.apache.spark.util.Utils

private[deploy] class DriverInfo(
    val startTime: Long,
    val id: String,
    val desc: DriverDescription,
    val submitDate: Date)
  extends Serializable {

  @transient var state: DriverState.Value = DriverState.SUBMITTED
  /* If we fail when launching the driver, the exception is stored here. */
  @transient var exception: Option[Exception] = None
  /* Most recent worker assigned to this driver */
  @transient var worker: Option[WorkerInfo] = None
  // resources(e.f. gpu/fpga) allocated to this driver
  // map from resource name to ResourceInformation
  private var _resources: Map[String, ResourceInformation] = _

  init()

  private def readObject(in: java.io.ObjectInputStream): Unit = Utils.tryOrIOException {
    in.defaultReadObject()
    init()
  }

  private def init(): Unit = {
    state = DriverState.SUBMITTED
    worker = None
    exception = None
  }

  def withResources(r: Map[String, ResourceInformation]): Unit = _resources = r

  def resources: Map[String, ResourceInformation] = _resources
}


text:
package blended.security.akka.http

import akka.http.scaladsl.model.headers.{BasicHttpCredentials, HttpChallenges, HttpCredentials}
import akka.http.scaladsl.server.Directive0
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.directives.{AuthenticationDirective, AuthenticationResult}
import blended.security.SubjectImplicits._
import blended.security.{BlendedPermission, BlendedPermissionManager}
import blended.util.logging.Logger
import javax.security.auth.Subject
import javax.security.auth.callback._
import javax.security.auth.login.LoginContext

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

/**
 * JAAS Based BlendedSecurityDirectives.
 *
 */
trait JAASSecurityDirectives extends BlendedSecurityDirectives {

  val mgr : BlendedPermissionManager

  private[this] lazy val log = Logger[JAASSecurityDirectives]

  private[this] val challenge = HttpChallenges.basic("blended")

  private[this] def auth(creds : BasicHttpCredentials) : Option[Subject] = {

    val cbHandler = new CallbackHandler {
      override def handle(callbacks : Array[Callback]) : Unit = {
        callbacks.foreach { cb : Callback =>
          cb match {
            case nameCallback : NameCallback    => nameCallback.setName(creds.username)
            case pwdCallback : PasswordCallback => pwdCallback.setPassword(creds.password.toCharArray())
            case other                          => throw new UnsupportedCallbackException(other, "The submitted callback is not supported")
          }
        }
      }
    }

    val lc : LoginContext = new LoginContext("blended", cbHandler)

    try {
      lc.login()
      Some(lc.getSubject())
    } catch {
      case t : Throwable =>
        log.error(t)(s"Login failed for [${creds.username}]")
        None
    }
  }

  private[this] def myUserPassAuthenticator(credentials : Option[HttpCredentials]) : Future[AuthenticationResult[Subject]] =
    Future {
      credentials match {
        case Some(creds : BasicHttpCredentials) => auth(creds) match {
          case Some(s) => AuthenticationResult.success(s)
          case None    => AuthenticationResult.failWithChallenge(challenge)
        }
        case _ => AuthenticationResult.failWithChallenge(challenge)
      }
    }

  override val authenticated : AuthenticationDirective[Subject] = authenticateOrRejectWithChallenge(myUserPassAuthenticator _)

  override def requirePermission(permission : BlendedPermission) : Directive0 = mapInnerRoute { inner =>
    authenticated { subject =>
      log.info(s"subject: ${subject} with principal: ${Option(subject).map(_.getPrincipal()).getOrElse("null")}")
      log.debug(s"checking required permission: ${permission}")
      authorize(subject.isPermitted(mgr, permission)) {
        log.info(s"subject/principal: ${Option(subject).map(_.getPrincipal()).getOrElse(subject)} has required permissions: ${permission}")
        inner
      }
    }
  }

  override def requireGroup(group : String) : Directive0 = mapInnerRoute { inner =>
    authenticated { subject =>
      log.info(s"subject: ${subject} with principal: ${Option(subject).map(_.getPrincipal()).getOrElse("null")}")
      log.debug(s"checking required group: ${group}")
      authorize(subject.getGroups().contains(group)) {
        log.info(s"subject/principal: ${Option(subject).map(_.getPrincipal()).getOrElse(subject)} has required group: ${group}")
        inner
      }
    }
  }
}


text:
author: slowe
comments: true
date: 2008-08-19 14:18:47+00:00
layout: post
slug: my-vmworld-2008-schedule
title: My VMworld 2008 Schedule
wordpress_id: 831
categories: Information
tags:
- Virtualization
- VMware
- VMworld2008
---

For those that are interested, here's my VMworld 2008 schedule as it currently stands:

## Tuesday, September 16, 2008

9:30 AM to 10:30 AM - BC2621 - Fault Tolerant VMs in VMware Infrastructure: Operation and Best Practices

1:00 PM to 2:00 PM - TA2668 - VMware ESX Architectural Directions

2:30 PM to 3:30 PM - BC1693 - Architecting DR Solutions with VMware Site Recovery Manager

4:30 PM to 5:30 PM - PO1694 - Datacenter Migrations Using VMware Site Recovery Manager

## Wednesday, September 17, 2008

11:00 AM to 12:00 PM - VD2422 - Offline VDI

1:30 PM to 2:30 PM - TA2659 - Managing ESX in a COS-less world

3:00 PM to 4:00 PM - TA2275 - Tech Preview: VMware Infrastructure Virtual Networking - Future Directions

4:00 PM to 5:00 PM - BC2215 - Top Tips for VMware Consolidated Backup

## Thursday, September 18, 2008

11:00 AM to 12:00 PM - TA2441 - VMware Infrastructure 3.5 - Networking Concepts and Best Practices

1:00 PM to 2:00 PM - PO1644 - VMware Update Manager Performance, Best Practices

2:30 PM to 3:30 PM - PO2061 - VMware VirtualCenter 2.5 Database Best Practices

4:00 PM to 5:00 PM - BC2214 - Advanced HA Troubleshooting

As you can see, there are some gaps in the schedule. First, I've specifically blocked off time to go to the vendor pavilion and talk to some vendors about their products. This is something that I always say I'll get around to doing, but never actually make it. This year I decided to fix that by scheduling time specifically for that. Second, I'm working with [SearchVMware.com](http://searchvmware.techtarget.com/) again this year on some stuff, so there's time set aside for that. Finally, my boss has scheduled some meetings with various people while I'm there, so I had to set aside time for that as well.

If you're interested in catching up with me this year, shoot me an e-mail and let me know. I'll do my best to meet with you while I'm there. In addition, I'm getting in early before the conference and not leaving until the Friday afternoon, so I might be able to meet with someone outside the conference days themselves.

If you're attending and have a session suggestion for me, feel free to shout out in the comments below. Thanks!


text:
package net.runelite.mixins;

import net.runelite.api.events.RemovedFriend;
import net.runelite.api.mixins.Inject;
import net.runelite.api.mixins.MethodHook;
import net.runelite.api.mixins.Mixin;
import net.runelite.api.mixins.Shadow;
import net.runelite.rs.api.RSClient;
import net.runelite.rs.api.RSFriendManager;

@Mixin(RSFriendManager.class)
public abstract class RSFriendManagerMixin implements RSFriendManager
{
	@Shadow("clientInstance")
	private static RSClient client;

	@MethodHook("removeFriend")
	@Inject
	public void rl$removeFriend(String friendName)
	{
		RemovedFriend removedFriend = new RemovedFriend(friendName);
		client.getCallbacks().post(removedFriend);
	}
}


text:
package org.terracotta.management.integration.tests;

import com.terracotta.diagnostic.Diagnostics;
import org.hamcrest.core.StringContains;
import org.junit.Assert;
import org.junit.Test;
import org.terracotta.connection.Connection;
import org.terracotta.connection.ConnectionFactory;
import org.terracotta.connection.ConnectionPropertyNames;
import org.terracotta.connection.entity.EntityRef;

import java.net.URI;
import java.util.Properties;

import static org.hamcrest.core.StringContains.containsString;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

/**
 * @author Mathieu Carbou
 */
public class DiagnosticIT extends AbstractSingleTest {

  private static final String PROP_REQUEST_TIMEOUT = "request.timeout";
  private static final String PROP_REQUEST_TIMEOUTMESSAGE = "request.timeoutMessage";

  @Test
  public void cluster_state_dump() throws Exception {
    put(0, "pets", "pet1", "Cubitus");

    Properties properties = new Properties();
    properties.setProperty(ConnectionPropertyNames.CONNECTION_TIMEOUT, String.valueOf("5000"));
    properties.setProperty(ConnectionPropertyNames.CONNECTION_NAME, "diagnostic");
    properties.setProperty(PROP_REQUEST_TIMEOUT, "5000");
    properties.setProperty(PROP_REQUEST_TIMEOUTMESSAGE, "5000");
    URI uri = URI.create("diagnostic://" + voltron.getConnectionURI().getAuthority());
    try (Connection connection = ConnectionFactory.connect(uri, properties)) {
      EntityRef<Diagnostics, Object, Void> ref = connection.getEntityRef(Diagnostics.class, 1, "root");
      Diagnostics diagnostics = ref.fetchEntity(null);

      //TODO: improve these assertions
      // once https://github.com/Terracotta-OSS/terracotta-core/issues/613 and https://github.com/Terracotta-OSS/terracotta-core/pull/601 will be fixed
      // and once the state dump format will be improved.
      String dump = diagnostics.getClusterState();

      // monitoring service provider
      assertThat(dump, containsString("cluster="));

      // ActiveNmsServerEntity / PassiveNmsServerEntity
      assertThat(dump, containsString("consumerId="));
      assertThat(dump, containsString("stripeName="));

      // OffHeapResourcesProvider
      assertThat(dump, containsString("capacity="));
      assertThat(dump, containsString("available="));

      // ActiveCacheServerEntity / ActiveCacheServerEntity
      assertThat(dump, containsString("cacheName="));
      assertThat(dump, containsString("cacheSize="));

      // MapProvider
      assertThat(dump, containsString("caches="));

      // Common on all active entities
      assertThat(dump, containsString("instance="));
      assertThat(dump, containsString("clientCount="));
      assertThat(dump, containsString("clients="));
    }
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="com.ibm.commons.Extension">
      <service
            class="com.gregorbyte.xsp.resources.GregorbyteResourceProvider"
            type="com.ibm.xsp.GlobalResourceProvider">
      </service>
   </extension>
   <extension
         point="com.ibm.commons.Extension">
      <service
            class="com.gregorbyte.xsp.library.GregorbyteXspLibrary"
            type="com.ibm.xsp.Library">
      </service>
   </extension>
   <extension
         point="com.ibm.commons.Extension">
      <service
            class="com.gregorbyte.xsp.minifier.GregorbyteLoader"
            type="com.ibm.xsp.minifier.loader">
      </service>
   </extension>
   <extension
         point="com.ibm.commons.Extension">
      <service
            class="com.gregorbyte.xsp.resources.GregorbyteModulePath"
            type="com.ibm.xsp.resource.DojoModulePathResource">
      </service>
   </extension>

</plugin>


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Collections;
using System.Collections.Generic;

namespace System
{
    public partial struct Span<T>
    {
        public Enumerator GetEnumerator()
        {
            return new Enumerator(this);
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return new EnumeratorObject(this);
        }

        IEnumerator<T> IEnumerable<T>.GetEnumerator()
        {
            return new EnumeratorObject(this);
        }

        /// <summary>
        /// A struct-based enumerator, to make fast enumerations possible.
        /// This isn't designed for direct use, instead see GetEnumerator.
        /// </summary>
        public struct Enumerator
        {
            private readonly object _object;
            private readonly UIntPtr _offset;
            private readonly int _length;
            private int _position;

            internal Enumerator(Span<T> span)
            {
                _object = span.Object;
                _offset = span.Offset;
                _length = span.Length;
                _position = -1;
            }

            public T Current
            {
                get
                {
                    Contract.RequiresInRange(_position, (uint)_length);
                    return PtrUtils.Get<T>(_object, _offset, (UIntPtr)_position);
                }
            }

            public bool MoveNext()
            {
                return ++_position < _length;
            }

            public void Reset()
            {
                _position = -1;
            }
        }

        /// <summary>
        /// enumerator that implements <see cref="IEnumerator{T}"/> pattern (including <see cref="IDisposable"/>).
        /// it is used by LINQ and foreach when Slice is accessed via <see cref="IEnumerable{T}"/>
        /// it is reference type to avoid boxing when calling interface methods on stuctures
        /// </summary>
        private class EnumeratorObject : IEnumerator<T>
        {
            Span<T> _span;    // The slice being enumerated.
            int _position; // The current position.

            public EnumeratorObject(Span<T> span)
            {
                _span = span;
                _position = -1;
            }

            public T Current
            {
                get { return _span[_position]; }
            }

            object IEnumerator.Current
            {
                get { return Current; }
            }

            public void Dispose()
            {
                _span = default(Span<T>);
                _position = -1;
            }

            public bool MoveNext()
            {
                return ++_position < _span.Length;
            }

            public void Reset()
            {
                _position = -1;
            }
        }
    }
}


text:
<?php

namespace Everon\Event\Interfaces\Dependency;

use Everon\Event\Interfaces;

interface EventManager
{
    /**
     * @return Interfaces\Manager
     */
    function getEventManager();

    /**
     * @param Interfaces\Manager $EventManager
     * @return void
     */
    function setEventManager(Interfaces\Manager $EventManager);
}


text:
package com.InfinityRaider.AgriCraft.compatibility.bloodmagic;

import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
import com.InfinityRaider.AgriCraft.blocks.BlockCrop;
import com.InfinityRaider.AgriCraft.reference.Names;
import cpw.mods.fml.common.Optional;
import net.minecraft.block.Block;
import net.minecraft.world.World;

@Optional.Interface(modid = Names.Mods.bloodMagic, iface = "WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler")
public class HarvestHandler implements IHarvestHandler {
    @Override
    public boolean harvestAndPlant(World world, int x, int y, int z, Block block, int meta) {
        if(!(block instanceof BlockCrop)) {
            return false;
        }
        if(meta<7) {
            return false;
        }
        ((BlockCrop) block).harvest(world, x, y, z, null, null);
        return true;
    }
}


text:
<?php

namespace Phlexible\Component\MediaTemplate\Model;

/**
 * Video template.
 *
 * @author Stephan Wentz <sw@brainbits.net>
 */
class VideoTemplate extends AbstractTemplate
{
    const TYPE_VIDEO = 'video';

    /**
     * Constructor.
     */
    public function __construct()
    {
        $this->setType(self::TYPE_VIDEO);
    }

    /**
     * {@inheritdoc}
     */
    public function getManaged()
    {
        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function getDefaultParameters()
    {
        return [
            'match_format' => 0,
            'for_web' => 0,
            'format' => 'flv',
            'deinterlace' => 'flv',
            'video_width' => 0,
            'video_height' => 0,
            'video_format' => 'flv',
            'video_bitrate' => 0,
            'video_framerate' => 0,
            'audio_format' => 'mp3',
            'audio_bitrate' => 0,
            'audio_samplerate' => 0,
            'audio_samplebits' => 0,
            'audio_channels' => 0,
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function getAllowedParameters()
    {
        return [
            'match_format',
            'for_web',
            'format',
            'deinterlace',
            'video_width',
            'video_height',
            'video_format',
            'video_bitrate',
            'video_framerate',
            'audio_format',
            'audio_bitrate',
            'audio_samplerate',
            'audio_samplebits',
            'audio_channels',
        ];
    }

    /**
     * Set width.
     *
     * @param int $width
     *
     * @return $this
     */
    public function setWidth($width)
    {
        return $this->setParameter('video_width', $width);
    }

    /**
     * Return width.
     *
     * @return int
     */
    public function getWidth()
    {
        return $this->getParameter('video_width');
    }

    /**
     * Set height.
     *
     * @param int $height
     *
     * @return $this
     */
    public function setHeight($height)
    {
        return $this->setParameters('video_height', $height);
    }

    /**
     * Return height.
     *
     * @return int
     */
    public function getHeight()
    {
        return $this->getParameter('video_height');
    }
}


text:
package hudson.security;

import org.springframework.security.Authentication;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.acls.sid.PrincipalSid;
import org.springframework.security.acls.sid.GrantedAuthoritySid;
import org.springframework.security.acls.sid.Sid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * {@link ACL} that checks permissions based on {@link GrantedAuthority} of the
 * {@link Authentication}.
 *
 * @author Kohsuke Kawaguchi
 */
public abstract class SidACL extends ACL {

    private transient Logger logger = LoggerFactory.getLogger(SidACL.class);

    @Override
    public boolean hasPermission(Authentication a, Permission permission) {
        if (a == SYSTEM) {
            logger.debug("hasPermission(" + a + "," + permission + ")=>SYSTEM user has full access");
            return true;
        }
        Boolean b = _hasPermission(a, permission);

        logger.debug("hasPermission(" + a + "," + permission + ")=>" + (b == null ? "null, thus false" : b));

        if (b == null) {
            b = false;    // default to rejection
        }
        return b;
    }

    /**
     * Implementation that backs up
     * {@link #hasPermission(Authentication, Permission)}.
     *
     * @return true or false if {@link #hasPermission(Sid, Permission)} returns
     * it. Otherwise null, indicating that this ACL doesn't have any entry for
     * it.
     */
    protected Boolean _hasPermission(Authentication a, Permission permission) {
        // ACL entries for this principal takes precedence
        logger.debug("Checking if principal " + a.getName() + " has " + permission);
        Boolean b = hasPermission(new PrincipalSid(a), permission);
        if (b != null) {
            logger.debug("hasPermission(PrincipalSID:" + a.getPrincipal() + "," + permission + ")=>" + b);
            return b;
        }

        // after that, we check if the groups this principal belongs to
        // has any ACL entries.
        // here we are using GrantedAuthority as a group
        for (GrantedAuthority ga : a.getAuthorities()) {
            logger.debug("Checking if principal's role " + ga.getAuthority() + " has " + permission);
            b = hasPermission(new GrantedAuthoritySid(ga), permission);
            if (b != null) {
                logger.debug("hasPermission(GroupSID:" + ga.getAuthority() + "," + permission + ")=>" + b);
                return b;
            }
        }

        // permissions granted to 'everyone' and 'anonymous' users are granted to everyone
        for (Sid sid : AUTOMATIC_SIDS) {
            b = hasPermission(sid, permission);
            if (b != null) {
                logger.debug("hasPermission(" + sid + "," + permission + ")=>" + b);
                return b;
            }
        }

        return null;
    }

    /**
     * Checks if the given {@link Sid} has the given {@link Permission}.
     *
     * <p> {@link #hasPermission(Authentication, Permission)} is implemented by
     * checking authentication's {@link GrantedAuthority} by using this method.
     *
     * <p> It is the implementor's responsibility to recognize
     * {@link Permission#impliedBy} and take that into account.
     *
     * @return true if the access should be granted, false if it should be
     * denied. The null value indicates that the ACL does no rule for this
     * Sid/Permission combination. The caller can decide what to do &mash; such
     * as consulting the higher level ACL, or denying the access (if the model
     * is no-access-by-default.)
     */
    protected abstract Boolean hasPermission(Sid p, Permission permission);

    protected String toString(Sid p) {
        if (p instanceof GrantedAuthoritySid) {
            return ((GrantedAuthoritySid) p).getGrantedAuthority();
        }
        if (p instanceof PrincipalSid) {
            return ((PrincipalSid) p).getPrincipal();
        }
        if (p == EVERYONE) {
            return "role_everyone";
        }
        // hmm...
        return p.toString();
    }

    /**
     * Creates a new {@link SidACL} that first consults 'this' {@link SidACL}
     * and then delegate to the given parent {@link SidACL}. By doing this at
     * the {@link SidACL} level and not at the {@link ACL} level, this allows
     * the child ACLs to have an explicit deny entry. Note that the combined ACL
     * calls hasPermission(Sid,Permission) in the child and parent SidACLs
     * directly, so if these override _hasPermission then this custom behavior
     * will not be applied.
     */
    public final SidACL newInheritingACL(final SidACL parent) {
        final SidACL child = this;
        return new SidACL() {
            protected Boolean hasPermission(Sid p, Permission permission) {
                Boolean b = child.hasPermission(p, permission);
                if (b != null) {
                    return b;
                }
                return parent.hasPermission(p, permission);
            }
        };
    }
}


text:
package net.sf.cglib.transform;

import junit.framework.*;
import net.sf.cglib.core.CodeGenerationException;

/**
 * @author baliuka
 * $Id: AbstractTransformTest.java,v 1.8 2004-06-24 21:15:16 herbyderby Exp $
 */
abstract public class AbstractTransformTest extends TestCase {

     /** Creates a new instance of AbstractTransformTest */
    public AbstractTransformTest() {
        super(null);
    }

    /** Creates a new instance of AbstractTransformTest */
    public AbstractTransformTest(String s) {
       super(s);
    }

    protected abstract ClassTransformerFactory getTransformer() throws Exception;

    public Class transform() throws Exception {
        ClassLoader loader =
            new TransformingClassLoader(AbstractTransformTest.class.getClassLoader(),
                                        new ClassFilter(){
                                            public boolean accept(String name){
                                                return !(name.startsWith("java")
                                                         || name.startsWith("junit")
                                                         || name.endsWith("Exclude"));
                                            }
                                        },
                                        getTransformer());
        try {
            return loader.loadClass(getClass().getName());
        } catch (Exception e) {
            e.printStackTrace(System.err);
            throw e;
        }
    }

    protected void postProcess(Class c) {
    }
}


text:
namespace Microsoft.Graph
{
    using System;
    using System.Collections.Generic;
    using System.IO;

    /// <summary>
    /// The type ConversationThreadRequestBuilder.
    /// </summary>
    public partial class ConversationThreadRequestBuilder : EntityRequestBuilder, IConversationThreadRequestBuilder
    {

        /// <summary>
        /// Constructs a new ConversationThreadRequestBuilder.
        /// </summary>
        /// <param name="requestUrl">The URL for the built request.</param>
        /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
        public ConversationThreadRequestBuilder(
            string requestUrl,
            IBaseClient client)
            : base(requestUrl, client)
        {
        }

        /// <summary>
        /// Builds the request.
        /// </summary>
        /// <returns>The built request.</returns>
        public new IConversationThreadRequest Request()
        {
            return this.Request(null);
        }

        /// <summary>
        /// Builds the request.
        /// </summary>
        /// <param name="options">The query and header options for the request.</param>
        /// <returns>The built request.</returns>
        public new IConversationThreadRequest Request(IEnumerable<Option> options)
        {
            return new ConversationThreadRequest(this.RequestUrl, this.Client, options);
        }

        /// <summary>
        /// Gets the request builder for Posts.
        /// </summary>
        /// <returns>The <see cref="IConversationThreadPostsCollectionRequestBuilder"/>.</returns>
        public IConversationThreadPostsCollectionRequestBuilder Posts
        {
            get
            {
                return new ConversationThreadPostsCollectionRequestBuilder(this.AppendSegmentToRequestUrl("posts"), this.Client);
            }
        }

        /// <summary>
        /// Gets the request builder for ConversationThreadReply.
        /// </summary>
        /// <returns>The <see cref="IConversationThreadReplyRequestBuilder"/>.</returns>
        public IConversationThreadReplyRequestBuilder Reply(
            Post Post)
        {
            return new ConversationThreadReplyRequestBuilder(
                this.AppendSegmentToRequestUrl("microsoft.graph.reply"),
                this.Client,
                Post);
        }

    }
}


text:
#ifndef VICE_CLIPBOARD_H
#define VICE_CLIPBOARD_H

#include "vice.h"

extern char *clipboard_read_screen_output(char *line_ending);

#endif


text:
static NSString * const VVPopMenuButtonSelectdAnimationKey = @"VVPopMenuButtonSelectdAnimationKey";

static NSString * const VVTransformScaleKeyPathKey         = @"transform.scale";
static NSString * const VVTransformOpacityKeyPathKey       = @"opacity";

@interface VVPopMenuButton () <CAAnimationDelegate>

@property (nonatomic, strong) VVPopMenuModel *popMenuModel;

@end

@implementation VVPopMenuButton

#pragma mark - LifeCycle

- (instancetype)initWithCoder:(NSCoder *)coder {
    if (self = [super initWithCoder:coder]) {
        [self setup];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setup];
    }
    return self;
}

- (void)setup {
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    self.titleLabel.numberOfLines = 0;
    self.imageView.contentMode = UIViewContentModeScaleAspectFill;
    self.imageView.clipsToBounds = YES;
    self.adjustsImageWhenHighlighted = NO;
    [self addTarget:self action:@selector(scaleToLarge) forControlEvents:UIControlEventTouchDown | UIControlEventTouchDragEnter];
    [self addTarget:self action:@selector(scaleToDefault) forControlEvents:UIControlEventTouchDragExit];
}

- (void)layoutSubviews {
    [super layoutSubviews];

    CGSize selfSize = self.bounds.size;
    CGFloat imageAndTitlePadding = 10.0;
    CGFloat textLineHeight = [@"一行内容高度" vv_heightWithFont:self.titleLabel.font constrainedToWidth:MAXFLOAT];

    CGFloat imageViewWidth = selfSize.width / 1.7;
    CGFloat imageViewHeight = imageViewWidth;
    CGFloat textLabelWidth = selfSize.width;
    CGFloat textLabelHeight = [self.titleLabel.text vv_heightWithFont:self.titleLabel.font constrainedToWidth:textLabelWidth];

    CGFloat imageViewX = (selfSize.width - imageViewWidth) / 2;
    CGFloat imageViewY = (selfSize.height - imageViewHeight - textLineHeight - imageAndTitlePadding) / 2;
    CGFloat textLabelX = 0.0;
    CGFloat textLabelY = imageViewY + imageViewHeight + imageAndTitlePadding;
    self.imageView.frame = CGRectMake(imageViewX, imageViewY, imageViewWidth, imageViewHeight);
    self.titleLabel.frame = CGRectMake(textLabelX, textLabelY, textLabelWidth, textLabelHeight);
    self.imageView.layer.cornerRadius = imageViewWidth * 0.5;
}

+ (instancetype)popMenuButtonWithPopMenuModel:(VVPopMenuModel *)popMenuModel {
    VVPopMenuButton *popMenuButton = [[self alloc] init];
    popMenuButton.popMenuModel = popMenuModel;
    return popMenuButton;
}

#pragma mark - Public Method

- (void)selectdAnimation {
    self.userInteractionEnabled = NO;
    switch (self.popMenuModel.transitionType) {
        case VVPopMenuTransitionTypeDefault: {
            CABasicAnimation* scaleAnimation = [CABasicAnimation animationWithKeyPath:VVTransformScaleKeyPathKey];
            scaleAnimation.delegate = self;
            scaleAnimation.duration = VVPopMenuViewAnimationDefaultDuration;
            scaleAnimation.repeatCount = 0;
            scaleAnimation.removedOnCompletion = NO;
            scaleAnimation.fillMode = kCAFillModeForwards;
            scaleAnimation.autoreverses = NO;
            scaleAnimation.fromValue = @1;
            scaleAnimation.toValue = @1.4;

            CABasicAnimation* opacityAnimation = [CABasicAnimation animationWithKeyPath:VVTransformOpacityKeyPathKey];
            opacityAnimation.delegate = self;
            opacityAnimation.duration = VVPopMenuViewAnimationDefaultDuration;
            opacityAnimation.repeatCount = 0;
            opacityAnimation.removedOnCompletion = NO;
            opacityAnimation.fillMode = kCAFillModeForwards;
            opacityAnimation.autoreverses = NO;
            opacityAnimation.fromValue = @1;
            opacityAnimation.toValue = @0;

            [self.layer addAnimation:scaleAnimation forKey:VVPopMenuButtonSelectdAnimationKey];
            [self.layer addAnimation:opacityAnimation forKey:opacityAnimation.keyPath];
            break;
        }
        case VVPopMenuTransitionTypeBubble: {
            self.layer.cornerRadius = CGRectGetWidth(self.bounds) / 2;
            UIColor* color = [self.imageView.image vv_colorAtPixel:CGPointMake(50, 20)];
            [self setBackgroundColor:color];
            UILabel* textLabel = [self viewWithTag:21];
            textLabel.text = @"";
            [self setTitle:@"" forState:UIControlStateNormal];
            [self setImage:nil forState:UIControlStateNormal];

            CABasicAnimation* expandAnim = [CABasicAnimation animationWithKeyPath:VVTransformScaleKeyPathKey];
            expandAnim.fromValue = @(1.0);
            expandAnim.toValue = @(33.0);
            expandAnim.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.95:0.02:1:0.05];
            expandAnim.duration = VVPopMenuViewAnimationDefaultDuration;
            expandAnim.delegate = self;
            expandAnim.fillMode = kCAFillModeForwards;
            expandAnim.removedOnCompletion = NO;
            expandAnim.autoreverses = NO;
            [self.layer addAnimation:expandAnim forKey:VVPopMenuButtonSelectdAnimationKey];
            break;
        }
    }
}

- (void)cancelAnimation {
    CABasicAnimation* scaleAnimation = [CABasicAnimation animationWithKeyPath:VVTransformScaleKeyPathKey];
    scaleAnimation.delegate = self;
    scaleAnimation.duration = VVPopMenuViewAnimationDefaultDuration;
    scaleAnimation.repeatCount = 0;
    scaleAnimation.removedOnCompletion = NO;
    scaleAnimation.fillMode = kCAFillModeForwards;
    scaleAnimation.autoreverses = NO;
    scaleAnimation.fromValue = @1;
    scaleAnimation.toValue = @0.2;

    CABasicAnimation* opacityAnimation = [CABasicAnimation animationWithKeyPath:VVTransformOpacityKeyPathKey];
    opacityAnimation.delegate = self;
    opacityAnimation.duration = VVPopMenuViewAnimationDefaultDuration;
    opacityAnimation.repeatCount = 0;
    opacityAnimation.removedOnCompletion = NO;
    opacityAnimation.fillMode = kCAFillModeForwards;
    opacityAnimation.autoreverses = NO;
    opacityAnimation.fromValue = @1;
    opacityAnimation.toValue = @0;
    // CGAffineTransformIdentity
    [self.layer addAnimation:scaleAnimation forKey:scaleAnimation.keyPath];
    [self.layer addAnimation:opacityAnimation forKey:opacityAnimation.keyPath];
}

#pragma mark - Event Method

- (void)scaleToLarge {
    CABasicAnimation *theAnimation = [CABasicAnimation animationWithKeyPath:VVTransformScaleKeyPathKey];
    theAnimation.delegate = self;
    theAnimation.duration = 0.1;
    theAnimation.repeatCount = 0;
    theAnimation.removedOnCompletion = NO;
    theAnimation.fillMode = kCAFillModeForwards;
    theAnimation.autoreverses = NO;
    theAnimation.fromValue = [NSNumber numberWithFloat:1];
    theAnimation.toValue = [NSNumber numberWithFloat:1.2f];
    [self.imageView.layer addAnimation:theAnimation forKey:theAnimation.keyPath];
}

- (void)scaleToDefault {
    CABasicAnimation *theAnimation = [CABasicAnimation animationWithKeyPath:VVTransformScaleKeyPathKey];
    theAnimation.delegate = self;
    theAnimation.duration = 0.1;
    theAnimation.repeatCount = 0;
    theAnimation.removedOnCompletion = NO;
    theAnimation.fillMode = kCAFillModeForwards;
    theAnimation.autoreverses = NO;
    theAnimation.fromValue = [NSNumber numberWithFloat:1.2f];
    theAnimation.toValue = [NSNumber numberWithFloat:1];
    [self.imageView.layer addAnimation:theAnimation forKey:theAnimation.keyPath];
}

- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
    if (anim == [self.layer animationForKey:VVPopMenuButtonSelectdAnimationKey]) {
        self.userInteractionEnabled = YES;
        if (flag == YES) {
            self.completionAnimationBlock ? self.completionAnimationBlock() : nil;
            __weak typeof(self) weakSelf = self;
            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.6 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                [weakSelf stopAnimation];
            });
        }
    }
}

- (void)stopAnimation {
    [self.layer removeAllAnimations];
}

#pragma mark - Property Method

- (void)setPopMenuModel:(VVPopMenuModel *)popMenuModel {
    _popMenuModel = popMenuModel;
    if ([popMenuModel.image isKindOfClass:[UIImage class]]) {
        [self setImage:popMenuModel.image forState:UIControlStateNormal];
    } else if ([popMenuModel.image isKindOfClass:[NSString class]]) {
        [self sd_setImageWithURL:[NSURL URLWithString:popMenuModel.image] forState:UIControlStateNormal placeholderImage:popMenuModel.placeholdImage];
    } else {
        [self setImage:nil forState:UIControlStateNormal];
    }
    [self setTitle:popMenuModel.title forState:UIControlStateNormal];
    if (popMenuModel.titleColor != nil) {
        [self setTitleColor:popMenuModel.titleColor forState:UIControlStateNormal];
    }
    [self setNeedsLayout];
}

@end


text:
void HostFxrResolutionResult::GetArguments(DWORD& hostfxrArgc, std::unique_ptr<PCWSTR[]>& hostfxrArgv) const
{
    hostfxrArgc = static_cast<DWORD>(m_arguments.size());
    hostfxrArgv = std::make_unique<PCWSTR[]>(hostfxrArgc);
    for (DWORD i = 0; i < hostfxrArgc; ++i)
    {
        hostfxrArgv[i] = m_arguments[i].c_str();
    }
}

HRESULT HostFxrResolutionResult::Create(
        _In_ const std::wstring& pcwzDotnetExePath,
        _In_ const std::wstring& pcwzProcessPath,
        _In_ const std::wstring& pcwzApplicationPhysicalPath,
        _In_ const std::wstring& pcwzArguments,
        _In_ ErrorContext& errorContext,
        _Out_ std::unique_ptr<HostFxrResolutionResult>& ppWrapper)
{
    std::filesystem::path knownDotnetLocation;

    if (!pcwzDotnetExePath.empty())
    {
        knownDotnetLocation = pcwzDotnetExePath;
    }

    try
    {
        std::filesystem::path hostFxrDllPath;
        std::vector<std::wstring> arguments;
        HostFxrResolver::GetHostFxrParameters(
                pcwzProcessPath,
                pcwzApplicationPhysicalPath,
                pcwzArguments,
                hostFxrDllPath,
                knownDotnetLocation,
                arguments,
                errorContext);

        LOG_INFOF(L"Parsed hostfxr options: dotnet location: '%ls' hostfxr path: '%ls' arguments:", knownDotnetLocation.c_str(), hostFxrDllPath.c_str());
        for (size_t i = 0; i < arguments.size(); i++)
        {
            LOG_INFOF(L"Argument[%d] = '%ls'", i, arguments[i].c_str());
        }
        ppWrapper = std::make_unique<HostFxrResolutionResult>(knownDotnetLocation, hostFxrDllPath, arguments);
    }
    catch (InvalidOperationException &ex)
    {
        EventLog::Error(
            ASPNETCORE_EVENT_INPROCESS_START_ERROR,
            ASPNETCORE_EVENT_INPROCESS_START_ERROR_MSG,
            pcwzApplicationPhysicalPath.c_str(),
            ex.as_wstring().c_str());

        RETURN_CAUGHT_EXCEPTION();
    }
    catch (std::runtime_error &ex)
    {
        EventLog::Error(
            ASPNETCORE_EVENT_INPROCESS_START_ERROR,
            ASPNETCORE_EVENT_INPROCESS_START_ERROR_MSG,
            pcwzApplicationPhysicalPath.c_str(),
            GetUnexpectedExceptionMessage(ex).c_str());

        RETURN_CAUGHT_EXCEPTION();
    }
    CATCH_RETURN();

    return S_OK;
}


text:
MathJax.Localization.addTranslation("sl","HTML-CSS",{
        version: "2.7.0",
        isLoaded: true,
        strings: {
          LoadWebFont: "Nalagam spletni font %1",
          CantLoadWebFont: "Spletne pisave %1 ni mogo\u010De nalo\u017Eiti",
          FirefoxCantLoadWebFont: "Firefox ne more nalo\u017Eiti spletnih pisav na oddaljenem gostitelju.",
          CantFindFontUsing: "Z uporabo %1 ne morem najti veljavne pisave.",
          WebFontsNotAvailable: "Web-Fonts niso na razpolago. Namesto njih uporabljam slikovne pisave."
        }
});

MathJax.Ajax.loadComplete("[MathJax]/localization/sl/HTML-CSS.js");


text:
if(typeof(window.ReportTemplateV2) === undefined) {
  alert("ERROR: undefined window.ReportTemplateV2");
}
console.log('template version: ' + window.ReportTemplateV2.version);

window.ReportTemplateV2.modal = function(ctl, type) {
  var date1 = new Date().getTime(),
      $modal = $("#ReportTemplateV2Modal");

  $modal.modal("show");
  console.log(type);

  if(type === 'info') {
    $modal.find(".modal-title").html($(ctl).data("title"));
    $modal.find(".modal-body").html($(ctl).data("content"));
  }
  else if(type === 'search') {
    $modal.find(".modal-title").html("选择门店");
    var items = [], itemName;
    for(var i = 0, len = window.TemplateDatas.length; i < len; i++) {
      itemName = window.TemplateDatas[i].name;
      items.push("" + itemName + "");
    }

    $modal.find(".modal-body").html(items.join("
"));
  }
  else {
    console.log("unkown type: " + type);
  }
  var date2 = new Date().getTime(),
      dif = date2 - date1;
  console.log("duration: " + dif);
}
window.ReportTemplateV2.setSelectedItem = function(selectedItem) {
 $(document).attr("title", selectedItem);

  if(selectedItem && selectedItem.length) {
    window.TemplateDataConfig.selected_item = selectedItem;
    for(var i = 0, len = window.TemplateDatas.length; i < len; i ++) {
      if(window.TemplateDatas[i].name === selectedItem) {
        window.TemplateData.templates = window.TemplateDatas[i].data;
        break;
      }
    }
  }
  ReportTemplateV2.generateTemplates(window.TemplateData.templates);

  $(document).on("click","a.table-more",function(e) {
    e.preventDefault()
    var $this = $(this),
        $currentRow = $this.closest('tr');
        $currentRow.siblings(".tr-item-"+$(this).attr('data-id')).each(function(e){
          if($(this).is(":hidden")){
            if($(this).hasClass("hasChild") && !$(this).find('a.table-more').hasClass('table-more-closed')){
              $(this).siblings("tr[class='tr-item-"+$(this).find('a.table-more').attr('data-id')+" trthreelev']").show();
            }
            $(this).show();
          } else {
            if($(this).hasClass("hasChild") && !$(this).find('a.table-more').hasClass('table-more-closed')){
              $(this).siblings("tr[class='tr-item-"+$(this).find('a.table-more').attr('data-id')+" trthreelev'] ").hide();
            }
            $(this).hide();
          }
        });
    //$currentRow.nextUntil('tr[class!=more-items]').toggle();
    $this.toggleClass('table-more-closed');
  });

  $('a.day-container').click(function(el) {
    el.preventDefault();

    $(".day-container").removeClass("highlight");
    $(this).addClass("highlight");

    var tabIndex = $(this).data("index");
    var klass = ".tab-part-" + tabIndex;
    $(".tab-part").addClass("hidden");
    $(klass).removeClass("hidden");
    //ReportTemplateV2.caculateHeightForTable(klass);
  });

  $("#ReportTemplateV2Modal").modal("hide");
}

window.ReportTemplateV2.setSearchItems = function() {
  var items = [];
  for(var i = 0, len = window.TemplateDatas.length; i < len; i++) {
    items.push(window.TemplateDatas[i].name);
  }

  return items[0];
  // window.MobileBridge.setSearchItems(items);
}

window.onerror = function(e) {
  window.alert(e);
}
$(function() {
  var selectedItem = ReportTemplateV2.setSearchItems();
  ReportTemplateV2.setSelectedItem(selectedItem);
});


text:
@interface ImageCellOut : MessageCell

@end


text:
    <button class="btn btn-sm yellow filter-submit margin-bottom" title="Cari"> Cari</button>
    <button class="btn btn-sm red filter-cancel" title="Reset"> Reset</button>

    No
    Nama Kelompok
    Desa
    Kecamatan
    Kabupaten
    Provinsi

    <input type="text" class="form-control form-filter input-sm input-circle" name="nmpoktan">
    <input type="text" class="form-control form-filter input-sm input-circle" name="nmdesa">
    <input type="text" class="form-control form-filter input-sm input-circle" name="nmkec">
    <input type="text" class="form-control form-filter input-sm input-circle" name="nmkab">
    <input type="text" class="form-control form-filter input-sm input-circle" name="nmprov">


text:
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <stdbool.h>
#include <stdlib.h>

#include "format.h"
#include "c-ctype.h"
#include "xalloc.h"
#include "xerror.h"
#include "format-invalid.h"
#include "gettext.h"

#define _(str) gettext (str)

/* GCC internal format strings consist of language frontend independent
   format directives, implemented in gcc-3.3/gcc/diagnostic.c (function
   output_format), plus some frontend dependent extensions:
     - for the C/ObjC frontend in gcc-3.3/gcc/c-objc-common.c
     - for the C++ frontend in gcc-3.3/gcc/cp/error.c
   Taking these together, GCC internal format strings are specified as follows.
   A directive
   - starts with '%',
   - is optionally followed by a size specifier 'l',
   - is optionally followed by '+' (only the specifiers of gcc/cp/error.c),
   - is optionally followed by '#' (only the specifiers of gcc/cp/error.c),
   - is finished by a specifier

       - '%', that needs no argument,
       - 'c', that needs a character argument,
       - 's', that needs a string argument,
       - 'i', 'd', that need a signed integer argument,
       - 'o', 'u', 'x', that need an unsigned integer argument,
       - '.*s', that needs a signed integer argument and a string argument,
       - 'H', that needs a 'location_t *' argument,
         [see gcc/diagnostic.c]

       - 'D', that needs a general declaration argument,
       - 'F', that needs a function declaration argument,
       - 'T', that needs a type argument,
         [see gcc/c-objc-common.c and gcc/cp/error.c]

       - 'A', that needs a function argument list argument,
       - 'C', that needs a tree code argument,
       - 'E', that needs an expression argument,
       - 'L', that needs a language argument,
       - 'O', that needs a binary operator argument,
       - 'P', that needs a function parameter argument,
       - 'Q', that needs an assignment operator argument,
       - 'V', that needs a const/volatile qualifier argument.
         [see gcc/cp/error.c]
 */

enum format_arg_type
{
  FAT_NONE		= 0,
  /* Basic types */
  FAT_INTEGER		= 1,
  FAT_CHAR		= 2,
  FAT_STRING		= 3,
  FAT_LOCATION		= 4,
  FAT_TREE		= 5,
  FAT_TREE_CODE		= 6,
  FAT_LANGUAGES		= 7,
  /* Flags */
  FAT_UNSIGNED		= 1 << 3,
  FAT_SIZE_LONG		= 1 << 4,
  FAT_TREE_DECL		= 1 << 5,
  FAT_TREE_FUNCDECL	= 2 << 5,
  FAT_TREE_TYPE		= 3 << 5,
  FAT_TREE_ARGUMENT	= 4 << 5,
  FAT_TREE_EXPRESSION	= 5 << 5,
  FAT_TREE_CV		= 6 << 5,
  FAT_TREE_CODE_BINOP	= 1 << 8,
  FAT_TREE_CODE_ASSOP	= 2 << 8,
  FAT_FUNCPARAM		= 1 << 10
};

struct unnumbered_arg
{
  enum format_arg_type type;
};

struct spec
{
  unsigned int directives;
  unsigned int unnumbered_arg_count;
  unsigned int allocated;
  struct unnumbered_arg *unnumbered;
};

static void *
format_parse (const char *format, bool translated, char **invalid_reason)
{
  struct spec spec;
  struct spec *result;

  spec.directives = 0;
  spec.unnumbered_arg_count = 0;
  spec.allocated = 0;
  spec.unnumbered = NULL;

  for (; *format != '\0';)
    if (*format++ == '%')
      {
	/* A directive.  */
	enum format_arg_type size;

	spec.directives++;

	/* Parse size.  */
	size = 0;
	if (*format == 'l')
	  {
	    format++;
	    size = FAT_SIZE_LONG;
	  }

	if (*format != '%')
	  {
	    enum format_arg_type type;

	    if (*format == 'c')
	      type = FAT_CHAR;
	    else if (*format == 's')
	      type = FAT_STRING;
	    else if (*format == 'i' || *format == 'd')
	      type = FAT_INTEGER | size;
	    else if (*format == 'o' || *format == 'u' || *format == 'x')
	      type = FAT_INTEGER | FAT_UNSIGNED | size;
	    else if (*format == '.' && format[1] == '*' && format[2] == 's')
	      {
		if (spec.allocated == spec.unnumbered_arg_count)
		  {
		    spec.allocated = 2 * spec.allocated + 1;
		    spec.unnumbered = (struct unnumbered_arg *) xrealloc (spec.unnumbered, spec.allocated * sizeof (struct unnumbered_arg));
		  }
		spec.unnumbered[spec.unnumbered_arg_count].type = FAT_INTEGER;
		spec.unnumbered_arg_count++;
		type = FAT_STRING;
	      }
	    else if (*format == 'H')
	      type = FAT_LOCATION;
	    else
	      {
		if (*format == '+')
		  format++;
		if (*format == '#')
		  format++;
		if (*format == 'D')
		  type = FAT_TREE | FAT_TREE_DECL;
		else if (*format == 'F')
		  type = FAT_TREE | FAT_TREE_FUNCDECL;
		else if (*format == 'T')
		  type = FAT_TREE | FAT_TREE_TYPE;
		else if (*format == 'A')
		  type = FAT_TREE | FAT_TREE_ARGUMENT;
		else if (*format == 'C')
		  type = FAT_TREE_CODE;
		else if (*format == 'E')
		  type = FAT_TREE | FAT_TREE_EXPRESSION;
		else if (*format == 'L')
		  type = FAT_LANGUAGES;
		else if (*format == 'O')
		  type = FAT_TREE_CODE | FAT_TREE_CODE_BINOP;
		else if (*format == 'P')
		  type = FAT_INTEGER | FAT_FUNCPARAM;
		else if (*format == 'Q')
		  type = FAT_TREE_CODE | FAT_TREE_CODE_ASSOP;
		else if (*format == 'V')
		  type = FAT_TREE | FAT_TREE_CV;
		else
		  {
		    *invalid_reason =
		      (*format == '\0'
		       ? INVALID_UNTERMINATED_DIRECTIVE ()
		       : (*format == 'c'
			  || *format == 's'
			  || *format == 'i' || *format == 'd'
			  || *format == 'o' || *format == 'u' || *format == 'x'
			  || *format == 'H'
			  ? xasprintf (_("In the directive number %u, flags are not allowed before '%c'."), spec.directives, *format)
			  : INVALID_CONVERSION_SPECIFIER (spec.directives,
							  *format)));
		    goto bad_format;
		  }
	      }

	    if (spec.allocated == spec.unnumbered_arg_count)
	      {
		spec.allocated = 2 * spec.allocated + 1;
		spec.unnumbered = (struct unnumbered_arg *) xrealloc (spec.unnumbered, spec.allocated * sizeof (struct unnumbered_arg));
	      }
	    spec.unnumbered[spec.unnumbered_arg_count].type = type;
	    spec.unnumbered_arg_count++;
	  }

	format++;
      }

  result = (struct spec *) xmalloc (sizeof (struct spec));
  *result = spec;
  return result;

 bad_format:
  if (spec.unnumbered != NULL)
    free (spec.unnumbered);
  return NULL;
}

static void
format_free (void *descr)
{
  struct spec *spec = (struct spec *) descr;

  if (spec->unnumbered != NULL)
    free (spec->unnumbered);
  free (spec);
}

static int
format_get_number_of_directives (void *descr)
{
  struct spec *spec = (struct spec *) descr;

  return spec->directives;
}

static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
	      formatstring_error_logger_t error_logger,
	      const char *pretty_msgstr)
{
  struct spec *spec1 = (struct spec *) msgid_descr;
  struct spec *spec2 = (struct spec *) msgstr_descr;
  bool err = false;
  unsigned int i;

  /* Check the argument types are the same.  */
  if (equality
      ? spec1->unnumbered_arg_count != spec2->unnumbered_arg_count
      : spec1->unnumbered_arg_count < spec2->unnumbered_arg_count)
    {
      if (error_logger)
	error_logger (_("number of format specifications in 'msgid' and '%s' does not match"),
		      pretty_msgstr);
      err = true;
    }
  else
    for (i = 0; i < spec2->unnumbered_arg_count; i++)
      if (spec1->unnumbered[i].type != spec2->unnumbered[i].type)
	{
	  if (error_logger)
	    error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
			  pretty_msgstr, i + 1);
	  err = true;
	}

  return err;
}

struct formatstring_parser formatstring_gcc_internal =
{
  format_parse,
  format_free,
  format_get_number_of_directives,
  format_check
};

#ifdef TEST

/* Test program: Print the argument list specification returned by
   format_parse for strings read from standard input.  */

#include <stdio.h>
#include "getline.h"

static void
format_print (void *descr)
{
  struct spec *spec = (struct spec *) descr;
  unsigned int i;

  if (spec == NULL)
    {
      printf ("INVALID");
      return;
    }

  printf ("(");
  for (i = 0; i < spec->unnumbered_arg_count; i++)
    {
      if (i > 0)
	printf (" ");
      if (spec->unnumbered[i].type & FAT_UNSIGNED)
	printf ("[unsigned]");
      if (spec->unnumbered[i].type & FAT_SIZE_LONG)
	printf ("[long]");
      switch (spec->unnumbered[i].type & ~(FAT_UNSIGNED | FAT_SIZE_LONG))
	{
	case FAT_INTEGER:
	  printf ("i");
	  break;
	case FAT_INTEGER | FAT_FUNCPARAM:
	  printf ("P");
	  break;
	case FAT_CHAR:
	  printf ("c");
	  break;
	case FAT_STRING:
	  printf ("s");
	  break;
	case FAT_LOCATION:
	  printf ("H");
	  break;
	case FAT_TREE | FAT_TREE_DECL:
	  printf ("D");
	  break;
	case FAT_TREE | FAT_TREE_FUNCDECL:
	  printf ("F");
	  break;
	case FAT_TREE | FAT_TREE_TYPE:
	  printf ("T");
	  break;
	case FAT_TREE | FAT_TREE_ARGUMENT:
	  printf ("A");
	  break;
	case FAT_TREE | FAT_TREE_EXPRESSION:
	  printf ("E");
	  break;
	case FAT_TREE | FAT_TREE_CV:
	  printf ("V");
	  break;
	case FAT_TREE_CODE:
	  printf ("C");
	  break;
	case FAT_TREE_CODE | FAT_TREE_CODE_BINOP:
	  printf ("O");
	  break;
	case FAT_TREE_CODE | FAT_TREE_CODE_ASSOP:
	  printf ("Q");
	  break;
	case FAT_LANGUAGES:
	  printf ("L");
	  break;
	default:
	  abort ();
	}
    }
  printf (")");
}

int
main ()
{
  for (;;)
    {
      char *line = NULL;
      size_t line_size = 0;
      int line_len;
      char *invalid_reason;
      void *descr;

      line_len = getline (&line, &line_size, stdin);
      if (line_len < 0)
	break;
      if (line_len > 0 && line[line_len - 1] == '\n')
	line[--line_len] = '\0';

      invalid_reason = NULL;
      descr = format_parse (line, false, &invalid_reason);

      format_print (descr);
      printf ("\n");
      if (descr == NULL)
	printf ("%s\n", invalid_reason);

      free (invalid_reason);
      free (line);
    }

  return 0;
}

/*
 * For Emacs M-x compile
 * Local Variables:
 * compile-command: "/bin/sh ../libtool --mode=link gcc -o a.out -static -O -g -Wall -I.. -I../lib -I../intl -DHAVE_CONFIG_H -DTEST format-gcc-internal.c ../lib/libgettextlib.la"
 * End:
 */

#endif /* TEST */


text:
{% extends "base.html" %}
{% block body_class %}blog{% endblock %}

{% block content %}

500

Yikes, something went wrong!

Unlike the text below, this is no hoax - something just isn't correct. Maybe the below is of interest?

		Ladies and gentlemen of the class of '97:

		Wear sunscreen.

		If I could offer you only one tip for the future, sunscreen would be it.
		The long-term benefits of sunscreen have been proved by scientists,
		whereas the rest of my advice has no basis more reliable than my own
		meandering experience. I will dispense this advice now.

		Enjoy the power and beauty of your youth. Oh, never mind. You will not
		understand the power and beauty of your youth until they've faded. But
		trust me, in 20 years, you'll look back at photos of yourself and recall
		in a way you can't grasp now how much  possibility lay before you and how
		fabulous you really looked. You are not as fat as you imagine.

		Don't worry about the future. Or worry, but know that worrying is as
		effective as trying to solve an algebra equation by chewing bubble gum.
		The real troubles in your life are apt to be things that never crossed
		your worried mind, the kind that blindside you at 4 pm on some idle
		Tuesday.

		Do one thing every day that scares you.

		Sing.

		Don't be reckless with other people's hearts. Don't put up with people
		who are reckless with yours.

		Floss.

		Don't waste your time on jealousy. Sometimes you're ahead, sometimes
		you're behind. The race is long and, in the end, it's only with yourself.

		Remember compliments you receive. Forget the insults. If you succeed in
		doing this, tell me how.

		Keep your old love letters. Throw away your old bank statements.

		Stretch.

		Don't feel guilty if you don't know what you want to do with your life.
		The most interesting people I know didn't know at 22 what they wanted to
		do with their lives. Some of the most interesting 40-year-olds I know
		still don't.

		Get plenty of calcium. Be kind to your knees. You'll miss them
		when they're gone.

		Maybe you'll marry, maybe you won't. Maybe you'll have children, maybe
		you won't. Maybe you'll divorce at 40, maybe you'll dance the funky
		chicken on your 75th wedding anniversary. Whatever you do, don't
		congratulate yourself too much, or berate yourself either. Your choices
		are half chance. So are everybody else's. Enjoy your body. Use it every
		way you can. Don't be afraid of it or of what other people think of it.
		It's the greatest instrument you'll ever own.

		Dance, even if you have nowhere to do it but your living room. Read the
		directions, even if you don't follow them. Do not read beauty magazines.
		They will only make you feel ugly.

		Get to know your parents. You never know when they'll be gone for good.
		Be nice to your siblings. They're your best link to your past and the
		people most likely to stick with you in the future.

		Understand that friends come and go, but with a precious few you should
		hold on. Work hard to bridge the gaps in geography and lifestyle, because
		the older you get, the more you need the people who knew you when you
		were young.

		Live in New York City once, but leave before it makes you hard. Live in
		Northern California once, but leave before it makes you soft. Travel.

		Accept certain inalienable truths: Prices will rise. Politicians will
		philander. You, too, will get old. And when you do, you'll fantasize that
		when you were young, prices were reasonable, politicians were noble, and
		children respected their elders.

		Respect your elders.

		Don't expect anyone else to support you. Maybe you have a trust fund.
		Maybe you'll have a wealthy spouse. But you never know when either one
		might run out.

		Don't mess too much with your hair or by the time you're 40 it
		will look 85.

		Be careful whose advice you buy, but be patient with those who supply it.
		Advice is a form of nostalgia. Dispensing it is a way of fishing the past
		from the disposal, wiping it off, painting over the ugly parts and
		recycling it for more than it's worth. But trust me on the sunscreen.

{% endblock %}


text:
import { promises as fs } from 'fs';
import * as path from 'path';
import type { UmzugStorage } from './contract';

const filesystem = {
	/** reads a file as a string or returns null if file doesn't exist */
	async readAsync(filepath: string) {
		return fs.readFile(filepath).then(
			c => c.toString(),
			() => null
		);
	},
	/** writes a string as file contents, creating its parent directory if necessary */
	async writeAsync(filepath: string, content: string) {
		await fs.mkdir(path.dirname(filepath), { recursive: true });
		await fs.writeFile(filepath, content);
	},
};

export type JSONStorageConstructorOptions = {
	/**
	Path to JSON file where the log is stored.

	@default './umzug.json'
	*/
	readonly path?: string;
};

export class JSONStorage implements UmzugStorage {
	public readonly path: string;

	constructor(options?: JSONStorageConstructorOptions) {
		this.path = options?.path ?? path.join(process.cwd(), 'umzug.json');
	}

	async logMigration({ name: migrationName }: { name: string }): Promise<void> {
		const loggedMigrations = await this.executed();
		loggedMigrations.push(migrationName);

		await filesystem.writeAsync(this.path, JSON.stringify(loggedMigrations, null, 2));
	}

	async unlogMigration({ name: migrationName }: { name: string }): Promise<void> {
		const loggedMigrations = await this.executed();
		const updatedMigrations = loggedMigrations.filter(name => name !== migrationName);

		await filesystem.writeAsync(this.path, JSON.stringify(updatedMigrations, null, 2));
	}

	async executed(): Promise<string[]> {
		const content = await filesystem.readAsync(this.path);
		return content ? (JSON.parse(content) as string[]) : [];
	}
}


text:
/*!  \file kfbxobjectmetadata.h
 */

#ifndef FBXFILESDK_KFBXPLUGINS_KFBXOBJECTMETADATA_H
#define FBXFILESDK_KFBXPLUGINS_KFBXOBJECTMETADATA_H

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

 Copyright (C) 2001 - 2009 Autodesk, Inc. and/or its licensors.
 All Rights Reserved.

 The coded instructions, statements, computer programs, and/or related material
 (collectively the "Data") in these files contain unpublished information
 proprietary to Autodesk, Inc. and/or its licensors, which is protected by
 Canada and United States of America federal copyright law and by international
 treaties.

 The Data may not be disclosed or distributed to third parties, in whole or in
 part, without the prior written consent of Autodesk, Inc. ("Autodesk").

 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
 BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE,
 NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE.
 WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
 OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE.

 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
 OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
 SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
 OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
 HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
 FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
 ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
 WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
 OR DAMAGE.

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

#include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
#include <fbxfilesdk/components/kbaselib/kaydara.h>

#include <fbxfilesdk/kfbxplugins/kfbxobject.h>
#include <fbxfilesdk/kfbxplugins/kfbxgroupname.h>

#include <fbxfilesdk/components/kbaselib/klib/kstring.h>
#include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
#include <fbxfilesdk/components/kbaselib/klib/kname.h>
#include <fbxfilesdk/kfbxmath/kfbxmatrix.h>

#include <fbxfilesdk/fbxfilesdk_nsbegin.h>

/** This class is used to hold meta-data information on nodes.
  * \nosubgrouping
  *
  * This class does not offer any new functionality over a regular KFbxObject;
  * all meta-data information should be stored in properties.
  *
  */
class KFBX_DLL KFbxObjectMetaData : public KFbxObject
{
	KFBXOBJECT_DECLARE(KFbxObjectMetaData,KFbxObject);
public:

///////////////////////////////////////////////////////////////////////////////
//
//  WARNING!
//
//	Anything beyond these lines may not be documented accurately and is
// 	subject to change without notice.
//
///////////////////////////////////////////////////////////////////////////////

#ifndef DOXYGEN_SHOULD_SKIP_THIS

	// Clone
	virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;

protected:

	/** Create an object of type KFbxObjectMetaData.
	 * \param pManager (need to exist for extended validation).
	 * \param pName Name of this KFbxObjectMetaData.
	 */
	KFbxObjectMetaData(KFbxSdkManager& pManager, char const* pName);

	// From KFbxObject
	virtual KString		GetTypeName() const;
	virtual KStringList	GetTypeFlags() const;

	//! Assignment operator.
    KFbxObjectMetaData& operator=(KFbxObjectMetaData const& pMetaData);
#endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
};

typedef KFbxObjectMetaData* HKFbxObjectMetaData;

#include <fbxfilesdk/fbxfilesdk_nsend.h>

#endif // FBXFILESDK_KFBXPLUGINS_KFBXOBJECTMETADATA_H


text:
<?php

function epages_options_page() {
  global $epages_api_http_options;

  $valid_shop_id = false;
  $shop_id_validated = false;

  if (!get_option("epages_api_url_confirmed") && (get_option("epages_api_url"))) {
    $shop_id_validated = true;

    // We're hitting the legal-API to verify whether the provided
    // Shop ID is actually pointing to the ePages API.
    $url = esc_html(get_option("epages_api_url"));
    $url = trim($url, "/") . "/";

    epages_log( __("Trying to validate API URL: "  , 'epages-online-shop') . $url);

    $response = wp_remote_get($url, $epages_api_http_options);
    epages_log($response);

    $valid_shop_id = epages_is_valid_api_response($response);
    $mbo_url = epages_get_mbo_url($response);

    epages_log( __("API URL validation status: ") . ($valid_shop_id ? __("Success"  , 'epages-online-shop') : __("Failure"  , 'epages-online-shop')));
    update_option("epages_api_url_confirmed", $valid_shop_id);
    update_option("epages_mbo_url", $mbo_url);
  }

  epages_load_template("options_page", array(
    "valid_shop_id"     => $valid_shop_id,
    "shop_id_validated" => $shop_id_validated
  ));
}

// If `$response` is not an error object and the request was successful,
// we're checking for a specific element in the response and expect it
// to be an ePages API response, if the element was found.
function epages_is_valid_api_response($response) {
  if (is_array($response) && 200 == $response["response"]["code"]) {
    try {
      $json = json_decode($response["body"]);
      if (is_string($json->sfUrl)) {
        return true;
      }
    } catch (Exception $ex) {
      epages_log( __("Exception while parsing the shop API validation response."  , 'epages-online-shop') );
    }
  }

  return false;
}

function epages_get_mbo_url($response) {
  if (is_array($response) && 200 == $response["response"]["code"]) {
    try {
      $json = json_decode($response["body"]);
      return $json->mboUrl;
    } catch (Exception $ex) {
      epages_log( __("Exception while parsing the shop API validation response."  , 'epages-online-shop') );
    }
  }
}

?>