text
stringlengths 2
1.04M
| meta
dict |
---|---|
body { font: 14pt helvetica; width: 100%; -webkit-text-size-adjust: 100%; margin: 0; padding: 0; height: 100%; width: 100%;}
#cytoscape, #cytoscape2 { border: 1px solid #888; height: 450px; background: #fff; width: 600px; max-width: 100%; max-height: 50%; }
#commands { z-index: 2; position: absolute; right: 0; top: 0; padding: 0.25em; font-size: 0.75em; line-height: 1; background: #f5f5f5; border-radius: 0.333em; }
#commands h2 { margin-top: 1em; font-size: 1.25em; }
label { position: absolute; margin-top: -0.25em; font-size: 0.65em; margin-left: 0.5em; background: #fff; }
#nodes-number, #edges-number, #parent-node { width: 5em; }
.ui-tooltip { font-size: 0.75em; max-width: 400px; }
#string-stylesheet { display: block; min-height: 7em; }
#hide-commands { position: absolute; right: 0; top: 0; }
#commands-show-area { z-index: 2; position: absolute; right: 0; top: 0; font-size: 0.75em; }
#show-commands { }
#bb { position: absolute; left: 0; top: 0; background: rgba(0, 255, 255, 0.333); z-index: 999999999; pointer-events: none; }
#note { z-index: 999999; cursor: pointer; display: none; position: fixed; right: 0; top: 0; margin: 1em; padding: 1em; width: 15em; background: rgba(0,0,0,0.8); color: #fff; border-radius: 1em; font-size: 0.8em; }
#note-descr { margin-top: 0.5em; font-size: 0.8em; }
#cytoscape.full { z-index: 1; position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; }
@media screen and ( max-width: 889px ){
#commands { display: none; }
}
| {
"content_hash": "c7c9f9105ee509d5d83bc6e56472de99",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 213,
"avg_line_length": 79.6842105263158,
"alnum_prop": 0.6723910171730515,
"repo_name": "rlugojr/cytoscape.js",
"id": "f1c81a0cfbdfc64b25fb04e364a67b233165263d",
"size": "1514",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "debug/style.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5756"
},
{
"name": "HTML",
"bytes": "13896"
},
{
"name": "JavaScript",
"bytes": "2300943"
}
],
"symlink_target": ""
} |
#pragma once
#include "ofxObject.h"
class ofxRectangleObject : public ofxObject
{
public:
ofxRectangleObject(float iW, float iH);
~ofxRectangleObject();
void render();
void setCentered(bool iB);
public:
ofVec2f dimensions;
bool isCentered;
bool isFilled;
float strokeAlpha, fillAlpha;
};
| {
"content_hash": "d9b78dcc2cf855d6d79ee0518992a967",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 43,
"avg_line_length": 15.695652173913043,
"alnum_prop": 0.6260387811634349,
"repo_name": "sosolimited/ofxSoso",
"id": "5024b45e2c417a1152b81bda9bad53c74ce8368e",
"size": "1549",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/ofxRectangleObject.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "6205"
},
{
"name": "C++",
"bytes": "408361"
},
{
"name": "Makefile",
"bytes": "3820"
}
],
"symlink_target": ""
} |
<?php
session_start();
?>
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Material Login Form</title>
<link rel="stylesheet" href="css/reset.css">
<link rel='stylesheet prefetch' href='http://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900|RobotoDraft:400,100,300,500,700,900'>
<link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Mixins-->
<!-- Pen Title-->
<div class="pen-title">
<h1>Welcome</h1><span>Week 9 <i class='fa fa-code'></i> ITE220: Web Development II </span>
</div>
<div class="container">
<div class="card"></div>
<div class="card">
<h1 class="title">
Welcome
<?php
echo $_SESSION["username"];
?>!
</h1>
<form action= "action.php?q=logout" method="POST">
<br/><br/><br/>
<div class="button-container">
<button><span>Logout</span></button>
</div>
</form>
</div>
</div>
<!-- Portfolio--><a id="portfolio" href="http://andytran.me/" title="View my portfolio!"><i class="fa fa-link"></i></a>
<!-- CodePen--><a id="codepen" href="http://codepen.io/andytran/" title="Follow me!"><i class="fa fa-codepen"></i></a>
<script src='js/jquery.min.js'></script>
</body>
</html>
| {
"content_hash": "586c4f6f87c0718e535eb17ff4d364ad",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 149,
"avg_line_length": 32.53333333333333,
"alnum_prop": 0.5594262295081968,
"repo_name": "rycara/ite-220-",
"id": "095dfcaafa31f449c89112af4dc2cb134612fd00",
"size": "1464",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Week9-Authenthication/welcome.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "21843"
},
{
"name": "HTML",
"bytes": "9340"
},
{
"name": "JavaScript",
"bytes": "15523"
},
{
"name": "PHP",
"bytes": "5520"
}
],
"symlink_target": ""
} |
class GURL;
namespace base {
class FilePath;
class Value;
} // namespace base
namespace google_apis {
class AppList;
class AppResource;
class ChangeList;
class ChangeResource;
class DriveAppIcon;
class FileList;
class FileResource;
class ResourceEntry;
class ResourceList;
} // namespace google_apis
namespace drive {
namespace util {
// Google Apps MIME types:
const char kGoogleDocumentMimeType[] = "application/vnd.google-apps.document";
const char kGoogleDrawingMimeType[] = "application/vnd.google-apps.drawing";
const char kGooglePresentationMimeType[] =
"application/vnd.google-apps.presentation";
const char kGoogleSpreadsheetMimeType[] =
"application/vnd.google-apps.spreadsheet";
const char kGoogleTableMimeType[] = "application/vnd.google-apps.table";
const char kGoogleFormMimeType[] = "application/vnd.google-apps.form";
const char kDriveFolderMimeType[] = "application/vnd.google-apps.folder";
// Escapes ' to \' in the |str|. This is designed to use for string value of
// search parameter on Drive API v2.
// See also: https://developers.google.com/drive/search-parameters
std::string EscapeQueryStringValue(const std::string& str);
// Parses the query, and builds a search query for Drive API v2.
// This only supports:
// Regular query (e.g. dog => fullText contains 'dog')
// Conjunctions
// (e.g. dog cat => fullText contains 'dog' and fullText contains 'cat')
// Exclusion query (e.g. -cat => not fullText contains 'cat').
// Quoted query (e.g. "dog cat" => fullText contains 'dog cat').
// See also: https://developers.google.com/drive/search-parameters
std::string TranslateQuery(const std::string& original_query);
// Extracts resource_id out of edit url.
std::string ExtractResourceIdFromUrl(const GURL& url);
// If |resource_id| is in the old resource ID format used by WAPI, converts it
// into the new format.
std::string CanonicalizeResourceId(const std::string& resource_id);
// Returns a ResourceIdCanonicalizer which returns the argument.
ResourceIdCanonicalizer GetIdentityResourceIdCanonicalizer();
// Note: Following constants and a function are used to support GetShareUrl on
// Drive API v2. Unfortunately, there is no support on Drive API v2, so we need
// to fall back to GData WAPI for the GetShareUrl. Thus, these are shared by
// both GDataWapiService and DriveAPIService.
// TODO(hidehiko): Remove these from here, when Drive API v2 supports
// GetShareUrl.
// OAuth2 scopes for the GData WAPI.
extern const char kDocsListScope[];
extern const char kDriveAppsScope[];
// Extracts an url to the sharing dialog and returns it via |callback|. If
// the share url doesn't exist, then an empty url is returned.
void ParseShareUrlAndRun(const google_apis::GetShareUrlCallback& callback,
google_apis::GDataErrorCode error,
scoped_ptr<base::Value> value);
// Converts ResourceEntry to FileResource.
scoped_ptr<google_apis::FileResource>
ConvertResourceEntryToFileResource(const google_apis::ResourceEntry& entry);
// Returns the GData WAPI's Kind of the FileResource.
google_apis::DriveEntryKind GetKind(
const google_apis::FileResource& file_resource);
// Converts FileResource to ResourceEntry.
scoped_ptr<google_apis::ResourceEntry>
ConvertFileResourceToResourceEntry(
const google_apis::FileResource& file_resource);
// Converts ChangeResource to ResourceEntry.
scoped_ptr<google_apis::ResourceEntry>
ConvertChangeResourceToResourceEntry(
const google_apis::ChangeResource& change_resource);
// Converts FileList to ResourceList.
scoped_ptr<google_apis::ResourceList>
ConvertFileListToResourceList(const google_apis::FileList& file_list);
// Converts ChangeList to ResourceList.
scoped_ptr<google_apis::ResourceList>
ConvertChangeListToResourceList(const google_apis::ChangeList& change_list);
// Returns the (base-16 encoded) MD5 digest of the file content at |file_path|,
// or an empty string if an error is found.
std::string GetMd5Digest(const base::FilePath& file_path);
// The resource ID for the root directory for WAPI is defined in the spec:
// https://developers.google.com/google-apps/documents-list/
extern const char kWapiRootDirectoryResourceId[];
} // namespace util
} // namespace drive
#endif // CHROME_BROWSER_DRIVE_DRIVE_API_UTIL_H_
| {
"content_hash": "3c5a99b5354cabaf3375e24a58796440",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 79,
"avg_line_length": 38.06194690265487,
"alnum_prop": 0.7626133457335503,
"repo_name": "boundarydevices/android_external_chromium_org",
"id": "a57432011d678e98eb5b9bf132c26559872c1da4",
"size": "4830",
"binary": false,
"copies": "10",
"ref": "refs/heads/cm-12.0",
"path": "chrome/browser/drive/drive_api_util.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?php
// System restore ... from raspi-config
// Includes
$base_URI = substr($_SERVER['SCRIPT_FILENAME'],0,strpos(substr($_SERVER['SCRIPT_FILENAME'],1),"/")+1);
include_once $base_URI.'/www/smartcan/www/conf/config.php';
// Connect DB
$DB = mysqli_connect(mysqli_HOST, mysqli_LOGIN, mysqli_PWD);
mysqli_set_charset($DB,'utf8');
mysqli_select_db($DB,mysqli_DB);
$variable = $argv[1];
//echo("Console Variable = $variable");
if ($variable=="/boot/FULLsmartCAN-BACKUP.tar.gz") {
// Restore
// UnTAR & Restore Files & DB
$BackupDest = $base_URI."/www/backups";
echo("Uncompressing /boot/FULLsmartCAN-BACKUP.tar.gz /n" . CRLF);
shell_exec("sudo /bin/tar zxvf /boot/FULLsmartCAN-BACKUP.tar.gz -C / 2>&1");
// SQL File present in Extracted files
$ScanDir = scandir($BackupDest);
$ndir=0;
while (isset($ScanDir[$ndir+2])) {
if (substr($ScanDir[$ndir+2],-4)==".sql") {
echo("SQL File : ".$ScanDir[$ndir+2]. " Restored ;-) /n". CRLF);
importDB($BackupDest."/".$ScanDir[$ndir+2]);
unlink($BackupDest."/".$ScanDir[$ndir+2]);
} // END IF
if ($ScanDir[$ndir+2]=="samba-users.smbback") {
echo("Restoring SAMBA Passwords/n");
shell_exec("sudo pdbedit -i smbpasswd:".$BackupDest."/samba-users.smbback");
unlink($BackupDest."/".$ScanDir[$ndir+2]);
} // END IF
$ndir++;
} // END WHILE
} // END IF
function importDB($filename) {
global $DB;
$table = substr($filename,strrpos($filename,"/")+1,strlen($filename)-5-strrpos($filename,"/"));
echo("Select Table: $table/n");
mysqli_select_db($DB,$table);
// Temporary variable, used to store current query
$templine = '';
// Read in entire file
$lines = file($filename);
// Loop through each line
foreach ($lines as $line) {
// Skip it if it's a comment
if (substr($line, 0, 2) == '--' || $line == '')
continue;
// Add this line to the current segment
$templine .= $line;
// If it has a semicolon at the end, it's the end of the query
if (substr(trim($line), -1, 1) == ';') {
// Perform the query
mysqli_query($DB,$templine) or print('Error performing query \'<strong>' . $templine . '\': ' . mysqli_error($DB) . '<br /><br />');
// Reset temp variable to empty
$templine = '';
} // ENDIF
} // END FOREACH
//if ($filename=="mysql.sql") { mysqli_query($DB,"FLUSH PRIVILEGES"); }
//echo "Tables imported (".$filename.") successfully";
} // END FUNCTION importtDB
?>
| {
"content_hash": "b8a02376f5f7587def874b93553ded64",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 138,
"avg_line_length": 34.785714285714285,
"alnum_prop": 0.6180698151950719,
"repo_name": "theonlyzby/SmartCAN",
"id": "932a5824ac25b833ab8f0b688b47674e697fa4ac",
"size": "2435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "var/www/smartcan/bin/restore.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6467"
},
{
"name": "C",
"bytes": "62616"
},
{
"name": "CSS",
"bytes": "237711"
},
{
"name": "HTML",
"bytes": "2319562"
},
{
"name": "JavaScript",
"bytes": "5887099"
},
{
"name": "Lua",
"bytes": "20359"
},
{
"name": "Makefile",
"bytes": "7342"
},
{
"name": "PHP",
"bytes": "10778802"
},
{
"name": "Python",
"bytes": "27384"
},
{
"name": "Roff",
"bytes": "58"
},
{
"name": "Shell",
"bytes": "3756"
}
],
"symlink_target": ""
} |
<hr />
### Intro <a id="intro"></a>
### This is a simple skill that you can use to introduce an Alexa talk or training session. Just say "Alexa, start our talk".
Back to the [Workshop Folder](../README.md#title) - [Cookbook Home Page](../../README.md#title)
| {
"content_hash": "9973c548901d037eeb5e72d007b95f16",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 126,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.6628787878787878,
"repo_name": "tcardona/PSEG-Alexa-Project",
"id": "d0731cbcac3c9e9b0981322713509165762e074a",
"size": "318",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Workshop/Roadshow/OurTalkSkill/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "60482"
},
{
"name": "Shell",
"bytes": "3464"
}
],
"symlink_target": ""
} |
package org.camunda.bpm.engine.impl.form.validator;
/**
* @author Daniel Meyer
*
*/
public class MaxLengthValidator extends AbstractTextValueValidator {
protected boolean validate(String submittedValue, String configuration) {
Integer maxLength = null;
try {
maxLength = Integer.parseInt(configuration);
} catch (NumberFormatException e) {
// do not throw validation exception, as the issue is not with the submitted value
throw new FormFieldConfigurationException(configuration, "Cannot validate \"maxlength\": configuration "+configuration+" cannot be interpreted as Integer");
}
return submittedValue.length() <= maxLength;
}
}
| {
"content_hash": "82348d27efb6a264f31a03af9bd48be6",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 162,
"avg_line_length": 30.954545454545453,
"alnum_prop": 0.73568281938326,
"repo_name": "ingorichtsmeier/camunda-bpm-platform",
"id": "680a6932663146e88df3fc9f7166f4742f0231d3",
"size": "1488",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "engine/src/main/java/org/camunda/bpm/engine/impl/form/validator/MaxLengthValidator.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8608"
},
{
"name": "CSS",
"bytes": "5486"
},
{
"name": "Fluent",
"bytes": "3111"
},
{
"name": "FreeMarker",
"bytes": "1442812"
},
{
"name": "Groovy",
"bytes": "1904"
},
{
"name": "HTML",
"bytes": "961289"
},
{
"name": "Java",
"bytes": "44047866"
},
{
"name": "JavaScript",
"bytes": "3063613"
},
{
"name": "Less",
"bytes": "154956"
},
{
"name": "Python",
"bytes": "192"
},
{
"name": "Ruby",
"bytes": "60"
},
{
"name": "SQLPL",
"bytes": "44180"
},
{
"name": "Shell",
"bytes": "11634"
}
],
"symlink_target": ""
} |
@extends('layouts.main')
@section('title', 'Editar')
@section('content')
<div class="container">
<div class="row">
</div>
</div>
@endsection
| {
"content_hash": "a1d6988d75d32bb0fdda391b4dd9bb5c",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 27,
"avg_line_length": 16.666666666666668,
"alnum_prop": 0.6266666666666667,
"repo_name": "alphabraga/nay",
"id": "610ffdf1212c5fb81401b60af95c69ebe9b8a7cc",
"size": "150",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "resources/views/configuration/edit.blade.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20584"
},
{
"name": "HTML",
"bytes": "249899"
},
{
"name": "JavaScript",
"bytes": "25119"
},
{
"name": "PHP",
"bytes": "277551"
},
{
"name": "Vue",
"bytes": "563"
}
],
"symlink_target": ""
} |
using Newtonsoft.Json.Linq;
using System.Linq;
namespace EDDiscovery.EliteDangerous.JournalEvents
{
// When written: when the ‘reboot repair’ function is used
// Parameters:
//• Modules: JSON array of names of modules repaired
public class JournalRebootRepair : JournalEntry
{
public JournalRebootRepair(JObject evt) : base(evt, JournalTypeEnum.RebootRepair)
{
if (!JSONHelper.IsNullOrEmptyT(evt["Modules"]))
Modules = evt.Value<JArray>("Modules").Values<string>().ToArray();
}
public string[] Modules { get; set; }
public static System.Drawing.Bitmap Icon { get { return EDDiscovery.Properties.Resources.rebootrepair; } }
}
}
| {
"content_hash": "b31d88097aa30439d93bf2f4d17c9728",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 114,
"avg_line_length": 30,
"alnum_prop": 0.6722222222222223,
"repo_name": "vendolis/EDDiscovery",
"id": "a8ce21c19e199fe4ac0173285b8531290fdbcb0e",
"size": "728",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "EDDiscovery/EliteDangerous/JournalEvents/JournalRebootRepair.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "2487635"
},
{
"name": "JavaScript",
"bytes": "20552"
}
],
"symlink_target": ""
} |
import Spotify from 'spotify-web-api-js';
export default class ActionFactory {
static buildPendingActionCreator(pendingConstant){
return () => {
return {
type: pendingConstant,
data: {}
}
}
}
static buildSuccessActionCreator(successConstant){
return (data) => {
return {
type: successConstant,
data: data
}
}
}
static buildFailureActionCreator(failureConstant){
return (error) => {
return {
type: failureConstant,
error: error
}
}
}
static buildSpotifyAction(constants, apiOptions, callbackOptions = {}){
let spotify = new Spotify();
let pending = this.buildPendingActionCreator(constants.PENDING);
let success = this.buildSuccessActionCreator(constants.SUCCESS);
let failure = this.buildFailureActionCreator(constants.FAILURE);
return (dispatch, getState) => {
let { accessToken } = getState().auth.tokenData;
spotify.setAccessToken(accessToken);
let processedPending = pending();
callbackOptions.pending && callbackOptions.pending(processedPending.data);
dispatch(processedPending);
spotify[apiOptions.apiCall].apply(spotify, apiOptions.args)
.then((data) => {
let processedData = callbackOptions.success ? callbackOptions.success(data) : data;
return dispatch(success(processedData))
})
.catch((error) => {
let processedError = callbackOptions.failure ? callbackOptions.failure(error) : error;
return dispatch(failure(processedError))
})
}
}
}
| {
"content_hash": "73311cc46ba4c256a985e857af99794c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 96,
"avg_line_length": 31.470588235294116,
"alnum_prop": 0.6523364485981309,
"repo_name": "matiasgarcia/tubify",
"id": "eb8c8b98f22be4ba5bcbcfc46c11fffbf0dc3fff",
"size": "1605",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/utils/actionFactory.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "766"
},
{
"name": "JavaScript",
"bytes": "69404"
}
],
"symlink_target": ""
} |
id: concepts-clients
title: Pulsar Clients
sidebar_label: "Clients"
original_id: concepts-clients
---
Pulsar exposes a client API with language bindings for [Java](client-libraries-java.md), [Go](client-libraries-go.md), [Python](client-libraries-python.md) and [C++](client-libraries-cpp). The client API optimizes and encapsulates Pulsar's client-broker communication protocol and exposes a simple and intuitive API for use by applications.
Under the hood, the current official Pulsar client libraries support transparent reconnection and/or connection failover to brokers, queuing of messages until acknowledged by the broker, and heuristics such as connection retries with backoff.
> #### Custom client libraries
> If you'd like to create your own client library, we recommend consulting the documentation on Pulsar's custom [binary protocol](developing-binary-protocol.md)
## Client setup phase
When an application wants to create a producer/consumer, the Pulsar client library will initiate a setup phase that is composed of two steps:
1. The client will attempt to determine the owner of the topic by sending an HTTP lookup request to the broker. The request could reach one of the active brokers which, by looking at the (cached) zookeeper metadata will know who is serving the topic or, in case nobody is serving it, will try to assign it to the least loaded broker.
1. Once the client library has the broker address, it will create a TCP connection (or reuse an existing connection from the pool) and authenticate it. Within this connection, client and broker exchange binary commands from a custom protocol. At this point the client will send a command to create producer/consumer to the broker, which will comply after having validated the authorization policy.
Whenever the TCP connection breaks, the client will immediately re-initiate this setup phase and will keep trying with exponential backoff to re-establish the producer or consumer until the operation succeeds.
## Reader interface
In Pulsar, the "standard" [consumer interface](concepts-messaging.md#consumers) involves using consumers to listen on [topics](reference-terminology.md#topic), process incoming messages, and finally acknowledge those messages when they've been processed. Whenever a new subscription is created, it is initially positioned at the end of the topic (by default), and consumers associated with that subscription will begin reading with the first message created afterwards. Whenever a consumer connects to a topic using a pre-existing subscription, it begins reading from the earliest message un-acked within that subscription. In summary, with the consumer interface, subscription cursors are automatically managed by Pulsar in response to [message acknowledgements](concepts-messaging.md#acknowledgement).
The **reader interface** for Pulsar enables applications to manually manage cursors. When you use a reader to connect to a topic---rather than a consumer---you need to specify *which* message the reader begins reading from when it connects to a topic. When connecting to a topic, the reader interface enables you to begin with:
* The **earliest** available message in the topic
* The **latest** available message in the topic
* Some other message between the earliest and the latest. If you select this option, you'll need to explicitly provide a message ID. Your application will be responsible for "knowing" this message ID in advance, perhaps fetching it from a persistent data store or cache.
The reader interface is helpful for use cases like using Pulsar to provide effectively-once processing semantics for a stream processing system. For this use case, it's essential that the stream processing system be able to "rewind" topics to a specific message and begin reading there. The reader interface provides Pulsar clients with the low-level abstraction necessary to "manually position" themselves within a topic.
Internally, the reader interface is implemented as a consumer using an exclusive, non-durable subscription to the topic with a randomly-allocated name.
[ **IMPORTANT** ]
Unlike subscription/consumer, readers are non-durable in nature and will not prevent data in a topic from being deleted, thus it is ***strongly*** advised that [data retention](cookbooks-retention-expiry) be configured. If data retention for a topic is not configured for an adequate amount of time, messages that the reader has not yet read might be deleted . This will cause readers to essentially skip messages. Configuring the data retention for a topic guarantees the reader with have a certain duration to read a message.
Please also note that a reader can have a "backlog", but the metric is just to allow users to know how behind the reader is and is not considered for any backlog quota calculations.

> ### Non-partitioned topics only
> The reader interface for Pulsar cannot currently be used with [partitioned topics](concepts-messaging.md#partitioned-topics).
Here's a Java example that begins reading from the earliest available message on a topic:
```java
import org.apache.pulsar.client.api.Message;
import org.apache.pulsar.client.api.MessageId;
import org.apache.pulsar.client.api.Reader;
// Create a reader on a topic and for a specific message (and onward)
Reader<byte[]> reader = pulsarClient.newReader()
.topic("reader-api-test")
.startMessageId(MessageId.earliest)
.create();
while (true) {
Message message = reader.readNext();
// Process the message
}
```
To create a reader that will read from the latest available message:
```java
Reader<byte[]> reader = pulsarClient.newReader()
.topic(topic)
.startMessageId(MessageId.latest)
.create();
```
To create a reader that will read from some message between earliest and latest:
```java
byte[] msgIdBytes = // Some byte array
MessageId id = MessageId.fromByteArray(msgIdBytes);
Reader<byte[]> reader = pulsarClient.newReader()
.topic(topic)
.startMessageId(id)
.create();
```
| {
"content_hash": "33dc13896ecd5873b3f32fa207d43cb0",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 806,
"avg_line_length": 65.14893617021276,
"alnum_prop": 0.7882103200522534,
"repo_name": "yahoo/pulsar",
"id": "88fe80b8c6381aed6bfa6cd155ad952f283bf8a3",
"size": "6128",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "site2/website/versioned_docs/version-2.6.4/concepts-clients.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "77960"
},
{
"name": "C++",
"bytes": "736937"
},
{
"name": "CMake",
"bytes": "9092"
},
{
"name": "HTML",
"bytes": "29382"
},
{
"name": "Java",
"bytes": "5371040"
},
{
"name": "Protocol Buffer",
"bytes": "15090"
},
{
"name": "Python",
"bytes": "91802"
},
{
"name": "Shell",
"bytes": "47717"
}
],
"symlink_target": ""
} |
package com.cloudant.sync.notifications;
/**
* <p>Event for database closed</p>
*
* <p>This event is posted by {@link com.cloudant.sync.datastore.Datastore#close()}</p>
*/
public class DatabaseClosed extends DatabaseModified {
/**
* <p>Event for database closed</p>
*
* @param dbName
* The name of the Datastore that was closed
*/
public DatabaseClosed(String dbName) {
super(dbName);
}
} | {
"content_hash": "91567a0a3627336b86bab5ce92d3f0cb",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 87,
"avg_line_length": 21.523809523809526,
"alnum_prop": 0.6238938053097345,
"repo_name": "akhilesh0707/sync-android",
"id": "7dd04297c646f1b3c176c6483dff75de62df193b",
"size": "1065",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/notifications/DatabaseClosed.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2001141"
},
{
"name": "Ruby",
"bytes": "3435"
},
{
"name": "Shell",
"bytes": "528"
}
],
"symlink_target": ""
} |
#import "ANDeviceInfoService.h"
#import "ANFirmwareRevisionCharacteristic.h"
#import "ANModelCharacteristic.h"
#import "ANSerialNumberCharacteristic.h"
#import "ANHardwareRevisionCharacteristic.h"
#import "ANSoftwareRevisionCharacteristic.h"
#import "ANManufacturerCharacteristic.h"
@implementation ANDeviceInfoService
- (NSArray *)characteristicsUUIDs {
return nil;
}
+ (CBUUID *)UUID {
return [CBUUID UUIDWithString:kDeviceInfoServiceUUIDString];
}
- (void)peripheral:(ANPeripheral *)peripheral discoveredCharacteristicsForService:(ANService *)service error:(NSError *)error {
NSArray *characteristics = [service.service characteristics];
CBCharacteristic *characteristic;
if (service.service != self.service) {
return ;
}
if (error != nil) {
return ;
}
for (characteristic in characteristics) {
if ([[characteristic UUID] isEqual:[ANFirmwareRevisionCharacteristic UUID]]) {
_firmwareChar = [[ANFirmwareRevisionCharacteristic alloc] initWithCBCharacteristic:characteristic];
}
else if ([[characteristic UUID] isEqual:[ANSoftwareRevisionCharacteristic UUID]]) {
_softwareChar = [[ANSoftwareRevisionCharacteristic alloc] initWithCBCharacteristic:characteristic];
}
else if ([[characteristic UUID] isEqual:[ANHardwareRevisionCharacteristic UUID]]) {
_hardwareChar = [[ANHardwareRevisionCharacteristic alloc] initWithCBCharacteristic:characteristic];
}
else if ([[characteristic UUID] isEqual:[ANModelCharacteristic UUID]]) {
_modelChar = [[ANModelCharacteristic alloc] initWithCBCharacteristic:characteristic];
}
else if ([[characteristic UUID] isEqual:[ANSerialNumberCharacteristic UUID]]) {
_serialChar = [[ANSerialNumberCharacteristic alloc] initWithCBCharacteristic:characteristic];
}
else if ([[characteristic UUID] isEqual:[ANManufacturerCharacteristic UUID]]) {
_manufacturerChar = [[ANManufacturerCharacteristic alloc] initWithCBCharacteristic:characteristic];
}
[peripheral.peripheral readValueForCharacteristic:characteristic];
}
}
- (void)valueUpdatedForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error {
ANCharacteristic *aCharacteristic = [self getANCharacteristic:characteristic];
[aCharacteristic processData];
if (self.delegate && [self.delegate respondsToSelector:@selector(service:didUpdateValueForCharacterstic:error:)]) {
[self.delegate service:self didUpdateValueForCharacterstic:aCharacteristic error:error];
}
}
- (ANCharacteristic *)getANCharacteristic:(CBCharacteristic *)characteristic {
if ([characteristic.UUID isEqual:[ANFirmwareRevisionCharacteristic UUID]]) {
return self.firmwareChar;
}
else if ([characteristic.UUID isEqual:[ANModelCharacteristic UUID]]) {
return self.modelChar;
}
else if ([characteristic.UUID isEqual:[ANSerialNumberCharacteristic UUID]]) {
return self.serialChar;
}
else if ([characteristic.UUID isEqual:[ANSoftwareRevisionCharacteristic UUID]]) {
return self.softwareChar;
}
else if ([characteristic.UUID isEqual:[ANHardwareRevisionCharacteristic UUID]]) {
return self.hardwareChar;
}
else if ([characteristic.UUID isEqual:[ANManufacturerCharacteristic UUID]]) {
return self.manufacturerChar;
}
return nil;
}
- (NSString *)description {
return [NSString stringWithFormat:@"Device Info service: %@", self.service];
}
@end
| {
"content_hash": "0ef99ba6831345f8e5343dd4764ae908",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 127,
"avg_line_length": 37.385416666666664,
"alnum_prop": 0.722485371969908,
"repo_name": "AngelSensor/angel-sdk",
"id": "15cb957fa7dcfcf422f6b85076b34b43e7371fb1",
"size": "5179",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "iOS/SDK/Services/DeviceInfo/ANDeviceInfoService.m",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "30660"
},
{
"name": "Java",
"bytes": "161924"
},
{
"name": "Objective-C",
"bytes": "1820098"
},
{
"name": "Python",
"bytes": "76162"
},
{
"name": "Ruby",
"bytes": "63"
},
{
"name": "Shell",
"bytes": "7953"
}
],
"symlink_target": ""
} |
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi;
import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.openapi.util.Segment;
import com.intellij.openapi.util.TextRange;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
/**
* Marks PSI element as (potentially) containing text in other language.
* Injected language PSI does not embed into the PSI tree of the hosting element,
* but is used by the IDE for highlighting, completion and other code insight actions.
* <p>
* In order to do the injection, you have to
* <ul>
* <li>Implement {@link com.intellij.psi.LanguageInjector} to describe exact place where injection should occur.</li>
* <li>Register injection in {@link com.intellij.psi.LanguageInjector#EXTENSION_POINT_NAME} extension point.</li>
* </ul>
* Currently, language can be injected into string literals, XML tag contents and XML attributes.
* <p>
* You don't have to implement {@code PsiLanguageInjectionHost} by yourself, unless you want to inject something into your own custom PSI.
* For all returned injected PSI elements, {@link InjectedLanguageManager#getInjectionHost(PsiElement)} returns {@code PsiLanguageInjectionHost} they were injected into.
*/
public interface PsiLanguageInjectionHost extends PsiElement {
/**
* @return {@code true} if this instance can accept injections, {@code false} otherwise
*/
boolean isValidHost();
/**
* Update the host element using the provided text of the injected file. It may be required to escape characters from {@code text}
* in accordance with the host language syntax. The implementation may delegate to {@link ElementManipulators#handleContentChange(PsiElement, String)}
* if {@link ElementManipulator} implementation is registered for this element class.
*
* @param text text of the injected file
* @return the updated instance
*/
PsiLanguageInjectionHost updateText(@Nonnull String text);
/**
* @return {@link LiteralTextEscaper} instance which will be used to convert the content of this host element to the content of injected file
*/
@Nonnull
LiteralTextEscaper<? extends PsiLanguageInjectionHost> createLiteralTextEscaper();
@FunctionalInterface
interface InjectedPsiVisitor {
void visit(@Nonnull PsiFile injectedPsi, @Nonnull List<Shred> places);
}
interface Shred {
/**
* @return returns null when the host document marker is invalid
*/
@Nullable
Segment getHostRangeMarker();
@Nonnull
TextRange getRangeInsideHost();
boolean isValid();
void dispose();
@Nullable
PsiLanguageInjectionHost getHost();
/**
* @return range in decoded PSI
*/
@Nonnull
TextRange getRange();
@Nonnull
String getPrefix();
@Nonnull
String getSuffix();
}
}
| {
"content_hash": "fe9f4dd89c6642e4aa85a99ae07c75a1",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 169,
"avg_line_length": 35.226190476190474,
"alnum_prop": 0.739438999662048,
"repo_name": "consulo/consulo",
"id": "dca54d03524cb71d753d96ecea7c721697ef6f8b",
"size": "2959",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/base/core-api/src/main/java/com/intellij/psi/PsiLanguageInjectionHost.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "299"
},
{
"name": "C",
"bytes": "52718"
},
{
"name": "C++",
"bytes": "72795"
},
{
"name": "CMake",
"bytes": "854"
},
{
"name": "CSS",
"bytes": "64655"
},
{
"name": "Groovy",
"bytes": "36006"
},
{
"name": "HTML",
"bytes": "173780"
},
{
"name": "Java",
"bytes": "64026758"
},
{
"name": "Lex",
"bytes": "5909"
},
{
"name": "Objective-C",
"bytes": "23787"
},
{
"name": "Python",
"bytes": "3276"
},
{
"name": "SCSS",
"bytes": "9782"
},
{
"name": "Shell",
"bytes": "5689"
},
{
"name": "Thrift",
"bytes": "1216"
},
{
"name": "XSLT",
"bytes": "49230"
}
],
"symlink_target": ""
} |
var del = require('del');
// config
var config = require('../../config/styles');
/**
* Delete all CSS and SourceMap
* files within the built theme's
* asset directory
*
*/
module.exports = function (done) {
del(config.paths.clean, { force: true })
.then(function () { done(); });
}; | {
"content_hash": "f7600cd2a7f221ba4dd895e251a94f11",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 44,
"avg_line_length": 19.25,
"alnum_prop": 0.5909090909090909,
"repo_name": "nisshin-printing/ym--satellite",
"id": "8c33c2c060ae3fab4fe130da40b3b4775a695c55",
"size": "308",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gulp/core/recipes/styles/clean.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "42536"
},
{
"name": "HTML",
"bytes": "6764"
},
{
"name": "Hack",
"bytes": "8910"
},
{
"name": "JavaScript",
"bytes": "54799"
},
{
"name": "PHP",
"bytes": "215230"
},
{
"name": "Shell",
"bytes": "1575"
}
],
"symlink_target": ""
} |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package keyline.domodel;
/**
*
* @author KMY
*/
public class NotionModel {
}
| {
"content_hash": "60169a0ec5288facc5a10d9d6f5aa86a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 19.071428571428573,
"alnum_prop": 0.7078651685393258,
"repo_name": "kmycode/Keyline",
"id": "60a984eaeab27b3d5288f0c3d9f6e2749a945405",
"size": "267",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/keyline/domodel/NotionModel.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "32978"
},
{
"name": "Java",
"bytes": "195365"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<title>Cultural Blog | Week 5</title>
<link rel="stylesheet" type="text/css" href="stylesheets/technical_blog.css">
</head>
<body>
<div class="header">
<div class="wrapper">
<h1 class="page-title">Tech Bits</h1>
</div>
</div>
<div class="wrapper">
<div class="sidebar">
<ul class="sidebar-nav">
<li class="sidebar-nav-element html-nav-element"><a href="#">HTML</a></li>
<li class="sidebar-nav-element css-nav-element"><a href="#">CSS</a></li>
<li class="sidebar-nav-element javascript-nav-element"><a href="#">Javascript</a></li>
<li class="sidebar-nav-element ror-nav-element"><a href="#">Ruby on Rails</a></li>
</ul>
</div>
<div class="content">
<div class="article">
<div class="article-header css-style">Compass of <i>Shame</i></div>
<div class="article-header-details">May 17, 2014 - 9:11pm</div>
<div class="article-content">
The compass of shame is an interesting model to use when breaking down conflicts between people. I find it very similar to the <a href="http://en.wikipedia.org/wiki/SWOT_analysis">SWOT Analysis</a> when analyzing a businesses position in a marketplace. In general, I am a relatively non-confrontational person. I don't like it, and commonly don't look for confrontation. There have been times in the past for whatever reason they do come about, and most commonly due to miscommunication, or due to someone spreading untrue rumors.
<br /><br />
This particular time that I will use for this example was regarding a work related issue. There was actually a software bug that arose after a release, and instead of remaining a work challenge, it turned into a personal issue between myself and another employee. The big came back to me, and initially I turned inward, or towards the "Attack Self" side of the spectrom. After being relatively down regarding this issue for a couple days trying to fix this persistent bug, I reached back out to the individual that sent this bug my way, and after some significant research it turned out to be their faulty implementation of my work that led to the bug.
<br /><br />
I learned a great lesson from this incident. I learned that just because you think another individual is superior, or smarter, or has more experience, that doesn't mean they are <i>always</i> right. People make mistakes, and when mistakes or conflicts arise, it is most important to address them head on, while collecting as much information as possible regarding the cause of the problem before trying to fix it. More often than not, it is a communication or misinterpretation problem, instead of a true issue with whatever the case it may be regarding. Moral of the story regardless of the situation, before blaming yourself and taking on the problem head on and along, consult everyone involved to get as much information as possible. This will help find the root issue without attacking others or attacking yourself.
</div>
</div>
</div>
</div>
<div class="footer">
<div class="wrapper">
<div class="footer-name">Patrick Reynolds</div>
<div class="social-media-links">
<ul>
<li><a href="http://www.facebook.com/patricl.reynolds.161"><span class="facebook"></span></a></li>
<li><a href="http://www.linkedin.com/in/patrickscottreynolds"><span class="linkedin"></span></a></li>
<li><a href="http://twitter.com/patrickr3ynolds"><span class="twitter"></span></a></li>
<li><a href="http://github.com/patrickreynolds"><span class="github"></span></a></li>
<li><a href="http://google.com"><span class="google-plus"></span></a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
| {
"content_hash": "82dfc93807a44109eaed21590a513400",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 825,
"avg_line_length": 73.03921568627452,
"alnum_prop": 0.7060402684563758,
"repo_name": "patrickreynolds/patrickreynolds.github.io",
"id": "a1b9f81d8ea980312295926a362fafce1037c973",
"size": "3725",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "unit2_projects/week5_cultural_blog.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "29951"
}
],
"symlink_target": ""
} |
@implementation HBModel
-(instancetype)init{
if (self = [super init]) {
self.lines = [NSMutableArray new];
}
return self;
}
+ (NSDictionary *)objectClassInArray
{
return @{@"lines": [HBDrawModel class]};
}
@end
| {
"content_hash": "3f2454bab4c8e985a88fee5288866061",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 44,
"avg_line_length": 16.928571428571427,
"alnum_prop": 0.6244725738396625,
"repo_name": "FengDeng/DrawingBoard",
"id": "5e644b1327b929ff66d911a0af2b460cba10f4c7",
"size": "401",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DrawingBoard/Model/HBModel.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "38890"
},
{
"name": "Ruby",
"bytes": "760"
}
],
"symlink_target": ""
} |
#region S# License
#endregion S# License
namespace StockSharp.BitStamp.Native
{
using Newtonsoft.Json;
class Balance
{
[JsonProperty("usd_balance")]
public double UsdBalance { get; set; }
[JsonProperty("btc_balance")]
public double BtcBalance { get; set; }
[JsonProperty("usd_reserved")]
public double UsdReserved { get; set; }
[JsonProperty("btc_reserved")]
public double BtcReserved { get; set; }
[JsonProperty("usd_available")]
public double UsdAvailable { get; set; }
[JsonProperty("btc_available")]
public double BtcAvailable { get; set; }
[JsonProperty("fee")]
public double Fee { get; set; }
}
} | {
"content_hash": "9c09bd658c84ee6fbccda96cd09eaae7",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 42,
"avg_line_length": 20.741935483870968,
"alnum_prop": 0.6889580093312597,
"repo_name": "Shadance/StockSharp",
"id": "c59e99d054324270c0d1f37a1a50eb1e311c68e1",
"size": "1272",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Connectors/BitStamp/Native/Balance.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "314"
},
{
"name": "C#",
"bytes": "9031806"
},
{
"name": "Lua",
"bytes": "2300"
}
],
"symlink_target": ""
} |
+++
author = "Charley Mann"
categories = ["Community"]
tags = ["Camundacon"]
title = "CamundaCon 2019 - AXA and viadee: Transformation from a self-built process engine"
date = "2019-08-01T12:00:00+04:00"
+++
Niko Vogel, Manager IT-BPM and Product Owner AXA Konzern AG; and Matthias Schulte, Senior Consultant - Competence Center “BPM and Process Automation”, viadee Unternehmensberatung AG, are some of Camunda’s longest-standing users. In fact, Niko has joined us on stage before, presenting at Camunda Days in Stockholm and Brussels. If you were fortunate enough to score a seat at those events – you’ll know this CamundaCon presentation from the forward-thinking pair is not to be missed! Read on for highlights of their talk, and what they’re looking forward to at [CamundaCon 2019](https://www.camundacon.com/agenda).
<!--more-->
## The interesting facts:
### Q: How long have you been using Camunda?
A: It was in 2016 that we started to work with Camunda and the first AXA process was modelled. We were in production by April 2017.
### Q: Do you use the Community or Enterprise edition?
A: Enterprise
### Q: How are you using Camunda?
A: At AXA Germany, we use Camunda as an end-to-end process automation tool to manage our customer communications. For example, if we receive a letter from a customer, it is scanned and then routed to the right business process. Camunda automates the entire request, takes care of the business process itself and, in most cases, automates the response to the customer as well.
### Q: Have you built any interesting extensions/would you recommend any plugins etc.?
A: N Yes, we have! We’ve built lots of our own internal AXA extensions – and we’ll tell you more about these at CamundaCon.
A: M In addition, at viadee we have plugins for the Camunda modeler enabling modelling and documentation in Confluence.
## CamundaCon preview:
### Q: What will you be presenting?
A: Our journey at AXA from a self-built process engine to Camunda. IT loved our self-built process engine, but it was hard for our business users to understand. With Camunda, more people are able to actually use the platform – it’s enabling people from different departments to effectively work together.
### Q: What’s motivating you to share your use case?
A: We aim to reinvent our business model in our quest to be a customer-centric, tech-led company. We have lots of ideas and discussions and it’s exciting to bring these on stage, to talk about what’s been done and how we’ve developed. It’s a great chance to discuss what will come in the future, especially as more and more companies move to the cloud. And, of course, it’s an opportunity to get feedback from other users and network with the Camunda Community.
### Q: Are there any CamundaCon presentations/events that you’re looking forward to?
A: We’d like to see: Magenta Housekeeping: Dealing with a huge amount of Camunda historical data effectively, with Artem Grebnjev. Unfortunately, he’s speaking at the same time as us on the Community stage, so that might be a bit tricky. Plus, hacking on the WorkShip seems like a promising event!
Don’t miss Niko and Matthias’ presentation: Transformation from a self-built process engine to Camunda in the Cloud, on September 12th on the Plenum track.
## Abstract:
Workflows, process automation and system integration have been topics at AXA for many years. Since 2015 Camunda has played a significant role in the tool portfolio for implementing processes. AXA and viadee IT Consulting will talk about their experiences integrating Camunda into the IT-Landscape of AXA Germany.
In this session we will travel back in time to the beginning of our self-developed workflow solution at AXA, show the transformation path to Camunda, and reflect on how the handling of processes in the organization has changed. There will be insights into the integration of Camunda with the existing application landscape and the cooperation between Business Units and IT departments.
AXA is on the move and we transform continuously. Currently, we're moving Camunda into a scalable and distributed Cloud architecture and would like to outline our approach, as well as the organizational and technical framework. Last but not least, we share our thoughts on what it means to "cloudify" a workflow solution in an entity like AXA Germany.
| {
"content_hash": "849b4f9be6366b0e73717ac281b55e74",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 614,
"avg_line_length": 77.76785714285714,
"alnum_prop": 0.7839265212399541,
"repo_name": "camunda/blog.camunda.org",
"id": "69048c3cd0a7e98abb23b04f620eb78dfc8ee6fc",
"size": "4399",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "content/post/2019/07/transformation-from-a-self-built-process-engine.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "33751"
},
{
"name": "HTML",
"bytes": "30214"
},
{
"name": "JavaScript",
"bytes": "24409"
},
{
"name": "Makefile",
"bytes": "1483"
}
],
"symlink_target": ""
} |
import sys
from typing import cast, Iterable, List, Tuple, TYPE_CHECKING, Union
from pyspark import since, SparkContext
from pyspark.sql.column import _to_seq, _to_java_column
from py4j.java_gateway import JavaObject
if TYPE_CHECKING:
from pyspark.sql._typing import ColumnOrName, ColumnOrName_
__all__ = ["Window", "WindowSpec"]
def _to_java_cols(cols: Tuple[Union["ColumnOrName", List["ColumnOrName_"]], ...]) -> int:
sc = SparkContext._active_spark_context
if len(cols) == 1 and isinstance(cols[0], list):
cols = cols[0] # type: ignore[assignment]
assert sc is not None
return _to_seq(sc, cast(Iterable["ColumnOrName"], cols), _to_java_column)
class Window:
"""
Utility functions for defining window in DataFrames.
.. versionadded:: 1.4
Notes
-----
When ordering is not defined, an unbounded window frame (rowFrame,
unboundedPreceding, unboundedFollowing) is used by default. When ordering is defined,
a growing window frame (rangeFrame, unboundedPreceding, currentRow) is used by default.
Examples
--------
>>> # ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
>>> window = Window.orderBy("date").rowsBetween(Window.unboundedPreceding, Window.currentRow)
>>> # PARTITION BY country ORDER BY date RANGE BETWEEN 3 PRECEDING AND 3 FOLLOWING
>>> window = Window.orderBy("date").partitionBy("country").rangeBetween(-3, 3)
"""
_JAVA_MIN_LONG = -(1 << 63) # -9223372036854775808
_JAVA_MAX_LONG = (1 << 63) - 1 # 9223372036854775807
_PRECEDING_THRESHOLD = max(-sys.maxsize, _JAVA_MIN_LONG)
_FOLLOWING_THRESHOLD = min(sys.maxsize, _JAVA_MAX_LONG)
unboundedPreceding: int = _JAVA_MIN_LONG
unboundedFollowing: int = _JAVA_MAX_LONG
currentRow: int = 0
@staticmethod
@since(1.4)
def partitionBy(*cols: Union["ColumnOrName", List["ColumnOrName_"]]) -> "WindowSpec":
"""
Creates a :class:`WindowSpec` with the partitioning defined.
Parameters
----------
cols : str, :class:`Column` or list
names of columns or expressions
"""
sc = SparkContext._active_spark_context
assert sc is not None and sc._jvm is not None
jspec = sc._jvm.org.apache.spark.sql.expressions.Window.partitionBy(_to_java_cols(cols))
return WindowSpec(jspec)
@staticmethod
@since(1.4)
def orderBy(*cols: Union["ColumnOrName", List["ColumnOrName_"]]) -> "WindowSpec":
"""
Creates a :class:`WindowSpec` with the ordering defined.
Parameters
----------
cols : str, :class:`Column` or list
names of columns or expressions
"""
sc = SparkContext._active_spark_context
assert sc is not None and sc._jvm is not None
jspec = sc._jvm.org.apache.spark.sql.expressions.Window.orderBy(_to_java_cols(cols))
return WindowSpec(jspec)
@staticmethod
def rowsBetween(start: int, end: int) -> "WindowSpec":
"""
Creates a :class:`WindowSpec` with the frame boundaries defined,
from `start` (inclusive) to `end` (inclusive).
Both `start` and `end` are relative positions from the current row.
For example, "0" means "current row", while "-1" means the row before
the current row, and "5" means the fifth row after the current row.
We recommend users use ``Window.unboundedPreceding``, ``Window.unboundedFollowing``,
and ``Window.currentRow`` to specify special boundary values, rather than using integral
values directly.
A row based boundary is based on the position of the row within the partition.
An offset indicates the number of rows above or below the current row, the frame for the
current row starts or ends. For instance, given a row based sliding frame with a lower bound
offset of -1 and a upper bound offset of +2. The frame for row with index 5 would range from
index 4 to index 7.
.. versionadded:: 2.1.0
Parameters
----------
start : int
boundary start, inclusive.
The frame is unbounded if this is ``Window.unboundedPreceding``, or
any value less than or equal to -9223372036854775808.
end : int
boundary end, inclusive.
The frame is unbounded if this is ``Window.unboundedFollowing``, or
any value greater than or equal to 9223372036854775807.
Examples
--------
>>> from pyspark.sql import Window
>>> from pyspark.sql import functions as func
>>> df = spark.createDataFrame(
... [(1, "a"), (1, "a"), (2, "a"), (1, "b"), (2, "b"), (3, "b")], ["id", "category"])
>>> df.show()
+---+--------+
| id|category|
+---+--------+
| 1| a|
| 1| a|
| 2| a|
| 1| b|
| 2| b|
| 3| b|
+---+--------+
Calculate sum of ``id`` in the range from currentRow to currentRow + 1
in partition ``category``
>>> window = Window.partitionBy("category").orderBy("id").rowsBetween(Window.currentRow, 1)
>>> df.withColumn("sum", func.sum("id").over(window)).sort("id", "category", "sum").show()
+---+--------+---+
| id|category|sum|
+---+--------+---+
| 1| a| 2|
| 1| a| 3|
| 1| b| 3|
| 2| a| 2|
| 2| b| 5|
| 3| b| 3|
+---+--------+---+
"""
if start <= Window._PRECEDING_THRESHOLD:
start = Window.unboundedPreceding
if end >= Window._FOLLOWING_THRESHOLD:
end = Window.unboundedFollowing
sc = SparkContext._active_spark_context
assert sc is not None and sc._jvm is not None
jspec = sc._jvm.org.apache.spark.sql.expressions.Window.rowsBetween(start, end)
return WindowSpec(jspec)
@staticmethod
def rangeBetween(start: int, end: int) -> "WindowSpec":
"""
Creates a :class:`WindowSpec` with the frame boundaries defined,
from `start` (inclusive) to `end` (inclusive).
Both `start` and `end` are relative from the current row. For example,
"0" means "current row", while "-1" means one off before the current row,
and "5" means the five off after the current row.
We recommend users use ``Window.unboundedPreceding``, ``Window.unboundedFollowing``,
and ``Window.currentRow`` to specify special boundary values, rather than using integral
values directly.
A range-based boundary is based on the actual value of the ORDER BY
expression(s). An offset is used to alter the value of the ORDER BY expression, for
instance if the current ORDER BY expression has a value of 10 and the lower bound offset
is -3, the resulting lower bound for the current row will be 10 - 3 = 7. This however puts a
number of constraints on the ORDER BY expressions: there can be only one expression and this
expression must have a numerical data type. An exception can be made when the offset is
unbounded, because no value modification is needed, in this case multiple and non-numeric
ORDER BY expression are allowed.
.. versionadded:: 2.1.0
Parameters
----------
start : int
boundary start, inclusive.
The frame is unbounded if this is ``Window.unboundedPreceding``, or
any value less than or equal to max(-sys.maxsize, -9223372036854775808).
end : int
boundary end, inclusive.
The frame is unbounded if this is ``Window.unboundedFollowing``, or
any value greater than or equal to min(sys.maxsize, 9223372036854775807).
Examples
--------
>>> from pyspark.sql import Window
>>> from pyspark.sql import functions as func
>>> df = spark.createDataFrame(
... [(1, "a"), (1, "a"), (2, "a"), (1, "b"), (2, "b"), (3, "b")], ["id", "category"])
>>> df.show()
+---+--------+
| id|category|
+---+--------+
| 1| a|
| 1| a|
| 2| a|
| 1| b|
| 2| b|
| 3| b|
+---+--------+
Calculate sum of ``id`` in the range from ``id`` of currentRow to ``id`` of currentRow + 1
in partition ``category``
>>> window = Window.partitionBy("category").orderBy("id").rangeBetween(Window.currentRow, 1)
>>> df.withColumn("sum", func.sum("id").over(window)).sort("id", "category").show()
+---+--------+---+
| id|category|sum|
+---+--------+---+
| 1| a| 4|
| 1| a| 4|
| 1| b| 3|
| 2| a| 2|
| 2| b| 5|
| 3| b| 3|
+---+--------+---+
"""
if start <= Window._PRECEDING_THRESHOLD:
start = Window.unboundedPreceding
if end >= Window._FOLLOWING_THRESHOLD:
end = Window.unboundedFollowing
sc = SparkContext._active_spark_context
assert sc is not None and sc._jvm is not None
jspec = sc._jvm.org.apache.spark.sql.expressions.Window.rangeBetween(start, end)
return WindowSpec(jspec)
class WindowSpec:
"""
A window specification that defines the partitioning, ordering,
and frame boundaries.
Use the static methods in :class:`Window` to create a :class:`WindowSpec`.
.. versionadded:: 1.4.0
"""
def __init__(self, jspec: JavaObject) -> None:
self._jspec = jspec
def partitionBy(self, *cols: Union["ColumnOrName", List["ColumnOrName_"]]) -> "WindowSpec":
"""
Defines the partitioning columns in a :class:`WindowSpec`.
.. versionadded:: 1.4.0
Parameters
----------
cols : str, :class:`Column` or list
names of columns or expressions
"""
return WindowSpec(self._jspec.partitionBy(_to_java_cols(cols)))
def orderBy(self, *cols: Union["ColumnOrName", List["ColumnOrName_"]]) -> "WindowSpec":
"""
Defines the ordering columns in a :class:`WindowSpec`.
.. versionadded:: 1.4.0
Parameters
----------
cols : str, :class:`Column` or list
names of columns or expressions
"""
return WindowSpec(self._jspec.orderBy(_to_java_cols(cols)))
def rowsBetween(self, start: int, end: int) -> "WindowSpec":
"""
Defines the frame boundaries, from `start` (inclusive) to `end` (inclusive).
Both `start` and `end` are relative positions from the current row.
For example, "0" means "current row", while "-1" means the row before
the current row, and "5" means the fifth row after the current row.
We recommend users use ``Window.unboundedPreceding``, ``Window.unboundedFollowing``,
and ``Window.currentRow`` to specify special boundary values, rather than using integral
values directly.
.. versionadded:: 1.4.0
Parameters
----------
start : int
boundary start, inclusive.
The frame is unbounded if this is ``Window.unboundedPreceding``, or
any value less than or equal to max(-sys.maxsize, -9223372036854775808).
end : int
boundary end, inclusive.
The frame is unbounded if this is ``Window.unboundedFollowing``, or
any value greater than or equal to min(sys.maxsize, 9223372036854775807).
"""
if start <= Window._PRECEDING_THRESHOLD:
start = Window.unboundedPreceding
if end >= Window._FOLLOWING_THRESHOLD:
end = Window.unboundedFollowing
return WindowSpec(self._jspec.rowsBetween(start, end))
def rangeBetween(self, start: int, end: int) -> "WindowSpec":
"""
Defines the frame boundaries, from `start` (inclusive) to `end` (inclusive).
Both `start` and `end` are relative from the current row. For example,
"0" means "current row", while "-1" means one off before the current row,
and "5" means the five off after the current row.
We recommend users use ``Window.unboundedPreceding``, ``Window.unboundedFollowing``,
and ``Window.currentRow`` to specify special boundary values, rather than using integral
values directly.
.. versionadded:: 1.4.0
Parameters
----------
start : int
boundary start, inclusive.
The frame is unbounded if this is ``Window.unboundedPreceding``, or
any value less than or equal to max(-sys.maxsize, -9223372036854775808).
end : int
boundary end, inclusive.
The frame is unbounded if this is ``Window.unboundedFollowing``, or
any value greater than or equal to min(sys.maxsize, 9223372036854775807).
"""
if start <= Window._PRECEDING_THRESHOLD:
start = Window.unboundedPreceding
if end >= Window._FOLLOWING_THRESHOLD:
end = Window.unboundedFollowing
return WindowSpec(self._jspec.rangeBetween(start, end))
def _test() -> None:
import doctest
from pyspark.sql import SparkSession
import pyspark.sql.window
globs = pyspark.sql.window.__dict__.copy()
spark = SparkSession.builder.master("local[4]").appName("sql.window tests").getOrCreate()
globs["spark"] = spark
(failure_count, test_count) = doctest.testmod(
pyspark.sql.window, globs=globs, optionflags=doctest.NORMALIZE_WHITESPACE
)
spark.stop()
if failure_count:
sys.exit(-1)
if __name__ == "__main__":
_test()
| {
"content_hash": "f25773aac43e6d8774d2f95ab258e606",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 100,
"avg_line_length": 38.03013698630137,
"alnum_prop": 0.5881420646927454,
"repo_name": "WeichenXu123/spark",
"id": "7bb59f362898c19929f158fa629933e486b5f985",
"size": "14666",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "python/pyspark/sql/window.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "58123"
},
{
"name": "Batchfile",
"bytes": "27405"
},
{
"name": "C",
"bytes": "1493"
},
{
"name": "CSS",
"bytes": "26338"
},
{
"name": "Dockerfile",
"bytes": "16097"
},
{
"name": "HTML",
"bytes": "42080"
},
{
"name": "HiveQL",
"bytes": "1859465"
},
{
"name": "Java",
"bytes": "4699504"
},
{
"name": "JavaScript",
"bytes": "222842"
},
{
"name": "Jupyter Notebook",
"bytes": "4310512"
},
{
"name": "Makefile",
"bytes": "2379"
},
{
"name": "PLpgSQL",
"bytes": "352609"
},
{
"name": "PowerShell",
"bytes": "4221"
},
{
"name": "Python",
"bytes": "7728379"
},
{
"name": "R",
"bytes": "1286372"
},
{
"name": "ReScript",
"bytes": "240"
},
{
"name": "Roff",
"bytes": "31582"
},
{
"name": "Scala",
"bytes": "43493445"
},
{
"name": "Shell",
"bytes": "241106"
},
{
"name": "Thrift",
"bytes": "2016"
},
{
"name": "q",
"bytes": "111129"
}
],
"symlink_target": ""
} |
typedef size_t __swift_size_t;
#else
typedef __SIZE_TYPE__ __swift_size_t;
#endif
// This selects the signed equivalent of the unsigned type chosen for size_t.
typedef __typeof__(_Generic((__swift_size_t)0, \
unsigned long long int : (long long int)0, \
unsigned long int : (long int)0, \
unsigned int : (int)0, \
unsigned short : (short)0, \
unsigned char : (signed char)0)) __swift_ssize_t;
#endif // SWIFT_STDLIB_SHIMS_SWIFT_STDDEF_H
| {
"content_hash": "2268ad77c0b4a64e154ed637e06d7382",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 80,
"avg_line_length": 49.214285714285715,
"alnum_prop": 0.4397677793904209,
"repo_name": "brentdax/swift",
"id": "eb7df543bcacc748279baba1dbbf2a381366092f",
"size": "1790",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "stdlib/public/SwiftShims/SwiftStddef.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "34"
},
{
"name": "C",
"bytes": "205124"
},
{
"name": "C++",
"bytes": "30580826"
},
{
"name": "CMake",
"bytes": "468248"
},
{
"name": "D",
"bytes": "1107"
},
{
"name": "DTrace",
"bytes": "2438"
},
{
"name": "Emacs Lisp",
"bytes": "57210"
},
{
"name": "LLVM",
"bytes": "70800"
},
{
"name": "Makefile",
"bytes": "1841"
},
{
"name": "Objective-C",
"bytes": "382820"
},
{
"name": "Objective-C++",
"bytes": "243321"
},
{
"name": "Perl",
"bytes": "2211"
},
{
"name": "Python",
"bytes": "1333445"
},
{
"name": "Ruby",
"bytes": "2091"
},
{
"name": "Shell",
"bytes": "212537"
},
{
"name": "Swift",
"bytes": "25158306"
},
{
"name": "Vim script",
"bytes": "16250"
}
],
"symlink_target": ""
} |
package null
import (
"encoding/json"
"math"
"reflect"
"strconv"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
)
var (
floatJSON = []byte(`1.2345`)
floatJSONString = []byte(`"1.2345"`)
floatBlankJSON = []byte(`""`)
nullFloatJSON = []byte(`{"Float64":1.2345,"Valid":true}`)
nullFloatJSONString = []byte(`{"Float64":"1.2345","Valid":true}`)
)
func TestFloatFrom(t *testing.T) {
f := FloatFrom(1.2345)
assertFloat(t, f, "FloatFrom()")
zero := FloatFrom(0)
if !zero.Valid {
t.Error("FloatFrom(0)", "is invalid, but should be valid")
}
}
func TestFloatFromPtr(t *testing.T) {
n := float64(1.2345)
iptr := &n
f := FloatFromPtr(iptr)
assertFloat(t, f, "FloatFromPtr()")
null := FloatFromPtr(nil)
assertNullFloat(t, null, "FloatFromPtr(nil)")
}
func TestUnmarshalFloat(t *testing.T) {
tests := []struct {
in []byte
exp Float
expErrType reflect.Type
expErrTypeEasy reflect.Type
}{
{
in: floatJSON,
exp: FloatFrom(1.2345),
},
{
in: floatJSONString,
exp: FloatFrom(1.2345),
},
{
in: []byte(` "1.2345" `),
exp: FloatFrom(1.2345),
},
{
in: nullFloatJSON,
exp: FloatFrom(1.2345),
},
{
in: nullFloatJSONString,
exp: FloatFrom(1.2345),
},
{
in: nullJSON,
},
{
in: boolJSON,
expErrType: reflect.TypeOf((*strconv.NumError)(nil)),
expErrTypeEasy: reflect.TypeOf((*jlexer.LexerError)(nil)),
},
{
in: invalidJSON,
expErrType: reflect.TypeOf((*json.SyntaxError)(nil)),
expErrTypeEasy: reflect.TypeOf((*jlexer.LexerError)(nil)),
},
{
in: []byte(`{"Float64": true, "Valid": true}`),
expErrType: reflect.TypeOf((*json.UnmarshalTypeError)(nil)),
expErrTypeEasy: reflect.TypeOf((*jlexer.LexerError)(nil)),
},
}
for _, test := range tests {
t.Run(string(test.in), func(t *testing.T) {
var f Float
err := json.Unmarshal(test.in, &f)
if err != nil {
if test.expErrType == nil {
t.Fatal(err)
}
if reflect.TypeOf(err) != test.expErrType {
t.Fatalf("error %s(%T) is not of type %s", err, err, test.expErrType)
}
} else if test.expErrType != nil {
t.Fatal("expected an error")
}
if diff := cmp.Diff(test.exp, f); diff != "" {
t.Fatalf("result not as expected. %s", diff)
}
})
t.Run(string(test.in)+"_easyjson", func(t *testing.T) {
var f Float
var err error
allocs := testing.AllocsPerRun(10, func() {
err = easyjson.Unmarshal(test.in, &f)
})
if err != nil {
if test.expErrTypeEasy == nil {
t.Fatal(err)
}
if reflect.TypeOf(err) != test.expErrTypeEasy {
t.Fatalf("error %s(%T) is not of type %s", err, err, test.expErrTypeEasy)
}
} else if test.expErrTypeEasy != nil {
t.Fatal("expected an error")
}
if test.expErrTypeEasy == nil && allocs > 0 {
t.Fatalf("easyjson made %.0f allocations unmarshalling %T from: %s", allocs, f, test.in)
}
if diff := cmp.Diff(test.exp, f); diff != "" {
t.Fatalf("result not as expected. %s", diff)
}
})
}
}
func BenchmarkFloatUnmarshal(b *testing.B) {
tests := [][]byte{
floatJSON,
floatJSONString,
[]byte(` "1.2345" `),
nullFloatJSON,
nullJSON,
}
for _, test := range tests {
b.Run(string(test), func(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
var ii Float
if err := json.Unmarshal(test, &ii); err != nil {
b.Fatal(err)
}
}
})
b.Run("easy "+string(test), func(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
w := &jlexer.Lexer{Data: test}
var ii Float
ii.UnmarshalEasyJSON(w)
if err := w.Error(); err != nil {
b.Fatal(err)
}
}
})
}
}
func TestTextUnmarshalFloat(t *testing.T) {
var f Float
err := f.UnmarshalText([]byte("1.2345"))
maybePanic(err)
assertFloat(t, f, "UnmarshalText() float")
var blank Float
err = blank.UnmarshalText([]byte(""))
maybePanic(err)
assertNullFloat(t, blank, "UnmarshalText() empty float")
var null Float
err = null.UnmarshalText(nullLiteral)
maybePanic(err)
assertNullFloat(t, null, `UnmarshalText() "null"`)
var invalid Float
err = invalid.UnmarshalText([]byte("hello world"))
if err == nil {
panic("expected error")
}
}
func TestMarshalFloat(t *testing.T) {
f := FloatFrom(1.2345)
data, err := json.Marshal(f)
maybePanic(err)
assertJSONEquals(t, data, "1.2345", "non-empty json marshal")
// invalid values should be encoded as null
null := NewFloat(0, false)
data, err = json.Marshal(null)
maybePanic(err)
assertJSONEquals(t, data, "null", "null json marshal")
}
func TestMarshalFloatText(t *testing.T) {
f := FloatFrom(1.2345)
data, err := f.MarshalText()
maybePanic(err)
assertJSONEquals(t, data, "1.2345", "non-empty text marshal")
// invalid values should be encoded as null
null := NewFloat(0, false)
data, err = null.MarshalText()
maybePanic(err)
assertJSONEquals(t, data, "", "null text marshal")
}
func TestFloatPointer(t *testing.T) {
f := FloatFrom(1.2345)
ptr := f.Ptr()
if *ptr != 1.2345 {
t.Errorf("bad %s float: %#v ≠ %v\n", "pointer", ptr, 1.2345)
}
null := NewFloat(0, false)
ptr = null.Ptr()
if ptr != nil {
t.Errorf("bad %s float: %#v ≠ %s\n", "nil pointer", ptr, "nil")
}
}
func TestFloatIsZero(t *testing.T) {
f := FloatFrom(1.2345)
if f.IsZero() {
t.Errorf("IsZero() should be false")
}
null := NewFloat(0, false)
if !null.IsZero() {
t.Errorf("IsZero() should be true")
}
zero := NewFloat(0, true)
if zero.IsZero() {
t.Errorf("IsZero() should be false")
}
}
func TestFloatSetValid(t *testing.T) {
change := NewFloat(0, false)
assertNullFloat(t, change, "SetValid()")
change.SetValid(1.2345)
assertFloat(t, change, "SetValid()")
}
func TestFloatScan(t *testing.T) {
var f Float
err := f.Scan(1.2345)
maybePanic(err)
assertFloat(t, f, "scanned float")
var sf Float
err = sf.Scan("1.2345")
maybePanic(err)
assertFloat(t, sf, "scanned string float")
var null Float
err = null.Scan(nil)
maybePanic(err)
assertNullFloat(t, null, "scanned null")
}
func TestFloatInfNaN(t *testing.T) {
nan := NewFloat(math.NaN(), true)
_, err := nan.MarshalJSON()
if err == nil {
t.Error("expected error for NaN, got nil")
}
inf := NewFloat(math.Inf(1), true)
_, err = inf.MarshalJSON()
if err == nil {
t.Error("expected error for Inf, got nil")
}
}
func TestFloatValueOrZero(t *testing.T) {
valid := NewFloat(1.2345, true)
if valid.ValueOrZero() != 1.2345 {
t.Error("unexpected ValueOrZero", valid.ValueOrZero())
}
invalid := NewFloat(1.2345, false)
if invalid.ValueOrZero() != 0 {
t.Error("unexpected ValueOrZero", invalid.ValueOrZero())
}
}
func TestFloatEqual(t *testing.T) {
f1 := NewFloat(10, false)
f2 := NewFloat(10, false)
assertFloatEqualIsTrue(t, f1, f2)
f1 = NewFloat(10, false)
f2 = NewFloat(20, false)
assertFloatEqualIsTrue(t, f1, f2)
f1 = NewFloat(10, true)
f2 = NewFloat(10, true)
assertFloatEqualIsTrue(t, f1, f2)
f1 = NewFloat(10, true)
f2 = NewFloat(10, false)
assertFloatEqualIsFalse(t, f1, f2)
f1 = NewFloat(10, false)
f2 = NewFloat(10, true)
assertFloatEqualIsFalse(t, f1, f2)
f1 = NewFloat(10, true)
f2 = NewFloat(20, true)
assertFloatEqualIsFalse(t, f1, f2)
}
func assertFloat(t *testing.T, f Float, from string) {
if f.Float64 != 1.2345 {
t.Errorf("bad %s float: %f ≠ %f\n", from, f.Float64, 1.2345)
}
if !f.Valid {
t.Error(from, "is invalid, but should be valid")
}
}
func assertNullFloat(t *testing.T, f Float, from string) {
if f.Valid {
t.Error(from, "is valid, but should be invalid")
}
}
func assertFloatEqualIsTrue(t *testing.T, a, b Float) {
t.Helper()
if !a.Equal(b) {
t.Errorf("Equal() of Float{%v, Valid:%t} and Float{%v, Valid:%t} should return true", a.Float64, a.Valid, b.Float64, b.Valid)
}
}
func assertFloatEqualIsFalse(t *testing.T, a, b Float) {
t.Helper()
if a.Equal(b) {
t.Errorf("Equal() of Float{%v, Valid:%t} and Float{%v, Valid:%t} should return false", a.Float64, a.Valid, b.Float64, b.Valid)
}
}
| {
"content_hash": "6c92caaff933be0447b79e1ba931f6f0",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 128,
"avg_line_length": 22.98583569405099,
"alnum_prop": 0.626694601922603,
"repo_name": "unravelin/null",
"id": "e6f3115cda8f963de13a8b32cb56bd81be82cf6c",
"size": "8120",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "float_test.go",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Go",
"bytes": "111637"
}
],
"symlink_target": ""
} |
/*
* Copyright (C) 2004,
*
* Arjuna Technologies Ltd,
* Newcastle upon Tyne,
* Tyne and Wear,
* UK.
*
* $Id: xidcheck.java 2342 2006-03-30 13:06:17Z $
*/
package com.hp.mwtests.ts.jta.jts.recovery;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.arjuna.ats.arjuna.common.Uid;
import com.arjuna.ats.internal.jta.recovery.jts.XARecoveryResourceManagerImple;
import com.hp.mwtests.ts.jta.jts.common.DummyXA;
public class XARecoveryResourceManagerUnitTest
{
@Test
public void test ()
{
XARecoveryResourceManagerImple man = new XARecoveryResourceManagerImple();
assertTrue(man.getResource(new Uid()) != null);
assertTrue(man.getResource(new Uid(), new DummyXA(false)) != null);
}
}
| {
"content_hash": "f2cfd8c12541d9bab633c3642826a028",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 82,
"avg_line_length": 22.764705882352942,
"alnum_prop": 0.6976744186046512,
"repo_name": "nmcl/scratch",
"id": "bc2b1c227719eb12009b1feb9a44ffc47fa8fd61",
"size": "1759",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "graalvm/transactions/fork/narayana/ArjunaJTS/jtax/tests/classes/com/hp/mwtests/ts/jta/jts/recovery/XARecoveryResourceManagerUnitTest.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "37106"
},
{
"name": "Batchfile",
"bytes": "70668"
},
{
"name": "C",
"bytes": "139579"
},
{
"name": "C++",
"bytes": "3001008"
},
{
"name": "CSS",
"bytes": "2238"
},
{
"name": "Clojure",
"bytes": "1535"
},
{
"name": "Dockerfile",
"bytes": "4325"
},
{
"name": "Erlang",
"bytes": "33048"
},
{
"name": "Go",
"bytes": "333"
},
{
"name": "HTML",
"bytes": "1423375"
},
{
"name": "Haskell",
"bytes": "3992"
},
{
"name": "Io",
"bytes": "11232"
},
{
"name": "Java",
"bytes": "22796079"
},
{
"name": "JavaScript",
"bytes": "10464"
},
{
"name": "Makefile",
"bytes": "78159"
},
{
"name": "PHP",
"bytes": "175"
},
{
"name": "PowerShell",
"bytes": "3549"
},
{
"name": "Prolog",
"bytes": "17925"
},
{
"name": "Python",
"bytes": "23464"
},
{
"name": "Roff",
"bytes": "3575"
},
{
"name": "Ruby",
"bytes": "12190"
},
{
"name": "Rust",
"bytes": "880"
},
{
"name": "Scala",
"bytes": "4608"
},
{
"name": "Shell",
"bytes": "165574"
},
{
"name": "Swift",
"bytes": "211"
},
{
"name": "XSLT",
"bytes": "16312"
}
],
"symlink_target": ""
} |
<?php
/**
* The Zend_Service_SlideShare_SlideShow class represents a slide show on the
* slideshare.net servers.
*
* @category Zend
* @package Zend_Service
* @subpackage SlideShare
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Service_SlideShare_SlideShow
{
/**
* Status constant mapping for web service
*
*/
const STATUS_QUEUED = 0;
const STATUS_PROCESSING = 1;
const STATUS_READY = 2;
const STATUS_FAILED = 3;
/**
* The HTML code to embed the slide show in a web page
*
* @var string the HTML to embed the slide show
*/
protected $_embedCode;
/**
* The URI for the thumbnail representation of the slide show
*
* @var string The URI of a thumbnail image
*/
protected $_thumbnailUrl;
/**
* The title of the slide show
*
* @var string The slide show title
*/
protected $_title;
/**
* The Description of the slide show
*
* @var string The slide show description
*/
protected $_description;
/**
* The status of the silde show on the server
*
* @var int The Slide show status code
*/
protected $_status;
/**
* The Description of the slide show status code
*
* @var string The status description
*/
protected $_statusDescription;
/**
* The Permanent link for the slide show
*
* @var string the Permalink for the slide show
*/
protected $_permalink;
/**
* The number of views this slide show has received
*
* @var int the number of views
*/
protected $_numViews;
/**
* The ID of the slide show on the server
*
* @var int the Slide show ID number on the server
*/
protected $_slideShowId;
/**
* A slide show filename on the local filesystem (when uploading)
*
* @var string the local filesystem path & file of the slide show to upload
*/
protected $_slideShowFilename;
/**
* An array of tags associated with the slide show
*
* @var array An array of tags associated with the slide show
*/
protected $_tags = array();
/**
* The location of the slide show
*
* @var string the Location
*/
protected $_location;
/**
* The transcript associated with the slide show
*
* @var string the Transscript
*/
protected $_transcript;
/**
* Retrieves the location of the slide show
*
* @return string the Location
*/
public function getLocation()
{
return $this->_location;
}
/**
* Sets the location of the slide show
*
* @param string $loc The location to use
* @return Zend_Service_SlideShare_SlideShow
*/
public function setLocation($loc)
{
$this->_location = (string)$loc;
return $this;
}
/**
* Gets the transcript for this slide show
*
* @return string the Transcript
*/
public function getTranscript()
{
return $this->_transcript;
}
/**
* Sets the transcript for this slide show
*
* @param string $t The transcript
* @return Zend_Service_SlideShare_SlideShow
*/
public function setTranscript($t)
{
$this->_transcript = (string)$t;
return $this;
}
/**
* Adds a tag to the slide show
*
* @param string $tag The tag to add
* @return Zend_Service_SlideShare_SlideShow
*/
public function addTag($tag)
{
$this->_tags[] = (string)$tag;
return $this;
}
/**
* Sets the tags for the slide show
*
* @param array $tags An array of tags to set
* @return Zend_Service_SlideShare_SlideShow
*/
public function setTags(Array $tags)
{
$this->_tags = $tags;
return $this;
}
/**
* Gets all of the tags associated with the slide show
*
* @return array An array of tags for the slide show
*/
public function getTags()
{
return $this->_tags;
}
/**
* Sets the filename on the local filesystem of the slide show
* (for uploading a new slide show)
*
* @param string $file The full path & filename to the slide show
* @return Zend_Service_SlideShare_SlideShow
*/
public function setFilename($file)
{
$this->_slideShowFilename = (string)$file;
return $this;
}
/**
* Retrieves the filename on the local filesystem of the slide show
* which will be uploaded
*
* @return string The full path & filename to the slide show
*/
public function getFilename()
{
return $this->_slideShowFilename;
}
/**
* Sets the ID for the slide show
*
* @param int $id The slide show ID
* @return Zend_Service_SlideShare_SlideShow
*/
public function setId($id)
{
$this->_slideShowId = (string)$id;
return $this;
}
/**
* Gets the ID for the slide show
*
* @return int The slide show ID
*/
public function getId()
{
return $this->_slideShowId;
}
/**
* Sets the HTML embed code for the slide show
*
* @param string $code The HTML embed code
* @return Zend_Service_SlideShare_SlideShow
*/
public function setEmbedCode($code)
{
$this->_embedCode = (string)$code;
return $this;
}
/**
* Retrieves the HTML embed code for the slide show
*
* @return string the HTML embed code
*/
public function getEmbedCode()
{
return $this->_embedCode;
}
/**
* Sets the Thumbnail URI for the slide show
*
* @param string $url The URI for the thumbnail image
* @return Zend_Service_SlideShare_SlideShow
*/
public function setThumbnailUrl($url)
{
$this->_thumbnailUrl = (string) $url;
return $this;
}
/**
* Retrieves the Thumbnail URi for the slide show
*
* @return string The URI for the thumbnail image
*/
public function getThumbnailUrl()
{
return $this->_thumbnailUrl;
}
/**
* Sets the title for the Slide show
*
* @param string $title The slide show title
* @return Zend_Service_SlideShare_SlideShow
*/
public function setTitle($title)
{
$this->_title = (string)$title;
return $this;
}
/**
* Retrieves the Slide show title
*
* @return string the Slide show title
*/
public function getTitle()
{
return $this->_title;
}
/**
* Sets the description for the Slide show
*
* @param strign $desc The description of the slide show
* @return Zend_Service_SlideShare_SlideShow
*/
public function setDescription($desc)
{
$this->_description = (string)$desc;
return $this;
}
/**
* Gets the description of the slide show
*
* @return string The slide show description
*/
public function getDescription()
{
return $this->_description;
}
/**
* Sets the numeric status of the slide show on the server
*
* @param int $status The numeric status on the server
* @return Zend_Service_SlideShare_SlideShow
*/
public function setStatus($status)
{
$this->_status = (int)$status;
return $this;
}
/**
* Gets the numeric status of the slide show on the server
*
* @return int A Zend_Service_SlideShare_SlideShow Status constant
*/
public function getStatus()
{
return $this->_status;
}
/**
* Sets the textual description of the status of the slide show on the server
*
* @param string $desc The textual description of the status of the slide show
* @return Zend_Service_SlideShare_SlideShow
*/
public function setStatusDescription($desc)
{
$this->_statusDescription = (string)$desc;
return $this;
}
/**
* Gets the textual description of the status of the slide show on the server
*
* @return string the textual description of the service
*/
public function getStatusDescription()
{
return $this->_statusDescription;
}
/**
* Sets the permanent link of the slide show
*
* @param string $url The permanent URL for the slide show
* @return Zend_Service_SlideShare_SlideShow
*/
public function setPermaLink($url)
{
$this->_permalink = (string)$url;
return $this;
}
/**
* Gets the permanent link of the slide show
*
* @return string the permanent URL for the slide show
*/
public function getPermaLink()
{
return $this->_permalink;
}
/**
* Sets the number of views the slide show has received
*
* @param int $views The number of views
* @return Zend_Service_SlideShare_SlideShow
*/
public function setNumViews($views)
{
$this->_numViews = (int)$views;
return $this;
}
/**
* Gets the number of views the slide show has received
*
* @return int The number of views
*/
public function getNumViews()
{
return $this->_numViews;
}
} | {
"content_hash": "88cd88484272d96249c9f734f3056bbf",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 87,
"avg_line_length": 22.66267942583732,
"alnum_prop": 0.5790140399028819,
"repo_name": "linkorb/ZendFramework-1.10.8-minimal-patched",
"id": "1b513fe34aa9706d480e9487a6c46456a90f623e",
"size": "10245",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "library/Zend/Service/SlideShare/SlideShow.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
layout: docs
title: Extras
permalink: /docs/extras/
---
There are a number of (optional) extra features that Jekyll supports that you
may want to install, depending on how you plan to use Jekyll.
## Math Support
Kramdown comes with optional support for LaTeX to PNG rendering via [MathJax](http://www.mathjax.org/) within math blocks. See the Kramdown documentation on [math blocks](http://kramdown.gettalong.org/syntax.html#math-blocks) and [math support](http://kramdown.gettalong.org/converter/html.html#math-support) for more details. MathJax requires you to include JavaScript or CSS to render the LaTeX, e.g.
{% highlight html %}
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
{% endhighlight %}
For more information about getting started, check out [this excellent blog post](http://gastonsanchez.com/opinion/2014/02/16/Mathjax-with-jekyll/).
## Alternative Markdown Processors
See the Markdown section on the [configuration page](/docs/configuration/#markdown-options) for instructions on how to use and configure alternative Markdown processors, as well as how to create [custom processors](/docs/configuration/#custom-markdown-processors).
| {
"content_hash": "3baf50f97e6e599347ca2742d8af65b3",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 402,
"avg_line_length": 58.80952380952381,
"alnum_prop": 0.7829959514170041,
"repo_name": "princeofdarkness76/jekyll",
"id": "24bcafa148a1fbda459e89df4bf3bcaa8a7105fd",
"size": "1239",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "site/_docs/extras.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "136"
},
{
"name": "CSS",
"bytes": "49453"
},
{
"name": "CoffeeScript",
"bytes": "202"
},
{
"name": "Cucumber",
"bytes": "112080"
},
{
"name": "HTML",
"bytes": "26301"
},
{
"name": "PHP",
"bytes": "90"
},
{
"name": "Ruby",
"bytes": "507037"
},
{
"name": "Shell",
"bytes": "4748"
}
],
"symlink_target": ""
} |
Classes
=======
.. toctree::
Spectrum, Spectra, and ObsBlocks <spectrum>
SpectroscopicCube and its supporting functions <cubes>
| {
"content_hash": "ac0e03491a81d70a1699a25ba319b9a3",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 59,
"avg_line_length": 23.166666666666668,
"alnum_prop": 0.6906474820143885,
"repo_name": "keflavich/pyspeckit",
"id": "6976bbf302d698d1f835feef5c57e856fdd489de",
"size": "139",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "docs/classes.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "1249069"
},
{
"name": "Shell",
"bytes": "313"
}
],
"symlink_target": ""
} |
import re
from subprocess import Popen, PIPE
import sys
# Super hacky but easier to do than calling Keystone and Heat's APIs
process = Popen(('heat', 'stack-show', 'overcloud'), stdout=PIPE, stderr=PIPE)
output = process.stdout.read()
# If we're in a HA mode (i.e. more than one controller), make sure the
# NtpServer parameters are set.
controller_count = int(re.search(r'"Controller-[^":]*::count"\s*:\s*"([^"]*)"', output).group(1))
if controller_count > 1:
print "This is a HA setup, checking whether NTP is configured."
ntp_servers = re.findall(r'"(Controller|Compute)-[^":]*::NtpServer"\s*:\s*"([^"]*)"', output)
if all(t[1] for t in ntp_servers):
print "SUCCESS: Controller and Compute nodes are configured with NTP."
else:
print "ERROR: NTP server is not configured for Controller or Compute nodes!"
sys.exit(1)
else:
print "SUCESS: This is not a HA setup, we don't need NTP configured."
| {
"content_hash": "475d6729045c97a122f22b7595948181",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 97,
"avg_line_length": 42.86363636363637,
"alnum_prop": 0.6744432661717922,
"repo_name": "coolsvap/clapper",
"id": "e092d7108d0382202b9146167e8c82d975540eb6",
"size": "943",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ntp-ha-test/test.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1526"
},
{
"name": "Python",
"bytes": "60690"
},
{
"name": "Shell",
"bytes": "3142"
}
],
"symlink_target": ""
} |
package org.drools.chance.rule.constraint.core.connectives.impl;
public enum LogicConnectives {
AND,
OR,
MINUS,
XOR,
EQ,
NOT,
IMPL
}
| {
"content_hash": "dfa44a9eb7214d1866c73dda1416f5a1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 64,
"avg_line_length": 12.615384615384615,
"alnum_prop": 0.6280487804878049,
"repo_name": "sotty/drools-chance",
"id": "6fcedf5e5ae88571c8719cb155faaad623fdff9b",
"size": "758",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "drools-chance-core/src/main/java/org/drools/chance/rule/constraint/core/connectives/impl/LogicConnectives.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2712410"
}
],
"symlink_target": ""
} |
module Attune
module Model
# List of ids in ranked order. If an error occurs, returns message and status code.
#
# @attr [String] message Error message if ranking failed
# @attr [String] cell Cell assignment
# @attr [Array<String>] ranking List of ids in ranked order
# @attr [Integer] status HTTP status code if ranking failed
class RankedEntities
attr_accessor :message
attr_accessor :cell
attr_accessor :ranking
attr_accessor :status
def initialize(attributes = {})
return if attributes.empty?
# Workaround since JSON.parse has accessors as strings rather than symbols
@message = attributes["message"] || attributes[:"message"]
# Workaround since JSON.parse has accessors as strings rather than symbols
@cell = attributes["cell"] || attributes[:"cell"]
value = attributes["ranking"] || attributes[:"ranking"]
if value.is_a?(Array)
@ranking = value
end
# Workaround since JSON.parse has accessors as strings rather than symbols
@status = attributes["status"] || attributes[:"status"]
end
def to_body
Hash[ATTRIBUTE_MAP.map do |internal, external|
next unless value = send(internal)
[external, value]
end.compact]
end
def to_json(options = {})
to_body.to_json
end
private
# :internal => :external
ATTRIBUTE_MAP = {
:message => :message,
:cell => :cell,
:ranking => :ranking,
:status => :status
}
end
end
end
| {
"content_hash": "9af117ae59ec18a835078a1e811f83ac",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 87,
"avg_line_length": 26.661290322580644,
"alnum_prop": 0.5910465819721719,
"repo_name": "attune-api/attune-ruby",
"id": "1c2ee7c84d8e7d45594f99e6bcec68b86a3b3c42",
"size": "1653",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/attune/models/ranked_entities.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "64953"
}
],
"symlink_target": ""
} |
package org.apache.pulsar.broker.service;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import lombok.Cleanup;
import org.apache.pulsar.broker.ServiceConfiguration;
import org.apache.pulsar.client.api.Consumer;
import org.apache.pulsar.client.api.Message;
import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.Schema;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@Test(groups = "broker")
public class BusyWaitServiceTest extends BkEnsemblesTestBase {
public BusyWaitServiceTest() {
super(1);
}
protected void configurePulsar(ServiceConfiguration config) {
config.setEnableBusyWait(true);
config.setManagedLedgerDefaultEnsembleSize(1);
config.setManagedLedgerDefaultWriteQuorum(1);
config.setManagedLedgerDefaultAckQuorum(1);
}
@Test
public void testPublishWithBusyWait() throws Exception {
@Cleanup
PulsarClient client = PulsarClient.builder()
.serviceUrl(pulsar.getWebServiceAddress())
.statsInterval(0, TimeUnit.SECONDS)
.enableBusyWait(true)
.build();
String namespace = "prop/busy-wait";
admin.namespaces().createNamespace(namespace);
String topic = namespace + "/my-topic-" + UUID.randomUUID();
@Cleanup
Consumer<String> consumer = client.newConsumer(Schema.STRING)
.topic(topic)
.subscriptionName("test")
.subscribe();
@Cleanup
Producer<String> producer = client.newProducer(Schema.STRING)
.topic(topic)
.create();
for (int i = 0; i < 10; i++) {
producer.send("my-message-" + i);
}
for (int i = 0; i < 10; i++) {
Message<String> msg = consumer.receive();
assertNotNull(msg);
assertEquals(msg.getValue(), "my-message-" + i);
consumer.acknowledge(msg);
}
}
}
| {
"content_hash": "49aed3fca1daab8cf30fc733b11b1a54",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 69,
"avg_line_length": 31.308823529411764,
"alnum_prop": 0.6420854861437294,
"repo_name": "massakam/pulsar",
"id": "03d479aa6808566d6ba6fdd0038579ed535852fe",
"size": "2936",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BusyWaitServiceTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "15099"
},
{
"name": "Dockerfile",
"bytes": "20057"
},
{
"name": "Go",
"bytes": "117008"
},
{
"name": "HCL",
"bytes": "14529"
},
{
"name": "HTML",
"bytes": "822"
},
{
"name": "Java",
"bytes": "31626049"
},
{
"name": "JavaScript",
"bytes": "1385"
},
{
"name": "Lua",
"bytes": "5454"
},
{
"name": "Python",
"bytes": "243009"
},
{
"name": "Shell",
"bytes": "159955"
}
],
"symlink_target": ""
} |
package com.itpkg.core.tasks;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* Created by flamen on 15-7-28.
*/
@Component("core.siteMapJob")
@Slf4j
public class SiteMapJob {
@Scheduled(cron = "0 0 */12 * * *")
public void run() {
if (enable) {
log.info("begin sitemap job");
log.info("end sitemap job");
}
}
@Value("${job.dispatcher}")
boolean enable;
}
| {
"content_hash": "753408bb2941cbbc26ca6d772704e303",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 59,
"avg_line_length": 22.346153846153847,
"alnum_prop": 0.6557659208261618,
"repo_name": "chonglou/itpkg",
"id": "5d13419ba20db79c57ebd3416e75237ca54ab202",
"size": "581",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "core/src/main/java/com/itpkg/core/tasks/SiteMapJob.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "43"
},
{
"name": "HTML",
"bytes": "793"
},
{
"name": "Java",
"bytes": "111252"
},
{
"name": "JavaScript",
"bytes": "25348"
},
{
"name": "Shell",
"bytes": "938"
}
],
"symlink_target": ""
} |
local http_handle = require('resty.shcache')
-- perf
local setmetatable = setmetatable
local Shcache = {}
function Shcache:new()
local instance = {
}
setmetatable(instance, Shcache)
return instance
end
return Shcache | {
"content_hash": "79a8bc5a1d2ea03ec737c4250eeec54c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 44,
"avg_line_length": 14.933333333333334,
"alnum_prop": 0.7455357142857143,
"repo_name": "idevz/vanilla",
"id": "443803846e56c8c58ab3676a7f0736ad433a6fa9",
"size": "282",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "vanilla/v/libs/shcache.lua",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "924"
},
{
"name": "Lua",
"bytes": "189420"
},
{
"name": "Makefile",
"bytes": "1185"
},
{
"name": "Perl",
"bytes": "334464"
},
{
"name": "Shell",
"bytes": "10280"
}
],
"symlink_target": ""
} |
<?php
namespace EasyBib\Tests;
use Silex\WebTestCase;
use Symfony\Component\HttpKernel\HttpKernel;
/**
* Class AppTest
*
* @see http://silex.sensiolabs.org/doc/testing.html
*/
class AppTest extends WebTestCase
{
public function testHelloWorld()
{
$client = $this->createClient();
$client->request('GET', '/hello/world');
$this->assertTrue($client->getResponse()->isOk());
$this->assertContains('Hello world', $client->getResponse()->getContent());
}
/**
* Creates the application.
*
* @return HttpKernel
*/
public function createApplication()
{
return require __DIR__ . '/../../bootstrap.php';
}
}
| {
"content_hash": "0d1eb9a71e6f896efb58877b82962222",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 83,
"avg_line_length": 19.914285714285715,
"alnum_prop": 0.6097560975609756,
"repo_name": "dazz/prototype-silex-angularjs",
"id": "4c013661d4e22d3ff16218676f1be9c449ebe288",
"size": "697",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/EasyBib/Tests/AppTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "3708"
}
],
"symlink_target": ""
} |
license: >
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
---
media.stop
==========
Stops playing an audio file.
media.stop();
Description
-----------
Function `media.stop` is a synchronous function that stops playing an audio file.
Supported Platforms
-------------------
- Android
- BlackBerry WebWorks (OS 5.0 and higher)
- iOS
- Windows Phone 7 and 8
- Tizen
- Windows 8
Quick Example
-------------
// Play audio
//
function playAudio(url) {
// Play the audio file at url
var my_media = new Media(url,
// success callback
function() {
console.log("playAudio():Audio Success");
},
// error callback
function(err) {
console.log("playAudio():Audio Error: "+err);
});
// Play audio
my_media.play();
// Pause after 10 seconds
setTimeout(function() {
my_media.stop();
}, 10000);
}
Full Example
------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Media Example</title>
<script type="text/javascript" charset="utf-8" src="cordova-2.6.0.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
//
function onDeviceReady() {
playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
}
// Audio player
//
var my_media = null;
var mediaTimer = null;
// Play audio
//
function playAudio(src) {
// Create Media object from src
my_media = new Media(src, onSuccess, onError);
// Play audio
my_media.play();
// Update my_media position every second
if (mediaTimer == null) {
mediaTimer = setInterval(function() {
// get my_media position
my_media.getCurrentPosition(
// success callback
function(position) {
if (position > -1) {
setAudioPosition((position) + " sec");
}
},
// error callback
function(e) {
console.log("Error getting pos=" + e);
setAudioPosition("Error: " + e);
}
);
}, 1000);
}
}
// Pause audio
//
function pauseAudio() {
if (my_media) {
my_media.pause();
}
}
// Stop audio
//
function stopAudio() {
if (my_media) {
my_media.stop();
}
clearInterval(mediaTimer);
mediaTimer = null;
}
// onSuccess Callback
//
function onSuccess() {
console.log("playAudio():Audio Success");
}
// onError Callback
//
function onError(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
}
// Set audio position
//
function setAudioPosition(position) {
document.getElementById('audio_position').innerHTML = position;
}
</script>
</head>
<body>
<a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">Play Audio</a>
<a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
<a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
<p id="audio_position"></p>
</body>
</html>
| {
"content_hash": "6343a5fb907003acce354751b9310a7b",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 142,
"avg_line_length": 30.92982456140351,
"alnum_prop": 0.4658725657024012,
"repo_name": "mallzee/cordova-docs",
"id": "24c9d86db2a80b490c3ce09f4c55d72c0b15927e",
"size": "5293",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "docs/en/2.6.0/cordova/media/media.stop.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5116"
},
{
"name": "CSS",
"bytes": "11129"
},
{
"name": "HTML",
"bytes": "113105"
},
{
"name": "JavaScript",
"bytes": "69082"
}
],
"symlink_target": ""
} |
package pablosaraiva.gotobed.model;
import java.util.Date;
import pablosaraiva.gotobed.annotations.DoNotSave;
import pablosaraiva.gotobed.annotations.Sleeper;
import pablosaraiva.gotobed.annotations.SleeperId;
@Sleeper
public class Kid {
@SleeperId
private long myid;
private String name;
private Date birthdate;
@DoNotSave
private String nickname;
public long getId() {
return myid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBirthdate() {
return birthdate;
}
public void setBirthdate(Date birthdate) {
this.birthdate = birthdate;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (myid ^ (myid >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Kid other = (Kid) obj;
if (myid != other.myid)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
}
| {
"content_hash": "a2096432a092db1a159dd65c3112956d",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 67,
"avg_line_length": 19.17391304347826,
"alnum_prop": 0.6349206349206349,
"repo_name": "pablosaraiva/GoToBed",
"id": "6a3cb60734ea0ced27535112fbe97222764650df",
"size": "1323",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/pablosaraiva/gotobed/model/Kid.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "16273"
}
],
"symlink_target": ""
} |
**I will be away for 5 months, starting May. v2 should be the preferred stable release to use. Master has some new changes for SVG that haven't yet endured the test of time, bug reports are appreciated.**
Minify is a minifier package written in [Go][1]. It has build-in HTML5, CSS3, JS, JSON, SVG and XML minifiers and provides an interface to implement any minifier. Minification is the process of removing bytes from a file (such as whitespace) without changing its output and therefore speeding up transmission over the internet. The implemented minifiers are high performance and streaming (which implies O(n)).
It associates minification functions with mimetypes, allowing embedded resources (like CSS or JS in HTML files) to be minified too. The user can add any mime-based implementation. Users can also implement a mimetype using an external command (like the ClosureCompiler, UglifyCSS, ...). It is possible to pass parameters through the mediatype to specify the charset for example.
[Demo](http://go.tacodewolff.nl/) · [CLI](https://github.com/tdewolff/minify/tree/master/cmd/minify) · [Download](https://dl.equinox.io/tdewolff/minify/stable)
#### Table of Contents
- [Minify](#minify---)
- [Prologue](#prologue)
- [Installation](#installation)
- [API stability](#api-stability)
- [Testing](#testing)
- [HTML](#html--)
- [Whitespace removal](#whitespace-removal)
- [CSS](#css--)
- [JS](#js--)
- [JSON](#json--)
- [SVG](#svg--)
- [XML](#xml--)
- [Usage](#usage)
- [New](#new)
- [From reader](#from-reader)
- [From bytes](#from-bytes)
- [From string](#from-string)
- [Custom minifier](#custom-minifier)
- [Mediatypes](#mediatypes)
- [Examples](#examples)
- [Common minifiers](#common-minifiers)
- [Custom minifier](#custom-minifier-1)
- [ResponseWriter](#responsewriter)
- [Templates](#templates)
- [License](#license)
#### Status
* CSS: **fully implemented**
* HTML: **fully implemented**
* JS: basic JSmin-like implementation
* JSON: **fully implemented**
* SVG: partially implemented; in development
* XML: **fully implemented**
## Prologue
Minifiers or bindings to minifiers exist in almost all programming languages. Some implementations are merely using several regular-expressions to trim whitespace and comments (even though regex for parsing HTML/XML is ill-advised, for a good read see [Regular Expressions: Now You Have Two Problems](http://blog.codinghorror.com/regular-expressions-now-you-have-two-problems/)). Some implementations are much more profound, such as the [YUI Compressor](http://yui.github.io/yuicompressor/) and [Google Closure Compiler](https://github.com/google/closure-compiler) for JS. As most existing implementations either use Java or JavaScript and don't focus on performance, they are pretty slow. And loading the whole file into memory is bad for really large files (or impossible for infinite streams).
This minifier proves to be that fast and extensive minifier that can handle HTML and any other filetype it may contain (CSS, JS, ...). It streams the input and output and can minify files concurrently.
## Installation
Run the following command
go get github.com/tdewolff/minify
or add the following imports and run the project with `go get`
``` go
import (
"github.com/tdewolff/minify"
"github.com/tdewolff/minify/css"
"github.com/tdewolff/minify/html"
"github.com/tdewolff/minify/js"
"github.com/tdewolff/minify/json"
"github.com/tdewolff/minify/svg"
"github.com/tdewolff/minify/xml"
)
```
## API stability
There is no guarantee for absolute stability, but I take issues and bugs seriously and don't take API changes lightly. The library will be maintained in a compatible way unless vital bugs prevent me from doing so. There has been one API change after v1 which added options support and I took the opportunity to push through some more API clean up as well. There are no plans whatsoever for future API changes.
- minify-v1.0.0 depends on parse-v1.0.0
- minify-v1.1.0 depends on parse-v1.1.0
- minify-v2.0.0 depends on parse-v2.0.0
- minify-tip will always compile with my other packages on tip
The API differences between v1 and v2 are listed below. If `m := minify.New()` and `w` and `r` are your writer and reader respectfully, then **v1** → **v2**:
- `minify.Bytes(m, ...)` → `m.Bytes(...)`
- `minify.String(m, ...)` → `m.String(...)`
- `html.Minify(m, "text/html", w, r)` → `html.Minify(m, w, r, nil)` also for `css`, `js`, ...
- `css.Minify(m, "text/css;inline=1", w, r)` → `css.Minify(m, w, r, map[string]string{"inline":"1"})`
## Testing
For all subpackages and the imported `parse` and `buffer` packages, test coverage of 100% is pursued. Besides full coverage, the minifiers are [fuzz tested](https://github.com/tdewolff/fuzz) using [github.com/dvyukov/go-fuzz](http://www.github.com/dvyukov/go-fuzz), see [the wiki](https://github.com/tdewolff/minify/wiki) for the most important bugs found by fuzz testing. Furthermore am I working on adding visual testing to ensure that minification doesn't change anything visually. By using the WebKit browser to render the original and minified pages we can check whether any pixel is different.
These tests ensure that everything works as intended, the code does not crash (whatever the input) and that it doesn't change the final result visually. If you still encounter a bug, please report [here](https://github.com/tdewolff/minify/issues)!
## HTML
HTML (with JS and CSS) minification typically runs at about 40MB/s ~= 140GB/h, depending on the composition of the file.
Website | Original | Minified | Ratio | Time<sup>*</sup>
------- | -------- | -------- | ----- | -----------------------
[Amazon](http://www.amazon.com/) | 463kB | **414kB** | 90% | 11ms
[BBC](http://www.bbc.com/) | 113kB | **96kB** | 85% | 3ms
[StackOverflow](http://stackoverflow.com/) | 201kB | **182kB** | 91% | 5ms
[Wikipedia](http://en.wikipedia.org/wiki/President_of_the_United_States) | 435kB | **410kB** | 94%<sup>**</sup> | 10ms
<sup>*</sup>These times are measured on my home computer which is an average development computer. The duration varies a lot but it's important to see it's in the 10ms range! The benchmark uses all the minifiers and excludes reading from and writing to the file from the measurement.
<sup>**</sup>Is already somewhat minified, so this doesn't reflect the full potential of this minifier.
The HTML5 minifier uses these minifications:
- strip unnecessary whitespace and otherwise collapse it to one space (or newline if it originally contained a newline)
- strip superfluous quotes, or uses single/double quotes whichever requires fewer escapes
- strip default attribute values and attribute boolean values
- strip some empty attributes
- strip unrequired tags (`html`, `head`, `body`, ...)
- strip unrequired end tags (`tr`, `td`, `li`, ... and often `p`)
- strip default protocols (`http:`, `https:` and `javascript:`)
- strip comments (except conditional comments)
- shorten `doctype` and `meta` charset
- lowercase tags, attributes and some values to enhance gzip compression
Options:
- `KeepDefaultAttrVals` do not remove default attribute value such as `<script type="text/javascript">`
- `KeepWhitespace` do not remove whitespace between inline tags but still collapse multiple whitespace characters into one
After recent benchmarking and profiling it became really fast and minifies pages in the 10ms range, making it viable for on-the-fly minification.
However, be careful when doing on-the-fly minification. Minification typically trims off 10% and does this at worst around about 20MB/s. This means users have to download slower than 2MB/s to make on-the-fly minification worthwhile. This may or may not apply in your situation. Rather use caching!
### Whitespace removal
The whitespace removal mechanism collapses all sequences of whitespace (spaces, newlines, tabs) to a single space. If the sequence contained a newline or carriage return it will collapse into a newline character instead. It trims all text parts (in between tags) depending on whether it was preceded by a space from a previous piece of text and whether it is followed up by a block element or an inline element. In the former case we can omit spaces while for inline elements whitespace has significance.
Make sure your HTML doesn't depend on whitespace between `block` elements that have been changed to `inline` or `inline-block` elements using CSS. Your layout *should not* depend on those whitespaces as the minifier will remove them. An example is a menu consisting of multiple `<li>` that have `display:inline-block` applied and have whitespace in between them. It is bad practise to rely on whitespace for element positioning anyways!
## CSS
Minification typically runs at about 25MB/s ~= 90GB/h.
Library | Original | Minified | Ratio | Time<sup>*</sup>
------- | -------- | -------- | ----- | -----------------------
[Bootstrap](http://getbootstrap.com/) | 134kB | **111kB** | 83% | 5ms
[Gumby](http://gumbyframework.com/) | 182kB | **167kB** | 90% | 7ms
<sup>*</sup>The benchmark excludes the time reading from and writing to a file from the measurement.
The CSS minifier will only use safe minifications:
- remove comments and unnecessary whitespace
- remove trailing semicolons
- optimize `margin`, `padding` and `border-width` number of sides
- shorten numbers by removing unnecessary `+` and zeros and rewriting with/without exponent
- remove dimension and percentage for zero values
- remove quotes for URLs
- remove quotes for font families and make lowercase
- rewrite hex colors to/from color names, or to 3 digit hex
- rewrite `rgb(`, `rgba(`, `hsl(` and `hsla(` colors to hex or name
- replace `normal` and `bold` by numbers for `font-weight` and `font`
- replace `none` → `0` for `border`, `background` and `outline`
- lowercase all identifiers except classes, IDs and URLs to enhance gzip compression
- shorten MS alpha function
- rewrite data URIs with base64 or ASCII whichever is shorter
- calls minifier for data URI mediatypes, thus you can compress embedded SVG files if you have that minifier attached
It does purposely not use the following techniques:
- (partially) merge rulesets
- (partially) split rulesets
- collapse multiple declarations when main declaration is defined within a ruleset (don't put `font-weight` within an already existing `font`, too complex)
- remove overwritten properties in ruleset (this not always overwrites it, for example with `!important`)
- rewrite properties into one ruleset if possible (like `margin-top`, `margin-right`, `margin-bottom` and `margin-left` → `margin`)
- put nested ID selector at the front (`body > div#elem p` → `#elem p`)
- rewrite attribute selectors for IDs and classes (`div[id=a]` → `div#a`)
- put space after pseudo-selectors (IE6 is old, move on!)
It's great that so many other tools make comparison tables: [CSS Minifier Comparison](http://www.codenothing.com/benchmarks/css-compressor-3.0/full.html), [CSS minifiers comparison](http://www.phpied.com/css-minifiers-comparison/) and [CleanCSS tests](http://goalsmashers.github.io/css-minification-benchmark/). From the last link, this CSS minifier is almost without doubt the fastest and has near-perfect minification rates. It falls short with the purposely not implemented and often unsafe techniques, so that's fine.
## JS
The JS minifier is pretty basic. It removes comments, whitespace and line breaks whenever it can. It employs all the rules that [JSMin](http://www.crockford.com/javascript/jsmin.html) does too, but has additional improvements. For example the prefix-postfix bug is fixed.
Minification typically runs at about 45MB/s ~= 160GB/h. Common speeds of PHP and JS implementations are about 100-300kB/s (see [Uglify2](http://lisperator.net/uglifyjs/), [Adventures in PHP web asset minimization](https://www.happyassassin.net/2014/12/29/adventures-in-php-web-asset-minimization/)).
Library | Original | Minified | Ratio | Time<sup>*</sup>
------- | -------- | -------- | ----- | -----------------------
[ACE](https://github.com/ajaxorg/ace-builds) | 630kB | **442kB** | 70% | 14ms
[jQuery](http://jquery.com/download/) | 242kB | **130kB** | 54% | 5ms
[jQuery UI](http://jqueryui.com/download/) | 459kB | **300kB** | 65% | 11ms
[Moment](http://momentjs.com/) | 97kB | **51kB** | 52% | 2ms
<sup>*</sup>The benchmark excludes the time reading from and writing to a file from the measurement.
TODO:
- shorten local variables / function parameters names
- precise semicolon and newline omission
## JSON
Minification typically runs at about 95MB/s ~= 340GB/h. It shaves off about 15% of filesize for common indented JSON such as generated by [JSON Generator](http://www.json-generator.com/).
The JSON minifier only removes whitespace, which is the only thing that can be left out.
## SVG
Minification typically runs at about 15MB/s ~= 55GB/h. Performance improvement are due.
The SVG minifier uses these minifications:
- trim and collapse whitespace between all tags
- strip comments, empty `doctype`, XML prelude, `metadata`
- strip SVG version
- strip CDATA sections wherever possible
- collapse tags with no content to a void tag
- collapse empty container tags (`g`, `svg`, ...)
- minify style tag and attributes with the CSS minifier
- minify colors
- shorten lengths and numbers and remove default `px` unit
- shorten `path` data
- convert `rect`, `line`, `polygon`, `polyline` to `path`
- use relative or absolute positions in path data whichever is shorter
TODO:
- convert attributes to style attribute whenever shorter
- merge path data? (same style and no intersection -- the latter is difficult)
- truncate decimals
## XML
Minification typically runs at about 70MB/s ~= 250GB/h.
The XML minifier uses these minifications:
- strip unnecessary whitespace and otherwise collapse it to one space (or newline if it originally contained a newline)
- strip comments
- collapse tags with no content to a void tag
- strip CDATA sections wherever possible
Options:
- `KeepWhitespace` do not remove whitespace between inline tags but still collapse multiple whitespace characters into one
## Usage
Any input stream is being buffered by the minification functions. This is how the underlying buffer package inherently works to ensure high performance. The output stream however is not buffer. It is wise to preallocate a buffer as big as the input to which the output is written, or otherwise use `bufio` to buffer to a streaming writer.
### New
Retrieve a minifier struct which holds a map of mediatype → minifier functions.
``` go
m := minify.New()
```
The following loads all provided minifiers.
``` go
m := minify.New()
m.AddFunc("text/css", css.Minify)
m.AddFunc("text/html", html.Minify)
m.AddFunc("text/javascript", js.Minify)
m.AddFunc("image/svg+xml", svg.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]json$"), json.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]xml$"), xml.Minify)
```
You can set options to several minifiers.
``` go
m.Add("text/html", &html.Minifier{
KeepDefaultAttrVals: true,
KeepWhitespace: true,
})
```
### From reader
Minify from an `io.Reader` to an `io.Writer` for a specific mediatype.
``` go
if err := m.Minify(mediatype, w, r); err != nil {
panic(err)
}
```
Minify formats directly from an `io.Reader` to an `io.Writer`. The `params map[string]string` would contain the mediatype parameters, pass `nil` if non-existent.
``` go
if err := css.Minify(m, w, r, params); err != nil {
panic(err)
}
if err := html.Minify(m, w, r, params); err != nil {
panic(err)
}
if err := js.Minify(m, w, r, params); err != nil {
panic(err)
}
if err := json.Minify(m, w, r, params); err != nil {
panic(err)
}
if err := svg.Minify(m, w, r, params); err != nil {
panic(err)
}
if err := xml.Minify(m, w, r, params); err != nil {
panic(err)
}
```
### From bytes
Minify from and to a `[]byte` for a specific mediatype.
``` go
b, err = m.Bytes(mediatype, b)
if err != nil {
panic(err)
}
```
### From string
Minify from and to a `string` for a specific mediatype.
``` go
s, err = m.String(mediatype, s)
if err != nil {
panic(err)
}
```
### From reader
Get a minifying reader for a specific mediatype.
``` go
mr := m.Reader(mediatype, r)
if _, err := mr.Read(b); err != nil {
panic(err)
}
```
### From writer
Get a minifying writer for a specific mediatype. Must be explicitly closed because it uses an `io.Pipe` underneath.
``` go
mw := m.Writer(mediatype, w)
mw.Write([]byte("input"))
if err := mw.Close(); err != nil {
panic(err)
}
```
### Custom minifier
Add a minifier for a specific mimetype.
``` go
type CustomMinifier struct {
KeepLineBreaks bool
}
func (c *CustomMinifier) Minify(m *minify.M, w io.Writer, r io.Reader, params map[string]string) error {
// ...
return nil
}
m.Add(mimetype, &CustomMinifier{KeepLineBreaks: true})
// or
m.AddRegexp(regexp.MustCompile("/x-custom$"), &CustomMinifier{KeepLineBreaks: true})
```
Add a minify function for a specific mimetype.
``` go
m.AddFunc(mimetype, func(m *minify.M, w io.Writer, r io.Reader, params map[string]string) error {
// ...
return nil
})
m.AddFuncRegexp(regexp.MustCompile("/x-custom$"), func(m *minify.M, w io.Writer, r io.Reader, params map[string]string) error {
// ...
return nil
})
```
Add a command `cmd` with arguments `args` for a specific mimetype.
``` go
m.AddCmd(mimetype, exec.Command(cmd, args...))
m.AddCmdRegexp(regexp.MustCompile("/x-custom$"), exec.Command(cmd, args...))
```
### Mediatypes
Using the `params map[string]string` argument one can pass parameters to the minifier such as seen in mediatypes (`type/subtype; key1=val2; key2=val2`). Examples are the encoding or charset of the data. Calling `Minify` will split the mimetype and parameters for the minifiers for you, but `MinifyMimetype` can be used if you already have them split up.
Minifiers can also be added using a regular expression. For example a minifier with `image/.*` will match any image mime.
## Examples
### Common minifiers
Basic example that minifies from stdin to stdout and loads the default HTML, CSS and JS minifiers. Optionally, one can enable `java -jar build/compiler.jar` to run for JS (for example the [ClosureCompiler](https://code.google.com/p/closure-compiler/)). Note that reading the file into a buffer first and writing to a pre-allocated buffer would be faster (but would disable streaming).
``` go
package main
import (
"log"
"os"
"os/exec"
"github.com/tdewolff/minify"
"github.com/tdewolff/minify/css"
"github.com/tdewolff/minify/html"
"github.com/tdewolff/minify/js"
"github.com/tdewolff/minify/json"
"github.com/tdewolff/minify/svg"
"github.com/tdewolff/minify/xml"
)
func main() {
m := minify.New()
m.AddFunc("text/css", css.Minify)
m.AddFunc("text/html", html.Minify)
m.AddFunc("text/javascript", js.Minify)
m.AddFunc("image/svg+xml", svg.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]json$"), json.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]xml$"), xml.Minify)
// Or use the following for better minification of JS but lower speed:
// m.AddCmd("text/javascript", exec.Command("java", "-jar", "build/compiler.jar"))
if err := m.Minify("text/html", os.Stdout, os.Stdin); err != nil {
panic(err)
}
}
```
### Custom minifier
Custom minifier showing an example that implements the minifier function interface. Within a custom minifier, it is possible to call any minifier function (through `m minify.Minifier`) recursively when dealing with embedded resources.
``` go
package main
import (
"bufio"
"fmt"
"io"
"log"
"strings"
"github.com/tdewolff/minify"
)
func main() {
m := minify.New()
m.AddFunc("text/plain", func(m *minify.M, w io.Writer, r io.Reader, _ map[string]string) error {
// remove newlines and spaces
rb := bufio.NewReader(r)
for {
line, err := rb.ReadString('\n')
if err != nil && err != io.EOF {
return err
}
if _, errws := io.WriteString(w, strings.Replace(line, " ", "", -1)); errws != nil {
return errws
}
if err == io.EOF {
break
}
}
return nil
})
in := "Because my coffee was too cold, I heated it in the microwave."
out, err := m.String("text/plain", in)
if err != nil {
panic(err)
}
fmt.Println(out)
// Output: Becausemycoffeewastoocold,Iheateditinthemicrowave.
}
```
### ResponseWriter
ResponseWriter example which returns a ResponseWriter that minifies the content and then writes to the original ResponseWriter. Any write after applying this filter will be minified.
``` go
type MinifyResponseWriter struct {
http.ResponseWriter
io.WriteCloser
}
func (m MinifyResponseWriter) Write(b []byte) (int, error) {
return m.WriteCloser.Write(b)
}
// MinifyResponseWriter must be closed explicitly by calling site.
func MinifyFilter(mediatype string, res http.ResponseWriter) MinifyResponseWriter {
m := minify.New()
// add minfiers
mw := m.Writer(mediatype, res)
return MinifyResponseWriter{res, mw}
}
```
``` go
// Usage
func(w http.ResponseWriter, req *http.Request) {
w = MinifyFilter("text/html", w)
io.WriteString(w, "<p class="message"> This HTTP response will be minified. </p>")
// Output: <p class=message>This HTTP response will be minified.
}
```
### Templates
Here's an example of a replacement for `template.ParseFiles` from `template/html`, which automatically minifies each template before parsing it.
Be aware that minifying templates will work in most cases but not all. Because the HTML minifier only works for valid HTML5, your template must be valid HTML5 of itself. Template tags are parsed as regular text by the minifier.
``` go
func compileTemplates(filenames ...string) (*template.Template, error) {
m := minify.New()
m.AddFunc("text/html", html.Minify)
var tmpl *template.Template
for _, filename := range filenames {
name := filepath.Base(filename)
if tmpl == nil {
tmpl = template.New(name)
} else {
tmpl = tmpl.New(name)
}
b, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
mb, err := m.Bytes("text/html", b)
if err != nil {
return nil, err
}
tmpl.Parse(string(mb))
}
return tmpl, nil
}
```
Example usage:
``` go
templates := template.MustCompile(compileTemplates("view.html", "home.html"))
```
## License
Released under the [MIT license](LICENSE.md).
[1]: http://golang.org/ "Go Language"
| {
"content_hash": "580575519b58485ffe452709c3002be6",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 796,
"avg_line_length": 41.96816479400749,
"alnum_prop": 0.7245549060729106,
"repo_name": "tjcunliffe/hoverfly",
"id": "2ef1321f4ea1a4bc06df26d141105b2249fe212c",
"size": "22856",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/github.com/tdewolff/minify/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "821"
},
{
"name": "Go",
"bytes": "1887165"
},
{
"name": "HTML",
"bytes": "341"
},
{
"name": "JavaScript",
"bytes": "74172"
},
{
"name": "Makefile",
"bytes": "2017"
},
{
"name": "Python",
"bytes": "23775"
},
{
"name": "Ruby",
"bytes": "156"
},
{
"name": "Shell",
"bytes": "1071"
}
],
"symlink_target": ""
} |
"""
Provides BaseConfig - a class that makes a config file act like a dictionary
myconf = BaseConfig("myfile.ini")
val = myconf["mysection"]["mykey"]
for each value you read, it tries to return int, failing this float,
failing this returns bool for special string values 'true' / 'false'
(case insensitive test), failing this returns string
added feature is that if the value does not exist in the config,
then you get None instead of an exception
Another added feature is that in any string value, you can have a substring
which is substituted using another variable, in the format
{{var:[section]key}}.
Substitutions also include other substitutions. Documenting
by example:
[mysection]
topdir=/some/path
[othersection]
dir1={{var:[mysection]topdir}}/some/subdirectory
dir2={{var:[othersection]dir1}}/bar
It is entirely the user's responsibility not to set up loops when doing this.
You can also have expression substitutions, in the format {{eval:python_code}}
e.g. {{eval:1+1}}. These are evaluated with eval. They do not have to return
a string type, although in that case they should be constitute the whole of the
value as otherwise there will be an error from concatenating a string with
another type. Expression substitutions are evaluated after variable substitutions.
Another added feature is compulsory variables. The presence of these variables
will be checked for at the time that the config is read, and an exception raised
if not. The compulsory variable section is empty in this class, but may be
overridden to useful effect in a subclass.
Variables can be overridden via environment vars called
CONFIG__<section>__<key> e.g. in the example above setting
CONFIG__mysection__topdir=/some/other/path will override
any value in the file and will also find its way into any substitutions
"""
import ConfigParser
import sys
import os
import time
import re
import settings
class ConfigSection(dict):
"""
A class to make a section act as a dictionary.
This class is unlikely to be instantiated directly by calling code.
"""
_varSubsRe = re.compile("\$\(([a-zA-Z_]+)\:(.*?)\)")
_evalSubsRe = re.compile("\{\{eval:(.*?)\}\}")
def __init__(self, config=None, section=None, parent=None):
d = super(ConfigSection, self)
d.__init__()
self.parent = parent # used for substitutions
self.section = section
if config:
for opt in config.options(section):
value = config.get(section, opt)
d.__setitem__(opt, value)
def __getitem__(self, key):
return self.lookup(key)
def lookup(self, key, default=None):
"""
Look up a single key, doing any substitutions as described in the
module-level docstring.
"""
value = None
if self.section:
try:
value = os.environ["CONFIG__%s__%s" % (self.section, key)]
except KeyError:
pass
if value == None:
d = super(ConfigSection, self)
try:
value = d.__getitem__(key)
except KeyError:
pass
if value != None:
return self.mapValue(value)
else:
return default
def mapValue(self, value):
"""
map a string value from the config file to something that has
potentially different type and also has the special tokens
substituted
"""
if not isinstance(value, str):
return value
try:
return int(value)
except ValueError:
pass
try:
return float(value)
except ValueError:
pass
upper = value.upper()
if upper == "TRUE": return True
if upper == "FALSE": return False
if value == "None": return None
value = self.doSubs(value, self.parent)
return value
def getVarSub(self, config, section, key):
"""
get substitution text that will be used to replace a
{{var:[section]key}} token - i.e. the variable referred to
or else the empty string
"""
if config:
try:
return config[section][key]
except KeyError:
pass
return ""
def doSub(self, str_, matchobj, sub):
"""
Given a string, a re.match object and a substitution value,
return the result of substituting it.
The substitution value should normally be a string, but in the
case where the match constitutes the whole string, then just the
substitution value itself, so it can then be another data type.
"""
string1 = str_[ : matchobj.start()]
string2 = str_[matchobj.end() : ]
if (not string1) and (not string2):
return sub
return string1 + sub + string2
def doSubs(self, str_, config):
"""
Given a string and a config object, return a revised value after
expanding all special tokens (i.e. if none are found then just get
the original string back)
"""
while True:
m = self._varSubsRe.search(str_)
if not m:
break
section = m.group(1)
key = m.group(2)
sub = self.getVarSub(config, section, key)
str_ = self.doSub(str_, m, sub)
while isinstance(str_, str):
m = self._evalSubsRe.search(str_)
if not m:
break
code = m.group(1)
try:
sub = eval(code)
except:
sub = ""
str_ = self.doSub(str_, m, sub)
return str_
class BaseConfig(dict):
"""
See module-level doc for details.
Note not "AbstractConfig" - this can meaningfully be instantiated,
although in fact GlobalConfig and DatasetConfig do subclass it to add
extra functionality.
"""
compulsoryVars = []
def __init__(self, config_file_path, missing_ok = False):
"""
Instantiate based on given path to config file
"""
self.d = super(BaseConfig, self)
self.d.__init__()
self.config_file_path = config_file_path
self.missing_ok = missing_ok
self.settings = []
self.reread()
def __getitem__(self, key):
"""
Return a ConfigSection object based on the specified section of
the file (or an empty ConfigSection if none)
"""
if not self.d.has_key(key):
self.d.__setitem__(key, ConfigSection()) # create an empty section
return self.d.__getitem__(key)
def _readConfig(self, config):
retval = config.read(self.config_file_path)
if not retval and not self.missing_ok:
raise RuntimeError("Could not read config file %s" % self.config_file_path)
def reread(self):
"""
Unconditionally reread the config file. Returns nothing if file disappeared.
"""
if not os.path.exists(self.config_file_path):
return
self.clear()
config = ConfigParser.ConfigParser()
self._readConfig(config)
for section in config.sections():
self.d.__setitem__(section, ConfigSection(config, section, parent=self))
# go through the default settings and update the config with the
# defaults if none have been set so far
for s in self.settings:
if not self.checkSet(s[0] + "." + s[1]):
if not config.has_section(s[0]):
config.add_section(s[0])
self.d.__setitem__(s[0], ConfigSection(config, s[0], parent=self))
self.set(s[0] + "." + s[1], s[2])
self.time_last_read = time.time()
self.checkCompulsoryVars()
def readDefaults(self):
'''
Read global default values from python settings.py file
'''
self.settings = []
defaults = dir(settings)
for default in defaults:
if not default.startswith("__"):
c = getattr(settings, default)
d = default.split("_")
for k in c:
e = d[0]
self.settings.append((e, k, c[k]))
def checkCompulsoryVars(self):
"""
Raise an exception if any compulsory variable does not exist or
has wrong type. Note that there are no compulsory variables except
where a subclass (e.g. GlobalConfig / DatasetConfig) defines some.
"""
for sect, varnames in self.compulsoryVars:
s = self[sect]
for v in varnames:
if isinstance(v, str):
varname, vartype = v, None
else:
varname, vartype = v
if varname not in s:
raise Exception("Compulsory variable %s::%s not in %s" %
(sect, varname, self.config_file_path))
value = s[varname]
type_ = type(value)
if vartype and not isinstance(value, vartype):
raise Exception("Compulsory variable %s::%s in %s has type %s (value %s), should be %s" %
(sect, varname, self.config_file_path, type_, value, vartype))
def rereadIfUpdated(self):
"""
Re-reads the config file, if necessary.
Return value is whether it actually reread or not
"""
# note: duplicates a test in FileUtils but prefer not to depend on that module here
if not os.path.exists(self.config_file_path):
# config has been deleted, maybe intentionally, so don't reread
return False
mtime = os.path.getmtime(self.config_file_path)
if mtime + 1 > self.time_last_read:
self.reread()
return True
else:
return False
# set a value for a key
def set(self, key, value):
try:
sk = key.split(".")
a = self.d.__getitem__(sk[0])
#b = a[sk[1]]
a[sk[1]] = value
self.d.__setitem__(sk[0], a);
except Exception, ex:
print str(ex)
# get the value for a key
def get(self, key):
b = None
try:
sk = key.split(".")
a = self.d.__getitem__(sk[0])
b = a[sk[1]]
except Exception, ex:
print str(ex)
return b
# check if a key is set and it has
# somesort of value
def checkSet(self, key):
try:
a = self.get(key)
if a:
return True
return False
except:
return False
# if a keys is set (with the appropriate value),
# then ensure the other
# relavent keys are set
def checkSetIf(self, key, val, keys):
rv = []
if self.checkSet(key) == True and self.get(key) != val:
for k in keys:
if self.checkSet(k) == False:
rv.append(k)
if len(rv) == 0:
return None
return rv
return None
def dump(self, stream = sys.stdout):
"""
For debugging.
"""
stream.write("\n===Config dump===\n")
stream.write("Filename = %s\n" % self.config_file_path)
sections = self.keys()
sections.sort()
for section in sections:
s = self[section]
stream.write("[%s]\n" % section)
keys = s.keys()
keys.sort()
for k in keys:
stream.write(" %s = %s (%s)\n" % (k, s[k], type(s[k]).__name__))
stream.write("===End of config dump===\n\n")
if __name__ == '__main__':
for file in ["../conf/dataset_hadgem2_2xco2.ini", "../conf/global.ini"]:
a = BaseConfig(file)
# main test - can we dump the config
a.dump()
print "these should be None:"
print a["asdadsasklejklj"]["adsfasdf"]
for sect in a:
print a[sect]["asdfasdfasdfad"]
# test we can put stuff to existing and non-existing section
print "Put test:"
sects = [a.keys()[0], "mysect"]
for s in sects:
for k in ["username", "mykey"]:
print s, k, a[s][k],
a[s][k] = "foo"
print a[s][k]
print "Reread test:"
# rereading the config file will wipe the value that we wrote, but we are calling
# rereadIfUpdated(), so it will only happen if the file modification time is updated
a["rsync"]["cmd"] = "FOO"
print a["rsync"]["cmd"]
a.rereadIfUpdated()
print a["rsync"]["cmd"]
os.system("touch %s" % file)
a.rereadIfUpdated()
print a["rsync"]["cmd"]
| {
"content_hash": "cf14ec84a8a8bcae762e23f64aa9b2e0",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 109,
"avg_line_length": 32.40841584158416,
"alnum_prop": 0.551210570533873,
"repo_name": "cedadev/mistamover",
"id": "5c5be2e06126c7ede167ec26ca7eadce8cf08b22",
"size": "13298",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Config/BaseConfig.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "16435"
},
{
"name": "JavaScript",
"bytes": "52869"
},
{
"name": "Python",
"bytes": "268174"
},
{
"name": "Shell",
"bytes": "424"
}
],
"symlink_target": ""
} |
// If you would like IE 8 support, include the polyfill here: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Compatibility
/**
* Adds a speech bubble above or below the specified element.
* @param {HTMLElement} targetElement - Element that the speech bubble points to
* if targetElement is null then a dialog bubble is used which doesn't point anywhere
* @param {string|HTMLElement} content - What the bubble will contain (html is ok).
* @param {string} [additionalCSSClasses] The CSS class to add to the element.
* @param {HTMLElement} [appendToElement=body] The element to which the SpeechBubble will actually be appended to. By default this is the `body` element.
* @returns {HTMLElement} The Speech Bubble element.
*/
window.SpeechBubble = function(targetElement, content, additionalCSSClasses, appendToElement){
// http://stackoverflow.com/a/34014786/1610754 and http://stackoverflow.com/a/442474/1610754
function getOffset(elm) {
// Find the offset of elm from the body or html element
var _x = 0;
var _y = 0;
while( elm && !isNaN( elm.offsetLeft ) && !isNaN( elm.offsetTop ) )
{
_x += elm.offsetLeft - elm.scrollLeft + elm.clientLeft;
_y += elm.offsetTop - elm.scrollTop + elm.clientTop;
elm = elm.offsetParent;
}
return { top: _y, left: _x };
}
var element;
if (typeof jQuery !== "undefined" && targetElement instanceof jQuery) {
element = targetElement[0];
} else {
element = targetElement;
}
var appendElm;
if (typeof jQuery !== "undefined" && appendToElement instanceof jQuery) {
appendElm = appendToElement[0];
} else {
appendElm = appendToElement;
}
var SpeechDiv = document.createElement('div');
if ( element === null){
SpeechDiv.className = 'dialog-bubble-main';
} else {
SpeechDiv.className = 'speech-bubble-main speech-bubble-top';
}
if (additionalCSSClasses) {
SpeechDiv.className += ' '+ additionalCSSClasses;
}
if (content instanceof HTMLElement)
SpeechDiv.appendChild(content);
else
SpeechDiv.innerHTML = content;
var SpeechID;
do {
SpeechID='bubble-' + new Date().getTime();
} while (document.getElementById(SpeechID));
SpeechDiv.id = SpeechID;
SpeechDiv.setAttribute("style", "");
(appendElm || document.getElementsByTagName('body')[0]).appendChild(SpeechDiv);
var SpeechStyle = document.createElement('style');
document.getElementsByTagName('body')[0].appendChild(SpeechStyle);
function doDialogPosition(){
// Unset inline style.
SpeechDiv.style.left = "";
SpeechStyle.innerHTML =
'#' + SpeechDiv.id + ' {' +
' position: fixed;' +
' top: 20px; left: 50%; ' +
' transform: translate(-50%, 0); -webkit-transform: translate(-50%, 0); -ms-transform: translate(-50%, 0)' +
'}';
}
function DoAutoPosition() {
var elmXY;
if ( element !== null)
elmXY = getOffset(element);
else{
doDialogPosition();
return;
}
var speechX;
var speechY;
var elmWidth = (element.offsetWidth && element.offsetWidth > element.clientWidth) ? element.offsetWidth : element.clientWidth;
var elmHeight = (element.offsetHeight && element.offsetHeight > element.clientHeight) ? element.offsetHeight : element.clientHeight;
var fromRight = false;
var targetPointerCoefficient = 0;
if (SpeechDiv.clientWidth < elmWidth)
speechX = elmXY.left + (elmWidth - SpeechDiv.clientWidth) / 2;
else if (elmXY.left + SpeechDiv.clientWidth >= document.documentElement.clientWidth) {
// If the size of the SpeechDiv is greater than the amount of space there is from
// the beginning of the element to the edge of the page, the SpeechDiv must from the right edge.
speechX = elmXY.left - SpeechDiv.clientWidth + 35;
fromRight = true;
// If the SpeechDiv is larger that the viewport, let the SpeechBubble become taller.
if (speechX < 0) {
targetPointerCoefficient = speechX;
speechX = 0;
}
} else
speechX = elmXY.left - 35;
// Temporarily set the X coordinate of the SpeechDiv manually to correctly calculate the Y coordinate.
SpeechDiv.style.left = speechX + 'px';
if (elmXY.top + elmHeight + SpeechDiv.clientHeight + 23 > (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight)) {
var appliedClasses = SpeechDiv.className.split(' ');
for ( var i = 0; i < appliedClasses.length; i++ ) {
if (appliedClasses[i] == 'speech-bubble-top') {
appliedClasses[i] = 'speech-bubble-bottom';
}
}
SpeechDiv.className = appliedClasses.join(' ');
var speechHeight = SpeechDiv.getBoundingClientRect ? SpeechDiv.getBoundingClientRect().height : SpeechDiv.clientHeight;
speechY = elmXY.top - speechHeight - 15;
} else {
var appliedClasses = SpeechDiv.className.split(' ');
for ( var i = 0; i < appliedClasses.length; i++ ) {
if (appliedClasses[i] == 'speech-bubble-bottom') {
appliedClasses[i] = 'speech-bubble-top';
}
}
SpeechDiv.className = appliedClasses.join(' ');
speechY = elmXY.top + elmHeight + 15;
}
if (speechY < 0) speechY = 0;
SpeechDiv.style.top = speechY + 'px';
elmXY = getOffset(element);
if (SpeechDiv.clientWidth < elmWidth)
speechX = elmXY.left + (elmWidth - SpeechDiv.clientWidth) / 2;
else if (elmXY.left + SpeechDiv.clientWidth >= document.documentElement.clientWidth) {
// If the size of the SpeechDiv is greater than the amount of space there is from
// the beginning of the element to the edge of the page, the SpeechDiv must from the right edge.
speechX = elmXY.left - SpeechDiv.clientWidth + 35;
fromRight = true;
// If the SpeechDiv is larger that the viewport, let the SpeechBubble become taller.
if (speechX < 0) {
targetPointerCoefficient = speechX;
speechX = 0;
}
} else
speechX = elmXY.left - 35;
// Unset inline style.
SpeechDiv.style.left = "";
SpeechDiv.style.top = "";
var newStyle;
newStyle =
'#' + SpeechDiv.id + ' {' +
' left: ' + speechX + 'px;' +
' top: ' + speechY + 'px;' +
'}' +
'#' + SpeechDiv.id + ':before {';
if (SpeechDiv.clientWidth > elmWidth)
if (fromRight)
newStyle += ' left: ' + (SpeechDiv.clientWidth - 55 + targetPointerCoefficient) + 'px';
else
newStyle += ' left: ' + (15) + 'px';
newStyle +=
'}' +
'#' + SpeechDiv.id + ':after {';
if (SpeechDiv.clientWidth > elmWidth)
if (fromRight)
newStyle += ' left: ' + (SpeechDiv.clientWidth - 49 + targetPointerCoefficient) + 'px';
else
newStyle += ' left: ' + (21) + 'px';
newStyle += '}';
if (newStyle != SpeechStyle.innerHTML) {
SpeechStyle.innerHTML = newStyle;
}
}
DoAutoPosition();
window.addEventListener('resize', DoAutoPosition, true);
MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
var observer;
SpeechDiv.removeBubble = function() {
// Remove all the listeners.
window.removeEventListener('resize', DoAutoPosition, true);
if (MutationObserver) {
observer.disconnect();
}
try {
SpeechStyle.parentNode.removeChild(SpeechStyle);
} catch (e) {}
try {
SpeechDiv.parentNode.removeChild(SpeechDiv);
} catch (e) {}
for ( var i = 0; i < OpenSpeechBubbles.length; i++ ) {
if (OpenSpeechBubbles[i] == SpeechDiv) {
OpenSpeechBubbles.splice(i, 1);
}
}
};
// Check if MutationObserver is available.
if (MutationObserver) {
observer = new MutationObserver(function (mutations, observer) {
var DontPosition = false;
var applicableMutations = mutations.length;
mutations.forEach(function(mutation) {
if (mutation.target.tagName && mutation.target.tagName.toLowerCase() == "script") {
DontPosition = true;
} else if (mutation.target == SpeechDiv && mutation.type == "attributes"){
DontPosition = true;
} else {
if (mutation.removedNodes && Array.prototype.slice.call(mutation.removedNodes).length > 0) {
Array.prototype.slice.call(mutation.removedNodes).forEach(function(node) {
if (node == SpeechDiv) {
SpeechDiv.removeBubble();
DontPosition = true;
} else if (node == SpeechStyle) {
DontPosition = true;
}
});
}
if (mutation.addedNodes && Array.prototype.slice.call(mutation.addedNodes).length > 0) {
Array.prototype.slice.call(mutation.addedNodes).forEach(function(node) {
if (node.tagName && node.tagName.toLowerCase() == "script") {
DontPosition = true;
}
});
}
}
});
if (applicableMutations > 0 && !DontPosition) {
DoAutoPosition();
}
});
// define what element should be observed by the observer
// and what types of mutations trigger the callback
observer.observe(document, {
childList: true,
subtree: true,
attributes: true,
characterData: true
});
}
SpeechDiv.DoAutoPosition = DoAutoPosition;
OpenSpeechBubbles.push(SpeechDiv);
return SpeechDiv;
};
window.OpenSpeechBubbles = [];
| {
"content_hash": "6607e4dbd0c2e7f4936d0c284b6a5b0d",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 154,
"avg_line_length": 33.31272727272727,
"alnum_prop": 0.6565877087654186,
"repo_name": "MDTech-us-MAN/SpeechBubble.js",
"id": "f509e9e14c409678895b5a2ca2ea3d7b133b45b8",
"size": "9767",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SpeechBubble.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1892"
},
{
"name": "JavaScript",
"bytes": "9767"
}
],
"symlink_target": ""
} |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser;
/**
* Contains all of the command line switches that are specific to the chrome/
* portion of Chromium on Android.
*/
public abstract class ChromeSwitches {
// Switches used from Java. Please continue switch style used Chrome where
// options-have-hypens and are_not_split_with_underscores.
/** Testing: pretend that the switch value is the name of a child account. */
public static final String CHILD_ACCOUNT = "child-account";
/** Mimic a low end device */
public static final String ENABLE_ACCESSIBILITY_TAB_SWITCHER =
"enable-accessibility-tab-switcher";
/** Whether fullscreen support is disabled (auto hiding controls, etc...). */
public static final String DISABLE_FULLSCREEN = "disable-fullscreen";
/** Show the undo bar for high end UI devices. */
public static final String ENABLE_HIGH_END_UI_UNDO = "enable-high-end-ui-undo";
/** Enable toolbar swipe to change tabs in document mode */
public static final String ENABLE_TOOLBAR_SWIPE_IN_DOCUMENT_MODE =
"enable-toolbar-swipe-in-document-mode";
/** Whether instant is disabled. */
public static final String DISABLE_INSTANT = "disable-instant";
/** Enables StrictMode violation detection. By default this logs violations to logcat. */
public static final String STRICT_MODE = "strict-mode";
/** Don't restore persistent state from saved files on startup. */
public static final String NO_RESTORE_STATE = "no-restore-state";
/** Disable the First Run Experience. */
public static final String DISABLE_FIRST_RUN_EXPERIENCE = "disable-fre";
/** Force the crash dump to be uploaded regardless of preferences. */
public static final String FORCE_CRASH_DUMP_UPLOAD = "force-dump-upload";
/** Enable debug logs for the video casting feature. */
public static final String ENABLE_CAST_DEBUG_LOGS = "enable-cast-debug";
/** Prevent automatic reconnection to current Cast video when Chrome restarts. */
public static final String DISABLE_CAST_RECONNECTION = "disable-cast-reconnection";
/** Whether or not to enable the experimental tablet tab stack. */
public static final String ENABLE_TABLET_TAB_STACK = "enable-tablet-tab-stack";
/** Disables support for playing videos remotely via Android MediaRouter API. */
public static final String DISABLE_CAST = "disable-cast";
/** Never forward URL requests to external intents. */
public static final String DISABLE_EXTERNAL_INTENT_REQUESTS =
"disable-external-intent-requests";
/** Disable document mode. */
public static final String DISABLE_DOCUMENT_MODE = "disable-document-mode";
/** Disable Contextual Search. */
public static final String DISABLE_CONTEXTUAL_SEARCH = "disable-contextual-search";
/** Enable Contextual Search. */
public static final String ENABLE_CONTEXTUAL_SEARCH = "enable-contextual-search";
/** Disable Contextual Search first-run flow, for testing. Not exposed to user. */
public static final String DISABLE_CONTEXTUAL_SEARCH_PROMO_FOR_TESTING =
"disable-contextual-search-promo-for-testing";
/** Enable Contextual Search for instrumentation testing. Not exposed to user. */
public static final String ENABLE_CONTEXTUAL_SEARCH_FOR_TESTING =
"enable-contextual-search-for-testing";
/**
* Enable hosted mode so that hosted activity can be launched.
*/
public static final String ENABLE_HOSTED_MODE = "enable-hosted-mode";
// TODO(ianwen): remove this after rolling.
@Deprecated
public static final String ENABLE_EMBEDDED_MODE = "enable-hosted-mode";
// How many thumbnails should we allow in the cache (per tab stack)?
public static final String THUMBNAILS = "thumbnails";
// How many "approximated" thumbnails should we allow in the cache
// (per tab stack)? These take very low memory but have poor quality.
public static final String APPROXIMATION_THUMBNAILS = "approximation-thumbnails";
///////////////////////////////////////////////////////////////////////////////////////////////
// Native Switches
///////////////////////////////////////////////////////////////////////////////////////////////
/**
* Sets the max number of render processes to use.
* Native switch - content_switches::kRendererProcessLimit.
*/
public static final String RENDER_PROCESS_LIMIT = "renderer-process-limit";
/**
* Enable enhanced bookmarks feature.
* Native switch - switches::kEnhancedBookmarksExperiment
*/
public static final String ENABLE_ENHANCED_BOOKMARKS = "enhanced-bookmarks-experiment";
/** Enable the DOM Distiller. */
public static final String ENABLE_DOM_DISTILLER = "enable-dom-distiller";
/** Enable experimental web-platform features, such as Push Messaging. */
public static final String EXPERIMENTAL_WEB_PLAFTORM_FEATURES =
"enable-experimental-web-platform-features";
/** Enable Reader Mode button animation. */
public static final String ENABLE_READER_MODE_BUTTON_ANIMATION =
"enable-dom-distiller-button-animation";
/** Enable the native app banners. */
public static final String ENABLE_APP_INSTALL_ALERTS = "enable-app-install-alerts";
/**
* Use sandbox Wallet environment for requestAutocomplete.
* Native switch - autofill::switches::kWalletServiceUseSandbox.
*/
public static final String USE_SANDBOX_WALLET_ENVIRONMENT = "wallet-service-use-sandbox";
/**
* Change Google base URL.
* Native switch - switches::kGoogleBaseURL.
*/
public static final String GOOGLE_BASE_URL = "google-base-url";
/**
* Use fake device for Media Stream to replace actual camera and microphone.
* Native switch - switches::kUseFakeDeviceForMediaStream.
*/
public static final String USE_FAKE_DEVICE_FOR_MEDIA_STREAM =
"use-fake-device-for-media-stream";
// Prevent instantiation.
private ChromeSwitches() {}
}
| {
"content_hash": "60d39de7ec30231642a55862e874176e",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 99,
"avg_line_length": 42.51020408163265,
"alnum_prop": 0.6833093294927188,
"repo_name": "guorendong/iridium-browser-ubuntu",
"id": "9dfbe2ce56b28afc460b5ebfa07f81fb0f9af8a4",
"size": "6249",
"binary": false,
"copies": "3",
"ref": "refs/heads/ubuntu/precise",
"path": "chrome/android/java/src/org/chromium/chrome/browser/ChromeSwitches.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "8402"
},
{
"name": "Assembly",
"bytes": "256197"
},
{
"name": "Batchfile",
"bytes": "34966"
},
{
"name": "C",
"bytes": "15445429"
},
{
"name": "C++",
"bytes": "276628399"
},
{
"name": "CMake",
"bytes": "27829"
},
{
"name": "CSS",
"bytes": "867238"
},
{
"name": "Emacs Lisp",
"bytes": "3348"
},
{
"name": "Go",
"bytes": "13628"
},
{
"name": "Groff",
"bytes": "7777"
},
{
"name": "HTML",
"bytes": "20250399"
},
{
"name": "Java",
"bytes": "9950308"
},
{
"name": "JavaScript",
"bytes": "13873772"
},
{
"name": "LLVM",
"bytes": "1169"
},
{
"name": "Logos",
"bytes": "6893"
},
{
"name": "Lua",
"bytes": "16189"
},
{
"name": "Makefile",
"bytes": "179129"
},
{
"name": "Objective-C",
"bytes": "1871766"
},
{
"name": "Objective-C++",
"bytes": "9674498"
},
{
"name": "PHP",
"bytes": "42038"
},
{
"name": "PLpgSQL",
"bytes": "163248"
},
{
"name": "Perl",
"bytes": "63937"
},
{
"name": "Protocol Buffer",
"bytes": "474121"
},
{
"name": "Python",
"bytes": "11646662"
},
{
"name": "Ragel in Ruby Host",
"bytes": "104923"
},
{
"name": "Scheme",
"bytes": "10604"
},
{
"name": "Shell",
"bytes": "1151673"
},
{
"name": "Standard ML",
"bytes": "5034"
},
{
"name": "VimL",
"bytes": "4075"
},
{
"name": "nesC",
"bytes": "18347"
}
],
"symlink_target": ""
} |
var widgets = require('@jupyter-widgets/base');
var _ = require('underscore');
var handsontable_css = require('handsontable/dist/handsontable.full.css');
import Handsontable from 'handsontable/dist/handsontable.full.js';
var SciSheetTableModel = widgets.DOMWidgetModel.extend({
defaults: _.extend(_.result(this, 'widgets.DOMWidgetModel.prototype.defaults'), {
_model_name : 'SciSheetTableModel',
_view_name : 'SciSheetTableView',
_model_module : 'jupyter_scisheets_widget',
_view_module : 'jupyter_scisheets_widget',
_model_module_version : '0.1.0',
_view_module_version : '0.1.0'
})
});
var table_id = 0;
// Custom View. Renders the widget model.
var SciSheetTableView = widgets.DOMWidgetView.extend({
render: function(){
// CREATION OF THE WIDGET IN THE NOTEBOOK.
// Add a <div> in the widget area.
this.$table = $('<div />')
.attr('id', 'table_' + (table_id++))
.appendTo(this.$el);
// Get the model's value (JSON);
var json = this.model.get('_model_data');
// Get the model's JSON string and parse it
var datamod = JSON.parse(json);
// Create the Handsontable table.
this.$table.handsontable({
data: datamod["data"],
colHeaders: datamod["columns"]
});
},
});
module.exports = {
SciSheetTableModel: SciSheetTableModel,
SciSheetTableView: SciSheetTableView
};
| {
"content_hash": "75834553fb184ee301e9690a9c208c1c",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 85,
"avg_line_length": 32.21739130434783,
"alnum_prop": 0.6153846153846154,
"repo_name": "ScienceStacks/jupyter_scisheets_widget",
"id": "82848d9b087cbcf3e4af13ab849a96379997f856",
"size": "1482",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "js/lib/old_versions/scisheets_widget_update.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "18080"
},
{
"name": "Jupyter Notebook",
"bytes": "337993"
},
{
"name": "Python",
"bytes": "34608"
},
{
"name": "Shell",
"bytes": "434"
}
],
"symlink_target": ""
} |
{-# LANGUAGE TemplateHaskell #-}
--------------------------------------------------------------------------------
-- |
-- Module : Data.Comp.Derive
-- Copyright : (c) 2010-2011 Patrick Bahr
-- License : BSD3
-- Maintainer : Patrick Bahr <[email protected]>
-- Stability : experimental
-- Portability : non-portable (GHC Extensions)
--
-- This module contains functionality for automatically deriving boilerplate
-- code using Template Haskell. Examples include instances of 'Functor',
-- 'Foldable', and 'Traversable'.
--
--------------------------------------------------------------------------------
module Data.Comp.Derive
(
derive,
-- |Derive boilerplate instances for compositional data type signatures.
-- ** ShowF
module Data.Comp.Derive.Show,
-- ** EqF
module Data.Comp.Derive.Equality,
-- ** OrdF
module Data.Comp.Derive.Ordering,
-- ** Functor
Functor,
makeFunctor,
-- ** Foldable
module Data.Comp.Derive.Foldable,
-- ** Traversable
module Data.Comp.Derive.Traversable,
-- ** HaskellStrict
module Data.Comp.Derive.HaskellStrict,
-- ** Arbitrary
module Data.Comp.Derive.Arbitrary,
NFData(..),
makeNFData,
-- ** DeepSeq
module Data.Comp.Derive.DeepSeq,
-- ** Smart Constructors
module Data.Comp.Derive.SmartConstructors,
-- ** Smart Constructors w/ Annotations
module Data.Comp.Derive.SmartAConstructors,
-- ** Lifting to Sums
liftSum
) where
import Control.DeepSeq (NFData (..))
import Data.Comp.Derive.Arbitrary
import Data.Comp.Derive.DeepSeq
import Data.Comp.Derive.Equality
import Data.Comp.Derive.Foldable
import Data.Comp.Derive.HaskellStrict
import Data.Comp.Derive.Ordering
import Data.Comp.Derive.Show
import Data.Comp.Derive.SmartAConstructors
import Data.Comp.Derive.SmartConstructors
import Data.Comp.Derive.Traversable
import Data.Comp.Derive.Utils (derive, liftSumGen)
import Data.Comp.Ops ((:+:), caseF)
import Language.Haskell.TH
import qualified Data.Derive.All as A
import qualified Data.DeriveTH as D
{-| Derive an instance of 'Functor' for a type constructor of any first-order
kind taking at least one argument. -}
makeFunctor :: Name -> Q [Dec]
makeFunctor = D.derive A.makeFunctor
{-| Derive an instance of 'NFData' for a type constructor. -}
makeNFData :: Name -> Q [Dec]
makeNFData = D.derive A.makeNFData
{-| Given the name of a type class, where the first parameter is a functor,
lift it to sums of functors. Example: @class ShowF f where ...@ is lifted
as @instance (ShowF f, ShowF g) => ShowF (f :+: g) where ... @. -}
liftSum :: Name -> Q [Dec]
liftSum = liftSumGen 'caseF ''(:+:)
| {
"content_hash": "1be2f2db70210edce5ee5178cc773e44",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 80,
"avg_line_length": 32.566265060240966,
"alnum_prop": 0.6500184979652238,
"repo_name": "spacekitteh/compdata",
"id": "d5369d1ad2d9cb88a03a95eb7b776073e84b623b",
"size": "2703",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Data/Comp/Derive.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "357810"
},
{
"name": "Shell",
"bytes": "758"
}
],
"symlink_target": ""
} |
package io.github.binaryfoo.tlv;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Test;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.*;
public class TagTest {
private static final byte[] TAG_E1 = {(byte) 0xE1};
private static final byte[] TAG_1F = {(byte) 0x1F};
private static final byte[] TAG_3F = {(byte) 0x3F};
private static final byte[] TAG_NEGATIVE_1 = {(byte) -1};
private static final byte[] TAG_9F39 = {(byte) 0x9f, (byte) 0x39};
private static final byte[] TAG_9F1A = {(byte) 0x9f, (byte) 0x1A};
private static final byte[] TAG_9FC8 = {(byte) 0x9f, (byte) 0xC8};
private static final byte[] TAG_9FC81A = {(byte) 0x9f, (byte) 0xC8, (byte) 0x1A};
private static final byte[] TAG_9F1A1A = {(byte) 0x9f, (byte) 0x1A, (byte) 0x1A};
private static final byte[] TAG_9FC8C8 = {(byte) 0x9f, (byte) 0xC8, (byte) 0xC8};
@Test
public void testHexStringFactoryMethod() throws Exception {
Tag tag = Tag.fromHex("9FC81A");
assertTrue(Arrays.equals(TAG_9FC81A, tag.getBytes()));
}
@Test
public void testConstructTagWithNull() throws Exception {
doIllegalArgumentTest(null);
}
@Test
public void testConstructTagWithEmptyByteArray() throws Exception {
doIllegalArgumentTest(new byte[]{});
}
@Test
public void testConstructTagWithNegative1() throws Exception {
doIllegalArgumentTest(TAG_NEGATIVE_1);
}
@Test
public void testConstructTagWith1F() throws Exception {
doIllegalArgumentTest(TAG_1F);
}
@Test
public void testConstructTagWith3F() throws Exception {
doIllegalArgumentTest(TAG_3F);
}
@Test
public void testConstructTagWithE1() throws Exception {
doValidTest(TAG_E1);
}
@Test
public void testConstructTagWith9F39() throws Exception {
doValidTest(TAG_9F39);
}
@Test
public void testConstructTagWith9F1A() throws Exception {
doValidTest(TAG_9F1A);
}
@Test
public void testConstructTagWith9FC8() throws Exception {
doIllegalArgumentTest(TAG_9FC8);
}
@Test
public void testConstructTagWith9FC81A() throws Exception {
doValidTest(TAG_9FC81A);
}
@Test
public void testConstructTagWith9F1A1A() throws Exception {
doIllegalArgumentTest(TAG_9F1A1A);
}
@Test
public void testConstructTagWith9FC8C8() throws Exception {
doIllegalArgumentTest(TAG_9FC8C8);
}
private void doValidTest(byte[] bytes) {
Tag tag = new Tag(bytes, true);
assertTrue(Arrays.equals(bytes, tag.getBytes()));
}
private void doIllegalArgumentTest(byte[] bytes) {
try {
new Tag(bytes, true);
fail();
} catch (IllegalArgumentException ignored) {
}
}
@Test
public void testIsConstructed() throws Exception {
assertTrue(Tag.fromHex("21").isConstructed());
assertFalse(Tag.fromHex("01").isConstructed());
assertFalse(Tag.fromHex("8F").isConstructed());
}
@Test
public void testParse() throws Exception {
doTestParse(TAG_E1);
doTestParse(TAG_9F39);
doTestParse(TAG_9F1A);
doTestParse(TAG_9FC81A);
}
@Test
public void testParseListOfTags() throws Exception {
ByteBuffer byteBuffer = ByteBuffer.allocate(20);
byteBuffer.put(TAG_E1);
byteBuffer.put(TAG_9F39);
byteBuffer.put(TAG_9F1A);
byteBuffer.put(TAG_9FC81A);
int endPosition = byteBuffer.position();
byteBuffer.flip();
BerTlvUtils.assertEquals(TAG_E1, Tag.parse(byteBuffer).getBytes());
BerTlvUtils.assertEquals(TAG_9F39, Tag.parse(byteBuffer).getBytes());
BerTlvUtils.assertEquals(TAG_9F1A, Tag.parse(byteBuffer).getBytes());
BerTlvUtils.assertEquals(TAG_9FC81A, Tag.parse(byteBuffer).getBytes());
assertEquals(endPosition, byteBuffer.position());
}
@Test
public void nonStandard9F84() throws Exception {
Tag parsedTag = Tag.parse(asBuffer("9F84"), new QuirkListTagMode(Collections.singleton("9F84")));
assertThat(parsedTag.getHexString(), is("9F84"));
}
@Test
public void commonVendorErrorMode() throws Exception {
assertThat(Tag.parse(asBuffer("9F81"), CommonVendorErrorMode.INSTANCE$).getHexString(), is("9F81"));
assertThat(Tag.parse(asBuffer("9F8A"), CommonVendorErrorMode.INSTANCE$).getHexString(), is("9F8A"));
assertThat(Tag.parse(asBuffer("9F8F"), CommonVendorErrorMode.INSTANCE$).getHexString(), is("9F8F"));
assertThat(Tag.parse(asBuffer("9FC81A"), CommonVendorErrorMode.INSTANCE$).getHexString(), is("9FC81A"));
}
private void doTestParse(byte[] rawTag) {
ByteBuffer buffer = asBuffer(rawTag);
Tag parsedTag = Tag.parse(buffer);
BerTlvUtils.assertEquals(rawTag, parsedTag.getBytes());
assertEquals(rawTag.length, buffer.position());
}
private ByteBuffer asBuffer(String tagAsHex) {
return asBuffer(ISOUtil.hex2byte(tagAsHex));
}
private ByteBuffer asBuffer(byte[] rawTag) {
ByteBuffer buffer = ByteBuffer.allocate(8);
buffer.put(rawTag);
return (ByteBuffer) buffer.flip();
}
}
| {
"content_hash": "935cb61866126ec8b6fa32b7399ebcc8",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 112,
"avg_line_length": 32.144578313253014,
"alnum_prop": 0.6577961019490255,
"repo_name": "mehulsbhatt/emv-bertlv",
"id": "387d6a06b8ca859583463386729cc486f02ef38a",
"size": "5336",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/io/github/binaryfoo/tlv/TagTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Groovy",
"bytes": "674"
},
{
"name": "Java",
"bytes": "137541"
},
{
"name": "Kotlin",
"bytes": "148292"
}
],
"symlink_target": ""
} |
import pytest
from selenium.webdriver.common.by import By
@pytest.mark.xfail_safari
def test_should_fire_click_event_when_clicking(driver, pages):
pages.load("javascriptPage.html")
_click_on_element_which_records_events(driver)
_assert_event_fired(driver, "click")
@pytest.mark.xfail_safari
def test_should_fire_mouse_down_event_when_clicking(driver, pages):
pages.load("javascriptPage.html")
_click_on_element_which_records_events(driver)
_assert_event_fired(driver, "mousedown")
@pytest.mark.xfail_safari
def test_should_fire_mouse_up_event_when_clicking(driver, pages):
pages.load("javascriptPage.html")
_click_on_element_which_records_events(driver)
_assert_event_fired(driver, "mouseup")
@pytest.mark.xfail_safari
def test_should_issue_mouse_down_events(driver, pages):
pages.load("javascriptPage.html")
driver.find_element(By.ID, "mousedown").click()
result = driver.find_element(By.ID, "result").text
assert result == "mouse down"
@pytest.mark.xfail_safari
def test_should_issue_click_events(driver, pages):
pages.load("javascriptPage.html")
driver.find_element(By.ID, "mouseclick").click()
result = driver.find_element(By.ID, "result").text
assert result == "mouse click"
@pytest.mark.xfail_safari
def test_should_issue_mouse_up_events(driver, pages):
pages.load("javascriptPage.html")
driver.find_element(By.ID, "mouseup").click()
result = driver.find_element(By.ID, "result").text
assert result == "mouse up"
@pytest.mark.xfail_safari
def test_mouse_events_should_bubble_up_to_containing_elements(driver, pages):
pages.load("javascriptPage.html")
driver.find_element(By.ID, "child").click()
result = driver.find_element(By.ID, "result").text
assert result == "mouse down"
@pytest.mark.xfail_safari
def test_should_emit_on_change_events_when_selecting_elements(driver, pages):
pages.load("javascriptPage.html")
select = driver.find_element(By.ID, 'selector')
options = select.find_elements(By.TAG_NAME, 'option')
initialTextValue = driver.find_element(By.ID, "result").text
select.click()
assert driver.find_element(By.ID, "result").text == initialTextValue
options[1].click()
assert driver.find_element(By.ID, "result").text == "bar"
@pytest.mark.xfail_safari
def test_should_emit_on_change_events_when_changing_the_state_of_acheckbox(driver, pages):
pages.load("javascriptPage.html")
checkbox = driver.find_element(By.ID, "checkbox")
checkbox.click()
assert driver.find_element(By.ID, "result").text == "checkbox thing"
def test_should_emit_click_event_when_clicking_on_atext_input_element(driver, pages):
pages.load("javascriptPage.html")
clicker = driver.find_element(By.ID, "clickField")
clicker.click()
assert clicker.get_attribute("value") == "Clicked"
@pytest.mark.xfail_safari
def test_clearing_an_element_should_cause_the_on_change_handler_to_fire(driver, pages):
pages.load("javascriptPage.html")
element = driver.find_element(By.ID, "clearMe")
element.clear()
result = driver.find_element(By.ID, "result")
assert result.text == "Cleared"
# TODO Currently Failing and needs fixing
# def test_sending_keys_to_another_element_should_cause_the_blur_event_to_fire(driver, pages):
# pages.load("javascriptPage.html")
# element = driver.find_element(By.ID, "theworks")
# element.send_keys("foo")
# element2 = driver.find_element(By.ID, "changeable")
# element2.send_keys("bar")
# _assertEventFired(driver, "blur")
# TODO Currently Failing and needs fixing
# def test_sending_keys_to_an_element_should_cause_the_focus_event_to_fire(driver, pages):
# pages.load("javascriptPage.html")
# element = driver.find_element(By.ID, "theworks")
# element.send_keys("foo")
# _assertEventFired(driver, "focus")
def _click_on_element_which_records_events(driver):
driver.find_element(By.ID, "plainButton").click()
def _assert_event_fired(driver, eventName):
result = driver.find_element(By.ID, "result")
text = result.text
assert eventName in text, "No " + eventName + " fired: " + text
| {
"content_hash": "3e8b9db45325751aa3e5548be5dfc5cc",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 94,
"avg_line_length": 34.56666666666667,
"alnum_prop": 0.7128736740597879,
"repo_name": "HtmlUnit/selenium",
"id": "ae63df258a1d26caa046154bb4323cf1d8ce51e1",
"size": "4936",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "py/test/selenium/webdriver/common/correct_event_firing_tests.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP.NET",
"bytes": "825"
},
{
"name": "Batchfile",
"bytes": "4443"
},
{
"name": "C",
"bytes": "82917"
},
{
"name": "C#",
"bytes": "2977660"
},
{
"name": "C++",
"bytes": "2282643"
},
{
"name": "CSS",
"bytes": "1049"
},
{
"name": "Dockerfile",
"bytes": "1737"
},
{
"name": "HTML",
"bytes": "1379423"
},
{
"name": "Java",
"bytes": "6302205"
},
{
"name": "JavaScript",
"bytes": "2533049"
},
{
"name": "Makefile",
"bytes": "4655"
},
{
"name": "Python",
"bytes": "974345"
},
{
"name": "Ragel",
"bytes": "3086"
},
{
"name": "Ruby",
"bytes": "1004097"
},
{
"name": "Shell",
"bytes": "30004"
},
{
"name": "Starlark",
"bytes": "395776"
},
{
"name": "TypeScript",
"bytes": "110634"
},
{
"name": "XSLT",
"bytes": "1047"
}
],
"symlink_target": ""
} |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
extra = {}
try:
from nowin_core.scripts import setup_cmd
extra['cmdclass'] = {
'initdb': setup_cmd.InitdbCommand,
'shell': setup_cmd.ShellCommand
}
except ImportError:
pass
tests_require = [
'mock',
'pytest',
'pytest-cov',
'pytest-xdist',
'pytest-capturelog',
'pytest-mock',
]
setup(
name='nowin_core',
packages=find_packages(),
install_requires=[
'psutil',
'SQLAlchemy',
'zope.sqlalchemy',
'transaction',
'nose',
'PyYaml',
'Twisted',
'zope.sqlalchemy',
],
tests_require=[
'nose-cov'
],
extras_require=dict(
tests=tests_require,
),
**extra
)
| {
"content_hash": "1c6c8faea8f46d30026ed181f0203309",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 44,
"avg_line_length": 18.11111111111111,
"alnum_prop": 0.5631901840490797,
"repo_name": "g0v/nowin_core",
"id": "a2891035cca247696c9de7de9b7ea79078c8d9b2",
"size": "815",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "setup.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "299101"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<ArrayOfCountryInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CountryInfo>
<EnglishName>Andorra</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AD</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AD</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Abu Dhabi</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AE</TwoLetterISOCountryName>
<CountryCode>599</CountryCode>
<Inhabited>true</Inhabited>
<Name>AE-ABU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Al l'Ayn</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AE</TwoLetterISOCountryName>
<CountryCode>9217877</CountryCode>
<Inhabited>true</Inhabited>
<Name>AE-AL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ash Shariqah</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AE</TwoLetterISOCountryName>
<CountryCode>2082</CountryCode>
<Inhabited>true</Inhabited>
<Name>AE-ASH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Dubai</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AE</TwoLetterISOCountryName>
<CountryCode>9470</CountryCode>
<Inhabited>true</Inhabited>
<Name>AE-DUB</Name>
</CountryInfo>
</Childs>
<EnglishName>United Arab Emirates</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AE</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Herat</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AF</TwoLetterISOCountryName>
<CountryCode>13852</CountryCode>
<Inhabited>true</Inhabited>
<Name>AF-HER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kabul</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AF</TwoLetterISOCountryName>
<CountryCode>15851</CountryCode>
<Inhabited>true</Inhabited>
<Name>AF-KAB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kandahar</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AF</TwoLetterISOCountryName>
<CountryCode>16074</CountryCode>
<Inhabited>true</Inhabited>
<Name>AF-KAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mazar-e Sharif</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AF</TwoLetterISOCountryName>
<CountryCode>20696</CountryCode>
<Inhabited>true</Inhabited>
<Name>AF-MAZ</Name>
</CountryInfo>
</Childs>
<EnglishName>Afghanistan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AF</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AF</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Antigua And Barbuda</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Anguilla</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Albania</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AL</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Armenia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Netherlands Antilles</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Angola</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Antarctica</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AQ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AQ</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Buenos Aires</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>5155</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-BUE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Catamarca</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106912</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-CAT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Chaco</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>6427</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-CHA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Chubut</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106904</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-CHU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cordoba</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>7915</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-COR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Corrientes</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>7990</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-COR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Distrito Federal</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106907</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-DIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Entre Rios</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10313</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-ENT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Formosa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106913</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-FOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Jujuy</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106914</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-JUJ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>La Pampa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106906</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-LA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>La Rioja</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106910</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-LA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mendoza</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>20974</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-MEN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Misiones</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106911</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-MIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Neuquen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>23013</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-NEU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ro Negro</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106905</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-RO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Salta</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>29054</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-SAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>San Juan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>29330</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-SAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>San Luis</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>10106909</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-SAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Santa Cruz</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>29642</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-SAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Santa Fe</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>29657</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-SAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Santiago del Estero</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>29744</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-SAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tierra del Fuego Antrtida e Islas del Atlntico S</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>8983108</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-TIE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tucuman</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>34062</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR-TUC</Name>
</CountryInfo>
</Childs>
<EnglishName>Argentina</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>American Samoa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AS</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Austria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Australia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Aruba</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Azerbaijan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>AZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>AZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bosnia AND Herzegovina</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Barbados</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BB</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bangladesh</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BD</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Belgium</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Burkina Faso</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BF</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BF</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bulgaria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bahrain</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BH</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Burundi</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Benin</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BJ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BJ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bermuda</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Brunei</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bolivia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Brazil</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bahamas, The</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BS</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bhutan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bouvet Island</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BV</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Botswana</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Belarus</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Belize</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>BZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>BZ</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Alberta</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>1076</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-ALB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>British Columbia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>4934</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-BRI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Manitoba</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>20110</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-MAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>New Brunswick</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>23074</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-NEW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Newfoundland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>23204</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-NEW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Northwest Territories</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>23766</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-NOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nova Scotia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>23841</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-NOV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nunavut</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>42096</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-NUN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ontario</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>24465</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-ONT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Prince Edward Island</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>26704</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-PRI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Quebec</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>27068</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-QUE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saskatchewan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>29926</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-SAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Yukon Territory</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>37348</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA-YUK</Name>
</CountryInfo>
</Childs>
<EnglishName>Canada</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cocos (Keeling) Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CC</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Congo, Democractic Republic of the</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CD</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Central African Republic</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CF</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CF</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Congo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Switzerland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CH</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cote D'Ivoire (Ivory Coast)</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cook Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Chile</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CL</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cameroon</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>China</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Colombia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Costa Rica</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cuba</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cape Verde</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CV</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Christmas Island</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CX</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CX</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cyprus</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Czech Republic</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>CZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>CZ</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Baden-Wrttemberg</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>2537</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-BAD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bayern</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8255245</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-BAY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Berlin</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8045746</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-BER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Brandenburg</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8248738</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-BRA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bremen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>41760</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-BRE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Hamburg</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>13339</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-HAM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Hessen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8208586</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-HES</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mecklenburg-Vorpommern</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8175722</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-MEC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Niedersachsen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>23331</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-NIE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nordrhein-Westfalen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8164991</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-NOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Rheinland-Pfalz</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>27654</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-RHE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saarland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>28479</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-SAA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sachsen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8145598</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-SAC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sachsen-Anhalt</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8145597</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-SAC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Schleswig-Holstein</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8141652</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-SCH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Thuringen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>8125502</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE-THU</Name>
</CountryInfo>
</Childs>
<EnglishName>Germany</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>DE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Djibouti</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DJ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>DJ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Denmark</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>DK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Dominica</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>DM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Dominican Republic</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>DO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Algeria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>DZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>DZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ecuador</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>EC</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>EC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Estonia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>EE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>EE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Egypt</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>EG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>EG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Eritrea</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ER</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ER</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Alava</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9630421</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-ALA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Albacete</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9630410</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-ALB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Alicante</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9629788</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-ALI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Almeria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9629623</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-ALM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Asturias</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9605029</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-AST</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Avila</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9628030</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-AVI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Badajoz</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9627875</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-BAD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Baleares</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>10111303</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-BAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Barcelona</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9627509</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-BAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Burgos</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9625584</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-BUR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Caceres</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9625152</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-CAC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cadiz</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9625113</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-CAD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Castellon</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>10111296</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-CAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ciudad Real</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9621755</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-CIU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cordoba</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9621233</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-COR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cuenca</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9620542</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-CUE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Gerona</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>10111297</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-GER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Granada</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9615670</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-GRA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Guadalajara</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9615419</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-GUA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Guipuzcoa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9615112</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-GUI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Huelva</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9614436</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-HUE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Huesca</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9614354</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-HUE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Jaen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9613931</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-JAE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>La Coruna</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9613207</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-LA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>La Rioja</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9610406</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-LA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Las Palmas</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9611473</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-LAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Leon</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9610926</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-LEO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lleida</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9610903</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-LLE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Madrid</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>10111301</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-MAD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Malaga</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9609211</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-MAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Murcia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>10111302</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-MUR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Navarra</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9606207</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-NAV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Orense</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9605329</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-ORE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Palencia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9604804</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-PAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Provincia de Lugo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9609494</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-PRO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Provincia de Pontevedra</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9602882</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-PRO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Salamanca</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9599894</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-SAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Santa Cruz de Tenerife</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9598313</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-SAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Santander</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>10111300</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-SAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Segovia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9597450</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-SEG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sevilla</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9597150</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-SEV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Soria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9596689</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-SOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tarragona</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9596097</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-TAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Teruel</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>10111298</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-TER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Toledo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9595641</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-TOL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Valencia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9593864</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-VAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Valladolid</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9593798</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-VAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vizcaya</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9591071</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-VIZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Zamora</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>9590886</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-ZAM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Zaragoza</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>10111299</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES-ZAR</Name>
</CountryInfo>
</Childs>
<EnglishName>Spain</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ES</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ES</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ethiopia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ET</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ET</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Finland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>FI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Fiji Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FJ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>FJ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Falkland Islands (Islas Malvinas)</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>FK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Micronesia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>FM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Faroe Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>FO</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Ain</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8593129</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-AIN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Aisne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8593082</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-AIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Allier</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8592815</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ALL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Alpes-de-Haute-Provence</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8592754</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ALP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Alpes-Maritimes</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8592753</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ALP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ardeche</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8591842</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ARD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ardennes</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8591830</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ARD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ariege</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8591658</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ARI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Aube</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8591109</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-AUB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Aude</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8590953</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-AUD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Aveyron</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8590379</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-AVE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bas-Rhin</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8589403</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-BAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bouches-du-Rhone</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8586025</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-BOU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Calvados</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8583754</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-CAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cantal</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8583450</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-CAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Charente</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8581300</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-CHA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Charente-Maritime</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8581298</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-CHA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cher</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8580134</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-CHE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Correze</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8578186</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-COR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Corse-du-Sud</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8578168</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-COR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cote-d'Or</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8578076</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-COT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cotes-d'Armor</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8578067</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-COT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Creuse</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8577167</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-CRE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Deux-Sevres</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8576149</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-DEU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Dordogne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8575688</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-DOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Doubs</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8575635</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-DOU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Drome</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8575427</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-DRO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Essonne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8574239</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ESS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Eure</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8573956</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-EUR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Eure-et-Loir</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8573955</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-EUR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Finistere</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8573109</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-FIN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Gard</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8571302</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-GAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Gers</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8570825</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-GER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Gironde</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8570578</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-GIR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haute-Corse</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568416</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haute-Garonne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568389</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haute-Loire</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568382</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haute-Marne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568379</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Hautes-Alpes</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568359</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haute-Saone</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568358</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haute-Savoie</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568357</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Hautes-Pyrenees</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568347</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haute-Vienne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568340</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haut-Rhin</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568284</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Hauts-de-Seine</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568278</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Herault</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8568121</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-HER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ille-et-Vilaine</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8567467</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ILL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Indre</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8567423</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-IND</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Indre-et-Loire</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8567422</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-IND</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Isere</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8567332</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ISE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Jura</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8566665</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-JUR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Landes</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8562476</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-LAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Loire</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8552463</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-LOI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Loire-Atlantique</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8552454</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-LOI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Loiret</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8552450</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-LOI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Loir-et-Cher</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8552449</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-LOI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lot</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8552114</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-LOT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lot-et-Garonne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8552113</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-LOT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lozere</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8551878</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-LOZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Maine-et-Loire</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8551250</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-MAI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Manche</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8550855</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-MAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Marne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8550187</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-MAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mayenne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8549516</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-MAY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Meurthe-et-Moselle</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8548691</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-MEU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Meuse</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8548685</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-MEU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Morbihan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8546453</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-MOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Moselle</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8546201</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-MOS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nievre</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8544940</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-NIE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nord</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8544697</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-NOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Oise</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8544230</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-OIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Orne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8543814</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-ORN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Paris</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8523323</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-PAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pas-de-Calais</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8542995</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-PAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Puy-de-Dome</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8539537</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-PUY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pyrenees-Atlantiques</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8539437</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-PYR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pyrenees-Orientales</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8539434</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-PYR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Rhone</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>10026439</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-RHO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saone-et-Loire</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8530614</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-SAO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sarthe</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8530458</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-SAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Savoie</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8530048</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-SAV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Seine-et-Marne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8529778</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-SEI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Seine-Maritime</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8529777</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-SEI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Seine-Saint-Denis</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8529775</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-SEI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Somme</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8528825</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-SOM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tarn</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8527882</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-TAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tarn-et-Garonne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8527877</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-TAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Territoire-de-Belfort</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8588470</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-TER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Val-De-Marne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8525601</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-VAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Val-drOise</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8525582</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-VAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Var</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8525260</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-VAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vaucluse</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8525064</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-VAU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vendee</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8524650</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-VEN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vienne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8523790</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-VIE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vosges</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8522188</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-VOS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Yonne</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8521729</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-YON</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Yvelines</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>8521702</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR-YVE</Name>
</CountryInfo>
</Childs>
<EnglishName>France</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>FR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>FR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Gabon</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>United Kingdom</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GB</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Grenada</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GD</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Georgia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>French Guiana</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GF</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GF</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ghana</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GH</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Gibraltar</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Greenland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GL</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Gambia, The</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Guinea</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Guadeloupe</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GP</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Equatorial Guinea</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GQ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GQ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Greece</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>South Georgia And The South Sandwich Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GS</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Guatemala</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Guam</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Guinea-Bissau</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Guyana</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>GY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>GY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Hong Kong S.A.R.</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>HK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>HK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Heard AND McDonald Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>HM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>HM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Honduras</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>HN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>HN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Croatia (Hrvatska)</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>HR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>HR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Haiti</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>HT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>HT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Hungary</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>HU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>HU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Indonesia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ID</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ID</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ireland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>IE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Israel</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IL</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>IL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>India</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>IN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>British Indian Ocean Territory</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>IO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Iraq</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IQ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>IQ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Iran</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>IR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Iceland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IS</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>IS</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Agrigento</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9889982</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-AGR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Alessandria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9889853</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ALE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ancona</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126883</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ANC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Aosta</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9889497</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-AOS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Arezzo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9889362</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ARE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ascoli Piceno</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126885</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ASC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Asti</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9889164</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-AST</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Avellino</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9889092</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-AVE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bari</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9888744</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Belluno</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9888582</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BEL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Benevento</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9888540</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BEN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bergamo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9888525</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Biella</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10209554</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BIE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bologna</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9888257</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BOL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Bolzano</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9888241</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BOL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Brescia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9887844</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BRE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Brindisi</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9887815</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-BRI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cagliari</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9887534</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CAG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Caltanissetta</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126889</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Campobasso</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9887202</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CAM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Caserta</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9885780</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Catania</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9885210</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CAT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Catanzaro</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9885203</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CAT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Chieti</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126886</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CHI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Como</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9883946</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-COM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cosenza</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9883595</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-COS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cremona</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9883496</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CRE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Crotone</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10209560</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CRO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cuneo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9883330</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-CUN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Enna</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126890</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ENN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ferrara</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9882611</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-FER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Firenze</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9882456</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-FIR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Foggia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9882361</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-FOG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Forli-Cesena</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9882212</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-FOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Frosinone</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9881951</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-FRO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Genova</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9881598</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-GEN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Gorizia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9881297</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-GOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Grosseto</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9881066</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-GRO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Imperia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9880762</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-IMP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Isernia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9880657</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ISE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>La Spezia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9880226</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-LA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>L'Aquila</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9880275</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-L'A</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Latina</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9880201</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-LAT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lecce</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9880079</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-LEC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lecco</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10209557</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-LEC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Livorno</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9879741</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-LIV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lodi</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10209556</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-LOD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lucca</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9879594</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-LUC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Macerata</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126884</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-MAC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mantova</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9879034</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-MAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Massa Carrara</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9878692</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-MAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Matera</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9878616</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-MAT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Messina</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9878383</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-MES</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Milano</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9878273</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-MIL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Modena</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9878134</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-MOD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Napoli</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9877095</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-NAP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Novara</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9876861</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-NOV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nuoro</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126892</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-NUO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Oristano</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126891</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ORI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Padova</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9876337</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PAD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Palermo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9876200</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Parma</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9876000</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pavia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9875893</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PAV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Perugia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9875675</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pesaro e Urbino</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9875668</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PES</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pescara</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9875659</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PES</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Piacenza</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9875535</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PIA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pisa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9875081</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pistoia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9875048</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pordenone</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9874523</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-POR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Potenza</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9874381</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-POT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Prato</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10209559</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-PRA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ragusa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126888</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-RAG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ravenna</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9873853</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-RAV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Reggio di Calabria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9873808</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-REG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Reggio nella Emilia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9873807</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-REG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Rieti</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9873679</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-RIE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Rimini</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10209558</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-RIM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Roma</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9873306</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ROM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Rovigo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9873060</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-ROV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Salerno</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9872871</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-SAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sassari</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9870948</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-SAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Savona</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9870868</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-SAV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Siena</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9870289</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-SIE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Siracusa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9870214</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-SIR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sondrio</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9870080</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-SON</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Taranto</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9869522</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-TAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Teramo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10126887</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-TER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Terni</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9869351</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-TER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Torino</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9869061</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-TOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Trapani</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9868810</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-TRA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Trento</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9868716</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-TRE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Treviso</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9868672</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-TRE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Trieste</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9868653</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-TRI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Udine</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9868517</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-UDI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Varese</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9868095</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-VAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Venezia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9867990</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-VEN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Verbano-Cusio-Ossola</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10209555</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-VER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vercelli</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9867950</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-VER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Verona</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9867907</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-VER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vibo Valentia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>10209561</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-VIB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vicenza</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9867790</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-VIC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Viterbo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>9867354</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT-VIT</Name>
</CountryInfo>
</Childs>
<EnglishName>Italy</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>IT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>IT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Jamaica</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>JM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>JM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Jordan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>JO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>JO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Japan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>JP</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>JP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kenya</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kyrgyzstan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cambodia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KH</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kiribati</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Comoros</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saint Kitts And Nevis</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Korea, North</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KP</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Korea</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kuwait</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Cayman Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kazakhstan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>KZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>KZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Laos</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lebanon</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LB</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saint Lucia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LC</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Liechtenstein</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sri Lanka</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Liberia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lesotho</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LS</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Lithuania</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Luxembourg</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Latvia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LV</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Libya</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>LY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>LY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Morocco</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Monaco</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MC</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Moldova</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MD</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Madagascar</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Marshall Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MH</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Macedonia, Former Yugoslav Republic of</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mali</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ML</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ML</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Myanmar</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mongolia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Macau S.A.R.</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Northern Mariana Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MP</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Martinique</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MQ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MQ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mauritania</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Montserrat</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MS</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Malta</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mauritius</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Maldives</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MV</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Malawi</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mexico</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MX</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MX</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Malaysia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mozambique</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>MZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>MZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Namibia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>New Caledonia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NC</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Niger</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Norfolk Island</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NF</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NF</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nigeria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nicaragua</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Netherlands, The</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NL</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NL</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Unspecified</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NN-UNS</Name>
</CountryInfo>
</Childs>
<EnglishName>Unknown</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Norway</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nepal</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NP</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NP</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nauru</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Niue</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>New Zealand</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>NZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>NZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Oman</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>OM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>OM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Panama</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Peru</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>French Polynesia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PF</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PF</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Papua new Guinea</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Philippines</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PH</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pakistan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Poland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PL</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saint Pierre AND Miquelon</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pitcairn Island</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Puerto Rico</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Portugal</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Palau</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Paraguay</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Qatar</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>QA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>QA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Reunion</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>RE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>RE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Romania</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>RO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>RO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Russia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>RU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>RU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Rwanda</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>RW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>RW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saudi Arabia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Solomon Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SB</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Seychelles</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SC</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sudan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SD</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sweden</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Singapore</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saint Helena</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SH</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Slovenia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Svalbard And Jan Mayen Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SJ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SJ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Slovakia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sierra Leone</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SL</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>San Marino</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Senegal</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Somalia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Suriname</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Sao Tome AND Principe</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ST</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ST</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>El Salvador</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SV</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Syria</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Swaziland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>SZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>SZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Turks And Caicos Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TC</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Chad</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TD</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TD</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>French Southern Territories</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TF</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TF</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Togo</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Thailand</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TH</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TH</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tajikistan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TJ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TJ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tokelau</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TK</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>East Timor</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TL</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tunisia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tonga</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TO</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Turkey</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TR</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Trinidad And Tobago</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tuvalu</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TV</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Taiwan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tanzania</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>TZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>TZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ukraine</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>UA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>UA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Uganda</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>UG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>UG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>United States Minor Outlying Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>UM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>UM</Name>
</CountryInfo>
<CountryInfo>
<Childs>
<CountryInfo>
<EnglishName>Alabama</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>1003</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-ALA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Alaska</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>1040</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-ALA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Arizona</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>1945</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-ARI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Arkansas</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>1951</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-ARK</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>California</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>5599</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-CAL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Colorado</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>7636</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-COL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Connecticut</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>7798</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-CON</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Delaware</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>8831</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-DEL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>District of Columbia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>9130</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-DIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Florida</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>11032</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-FLO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Georgia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>12004</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-GEO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Hawaii</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>13656</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-HAW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Idaho</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>14713</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-IDA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Illinois</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>14808</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-ILL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Indiana</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>14882</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-IND</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Iowa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>14987</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-IOW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kansas</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>16121</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-KAN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Kentucky</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>16480</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-KEN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Louisiana</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>19283</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-LOU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Maine</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>19840</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-MAI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Maryland</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>20487</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-MAR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Massachusetts</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>20543</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-MAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Michigan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>21196</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-MIC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Minnesota</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>21412</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-MIN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mississippi</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>21502</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-MIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Missouri</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>21512</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-MIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Montana</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>21789</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-MON</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nebraska</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>22869</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-NEB</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Nevada</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>23035</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-NEV</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>New Hampshire</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>23097</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-NEW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>New Jersey</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>23117</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-NEW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>New Mexico</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>23132</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-NEW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>New York</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>23161</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-NEW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>North Carolina</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>23611</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-NOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>North Dakota</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>23624</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-NOR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Ohio</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>24230</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-OHI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Oklahoma</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>24293</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-OKL</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Oregon</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>24561</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-ORE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Pennsylvania</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>25623</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-PEN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Rhode Island</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>27664</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-RHO</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>South Carolina</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>31410</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-SOU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>South Dakota</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>31418</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-SOU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Tennessee</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>33025</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-TEN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Texas</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>33145</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-TEX</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Utah</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>34626</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-UTA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vermont</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>35022</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-VER</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Virginia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>35364</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-VIR</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Washington</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>35841</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-WAS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>West Virginia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>36208</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-WES</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Wisconsin</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>36684</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-WIS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Wyoming</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>36927</CountryCode>
<Inhabited>true</Inhabited>
<Name>US-WYO</Name>
</CountryInfo>
</Childs>
<EnglishName>United States</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>US</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>US</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Uruguay</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>UY</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>UY</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Uzbekistan</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>UZ</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>UZ</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vatican City State (Holy See)</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>VA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>VA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Saint Vincent And The Grenadines</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>VC</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>VC</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Venezuela</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>VE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>VE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Virgin Islands (British)</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>VG</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>VG</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Virgin Islands (US)</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>VI</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>VI</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vietnam</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>VN</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>VN</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Vanuatu</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>VU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>VU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Wallis And Futuna Islands</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>WF</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>WF</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Samoa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>WS</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>WS</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Yemen</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>YE</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>YE</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Mayotte</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>YT</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>YT</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Yugoslavia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>YU</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>YU</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>South Africa</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ZA</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ZA</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Zambia</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ZM</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ZM</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Zimbabwe</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>ZW</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>ZW</Name>
</CountryInfo>
<CountryInfo>
<EnglishName>Palestinian territory, Occupied</EnglishName>
<ThreeLetterISOCountryName />
<TwoLetterISOCountryName>PS</TwoLetterISOCountryName>
<CountryCode>0</CountryCode>
<Inhabited>true</Inhabited>
<Name>PS</Name>
</CountryInfo>
</ArrayOfCountryInfo> | {
"content_hash": "4a72ebb663be0acf0db26a51142d239e",
"timestamp": "",
"source": "github",
"line_count": 4823,
"max_line_length": 119,
"avg_line_length": 34.472527472527474,
"alnum_prop": 0.6726351940623477,
"repo_name": "Appleseed/portal",
"id": "f18ed167fa47973b6679fbb1a55c34443a2e7269",
"size": "166261",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Master/Appleseed/WebSites/Appleseed/App_GlobalResources/Countries.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "701416"
},
{
"name": "Batchfile",
"bytes": "5824"
},
{
"name": "C#",
"bytes": "5437355"
},
{
"name": "CSS",
"bytes": "3097267"
},
{
"name": "ColdFusion",
"bytes": "166069"
},
{
"name": "Gherkin",
"bytes": "225"
},
{
"name": "HTML",
"bytes": "1084272"
},
{
"name": "JavaScript",
"bytes": "5781627"
},
{
"name": "Lasso",
"bytes": "34435"
},
{
"name": "PHP",
"bytes": "111194"
},
{
"name": "PLpgSQL",
"bytes": "353788"
},
{
"name": "Perl",
"bytes": "38719"
},
{
"name": "Perl 6",
"bytes": "25708"
},
{
"name": "PowerShell",
"bytes": "3737"
},
{
"name": "Python",
"bytes": "46471"
},
{
"name": "SQLPL",
"bytes": "6479"
},
{
"name": "Smalltalk",
"bytes": "25790"
},
{
"name": "XSLT",
"bytes": "39762"
}
],
"symlink_target": ""
} |
/** @define utilities */
.u-padding-halfrem {
padding: 0.5rem !important;
}
.u-p-halfrem {
padding: 0.5rem !important;
}
.u-pt-halfrem {
padding-top: 0.5rem !important;
}
.u-pb-halfrem {
padding-bottom: 0.5rem !important;
}
.u-pl-halfrem {
padding-left: 0.5rem !important;
}
.u-pr-halfrem {
padding-right: 0.5rem !important;
}
@each $dimension in left, right, top, bottom {
.u-padding-$(dimension)-halfrem {
padding-$(dimension): 0.5rem !important;
}
}
@for $factor from 0 to 20 {
.u-padding-$(factor)rem {
padding: $(factor)rem !important;
}
}
@for $factor from 0 to 20 {
.u-p$(factor)rem {
padding: $(factor)rem !important;
}
.u-pt$(factor)rem {
padding-top: $(factor)rem !important;
}
.u-pb$(factor)rem {
padding-bottom: $(factor)rem !important;
}
.u-pl$(factor)rem {
padding-left: $(factor)rem !important;
}
.u-pr$(factor)rem {
padding-right: $(factor)rem !important;
}
}
@each $dimension in left, right, top, bottom {
@for $factor from 0 to 20 {
.u-padding-$(dimension)-$(factor)rem {
padding-$(dimension): $(factor)rem !important;
}
}
} | {
"content_hash": "f70da6b21009b5c04b8b27765e1ce103",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 52,
"avg_line_length": 19.53448275862069,
"alnum_prop": 0.6187113857016769,
"repo_name": "superflycss/utilities-layout",
"id": "a73552ef185d1a0cff509129c8d0d5fd918356be",
"size": "1133",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/css/padding/padding.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "90818"
},
{
"name": "HTML",
"bytes": "81310"
},
{
"name": "JavaScript",
"bytes": "550"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "ab6277a6adbafa6aa64538c371e348d4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "1f83973018a7da3756d7f62f3386275e9a78f7f1",
"size": "200",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Himantoglossum/Himantoglossum affine/ Syn. Himantoglossum caprinum bolleanum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OnlineExamPrep.Service.Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OnlineExamPrep.Service.Common")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("84dcf3c8-e445-4aab-8cb6-56c32c5d8cd5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "7952a1c59de49920db5fbf6ad01e5c75",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.75,
"alnum_prop": 0.7484276729559748,
"repo_name": "isimic413/OnlineExamPrep",
"id": "47d55672f8a152308538d584bcc1e1824fb0675b",
"size": "1434",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/OnlineExamPrep.Service.Common/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "115"
},
{
"name": "C#",
"bytes": "320894"
},
{
"name": "CSS",
"bytes": "8012"
},
{
"name": "HTML",
"bytes": "38320"
},
{
"name": "JavaScript",
"bytes": "772892"
},
{
"name": "SQLPL",
"bytes": "509"
}
],
"symlink_target": ""
} |
<component name="libraryTable">
<library name="support-media-compat-25.0.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.0.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.0.0/res" />
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.0.0/jars/libs/internal_impl-25.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://D:/sdk/extras/android/m2repository/com/android/support/support-media-compat/25.0.0/support-media-compat-25.0.0-sources.jar!/" />
</SOURCES>
</library>
</component> | {
"content_hash": "45f20440664faf7a25502b46f28558e9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 162,
"avg_line_length": 59.15384615384615,
"alnum_prop": 0.6983094928478544,
"repo_name": "lijunyandev/BottomBar",
"id": "713247a0cb548f3eb77ae11b2c5a92b450c5c31f",
"size": "769",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/libraries/support_media_compat_25_0_0.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "18395"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<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.6"/>
<title>OpenNI 1.5.8: XnOpenNIModuleInterface Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="OpenNILogo.bmp"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">OpenNI 1.5.8
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Public Attributes</a> |
<a href="struct_xn_open_n_i_module_interface-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">XnOpenNIModuleInterface Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <<a class="el" href="_xn_module_interface_8h_source.html">XnModuleInterface.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a01e2ad32155c2f5e3832c7a3bbd2ce7c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_xn_module_interface_8h.html#a90aa056e4c7e00dbe3ec58621835a590">XnModuleLoadPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_xn_open_n_i_module_interface.html#a01e2ad32155c2f5e3832c7a3bbd2ce7c">pLoadFunc</a></td></tr>
<tr class="separator:a01e2ad32155c2f5e3832c7a3bbd2ce7c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2634b684a0af5b5b0e49f333a76a2590"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_xn_module_interface_8h.html#afe1fb403a5e4fe2fbc0c41d0f8da8a88">XnModuleUnloadPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_xn_open_n_i_module_interface.html#a2634b684a0af5b5b0e49f333a76a2590">pUnloadFunc</a></td></tr>
<tr class="separator:a2634b684a0af5b5b0e49f333a76a2590"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adfc4114ac60d8cd3582d3aca8054394f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_xn_module_interface_8h.html#ae85aa58dd1115cc9d58b73e2f5811fce">XnModuleGetExportedNodesCountPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_xn_open_n_i_module_interface.html#adfc4114ac60d8cd3582d3aca8054394f">pGetCountFunc</a></td></tr>
<tr class="separator:adfc4114ac60d8cd3582d3aca8054394f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afbdad6eecfbb30ad7a0561659d90fc40"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_xn_module_interface_8h.html#a4ad068afc22a20fb878eea2aa4003e75">XnModuleGetExportedNodesEntryPointsPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_xn_open_n_i_module_interface.html#afbdad6eecfbb30ad7a0561659d90fc40">pGetEntryPointsFunc</a></td></tr>
<tr class="separator:afbdad6eecfbb30ad7a0561659d90fc40"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a16a4a8caefbce4c45f4675ad1e65a39b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_xn_module_interface_8h.html#a3b46a300c4ea78f1e20d29128679a01c">XnModuleGetOpenNIVersionPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_xn_open_n_i_module_interface.html#a16a4a8caefbce4c45f4675ad1e65a39b">pGetVersionFunc</a></td></tr>
<tr class="separator:a16a4a8caefbce4c45f4675ad1e65a39b"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="adfc4114ac60d8cd3582d3aca8054394f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_xn_module_interface_8h.html#ae85aa58dd1115cc9d58b73e2f5811fce">XnModuleGetExportedNodesCountPtr</a> XnOpenNIModuleInterface::pGetCountFunc</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="afbdad6eecfbb30ad7a0561659d90fc40"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_xn_module_interface_8h.html#a4ad068afc22a20fb878eea2aa4003e75">XnModuleGetExportedNodesEntryPointsPtr</a> XnOpenNIModuleInterface::pGetEntryPointsFunc</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a16a4a8caefbce4c45f4675ad1e65a39b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_xn_module_interface_8h.html#a3b46a300c4ea78f1e20d29128679a01c">XnModuleGetOpenNIVersionPtr</a> XnOpenNIModuleInterface::pGetVersionFunc</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a01e2ad32155c2f5e3832c7a3bbd2ce7c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_xn_module_interface_8h.html#a90aa056e4c7e00dbe3ec58621835a590">XnModuleLoadPtr</a> XnOpenNIModuleInterface::pLoadFunc</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a2634b684a0af5b5b0e49f333a76a2590"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_xn_module_interface_8h.html#afe1fb403a5e4fe2fbc0c41d0f8da8a88">XnModuleUnloadPtr</a> XnOpenNIModuleInterface::pUnloadFunc</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="_xn_module_interface_8h_source.html">XnModuleInterface.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jun 11 2015 12:31:40 for OpenNI 1.5.8 by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
| {
"content_hash": "95f096dc763f0f0405d4f373966577f7",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 412,
"avg_line_length": 53.13793103448276,
"alnum_prop": 0.6973393900064893,
"repo_name": "Wessi/OpenNI",
"id": "e5e581831c25b9e02bc66f506365928e21df15f6",
"size": "7705",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/DoxyGen/html/struct_xn_open_n_i_module_interface.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "29969"
},
{
"name": "C",
"bytes": "2271424"
},
{
"name": "C#",
"bytes": "379010"
},
{
"name": "C++",
"bytes": "5459288"
},
{
"name": "CSS",
"bytes": "34073"
},
{
"name": "HTML",
"bytes": "18993107"
},
{
"name": "Java",
"bytes": "463576"
},
{
"name": "JavaScript",
"bytes": "2983"
},
{
"name": "Makefile",
"bytes": "1364527"
},
{
"name": "Python",
"bytes": "102996"
},
{
"name": "Shell",
"bytes": "304536"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('pastebin', '0007_auto_20170129_1536'),
]
operations = [
migrations.CreateModel(
name='UserPasteStats',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('paste_count', models.IntegerField(verbose_name='paste count')),
('bio', models.TextField()),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
| {
"content_hash": "a5b5b727fcb5b5cc22c64b42fbf72d91",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 121,
"avg_line_length": 33.48,
"alnum_prop": 0.6236559139784946,
"repo_name": "johannessarpola/django-pastebin",
"id": "779e663f839f9efe51e7c4e47ff8e9cdd2a4251f",
"size": "910",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pastebin/migrations/0008_userpastestats.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "139"
},
{
"name": "HTML",
"bytes": "9950"
},
{
"name": "JavaScript",
"bytes": "3363"
},
{
"name": "Python",
"bytes": "56138"
}
],
"symlink_target": ""
} |
using Umbraco.Cms.Core.Events;
namespace Umbraco.Cms.Core.Notifications;
public sealed class UserGroupWithUsersSavingNotification : SavingNotification<UserGroupWithUsers>
{
public UserGroupWithUsersSavingNotification(UserGroupWithUsers target, EventMessages messages)
: base(
target,
messages)
{
}
public UserGroupWithUsersSavingNotification(IEnumerable<UserGroupWithUsers> target, EventMessages messages)
: base(
target, messages)
{
}
}
| {
"content_hash": "e95b507b24ed8c5f6a5b5a1cfc45228d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 111,
"avg_line_length": 26.57894736842105,
"alnum_prop": 0.7346534653465346,
"repo_name": "abryukhov/Umbraco-CMS",
"id": "c34d66841c1ae429432a7e96faae418d59c5571e",
"size": "565",
"binary": false,
"copies": "5",
"ref": "refs/heads/v10/contrib",
"path": "src/Umbraco.Core/Notifications/UserGroupWithUsersSavingNotification.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "16182634"
},
{
"name": "CSS",
"bytes": "20943"
},
{
"name": "Dockerfile",
"bytes": "1349"
},
{
"name": "HTML",
"bytes": "1376922"
},
{
"name": "JavaScript",
"bytes": "4774243"
},
{
"name": "Less",
"bytes": "744095"
},
{
"name": "Smalltalk",
"bytes": "1"
},
{
"name": "TypeScript",
"bytes": "186621"
}
],
"symlink_target": ""
} |
<div id="templatemo_content_wrapper">
<div id="templatemo_content">
<div id="column_w530">
<div class="header_02">Welcome {{username}}</div>
<div class="header_02">CUELOGIC Technologies have the following clients!</div>
<p class="em_text">Simple Gray is a professional XHTML/CSS layout provided by <a href="http://www.templatemo.com" target="_parent">templatemo.com</a> for free of charge. You can use this template for any purpose. Credit goes to <a href="http://www.photovaco.com" target="_blank">Free Photos</a> for photos.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam a justo dolor. Duis in tincidunt lorem. Nunc et tellus nisi. Nulla non velit lectus. Morbi luctus ullamcorper felis, non gravida neque congue sit amet.</p>
<div class="margin_bottom_20"></div>
<ul class="content_list_01">
<li>Integer tempor, libero quis laoreet dapibus, quam mauris hendrerit urna, vel feugiat dolor lectus non velit. Fusce at nisl libero, ac fringilla risus.</li>
<li>Proin non velit nec enim volutpat euismod. Phasellus lorem velit, porttitor non iaculis in, euismod a metus. Nullam orci odio, dignissim a egestas ac, sollicitudin in quam.</li>
</ul>
<div class="margin_bottom_20"></div>
<div class="content_section_01">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam a justo dolor. Duis in tincidunt lorem. Nunc et tellus nisi. Nulla non velit lectus. Morbi luctus ullamcorper felis, non gravida neque congue sit amet. Nam nec mi metus, ac elementum velit. Etiam vel arcu velit, eget consequat risus.
</div>
<div class="cleaner"></div>
</div>
<div id="column_w300">
<div class="header_03">Latest News</div>
<div class="column_w300_section_01">
<div class="news_image_wrapper">
<img src="img/templatemo_image_02.jpg" alt="image" />
</div>
<div class="news_content">
<div class="news_date">OCT 29, 2048</div>
<div class="header_04"><a href="#">Lorem ipsum dolor sit</a></div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam a justo dolor.</p>
</div>
<div class="cleaner"></div>
</div>
<div class="column_w300_section_01 even_color">
<div class="news_image_wrapper">
<img src="img/templatemo_image_03.jpg" alt="image" />
</div>
<div class="news_content">
<div class="news_date">OCT 28, 2048</div>
<div class="header_04"><a href="#">Nam dictum pellentesque</a></div>
<p>Nam ultricies cursus enim, non aliquet orci lacinia ac. Etiam lobortis adipiscing.</p>
</div>
<div class="cleaner"></div>
</div>
<div class="column_w300_section_01">
<div class="news_image_wrapper">
<img src="img/templatemo_image_04.jpg" alt="image" />
</div>
<div class="news_content">
<div class="news_date">OCT 27, 2048</div>
<div class="header_04"><a href="#">Donec faucibus tortor</a></div>
<p>Aliquam porttitor nibh in erat porttitor in accumsan dui pulvinar.</p>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div>
<div class="cleaner"></div>
</div> <!-- end of content wrapper --> | {
"content_hash": "e20d4f691499959306b9a0f9e74e6185",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 322,
"avg_line_length": 51.205128205128204,
"alnum_prop": 0.5317976965448172,
"repo_name": "subhodeep-cuelogic/cueapp",
"id": "c4d3b7a7b83c287564838e2ce7d82a96e1aed92d",
"size": "3994",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/partials/clients.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8277"
},
{
"name": "JavaScript",
"bytes": "10785"
},
{
"name": "PHP",
"bytes": "1331"
}
],
"symlink_target": ""
} |
package com.datatorrent.benchmark.util.serde;
import java.util.Random;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.apex.malhar.lib.utils.serde.GenericSerde;
import org.apache.apex.malhar.lib.utils.serde.Serde;
import org.apache.apex.malhar.lib.utils.serde.SerializationBuffer;
import org.apache.apex.malhar.lib.utils.serde.StringSerde;
import org.apache.apex.malhar.lib.window.Window;
import org.apache.commons.lang3.tuple.ImmutablePair;
import com.esotericsoftware.kryo.Kryo;
public class GenericSerdePerformanceTest
{
private static final transient Logger logger = LoggerFactory.getLogger(GenericSerdePerformanceTest.class);
private SerializationBuffer buffer = SerializationBuffer.READ_BUFFER;
private Random random = new Random();
private int serdeDataSize = 1000000;
@Test
public void testCompareSerdeForString()
{
long beginTime = System.currentTimeMillis();
testSerdeForString(new GenericSerde<String>(String.class));
long genericSerdeCost = System.currentTimeMillis() - beginTime;
logger.info("Generic Serde cost for String: {}", genericSerdeCost);
beginTime = System.currentTimeMillis();
testSerdeForString(new StringSerde());
long stringSerdeCost = System.currentTimeMillis() - beginTime;
logger.info("String Serde cost for String: {}", stringSerdeCost);
beginTime = System.currentTimeMillis();
Kryo kryo = new Kryo();
for (int i = 0; i < serdeDataSize; ++i) {
kryo.writeObject(buffer, "" + random.nextInt(1000));
buffer.toSlice();
}
buffer.release();
long kryoSerdeCost = System.currentTimeMillis() - beginTime;
logger.info("Kryo Serde cost for String: {}", kryoSerdeCost);
}
protected void testSerdeForString(Serde<String> serde)
{
for (int i = 0; i < serdeDataSize; ++i) {
serde.serialize("" + random.nextInt(1000), buffer);
buffer.toSlice();
}
buffer.release();
}
@Test
public void testCompareSerdeForRealCase()
{
long beginTime = System.currentTimeMillis();
GenericSerde<ImmutablePair> serde = new GenericSerde<ImmutablePair>();
for (int i = 0; i < serdeDataSize; ++i) {
serde.serialize(generatePair(beginTime), buffer);
buffer.toSlice();
}
buffer.release();
long genericSerdeCost = System.currentTimeMillis() - beginTime;
logger.info("Generic Serde cost for ImmutablePair: {}", genericSerdeCost);
beginTime = System.currentTimeMillis();
Kryo kryo = new Kryo();
for (int i = 0; i < serdeDataSize; ++i) {
kryo.writeObject(buffer, generatePair(beginTime));
buffer.toSlice();
}
buffer.release();
long kryoSerdeCost = System.currentTimeMillis() - beginTime;
logger.info("Kryo Serde cost for ImmutablePair without class info: {}", kryoSerdeCost);
beginTime = System.currentTimeMillis();
Kryo kryo1 = new Kryo();
for (int i = 0; i < serdeDataSize; ++i) {
kryo1.writeClassAndObject(buffer, generatePair(beginTime));
buffer.toSlice();
}
buffer.release();
long kryoSerdeCost2 = System.currentTimeMillis() - beginTime;
logger.info("Kryo Serde cost for ImmutablePair with class info: {}", kryoSerdeCost2);
}
protected ImmutablePair generatePair(long now)
{
return new ImmutablePair(new Window.TimeWindow(now + random.nextInt(100),
random.nextInt(100)), "" + random.nextInt(1000));
}
}
| {
"content_hash": "258e3a42fa849bb5ff1f3233319d333b",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 108,
"avg_line_length": 34.90816326530612,
"alnum_prop": 0.7109032446653025,
"repo_name": "yogidevendra/apex-malhar",
"id": "157accc09441678ed5e1008c99b635b18bfa7cf2",
"size": "4229",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "benchmark/src/test/java/com/datatorrent/benchmark/util/serde/GenericSerdePerformanceTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1824"
},
{
"name": "CSS",
"bytes": "101734"
},
{
"name": "Java",
"bytes": "7967928"
},
{
"name": "JavaScript",
"bytes": "28043"
},
{
"name": "Makefile",
"bytes": "80"
},
{
"name": "PHP",
"bytes": "22375"
},
{
"name": "R",
"bytes": "9316"
},
{
"name": "Roff",
"bytes": "2090157"
},
{
"name": "Shell",
"bytes": "392"
},
{
"name": "XSLT",
"bytes": "8012"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("history.api")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("history.api")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7aed42b3-306b-4519-8223-d7f3af9143c9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "ec3b9d1cea373916b58dcd530b70712b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 84,
"avg_line_length": 38.57142857142857,
"alnum_prop": 0.7496296296296296,
"repo_name": "merrillorg/history",
"id": "e9a16eafcce8b1c6bc6cde9ad7d5cda81495f2ee",
"size": "1353",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "history.api/history.api/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "105"
},
{
"name": "C#",
"bytes": "144176"
},
{
"name": "CSS",
"bytes": "2626"
},
{
"name": "JavaScript",
"bytes": "10318"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "4947d9da9d9deac81ef58468cfd7a9e1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "6e0dbedce8a13df4e6935a0bcc3a6b97df82d545",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Euphorbiaceae/Trigonostemon/Trigonostemon chinensis/ Syn. Trigonostemon huangmosu/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
source $GOPHER_INSTALLDIR/lib/gopherbot_v1.sh
MESSAGE="$1"
Say "$MESSAGE"
| {
"content_hash": "6efdba0f34c5646411e51fa1631badd4",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 45,
"avg_line_length": 18.75,
"alnum_prop": 0.7466666666666667,
"repo_name": "parsley42/gopherbot",
"id": "2f92daabc0719fd57d6bb62031e7adfe53a26833",
"size": "182",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tasks/status.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "5737"
},
{
"name": "Go",
"bytes": "529620"
},
{
"name": "Makefile",
"bytes": "5439"
},
{
"name": "Python",
"bytes": "35220"
},
{
"name": "Ruby",
"bytes": "15966"
},
{
"name": "Shell",
"bytes": "67093"
}
],
"symlink_target": ""
} |
require 'edgecase'
class AboutOpenClasses < EdgeCase::Koan
class Dog
def bark
"WOOF"
end
end
def test_as_defined_dogs_do_bark
fido = Dog.new
assert_equal __, fido.bark
end
# ------------------------------------------------------------------
# Open the existing Dog class and add a new method.
class Dog
def wag
"HAPPY"
end
end
def test_after_reopening_dogs_can_both_wag_and_bark
fido = Dog.new
assert_equal __, fido.wag
assert_equal __, fido.bark
end
# ------------------------------------------------------------------
class ::Integer
def even?
(self % 2) == 0
end
end
def test_even_existing_built_in_classes_can_be_reopened
assert_equal __, 1.even?
assert_equal __, 2.even?
end
# NOTE: To understand why we need the :: before Integer, you need to
# become enlightened about scope.
end
| {
"content_hash": "7db56f60d8d7e5ed3d27b570f68373e8",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 70,
"avg_line_length": 20.044444444444444,
"alnum_prop": 0.5310421286031042,
"repo_name": "rizwanreza/ruby_koans",
"id": "233cef50774f779b5ea9539881218f3777ce2706",
"size": "902",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "koans/about_open_classes.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "126121"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topics', '0083_auto_20171019_0024'),
]
operations = [
migrations.CreateModel(
name='ClassroomResource',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('slug', models.SlugField(max_length=80, unique=True)),
('description', models.CharField(max_length=100)),
],
),
migrations.RemoveField(
model_name='lesson',
name='classroom_resources',
),
migrations.AddField(
model_name='lesson',
name='classroom_resources',
field=models.ManyToManyField(to='topics.ClassroomResource'),
),
]
| {
"content_hash": "62d413ece6dde16c0996f05c9455b032",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 114,
"avg_line_length": 29.9,
"alnum_prop": 0.5674470457079153,
"repo_name": "uccser/cs-unplugged",
"id": "543b9a2ace933ccb4c0e633f3bb4ebddfbb81102",
"size": "970",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "csunplugged/topics/migrations/0084_auto_20171019_2324.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "7927"
},
{
"name": "HTML",
"bytes": "432891"
},
{
"name": "JavaScript",
"bytes": "104806"
},
{
"name": "Python",
"bytes": "1257568"
},
{
"name": "SCSS",
"bytes": "67560"
},
{
"name": "Shell",
"bytes": "12461"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "515547c32ba8a441527ca169cd3f5d0e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "6c10986ec0d4e368145670801962d5fee8266208",
"size": "179",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Asclepiadaceae/Amphistelma/Amphistelma riedelii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
require File.expand_path('../../../spec_helper', __FILE__)
require 'rbconfig'
# These specs are difficult because the values may vary
# depending on platform or other configuration options.
# However, the specs are valuable in that they will ensure
# that rbconfig loads and contains required values.
#
# The RbConfig entries fall into two general categories:
# 1) the static-value entries; and 2) the configured-
# value entries. For the second one, the specs check
# only for the existence of a key.
def it_has_keys(name, keys)
describe "#{name}" do
before :all do
@const = const_lookup name
end
keys.each do |key|
it "has key #{key}" do
@const.key?(key).should_not be_nil
end
end
end
end
def it_has_entries(name, entries)
describe "#{name}" do
before :all do
@const = const_lookup name
end
entries.each do |key, expected|
it "has entry #{key} == #{expected}" do
@const[key].should == expected
end
end
end
end
describe "Config" do
it "is equal to RbConfig" do
Config.should eql(RbConfig)
end
end
# TODO: many more specs needed
describe "RbConfig::CONFIG" do
keys = [
"LDSHARED",
"DLEXT",
"EXEEXT",
"wordsize",
"prefix",
"bindir",
"datadir",
"rubyhdrdir",
"wordsize",
"arch",
"bindir"
]
it_has_keys 'RbConfig::CONFIG', keys
entries = {
"RUBY_SO_NAME" => "rubinius-#{Rubinius::VERSION}",
"ruby_install_name" => Rubinius::PROGRAM_NAME,
"rubyhdrdir" => Rubinius::HDR_PATH
}
it_has_entries 'RbConfig::CONFIG', entries
end
describe "RbConfig::MAKEFILE_CONFIG" do
sitedir = Rubinius::SITE_PATH
sitelibdir = Rubinius::SITE_PATH
arch = "#{Rubinius::CPU}-#{Rubinius::OS}"
entries = {
"exec_prefix" => "$(prefix)",
"sbindir" => "$(exec_prefix)/sbin",
"libexecdir" => "$(exec_prefix)/libexec",
"datarootdir" => "$(prefix)/share",
"datadir" => "$(datarootdir)",
"sysconfdir" => "$(prefix)/etc",
"sharedstatedir" => "$(prefix)/com",
"localstatedir" => "$(prefix)/var",
"includedir" => "$(prefix)/include",
"oldincludedir" => "/usr/include",
"docdir" => "$(datarootdir)/doc/$(PACKAGE)",
"infodir" => "$(datarootdir)/info",
"htmldir" => "$(docdir)",
"dvidir" => "$(docdir)",
"pdfdir" => "$(docdir)",
"psdir" => "$(docdir)",
"libdir" => "$(exec_prefix)/lib",
"localedir" => "$(datarootdir)/locale",
"mandir" => "$(datarootdir)/man",
"ruby_version" => "$(MAJOR).$(MINOR)",
"rubylibdir" => sitelibdir,
"archdir" => "#{sitelibdir}/#{arch}",
"sitearchdir" => "#{sitelibdir}/#{arch}",
"sitedir" => "#{sitedir}",
}
it_has_entries 'RbConfig::MAKEFILE_CONFIG', entries
end
describe "RbConfig#ruby" do
it "returns the path to the running Ruby executable" do
rb_path = RbConfig.ruby
rb_path.should be_kind_of(String)
# needs to be an executable
File.executable?(rb_path).should eql(true)
# make sure the executable it points to has the same RbConfig we have
cmd = "#{rb_path} -rrbconfig -e 'puts Marshal.dump(RbConfig::CONFIG)'"
rb_config = Marshal.load(`#{cmd}`)
rb_config.should == RbConfig::CONFIG
end
end
| {
"content_hash": "f93b260276b95376d8641e1e88fb9277",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 74,
"avg_line_length": 27.862903225806452,
"alnum_prop": 0.5716353111432706,
"repo_name": "benlovell/rubinius",
"id": "1da0ece09960cfc38146fbe3cc38925de631f735",
"size": "3455",
"binary": false,
"copies": "17",
"ref": "refs/heads/master",
"path": "spec/library/config/rbconfig_spec.rb",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "120"
},
{
"name": "C",
"bytes": "521805"
},
{
"name": "C++",
"bytes": "3271512"
},
{
"name": "DTrace",
"bytes": "4932"
},
{
"name": "Groff",
"bytes": "41909"
},
{
"name": "HTML",
"bytes": "81103"
},
{
"name": "LLVM",
"bytes": "24552"
},
{
"name": "Makefile",
"bytes": "8464"
},
{
"name": "Objective-C",
"bytes": "31"
},
{
"name": "Perl",
"bytes": "264756"
},
{
"name": "Python",
"bytes": "21164"
},
{
"name": "Ruby",
"bytes": "7196240"
},
{
"name": "Shell",
"bytes": "6824"
}
],
"symlink_target": ""
} |
#Hyperledger Client SDK for Node.js
The Hyperledger Client SDK (HLC) provides a powerful and easy to use API to interact with a Hyperledger blockchain.
The sections in this document are as follows:
* The [Getting Started](#getting-started) section is intended to help you quickly get a feel for HLC, how to use it, and some of it's common capabilities. This is demonstrated by example.
* The [Getting Set Up](#getting-set-up) section shows you how to setup up your environment and to run the unit tests. Looking at the unit tests will also help you learn more of the APIs by example, including asset management and confidentiality.
* The [Going Deeper](#going-deeper) section discusses HLC's pluggability or extensibility design. It also describes the main object hierarchy to help you get started in navigating the reference documentation. The top-level class is `Chain`.
WARNING: To view the reference documentation correctly, you first need to [build the SDK](#building-the-client-sdk) and then open the following URLs directly in your browser. Be sure to replace YOUR-FABRIC-DIR with the path to your fabric directory.
`file:///YOUR-FABRIC-DIR/sdk/node/doc/modules/_hlc_.html`
`file:///YOUR-FABRIC-DIR/sdk/node/doc/classes/_hlc_.chain.html`
* The [Future Work](#future-work) section describes some upcoming work to be done.
## Getting Started
This purpose of this section is to help you quickly get a feel for HLC and how you may use it. It is not intended to demonstrate all of it's power, but to demonstrate common use cases by example.
### Some basic terminology
First, there is some basic terminology you should understand. In order to transact on a hyperledger blockchain, you must first have an identity which has been both **registered** and **enrolled**.
Think of **registration** as *issuing a user invitation* to join a blockchain. It consists of adding a new user name (also called an *enrollment ID*) to the membership service configuration. This can be done programatically with the `Member.register` method, or by adding the enrollment ID directly to the [membersrvc.yaml](https://github.com/hyperledger/fabric/blob/master/membersrvc/membersrvc.yaml) configuration file.
Think of **enrollment** as *accepting a user invitation* to join a blockchain. This is always done by the entity that will transact on the blockchain. This can be done programatically via the `Member.enroll` method.
### Learn by example
The best way to quickly learn HLC is by example.
The following example demonstrates a typical web app. The web app authenticates a user and then transacts on a blockchain on behalf of that user.
```
/**
* This example shows how to do the following in a web app.
* 1) At initialization time, enroll the web app with the block chain.
* The identity must have already been registered.
* 2) At run time, after a user has authenticated with the web app:
* a) register and enroll an identity for the user;
* b) use this identity to deploy, query, and invoke a chaincode.
*/
// To include the package from your hyperledger fabric directory:
// var hlc = require("myFabricDir/sdk/node");
// To include the package from npm:
// var hlc = require('hlc');
var hlc = require('hlc');
// Create a client chain.
// The name can be anything as it is only used internally.
var chain = hlc.newChain("targetChain");
// Configure the KeyValStore which is used to store sensitive keys
// as so it is important to secure this storage.
// The FileKeyValStore is a simple file-based KeyValStore, but you
// can easily implement your own to store whereever you want.
chain.setKeyValStore( hlc.newFileKeyValStore('/tmp/keyValStore') );
// Set the URL for member services
chain.setMemberServicesUrl("grpc://localhost:50051");
// Add a peer's URL
chain.addPeer("grpc://localhost:30303");
// Enroll "WebAppAdmin" which is already registered because it is
// listed in fabric/membersrvc/membersrvc.yaml with it's one time password.
// If "WebAppAdmin" has already been registered, this will still succeed
// because it stores the state in the KeyValStore
// (i.e. in '/tmp/keyValStore' in this sample).
chain.enroll("WebAppAdmin", "DJY27pEnl16d", function(err, webAppAdmin) {
if (err) return console.log("ERROR: failed to register %s: %s",err);
// Successfully enrolled WebAppAdmin during initialization.
// Set this user as the chain's registrar which is authorized to register other users.
chain.setRegistrar(webAppAdmin);
// Now begin listening for web app requests
listenForUserRequests();
});
// Main web app function to listen for and handle requests
function listenForUserRequests() {
for (;;) {
// WebApp-specific logic goes here to await the next request.
// ...
// Assume that we received a request from an authenticated user
// 'userName', and determined that we need to invoke the chaincode
// with 'chaincodeID' and function named 'fcn' with arguments 'args'.
handleUserRequest(userName,chaincodeID,fcn,args);
}
}
// Handle a user request
function handleUserRequest(userName, chaincodeID, fcn, args) {
// Register and enroll this user.
// If this user has already been registered and/or enrolled, this will
// still succeed because the state is kept in the KeyValStore
// (i.e. in '/tmp/keyValStore' in this sample).
var registrationRequest = {
enrollmentID: userName,
// Customize account & affiliation
account: "bank_a",
affiliation: "00001"
};
chain.registerAndEnroll( registrationRequest, function(err, user) {
if (err) return console.log("ERROR: %s",err);
// Issue an invoke request
var invokeRequest = {
// Name (hash) required for invoke
chaincodeID: chaincodeID,
// Function to trigger
fcn: fcn,
// Parameters for the invoke function
args: args
};
// Invoke the request from the user object.
var tx = user.invoke(invokeRequest);
// Listen for the 'submitted' event
tx.on('submitted', function(results) {
console.log("submitted invoke: %j",results);
});
// Listen for the 'complete' event.
tx.on('complete', function(results) {
console.log("completed invoke: %j",results;
});
// Listen for the 'error' event.
tx.on('error', function(err) {
console.log("error on invoke: %j",err);
});
});
}
```
### Installing hlc from npm
To install `hlc` from npm simply execute the following command.
npm install -g hlc
### Chaincode Deployment Directory structure
To have the chaincode deployment succeed in network mode, you must properly set up the chaincode project outside of your Hyperledger Fabric source tree. These instructions will demonstrate how to properly set up the directory structure to deploy *chaincode_example02* in network mode.
The chaincode project must be placed inside the `src` directory in your local `$GOPATH`. For example, the `chaincode_example02` project may be placed inside `$GOPATH/src/` as shown below.
```
$GOPATH/src/github.com/chaincode_example02/
```
The chaincode project directory must contain project related code and also a `vendor` folder which contains the entire Hyperledger Fabric source tree. Currently, this is still a dependency to have the chaincode project deploy successfully. However, the entire fabric directory is not packaged into the deploy transaction when the payload is generated. The deployment process selects a specific set of files when creating the transaction payload. Correct project directory structure is shown below.
```
ls -la $GOPATH/src/github.com/chaincode_example02/
.
..
chaincode_example02.go
vendor
ls -la $GOPATH/src/github.com/chaincode_example02/vendor/github.com/hyperledger/
.
..
fabric
```
Once you have placed your chaincode project inside the `src` directory in your local `$GOPATH` together with the `vendor` directory containing the Hyperledger Fabric, you need to verify that the chaincode builds in this directory. To do so execute `go build`. This step verifies that all of the chaincode dependencies are present.
```
cd $GOPATH/src/github.com/chaincode_example02/
go build
```
Once the chaincode is built, you need to verify that [chain-tests.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/chain-tests.js) unit test file points to the appropriate chaincode project path. The default directory is set to `github.com/chaincode_example02/` as shown below.
```
// Path to the local directory containing the chaincode project under $GOPATH
var testChaincodePath = "github.com/chaincode_example02/";
```
Set the `DEPLOY_MODE` environment variable to `net` and run the chain-tests as follows:
```
cd $GOPATH/src/github.com/hyperledger/fabric/sdk/node
export DEPLOY_MODE='net'
node test/unit/chain-tests.js | node_modules/.bin/tap-spec
```
### Enabling TLS
If you wish to activate TLS connection with the member services the following actions are needed:
- Modify `$GOPATH/src/github.com/hyperledger/fabric/membersrvc/membersrvc.yaml` as follows:
```
server:
tls:
certfile: "/var/hyperledger/production/.membersrvc/tlsca.cert"
keyfile: "/var/hyperledger/production/.membersrvc/tlsca.priv"
```
This is needed to instruct the member services on which tls cert and key to use.
- Modify `$GOPATH/src/github.com/hyperledger/fabric/peer/core.yaml` as follows:
```
peer:
pki:
tls:
enabled: true
rootcert:
file: "/var/hyperledger/production/.membersrvc/tlsca.cert"
```
This is needed to allow the peer to connect to the member services using TLS, otherwise the connection will fail.
- Bootstrap your member services and the peer. This is needed in order to have the file *tlsca.cert* generated by the member services.
- Copy `/var/hyperledger/production/.membersrvc/tlsca.cert` to `$GOPATH/src/github.com/hyperledger/fabric/sdk/node`.
*Note:* If you cleanup the folder `/var/hyperledger/production` then don't forget to copy again the *tlsca.cert* file as described above.
## Running the SDK unit tests
HLC includes a set of unit tests implemented with the [tape framework](https://github.com/substack/tape). The unit [test script](https://github.com/hyperledger/fabric/blob/master/sdk/node/bin/run-unit-tests.sh) builds and runs both the membership service server and the peer node for you, therefore you do not have to start those manually.
To run the unit tests, execute the following commands.
cd $GOPATH/src/github.com/hyperledger/fabric
make node-sdk-unit-tests
The following are brief descriptions of each of the unit tests that are being run.
#### registrar
The [registrar.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/registrar.js) test case exercises registering users with member services. It also tests registering a designated registrar user which can then register additional users.
#### chain-tests
The [chain-tests.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/chain-tests.js) test case exercises the [chaincode_example02.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/chaincode_example02) chaincode when it has been deployed in both development mode and network mode.
#### asset-mgmt
The [asset-mgmt.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/asset-mgmt.js) test case exercises the [asset_management.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/asset_management) chaincode when it has been deployed in both development mode and network mode.
#### asset-mgmt-with-roles
The [asset-mgmt-with-roles.js](https://github.com/hyperledger/fabric/blob/master/sdk/node/test/unit/asset-mgmt-with-roles.js) test case exercises the [asset_management_with_roles.go](https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/asset_management_with_roles) chaincode when it has been deployed in both development mode and network mode.
#### Troublingshooting
If you see errors stating that the client has already been registered/enrolled, keep in mind that you can perform the enrollment process only once, as the enrollmentSecret is a one-time-use password. You will see these errors if you have performed a user registration/enrollment and subsequently deleted the crypto tokens stored on the client side. The next time you try to enroll, errors similar to the ones below will be seen.
```
Error: identity or token do not match
```
```
Error: user is already registered
```
To address this, remove any stored crypto material from the CA server by following the instructions [here](https://github.com/hyperledger/fabric/blob/master/docs/API/SandboxSetup.md#removing-temporary-files-when-security-is-enabled). You will also need to remove any of the crypto tokens stored on the client side by deleting the KeyValStore directory. That directory is configurable and is set to `/tmp/keyValStore` within the unit tests.
## Going Deeper
#### Pluggability
HLC was designed to support two pluggable components:
1. Pluggable key value store which is used to retrieve and store keys associated with a member. The key value store is used to store sensitive private keys, so care must be taken to properly protect access.
2. Pluggable member service which is used to register and enroll members. Member services enables hyperledger to be a permissioned blockchain, providing security services such as anonymity, unlinkability of transactions, and confidentiality
#### HLC objects and reference documentation
HLC is written primarily in typescript and is object-oriented. The source can be found in the `fabric/sdk/node/src` directory.
To go deeper, you can view the reference documentation in your browser by opening the [reference documentation](doc/modules/_hlc_.html) and clicking on **"hlc"** on the right-hand side under **"Globals"**. This will work after you have built the SDK per the instruction [here](#building-the-client-sdk).
The following is a high-level description of the HLC objects (classes and interfaces) to help guide you through the object hierarchy.
* The main top-level class is [Chain](doc/classes/_hlc_.chain.html). It is the client's representation of a chain. HLC allows you to interact with multiple chains and to share a single [KeyValStore](doc/interfaces/_hlc_.keyvalstore.html) and [MemberServices](doc/interfaces/_hlc_.memberservices.html) object with multiple Chain objects as needed. For each chain, you add one or more [Peer](doc/classes/_hlc_.peer.html) objects which represents the endpoint(s) to which HLC connects to transact on the chain.
* The [KeyValStore](doc/interfaces/_hlc_.keyvalstore.html) is a very simple interface which HLC uses to store and retrieve all persistent data. This data includes private keys, so it is very important to keep this storage secure. The default implementation is a simple file-based version found in the [FileKeyValStore](doc/classes/_hlc_.filekeyvalstore.html) class.
* The [MemberServices](doc/interfaces/_hlc_.memberservices.html) interface is implemented by the [MemberServicesImpl](doc/classes/_hlc_.memberservicesimpl.html) class and provides security and identity related features such as privacy, unlinkability, and confidentiality. This implementation issues *ECerts* (enrollment certificates) and *TCerts* (transaction certificates). ECerts are for enrollment identity and TCerts are for transactions.
* The [Member](doc/classes/_hlc_.member.html) class most often represents an end user who transacts on the chain, but it may also represent other types of members such as peers. From the Member class, you can *register* and *enroll* members or users. This interacts with the [MemberServices](doc/interfaces/_hlc_.memberservices.html) object. You can also deploy, query, and invoke chaincode directly, which interacts with the [Peer](doc/classes/_hlc_.peer.html). The implementation for deploy, query and invoke simply creates a temporary [TransactionContext](doc/classes/_hlc_.transactioncontext.html) object and delegates the work to it.
* The [TransactionContext](doc/classes/_hlc_.transactioncontext.html) class implements the bulk of the deploy, invoke, and query logic. It interacts with MemberServices to get a TCert to perform these operations. Note that there is a one-to-one relationship between TCert and TransactionContext; in other words, a single TransactionContext will always use the same TCert. If you want to issue multiple transactions with the same TCert, then you can get a [TransactionContext](doc/classes/_hlc_.transactioncontext.html) object from a [Member](doc/classes/_hlc_.member.html) object directly and issue multiple deploy, invoke, or query operations on it. Note however that if you do this, these transactions are linkable, which means someone could tell that they came from the same user, though not know which user. For this reason, you will typically just call deploy, invoke, and query on the User or Member object.
## Future Work
The following is a list of known remaining work to be done.
* The reference documentation needs to be made simpler to follow as there are currently some internal classes and interfaces that are being exposed.
* We are investigating how to make deployment of a chaincode simpler by not requiring you to set up a specific directory structure with dependencies.
* Implement events appropriately, both custom and non-custom. The 'complete' event for `deploy` and `invoke` is currently implemented by simply waiting a set number of seconds (5 for invoke, 20 for deploy). It needs to receive a complete event from the server with the result of the transaction and make this available to the caller. This has not yet been implemented.
* Support SHA2. HLC currently supports SHA3.
| {
"content_hash": "ec1422a27c1811055d139368cced249b",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 918,
"avg_line_length": 61.49828178694158,
"alnum_prop": 0.7605610192221726,
"repo_name": "tuand27613/obc-peer",
"id": "dfa7ee9e06be07256896f4f9cd0e5164351f2245",
"size": "17896",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "sdk/node/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Cucumber",
"bytes": "31615"
},
{
"name": "Go",
"bytes": "1450010"
},
{
"name": "Protocol Buffer",
"bytes": "32979"
},
{
"name": "Python",
"bytes": "28221"
},
{
"name": "Shell",
"bytes": "5867"
}
],
"symlink_target": ""
} |
"""Timeseries plotting functions."""
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats, interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
import warnings
from .external.six import string_types
from . import utils
from . import algorithms as algo
from .palettes import color_palette
__all__ = ["tsplot"]
def tsplot(data, time=None, unit=None, condition=None, value=None,
err_style="ci_band", ci=68, interpolate=True, color=None,
estimator=np.mean, n_boot=5000, err_palette=None, err_kws=None,
legend=True, ax=None, **kwargs):
"""Plot one or more timeseries with flexible representation of uncertainty.
This function is intended to be used with data where observations are
nested within sampling units that were measured at multiple timepoints.
It can take data specified either as a long-form (tidy) DataFrame or as an
ndarray with dimensions (unit, time) The interpretation of some of the
other parameters changes depending on the type of object passed as data.
Parameters
----------
data : DataFrame or ndarray
Data for the plot. Should either be a "long form" dataframe or an
array with dimensions (unit, time, condition). In both cases, the
condition field/dimension is optional. The type of this argument
determines the interpretation of the next few parameters. When
using a DataFrame, the index has to be sequential.
time : string or series-like
Either the name of the field corresponding to time in the data
DataFrame or x values for a plot when data is an array. If a Series,
the name will be used to label the x axis.
unit : string
Field in the data DataFrame identifying the sampling unit (e.g.
subject, neuron, etc.). The error representation will collapse over
units at each time/condition observation. This has no role when data
is an array.
value : string
Either the name of the field corresponding to the data values in
the data DataFrame (i.e. the y coordinate) or a string that forms
the y axis label when data is an array.
condition : string or Series-like
Either the name of the field identifying the condition an observation
falls under in the data DataFrame, or a sequence of names with a length
equal to the size of the third dimension of data. There will be a
separate trace plotted for each condition. If condition is a Series
with a name attribute, the name will form the title for the plot
legend (unless legend is set to False).
err_style : string or list of strings or None
Names of ways to plot uncertainty across units from set of
{ci_band, ci_bars, boot_traces, boot_kde, unit_traces, unit_points}.
Can use one or more than one method.
ci : float or list of floats in [0, 100] or "sd" or None
Confidence interval size(s). If a list, it will stack the error plots
for each confidence interval. If ``"sd"``, show standard deviation of
the observations instead of boostrapped confidence intervals. Only
relevant for error styles with "ci" in the name.
interpolate : boolean
Whether to do a linear interpolation between each timepoint when
plotting. The value of this parameter also determines the marker
used for the main plot traces, unless marker is specified as a keyword
argument.
color : seaborn palette or matplotlib color name or dictionary
Palette or color for the main plots and error representation (unless
plotting by unit, which can be separately controlled with err_palette).
If a dictionary, should map condition name to color spec.
estimator : callable
Function to determine central tendency and to pass to bootstrap
must take an ``axis`` argument.
n_boot : int
Number of bootstrap iterations.
err_palette : seaborn palette
Palette name or list of colors used when plotting data for each unit.
err_kws : dict, optional
Keyword argument dictionary passed through to matplotlib function
generating the error plot,
legend : bool, optional
If ``True`` and there is a ``condition`` variable, add a legend to
the plot.
ax : axis object, optional
Plot in given axis; if None creates a new figure
kwargs :
Other keyword arguments are passed to main plot() call
Returns
-------
ax : matplotlib axis
axis with plot data
Examples
--------
Plot a trace with translucent confidence bands:
.. plot::
:context: close-figs
>>> import numpy as np; np.random.seed(22)
>>> import seaborn as sns; sns.set(color_codes=True)
>>> x = np.linspace(0, 15, 31)
>>> data = np.sin(x) + np.random.rand(10, 31) + np.random.randn(10, 1)
>>> ax = sns.tsplot(data=data)
Plot a long-form dataframe with several conditions:
.. plot::
:context: close-figs
>>> gammas = sns.load_dataset("gammas")
>>> ax = sns.tsplot(time="timepoint", value="BOLD signal",
... unit="subject", condition="ROI",
... data=gammas)
Use error bars at the positions of the observations:
.. plot::
:context: close-figs
>>> ax = sns.tsplot(data=data, err_style="ci_bars", color="g")
Don't interpolate between the observations:
.. plot::
:context: close-figs
>>> import matplotlib.pyplot as plt
>>> ax = sns.tsplot(data=data, err_style="ci_bars", interpolate=False)
Show multiple confidence bands:
.. plot::
:context: close-figs
>>> ax = sns.tsplot(data=data, ci=[68, 95], color="m")
Show the standard deviation of the observations:
.. plot::
:context: close-figs
>>> ax = sns.tsplot(data=data, ci="sd")
Use a different estimator:
.. plot::
:context: close-figs
>>> ax = sns.tsplot(data=data, estimator=np.median)
Show each bootstrap resample:
.. plot::
:context: close-figs
>>> ax = sns.tsplot(data=data, err_style="boot_traces", n_boot=500)
Show the trace from each sampling unit:
.. plot::
:context: close-figs
>>> ax = sns.tsplot(data=data, err_style="unit_traces")
"""
msg = (
"The `tsplot` function is deprecated and will be removed in a future "
"release. Please update your code to use the new `lineplot` function."
)
warnings.warn(msg, UserWarning)
# Sort out default values for the parameters
if ax is None:
ax = plt.gca()
if err_kws is None:
err_kws = {}
# Handle different types of input data
if isinstance(data, pd.DataFrame):
xlabel = time
ylabel = value
# Condition is optional
if condition is None:
condition = pd.Series(1, index=data.index)
legend = False
legend_name = None
n_cond = 1
else:
legend = True and legend
legend_name = condition
n_cond = len(data[condition].unique())
else:
data = np.asarray(data)
# Data can be a timecourse from a single unit or
# several observations in one condition
if data.ndim == 1:
data = data[np.newaxis, :, np.newaxis]
elif data.ndim == 2:
data = data[:, :, np.newaxis]
n_unit, n_time, n_cond = data.shape
# Units are experimental observations. Maybe subjects, or neurons
if unit is None:
units = np.arange(n_unit)
unit = "unit"
units = np.repeat(units, n_time * n_cond)
ylabel = None
# Time forms the xaxis of the plot
if time is None:
times = np.arange(n_time)
else:
times = np.asarray(time)
xlabel = None
if hasattr(time, "name"):
xlabel = time.name
time = "time"
times = np.tile(np.repeat(times, n_cond), n_unit)
# Conditions split the timeseries plots
if condition is None:
conds = range(n_cond)
legend = False
if isinstance(color, dict):
err = "Must have condition names if using color dict."
raise ValueError(err)
else:
conds = np.asarray(condition)
legend = True and legend
if hasattr(condition, "name"):
legend_name = condition.name
else:
legend_name = None
condition = "cond"
conds = np.tile(conds, n_unit * n_time)
# Value forms the y value in the plot
if value is None:
ylabel = None
else:
ylabel = value
value = "value"
# Convert to long-form DataFrame
data = pd.DataFrame(dict(value=data.ravel(),
time=times,
unit=units,
cond=conds))
# Set up the err_style and ci arguments for the loop below
if isinstance(err_style, string_types):
err_style = [err_style]
elif err_style is None:
err_style = []
if not hasattr(ci, "__iter__"):
ci = [ci]
# Set up the color palette
if color is None:
current_palette = utils.get_color_cycle()
if len(current_palette) < n_cond:
colors = color_palette("husl", n_cond)
else:
colors = color_palette(n_colors=n_cond)
elif isinstance(color, dict):
colors = [color[c] for c in data[condition].unique()]
else:
try:
colors = color_palette(color, n_cond)
except ValueError:
color = mpl.colors.colorConverter.to_rgb(color)
colors = [color] * n_cond
# Do a groupby with condition and plot each trace
c = None
for c, (cond, df_c) in enumerate(data.groupby(condition, sort=False)):
df_c = df_c.pivot(unit, time, value)
x = df_c.columns.values.astype(np.float)
# Bootstrap the data for confidence intervals
if "sd" in ci:
est = estimator(df_c.values, axis=0)
sd = np.std(df_c.values, axis=0)
cis = [(est - sd, est + sd)]
boot_data = df_c.values
else:
boot_data = algo.bootstrap(df_c.values, n_boot=n_boot,
axis=0, func=estimator)
cis = [utils.ci(boot_data, v, axis=0) for v in ci]
central_data = estimator(df_c.values, axis=0)
# Get the color for this condition
color = colors[c]
# Use subroutines to plot the uncertainty
for style in err_style:
# Allow for null style (only plot central tendency)
if style is None:
continue
# Grab the function from the global environment
try:
plot_func = globals()["_plot_%s" % style]
except KeyError:
raise ValueError("%s is not a valid err_style" % style)
# Possibly set up to plot each observation in a different color
if err_palette is not None and "unit" in style:
orig_color = color
color = color_palette(err_palette, len(df_c.values))
# Pass all parameters to the error plotter as keyword args
plot_kwargs = dict(ax=ax, x=x, data=df_c.values,
boot_data=boot_data,
central_data=central_data,
color=color, err_kws=err_kws)
# Plot the error representation, possibly for multiple cis
for ci_i in cis:
plot_kwargs["ci"] = ci_i
plot_func(**plot_kwargs)
if err_palette is not None and "unit" in style:
color = orig_color
# Plot the central trace
kwargs.setdefault("marker", "" if interpolate else "o")
ls = kwargs.pop("ls", "-" if interpolate else "")
kwargs.setdefault("linestyle", ls)
label = cond if legend else "_nolegend_"
ax.plot(x, central_data, color=color, label=label, **kwargs)
if c is None:
raise RuntimeError("Invalid input data for tsplot.")
# Pad the sides of the plot only when not interpolating
ax.set_xlim(x.min(), x.max())
x_diff = x[1] - x[0]
if not interpolate:
ax.set_xlim(x.min() - x_diff, x.max() + x_diff)
# Add the plot labels
if xlabel is not None:
ax.set_xlabel(xlabel)
if ylabel is not None:
ax.set_ylabel(ylabel)
if legend:
ax.legend(loc=0, title=legend_name)
return ax
# Subroutines for tsplot errorbar plotting
# ----------------------------------------
def _plot_ci_band(ax, x, ci, color, err_kws, **kwargs):
"""Plot translucent error bands around the central tendancy."""
low, high = ci
if "alpha" not in err_kws:
err_kws["alpha"] = 0.2
ax.fill_between(x, low, high, facecolor=color, **err_kws)
def _plot_ci_bars(ax, x, central_data, ci, color, err_kws, **kwargs):
"""Plot error bars at each data point."""
for x_i, y_i, (low, high) in zip(x, central_data, ci.T):
ax.plot([x_i, x_i], [low, high], color=color,
solid_capstyle="round", **err_kws)
def _plot_boot_traces(ax, x, boot_data, color, err_kws, **kwargs):
"""Plot 250 traces from bootstrap."""
err_kws.setdefault("alpha", 0.25)
err_kws.setdefault("linewidth", 0.25)
if "lw" in err_kws:
err_kws["linewidth"] = err_kws.pop("lw")
ax.plot(x, boot_data.T, color=color, label="_nolegend_", **err_kws)
def _plot_unit_traces(ax, x, data, ci, color, err_kws, **kwargs):
"""Plot a trace for each observation in the original data."""
if isinstance(color, list):
if "alpha" not in err_kws:
err_kws["alpha"] = .5
for i, obs in enumerate(data):
ax.plot(x, obs, color=color[i], label="_nolegend_", **err_kws)
else:
if "alpha" not in err_kws:
err_kws["alpha"] = .2
ax.plot(x, data.T, color=color, label="_nolegend_", **err_kws)
def _plot_unit_points(ax, x, data, color, err_kws, **kwargs):
"""Plot each original data point discretely."""
if isinstance(color, list):
for i, obs in enumerate(data):
ax.plot(x, obs, "o", color=color[i], alpha=0.8, markersize=4,
label="_nolegend_", **err_kws)
else:
ax.plot(x, data.T, "o", color=color, alpha=0.5, markersize=4,
label="_nolegend_", **err_kws)
def _plot_boot_kde(ax, x, boot_data, color, **kwargs):
"""Plot the kernal density estimate of the bootstrap distribution."""
kwargs.pop("data")
_ts_kde(ax, x, boot_data, color, **kwargs)
def _plot_unit_kde(ax, x, data, color, **kwargs):
"""Plot the kernal density estimate over the sample."""
_ts_kde(ax, x, data, color, **kwargs)
def _ts_kde(ax, x, data, color, **kwargs):
"""Upsample over time and plot a KDE of the bootstrap distribution."""
kde_data = []
y_min, y_max = data.min(), data.max()
y_vals = np.linspace(y_min, y_max, 100)
upsampler = interpolate.interp1d(x, data)
data_upsample = upsampler(np.linspace(x.min(), x.max(), 100))
for pt_data in data_upsample.T:
pt_kde = stats.kde.gaussian_kde(pt_data)
kde_data.append(pt_kde(y_vals))
kde_data = np.transpose(kde_data)
rgb = mpl.colors.ColorConverter().to_rgb(color)
img = np.zeros((kde_data.shape[0], kde_data.shape[1], 4))
img[:, :, :3] = rgb
kde_data /= kde_data.max(axis=0)
kde_data[kde_data > 1] = 1
img[:, :, 3] = kde_data
ax.imshow(img, interpolation="spline16", zorder=2,
extent=(x.min(), x.max(), y_min, y_max),
aspect="auto", origin="lower")
| {
"content_hash": "e4dfad5ab1f4a4edd70f22404a1830d0",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 79,
"avg_line_length": 35.35462555066079,
"alnum_prop": 0.5923618466139181,
"repo_name": "petebachant/seaborn",
"id": "a3b25bf457929357c97fc5af9b699978da9bf981",
"size": "16051",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "seaborn/timeseries.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Makefile",
"bytes": "342"
},
{
"name": "Python",
"bytes": "652614"
}
],
"symlink_target": ""
} |
package org.springframework.social.betaseries.api.impl.json;
import org.springframework.social.betaseries.api.Movie;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown=true)
public class BetaSeriesMovieSingleObject extends
AbstractBetaSeriesSingleObject<Movie> {
@JsonCreator
public BetaSeriesMovieSingleObject(@JsonProperty("movie") Movie object) {
super(object);
}
}
| {
"content_hash": "a33e554fbf9377d52057bf82d116bee6",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 74,
"avg_line_length": 33.4375,
"alnum_prop": 0.8373831775700935,
"repo_name": "guillaumemaka/spring-social-betaseries",
"id": "3c17e910c2b23e671fc100d0a382bd76e3cd2c66",
"size": "535",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spring-social-betaseries/src/main/java/org/springframework/social/betaseries/api/impl/json/BetaSeriesMovieSingleObject.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "9541"
},
{
"name": "HTML",
"bytes": "349"
},
{
"name": "Java",
"bytes": "495921"
},
{
"name": "XSLT",
"bytes": "31599"
}
],
"symlink_target": ""
} |
package pl.pronux.sokker.importer.controller;
import java.io.StringReader;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import pl.pronux.sokker.actions.ConfigurationManager;
import pl.pronux.sokker.actions.JuniorsManager;
import pl.pronux.sokker.actions.PlayersManager;
import pl.pronux.sokker.actions.TeamManager;
import pl.pronux.sokker.actions.TrainersManager;
import pl.pronux.sokker.data.sql.SQLSession;
import pl.pronux.sokker.downloader.managers.JuniorsXmlManager;
import pl.pronux.sokker.downloader.managers.PlayersXmlManager;
import pl.pronux.sokker.downloader.managers.ReportsXmlManager;
import pl.pronux.sokker.downloader.managers.TeamsXmlManager;
import pl.pronux.sokker.downloader.managers.TrainersXmlManager;
import pl.pronux.sokker.downloader.managers.TransfersXmlManager;
import pl.pronux.sokker.downloader.managers.XmlManagerUtils;
import pl.pronux.sokker.downloader.xml.parsers.OldXmlParser;
import pl.pronux.sokker.importer.model.IXMLpack;
import pl.pronux.sokker.importer.model.XMLpack;
import pl.pronux.sokker.importer.model.XMLpackOld;
import pl.pronux.sokker.interfaces.ProgressMonitor;
import pl.pronux.sokker.interfaces.RunnableWithProgress;
import pl.pronux.sokker.model.Club;
import pl.pronux.sokker.model.Coach;
import pl.pronux.sokker.model.Junior;
import pl.pronux.sokker.model.Player;
import pl.pronux.sokker.model.Report;
import pl.pronux.sokker.model.Training;
import pl.pronux.sokker.model.Transfer;
import pl.pronux.sokker.resources.Messages;
import pl.pronux.sokker.utils.Log;
import pl.pronux.sokker.utils.file.OperationOnFile;
public class ImportXMLAction implements RunnableWithProgress {
private ConfigurationManager configurationManager = ConfigurationManager.getInstance();
private TrainersManager trainersManager = TrainersManager.getInstance();
private TeamManager teamManager = TeamManager.getInstance();
private JuniorsManager juniorsManager = JuniorsManager.getInstance();
private PlayersManager playersManager = PlayersManager.getInstance();
private List<IXMLpack> packages;
public ImportXMLAction(List<IXMLpack> packages) {
this.packages = packages;
}
public void run(ProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask(Messages.getString("ImportXMLAction.start"), packages.size());
try {
SQLSession.connect();
int teamID = configurationManager.getTeamId();
for (IXMLpack child : packages) {
if (monitor.isCanceled()) {
throw new InterruptedException();
}
monitor.setTaskName(Messages.getString("ImportXMLAction.import"));
monitor.subTask(child.getDate().toDateTimeString());
if (child instanceof XMLpack) {
XMLpack pack = (XMLpack) child;
if (pack.isComplete()) {
try {
SQLSession.beginTransaction();
// if (pack.getCountries() != null) {
// CountriesXmlManager countriesManager = new
// CountriesXmlManager(OperationOnFile.readFromFile(pack.getCountries(),
// "UTF-8"), pack.getDate(), pack.getTeamID());
// countriesManager.parseXML();
// countriesManager.importToSQL();
// }
TeamsXmlManager teamXmlManager = new TeamsXmlManager(
OperationOnFile.readFromFile(pack.getTeam(), "UTF-8"), pack.getDate(), pack.getTeamId());
PlayersXmlManager playersXmlManager = new PlayersXmlManager(
OperationOnFile.readFromFile(pack.getPlayers(), "UTF-8"), pack.getDate(), pack.getTeamId());
JuniorsXmlManager juniorsXmlManager = new JuniorsXmlManager(
OperationOnFile.readFromFile(pack.getJuniors(), "UTF-8"), pack.getDate(), pack.getTeamId());
TrainersXmlManager trainersXMLManager;
TransfersXmlManager transfersManager;
ReportsXmlManager reportsManager;
List<Coach> trainers;
Club club = teamXmlManager.parseXML(teamID);
List<Player> players = playersXmlManager.parseXML();
List<Junior> juniors = juniorsXmlManager.parseXML();
if (club.getId() == teamID) {
if (club.getId() == pack.getTeamId()) {
teamManager.importerTeam(club, pack.getDate());
}
Training training = null;
if (club != null) {
training = club.getTraining();
if (pack.getTrainers() != null) {
trainersXMLManager = new TrainersXmlManager(
OperationOnFile.readFromFile(pack.getTrainers(), "UTF-8"), pack.getDate(), pack.getTeamId());
trainers = trainersXMLManager.parseXML();
trainersManager.importerTrainers(trainers);
trainersXMLManager.importCoachesAtTraining(training);
}
}
playersManager.importPlayers(players, training);
juniorsManager.importJuniors(juniors, training, club.getId());
if (pack.getReports() != null) {
reportsManager = new ReportsXmlManager(
OperationOnFile.readFromFile(pack.getReports(), "UTF-8"), pack.getDate(), pack.getTeamId());
List<Report> reports = reportsManager.parseXML();
teamManager.importerReports(reports);
}
// if(pack.getRegion() != null) {
// CountriesManager countriesManager = new
// CountriesManager();
// regionManager = new
// RegionXmlManager(OperationOnFile.readFromFile(pack.getRegion(),
// "UTF-8"), pack.getDate(), pack.getTeamID());
// List<Region> regions =
// regionManager.parseXML();
// if(regions.get(0) != null) {
// countriesManager.importRegion(regions.get(0));
// }
// }
if (pack.getTransfers() != null) {
transfersManager = new TransfersXmlManager(
OperationOnFile.readFromFile(pack.getTransfers(), "UTF-8"), pack.getDate(), pack.getTeamId());
List<Transfer> transfers = transfersManager.parseXML();
teamManager.importerTransfers(transfers);
}
// if(pack.getLeagues().size() > 0) {
// leagueXmlManager = new LeagueXmlManager();
// List<String> leagues = new ArrayList<String>();
// for(File league : pack.getLeagues()) {
// leagues.add(OperationOnFile.readFromFile(league, "UTF-8"));
// }
// leagueXmlManager.parseXML(leagues);
// leagueXmlManager.importToSQL();
// }
//
// if(pack.getMatches().size() > 0) {
// matchXmlManager = new MatchXmlManager();
// List<String> matches = new ArrayList<String>();
// for(File match : pack.getMatches()) {
// matches.add(OperationOnFile.readFromFile(match, "UTF-8"));
// }
// matchXmlManager.parseXML(matches);
// matchXmlManager.importToSQL();
// }
pack.setImported(true);
} else {
pack.setImported(false);
}
SQLSession.commit();
} catch (Exception e) {
pack.setImported(false);
SQLSession.rollback();
Log.error("XML Importer ", e);
} finally {
SQLSession.endTransaction();
}
}
} else if (child instanceof XMLpackOld) {
XMLpackOld pack = (XMLpackOld) child;
try {
// FIXME: data zmiany kodowania z ISO-8859-2 na utf 24.03.2006
// BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(importXMLTable.getItem(i).getText(0)), "ISO-8859-2"));
SQLSession.beginTransaction();
OldXmlParser oldXMLParser = new OldXmlParser();
String xml = OperationOnFile.readFromFile(pack.getFile(), "UTF-8");
InputSource input = new InputSource(new StringReader(xml));
try {
oldXMLParser.parseXmlSax(input, null);
} catch (SAXException ex) {
input = new InputSource(new StringReader(XmlManagerUtils.filterCharacters(xml)));
oldXMLParser.parseXmlSax(input, null);
}
Club club = oldXMLParser.getClub();
if (club.getId() == teamID) {
trainersManager.importerTrainers(club.getCoaches());
teamManager.importerTeam(club, pack.getDate());
Training training = null;
if (club != null) {
training = club.getTraining();
if ((training.getStatus() & Training.NEW_TRAINING) != 0) {
trainersManager.importTrainersAtTraining(club.getCoaches(), training);
} else if ((training.getStatus() & Training.UPDATE_TRAINING) != 0) {
trainersManager.updateTrainersAtTraining(club.getCoaches(), training);
}
}
playersManager.importPlayers(club.getPlayers(), training);
juniorsManager.importJuniors(club.getJuniors(), training, club.getId());
pack.setImported(true);
} else {
pack.setImported(false);
}
SQLSession.commit();
} catch (Exception e) {
pack.setImported(false);
SQLSession.rollback();
Log.error("XML Importer ", e);
} finally {
SQLSession.endTransaction();
}
}
monitor.worked(1);
}
// new DatabaseConfiguration().updateDbCountry(true);
// new DatabaseConfiguration().updateDbUpdate(true);
// SQLSession.commit();
SQLSession.close();
} catch (SQLException e) {
try {
SQLSession.rollback();
SQLSession.close();
} catch (SQLException e1) {
Log.error("Synchronizer -> SQL Importing Rollback", e1);
}
Log.error("Synchronizer -> SQL Importing", e);
} finally {
monitor.done();
}
}
public void onFinish() {
// TODO Auto-generated method stub
}
}
| {
"content_hash": "76b6866a3ac64499560b9675845670ce",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 145,
"avg_line_length": 38.964,
"alnum_prop": 0.6615337234370188,
"repo_name": "rrymaszewski/SokkerViewer",
"id": "01c4d699a6b057192b270a4f240debb49f49ae84",
"size": "9741",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/pl/pronux/sokker/importer/controller/ImportXMLAction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2245211"
}
],
"symlink_target": ""
} |
@import WMF.WMFNetworkUtilities;
@import WMF.NSURL_WMFLinkParsing;
#import "WMFRevisionQueryResults.h"
#import "WMFArticleRevision.h"
#import "Wikipedia-Swift.h"
@implementation WMFArticleRevisionFetcher
- (NSURLSessionTask *)fetchLatestRevisionsForArticleURL:(NSURL *)articleURL
resultLimit:(NSUInteger)numberOfResults
endingWithRevision:(NSNumber *)revisionId
failure:(WMFErrorHandler)failure
success:(WMFSuccessIdHandler)success {
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] initWithDictionary:@{
@"format": @"json",
@"continue": @"",
@"formatversion": @2,
@"action": @"query",
@"prop": @"revisions",
@"redirects": @1,
@"titles": articleURL.wmf_title,
@"rvlimit": @(numberOfResults),
@"rvprop": WMFJoinedPropertyParameters(@[@"ids", @"size", @"flags"]) //,
//@"pilicense": @"any"
}];
if (revisionId != nil) {
parameters[@"rvendid"] = revisionId;
}
return [self performMediaWikiAPIGETForURL:articleURL withQueryParameters:[parameters copy] completionHandler:^(NSDictionary<NSString *,id> * _Nullable result, NSHTTPURLResponse * _Nullable response, NSError * _Nullable error) {
if (error) {
failure(error);
return;
}
NSError *mantleError = nil;
NSArray *results = [WMFLegacySerializer modelsOfClass:[WMFRevisionQueryResults class] fromArrayForKeyPath:@"query.pages" inJSONDictionary:result error:&mantleError];
if (mantleError) {
failure(mantleError);
return;
}
success([results firstObject]);
}];
}
@end
| {
"content_hash": "d5096295e24ee5e1bd3be281efdbe070",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 231,
"avg_line_length": 60.24444444444445,
"alnum_prop": 0.40206565842862413,
"repo_name": "wikimedia/apps-ios-wikipedia",
"id": "63be4b43e55e1796edfa7491bc80fd52899885f6",
"size": "2749",
"binary": false,
"copies": "1",
"ref": "refs/heads/twn",
"path": "Wikipedia/Code/WMFArticleRevisionFetcher.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "8898"
},
{
"name": "C++",
"bytes": "3272"
},
{
"name": "CSS",
"bytes": "12878"
},
{
"name": "HTML",
"bytes": "1006344"
},
{
"name": "JavaScript",
"bytes": "65642"
},
{
"name": "Makefile",
"bytes": "5485"
},
{
"name": "Objective-C",
"bytes": "2236619"
},
{
"name": "PHP",
"bytes": "5433"
},
{
"name": "Ruby",
"bytes": "19067"
},
{
"name": "Shell",
"bytes": "8667"
},
{
"name": "Swift",
"bytes": "172683"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "08398bc7352dd6df118b99e4a5de9241",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "13877ebd9e2c03b9978ed9b52faeb7161320aa2c",
"size": "195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Dendrobium/Dendrobium dekockii/ Syn. Pedilonum chrysornis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.datastax.oss.driver.examples.json.jackson;
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.bindMarker;
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.insertInto;
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.literal;
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.selectFrom;
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.cql.PreparedStatement;
import com.datastax.oss.driver.api.core.cql.ResultSet;
import com.datastax.oss.driver.api.core.cql.Row;
import com.datastax.oss.driver.api.core.cql.Statement;
import com.datastax.oss.driver.api.core.type.codec.ExtraTypeCodecs;
import com.datastax.oss.driver.api.core.type.codec.TypeCodec;
import com.datastax.oss.driver.examples.json.PlainTextJson;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Illustrates how to map a single table column of type {@code VARCHAR}, containing JSON payloads,
* into a Java object using the <a href="http://wiki.fasterxml.com/JacksonHome">Jackson</a> library.
*
* <p>This example makes usage of a {@linkplain ExtraTypeCodecs#json(Class) custom codec for JSON}.
* If you plan to follow this example, make sure to include the following Maven dependencies in your
* project:
*
* <pre>{@code
* <dependency>
* <groupId>com.fasterxml.jackson.core</groupId>
* <artifactId>jackson-databind</artifactId>
* <version>2.9.8</version>
* </dependency>
* }</pre>
*
* <p>This example also uses the {@link com.datastax.oss.driver.api.querybuilder.QueryBuilder
* QueryBuilder}; for examples using the "core" API, see {@link PlainTextJson} (they are easily
* translatable to the queries in this class).
*
* <p>Preconditions:
*
* <ul>
* <li>An Apache Cassandra(R) cluster is running and accessible through the contacts points
* identified by basic.contact-points (see application.conf).
* </ul>
*
* <p>Side effects:
*
* <ul>
* <li>creates a new keyspace "examples" in the cluster. If a keyspace with this name already
* exists, it will be reused;
* <li>creates a table "examples.json_jackson_column". If it already exists, it will be reused;
* <li>inserts data in the table.
* </ul>
*/
public class JacksonJsonColumn {
// A codec to convert JSON payloads into User instances;
private static final TypeCodec<User> USER_CODEC = ExtraTypeCodecs.json(User.class);
public static void main(String[] args) {
try (CqlSession session = CqlSession.builder().addTypeCodecs(USER_CODEC).build()) {
createSchema(session);
insertJsonColumn(session);
selectJsonColumn(session);
}
}
private static void createSchema(CqlSession session) {
session.execute(
"CREATE KEYSPACE IF NOT EXISTS examples "
+ "WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}");
session.execute(
"CREATE TABLE IF NOT EXISTS examples.json_jackson_column("
+ "id int PRIMARY KEY, json text)");
}
// Mapping a User instance to a table column
private static void insertJsonColumn(CqlSession session) {
User alice = new User("alice", 30);
User bob = new User("bob", 35);
// Build and execute a simple statement
Statement stmt =
insertInto("examples", "json_jackson_column")
.value("id", literal(1))
// the User object will be converted into a String and persisted into the VARCHAR column
// "json"
.value("json", literal(alice, session.getContext().getCodecRegistry()))
.build();
session.execute(stmt);
// The JSON object can be a bound value if the statement is prepared
// (subsequent calls to the prepare() method will return cached statement)
PreparedStatement pst =
session.prepare(
insertInto("examples", "json_jackson_column")
.value("id", bindMarker("id"))
.value("json", bindMarker("json"))
.build());
session.execute(pst.bind().setInt("id", 2).set("json", bob, User.class));
}
// Retrieving User instances from a table column
private static void selectJsonColumn(CqlSession session) {
Statement stmt =
selectFrom("examples", "json_jackson_column")
.all()
.whereColumn("id")
.in(literal(1), literal(2))
.build();
ResultSet rows = session.execute(stmt);
for (Row row : rows) {
int id = row.getInt("id");
// retrieve the JSON payload and convert it to a User instance
User user = row.get("json", User.class);
// it is also possible to retrieve the raw JSON payload
String json = row.getString("json");
System.out.printf(
"Retrieved row:%n id %d%n user %s%n user (raw) %s%n%n",
id, user, json);
}
}
@SuppressWarnings("unused")
public static class User {
private final String name;
private final int age;
@JsonCreator
public User(@JsonProperty("name") String name, @JsonProperty("age") int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
@Override
public String toString() {
return String.format("%s (%s)", name, age);
}
}
}
| {
"content_hash": "5bb6746300555368ef9ba8c6e23eebad",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 100,
"avg_line_length": 34.78846153846154,
"alnum_prop": 0.6714575271789203,
"repo_name": "datastax/java-driver",
"id": "427059b6b68f5ffbd3e2ce4143a9957a6699e5ff",
"size": "6015",
"binary": false,
"copies": "1",
"ref": "refs/heads/4.x",
"path": "examples/src/main/java/com/datastax/oss/driver/examples/json/jackson/JacksonJsonColumn.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "9423701"
},
{
"name": "Scala",
"bytes": "1509"
},
{
"name": "Shell",
"bytes": "10722"
}
],
"symlink_target": ""
} |
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.spring.test.autodeployment;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.Assertions.fail;
import java.net.URISyntaxException;
import java.sql.Driver;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.sql.DataSource;
import org.flowable.bpmn.exceptions.XMLException;
import org.flowable.common.engine.impl.util.IoUtil;
import org.flowable.common.spring.CommonAutoDeploymentStrategy;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.impl.test.AbstractTestCase;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.DeploymentQuery;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.repository.ProcessDefinitionQuery;
import org.flowable.spring.ProcessEngineFactoryBean;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.MapPropertySource;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
import org.springframework.transaction.PlatformTransactionManager;
/**
* @author Tom Baeyens
* @author Joram Barrez
* @author Filip Hrisafov
*/
public class SpringAutoDeployTest extends AbstractTestCase {
protected static final String DEFAULT_VALID_DEPLOYMENT_RESOURCES = "classpath*:/org/flowable/spring/test/autodeployment/autodeploy.*.bpmn20.xml";
protected static final String DEFAULT_INVALID_DEPLOYMENT_RESOURCES = "classpath*:/org/flowable/spring/test/autodeployment/*autodeploy.*.bpmn20.xml";
protected static final String DEFAULT_VALID_DIRECTORY_DEPLOYMENT_RESOURCES = "classpath*:/org/flowable/spring/test/autodeployment/**/autodeploy.*.bpmn20.xml";
protected static final String DEFAULT_INVALID_DIRECTORY_DEPLOYMENT_RESOURCES = "classpath*:/org/flowable/spring/test/autodeployment/**/*autodeploy.*.bpmn20.xml";
protected ConfigurableApplicationContext applicationContext;
protected RepositoryService repositoryService;
protected void createAppContextWithCreateDropDb() {
Map<String, Object> properties = new HashMap<>();
properties.put("databaseSchemaUpdate", "create-drop");
properties.put("deploymentResources", DEFAULT_VALID_DEPLOYMENT_RESOURCES);
properties.put("jdbc.url", "jdbc:h2:mem:SpringAutoDeployTest;DB_CLOSE_DELAY=1000");
createAppContext(properties);
}
protected void createAppContextWithoutDeploymentMode() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentResources", DEFAULT_VALID_DEPLOYMENT_RESOURCES);
createAppContext(properties);
}
protected void createAppContextWithDefaultDeploymentMode() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "default");
properties.put("deploymentResources", DEFAULT_VALID_DEPLOYMENT_RESOURCES);
createAppContext(properties);
}
protected void createAppContextWithSingleResourceDeploymentMode() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "single-resource");
properties.put("deploymentResources", DEFAULT_VALID_DEPLOYMENT_RESOURCES);
createAppContext(properties);
}
protected void createAppContextWithResourceParenFolderDeploymentMode() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "resource-parent-folder");
properties.put("deploymentResources", DEFAULT_VALID_DIRECTORY_DEPLOYMENT_RESOURCES);
createAppContext(properties);
}
protected void createAppContext(Map<String, Object> properties) {
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
applicationContext.register(SpringAutoDeployTestConfiguration.class);
applicationContext.getEnvironment().getPropertySources()
.addLast(new MapPropertySource("springAutoDeploy", properties));
applicationContext.refresh();
this.applicationContext = applicationContext;
this.repositoryService = applicationContext.getBean(RepositoryService.class);
}
@AfterEach
protected void tearDown() throws Exception {
removeAllDeployments();
if (this.applicationContext != null) {
this.applicationContext.close();
this.applicationContext = null;
}
this.repositoryService = null;
}
@Test
public void testBasicActivitiSpringIntegration() {
createAppContextWithoutDeploymentMode();
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list();
Set<String> processDefinitionKeys = new HashSet<>();
for (ProcessDefinition processDefinition : processDefinitions) {
processDefinitionKeys.add(processDefinition.getKey());
}
Set<String> expectedProcessDefinitionKeys = new HashSet<>();
expectedProcessDefinitionKeys.add("a");
expectedProcessDefinitionKeys.add("b");
expectedProcessDefinitionKeys.add("c");
assertThat(expectedProcessDefinitionKeys).isEqualTo(processDefinitionKeys);
}
@Test
public void testNoRedeploymentForSpringContainerRestart() throws Exception {
createAppContextWithoutDeploymentMode();
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
assertThat(deploymentQuery.count()).isEqualTo(1);
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
assertThat(processDefinitionQuery.count()).isEqualTo(3);
// Creating a new app context with same resources doesn't lead to more
// deployments
createAppContextWithoutDeploymentMode();
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(1);
assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(3);
}
// Updating the bpmn20 file should lead to a new deployment when restarting
// the Spring container
@Test
public void testResourceRedeploymentAfterProcessDefinitionChange() throws Exception {
createAppContextWithoutDeploymentMode();
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(1);
applicationContext.close();
String filePath = "org/flowable/spring/test/autodeployment/autodeploy.a.bpmn20.xml";
String originalBpmnFileContent = IoUtil.readFileAsString(filePath);
String updatedBpmnFileContent = originalBpmnFileContent.replace("flow1", "fromStartToEndFlow");
assertThat(updatedBpmnFileContent).hasSizeGreaterThan(originalBpmnFileContent.length());
IoUtil.writeStringToFile(updatedBpmnFileContent, filePath);
// Classic produced/consumer problem here:
// The file is already written in Java, but not yet completely persisted
// by the OS
// Constructing the new app context reads the same file which is
// sometimes not yet fully written to disk
waitUntilFileIsWritten(filePath, updatedBpmnFileContent.length());
try {
createAppContextWithoutDeploymentMode();
} finally {
// Reset file content such that future test are not seeing something funny
IoUtil.writeStringToFile(originalBpmnFileContent, filePath);
}
// Assertions come AFTER the file write! Otherwise the process file is
// messed up if the assertions fail.
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(2);
assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(6);
}
@Test
public void testAutoDeployWithCreateDropOnCleanDb() {
createAppContextWithCreateDropDb();
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(1);
assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(3);
}
@Test
public void testAutoDeployWithDeploymentModeDefault() {
createAppContextWithDefaultDeploymentMode();
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(1);
assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(3);
}
@Test
public void testAutoDeployWithInvalidResourcesWithDeploymentModeDefault() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "default");
properties.put("deploymentResources", DEFAULT_INVALID_DEPLOYMENT_RESOURCES);
assertThatThrownBy(() -> createAppContext(properties))
.hasCauseInstanceOf(XMLException.class);
assertThat(repositoryService).isNull();
// Some of the resources should have been deployed
properties.put("deploymentResources", "classpath*:/notExisting*.bpmn20.xml");
createAppContext(properties);
assertThat(repositoryService.createProcessDefinitionQuery().list())
.extracting(ProcessDefinition::getKey)
.isEmpty();
assertThat(repositoryService.createDeploymentQuery().count()).isZero();
}
@Test
public void testAutoDeployWithInvalidResourcesAndIgnoreExceptionWithDeploymentModeDefault() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "default");
properties.put("deploymentResources", DEFAULT_INVALID_DEPLOYMENT_RESOURCES);
properties.put("throwExceptionOnDeploymentFailure", false);
createAppContext(properties);
assertThat(repositoryService.createProcessDefinitionQuery().list())
.extracting(ProcessDefinition::getKey)
.isEmpty();
assertThat(repositoryService.createDeploymentQuery().count()).isZero();
}
@Test
public void testAutoDeployWithDeploymentModeSingleResource() {
createAppContextWithSingleResourceDeploymentMode();
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(3);
assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(3);
}
@Test
public void testAutoDeployWithInvalidResourcesWithDeploymentModeSingleResource() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "single-resource");
properties.put("deploymentResources", DEFAULT_INVALID_DEPLOYMENT_RESOURCES);
assertThatThrownBy(() -> createAppContext(properties))
.hasCauseInstanceOf(XMLException.class);
assertThat(repositoryService).isNull();
// Some of the resources should have been deployed
properties.put("deploymentResources", "classpath*:/notExisting*.bpmn20.xml");
createAppContext(properties);
assertThat(repositoryService.createProcessDefinitionQuery().list())
.extracting(ProcessDefinition::getKey)
.containsExactlyInAnyOrder("a", "b", "c");
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(3);
}
@Test
public void testAutoDeployWithInvalidResourcesAndIgnoreExceptionOnDeploymentWithDeploymentModeSingleResource() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "single-resource");
properties.put("deploymentResources", DEFAULT_INVALID_DEPLOYMENT_RESOURCES);
properties.put("throwExceptionOnDeploymentFailure", false);
createAppContext(properties);
assertThat(repositoryService.createProcessDefinitionQuery().list())
.extracting(ProcessDefinition::getKey)
.containsExactlyInAnyOrder("a", "b", "c");
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(3);
}
@Test
public void testAutoDeployWithDeploymentModeResourceParentFolder() {
createAppContextWithResourceParenFolderDeploymentMode();
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(2);
assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(4);
}
@Test
public void testAutoDeployWithInvalidResourcesWithDeploymentModeResourceParentFolder() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "resource-parent-folder");
properties.put("deploymentResources", DEFAULT_INVALID_DIRECTORY_DEPLOYMENT_RESOURCES);
assertThatThrownBy(() -> createAppContext(properties))
.hasCauseInstanceOf(XMLException.class);
assertThat(repositoryService).isNull();
// Start a new application context to verify that there are no deployments
properties.put("deploymentResources", "classpath*:/notExisting*.bpmn20.xml");
createAppContext(properties);
assertThat(repositoryService.createProcessDefinitionQuery().list())
.extracting(ProcessDefinition::getKey)
.isEmpty();
assertThat(repositoryService.createDeploymentQuery().count()).isZero();
}
@Test
public void testAutoDeployWithInvalidResourcesAndIgnoreExceptionOnDeploymentWithDeploymentModeResourceParentFolder() {
Map<String, Object> properties = new HashMap<>();
properties.put("deploymentMode", "resource-parent-folder");
properties.put("deploymentResources", DEFAULT_INVALID_DIRECTORY_DEPLOYMENT_RESOURCES);
properties.put("throwExceptionOnDeploymentFailure", false);
createAppContext(properties);
assertThat(repositoryService.createProcessDefinitionQuery().list())
.extracting(ProcessDefinition::getKey)
.containsExactlyInAnyOrder("d");
assertThat(repositoryService.createDeploymentQuery().count()).isEqualTo(1);
}
// --Helper methods
// ----------------------------------------------------------
private void removeAllDeployments() {
if (repositoryService != null) {
for (Deployment deployment : repositoryService.createDeploymentQuery().list()) {
repositoryService.deleteDeployment(deployment.getId(), true);
}
}
}
private boolean waitUntilFileIsWritten(String filePath, int expectedBytes) throws URISyntaxException {
while (IoUtil.getFile(filePath).length() != (long) expectedBytes) {
try {
wait(100L);
} catch (InterruptedException e) {
fail(e.getMessage());
}
}
return true;
}
@Configuration(proxyBeanMethods = false)
static class SpringAutoDeployTestConfiguration {
@Bean
public SimpleDriverDataSource dataSource(
@Value("${jdbc.driver:org.h2.Driver}") Class<? extends Driver> driverClass,
@Value("${jdbc.url:jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000}") String url,
@Value("${jdbc.username:sa}") String username,
@Value("${jdbc.password:}") String password
) {
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
dataSource.setDriverClass(driverClass);
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
return dataSource;
}
@Bean
public PlatformTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
public SpringProcessEngineConfiguration processEngineConfiguration(DataSource dataSource, PlatformTransactionManager transactionManager,
@Value("${databaseSchemaUpdate:true}") String databaseSchemaUpdate,
@Value("${deploymentMode:#{null}}") String deploymentMode,
@Value("${deploymentResources}") Resource[] deploymentResources,
@Value("${throwExceptionOnDeploymentFailure:#{null}}") Boolean throwExceptionOnDeploymentFailure
) {
SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();
processEngineConfiguration.setDataSource(dataSource);
processEngineConfiguration.setTransactionManager(transactionManager);
processEngineConfiguration.setDatabaseSchemaUpdate(databaseSchemaUpdate);
if (deploymentMode != null) {
processEngineConfiguration.setDeploymentMode(deploymentMode);
}
processEngineConfiguration.setDeploymentResources(deploymentResources);
if (throwExceptionOnDeploymentFailure != null) {
processEngineConfiguration.getDeploymentStrategies()
.forEach(strategy -> {
if (strategy instanceof CommonAutoDeploymentStrategy) {
((CommonAutoDeploymentStrategy<ProcessEngine>) strategy).getDeploymentProperties()
.setThrowExceptionOnDeploymentFailure(throwExceptionOnDeploymentFailure);
}
});
}
return processEngineConfiguration;
}
@Bean
public ProcessEngineFactoryBean processEngine(SpringProcessEngineConfiguration processEngineConfiguration) {
ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean();
processEngineFactoryBean.setProcessEngineConfiguration(processEngineConfiguration);
return processEngineFactoryBean;
}
@Bean
public RepositoryService repositoryService(ProcessEngine processEngine) {
return processEngine.getRepositoryService();
}
}
}
| {
"content_hash": "0152b52392c4f221d7188270b0ddabf9",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 165,
"avg_line_length": 46.63814180929096,
"alnum_prop": 0.7134469200524246,
"repo_name": "dbmalkovsky/flowable-engine",
"id": "747429c860dabab36d9b7beed6144549d55d5be5",
"size": "19075",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "modules/flowable-spring/src/test/java/org/flowable/spring/test/autodeployment/SpringAutoDeployTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "166"
},
{
"name": "CSS",
"bytes": "673786"
},
{
"name": "Dockerfile",
"bytes": "477"
},
{
"name": "Groovy",
"bytes": "482"
},
{
"name": "HTML",
"bytes": "1201811"
},
{
"name": "Handlebars",
"bytes": "6004"
},
{
"name": "Java",
"bytes": "46660725"
},
{
"name": "JavaScript",
"bytes": "12668702"
},
{
"name": "Mustache",
"bytes": "2383"
},
{
"name": "PLSQL",
"bytes": "268970"
},
{
"name": "SQLPL",
"bytes": "238673"
},
{
"name": "Shell",
"bytes": "12773"
},
{
"name": "TSQL",
"bytes": "19452"
}
],
"symlink_target": ""
} |
#define BOOST_TEST_MAIN
#include <boost/test/floating_point_comparison.hpp>
#include <boost/test/unit_test.hpp>
#include <Eigen/Core>
#include "Tudat/Basics/testMacros.h"
#include "Tudat/Mathematics/BasicMathematics/legendrePolynomials.h"
namespace tudat
{
namespace unit_tests
{
//! Typedef for Vector10d (vector of 10 doubles).
typedef Eigen::Matrix< double, 10, 1 > Vector10d;
//! Typedef for Vector10i (vector of 10 integers).
typedef Eigen::Matrix< int, 10, 1 > Vector10i;
//! Typedef for Vector12d (vector of 12 doubles).
typedef Eigen::Matrix< double, 12, 1 > Vector12d;
//! Typedef for Vector12i (vector of 12 integers).
typedef Eigen::Matrix< int, 12, 1 > Vector12i;
BOOST_AUTO_TEST_SUITE( test_LegendreFunctions )
BOOST_AUTO_TEST_CASE( test_LegendrePolynomial )
{
// Declare test values vector.
Vector12d computedTestValues;
Vector12d computedTestValuesDirect;
// Define degree and order vectors.
const Vector12i degree
= ( Eigen::VectorXi( 12 ) << 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 150, 150 ).finished( );
const Vector12i order
= ( Eigen::VectorXi( 12 ) << 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 150 ).finished( );
basic_mathematics::LegendreCache legendreCache = basic_mathematics::LegendreCache( 150, 150, 0 );
// Define polynomial parameter.
const double polynomialParameter = 0.5;
legendreCache.update( polynomialParameter );
// Loop through degrees and orders.
for ( int index = 0; index < degree.size( ); index++ )
{
// Compute test value of Legendre polynomial.
computedTestValues( index ) = basic_mathematics::computeLegendrePolynomialFromCache(
degree( index ),
order( index ),
legendreCache );
computedTestValuesDirect( index ) = basic_mathematics::computeLegendrePolynomial(
degree( index ),
order( index ),
polynomialParameter );
}
// Set expected values. These values have been obtained from the MATLAB function "legendre"
// which is described by Mathworks [2012a]. The definition of the associated Legendre
// polynomial in Mathworks [2012a] differs slightly from the definition used in "legendre.h":
// the former includes the Condon-Shortley phase-factor, whereas the latter does not. The
// Condon-Shortley phase factor consists of "(-1)^order". The results from Mathworks [2012a]
// have been divided by this factor in order to make them match with the results from
// "legendre.h".
const Vector12d expectedValues = ( Eigen::VectorXd( 12 ) <<
1.0,
5.000000000000001e-1,
8.660254037844388e-1,
-1.249999999999999e-1,
1.299038105676658,
2.250000000000000,
-4.375000000000001e-1,
3.247595264191651e-1,
5.625000000000002,
9.742785792574935,
6.749829804674222e-2,
1.599576582902126e297
).finished( );
// Check if test values match expected values.
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( expectedValues, computedTestValues, 1.0e-14 );
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( expectedValues, computedTestValuesDirect, 1.0e-14 );
}
BOOST_AUTO_TEST_CASE( test_GeodesyLegendrePolynomial )
{
// Declare test values vector.
Vector10d computedTestValues;
Vector10d computedTestValuesDirect;
basic_mathematics::LegendreCache legendreCache = basic_mathematics::LegendreCache( 4, 4, 1 );
// Define degree and order vectors.
const Vector10i degree = ( Eigen::VectorXi( 10 ) << 0, 1, 1, 2, 2, 2, 3, 3, 3, 3 ).finished( );
const Vector10i order = ( Eigen::VectorXi( 10 ) << 0, 0, 1, 0, 1, 2, 0, 1, 2, 3 ).finished( );
// Define polynomial parameter.
const double polynomialParameter = 0.5;
legendreCache.update( polynomialParameter );
// Loop through degrees and orders.
for ( int index = 0; index < degree.size( ); index++ )
{
// Compute test value of Legendre polynomial.
computedTestValues( index ) = basic_mathematics::computeGeodesyLegendrePolynomialFromCache(
degree( index ),
order( index ), legendreCache );
computedTestValuesDirect( index ) = basic_mathematics::computeGeodesyLegendrePolynomial(
degree( index ),
order( index ), polynomialParameter );
}
// Set expected values. These values have been obtained from the MATLAB subfunction
// "loc_gravLegendre" which is housed in the main function "gravitysphericalharmonic". The
// main function is described by Mathworks [2012b].
const Eigen::VectorXd expectedValues = ( Eigen::VectorXd( 10 ) <<
1.0,
8.660254037844386e-1,
1.500000000000000,
-2.795084971874738e-1,
1.677050983124842,
1.452368754827781,
-1.157516198590759,
3.507803800100574e-1,
1.921303268617425,
1.358566569955260
).finished( );
// Check if test values match expected values.
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( expectedValues, computedTestValues, 2.0e-15 );
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( expectedValues, computedTestValuesDirect, 2.0e-15 );
}
BOOST_AUTO_TEST_CASE( test_LegendrePolynomialDerivative )
{
// Initialize test values vector.
Vector10d computedTestValues;
// Define degree and order vectors.
const Vector10i degree = ( Eigen::VectorXi( 10 ) << 0, 1, 1, 2, 2, 2, 3, 3, 3, 3 ).finished( );
const Vector10i order = ( Eigen::VectorXi( 10 ) << 0, 0, 1, 0, 1, 2, 0, 1, 2, 3 ).finished( );
// Define polynomial parameter.
const double polynomialParameter = 0.5;
// Define current Legendre polynomials.
const Vector10d currentLegendrePolynomials =
( Eigen::VectorXd( 10 ) << 1.000000000000000,
5.000000000000001e-1, 8.660254037844388e-1, -1.249999999999999e-1,
1.299038105676658, 2.250000000000000, -4.375000000000001e-1,
3.247595264191651e-1, 5.625000000000002, 9.742785792574935
).finished( );
// Define incremented Legendre polynomials.
const Vector10d incrementedLegendrePolynomials =
( Eigen::VectorXd( 10 ) << 0.000000000000000,
8.660254037844388e-1, 0.000000000000000, 1.299038105676658,
2.250000000000000, 0.000000000000000, 3.247595264191651e-1,
5.625000000000002, 9.742785792574935, 0.000000000000000
).finished( );
// Loop through degrees and orders.
for ( int index = 0; index < degree.size( ); index++ )
{
// Compute test value of Legendre polynomial derivative.
computedTestValues( index ) = basic_mathematics::computeLegendrePolynomialDerivative(
order( index ), polynomialParameter,
currentLegendrePolynomials( index ), incrementedLegendrePolynomials( index ) );
}
// Define expected values of Legendre polynomial derivatives. These values have been obtained
// by evaluating the explicit expressions given by Eberly [2008]. This evaluation has been
// performed using MATLAB R2012a.
const Vector10d expectedValues = ( Eigen::VectorXd( 10 ) <<
0.0,
1.000000000000000,
-5.773502691896258e-1,
1.500000000000000,
1.732050807568877,
-3.000000000000000,
3.750000000000000e-1,
6.278684177437181,
3.750000000000000,
-1.948557158514987e1
).finished( );
// Check if test values match expected values.
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( expectedValues, computedTestValues, 1.0e-14 );
}
BOOST_AUTO_TEST_CASE( test_Legendre_GeodesyLegendrePolynomialDerivative )
{
// Declare test values vector.
Vector10d computedTestValues;
// Define degree and order vectors.
const Vector10i degree = ( Eigen::VectorXi( 10 ) << 0, 1, 1, 2, 2, 2, 3, 3, 3, 3 ).finished( );
const Vector10i order = ( Eigen::VectorXi( 10 ) << 0, 0, 1, 0, 1, 2, 0, 1, 2, 3 ).finished( );
// Define polynomial parameter.
const double polynomialParameter = 0.5;
// Define current Legendre polynomials.
const Vector10d currentLegendrePolynomials =
( Eigen::VectorXd( 10 ) << 1.000000000000000,
8.660254037844386e-1, 1.500000000000000, -2.795084971874738e-1,
1.677050983124842, 1.452368754827781, -1.157516198590759,
3.507803800100574e-1, 1.921303268617425, 1.358566569955260
).finished( );
// Define incremented Legendre polynomials.
const Vector10d incrementedLegendrePolynomials =
( Eigen::VectorXd( 10 ) << 0.000000000000000,
1.500000000000000, 0.000000000000000, 1.677050983124842,
1.452368754827781, 0.000000000000000, 3.507803800100574e-1,
1.921303268617425, 1.358566569955260, 0.000000000000000
).finished( );
// Loop through degrees and orders.
for ( int index = 0; index < degree.size( ); index++ )
{
// Compute test value of Legendre polynomial derivative.
computedTestValues( index )
= basic_mathematics::computeGeodesyLegendrePolynomialDerivative(
degree( index ), order( index ), polynomialParameter,
currentLegendrePolynomials( index ), incrementedLegendrePolynomials( index ) );
}
// Define expected values of Legendre polynomial derivatives. These values have been obtained
// by evaluating the explicit expressions given by Eberly [2008]. Subsequently these values
// have been multiplied by the geodesy normalization factor as given by
// Heiskanen & Moritz [1967]. This evaluation has been performed using MATLAB R2012a.
const Vector10d expectedValues = ( Eigen::VectorXd( 10 ) <<
0.0,
1.732050807568877,
-1.000000000000000,
3.354101966249685,
2.236067977499790,
-1.936491673103709,
9.921567416492215e-1,
6.781754013527770,
1.280868845744950,
-2.717133139910520
).finished( );
// Check if test values match expected values.
TUDAT_CHECK_MATRIX_CLOSE_FRACTION( expectedValues, computedTestValues, 1.0e-14 );
}
BOOST_AUTO_TEST_SUITE_END( )
} // namespace unit_tests
} // namespace tudat
| {
"content_hash": "106a59a168b2108cc7e86d310f660151",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 101,
"avg_line_length": 45.39080459770115,
"alnum_prop": 0.5731408795475648,
"repo_name": "DominicDirkx/tudat",
"id": "4365f925e9581a5b8be57e2d44d68f4eaa5a2cff",
"size": "12885",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Tudat/Mathematics/BasicMathematics/UnitTests/unitTestLegendrePolynomials.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "8026"
},
{
"name": "C++",
"bytes": "12614398"
},
{
"name": "CMake",
"bytes": "185505"
},
{
"name": "HCL",
"bytes": "30891"
},
{
"name": "MATLAB",
"bytes": "2799"
}
],
"symlink_target": ""
} |
package org.apache.accumulo.server.master.balancer;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.function.Predicate;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.client.impl.TableOperationsImpl;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.ConfigurationCopy;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.master.thrift.TabletServerStatus;
import org.apache.accumulo.server.conf.ServerConfigurationFactory;
import org.apache.accumulo.server.conf.TableConfiguration;
import org.apache.accumulo.server.master.state.TServerInstance;
import org.apache.hadoop.io.Text;
import org.easymock.EasyMock;
public abstract class BaseHostRegexTableLoadBalancerTest extends HostRegexTableLoadBalancer {
protected static class TestInstance implements Instance {
@Override
public String getRootTabletLocation() {
throw new UnsupportedOperationException();
}
@Override
public List<String> getMasterLocations() {
throw new UnsupportedOperationException();
}
@Override
public String getInstanceID() {
return "1111";
}
@Override
public String getInstanceName() {
return "test";
}
@Override
public String getZooKeepers() {
return "";
}
@Override
public int getZooKeepersSessionTimeOut() {
return 30;
}
@Override
public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
}
@Override
public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
}
@Override
public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
}
@Override
public AccumuloConfiguration getConfiguration() {
throw new UnsupportedOperationException();
}
@Override
public void setConfiguration(AccumuloConfiguration conf) {}
@Override
public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
}
}
protected static class Table {
private String tableName;
private String id;
Table(String tableName, String id) {
this.tableName = tableName;
this.id = id;
}
public String getTableName() {
return tableName;
}
public String getId() {
return id;
}
}
protected static final HashMap<String,String> DEFAULT_TABLE_PROPERTIES = new HashMap<>();
{
DEFAULT_TABLE_PROPERTIES.put(HostRegexTableLoadBalancer.HOST_BALANCER_OOB_CHECK_KEY, "10s");
DEFAULT_TABLE_PROPERTIES.put(HostRegexTableLoadBalancer.HOST_BALANCER_POOL_RECHECK_KEY, "30s");
DEFAULT_TABLE_PROPERTIES.put(HostRegexTableLoadBalancer.HOST_BALANCER_PREFIX + FOO.getTableName(), "r01.*");
DEFAULT_TABLE_PROPERTIES.put(HostRegexTableLoadBalancer.HOST_BALANCER_PREFIX + BAR.getTableName(), "r02.*");
}
protected static class TestServerConfigurationFactory extends ServerConfigurationFactory {
public TestServerConfigurationFactory(Instance instance) {
super(instance);
}
@Override
public synchronized AccumuloConfiguration getConfiguration() {
return new ConfigurationCopy(DEFAULT_TABLE_PROPERTIES);
}
@Override
public TableConfiguration getTableConfiguration(String tableId) {
return new TableConfiguration(getInstance(), tableId, null) {
@Override
public String get(Property property) {
return DEFAULT_TABLE_PROPERTIES.get(property.name());
}
@Override
public void getProperties(Map<String,String> props, Predicate<String> filter) {
for (Entry<String,String> e : DEFAULT_TABLE_PROPERTIES.entrySet()) {
if (filter.test(e.getKey())) {
props.put(e.getKey(), e.getValue());
}
}
}
};
}
}
protected static final Table FOO = new Table("foo", "1");
protected static final Table BAR = new Table("bar", "2");
protected static final Table BAZ = new Table("baz", "3");
protected final TestInstance instance = new TestInstance();
protected final TestServerConfigurationFactory factory = new TestServerConfigurationFactory(instance);
protected final Map<String,String> servers = new HashMap<>(15);
protected final SortedMap<TServerInstance,TabletServerStatus> allTabletServers = new TreeMap<>();
protected final Map<String,List<KeyExtent>> tableExtents = new HashMap<>(3);
{
servers.put("192.168.0.1", "r01s01");
servers.put("192.168.0.2", "r01s02");
servers.put("192.168.0.3", "r01s03");
servers.put("192.168.0.4", "r01s04");
servers.put("192.168.0.5", "r01s05");
servers.put("192.168.0.6", "r02s01");
servers.put("192.168.0.7", "r02s02");
servers.put("192.168.0.8", "r02s03");
servers.put("192.168.0.9", "r02s04");
servers.put("192.168.0.10", "r02s05");
servers.put("192.168.0.11", "r03s01");
servers.put("192.168.0.12", "r03s02");
servers.put("192.168.0.13", "r03s03");
servers.put("192.168.0.14", "r03s04");
servers.put("192.168.0.15", "r03s05");
allTabletServers.put(new TServerInstance("192.168.0.1:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.2:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.3:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.4:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.5:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.6:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.7:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.8:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.9:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.10:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.11:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.12:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.13:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.14:9997", 1), new TabletServerStatus());
allTabletServers.put(new TServerInstance("192.168.0.15:9997", 1), new TabletServerStatus());
tableExtents.put(FOO.getTableName(), new ArrayList<KeyExtent>());
tableExtents.get(FOO.getTableName()).add(new KeyExtent(FOO.getId(), new Text("1"), new Text("0")));
tableExtents.get(FOO.getTableName()).add(new KeyExtent(FOO.getId(), new Text("2"), new Text("1")));
tableExtents.get(FOO.getTableName()).add(new KeyExtent(FOO.getId(), new Text("3"), new Text("2")));
tableExtents.get(FOO.getTableName()).add(new KeyExtent(FOO.getId(), new Text("4"), new Text("3")));
tableExtents.get(FOO.getTableName()).add(new KeyExtent(FOO.getId(), new Text("5"), new Text("4")));
tableExtents.put(BAR.getTableName(), new ArrayList<KeyExtent>());
tableExtents.get(BAR.getTableName()).add(new KeyExtent(BAR.getId(), new Text("11"), new Text("10")));
tableExtents.get(BAR.getTableName()).add(new KeyExtent(BAR.getId(), new Text("12"), new Text("11")));
tableExtents.get(BAR.getTableName()).add(new KeyExtent(BAR.getId(), new Text("13"), new Text("12")));
tableExtents.get(BAR.getTableName()).add(new KeyExtent(BAR.getId(), new Text("14"), new Text("13")));
tableExtents.get(BAR.getTableName()).add(new KeyExtent(BAR.getId(), new Text("15"), new Text("14")));
tableExtents.put(BAZ.getTableName(), new ArrayList<KeyExtent>());
tableExtents.get(BAZ.getTableName()).add(new KeyExtent(BAZ.getId(), new Text("21"), new Text("20")));
tableExtents.get(BAZ.getTableName()).add(new KeyExtent(BAZ.getId(), new Text("22"), new Text("21")));
tableExtents.get(BAZ.getTableName()).add(new KeyExtent(BAZ.getId(), new Text("23"), new Text("22")));
tableExtents.get(BAZ.getTableName()).add(new KeyExtent(BAZ.getId(), new Text("24"), new Text("23")));
tableExtents.get(BAZ.getTableName()).add(new KeyExtent(BAZ.getId(), new Text("25"), new Text("24")));
}
protected boolean tabletInBounds(KeyExtent ke, TServerInstance tsi) {
String tid = ke.getTableId().toString();
String host = tsi.host();
if (tid.equals("1")
&& (host.equals("192.168.0.1") || host.equals("192.168.0.2") || host.equals("192.168.0.3") || host.equals("192.168.0.4") || host.equals("192.168.0.5"))) {
return true;
} else if (tid.equals("2")
&& (host.equals("192.168.0.6") || host.equals("192.168.0.7") || host.equals("192.168.0.8") || host.equals("192.168.0.9") || host.equals("192.168.0.10"))) {
return true;
} else if (tid.equals("3")
&& (host.equals("192.168.0.11") || host.equals("192.168.0.12") || host.equals("192.168.0.13") || host.equals("192.168.0.14") || host
.equals("192.168.0.15"))) {
return true;
} else {
return false;
}
}
@Override
protected TableOperations getTableOperations() {
return new TableOperationsImpl(EasyMock.createMock(ClientContext.class)) {
@Override
public Map<String,String> tableIdMap() {
HashMap<String,String> tables = new HashMap<>();
tables.put(FOO.getTableName(), FOO.getId());
tables.put(BAR.getTableName(), BAR.getId());
tables.put(BAZ.getTableName(), BAZ.getId());
return tables;
}
};
}
@Override
protected TabletBalancer getBalancerForTable(String table) {
return new DefaultLoadBalancer();
}
@Override
protected String getNameFromIp(String hostIp) throws UnknownHostException {
if (servers.containsKey(hostIp)) {
return servers.get(hostIp);
} else {
throw new UnknownHostException();
}
}
protected SortedMap<TServerInstance,TabletServerStatus> createCurrent(int numTservers) {
String base = "192.168.0.";
TreeMap<TServerInstance,TabletServerStatus> current = new TreeMap<>();
for (int i = 1; i <= numTservers; i++) {
current.put(new TServerInstance(base + i + ":9997", 1), new TabletServerStatus());
}
return current;
}
}
| {
"content_hash": "06e490fff28c9b2e1a50f5b368e0e543",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 163,
"avg_line_length": 41.501831501831504,
"alnum_prop": 0.6983230361871139,
"repo_name": "dhutchis/accumulo",
"id": "6777a66808853fa63b0dd66a3a85cc43243e6e2c",
"size": "12131",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/base/src/test/java/org/apache/accumulo/server/master/balancer/BaseHostRegexTableLoadBalancerTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2423"
},
{
"name": "C++",
"bytes": "2274937"
},
{
"name": "CSS",
"bytes": "5933"
},
{
"name": "Groovy",
"bytes": "1385"
},
{
"name": "HTML",
"bytes": "11698"
},
{
"name": "Java",
"bytes": "22224331"
},
{
"name": "JavaScript",
"bytes": "249600"
},
{
"name": "Makefile",
"bytes": "2560"
},
{
"name": "Perl",
"bytes": "28190"
},
{
"name": "Protocol Buffer",
"bytes": "1325"
},
{
"name": "Python",
"bytes": "1005923"
},
{
"name": "Ruby",
"bytes": "272223"
},
{
"name": "Shell",
"bytes": "201208"
},
{
"name": "Thrift",
"bytes": "62455"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js" type="text/javascript"> </script>
<script src="//cdn.auth0.com/w2/auth0-6.7.js"></script>
<script src="//cdn.rawgit.com/auth0/angular-storage/master/dist/angular-storage.js" type="text/javascript"> </script>
<script src="//cdn.rawgit.com/auth0/angular-jwt/master/dist/angular-jwt.js" type="text/javascript"> </script>
<script src="//code.angularjs.org/1.2.16/angular-route.min.js" type="text/javascript"> </script>
<script src="//code.angularjs.org/1.2.16/angular-cookies.min.js" type="text/javascript"> </script>
<script src="./scripts/myApp.js" type="text/javascript"> </script>
<script src="//cdn.auth0.com/w2/auth0-angular-4.js"></script>
<script src="./scripts/controllers.js" type="text/javascript"> </script>
<title>Sample Angular App with Auth0</title>
</head>
<body>
<div ng-app="myApp" ng-controller="MsgCtrl">
<div ng-controller="MenuCtrl">
<a href="" ng-click="go('/')">main</a>
<a href="" ng-click="go('/login')">login</a>
<a href="" ng-click="go('/logout')">logout</a>
</div>
<div style="margin-top: 10px;">{{message}}</div>
<div ng-view>
</div>
</div>
</body>
</html>
| {
"content_hash": "f5ceeae0566c35344c12d8f3f65a7e25",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 119,
"avg_line_length": 38.18181818181818,
"alnum_prop": 0.6523809523809524,
"repo_name": "tacticianstudios/quarky",
"id": "38e2231bb5427c19af1a6e00b152643bfe73a9ba",
"size": "1262",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "platforms/windows/build/windows/Debug/AnyCPU/AppX/www/lib/auth0-angular/examples/custom-signup/client/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "7836"
},
{
"name": "CSS",
"bytes": "9615229"
},
{
"name": "HTML",
"bytes": "888321"
},
{
"name": "JavaScript",
"bytes": "69831197"
},
{
"name": "PowerShell",
"bytes": "6052"
},
{
"name": "Shell",
"bytes": "7224"
}
],
"symlink_target": ""
} |
namespace safe_browsing {
// What service classified this threat as unsafe.
enum class ThreatSource {
UNKNOWN,
DATA_SAVER, // From the Data Reduction service.
LOCAL_PVER3, // From LocalSafeBrowsingDatabaseManager, protocol v3
LOCAL_PVER4, // From V4LocalDatabaseManager, protocol v4
REMOTE, // From RemoteSafeBrowsingDatabaseManager
CLIENT_SIDE_DETECTION, // From ClientSideDetectionHost
};
// Data to report about the contents of a particular threat (malware, phishing,
// unsafe download URL). If post_data is non-empty, the request will be
// sent as a POST instead of a GET.
struct HitReport {
HitReport();
HitReport(const HitReport& other);
~HitReport();
GURL malicious_url;
GURL page_url;
GURL referrer_url;
bool is_subresource;
SBThreatType threat_type;
ThreatSource threat_source;
// Opaque string used for tracking Pver4-based experiments
std::string population_id;
ExtendedReportingLevel extended_reporting_level;
bool is_metrics_reporting_active;
std::string post_data;
};
} // namespace safe_browsing
#endif // COMPONENTS_SAFE_BROWSING_DB_HIT_REPORT_H_
| {
"content_hash": "8c383e08208eea5870974bc5b954ff3f",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 79,
"avg_line_length": 29.2,
"alnum_prop": 0.7174657534246576,
"repo_name": "google-ar/WebARonARCore",
"id": "afa567637f1cd61b472087d6d0a9ba2f46f91ca8",
"size": "1642",
"binary": false,
"copies": "4",
"ref": "refs/heads/webarcore_57.0.2987.5",
"path": "components/safe_browsing_db/hit_report.h",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
var y_axis = new Rickshaw.Graph.Axis.Y( {
graph: graph,
orientation: 'left',
height: {{ height }},
tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
element: d3.select("#{{ y_axis_id }}").node()
} );
| {
"content_hash": "5483d280d3b14fe0ea4f3abc847f0ead",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 56,
"avg_line_length": 34.142857142857146,
"alnum_prop": 0.5606694560669456,
"repo_name": "brokendata/bearcart",
"id": "16171d0e46a31aadb4c5dbcbe9dd0f46054ccc40",
"size": "239",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "bearcart/templates/y_axis.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5246"
},
{
"name": "HTML",
"bytes": "7434"
},
{
"name": "JavaScript",
"bytes": "2804"
},
{
"name": "Python",
"bytes": "18872"
}
],
"symlink_target": ""
} |
<?php
require 'soap_config.php';
$client = new SoapClient(null, array('location' => $soap_location,
'uri' => $soap_uri,
'trace' => 1,
'exceptions' => 1));
try {
if($session_id = $client->login($username, $password)) {
echo 'Logged successfull. Session ID:'.$session_id.'<br />';
}
//* Parameters
$id = 4;
$affected_rows = $client->dns_alias_delete($session_id, $id);
echo "Number of records that have been deleted: ".$affected_rows."<br>";
if($client->logout($session_id)) {
echo 'Logged out.<br />';
}
} catch (SoapFault $e) {
echo $client->__getLastResponse();
die('SOAP Error: '.$e->getMessage());
}
?>
| {
"content_hash": "e8f5d821e2360ba404ad2bd066b6d191",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 73,
"avg_line_length": 18.4,
"alnum_prop": 0.6040372670807453,
"repo_name": "idrassi/ispconfig_ovh_hosting",
"id": "36bb1dbcf9e17aef62b2f3a8f46eb96de13cc051",
"size": "644",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ispconfig3_install/remoting_client/examples/dns_alias_delete.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "131"
},
{
"name": "CSS",
"bytes": "301732"
},
{
"name": "HTML",
"bytes": "2336175"
},
{
"name": "JavaScript",
"bytes": "30052"
},
{
"name": "PHP",
"bytes": "5099533"
},
{
"name": "Perl",
"bytes": "17025"
},
{
"name": "Python",
"bytes": "8951"
},
{
"name": "Shell",
"bytes": "104065"
},
{
"name": "Smarty",
"bytes": "1605"
}
],
"symlink_target": ""
} |
default_app_config = 't4proj.apps.stats.apps.StatsConfig' | {
"content_hash": "8d55021b624ea70a700eacb431b7910b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 57,
"avg_line_length": 57,
"alnum_prop": 0.8070175438596491,
"repo_name": "mivanov-utwente/t4proj",
"id": "f1aeca083731ed0bdd451842a014bee412fca0cc",
"size": "81",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "t4proj/apps/stats/__init__.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "451384"
},
{
"name": "HTML",
"bytes": "44876"
},
{
"name": "JavaScript",
"bytes": "545288"
},
{
"name": "Python",
"bytes": "25492"
}
],
"symlink_target": ""
} |
PROGRESS_BAR_LENGTH = 40
def generate_loading_string(completed_tasks, total_tasks):
""" <percentage completed>% [< -- based on percentage completion>] Completed/Total
"""
try:
fraction_completed = (completed_tasks / total_tasks)
except:
fraction_completed = 1 # To avoid division by Zero
percentage_complete = fraction_completed * 100
dashes = int(PROGRESS_BAR_LENGTH * fraction_completed)
blanks = PROGRESS_BAR_LENGTH - dashes
bar = "[" + "-" * dashes + ">" + " " * blanks + "]"
fraction_display = "%s/%s" % (completed_tasks, total_tasks)
loading_string = "%s%% %s %s" % (percentage_complete, bar, fraction_display)
return loading_string
| {
"content_hash": "815ce2736052f12fbbe5df49327229db",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 87,
"avg_line_length": 41.35294117647059,
"alnum_prop": 0.6443812233285917,
"repo_name": "CodingVanGogh/parallelization3",
"id": "9e54a75e7c99889154abc00673671bb2e2ce7adf",
"size": "703",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plmap3/progress_bar.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "6574"
}
],
"symlink_target": ""
} |
<HTML>
<BODY>
<p>Contains classes for accessing application resources,
such as raw asset files, colors, drawables, media or other other files
in the package, plus important device configuration details
(orientation, input types, etc.) that affect how the application may behave.</p>
<p>For more information, see the <a
href="{@docRoot}guide/topics/resources/index.html">Application Resources</a> guide.</p>
{@more}
</BODY>
</HTML> | {
"content_hash": "435d60af5d015ffae4c7529fbdc29619",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 87,
"avg_line_length": 35.916666666666664,
"alnum_prop": 0.7633410672853829,
"repo_name": "szpaddy/android-4.1.2_r2-core",
"id": "3d0bac18d7b77679e8c538c751cb1d1ad0250a42",
"size": "431",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "java/android/content/res/package.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "10192"
},
{
"name": "C++",
"bytes": "2648368"
},
{
"name": "Java",
"bytes": "23513823"
}
],
"symlink_target": ""
} |
package net.meisen.dissertation.impl.idfactories;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import net.meisen.dissertation.config.TestConfig;
import net.meisen.dissertation.impl.idfactories.UuIdsFactory;
import net.meisen.general.sbconfigurator.runners.JUnitConfigurationRunner;
import net.meisen.general.sbconfigurator.runners.annotations.ContextClass;
import net.meisen.general.sbconfigurator.runners.annotations.ContextFile;
import net.meisen.general.sbconfigurator.runners.annotations.SystemProperty;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
/**
* Tests the implementation of the {@code UuIdsFactory}.
*
* @author pmeisen
*
*/
@RunWith(JUnitConfigurationRunner.class)
@ContextClass(TestConfig.class)
@ContextFile("test-sbconfigurator-core.xml")
@SystemProperty(property = "testBeans.selector", value = "net/meisen/dissertation/impl/idfactories/testIdFactories.xml")
public class TestUuIdsFactory {
@Autowired(required = true)
@Qualifier("uuIdFactory")
private UuIdsFactory factory;
/**
* Tests the unique id generation of the factory
*/
@Test
public void testIdGeneration() {
// generate some identifiers
final Set<UUID> generatedIds = new HashSet<UUID>();
for (int i = 0; i < 10000; i++) {
final UUID id = factory.getId();
assertNotNull(id);
assertTrue(generatedIds.add(id));
}
}
}
| {
"content_hash": "75b0321663e39d75c0f0986d6e00dd9b",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 120,
"avg_line_length": 30,
"alnum_prop": 0.7849056603773585,
"repo_name": "pmeisen/dis-timeintervaldataanalyzer",
"id": "924d1ce89d93373f835d3775aab8a213402ffd7c",
"size": "1590",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/net/meisen/dissertation/impl/idfactories/TestUuIdsFactory.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ANTLR",
"bytes": "16445"
},
{
"name": "Java",
"bytes": "3229818"
},
{
"name": "XSLT",
"bytes": "73394"
}
],
"symlink_target": ""
} |
using System.Web.Mvc;
namespace BtsPortal.Web.Controllers
{
public class ErrorController : Controller
{
// GET: Error
public ActionResult Index()
{
return View();
}
public ActionResult AccessDenied(string roles, string errorDesc)
{
ViewBag.Roles = roles;
ViewBag.error = errorDesc;
return View();
}
public PartialViewResult AccessDeniedPartial(string roles, string errorDesc)
{
ViewBag.Roles = roles;
ViewBag.error = errorDesc;
return PartialView("_AccessDenied");
}
}
} | {
"content_hash": "5987a0a930b073a120a3691f70f192f9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 84,
"avg_line_length": 24.074074074074073,
"alnum_prop": 0.5615384615384615,
"repo_name": "nishantnepal/BtsPortal",
"id": "7717e816e679a0d31bee583969c513dd2593fc65",
"size": "652",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "BtsPortal.Web/Controllers/ErrorController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "104"
},
{
"name": "C#",
"bytes": "580564"
},
{
"name": "CSS",
"bytes": "14339"
},
{
"name": "HTML",
"bytes": "5127"
},
{
"name": "JavaScript",
"bytes": "542781"
},
{
"name": "Shell",
"bytes": "15321"
},
{
"name": "XSLT",
"bytes": "13408"
}
],
"symlink_target": ""
} |
package hyweb.jo.type;
import hyweb.jo.util.DateUtil;
import hyweb.jo.util.JODatetimeFormat;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author William
*/
public class JODateType extends JOType<Date> {
public final static Date MAX_VALUE = DateUtil.newInstance(1753, 1, 1, 0, 0, 0);
public final static Date MIN_VALUE = DateUtil.newInstance(9999, 12, 31, 23, 59, 59);
@Override
public String dt() {
return dt_date;
}
@Override
public Date check(Object o, Date dv) {
if (o instanceof Date) {
return (Date) o;
} else if (o instanceof String) {
Date d = DateUtil.to_date((String) o);
return (d != null) ? d : dv;
} else if (o != null) {
String text = o.toString();
Date d = DateUtil.to_date(text);
return (d != null) ? d : dv;
}
return dv;
}
public Date check(Object o, String fmt) {
if (o instanceof Date) {
return ((Date) o);
} else if (o != null) {
String text = o.toString().trim();
return DateUtil.to_date(text);
}
return null;
}
@Override
public Date loadRS(ResultSet rs, String name) throws SQLException {
java.sql.Timestamp ts = rs.getTimestamp(name);
if (ts != null) {
return new Date(ts.getTime());
}
return null;
}
@Override
public void setPS(PreparedStatement ps, int idx, Object value) throws SQLException {
Date d = check(value);
if (value == null) {
ps.setNull(idx, Types.TIMESTAMP);
} else {
java.sql.Timestamp ts = new java.sql.Timestamp(d.getTime());
ps.setTimestamp(idx, ts);
}
}
public Class<?> nativeClass() {
return Date.class;
}
@Override
public int jdbc() {
return Types.TIMESTAMP;
}
protected SimpleDateFormat sfmt() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
sdf.setLenient(false);
return sdf;
}
protected SimpleDateFormat lfmt() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
sdf.setLenient(false);
return sdf;
}
@Override
public String sql_string(Object o, String ft) {
Date v = check(o, ft);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return (v != null) ? "'" + sdf.format(v) + "'" : "null";
}
}
| {
"content_hash": "9c1f99744c05391662412239578b109c",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 88,
"avg_line_length": 27.65,
"alnum_prop": 0.5562386980108499,
"repo_name": "williamyyj/mjo2",
"id": "4ba1971ca692cefa0eb7715d7805ac679ca553a8",
"size": "2765",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/hyweb/jo/type/JODateType.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1120312"
}
],
"symlink_target": ""
} |
package org.taskana.model.mappings;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.taskana.model.WorkbasketAccessItem;
/**
* This class is the mybatis mapping of workbasket access items.
*/
public interface WorkbasketAccessMapper {
@Select("SELECT ID, WORKBASKET_ID, USER_ID, GROUP_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE FROM WORKBASKET_ACCESS_LIST WHERE ID = #{id}")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@Result(property = "userId", column = "USER_ID"),
@Result(property = "groupId", column = "GROUP_ID"),
@Result(property = "read", column = "READ"),
@Result(property = "open", column = "OPEN"),
@Result(property = "append", column = "APPEND"),
@Result(property = "transfer", column = "TRANSFER"),
@Result(property = "distribute", column = "DISTRIBUTE") })
WorkbasketAccessItem findById(@Param("id") String id);
@Select("SELECT ID, WORKBASKET_ID, USER_ID, GROUP_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE FROM WORKBASKET_ACCESS_LIST WHERE USER_ID = #{userId}")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@Result(property = "userId", column = "USER_ID"),
@Result(property = "groupId", column = "GROUP_ID"),
@Result(property = "read", column = "READ"),
@Result(property = "open", column = "OPEN"),
@Result(property = "append", column = "APPEND"),
@Result(property = "transfer", column = "TRANSFER"),
@Result(property = "distribute", column = "DISTRIBUTE") })
List<WorkbasketAccessItem> findByUserId(@Param("userId") String userId);
@Select("SELECT ID, WORKBASKET_ID, USER_ID, GROUP_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE FROM WORKBASKET_ACCESS_LIST WHERE WORKBASKET_ID = #{id}")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@Result(property = "userId", column = "USER_ID"),
@Result(property = "groupId", column = "GROUP_ID"),
@Result(property = "read", column = "READ"),
@Result(property = "open", column = "OPEN"),
@Result(property = "append", column = "APPEND"),
@Result(property = "transfer", column = "TRANSFER"),
@Result(property = "distribute", column = "DISTRIBUTE") })
List<WorkbasketAccessItem> findByWorkbasketId(@Param("id") String id);
@Select("SELECT ID, WORKBASKET_ID, USER_ID, GROUP_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE FROM WORKBASKET_ACCESS_LIST ORDER BY ID")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@Result(property = "userId", column = "USER_ID"),
@Result(property = "groupId", column = "GROUP_ID"),
@Result(property = "read", column = "READ"),
@Result(property = "open", column = "OPEN"),
@Result(property = "append", column = "APPEND"),
@Result(property = "transfer", column = "TRANSFER"),
@Result(property = "distribute", column = "DISTRIBUTE") })
List<WorkbasketAccessItem> findAll();
@Insert("INSERT INTO WORKBASKET_ACCESS_LIST (ID, WORKBASKET_ID, USER_ID, GROUP_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE) "
+ "VALUES (#{workbasketAccessItem.id}, #{workbasketAccessItem.workbasketId}, #{workbasketAccessItem.userId}, #{workbasketAccessItem.groupId}, #{workbasketAccessItem.read}, #{workbasketAccessItem.open}, #{workbasketAccessItem.append}, #{workbasketAccessItem.transfer}, #{workbasketAccessItem.distribute})")
@Options(keyProperty = "id", keyColumn = "ID")
void insert(@Param("workbasketAccessItem") WorkbasketAccessItem workbasketAccessItem);
@Update("UPDATE WORKBASKET_ACCESS_LIST SET WORKBASKET_ID = #{workbasketAccessItem.workbasketId}, USER_ID = #{workbasketAccessItem.userId}, GROUP_ID = #{workbasketAccessItem.groupId}, READ = #{workbasketAccessItem.read}, OPEN = #{workbasketAccessItem.open}, APPEND = #{workbasketAccessItem.append}, TRANSFER = #{workbasketAccessItem.transfer}, DISTRIBUTE = #{workbasketAccessItem.distribute} "
+ "WHERE id = #{workbasketAccessItem.id}")
void update(@Param("workbasketAccessItem") WorkbasketAccessItem workbasketAccessItem);
@Delete("DELETE FROM WORKBASKET_ACCESS_LIST where id = #{id}")
void delete(@Param("id") String id);
@Select("<script>SELECT ID, WORKBASKET_ID, USER_ID, GROUP_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE "
+ "FROM WORKBASKET_ACCESS_LIST "
+ "WHERE WORKBASKET_ID = #{workbasketId} "
+ "AND USER_ID = #{userId} "
+ "AND <if test=\"authorization == 'OPEN'\">OPEN</if>"
+ "<if test=\"authorization == 'READ'\">READ</if>"
+ "<if test=\"authorization == 'APPEND'\">APPEND</if>"
+ "<if test=\"authorization == 'TRANSFER'\">TRANSFER</if>"
+ "<if test=\"authorization == 'DISTRIBUTE'\">DISTRIBUTE</if> = 1</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@Result(property = "userId", column = "USER_ID"),
@Result(property = "groupId", column = "GROUP_ID"),
@Result(property = "read", column = "READ"),
@Result(property = "open", column = "OPEN"),
@Result(property = "append", column = "APPEND"),
@Result(property = "transfer", column = "TRANSFER"),
@Result(property = "distribute", column = "DISTRIBUTE") })
List<WorkbasketAccessItem> findByWorkbasketAndUserAndAuthorization(@Param("workbasketId") String workbasketId, @Param("userId") String userId, @Param("authorization") String authorization);
@Select("SELECT ID, WORKBASKET_ID, USER_ID, GROUP_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE FROM WORKBASKET_ACCESS_LIST WHERE WORKBASKET_ID = #{workbasketId} AND GROUP_ID = #{groupId}")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
@Result(property = "userId", column = "USER_ID"),
@Result(property = "groupId", column = "GROUP_ID"),
@Result(property = "read", column = "READ"),
@Result(property = "open", column = "OPEN"),
@Result(property = "append", column = "APPEND"),
@Result(property = "transfer", column = "TRANSFER"),
@Result(property = "distribute", column = "DISTRIBUTE") })
List<WorkbasketAccessItem> findByWorkbasketAndGroup(@Param("workbasketId") String workbasketId, @Param("groupId") String groupId);
}
| {
"content_hash": "8328e0b69886401fa0c55d4a3b5fa6cf",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 396,
"avg_line_length": 63.275862068965516,
"alnum_prop": 0.6302452316076295,
"repo_name": "eberhardmayer/taskana",
"id": "598501fee2a561223da5f85d5461b515f2128efd",
"size": "7340",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/taskana-core/src/main/java/org/taskana/model/mappings/WorkbasketAccessMapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4994"
},
{
"name": "CSS",
"bytes": "561"
},
{
"name": "HTML",
"bytes": "23765"
},
{
"name": "Java",
"bytes": "243168"
},
{
"name": "JavaScript",
"bytes": "5988"
},
{
"name": "Shell",
"bytes": "6468"
},
{
"name": "TypeScript",
"bytes": "74589"
}
],
"symlink_target": ""
} |
INSERT INTO version VALUES ('6.9.1', now(), 'Cleans up the landing page.');
# --- !Downs
DELETE FROM version WHERE version_id = '6.9.1';
| {
"content_hash": "3d3710fa2f504edfff8ff0c06da01a8b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 75,
"avg_line_length": 34.5,
"alnum_prop": 0.6521739130434783,
"repo_name": "ProjectSidewalk/SidewalkWebpage",
"id": "b997627c3487f12114f641e0e084daafee7bd1c8",
"size": "149",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "conf/evolutions/default/86.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "109361"
},
{
"name": "Dockerfile",
"bytes": "1227"
},
{
"name": "HTML",
"bytes": "734601"
},
{
"name": "Java",
"bytes": "19745"
},
{
"name": "JavaScript",
"bytes": "1237155"
},
{
"name": "Makefile",
"bytes": "1666"
},
{
"name": "NewLisp",
"bytes": "23115"
},
{
"name": "Python",
"bytes": "31155"
},
{
"name": "Ruby",
"bytes": "870"
},
{
"name": "SCSS",
"bytes": "1498"
},
{
"name": "Scala",
"bytes": "696576"
},
{
"name": "Shell",
"bytes": "2738"
}
],
"symlink_target": ""
} |
package editor.plugin.typeloader.properties;
import editor.EditorHost;
import gw.lang.IIssueContainer;
import editor.plugin.typeloader.INewFileParams;
import editor.plugin.typeloader.ITypeFactory;
import gw.lang.reflect.IType;
import javax.swing.JComponent;
import javax.swing.text.StyledEditorKit;
/**
*/
@SuppressWarnings("UnusedDeclaration")
public class PropertiesTypeFactory implements ITypeFactory
{
public PropertiesTypeFactory()
{
}
@Override
public boolean canCreate()
{
return true;
}
@Override
public String getFileExtension()
{
return ".properties";
}
@Override
public String getName()
{
return "Properties";
}
@Override
public String getIcon()
{
return "images/properties_type.png";
}
@Override
public PropertiesFileParams makeDefaultParams( String fqn )
{
return new PropertiesFileParams( fqn );
}
@Override
public String createNewFileContents( INewFileParams params )
{
String eol = System.getProperty( "line.separator" );
return "# " + params.getFqn() + eol + eol + "MyProperty = My value" + eol;
}
@Override
public JComponent makePanel( INewFileParams params )
{
return null;
}
@Override
public StyledEditorKit makeEditorKit()
{
return null;
}
@Override
public void parse( IType type, String strText, boolean forceCodeCompletion, boolean changed, EditorHost editor )
{
//## todo: write a properties file parser
}
@Override
public boolean canAddBreakpoint( IType type, int line )
{
return false;
}
@Override
public String getTypeAtOffset( IType type, int offset )
{
return type.getName();
}
@Override
public String getTooltipMessage( int iPos, EditorHost editor )
{
//## todo: get error message for iPos
return null;
}
@Override
public IIssueContainer getIssueContainer( EditorHost editor )
{
return new PropertiesIssueContainer();
}
}
| {
"content_hash": "a973c3e3a59c65fa038acf830daadc6b",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 114,
"avg_line_length": 19.575757575757574,
"alnum_prop": 0.7053663570691434,
"repo_name": "gosu-lang/gosu-lang",
"id": "a1f88da07268a6c435ac6cb22f73f7a07736713f",
"size": "1938",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gosu-lab/src/main/java/editor/plugin/typeloader/properties/PropertiesTypeFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "10236"
},
{
"name": "GAP",
"bytes": "51837"
},
{
"name": "Gosu",
"bytes": "16976739"
},
{
"name": "Groovy",
"bytes": "22653"
},
{
"name": "Java",
"bytes": "12112134"
},
{
"name": "JavaScript",
"bytes": "921060"
},
{
"name": "Makefile",
"bytes": "6850"
},
{
"name": "Python",
"bytes": "8450"
},
{
"name": "Roff",
"bytes": "345"
},
{
"name": "Shell",
"bytes": "3417"
}
],
"symlink_target": ""
} |
(function () {
"use strict"; // note that this makes JSLint complain if you use arguments[x]
/*global progress : true*/
/*global storage, XMLHttpRequest, msg, btoa*/
progress.data.AuthenticationProviderBearer = function (uri) {
var bearerToken = null,
fn;
// process constructor arguments, etc.
this._initialize(uri, progress.data.Session.AUTH_TYPE_BEARER,
{"_loginURI": progress.data.AuthenticationProvider._homeLoginURIBase});
// PRIVATE FUNCTIONS
function make_Bearer_auth_header(token) {
return "Bearer " + token;
}
// "INTERNAL" METHODS
// Override the protoype's method but call it from within the override
// (Define the override here in the constructor so it has access to instance variables)
this._reset = function () {
bearerToken = null;
progress.data.AuthenticationProviderBearer.prototype._reset.apply(this);
};
// Override the protoype's method (this method does not invoke the prototype's copy)
// (Define the override here in the constructor so it has access to instance variables)
this._openLoginRequest = function (xhr, uri) {
var auth;
xhr.open("GET", uri, true); // but see comments below inside the "if bearerToken"
// may have to go with that approach
if (bearerToken) {
// set Authorization header
auth = make_Bearer_auth_header(bearerToken);
xhr.setRequestHeader('Authorization', auth);
}
progress.data.Session._setNoCacheHeaders(xhr);
};
// Override the protoype's method but call it from within the override
// (Define the override here in the constructor so it has access to instance variables)
this._processLoginResult = function _Bearer_processLoginResult(xhr, deferred) {
progress.data.AuthenticationProviderBearer.prototype._processLoginResult.apply(
this,
[xhr, deferred]
);
if (!this._loggedIn) {
// login failed, clear the credentials
bearerToken = null;
}
};
// Override the protoype's method (this method does not invoke the prototype's copy, but
// calls a prototype general-purpose login method)
// (Define the override here in the constructor so it has access to instance variables)
this.login = function (token) {
// these throw if the check fails (may want to do something more elegant)
this._checkStringArg("login", token, 1, "token");
bearerToken = token;
return this._loginProto();
};
// Override the protoype's method (this method does not invoke the prototype's copy)
// (Define the override here in the constructor so it has access to instance variables)
// TODO: This method uses a callback, primarily to avoid breaking tdriver tests. We should change
// it to use promises
this._openRequestAndAuthorize = function (xhr, verb, uri, async, callback) {
var auth,
errorObject;
if (this.hasClientCredentials()) {
xhr.open(verb, uri, async); // but see comments below inside the "if bearerToken"
// may have to go with that approach
if (bearerToken) {
// set Authorization header
auth = make_Bearer_auth_header(bearerToken);
xhr.setRequestHeader('Authorization', auth);
}
progress.data.Session._setNoCacheHeaders(xhr);
} else {
// AuthenticationProvider: The AuthenticationProvider is not managing valid credentials.
errorObject = new Error(progress.data._getMsgText("jsdoMSG125", "AuthenticationProvider"));
}
callback(errorObject);
};
};
// Give this constructor the prototype from the "base" AuthenticationProvider
// Do this indirectly by way of an intermediate object so changes to the prototype ("method overrides")
// don't affect other types of AuthenticationProviders that use the prototype)
function BearerProxy() {}
BearerProxy.prototype = progress.data.AuthenticationProvider.prototype;
progress.data.AuthenticationProviderBearer.prototype = new BearerProxy();
// Reset the prototype's constructor property so it points to AuthenticationProviderForm rather than
// the one that it just inherited (this is pretty much irrelevant though - the correct constructor
// will get called regardless)
progress.data.AuthenticationProviderBearer.prototype.constructor =
progress.data.AuthenticationProviderBearer;
// OVERRIDE METHODS ON PROTOTYPE IF NECESSARY AND POSSIBLE
// (SOME METHODS ARE OVERRIDDEN IN THE CONSTRUCTOR BECAUSE THEY NEED ACCESS TO INSTANCE VARIABLES)
// NOTE: There are no overrides of the following methods (either here or in the constructor).
// This object uses these methods from the original prototype(i.e., the implementations from the
// AuthenticationProvider object):
// logout (API method)
// hasClientCredentials (API method)
}());
| {
"content_hash": "4004bd4d73fb54ef5c66637a970f5eaf",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 107,
"avg_line_length": 42.8203125,
"alnum_prop": 0.6236088305053822,
"repo_name": "CloudDataObject/JSDO",
"id": "96fc8a403887187af4ab56ec207952f6ca10bb75",
"size": "6112",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/auth/progress.auth.bearer.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "1921985"
}
],
"symlink_target": ""
} |
import sys
import os
from xml.etree import ElementTree
import json
# Import vendor modules from a subdirectory
here = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(here, "./vendored"))
import requests
from bs4 import BeautifulSoup
import boto3
if os.environ.get("IN_AWS", "false").lower() == "true":
from aws_xray_sdk.core import xray_recorder # noqa
from aws_xray_sdk.core import patch_all # noqa
patch_all()
xray_recorder.configure(sampling=False)
# Download RSS feed and parse news entries
@xray_recorder.capture("get_feed_xml")
def get_feed_xml():
url = "http://feeds.feedburner.com/ampparit-uutiset"
response = requests.get(url, timeout=5)
ns = {"atom": "http://www.w3.org/2005/Atom"}
feed = ElementTree.fromstring(response.content)
print(f"Feed last updated {feed.find('atom:updated', ns).text}")
id_prefix = "id="
entries = [
{
"id": entry.find("atom:id", ns).text.split(id_prefix, 1)[1],
"title": entry.find("atom:title", ns).text,
"updated": entry.find("atom:updated", ns).text,
"feed_url": entry.find("atom:link", ns).attrib.get("href"),
"author": entry.find("atom:author", ns).find("atom:name", ns).text
}
for entry in feed.findall("atom:entry", ns)
]
print(f"Parsed {len(entries)} items")
return entries
# Scrape given html to plaintext
@xray_recorder.capture("parse_text")
def parse_text(html, source):
soup = BeautifulSoup(html, "html.parser")
print("Parsing content from source " + source)
xray_recorder.current_subsegment().put_annotation('source_parser', source)
class_parsers = {
"Aamulehti": {"css": "content--main"},
"Demokraatti.fi": {"css": "post-content", "parent": "section"},
"Iltalehti": {"css": "article-body"},
"Kainuun Sanomat": {"css": "Teksti"},
"Kaleva": {"css": "article__text"},
"Karjalainen": {"css": "itemBody"},
"Lapin Kansa": {"css": "content--main"},
"Mikrobitti.fi": {"css": "post-content"},
"Mobiili.fi": {"css": "blogcontent"},
"MTV.fi": {"css": "article"},
"Pohjalainen": {"css": "article__full", "parent": "article"},
"Savon Sanomat": {"css": "article__body"},
"Seura": {"css": "content__body"},
"Suomenmaa": {"css": "ArticleText"},
"Talouselämä": {"css": "article-body"},
"Tivi": {"css": "article-body"},
"Verkkouutiset": {"css": "entry-content"}
}
# Returns all child tags of the parent tag which has a specific css class
def children(css, parent="div", child="p"):
parent_node = soup.find(parent, class_=css)
if parent_node:
return parent_node.find_all(child)
else:
return []
text = ""
if source in class_parsers:
for e in children(**class_parsers[source]):
text += e.get_text() + " "
elif source == "Yle":
for e in children("yle__article__content") or children("ydd-article__body"):
text += e.get_text() + " "
elif source == "Uusi Suomi":
mess = soup.find("div", class_="field-name-body").find("div", class_="field-item")
for script in mess.find_all("script"):
script.decompose()
for e in mess.find_all("div"):
text += e.get_text() + " "
elif source in ["Ilta-Sanomat", "Taloussanomat"]:
mess = soup.find("div", class_="body")
for script in mess.find_all("script"):
script.decompose()
for script in mess.select(".hidden"):
script.decompose()
text = mess.get_text()
else:
print("Fallback to crude parser")
for e in soup.find_all("p"):
text += e.get_text() + " "
print(f"Parsed {len(text)} bytes of plaintext")
return text
# Fetch page content and return object with parsed plaintext
def get_content(item):
if item["author"] in ["Kauppalehti"]:
print("Dropping unsupported source " + item["author"])
return None
try:
url = item["feed_url"]
xray = xray_recorder.begin_subsegment("get url")
response = requests.get(url, timeout=5)
xray.put_annotation('html_size', len(response.content))
xray_recorder.end_subsegment()
except Exception as e:
print(e)
xray_recorder.end_subsegment()
return None
if response.status_code == 404:
print("Feed link is stale")
return None
else:
print(f"Fetched {len(response.content)} bytes of HTML from {response.url}")
item["content_url"] = response.url
item["content"] = parse_text(response.text, item["author"])
item["content_length"] = len(item["content"])
if item["content"] == "":
item["content"] = "FAILED_TO_PARSE_CONTENT"
return item
# Save entries to DynamoDB
@xray_recorder.capture("save_to_dynamo")
def save_to_dynamo(items):
table_name = os.environ.get("CORPUS_TABLE_NAME")
table = boto3.resource("dynamodb").Table(table_name)
with table.batch_writer() as batch:
for item in items:
batch.put_item(Item=item)
# Lambda entry point
@xray_recorder.capture("handler")
def handler(event, context):
headlines = get_feed_xml()
max_items = int(os.environ.get("MAX_HARVESTED_HEADLINES"))
corpus_items = list(
filter(
None.__ne__,
[get_content(headline) for headline in headlines[:max_items]]
)
)
if not event.get("is_local_dev"):
save_to_dynamo(corpus_items)
else:
print(json.dumps(corpus_items, indent=1))
raise NotImplementedError("Local DynamoDB usage not implemented")
# Main function for local testing
if __name__ == "__main__":
print("Local execution is not completely supported. Please run this in AWS Lambda.")
handler({"is_local_dev": True}, {})
| {
"content_hash": "05ea679e49c94642b8612695d99a363e",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 90,
"avg_line_length": 33.97142857142857,
"alnum_prop": 0.5971404541631623,
"repo_name": "Vilsepi/infinimonkey",
"id": "b36a6db0e47d27bc552ed2ddf9a84006db9768d1",
"size": "5997",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/harvester.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "362"
},
{
"name": "HTML",
"bytes": "579"
},
{
"name": "JavaScript",
"bytes": "615"
},
{
"name": "Python",
"bytes": "9732"
},
{
"name": "Shell",
"bytes": "1378"
}
],
"symlink_target": ""
} |
set verify off
set feedback off
prompt Create VORAX_TEST user
grant create session,
create table,
create view,
create sequence,
create procedure,
create type,
create synonym,
unlimited tablespace
to vorax_test identified by xxx;
grant select on v_$sesstat to vorax_test;
grant select on v_$statname to vorax_test;
grant select on v_$mystat to vorax_test;
prompt Done.
alter session set current_schema=VORAX_TEST;
@create_objects.sql
quit
| {
"content_hash": "eda6e110e767ce41a41efee2f31549ea",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 44,
"avg_line_length": 19.64,
"alnum_prop": 0.7128309572301426,
"repo_name": "talek/vorax4",
"id": "2bf5c4c26e60deff65a2c6798b2fc5877fa7818b",
"size": "491",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vorax/ruby/spec/sql/setup_user.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PLSQL",
"bytes": "225058"
},
{
"name": "Ragel",
"bytes": "23981"
},
{
"name": "Ruby",
"bytes": "556877"
},
{
"name": "SQLPL",
"bytes": "2837"
},
{
"name": "Vim script",
"bytes": "257905"
}
],
"symlink_target": ""
} |
CREATE DATABASE `Equipment shop` DEFAULT CHARACTER SET utf8 ;
USE `Equipment shop`;
CREATE TABLE `Product` (
maker varchar(10) NOT NULL,
model varchar(50),
type varchar(50) CHECK ( type IN ('PC', 'Laptop', 'Printer') ),
PRIMARY KEY (model)
);
CREATE TABLE `Laptop`(
code int auto_increment,
model varchar(50) NOT NULL,
speed smallint NOT NULL,
ram smallint NOT NULL,
hd real NOT NULL,
price int,
screen tinyint NOT NULL,
PRIMARY KEY (code),
FOREIGN KEY (model) REFERENCES product(model)
);
CREATE TABLE `PC` (
code int auto_increment,
model varchar(50) NOT NULL,
speed smallint NOT NULL,
ram smallint NOT NULL,
hd real NOT NULL,
cd varchar(10) NOT NULL,
price int,
PRIMARY KEY (code),
FOREIGN KEY (model) REFERENCES product(model)
);
CREATE TABLE Printer(
code int auto_increment,
model varchar(50) NOT NULL,
color char(1) DEFAULT 'n' CHECK (color IN ('y', 'n')),
type varchar(10) NOT NULL CHECK (type IN ('Laser', 'Jet', 'Matrix')),
price int NOT NULL,
PRIMARY KEY (code),
FOREIGN KEY (model) REFERENCES product(model)
);
| {
"content_hash": "6533e7b567f3f109a3e6c24bb831557c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 73,
"avg_line_length": 25.066666666666666,
"alnum_prop": 0.6604609929078015,
"repo_name": "RakickayaKaterina/Java-training",
"id": "99cbf27c3c3dd30b54676d9e916f494a9685b90f",
"size": "1128",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "task10/1/createDB.sql",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "140"
},
{
"name": "Java",
"bytes": "804327"
}
],
"symlink_target": ""
} |
{% extends "manage/user/user_form.html" %}
{% block location %}Edit User{% endblock %}
{% block sectionid %}edit-user{% endblock %}
{% block formid %}user-edit-form{% endblock %}
{% block formtitle %}Edit User '{{ subject }}'{% endblock %}
{% block afterform %}
<div class="apikeys">
{% with subject.api_keys.active as apikeys %}
{% if apikeys %}
<h3>API Keys</h3>
<ul class="key-list">
{% for apikey in apikeys %}
<li>{{ apikey.key }}</li>
{% endfor %}
</ul>
{% else %}
<form action="{% url 'auth_create_apikey' user_id=subject.id %}" method="POST" id="create-apikey-form" class="apikey-form">
{% csrf_token %}
<button type="submit">generate an API key</button>
</form>
{% endif %}
{% endwith %}
</div>
{% endblock %}
| {
"content_hash": "349eeef5d50c85734012bc8a005cdd39",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 125,
"avg_line_length": 27.321428571428573,
"alnum_prop": 0.596078431372549,
"repo_name": "shinglyu/moztrap",
"id": "1228fbb98eac186f0d660a17348cf8ba86f0336c",
"size": "765",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "templates/manage/user/edit_user.html",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "713042"
},
{
"name": "HTML",
"bytes": "1056025"
},
{
"name": "JavaScript",
"bytes": "270285"
},
{
"name": "Python",
"bytes": "2088749"
},
{
"name": "Ruby",
"bytes": "464"
},
{
"name": "Shell",
"bytes": "867"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Foundation;
using UIKit;
using Xamarin.Forms;
using Hanselman.Portable.Helpers;
using Hanselman.iOS.Renderers;
using Xamarin.Forms.Platform.iOS;
using AVFoundation;
using System.Timers;
using CoreMedia;
[assembly: ExportCell(typeof(AudioPlayer), typeof(AudioPlayerRenderer))]
namespace Hanselman.iOS.Renderers
{
public class AudioPlayerRenderer : FrameRenderer
{
AVPlayer player;
Timer timer;
private AudioPlayer Player
{
get { return (AudioPlayer)this.Element;}
}
protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)
{
base.OnElementChanged(e);
if (Element == null)
return;
timer = new Timer(1000);
timer.Elapsed += timer_Elapsed;
if (string.IsNullOrWhiteSpace(Player.Url))
return;
InitPlayer();
}
private void InitPlayer()
{
if (player != null)
player.Pause();
player = AVPlayer.FromUrl(new NSUrl(Player.Url));
player.Play();
timer.Start();
}
protected override async void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if(e.PropertyName == AudioPlayer.UrlProperty.PropertyName)
{
InitPlayer();
}
else if (e.PropertyName == AudioPlayer.PlaybackStateProperty.PropertyName)
{
if (player == null)
return;
switch (Player.PlaybackState)
{
case 0:
player.Play();
timer.Start();
break;
case 1:
player.Pause();
timer.Stop();
break;
case 2:
player.Pause();
timer.Stop();
Player.Progress = 0.0M;
player.SeekAsync(new CoreMedia.CMTime(0, 1));
break;
}
}
else if(e.PropertyName == AudioPlayer.SeekToProperty.PropertyName)
{
if (player == null || player.CurrentItem == null)
return;
var newTime = CMTime.FromSeconds((double)(Player.SeekTo * (decimal)player.CurrentItem.Duration.Seconds), 1);
await player.SeekAsync(newTime);
if (Player.PlaybackState == 0)
player.Play();
}
}
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
if (player == null)
return;
Player.Progress = (decimal)(player.CurrentItem.CurrentTime.Seconds / player.CurrentItem.Duration.Seconds);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
player.Pause();
player.Dispose();
timer.Stop();
}
}
} | {
"content_hash": "7b5cc31219a24d8867fd0a80f50e2e09",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 123,
"avg_line_length": 24.580357142857142,
"alnum_prop": 0.6131492916818017,
"repo_name": "elkjaerit/Hanselman.Forms",
"id": "b47be37b5372ab1a1b6e769b699a100b8a057976",
"size": "2753",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Hanselman.iOS/Renderers/AudioPlayerRenderer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "89549"
}
],
"symlink_target": ""
} |
package com.netflix.servo.monitor;
import com.google.common.base.Function;
import com.google.common.cache.Cache;
import com.netflix.servo.DefaultMonitorRegistry;
import com.netflix.servo.annotations.DataSourceType;
import com.netflix.servo.annotations.MonitorTags;
import com.netflix.servo.tag.SortedTagList;
import com.netflix.servo.tag.TagList;
import com.netflix.servo.tag.TaggingContext;
import com.netflix.servo.util.Throwables;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* Some helper functions for creating monitor objects.
*/
public final class Monitors {
/** Name used for composite objects that do not have an explicit id. */
private static final String DEFAULT_ID = "default";
/** Function to create basic timers. */
private static class TimerFactory implements Function<MonitorConfig, Timer> {
private final TimeUnit unit;
public TimerFactory(TimeUnit unit) {
this.unit = unit;
}
public Timer apply(MonitorConfig config) {
return new BasicTimer(config, unit);
}
}
/** Function to create basic counters. */
private static class CounterFactory implements Function<MonitorConfig, Counter> {
public Counter apply(MonitorConfig config) {
return new BasicCounter(config);
}
}
private static final CounterFactory COUNTER_FUNCTION = new CounterFactory();
private Monitors() {
}
/**
* Create a new timer with only the name specified.
*/
public static Timer newTimer(String name) {
return newTimer(name, TimeUnit.MILLISECONDS);
}
/**
* Create a new timer with a name and context. The returned timer will maintain separate
* sub-monitors for each distinct set of tags returned from the context on an update operation.
*/
public static Timer newTimer(String name, TaggingContext context) {
return newTimer(name, TimeUnit.MILLISECONDS, context);
}
/**
* Create a new timer with only the name specified.
*/
public static Timer newTimer(String name, TimeUnit unit) {
return new BasicTimer(MonitorConfig.builder(name).build(), unit);
}
/**
* Create a new timer with a name and context. The returned timer will maintain separate
* sub-monitors for each distinct set of tags returned from the context on an update operation.
*/
public static Timer newTimer(String name, TimeUnit unit, TaggingContext context) {
final MonitorConfig config = MonitorConfig.builder(name).build();
return new ContextualTimer(config, context, new TimerFactory(unit));
}
/**
* Create a new counter instance.
*/
public static Counter newCounter(String name) {
return new BasicCounter(MonitorConfig.builder(name).build());
}
/**
* Create a new counter with a name and context. The returned counter will maintain separate
* sub-monitors for each distinct set of tags returned from the context on an update operation.
*/
public static Counter newCounter(String name, TaggingContext context) {
final MonitorConfig config = MonitorConfig.builder(name).build();
return new ContextualCounter(config, context, COUNTER_FUNCTION);
}
/**
* Helper function to easily create a composite for all monitor fields and
* annotated attributes of a given object.
*/
public static CompositeMonitor<?> newObjectMonitor(Object obj) {
return newObjectMonitor(null, obj);
}
/**
* Helper function to easily create a composite for all monitor fields and
* annotated attributes of a given object.
*
* @param id a unique id associated with this particular instance of the
* object. If multiple objects of the same class are registered
* they will have the same config and conflict unless the id
* values are distinct.
*
* @param obj object to search for monitors on. All fields of type
* {@link Monitor} and fields/methods with a
* {@link com.netflix.servo.annotations.Monitor} annotation
* will be extracted and returned using
* {@link CompositeMonitor#getMonitors()}.
*
* @return composite monitor based on the fields of the class
*/
public static CompositeMonitor<?> newObjectMonitor(String id, Object obj) {
final TagList tags = getMonitorTags(obj);
List<Monitor<?>> monitors = new ArrayList<Monitor<?>>();
addMonitors(monitors, id, tags, obj);
final Class<?> c = obj.getClass();
final String objectId = (id == null) ? DEFAULT_ID : id;
return new BasicCompositeMonitor(newObjectConfig(c, objectId, tags), monitors);
}
/**
* Creates a new monitor for a thread pool with standard metrics for the pool size, queue size,
* task counts, etc.
*
* @param id id to differentiate metrics for this pool from others.
* @param pool thread pool instance to monitor.
* @return composite monitor based on stats provided for the pool
*/
public static CompositeMonitor<?> newThreadPoolMonitor(String id, ThreadPoolExecutor pool) {
return newObjectMonitor(id, new MonitoredThreadPool(pool));
}
/**
* Creates a new monitor for a cache with standard metrics for the hits, misses, and loads.
*
* @param id id to differentiate metrics for this cache from others.
* @param cache cache instance to monitor.
* @return composite monitor based on stats provided for the cache
*/
public static CompositeMonitor<?> newCacheMonitor(String id, Cache<?, ?> cache) {
return newObjectMonitor(id, new MonitoredCache(cache));
}
/**
* Register an object with the default registry. Equivalent to
* {@code DefaultMonitorRegistry.getInstance().register(Monitors.newObjectMonitor(obj))}.
*/
public static void registerObject(Object obj) {
registerObject(null, obj);
}
/**
* Unregister an object from the default registry. Equivalent to
* {@code DefaultMonitorRegistry.getInstance().unregister(Monitors.newObjectMonitor(obj))}.
* @param obj Previously registered using {@code Monitors.registerObject(obj)}
*/
public static void unregisterObject(Object obj) {
unregisterObject(null, obj);
}
/**
* Unregister an object from the default registry. Equivalent to
* {@code DefaultMonitorRegistry.getInstance().unregister(Monitors.newObjectMonitor(id, obj))}.
* @param obj Previously registered using {@code Monitors.registerObject(id, obj)}
*/
public static void unregisterObject(String id, Object obj) {
DefaultMonitorRegistry.getInstance().unregister(newObjectMonitor(id, obj));
}
/**
* Register an object with the default registry. Equivalent to
* {@code DefaultMonitorRegistry.getInstance().register(Monitors.newObjectMonitor(id, obj))}.
*/
public static void registerObject(String id, Object obj) {
DefaultMonitorRegistry.getInstance().register(newObjectMonitor(id, obj));
}
/**
* Check whether an object is currently registered with the default registry.
*/
public static boolean isObjectRegistered(Object obj) {
return isObjectRegistered(null, obj);
}
/**
* Check whether an object is currently registered with the default registry.
*/
public static boolean isObjectRegistered(String id, Object obj) {
return DefaultMonitorRegistry.getInstance().isRegistered(newObjectMonitor(id, obj));
}
/**
* Returns a new monitor that adds the provided tags to the configuration returned by the
* wrapped monitor.
*/
@SuppressWarnings("unchecked")
static <T> Monitor<T> wrap(TagList tags, Monitor<T> monitor) {
Monitor<T> m;
if (monitor instanceof CompositeMonitor<?>) {
m = new CompositeMonitorWrapper<T>(tags, (CompositeMonitor<T>) monitor);
} else if (monitor instanceof NumericMonitor<?>) {
m = (Monitor<T>) new NumericMonitorWrapper(tags, (NumericMonitor<?>) monitor);
} else {
m = new MonitorWrapper<T>(tags, monitor);
}
return m;
}
/** Extract all monitors across class hierarchy. */
static void addMonitors(List<Monitor<?>> monitors, String id, TagList tags, Object obj) {
for (Class<?> c = obj.getClass(); c != null; c = c.getSuperclass()) {
addMonitorFields(monitors, id, tags, obj, c);
addAnnotatedFields(monitors, id, tags, obj, c);
}
}
/**
* Extract all fields of {@code obj} that are of type {@link Monitor} and add them to
* {@code monitors}.
*/
static void addMonitorFields(
List<Monitor<?>> monitors, String id, TagList tags, Object obj, Class<?> c) {
try {
final SortedTagList.Builder builder = SortedTagList.builder();
builder.withTag("class", className(obj.getClass()));
if (tags != null) {
builder.withTags(tags);
}
if (id != null) {
builder.withTag("id", id);
}
final TagList classTags = builder.build();
final Field[] fields = c.getDeclaredFields();
for (Field field : fields) {
if (isMonitorType(field.getType())) {
field.setAccessible(true);
final Monitor<?> m = (Monitor<?>) field.get(obj);
if (m == null) {
throw new NullPointerException("field " + field.getName()
+ " in class " + c.getName() + " is null, all monitor fields must be"
+ " initialized before registering");
}
monitors.add(wrap(classTags, m));
}
}
} catch (Exception e) {
throw Throwables.propagate(e);
}
}
/**
* Extract all fields/methods of {@code obj} that have a monitor annotation and add them to
* {@code monitors}.
*/
static void addAnnotatedFields(
List<Monitor<?>> monitors, String id, TagList tags, Object obj, Class<?> c) {
final Class<com.netflix.servo.annotations.Monitor> annoClass =
com.netflix.servo.annotations.Monitor.class;
try {
Field[] fields = c.getDeclaredFields();
for (Field field : fields) {
final com.netflix.servo.annotations.Monitor anno = field.getAnnotation(annoClass);
if (anno != null) {
final MonitorConfig config =
newConfig(obj.getClass(), field.getName(), id, anno, tags);
if (anno.type() == DataSourceType.INFORMATIONAL) {
monitors.add(new AnnotatedStringMonitor(config, obj, field));
} else {
checkType(anno, field.getType(), c);
monitors.add(new AnnotatedNumberMonitor(config, obj, field));
}
}
}
Method[] methods = c.getDeclaredMethods();
for (Method method : methods) {
final com.netflix.servo.annotations.Monitor anno = method.getAnnotation(annoClass);
if (anno != null) {
final MonitorConfig config =
newConfig(obj.getClass(), method.getName(), id, anno, tags);
if (anno.type() == DataSourceType.INFORMATIONAL) {
monitors.add(new AnnotatedStringMonitor(config, obj, method));
} else {
checkType(anno, method.getReturnType(), c);
monitors.add(new AnnotatedNumberMonitor(config, obj, method));
}
}
}
} catch (Exception e) {
throw Throwables.propagate(e);
}
}
/** Get tags from annotation. */
private static TagList getMonitorTags(Object obj) {
try {
Class<?> c = obj.getClass();
Field[] fields = c.getDeclaredFields();
for (Field field : fields) {
final MonitorTags anno = field.getAnnotation(MonitorTags.class);
if (anno != null) {
field.setAccessible(true);
return (TagList) field.get(obj);
}
}
Method[] methods = c.getDeclaredMethods();
for (Method method : methods) {
final MonitorTags anno = method.getAnnotation(MonitorTags.class);
if (anno != null) {
method.setAccessible(true);
return (TagList) method.invoke(obj);
}
}
} catch (Exception e) {
throw Throwables.propagate(e);
}
return null;
}
/** Verify that the type for the annotated field is numeric. */
private static void checkType(
com.netflix.servo.annotations.Monitor anno, Class<?> type, Class<?> container) {
if (!isNumericType(type)) {
final String msg = "annotation of type " + anno.type().name() + " can only be used"
+ " with numeric values, " + anno.name() + " in class " + container.getName()
+ " is applied to a field or method of type " + type.getName();
throw new IllegalArgumentException(msg);
}
}
/** Returns true if {@code c} can be assigned to a number. */
private static boolean isNumericType(Class<?> c) {
return Number.class.isAssignableFrom(c)
|| double.class == c
|| float.class == c
|| long.class == c
|| int.class == c
|| short.class == c
|| byte.class == c;
}
/** Returns true if {@code c} can be assigned to a monitor. */
private static boolean isMonitorType(Class<?> c) {
return Monitor.class.isAssignableFrom(c);
}
/** Creates a monitor config for a composite object. */
private static MonitorConfig newObjectConfig(Class<?> c, String id, TagList tags) {
MonitorConfig.Builder builder = MonitorConfig.builder(id);
builder.withTag("class", c.getSimpleName());
if (tags != null) {
builder.withTags(tags);
}
return builder.build();
}
private static String className(Class c) {
final String simpleName = c.getSimpleName();
return simpleName.isEmpty() ? className(c.getEnclosingClass()) : simpleName;
}
/** Creates a monitor config based on an annotation. */
private static MonitorConfig newConfig(
Class<?> c,
String defaultName,
String id,
com.netflix.servo.annotations.Monitor anno,
TagList tags) {
String name = anno.name();
if (name.isEmpty()) {
name = defaultName;
}
MonitorConfig.Builder builder = MonitorConfig.builder(name);
builder.withTag("class", className(c));
builder.withTag(anno.type());
builder.withTag(anno.level());
if (tags != null) {
builder.withTags(tags);
}
if (id != null) {
builder.withTag("id", id);
}
return builder.build();
}
}
| {
"content_hash": "d01de0fe9851f82a1a1013772495221d",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 99,
"avg_line_length": 38.669135802469135,
"alnum_prop": 0.6056445948534577,
"repo_name": "gorcz/servo",
"id": "6e4247937e64e98b3f18123b170e0c80606d1426",
"size": "16258",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1218210"
}
],
"symlink_target": ""
} |
{% extends "base.html" %}
{% load i18n %}
{% block navigation %}
<ul class="nav">
<li class="active"><a href="{% url campaign_list %}">{% trans "Active petitions" %}</a></li>
{% comment %}<li><a href="{% url petition_faq %}">{% trans "FAQ" %}</a></li>{% endcomment %}
</ul>
{% endblock navigation %}
{% block page-header %}
<h1>{% trans "Petitions" %}
<small>{% trans "List of current active petitions" %}</small>
</h1>
{% endblock page-header %}
{% block sidebar %}
<h3>{% trans "Stats" %}</h3>
<p>{% blocktrans %}We got {{ campaign_count }} active running petition(s).{% endblocktrans %}</p>
{% endblock sidebar %}
{% block content %}
<h2>{% trans "Available petitions" %}</h2>
<ul>
{% for campaign in campaigns %}
<li><a href="{% url campaign_details campaign.id %}">{{ campaign }}</a></li>
{% endfor %}
</ul>
{% endblock content %}
| {
"content_hash": "a24c027f10150c6cb9d0af6c949a198a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 101,
"avg_line_length": 28.84375,
"alnum_prop": 0.5471289274106176,
"repo_name": "norrs/onlinepetition",
"id": "a527df890f423915910c41761d195459ab0574e8",
"size": "923",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "onlinepetition/petition/templates/petition/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "37307"
}
],
"symlink_target": ""
} |
cd $HOME/pub_http_internet/bridge/walk_count/ice
mkdir -p ../databig
../count_walks slope=3/8 1-24 | right > ../databig/raw_counts_3_8.txt
| {
"content_hash": "79cdf4bbd1860d2736a7e458bc588928",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 69,
"avg_line_length": 46.333333333333336,
"alnum_prop": 0.7050359712230215,
"repo_name": "johnkerl/bridge-walk-count",
"id": "72108a704bb7c8fdce6e9864fdbf43b59f3e6e81",
"size": "580",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "ice/ice_3_8.sh",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "31097"
},
{
"name": "Python",
"bytes": "18371"
},
{
"name": "Shell",
"bytes": "19024"
},
{
"name": "VimL",
"bytes": "51"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/di-1"/>
| {
"content_hash": "8b551413c1c98f892e963f01295b3175",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 45,
"avg_line_length": 42.5,
"alnum_prop": 0.6588235294117647,
"repo_name": "KMax/jaxrs-cdi-example",
"id": "978b6493407fcb4ae1fc683395f520227fce8125",
"size": "85",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/webapp/META-INF/context.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "942"
}
],
"symlink_target": ""
} |
<?php
namespace Puli\Manager\Transaction;
/**
* An atomic operation.
*
* Atomic operations must not cause any side effects if their execution fails.
* Additionally, atomic operations support the method {@link rollback()} which
* undoes any side effects caused by {@link execute()}.
*
* @since 1.0
* @author Bernhard Schussek <[email protected]>
*/
interface AtomicOperation
{
/**
* Executes the operation.
*
* If the execution fails, this method must not cause any side effects in
* the system.
*/
public function execute();
/**
* Undoes the side effects of the operation.
*
* This method is called if the operation needs to be reverted. The method
* is only called if {@link execute()} completed successfully.
*/
public function rollback();
}
| {
"content_hash": "b6d2445a23c636a046d16dfb647abb89",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 24.323529411764707,
"alnum_prop": 0.6662636033857315,
"repo_name": "stof/manager",
"id": "edfc4c1d0916f021889b33097c9ffc9861027e0a",
"size": "1063",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Transaction/AtomicOperation.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "1383861"
}
],
"symlink_target": ""
} |
package com.xiaoleilu.hutool.convert.impl;
import com.xiaoleilu.hutool.convert.AbstractConverter;
import com.xiaoleilu.hutool.util.StrUtil;
/**
* 字符转换器
* @author Looly
*
*/
public class CharacterConverter extends AbstractConverter<Character>{
@Override
protected Character convertInternal(Object value) {
if(char.class == value.getClass()){
return Character.valueOf((char)value);
}else{
final String valueStr = convertToStr(value);
if (StrUtil.isNotBlank(valueStr)) {
try {
return Character.valueOf(valueStr.charAt(0));
} catch (Exception e) {
//Ignore Exception
}
}
}
return null;
}
}
| {
"content_hash": "b2a8163c629fedd62071d6448a52bf06",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 69,
"avg_line_length": 21.3,
"alnum_prop": 0.7057902973395931,
"repo_name": "hcxxiaomo/CarPlateNumber",
"id": "1b21e04786a8c5eb760487933b9292228981da9a",
"size": "649",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/xiaoleilu/hutool/convert/impl/CharacterConverter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "670260"
},
{
"name": "HTML",
"bytes": "498815"
},
{
"name": "Java",
"bytes": "1183590"
},
{
"name": "JavaScript",
"bytes": "685044"
}
],
"symlink_target": ""
} |
using System;
namespace Raksha.Asn1
{
public class DerBoolean
: Asn1Object
{
private readonly byte value;
public static readonly DerBoolean False = new DerBoolean(false);
public static readonly DerBoolean True = new DerBoolean(true);
/**
* return a bool from the passed in object.
*
* @exception ArgumentException if the object cannot be converted.
*/
public static DerBoolean GetInstance(
object obj)
{
if (obj == null || obj is DerBoolean)
{
return (DerBoolean) obj;
}
throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name);
}
/**
* return a DerBoolean from the passed in bool.
*/
public static DerBoolean GetInstance(
bool value)
{
return value ? True : False;
}
/**
* return a Boolean from a tagged object.
*
* @param obj the tagged object holding the object we want
* @param explicitly true if the object is meant to be explicitly
* tagged false otherwise.
* @exception ArgumentException if the tagged object cannot
* be converted.
*/
public static DerBoolean GetInstance(
Asn1TaggedObject obj,
bool isExplicit)
{
Asn1Object o = obj.GetObject();
if (isExplicit || o is DerBoolean)
{
return GetInstance(o);
}
return new DerBoolean(((Asn1OctetString)o).GetOctets());
}
public DerBoolean(
byte[] val)
{
if (val.Length != 1)
throw new ArgumentException("byte value should have 1 byte in it", "val");
// TODO Are there any constraints on the possible byte values?
this.value = val[0];
}
private DerBoolean(
bool value)
{
this.value = value ? (byte)0xff : (byte)0;
}
public bool IsTrue
{
get { return value != 0; }
}
internal override void Encode(
DerOutputStream derOut)
{
// TODO Should we make sure the byte value is one of '0' or '0xff' here?
derOut.WriteEncoded(Asn1Tags.Boolean, new byte[]{ value });
}
protected override bool Asn1Equals(
Asn1Object asn1Object)
{
DerBoolean other = asn1Object as DerBoolean;
if (other == null)
return false;
return IsTrue == other.IsTrue;
}
protected override int Asn1GetHashCode()
{
return IsTrue.GetHashCode();
}
public override string ToString()
{
return IsTrue ? "TRUE" : "FALSE";
}
}
}
| {
"content_hash": "4a9f885bb13e71255299978e7e888a54",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 87,
"avg_line_length": 24.345454545454544,
"alnum_prop": 0.5694548170276326,
"repo_name": "Everbytes/Raksha",
"id": "6fd365b2af7aa15ae87018fbd2bc0df9f5b4ad12",
"size": "2678",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Raksha.Shared/Asn1/DerBoolean.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "7135288"
},
{
"name": "PowerShell",
"bytes": "34903"
}
],
"symlink_target": ""
} |
SELECT DISTINCT CITY FROM STATION WHERE LOWER(RIGHT(CITY,1)) NOT IN ('a', 'e', 'o', 'u', 'i') | {
"content_hash": "fd4f15da5b2089ac51a46ca0d2d13214",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 93,
"avg_line_length": 93,
"alnum_prop": 0.6344086021505376,
"repo_name": "ebolat/HackerRank",
"id": "ece4ecda4a49596d2411fe06b828f1a129066848",
"size": "93",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SQL/Basic Select/Weather Observation Station 10/Solution.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "19626"
},
{
"name": "JavaScript",
"bytes": "3031"
}
],
"symlink_target": ""
} |
Just a tiny program for taking notes with a graphics tablet.
| {
"content_hash": "97d3e3374c84ccc03a475bd679b4a094",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 60,
"avg_line_length": 61,
"alnum_prop": 0.8032786885245902,
"repo_name": "bwr/tinynote",
"id": "1b8a8282d5bfea0c56a2c0c57843df6ce299f56e",
"size": "74",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "20374"
},
{
"name": "C++",
"bytes": "1503"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.