text:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
  <string name="app_name">Kernel Adiutor</string>
  <string name="no_root">Geen root beschikbaar</string>
  <string name="no_busybox">Geen busybox beschikbaar</string>
  <string name="ok">Oké</string>
  <string name="cancel">Annuleer</string>
  <string name="current_value_not_supported">Huidige waarde wordt niet ondersteund</string>
  <string name="beta_message">Bedankt voor het zijn van een beta tester! Als er enige problemen zijn, aarzel dan niet en contacteer mij. Jij draait momenteel versie nummer %s.</string>
  <string name="select_picture">Selecteer afbeelding</string>
  <string name="select_file">Selecteer bestand</string>
  <string name="no_files">Geen bestanden in dit pad.</string>
  <string name="apply_on_boot">Toepassen bij het opstarten</string>
  <string name="apply_on_boot_finished">Je wijzigingen zijn toegepast</string>
  <string name="apply_on_boot_time">Uw instellingen worden toegepast in %d seconden</string>
  <string name="apply_on_boot_enabled">Uw boot instellingen voor %s zijn toegepast</string>
  <string name="apply_on_boot_disabled">Uw boot instellingen voor %s zijn Niet toegepast</string>
  <string name="apply_on_boot_failed">Toepassen van aangebrachte instellingen mislukt bij het opstarten</string>
  <string name="mhz">MHz</string>
  <string name="mv">mV</string>
  <string name="kb">kB</string>
  <string name="ms">ms</string>
  <string name="mb">MB</string>
  <string name="min">minuten</string>
  <string name="sec">seconde</string>
  <string name="ma">mA</string>
  <string name="information">Informatie</string>
  <string name="kernel">Kernel</string>
  <string name="tools">Hulpprogramma\'s</string>
  <string name="other">Overige</string>
  <string name="frequency_table">Frequentietabel</string>
  <string name="kernel_information">Kernel informatie</string>
  <string name="cpu">CPU</string>
  <string name="cpu_voltage">CPU Voltage</string>
  <string name="cpu_hotplug">CPU Hotplug</string>
  <string name="gpu">GPU</string>
  <string name="screen">Scherm</string>
  <string name="sound">Geluid</string>
  <string name="battery">Batterij</string>
  <string name="io_scheduler">I/o-Scheduler</string>
  <string name="ksm">Kernel Samepage samenvoegen</string>
  <string name="low_memory_killer">Onvoldoende geheugen Killer</string>
  <string name="virtual_memory">Virtueel geheugen</string>
  <string name="misc_controls">Misc besturingselementen</string>
  <string name="backup">Backup</string>
  <string name="build_prop_editor">Build prop bewerker</string>
  <string name="profile">Profiel</string>
  <string name="recovery">Herstel</string>
  <string name="initd">Init.d</string>
  <string name="settings">Instellingen</string>
  <string name="faq">Veelgestelde Vragen</string>
  <string name="about_us">Over ons</string>
  <string name="unused_cpu_states">Ongebruikte CPU Staten</string>
  <string name="uptime">Bedrijfstijd</string>
  <string name="deep_sleep">Diepe slaap</string>
  <string name="refresh">Vernieuwen</string>
  <string name="reset_timer">Reset Timers</string>
  <string name="restore_timer">Herstel Timers</string>
  <string name="kernel_version">Kernel Versie</string>
  <string name="cpu_information">CPU informatie</string>
  <string name="memory_information">Geheugen Informatie</string>
  <string name="cpu_usage">CPU-gebruik</string>
  <string name="cpu_temp">CPU temperatuur</string>
  <string name="current_freq">Huidige frequentie</string>
  <string name="core">Kern %d</string>
  <string name="offline">Offline</string>
  <string name="cpu_max_freq">Maximale CPU-frequentie</string>
  <string name="cpu_max_freq_summary">Stel de maximale frequentie van de CPU in</string>
  <string name="cpu_min_freq">Minimale CPU-Frequentie</string>
  <string name="cpu_min_freq_summary">Stel de minimale frequentie van de CPU in</string>
  <string name="cpu_max_screen_off_freq">CPU Maximum scherm uit frequentie</string>
  <string name="cpu_max_screen_off_freq_summary">Stel de maximale frequentie in die de CPU kan schalen wanneer het scherm uitgeschakeld is.</string>
  <string name="cpu_governor">CPU governor</string>
  <string name="cpu_governor_summary">De CPU governor bepaalt hoe de CPU zich gedraagt op veranderingen in de werklast. Wijzigt de governor dan zal invloed hebben op hoe de CPU wordt geschaald door de frequentiestappen die beschikbaar zijn voor jou CPU.</string>
  <string name="cpu_governor_tunables">CPU governor Tunables</string>
  <string name="cpu_governor_tunables_summary">De verschillende configuratie-items die afhankelijk van de governor zijn.</string>
  <string name="not_tunable">%s is niet afstembare</string>
  <string name="mc_power_saving">Multicore energiebesparing</string>
  <string name="mc_power_saving_summary">Probeer taken te groeperen in de minst mogelijke kernen.</string>
  <string name="power_saving_wq">Schema workqueues op wakker CPU\'s om energie te besparen.</string>
  <string name="cfs_scheduler_policy">CFS Scheduler beleid</string>
  <string name="cfs_scheduler_policy_summary">Beleid beslist de CFS scheduler om de taken op verschillende CPU units evenwicht te brengen.</string>
  <string name="disabled">Uitgeschakeld</string>
  <string name="enabled">Ingeschakeld</string>
  <string name="aggressive">Agressieve</string>
  <string name="cpu_boost">CPU Boost</string>
  <string name="debug_mask">Debug masker</string>
  <string name="debug_mask_summary">Hiermee kunt u foutopsporing voor CPU Boost operaties activeren.</string>
  <string name="interval">Interval</string>
  <string name="interval_summary">Minimuminterval wanneer de CPU versneld</string>
  <string name="sync_threshold">Sync drempel</string>
  <string name="sync_threshold_summary">Wanneer CPU laden de vooraf ingestelde drempel kruist, wordt de huidige CPU verhoogd naar deze frequentie.</string>
  <string name="input_interval">Input Interval</string>
  <string name="input_interval_summary">Minimuminterval een CPU wordt versterkt wanneer invoer wordt gedetecteerd.</string>
  <string name="input_boost_freq">Input Boost frequentie</string>
  <string name="input_boost_freq_summary">CPU frequentie te stimuleren om deze frequentie na invoer detectie.</string>
  <string name="balanced">Gebalanceerd</string>
  <string name="performance">Prestaties</string>
  <string name="conservative">Conservatief</string>
  <string name="eco_performance">Eco prestaties</string>
  <string name="eco_conservative">Eco conservatief</string>
  <string name="eco">Eco</string>
  <string name="strict">Strikt</string>
  <string name="eco_mode">Eco-modus</string>
  <string name="temp_limit">Temperatuurgrens</string>
  <string name="temp_limit_summary">Als de temperatuur te hoog wordt dan zal de thermische throttle de CPU frequentie om de temperatuur te verlagen.</string>
</resources>


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<project name="flashing" default="jar" basedir="..">

    <property name="plug.dir" value="${basedir}"/>
    <property name="plug.lib.dir" value="${plug.dir}/build/lib"/>

	<property name="classes.dir" value="${basedir}/build/classes"/>

    <property name="src.dir" value="${plug.dir}/src"/>
    <property name="java.dir" value="${src.dir}/java"/>
    <property name="resources.dir" value="resources"/>
    <property name="target.dir" value="${plug.dir}/target"/>
    <property name="target.lib.dir" value="${plug.dir}/target/lib"/>
    <property name="jar.file" value="${target.dir}/lib/plugin-classes.jar"/>

    <property name="spark.home" value="../../../"/>
    <property name="spark.libs.dir" value="${spark.home}/target/build/lib"/>

    <path id="lib.classpath">
        <fileset dir="${spark.libs.dir}" includes="**/*.jar, **/*.zip"/>
        <fileset dir="${spark.home}/build/lib/dist" includes="**/*.jar, **/*.zip"/>
        <fileset dir="${spark.home}/build/lib/dist/windows" includes="**/*.jar"/>
    </path>

	<!-- clean =================================================================================== -->
	<target name="clean" description="Cleans all build related output">
		<delete file="${jar.file}"/>
		<delete dir="${classes.dir}"/>
		<delete dir="${target.dir}"/>
	</target>

	<!-- jni-compile =================================================================================== -->
	<target name="jni-compile">
		<mkdir dir="${target.dir}"/>

		<javac srcdir="src/java"
	        destdir="${target.dir}"
	        classpathref="lib.classpath"
	        source="1.5"
	        debug="true"
	        target="1.5"/>

		<javah destdir="src/c" class="org.jivesoftware.spark.plugin.flashing.FlashWindow" classpath="${target.dir}"/>
	</target>

	<!-- compile =================================================================================== -->
    <target name="compile" description="Compiles plugin source">
        <mkdir dir="${classes.dir}"/>
        <javac srcdir="${java.dir}"
               destdir="${classes.dir}"
               classpathref="lib.classpath"
               source="1.5"
               debug="true"
               target="1.5"/>
    	 <copy todir="${classes.dir}">
    	            <fileset dir="${src.dir}" includes="**/*.png"/>
    	            <fileset dir="${src.dir}" includes="**/*.gif"/>
    	            <fileset dir="${src.dir}" includes="**/*.jpg"/>
    	            <fileset dir="${src.dir}" includes="**/*.jpeg"/>
    	            <fileset dir="${src.dir}" includes="**/*.wav"/>
    	            <fileset dir="${src.dir}" includes="**/*.properties"/>
		</copy>
    </target>

    <!-- resources =================================================================================== -->
    <target name="resources">
        <copy todir="${classes.dir}">
            <fileset dir="${resources.dir}">
                <include name="**/*"/>
            </fileset>
            <fileset dir="${src.dir}">
                <include name="**/*.properties"/>
            </fileset>
        </copy>
    </target>

	<!-- jar =================================================================================== -->
    <target name="jar" depends="clean,compile,resources" description="Makes a plugin jar">
        <mkdir dir="${target.dir}"/>
        <mkdir dir="${target.lib.dir}"/>

        <copy todir="${target.lib.dir}">
            <fileset file="${plug.lib.dir}/*.*"/>
        </copy>

        <copy todir="${target.dir}">
            <fileset file="${plug.dir}/plugin.xml"/>
        </copy>

        <copy todir="${target.dir}">
            <fileset dir="${plug.dir}">
                <include name="**/*.html"/>
                <include name="**/*.txt"/>
            </fileset>
        </copy>

        <jar basedir="${classes.dir}" file="${jar.file}" update="false"/>

        <jar file="${target.dir}/flashing.jar" basedir="${target.dir}" />

        <copy todir="${spark.home}/src/commercial">
            <fileset file="${target.dir}/flashing.jar"/>
        </copy>

    </target>
