text:
package org.axonframework.eventhandling.saga;

import org.axonframework.common.Assert;
import org.axonframework.eventhandling.EventMessage;
import org.axonframework.eventhandling.TrackedEventMessage;
import org.axonframework.eventhandling.saga.metamodel.SagaModel;
import org.axonframework.eventsourcing.eventstore.TrackingToken;

import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import java.util.function.Function;

/**
 * Implementation of the {@link Saga interface} that allows for a POJO instance with annotated message handlers to act
 * as a Saga. The POJO instance can access static methods on {@link SagaLifecycle} as long as it is access via the
 * {@link #execute(Consumer)} or {@link #invoke(Function)} methods.
 *
 * @author Allard Buijze
 * @since 3.0
 */
public class AnnotatedSaga<T> extends SagaLifecycle implements Saga<T> {

    private final SagaModel<T> metaModel;

    private final AssociationValues associationValues;
    private volatile boolean isActive = true;
    private final String sagaId;
    private final T sagaInstance;
    private final AtomicReference<TrackingToken> trackingToken;

    /**
     * Creates an AnnotatedSaga instance to wrap the given {@code annotatedSaga}, identifier with the given
     * {@code sagaId} and associated with the given {@code associationValues}. The {@code metaModel} provides the
     * description of the structure of the Saga.
     *
     * @param sagaId            The identifier of this Saga instance
     * @param associationValues The current associations of this Saga
     * @param annotatedSaga     The object instance representing the Saga
     * @param trackingToken     The token identifying the position in a stream the saga has last processed
     * @param metaModel         The model describing Saga structure
     */
    public AnnotatedSaga(String sagaId, Set<AssociationValue> associationValues,
                         T annotatedSaga, TrackingToken trackingToken, SagaModel<T> metaModel) {
        Assert.notNull(annotatedSaga, "SagaInstance may not be null");
        this.sagaId = sagaId;
        this.associationValues = new AssociationValuesImpl(associationValues);
        this.sagaInstance = annotatedSaga;
        this.metaModel = metaModel;
        this.trackingToken = new AtomicReference<>(trackingToken);
    }

    @Override
    public String getSagaIdentifier() {
        return sagaId;
    }

    @Override
    public AssociationValues getAssociationValues() {
        return associationValues;
    }

    @Override
    public <R> R invoke(Function<T, R> invocation) {
        try {
            return executeWithResult(() -> invocation.apply(sagaInstance));
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new SagaExecutionException("Exception while invoking a Saga", e);
        }
    }

    @Override
    public void execute(Consumer<T> invocation) {
        super.execute(() -> invocation.accept(sagaInstance));
    }

    @Override
    public final boolean handle(EventMessage<?> event) {
        if (isActive) {
            return metaModel.findHandlerMethods(event).stream()
                    .filter(h -> getAssociationValues().contains(h.getAssociationValue(event)))
                    .findFirst().map(h -> {
                        try {
                            executeWithResult(() -> h.handle(event, sagaInstance));
                            if (event instanceof TrackedEventMessage) {
                                this.trackingToken.set(((TrackedEventMessage) event).trackingToken());
                            }
                        } catch (RuntimeException | Error e) {
                            throw e;
                        } catch (Exception e) {
                            throw new SagaExecutionException("Exception while handling an Event in a Saga", e);
                        } finally {
                            if (h.isEndingHandler()) {
                                doEnd();
                            }
                        }
                        return true;
                    })
                    .orElse(false);
        }
        return false;
    }

    @Override
    public boolean isActive() {
        return isActive;
    }

    @Override
    public TrackingToken trackingToken() {
        return trackingToken.get();
    }

    /**
     * Returns the (annotated) Saga instance. This method should not be used to modify the Saga's state, as it doesn't
     * allow the instance to access the static methods on {@link SagaLifecycle}.
     *
     * @return the Saga instance
     */
    public T root() {
        return sagaInstance;
    }

    /**
     * Marks the saga as ended. Ended saga's may be cleaned up by the repository when they are committed.
     */
    protected void doEnd() {
        isActive = false;
    }

    /**
     * Registers a AssociationValue with the given saga. When the saga is committed, it can be found using the
     * registered property.
     *
     * @param property The value to associate this saga with.
     */
    protected void doAssociateWith(AssociationValue property) {
        associationValues.add(property);
    }

    /**
     * Removes the given association from this Saga. When the saga is committed, it can no longer be found using the
     * given association. If the given property wasn't registered with the saga, nothing happens.
     *
     * @param property the association value to remove from the saga.
     */
    protected void doRemoveAssociation(AssociationValue property) {
        associationValues.remove(property);
    }

}

redpajama_set_name: RedPajamaGithub


text:
import path from 'path'
import { assertProject } from '@pnpm/assert-project'
import { importCommand } from '@pnpm/plugin-commands-installation'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { readProjects } from '@pnpm/filter-workspace-packages'
import { fixtures } from '@pnpm/test-fixtures'
import tempy from 'tempy'

const f = fixtures(__dirname)
const REGISTRY = `http://localhost:${REGISTRY_MOCK_PORT}`
const TMP = tempy.directory()

const DEFAULT_OPTS = {
  ca: undefined,
  cacheDir: path.join(TMP, 'cache'),
  cert: undefined,
  fetchRetries: 2,
  fetchRetryFactor: 90,
  fetchRetryMaxtimeout: 90,
  fetchRetryMintimeout: 10,
  httpsProxy: undefined,
  key: undefined,
  localAddress: undefined,
  lock: false,
  lockStaleDuration: 90,
  networkConcurrency: 16,
  offline: false,
  proxy: undefined,
  pnpmHomeDir: '',
  rawConfig: { registry: REGISTRY },
  registries: { default: REGISTRY },
  registry: REGISTRY,
  storeDir: path.join(TMP, 'store'),
  strictSsl: false,
  userAgent: 'pnpm',
  userConfig: {},
  useRunningStoreServer: false,
  useStoreServer: false,
}

test('import from shared yarn.lock of monorepo', async () => {
  f.prepare('workspace-has-shared-yarn-lock')
  const { allProjects, allProjectsGraph, selectedProjectsGraph } = await readProjects(process.cwd(), [])
  await importCommand.handler({
    ...DEFAULT_OPTS,
    allProjects: allProjects as any, // eslint-disable-line @typescript-eslint/no-explicit-any
    allProjectsGraph,
    selectedProjectsGraph,
    workspaceDir: process.cwd(),
    lockfileDir: process.cwd(),
    dir: process.cwd(),
  }, [])

  const project = assertProject(process.cwd())
  const lockfile = await project.readLockfile()
  expect(lockfile.packages).toHaveProperty(['/is-positive/1.0.0'])
  expect(lockfile.packages).toHaveProperty(['/is-negative/1.0.1'])

  // node_modules is not created
  await project.hasNot('is-positive')
  await project.hasNot('is-negative')
})

test('import from shared package-lock.json of monorepo', async () => {
  f.prepare('workspace-has-shared-package-lock-json')
  const { allProjects, allProjectsGraph, selectedProjectsGraph } = await readProjects(process.cwd(), [])
  await importCommand.handler({
    ...DEFAULT_OPTS,
    allProjects: allProjects as any, // eslint-disable-line @typescript-eslint/no-explicit-any
    allProjectsGraph,
    selectedProjectsGraph,
    workspaceDir: process.cwd(),
    lockfileDir: process.cwd(),
    dir: process.cwd(),
  }, [])

  const project = assertProject(process.cwd())
  const lockfile = await project.readLockfile()
  expect(lockfile.packages).toHaveProperty(['/is-positive/1.0.0'])
  expect(lockfile.packages).toHaveProperty(['/is-negative/1.0.1'])

  // node_modules is not created
  await project.hasNot('is-positive')
  await project.hasNot('is-negative')
})

test('import from shared npm-shrinkwrap.json of monorepo', async () => {
  f.prepare('workspace-has-shared-npm-shrinkwrap-json')
  const { allProjects, allProjectsGraph, selectedProjectsGraph } = await readProjects(process.cwd(), [])
  await importCommand.handler({
    ...DEFAULT_OPTS,
    allProjects: allProjects as any, // eslint-disable-line @typescript-eslint/no-explicit-any
    allProjectsGraph,
    selectedProjectsGraph,
    workspaceDir: process.cwd(),
    lockfileDir: process.cwd(),
    dir: process.cwd(),
  }, [])

  const project = assertProject(process.cwd())
  const lockfile = await project.readLockfile()
  expect(lockfile.packages).toHaveProperty(['/is-positive/1.0.0'])
  expect(lockfile.packages).toHaveProperty(['/is-negative/1.0.1'])

  // node_modules is not created
  await project.hasNot('is-positive')
  await project.hasNot('is-negative')
})


text:
<?php
namespace Modules\Necrolab\Models\Rankings;

use \DateTime;
use \Exception;
use \Modules\Necrolab\Models\Necrolab;

class Rankings
extends Necrolab {
    protected static $rankings = array();

    protected static function load($release_id, $mode_id, $seeded, DateTime $date) {}

    public static function get($release_id, $mode_id, $seeded, DateTime $date) {
        static::load($release_id, $mode_id, $seeded, $date);

        $date_formatted = $date->format('Y-m-d');

        $ranking = array();

        if(isset(static::$rankings[$release_id][$mode_id][$seeded][$date_formatted])) {
            $ranking = static::$rankings[$release_id][$mode_id][$seeded][$date_formatted];
        }

        return $ranking;
    }

    public static function getLastRefreshed() {
        return false;
    }

    public static function getGenerateQueueName() {
        return 'power_ranking_generation';
    }

    public static function addToGenerateQueue(DateTime $date) {
        static::addDateToQueue(static::getGenerateQueueName(), $date);
    }

    public static function getCacheQueueName() {
        return 'power_ranking_cache';
    }

    public static function addToCacheQueue(DateTime $date) {
        static::addDateToQueue(static::getCacheQueueName(), $date);
    }

    public static function getFormattedApiRecord($data_row) {
        return $data_row['date'];
    }
}


text:
using System;
using System.IO;
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Specialized;
using NUnit.Core;
using NUnit.Util;

namespace NUnit.ConsoleRunner
{
	/// <summary>
	/// Summary description for EventCollector.
	/// </summary>
	public class EventCollector : MarshalByRefObject, EventListener
	{
		private int testRunCount;
		private int testIgnoreCount;
		private int failureCount;
		private int level;

		private ConsoleOptions options;
		private TextWriter outWriter;
		private TextWriter errorWriter;

		StringCollection messages;

		private bool progress = false;
		private string currentTestName;

		private ArrayList unhandledExceptions = new ArrayList();

		public EventCollector( ConsoleOptions options, TextWriter outWriter, TextWriter errorWriter )
		{
			level = 0;
			this.options = options;
			this.outWriter = outWriter;
			this.errorWriter = errorWriter;
			this.currentTestName = string.Empty;
			this.progress = !options.xmlConsole && !options.labels && !options.nodots;

			AppDomain.CurrentDomain.UnhandledException +=
				new UnhandledExceptionEventHandler(OnUnhandledException);
		}

