text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string translatable="false" name="app_name">c:geo</string>

    <string-array translatable="false" name="waypoint_coordinate_formats">
        <item>@string/waypoint_coordinate_formats_plain</item>
        <item>DDD.DDDDD°</item>
        <item>DDD°MM.MMM\'</item>
        <item>DDD°MM\'SS.SSS\"</item>
    </string-array>

    <string-array translatable="false" name="distance_units">
        <item>@string/unit_m</item>
        <item>@string/unit_km</item>
        <item>@string/unit_ft</item>
        <item>@string/unit_yd</item>
        <item>@string/unit_mi</item>
    </string-array>

    <integer-array name="log_image_scale_values">
        <item>-1</item>
        <item>512</item>
        <item>640</item>
        <item>800</item>
        <item>1024</item>
    </integer-array>
    <string translatable="false" name="log_image_scale_option_entry">%1$d x %2$d px</string>
    <string translatable="false" name="log_image_scale_option_entry_noimage">%1$d px</string>

    <string translatable="false" name="loc_gps">GPS</string>

    <string translatable="false"  name="persistablefolder_gpx">GPX</string>

    <string translatable="false" name="export_gpx">GPX</string>

    <string translatable="false" name="map_source_osm_mapnik">OpenStreetMap.org</string>
    <string translatable="false" name="map_source_osm_osmde">OpenStreetMap.de</string>
    <string translatable="false" name="map_source_osm_cyclosm">CyclOSM</string>
    <string translatable="false" name="map_source_mapy_cz">Mapy.cz</string>

    <string translatable="false" name="waypoint_latitude_null">N/S --° --.---</string>
    <string translatable="false" name="waypoint_longitude_null">E/W --° --.---</string>

    <string translatable="false" name="settings_title_gpx">GPX</string>
    <string translatable="false" name="init_signature_template_url">URL</string>
    <string translatable="false" name="settings_gc_legal_note_url">https://www.geocaching.com/account/documents/termsofuse</string>
    <string translatable="false" name="settings_send2cgeo_url">https://send2.cgeo.org/</string>
    <string translatable="false" name="settings_facebook_login_url">https://faq.cgeo.org/#facebook-login</string>

    <string translatable="false" name="map_attribution_openstreetmap_html"><![CDATA[© OpenStreetMap contributors]]></string>
    <string translatable="false" name="map_attribution_openstreetmapde_html"><![CDATA[© OpenStreetMap DE, map data OpenStreetMap contributors]]></string>
    <string translatable="false" name="map_attribution_cyclosm_html"><![CDATA[© CyclOSM, map data OpenStreetMap contributors]]></string>
    <string translatable="false" name="map_attribution_mapy_cz_html"><![CDATA[© Seznam.cz, a.s. and the OpenStreetMap contributors]]></string>

    <string translatable="false" name="manual_url_settings_offline_maps">https://manual.cgeo.org/en/offlinemaps</string>
    <string translatable="false" name="faq_url_settings_themes">https://faq.cgeo.org/#theme-slow</string>
    <string translatable="false" name="manual_url_mapbehavior">https://manual.cgeo.org/en/mainmenu/settings#map_behavior</string>
    <string translatable="false" name="manual_url_hillshading">https://manual.cgeo.org/en/offlinemaps#hillshading</string>

    <string translatable="false" name="contributors_carnero">carnero</string>
    <string translatable="false" name="powered_by">carnero</string>

    <string translatable="false" name="contributors_recent">
    bekuno|https://github.com/bekuno|ci|
    eddiemuc|https://github.com/eddiemuc|cd|
    fm-sys|https://github.com/fm-sys|cg|
    jakedot||c|
    k3b||c|
    Lineflyer|https://github.com/Lineflyer|ptsdi|
    MagpieFourtyTwo|https://github.com/MagpieFourtyTwo|t|
    moving-bits|https://github.com/moving-bits|cdgs|
    mucek4||cip|
    murggel|https://github.com/murggel|cdg|
    nmrsmn||c|
    NotWoods|https://github.com/NotWoods|c|
    pet0etie||c|
    Rainer S.||c|
    SammysHP|https://www.sammyshp.de/|i|
    SchoolGuy|https://github.com/SchoolGuy|c|
    Surfoo||c|
    Volthai7us||c
    ztNFny|https://github.com/ztNFny|cg|
    </string>

    <string translatable="false" name="contributors_other">
    avogadogc|||
    Arne Schwabe||c|
    baiti|https://github.com/baiti|c|
    Bananeweizen||c|
    BeckyDTP|https://github.com/BeckyDTP|c|
    bjdupuis||c|
    blafoo||c|
    bmuzzin|https://github.com/bmuzzin|c|
    cayacdev|https://github.com/cayacdev|c|
    campbeb||c|
    capoaira|https://github.com/capoaira|c|
    ControlTheBit||c|
    Eisbehr||c|
    emividmark|||
    Filipe C.||c|
    following5|||
    geocachermgo|https://github.com/geocachermgo|t|
    HolgerJeromin|||
    Iiro Jäppinen||g|
    Jan Žatecký|https://www.jaytech.cz/|g|
    jgoestl|https://github.com/jgoestl|c|
    jirkavrba|https://github.com/jirkavrba|c|
    jonas-koeritz|https://github.com/jonas-koeritz|c|
    JoWi24|https://joachim-wilke.de/|c|
    Karsten Priegnitz|https://github.com/koem|cg|
    KiwiStone|https://www.geocaching.com/profile/?guid=231070d8-b6f4-4d14-8d5a-b8bdcb19b78e|c|
    lazydays79||c|
    Lomanic|https://github.com/Lomanic|c|
    marco-dev||c|
    Mathieu Alorent||c|
    Matze2||c|
    MichielK||c|
    msperkowski|||
    ncorreia||c|
    okainov|https://github.com/okainov|c|
    osma|https://github.com/osma|c|
    Pavol Babinčák||c|
    Peter Storch|https://github.com/pstorch|c|
    Portree Kid|https://github.com/Portree-Kid|c|
    Ray||c|
    RoadRunner-||c|
    Samuel Tardieu|https://www.rfc1149.net/sam.html||
    S-Bartfast|https://github.com/S-Bartfast|c|
    stephanme/Geoteufel||c|
    UniQP|https://github.com/UniQP|c|
    TakoTheDank|https://github.com/TacoTheDank|c|
    thiasB||c|
    YraFyra||c|
    zenobios||c|
    </string>

    <string translatable="false" name="components">
    - [Mapsforge](https://code.google.com/p/mapsforge/) (OSM-rendering)\n
    - [The Noun Project](https://thenounproject.com/) (basis for attribute icons):\n%1
    - [The Apache Commons Project](https://commons.apache.org/)\n
    - [Google Material Design Icons](https://material.io/tools/icons/) ([Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html))\n
    - [Community Material Design Icons](https://materialdesignicons.com/) ([Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html))\n
    - [DragSortListView library by Carl Bauer](https://github.com/bauerca/drag-sort-listview/) ([Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html))\n
    - [Geocoding courtesy of MapQuest](https://www.mapquest.com/)\n
    - [Geocoding data from OpenStreetMap](https://www.openstreetmap.org/)\n
    - OpenStreetMap cartography (OSM:Mapnik) © OpenStreetMap contributors. Map tile data [licensed](http://www.openstreetmap.org/copyright/en) under Creative Commons 2.0 BY-SA.\n
    - More maps based on OpenStreetMap cartography: © [openstreetmap.de](https://www.openstreetmap.de/), © [cyclosm.org](https://www.cyclosm.org/) and Mapy.cz by © [Seznam.cz, a.s.](https://o.seznam.cz/).\n
    - Map Downloader supports maps from [Mapsforge](https://github.com/mapsforge), [OpenAndroMaps](https://www.openandromaps.org), [Freizeitkarte](https://www.freizeitkarte-osm.de/) and [Hylly](https://kartat.hylly.org/).\n
    - Routing © 2019 BRouter contributors ([MIT license](https://github.com/abrensch/brouter/blob/master/LICENSE))\n
	</string>

    <string translatable="false" name="components2">
    - add by Susannanova\n
    - Arrow by Jamison Wieser\n
    - challenge by Adrien Coquet\n
    - color palette by Vlad Likh\n
    - Folder by Landan Lloyd\n
    - new-idea by Artem Korotkikh\n
    - solution by Adrien Coquet\n
    - Trail by Martina Krasnayová\n
    - USB by Kenneth Von Alt\n
    </string>

    <string translatable="false" name="favorite_count">%1$d</string>
    <string translatable="false" name="favorite_count_percent">%1$d (%2$.0f%%)</string>

    <string translatable="false" name="caches_map_mapswithme">Maps.me</string>
    <string translatable="false" name="cache_menu_mapswithme">Maps.me</string>
    <string translatable="false" name="faq_link">faq.cgeo.org</string>
    <string translatable="false" name="website_link">cgeo.org</string>
    <string translatable="false" name="twitter_link">@android_GC</string>
    <string translatable="false" name="support_mail">support@cgeo.org</string>
    <string translatable="false" name="manual_link">manual.cgeo.org</string>
    <string translatable="false" name="github_link">github.com/cgeo/cgeo/issues</string>
    <string translatable="false" name="faq_link_full">https://faq.cgeo.org</string>
    <string translatable="false" name="manual_link_full">https://manual.cgeo.org</string>

    <string translatable="false" name="ellipsis">…</string>
    <string translatable="false" name="triple_dash_vertical">┆</string>

    <string translatable="false" name="equation_hint">a + b</string>
    <string translatable="false" name="free_variable_hint">2 + 2</string>
    <string translatable="false" name="empty_equation_result">_</string>
    <string translatable="false" name="equation_error_result">*</string>

    <string translatable="false" name="caches_map_locus">Locus</string>
    <string translatable="false" name="settings_title_gc">Geocaching.com</string>
    <string translatable="false" name="settings_title_ec">Extremcaching.com</string>
    <string translatable="false" name="settings_title_lc">Geocaching.com Adventure Lab</string>
    <string translatable="false" name="init_oc">Opencaching.de</string>
    <string translatable="false" name="auth_ocde">opencaching.de</string>
    <string translatable="false" name="init_oc_pl">Opencaching.pl</string>
    <string translatable="false" name="auth_ocpl">opencaching.pl</string>
    <string translatable="false" name="init_oc_nl">Opencaching.nl</string>
    <string translatable="false" name="auth_ocnl">opencaching.nl</string>
    <string translatable="false" name="init_oc_us">Opencaching.us</string>
    <string translatable="false" name="auth_ocus">opencaching.us</string>
    <string translatable="false" name="init_oc_ro">Opencaching.ro</string>
    <string translatable="false" name="auth_ocro">opencaching.ro</string>
    <string translatable="false" name="init_oc_uk">opencache.uk</string>
    <string translatable="false" name="auth_ocuk">opencache.uk</string>
    <string translatable="false" name="init_su">Geocaching.su</string>
    <string translatable="false" name="auth_su">geocaching.su</string>
    <string translatable="false" name="init_gcvote">GCvote.com</string>
    <string translatable="false" name="facebook_title">Facebook</string>
    <string translatable="false" name="twitter_title">Twitter</string>
    <string translatable="false" name="init_twitter">Twitter</string>
    <string translatable="false" name="auth_twitter">Twitter</string>
    <string translatable="false" name="cache_menu_whereyougo">WhereYouGo</string>
    <string translatable="false" name="cache_menu_pebble">Pebble</string>
    <string translatable="false" name="init_geokrety">GeoKrety.org</string>
    <string translatable="false" name="trackable_geokrety">GeoKrety</string>

    <string translatable="false" name="helper_locus_title">Locus</string>
    <string translatable="false" name="helper_gpsstatus_title">GPS Status & Toolbox</string>
    <string translatable="false" name="helper_bluetoothgps_title">Bluetooth GPS</string>
    <string translatable="false" name="helper_gps_locker_title">GPS Locker</string>
    <string translatable="false" name="helper_where_you_go_title">WhereYouGo</string>
    <string translatable="false" name="helper_chirpwolf">Chirp Wolf</string>
    <string translatable="false" name="helper_alc">Adventure Lab</string>
    <string translatable="false" name="helper_gcwizard">GC Wizard</string>

    <string translatable="false" name="file_provider_authority">org.cgeo.fileprovider</string>

    <string translatable="false" name="whereyougo_action_Mapsforge">"menion.android.whereyougo.maps.mapsforge.MapsforgeActivity"</string>

    <string translatable="false" name="cgeo_queryMapFile_resultParam">mapfile</string>
    <string translatable="false" name="cgeo_queryMapFile_actionParam">forceAndFeedback</string>

    <string translatable="false" name="package_whereyougo">menion.android.whereyougo</string>
    <string translatable="false" name="package_chirpwolf">de.wolffire.chirpwolf</string>
    <string translatable="false" name="package_brouter">btools.routingapp</string>
    <string translatable="false" name="package_cgeo_contacts">cgeo.contacts</string>
    <string translatable="false" name="package_google_translate">com.google.android.apps.translate</string>
    <string translatable="false" name="package_gpsstatus">com.eclipsim.gpsstatus2</string>
    <string translatable="false" name="package_bluetoothgps">googoo.android.btgps</string>
    <string translatable="false" name="package_gpslocker">com.silentlexx.gpslock</string>
    <string translatable="false" name="package_locus">menion.android.locus</string>
    <string translatable="false" name="package_alc">com.groundspeak.react.adventures</string>
    <string translatable="false" name="package_gcwizward">de.sman42.gc_wizard</string>

    <string translatable="false" name="mapserver_mapsforge_name">Mapsforge</string>
    <string translatable="false" name="mapserver_mapsforge_downloadurl">https://ftp-stud.hs-esslingen.de/pub/Mirrors/download.mapsforge.org/maps/v5/</string>
    <string translatable="false" name="mapserver_mapsforge_likeiturl">https://github.com/mapsforge/mapsforge</string>
    <string translatable="false" name="mapserver_mapsforge_projecturl">https://github.com/mapsforge/mapsforge</string>

    <string translatable="false" name="mapserver_openandromaps_name">OpenAndroMaps</string>
    <string translatable="false" name="mapserver_openandromaps_downloadurl">https://ftp.gwdg.de/pub/misc/openstreetmap/openandromaps/mapsV5/</string>
    <string translatable="false" name="mapserver_openandromaps_likeiturl">https://www.openandromaps.org/projektkosten</string>
    <string translatable="false" name="mapserver_openandromaps_projecturl">https://www.openandromaps.org/</string>

    <string translatable="false" name="mapserver_openandromaps_themes_name">OpenAndroMaps Theme</string>
    <string translatable="false" name="mapserver_openandromaps_themes_downloadurl">https://www.openandromaps.org/wp-content/users/tobias/</string>
    <string translatable="false" name="mapserver_openandromaps_themes_updatecheckurl">https://www.openandromaps.org/kartenlegende/elevation-hike-theme</string>

    <string translatable="false" name="mapserver_freizeitkarte_name">Freizeitkarte</string>
    <string translatable="false" name="mapserver_freizeitkarte_downloadurl">http://repository.freizeitkarte-osm.de/repository_freizeitkarte_android.xml</string>
    <string translatable="false" name="mapserver_freizeitkarte_likeiturl">https://www.freizeitkarte-osm.de/android/de/impressum.html</string>
    <string translatable="false" name="mapserver_freizeitkarte_projecturl">https://www.freizeitkarte-osm.de/android/en/</string>

    <string translatable="false" name="mapserver_freizeitkarte_themes_name">Freizeitkarte Themes</string>
    <string translatable="false" name="mapserver_freizeitkarte_themes_downloadurl">http://download.freizeitkarte-osm.de/android/latest/</string>

    <string translatable="false" name="mapserver_hylly_name">Hylly</string>
    <string translatable="false" name="mapserver_hylly_updatecheckurl">https://kartat.hylly.org/</string>
    <string translatable="false" name="mapserver_hylly_likeiturl">https://kartat.hylly.org/</string>
    <string translatable="false" name="mapserver_hylly_projecturl">https://kartat.hylly.org/</string>

    <string translatable="false" name="mapserver_hylly_themes_name">Hylly Themes</string>
    <string translatable="false" name="mapserver_hylly_themes_updatecheckurl">https://kartat.hylly.org/</string>
    <string translatable="false" name="mapserver_hylly_themes_downloadurl">https://kartat-dl.hylly.org/</string>

    <string translatable="false" name="brouter_name">BRouter</string>
    <string translatable="false" name="brouter_downloadurl">http://brouter.de/brouter/segments4/</string>
    <string translatable="false" name="brouter_projecturl">https://www.brouter.de/brouter/</string>

    <string translatable="false" name="mapserver_osmpaws_name">Paws</string>
    <string translatable="false" name="mapserver_osmpaws_downloadurl">https://osm.paws.cz/cgeo.php</string>
    <string translatable="false" name="mapserver_osmpaws_likeiturl">https://osm.paws.cz/podpora.php</string>
    <string translatable="false" name="mapserver_osmpaws_projecturl">https://osm.paws.cz</string>

    <string translatable="false" name="mapserver_osmpaws_themes_name">Paws Themes</string>
    <string translatable="false" name="mapserver_osmpaws_themes_downloadurl">https://osm.paws.cz/paws_themes/</string>

    <string translatable="false" name="maptheme_legend_elevate">https://www.openandromaps.org/wp-content/users/tobias/Elevate_de.pdf</string>
    <string translatable="false" name="maptheme_legend_freizeitkarte_base">https://www.freizeitkarte-osm.de/android/en/legende-freizeitkarte.html</string>
    <string translatable="false" name="maptheme_legend_freizeitkarte_outdoor">https://www.freizeitkarte-osm.de/android/en/legende-outdoor-contrast.html</string>
    <string translatable="false" name="maptheme_legend_osmpaws">https://osm.paws.cz/legend_paws.php</string>

    <string translatable="false" name="mailsubject_problem_report">c:geo problem report (%s)</string>

    <string translatable="false" name="formula_syntax_url">https://manual.cgeo.org/en/cachevariables</string>
</resources>

redpajama_set_name: RedPajamaGithub


text:
<?php

require '../init.php';
require '../tools.php';

$events = json_decode($_POST['events']);

if(!is_array($events)) {
    fail("Error: Expecting an Array of Events.");
}

// foreach($events as $event) {
//     $date = new DateTime($event->start);
//     echo $date->format("Y-m-d H:i:s") . "<br>\n";
// }

// foreach($events as $event) {
//     echo $event->start;
// }

// print_r($events);
$conn = Database::getConn();
$stmt = $conn->prepare("UPDATE brew
                        SET brewStart = :brewStart,
                            brewEnd = :brewEnd
                        WHERE id = :brewId");

foreach($events as $event) {
    $eventStart = new DateTime($event->start);
    $eventStart = $eventStart->format("Y-m-d H:i:s");

    $eventEnd = new DateTime($event->end);
    $eventEnd = $eventEnd->format("Y-m-d H:i:s");

    $bind_params = array("brewStart" => $eventStart, "brewEnd" => $eventEnd, "brewId" => $event->id);

    $stmt->execute($bind_params);
}

success();

// foreach($events as $event) {
//     $eventStart = new DateTime($event->start);
//     $eventStart = $eventStart->format("Y-m-d H:i:s");

//     $eventEnd = new DateTime($event->end);
//     $eventEnd = $eventEnd->format("Y-m-d H:i:s");

//     try {
//         Database::runQuery(
//             "UPDATE brew
//             SET brewStart = :brewStart,
//                 brewEnd = :brewEnd
//             WHERE id = :brewId"
//             , array("brewStart" => $eventStart, "brewEnd" => $eventEnd, "brewId" => $event->id));

//     } catch (PDOException $e) {
//         fail("Error in api/schedule/saveFullCalendar.php: " . $e->getMessage());
//     }
// }


text:
<?php

namespace Dipo\NaijaEmojis;

/* User model */
class User
{
     private $username;
     private $password;
     private $token;
     private $tokenExpire;

    public function __construct($username, $password)
    {
        $this->username = $username;
        $this->password = $password;
    }

    public function getUsername()
    {
        return $this->username;
    }

    public function getPassword()
    {
        return $this->password;
    }

    public function setToken($token)
    {
        $this->token = $token;
    }

    public function getToken()
    {
        return $this->token;
    }

    public function setTokenExpire($tokenExpire)
    {
        $this->tokenExpire = $tokenExpire;
    }

    public function getTokenExpire()
    {
        return $this->tokenExpire;
    }
}


text:
package org.diorite.event;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import org.diorite.event.pipelines.EventPipeline;

/**
 * Class for all events, all events needs to be registered here.

 * It don't use {@link org.diorite.utils.SimpleEnum} because it use generic types.
 *
 * @param <T> type of event.
 * @param <E> type of pipeline for this event.
 */
public class EventType<T extends Event, E extends EventPipeline<T>>
{
    private static final Map<Class<? extends Event>, EventType<?, ?>> byEventClass = new HashMap<>(3);

    private final Class<T> eventClass;
    private final Class<E> pipelineClass;
    private       E        pipeline;

    /**
     * Construct new event type, not registred event is usless.
     *
     * @param eventClass    class of used event.
     * @param pipelineClass class of used pipeline.
     * @param pipeline      event pipeline.
     *
     * @see #register(EventType)
     */
    public EventType(final Class<T> eventClass, final Class<E> pipelineClass, final E pipeline)
    {
        this.eventClass = eventClass;
        this.pipelineClass = pipelineClass;
        this.pipeline = pipeline;
    }

    /**
     * @return event class used by this event.
     */
    public Class<T> getEventClass()
    {
        return this.eventClass;
    }

    /**
     * @return expected pipeline class.
     */
    public Class<E> getPipelineClass()
    {
        return this.pipelineClass;
    }

    /**
     * Every even have own pipeline, may return null if used before event init.
     *
     * @return used pipeline.
     */
    public E getPipeline()
    {
        return this.pipeline;
    }

    /**
     * Allow to change event pipeline used be event.
     *
     * @param pipeline new pipeline for event.
     */
    public void setPipeline(final E pipeline)
    {
        if ((pipeline != null) && ! this.pipelineClass.isAssignableFrom(pipeline.getClass()))
        {
            throw new RuntimeException("This event need pipeline of " + this.pipelineClass.getName() + " type, not: " + pipeline.getClass());
        }
        this.pipeline = pipeline;
    }

    /**
     * Construct new event type and register it.
     *
     * @param eventClass    class of used event.
     * @param pipelineClass class of used pipeline.
     * @param pipeline      event pipeline.
     * @param <T>           type of event.
     * @param <E>           type of pipeline for this event.
     *
     * @return created and registered event type.
     *
     * @throws IllegalArgumentException if event class is already registered.
     */
    public static <T extends Event, E extends EventPipeline<T>> EventType<T, E> register(final Class<T> eventClass, final Class<E> pipelineClass, final E pipeline) throws IllegalArgumentException
    {
        return register(new EventType<>(eventClass, pipelineClass, pipeline));
    }

    /**
     * Register new event type.
     *
     * @param type event type to register.
     * @param <T>  type of event.
     * @param <E>  type of pipeline for this event.
     *
     * @return given event type.
     *
     * @throws IllegalArgumentException if event class is already registered.
     */
    public static <T extends Event, E extends EventPipeline<T>> EventType<T, E> register(final EventType<T, E> type) throws IllegalArgumentException
    {
        if (byEventClass.containsKey(type.getEventClass()))
        {
            throw new IllegalArgumentException("Event already registered: " + type + ", existing: " + byEventClass.get(type.getEventClass()));
        }
        byEventClass.put(type.getEventClass(), type);
        return type;
    }

    /**
     * Gets event type by given event class.

     *
     * @param clazz event class to find event type for it.
     * @param <T>   type of event.
     * @param <E>   type of pipeline for this event.
     *
     * @return event type for that event or null.
     */
    @SuppressWarnings("unchecked")
    public static <T extends Event, E extends EventPipeline<T>> EventType<T, E> getByEvent(final Class<T> clazz)
    {
        return (EventType<T, E>) byEventClass.get(clazz);
    }

    /**
     * Gets event type by given event instance.

     * It just pass class of given object to {@link #getByEvent(Class)}
     * and return this same value.
     *
     * @param evt event instance to find event type for it.
     * @param <T> type of event.
     * @param <E> type of pipeline for this event.
     *
     * @return event type for that event or null.
     *
     * @see #getByEvent(Class)
     */
    @SuppressWarnings("unchecked")
    public static <T extends Event, E extends EventPipeline<T>> EventType<T, E> getByEvent(final T evt)
    {
        return (EventType<T, E>) byEventClass.get(evt.getClass());
    }

    /**
     * Method will find event type of this event and pass given event to its pipeline.

     * If it can't find event type or pipeline is null, method will return false.
     *
     * @param event event to call.
     *
     * @return true if pipeline was found and event was passed to it.
     */
    @SuppressWarnings({"unchecked", "rawtypes"})
    public static boolean callEvent(final Event event)
    {
        final EventType pipe = getByEvent(event);
        if ((pipe == null) || (pipe.pipeline == null))
        {
            return false;
        }
        pipe.pipeline.run(event);
        return true;
    }

    /**
     * @return all event types in array.
     */
    public static EventType<?, ?>[] values()
    {
        return byEventClass.values().toArray(new EventType<?, ?>[byEventClass.size()]);
    }

    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).appendSuper(super.toString()).append("eventClass", this.eventClass).append("pipelineClass", this.pipelineClass).append("pipeline", (this.pipeline == null) ? null : this.pipeline.toNamesCollection()).toString();
    }
}


text:
package com.cinnober.msgcodec;

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

import com.cinnober.msgcodec.TypeDef.Type;

/**
 * Group is a generic group object.
 *
 * @author mikael.brannstrom
 *
 */
public class Group {

    /**
     * Synchronize on this object when accessing.
     */
    private static final WeakHashMap<Object, SchemaInfo> schemaInfoBySchemaUID = new WeakHashMap<>();
    private static final GroupTypeAccessorImpl GROUP_TYPE_ACCESSOR = new GroupTypeAccessorImpl();

    private final GroupInfo groupInfo;
    private final Object[] fieldValues;

    private static GroupInfo getGroupInfo(Schema schema, String groupName) {
        SchemaInfo dictInfo;
        synchronized (schemaInfoBySchemaUID) {
            dictInfo = schemaInfoBySchemaUID.get(schema.getUID());
        }
        if (dictInfo == null) {
            throw new IllegalArgumentException("Schema not bound to Group");
        }
        GroupInfo groupInfo = dictInfo.getGroupInfo(groupName);
        if (groupInfo == null) {
            throw new IllegalArgumentException("Unknown group name \"" + groupName + "\"");
        }
        return groupInfo;
    }

    /**
     * Create a new group.
     *
     * @param schema the schema bound to {@link Group}, not null.
     * @param groupName the group name, not null.
     */
    public Group(Schema schema, String groupName) {
        this(getGroupInfo(schema, groupName));
    }

    private Group(GroupInfo groupInfo) {
        this.groupInfo = groupInfo;
        this.fieldValues = new Object[groupInfo.size()];
    }

    /**
     * Returns the group type.
     * @return the group type (an opaque group type identifier), not null.
     * @see GroupTypeAccessor#getGroupType(java.lang.Object)
     * @see GroupBinding#getGroupType()
     */
    public Object getGroupType() {
        return groupInfo;
    }

    /**
     * Returns the group name.
     * @return the group name, not null.
     */
    public String getGroupName() {
        return groupInfo.name();
    }

    /**
     * Returns the value for the specified field.
     * @param fieldName the field name, not null.
     * @return the field value (including null).
     * @throws IllegalArgumentException if the field name does not exist.
     */
    public Object get(String fieldName) throws IllegalArgumentException {
        return fieldValues[groupInfo.getFieldIndex(fieldName)];

    }
    /**
     * Set the value for the specified field.
     * @param fieldName the field name, not null.
     * @param value the field value (including null).
     * @return this group instance, for chaining.
     * @throws IllegalArgumentException if the field name does not exist.
     */
    public Group set(String fieldName, Object value) throws IllegalArgumentException {
        fieldValues[groupInfo.getFieldIndex(fieldName)] = value;
        return this;
    }
    private Object get(int fieldIndex) {
        return fieldValues[fieldIndex];
    }
    private void set(int fieldIndex, Object value) {
        fieldValues[fieldIndex] = value;
    }
    /**
     * Clear all field values (set to null).
     */
    public void clear() {
        for (int i=0; i<fieldValues.length; i++) {
            fieldValues[i] = null;
        }
    }

    @Override
    public String toString() {
        return groupInfo.toString(fieldValues);
    }

    /**
     * Bind the protocol schema to {@link Group} instances for group objects.
     *
     * @param schema the schema to be bound, not null.
     * @return the bound schema
     */
    public static Schema bind(Schema schema) {
        Map<String, GroupInfo> groupInfos = new HashMap<>();
        ArrayList<FieldIndexAccessor> fieldAccessors = new ArrayList<>();
        List<GroupDef> groups = new ArrayList<>(schema.getGroups().size());
        for (GroupDef group : schema.getGroups()) {
            groups.add(bind(group, schema, groupInfos, fieldAccessors));
        }
        SchemaBinding binding = new SchemaBinding(GROUP_TYPE_ACCESSOR);
        Schema boundSchema =
                new Schema(groups, schema.getNamedTypes(), schema.getAnnotations(), binding);

        SchemaInfo schemaInfo = new SchemaInfo(groupInfos);
        synchronized (schemaInfoBySchemaUID) {
            schemaInfoBySchemaUID.put(boundSchema.getUID(), schemaInfo);
        }
        return boundSchema;
    }

    private static FieldIndexAccessor getAccessor(List<FieldIndexAccessor> accessors, int index) {
        while (accessors.size() <= index) {
            accessors.add(new FieldIndexAccessor(accessors.size()));
        }
        return accessors.get(index);
    }

    private static GroupDef bind(GroupDef group, Schema schema,
            Map<String, GroupInfo> groupInfoByName, List<FieldIndexAccessor> accessors) {
        GroupInfo superGroupInfo = group.getSuperGroup() != null ? groupInfoByName.get(group.getSuperGroup()) : null;
        List<FieldDef> allFields = new ArrayList<>();
        List<FieldDef> declaredFields = new ArrayList<>();
        if (superGroupInfo != null) {
            allFields.addAll(Arrays.asList(superGroupInfo.fieldDefs()));
        }
        for (FieldDef field : group.getFields()) {
            TypeDef type = schema.resolveToType(field.getType(), true);
            SymbolMapping<?> symbolMapping = null;

            if (type.getType() == Type.ENUM) {
                symbolMapping = new SymbolMapping.IdentityIntegerEnumMapping((TypeDef.Enum) type);
            } else if (type.getType() == Type.SEQUENCE) {
                TypeDef componentType = schema.resolveToType(((TypeDef.Sequence) type).getComponentType(), false);
                if (componentType != null && componentType.getType() == Type.ENUM) {
                    symbolMapping = new SymbolMapping.IdentityIntegerEnumMapping((TypeDef.Enum) componentType);
                }
            }

            FieldDef boundField = field.bind(new FieldBinding(getAccessor(accessors, allFields.size()),
                    type.getDefaultJavaType(), type.getDefaultJavaComponentType(), symbolMapping));
            allFields.add(boundField);
            declaredFields.add(boundField);
        }

        GroupInfo groupInfo = new GroupInfo(allFields.toArray(new FieldDef[allFields.size()]));
        GroupBinding groupBinding = new GroupBinding(groupInfo, groupInfo);
        GroupDef boundGroup = new GroupDef(group.getName(), group.getId(), group.getSuperGroup(), declaredFields,
                group.getAnnotations(), groupBinding);

        groupInfo.initGroupDef(boundGroup);
        groupInfoByName.put(groupInfo.name(), groupInfo);

        return boundGroup;
    }

    private static class SchemaInfo {
        private final Map<String, GroupInfo> groupsByName;

        public SchemaInfo(Map<String, GroupInfo> groupsByName) {
            this.groupsByName = groupsByName;
        }

        private GroupInfo getGroupInfo(String groupName) {
            return groupsByName.get(groupName);
        }

    }

    private static class GroupInfo implements Factory<Group> {
        private GroupDef groupDef;
        private final FieldDef[] fieldDefs;
        private final Map<String, Integer> fieldIndexByName;

        public GroupInfo(FieldDef[] fieldDefs) {
            this.fieldDefs = fieldDefs;
            this.fieldIndexByName = new HashMap<>(fieldDefs.length*2);
            int index = 0;
            for (FieldDef field : fieldDefs) {
                fieldIndexByName.put(field.getName(), index++);
            }
        }

        void initGroupDef(GroupDef groupDef) {
            this.groupDef = groupDef;
        }

        FieldDef[] fieldDefs() {
            return fieldDefs;
        }

        int size() {
            return fieldDefs.length;
        }
        String name() {
            return groupDef.getName();
        }

        int getFieldIndex(String fieldName) {
            Integer index = fieldIndexByName.get(fieldName);
            if (index == null) {
                throw new IllegalArgumentException("No such field \"" + fieldName+"\" in group \""+name()+"\"");
            }
            return index.intValue();
        }

        @Override
        public Group newInstance() {
            return new Group(this);
        }

        @Override
        public String toString() {
            return name();
        }
        String toString(Object[] values) {
            StringBuilder str = new StringBuilder();
            str.append(name()).append(" [");
            int len = fieldDefs.length;
            boolean comma = false;
            for (int i=0; i<len; i++) {
                Object value = values[i];
                if (value != null) {
                    if (comma) {
                        str.append(", ");
                    } else {
                        comma = true;
                    }
                    str.append(fieldDefs[i].getName()).append('=').append(value.toString());
                }
            }
            str.append("]");
            return str.toString();
        }
    }

    private static class FieldIndexAccessor implements Accessor<Group, Object> {
        private final int index;
        public FieldIndexAccessor(int index) {
            this.index = index;
        }

        @Override
        public Object getValue(Group obj) {
            return obj.get(index);
        }

        @Override
        public void setValue(Group obj, Object value) {
            obj.set(index, value);
        }
    }

    private static class GroupTypeAccessorImpl implements GroupTypeAccessor {
        @Override
        public Object getGroupType(Object groupValue) {
            return ((Group)groupValue).getGroupType();
        }
    }
}


text:
package ioutils

import (
	"io"
	"os"
	"path/filepath"
)

// AtomicFileWriterOptions specifies options for creating the atomic file writer.
type AtomicFileWriterOptions struct {
	// NoSync specifies whether the sync call must be skipped for the file.
	// If NoSync is not specified, the file is synced to the
	// storage after it has been written and before it is moved to
	// the specified path.
	NoSync bool
}

var defaultWriterOptions = AtomicFileWriterOptions{}

// SetDefaultOptions overrides the default options used when creating an
// atomic file writer.
func SetDefaultOptions(opts AtomicFileWriterOptions) {
	defaultWriterOptions = opts
}

// NewAtomicFileWriterWithOpts returns WriteCloser so that writing to it writes to a
// temporary file and closing it atomically changes the temporary file to
// destination path. Writing and closing concurrently is not allowed.
func NewAtomicFileWriterWithOpts(filename string, perm os.FileMode, opts *AtomicFileWriterOptions) (io.WriteCloser, error) {
	return newAtomicFileWriter(filename, perm, opts)
}

// newAtomicFileWriter returns WriteCloser so that writing to it writes to a
// temporary file and closing it atomically changes the temporary file to
// destination path. Writing and closing concurrently is not allowed.
func newAtomicFileWriter(filename string, perm os.FileMode, opts *AtomicFileWriterOptions) (*atomicFileWriter, error) {
	f, err := os.CreateTemp(filepath.Dir(filename), ".tmp-"+filepath.Base(filename))
	if err != nil {
		return nil, err
	}
	if opts == nil {
		opts = &defaultWriterOptions
	}
	abspath, err := filepath.Abs(filename)
	if err != nil {
		return nil, err
	}
	return &atomicFileWriter{
		f:      f,
		fn:     abspath,
		perm:   perm,
		noSync: opts.NoSync,
	}, nil
}

// NewAtomicFileWriter returns WriteCloser so that writing to it writes to a
// temporary file and closing it atomically changes the temporary file to
// destination path. Writing and closing concurrently is not allowed.
func NewAtomicFileWriter(filename string, perm os.FileMode) (io.WriteCloser, error) {
	return NewAtomicFileWriterWithOpts(filename, perm, nil)
}

// AtomicWriteFile atomically writes data to a file named by filename.
func AtomicWriteFile(filename string, data []byte, perm os.FileMode) error {
	f, err := newAtomicFileWriter(filename, perm, nil)
	if err != nil {
		return err
	}
	n, err := f.Write(data)
	if err == nil && n < len(data) {
		err = io.ErrShortWrite
		f.writeErr = err
	}
	if err1 := f.Close(); err == nil {
		err = err1
	}
	return err
}

type atomicFileWriter struct {
	f        *os.File
	fn       string
	writeErr error
	perm     os.FileMode
	noSync   bool
}

func (w *atomicFileWriter) Write(dt []byte) (int, error) {
	n, err := w.f.Write(dt)
	if err != nil {
		w.writeErr = err
	}
	return n, err
}

func (w *atomicFileWriter) Close() (retErr error) {
	defer func() {
		if retErr != nil || w.writeErr != nil {
			os.Remove(w.f.Name())
		}
	}()
	if !w.noSync {
		if err := fdatasync(w.f); err != nil {
			w.f.Close()
			return err
		}
	}
	if err := w.f.Close(); err != nil {
		return err
	}
	if err := os.Chmod(w.f.Name(), w.perm); err != nil {
		return err
	}
	if w.writeErr == nil {
		return os.Rename(w.f.Name(), w.fn)
	}
	return nil
}

// AtomicWriteSet is used to atomically write a set
// of files and ensure they are visible at the same time.
// Must be committed to a new directory.
type AtomicWriteSet struct {
	root string
}

// NewAtomicWriteSet creates a new atomic write set to
// atomically create a set of files. The given directory
// is used as the base directory for storing files before
// commit. If no temporary directory is given the system
// default is used.
func NewAtomicWriteSet(tmpDir string) (*AtomicWriteSet, error) {
	td, err := os.MkdirTemp(tmpDir, "write-set-")
	if err != nil {
		return nil, err
	}

	return &AtomicWriteSet{
		root: td,
	}, nil
}

// WriteFile writes a file to the set, guaranteeing the file
// has been synced.
func (ws *AtomicWriteSet) WriteFile(filename string, data []byte, perm os.FileMode) error {
	f, err := ws.FileWriter(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm)
	if err != nil {
		return err
	}
	n, err := f.Write(data)
	if err == nil && n < len(data) {
		err = io.ErrShortWrite
	}
	if err1 := f.Close(); err == nil {
		err = err1
	}
	return err
}

type syncFileCloser struct {
	*os.File
}

func (w syncFileCloser) Close() error {
	if !defaultWriterOptions.NoSync {
		return w.File.Close()
	}
	err := fdatasync(w.File)
	if err1 := w.File.Close(); err == nil {
		err = err1
	}
	return err
}

// FileWriter opens a file writer inside the set. The file
// should be synced and closed before calling commit.
func (ws *AtomicWriteSet) FileWriter(name string, flag int, perm os.FileMode) (io.WriteCloser, error) {
	f, err := os.OpenFile(filepath.Join(ws.root, name), flag, perm)
	if err != nil {
		return nil, err
	}
	return syncFileCloser{f}, nil
}

// Cancel cancels the set and removes all temporary data
// created in the set.
func (ws *AtomicWriteSet) Cancel() error {
	return os.RemoveAll(ws.root)
}

// Commit moves all created files to the target directory. The
// target directory must not exist and the parent of the target
// directory must exist.
func (ws *AtomicWriteSet) Commit(target string) error {
	return os.Rename(ws.root, target)
}

// String returns the location the set is writing to.
func (ws *AtomicWriteSet) String() string {
	return ws.root
}


text:
.class abstract Lcom/google/android/gms/internal/hx$a;
.super Lcom/google/android/gms/plus/Plus$a;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/google/android/gms/internal/hx;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x408
    name = "a"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/google/android/gms/plus/Plus$a<Lcom/google/android/gms/common/api/Status;>;"
    }
.end annotation

# direct methods
.method constructor <init>(Lcom/google/android/gms/common/api/Api$b;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Lcom/google/android/gms/common/api/Api$b<Lcom/google/android/gms/internal/hs;>;)V"
        }
    .end annotation

    invoke-direct {p0, p1}, Lcom/google/android/gms/plus/Plus$a;-><init>(Lcom/google/android/gms/common/api/Api$b;)V

    return-void
.end method

# virtual methods
.method public synthetic e(Lcom/google/android/gms/common/api/Status;)Lcom/google/android/gms/common/api/Result;
    .locals 1

    invoke-virtual {p0, p1}, Lcom/google/android/gms/internal/hx$a;->g(Lcom/google/android/gms/common/api/Status;)Lcom/google/android/gms/common/api/Status;

    move-result-object v0

    return-object v0
.end method

.method public g(Lcom/google/android/gms/common/api/Status;)Lcom/google/android/gms/common/api/Status;
    .locals 0

    return-object p1
.end method


text:
package types

import (
	"github.com/pingcap/parser/mysql"
	"github.com/pingcap/parser/terror"
	parser_types "github.com/pingcap/parser/types"
)

// const strings for ErrWrongValue
const (
	DateTimeStr = "datetime"
	TimeStr     = "time"
)

var (
	// ErrInvalidDefault is returned when meet a invalid default value.
	ErrInvalidDefault = parser_types.ErrInvalidDefault
	// ErrDataTooLong is returned when converts a string value that is longer than field type length.
	ErrDataTooLong = terror.ClassTypes.New(mysql.ErrDataTooLong, mysql.MySQLErrName[mysql.ErrDataTooLong])
	// ErrIllegalValueForType is returned when value of type is illegal.
	ErrIllegalValueForType = terror.ClassTypes.New(mysql.ErrIllegalValueForType, mysql.MySQLErrName[mysql.ErrIllegalValueForType])
	// ErrTruncated is returned when data has been truncated during conversion.
	ErrTruncated = terror.ClassTypes.New(mysql.WarnDataTruncated, mysql.MySQLErrName[mysql.WarnDataTruncated])
	// ErrOverflow is returned when data is out of range for a field type.
	ErrOverflow = terror.ClassTypes.New(mysql.ErrDataOutOfRange, mysql.MySQLErrName[mysql.ErrDataOutOfRange])
	// ErrDivByZero is return when do division by 0.
	ErrDivByZero = terror.ClassTypes.New(mysql.ErrDivisionByZero, mysql.MySQLErrName[mysql.ErrDivisionByZero])
	// ErrTooBigDisplayWidth is return when display width out of range for column.
	ErrTooBigDisplayWidth = terror.ClassTypes.New(mysql.ErrTooBigDisplaywidth, mysql.MySQLErrName[mysql.ErrTooBigDisplaywidth])
	// ErrTooBigFieldLength is return when column length too big for column.
	ErrTooBigFieldLength = terror.ClassTypes.New(mysql.ErrTooBigFieldlength, mysql.MySQLErrName[mysql.ErrTooBigFieldlength])
	// ErrTooBigSet is returned when too many strings for column.
	ErrTooBigSet = terror.ClassTypes.New(mysql.ErrTooBigSet, mysql.MySQLErrName[mysql.ErrTooBigSet])
	// ErrTooBigScale is returned when type DECIMAL/NUMERIC scale is bigger than mysql.MaxDecimalScale.
	ErrTooBigScale = terror.ClassTypes.New(mysql.ErrTooBigScale, mysql.MySQLErrName[mysql.ErrTooBigScale])
	// ErrTooBigPrecision is returned when type DECIMAL/NUMERIC precision is bigger than mysql.MaxDecimalWidth
	ErrTooBigPrecision = terror.ClassTypes.New(mysql.ErrTooBigPrecision, mysql.MySQLErrName[mysql.ErrTooBigPrecision])
	// ErrBadNumber is return when parsing an invalid binary decimal number.
	ErrBadNumber = terror.ClassTypes.New(mysql.ErrBadNumber, mysql.MySQLErrName[mysql.ErrBadNumber])
	// ErrInvalidFieldSize is returned when the precision of a column is out of range.
	ErrInvalidFieldSize = terror.ClassTypes.New(mysql.ErrInvalidFieldSize, mysql.MySQLErrName[mysql.ErrInvalidFieldSize])
	// ErrMBiggerThanD is returned when precision less than the scale.
	ErrMBiggerThanD = terror.ClassTypes.New(mysql.ErrMBiggerThanD, mysql.MySQLErrName[mysql.ErrMBiggerThanD])
	// ErrWarnDataOutOfRange is returned when the value in a numeric column that is outside the permissible range of the column data type.
	// See https://dev.mysql.com/doc/refman/5.5/en/out-of-range-and-overflow.html for details
	ErrWarnDataOutOfRange = terror.ClassTypes.New(mysql.ErrWarnDataOutOfRange, mysql.MySQLErrName[mysql.ErrWarnDataOutOfRange])
	// ErrDuplicatedValueInType is returned when enum column has duplicated value.
	ErrDuplicatedValueInType = terror.ClassTypes.New(mysql.ErrDuplicatedValueInType, mysql.MySQLErrName[mysql.ErrDuplicatedValueInType])
	// ErrDatetimeFunctionOverflow is returned when the calculation in datetime function cause overflow.
	ErrDatetimeFunctionOverflow = terror.ClassTypes.New(mysql.ErrDatetimeFunctionOverflow, mysql.MySQLErrName[mysql.ErrDatetimeFunctionOverflow])
	// ErrCastAsSignedOverflow is returned when positive out-of-range integer, and convert to it's negative complement.
	ErrCastAsSignedOverflow = terror.ClassTypes.New(mysql.ErrCastAsSignedOverflow, mysql.MySQLErrName[mysql.ErrCastAsSignedOverflow])
	// ErrCastNegIntAsUnsigned is returned when a negative integer be casted to an unsigned int.
	ErrCastNegIntAsUnsigned = terror.ClassTypes.New(mysql.ErrCastNegIntAsUnsigned, mysql.MySQLErrName[mysql.ErrCastNegIntAsUnsigned])
	// ErrInvalidYearFormat is returned when the input is not a valid year format.
	ErrInvalidYearFormat = terror.ClassTypes.New(mysql.ErrInvalidYearFormat, mysql.MySQLErrName[mysql.ErrInvalidYearFormat])
	// ErrInvalidYear is returned when the input value is not a valid year.
	ErrInvalidYear = terror.ClassTypes.New(mysql.ErrInvalidYear, mysql.MySQLErrName[mysql.ErrInvalidYear])
	// ErrTruncatedWrongVal is returned when data has been truncated during conversion.
	ErrTruncatedWrongVal = terror.ClassTypes.New(mysql.ErrTruncatedWrongValue, mysql.MySQLErrName[mysql.ErrTruncatedWrongValue])
	// ErrInvalidWeekModeFormat is returned when the week mode is wrong.
	ErrInvalidWeekModeFormat = terror.ClassTypes.New(mysql.ErrInvalidWeekModeFormat, mysql.MySQLErrName[mysql.ErrInvalidWeekModeFormat])
	// ErrWrongValue is returned when the input value is in wrong format.
	ErrWrongValue = terror.ClassTypes.New(mysql.ErrWrongValue, mysql.MySQLErrName[mysql.ErrWrongValue])
)


text:
/* BSD 2-Clause License, see github.com/ma16/hantek_dso_2090 */

#include "optHantek.h"
#include <string.h>
#include "dod.h"
#include "textHantek.h"

HantekDlg_AdcId optHantek_AdcId(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_AdcId h = textHantek_AdcId(&text) ;
    if (!text_end(&text))
	dod_exit("opt:AdcId:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_ChannelId optHantek_ChannelId(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_ChannelId h = textHantek_ChannelId(&text) ;
    if (!text_end(&text))
	dod_exit("opt:ChannelId:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_CouplingId optHantek_CouplingId(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_CouplingId h = textHantek_CouplingId(&text) ;
    if (!text_end(&text))
	dod_exit("opt:CouplingId:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_FrameId optHantek_FrameId(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_FrameId h = textHantek_FrameId(&text) ;
    if (!text_end(&text))
	dod_exit("opt:FrameId:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_InputId optHantek_InputId(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_InputId h = textHantek_InputId(&text) ;
    if (!text_end(&text))
	dod_exit("opt:InputId:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_MuxAttnId optHantek_MuxAttnId(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_MuxAttnId h = textHantek_MuxAttnId(&text) ;
    if (!text_end(&text))
	dod_exit("opt:MuxAttnId:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_OffsetVoltage optHantek_OffsetVoltage(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_OffsetVoltage h = textHantek_OffsetVoltage(&text) ;
    if (!text_end(&text))
	dod_exit("opt:OffsetVoltage:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_Prescaler optHantek_Prescaler(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_Prescaler h = textHantek_Prescaler(&text) ;
    if (!text_end(&text))
	dod_exit("opt:Prescaler:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_RelayAttnId optHantek_RelayAttnId(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_RelayAttnId h = textHantek_RelayAttnId(&text) ;
    if (!text_end(&text))
	dod_exit("opt:RelayAttnId:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_TriggerCount optHantek_TriggerCount(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_TriggerCount h = textHantek_TriggerCount(&text) ;
    if (!text_end(&text))
	dod_exit("opt:TriggerCount:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_SlopeId optHantek_SlopeId(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_SlopeId h = textHantek_SlopeId(&text) ;
    if (!text_end(&text))
	dod_exit("opt:SlopeId:trailing characters:<%s>",s) ;
    return h ;
}

HantekDlg_TriggerLevel optHantek_TriggerLevel(Opt *opt)
{
    char const *s = opt_pop(opt) ;
    Text text = text_init(s,strlen(s)) ;
    HantekDlg_TriggerLevel h = textHantek_TriggerLevel(&text) ;
    if (!text_end(&text))
	dod_exit("opt:TriggerLevel:trailing characters:<%s>",s) ;
    return h ;
}


text:
#define AUTOSENSE
#define PSEUDO_DMA

/*
 * Options :
 * AUTOSENSE - if defined, REQUEST SENSE will be performed automatically
 *      for commands that return with a CHECK CONDITION status.
 *
 * PSEUDO_DMA - enables PSEUDO-DMA hardware, should give a 3-4X performance
 * increase compared to polled I/O.
 *
 * PARITY - enable parity checking.  Not supported.
 *
 * SCSI2 - enable support for SCSI-II tagged queueing.  Untested.
 *
 *
 * UNSAFE - leave interrupts enabled during pseudo-DMA transfers.  You
 *          only really want to use this if you're having a problem with
 *          dropped characters during high speed communications, and even
 *          then, you're going to be better off twiddling with transfersize.
 *
 * USLEEP - enable support for devices that don't disconnect.  Untested.
 *
 * The card is detected and initialized in one of several ways :
 * 1.  Autoprobe (default) - since the board is memory mapped,
 *     a BIOS signature is scanned for to locate the registers.
 *     An interrupt is triggered to autoprobe for the interrupt
 *     line.
 *
 * 2.  With command line overrides - t128=address,irq may be
 *     used on the LILO command line to override the defaults.
 *
 * 3.  With the T128_OVERRIDE compile time define.  This is
 *     specified as an array of address, irq tuples.  Ie, for
 *     one board at the default 0xcc000 address, IRQ5, I could say
 *     -DT128_OVERRIDE={{0xcc000, 5}}
 *
 *     Note that if the override methods are used, place holders must
 *     be specified for other boards in the system.
 *
 * T128/T128F jumper/dipswitch settings (note : on my sample, the switches
 * were epoxy'd shut, meaning I couldn't change the 0xcc000 base address) :
 *
 * T128    Sw7 Sw8 Sw6 = 0ws Sw5 = boot
 * T128F   Sw6 Sw7 Sw5 = 0ws Sw4 = boot Sw8 = floppy disable
 * cc000   off off
 * c8000   off on
 * dc000   on  off
 * d8000   on  on
 *
 *
 * Interrupts
 * There is a 12 pin jumper block, jp1, numbered as follows :
 *   T128 (JP1)  	 T128F (J5)
 * 2 4 6 8 10 12	11 9  7 5 3 1
 * 1 3 5 7 9  11	12 10 8 6 4 2
 *
 * 3   2-4
 * 5   1-3
 * 7   3-5
 * T128F only
 * 10 8-10
 * 12 7-9
 * 14 10-12
 * 15 9-11
 */

/*
 * $Log: t128.c,v $
 */

#include <asm/system.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <asm/io.h>
#include <linux/blkdev.h>
#include <linux/interrupt.h>
#include <linux/stat.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/delay.h>

#include "scsi.h"
#include <scsi/scsi_host.h>
#include "t128.h"
#define AUTOPROBE_IRQ
#include "NCR5380.h"

static struct override {
    unsigned long address;
    int irq;
} overrides
#ifdef T128_OVERRIDE
    [] __initdata = T128_OVERRIDE;
#else
    [4] __initdata = {{0, IRQ_AUTO}, {0, IRQ_AUTO},
        {0 ,IRQ_AUTO}, {0, IRQ_AUTO}};
#endif

#define NO_OVERRIDES (sizeof(overrides) / sizeof(struct override))

static struct base {
    unsigned int address;
    int noauto;
} bases[] __initdata = {
    { 0xcc000, 0}, { 0xc8000, 0}, { 0xdc000, 0}, { 0xd8000, 0}
};

#define NO_BASES (sizeof (bases) / sizeof (struct base))

static struct signature {
    const char *string;
    int offset;
} signatures[] __initdata = {
{"TSROM: SCSI BIOS, Version 1.12", 0x36},
};

#define NO_SIGNATURES (sizeof (signatures) /  sizeof (struct signature))

/*
 * Function : t128_setup(char *str, int *ints)
 *
 * Purpose : LILO command line initialization of the overrides array,
 *
 * Inputs : str - unused, ints - array of integer parameters with ints[0]
 *	equal to the number of ints.
 *
 */

void __init t128_setup(char *str, int *ints){
    static int commandline_current = 0;
    int i;
    if (ints[0] != 2)
	printk("t128_setup : usage t128=address,irq\n");
    else
	if (commandline_current < NO_OVERRIDES) {
	    overrides[commandline_current].address = ints[1];
	    overrides[commandline_current].irq = ints[2];
	    for (i = 0; i < NO_BASES; ++i)
		if (bases[i].address == ints[1]) {
		    bases[i].noauto = 1;
		    break;
		}
	    ++commandline_current;
	}
}

/*
 * Function : int t128_detect(struct scsi_host_template * tpnt)
 *
 * Purpose : detects and initializes T128,T128F, or T228 controllers
 *	that were autoprobed, overridden on the LILO command line,
 *	or specified at compile time.
 *
 * Inputs : tpnt - template for this SCSI adapter.
 *
 * Returns : 1 if a host adapter was found, 0 if not.
 *
 */

int __init t128_detect(struct scsi_host_template * tpnt){
    static int current_override = 0, current_base = 0;
    struct Scsi_Host *instance;
    unsigned long base;
    void __iomem *p;
    int sig, count;

    tpnt->proc_name = "t128";
    tpnt->proc_info = &t128_proc_info;

    for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
	base = 0;
	p = NULL;

	if (overrides[current_override].address) {
	    base = overrides[current_override].address;
	    p = ioremap(bases[current_base].address, 0x2000);
	    if (!p)
		base = 0;
	} else
	    for (; !base && (current_base < NO_BASES); ++current_base) {
#if (TDEBUG & TDEBUG_INIT)
    printk("scsi-t128 : probing address %08x\n", bases[current_base].address);
#endif
		if (bases[current_base].noauto)
			continue;
		p = ioremap(bases[current_base].address, 0x2000);
		if (!p)
			continue;
		for (sig = 0; sig < NO_SIGNATURES; ++sig)
		    if (check_signature(p + signatures[sig].offset,
					signatures[sig].string,
					strlen(signatures[sig].string))) {
			base = bases[current_base].address;
#if (TDEBUG & TDEBUG_INIT)
			printk("scsi-t128 : detected board.\n");
#endif
			goto found;
		    }
		iounmap(p);
	    }

#if defined(TDEBUG) && (TDEBUG & TDEBUG_INIT)
	printk("scsi-t128 : base = %08x\n", (unsigned int) base);
#endif

	if (!base)
	    break;

found:
	instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
	if(instance == NULL)
		break;

	instance->base = base;
	((struct NCR5380_hostdata *)instance->hostdata)->base = p;

	NCR5380_init(instance, 0);

	if (overrides[current_override].irq != IRQ_AUTO)
	    instance->irq = overrides[current_override].irq;
	else
	    instance->irq = NCR5380_probe_irq(instance, T128_IRQS);

	if (instance->irq != SCSI_IRQ_NONE)
	    if (request_irq(instance->irq, t128_intr, SA_INTERRUPT, "t128", instance)) {
		printk("scsi%d : IRQ%d not free, interrupts disabled\n",
		    instance->host_no, instance->irq);
		instance->irq = SCSI_IRQ_NONE;
	    }

	if (instance->irq == SCSI_IRQ_NONE) {
	    printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
	    printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
	}

#if defined(TDEBUG) && (TDEBUG & TDEBUG_INIT)
	printk("scsi%d : irq = %d\n", instance->host_no, instance->irq);
#endif

	printk("scsi%d : at 0x%08lx", instance->host_no, instance->base);
	if (instance->irq == SCSI_IRQ_NONE)
	    printk (" interrupts disabled");
	else
	    printk (" irq %d", instance->irq);
	printk(" options CAN_QUEUE=%d  CMD_PER_LUN=%d release=%d",
	    CAN_QUEUE, CMD_PER_LUN, T128_PUBLIC_RELEASE);
	NCR5380_print_options(instance);
	printk("\n");

	++current_override;
	++count;
    }
    return count;
}

static int t128_release(struct Scsi_Host *shost)
{
	NCR5380_local_declare();
	NCR5380_setup(shost);
	if (shost->irq)
		free_irq(shost->irq, NULL);
	NCR5380_exit(shost);
	if (shost->io_port && shost->n_io_port)
		release_region(shost->io_port, shost->n_io_port);
	scsi_unregister(shost);
	iounmap(base);
	return 0;
}

/*
 * Function : int t128_biosparam(Disk * disk, struct block_device *dev, int *ip)
 *
 * Purpose : Generates a BIOS / DOS compatible H-C-S mapping for
 *	the specified device / size.
 *
 * Inputs : size = size of device in sectors (512 bytes), dev = block device
 *	major / minor, ip[] = {heads, sectors, cylinders}
 *
 * Returns : always 0 (success), initializes ip
 *
 */

/*
 * XXX Most SCSI boards use this mapping, I could be incorrect.  Some one
 * using hard disks on a trantor should verify that this mapping corresponds
 * to that used by the BIOS / ASPI driver by running the linux fdisk program
 * and matching the H_C_S coordinates to what DOS uses.
 */

int t128_biosparam(struct scsi_device *sdev, struct block_device *bdev,
		sector_t capacity, int * ip)
{
  ip[0] = 64;
  ip[1] = 32;
  ip[2] = capacity >> 11;
  return 0;
}

/*
 * Function : int NCR5380_pread (struct Scsi_Host *instance,
 *	unsigned char *dst, int len)
 *
 * Purpose : Fast 5380 pseudo-dma read function, transfers len bytes to
 *	dst
 *
 * Inputs : dst = destination, len = length in bytes
 *
 * Returns : 0 on success, non zero on a failure such as a watchdog
 * 	timeout.
 */

static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
    int len) {
    NCR5380_local_declare();
    void __iomem *reg;
    unsigned char *d = dst;
    register int i = len;

    NCR5380_setup(instance);
    reg = base + T_DATA_REG_OFFSET;

#if 0
    for (; i; --i) {
	while (!(readb(base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
#else
    while (!(readb(base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
    for (; i; --i) {
#endif
	*d++ = readb(reg);
    }

    if (readb(base + T_STATUS_REG_OFFSET) & T_ST_TIM) {
	unsigned char tmp;
	void __iomem *foo = base + T_CONTROL_REG_OFFSET;
	tmp = readb(foo);
	writeb(tmp | T_CR_CT, foo);
	writeb(tmp, foo);
	printk("scsi%d : watchdog timer fired in NCR5380_pread()\n",
	    instance->host_no);
	return -1;
    } else
	return 0;
}

/*
 * Function : int NCR5380_pwrite (struct Scsi_Host *instance,
 *	unsigned char *src, int len)
 *
 * Purpose : Fast 5380 pseudo-dma write function, transfers len bytes from
 *	src
 *
 * Inputs : src = source, len = length in bytes
 *
 * Returns : 0 on success, non zero on a failure such as a watchdog
 * 	timeout.
 */

static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src,
    int len) {
    NCR5380_local_declare();
    void __iomem *reg;
    unsigned char *s = src;
    register int i = len;

    NCR5380_setup(instance);
    reg = base + T_DATA_REG_OFFSET;

#if 0
    for (; i; --i) {
	while (!(readb(base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
#else
    while (!(readb(base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
    for (; i; --i) {
#endif
	writeb(*s++, reg);
    }

    if (readb(base + T_STATUS_REG_OFFSET) & T_ST_TIM) {
	unsigned char tmp;
	void __iomem *foo = base + T_CONTROL_REG_OFFSET;
	tmp = readb(foo);
	writeb(tmp | T_CR_CT, foo);
	writeb(tmp, foo);
	printk("scsi%d : watchdog timer fired in NCR5380_pwrite()\n",
	    instance->host_no);
	return -1;
    } else
	return 0;
}

MODULE_LICENSE("GPL");

#include "NCR5380.c"

static struct scsi_host_template driver_template = {
	.name           = "Trantor T128/T128F/T228",
	.detect         = t128_detect,
	.release        = t128_release,
	.queuecommand   = t128_queue_command,
	.eh_abort_handler = t128_abort,
	.eh_bus_reset_handler    = t128_bus_reset,
	.bios_param     = t128_biosparam,
	.can_queue      = CAN_QUEUE,
        .this_id        = 7,
	.sg_tablesize   = SG_ALL,
	.cmd_per_lun    = CMD_PER_LUN,
	.use_clustering = DISABLE_CLUSTERING,
};
#include "scsi_module.c"


text: class a { static set b(c) {}}


text:
from ftplib import FTP

class ftp(FTP):
	def __init__(self,host, user='', passwd=''):

		super(ftp,self).__init__(host)
		self.login(user=user, passwd=passwd)

	def read_file(self, file):
		class Reader:
			def __init__(self):
				pass
			def __call__(self,s):
				self.data = s
		r = Reader()
		self.retrbinary('RETR ' + file, r)
		return r.data

	def get_files(self, dir=None):
		print (self.pwd(),dir)
		if dir is None:
			folders = self.get_folders()
			return [x for x in self.nlst() if not x in folders]

		folders = [dir+'/'+x for x in self.get_folders(dir)]
		try:
			return [x for x in self.nlst(self.pwd()+'/'+dir) if not x in folders]
		except:
			return [x for x in self.nlst() if not x in folders]
	def get_folders(self,dir=None):
		ret = []
		def parse(line):
			    if line[0] == 'd':
			        ret.append(line.rpartition(' ')[2])   # gives you the name of a directory
		if dir is not None:
			self.cwd(dir)
		self.dir(parse)
		self.cwd('/')
		return ret
	def remove_file(self, filename):
		original = filename
		while '/' in filename:
			folder, filename = filename.split('/')[0], filename.replace(filename.split('/')[0]+'/','')
			if not folder in self.nlst():
				self.mkd(folder)
			self.cwd(folder)
			if '/' in filename:
				continue
			else:
				self.delete(filename)
				self.cwd('/')
		if not '/' in original:
			self.delete(filename)
	def write_file(self,filename, newname=None):
		original = filename
		while '/' in filename:
			folder, filename = filename.split('/')[0], filename.replace(filename.split('/')[0]+'/','')
			if not folder in self.nlst():
				self.mkd(folder)
			self.cwd(folder)
			if '/' in filename:
				continue
			else:
				file = open(original, 'rb')
				stor_str = "STOR {0}".format(filename)
				self.storbinary(stor_str, file)
				self.cwd('/')
				file.close()

		if not '/' in original:
			file = open(filename, 'rb')
			if newname is None:
				stor_str = "STOR {0}".format(filename)
			else:
				stor_str = "STOR {0}".format(newname)

			self.storbinary(stor_str, file)
			file.close()

if __name__ == '__main__':
	a = ftp('127.0.0.1','geek','12345')
	a.write_file('steps.md', newname='process.md')
	with open('new.md','wb') as f:
		f.write(a.read_file('process.md'))
	print (a.nlst())


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
NotificationCompat
</TITLE>

<META NAME="date" CONTENT="2013-08-26">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

android.support.v4.app

Class NotificationCompat

java.lang.Object
  android.support.v4.app.NotificationCompat

public class NotificationCompat
extends java.lang.Object

Helper for accessing features in android.app.Notification
 introduced after API level 4 in a backwards compatible fashion.

Nested Class Summary

static class
NotificationCompat.Action

static class
NotificationCompat.BigPictureStyle

          Helper class for generating large-format notifications that include a large image attachment.

static class
NotificationCompat.BigTextStyle

          Helper class for generating large-format notifications that include a lot of text.

static class
NotificationCompat.Builder

          Builder class for NotificationCompat objects.

static class
NotificationCompat.InboxStyle

          Helper class for generating large-format notifications that include a list of (up to 5) strings.

static class
NotificationCompat.Style

          An object that can apply a rich notification style to a Notification.Builder
 object.

Field Summary

static int
FLAG_HIGH_PRIORITY

          Deprecated. Use NotificationCompat.Builder.setPriority(int) with a positive value.

static int
PRIORITY_DEFAULT

          Default notification priority for NotificationCompat.Builder.setPriority(int).

static int
PRIORITY_HIGH

          Higher notification priority for NotificationCompat.Builder.setPriority(int),
 for more important notifications or alerts.

static int
PRIORITY_LOW

          Lower notification priority for NotificationCompat.Builder.setPriority(int),
 for items that are less important.

static int
PRIORITY_MAX

          Highest notification priority for NotificationCompat.Builder.setPriority(int),
 for your application's most important items that require the user's
 prompt attention or input.

static int
PRIORITY_MIN

          Lowest notification priority for NotificationCompat.Builder.setPriority(int);
 these items might not be shown to the user except under
 special circumstances, such as detailed notification logs.

Constructor Summary

NotificationCompat()

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

FLAG_HIGH_PRIORITY

public static final int FLAG_HIGH_PRIORITY

Deprecated. Use NotificationCompat.Builder.setPriority(int) with a positive value.
Obsolete flag indicating high-priority notifications; use the priority field instead.

See Also:
Constant Field Values

PRIORITY_DEFAULT

public static final int PRIORITY_DEFAULT

Default notification priority for NotificationCompat.Builder.setPriority(int).
 If your application does not prioritize its own notifications,
 use this value for all notifications.

See Also:
Constant Field Values

PRIORITY_LOW

public static final int PRIORITY_LOW

Lower notification priority for NotificationCompat.Builder.setPriority(int),
 for items that are less important. The UI may choose to show
 these items smaller, or at a different position in the list,
 compared with your app's PRIORITY_DEFAULT items.

See Also:
Constant Field Values

PRIORITY_MIN

public static final int PRIORITY_MIN

Lowest notification priority for NotificationCompat.Builder.setPriority(int);
 these items might not be shown to the user except under
 special circumstances, such as detailed notification logs.

See Also:
Constant Field Values

PRIORITY_HIGH

public static final int PRIORITY_HIGH

Higher notification priority for NotificationCompat.Builder.setPriority(int),
 for more important notifications or alerts. The UI may choose
 to show these items larger, or at a different position in
 notification lists, compared with your app's PRIORITY_DEFAULT items.

See Also:
Constant Field Values

PRIORITY_MAX

public static final int PRIORITY_MAX

Highest notification priority for NotificationCompat.Builder.setPriority(int),
 for your application's most important items that require the user's
 prompt attention or input.

See Also:
Constant Field Values

Constructor Detail

NotificationCompat

public NotificationCompat()

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
game
====

First project for CompSci 308 Spring 2014. Uses JGame.

Genre: Top Down Scrolling Shooter

***SHARPSHOOTERS IN SPACE:***
An alien force has left bombs floating in space as you make an approach on their planet. You 15 shots to destroy and deactivate all the bombs in play. If you run out of shots, the bombs will explode and destroy everything in the blast radius! Carefully use your limited amunition to save yourself and your crew from disaster!!!

How to win: Use the shots carefully to destroy all the bombs. Some bombs will be blocked by asteroids. These asteroids will need to be shot to get to the bombs. If you destroy all the bombs before you run out of ammunition, you win! Gameplay resembles that of Space Invaders, but only the bombs need to be destroyed.

How to play: Use the left and right arrow keys to move your spacefighter left or right. Use the up spacebar to fire a shot. The spacefighter will be able to wrap from one side of the game screen to the other. For example, if the spacefighter reaches the left edge of the screen, it will then appear on the right edge.

Modes: There are two levels. In Level 1, the asteroids and bombs will remain stationary. In Level 2, the asteroids and bombs will move from right to left and wrap around the game screen (asteroids that reach the left side of the screen will appear on the right).

Cheatcodes: Press "u" during gameplay for unlimited ammunition. Press "d" during gameplay to remove all the asteroids.


text:
Ball Devices
============

+------------------------------------------------------------------------------+
| Related Config File Sections                                                 |
+==============================================================================+
| :doc:`/config/ball_devices`                                                  |
+------------------------------------------------------------------------------+

.. contents::
   :local:

A *ball device* is any physical thing in a pinball machine which is able to
hold (i.e. "capture") a ball and then release it. (Either
automatically or based on some action by the player.) Examples of ball
devices include the trough, the plunger lane, VUKs, poppers, playfield
locks, etc.—basically anything that can hold a ball. (Even the
playfield is technically a ball device since balls rolling around are "in" the
playfield device.)

Ball devices are usually made up of switches (which
are typically used to count how many balls the ball device has) and
coils (which are typically used to eject a ball from a device.) Most
games have several ball devices. At a minimum they'll have the device
that holds the ball when it drains and the playfield.

Ball devices are probably the most important element of MPF (because no one
likes it when a machine gets confused about where the balls are) and
something we've spent a lot of time on. They work hand-in-hand with MPF's
Ball Controller to keep track of where all the balls are at any given time.

In MPF, ball devices are implemented as
`finite state machines <https://en.wikipedia.org/wiki/Finite-state_machine>`_.

Each ball device is responsible for managing its own state, which can
be:

+ idle
+ missing_balls
+ waiting_for_ball
+ waiting_for_ball_mechanical
+ ball_left
+ wait_for_eject
+ ejecting
+ failed_eject
+ eject_confirmed

Here's a diagram which shows the relationships between the various
states. A device can only transition from its current state to one of
the states an arrow is connected to.

.. image:: /mechs/images/ball_device_fsm_diagram.png

When you configure ball devices in MPF, you configure the list of other
devices that a ball device can eject to. This allows MPF to have an understanding
of the "chain" of devices and enables it to route balls to where they need to
go. (:doc:`/mechs/diverters/index` also figure into this chain, meaning MPF
can ensure that diverters are set properly as it's routing balls around.)

Here's a simplified example of how the "chain" of ball devices works:

A simple modern machine would have a minimum of three ball devices:

* The trough
* The plunger lane
* The playfield (remember in MPF, the playfield is technically a ball device)

When you configure your ball devices, the trough is configured so that the
plunger lane is its eject target, the plunger lane is configured with the
playfield as its eject target, and the playfield is configured to know that it
drains into the trough. So you have a complete loop of devices.

This means that, for example, if the playfield wants another ball (like for
a multiball), MPF knows that the playfield gets balls from the plunger lane, and
if the plunger lane doesn't have a ball, MPF knows that the plunger lane can get
a ball from the trough.

Pretty cool!

Of course in a real machine, you'll have a lot more than the three ball devices
listed above.

Picking a random machine as an example, *Judge Dredd* has eight(!) ball devices:

1. :doc:`The trough </mechs/troughs/index>`
2. The right :doc:`plunger lane </mechs/plungers/index>`
3. The left plunger lane
4. The Sniper VUK
5. The Hall of Justice VUK
6. The Deadworld orbit thingy
7. The crane
8. :doc:`The playfield </mechs/playfields/index>`

MPF keeps track of how many balls are in each ball device at all
times, and it knows which devices are in the process of ejecting (and which
target devices they're ejecting to), so it also knows if balls get stuck along
the way.

Ball devices support all sorts of settings and events. You can also configure counting
delays to account for balls bouncing around before they settle, you
can specify how devices confirm that balls have successfully ejected,
as well as dozens of other options that allow MPF to support every
known type of device in every pinball machine ever created.
(Seriously.)

Video on ball tracking in MPF:

.. youtube:: Yh8ittsuWIc

Monitorable Properties
----------------------

For :doc:`dynamic values </config/instructions/dynamic_values>` and
:doc:`conditional events </events/overview/conditional>`,
the prefix for ball devices is ``device.ball_devices.<name>``.

*available_balls*
   Number of balls that are available to be ejected. This differs from
   *balls* since it's possible that this device could have balls that are
   being used for some other eject, and thus not available.

*state*
   What state this device is in.

*balls*
   How many balls this device is currently holding.

Related How To guides
---------------------

* :doc:`/mechs/troughs/modern_opto`
* :doc:`/mechs/troughs/modern_mechanical`
* :doc:`/mechs/troughs/two_coil_multiple_switches`
* :doc:`/mechs/troughs/two_coil_one_switch`
* :doc:`/mechs/troughs/classic_single_ball`

.. toctree::
   :titlesonly:

   troubleshooting

Related Events
--------------

.. include:: /events/include_ball_devices.rst


text:
<!DOCTYPE html>

<!--
  Copyright (c) 2015, <your name>. All rights reserved. Use of this source code
  is governed by a BSD-style license that can be found in the LICENSE file.
-->

<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="scaffolded-by" content="https://github.com/google/stagehand">
  <title>ChartDemo</title>

  <!-- example of your own custom element -->
  <link rel="import" href="main_app.html">

  <link rel="stylesheet" href="styles.css">
</head>

<body unresolved>

  <main-app></main-app>

  <script type="application/dart">export 'package:polymer/init.dart';</script>
</body>
</html>


text:
namespace galaxy
{
	CameraTag::CameraTag()
		:m_bounds(0.0f, 0.0f, Locator::window->getSize().m_x, Locator::window->getSize().m_y)
	{
	}

	CameraTag::CameraTag(const sol::table& table)
	{
		// Set values from lua table.
		m_bounds.m_x = 0;
		m_bounds.m_y = 0;
		m_bounds.m_width = table.get<int>("width");
		m_bounds.m_height = table.get<int>("height");
	}

	CameraTag::CameraTag(const Rect<float, int>& bounds)
		:m_bounds(bounds)
	{
		// Argument constructor.
	}

	void CameraTag::update(const unsigned int playerEntity)
	{
		// Retrieve transformcomponent of player.
		TransformComponent& tc = Locator::world->m_registry.get<TransformComponent>(playerEntity);

		// Calculate new (x, y) of the camera.
		m_bounds.m_x = (tc.m_rect.m_x + tc.m_rect.m_width / 2) - m_bounds.m_width / 2;
		m_bounds.m_y = (tc.m_rect.m_y + tc.m_rect.m_height / 2) - m_bounds.m_height / 2;

		// Then correct values if "out of bounds".
		if (m_bounds.m_x < 0) { m_bounds.m_x = 0; }
		if (m_bounds.m_y < 0) { m_bounds.m_y = 0; }
		if (m_bounds.m_x > Locator::stateMachine->top()->m_bounds.m_width - m_bounds.m_width) { m_bounds.m_x = (float)Locator::stateMachine->top()->m_bounds.m_width - (float)m_bounds.m_width; }
		if (m_bounds.m_y > Locator::stateMachine->top()->m_bounds.m_height - m_bounds.m_height) { m_bounds.m_y = (float)Locator::stateMachine->top()->m_bounds.m_height - (float)m_bounds.m_height; }
	}
}


text:
In this exercise you'll be playing around with a remote controlled car, which you've finally saved enough money for to buy.

Cars start with full (100%) batteries. Each time you drive the car using the remote control, it covers 20 meters and drains one percent of the battery. The car's nickname is not known until it is created.

The remote controlled car has a fancy LED display that shows two bits of information:

- The total distance it has driven, displayed as: `"<METERS> meters"`.
- The remaining battery charge, displayed as: `"Battery at <PERCENTAGE>%"`.

If the battery is at 0%, you can't drive the car anymore and the battery display will show `"Battery empty"`.

## 1. Create a brand-new remote controlled car

Implement the `RemoteControlCar.new/0` function to return a brand-new remote controlled car struct:

```elixir
RemoteControlCar.new()
# => %RemoteControlCar{
#      battery_percentage: 100,
#      distance_driven_in_meters: 0,
#      nickname: "none"
#    }
```

The nickname is required by the struct, make sure that a value is initialized in the `new` function, but not in the struct.

## 2. Create a brand-new remote controlled car with a nickname

Implement the `RemoteControlCar.new/1` function to return a brand-new remote controlled car struct with a provided nickname:

```elixir
RemoteControlCar.new("Blue")
# => %RemoteControlCar{
#      battery_percentage: 100,
#      distance_driven_in_meters: 0,
#      nickname: "Blue"
#    }
```

## 3. Display the distance

Implement the `RemoteControlCar.display_distance/1` function to return the distance as displayed on the LED display:

```elixir
car = RemoteControlCar.new()
RemoteControlCar.display_distance(car)
# => "0 meters"
```

Make sure the function only accepts a `RemoteControlCar` struct as the argument.

## 4. Display the battery percentage

Implement the `RemoteControlCar.display_battery/1` function to return the battery percentage as displayed on the LED display:

```elixir
car = RemoteControlCar.new()
RemoteControlCar.display_battery(car)
# => "Battery at 100%"
```

Make sure the function only accepts a `RemoteControlCar` struct as the argument. If the battery is at 0%, the battery display will show "Battery empty".

## 5. Driving changes the battery and distance driven

Implement the `RemoteControlCar.drive/1` function that:

- updates the number of meters driven by 20
- drains 1% of the battery

```elixir
RemoteControlCar.new("Red")
|> RemoteControlCar.drive()
# => %RemoteControlCar{
#      battery_percentage: 99,
#      distance_driven_in_meters: 20,
#      nickname: "Red"
#    }

```

Make sure the function only accepts a `RemoteControlCar` struct as the argument.

## 6. Account for driving with a dead battery

Update the `RemoteControlCar.drive/1` function to not increase the distance driven nor decrease the battery percentage when the battery is drained (at 0%):

```elixir
%RemoteControlCar{
  battery_percentage: 0,
  distance_driven_in_meters: 1980,
  nickname: "Red"
}
|> RemoteControlCar.drive()
# => %RemoteControlCar{
#      battery_percentage: 0,
#      distance_driven_in_meters: 1980,
#      nickname: "Red"
#    }
```


text:
export class Engine {
	public size: string;
	public type: string;

	constructor(size: string, type: string) {
		this.size = size;
		this.type = type;
	}

	toString (): string {
		return this.size + " " + this.type;
	}
}


text:
// Copyright 2016 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.lib.rules.android;

import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.collect.nestedset.Depset;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.packages.BuiltinProvider;
import com.google.devtools.build.lib.packages.NativeInfo;
import com.google.devtools.build.lib.starlarkbuildapi.android.AndroidLibraryResourceClassJarProviderApi;
import com.google.devtools.build.lib.syntax.EvalException;

/**
 * A provider which contains the resource class jars from android_library rules. See {@link
 * AndroidRuleClasses#ANDROID_RESOURCES_CLASS_JAR}.
 */
public final class AndroidLibraryResourceClassJarProvider extends NativeInfo
    implements AndroidLibraryResourceClassJarProviderApi<Artifact> {

  public static final Provider PROVIDER = new Provider();

  private final NestedSet<Artifact> resourceClassJars;

  private AndroidLibraryResourceClassJarProvider(NestedSet<Artifact> resourceClassJars) {
    super(PROVIDER);
    this.resourceClassJars = resourceClassJars;
  }

  public static AndroidLibraryResourceClassJarProvider create(
      NestedSet<Artifact> resourceClassJars) {
    return new AndroidLibraryResourceClassJarProvider(resourceClassJars);
  }

  public static AndroidLibraryResourceClassJarProvider getProvider(
      TransitiveInfoCollection target) {
    return (AndroidLibraryResourceClassJarProvider)
        target.get(AndroidLibraryResourceClassJarProvider.PROVIDER.getKey());
  }

  @Override
  public Depset /*<Artifact>*/ getResourceClassJarsForStarlark() {
    return Depset.of(Artifact.TYPE, resourceClassJars);
  }

  public NestedSet<Artifact> getResourceClassJars() {
    return resourceClassJars;
  }

  /** Provider class for {@link AndroidLibraryResourceClassJarProvider} objects. */
  public static class Provider extends BuiltinProvider<AndroidLibraryResourceClassJarProvider>
      implements AndroidLibraryResourceClassJarProviderApi.Provider<Artifact> {

    private Provider() {
      super(NAME, AndroidLibraryResourceClassJarProvider.class);
    }

    public String getName() {
      return NAME;
    }

    @Override
    public AndroidLibraryResourceClassJarProvider create(Depset jars) throws EvalException {
      return new AndroidLibraryResourceClassJarProvider(
          NestedSetBuilder.<Artifact>stableOrder()
              .addTransitive(Depset.cast(jars, Artifact.class, "jars"))
              .build());
    }
  }
}


text:
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {Relation} from '@nozbe/watermelondb';
import {immutableRelation, json} from '@nozbe/watermelondb/decorators';
import Model, {Associations} from '@nozbe/watermelondb/Model';

import {MM_TABLES} from '@constants/database';
import {safeParseJSON} from '@utils/helpers';

import type MyChannelModel from '@typings/database/models/servers/my_channel';
import type MyChannelSettingsModelInterface from '@typings/database/models/servers/my_channel_settings';

const {MY_CHANNEL, MY_CHANNEL_SETTINGS} = MM_TABLES.SERVER;

/**
 * The MyChannelSettings model represents the specific user's configuration to
 * the channel this user belongs to.
 */
export default class MyChannelSettingsModel extends Model implements MyChannelSettingsModelInterface {
    /** table (name) : MyChannelSettings */
    static table = MY_CHANNEL_SETTINGS;

    static associations: Associations = {

        /** A MY_CHANNEL is associated with one MY_CHANNEL_SETTINGS (relationship is 1:1) **/
        [MY_CHANNEL]: {type: 'belongs_to', key: 'id'},
    };

    /** notify_props : Configurations in regard to this channel */
    @json('notify_props', safeParseJSON) notifyProps!: ChannelNotifyProps;

    /** channel : The relation pointing to the MY_CHANNEL table */
    @immutableRelation(MY_CHANNEL, 'id') myChannel!: Relation<MyChannelModel>;
}


text:
<?php

namespace Mage\Admin\Test\TestCase;

use Mage\Admin\Test\Page\Adminhtml\UserEdit;
use Mage\Admin\Test\Page\Adminhtml\UserIndex;
use Mage\Admin\Test\Fixture\User;
use Magento\Mtf\Fixture\FixtureFactory;
use Magento\Mtf\TestCase\Injectable;
use Magento\Mtf\Fixture\FixtureInterface;

/**
 * Test Flow:
 * 1. Log in as default admin user.
 * 2. Go to System-Permissions-Users.
 * 3. Press "Add new user" button to start create new admin user.
 * 4. Fill in all data according to data set.
 * 5. Save user.
 * 6. Perform assertions.
 *
 * @group ACL_(MX)
 * @ZephyrId MPERF-6593
 */
class CreateAdminUserEntityTest extends Injectable
{
    /**
     * User grid page.
     *
     * @var UserIndex
     */
    protected $userIndexPage;

    /**
     * User new/edit page.
     *
     * @var UserEdit
     */
    protected $userEditPage;

    /**
     * Factory for Fixtures.
     *
     * @var FixtureFactory
     */
    protected $fixtureFactory;

    /**
     * Preconditions for test.
     *
     * @param FixtureFactory $fixtureFactory
     * @return array
     */
    public function __prepare(FixtureFactory $fixtureFactory)
    {
        $this->fixtureFactory = $fixtureFactory;
        $adminUser = $fixtureFactory->createByCode('user');
        $adminUser->persist();

        return ['adminUser' => $adminUser];
    }

    /**
     * Injection data.
     *
     * @param UserIndex $userIndex
     * @param UserEdit $userEdit
     * @return void
     */
    public function __inject(UserIndex $userIndex, UserEdit $userEdit)
    {
        $this->userIndexPage = $userIndex;
        $this->userEditPage = $userEdit;
    }

    /**
     * Run Create Admin User Entity Test.
     *
     * @param User $user
     * @param User $adminUser
     * @param null|string $duplicatedParam
     * @param bool $isCustomRole [optional]
     * @return void
     */
    public function test(User $user, User $adminUser, $duplicatedParam = null, $isCustomRole = false)
    {
        // Prepare data
        $user = $this->prepareUser($user, $adminUser, $duplicatedParam, $isCustomRole);

        // Steps:
        $this->userIndexPage->open();
        $this->userIndexPage->getPageActionsBlock()->addNew();
        $this->userEditPage->getUserForm()->fill($user);
        $this->userEditPage->getFormPageActions()->save();
    }

    /**
     * Prepare User fixture.
     *
     * @param User $user
     * @param User $adminUser
     * @param null|string $duplicatedParam
     * @param bool $isCustomRole
     * @return User
     */
    protected function prepareUser(User $user, User $adminUser, $duplicatedParam, $isCustomRole)
    {
        if (!empty($duplicatedParam)) {
            $data = $user->getData();
            $data[$duplicatedParam] = $adminUser->getData($duplicatedParam);
            $user = $this->prepareUserFixture($user, $data);
        } elseif ($isCustomRole) {
            $data = $user->getData();
            $user = $this->prepareUserFixture($user, $data);
        }

        return $user;
    }

    /**
     * Prepare user fixture.
     *
     * @param User $user
     * @param array $data
     * @return FixtureInterface
     */
    protected function prepareUserFixture(User $user, array $data)
    {
        $data['role_id'] = ['role' => $user->getDataFieldConfig('role_id')['source']->getRole()];
        return $this->fixtureFactory->createByCode('user', ['data' => $data]);
    }
}


text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available at through the world-wide-web at                           |
// | http://www.php.net/license/2_02.txt.                                 |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to          |
// | license@php.net so we can mail you a copy immediately.               |
// +----------------------------------------------------------------------+
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com>                        |
// |          Bertrand Mansion <bmansion@mamasam.com>                     |
// +----------------------------------------------------------------------+
//
// $Id$

require_once("HTML/QuickForm/input.php");

/**
 * HTML class for a text field
 *
 * @author       Adam Daniel <adaniel1@eesus.jnj.com>
 * @author       Bertrand Mansion <bmansion@mamasam.com>
 * @version      1.0
 * @since        PHP4.04pl1
 * @access       public
 */
class HTML_QuickForm_text extends HTML_QuickForm_input
{

    // {{{ constructor

    /**
     * Class constructor
     *
     * @param     string    $elementName    (optional)Input field name attribute
     * @param     string    $elementLabel   (optional)Input field label
     * @param     mixed     $attributes     (optional)Either a typical HTML attribute string
     *                                      or an associative array
     * @since     1.0
     * @access    public
     * @return    void
     */
    public function __construct($elementName=null, $elementLabel=null, $attributes=null) {
        parent::__construct($elementName, $elementLabel, $attributes);
        $this->_persistantFreeze = true;
        $this->setType('text');
    } //end constructor

    /**
     * Old syntax of class constructor. Deprecated in PHP7.
     *
     * @deprecated since Moodle 3.1
     */
    public function HTML_QuickForm_text($elementName=null, $elementLabel=null, $attributes=null) {
        debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
        self::__construct($elementName, $elementLabel, $attributes);
    }

    // }}}
    // {{{ setSize()

    /**
     * Sets size of text field
     *
     * @param     string    $size  Size of text field
     * @since     1.3
     * @access    public
     * @return    void
     */
    function setSize($size)
    {
        $this->updateAttributes(array('size'=>$size));
    } //end func setSize

    // }}}
    // {{{ setMaxlength()

    /**
     * Sets maxlength of text field
     *
     * @param     string    $maxlength  Maximum length of text field
     * @since     1.3
     * @access    public
     * @return    void
     */
    function setMaxlength($maxlength)
    {
        $this->updateAttributes(array('maxlength'=>$maxlength));
    } //end func setMaxlength

    // }}}

} //end class HTML_QuickForm_text
?>


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>QUnit Notification Test Suite - Failed tests example</title>
  <link rel="stylesheet" href="../../bower_components/qunit/qunit/qunit.css">


text:
from __future__ import unicode_literals
from bs4 import BeautifulSoup
import requests
import sys

DOMAIN = 'http://info.kingcounty.gov/'
PATH = 'health/ehs/foodsafety/inspections/Results.aspx'
PARAMS = {
    'Output': 'W',
    'Business_Name': '',
    'Business_Address': '',
    'Longitude': '',
    'Latitude': '',
    'City': '',
    'Zip_Code': '',
    'Inspection_Type': 'All',
    'Inspection_Start': '',
    'Inspection_End': '',
    'Inspection_Closed_Business': 'A',
    'Violation_Points': '',
    'Violation_Red_Points': '',
    'Violation_Descr': '',
    'Fuzzy_Search': 'N',
    'Sort': 'B'
}

def get_inspection_page(**kwargs):
    url = DOMAIN + PATH
    params = PARAMS.copy()
    for k, v in kwargs.items():
        if k in PARAMS:
            params[k] = v

    response = requests.get(url, params=params)
    response.raise_for_status()
    return response.content, response.encoding

def load_inspection_page():
    with open('inspection_page.html', 'rb') as data:
        encoded_data = data.read()
        return encoded_data, 'utf-8'

def parse_source(data, encoding='utf-8'):
    soup_data = BeautifulSoup(data, 'html5lib', from_encoding=encoding)
    return soup_data

def extract_data_listings(soup):
    import re
    id_info = re.compile(r'PR0.*~')
    divs = soup.find_all('div', id=id_info)
    return divs

def has_two_tds(element):
    tr = element.name == 'tr'
    tds = element.find_all('td', recursive=False)
    has_two = len(tds) == 2
    return tr and has_two

def clean_data(cell):
    data = cell.string
    try:
        return data.strip(' \n:-')
    except AttributeError:
        return u''

def extract_restaurant_metadata(element):
    metadata_rows = element.find('tbody').find_all(
        has_two_tds, recursive=False
    )
    rdata = {}
    current_label = ''
    for row in metadata_rows:
        key, val = row.find_all('td', recursive=False)
        new_label = clean_data(key)
        current_label = new_label if new_label else current_label
        rdata.setdefault(current_label, []).append(clean_data(val))
    return rdata

def is_inspection_row(element):
    tr = element.name == 'tr'
    if not tr:
        return False
    td_child = element.find_all('td', recursive=False)
    has_four = len(td_child) == 4
    this_text = clean_data(td_child[0]).lower()
    contains_word = 'inspection' in this_text
    does_not_start = not this_text.startswith('inspection')
    return tr and has_four and contains_word and does_not_start

def extract_score_data(element):
    inspected = element.find_all(is_inspection_row)
    samples = len(inspected)
    total = high_score = average = 0
    for row in inspected:
        strval = clean_data(row.find_all('td')[2])
        try:
            intval = int(strval)
        except (ValueError, TypeError):
            samples -= 1
        else:
            total += intval
            high_score = intval if intval > high_score else high_score
    if samples:
        average = total / float(samples)
    data = {
        u'Average Score': average,
        u'High Score': high_score,
        u'Total Inspections': samples
    }
    return data

if __name__ == '__main__':
    if len(sys.argv) > 1 and sys.argv[1] == "Test":
        c, e = load_inspection_page()
    else:
        c, e = get_inspection_page(
            Zip_Code='98109',
            Inspection_Start='1/1/2015'
        )
    soup = parse_source(c, e)
    listings = extract_data_listings(soup)
    for listing in listings:
        meta_data = extract_restaurant_metadata(listing)
        score_data = extract_score_data(listing)
        full_data = meta_data.update(score_data)
        print(meta_data)


text:
package com.github.jinahya.codec;

import java.util.UUID;

import static java.lang.Long.parseLong;

/**
 * A class for decoding identifiers.
 *
 * @author Jin Kwon <jinahya_at_gmail.com>
 */
public class IdDecoder extends IdCodecBase<IdDecoder> {

    /**
     * Decodes specified single block.
     *
     * @param encoded the block to decode
     * @return decoded output
     */
    private long block(final String encoded) {
        final StringBuilder builder = new StringBuilder();
        builder.append(parseLong(encoded, getRadix()));
        builder.reverse();
        builder.delete(builder.length() - getScale(), builder.length());
        return parseLong(builder.toString());
    }

    /**
     * Decodes given value.
     *
     * @param encoded the value to decode.
     * @return decoded value
     */
    public long decode(final String encoded) {
        if (encoded == null) {
            throw new NullPointerException("encoded is null");
        }
        final int index = encoded.indexOf('-');
        return (block(encoded.substring(0, index)) << Integer.SIZE) | (block(encoded.substring(index + 1)));
    }

    /**
     * Decodes given value.
     *
     * @param encoded the value to decode.
     * @return decoded value
     */
    public UUID decodeUuid(final String encoded) {
        if (encoded == null) {
            throw new NullPointerException("encoded is null");
        }
        final int first = encoded.indexOf('-');
        final int second = encoded.indexOf('-', first + 1);
        final long mostSignificantBits = decode(encoded.substring(0, second));
        final long leastSignificantBits = decode(encoded.substring(second + 1));
        return new UUID(mostSignificantBits, leastSignificantBits);
    }
}


text:
<?php

namespace Zend\Crypt\Password\Exception;

use Zend\Crypt\Exception;

/**
 * Runtime argument exception
 *
 * @category   Zend
 * @package    Zend_Crypt
 * @subpackage Exception
 */
class RuntimeException extends Exception\RuntimeException implements
    ExceptionInterface
{}