</project>

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Cleaner Caption - Cleans up the WP [caption] shortcode.
 *
 * WordPress adds an inline style to its [caption] shortcode which specifically adds 10px of extra width to
 * captions, making theme authors jump through hoops to design captioned elements to their liking.  This extra
 * width makes the assumption that all captions should have 10px of extra padding to account for a box that
 * wraps the element.  This script changes the width to match that of the 'width' attribute passed in through
 * the shortcode, allowing themes to better handle how their captions are designed.
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package hoot
 * @subpackage framework
 * @since hoot 1.0.0
 */

/* Filter the caption shortcode output. */
add_filter( 'img_caption_shortcode', 'hoot_cleaner_caption', 10, 3 );

/**
 * Cleans up the default WordPress [caption] shortcode.  The main purpose of this function is to remove the
 * inline styling WP adds, which creates 10px of padding around captioned elements.
 *
 * @since 1.0.0
 * @access private
 * @param string $output The output of the default caption (empty string at this point).
 * @param array $attr Array of arguments for the [caption] shortcode.
 * @param string $content The content placed after the opening [caption] tag and before the closing [/caption] tag.
 * @return string $output The formatted HTML for the caption.
 */
function hoot_cleaner_caption( $output, $attr, $content ) {

	/* We're not worried abut captions in feeds, so just return the output here. */
	if ( is_feed() )
		return $output;

	/* Set up the default arguments. */
	$defaults = array(
		'id'      => '',
		'align'   => 'alignnone',
		'width'   => '',
		'caption' => ''
	);

	/* Allow developers to override the default arguments. */
	$defaults = apply_filters( 'hoot_cleaner_caption_defaults', $defaults );

	/* Apply filters to the arguments. */
	$attr = apply_filters( 'hoot_cleaner_caption_args', $attr );

	/* Merge the defaults with user input. */
	$attr = shortcode_atts( $defaults, $attr, 'caption' );

	/* If the width is less than 1 or there is no caption, return the content wrapped between the [caption] tags. */
	if ( 1 > $attr['width'] || empty( $attr['caption'] ) )
		return $content;

	/* Set up the attributes for the caption
. */
	$attributes  = !empty( $attr['id'] ) ? ' id="' . esc_attr( $attr['id'] ) . '"' : '';
	$attributes .= ' class="wp-caption ' . esc_attr( $attr['align'] ) . '"';

	/* Caption width filter hook from WP core. */
	$caption_width = apply_filters( 'img_caption_shortcode_width', $attr['width'], $attr, $content );

	/* If there's a width, add the inline style for it. */
	if ( 0 < $caption_width )
		$attributes .= ' style="max-width: ' . esc_attr( $caption_width ) . 'px"';

	/* Open the caption
. */
	$output = '
';

	/* Allow shortcodes for the content the caption was created for. */
	$output .= do_shortcode( $content );

	/* Append the caption text. */
	$output .= '
' . $attr['caption'] . '
';

	/* Close the caption
. */
	$output .= '
';

	/* Return the formatted, clean caption. */
	return apply_filters( 'hoot_cleaner_caption', $output );
}


text:
<?php

/**
 * Prepares requests with a body before sending
 *
 * **Request Options**
 *
 * - expect: Set to true to enable the "Expect: 100-Continue" header for a
 *   request that send a body. Set to false to disable "Expect: 100-Continue".
 *   Set to a number so that the size of the payload must be greater than the
 *   number in order to send the Expect header. Setting to a number will send
 *   the Expect header for all requests in which the size of the payload cannot
 *   be determined or where the body is not rewindable.
 */
class puzzle_subscriber_Prepare implements puzzle_event_SubscriberInterface
{
    public function getEvents()
    {
        return array('before' => array('onBefore', puzzle_event_RequestEvents::PREPARE_REQUEST));
    }

    public function onBefore(puzzle_event_BeforeEvent $event)
    {
        $request = $event->getRequest();

        // Set the appropriate Content-Type for a request if one is not set and
        // there are form fields
        if (!($body = $request->getBody())) {
            return;
        }

        $this->addContentLength($request, $body);

        if ($body instanceof puzzle_post_PostBodyInterface) {
            // Synchronize the POST body with the request's headers
            $body->applyRequestHeaders($request);
        } elseif (!$request->hasHeader('Content-Type')) {
            $this->addContentType($request, $body);
        }

        $this->addExpectHeader($request, $body);
    }

    private function addContentType(
        puzzle_message_RequestInterface $request,
        puzzle_stream_StreamInterface $body
    ) {
        if (!($body instanceof puzzle_stream_MetadataStreamInterface)) {
            return;
        }

        if (!($uri = $body->getMetadata('uri'))) {
            return;
        }

        // Guess the content-type based on the stream's "uri" metadata value.
        // The file extension is used to determine the appropriate mime-type.
        if ($contentType = puzzle_Mimetypes::getInstance()->fromFilename($uri)) {
            $request->setHeader('Content-Type', $contentType);
        }
    }

    private function addContentLength(
        puzzle_message_RequestInterface $request,
        puzzle_stream_StreamInterface $body
    ) {
        // Set the Content-Length header if it can be determined, and never
        // send a Transfer-Encoding: chunked and Content-Length header in
        // the same request.
        if ($request->hasHeader('Content-Length')) {
            // Remove transfer-encoding if content-length is set.
            $request->removeHeader('Transfer-Encoding');
            return;
        }

        if ($request->hasHeader('Transfer-Encoding')) {
            return;
        }

        if (null !== ($size = $body->getSize())) {
            $request->setHeader('Content-Length', $size)
                ->removeHeader('Transfer-Encoding');
        } elseif ('1.1' == $request->getProtocolVersion()) {
            // Use chunked Transfer-Encoding if there is no determinable
            // content-length header and we're using HTTP/1.1.
            $request->setHeader('Transfer-Encoding', 'chunked')
                ->removeHeader('Content-Length');
        }
    }

    private function addExpectHeader(
        puzzle_message_RequestInterface $request,
        puzzle_stream_StreamInterface $body
    ) {
        // Determine if the Expect header should be used
        if ($request->hasHeader('Expect')) {
            return;
        }

        $expect = $request->getConfig();
        $expect = $expect['expect'];

        // Return if disabled or if you're not using HTTP/1.1
        if ($expect === false || $request->getProtocolVersion() !== '1.1') {
            return;
        }

        // The expect header is unconditionally enabled
        if ($expect === true) {
            $request->setHeader('Expect', '100-Continue');
            return;
        }

        // By default, send the expect header when the payload is > 1mb
        if ($expect === null) {
            $expect = 1048576;
        }

        // Always add if the body cannot be rewound, the size cannot be
        // determined, or the size is greater than the cutoff threshold
        $size = $body->getSize();
        if ($size === null || $size >= (int) $expect || !$body->isSeekable()) {
            $request->setHeader('Expect', '100-Continue');
        }
    }
}


text:
include Make_Setup.inc

#optional files to build

OPT_FILES=

#Optional Library Defines
ifeq ($(MYSQL),YES)
OPT_FILES += ucmysql.o
endif

#Optional Library Defines
ifeq ($(CURL),YES)
OPT_FILES += buffer_curl.o uc_curl.o
endif

#Optional Library Defines
ifeq ($(MYSQL),YES)
OPT_FILES += ucsqlite.o
endif

example : libuc.a example.o
	$(LINKXX) -o $@ $^

ucoder_json.cpp : json_parser.lex
	flex json_parser.lex

libuc.a : ucontainer.o buffer.o buffer_util.o ucoder_ini.o ucoder_bin.o \
string_util.o uc_web.o ucio.o ucoder_json.o buffer_curl.o uccontract.o \
ucdb.o $(OPT_FILES)
	rm -f libuc.a
	$(STATICLIB) $@ $^

buffer.o : buffer.h
buffer_util.o : buffer.h
buffer_curl.o : buffer.h
ucontainer.o : ucontainer.h stl_util.h
ucontract.o : uccontainer.h
ucio.o :  ucontainer.h stl_util.h buffer.h ucio.h
ucoder_ini.o : ucontainer.h buffer.h
ucoder_bin.o : ucontainer.h buffer.h
ucoder_json.o : ucontainer.h buffer.h
uc_web.o : ucontainer.h stl_util.h buffer.h ucio.h uc_web.h
ucsqlite.o : ucdb.h ucsqlite.h
ucmysql.o : ucdb.h ucmysql.h
example.o : ucontainer.h ucio.h

install:
	install -m644 -o root -g wheel *.h $(INSTALLDIR)/include
	install -m644 -o root -g wheel *.a $(INSTALLDIR)/lib