		public bool HasExceptions
		{
			get { return unhandledExceptions.Count > 0; }
		}

		public void WriteExceptions()
		{
			Console.WriteLine();
			Console.WriteLine("Unhandled exceptions:");
			int index = 1;
			foreach( string msg in unhandledExceptions )
				Console.WriteLine( "{0}) {1}", index++, msg );
		}

		public void RunStarted(string name, int testCount)
		{
		}

		public void RunFinished(TestResult result)
		{
		}

		public void RunFinished(Exception exception)
		{
		}

		public void TestFinished(TestResult testResult)
		{
            switch( testResult.ResultState )
            {
                case ResultState.Error:
                case ResultState.Failure:
                case ResultState.Cancelled:
                    testRunCount++;
			        failureCount++;

			        if ( progress )
				        Console.Write("F");

			        messages.Add( string.Format( "{0}) {1} :", failureCount, testResult.Test.TestName.FullName ) );
			        messages.Add( testResult.Message.Trim( Environment.NewLine.ToCharArray() ) );

			        string stackTrace = StackTraceFilter.Filter( testResult.StackTrace );
			        if ( stackTrace != null && stackTrace != string.Empty )
			        {
				        string[] trace = stackTrace.Split( System.Environment.NewLine.ToCharArray() );
				        foreach( string s in trace )
				        {
					        if ( s != string.Empty )
					        {
						        string link = Regex.Replace( s.Trim(), @".* in (.*):line (.*)", "$1($2)");
						        messages.Add( string.Format( "at\n{0}", link ) );
					        }
				        }
			        }
                    break;

                case ResultState.Inconclusive:
                case ResultState.Success:
                    testRunCount++;
                    break;

                case ResultState.Ignored:
                case ResultState.Skipped:
                case ResultState.NotRunnable:
    				testIgnoreCount++;

	    			if ( progress )
		    			Console.Write("N");
                    break;
			}

			currentTestName = string.Empty;
		}

		public void TestStarted(TestName testName)
		{
			currentTestName = testName.FullName;

			if ( options.labels )
				outWriter.WriteLine("***** {0}", currentTestName );

			if ( progress )
				Console.Write(".");
		}

		public void SuiteStarted(TestName testName)
		{
			if ( level++ == 0 )
			{
				messages = new StringCollection();
				testRunCount = 0;
				testIgnoreCount = 0;
				failureCount = 0;
				Trace.WriteLine( "################################ UNIT TESTS ################################" );
				Trace.WriteLine( "Running tests in '" + testName.FullName + "'..." );
			}
		}

		public void SuiteFinished(TestResult suiteResult)
		{
			if ( --level == 0)
			{
				Trace.WriteLine( "############################################################################" );

				if (messages.Count == 0)
				{
					Trace.WriteLine( "##############                 S U C C E S S               #################" );
				}
				else
				{
					Trace.WriteLine( "##############                F A I L U R E S              #################" );

					foreach ( string s in messages )
					{
						Trace.WriteLine(s);
					}
				}

				Trace.WriteLine( "############################################################################" );
				Trace.WriteLine( "Executed tests       : " + testRunCount );
				Trace.WriteLine( "Ignored tests        : " + testIgnoreCount );
				Trace.WriteLine( "Failed tests         : " + failureCount );
				Trace.WriteLine( "Unhandled exceptions : " + unhandledExceptions.Count);
				Trace.WriteLine( "Total time           : " + suiteResult.Time + " seconds" );
				Trace.WriteLine( "############################################################################");
			}
		}

		private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
		{
			if (e.ExceptionObject.GetType() != typeof(System.Threading.ThreadAbortException))
			{
				this.UnhandledException((Exception)e.ExceptionObject);
			}
		}

		public void UnhandledException( Exception exception )
		{
			// If we do labels, we already have a newline
			unhandledExceptions.Add(currentTestName + " : " + exception.ToString());
			//if (!options.labels) outWriter.WriteLine();
			string msg = string.Format("##### Unhandled Exception while running {0}", currentTestName);
			//outWriter.WriteLine(msg);
			//outWriter.WriteLine(exception.ToString());

			Trace.WriteLine(msg);
			Trace.WriteLine(exception.ToString());
		}

		public void TestOutput( TestOutput output)
		{
			switch ( output.Type )
			{
				case TestOutputType.Out:
					outWriter.Write( output.Text );
					break;
				case TestOutputType.Error:
					errorWriter.Write( output.Text );
					break;
			}
		}

		public override object InitializeLifetimeService()
		{
			return null;
		}
	}
}


text:
//go:build !ignore_autogenerated
// +build !ignore_autogenerated

// Code generated by deepcopy-gen. DO NOT EDIT.

package v1

