text:
package ca.ualberta.cs.scandaloutraveltracker.models;

import android.location.Location;

/**
 * A destination is the physical location in which the claim is being added/processed, which is denoted with coordinates
 *  Class contains all the information that a Destination needs(Destination Name, Description and location).
 *   A destination(s) is contained inside a Claim.
 * @author Team3ScandalouStopwatch
 *
 */
public class Destination extends SModel  {

	String name;
	String description;
	Location location;

	/**
	 * Default constructor that sets the Destination object properties.
	 * @param name
	 * @param description
	 */
	public Destination(String name, String description) {
		this.name = name;
		this.description = description;
		this.location = null;
	}

	/**
	 *
	 * @return Name of Destination
	 */
	public String getName() {
		return name;
	}

	/**
	 *
	 * @param sets name of destination in the current Destination
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 *
	 * @return Description of Destination
	 */
	public String getDescription() {
		return description;
	}

	/**
	 *
	 * @param sets description of destination in the current Destination
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 *
	 * @return Location of Destination
	 */
	public Location getLocation() {
		return location;
	}

	/**
	 *
	 * @param sets location of Destination in the current Destination
	 */
	public void setLocation(Location location) {
		this.location = location;
	}

	/**
	 * Converts the destination and it's description into
	 * a string. In format: Destination name: description.
	 * @return Destination converted to a string
	 */
	public String toString(){
		String destination = this.name +": " + this.description;
		return destination;
	}
}


text:
<?php

?>

<?php

	ini_set('display_startup_errors',1);
	ini_set('display_errors',1);
	error_reporting(-1);

	include('../assets/php/lib.php');
	dontCache();

	checkLastActivity();
	redirectIfNotLoggedIn();
?>

	<link rel='stylesheet' href='../assets/css/styles.css' type='text/css' />
	<title>Main Menu</title>

QuikPHP Workflow Menu

	<form action='process.php' name='menu' id='menu' method='post'>
		<?php
			include '../assets/php/createNav.php';
			generateDashboard();
		?>

	</form>

redpajama_set_name: RedPajamaGithub


text:
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>Early Thoughts on iOS Development</title>
    <meta name="description" content="">

    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="shortcut icon" href="../favicon.ico">

    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic%7COpen+Sans:700,400">
    <link rel="stylesheet" type="text/css" href="../assets/css/screen.css?v=36acbe3795">

    <link rel="canonical" href="index.html">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <link rel="amphtml" href="amp/index.html">

    <meta property="og:site_name" content="Pat Kayongo's Software Development Blog">
    <meta property="og:type" content="article">
    <meta property="og:title" content="Early Thoughts on iOS Development">
    <meta property="og:description" content="Recently, I started developing iOS applications for work. It's an interesting experience, especially because I once vowed never to do iOS development due to my love-hate relationship with Apple. But the opportunity came up, and the diversity of experience can only be good experience. So here are my thoughts">
    <meta property="og:url" content="http://localhost:2368/early-thoughts-on-ios-development/">
    <meta property="article:published_time" content="2014-08-18T06:08:01.000Z">
    <meta property="article:modified_time" content="2014-08-18T10:38:37.000Z">
    <meta property="article:tag" content="iOS">
    <meta property="article:tag" content="Objective-C">
    <meta property="article:tag" content="XCode">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Early Thoughts on iOS Development">
    <meta name="twitter:description" content="Recently, I started developing iOS applications for work. It's an interesting experience, especially because I once vowed never to do iOS development due to my love-hate relationship with Apple. But the opportunity came up, and the diversity of experience can only be good experience. So here are my thoughts">
    <meta name="twitter:url" content="http://localhost:2368/early-thoughts-on-ios-development/">
    <meta name="twitter:label1" content="Written by">
    <meta name="twitter:data1" content="Patrick Kayongo">
    <meta name="twitter:label2" content="Filed under">
    <meta name="twitter:data2" content="iOS, Objective-C, XCode">
    <meta name="twitter:site" content="@patkayongo">

    <meta name="generator" content="Ghost 0.11">
    <link rel="alternate" type="application/rss+xml" title="Pat Kayongo's Software Development Blog" href="../rss/index.html">

Menu

        Close

Home

        Subscribe

            Menu

Early Thoughts on iOS Development

                <time class="post-date" datetime="2014-08-18">18 August 2014</time>  on iOS, Objective-C, XCode

Recently, I started developing iOS applications for work. It's an interesting experience, especially because I once vowed never to do iOS development due to my love-hate relationship with Apple. But the opportunity came up, and the diversity of experience can only be good experience. So here are my thoughts on the past few weeks:

It requires a change in paradigm from what I'm used to. The way a system is designed in .Net, i.e. the different classes, interfaces, base classes and design patterns that may be used will be different because they have different approaches. Sure iOS app development is based on the foundation of the common MVC design pattern, but there are differences in the way the application responds to events, handles user inputs, saves data, etc. There are many new concepts, such as delegates, which are not prevalent in .Net development. I'm still learning 'best practices' in terms of design.

The names of things aren't the same. Firstly, every class has a header and an implementation file. Some people don't like this. I kinda liked the separation of what a class does internally and how it interfaces with others. Also, initially I thought protocols in Objective-C are synonymous with interfaces in .Net development, but they aren't necessarily. They don't always have the same uses.

Like .Net, it's best to stand on the shoulders of others. Just like Entity Framework abstracts interactions with the database in .Net, there is really no need to create your own frameworks and libraries for what others have done already. Magical Record is really good for accessing and manipulating Core Data. RestKit is a really good library for interacting with RESTful web services.

Following from that Ray Wenderlich is my new best friend. This site has tutorials which cover everything I've needed thus far. Most of my learning has been from here.

Visual Studio is a really good IDE. Using XCode after spending so long with Visual Studio is like moving from the new Mercedes Benz C-Class to my current student card 2004 Renault Clio. At times I think it's just a glorified text editor. The debugging process is silly. It doesn't automate tasks which I assume should be easily automated. But it works. Most times.

The Mac OS operating system is what Ubuntu should have been. The Unix interface and general use is similar, but it's prettier, and more user friendly.

Mobile is the future. Creating apps instead of creating web applications has just shown that with mobile apps, one can truly create a personal experience interacting with user preferences and other user data which can be stored per user on their own device. Also, unlike the bottlenecks of the state-less nature of the web, developing apps instead of web sites becomes so much easier, and allows for so much more.

This journey has recently started, but it looks like an interesting one. I'm still a Microsoft lover and evangelist, but this has opened my previously myopic eyes to a bigger world out there with a larger range of possibilities.

                Patrick Kayongo's Picture

Patrick Kayongo

Read more posts by this author.

Share this post

                    Twitter

                    Facebook

                    Google+

Commenting Code

I have never had a 'standard' in mind on commenting code. There are principles that one should think of,…

Communication

A few years ago, my goal was to be the best software developer ever. Over time, that didn't…

Pat Kayongo's Software Development Blog © 2017

Proudly published with Ghost