uninstall:
	rm -f $(INSTALLDIR)/include/buffer.h
	rm -f $(INSTALLDIR)/include/stl_util.h
	rm -f $(INSTALLDIR)/include/string_util.h
	rm -f $(INSTALLDIR)/include/uc_web.h
	rm -f $(INSTALLDIR)/include/ucio.h
	rm -f $(INSTALLDIR)/include/ucdb.h
	rm -f $(INSTALLDIR)/include/ucmysql.h
	rm -f $(INSTALLDIR)/include/ucontainer.h
	rm -f $(INSTALLDIR)/include/ucsqlite.h
	rm -f $(INSTALLDIR)/include/univcont.h
	rm -f $(INSTALLDIR)/lib/libuc.a

clean :
	rm -f *.o
	rm -f *.a
	rm -f *.gcno
	rm -f example


text:
package edu.stanford.math.plex4.io;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

import edu.stanford.math.plex4.homology.chain_basis.Simplex;
import edu.stanford.math.plex4.streams.impl.ExplicitSimplexStream;
import edu.stanford.math.plex4.streams.interfaces.AbstractFilteredStream;

public class SimplexStreamReaderWriter implements ObjectReader<AbstractFilteredStream<Simplex>>, ObjectWriter<AbstractFilteredStream<Simplex>> {
	private static final SimplexStreamReaderWriter instance = new SimplexStreamReaderWriter();

	private SimplexStreamReaderWriter() {}

	public static SimplexStreamReaderWriter getInstance() {
		return instance;
	}

	public String getExtension() {
		return "txt";
	}