import (
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CertificatePrivateKey) DeepCopyInto(out *CertificatePrivateKey) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificatePrivateKey.
func (in *CertificatePrivateKey) DeepCopy() *CertificatePrivateKey {
	if in == nil {
		return nil
	}
	out := new(CertificatePrivateKey)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CertificateSpec) DeepCopyInto(out *CertificateSpec) {
	*out = *in
	if in.IssuerRef != nil {
		in, out := &in.IssuerRef, &out.IssuerRef
		*out = new(corev1.TypedLocalObjectReference)
		(*in).DeepCopyInto(*out)
	}
	if in.Subject != nil {
		in, out := &in.Subject, &out.Subject
		*out = new(X509Subject)
		(*in).DeepCopyInto(*out)
	}
	if in.Duration != nil {
		in, out := &in.Duration, &out.Duration
		*out = new(metav1.Duration)
		**out = **in
	}
	if in.RenewBefore != nil {
		in, out := &in.RenewBefore, &out.RenewBefore
		*out = new(metav1.Duration)
		**out = **in
	}
	if in.DNSNames != nil {
		in, out := &in.DNSNames, &out.DNSNames
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.IPAddresses != nil {
		in, out := &in.IPAddresses, &out.IPAddresses
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.URIs != nil {
		in, out := &in.URIs, &out.URIs
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.EmailAddresses != nil {
		in, out := &in.EmailAddresses, &out.EmailAddresses
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.PrivateKey != nil {
		in, out := &in.PrivateKey, &out.PrivateKey
		*out = new(CertificatePrivateKey)
		**out = **in
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSpec.
func (in *CertificateSpec) DeepCopy() *CertificateSpec {
	if in == nil {
		return nil
	}
	out := new(CertificateSpec)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Condition) DeepCopyInto(out *Condition) {
	*out = *in
	in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (in *Condition) DeepCopy() *Condition {
	if in == nil {
		return nil
	}
	out := new(Condition)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference.
func (in *ObjectReference) DeepCopy() *ObjectReference {
	if in == nil {
		return nil
	}
	out := new(ObjectReference)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceID) DeepCopyInto(out *ResourceID) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceID.
func (in *ResourceID) DeepCopy() *ResourceID {
	if in == nil {
		return nil
	}
	out := new(ResourceID)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TLSConfig) DeepCopyInto(out *TLSConfig) {
	*out = *in
	if in.IssuerRef != nil {
		in, out := &in.IssuerRef, &out.IssuerRef
		*out = new(corev1.TypedLocalObjectReference)
		(*in).DeepCopyInto(*out)
	}
	if in.Certificates != nil {
		in, out := &in.Certificates, &out.Certificates
		*out = make([]CertificateSpec, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig.
func (in *TLSConfig) DeepCopy() *TLSConfig {
	if in == nil {
		return nil
	}
	out := new(TLSConfig)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *X509Subject) DeepCopyInto(out *X509Subject) {
	*out = *in
	if in.Organizations != nil {
		in, out := &in.Organizations, &out.Organizations
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.Countries != nil {
		in, out := &in.Countries, &out.Countries
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.OrganizationalUnits != nil {
		in, out := &in.OrganizationalUnits, &out.OrganizationalUnits
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.Localities != nil {
		in, out := &in.Localities, &out.Localities
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.Provinces != nil {
		in, out := &in.Provinces, &out.Provinces
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.StreetAddresses != nil {
		in, out := &in.StreetAddresses, &out.StreetAddresses
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	if in.PostalCodes != nil {
		in, out := &in.PostalCodes, &out.PostalCodes
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new X509Subject.
func (in *X509Subject) DeepCopy() *X509Subject {
	if in == nil {
		return nil
	}
	out := new(X509Subject)
	in.DeepCopyInto(out)
	return out
}


text:
import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    View,
    ListView,
    Image,
    TouchableHighlight
} from 'react-native';

import Constants from '../config/constants';
import Colors from '../config/colors';

// import {Environment} from '../config/environment';
const REQUEST_URL = Constants.BASE_URL + 'players/stats';

class LeaderboardScreen extends Component {

    constructor(props) {
      props.title="Leaderboard";
        super(props);
        this.state = {
            players: []
        };
    }

    componentDidMount() {
        this.fetchData();
    }

    getPlayerImageUrl(player) {
        if (player && player.avatarUrl) {
            return player.avatarUrl;
        }

        return 'http://combonetwork.com/img/empty_profile.png';
    }

    fetchData() {
        fetch(REQUEST_URL, {
          headers: {
            Accept: 'application/json',
            Authorization: 'Token token=' + Constants.API_TOKEN,
          }
            })
            .then((response) => response.json())
            .then((responseData) => {
                console.log(responseData);
                this.setState({
                    players: responseData
                });
            })
            .done();
    }

    render() {
        console.log('Render started: ', this.state.players);
        if (!this.state.players || this.state.players.length === 0) {
            return (
                <View style={styles.loadingContainer}>
                    <Text style={styles.welcome}>Loading leaderboard...</Text>
                </View>
            );
        }

        const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
        const dataSource = ds.cloneWithRows(this.state.players);

        return (
            <View style={styles.container}>
                <ListView
                    enableEmptySections
                    dataSource={dataSource}
                    contentContainerStyle={styles.listContent}
                    renderRow={(rowData) =>
                        <TouchableHighlight style={styles.row}>
                            <View style={styles.item}>
                                <Image
                                    style={styles.image}
                                    source={{ uri: this.getPlayerImageUrl(rowData.user) }}
                                    resizeMode="cover"
                                />
                                <View>
                                  <Text style={styles.title}>{rowData.user.firstName} {rowData.user.lastName}</Text>
                                  <Text style={styles.text}>Wins: {rowData.stat.gamesWon}</Text>
                                  <Text style={styles.text}>Losses: {rowData.stat.gamesLost}</Text>
                                  <Text style={styles.text}>Ratio: {rowData.stat.gameRatio}</Text>
                                </View>
                            </View>
                        </TouchableHighlight>
                    }
                />
            </View>
        );
    }
}

const styles = StyleSheet.create({
    loadingContainer: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center'
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
        color: 'black',
    },
    container: {
        flex: 1,
        backgroundColor: 'white',
        marginBottom: 0,
        marginTop: 60,
        backgroundColor: Colors.grey6
    },
    row: {
        marginLeft: 14,
        marginRight: 14,
        marginTop: 10,
        backgroundColor: 'white',
         borderWidth: 1,
        borderStyle: 'solid',
        borderColor: '#ccc',
        borderRadius: 3,
        shadowColor: '#666', // shadow doesn't work on Android, perhaps use https://github.com/879479119/react-native-shadow
        shadowOffset: {
            width: 0,
            height: 1
        },
        shadowRadius: 2,
        shadowOpacity: 0.3
    },
    item: {
        flex: 1,
        flexDirection: 'row',
        height: 80
    },
    image: {
        marginTop: 10,
        width: 60,
        height: 60,
        borderRadius: 30,
        marginLeft: 10
    },
    title: {
        marginLeft: 16,
        flexDirection: 'row',
        justifyContent: 'space-around',
        fontSize: 20
    },
    text: {
        marginLeft: 16,
        flexDirection: 'row',
        justifyContent: 'space-around',
        fontSize: 14
    },
    listContent: {
        padding: 2,
        paddingTop: 0,
    },
});

export default LeaderboardScreen;


text:
int main() {
    tinyxml2::XMLDocument doc;
    doc.LoadFile("dummy.xml");

    return 0;
}


text: from jawbone import Jawbone


text:
package ingress

import networking "k8s.io/api/networking/v1"

func FindIngressDNSName(ing *networking.Ingress) string {
	for _, ingSTS := range ing.Status.LoadBalancer.Ingress {
		if ingSTS.Hostname != "" {
			return ingSTS.Hostname
		}
	}
	return ""
}


text:
using System.Web.Mvc;

namespace OpenLibrary.Mvc.Helper
{
	/// <summary>
	/// Jenis format
	/// </summary>
	public enum FormatType
	{
		/// <summary>
		/// Format angka tanpa digit desimal
		/// </summary>
		Numeric,

		/// <summary>
		/// Format angka dengan 2 digit desimal
		/// </summary>
		NumericWithDecimalPoint,

		/// <summary>
		/// Format prosentase (ada karakter '%') tanpa digit desimal
		/// </summary>
		Percentage,

		/// <summary>
		/// Format prosentase (ada karakter '%') dengan 2 digit desimal
		/// </summary>
		PercentageWithDecimalPoint,

		/// <summary>
		/// Format tanggal
		/// </summary>
		Date,

		/// <summary>
		/// Format jam
		/// </summary>
		Time,

		/// <summary>
		/// Format tanggal & jam
		/// </summary>
		DateTime,

		/// <summary>
		/// Format boolean menjadi yes (jika true) atau no (jika false)
		/// </summary>
		YesNo
	}

	/// <summary>
	/// Helper for print format
	/// </summary>
	public static class FormatHelper
	{
		private const string THOUSAND_SEPARATOR = ",";
		private const string DECIMAL_SEPARATOR = ".";
		private const string DEFAULT_DATEFORMAT = "yyyy-MM-dd";
		private const string DEFAULT_TIMEFORMAT = "HH:mm";
		private const string DEFAULT_EMPTY = "-";

		/// <summary>
		/// Menggenerate format yg compatible dengan C# atau kendo
		/// </summary>
		/// <param name="formatType">jenis format</param>
		/// <param name="isCSharpFormat">jika ya, maka akan digunakan {0:format}</param>
		/// <param name="decimalPoint">jumlah digit desimal</param>
		/// <param name="suffix">tambahan kata di akhir</param>
		/// <param name="prefix">tambahan kata di awal</param>
		/// <param name="dateFormat">custom date format (default: yyyy-MM-dd)</param>
		/// <param name="forcePaddingZero">paksa isi dengan angka 0 jika nilai decimal tidak ada (hanya jika <paramref name="decimalPoint"/> > 0</param>
		/// <returns>string</returns>
		private static string PrepareFormat(FormatType formatType, bool isCSharpFormat = true, int decimalPoint = 2, string suffix = "", string prefix = "", string dateFormat = "", bool forcePaddingZero = true)
		{
			string format = string.Empty;
			string defaultDateFormat = DEFAULT_DATEFORMAT;
			switch (formatType)
			{
				case FormatType.Numeric:
				case FormatType.Percentage:
					format = "#" + THOUSAND_SEPARATOR + (forcePaddingZero ? "0" : "#");
					break;
				case FormatType.NumericWithDecimalPoint:
				case FormatType.PercentageWithDecimalPoint:
					format = "#" + THOUSAND_SEPARATOR + (forcePaddingZero ? "0" : "#");
					if (decimalPoint > 0)
						format += DECIMAL_SEPARATOR + new System.String(forcePaddingZero ? '0' : '#', decimalPoint);
					break;
				case FormatType.Date:
					format = string.IsNullOrEmpty(dateFormat) ? defaultDateFormat : dateFormat;
					break;
				case FormatType.Time:
					format = DEFAULT_TIMEFORMAT;
					break;
				case FormatType.DateTime:
					format = (string.IsNullOrEmpty(dateFormat) ? defaultDateFormat : dateFormat) + " " + DEFAULT_TIMEFORMAT;
					break;
			}
			//untuk format C#, harus menggunakan {x:#} dst
			if (isCSharpFormat)
				format = "{0:" + format + "}";
			//karakter tambahan harus diluar {x}
			if (formatType.ToString().Contains("Percentage"))
				format += " %";
			if (!string.IsNullOrEmpty(prefix))
				format = prefix + " " + format;
			if (!string.IsNullOrEmpty(suffix))
				format += " " + suffix;
			return format;
		}

		/// <summary>
		/// Generate string format
		/// </summary>
		/// <param name="helper"></param>
		/// <param name="formatType">jenis format</param>
		/// <param name="isCSharpFormat">menentukan apakah format yg diinginkan format untuk bahasa C# atau tidak (dalam kurung kurawal)</param>
		/// <param name="decimalPoint">number of decimal digit, hanya berlaku untuk jenis format angka (default: 0)</param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <param name="dateFormat">format tanggal</param>
		/// <param name="forcePaddingZero">paksa isi dengan angka 0 jika nilai decimal tidak ada (hanya jika <paramref name="decimalPoint"/> > 0, hanya berlaku untuk jenis format angka</param>
		/// <returns>string format</returns>
		public static string Format(this HtmlHelper helper, FormatType formatType, bool isCSharpFormat = true, int decimalPoint = 2, string suffix = "", string prefix = "", string dateFormat = "", bool forcePaddingZero = true)
		{
			return PrepareFormat(formatType, isCSharpFormat, decimalPoint, suffix, prefix, dateFormat, forcePaddingZero);
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="decimalPoint">number of decimal digit, hanya berlaku untuk jenis format angka (default: 0)</param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <param name="forcePaddingZero">paksa isi dengan angka 0 jika nilai decimal tidak ada (hanya jika <paramref name="decimalPoint"/> > 0, hanya berlaku untuk jenis format angka</param>
		/// <returns></returns>
		public static string Format(this double number, int decimalPoint = 2, string suffix = "", string prefix = "", bool forcePaddingZero = true)
		{
			return number.ToString(PrepareFormat(FormatType.NumericWithDecimalPoint, isCSharpFormat: false, decimalPoint: decimalPoint, suffix: suffix, prefix: prefix, forcePaddingZero: forcePaddingZero), System.Threading.Thread.CurrentThread.CurrentCulture);
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="decimalPoint">number of decimal digit, hanya berlaku untuk jenis format angka (default: 0)</param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <param name="forcePaddingZero">paksa isi dengan angka 0 jika nilai decimal tidak ada (hanya jika <paramref name="decimalPoint"/> > 0, hanya berlaku untuk jenis format angka</param>
		/// <returns></returns>
		public static string Format(this double? number, int decimalPoint = 2, string suffix = "", string prefix = "", bool forcePaddingZero = true)
		{
			return number.HasValue
				? number.Value.Format(decimalPoint, suffix, prefix, forcePaddingZero)
				: DEFAULT_EMPTY;
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="decimalPoint">number of decimal digit, hanya berlaku untuk jenis format angka (default: 0)</param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <param name="forcePaddingZero">paksa isi dengan angka 0 jika nilai decimal tidak ada (hanya jika <paramref name="decimalPoint"/> > 0, hanya berlaku untuk jenis format angka</param>
		/// <returns></returns>
		public static string Format(this decimal number, int decimalPoint = 2, string suffix = "", string prefix = "", bool forcePaddingZero = true)
		{
			return Format((double)number, decimalPoint, suffix, prefix, forcePaddingZero);
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="decimalPoint">number of decimal digit, hanya berlaku untuk jenis format angka (default: 0)</param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <param name="forcePaddingZero">paksa isi dengan angka 0 jika nilai decimal tidak ada (hanya jika <paramref name="decimalPoint"/> > 0, hanya berlaku untuk jenis format angka</param>
		/// <returns></returns>
		public static string Format(this decimal? number, int decimalPoint = 2, string suffix = "", string prefix = "", bool forcePaddingZero = true)
		{
			return Format((double?)number, decimalPoint, suffix, prefix, forcePaddingZero);
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <returns></returns>
		public static string Format(this long number, string suffix = "", string prefix = "")
		{
			return number.ToString(PrepareFormat(FormatType.Numeric, isCSharpFormat: false, suffix: suffix, prefix: prefix), System.Threading.Thread.CurrentThread.CurrentCulture);
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <returns></returns>
		public static string Format(this long? number, string suffix = "", string prefix = "")
		{
			return number.HasValue
				? number.Value.Format(suffix, prefix)
				: DEFAULT_EMPTY;
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <returns></returns>
		public static string Format(this int number, string suffix = "", string prefix = "")
		{
			return Format((long)number, suffix, prefix);
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <returns></returns>
		public static string Format(this int? number, string suffix = "", string prefix = "")
		{
			return Format((long?)number, suffix, prefix);
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <returns></returns>
		public static string Format(this short number, string suffix = "", string prefix = "")
		{
			return Format((long)number, suffix, prefix);
		}

		/// <summary>
		/// Format untuk angka
		/// </summary>
		/// <param name="number"></param>
		/// <param name="suffix">character after formatting</param>
		/// <param name="prefix">character before formatting</param>
		/// <returns></returns>
		public static string Format(this short? number, string suffix = "", string prefix = "")
		{
			return Format((long?)number, suffix, prefix);
		}

		/// <summary>
		/// Format date & time
		/// </summary>
		/// <param name="dateTime"></param>
		/// <param name="dateFormat">format spesifik waktu (default jika kosong: yyyy-MM-dd HH:mm)</param>
		/// <returns></returns>
		public static string Format(this System.DateTime dateTime, string dateFormat = "")
		{
			return dateTime.ToString(PrepareFormat(FormatType.DateTime, isCSharpFormat: false, dateFormat: dateFormat));
		}

		/// <summary>
		/// Format date & time
		/// </summary>
		/// <param name="dateTime"></param>
		/// <param name="dateFormat">format spesifik waktu (default jika kosong: yyyy-MM-dd HH:mm)</param>
		/// <returns></returns>
		public static string Format(this System.DateTime? dateTime, string dateFormat = "")
		{
			return dateTime.HasValue
				? dateTime.Value.Format(dateFormat)
				: DEFAULT_EMPTY;
		}

		/// <summary>
		/// Format for date
		/// </summary>
		/// <param name="dateTime"></param>
		/// <param name="dateFormat">format spesifik waktu (default jika kosong: yyyy-MM-dd)</param>
		/// <returns></returns>
		public static string FormatDate(this System.DateTime dateTime, string dateFormat = "")
		{
			return dateTime.ToString(PrepareFormat(FormatType.Date, isCSharpFormat: false, dateFormat: dateFormat));
		}

		/// <summary>
		/// Format for date
		/// </summary>
		/// <param name="dateTime"></param>
		/// <param name="dateFormat">format spesifik waktu (default jika kosong: yyyy-MM-dd)</param>
		/// <returns></returns>
		public static string FormatDate(this System.DateTime? dateTime, string dateFormat = "")
		{
			return dateTime.HasValue
				? dateTime.Value.FormatDate(dateFormat)
				: DEFAULT_EMPTY;
		}

		/// <summary>
		/// Format untuk time
		/// </summary>
		/// <param name="dateTime"></param>
		/// <param name="dateFormat">format spesifik waktu (default jika kosong: HH:mm)</param>
		/// <returns></returns>
		public static string FormatTime(this System.DateTime dateTime, string dateFormat = "")
		{
			return dateTime.ToString(PrepareFormat(FormatType.Time, isCSharpFormat: false, dateFormat: dateFormat));
		}

		/// <summary>
		/// Format untuk time
		/// </summary>
		/// <param name="dateTime"></param>
		/// <param name="dateFormat">format spesifik waktu (default jika kosong: HH:mm)</param>
		/// <returns></returns>
		public static string FormatTime(this System.DateTime? dateTime, string dateFormat = "")
		{
			return dateTime.HasValue
				? dateTime.Value.FormatTime(dateFormat)
				: DEFAULT_EMPTY;
		}

		/// <summary>
		/// Format yes/no
		/// </summary>
		/// <param name="boolean"></param>
		/// <returns></returns>
		public static string Format(this bool boolean)
		{
			return boolean ? "yes" : "no";
		}

		/// <summary>
		/// Format yes/no
		/// </summary>
		/// <param name="boolean"></param>
		/// <returns></returns>
		public static string Format(this bool? boolean)
		{
			return boolean.HasValue
				? boolean.Value ? "yes" : "no"
				: DEFAULT_EMPTY;
		}
	}
}


text:
package app.action;

import app.shipper.BasicShipper;

public class Drop extends BasicShipperAction {
	public Drop(BasicShipper target) {
		super(target);
	}

	@Override
	public void start() {
		System.out.println("Hey . " + target.getName() + " is droping package " + target.getPack() + " duuuuude");

		if(target.getPack() == null || target.getPack().isEmpty()) {
			throw new IllegalStateException("Can not drop a package. I DONT HAVE ONE");
		}
		super.start();
	}

	@Override
	public void end() {
		super.end();
		target.setPack(null);
	}
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>São João</logradouro><bairro>Vila Nova</bairro><cidade>Cubatão</cidade><uf>SP</uf><cep>11520160</cep></feed>


text:
class PluginConfigFactory {
  constructor (MyCDAPDataSource, $q, myHelpers) {
    this.dataSrc = new MyCDAPDataSource();
    this.$q = $q;
    this.myHelpers = myHelpers;
  }
  // Seems super lame. Need to remove this.
  fetch(templateid, pluginid) {
    return this.dataSrc.config({
      templateid: templateid, //'etlRealtime',
      pluginid: pluginid //'TwitterSource'
    });
  }

  generateNodeConfig(backendProperties, nodeConfig) {
    var isNewSpecVersion = this.myHelpers.objectQuery(nodeConfig, 'metadata', 'spec-version');
    if (isNewSpecVersion) {
      return this.generateConfigForNewSpec(backendProperties, nodeConfig);
    } else {
      return this.generateConfigForOlderSpec(backendProperties, nodeConfig);
    }
  }

  generateConfigForNewSpec(backendProperties, nodeConfig) {
    var propertiesFromBackend = Object.keys(backendProperties);
    var groupsConfig = {
      backendProperties: propertiesFromBackend,
      outputSchema: {
        isOutputSchemaExists: false,
        schemaProperties: null,
        outputSchemaProperty: null,
        isOutputSchemaRequired: null,
        implicitSchema: null
      },
      groups: []
    };
    var missedFieldsGroup = {
      display: 'Generic',
      fields: []
    };

    // Parse configuration groups
    nodeConfig['configuration-groups'].forEach( (group) => {
      let matchedProperties = group.properties.filter( (property) => {
        let index = propertiesFromBackend.indexOf(property.name);
        if (index !== -1) {
          propertiesFromBackend.splice(index, 1);
          let description = property.description;
          if (!description || (description && !description.length)) {
            description = this.myHelpers.objectQuery(backendProperties, property.name, 'description');
            property.description = description || 'No Description Available';
          }
          property.label = property.label || property.name;
          property.defaultValue = this.myHelpers.objectQuery(property, 'widget-attributes', 'default');
          return true;
        }
        return false;
      });
      groupsConfig.groups.push({
        display: group.label,
        fields: matchedProperties
      });
    });

    // Parse 'outputs' and find the property that needs to be used as output schema.
    if (nodeConfig.outputs && nodeConfig.outputs.length) {
      nodeConfig.outputs.forEach( output => {
        var index;
        if (output['widget-type'] === 'non-editable-schema-editor') {
          groupsConfig.outputSchema.isOutputSchemaExists = true;
          groupsConfig.outputSchema.implicitSchema = output.schema;
        } else {
          index = propertiesFromBackend.indexOf(output.name);
          groupsConfig.outputSchema.isOutputSchemaExists = true;
          groupsConfig.outputSchema.outputSchemaProperty = [output.name];
          groupsConfig.outputSchema.schemaProperties = output['widget-attributes'];
          groupsConfig.outputSchema.isOutputSchemaRequired = backendProperties[output.name].required;
          if (index !== -1) {
            propertiesFromBackend.splice(index, 1);
          }
        }
      });
    }

    // Parse properties that are from backend but not from config json.
    if (propertiesFromBackend.length) {
      propertiesFromBackend.forEach( property => {
        missedFieldsGroup.fields.push({
          'widget-type': 'textbox',
          label: property,
          name: property,
          info: 'Info',
          description: this.myHelpers.objectQuery(backendProperties, property, 'description') || 'No Description Available'
        });
      });
      groupsConfig.groups.push(missedFieldsGroup);
    }

    return groupsConfig;
  }

  generateConfigForOlderSpec(backendProperties, nodeConfig) {
    var propertiesFromBackend = Object.keys(backendProperties);
    var groupConfig = {
      backendProperties: propertiesFromBackend,
      outputSchema: {
        isOutputSchemaExists: false,
        schemaProperties: null,
        outputSchemaProperty: null,
        isOutputSchemaRequired: null,
        implicitSchema: false
      },
      groups: []
    };
    var index;
    var schemaProperty;

    // Parse 'outputs' and find the property that needs to be used as output schema.
    if (nodeConfig.outputschema) {
      groupConfig.outputSchema.outputSchemaProperty = Object.keys(nodeConfig.outputschema);

      if (!nodeConfig.outputschema.implicit) {
        groupConfig.outputSchema.isOutputSchemaExists = (propertiesFromBackend.indexOf(groupConfig.outputSchema.outputSchemaProperty[0]) !== -1);
        if (groupConfig.outputSchema.isOutputSchemaExists) {
          schemaProperty = groupConfig.outputSchema.outputSchemaProperty[0];
          index = propertiesFromBackend.indexOf(schemaProperty);
          groupConfig.outputSchema.schemaProperties = nodeConfig.outputschema[schemaProperty];
          groupConfig.outputSchema.isOutputSchemaRequired = backendProperties[schemaProperty].required;
          propertiesFromBackend.splice(index, 1);
        }
      } else if (nodeConfig.outputschema && nodeConfig.outputschema.implicit) {
        groupConfig.outputSchema.implicitSchema = nodeConfig.outputschema.implict;
        groupConfig.outputSchema.isOutputSchemaExists = true;
      }
    } else {
      groupConfig.outputSchema.isOutputSchemaExists = false;
    }

    // Parse configuration groups
    angular.forEach( nodeConfig.groups.position, (groupName) => {
      var group = nodeConfig.groups[groupName];
      var newGroup = {};
      newGroup.label = group.display;
      newGroup.fields = [];
      angular.forEach(group.position, (fieldName) => {
        var copyOfField = group.fields[fieldName];
        var index = propertiesFromBackend.indexOf(fieldName);
        if (index!== -1) {
          propertiesFromBackend.splice(index, 1);

          copyOfField.name = fieldName;
          copyOfField.info = this.myHelpers.objectQuery(groupConfig, 'groups', groupName, 'fields', fieldName, 'info') || 'Info';

          // If there is a description in the config from nodejs use that otherwise fallback to description from backend.
          let description = this.myHelpers.objectQuery(nodeConfig, 'groups', groupName, 'fields', fieldName, 'description');
          if (!description || (description && !description.length)) {
            description = this.myHelpers.objectQuery('backendProperties', fieldName, 'description');
            copyOfField.description = description || 'No Description Available';
          }

          let label = this.myHelpers.objectQuery(nodeConfig, 'groups', groupName, 'fields', fieldName, 'label');
          if (!label) {
            copyOfField.label = fieldName;
          }

          copyOfField.defaultValue = this.myHelpers.objectQuery(nodeConfig, 'groups', groupName, 'fields', fieldName, 'properties', 'default');
        }
        newGroup.fields.push(copyOfField);
      });
      groupConfig.groups.push(newGroup);
    });

    // After iterating over all the groups check if the propertiesFromBackend is still empty
    // If not there are some fields from backend for which we don't have configuration from the nodejs.
    // Add them to the 'missedFieldsGroup' and show it as a separate group.
    if (propertiesFromBackend.length) {
      let genericGroup = {
        label: 'Generic',
        fields: []
      };
      angular.forEach(propertiesFromBackend, (property) => {
        genericGroup.fields.push({
          widget: 'textbox',
          label: property,
          info: 'Info',
          description: this.myHelpers.objectQuery(backendProperties, property, 'description') || 'No Description Available'
        });
      });
      groupConfig.groups.push(genericGroup);
    }
    return groupConfig;
  }
}

PluginConfigFactory.$inject = ['MyCDAPDataSource', '$q', 'myHelpers'];
angular.module(PKG.name + '.feature.hydrator')
  .service('PluginConfigFactory', PluginConfigFactory);


text:
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
                            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
                            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
	<class name="org.mifos.customers.surveys.business.Survey" table="survey">
		<id name="surveyId" column="survey_id" type="integer" unsaved-value="0" access="field">
			<generator class="native"/>
		</id>
		<property name="name" column="survey_name"/>
		<property name="appliesTo" column="survey_applies_to"/>
		<property name="dateOfCreation" column="date_of_creation"/>
		<property name="state" column="state" not-null="true"/>
		<list name="questions" lazy="false" cascade="evict" inverse="true">
			<key column="survey_id" not-null="true" />
			<index column="question_order"/>
			<one-to-many class="org.mifos.customers.surveys.business.SurveyQuestion"/>
		</list>

		<joined-subclass table="ppi_survey" name="org.mifos.customers.ppi.business.PPISurvey">
			<key column="survey_id"/>
			<property name="veryPoorMin" column="very_poor_min"/>
			<property name="veryPoorMax" column="very_poor_max"/>
			<property name="poorMin" column="poor_min"/>
			<property name="poorMax" column="poor_max"/>
			<property name="atRiskMin" column="at_risk_min"/>
			<property name="atRiskMax" column="at_risk_max"/>
			<property name="nonPoorMin" column="non_poor_min"/>
			<property name="nonPoorMax" column="non_poor_max"/>
			<property name="country" column="country_id"/>
		</joined-subclass>
	</class>
</hibernate-mapping>


text:
define(['angular'], function (angular) {
  'use strict';

  angular.module('primediser.controllers.MainCtrl', [])
    .controller('MainCtrl', ['$scope', '$http',
      function ($scope, $http) {
        $http.get('/api/awesomeThings').success(function (awesomeThings) {
          $scope.awesomeThings = awesomeThings;
        });
      }]);
});


text:
import { store } from './store.js';

export default {
	html: '
0
',
	before_test() {
		store.reset();
	},
	async test({ assert, target }) {
		store.set(42);

		await Promise.resolve();

		assert.htmlEqual(target.innerHTML, '
42
');

		assert.equal(store.numberOfTimesSubscribeCalled(), 1);
	},
	test_ssr({ assert }) {
		assert.equal(store.numberOfTimesSubscribeCalled(), 1);
	}
};


text:
<?php

namespace IMT\DataGrid\Filter\Reflection\Doctrine\ORM;

use IMT\DataGrid\Filter\Reflection\Doctrine\ORM\FilterReflection;
use IMT\DataGrid\Filter\Filter;

/**
 * @author Igor Timoshenko <igor.timoshenko@i.ua>
 */
class FilterReflectionTest extends AbstractTestCase
{
    /**
     * @var FilterReflection
     */
    private $filterReflection;

    /**
     * {@inheritDoc}
     */
    public function setUp()
    {
        parent::setUp();

        $this->filterReflection = new FilterReflection($this->queryBuilder);
    }

    /**
     * @covers IMT\DataGrid\Filter\Reflection\Doctrine\ORM\FilterReflection::__construct
     */
    public function testConstructedWithDependencies()
    {
        $this->assertAttributeInstanceOf(
            'Doctrine\ORM\QueryBuilder',
            'queryBuilder',
            $this->filterReflection
        );
    }

    /**
     * @covers IMT\DataGrid\Filter\Reflection\Doctrine\ORM\FilterReflection::reflect
     */
    public function testReflectWithNonExistingRuleReflection()
    {
        $filter = new Filter(array('groupOp' => 'AND'));
        $filter->addRule($this->getRuleMock('non-existing op'));

        $this->setExpectedException('IMT\DataGrid\Filter\Reflection\Exception\ReflectionNotFoundException');

        $this->filterReflection->reflect($filter);
    }

    /**
     * @covers IMT\DataGrid\Filter\Reflection\Doctrine\ORM\FilterReflection::reflect
     */
    public function testReflectWithoutRules()
    {
        $filter = new Filter(array('groupOp' => 'AND'));

        $this->assertEquals(
            '',
            (string) $this->filterReflection->reflect($filter)
        );
    }

    /**
     * @covers IMT\DataGrid\Filter\Reflection\Doctrine\ORM\FilterReflection::reflect
     */
    public function testReflectWithOneRule()
    {
        $filter = new Filter(array('groupOp' => 'AND'));
        $filter->addRule($this->getRuleMock());

        $this->assertEquals(
            'NOT(field LIKE ?1)',
            (string) $this->filterReflection->reflect($filter)
        );
    }

    /**
     * @covers IMT\DataGrid\Filter\Reflection\Doctrine\ORM\FilterReflection::reflect
     */
    public function testReflectWithTwoRules()
    {
        $filter = new Filter(array('groupOp' => 'AND'));
        $filter
            ->addRule($this->getRuleMock())
            ->addRule($this->getRuleMock('bw'));

        $this->assertEquals(
            'NOT(field LIKE ?1) AND field LIKE ?2',
            (string) $this->filterReflection->reflect($filter)
        );
    }

    /**
     * @covers IMT\DataGrid\Filter\Reflection\Doctrine\ORM\FilterReflection::reflect
     */
    public function testReflectWithTwoRulesAndOneNestedFilterWithoutRules()
    {
        $filter = new Filter(array('groupOp' => 'AND'));
        $filter
            ->addFilter(new Filter(array('groupOp' => 'AND')))
            ->addRule($this->getRuleMock())
            ->addRule($this->getRuleMock('bw'));

        $this->assertEquals(
            'NOT(field LIKE ?1) AND field LIKE ?2',
            (string) $this->filterReflection->reflect($filter)
        );
    }

    /**
     * @covers IMT\DataGrid\Filter\Reflection\Doctrine\ORM\FilterReflection::reflect
     */
    public function testReflectWithTwoRulesAndOneNestedFilterWithTwoRules()
    {
        $filter = new Filter(array('groupOp' => 'AND'));
        $filter
            ->addRule($this->getRuleMock())
            ->addRule($this->getRuleMock('bw'));

        $nestedFilter = new Filter(array('groupOp' => 'AND'));
        $nestedFilter
            ->addRule($this->getRuleMock('cn'))
            ->addRule($this->getRuleMock('en'));

        $filter->addFilter($nestedFilter);

        $this->assertEquals(
            '(NOT(field LIKE ?1) AND field LIKE ?2) AND (field LIKE ?3 AND '
            . 'NOT(field LIKE ?4))',
            (string) $this->filterReflection->reflect($filter)
        );
    }
}


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

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum AccessDeniedExceptionReason {

    UNAUTHORIZED_ACCOUNT("UNAUTHORIZED_ACCOUNT"),
    DEPENDENCY_ACCESS_DENIED("DEPENDENCY_ACCESS_DENIED");

    private String value;

    private AccessDeniedExceptionReason(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return AccessDeniedExceptionReason corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static AccessDeniedExceptionReason fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (AccessDeniedExceptionReason enumEntry : AccessDeniedExceptionReason.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
package me.shuza.rxdemoapicall;

import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import org.w3c.dom.Text;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class MainActivity extends AppCompatActivity {
    @BindView(R.id.tvName)
    TextView tvName;

    @BindView(R.id.tvEmail)
    TextView tvEmail;

    @BindView(R.id.tvBlog)
    TextView tvBlog;

    @BindView(R.id.btnLoad)
    Button btnLoad;

    private ProgressDialog progressDialog;

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

        progressDialog = new ProgressDialog(this);
        progressDialog.setCancelable(false);
        progressDialog.setTitle("Loading...");
    }

    @OnClick(R.id.btnLoad)
    public void loadStudentList(View view) {
        progressDialog.show();
        getDataFromAPI();
    }

    public void getDataFromAPI() {
        ApiService apiService = NetworkManager.createRetrofit().create(ApiService.class);
        apiService.getDataFromAPI()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Observer<ResponsePojo>() {
                    @Override
                    public void onSubscribe(Disposable d) {

                    }

                    @Override
                    public void onNext(ResponsePojo data) {
                        progressDialog.dismiss();
                        tvName.setText("Name : " + data.getName());
                        tvEmail.setText("Email : " + data.getEmail());
                        tvBlog.setText("Blog : " + data.getBlog());
                    }

                    @Override
                    public void onError(Throwable t) {
                        LogUtil.printLogMessage("error response", t.getMessage());

                        progressDialog.dismiss();
                        tvName.setText("error :   " + t.getMessage());
                    }

                    @Override
                    public void onComplete() {

                    }
                });

    }
}


text:
\documentclass[a4paper,oneside,11pt]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[light,nott]{kpfonts}
\usepackage[left=30mm,right=30mm,top=30mm,bottom=40mm]{geometry}
\usepackage{tabularx}

\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{xcolor}
\usepackage{framed}
\usepackage[%
        bookmarksnumbered=true,
        colorlinks=true,
        linkcolor=cyan!50!blue,
        citecolor=violet,
        urlcolor=purple,
    ]{hyperref}
\usepackage{hologo}

\newcommand\compar[2]{\texttt{\textbackslash #1\{#2\}}}
\newcommand\comm[1]{\texttt{\textbackslash#1}}
\newcommand\code[1]{\texttt{#1}}
\newcommand\XeLaTeX{\hologo{XeLaTeX}}
\newenvironment{framedcompact}
    {\begin{framed}\vspace{-1em}}
    {\vspace{-1em}\end{framed}}
\definecolor{TFFrameColor}{HTML}{4393c3}
\definecolor{TFTitleColor}{HTML}{FFFFFF}

\title{Fonts in \LaTeX}
\author{Raphael Frey\\[2mm]%
    \small\href{https://github.com/alpenwasser/TeX/tree/master/fonts}
    {\nolinkurl{https://github.com/alpenwasser/TeX/}}}

% ************************************************************************** %
\begin{document}
% ************************************************************************** %

\maketitle

\vfill

\begin{abstract}
    This document  presents a  very brief  overview of the  topic of  fonts in
    \LaTeX. A  quick introduction  to some  of the  terminology is  given, and
    various ways  are shown to change  fonts and different aspects  of them to
    one's liking.

    This document is in  no way, shape or form exhaustive;  the topic of fonts
    can fill  (and has filled)  entire books. But  it should suffice  for most
    day-to-day usage,  and where it does  not, provides some pointers  to more
    in-depth resources.
\end{abstract}

\vfill

\tableofcontents

\vfill

% -------------------------------------------------------------------------- %
\newpage
\section{Incomplete Summary For the Impatient}
\label{sec:summary}
% -------------------------------------------------------------------------- %

\begin{titled-frame}
{\textsf{Switching to Default Document Font}}
\vspace{-1em}
\begin{verbatim}
\normalfont The quick brown fox jumps over the lazy dog.
\end{verbatim}
\normalfont The quick brown fox jumps over the lazy dog.
\end{titled-frame}

\vspace{-1.0em}

\begin{titled-frame}
{\textsf{Changing Fonts between Roman, Sans Serif and Monospace}}
\vspace{-1em}
\begin{verbatim}
\rmfamily We shall start with roman, \sffamily continue with
sans serif, \ttfamily and end up at typewriter.
\end{verbatim}
\rmfamily  We shall  start with  roman,  \sffamily continue  with sans  serif,
\ttfamily and end up at typewriter.
\end{titled-frame}

\vspace{-1.0em}

\begin{titled-frame}
{\textsf{Writing a Piece of Text In Roman, Sans Serif and Monospace}}
\vspace{-1em}
\begin{verbatim}
\textrm{The quick brown fox jumps over the lazy dog.}
\textsf{The quick brown fox jumps over the lazy dog.}
\texttt{The quick brown fox jumps over the lazy dog.}
\end{verbatim}
\textrm{The quick brown fox jumps over the lazy dog.}\\
\textsf{The quick brown fox jumps over the lazy dog.}\\
\texttt{The quick brown fox jumps over the lazy dog.}
\end{titled-frame}

\vspace{-1.0em}

\begin{titled-frame}
{\textsf{Writing a Piece of Text in Different Font Weights}}
\vspace{-1em}
\begin{verbatim}
\textbf{The quick brown fox jumps over the lazy dog.}
\textmd{The quick brown fox jumps over the lazy dog.}
\end{verbatim}
\textbf{The quick brown fox jumps over the lazy dog.}\\
\textmd{The quick brown fox jumps over the lazy dog.}
\end{titled-frame}

\vspace{-1.0em}

\begin{titled-frame}
{\textsf{Writing a Piece of Text in Different Font Shapes}}
\vspace{-1em}
\begin{verbatim}
\emph{The quick brown fox jumps over the lazy dog.}
\textit{The quick brown fox jumps over the lazy dog.}
\textsl{The quick brown fox jumps over the lazy dog.}
\textsc{The quick brown fox jumps over the lazy dog.}
\textup{The quick brown fox jumps over the lazy dog.}
\end{verbatim}
\emph{The quick brown fox jumps over the lazy dog.}\\
\textit{The quick brown fox jumps over the lazy dog.}\\
\textsl{The quick brown fox jumps over the lazy dog.}\\
\textsc{The quick brown fox jumps over the lazy dog.}\\
\textup{The quick brown fox jumps over the lazy dog.}
\end{titled-frame}

% -------------------------------------------------------------------------- %
\newpage
\section{Terminology: Font Families, Fonts and Glyphs}
\label{sec:font-families}
% -------------------------------------------------------------------------- %

A \emph{font family},  also referred to as  a \emph{typeface}, is a  font or a
set  of fonts  with common  features and  characteristics, comprising  all the
needed \emph{glyphs}. A glyph, in this  context, is a graphical representation
of a character,  which can be a  letter, a logogram, a  mathematical symbol or
other things\footnotemark.

\footnotetext{%
    Obviously typography is a vast and complex topic and there is no way I can
    do it  true justice  here. Even if  I wanted  to, I  am most  certainly no
    scholar  on  the  topic. But  for  the  purposes  of  this  document  this
    information shall suffice. The curious reader  shall feel free to research
    the topic in more depth, if so desired.}

For  example, Table  \ref{tab:allographs}  contains  different glyphs  (called
allographs) of the letter Q.

\begin{table}[h!]
    \centering
    \caption{Allographs for the letter Q}
    \label{tab:allographs}
    \vspace{0.5em}
    \begin{tabular}{llr}
        \toprule
        Font                               & \TeX{} Abbreviation & Glyph \\
        \midrule
        Computer Modern (\LaTeX{} default) & \code{cmr}  & \fontfamily{cmr}\selectfont Q \\
        Latin Modern                       & \code{lmr}  & \fontfamily{lmr}\selectfont Q \\
        Johannes Kepler Roman              & \code{jkp}  & \fontfamily{jkp}\selectfont Q\\
        Johannes Kepler Roman Light        & \code{jkpl} & \fontfamily{jkpl}\selectfont Q\\
        Latin Modern Sans Serif            & \code{lmss} & \fontfamily{lmss}\selectfont Q \\
        Avant Garde                        & \code{pag}  & \fontfamily{pag}\selectfont Q \\
        Computer Modern Typewriter         & \code{cmtt} & \fontfamily{cmtt}\selectfont Q \\
        Zapf Chancery                      & \code{pzc}  & \fontfamily{pzc}\selectfont Q \\
        \bottomrule
    \end{tabular}
\end{table}

In general,  font families  which one  tends to use  in a  reasonable document
these days tend to be grouped into three main categories\footnotemark:

\footnotetext{%
    There are  more, but  these are  unlikely to be  useful in  most practical
    applications these days. For more, see \cite{wikipedia:typeface}.}

\begin{titled-frame}
    {\textsf{Common Font Families}}
    \noindent{\fontfamily{ppl}\selectfont roman fonts (with serifs), for example Palatino}\\
    {\fontfamily{phv}\selectfont sans-serif fonts, for example Helvetica}\\
    {\fontfamily{pcr}\selectfont monospace fonts, for example Courier}
\end{titled-frame}

Often, font families  provide fonts for roman, sans-serif  and monospace fonts
(also called  typewriter fonts,  particularly in  the \TeX{}  world). In those
cases, the  metrics and aesthetics of  these different fonts in  the same font
family have  been tuned to look  pleasing when used together. It  is therefore
often tricky to  mix and match fonts from different  font families without the
result looking odd\footnotemark.

\footnotetext{%
    Of course it  can be done, but it  is helpful to be aware  of this general
    issue and to  be careful when picking fonts from  different families to be
    used together in the same document.}

In \LaTeX, there are three macros which contain the default fonts families for
the three font groups:

\begin{titled-frame}
    {\textsf{Default Font Families in \LaTeX}}
    \noindent\comm{rmdefault}\\
    \comm{sfdefault}\\
    \comm{ttdefault}
\end{titled-frame}

Furthermore,  there  is  a  command \comm{familydefault}  which  contains  the
currently configured default font family (one of the above three).

% -------------------------------------------------------------------------- %
\section{Selecting Fonts}
\label{sec:setting-fonts}
% -------------------------------------------------------------------------- %

Fundamentally,  there  are  three  mechanisms  for  selecting  fonts: Firstly,
\emph{font     declarations}     and,    secondly,     their     corresponding
\emph{commands}. Declarations change the font  within the current scope, while
the  commands only  typeset the  content within  their argument,  delimited by
\verb|{| and \verb|}|. Table \ref{tab:font-decs-cmds} presents an overview the
declarations, their equivalent commands and their effect.

\begin{table}[h!]
    \centering
    \caption{Font declarations and commands, and their effects}
    \vspace{0.5em}
    \label{tab:font-decs-cmds}
    \begin{tabular}{>{\ttfamily}l<{\normalfont} >{\ttfamily}l<{\normalfont} l}
        \toprule
        \normalfont\scshape Declaration & \normalfont\scshape Command  & \scshape Effect \\
        \midrule
        \textbackslash{}mdseries   & \textbackslash{}textmd\{\textit{text}\}     & \mdseries Medium Series             \\
        \textbackslash{}bfseries   & \textbackslash{}textbf\{\textit{text}\}     & \bfseries Bold Series               \\
        \textbackslash{}upshape    & \textbackslash{}textup\{\textit{text}\}     & \upshape Upright Shape              \\
        \textbackslash{}itshape    & \textbackslash{}textit\{\textit{text}\}     & \itshape Italic Shape               \\
        \textbackslash{}slshape    & \textbackslash{}textsl\{\textit{text}\}     & \slshape Slanted Shape              \\
        \textbackslash{}scshape    & \textbackslash{}textsc\{\textit{text}\}     & \scshape Small Caps Shape           \\
        \textbackslash{}scslshape  & \textbackslash{}textscsl\{\textit{text}\}   & \scslshape Small Caps Slanted Shape \\
        \textbackslash{}rmfamily   & \textbackslash{}rmfamily\{\textit{text}\}   & \rmfamily Roman Family              \\
        \textbackslash{}sffamily   & \textbackslash{}sffamily\{\textit{text}\}   & \sffamily Sans Serif Family         \\
        \textbackslash{}ttfamily   & \textbackslash{}ttfamily\{\textit{text}\}   & \ttfamily Typewriter Family         \\
        \textbackslash{}normalfont & \textbackslash{}normalfont\{\textit{text}\} & \normalfont Default Document Font   \\
        \bottomrule
    \end{tabular}
\end{table}

Different fonts  may or may not  implement some or more  of these options. For
example, the  \textscsl{Small Caps Slanted}  font variant is not  supported by
Computer Modern, but comes with the Kp-Fonts font family which has been chosen
for this document.

The  third mechanism  is to  set the  four properties  which are  configurable
for  a  font  with   the  commands  \verb|\fontencoding|,  \verb|\fontfamily|,
\verb|\fontseries| and \verb|\fontshape|,  followed by \verb|\selectfont| (not
all of  them need be set,  of course; one may  choose to only change  the font
family, for example). The  \verb|\selectfont| command tends to  be used mostly
for local font style  changes which can't be covered by  the macros from Table
\ref{tab:font-decs-cmds}.

\begin{titled-frame}
{\textsf{The \textbackslash{}selectfont Command}}
\vspace{-1em}
\begin{verbatim}
\fontencoding{T1}
\fontfamily{pag}
\fontseries{m}
\fontshape{it}
\selectfont
The quick brown fox jumps over the lazy dog.
\end{verbatim}
\fontencoding{T1}
\fontfamily{pag}
\fontseries{m}
\fontshape{it}
\selectfont
The quick brown fox jumps over the lazy dog.
\end{titled-frame}

% -------------------------------------------------------------------------- %
\subsection{Font Packages}
\label{subsec:font-packages}
% -------------------------------------------------------------------------- %

The most convenient way to choose the default fonts for a document is by using
font packages. Once  one or more font  packages have been loaded,  we can then
switch among the  defaults which have been defined by  those packages with the
commands from Table \ref{tab:font-decs-cmds}.

Good places  to peruse for  finding fonts  are CTAN \cite{ctan:fonts}  and the
\LaTeX{}  font  catalogue  \cite{tug:font-catalog}. A popular  choice  is  the
Latin Modern  Package (\verb|\usepackage{lmodern}|), which is  an expansion of
Computer Modern  with better  support for non-ASCII  characters. For documents
which are not in  English, Latin Modern is a solid  choice, provided one likes
its aesthetics.

As  a  different example,  if  we  wish to  typeset  our  document in  DejaVu,
we  can  put  \compar{usepackage}{dejavu}{}  in the  preamble. This  will  set
\comm{rmdefault}, \comm{sfdefault}  and \comm{ttdefault} to  the corresponding
values, while \comm{familydefault} will continue to  point to the one of those
three to which it was set previously (\comm{rmdefault} by default).

Not all font packages provide all kinds of font families, or all font families
in all  weights and  shapes. Consult the documentation  for the  package which
you're intending to use. In the cases  where a package only provides some type
of font, the  others will be left  unchanged and may be configured  by using a
font  package  specific  to  those  fonts, or  left  at  the  Computer  Modern
default. For example, the  \code{FiraSans} package, which is  obviously a sans
serif typeface, does not provide a  roman font. Therefore, the serif fonts are
left untouched by loading that package.

The same  goes for mathematics: Not all  fonts provide the needed  symbols for
typesetting mathematics.

A personal  favorite of mine  is the Kp-Fonts family  \cite{ctan:kpfonts}.  It
has  roman, sans-serif  and  typewriter font  choices  (although personally  I
prefer  the Computer  Modern typewriter  font and  usually keep  that intact),
along with  mathematics and  many symbols. This  is the  setup which  has been
chosen for this  document. But this is a matter of  personal preference; one's
mileage may vary.

% -------------------------------------------------------------------------- %
\subsection{Global Font Selection For a Document}
\label{subsec:fontsel:global}
% -------------------------------------------------------------------------- %

One may wish to typeset a  document in sans serif or typewriter. Besides using
a package  to do this,  one may also  manually configure the  default document
font in the preamble\footnotemark like this:

\footnotetext{%
    Or anywhere else in the document,  for that matter. Whether or not that is
    a sensible  thing to do  is another  question. One should usually  not mix
    different fonts and font styles willy-nilly.}

\begin{titled-frame}
{\textsf{Defining the Default Font Families Manually}}
\vspace{-1em}
\begin{verbatim}
\renewcommand{\familydefault}{\rmdefault}
\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\familydefault}{\ttdefault}
\end{verbatim}
\vspace{-1em}
\end{titled-frame}

The first  command will  usually do  nothing, of  course, because  the default
family tends to be the roman font.

Note that typewriter fonts differ in  what kinds of adjustments \TeX{} usually
makes  when it  comes to  spacing in  order to  achieve a  justified block  of
text.  Also,  words in typerwriter fonts  will not hyphenate except  in places
where  \code{\textbackslash{}-}  has  been  inserted  manually. This  is  also
why  sometimes a  monospaced  piece of  text can  protrude  outside the  right
textblock margin  when you put  it in normal text  (see above with  the dejavu
example; that  was not  done on purpose). More  on the topic  can be  found in
\cite{texblog:typewriter}.

Combining different font families can be  done in the same manner. This allows
to compose  a custom set of  default fonts for  a document which might  not be
covered by  a font package. As mentioned,  care should be taken  to pick fonts
which go nicely together. For example, selecting Palatino as the roman default
font,  Helvetica as  the  default  sans-serif font  and  Latin  Modern as  the
typewriter font could be done by putting these commands in the preamble:

\begin{titled-frame}
{\textsf{Creating a Custom Set of Default Fonts}}
\vspace{-1em}
\begin{verbatim}
\renewcommand{\rmdefault}{ppl}  % Palatino
\renewcommand{\sfdefault}{phv}  % Helvetica
\renewcommand{\ttdefault}{lmtt} % Latin Modern
\end{verbatim}
\vspace{-1em}
\end{titled-frame}

Changing  math  fonts is  rather  more  complex. I  recommend not  doing  that
manually,  but  instead  relying  on   font  packages  instead,  as  described
in  the  previous  section. See for  example  \cite{stackexch:math-fonts}  and
\cite{practex:fonts}).

% -------------------------------------------------------------------------- %
\subsection{Local Font Selection From Defined Defaults}
\label{subsec:fontsel:local:defaults}
% -------------------------------------------------------------------------- %

There  are  two  basic  scenarios  for  locally  changing  fonts: Selecting  a
different font, series  or shape from the defined default  font families which
are already loaded, or selecting a completely different font which has not yet
been loaded  into the document. This  section deals with the  former scenario;
for the latter, see the next section.

Locally  changing  font  properties  or families  among  the  choices  already
loaded  can  be done  with  the  declarations  and  commands listed  in  Table
\ref{tab:font-decs-cmds}.

\begin{titled-frame}
{\textsf{Local Font Changing Among Loaded Fonts and Styles}}
\vspace{-1em}
\begin{verbatim}
\bfseries This text is in bold, while \mdseries this text is
in  normal weight.  \slshape  We continue  with the  slanted
shape,  followed  by  the  \scshape  small  capitals  shape,
followed by  the \itshape italic shape.  \normalfont and now
we are back to the  default document font, whatever that may
be.

{\scslshape For keeping font  declaration effects local}, we
must enclose  the declaration and  the text which  it should
affect inside a scope.
\end{verbatim}
\bfseries This text is in bold, while \mdseries this text is
in  normal weight.  \slshape  We continue  with the  slanted
shape,  followed  by  the  \scshape  small  capitals  shape,
followed by  the \itshape italic shape.  \normalfont And now
we are back to the  default document font, whatever that may
be.

{\scslshape For keeping font  declaration effects local}, we
must enclose  the declaration and  the text which  it should
affect inside a scope.
\end{titled-frame}

Or with font commands:

\begin{titled-frame}
{\textsf{Local Font Changing Among Loaded Fonts and Styles}}
\vspace{-1em}
\begin{verbatim}
\textbf{This text is in bold, while} \textmd{this text is in
normal weight}. \textsl{We continue  with the slanted shape,
followed by the } \textsc{ small capitals shape, followed by
the  }\textit{italic  shape.} And now  we  are  back to  the
default document font, whatever that may be.
\end{verbatim}
\textbf{This text is in bold, while} \textmd{this text is in
normal weight}. \textsl{We continue  with the slanted shape,
followed by the } \textsc{ small capitals shape, followed by
the  }\textit{italic  shape.} And now  we  are  back to  the
default document font, whatever that may be.
\end{titled-frame}

% -------------------------------------------------------------------------- %
\subsection{Local Font Selection From Non-Defaults}
\label{subsec:fontsel:local:nondefaults}
% -------------------------------------------------------------------------- %

If we  wish to  load a completely  different font which  has not  already been
loaded (be  that because we  did not  want it to  be the document  default, or
because  there simply  does  not exist  a  package  for it),  we  can use  the
\verb|\selectfont| command and its friends.

\begin{titled-frame}{\sffamily Switching to a Non-Default Font}
For example, if we wish to switch to Helvetica:

\vspace{1em}\noindent
\verb|\fontfamily{phv}\selectfont|\\

\fontfamily{phv}\selectfont  And  now  we   should  have  Helvetica  for  this
text. The font family  will stay Helvetica until it is  switched back with one
of  these two  commands  (or changed  to anything  else  with the  appropriate
command, should one so choose):

\vspace{1em}\noindent
\verb|\fontfamily{\familydefault}\selectfont|\\[1ex]
or\\[1ex]
\noindent
\verb|\normalfont|\\

\noindent\normalfont And now we're back to Kp-Fonts serif.
\end{titled-frame}

The same scope rules which we've already seen apply here as well:

\begin{titled-frame}
{\textsf{Selecting Arbitrary Font Families Locally}}
\vspace{-1em}
\begin{verbatim}
{\fontfamily{phv}\selectfont This text is in Helvetica!}
While this text is not!
\end{verbatim}
{\fontfamily{phv}\selectfont This text is in Helvetica!} While this text is not!
\end{titled-frame}

% -------------------------------------------------------------------------- %
\section{Font Properties}
\label{sec:font-props}
% -------------------------------------------------------------------------- %

We  will  now look  at  changing  various  properties  for a  font: Its  size,
its  series (weight)  and  its  shape. For a  nice  explanation  of this,  see
\cite{stackexch:bfseries-textbf}.

% -------------------------------------------------------------------------- %
\subsection{Font Sizes}
\label{subsec:font-sizes}
% -------------------------------------------------------------------------- %

By  default, \LaTeX{}  offers the  following font  sizes, which,  depending on
the  global  document  font  size  set in  the  preamble  (for  example,  with
\code{\textbackslash{}documentclass[11pt]\{article\}}), vary in the size which
they will have on the page:

\begin{center}
    \begin{tabular}{lrrrrrr}
        \toprule
        \textsc{Size} &
        \multicolumn{3}{l}{\textsc{Standard Classes and beamer}} &
        \multicolumn{3}{l}{\textsc{AMS Classes and memoir}} \\
        \midrule
        \comm{tiny}         &  5    &  6     & 6     & 6     & 7     & 8     \\
        \comm{scriptsize}   &  7    &  8     & 8     & 7     & 8     & 9     \\
        \comm{footnotesize} &  8    &  9     & 10    & 8     & 9     & 10    \\
        \comm{small}        &  9    &  10    & 10.95 & 9     & 10    & 10.95 \\
        \comm{normalsize}   & 10    &  10.95 & 12    & 10    & 10.95 & 12    \\
        \comm{large}        & 12    &  12    & 14.4  & 10.95 & 12    & 14.4  \\
        \comm{Large}        & 14.4  &  14.4  & 17.28 & 12    & 14.4  & 17.28 \\
        \comm{LARGE}        & 17.28 &  17.28 & 20.74 & 14.4  & 17.28 & 20.74 \\
        \comm{huge}         & 20.74 &  20.74 & 24.88 & 17.28 & 20.74 & 24.88 \\
        \comm{Huge}         & 24.88 &  24.88 & 24.88 & 20.74 & 24.88 & 24.88 \\
        \bottomrule
    \end{tabular}
\end{center}

The table has been taken from \cite{wikibooks:fonts}.

Yet again, these commands change the font size within the current scope, so should
usually be enclosed in braces:

\begin{titled-frame}
{\textsf{Locally Changing Font Sizes}}
\vspace{-1em}
\begin{verbatim}
{\LARGE This is a piece of large text.} And this is of normal size again.
\end{verbatim}
{\LARGE This is a piece of large text.} And this is of normal size again.
\end{titled-frame}

% -------------------------------------------------------------------------- %
\subsection{Font Series}
\label{subsec:font-series}
% -------------------------------------------------------------------------- %

Changing font weights can be done either via a \comm{fontseries\{<argument>\}}
command,   followed  by   \comm{selectfont},  or   via  the   \comm{bfseries},
\comm{mdseries}   and    \comm{lfseries}   declarations   listed    in   Table
\ref{tab:font-decs-cmds},  respectively. A  font  may offer  more  than  three
weights,  in which  case one  might need  to resort  to the  \comm{fontseries}
command  for   changing  fonts   because  the   corresponding  \comm{..series}
declaration does not exist.

Furthermore,  depending on  which option  is  loaded if  one is  using a  font
package  such as  Kp-Fonts, the  default font  weight and  all others  will be
changed accordingly  among \comm{bfseries} and its  friends. For example, this
happens when  one selects  the \comm{light}  option for  Kp-Fonts package. For
specifics, consult the documentation for the package you're using.

Lastly,  note that  not  all options  might  be supported  by  all fonts  (for
example,  Kp-Fonts  with  a  \code{light} option  shows  vehement  displeasure
at  being  instructed  to   execute  \comm{lfseries}). With  Kp-Fonts  in  the
configuration for this document, these are the options available:

\begin{titled-frame}
{\textsf{Locally Changing Font Weight}}
\vspace{-1em}
\begin{verbatim}
{\fontseries{l}\selectfont  The quick brown fox jumps over the lazy dog.}
{\fontseries{m}\selectfont  The quick brown fox jumps over the lazy dog.}
{\fontseries{sb}\selectfont The quick brown fox jumps over the lazy dog.}
{\fontseries{b}\selectfont  The quick brown fox jumps over the lazy dog.}
{\fontseries{bx}\selectfont The quick brown fox jumps over the lazy dog.}

{\mdseries\selectfont The quick brown fox jumps over the lazy dog.}
{\bfseries\selectfont The quick brown fox jumps over the lazy dog.}

\textbf{The quick brown fox jumps over the lazy dog.}
\textmd{The quick brown fox jumps over the lazy dog.}
\end{verbatim}

\noindent{\fontseries{l}\selectfont  The quick brown fox jumps over the lazy dog.}\\
{\fontseries{m}\selectfont  The quick brown fox jumps over the lazy dog.}\\
{\fontseries{sb}\selectfont  The quick brown fox jumps over the lazy dog.}\\
{\fontseries{b}\selectfont  The quick brown fox jumps over the lazy dog.}\\
{\fontseries{bx}\selectfont The quick brown fox jumps over the lazy dog.}\\

\noindent{\mdseries\selectfont The quick brown fox jumps over the lazy dog.}\\
{\bfseries\selectfont The quick brown fox jumps over the lazy dog.}\\

\noindent\textmd{The quick brown fox jumps over the lazy dog.}\\
\textbf{The quick brown fox jumps over the lazy dog.}\\
\vspace{-1em}
\end{titled-frame}

% -------------------------------------------------------------------------- %
\subsection{Font Shapes}
\label{subsec:font-shapes}
% -------------------------------------------------------------------------- %

Selecting the  font shape can  be done via  the \comm{fontshape\{<argument>\}}
command,   followed   by   \comm{selectfont},    by   a   corresponding   font
declaration,  or, by  the  corresponding \verb|\text..{}|  command (see  Table
\ref{tab:font-decs-cmds}).   Again, the  number of  font shapes   and possible
combinations  thereof will  vary depending  on the  font being  used. Kp-Fonts
supports these options:

\begin{titled-frame}
{\textsf{Locally Changing Font Shapes}}
\vspace{-1em}
\small
\begin{verbatim}
{\fontshape{sc}\selectfont The quick brown fox jumps over the lazy dog.}
{\fontshape{scsl}\selectfont The quick brown fox jumps over the lazy dog.}
{\fontshape{it}\selectfont The quick brown fox jumps over the lazy dog.}
{\otherscshape\selectfont The quick brown fox jumps over the lazy dog.}
{\otherscslshape\selectfont The quick brown fox jumps over the lazy dog.}

{\upshape The quick brown fox jumps over the lazy dog.}
{\itshape The quick brown fox jumps over the lazy dog.}
{\slshape The quick brown fox jumps over the lazy dog.}
{\scshape The quick brown fox jumps over the lazy dog.}
{\scslshape The quick brown fox jumps over the lazy dog.}

\textup{The quick brown fox jumps over the lazy dog.}
\textit{The quick brown fox jumps over the lazy dog.}
\textsl{The quick brown fox jumps over the lazy dog.}
\textsc{The quick brown fox jumps over the lazy dog.}
\textscsl{The quick brown fox jumps over the lazy dog.}

\end{verbatim}
\normalsize
\noindent{\fontshape{sc}\selectfont The quick brown fox jumps over the lazy dog.}\\
{\fontshape{scsl}\selectfont The quick brown fox jumps over the lazy dog.}\\
{\fontshape{it}\selectfont The quick brown fox jumps over the lazy dog.}\\
{\otherscshape\selectfont The quick brown fox jumps over the lazy dog.}\\
{\otherscslshape\selectfont The quick brown fox jumps over the lazy dog.}\\\\
{\upshape The quick brown fox jumps over the lazy dog.}\\
{\itshape The quick brown fox jumps over the lazy dog.}\\
{\slshape The quick brown fox jumps over the lazy dog.}\\
{\scshape The quick brown fox jumps over the lazy dog.}\\
{\scslshape The quick brown fox jumps over the lazy dog.}\\\\
\textup{The quick brown fox jumps over the lazy dog.}\\
\textit{The quick brown fox jumps over the lazy dog.}\\
\textsl{The quick brown fox jumps over the lazy dog.}\\
\textsc{The quick brown fox jumps over the lazy dog.}\\
\textscsl{The quick brown fox jumps over the lazy dog.}\\
\vspace{-1em}
\end{titled-frame}

% -------------------------------------------------------------------------- %
\subsection{Combinations}
\label{subsec:combinations}
% -------------------------------------------------------------------------- %

The  commands presented  above can  be  combined in  various ways,  depending,
again,  on the  font families  being used. Some  fonts will  support different
combinations than others.

\begin{titled-frame}
{\textsf{Combining Different Font Styles}}
\vspace{-1em}
\begin{verbatim}
The quick brown fox jumps over the lazy dog.
{\fontshape{sc}\fontseries{b}\selectfont
The quick brown fox jumps over the lazy dog.}
{\fontshape{it}\fontseries{b}\selectfont
The quick brown fox jumps over the lazy dog.}
\end{verbatim}

\noindent The quick brown fox jumps over the lazy dog.\\
{\fontshape{sc}\fontseries{b}\selectfont
The quick brown fox jumps over the lazy dog.}\\
{\fontshape{it}\fontseries{b}\selectfont
The quick brown fox jumps over the lazy dog.}
\end{titled-frame}

% -------------------------------------------------------------------------- %
\subsection{Emphasis}
% -------------------------------------------------------------------------- %

The  \comm{emph}  command  is  a   context-aware  way  to  highlight  text. It
will  select  an  appropriate  font  version  automatically  to  achieve  this
goal. Usually, \comm{emph} uses  italics, but when it is  placed inside italic
text, it will switch to an upright font shape.

\begin{titled-frame}
{\textsf{Emphasis}}
\vspace{-1em}
\small
\begin{verbatim}
{\fontshape{u}\selectfont This sentence \emph{emphasizes} a word of itself.}
{\fontshape{it}\selectfont This sentence \emph{emphasizes} a word of itself.}
Here, again, there exists an {\em alternative} version.
{\itshape Here, again, there exists an {\em alternative} version.}
\end{verbatim}
\normalsize
{\fontshape{u}\selectfont This sentence \emph{emphasizes} a word of itself.}\\
{\fontshape{it}\selectfont This sentence \emph{emphasizes} a word of itself.}\\
Here, again, there exists an {\em alternative} version.\\
{\itshape Here, again, there exists an {\em alternative} version.}
\end{titled-frame}

%% -------------------------------------------------------------------------- %
%\section{List of Typefaces}
%\label{sec:tflist}
%% -------------------------------------------------------------------------- %
%
%\begin{itemize}
%    \item
%        {\fontfamily{cmr}\selectfont Computer Modern: The \LaTeX{} default}
%    \item
%        {\fontfamily{lmr}\selectfont Latin Modern: A  modernised derivative of
%        Computer modern with more characters.}
%    \item
%        {\fontfamily{jkp}\selectfont Kp-Fonts: An alternative to the above two
%        with fully-featured  glyph sets for roman,  sans-serif, typewriter and
%        math fonts. \cite{ctan:kpfonts}}
%    \item
%        {\fontfamily{aeccr}\selectfont aecc --  Almost European Concrete Roman
%        virtual  fonts.  A  font prividing  roman, sans-serif,  and typewriter
%        fonts. \cite{ctan:aecc}}
%\end{itemize}

% -------------------------------------------------------------------------- %
\newpage
\begin{thebibliography}{1}
% -------------------------------------------------------------------------- %

    \bibitem{wikipedia:typeface}
        Wikipedia,
        ``\emph{Typeface}'',
        [Online],
        \href{https://en.wikipedia.org/wiki/Typeface}
             {\nolinkurl{https://en.wikipedia.org/wiki/Typeface}},
        [Accessed: 2017-MAR-20].

    \bibitem{texblog:typewriter}
        Stefan,
        ``\emph{Full justification with typewriter font}'',
        [Online],
        \href{http://texblog.net/latex-archive/plaintex/full-justification-with-typewriter-font/}
             {\nolinkurl{http://texblog.net/latex-archive/plaintex/full-justification-with-typewriter-font/}},
        2008-MAY-08,
        [Accessed: 2017-MAR-20].

    \bibitem{ctan:fonts}
        Comprehensive \TeX{} Archive Network,
        ``\emph{Topic Font: Fonts Themselves}'',
        [Online],
        \href{http://ctan.org/topic/font}
             {\nolinkurl{http://ctan.org/topic/font}},
        [Accessed: 2017-MAR-20].

    \bibitem{ctan:kpfonts}
        The Johannes Kepler Project, Christophe Caignaert,
        ``\emph{kpfonts -- A complete set of fonts for text and mathematics}''
        [Online],
        \href{https://www.ctan.org/pkg/kpfonts}
             {nolinkurl{https://www.ctan.org/pkg/kpfonts}},
        [Accessed: 2017-MAR-22].

    \bibitem{tug:font-catalog}
        \TeX{} Users Group,
        ``\emph{The \LaTeX{} Font Catalogue}'',
        [Online],
        \href{http://www.tug.dk/FontCatalogue/}
             {\nolinkurl{http://www.tug.dk/FontCatalogue/}},
        [Accessed: 2017-MAR-20].

    \bibitem{stackexch:math-fonts}
        tex.stackexchange.com,
        ``\emph{how to select math font in document}'',
        [Online],
        \href{http://tex.stackexchange.com/questions/30049/how-to-select-math-font-in-document}
             {\nolinkurl{http://tex.stackexchange.com/questions/30049/how-to-select-math-font-in-document}},
        [Accessed: 2017-MAR-20].

    \bibitem{practex:fonts}
        Walter Schmidt,
        ``\emph{Font selection in \LaTeX{}: The most frequently asked questions}'',
        The Prac\TeX{} Journal,
        [Online],
        \href{https://www.tug.org/pracjourn/2006-1/schmidt/schmidt.pdf}
             {\nolinkurl{https://www.tug.org/pracjourn/2006-1/schmidt/schmidt.pdf}},
        2006-FEB-01,
        [Accessed: 2017-MAR-20].

    \bibitem{wright:font-commands}
        David Wright,
        ``\emph{\LaTeX{} Font Commands}'',
        [Online],
        \href{http://www.cl.cam.ac.uk/~rf10/pstex/latexcommands.htm}
             {\nolinkurl{http://www.cl.cam.ac.uk/~rf10/pstex/latexcommands.htm}},
        1998,
        [Accessed: 2017-MAR-20].

    \bibitem{stackexch:bfseries-textbf}
        Tobi,
        ``\emph{\comm{bfseries} is to \comm{textbf} as WHAT is to \comm{textsf}}'',
        [Online],
        \href{http://tex.stackexchange.com/a/139592}
             {\nolinkurl{http://tex.stackexchange.com/a/139592}},
        2013-OCT-19,
        [Accessed: 2017-MAR-21].

    \bibitem{wikibooks:fonts}
        wikibooks,
        ``\emph{\LaTeX/Fonts}'',
        [Online],
        \href{https://en.wikibooks.org/wiki/LaTeX/Fonts}
             {\nolinkurl{https://en.wikibooks.org/wiki/LaTeX/Fonts}},
        [Accessed: 2017-MAR-21].

%    \bibitem{ctan:aecc}
%        CTAN,
%        ``\emph{aecc -- Almost European Concrete Roman virtual fonts}'',
%        [Online],
%        \href{http://ctan.org/pkg/aecc}
%             {\nolinkurl{http://ctan.org/pkg/aecc}},
%        [Accessed: 2017-MAr-22].

\end{thebibliography}

\end{document}