text:
$(function() {
    var geo_location_polyline_map;
    var geo_location_polygon_map;
    var geo_location_circle_map;
    geo_location_pin_map = 2;
    map = 1;

    AnyTime.picker( "create_new_heritage_item_start_date",
        {
            format: "%e %b %Y %E",
            formatUtcOffset: "%: (%@)",
            placement: "popup",
            latest: new Date()
        }
    );

    AnyTime.picker( "create_new_heritage_item_end_date",
        {
            format: "%e %b %Y %E",
            formatUtcOffset: "%: (%@)",
            placement: "popup",
            latest: new Date()
        }
    );

    AnyTime.picker( "create_new_heritage_item_exact_date",
        {
            format: "%e %b %Y %E",
            formatUtcOffset: "%: (%@)",
            placement: "popup",
            latest: new Date()
        }
    );

    $( "#create_new_heritage_item_clear_start_date_but" ).click(function() {
        $( "#create_new_heritage_item_start_date" ).val("");
    });
    $( "#create_new_heritage_item_clear_end_date_but" ).click(function() {
        $( "#create_new_heritage_item_end_date" ).val("");
    });
    $( "#create_new_heritage_item_clear_exact_date_but" ).click(function() {
        $( "#create_new_heritage_item_exact_date" ).val("");
    });

    $( "#create_new_heritage_item_select_map_type" ).change(function() {
        var selected_map_type = $( "#create_new_heritage_item_select_map_type" ).val();
        showMapSelector(selected_map_type);
    });

    $( "#create_new_heritage_item_new_marker_but" ).click(function() {
        var latestIndexNumber = map.markers.length-1;
        var indexNumberForNewsMarker = latestIndexNumber+1;
        $('#create_new_heritage_item_select_marker').html(
            "<option value='none'>select a marker index</option>"
        );
        map.AddLocation({lat:41.0082, lon:28.9784, draggable:true, zoom:5}, indexNumberForNewsMarker , true);
    });

    $( "#create_new_heritage_item_remove_marker_but" ).click(function() {
        var selectedIndexNumber = $('#create_new_heritage_item_select_marker option:selected').text();
        var lastIndexInOptions = $('#create_new_heritage_item_select_marker option:last-child').text();

        if (selectedIndexNumber == "select a marker index") {
            // not selected any index
            console.log("not selected any index");
        }
        else {
            if (lastIndexInOptions == 0) {
                // don't do anything as this is the last index
                console.log("Last index left, not allowed to delete");
            }
            else {
                $('#create_new_heritage_item_select_marker').html(
                    "<option value='none'>select a marker index</option>"
                );
                map.RemoveLocations(selectedIndexNumber , true);
            }
        }

    });

    function showMapSelector(selected_map_type) {
        $('#create_new_heritage_item_select_marker').html(
            "<option value='none'>select a marker index</option>"
        );
        $( ".create_new_heritage_item_map_container").removeClass("active")

        if (selected_map_type == "pin") {
            $("#create_new_heritage_item_pin_gmap_container").addClass("active");
            geo_location_pin_map = new Maplace({
                map_div: '#create_new_heritage_item_pin_gmap',
                type: 'marker',
                controls_on_map: false,
                dragEnd: function(index, location, marker) {
                    geo_location_pin_map.o.locations[index].lat = marker.position.lat();
                    geo_location_pin_map.o.locations[index].lon = marker.position.lng();
                },
                afterCreateMarker: function(index, location, marker) {
                    $('#create_new_heritage_item_select_marker').append(
                        "<option value='"+index+"'>"+index+"</option>"
                    );
                },
                locations: [{
                    lat: 38.9637,
                    lon: 35.2433,
                    draggable: true,
                    zoom: 5
                }]
            }).Load();
            map = geo_location_pin_map;
        }

        if (selected_map_type == "circle") {
            $("#create_new_heritage_item_circle_gmap_container").addClass("active")
            geo_location_circle_map = new Maplace({
                map_div: '#create_new_heritage_item_circle_gmap',
                type: 'circle',
                controls_on_map: false,
                dragEnd: function(index, location, marker) {
                    geo_location_circle_map.o.locations[index].lat = marker.position.lat();
                    geo_location_circle_map.o.locations[index].lon = marker.position.lng();
                },
                afterCreateMarker: function(index, location, marker) {
                    $('#create_new_heritage_item_select_marker').append(
                        "<option value='"+index+"'>"+index+"</option>"
                    );
                },
                locations: [{
                    lat: 38.9637,
                    lon: 35.2433,
                    circle_options: {
                        radius: 150000,
                        editable: true
                    },
                    zoom: 5,
                    draggable: true
                }]
            }).Load();
            map = geo_location_circle_map;
        }
        if (selected_map_type == "polygon") {
            $("#create_new_heritage_item_polygon_gmap_container").addClass("active")
            geo_location_polygon_map = new Maplace({
                map_div: '#create_new_heritage_item_polygon_gmap',
                type: 'polygon',
                controls_on_map: false,
                dragEnd: function(index, location, marker) {
                    geo_location_polygon_map.o.locations[index].lat = marker.position.lat();
                    geo_location_polygon_map.o.locations[index].lon = marker.position.lng();
                },
                afterCreateMarker: function(index, location, marker) {
                    $('#create_new_heritage_item_select_marker').append(
                        "<option value='"+index+"'>"+index+"</option>"
                    );
                },
                locations: [{
                    lat: 39.5,
                    lon: 32.2433,
                    draggable: true,
                    zoom: 5
                },
                {
                    lat: 39.5,
                    lon: 38.2433,
                    draggable: true,
                    zoom: 5
                },
                {
                    lat: 38,
                    lon: 35.2433,
                    draggable: true,
                    zoom: 5
                }]
            }).Load();
            map = geo_location_polygon_map;
        }
        if (selected_map_type == "polyline") {
            $("#create_new_heritage_item_polyline_gmap_container").addClass("active")
            geo_location_polyline_map = new Maplace({
                map_div: '#create_new_heritage_item_path_polyline_gmap',
                type: 'polyline',
                controls_on_map: false,
                dragEnd: function(index, location, marker) {
                    geo_location_polyline_map.o.locations[index].lat = marker.position.lat();
                    geo_location_polyline_map.o.locations[index].lon = marker.position.lng();
                },
                afterCreateMarker: function(index, location, marker) {
                    $('#create_new_heritage_item_select_marker').append(
                        "<option value='"+index+"'>"+index+"</option>"
                    );
                },
                locations: [{
                    lat: 37,
                    lon: 31,
                    draggable: true,
                    zoom: 5,
                    html: '
Content B1
',
                    show_infowindow: true
                },
                {
                    lat: 39.5,
                    lon: 33,
                    draggable: true,
                    zoom: 5
                },
                {
                    lat: 41,
                    lon: 34,
                    draggable: true,
                    zoom: 5
                },
                {
                    lat: 37,
                    lon: 36,
                    draggable: true,
                    zoom: 5
                },
                {
                    lat: 40,
                    lon: 38,
                    draggable: true,
                    zoom: 5
                },
                {
                    lat: 38.9637,
                    lon: 40,
                    draggable: true,
                    zoom: 5
                }]
            }).Load();
            map = geo_location_polyline_map;
        }
    }

    $('body').on('click', '.add-free-origin-field-but', function() {
        var free_origin_field_value = $(this).parent().prev().children().eq(0).children().eq(0).val();

        if (free_origin_field_value == "") {

        }
        else {
            $(this).parent().prev().children().eq(0).children().eq(0).prop('disabled', true);
            $(this).parent().prev().children().eq(0).children().eq(1).text("");
            $(this).removeClass( "add-free-origin-field-but" ).addClass("remove-free-origin-field-but").addClass("btn-danger");
            $(this).children().eq(0).removeClass( "fa-plus" ).addClass("fa-minus");
            $(this).parent().parent().after("

"+
                "
"+
                "<input type=\"text\" class=\"form-control create_new_heritage_item_free_origin\">"+
                "Origin (free-text field)"+
                "
"+
                "
"+
                "
"+
                "<button type=\"button\" class=\"btn ink-reaction btn-floating-action btn-primary add-free-origin-field-but\"></button>"+
                "

");
        }

    });

    $('body').on('click', '.remove-free-origin-field-but', function() {
        $(this).parent().parent().remove();
    });

    $('#multimedia-image-card .md-add').click(function() {
        var $template = $($('#template-multimedia-file-input').html());
        $("#multimedia-image-card ul").append($template);
        $('.fa-trash', $template).click(function() {
            $(this).parent().parent().remove();
        });
    });

    $('#multimedia-image-card .fa-trash').click(function() {
        $(this).parent().parent().remove();
    });

    $('body').on('click', '.add-key-value-field-but', function() {
        var key_field_input = $(this).parent().prev().prev().prev().children().eq(0).children().eq(0).val();
        var value_field_input = $(this).parent().prev().children().eq(0).children().eq(0).val();

        if (key_field_input == "" || value_field_input == "") {

        }
        else {
            $(this).parent().prev().prev().prev().children().eq(0).children().eq(0).prop('disabled', true);
            $(this).parent().prev().prev().prev().children().eq(0).children().eq(1).text("");
            $(this).parent().prev().children().eq(0).children().eq(0).prop('disabled', true);
            $(this).parent().prev().children().eq(0).children().eq(1).text("");
            $(this).removeClass( "add-key-value-field-but" ).addClass("remove-key-value-field-but").addClass("btn-danger");
            $(this).children().eq(0).removeClass( "fa-plus" ).addClass("fa-minus");
            $(this).parent().parent().after("
"+
                "
"+
                "
"+
                "<input type=\"text\" class=\"form-control basicInformation-name\">"+
                "key"+
                "
"+
                "
"+
                "
"+
                " "+
                "
"+
                "
"+
                "
"+
                "<input type=\"text\" class=\"form-control basicInformation-value\">"+
                "value"+
                "
"+
                "
"+
                "
"+
                "<button type=\"button\" class=\"btn ink-reaction btn-floating-action btn-primary add-key-value-field-but\"></button>"+
                "
"+
                "
");
        }

    });

    $('body').on('click', '.remove-key-value-field-but', function() {
        $(this).parent().parent().remove();
    });

    var timeout_for_create_heritage_item_title_input;
    $("#create_new_heritage_item_title").keypress(function(e) {
        if (timeout_for_create_heritage_item_title_input) {clearTimeout(timeout_for_create_heritage_item_title_input);}
        timeout_for_create_heritage_item_title_input = setTimeout(function () {
            $("#create_new_heritage_item_errors").html("");
        }, 150);
    });

    var timeout_for_create_heritage_item_description_input;
    $("#create_new_heritage_item_description").keypress(function(e) {
        if (timeout_for_create_heritage_item_description_input) {clearTimeout(timeout_for_create_heritage_item_description_input);}
        timeout_for_create_heritage_item_description_input = setTimeout(function () {
            $("#create_new_heritage_item_errors").html("");
        }, 150);
    });

    function saveMultimedia(instanceId, mm) {
        mm.meta = JSON.stringify(mm.meta);
        $.ajax({
            method: "POST",
            url: "/api/v1/heritages/" + instanceId + "/multimedia",
            data: JSON.stringify(mm),
            contentType: "application/json",
            async: false
        })
        .done(function(instance) {
            console.log(instance);
        }).fail(function(jqXHR, textStatus){
            console.log(jqXHR.responseText)
        });
    }

    function uploadImages(instanceId) {

        $(".multimedia-image").each(function(index, input) {
            if (input.files.length == 0)
                return;
            var data = new FormData();
            data.append("type", "image");
            data.append("file", input.files[0]);

            $.ajax({
                type: 'POST',
                url: "/api/v1/heritages/" + instanceId + "/multimedia",
                data: data,
                cache: false,
                async: false,
                contentType: false,
                processData: false,
            })
            .done(function(instance) {
                console.log(instance);
            }).fail(function(jqXHR, textStatus){
                console.log(jqXHR.responseText)
            });
        });
    }

    $( "#create_new_heritage_item_create_but" ).click(function() {

        // TODO: dsiable create button until completed or failed
        $("#create_new_heritage_item_create_but").attr("disabled", "1");

        var heritage = {};
        heritage.title = $( "#create_new_heritage_item_title" ).val();
        heritage.description = $( "#create_new_heritage_item_description" ).val();
        heritage.basicInformation = [];
        heritage.origin = [];
        heritage.startDate = $("#create_new_heritage_item_start_date").val();
        heritage.endDate = $("#create_new_heritage_item_end_date").val();
        heritage.exactDate = $("#create_new_heritage_item_exact_date").val();
        heritage.multimedia = [];
        heritage.tags = [];

        $(".basicInformation-name-value").each(function(index, nv){
            var name = $(".basicInformation-name", nv).val();
            var value = $(".basicInformation-value", nv).val();
            if (name) {
                heritage.basicInformation.push({
                    "name": name,
                    "value": value
                });
            }
        });

        $(".create_new_heritage_item_free_origin").each(function(index, origin){
            var origin = $(origin).val();
            if (origin) {
                heritage.origin.push({
                    "name": origin
                })
            }
        });

        var selected_map_type = $( "#create_new_heritage_item_select_map_type" ).val();

        if (selected_map_type != "not-selected") {
            if (selected_map_type == "pin")
                selected_map_type = "marker"
            var locationData = {
                "type": selected_map_type,
                "markers": []
            };
            for (var i = map.markers.length - 1; i >= 0; i--) {
                var marker = map.markers[i];
                var d = {
                    "lat": marker.position.lat(),
                    "lon": marker.position.lng(),
                    "zoom": marker.zoom
                };

                if (selected_map_type == "circle") {
                    d.circle_options = marker.circle_options;
                    d.circle_options.editable = false;
                }

                locationData.markers.push(d);
            }
            heritage.multimedia.push({
                "type": "location",
                "meta": locationData
            });
        }

        console.log(heritage)

        $.ajax({
            method: "POST",
            url: "/api/v1/heritages/",
            data: JSON.stringify(heritage),
            contentType: "application/json",
            async: false
        })
        .done(function(instance) {
            toastr.success('Heritage saved.')
            for (var i = heritage.multimedia.length - 1; i >= 0; i--) {
                saveMultimedia(instance.id, heritage.multimedia[i]);
            }

            toastr.success('Locations saved.')

            uploadImages(instance.id);
            toastr.success('Images saved.')

            $("#create_new_heritage_item_create_but").removeAttr("disabled", "1");
            location.href = "heritage.html?id=" + instance.id;
        }).fail(function(jqXHR, textStatus){
            toastr.error(jqXHR.responseText)
            $("#create_new_heritage_item_create_but").removeAttr("disabled", "1");
        });

        // if (title_input == "" || description_input == "") {
        //     $( "#create_new_heritage_item_errors" ).html("You should provide a title and a description while submitting a new heritage item.");
        // }
        // else {
        //     // submit form here
        // }
    });

    showMapSelector("pin")

});


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.serviceusage.v1.model;

/**
 * Selects and configures the service controller used by the service. Example: control: environment:
 * servicecontrol.googleapis.com
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Service Usage API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Control extends com.google.api.client.json.GenericJson {

  /**
   * The service controller environment to use. If empty, no control plane feature (like quota and
   * billing) will be enabled. The recommended value for most services is
   * servicecontrol.googleapis.com
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String environment;

  /**
   * The service controller environment to use. If empty, no control plane feature (like quota and
   * billing) will be enabled. The recommended value for most services is
   * servicecontrol.googleapis.com
   * @return value or {@code null} for none
   */
  public java.lang.String getEnvironment() {
    return environment;
  }

  /**
   * The service controller environment to use. If empty, no control plane feature (like quota and
   * billing) will be enabled. The recommended value for most services is
   * servicecontrol.googleapis.com
   * @param environment environment or {@code null} for none
   */
  public Control setEnvironment(java.lang.String environment) {
    this.environment = environment;
    return this;
  }

  @Override
  public Control set(String fieldName, Object value) {
    return (Control) super.set(fieldName, value);
  }

  @Override
  public Control clone() {
    return (Control) super.clone();
  }

}


text:
package com.facebook.imagepipeline.cache;

import com.facebook.cache.common.CacheKey;
import com.facebook.imagepipeline.image.CloseableImage;

public class BitmapMemoryCacheFactory {

  public static InstrumentedMemoryCache<CacheKey, CloseableImage> get(
      final CountingMemoryCache<CacheKey, CloseableImage> bitmapCountingMemoryCache,
      final ImageCacheStatsTracker imageCacheStatsTracker) {

    imageCacheStatsTracker.registerBitmapMemoryCache(bitmapCountingMemoryCache);

    MemoryCacheTracker memoryCacheTracker = new MemoryCacheTracker<CacheKey>() {
      @Override
      public void onCacheHit(CacheKey cacheKey) {
        imageCacheStatsTracker.onBitmapCacheHit(cacheKey);
      }

      @Override
      public void onCacheMiss() {
        imageCacheStatsTracker.onBitmapCacheMiss();
      }

      @Override
      public void onCachePut() {
        imageCacheStatsTracker.onBitmapCachePut();
      }
    };

    return new InstrumentedMemoryCache<>(bitmapCountingMemoryCache, memoryCacheTracker);
  }
}


text:
package com.intellij.json;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author Mikhail Golubev
 */
public class JsonUtil {
  private JsonUtil() {
    // empty
  }

  /**
   * Clone of C# "as" operator.
   * Checks if expression has correct type and casts it if it has. Returns null otherwise.
   * It saves coder from "instanceof / cast" chains.
   *
   * Copied from PyCharm's {@code PyUtil}.
   *
   * @param expression expression to check
   * @param cls        class to cast
   * @param <T>        class to cast
   * @return expression casted to appropriate type (if could be casted). Null otherwise.
   */
  @Nullable
  @SuppressWarnings("unchecked")
  public static <T> T as(@Nullable final Object expression, @NotNull final Class<T> cls) {
    if (expression == null) {
      return null;
    }
    if (cls.isAssignableFrom(expression.getClass())) {
      return (T)expression;
    }
    return null;
  }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<!-- Copyright © 1991-2013 Unicode, Inc.
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
For terms of use, see http://www.unicode.org/copyright.html
-->
<ldml>
	<identity>
		<version number="$Revision: 9728 $"/>
		<generation date="$Date: 2014-02-12 22:14:13 -0600 (Wed, 12 Feb 2014) $"/>
		<language type="kab"/>
	</identity>
	<localeDisplayNames>
		<languages>
			<language type="ak">Takanit</language>
			<language type="am">Tamahrict</language>
			<language type="ar">Taɛrabt</language>
			<language type="be">Tabilarusit</language>
			<language type="bg">Tabulgarit</language>
			<language type="bn">Tabengalit</language>
			<language type="cs">Tačikit</language>
			<language type="de">Talmant</language>
			<language type="el">Tagrikit</language>
			<language type="en">Taglizit</language>
			<language type="es">Taspenyulit</language>
			<language type="fa">Tafarisit</language>
			<language type="fr">Tafransist</language>
			<language type="ha">Tahwasit</language>
			<language type="hi">Tahendit</language>
			<language type="hu">Tahungarit</language>
			<language type="id">Tandunisit</language>
			<language type="ig">Tigbut</language>
			<language type="it">Taṭalyanit</language>
			<language type="ja">Tajapunit</language>
			<language type="jv">Tajavanit</language>
			<language type="kab">Taqbaylit</language>
			<language type="km">Takemrit</language>
			<language type="ko">Takurit</language>
			<language type="ms">Tamalawit</language>
			<language type="my">Taburmisit</language>
			<language type="ne">Tanipalit</language>
			<language type="nl">Tadučit</language>
			<language type="pa">Tapunjabit</language>
			<language type="pl">Tapulunit</language>
			<language type="pt">Tapurtugalit</language>
			<language type="ro">Tarumanit</language>
			<language type="ru">Tarusit</language>
			<language type="rw">Taruwandit</language>
			<language type="so">Taṣumalit</language>
			<language type="sv">Taswidit</language>
			<language type="ta">Taṭamulit</language>
			<language type="th">Taṭaylundit</language>
			<language type="tr">Taṭurkit</language>
			<language type="uk">Tukranit</language>
			<language type="ur">Turdut</language>
			<language type="vi">Tabyiṭnamit</language>
			<language type="yo">Tayurubit</language>
			<language type="zh">Tacinwat, Tamundarint</language>
			<language type="zu">Tazulut</language>
		</languages>
		<territories>
			<territory type="AD">Undura</territory>
			<territory type="AE">Tigeldunin Yedduklen Taɛrabin</territory>
			<territory type="AF">Afɣanistan</territory>
			<territory type="AG">Untiga d Barbuda</territory>
			<territory type="AI">Ungiya</territory>
			<territory type="AL">Lalbani</territory>
			<territory type="AM">Arminya</territory>
			<territory type="AN">Antilles n Tmura-Yessakesren</territory>
			<territory type="AO">Ungula</territory>
			<territory type="AR">Arjuntin</territory>
			<territory type="AS">Samwa Tamarikanit</territory>
			<territory type="AT">Ustriya</territory>
			<territory type="AU">Ustrali</territory>
			<territory type="AW">Aruba</territory>
			<territory type="AZ">Azrabijan</territory>
			<territory type="BA">Busna d Hersek</territory>
			<territory type="BB">Barbadus</territory>
			<territory type="BD">Bangladac</territory>
			<territory type="BE">Belǧik</territory>
			<territory type="BF">Burkina Fasu</territory>
			<territory type="BG">Bulgari</territory>
			<territory type="BH">Baḥrin</territory>
			<territory type="BI">Burandi</territory>
			<territory type="BJ">Binin</territory>
			<territory type="BM">Bermuda</territory>
			<territory type="BN">Bruney</territory>
			<territory type="BO">Bulivi</territory>
			<territory type="BR">Brizil</territory>
			<territory type="BS">Bahamas</territory>
			<territory type="BT">Bhutan</territory>
			<territory type="BW">Bustwana</territory>
			<territory type="BY">Bilarus</territory>
			<territory type="BZ">Biliz</territory>
			<territory type="CA">Kanada</territory>
			<territory type="CD">Tigduda Tagdudant n Kungu</territory>
			<territory type="CF">Tigduda n Tefriqt Talemmast</territory>
			<territory type="CG">Kungu</territory>
			<territory type="CH">Swis</territory>
			<territory type="CI">Kuṭ Divwar</territory>
			<territory type="CK">Tigzirin n Kuk</territory>
			<territory type="CL">Cili</territory>
			<territory type="CM">Kamirun</territory>
			<territory type="CN">Lacin</territory>
			<territory type="CO">Kulumbi</territory>
			<territory type="CR">Kusta Rika</territory>
			<territory type="CU">Kuba</territory>
			<territory type="CV">Tigzirin n yixef azegzaw</territory>
			<territory type="CY">Cipr</territory>
			<territory type="CZ">Čček</territory>
			<territory type="DE">Lalman</territory>
			<territory type="DJ">Ǧibuti</territory>
			<territory type="DK">Denmark</territory>
			<territory type="DM">Duminik</territory>
			<territory type="DO">Tigduda Taduminikit</territory>
			<territory type="DZ">Lezzayer</territory>
			<territory type="EC">Ikwaṭur</territory>
			<territory type="EE">Istunya</territory>
			<territory type="EG">Maṣr</territory>
			<territory type="ER">Iritiria</territory>
			<territory type="ES">Spanya</territory>
			<territory type="ET">Utyupi</territory>
			<territory type="FI">Finlund</territory>
			<territory type="FJ">Fiji</territory>
			<territory type="FK">Tigzirin n Falkland</territory>
			<territory type="FM">Mikrunizya</territory>
			<territory type="FR">Fransa</territory>
			<territory type="GA">Gabun</territory>
			<territory type="GB">Tagelda Yedduklen</territory>
			<territory type="GD">Grunad</territory>
			<territory type="GE">Jiyurji</territory>
			<territory type="GF">Ɣana tafransist</territory>
			<territory type="GH">Ɣana</territory>
			<territory type="GI">Jibraltar</territory>
			<territory type="GL">Grunland</territory>
			<territory type="GM">Gambya</territory>
			<territory type="GN">Ɣinya</territory>
			<territory type="GP">Gwadalupi</territory>
			<territory type="GQ">Ɣinya Tasebgast</territory>
			<territory type="GR">Lagris</territory>
			<territory type="GT">Gwatimala</territory>
			<territory type="GU">Gwam</territory>
			<territory type="GW">Ɣinya-Bisaw</territory>
			<territory type="GY">Guwana</territory>
			<territory type="HN">Hunduras</territory>
			<territory type="HR">Kerwasya</territory>
			<territory type="HT">Hayti</territory>
			<territory type="HU">Hungri</territory>
			<territory type="ID">Indunizi</territory>
			<territory type="IE">Lirlund</territory>
			<territory type="IL">Izrayil</territory>
			<territory type="IN">Lhend</territory>
			<territory type="IO">Akal Aglizi deg Ugaraw Ahendi</territory>
			<territory type="IQ">Lɛiraq</territory>
			<territory type="IR">Iran</territory>
			<territory type="IS">Island</territory>
			<territory type="IT">Ṭelyan</territory>
			<territory type="JM">Jamyika</territory>
			<territory type="JO">Lajurdani</territory>
			<territory type="JP">Jappu</territory>
			<territory type="KE">Kinya</territory>
			<territory type="KG">Kirigistan</territory>
			<territory type="KH">Cambudya</territory>
			<territory type="KI">Kiribati</territory>
			<territory type="KM">Kumur</territory>
			<territory type="KN">San Kits d Nivis</territory>
			<territory type="KP">Kurya, Ufella</territory>
			<territory type="KR">Kurya, Wadda</territory>
			<territory type="KW">Kuwayt</territory>
			<territory type="KY">Tigzirin n Kamyan</territory>
			<territory type="KZ">Kazaxistan</territory>
			<territory type="LA">Laws</territory>
			<territory type="LB">Lubnan</territory>
			<territory type="LC">San Lučya</territory>
			<territory type="LI">Layctenstan</territory>
			<territory type="LK">Sri Lanka</territory>
			<territory type="LR">Libirya</territory>
			<territory type="LS">Lizuṭu</territory>
			<territory type="LT">Liṭwanya</territory>
			<territory type="LU">Luksamburg</territory>
			<territory type="LV">Latvia</territory>
			<territory type="LY">Libya</territory>
			<territory type="MA">Lmerruk</territory>
			<territory type="MC">Munaku</territory>
			<territory type="MD">Muldabi</territory>
			<territory type="MG">Madaɣecqer</territory>
			<territory type="MH">Tigzirin n Marcal</territory>
			<territory type="MK">Masidwan</territory>
			<territory type="ML">Mali</territory>
			<territory type="MM">Myanmar</territory>
			<territory type="MN">Mungulya</territory>
			<territory type="MP">Tigzirin n Maryan Ufella</territory>
			<territory type="MQ">Martinik</territory>
			<territory type="MR">Muriṭanya</territory>
			<territory type="MS">Munsirat</territory>
			<territory type="MT">Malṭ</territory>
			<territory type="MU">Muris</territory>
			<territory type="MV">Maldib</territory>
			<territory type="MW">Malawi</territory>
			<territory type="MX">Meksik</territory>
			<territory type="MY">Malizya</territory>
			<territory type="MZ">Muzembiq</territory>
			<territory type="NA">Namibya</territory>
			<territory type="NC">Kalidunya Tamaynut</territory>
			<territory type="NE">Nijer</territory>
			<territory type="NF">Tigzirin Tinawfukin</territory>
			<territory type="NG">Nijirya</territory>
			<territory type="NI">Nikaragwa</territory>
			<territory type="NL">Timura-Yessakesren</territory>
			<territory type="NO">Nurvij</territory>
			<territory type="NP">Nipal</territory>
			<territory type="NR">Nuru</territory>
			<territory type="NU">Niwi</territory>
			<territory type="NZ">Ziland Tamaynut</territory>
			<territory type="OM">Ɛuman</territory>
			<territory type="PA">Panam</territory>
			<territory type="PE">Piru</territory>
			<territory type="PF">Pulunizi tafransist</territory>
			<territory type="PG">Ɣinya Tamaynut Tapaput</territory>
			<territory type="PH">Filipin</territory>
			<territory type="PK">Pakistan</territory>
			<territory type="PL">Pulund</territory>
			<territory type="PM">San Pyar d Miklun</territory>
			<territory type="PN">Pitkarin</territory>
			<territory type="PR">Purtu Riku</territory>
			<territory type="PS">Falisṭin d Ɣezza</territory>
			<territory type="PT">Purtugal</territory>
			<territory type="PW">Palu</territory>
			<territory type="PY">Paragway</territory>
			<territory type="QA">Qaṭar</territory>
			<territory type="RE">Timlilit</territory>
			<territory type="RO">Rumani</territory>
			<territory type="RU">Rrus</territory>
			<territory type="RW">Ruwanda</territory>
			<territory type="SA">Suɛudiya Taɛrabt</territory>
			<territory type="SB">Tigzirin n Sulumun</territory>
			<territory type="SC">Seycel</territory>
			<territory type="SD">Sudan</territory>
			<territory type="SE">Swid</territory>
			<territory type="SG">Singafur</territory>
			<territory type="SH">Sant Ilina</territory>
			<territory type="SI">Sluvinya</territory>
			<territory type="SK">Sluvakya</territory>
			<territory type="SL">Sira Lyun</territory>
			<territory type="SM">San Marinu</territory>
			<territory type="SN">Sinigal</territory>
			<territory type="SO">Ṣumal</territory>
			<territory type="SR">Surinam</territory>
			<territory type="ST">Saw Tumi d Pransip</territory>
			<territory type="SV">Salvadur</territory>
			<territory type="SY">Surya</territory>
			<territory type="SZ">Swazilund</territory>
			<territory type="TC">Ṭurk d Tegzirin n Kaykus</territory>
			<territory type="TD">Čad</territory>
			<territory type="TG">Ṭugu</territory>
			<territory type="TH">Ṭayland</territory>
			<territory type="TJ">Tajikistan</territory>
			<territory type="TK">Ṭuklu</territory>
			<territory type="TL">Tumur Asamar</territory>
			<territory type="TM">Ṭurkmanistan</territory>
			<territory type="TN">Tunes</territory>
			<territory type="TO">Ṭunga</territory>
			<territory type="TR">Ṭurk</territory>
			<territory type="TT">Ṭrindad d Ṭubagu</territory>
			<territory type="TV">Ṭuvalu</territory>
			<territory type="TW">Ṭaywan</territory>
			<territory type="TZ">Ṭanzanya</territory>
			<territory type="UA">Ukran</territory>
			<territory type="UG">Uɣanda</territory>
			<territory type="US">WDM</territory>
			<territory type="UY">Urugway</territory>
			<territory type="UZ">Uzbaxistan</territory>
			<territory type="VA">Awanek n Vatikan</territory>
			<territory type="VC">San Vansu d Grunadin</territory>
			<territory type="VE">Venzwila</territory>
			<territory type="VG">Tigzirin Tiverjiniyin Tigliziyin</territory>
			<territory type="VI">W.D. Tigzirin n Virginya</territory>
			<territory type="VN">Vyeṭnam</territory>
			<territory type="VU">Vanwatu</territory>
			<territory type="WF">Wallis d Futuna</territory>
			<territory type="WS">Samwa</territory>
			<territory type="YE">Lyamen</territory>
			<territory type="YT">Mayuṭ</territory>
			<territory type="ZA">Tafriqt Wadda</territory>
			<territory type="ZM">Zambya</territory>
			<territory type="ZW">Zimbabwi</territory>
		</territories>
	</localeDisplayNames>
	<characters>
		<exemplarCharacters>[a b c č d ḍ e ɛ f g ǧ ɣ h ḥ i j k l m n p q r ṛ s ṣ t ṭ u w x y z ẓ]</exemplarCharacters>
		<exemplarCharacters type="auxiliary">[o v]</exemplarCharacters>
		<exemplarCharacters type="index">[A B C Č D Ḍ E Ɛ F G Ǧ Ɣ H Ḥ I J K L M N P Q R Ṛ S Ṣ T Ṭ U W X Y Z Ẓ]</exemplarCharacters>
	</characters>
	<delimiters>
		<quotationStart>«</quotationStart>
		<quotationEnd>»</quotationEnd>
		<alternateQuotationStart>"</alternateQuotationStart>
		<alternateQuotationEnd>"</alternateQuotationEnd>
	</delimiters>
	<dates>
		<calendars>
			<calendar type="generic">
				<dateFormats>
					<dateFormatLength type="full">
						<dateFormat>
							<pattern>EEEE d MMMM y G</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="long">
						<dateFormat>
							<pattern>d MMMM y G</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="medium">
						<dateFormat>
							<pattern>d MMM, y G</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="short">
						<dateFormat>
							<pattern>d/M/y GGGGG</pattern>
						</dateFormat>
					</dateFormatLength>
				</dateFormats>
				<dateTimeFormats>
					<availableFormats>
						<dateFormatItem id="M">M</dateFormatItem>
						<dateFormatItem id="Md">d/M</dateFormatItem>
						<dateFormatItem id="MMd">d/MM</dateFormatItem>
						<dateFormatItem id="MMdd">dd/MM</dateFormatItem>
						<dateFormatItem id="MMM">MMM</dateFormatItem>
						<dateFormatItem id="MMMd">d MMM</dateFormatItem>
						<dateFormatItem id="MMMEd">E d MMM</dateFormatItem>
						<dateFormatItem id="MMMMd">d MMMM</dateFormatItem>
						<dateFormatItem id="MMMMEd">E d MMMM</dateFormatItem>
						<dateFormatItem id="ms">m:ss</dateFormatItem>
						<dateFormatItem id="y">y</dateFormatItem>
						<dateFormatItem id="yM">M/y</dateFormatItem>
						<dateFormatItem id="yMEd">E d/M/y</dateFormatItem>
						<dateFormatItem id="yMM">MM/y</dateFormatItem>
						<dateFormatItem id="yMMM">MMM y</dateFormatItem>
						<dateFormatItem id="yMMMd">d MMM y</dateFormatItem>
						<dateFormatItem id="yMMMEd">E d MMM y</dateFormatItem>
						<dateFormatItem id="yMMMM">MMMM y</dateFormatItem>
						<dateFormatItem id="yQQQ">QQQ y</dateFormatItem>
						<dateFormatItem id="yQQQQ">QQQQ y</dateFormatItem>
					</availableFormats>
				</dateTimeFormats>
			</calendar>
			<calendar type="gregorian">
				<months>
					<monthContext type="format">
						<monthWidth type="abbreviated">
							<month type="1">Yen</month>
							<month type="2">Fur</month>
							<month type="3">Meɣ</month>
							<month type="4">Yeb</month>
							<month type="5">May</month>
							<month type="6">Yun</month>
							<month type="7">Yul</month>
							<month type="8">Ɣuc</month>
							<month type="9">Cte</month>
							<month type="10">Tub</month>
							<month type="11">Nun</month>
							<month type="12">Duǧ</month>
						</monthWidth>
						<monthWidth type="wide">
							<month type="1">Yennayer</month>
							<month type="2">Fuṛar</month>
							<month type="3">Meɣres</month>
							<month type="4">Yebrir</month>
							<month type="5">Mayyu</month>
							<month type="6">Yunyu</month>
							<month type="7">Yulyu</month>
							<month type="8">Ɣuct</month>
							<month type="9">Ctembeṛ</month>
							<month type="10">Tubeṛ</month>
							<month type="11">Nunembeṛ</month>
							<month type="12">Duǧembeṛ</month>
						</monthWidth>
					</monthContext>
					<monthContext type="stand-alone">
						<monthWidth type="narrow">
							<month type="1">Y</month>
							<month type="2">F</month>
							<month type="3">M</month>
							<month type="4">Y</month>
							<month type="5">M</month>
							<month type="6">Y</month>
							<month type="7">Y</month>
							<month type="8">Ɣ</month>
							<month type="9">C</month>
							<month type="10">T</month>
							<month type="11">N</month>
							<month type="12">D</month>
						</monthWidth>
					</monthContext>
				</months>
				<days>
					<dayContext type="format">
						<dayWidth type="abbreviated">
							<day type="sun">Yan</day>
							<day type="mon">San</day>
							<day type="tue">Kraḍ</day>
							<day type="wed">Kuẓ</day>
							<day type="thu">Sam</day>
							<day type="fri">Sḍis</day>
							<day type="sat">Say</day>
						</dayWidth>
						<dayWidth type="wide">
							<day type="sun">Yanass</day>
							<day type="mon">Sanass</day>
							<day type="tue">Kraḍass</day>
							<day type="wed">Kuẓass</day>
							<day type="thu">Samass</day>
							<day type="fri">Sḍisass</day>
							<day type="sat">Sayass</day>
						</dayWidth>
					</dayContext>
					<dayContext type="stand-alone">
						<dayWidth type="narrow">
							<day type="sun">Y</day>
							<day type="mon">S</day>
							<day type="tue">K</day>
							<day type="wed">K</day>
							<day type="thu">S</day>
							<day type="fri">S</day>
							<day type="sat">S</day>
						</dayWidth>
					</dayContext>
				</days>
				<quarters>
					<quarterContext type="format">
						<quarterWidth type="abbreviated">
							<quarter type="1">Kḍg1</quarter>
							<quarter type="2">Kḍg2</quarter>
							<quarter type="3">Kḍg3</quarter>
							<quarter type="4">Kḍg4</quarter>
						</quarterWidth>
						<quarterWidth type="wide">
							<quarter type="1">akraḍaggur amenzu</quarter>
							<quarter type="2">akraḍaggur wis-sin</quarter>
							<quarter type="3">akraḍaggur wis-kraḍ</quarter>
							<quarter type="4">akraḍaggur wis-kuẓ</quarter>
						</quarterWidth>
					</quarterContext>
				</quarters>
				<dayPeriods>
					<dayPeriodContext type="format">
						<dayPeriodWidth type="wide">
							<dayPeriod type="am">n tufat</dayPeriod>
							<dayPeriod type="pm">n tmeddit</dayPeriod>
						</dayPeriodWidth>
					</dayPeriodContext>
				</dayPeriods>
				<eras>
					<eraNames>
						<era type="0">send talalit n Ɛisa</era>
						<era type="1">seld talalit n Ɛisa</era>
					</eraNames>
					<eraAbbr>
						<era type="0">snd. T.Ɛ</era>
						<era type="1">sld. T.Ɛ</era>
					</eraAbbr>
				</eras>
				<dateFormats>
					<dateFormatLength type="full">
						<dateFormat>
							<pattern>EEEE d MMMM y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="long">
						<dateFormat>
							<pattern>d MMMM y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="medium">
						<dateFormat>
							<pattern>d MMM, y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="short">
						<dateFormat>
							<pattern>d/M/y</pattern>
						</dateFormat>
					</dateFormatLength>
				</dateFormats>
				<timeFormats>
					<timeFormatLength type="full">
						<timeFormat>
							<pattern>HH:mm:ss zzzz</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="long">
						<timeFormat>
							<pattern>HH:mm:ss z</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="medium">
						<timeFormat>
							<pattern>HH:mm:ss</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="short">
						<timeFormat>
							<pattern>HH:mm</pattern>
						</timeFormat>
					</timeFormatLength>
				</timeFormats>
				<dateTimeFormats>
					<availableFormats>
						<dateFormatItem id="M">M</dateFormatItem>
						<dateFormatItem id="Md">d/M</dateFormatItem>
						<dateFormatItem id="MMd">d/MM</dateFormatItem>
						<dateFormatItem id="MMdd">dd/MM</dateFormatItem>
						<dateFormatItem id="MMM">MMM</dateFormatItem>
						<dateFormatItem id="MMMd">d MMM</dateFormatItem>
						<dateFormatItem id="MMMEd">E d MMM</dateFormatItem>
						<dateFormatItem id="MMMMd">d MMMM</dateFormatItem>
						<dateFormatItem id="MMMMEd">E d MMMM</dateFormatItem>
						<dateFormatItem id="ms">m:ss</dateFormatItem>
						<dateFormatItem id="y">y</dateFormatItem>
						<dateFormatItem id="yM">M/y</dateFormatItem>
						<dateFormatItem id="yMEd">E d/M/y</dateFormatItem>
						<dateFormatItem id="yMM">MM/y</dateFormatItem>
						<dateFormatItem id="yMMM">MMM y</dateFormatItem>
						<dateFormatItem id="yMMMd">d MMM y</dateFormatItem>
						<dateFormatItem id="yMMMEd">E d MMM y</dateFormatItem>
						<dateFormatItem id="yMMMM">MMMM y</dateFormatItem>
						<dateFormatItem id="yQQQ">QQQ y</dateFormatItem>
						<dateFormatItem id="yQQQQ">QQQQ y</dateFormatItem>
					</availableFormats>
				</dateTimeFormats>
			</calendar>
		</calendars>
		<fields>
			<field type="era">
				<displayName>Tallit</displayName>
			</field>
			<field type="year">
				<displayName>Aseggas</displayName>
			</field>
			<field type="month">
				<displayName>Aggur</displayName>
			</field>
			<field type="week">
				<displayName>Ddurt</displayName>
			</field>
			<field type="day">
				<displayName>Ass</displayName>
				<relative type="-1">Iḍelli</relative>
				<relative type="0">Ass-a</relative>
				<relative type="1">Azekka</relative>
			</field>
			<field type="weekday">
				<displayName>Ussan n ddurt</displayName>
			</field>
			<field type="dayperiod">
				<displayName>n tufat / n tmeddit</displayName>
			</field>
			<field type="hour">
				<displayName>Tamert</displayName>
			</field>
			<field type="minute">
				<displayName>Tamrect</displayName>
			</field>
			<field type="second">
				<displayName>Tasint</displayName>
			</field>
			<field type="zone">
				<displayName>Aseglem asergan</displayName>
			</field>
		</fields>
	</dates>
	<numbers>
		<symbols numberSystem="latn">
			<decimal>,</decimal>
			<group> </group>
		</symbols>
		<currencyFormats numberSystem="latn">
			<currencyFormatLength>
				<currencyFormat type="standard">
					<pattern>#,##0.00¤</pattern>
				</currencyFormat>
			</currencyFormatLength>
		</currencyFormats>
		<currencies>
			<currency type="AED">
				<displayName>Adirham n Tgeldunin Taɛrabin Yedduklen</displayName>
			</currency>
			<currency type="AOA">
				<displayName>Akwanza n Ungula</displayName>
			</currency>
			<currency type="AUD">
				<displayName>Adular n Lusṭrali</displayName>
			</currency>
			<currency type="BHD">
				<displayName>Adinar Abaḥrini</displayName>
			</currency>
			<currency type="BIF">
				<displayName>Afrank Aburandi</displayName>
			</currency>
			<currency type="BWP">
				<displayName>Apula Abusṭwanan</displayName>
			</currency>
			<currency type="CAD">
				<displayName>Adular Akanadi</displayName>
			</currency>
			<currency type="CDF">
				<displayName>Afrank Akunguli</displayName>
			</currency>
			<currency type="CHF">
				<displayName>Afrank Aswis</displayName>
			</currency>
			<currency type="CNY">
				<displayName>Ayuwan Renminbi Acinwa</displayName>
			</currency>
			<currency type="CVE">
				<displayName>Akabuviradinu Askudi</displayName>
			</currency>
			<currency type="DJF">
				<displayName>Afrank Ajibuti</displayName>
			</currency>
			<currency type="DZD">
				<displayName>Adinar Azzayri</displayName>
				<symbol>DA</symbol>
			</currency>
			<currency type="EGP">
				<displayName>Apund Amaṣri</displayName>
			</currency>
			<currency type="ERN">
				<displayName>Anakfa Iritiri</displayName>
			</currency>
			<currency type="ETB">
				<displayName>Abir Utyupi</displayName>
			</currency>
			<currency type="EUR">
				<displayName>Uru</displayName>
			</currency>
			<currency type="GBP">
				<displayName>Apund Sterling Aglizi</displayName>
			</currency>
			<currency type="GHC">
				<displayName>Asidi Aɣani</displayName>
			</currency>
			<currency type="GMD">
				<displayName>Adalasi Agambi</displayName>
			</currency>
			<currency type="GNS">
				<displayName>Afrank Aɣini</displayName>
			</currency>
			<currency type="INR">
				<displayName>Arupi Ahendi</displayName>
			</currency>
			<currency type="JPY">
				<displayName>Ayen Ajappuni</displayName>
			</currency>
			<currency type="KES">
				<displayName>Aciling Akini</displayName>
			</currency>
			<currency type="KMF">
				<displayName>Afrank Akamiruni</displayName>
			</currency>
			<currency type="LRD">
				<displayName>Adular Alibiri</displayName>
			</currency>
			<currency type="LSL">
				<displayName>Aluṭi Alizuṭi</displayName>
			</currency>
			<currency type="LYD">
				<displayName>Adinar Alibi</displayName>
			</currency>
			<currency type="MAD">
				<displayName>Adirham Amerruki</displayName>
			</currency>
			<currency type="MGA">
				<displayName>Aryari Amalgac</displayName>
			</currency>
			<currency type="MRO">
				<displayName>Agiya Amuriṭani</displayName>
			</currency>
			<currency type="MUR">
				<displayName>Arupi Amurisi</displayName>
			</currency>
			<currency type="MWK">
				<displayName>Akwaca Amalawi</displayName>
			</currency>
			<currency type="MZM">
				<displayName>Amitikal Amuzembiqi</displayName>
			</currency>
			<currency type="NAD">
				<displayName>Adular Anamibi</displayName>
			</currency>
			<currency type="NGN">
				<displayName>Anayra Anijiri</displayName>
			</currency>
			<currency type="RWF">
				<displayName>Afrank Aruwandi</displayName>
			</currency>
			<currency type="SAR">
				<displayName>Aryal Asuɛudi</displayName>
			</currency>
			<currency type="SCR">
				<displayName>Arupi Aseycili</displayName>
			</currency>
			<currency type="SDG">
				<displayName>Apund Asudani</displayName>
			</currency>
			<currency type="SHP">
				<displayName>Apund Asant Ilini</displayName>
			</currency>
			<currency type="SLL">
				<displayName>Alyun</displayName>
			</currency>
			<currency type="SOS">
				<displayName>Aciling Aṣumali</displayName>
			</currency>
			<currency type="STD">
				<displayName>Asw Ṭum d Udubra Amenzay</displayName>
			</currency>
			<currency type="SZL">
				<displayName>Alilangini</displayName>
			</currency>
			<currency type="TND">
				<displayName>Adinar Atunsi</displayName>
			</currency>
			<currency type="TZS">
				<displayName>Aciling Aṭanẓani</displayName>
			</currency>
			<currency type="UGX">
				<displayName>Aciling Awgandi</displayName>
			</currency>
			<currency type="USD">
				<displayName>Adular WD</displayName>
			</currency>
			<currency type="XAF">
				<displayName>Afrank BCEA CFA</displayName>
			</currency>
			<currency type="XOF">
				<displayName>Afrank BCEAO CFA</displayName>
			</currency>
			<currency type="ZAR">
				<displayName>Arand Afriqi n Wadda</displayName>
			</currency>
			<currency type="ZMK">
				<displayName>Akwaca Azambi (1968–2012)</displayName>
			</currency>
			<currency type="ZMW">
				<displayName>Akwaca Azambi</displayName>
			</currency>
			<currency type="ZWD">
				<displayName>Adular Azimbabwi</displayName>
			</currency>
		</currencies>
	</numbers>
	<posix>
		<messages>
			<yesstr>Ih:I</yesstr>
			<nostr>Uhu:U</nostr>
		</messages>
	</posix>
</ldml>


text:
suite('rb/models/ReviewRequestEditor', function() {
    let reviewRequest;
    let editor;

    beforeEach(function() {
        reviewRequest = new RB.ReviewRequest({
            id: 1,
        });

        editor = new RB.ReviewRequestEditor({
            reviewRequest: reviewRequest,
        });
    });

    describe('Methods', function() {
        describe('createFileAttachment', function() {
            it('With new FileAttachment', function() {
                const fileAttachments = editor.get('fileAttachments');

                expect(fileAttachments.length).toBe(0);

                const fileAttachment = editor.createFileAttachment();
                expect(fileAttachments.length).toBe(1);

                expect(fileAttachments.at(0)).toBe(fileAttachment);
            });
        });

        describe('decr', function() {
            it('With integer attribute', function() {
                editor.set('myint', 1);

                editor.decr('myint');
                expect(editor.get('myint')).toBe(0);
            });

            it('With non-integer attribute', function() {
                editor.set('foo', 'abc');

                expect(() => editor.decr('foo')).toThrow();

                expect(console.assert).toHaveBeenCalled();
                expect(console.assert.calls.mostRecent().args[0]).toBe(false);
                expect(editor.get('foo')).toBe('abc');
            });

            describe('editCount', function() {
                it('When > 0', function() {
                    editor.set('editCount', 1);

                    editor.decr('editCount');
                    expect(editor.get('editCount')).toBe(0);
                    expect(editor.validationError).toBe(null);
                });

                it('When 0', function() {
                    editor.set('editCount', 0);

                    editor.decr('editCount');
                    expect(editor.get('editCount')).toBe(0);
                    expect(editor.validationError).toBe(
                        RB.ReviewRequestEditor.strings.UNBALANCED_EDIT_COUNT);
                });
            });
        });

        describe('incr', function() {
            it('With integer attribute', function() {
                editor.set('myint', 0);
                editor.incr('myint');
                expect(editor.get('myint')).toBe(1);
            });

            it('With non-integer attribute', function() {
                editor.set('foo', 'abc');

                expect(() => editor.incr('foo')).toThrow();

                expect(console.assert).toHaveBeenCalled();
                expect(console.assert.calls.mostRecent().args[0]).toBe(false);
                expect(editor.get('foo')).toBe('abc');
            });
        });

        describe('getDraftField', function() {
            it('For closeDescription', function() {
                reviewRequest.set('closeDescription', 'Test');

                const value = editor.getDraftField('closeDescription');
                expect(value).toBe('Test');
            });

            it('For closeDescriptionRichText', function() {
                reviewRequest.set('closeDescriptionRichText', true);

                const value = editor.getDraftField('closeDescriptionRichText');
                expect(value).toBe(true);
            });

            it('For draft fields', function() {
                reviewRequest.draft.set('description', 'Test');

                const value = editor.getDraftField('description');
                expect(value).toBe('Test');
            });

            it('With useExtraData', function() {
                const extraData = reviewRequest.draft.get('extraData');

                extraData.foo = '**Test**';

                const value = editor.getDraftField('foo', {
                    useExtraData: true
                });
                expect(value).toBe('**Test**');
            });

            describe('With useExtraData and useRawTextValue', function() {
                it('With field in rawTextFields', function() {
                    const draft = reviewRequest.draft;
                    const extraData = reviewRequest.draft.get('extraData');

                    extraData.foo = 'Test';
                    draft.set('rawTextFields', {
                        extra_data: {
                            foo: '**Test**',
                        },
                    });

                    const value = editor.getDraftField('foo', {
                        useExtraData: true,
                        useRawTextValue: true,
                    });
                    expect(value).toBe('**Test**');
                });

                it('With field not in rawTextFields', function() {
                    const extraData = reviewRequest.draft.get('extraData');

                    extraData.foo = 'Test';

                    const value = editor.getDraftField('foo', {
                        useExtraData: true,
                        useRawTextValue: true,
                    });
                    expect(value).toBe('Test');
                });
            });
        });

        describe('setDraftField', function() {
            let draft;

            beforeEach(function() {
                draft = editor.get('reviewRequest').draft;
            });

            describe('When publishing', function() {
                beforeEach(function() {
                    spyOn(editor, 'publishDraft');

                    editor.set({
                        publishing: true,
                        pendingSaveCount: 1,
                    });
                });

                it('Successful saves', async function() {
                    spyOn(draft, 'save').and.resolveTo();

                    await editor.setDraftField(
                        'summary', 'My Summary', { jsonFieldName: 'summary' });

                    expect(editor.get('publishing')).toBe(false);
                    expect(editor.get('pendingSaveCount')).toBe(0);
                    expect(editor.publishDraft).toHaveBeenCalled();
                });

                it('Field set errors', async function() {
                    spyOn(draft, 'save').and.rejectWith(new BackboneError(
                        draft,
                        {
                            errorPayload: {
                                fields: {
                                    summary: ['Something went wrong'],
                                },
                            },
                        },
                        {}));

                    await expectAsync(
                        editor.setDraftField('summary', 'My Summary',
                                             { jsonFieldName: 'summary' }))
                        .toBeRejectedWith(Error('"Something went wrong"'));

                    expect(editor.get('publishing')).toBe(false);
                    expect(editor.get('pendingSaveCount')).toBe(1);
                    expect(editor.publishDraft).not.toHaveBeenCalled();
                });

                it('With callbacks', function(done) {
                    spyOn(draft, 'save').and.resolveTo();
                    spyOn(console, 'warn');

                    editor.setDraftField('summary', 'My Summary', {
                        jsonFieldName: 'summary',
                        success: () => {
                            expect(editor.get('publishing')).toBe(false);
                            expect(editor.get('pendingSaveCount')).toBe(0);
                            expect(editor.publishDraft).toHaveBeenCalled();
                            expect(console.warn).toHaveBeenCalled();

                            done();
                        },
                        error: () => done.fail(),
                    });
                });
            });

            describe('Rich text fields', function() {
                describe('changeDescription', function() {
                    describe('Draft description', function() {
                        async function testDraftDescription(richText, textType) {
                            spyOn(reviewRequest, 'close');
                            spyOn(reviewRequest.draft, 'save').and.resolveTo();

                            await editor.setDraftField(
                                'changeDescription',
                                'My description',
                                {
                                    allowMarkdown: true,
                                    fieldID: 'changedescription',
                                    richText: richText,
                                    jsonFieldName: 'changedescription',
                                    jsonTextTypeFieldName:
                                        'changedescription_text_type'
                                });

                            expect(reviewRequest.close).not.toHaveBeenCalled();
                            expect(reviewRequest.draft.save).toHaveBeenCalled();
                            expect(
                                reviewRequest.draft.save.calls.argsFor(0)[0].data
                            ).toEqual({
                                changedescription_text_type: textType,
                                changedescription: 'My description',
                                force_text_type: 'html',
                                include_text_types: 'raw'
                            });
                        }

                        it('For Markdown', async function() {
                            await testDraftDescription(true, 'markdown');
                        });

                        it('For plain text', async function() {
                            await testDraftDescription(false, 'plain');
                        });
                    });
                });
            });

            describe('Special list fields', function() {
                describe('targetGroups', function() {
                    it('Empty', async function() {
                        spyOn(draft, 'save').and.resolveTo();

                        await editor.setDraftField(
                            'targetGroups', '', { jsonFieldName: 'target_groups' });

                        expect(draft.save).toHaveBeenCalled();
                    });

                    it('With values', async function() {
                        spyOn(draft, 'save').and.resolveTo();

                        await editor.setDraftField(
                            'targetGroups', 'group1, group2',
                            { jsonFieldName: 'target_groups' });

                        expect(draft.save).toHaveBeenCalled();
                    });

                    it('With invalid groups', async function() {
                        spyOn(draft, 'save').and.rejectWith(new BackboneError(
                            draft,
                            {
                                errorPayload: {
                                    fields: {
                                        target_groups: ['group1', 'group2'],
                                    },
                                },
                            },
                            {}));

                        await expectAsync(
                            editor.setDraftField('targetGroups', 'group1, group2',
                                                 { jsonFieldName: 'target_groups' }))
                            .toBeRejectedWith(Error(
                                'Groups "group1" and "group2" do not exist.'));
                    });
                });

                describe('targetPeople', function() {
                    it('Empty', async function() {
                        spyOn(draft, 'save').and.resolveTo();

                        await editor.setDraftField(
                            'targetPeople', '', { jsonFieldName: 'target_people' });

                        expect(draft.save).toHaveBeenCalled();
                    });

                    it('With values', async function() {
                        spyOn(draft, 'save').and.resolveTo();

                        await editor.setDraftField(
                            'targetPeople', 'user1, user2',
                            { jsonFieldName: 'target_people' });

                        expect(draft.save).toHaveBeenCalled();
                    });

                    it('With invalid users', async function() {
                        spyOn(draft, 'save').and.rejectWith(new BackboneError(
                            draft,
                            {
                                errorPayload: {
                                    fields: {
                                        target_people: ['user1', 'user2'],
                                    },
                                },
                            },
                            {}));

                        await expectAsync(
                            editor.setDraftField('targetPeople', 'user1, user2',
                                                 { jsonFieldName: 'target_people' }))
                            .toBeRejectedWith(
                                Error('Users "user1" and "user2" do not exist.'));
                    });
                });

                describe('submitter', function() {
                    it('Empty', async function() {
                        spyOn(draft, 'save').and.resolveTo();

                        await editor.setDraftField(
                            'submitter', '', { jsonFieldName: 'submitter' });

                        expect(draft.save).toHaveBeenCalled();
                    });

                    it('With value', async function() {
                        spyOn(draft, 'save').and.resolveTo();

                        await editor.setDraftField(
                            'submitter', 'user1', { jsonFieldName: 'submitter' });

                        expect(draft.save).toHaveBeenCalled();
                    });

                    it('With invalid user', async function() {
                        spyOn(draft, 'save').and.rejectWith(new BackboneError(
                            draft,
                            {
                                errorPayload: {
                                    fields: {
                                        submitter: ['user1'],
                                    },
                                },
                            },
                            {}));

                        await expectAsync(
                            editor.setDraftField('submitter', 'user1',
                                                 { jsonFieldName: 'submitter' }))
                            .toBeRejectedWith(Error('User "user1" does not exist.'));
                    });
                });
            });

            describe('Custom fields', function() {
                describe('Rich text fields', function() {
                    async function testFields(richText, textType) {
                        spyOn(reviewRequest.draft, 'save').and.resolveTo();

                        await editor.setDraftField(
                            'myField',
                            'Test text.',
                            {
                                allowMarkdown: true,
                                useExtraData: true,
                                fieldID: 'myfield',
                                richText: richText,
                                jsonFieldName: 'myfield',
                                jsonTextTypeFieldName:
                                    'myfield_text_type'
                            });

                        expect(reviewRequest.draft.save).toHaveBeenCalled();
                        expect(
                            reviewRequest.draft.save.calls.argsFor(0)[0].data
                        ).toEqual({
                            'extra_data.myfield_text_type': textType,
                            'extra_data.myfield': 'Test text.',
                            force_text_type: 'html',
                            include_text_types: 'raw'
                        });
                    }

                    it('For Markdown', async function() {
                        await testFields(true, 'markdown');
                    });

                    it('For plain text', async function() {
                        await testFields(false, 'plain');
                    });
                });
            });
        });
    });

    describe('Reviewed objects', function() {
        describe('File attachments', function() {
            it('Removed when destroyed', async function() {
                const fileAttachments = editor.get('fileAttachments');
                const fileAttachment = editor.createFileAttachment();
                const draft = editor.get('reviewRequest').draft;

                spyOn(draft, 'ensureCreated').and.resolveTo();

                expect(fileAttachments.at(0)).toBe(fileAttachment);

                await fileAttachment.destroy();
                expect(fileAttachments.length).toBe(0);
            });
        });

        describe('Screenshots', function() {
            it('Removed when destroyed', async function() {
                const screenshots = editor.get('screenshots');
                const screenshot = reviewRequest.createScreenshot();

                screenshots.add(screenshot);
                expect(screenshots.at(0)).toBe(screenshot);

                await screenshot.destroy();
                expect(screenshots.length).toBe(0);
            });
        });
    });

    describe('Events', function() {
        describe('saved', function() {
            it('When new file attachment saved', function() {
                const fileAttachment = editor.createFileAttachment();

                spyOn(editor, 'trigger');
                fileAttachment.trigger('saved');

                expect(editor.trigger).toHaveBeenCalledWith('saved');
            });

            it('When new file attachment destroyed', async function() {
                const fileAttachment = editor.createFileAttachment();
                const draft = editor.get('reviewRequest').draft;

                spyOn(draft, 'ensureCreated').and.resolveTo();

                spyOn(editor, 'trigger');

                await fileAttachment.destroy();
                expect(editor.trigger).toHaveBeenCalledWith('saved');
            });

            it('When existing file attachment saved', function() {
                const fileAttachment =
                    reviewRequest.draft.createFileAttachment();

                editor = new RB.ReviewRequestEditor({
                    reviewRequest: reviewRequest,
                    fileAttachments: new Backbone.Collection(
                        [fileAttachment])
                });

                spyOn(editor, 'trigger');
                fileAttachment.trigger('saved');

                expect(editor.trigger).toHaveBeenCalledWith('saved');
            });

            it('When existing file attachment destroyed', async function() {
                const fileAttachment =
                    reviewRequest.draft.createFileAttachment();

                editor = new RB.ReviewRequestEditor({
                    reviewRequest: reviewRequest,
                    fileAttachments: new Backbone.Collection(
                        [fileAttachment])
                });

                spyOn(reviewRequest.draft, 'ensureCreated').and.resolveTo();

                spyOn(editor, 'trigger');

                await fileAttachment.destroy();
                expect(editor.trigger).toHaveBeenCalledWith('saved');
            });

            it('When existing screenshot saved', function() {
                const screenshot = reviewRequest.createScreenshot();

                editor = new RB.ReviewRequestEditor({
                    reviewRequest: reviewRequest,
                    screenshots: new Backbone.Collection([screenshot])
                });

                spyOn(editor, 'trigger');
                screenshot.trigger('saved');

                expect(editor.trigger).toHaveBeenCalledWith('saved');
            });

            it('When existing screenshot destroyed', async function() {
                const screenshot = reviewRequest.createScreenshot();

                editor = new RB.ReviewRequestEditor({
                    reviewRequest: reviewRequest,
                    screenshots: new Backbone.Collection([screenshot])
                });

                spyOn(reviewRequest.draft, 'ensureCreated').and.resolveTo();

                spyOn(editor, 'trigger');

                await screenshot.destroy();
                expect(editor.trigger).toHaveBeenCalledWith('saved');
            });
        });

        describe('saving', function() {
            it('When new file attachment saving', function() {
                const fileAttachment = editor.createFileAttachment();

                spyOn(editor, 'trigger');
                fileAttachment.trigger('saving');

                expect(editor.trigger).toHaveBeenCalledWith('saving');
            });

            it('When existing file attachment saving', function() {
                const fileAttachment =
                    reviewRequest.draft.createFileAttachment();

                editor = new RB.ReviewRequestEditor({
                    reviewRequest: reviewRequest,
                    fileAttachments: new Backbone.Collection(
                        [fileAttachment])
                });

                spyOn(editor, 'trigger');
                fileAttachment.trigger('saving');

                expect(editor.trigger).toHaveBeenCalledWith('saving');
            });

            it('When screenshot saving', function() {
                const screenshot = reviewRequest.createScreenshot();

                editor = new RB.ReviewRequestEditor({
                    reviewRequest: reviewRequest,
                    screenshots: new Backbone.Collection([screenshot])
                });

                spyOn(editor, 'trigger');
                screenshot.trigger('saving');

                expect(editor.trigger).toHaveBeenCalledWith('saving');
            });
        });
    });
});


text:
package poki

//go:generate protoc -I=$GOPATH/src/github.com/pokstad/poki/pb --go_out=plugins=grpc:$GOPATH/src $GOPATH/src/github.com/pokstad/poki/pb/poki.proto


text:
<!DOCTYPE html>

The aside tag defines some content aside from the content it is placed in.

Aside tag

The aside content should be related to the surrounding content.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>OpenWeatherMap: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

OpenWeatherMap

Main Page

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

 All Classes Functions Properties

OWMAPIService Member List

This is the complete list of members for OWMAPIService, including all inherited members.

	apiLanguage	OWMAPIService

	appId	OWMAPIService

	hostApiPath	OWMAPIService

- 	htmlStringWithDailyWeatherByGeographicCoordinats:	OWMAPIService

- 	searchCitiesByCoordinatsLeftTop:rightBottom:andZoomMap:withCompletion:	OWMAPIService

- 	searchCityByName:withCompletion:	OWMAPIService

- 	searchForecastDailyForCityByName:forDays:withCompletion:	OWMAPIService

- 	searchForecastForCityByName:withCompletion:	OWMAPIService

- 	searchWeatherCityByGeographicCoordinats:withCompletion:	OWMAPIService

- 	searchWeatherCityByName:withCompletion:	OWMAPIService

+ 	sharedInstance (defined in OWMAPIService)	OWMAPIService	static

	unitType	OWMAPIService

- 	urlWithCloudsWeather	OWMAPIService

- 	urlWithQuantityWeather	OWMAPIService

- 	urlWithSeaLevelWeather	OWMAPIService

- 	urlWithSnowWeather	OWMAPIService

- 	urlWithTemperatureWeather	OWMAPIService

- 	urlWithWeather	OWMAPIService

- 	urlWithWeatherAndStations	OWMAPIService

- 	urlWithWindWeather	OWMAPIService

<address class="footer">
Generated on Sat Mar 7 2015 15:59:37 for OpenWeatherMap by

 1.8.7
</address>


text:
**learnpython**

Exercises from the 3rd Edition of the Learn Python The Hard Way book.

http://learnpythonthehardway.org/book/


text:
<?php

namespace Rubel\Exceptions;

use Exception;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Auth\AuthException;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;

class Handler extends ExceptionHandler
{
    /**
     * A list of the exception types that should not be reported.
     *
     * @var array
     */
    protected $dontReport = [
        \Illuminate\Auth\AuthenticationException::class,
        \Illuminate\Auth\Access\AuthorizationException::class,
        \Symfony\Component\HttpKernel\Exception\HttpException::class,
        \Illuminate\Database\Eloquent\ModelNotFoundException::class,
        \Illuminate\Session\TokenMismatchException::class,
        \Illuminate\Validation\ValidationException::class,
    ];

    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param  Exception  $exception
     * @return void
     */
    public function report(Exception $exception)
    {
        parent::report($exception);
    }

    /**
     * Render an exception into an HTTP response.
     *
     * @param  Request  $request
     * @param  Exception  $exception
     * @return Response
     */
    public function render($request, Exception $exception)
    {
        return parent::render($request, $exception);
    }

    /**
     * Convert an authentication exception into an unauthenticated response.
     *
     * @param  Request  $request
     * @param  AuthenticationException  $exception
     * @return Response
     */
    protected function unauthenticated($request, AuthenticationException $exception)
    {
        if ($request->expectsJson()) {
            return response()->json(['error' => 'Unauthenticated.'], Response::HTTP_UNAUTHORIZED);
        }

        return redirect()->guest('/');
    }

    /**
     * Override default method - render the given HttpException.
     *
     * @param  HttpException  $e
     * @return Response
     */
    protected function renderHttpException(HttpException $e)
    {
        $status = $e->getStatusCode();
        $errorMessages = $this->handleErrorMessages($status);

        return response()->view(get_the_view_path('errors.index'), ['errorMessages' => $errorMessages], $status);
    }

    /**
     * Handle error messages.
     *
     * @param  int $status
     * @return string
     */
    private function handleErrorMessages($status)
    {
        $errorMessages['status'] = $status;

        switch ($status) {
            case Response::HTTP_UNAUTHORIZED:
                return $errorMessages['message'] = 'Unauthorized';
                break;

            case Response::HTTP_FORBIDDEN:
                return $errorMessages['message'] = 'forbidden';
                break;

            case Response::HTTP_NOT_FOUND:
                $errorMessages['message'] = 'Not Found';
                break;

            case Response::HTTP_INTERNAL_SERVER_ERROR:
                $errorMessages['message'] = 'Internal Server Error';
                break;

            case Response::HTTP_SERVICE_UNAVAILABLE:
                $errorMessages['message'] = 'Service Unavailable';
                break;
        }

        return $errorMessages;
    }
}


text:
namespace SkidiKit.Core.NodeAction.Common
{
    public class ActionSpeed: NodeAction
    {
        public float Speed { get; }
        protected internal NodeAction InnerAction { get; }

        public ActionSpeed(FinateTimeAction action, float speed)
        {
            InnerAction = action;
            Speed = speed;
        }

        public override NodeActionState StartAction(Drawable target)
        {
            return new ActionSpeedState(target, this);
        }
    }

    internal class ActionSpeedState : NodeActionState
    {
        private float Speed { get; }
        private NodeActionState InnerActionState { get; }

        public ActionSpeedState(Drawable target, ActionSpeed action) : base(target, action)
        {
            Speed = action.Speed;
            InnerActionState = action.InnerAction.StartAction(target);
        }

        public override void Stop()
        {
            InnerActionState?.Stop();
            base.Stop();
        }

        public override void Step(float dt)
        {
            InnerActionState.Step(dt * Speed);
        }
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Diatrype aethiops Cooke & Ellis, 1877

### Remarks
null


text:
package com.ikanow.aleph2.data_model.interfaces.data_access.samples;

import java.util.Collection;
import java.util.Optional;

import com.google.inject.Inject;
import com.ikanow.aleph2.data_model.objects.shared.GlobalPropertiesBean;

public class SampleCustomServiceThree implements ICustomService {

	public GlobalPropertiesBean _globals;

	@Inject
	public SampleCustomServiceThree(GlobalPropertiesBean globals) {
		this._globals = globals;
	}

	@Override
	public Collection<Object> getUnderlyingArtefacts() {
		return null;
	}

	@Override
	public <T> Optional<T> getUnderlyingPlatformDriver(Class<T> driver_class,
			Optional<String> driver_options) {
		return null;
	}

}


text:
package org.sagebionetworks.web.client.widget.entity.controller;

import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;

/**
 * Abstraction for the view
 *
 */
public interface SynapseAlertView extends IsWidget {
  /**
   * Clears all state in the view (makes all components invisible).
   */
  void clearState();

  /**
   * Show the error in an alert.
   *
   * @param error
   */
  void showError(String error);

  /**
   * Show a special login alert, that includes a link to the login page.
   */
  void showLogin();

  void reload();

  void setRetryButtonVisible(boolean visible);
}


text:
<?php

require_once "lib/common.php";
require_once "lib/session.php";
require_once "lib/render.php";

require_once "lib/render/login.php";
require_once "lib/render/idpage.php";
require_once "lib/render/idpXrds.php";
require_once "lib/render/userXrds.php";

require_once "Auth/OpenID.php";

/**
 * Handle a standard OpenID server request
 */
function action_default()
{
    header('X-XRDS-Location: '.buildURL('idpXrds'));

    $server =& getServer();
    $method = $_SERVER['REQUEST_METHOD'];
    $request = null;
    if ($method == 'GET') {
        $request = $_GET;
    } else {
        $request = $_POST;
    }

    $request = $server->decodeRequest();

    if (!$request) {
        return about_render();
    }

    setRequestInfo($request);

    if (in_array($request->mode,
                 array('checkid_immediate', 'checkid_setup'))) {

        if ($request->idSelect()) {
            // Perform IDP-driven identifier selection
            if ($request->mode == 'checkid_immediate') {
                $response =& $request->answer(false);
            } else {
                return trust_render($request);
            }
        } else if ((!$request->identity) &&
                   (!$request->idSelect())) {
            // No identifier used or desired; display a page saying
            // so.
            return noIdentifier_render();
        } else if ($request->immediate) {
            $response =& $request->answer(false, buildURL());
        } else {
            if (!getLoggedInUser()) {
                return login_render();
            }
            return trust_render($request);
        }
    } else {
        $response =& $server->handleRequest($request);
    }

    $webresponse =& $server->encodeResponse($response);

    if ($webresponse->code != AUTH_OPENID_HTTP_OK) {
        header(sprintf("HTTP/1.1 %d ", $webresponse->code),
               true, $webresponse->code);
    }

    foreach ($webresponse->headers as $k => $v) {
        header("$k: $v");
    }

    header(header_connection_close);
    print $webresponse->body;
    exit(0);
}

/**
 * Log out the currently logged in user
 */
function action_logout()
{
    setLoggedInUser(null);
    setRequestInfo(null);
    return authCancel(null);
}

/**
 * Check the input values for a login request
 */
function login_checkInput($input)
{
    $openid_url = false;
    $errors = array();

    if (!isset($input['openid_url'])) {
        $errors[] = 'Enter an OpenID URL to continue';
    }
    if (count($errors) == 0) {
        $openid_url = $input['openid_url'];
    }
    return array($errors, $openid_url);
}

/**
 * Log in a user and potentially continue the requested identity approval
 */
function action_login()
{
    $method = $_SERVER['REQUEST_METHOD'];
    switch ($method) {
    case 'GET':
        return login_render();
    case 'POST':
        $info = getRequestInfo();
        $fields = $_POST;
        if (isset($fields['cancel'])) {
            return authCancel($info);
        }

        list ($errors, $openid_url) = login_checkInput($fields);
        if (count($errors) || !$openid_url) {
            $needed = $info ? $info->identity : false;
            return login_render($errors, @$fields['openid_url'], $needed);
        } else {
            setLoggedInUser($openid_url);
            return doAuth($info);
        }
    default:
        return login_render(array('Unsupported HTTP method: $method'));
    }
}

/**
 * Ask the user whether he wants to trust this site
 */
function action_trust()
{
    $info = getRequestInfo();
    $trusted = isset($_POST['trust']);
    return doAuth($info, $trusted, true, @$_POST['idSelect']);
}

function action_idpage()
{
    $identity = $_GET['user'];
    return idpage_render($identity);
}

function action_idpXrds()
{
    return idpXrds_render();
}

function action_userXrds()
{
    $identity = $_GET['user'];
    return userXrds_render($identity);
}

?>


text:
( function ( $, WL ) {
	var MediaWiki = function () {};
	MediaWiki.prototype.initialize = function ( host ) {
		var deferred = $.Deferred();
		this.host = host;

		WL.api.getSiteInfo()
			.done( function ( doc ) {
				this.initializeFromDoc( doc );
				deferred.resolve( this );
			}.bind( this ) )
			.fail( function ( doc ) {
				deferred.reject( doc );
			} );

		return deferred.promise();
	};
	MediaWiki.prototype.initializeFromDoc = function ( doc ) {
		var fallback, i;
		this.dbname = doc.wikiid;
		this.lang = doc.lang;
		this.fallbackChain = [ doc.lang ];
		for ( i = 0; i < doc.fallback.length; i++ ) {
			fallback = doc.fallback[ i ];
			this.fallbackChain.push( fallback.code );
		}

		this.articlepath = doc.articlepath;
		this.script = doc.script;
		this.rtl = doc.rtl;
	};
	MediaWiki.prototype.urlToTitle = function ( title ) {
		return '//' + this.host + this.articlepath.replace( '$1', title );
	};
	MediaWiki.prototype.urlToDiff = function ( revId ) {
		return '//' + this.host + this.script + '?diff=' + revId;
	};
	MediaWiki.prototype.reBaseUrl = function ( relativeUrl ) {
		return String( new URL( relativeUrl, 'https://' + this.host ) );
	};
	MediaWiki.prototype.reBaseRelativeAnchors = function ( i, node ) {
		var href = node.getAttribute( 'href' );
		if ( !WL.ABS_URL_PREFIX.test( href ) ) {
			node.setAttribute( 'href', WL.mediawiki.reBaseUrl( href ) );
		}
	};

	WL.mediawiki = new MediaWiki();
}( jQuery, wikiLabels ) );


text:
import React from 'react';
import { findDOMNode } from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';
import Column from '../src/Column';

describe('Column', () => {
  it('Should output a null', () => {
    const instance = ReactTestUtils.renderIntoDocument(<Column />);

    const instanceDom = findDOMNode(instance);
    assert.equal(instanceDom, null);
  });
});


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycologia 67(6): 1214 (1976)

#### Original name
Syamithabeeja girisa Subram. & Natarajan, 1976

### Remarks
null