	public AbstractFilteredStream<Simplex> importFromFile(String path) throws IOException {
		ExplicitSimplexStream stream = new ExplicitSimplexStream();
		BufferedReader reader = null;
		String line = null;
		String[] entries = null;
		String separator = ",";
		try {
			reader = new BufferedReader(new FileReader(path));

			// format:
			// <filtrationIndex>,<vertex0>, ... <vertexN>

			// continue reading the data
			while ((line = reader.readLine()) != null) {
				// split the line into the individual tokens
				entries = line.split(separator);
				int filtrationIndex = Integer.parseInt(entries[0]);
				int[] vertices = new int[entries.length - 1];
				for (int i = 0; i < vertices.length; i++) {
					vertices[i] = Integer.parseInt(entries[i + 1]);
				}
				stream.addElement(vertices, filtrationIndex);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			// close the reader if necessary
			if (reader != null) {
				reader.close();
			}
		}

		return stream;
	}

	public void writeToFile(AbstractFilteredStream<Simplex> object, String path) throws IOException {
		BufferedWriter writer = null;
		try {
			writer = new BufferedWriter(new FileWriter(path, false));
			for (Simplex simplex: object) {
				Integer filtrationIndex = object.getFiltrationIndex(simplex);
				writer.write(filtrationIndex.toString() + ",");
				int[] vertices = simplex.getVertices();
				for (int i = 0; i < vertices.length; i++) {
					Integer vertex = vertices[i];
					writer.write(vertex.toString());
					if (i < vertices.length - 1) {
						writer.write(",");
					}
				}
				writer.newLine();
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				writer.close();
			}
		}
	}

}


text:
<?php /* Smarty version Smarty-3.1.13, created on 2015-01-01 23:01:34
         compiled from ".\admin\themes\default\template\photos_add_direct.tpl" */ ?>
<?php /*%%SmartyHeaderCode:1826854a5c3be4a67d7-72191444%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' =>
  array (
    '230c1c1d65a824dda996e66200292c8e80d69e41' =>
    array (
      0 => '.\\admin\\themes\\default\\template\\photos_add_direct.tpl',
      1 => 1420149514,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1826854a5c3be4a67d7-72191444',
  'function' =>
  array (
  ),
  'variables' =>
  array (
    'lang_info' => 0,
    'plupload_i18n' => 0,
    'themeconf' => 0,
    'CACHE_KEYS' => 0,
    'ROOT_URL' => 0,
    'pwg_token' => 0,
    'file_exts' => 0,
    'TABSHEET_TITLE' => 0,
    'setup_errors' => 0,
    'error' => 0,
    'setup_warnings' => 0,
    'warning' => 0,
    'hide_warnings_link' => 0,
    'form_action' => 0,
    'selected_category' => 0,
    'level_options' => 0,
    'level_options_selected' => 0,
    'original_resize_maxheight' => 0,
    'original_resize_maxwidth' => 0,
    'upload_max_filesize_shorthand' => 0,
    'upload_file_types' => 0,
    'max_upload_resolution' => 0,
    'max_upload_width' => 0,
    'max_upload_height' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_54a5c3be717583_24493017',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54a5c3be717583_24493017')) {function content_54a5c3be717583_24493017($_smarty_tpl) {?><?php if (!is_callable('smarty_function_html_options')) include 'C:\\Users\\Alexandre\\hubiC\\www\\the\\web\\piwigo\\include\\smarty\\libs\\plugins\\function.html_options.php';
?><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id'=>'common','load'=>'footer','path'=>'admin/themes/default/js/common.js'),$_smarty_tpl);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id'=>'jquery.jgrowl','load'=>'footer','require'=>'jquery','path'=>'themes/default/js/plugins/jquery.jgrowl_minimized.js'),$_smarty_tpl);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id'=>'jquery.plupload','load'=>'footer','require'=>'jquery','path'=>'themes/default/js/plugins/plupload/plupload.full.min.js'),$_smarty_tpl);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id'=>'jquery.plupload.queue','load'=>'footer','require'=>'jquery','path'=>'themes/default/js/plugins/plupload/jquery.plupload.queue/jquery.plupload.queue.min.js'),$_smarty_tpl);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id'=>'jquery.ui.progressbar','load'=>'footer'),$_smarty_tpl);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_css'][0][0]->func_combine_css(array('path'=>"themes/default/js/plugins/jquery.jgrowl.css"),$_smarty_tpl);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_css'][0][0]->func_combine_css(array('path'=>"themes/default/js/plugins/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css"),$_smarty_tpl);?>

<?php $_smarty_tpl->tpl_vars["plupload_i18n"] = new Smarty_variable("themes/default/js/plugins/plupload/i18n/".((string)$_smarty_tpl->tpl_vars['lang_info']->value['plupload_code']).".js", null, 0);?>
<?php if (file_exists((constant("PHPWG_ROOT_PATH")).($_smarty_tpl->tpl_vars['plupload_i18n']->value))){?>
<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id'=>"plupload_i18n-".((string)$_smarty_tpl->tpl_vars['lang_info']->value['plupload_code']),'load'=>"footer",'path'=>$_smarty_tpl->tpl_vars['plupload_i18n']->value,'require'=>"jquery.plupload.queue"),$_smarty_tpl);?>

<?php }?>

<?php echo $_smarty_tpl->getSubTemplate ('include/colorbox.inc.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<?php echo $_smarty_tpl->getSubTemplate ('include/add_album.inc.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id'=>'LocalStorageCache','load'=>'footer','path'=>'admin/themes/default/js/LocalStorageCache.js'),$_smarty_tpl);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_script'][0][0]->func_combine_script(array('id'=>'jquery.selectize','load'=>'footer','path'=>'themes/default/js/plugins/selectize.min.js'),$_smarty_tpl);?>

<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['combine_css'][0][0]->func_combine_css(array('id'=>'jquery.selectize','path'=>"themes/default/js/plugins/selectize.".((string)$_smarty_tpl->tpl_vars['themeconf']->value['colorscheme']).".css"),$_smarty_tpl);?>

<?php $_smarty_tpl->smarty->_tag_stack[] = array('footer_script', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['footer_script'][0][0]->block_footer_script(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

var categoriesCache = new CategoriesCache({
  serverKey: '<?php echo $_smarty_tpl->tpl_vars['CACHE_KEYS']->value['categories'];?>
',
  serverId: '<?php echo $_smarty_tpl->tpl_vars['CACHE_KEYS']->value['_hash'];?>
',
  rootUrl: '<?php echo $_smarty_tpl->tpl_vars['ROOT_URL']->value;?>
'
});

categoriesCache.selectize(jQuery('[data-selectize=categories]'), {
  filter: function(categories, options) {
    if (categories.length > 0) {
      jQuery("#albumSelection, .selectFiles, .showFieldset").show();
    }

    return categories;
  }
});

jQuery('[data-add-album]').pwgAddAlbum({ cache: categoriesCache });

var pwg_token = '<?php echo $_smarty_tpl->tpl_vars['pwg_token']->value;?>
';
var photosUploaded_label = "<?php echo l10n('%d photos uploaded');?>
";
var batch_Label = "<?php echo l10n('Manage this set of %d photos');?>
";
var albumSummary_label = "<?php echo htmlspecialchars(l10n('Album "%s" now contains %d photos'), ENT_QUOTES, 'UTF-8', true);?>
";
var uploadedPhotos = [];
var uploadCategory = null;

jQuery(document).ready(function(){
  jQuery("#uploadWarningsSummary a.showInfo").click(function() {
    jQuery("#uploadWarningsSummary").hide();
    jQuery("#uploadWarnings").show();
    return false;
  });

  jQuery("#showPermissions").click(function() {
    jQuery(this).parent(".showFieldset").hide();
    jQuery("#permissions").show();
    return false;
  });

	jQuery("#uploader").pluploadQueue({
		// General settings
    browse_button : 'addFiles',
    container : 'uploadForm',

		// runtimes : 'html5,flash,silverlight,html4',
		runtimes : 'html5',

		// url : '../upload.php',
		url : 'ws.php?method=pwg.images.upload&format=json',

		chunk_size: '500kb',

		filters : {
			// Maximum file size
			max_file_size : '1000mb',
			// Specify what files to browse for
			mime_types: [
				{title : "Image files", extensions : "<?php echo $_smarty_tpl->tpl_vars['file_exts']->value;?>
"}
			]
		},

		// Rename files by clicking on their titles
		// rename: true,

		// Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
		dragdrop: true,

    preinit: {
      Init: function (up, info) {
        jQuery('#uploader_container').removeAttr("title"); //remove the "using runtime" text

        jQuery('#startUpload').on('click', function(e) {
            e.preventDefault();
            up.start();
          });

        jQuery('#cancelUpload').on('click', function(e) {
            e.preventDefault();
            up.stop();
            up.trigger('UploadComplete', up.files);
          });
      }
    },

    init : {
      // update custom button state on queue change
      QueueChanged : function(up) {
        jQuery('#startUpload').prop('disabled', up.files.length == 0);
      },

      UploadProgress: function(up, file) {
        jQuery('#uploadingActions .progressbar').width(up.total.percent+'%');
      },

      FilesAdded: function() {
    if (tour.getCurrentStep()==4)
    {
      tour.goTo(5);
    }

  },
  BeforeUpload: function(up, file) {
        //console.log('[BeforeUpload]', file);

        // hide buttons
        jQuery('#startUpload, #addFiles').hide();
        jQuery('#uploadingActions').show();

        // warn user if she wants to leave page while upload is running
        jQuery(window).bind('beforeunload', function() {
          return "<?php echo htmlspecialchars(l10n('Upload in progress'), ENT_QUOTES, 'UTF-8', true);?>
";
        });

        // no more change on category/level
        jQuery("select[name=level]").attr("disabled", "disabled");

        // You can override settings before the file is uploaded
        up.setOption(
          'multipart_params',
          {
            category : jQuery("select[name=category] option:selected").val(),
            level : jQuery("select[name=level] option:selected").val(),
            pwg_token : pwg_token
            // name : file.name
          }
        );
      },

      FileUploaded: function(up, file, info) {
        // Called when file has finished uploading
        //console.log('[FileUploaded] File:', file, "Info:", info);

        // hide item line
        jQuery('#'+file.id).hide();

        var data = jQuery.parseJSON(info.response);

        jQuery("#uploadedPhotos").parent("fieldset").show();

        html = '';
        html += '';
        html += ' ';

        jQuery("#uploadedPhotos").prepend(html);

        // do not remove file, or it will reset the progress bar :-/
        // up.removeFile(file);
        uploadedPhotos.push(parseInt(data.result.image_id));
        uploadCategory = data.result.category;
      },

      UploadComplete: function(up, files) {
  if (tour.getCurrentStep()==5)
  {
    tour.goTo(6);
  }

        // Called when all files are either uploaded or failed
        //console.log('[UploadComplete]');

        jQuery(".selectAlbum, .selectFiles, #permissions, .showFieldset").hide();

        jQuery(".infos").append('

'+sprintf(photosUploaded_label, uploadedPhotos.length)+'

');

        html = sprintf(
          albumSummary_label,
          ''+uploadCategory.label+'',
          parseInt(uploadCategory.nb_photos)
        );

        jQuery(".infos ul").append('
'+html+'
');

        jQuery(".infos").show();

        // TODO: use a new method pwg.caddie.empty +
        // pwg.caddie.add(uploadedPhotos) instead of relying on huge GET parameter
        // (and remove useless code from admin/photos_add_direct.php)

        jQuery(".batchLink").attr("href", "admin.php?page=photos_add&section=direct&batch="+uploadedPhotos.join(","));
        jQuery(".batchLink").html(sprintf(batch_Label, uploadedPhotos.length));

        jQuery(".afterUploadActions").show();
        jQuery('#uploadingActions').hide();

        // user can safely leave page without warning
        jQuery(window).unbind('beforeunload');
      }
    }
	});

});
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['footer_script'][0][0]->block_footer_script(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>

<?php echo l10n('Upload Photos');?>
 <?php echo $_smarty_tpl->tpl_vars['TABSHEET_TITLE']->value;?>

 | <?php echo l10n('Add another set of photos');?>

<?php if (count($_smarty_tpl->tpl_vars['setup_errors']->value)>0){?>

<?php  $_smarty_tpl->tpl_vars['error'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['error']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['setup_errors']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['error']->key => $_smarty_tpl->tpl_vars['error']->value){
$_smarty_tpl->tpl_vars['error']->_loop = true;
?>

<?php echo $_smarty_tpl->tpl_vars['error']->value;?>

<?php } ?>

<?php }else{ ?>

<?php if (count($_smarty_tpl->tpl_vars['setup_warnings']->value)>0){?>

<?php  $_smarty_tpl->tpl_vars['warning'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['warning']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['setup_warnings']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['warning']->key => $_smarty_tpl->tpl_vars['warning']->value){
$_smarty_tpl->tpl_vars['warning']->_loop = true;
?>

<?php echo $_smarty_tpl->tpl_vars['warning']->value;?>

<?php } ?>

<a href="<?php echo $_smarty_tpl->tpl_vars['hide_warnings_link']->value;?>
"><?php echo l10n('Hide');?>

<?php }?>
<form id="uploadForm" enctype="multipart/form-data" method="post" action="<?php echo $_smarty_tpl->tpl_vars['form_action']->value;?>
">
    <fieldset class="selectAlbum">
      <legend><?php echo l10n('Drop into album');?>
</legend>

      <select data-selectize="categories" data-value="<?php echo htmlspecialchars(json_encode($_smarty_tpl->tpl_vars['selected_category']->value), ENT_QUOTES, 'UTF-8', true);?>
"
        data-default="first" name="category" style="width:600px"></select>

<?php echo l10n('... or ');?>

      <a href="#" data-add-album="category" title="<?php echo l10n('create a new album');?>
"><?php echo l10n('create a new album');?>

    </fieldset>

<?php echo l10n('Manage Permissions');?>

    <fieldset id="permissions" style="display:none">
      <legend><?php echo l10n('Who can see these photos?');?>
</legend>

      <select name="level" size="1">
        <?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['level_options']->value,'selected'=>$_smarty_tpl->tpl_vars['level_options_selected']->value),$_smarty_tpl);?>

      </select>
    </fieldset>

    <fieldset class="selectFiles" style="display:none">
      <legend><?php echo l10n('Select files');?>
</legend>

      <button id="addFiles" class="buttonLike icon-plus-circled"><?php echo l10n('Add Photos');?>
</button>

<?php if (isset($_smarty_tpl->tpl_vars['original_resize_maxheight']->value)){?>

<?php echo l10n('The picture dimensions will be reduced to %dx%d pixels.',$_smarty_tpl->tpl_vars['original_resize_maxwidth']->value,$_smarty_tpl->tpl_vars['original_resize_maxheight']->value);?>

<?php }?>

<?php echo $_smarty_tpl->tpl_vars['upload_max_filesize_shorthand']->value;?>
B. <?php echo $_smarty_tpl->tpl_vars['upload_file_types']->value;?>
. <?php if (isset($_smarty_tpl->tpl_vars['max_upload_resolution']->value)){?><?php echo $_smarty_tpl->tpl_vars['max_upload_resolution']->value;?>
Mpx<?php }?> <a class="icon-info-circled-1 showInfo" title="<?php echo l10n('Learn more');?>
">

        <?php echo l10n('Maximum file size: %sB.',$_smarty_tpl->tpl_vars['upload_max_filesize_shorthand']->value);?>

        <?php echo l10n('Allowed file types: %s.',$_smarty_tpl->tpl_vars['upload_file_types']->value);?>

<?php if (isset($_smarty_tpl->tpl_vars['max_upload_resolution']->value)){?>
        <?php echo l10n('Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).',$_smarty_tpl->tpl_vars['max_upload_resolution']->value,$_smarty_tpl->tpl_vars['max_upload_width']->value,$_smarty_tpl->tpl_vars['max_upload_height']->value);?>

<?php }?>

Your browser doesn't have HTML5 support.

    </fieldset>

      <button id="cancelUpload" class="buttonLike icon-cancel-circled"><?php echo l10n('Cancel');?>
</button>

    <button id="startUpload" class="buttonLike icon-upload" disabled><?php echo l10n('Start Upload');?>
</button>

</form>

<fieldset style="display:none">
  <legend><?php echo l10n('Uploaded Photos');?>
</legend>

</fieldset>

<?php }?>

<?php }} ?>


text:
/*	$NetBSD: clnt_raw.c,v 1.20 2000/12/10 04:12:03 christos Exp $	*/

/*-
 * Copyright (c) 2009, Sun Microsystems, Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * - Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 * - Neither the name of Sun Microsystems, Inc. nor the names of its
 *   contributors may be used to endorse or promote products derived
 *   from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#if defined(LIBC_SCCS) && !defined(lint)
static char *sccsid2 = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
static char *sccsid = "@(#)clnt_raw.c	2.2 88/08/01 4.0 RPCSRC";
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

/*
 * clnt_raw.c
 *
 * Copyright (C) 1984, Sun Microsystems, Inc.
 *
 * Memory based rpc for simple testing and timing.
 * Interface to create an rpc client and server in the same process.
 * This lets us similate rpc and get round trip overhead, without
 * any interference from the kernel.
 */

#include "namespace.h"
#include "reentrant.h"
#include <assert.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>

#include <rpc/rpc.h>
#include <rpc/raw.h>
#include "un-namespace.h"
#include "mt_misc.h"

#define MCALL_MSG_SIZE 24

/*
 * This is the "network" we will be moving stuff over.
 */
static struct clntraw_private {
	CLIENT	client_object;
	XDR	xdr_stream;
	char	*_raw_buf;
	union {
	    struct rpc_msg	mashl_rpcmsg;
	    char 		mashl_callmsg[MCALL_MSG_SIZE];
	} u;
	u_int	mcnt;
} *clntraw_private;

static enum clnt_stat clnt_raw_call(CLIENT *, rpcproc_t, xdrproc_t, void *,
	xdrproc_t, void *, struct timeval);
static void clnt_raw_geterr(CLIENT *, struct rpc_err *);
static bool_t clnt_raw_freeres(CLIENT *, xdrproc_t, void *);
static void clnt_raw_abort(CLIENT *);
static bool_t clnt_raw_control(CLIENT *, u_int, void *);
static void clnt_raw_destroy(CLIENT *);
static struct clnt_ops *clnt_raw_ops(void);

/*
 * Create a client handle for memory based rpc.
 */
CLIENT *
clnt_raw_create(prog, vers)
	rpcprog_t prog;
	rpcvers_t vers;
{
	struct clntraw_private *clp;
	struct rpc_msg call_msg;
	XDR *xdrs;
	CLIENT	*client;

	mutex_lock(&clntraw_lock);
	if ((clp = clntraw_private) == NULL) {
		clp = (struct clntraw_private *)calloc(1, sizeof (*clp));
		if (clp == NULL) {
			mutex_unlock(&clntraw_lock);
			return NULL;
		}
		if (__rpc_rawcombuf == NULL)
			__rpc_rawcombuf =
			    (char *)calloc(UDPMSGSIZE, sizeof (char));
		clp->_raw_buf = __rpc_rawcombuf;
		clntraw_private = clp;
	}
	xdrs = &clp->xdr_stream;
	client = &clp->client_object;

	/*
	 * pre-serialize the static part of the call msg and stash it away
	 */
	call_msg.rm_direction = CALL;
	call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
	/* XXX: prog and vers have been long historically :-( */
	call_msg.rm_call.cb_prog = (u_int32_t)prog;
	call_msg.rm_call.cb_vers = (u_int32_t)vers;
	xdrmem_create(xdrs, clp->u.mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE);
	if (! xdr_callhdr(xdrs, &call_msg))
		warnx("clntraw_create - Fatal header serialization error.");
	clp->mcnt = XDR_GETPOS(xdrs);
	XDR_DESTROY(xdrs);

	/*
	 * Set xdrmem for client/server shared buffer
	 */
	xdrmem_create(xdrs, clp->_raw_buf, UDPMSGSIZE, XDR_FREE);

	/*
	 * create client handle
	 */
	client->cl_ops = clnt_raw_ops();
	client->cl_auth = authnone_create();
	mutex_unlock(&clntraw_lock);
	return (client);
}

/* ARGSUSED */
static enum clnt_stat
clnt_raw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
	CLIENT *h;
	rpcproc_t proc;
	xdrproc_t xargs;
	void *argsp;
	xdrproc_t xresults;
	void *resultsp;
	struct timeval timeout;
{
	struct clntraw_private *clp = clntraw_private;
	XDR *xdrs = &clp->xdr_stream;
	struct rpc_msg msg;
	enum clnt_stat status;
	struct rpc_err error;

	assert(h != NULL);

	mutex_lock(&clntraw_lock);
	if (clp == NULL) {
		mutex_unlock(&clntraw_lock);
		return (RPC_FAILED);
	}
	mutex_unlock(&clntraw_lock);

call_again:
	/*
	 * send request
	 */
	xdrs->x_op = XDR_ENCODE;
	XDR_SETPOS(xdrs, 0);
	clp->u.mashl_rpcmsg.rm_xid ++ ;
	if ((! XDR_PUTBYTES(xdrs, clp->u.mashl_callmsg, clp->mcnt)) ||
	    (! XDR_PUTINT32(xdrs, &proc)) ||
	    (! AUTH_MARSHALL(h->cl_auth, xdrs)) ||
	    (! (*xargs)(xdrs, argsp))) {
		return (RPC_CANTENCODEARGS);
	}
	(void)XDR_GETPOS(xdrs);  /* called just to cause overhead */

	/*
	 * We have to call server input routine here because this is
	 * all going on in one process. Yuk.
	 */
	svc_getreq_common(FD_SETSIZE);

	/*
	 * get results
	 */
	xdrs->x_op = XDR_DECODE;
	XDR_SETPOS(xdrs, 0);
	msg.acpted_rply.ar_verf = _null_auth;
	msg.acpted_rply.ar_results.where = resultsp;
	msg.acpted_rply.ar_results.proc = xresults;
	if (! xdr_replymsg(xdrs, &msg)) {
		/*
		 * It's possible for xdr_replymsg() to fail partway
		 * through its attempt to decode the result from the
		 * server. If this happens, it will leave the reply
		 * structure partially populated with dynamically
		 * allocated memory. (This can happen if someone uses
		 * clntudp_bufcreate() to create a CLIENT handle and
		 * specifies a receive buffer size that is too small.)
		 * This memory must be free()ed to avoid a leak.
		 */
		int op = xdrs->x_op;
		xdrs->x_op = XDR_FREE;
		xdr_replymsg(xdrs, &msg);
		xdrs->x_op = op;
		return (RPC_CANTDECODERES);
	}
	_seterr_reply(&msg, &error);
	status = error.re_status;

	if (status == RPC_SUCCESS) {
		if (! AUTH_VALIDATE(h->cl_auth, &msg.acpted_rply.ar_verf)) {
			status = RPC_AUTHERROR;
		}
	}  /* end successful completion */
	else {
		if (AUTH_REFRESH(h->cl_auth, &msg))
			goto call_again;
	}  /* end of unsuccessful completion */

	if (status == RPC_SUCCESS) {
		if (! AUTH_VALIDATE(h->cl_auth, &msg.acpted_rply.ar_verf)) {
			status = RPC_AUTHERROR;
		}
		if (msg.acpted_rply.ar_verf.oa_base != NULL) {
			xdrs->x_op = XDR_FREE;
			(void)xdr_opaque_auth(xdrs, &(msg.acpted_rply.ar_verf));
		}
	}

	return (status);
}

/*ARGSUSED*/
static void
clnt_raw_geterr(cl, err)
	CLIENT *cl;
	struct rpc_err *err;
{
}

/* ARGSUSED */
static bool_t
clnt_raw_freeres(cl, xdr_res, res_ptr)
	CLIENT *cl;
	xdrproc_t xdr_res;
	void *res_ptr;
{
	struct clntraw_private *clp = clntraw_private;
	XDR *xdrs = &clp->xdr_stream;
	bool_t rval;

	mutex_lock(&clntraw_lock);
	if (clp == NULL) {
		rval = (bool_t) RPC_FAILED;
		mutex_unlock(&clntraw_lock);
		return (rval);
	}
	mutex_unlock(&clntraw_lock);
	xdrs->x_op = XDR_FREE;
	return ((*xdr_res)(xdrs, res_ptr));
}

/*ARGSUSED*/
static void
clnt_raw_abort(cl)
	CLIENT *cl;
{
}

/*ARGSUSED*/
static bool_t
clnt_raw_control(cl, ui, str)
	CLIENT *cl;
	u_int ui;
	void *str;
{
	return (FALSE);
}

/*ARGSUSED*/
static void
clnt_raw_destroy(cl)
	CLIENT *cl;
{
}

static struct clnt_ops *
clnt_raw_ops()
{
	static struct clnt_ops ops;

	/* VARIABLES PROTECTED BY ops_lock: ops */

	mutex_lock(&ops_lock);
	if (ops.cl_call == NULL) {
		ops.cl_call = clnt_raw_call;
		ops.cl_abort = clnt_raw_abort;
		ops.cl_geterr = clnt_raw_geterr;
		ops.cl_freeres = clnt_raw_freeres;
		ops.cl_destroy = clnt_raw_destroy;
		ops.cl_control = clnt_raw_control;
	}
	mutex_unlock(&ops_lock);
	return (&ops);
}


text:
"/Users/MikkelsImac/Library/Application Support/Titanium/mobilesdk/osx/2.1.3.GA/iphone/builder.py" xcode
exit $?


text:
package org.dbasu.robomvvm.componentmodel;

import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RatingBar;
import android.widget.SeekBar;
import android.widget.TextView;

import com.google.common.base.Preconditions;

import org.dbasu.robomvvm.componentadapter.adapterview.AdapterViewAdapter;
import org.dbasu.robomvvm.componentadapter.compoundbutton.CompoundButtonViewAdapter;
import org.dbasu.robomvvm.componentadapter.edittext.EditTextViewAdapter;
import org.dbasu.robomvvm.componentadapter.imageview.ImageViewAdapter;
import org.dbasu.robomvvm.componentadapter.listview.ListViewAdapter;
import org.dbasu.robomvvm.componentadapter.menuitem.MenuItemAdapter;
import org.dbasu.robomvvm.componentadapter.progressbar.ProgressBarViewAdapter;
import org.dbasu.robomvvm.componentadapter.ratingbar.RatingBarViewAdapter;
import org.dbasu.robomvvm.componentadapter.seekbar.SeekBarViewAdapter;
import org.dbasu.robomvvm.componentadapter.textview.TextViewAdapter;
import org.dbasu.robomvvm.componentadapter.view.ViewAdapter;
import org.dbasu.robomvvm.util.ObjectTagger;

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

/**
 * An adapter to make components from arbitrary objects. Make associations between object classes and component adapters
 * classes using {@link ComponentAdapter.Associations}. Create or retrieve the component adapter
 * of an object of one of the associated types or their subtypes using {@link #get(Object)}.
 */
public class ComponentAdapter extends Component {

    private static final String COMPONENT_ADAPTER = "robomvvm_component_adapter";

    /**
     * Can make associations between arbitrary classes and the {@link ComponentAdapter} subclasses that are used to make
     * components out of them.
     */
    public static class Associations {

        static {
            adapterTypes = new HashMap<Class<?>, Class<? extends ComponentAdapter>>();
            set(MenuItem.class, MenuItemAdapter.class);
            set(View.class, ViewAdapter.class);
            set(ImageView.class, ImageViewAdapter.class);
            set(TextView.class, TextViewAdapter.class);
            set(EditText.class, EditTextViewAdapter.class);
            set(CompoundButton.class, CompoundButtonViewAdapter.class);
            set(ProgressBar.class, ProgressBarViewAdapter.class);
            set(SeekBar.class, SeekBarViewAdapter.class);
            set(RatingBar.class, RatingBarViewAdapter.class);
            set(AdapterView.class, AdapterViewAdapter.class);
            set(ListView.class, ListViewAdapter.class);
        }

        private static final Map<Class<?>, Class<? extends ComponentAdapter>> adapterTypes;

        /**
         * Get the associated component adapter class associated with a class. If no
         * component adapter class is associated with the supplied class, then its super classes and interfaces
         * are searched until a component adapter association is found.
         * @param objectType
         *          The class of the object to find associations for.
         * @return
         *          The associated component adapter class, or null if none is found.
         */
        public synchronized static Class<? extends ComponentAdapter> get(Class<?> objectType) {
            Preconditions.checkNotNull(objectType);

            Class<? extends ComponentAdapter> adapterType = null;

            Class<?> myObjectType = objectType;

            List<Class<?>> reachableObjectTypes = new ArrayList<Class<?>>();

            while (myObjectType!= null) {

                reachableObjectTypes.add(myObjectType);
                reachableObjectTypes.addAll(Arrays.asList(myObjectType.getInterfaces()));

                myObjectType = myObjectType.getSuperclass();
            }

            for(Class<?> klazz : reachableObjectTypes) {
                adapterType = adapterTypes.get(klazz);
                if(adapterType != null) return  adapterType;

            }

            return null;
        }

        /**
         * Associates a component adapter class with an arbitrary class.
         * @param objectType
         *          The class to make the association for. If an association already exists for this class, then it is overwritten.
         * @param adapterType
         *          The component adapter class to associate with the supplied class.
         *          If this is null, then any existing association of the supplied class is removed.
         */
        public synchronized static void set(Class<?> objectType, Class<? extends ComponentAdapter> adapterType) {
            Preconditions.checkNotNull(objectType);

            if(adapterType != null) {
                adapterTypes.put(objectType, adapterType);
            }
            else {
                adapterTypes.remove(objectType);
            }
        }
    }

    /**
     * Create or retrieve the component adapter for the supplied object. Once created, the component adapter is stored as a tag
     * on the supplied object using {@link org.dbasu.robomvvm.util.ObjectTagger}, which stores weak references to the supplied object to
     * allow for Garbage Collection. Any component adapter associated with an object that has been garbage collected is not stored
     * internally by the library.
     *
     * @param targetObject
     *          The object to get the component adapter for.
     * @return
     *          The component adapter for the supplied object.
     *
     * @throws java.lang.RuntimeException
     *          When no component adapter class is associated with
     *          the class of the supplied object.
     */
    public synchronized static ComponentAdapter get(Object targetObject) {
        Preconditions.checkNotNull(targetObject);

        ComponentAdapter componentAdapter = (ComponentAdapter) ObjectTagger.getTag(targetObject, COMPONENT_ADAPTER);
        if (componentAdapter != null) return componentAdapter;

        Class<? extends ComponentAdapter> adapterType = Associations.get(targetObject.getClass());

        if(adapterType == null) {

            throw new RuntimeException("No ComponentAdapter Subclass Associated With " + targetObject.getClass().getName() +
                    ". Call ComponentAdapter.Associations.set(Class<?> objectType, Class<? extends ComponentAdapter> adapterType) " +
                    "To Make The Association.");
        }

        try {
            componentAdapter = adapterType.newInstance();

        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        componentAdapter.init(targetObject);

        ObjectTagger.setTag(targetObject, COMPONENT_ADAPTER, componentAdapter);

        return componentAdapter;
    }

    protected Object targetObject;

    protected ComponentAdapter() {

    }

    /**
     * Gets the target object of this component adapter.
     * @return
     *          Returns the target object.
     */
    public Object getTargetObject() {
        return targetObject;
    }

    private void init(Object targetObject) {
        this.targetObject = targetObject;
        adapt();

    }

    /**
     * Call this function in subclasses to set up the component adapter.
     */
    protected void adapt() {

    }
}


text:
/*global describe, beforeEach, module, it, inject, config, EZSpy */

describe('SearchCtrl', function () {

    'use strict';

    beforeEach(function () {
        module('voyager.security'); //auth service module - apparently this is needed to mock the auth service
        module('voyager.results');
        module(function ($provide) {
            $provide.constant('config', config);
            $provide.value('authService',{});  //mock the auth service so it doesn't call the init methods
        });
        module('voyager.tagging');
        module('voyager.details');
    });

    var scope, controllerService, translateServiceMock, authServiceMock, detailServiceMock, q, tagServiceMock, location, timeout;

    //spies
    var $s = {'configService':{}, 'cartService':{}, searchService:{}};

    beforeEach(inject(function ($rootScope, $controller, $q, $location, $timeout, searchService, cartService, configService) {
        scope = $rootScope.$new();
        q = $q;
        controllerService = $controller;
        location = $location;
        timeout = $timeout;

        EZSpy.spyOnAll($s, [{searchService:searchService}, {cartService:cartService}, {configService:configService}]);
        $s.searchService.getPageIds.and.returnValue([1]);
        $s.searchService.testEsriGeocodeService.and.returnValue(q.when({}));
    }));

    describe('Load', function () {

        it('should load with empty results', function () {

            var response = {docs:[], numFound:0}, sort = {key:'key', value:'value'};

            $s.configService.getSortable.and.returnValue([sort]);
            $s.searchService.doSearch2.and.returnValue(q.when({data:{response:response}}));

            controllerService('SearchCtrl', {$scope: scope, 'cartService': $s.cartService, 'searchService': $s.searchService, 'translateService': translateServiceMock, 'authService': authServiceMock, 'detailService': detailServiceMock, 'configService':$s.configService, 'tagService':tagServiceMock});

            scope.$apply();

            expect(scope.results).toBe(response.docs);
            expect(scope.totalItems).toBe(response.numFound);
            expect(scope.displaySortField).toBe(sort.value);
            expect(scope.sortField).toBe(sort.key);

        });

        it('should sync cart state', function () {

            var response = {docs:[{id:'id'}], numFound:0}, sort = {key:'key', value:'value'};
            var items = [{id:'id'}];

            $s.configService.getSortable.and.returnValue([sort]);
            $s.searchService.doSearch2.and.returnValue(q.when({data:{response:response}}));
            $s.searchService.getPageIds.and.returnValue([1]);
            $s.searchService.getItemsPerPage.and.returnValue(12);

            $s.cartService.hasItems.and.returnValue(true);
            $s.cartService.fetchQueued.and.returnValue(q.when(items));

            spyOn(scope,'$broadcast');

            controllerService('SearchCtrl', {$scope: scope, 'cartService': $s.cartService, 'searchService': $s.searchService, 'translateService': translateServiceMock, 'authService': authServiceMock, 'detailService': detailServiceMock, 'configService':$s.configService, 'tagService':tagServiceMock});

            scope.$apply();

            expect(response.docs[0].inCart).toBe(true);
            expect(scope.$broadcast).toHaveBeenCalledWith('syncCard', {});

        });

        it('should sort by location sort param', function () {

            var response = {docs:[{id:'id'}], numFound:0}, sortField = {key:'key', value:'value'}, sortField2 = {key:'key2', value:'value2'};
            spyOn(location,'search').and.returnValue({sort:'key2'});

            $s.configService.getSortable.and.returnValue([sortField, sortField2]);
            $s.searchService.doSearch2.and.returnValue(q.when({data:{response:response}}));

            controllerService('SearchCtrl', {$scope: scope, 'cartService': $s.cartService, 'searchService': $s.searchService, 'translateService': translateServiceMock, 'authService': authServiceMock, 'detailService': detailServiceMock, 'configService':$s.configService, 'tagService':tagServiceMock});

            scope.$apply();

            expect(scope.displaySortField).toBe(sortField2.value);
            expect(scope.sortField).toBe(sortField2.key);

        });

    });

    describe('Events', function () {
        it('should handle doSearch', function () {

            var response = {docs:[], numFound:0}, sort = {key:'key', value:'value'};
            spyOn(location,'search').and.returnValue({sort:'key', sortdir:'asc'});

            $s.configService.getSortable.and.returnValue([sort]);
            $s.searchService.doSearch2.and.returnValue(q.when({data:{response:response}}));

            controllerService('SearchCtrl', {$scope: scope, 'cartService': $s.cartService, 'searchService': $s.searchService, 'translateService': translateServiceMock, 'authService': authServiceMock, 'detailService': detailServiceMock, 'configService':$s.configService, 'tagService':tagServiceMock});

            scope.$apply();

            scope.$emit('doSearch');

            expect(scope.results).toBe(response.docs);
            expect(scope.totalItems).toBe(response.numFound);
            expect(scope.displaySortField).toBe(sort.value);
            expect(scope.sortField).toBe(sort.key);

            expect($s.searchService.setSort).toHaveBeenCalledWith('asc');

        });

        it('should handle filterChanged', function () {

            var response = {docs:[], numFound:0}, sort = {key:'key', value:'value'};

            $s.configService.getSortable.and.returnValue([sort]);
            $s.searchService.doSearch2.and.returnValue(q.when({data:{response:response}}));

            controllerService('SearchCtrl', {$scope: scope, 'cartService': $s.cartService, 'searchService': $s.searchService, 'translateService': translateServiceMock, 'authService': authServiceMock, 'detailService': detailServiceMock, 'configService':$s.configService, 'tagService':tagServiceMock});

            scope.$apply();

            scope.$emit('filterChanged');

            timeout.flush();

            expect(scope.results).toBe(response.docs);
            expect(scope.totalItems).toBe(response.numFound);

            expect($s.searchService.doSearch2).toHaveBeenCalled();

        });
    });
});


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.plugins.fsbrowser;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashSet;
import java.util.Set;

import javax.swing.ImageIcon;

import org.junit.Assert;
import org.junit.Test;

import generic.test.AbstractGenericTest;
import resources.ResourceManager;

public class ImageManagerTest extends AbstractGenericTest {

	@Test
	public void testImageManagerLoadedIconResources()
			throws IllegalArgumentException, IllegalAccessException {

		ImageIcon defaultIcon = ResourceManager.getDefaultIcon();

		Set<String> failedIcons = new HashSet<>();
		for (Field field : ImageManager.class.getDeclaredFields()) {
			if (Modifier.isStatic(field.getModifiers()) &&
					field.getType().equals(ImageIcon.class)) {
				Object fieldValue = field.get(null);
				if (fieldValue == null || fieldValue == defaultIcon) {
					failedIcons.add(field.getName());
				}
			}
		}
		Assert.assertTrue("Some icons failed to load or misconfigured: " + failedIcons.toString(),
			failedIcons.isEmpty());
	}
}


text:
using DeftPack.TestAutomation.Selenium.PageObjects.MetaInformation;
using OpenQA.Selenium;
using System.Collections.Generic;

namespace DeftPack.TestAutomation.Selenium.PageObjects.Elements
{
    /// <summary>
    /// HTML: thead
    /// </summary>
    [HtmlTag("thead")]
    public class TableHeader : Element
    {
        public TableHeader(IWebElement proxyObject, IEnumerable<TableRow> rows)
            : base(proxyObject)
        {
            Rows = rows;
        }

        public IEnumerable<TableRow> Rows { get; private set; }
    }
}


text:
static unsigned long flags = 0;

static void print_help(tl_option *opt, const char *value)
{
	(void)opt;
	(void)value;

	puts("Usage: cmdline <options> [files...]\n\n"
	     "  --help, -h      Print this help text and exit\n"
	     "  --version, -V   Print version information and exit\n"
	     "  --foo-flag, -f  Set the foo flag\n"
	     "  --bar-flag, -b  Set the bar flag\n");
	exit(EXIT_SUCCESS);
}

static void print_version(tl_option *opt, const char *value)
{
	(void)opt;
	(void)value;

	puts("cmdline version 5000");
	exit(EXIT_SUCCESS);
}

static tl_option options[] = {
	{ TL_OPT_ARG_OPTIONAL, "help", 'h', 0, NULL, print_help },
	{ TL_OPT_ARG_NONE, "version", 'V', 0, NULL, print_version },
	{ TL_OPT_ARG_NONE, "foo-flag", 'f', FLAG_FOO, &flags, NULL },
	{ TL_OPT_ARG_NONE, "bar-flag", 'b', FLAG_BAR, &flags, NULL },
	{ 0, NULL, 0, 0, NULL, NULL },
};

int main(int argc, char **argv)
{
	int optind, ret;

	if (argc < 2)
		print_help(NULL, NULL);

	ret = tl_process_args(options, argc, argv, &optind);

	if (ret < 0) {
		if (ret == TL_OPT_UNKNOWN) {
			fprintf(stderr, "Unknown option '%s'\n", argv[optind]);
		} else if (ret == TL_OPT_MISSING_ARGUMENT) {
			fprintf(stderr,
				"Option '%s' requires an argument\n",
				argv[optind]);
		} else if (ret == TL_OPT_EXTRA_ARGUMENT) {
			fprintf(stderr,
				"Option '%s' does not accept arguments\n",
				argv[optind]);
		} else {
			fprintf(stderr, "Malformed options '%s'\n",
				argv[optind]);
		}
		return EXIT_FAILURE;
	}

	if (flags & FLAG_FOO)
		puts("The foo flag is set");

	if (flags & FLAG_BAR)
		puts("The bar flag is set");

	puts("Extra, non option arguments (e.g. file names):");

	while (optind < argc) {
		printf("%s\n", argv[optind++]);
	}

	return EXIT_SUCCESS;
}


text:
require 'spec_helper'

describe FormatHelper, type: :helper do

  describe 'markdown' do
    it 'should return empty string for nil' do
      expect(markdown(nil)).to eq ''
    end

    it "doesn't render links with unsafe URI schemes" do
      expect(markdown('[a](javascript:b)')).to eq "
[a](javascript:b)
\n"
    end

    it 'should return HTML for header markdown' do
      expect(markdown('# this is my header')).to eq "
this is my header
\n"
    end
  end
end


text:
Similar to boxes, steps are applications on wercker. You can create them
by including a `run.sh` file in your repository that is run on wercker
when the step is activated. Furthermore, a `wercker-step.yml` needs to
be created that contains data on the step.

Let's create a step that notifies the Campfire chat platform when we do
a build on wercker. You can find the source for this step on
[GitHub](https://github.com/wwwouter/wercker-step-campfire-notify). Before we
begin, please make sure you are familiar with [environment variables](/articles/steps/variables.html)
and have read [A guide to steps](/articles/steps/guide.html).

We want to use this step in the following way in the
[wercker.yml](/articles/werckeryml) of our application:

```yaml
build:
  steps:
    - wouter/campfire-notify:
        token: $CAMPFIRE_TOKEN
        room-id: id
        subdomain: <<your campfire subdomain>>
        message: $WERCKER_APPLICATION_OWNER_NAME/$WERCKER_APPLICATION_NAME build by $WERCKER_STARTED_BY finished
```

The parameters for this step are self-explanatory; the **token** is our
Campfire token, **the room_id** the room that we want to post the
message to, subdomain is our campfie subdomain. Finally the message is
the message that we want to post to the Campfire room. It is constructed
from the various environment variables that are available on wercker and
those which you have specified on wercker yourself.

Next to the `wercker-step.yml` each step needs a `run.sh` file that
either runs your steps commands or executes another program (which could
be written in Python, Ruby or another language).

Let's look at the `run.sh` file for this Campfire notification step:

```bash
if [ ! -n "$WERCKER_CAMPFIRE_NOTIFY_TOKEN" ]; then
  error 'Please specify token property'
  exit 1
fi

if [ ! -n "$WERCKER_CAMPFIRE_NOTIFY_MESSAGE" ]; then
  error 'Please specify message property'
  exit 1
fi

if [ ! -n "$WERCKER_CAMPFIRE_NOTIFY_SUBDOMAIN" ]; then
  error 'Please specify subdomain property'
  exit 1
fi

if [ ! -n "$WERCKER_CAMPFIRE_NOTIFY_ROOM_ID" ]; then
  error 'Please specify room_id property'
  exit 1
fi

curl --user $WERCKER_CAMPFIRE_NOTIFY_TOKEN:x  -X POST -H "Content-Type: application/json" -d "{\"message\":{\"body\":\"$WERCKER_CAMPFIRE_NOTIFY_MESSAGE\", \"type\":\"TextMessage\"}}" https://$WERCKER_CAMPFIRE_NOTIFY_SUBDOMAIN.campfirenow.com/room/$WERCKER_CAMPFIRE_NOTIFY_ROOM_ID/speak
```

Here we check if the necessary environment variables are available, If
this is the case, we finaly do a simple **curl** command that does a
**HTTP POST** with **JSON** to the Campfire room.

We now have build notifications to Campfire for our wercker pipeline!

## Adding your step to the wercker directory

Make sure to add your repository to wercker. If you need some guidance with this, see the [getting started guide for the web](/articles/gettingstarted/web.html), that will help you do so.

Add your **wercker-step.yml** and **run.sh** to your git repository and push it to either GitHub or Bitbucket.

```no-highlight
git add wercker-step.yml run.sh
git commit -am 'added wercker-step.yml and run.sh'
git push origin master
```

This should trigger a build, which should pass.

You need to deploy your step to the wercker directory, just like any
other application. As such, you also need to create a deploy target for
the directory, so let's do so.

Go to the `settings tab` and under the *Deploy targets* section click **add deploy target**, after which a dialog is presented.

![image](http://f.cl.ly/items/0n0g0C0W3e1o33322o2R/Screen%20Shot%202013-07-08%20at%203.54.58%20PM.png)

Pick **wercker directory** as a deploy target and give it a name (such as
'directory').

![image](http://f.cl.ly/items/222d453f1R2w1F3a3o1V/Screen%20Shot%202013-07-08%20at%203.55.20%20PM.png)

Now go to your green build and hit the deploy button.

![image](http://f.cl.ly/items/3E3s3m2f0y360Z3F3q2H/deploy-to-directory.jpg)

Your step should now be available in the directory!

## Conclusion

Steps are quite powerful and can be created in other programming
languages as well.

We have a large collection of steps available on wercker's [GitHub
page](http://github.com/wercker) that you can use for inspiration for
creating your own steps.


text:
class WitnessSubclassExporter < GenericExporter
  def export
    super().merge('witness' => WitnessExporter.new(object).export)
  end
end


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Caldasia 4:97, t. 11. 1946

#### Original name
null

### Remarks
null


text:
package reducers.owl;

import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;

import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.mapreduce.Reducer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import utils.NumberUtils;
import data.Triple;
import data.TripleSource;

public class OWLTransitivityReducer extends
		Reducer<BytesWritable, BytesWritable, TripleSource, Triple> {

	protected static Logger log = LoggerFactory
			.getLogger(OWLTransitivityReducer.class);

	private TripleSource source = new TripleSource();
	private Triple triple = new Triple();
	private HashMap<Long, Long> firstSet = new HashMap<Long, Long>();
	private HashMap<Long, Long> secondSet = new HashMap<Long, Long>();

	private int baseLevel = 0;
	private int level = 0;

	public void reduce(BytesWritable key, Iterable<BytesWritable> values,
			Context context) throws IOException, InterruptedException {

		firstSet.clear();
		secondSet.clear();

		Iterator<BytesWritable> itr = values.iterator();
		while (itr.hasNext()) {
			byte[] value = itr.next().getBytes();
			long level = NumberUtils.decodeLong(value, 1);
			long resource = NumberUtils.decodeLong(value, 9);
			if (value[0] == 0 || value[0] == 1) {
				if (!firstSet.containsKey(resource)
						|| (firstSet.containsKey(resource) && firstSet
								.get(resource) < level)) {
					if (value[0] == 1) {
						firstSet.put(resource, level * -1);
					} else {
						firstSet.put(resource, level);
					}
				}
			} else {
				if (!secondSet.containsKey(resource)
						|| (secondSet.containsKey(resource) && secondSet
								.get(resource) < level)) {
					if (value[0] == 3) {
						secondSet.put(resource, level * -1);
					} else {
						secondSet.put(resource, level);
					}
				}
			}
		}

		if (firstSet.size() == 0 || secondSet.size() == 0)
			return;

		triple.setPredicate(NumberUtils.decodeLong(key.getBytes(), 0));
		Iterator<Entry<Long, Long>> firstItr = firstSet.entrySet().iterator();
		context.getCounter("stats", "joinPoint").increment(1);
		while (firstItr.hasNext()) {
			Entry<Long, Long> entry = firstItr.next();
			Iterator<Entry<Long, Long>> secondItr = secondSet.entrySet()
					.iterator();
			while (secondItr.hasNext()) {
				Entry<Long, Long> entry2 = secondItr.next();
				// Output the triple
				if (level != 1
						|| (level == 1 && (entry.getValue() > 0 || entry2
								.getValue() > 0))) {
					triple.setSubject(entry.getKey());
					triple.setObject(entry2.getKey());
					source.setStep((int) (Math.abs(entry.getValue())
							+ Math.abs(entry2.getValue()) - baseLevel));
					context.write(source, triple);
				}
			}
		}
	}

	@Override
	public void setup(Context context) {
		baseLevel = context.getConfiguration().getInt("reasoning.baseLevel", 1) - 1;
		level = context.getConfiguration().getInt(
				"reasoning.transitivityLevel", -1);
		source.setDerivation(TripleSource.OWL_RULE_4);
		triple.setObjectLiteral(false);
	}
}


text: Learning open source lib.


text:
var win = Titanium.UI.currentWindow;

// initialize to all modes
win.orientationModes = [
	Titanium.UI.PORTRAIT,
	Titanium.UI.LANDSCAPE_LEFT,
	Titanium.UI.LANDSCAPE_RIGHT
];

var tf1 = Titanium.UI.createTextField({
	color:'#336699',
	height:35,
	top:10,
	left:10,
	width:250,
	borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});

var l = Titanium.UI.createLabel({
	top:50,
	left:10,
	width:300,
	height:'auto',
	color:'#777',
	font:{fontSize:13},
	text:'do something like click a button...'
});
win.add(l);

//
// TEXT FIELD EVENTS (return, focus, blur, change)
//
tf1.addEventListener('return',function(e)
{
	l.text = 'return received, val = ' + e.value;
	tf1.blur();
});
tf1.addEventListener('focus',function(e)
{
	l.text = 'focus received, val = ' + e.value;
});
tf1.addEventListener('blur',function(e)
{
	l.text = 'blur received, val = ' + e.value;
});
tf1.addEventListener('change', function(e)
{
	l.text = 'change received, event val = ' + e.value + '\nfield val = ' + tf1.value;
});

win.add(tf1);

//
// FOCUS
//
var focusLabel = Titanium.UI.createButton({
	top:100,
	height:40,
	width:200,
	title:'Focus'
});
win.add(focusLabel);
focusLabel.addEventListener('click', function()
{
	tf1.focus();
});

//
// BLUR
//
var blurLabel = Titanium.UI.createButton({
	top:150,
	height:40,
	width:200,
	title:'Blur'
});
win.add(blurLabel);
blurLabel.addEventListener('click', function()
{
	tf1.blur();
});

//
// HIDE/SHOW
//
var showHide = Titanium.UI.createButton({
	top:200,
	height:40,
	width:200,
	title:'Hide/Show'
});
win.add(showHide);
var visible = true;
showHide.addEventListener('click', function()
{
	if (!visible)
	{
		tf1.show();
		visible = true;
	}
	else
	{
		tf1.hide();
		visible = false;
	}
});

var instructions = Ti.UI.createLabel({
	text:'Rotate device while keyboard is up',
	bottom:10,
	height:30,
	color:'#777'
});
win.add(instructions);


text:
import KolibriApp from '../src/kolibri_app';
import coreModule from '../src/state/modules/core';

jest.mock(
  'kolibri',
  () => {
    return {
      registerKolibriModuleSync: jest.fn(),
    };
  },
  { virtual: true }
);

jest.mock('kolibri.heartbeat', () => ({
  start() {},
}));

class TestApp extends KolibriApp {
  get pluginModule() {
    return {
      state: {
        count: 0,
      },
      getters: {
        countGetter(state) {
          return state.count;
        },
      },
      actions: {
        incrementTwice(store) {
          store.commit('increment');
          store.commit('increment');
        },
      },
      mutations: {
        increment(state) {
          return (state.count = state.count + 1);
        },
      },
    };
  }
}

describe('KolibriApp', function() {
  it('it should register the core vuex component', () => {
    const app = new TestApp();
    expect(app.store.state.core).toMatchObject(coreModule.state);
    // just checking on keys, since vuex transforms the actions
    expect(Object.keys(app.store._actions)).toEqual(Object.keys(coreModule.actions));
    // only checks intersection with core getters; doesn't include sub-modules
    expect(Object.keys(app.store.getters)).toEqual(
      expect.arrayContaining(Object.keys(coreModule.getters))
    );
  });

  it('it should register the plugin vuex components', async function() {
    const app = new TestApp();
    app.store.hotUpdate({
      modules: { core: { actions: { getCurrentSession: jest.fn().mockResolvedValue() } } },
    });
    await app.ready();
    app.store.dispatch('incrementTwice');
    expect(app.store.getters.countGetter).toEqual(2);
  });
});


text:
package com.hazelcast.partition;

import com.hazelcast.core.MigrationEvent;

/**
 * PartitionEvent is a base interface for partition-related events
 * @see MigrationEvent
 * @see PartitionLostEvent
 */
public interface PartitionEvent {

    /**
     * Partition id that the event is dispatch for
     * @return partition id that the event is dispatch for
     */
    int getPartitionId();

}


text:
A functional reactive graph database backed by PostgreSQL

In layman's terms, OpenARC lets you build graphs of objects that react to one another.

# Getting Started

### Prerequisites

OpenARC requires Python 3+ and PostgreSQL 10+.

Consult your operating system documentation for details on how to install these requirements.

### Install OpenARC

Use `pip` to install the last release:

```sh
pip install openarc --user
```

Live on the edge by cloning our repository:

```sh
git clone https://www.github.com/kchoudhu/openarc
cd openarc
pip install . --user
```

### (Optional) Prepare database

If you don't already have a database to point to, you can use the makefile to spin up your own local instance to work with:

```sh
cd openarc
make dbmshardinit
```

### Configure OpenARC

OpenARC follows the XDG specification, and looks for ```openarc.conf``` in the following locations:

* ```XDG_CONFIG_HOME```
* ```$HOME/.config/```
* ```/usr/local/etc/```

An annotated sample ```openarc.conf``` is available in the ```cfg``` directory of the project distribution.

# Quickstart

### Define an object

Start by importing the library and defining an OAG class:

```python
class OAG_User(OAG_RootNode):
    @staticproperty
    def context(cls): return "myproject"

    @staticproperty
    def streams(cls): return {
        'username' : [ 'text', str(), None ],
        'password' : [ 'text', str(), None ]
    }

new_user =\
    OAG_User(initprms={
        'username' : 'kamil',
        'password' : 'hunter2'
    })

print(new_user.username)

# Output: kamil
```

### Use the ORM

Persist to the database:

```python
new_user.db.create()
```

This creates a table in the database:

```SQL
> select * from myproject.user;

 _user_id | password | username
----------+----------+----------
        1 | hunter2  | kamil
```

Update the object:

```python
new_user[0].username = 'hana'
new_user.db.update()
```

The database is updated accordingly:

```SQL
> select * from myproject.user;

 _user_id | password | username
----------+----------+----------
        1 | hunter2  | hana
```

More documentation about the database capabilities of OpenARC is available here.

### Functional Reactive Programming

An ```OAG_Group``` is a collection of users:

```python
class OAG_Group(OAG_RootNode):
    @staticproperty
    def context(cls): return "myproject"

    @staticproperty
    def streams(cls): return {
        'user' : [ OAG_User, False, "user_update_handler" ]
    }

    def user_update_handler(self):
        print("[user_update_handler] User [%s] has been updated" % self.user.username)

group = OAG_Group()
group.user = new_user
```

An event dependency is created between ```group``` and ```new_user``` by assigning the latter to the former under ```group```'s  ```user``` node.

```user_update_handler``` is an event handler that is invoked whenever the ```user``` node of the OAG_Group object is changed:

```python
new_user.password = '*****'
# [user_update_handler] User [hana] has been updated
```

Nodes can be nested arbitrarily, permitting complex functional event chains. Think Excel, but for programmers.

# Next Steps

### Run the tests

If you have the project distribution, take a look under ```openarc/tests``` for a wide variety of use cases. Assuming your environment is set up, you can execute the tests by executing

```sh
make test
```

### Take a look at the examples

Interesting examples of OpenARC usage live under ```openarc/examples```. Each example is thoroughly documented and comes with a README; the hope is that they will open your eyes as to what is possible with OpenARC.

### Read the documentation

Documentation is distributed with the code, and can be generated by executing

```sh
make docs
```


text:
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-4.0-9071-x64.7z'
$checksum = 'a5cec73ef818fbc719cd83fa5dcef13fe166f84c'
$checksumType = 'sha1'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

Install-ChocolateyZipPackage -PackageName "$packageName" `
                             -Url "$url" `
                             -UnzipLocation "$toolsDir" `
                             -Url64bit "$url64" `
                             -Checksum "$checksum" `
                             -ChecksumType "$checksumType" `
                             -Checksum64 "$checksum64" `
                             -ChecksumType64 "$checksumType64"