text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  <meta http-equiv="x-ua-compatible" content="ie=edge" />
  <title>Format and Print Image Properties @ ImageMagick</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  <meta name="application-name" content="ImageMagick"/>
  <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves."/>
  <meta name="application-url" content="https://www.imagemagick.org"/>
  <meta name="generator" content="PHP"/>
  <meta name="keywords" content="format, print, image, properties, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
  <meta name="rating" content="GENERAL"/>
  <meta name="robots" content="INDEX, FOLLOW"/>
  <meta name="generator" content="ImageMagick Studio LLC"/>
  <meta name="author" content="ImageMagick Studio LLC"/>
  <meta name="revisit-after" content="2 DAYS"/>
  <meta name="resource-type" content="document"/>
  <meta name="copyright" content="Copyright (c) 1999-2017 ImageMagick Studio LLC"/>
  <meta name="distribution" content="Global"/>
  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
  <link rel="canonical" href="https://www.imagemagick.org/script/escape.html"/>
  <link rel="icon" href="../images/wand.png"/>
  <link rel="shortcut icon" href="../images/wand.ico"/>
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700" />
  <link rel="stylesheet" href="css/magick.css"/>

      Home
      Download
      Tools
      Command-line
      Resources
      Develop
      Search
      Community

There are copious amounts of extra data associated with images (metadata), beyond the actual image pixels. This metadata can be useful, either for display, or for various calculations, or in modifying the behavior of later image processing operations.  You can utilize percent escapes in a number of options, for example in -format or in montage -label, to print various properties and other settings associated with an image.

    Profile Data
    Such as EXIF: data, containing focal lengths, exposures, dates, and in
        come cases GPS locations.

    Attributes
    These are directly involved with image data, and more commonly
        modified as part of normal image processing.  These include
        width, height, depth, image type (colorspace), timing delays, and
        background color. Most specific percent escapes is to access this
        information.

    Properties
    These are stored as a table of free form strings, and are (if possible)
        saved with the image (especially in MIFF and PNG image file formats).
        These include: Labels, Captions, Comments.

    Artifacts
    These are various operational (expert) settings that are saved for
        use by various operators, or by the user for future use.  It is just
        a table of free-form strings.  They are not saved with the image when
        written.  See Artifacts and Options below for details.

    Options
    Also operational (expert) settings that are saved for
        use by various operators, but are set globally for use by a whole
        image list (also not saved).  See Artifacts and Options below.

Percent Escape Handling

If you request a percent escape such as %[key] the setting
is looked for in the following order until the first match has been
found...

Handle special prefixes such as 'artifact:' 'option:' 'exif:', or
    'fx:'.  This includes and calculations and or globs of those prefixes such
    as 'exif:*' or 'artifact:*' (see below).

If key contains a glob pattern (but no known prefix)
    search free-form properties table.

If key is a special image 'attribute' name (see list
    above) return the associated or calculated image attribute.

Search for setting as a free-form 'property'

Search for setting as a free-form 'artifact'

Search for setting as a free-form 'option'

Replace escape with empty string, and perhaps produce a warning.

Remember, all long name forms of percent escapes are handled in a is case
insensitive manner.

As of IM v6.8.0-5 you can now access the Artifact and Option
free-form string tables directly, allowing you to override the above sequence,
and avoid accessing an attribute or property of the same name.

%[artifact:<var>setting</var>]
%[option:<var>setting</var>]

Single Letter Attribute Percent Escapes

Here are common single letter escapes (short form) is used to report the most
common attributes and properties of an image, such as: the image filename
filename, type, width, height.

    \n
    newline

    \r
    carriage return

    <
    less-than character.

    >
    greater-than character.

    &
    ampersand character.

    %%
    a percent sign

    %b
    file size of image read in

    %c
    comment meta-data property

    %d
    directory component of path

    %e
    filename extension or suffix

    %f
    filename (including suffix)

    %g
    layer canvas page geometry   (equivalent to "%Wx%H%X%Y")

    %h
    current image height in pixels

    %i
    image filename (note: becomes output filename for "info:")

    %k
    CALCULATED: number of unique colors

    %l
    label meta-data property

    %m
    image file format (file magic)

    %n
    number of images in current image sequence

    %o
    output filename  (used for delegates)

    %p
    index of image in current image list

    %q
    quantum depth (compile-time constant)

    %r
    image class and colorspace

    %s
    scene number (from input unless re-assigned)

    %t
    filename without directory or extension (suffix)

    %u
    unique temporary filename (used for delegates)

    %w
    current width in pixels

    %x
    x resolution (density)

    %y
    y resolution (density)

    %z
    image depth (as read in unless modified, image save depth)

    %A
    image transparency channel enabled (true/false)

    %C
    image compression type

    %D
    image GIF dispose method

    %G
    original image size (%wx%h; before any resizes)

    %H
    page (canvas) height

    %M
    Magick filename (original file exactly as given,  including read mods)

    %O
    page (canvas) offset ( = %X%Y )

    %P
    page (canvas) size ( = %Wx%H )

    %Q
    image compression quality ( 0 = default )

    %S
    ?? scenes ??

    %T
    image time delay (in centi-seconds)

    %U
    image resolution units

    %W
    page (canvas) width

    %X
    page (canvas) x offset (including sign)

    %Y
    page (canvas) y offset (including sign)

    %Z
    unique filename (used for delegates)

    %@
    CALCULATED: trim bounding box (without actually trimming)

    %#
    CALCULATED: 'signature' hash of image values

Here is a sample command and its output for an image with filename
bird.miff and whose width is 512 and height is 480.

-> identify -format "%m:%f %wx%h" bird.miff
MIFF:bird.miff 512x480

Note that all single letter percent escapes can also be used using long
form (from IM version 6.7.6-9, see next). For example %[f] is
equivalent to the %f short form.

WARNING: short form percent escapes are NOT performed when the percent
is after a number.  For example,  10%x10 does not expand the
%x as a percent escape.  If you specifically want to expand the
'x', use the long form which overrides this special case. EG:
10%[x]10.

Also be warned that calculated attributes can take some time to generate,
especially for large images.

Long Form Attribute Percent Escapes

In addition to the above specific and calculated attributes are recognized
when enclosed in braces (long form):

    %[base]
    base filename, no suffixes (as %t)

    %[caption]
    caption meta-data property

    %[caption:pointsize]
    returns the pointsize computed during caption: processing (as of IM 6.9.1-0)

    %[channels]
    ??? channels in use - colorspace ???

    %[colors]
    Number of unique colors in the image (as of IM 7.0.3.8)

    %[colorspace]
    Colorspace of Image Data (excluding transparency)

    %[compression]
    Image compression type (as of IM 7.0.3.8)

    %[copyright]
    ImageMagick Copyright String

    %[depth]
    depth of image for write (as input unless changed)

    %[deskew:angle]
    The deskew angle in degrees of rotation

    %[directory]
    directory part of filename (as %d)

    %[distortion]
    how well an image resembles a reference image (-compare)

    %[entropy]
    CALCULATED: entropy of the image

    %[extension]
    extension part of filename (as %e)

    %[gamma]
    value of image gamma

    %[group]
    ??? window group ???

    %[height]
    original height of image (when it was read in)

    %[interlace]
    Image interlace mode (as of IM 7.0.3.8)

    %[kurtosis]
    CALCULATED: kurtosis statistic of image

    %[label]
    label meta-data property

    %[label:pointsize]
    returns the pointsize computed during label: processing (as of IM 6.9.1-0)

    %[magick]
    coder used to read image (not the file suffix)

    %[max]
    CALCULATED: maximum value statistic of image

    %[mean]
    CALCULATED: average value statistic of image

    %[min]
    CALCULATED: minimum value statistic of image

    %[name]
    The original name of the image

    %[opaque]
    CALCULATED: is image fully-opaque?

    %[orientation]
    image orientation

    %[page]
    Virtual canvas (page) geometry

    %[profile:icc]
    ICC profile info

    %[profile:icm]
    ICM profile info

    %[profiles]
    list of any embedded profiles

    %[quality]
    Image quality value (as of IM 7.0.3.8)

    %[rendering-intent]
    Image rendering intent (as of IM 7.0.3.8)

    %[resolution.x]
    X density (resolution) without units

    %[resolution.y]
    Y density (resolution) without units

    %[scene]
    original scene number of image in input file

    %[size]
    original size of image (when it was read in)

    %[skewness]
    CALCULATED: skewness statistic of image

    %[standard-deviation]
    CALCULATED: standard deviation statistic of image

    %[type]
    CALCULATED: image type

    %[unique]
    unique temporary filename ???

    %[units]
    image resolution units

    %[version]
    Version Information of this running ImageMagick

    %[width]
    original width of image (when it was read in)

    %[zero]
    zero (unique filename for delegate use)

Properties

All other long forms of percent escapes (not single letter long form) are
handled in a case insensitive manner. Such escapes will will attempt to look
up that name specific data sources.

The primary search space (if not a specific attribute listed above) is
a free-form property string.  Such strings are associated and saved with
images, and are typically set using either the -set
CLI option (or API equivalent), or from special convenience options
(such as -label, -comment, -caption).

These convenience options are globally saved (as 'global options' so thay can
be set before images are read), and later are transfered to the property of
individual images, only when they are read in. At that time any internal
percent escape present is then handled.

To change a property of an image already in memory, you need to use -set.

Note that properties, like attributes (and profiles), are saved with
images when write, if the image file format allows.

Artifacts and Options

The previous percent escapes are associated with the primary Attributes and
Properties. Which is the original and primary focus of such percent escapes.

However there are many operational settings that are used by various
ImageMagick operators that can be useful to set and later access.  These
consist of per-image Artifacts, and Global options (associated with a list of
images, typically the current image list).

Note that the major difference between an artifact and a property is that
artifacts, being an internal operational setting, is not saved with images (if
such is possible).

For example when you use -define 'distort:viewport=100x100' you
are in fact generating a global option, which the -distort operator will use to modify its behavior (distorted output
image 'view').

An Option is essentually a Artifact that has been stored globally as part
of a list of images (specifically a 'Wand' of images). As such they are
identical, in that a Option, is simply a global Artifact for all the
associated images.

As such you can use -set 'option:distort:viewport' '100x100' to
achieve the same result of setting a Artifact for the disort operation to use.

Internal Handling of a Global Option...

The Core library ('MagickCore') does not generally directly understand
Global Options. As such, continuing the previous example, the
DistortImages() function only looks up an artifact to discover if
a 'viewport' has been provided to it.

How Global Options are used when a library function requests an Artifact is
one of the key differences between IMv6 and IMv7.

In ImageMagick version 6... before each operator, any global Options
are copied to per-image Artifacts, for every image in the current image list.
This allows various operators to find its operational 'defines' or Artifacts.

In ImageMagick version 7... sets a link back to the global options
data, so that if a specific per-image Artifact is not found , then it will
look for a equivalent global Option for that image list.  directly.  This
saves coping these free-form options into artifacts repeatally, and means you
can now separately define a global option for a list, and a individual
overriding artifact for a specific image in that list.

Note that many API's that do not use Wands (PerlMagick for example using
arrays of images rather than a Wand). In these API's you will not have Global
Options, only per-image Artifacts.

In summery a Global Option, if available, is equivalent to a per-image
Artifact.

Glob-Pattern Listing of Properties, Artifacts and Options

The <var>setting</var> can contain a glob pattern. As such you can
now list all free-form string properties, artifacts, and options, (but not
specific image attributes) using...

convert ... \
   -print "__Properties__\n%[*]" \
   -print "__Artifacts__\n%[artifact:*]" \
   -print "__Options__\n%[option:*]" \
   ...

 The format of glob patterns are very specific and as such is generally
only used to list specific settings, such as when debugging, rather than being
used for image processing use.

Calculated Percent Escape Prefixes

There are some special prefixes (before the first ':') which performs
calculations based on the user provided string that follows that prefix.  For
example you can do a numerical calculation use %[fx:...] to
evaluate the given FX expressions:

%[fx:<var>expression</var>]

Use pixel: to evaluate a pixel color as defined by the FX
expression:

%[pixel:<var>expression</var>]

Specific Profile Percent Escape Prefixes

You can also use the following special formatting syntax to print EXIF
mage meta-data that was included in the image read in:

%[EXIF:<var>tag</var>]

Choose <var>tag</var> from the following:

*  (print all EXIF tags, in keyword=data format)
!  (print all EXIF tags, in tag_number data format)
#hhhh (print data for EXIF tag #hhhh)
ImageWidth
ImageLength
BitsPerSample
Compression
PhotometricInterpretation
FillOrder
DocumentName
ImageDescription
Make
Model
StripOffsets
Orientation
SamplesPerPixel
RowsPerStrip
StripByteCounts
XResolution
YResolution
PlanarConfiguration
ResolutionUnit
TransferFunction
Software
DateTime
Artist
WhitePoint
PrimaryChromaticities
TransferRange
JPEGProc
JPEGInterchangeFormat
JPEGInterchangeFormatLength
YCbCrCoefficients
YCbCrSubSampling
YCbCrPositioning
ReferenceBlackWhite
CFARepeatPatternDim
CFAPattern
BatteryLevel
Copyright
ExposureTime
FNumber
IPTC/NAA
EXIFOffset
InterColorProfile
ExposureProgram
SpectralSensitivity
GPSInfo
ISOSpeedRatings
OECF
EXIFVersion
DateTimeOriginal
DateTimeDigitized
ComponentsConfiguration
CompressedBitsPerPixel
ShutterSpeedValue
ApertureValue
BrightnessValue
ExposureBiasValue
MaxApertureValue
SubjectDistance
MeteringMode
LightSource
Flash
FocalLength
MakerNote
UserComment
SubSecTime
SubSecTimeOriginal
SubSecTimeDigitized
FlashPixVersion
ColorSpace
EXIFImageWidth
EXIFImageLength
InteroperabilityOffset
FlashEnergy
SpatialFrequencyResponse
FocalPlaneXResolution
FocalPlaneYResolution
FocalPlaneResolutionUnit
SubjectLocation
ExposureIndex
SensingMethod
FileSource
SceneType

Surround the format specification with quotation marks to prevent your
shell from misinterpreting any spaces and square brackets.

The following special formatting syntax can be used to print IPTC
information contained in the file:

%[IPTC:<var>dataset</var>:<var>record</var>]

Select <var>dataset</var> and <var>record</var> from the following:

  Envelope Record
  1:00  Model Version
  1:05  Destination
  1:20  File Format
  1:22  File Format Version
  1:30  Service Identifier
  1:40  Envelope Number
  1:50  Product ID
  1:60  Envelope Priority
  1:70  Date Sent
  1:80  Time Sent
  1:90  Coded Character Set
  1:100  UNO (Unique Name of Object)
  1:120  ARM Identifier
  1:122  ARM Version

Application Record
  2:00  Record Version
  2:03  Object Type Reference
  2:05  Object Name (Title)
  2:07  Edit Status
  2:08  Editorial Update
  2:10  Urgency
  2:12  Subject Reference
  2:15  Category
  2:20  Supplemental Category
  2:22  Fixture Identifier
  2:25  Keywords
  2:26  Content Location Code
  2:27  Content Location Name
  2:30  Release Date
  2:35  Release Time
  2:37  Expiration Date
  2:38  Expiration Time
  2:40  Special Instructions
  2:42  Action Advised
  2:45  Reference Service
  2:47  Reference Date
  2:50  Reference Number
  2:55  Date Created
  2:60  Time Created
  2:62  Digital Creation Date
  2:63  Digital Creation Time
  2:65  Originating Program
  2:70  Program Version
  2:75  Object Cycle
  2:80  By-Line (Author)
  2:85  By-Line Title (Author Position) [Not used in Photoshop 7]
  2:90  City
  2:92  Sub-Location
  2:95  Province/State
  2:100  Country/Primary Location Code
  2:101  Country/Primary Location Name
  2:103  Original Transmission Reference
  2:105  Headline
  2:110  Credit
  2:115  Source
  2:116  Copyright Notice
  2:118  Contact
  2:120  Caption/Abstract
  2:122  Caption Writer/Editor
  2:125  Rasterized Caption
  2:130  Image Type
  2:131  Image Orientation
  2:135  Language Identifier
  2:150  Audio Type
  2:151  Audio Sampling Rate
  2:152  Audio Sampling Resolution
  2:153  Audio Duration
  2:154  Audio Outcue
  2:200  ObjectData Preview File Format
  2:201  ObjectData Preview File Format Version
  2:202  ObjectData Preview Data

Pre-ObjectData Descriptor Record
  7:10   Size Mode
  7:20   Max Subfile Size
  7:90   ObjectData Size Announced
  7:95   Maximum ObjectData Size

ObjectData Record
  8:10   Subfile

Post ObjectData Descriptor Record
  9:10   Confirmed ObjectData Size

Donate •
     Sitemap •
    Related •
    Security •
    Architecture

Back to top •
    Public Key •
    Contact Us

© 1999-2017 ImageMagick Studio LLC


text:
package com.way.weather.plugin.spider;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Map;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.way.weather.plugin.bean.AQI;
import com.way.weather.plugin.bean.Alerts;
import com.way.weather.plugin.bean.Alerts.Alert;
import com.way.weather.plugin.bean.Forecast;
import com.way.weather.plugin.bean.Index;
import com.way.weather.plugin.bean.IndexDetail;
import com.way.weather.plugin.bean.RealTime;
import com.way.weather.plugin.util.Tools;

public class WeatherController {
	public static AQI convertToNewAQI(String aqiInfo, String language,
			String pid) {
		try {
			AQI aqi = new AQI();
			JSONObject aqiJSONObject = new JSONObject(aqiInfo)
					.getJSONObject("aqi");
			aqi.setCity_code(pid);
			aqi.setPub_time(getAQITime(aqiJSONObject.getString("pub_time")));
			int aqiValue = WeatherUtilities.getAqi(aqiJSONObject
					.getString("aqi"));
			aqi.setAqi(aqiValue);
			aqi.setPm25(WeatherUtilities.getAqi(aqiJSONObject.getString("pm25")));
			aqi.setPm10(WeatherUtilities.getAqi(aqiJSONObject.getString("pm10")));
			aqi.setNo2(WeatherUtilities.getAqi(aqiJSONObject.getString("no2")));
			aqi.setSo2(WeatherUtilities.getAqi(aqiJSONObject.getString("so2")));
			aqi.setCo(WeatherConstants.NO_VALUE_FLAG.intValue());
			aqi.setO3(WeatherConstants.NO_VALUE_FLAG.intValue());
			aqi.setAqi_level(WeatherUtilities.getAqiLevel(aqiValue, language));
			aqi.setAqi_desc(WeatherUtilities.getAqiDesc(aqiValue, language));
			aqi.setSource(WeatherUtilities.getAQISource(language));
			aqi.setSpot(aqiJSONObject.getString("spot"));
			return aqi;
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	}

	public static Alerts convertToNewAlert(String alertInfo, String language) {
		try {
			ArrayList<Alert> alertLists = new ArrayList<Alert>();
			Alerts alerts = new Alerts();
			JSONArray alertJSONArray = new JSONObject(alertInfo)
					.getJSONArray("weatherinfo");
			for (int i = 0; i < alertJSONArray.length(); ++i) {
				JSONObject jsonObject = alertJSONArray.getJSONObject(i);
				Alerts.Alert alert = new Alerts.Alert();
				alert.setAbnormal(jsonObject.getString("abnormal"));
				alert.setDetail(jsonObject.getString("detail"));
				alert.setHoliday(jsonObject.getString("holiday"));
				alert.setLevel(jsonObject.getString("level"));
				alert.setPubTime(Long.valueOf(jsonObject.getLong("pub_time")));
				alert.setTitle(jsonObject.getString("title"));
				alertLists.add(alert);
			}
			alerts.setPid(language);
			alerts.setArryAlert(alertLists);
			return alerts;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public static Forecast convertToNewForecast(String forecastInfo,
			String language, String pid) {
		try {
			Forecast forecast = new Forecast();

			JSONObject forecastJSONObject = new JSONObject(forecastInfo);
			JSONObject forcastJSONObject = forecastJSONObject
					.getJSONObject("weatherinfo");

			JSONObject todayJSONObject = forecastJSONObject
					.getJSONObject("today");
			JSONObject yestodayJSONObject = forecastJSONObject
					.getJSONObject("yestoday");

			forecast.setPid(pid);
			forecast.setWinds(0, "");
			forecast.setWinds(1, WeatherUtilities.getWind(
					forcastJSONObject.getString("fx1"),
					forcastJSONObject.getString("fl1"), language));
			forecast.setWinds(2, WeatherUtilities.getWind(
					forcastJSONObject.getString("fx2"),
					forcastJSONObject.getString("fl2"), language));
			forecast.setWinds(3, WeatherUtilities.getWind(
					forcastJSONObject.getString("fx2"),
					forcastJSONObject.getString("fl3"), language));
			forecast.setWinds(4, WeatherUtilities.getWind(
					forcastJSONObject.getString("fx2"),
					forcastJSONObject.getString("fl4"), language));
			forecast.setWinds(5, WeatherUtilities.getWind(
					forcastJSONObject.getString("fx2"),
					forcastJSONObject.getString("fl5"), language));
			for (int i = 0; i < 6; ++i)
				forecast.setHumiditys(i,
						WeatherConstants.NO_VALUE_FLAG.intValue());
			WeatherUtilities.WeatherName[] weatherName = new WeatherUtilities.WeatherName[5];
			for (int i = 0; i < 5; ++i)
				weatherName[i] = WeatherUtilities.getWeatherName(
						forcastJSONObject.getString("weather" + (i + 1)),
						language);
			forecast.setWeatherNames(0, "");
			for (int i = 0; i < 5; ++i)
				forecast.setWeatherNames(i + 1, weatherName[i].getName());
			forecast.setWeatherNamesFrom(0,
					yestodayJSONObject.getString("weatherStart"));
			for (int i = 0; i < 5; ++i)
				forecast.setWeatherNamesFrom(i + 1, weatherName[i].getFrom());
			forecast.setWeatherNamesTo(0,
					yestodayJSONObject.getString("weatherEnd"));
			for (int i = 0; i < 5; ++i)
				forecast.setWeatherNamesTo(i + 1, weatherName[i].getTo());
			long forcastTime = getForcastTime(forcastJSONObject
					.getString("date_y")
					+ " "
					+ forcastJSONObject.getString("fchh"));
			forecast.setPubtime(forcastTime);
			long yestodayTime = Tools.getStartMillsInOneDay(Calendar
					.getInstance());// 待检测
			int[] forecastTemps = new int[12];
			for (int i = 0; i < 5; ++i) {
				String[] temps = forcastJSONObject.getString("temp" + (i + 1))
						.split("~");
				String[] minTemp = temps[0].split("℃");
				String[] maxTemp = temps[1].split("℃");
				forecastTemps[(i * 2)] = Integer.parseInt(minTemp[0]);
				forecastTemps[(1 + i * 2)] = Integer.parseInt(maxTemp[0]);
			}
			forecast.setTmpHighs(0, yestodayJSONObject.getInt("tempMax"));
			forecast.setTmpLows(0, yestodayJSONObject.getInt("tempMin"));
			// if (forecastTemps[0] < forecastTemps[1])
			// ;
			for (int i = 0; i < 5; ++i) {
				forecast.setTmpHighs(i + 1, forecastTemps[(i * 2)]);
				forecast.setTmpLows(i + 1, forecastTemps[(1 + i * 2)]);
			}
			if (forcastTime > yestodayTime)
				forecast.setTmpHighs(1, todayJSONObject.getInt("tempMax"));
			for (int i = 0; i < 6; ++i)
				forecast.setSunrise(i, Long.valueOf(Long.parseLong(String
						.valueOf(WeatherConstants.NO_VALUE_FLAG))));
			for (int i = 0; i < 6; ++i)
				forecast.setSunset(i, Long.valueOf(Long.parseLong(String
						.valueOf(WeatherConstants.NO_VALUE_FLAG))));
			for (int i = 0; i < 6; ++i)
				forecast.setPressures(i,
						WeatherConstants.NO_VALUE_FLAG.intValue());
			// Log.i("way", forecast.toString());
			for (int i = 0; i < 6; i++)
				forecast.setType(i, WeatherUtilities.getAnimationType(forecast
						.getWeatherNamesTo(i)));
			return forecast;
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	}

	public static Index convertToNewIndex(String indexInfo, String language,
			String pid) {
		try {
			Index index = new Index();
			index.setCity_code(pid);

			JSONObject indexJSONObject = new JSONObject(indexInfo)
					.getJSONObject("weatherinfo");
			// Log.i("way", indexJSONObject.toString());
			ArrayList<IndexDetail> indexDetailLists = new ArrayList<IndexDetail>();
			IndexDetail windIndexDetail = new IndexDetail();
			windIndexDetail.setDesc(WeatherUtilities.getWind(
					indexJSONObject.getString("fx1"),
					indexJSONObject.getString("fl1"), language));
			windIndexDetail.setTitle("风力指数");
			windIndexDetail.setDetail(WeatherUtilities.getWindIndexDetail(
					indexJSONObject.getString("fl1"), language));
			windIndexDetail.setType(WeatherUtilities.getIndexType("风力指数")
					.intValue());
			indexDetailLists.add(windIndexDetail);

			for (Map.Entry<String, String> entry : WeatherConstants.INDEX_OLD
					.entrySet()) {
				String key = entry.getKey();
				IndexDetail indexDetail = new IndexDetail();
				indexDetail.setType(WeatherUtilities.getIndexType(key)
						.intValue());
				indexDetail.setTitle(WeatherUtilities.getIndexTitle(key,
						language));
				String indexValue = indexJSONObject
						.getString(WeatherConstants.INDEX_OLD.get(key));
				indexDetail.setDesc(WeatherUtilities.getIndexDesc(key,
						indexValue, language));

				indexDetail.setDetail(WeatherUtilities.getIndexDetail(key,
						indexValue, language));

				indexDetailLists.add(indexDetail);
			}
			index.setIndex(indexDetailLists);
			return index;
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	}

	public static RealTime convertToNewRealTime(String realTimeInfo,
			String language, String pid) {
		try {
			RealTime realTime = new RealTime();
			JSONObject realTimeJSONObject = new JSONObject(realTimeInfo)
					.getJSONObject("weatherinfo");
			realTime.setCity_code(pid);
			realTime.setPub_time(parseTime(realTimeJSONObject.getString("time")));
			realTime.setTemp(WeatherUtilities.getIntFromJSON(
					realTimeJSONObject, "temp"));
			realTime.setWind(WeatherUtilities.getWind(
					realTimeJSONObject.getString("WD"),
					realTimeJSONObject.getString("WS"), language));
			realTime.setAnimation_type(WeatherUtilities
					.getAnimationType(realTimeJSONObject.getString("weather")));
			realTime.setHumidity(WeatherUtilities
					.getHumidity(realTimeJSONObject.getString("SD")));
			realTime.setRising_tide(WeatherConstants.NO_VALUE_FLAG.intValue());
			realTime.setFalling_tide(WeatherConstants.NO_VALUE_FLAG.intValue());
			realTime.setPressure(WeatherConstants.NO_VALUE_FLAG.intValue());
			realTime.setWater(WeatherConstants.NO_VALUE_FLAG.intValue());
			realTime.setWeather_name(WeatherUtilities.getWeatherName(
					realTimeJSONObject.getString("weather"), language)
					.getName());
			return realTime;
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	}

	private static long getAQITime(String timeStr) {
		long aqiTime = -7754570281926000640L;
		try {
			aqiTime = new SimpleDateFormat("yyyy-MM-dd HH:00").parse(timeStr)
					.getTime();
		} catch (Exception e) {
		}
		return aqiTime;
	}

	private static long getForcastTime(String timeStr) {
		long forcastTime = -7754570281926000640L;
		try {
			forcastTime = new SimpleDateFormat("yyyy年M月d日 HH").parse(timeStr)
					.getTime();

		} catch (Exception e) {
		}
		return forcastTime;
	}

	private static long parseTime(String timeStr) {
		Calendar calendar1 = Calendar.getInstance();
		String[] arrayOfString = timeStr.split(":");
		// (60 * Integer.parseInt(arrayOfString[0]) +
		// Integer.parseInt(arrayOfString[1]));
		int i = Integer.parseInt(arrayOfString[0]);
		int j = Integer.parseInt(arrayOfString[1]);
		Long localLong = Long.valueOf(calendar1.getTimeInMillis());
		if (i - calendar1.get(11) > 2)
			localLong = Long.valueOf(localLong.longValue() - 24 * 60 * 60
					* 1000L);
		Calendar calendar2 = Calendar.getInstance();
		calendar2.setTimeInMillis(localLong.longValue());
		calendar2.set(11, i);
		calendar2.set(12, j);
		return calendar2.getTimeInMillis();
	}
}

redpajama_set_name: RedPajamaGithub


text:
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Seminar</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

Department of Mathematics

Indian Institute of Science

Bangalore 560 012

SEMINAR

    Speaker

    :

 Prof. Abhishek Banerjee

    Affiliation

    :

     Ohio State University, U.S.A.

    Subject Area

    :

    Mathematics

    Venue

    :

     TO BE ANNOUNCED

    Time

    :

4.00-5.00 p.m.

    Date

    :

February27, 2012 (Monday)

    Title

    :

"Lifting of model structures to fibred categories"

    Abstract

    :

 A fibred category consists of a functor $p:\mathbf N\longrightarrow \mathbf M$ between categories $\mathbf N$ and $\mathbf M$ such that
 objects of $\mathbf N$ may be "pulled back along any arrow of $\mathbf M$". Given a fibred category $p:\mathbf N\longrightarrow \mathbf M$
 and a model structure on the "base category" $\mathbf M$, we show that there exists a lifting of the model structure on $\mathbf M$ to a
 model structure on $\mathbf N$. We will refer to such a system as a "fibred model category" and give several examples of such structures.
 We show that, under certain conditions, right homotopies of maps in the base category $\mathbf M$ may  be lifted to right homotopic maps
 in the fibred category. Further, we show that these lifted model structures are well behaved with respect to Quillen adjunctions and Quillen
 equivalences. Finally, we show that if $\mathbf N$ and $\mathbf M$ carry compatible closed monoidal structures and the functor $p$ commutes
 with colimits, then a Quillen pair on $\mathbf M$ lifts to a Quillen pair on $\mathbf N$.


text:
	// Prefix file for Windows build
#ifdef WINVER
  #include "ctor.h"
#endif

// ===========================================================================

#include "StResourceContext.h"

// ===========================================================================
//		* Class variables
// ===========================================================================

Int16 StResourceContext::sAppContext = ::CurResFile();
StResourceContext* StResourceContext::sCurrentContext = nil;

// ===========================================================================

#pragma mark *** StResourceContext ***

// ---------------------------------------------------------------------------
//		* StResourceContext
// ---------------------------------------------------------------------------
//	Constructor, specifying the resource context to enter by using a refnum.
//	Destructor will revert to the existing resource context.

StResourceContext::StResourceContext(
	Int16 inContext)
{
	mThisContext = inContext;
	mIsValid = (mThisContext != ResourceContext_NoFile);
	mInContext = false;
	mSavedContext = false;
	mSaveContext = nil;
	Enter();
}

// ---------------------------------------------------------------------------
//		* ~StResourceContext
// ---------------------------------------------------------------------------
//	Make sure that CurResFile is returned to its initial state.

StResourceContext::~StResourceContext()
{
	Exit();
}

// ===========================================================================

#pragma mark -
#pragma mark ** CurResFile changers

// ---------------------------------------------------------------------------
//		* Enter
// ---------------------------------------------------------------------------
//	Enter this resource file's context.

void
StResourceContext::Enter()
{

	// Update current context pointer.

	mSaveContext = sCurrentContext;
	sCurrentContext = this;
	mInContext = true;
	mPrevContext = ::CurResFile();

	// Set new context (if necessary).

	if (IsValid())
		::UseResFile(mThisContext);

}

// ---------------------------------------------------------------------------
//		* Exit
// ---------------------------------------------------------------------------
//	Leave this resource file's context & go back to whatever we had before.

void
StResourceContext::Exit()
{

	// Update current context pointer.

	if (InContext() && (mSaveContext)) {
		sCurrentContext = mSaveContext;
		mSaveContext = nil;
	}

	// If we switched the resource context, switch it back.

	if (mSavedContext || (IsValid() && InContext()))
		::UseResFile(mPrevContext);

	// Now remember that we left context.

	mInContext = false;

}

// ---------------------------------------------------------------------------
//		* Save
// ---------------------------------------------------------------------------
//	Save the current resource context so when we Exit()
//	the current context is restored.

void
StResourceContext::Save()
{

	// Make sure we don't already have a context sitting around.

	Exit();

	// Now save the current context.

	mPrevContext = ::CurResFile();
	mThisContext = -1;
	mSavedContext = true;
	mIsValid = false;

}

// ===========================================================================

#pragma mark -
#pragma mark ** status accessors

// ---------------------------------------------------------------------------
//		* CurrentContextIsValid									[static]
// ---------------------------------------------------------------------------

Boolean
StResourceContext::CurrentContextIsValid()
{
	if (!sCurrentContext)
		return false;
	return sCurrentContext->IsValid();
}

// ---------------------------------------------------------------------------
//		* GetCurrentRefNum										[static]
// ---------------------------------------------------------------------------
//	Return the refnum for the current resource file context.

Int16
StResourceContext::GetCurrentRefNum()
{
	if (!sCurrentContext)
		return 0;
	return sCurrentContext->mThisContext;
}


text:
//  See http://www.boost.org/libs/test for the library home page.
//
//  File        : $RCSfile$
//
//  Version     : $Revision$
//
//  Description : unit test for string comparison specializations
// *****************************************************************************

#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/utils/is_cstring.hpp>

BOOST_AUTO_TEST_CASE( check_is_cstring_concept )
{
  namespace bp = boost::unit_test;
  BOOST_TEST((bp::is_cstring<char const*>::value));
  BOOST_TEST((bp::is_cstring<char const []>::value));
  BOOST_TEST((bp::is_cstring<char []>::value));
  BOOST_TEST((bp::is_cstring<char *>::value));
}

//____________________________________________________________________________//

BOOST_AUTO_TEST_CASE( check_string_compare )
{
    char const* buf_ptr_cch     = "abc";
    char const  buf_array_cch[] = "abc";
    char        buf_array_ch[]  = "abc";
    char*       buf_ptr_ch      = buf_array_ch;
    std::string buf_str         = "abc";

    BOOST_TEST((void*)buf_ptr_cch != (void*)buf_array_cch);
    BOOST_TEST((void*)buf_ptr_cch != (void*)buf_array_ch);
    BOOST_TEST((void*)buf_array_cch != (void*)buf_array_ch);

    BOOST_TEST(buf_ptr_cch == buf_ptr_cch);
    BOOST_TEST(buf_ptr_cch == buf_array_cch);
    BOOST_TEST(buf_ptr_cch == buf_ptr_ch);
    BOOST_TEST(buf_ptr_cch == buf_array_ch);
    BOOST_TEST(buf_ptr_cch == buf_str);

#ifndef BOOST_TEST_MACRO_LIMITED_SUPPORT
    BOOST_TEST(buf_array_cch == buf_ptr_cch);
    BOOST_TEST(buf_array_cch == buf_array_cch);
    BOOST_TEST(buf_array_cch == buf_ptr_ch);
    BOOST_TEST(buf_array_cch == buf_array_ch);
    BOOST_TEST(buf_array_cch == buf_str);
#endif

    BOOST_TEST(buf_ptr_ch == buf_ptr_cch);
    BOOST_TEST(buf_ptr_ch == buf_array_cch);
    BOOST_TEST(buf_ptr_ch == buf_ptr_ch);
    BOOST_TEST(buf_ptr_ch == buf_array_ch);
    BOOST_TEST(buf_ptr_ch == buf_str);

#ifndef BOOST_TEST_MACRO_LIMITED_SUPPORT
    BOOST_TEST(buf_array_ch == buf_ptr_cch);
    BOOST_TEST(buf_array_ch == buf_array_cch);
    BOOST_TEST(buf_array_ch == buf_ptr_ch);
    BOOST_TEST(buf_array_ch == buf_array_ch);
    BOOST_TEST(buf_array_ch == buf_str);
#endif

    BOOST_TEST(buf_str == buf_ptr_cch);
    BOOST_TEST(buf_str == buf_array_cch);
    BOOST_TEST(buf_str == buf_ptr_ch);
    BOOST_TEST(buf_str == buf_array_ch);
    BOOST_TEST(buf_str == buf_str);
}

// EOF


text:
  Fleurey-lès-Saint-Loup est
       un village
       géographiquement positionné dans le département de Haute-Saône en Franche-Comté. Elle totalisait 157 habitants en 2008.

À proximité de Fleurey-lès-Saint-Loup sont positionnées géographiquement les communes de
Cuve à 5 km, 151 habitants,
Anjeux située à 7 km, 165 habitants,
La Pisseure à 7 km, 40 habitants,
Magnoncourt située à 2 km, 441 habitants,
Le Clerjus située à 5 km, 556 habitants,
Fontaine-lès-Luxeuil située à 7 km, 1 470 habitants,
 entre autres. De plus, Fleurey-lès-Saint-Loup est située à seulement 24 km de Remiremont.

Si vous pensez venir habiter à Fleurey-lès-Saint-Loup, vous pourrez aisément trouver une maison à vendre.

Le nombre d'habitations, à Fleurey-lès-Saint-Loup, se décomposait en 2011 en un appartements et 63 maisons soit
 un marché plutôt équilibré.


text:
// Type definitions for moviedb
// Project: https://github.com/cavestri/themoviedb-javascript-library
// Definitions by: Erik Vullings
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module MovieDB {
    export interface IMovieDB {
        searchMovie(params: SearchOptions, callback: (err: any, movies: SearchResults) => void): void;
        movieInfo(options: InfoOptions, callback: (err: any, curMovie: Movie) => void): void;
        movieCasts(options: InfoOptions, callback: (err: any, casts: CastCrew) => void): void;
        personInfo(options: InfoOptions, callback: (err: any, info: PersonInfo) => void): void;
    }

    export interface SearchOptions {
        query: string;
    }

    export interface InfoOptions {
        id: number;
    }

    export interface SearchResults {
        page         : number;
        results      : SearchResult[];
        total_Pages  : number;
        total_results: number;
    }

    export interface SearchResult {
        adult         : boolean;
        backdrop_path : string;
        id            : number;
        original_title: string;
        release_date  : Date;
        poster_path   : string;
        popularity    : number;
        title         : string;
        vote_average  : number;
        vote_count    : number;
    }

    export interface Movie {
        collection           : string
        adult                : boolean;
        backdrop_path        : string;
        belongs_to_collection: any;
        budget               : number;
        genres               : Genre[];
        homepage             : string;
        id                   : number;
        imdb_id              : number;
        original_title       : string;
        overview             : string;
        popularity           : number;
        poster_path          : string;
        production_companies : ProductionCompany[];
        production_countries : ProductionCountry[];
        release_date         : Date;
        revenue              : number;
        runtime              : number;
        spoken_languages     : SpokenLanguage[];
        status               : string;
        tagline              : string;
        title                : string;
        vote_average         : number;
        vote_count           : number;
        // My own additions
        videoFile            : string;
        castCrew             : CastCrew;
    }

    export interface CastCrew {
        cast : Cast[];
        crew : Crew[];
    }

    export interface Cast {
        cast_id     : number;
        character   : string;
        credit_id   : string;
        id          : number;
        name        : string;
        order       : number;
        profile_path: string;
    }

    export interface Crew {
        cast_id     : number;
        department  : string;
        credit_id   : string;
        id          : number;
        name        : string;
        job         : string;
        profile_path: string;
    }

    export interface PersonInfo {
        adult         : boolean;
        also_known_as : string[];
        biography     : string;
        birthday      : Date;
        deathday      : Date;
        homepage      : string;
        id            : number;
        imbd_id       : string;
        name          : string;
        place_of_birth: any;
        popularity    : number;
        profile_path  : string;
    }

    export interface Genre {
        id  : number;
        name: string;
    }

    export interface ProductionCompany {
        id  : number;
        name: string;
    }

    export interface ProductionCountry {
        iso_3166_1: number;
        name      : string;
    }

    export interface SpokenLanguage {
        iso_639_1: number;
        name     : string;
    }

    //export interface Person {
    //    info :
    //}
    //     , "person" : {
    //        "Info" : { "resource": "person/:id", "method": "get" }
    //      , "Credits" : { "resource": "person/:id/credits", "method": "get" }
    //      , "Images" : { "resource": "person/:id/images", "method": "get" }
    //      , "Changes" : { "resource": "person/:id/changes", "method": "get" }
    //      , "Latest" : { "resource": "person/latest", "method": "get" }

}

declare module 'moviedb' {
    function apiKeyAcceptor(key: string): MovieDB.IMovieDB;
    export = apiKeyAcceptor;
}


text:
#ifndef avro_Codec_hh__
#define avro_Codec_hh__

#include "array"
#include <algorithm>
#include <map>
#include <string>
#include <vector>

#include "boost/blank.hpp"

#include "AvroTraits.hh"
#include "Config.hh"
#include "Decoder.hh"
#include "Encoder.hh"

/**
 * A bunch of templates and specializations for encoding and decoding
 * specific types.
 *
 * Primitive AVRO types BOOLEAN, INT, LONG, FLOAT, DOUBLE, STRING and BYTES
 * get decoded to and encoded from C++ types bool, int32_t, int64_t, float,
 * double, std::string and std::vector<uint8_t> respectively. In addition,
 * std::vector<T> for arbitrary type T gets encoded as an Avro array of T.
 * Similarly, std::map<std::string, T> for arbitrary type T gets encoded
 * as an Avro map with value type T.
 *
 * Users can have their custom types encoded/decoded by specializing
 * avro::codec_traits class for their types.
 */
namespace avro {

typedef boost::blank null;

template<typename T>
void encode(Encoder &e, const T &t);
template<typename T>
void decode(Decoder &d, T &t);

/**
 * Codec_traits tells avro how to encode and decode an object of given type.
 *
 * The class is expected to have two static methods:
 * \li static void encode(Encoder& e, const T& value);
 * \li static void decode(Decoder& e, T& value);
 * The default is empty.
 */
template<typename T>
struct codec_traits;

/**
 * codec_traits for Avro boolean.
 */
template<>
struct codec_traits<bool> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, bool b) {
        e.encodeBool(b);
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, bool &b) {
        b = d.decodeBool();
    }
};

/**
 * codec_traits for Avro int.
 */
template<>
struct codec_traits<int32_t> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, int32_t i) {
        e.encodeInt(i);
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, int32_t &i) {
        i = d.decodeInt();
    }
};

/**
 * codec_traits for Avro long.
 */
template<>
struct codec_traits<int64_t> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, int64_t l) {
        e.encodeLong(l);
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, int64_t &l) {
        l = d.decodeLong();
    }
};

/**
 * codec_traits for Avro float.
 */
template<>
struct codec_traits<float> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, float f) {
        e.encodeFloat(f);
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, float &f) {
        f = d.decodeFloat();
    }
};

/**
 * codec_traits for Avro double.
 */
template<>
struct codec_traits<double> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, double d) {
        e.encodeDouble(d);
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, double &dbl) {
        dbl = d.decodeDouble();
    }
};

/**
 * codec_traits for Avro string.
 */
template<>
struct codec_traits<std::string> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, const std::string &s) {
        e.encodeString(s);
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, std::string &s) {
        s = d.decodeString();
    }
};

/**
 * codec_traits for Avro bytes.
 */
template<>
struct codec_traits<std::vector<uint8_t>> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, const std::vector<uint8_t> &b) {
        e.encodeBytes(b);
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, std::vector<uint8_t> &s) {
        d.decodeBytes(s);
    }
};

/**
 * codec_traits for Avro fixed.
 */
template<size_t N>
struct codec_traits<std::array<uint8_t, N>> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, const std::array<uint8_t, N> &b) {
        e.encodeFixed(b.data(), N);
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, std::array<uint8_t, N> &s) {
        std::vector<uint8_t> v(N);
        d.decodeFixed(N, v);
        std::copy(v.data(), v.data() + N, s.data());
    }
};

/**
 * codec_traits for Avro arrays.
 */
template<typename T>
struct codec_traits<std::vector<T>> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, const std::vector<T> &b) {
        e.arrayStart();
        if (!b.empty()) {
            e.setItemCount(b.size());
            for (typename std::vector<T>::const_iterator it = b.begin();
                 it != b.end(); ++it) {
                e.startItem();
                avro::encode(e, *it);
            }
        }
        e.arrayEnd();
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, std::vector<T> &s) {
        s.clear();
        for (size_t n = d.arrayStart(); n != 0; n = d.arrayNext()) {
            for (size_t i = 0; i < n; ++i) {
                T t;
                avro::decode(d, t);
                s.push_back(std::move(t));
            }
        }
    }
};

typedef codec_traits<std::vector<bool>::const_reference> bool_codec_traits;

template<>
struct codec_traits<std::conditional<avro::is_not_defined<bool_codec_traits>::value,
                                     std::vector<bool>::const_reference, void>::type> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, std::vector<bool>::const_reference b) {
        e.encodeBool(b);
    }
};

/**
 * codec_traits for Avro maps.
 */
template<typename T>
struct codec_traits<std::map<std::string, T>> {
    /**
     * Encodes a given value.
     */
    static void encode(Encoder &e, const std::map<std::string, T> &b) {
        e.mapStart();
        if (!b.empty()) {
            e.setItemCount(b.size());
            for (typename std::map<std::string, T>::const_iterator
                     it = b.begin();
                 it != b.end(); ++it) {
                e.startItem();
                avro::encode(e, it->first);
                avro::encode(e, it->second);
            }
        }
        e.mapEnd();
    }

    /**
     * Decodes into a given value.
     */
    static void decode(Decoder &d, std::map<std::string, T> &s) {
        s.clear();
        for (size_t n = d.mapStart(); n != 0; n = d.mapNext()) {
            for (size_t i = 0; i < n; ++i) {
                std::string k;
                avro::decode(d, k);
                T &t = s[std::move(k)];
                avro::decode(d, t);
            }
        }
    }
};

/**
* codec_traits for Avro null.
*/
template<>
struct codec_traits<avro::null> {
    /**
    * Encodes a given value.
    */
    static void encode(Encoder &e, const avro::null &) {
        e.encodeNull();
    }

    /**
    * Decodes into a given value.
    */
    static void decode(Decoder &d, avro::null &) {
        d.decodeNull();
    }
};

/**
 * Generic encoder function that makes use of the codec_traits.
 */
template<typename T>
void encode(Encoder &e, const T &t) {
    codec_traits<T>::encode(e, t);
}

/**
 * Generic decoder function that makes use of the codec_traits.
 */
template<typename T>
void decode(Decoder &d, T &t) {
    codec_traits<T>::decode(d, t);
}

} // namespace avro

#endif // avro_Codec_hh__


text:
package monifu.reactive.internals.operators

import monifu.reactive.Observable
import scala.concurrent.duration.Duration.Zero

object TakeLeftSuite extends BaseOperatorSuite {
  def sum(sourceCount: Int): Long = sourceCount.toLong * (sourceCount + 1) / 2
  def count(sourceCount: Int) = sourceCount

  def createObservable(sourceCount: Int) = {
    require(sourceCount > 0, "sourceCount should be strictly positive")
    Some {
      val o = if (sourceCount == 1)
        Observable.range(1, 10).take(1)
      else
        Observable.range(1, sourceCount * 2).take(sourceCount)

      Sample(o, count(sourceCount), sum(sourceCount), Zero, Zero)
    }
  }

  def observableInError(sourceCount: Int, ex: Throwable) = {
    require(sourceCount > 0, "sourceCount should be strictly positive")
    Some {
      val o = if (sourceCount == 1)
        createObservableEndingInError(Observable.range(1, 2), ex)
          .take(2)
      else
        createObservableEndingInError(Observable.range(1, sourceCount), ex)
          .take(sourceCount)

      Sample(o, count(sourceCount-1), sum(sourceCount-1), Zero, Zero)
    }
  }

  def brokenUserCodeObservable(sourceCount: Int, ex: Throwable) =
    None
}


text:
package org.apache.spark.sql.catalyst.expressions

import org.apache.spark.SparkFunSuite
import org.apache.spark.sql.catalyst.dsl.expressions._
import org.apache.spark.sql.catalyst.expressions.codegen.CodegenContext
import org.apache.spark.sql.types._

class ConditionalExpressionSuite extends SparkFunSuite with ExpressionEvalHelper {

  test("if") {
    val testcases = Seq[(java.lang.Boolean, Integer, Integer, Integer)](
      (true, 1, 2, 1),
      (false, 1, 2, 2),
      (null, 1, 2, 2),
      (true, null, 2, null),
      (false, 1, null, null),
      (null, null, 2, 2),
      (null, 1, null, null)
    )

    // dataType must match T.
    def testIf(convert: (Integer => Any), dataType: DataType): Unit = {
      for ((predicate, trueValue, falseValue, expected) <- testcases) {
        val trueValueConverted = if (trueValue == null) null else convert(trueValue)
        val falseValueConverted = if (falseValue == null) null else convert(falseValue)
        val expectedConverted = if (expected == null) null else convert(expected)

        checkEvaluation(
          If(Literal.create(predicate, BooleanType),
            Literal.create(trueValueConverted, dataType),
            Literal.create(falseValueConverted, dataType)),
          expectedConverted)
      }
    }

    testIf(_ == 1, BooleanType)
    testIf(_.toShort, ShortType)
    testIf(identity, IntegerType)
    testIf(_.toLong, LongType)

    testIf(_.toFloat, FloatType)
    testIf(_.toDouble, DoubleType)
    testIf(Decimal(_), DecimalType.USER_DEFAULT)

    testIf(identity, DateType)
    testIf(_.toLong, TimestampType)

    testIf(_.toString, StringType)

    DataTypeTestUtils.propertyCheckSupported.foreach { dt =>
      checkConsistencyBetweenInterpretedAndCodegen(If, BooleanType, dt, dt)
    }
  }

  test("case when") {
    val row = create_row(null, false, true, "a", "b", "c")
    val c1 = 'a.boolean.at(0)
    val c2 = 'a.boolean.at(1)
    val c3 = 'a.boolean.at(2)
    val c4 = 'a.string.at(3)
    val c5 = 'a.string.at(4)
    val c6 = 'a.string.at(5)

    checkEvaluation(CaseWhen(Seq((c1, c4)), c6), "c", row)
    checkEvaluation(CaseWhen(Seq((c2, c4)), c6), "c", row)
    checkEvaluation(CaseWhen(Seq((c3, c4)), c6), "a", row)
    checkEvaluation(CaseWhen(Seq((Literal.create(null, BooleanType), c4)), c6), "c", row)
    checkEvaluation(CaseWhen(Seq((Literal.create(false, BooleanType), c4)), c6), "c", row)
    checkEvaluation(CaseWhen(Seq((Literal.create(true, BooleanType), c4)), c6), "a", row)

    checkEvaluation(CaseWhen(Seq((c3, c4), (c2, c5)), c6), "a", row)
    checkEvaluation(CaseWhen(Seq((c2, c4), (c3, c5)), c6), "b", row)
    checkEvaluation(CaseWhen(Seq((c1, c4), (c2, c5)), c6), "c", row)
    checkEvaluation(CaseWhen(Seq((c1, c4), (c2, c5))), null, row)

    assert(CaseWhen(Seq((c2, c4)), c6).nullable === true)
    assert(CaseWhen(Seq((c2, c4), (c3, c5)), c6).nullable === true)
    assert(CaseWhen(Seq((c2, c4), (c3, c5))).nullable === true)

    val c4_notNull = 'a.boolean.notNull.at(3)
    val c5_notNull = 'a.boolean.notNull.at(4)
    val c6_notNull = 'a.boolean.notNull.at(5)

    assert(CaseWhen(Seq((c2, c4_notNull)), c6_notNull).nullable === false)
    assert(CaseWhen(Seq((c2, c4)), c6_notNull).nullable === true)
    assert(CaseWhen(Seq((c2, c4_notNull))).nullable === true)
    assert(CaseWhen(Seq((c2, c4_notNull)), c6).nullable === true)

    assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5_notNull)), c6_notNull).nullable === false)
    assert(CaseWhen(Seq((c2, c4), (c3, c5_notNull)), c6_notNull).nullable === true)
    assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5)), c6_notNull).nullable === true)
    assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5_notNull)), c6).nullable === true)

    assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5_notNull))).nullable === true)
    assert(CaseWhen(Seq((c2, c4), (c3, c5_notNull))).nullable === true)
    assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5))).nullable === true)
  }

  test("case key when") {
    val row = create_row(null, 1, 2, "a", "b", "c")
    val c1 = 'a.int.at(0)
    val c2 = 'a.int.at(1)
    val c3 = 'a.int.at(2)
    val c4 = 'a.string.at(3)
    val c5 = 'a.string.at(4)
    val c6 = 'a.string.at(5)

    val literalNull = Literal.create(null, IntegerType)
    val literalInt = Literal(1)
    val literalString = Literal("a")

    checkEvaluation(CaseKeyWhen(c1, Seq(c2, c4, c5)), "b", row)
    checkEvaluation(CaseKeyWhen(c1, Seq(c2, c4, literalNull, c5, c6)), "c", row)
    checkEvaluation(CaseKeyWhen(c2, Seq(literalInt, c4, c5)), "a", row)
    checkEvaluation(CaseKeyWhen(c2, Seq(c1, c4, c5)), "b", row)
    checkEvaluation(CaseKeyWhen(c4, Seq(literalString, c2, c3)), 1, row)
    checkEvaluation(CaseKeyWhen(c4, Seq(c6, c3, c5, c2, Literal(3))), 3, row)

    checkEvaluation(CaseKeyWhen(literalInt, Seq(c2, c4, c5)), "a", row)
    checkEvaluation(CaseKeyWhen(literalString, Seq(c5, c2, c4, c3)), 2, row)
    checkEvaluation(CaseKeyWhen(c6, Seq(c5, c2, c4, c3)), null, row)
    checkEvaluation(CaseKeyWhen(literalNull, Seq(c2, c5, c1, c6)), null, row)
  }

  test("case key whn - internal pattern matching expects a List while apply takes a Seq") {
    val indexedSeq = IndexedSeq(Literal(1), Literal(42), Literal(42), Literal(1))
    val caseKeyWhaen = CaseKeyWhen(Literal(12), indexedSeq)
    assert(caseKeyWhaen.branches ==
      IndexedSeq((Literal(12) === Literal(1), Literal(42)),
        (Literal(12) === Literal(42), Literal(1))))
  }

  test("SPARK-22705: case when should use less global variables") {
    val ctx = new CodegenContext()
    CaseWhen(Seq((Literal.create(false, BooleanType), Literal(1))), Literal(-1)).genCode(ctx)
    assert(ctx.inlinedMutableStates.size == 1)
  }
}


text:
/**
 * @ngdoc directive
 * @name refigureApp.directive:blogItem
 * @restrict E
 * @description
 * Single post
 * @example
 * <blog-item></blog-item>
 */
(function(angular, twttr) {
    'use strict';

    angular
        .module('refigureApp')
        .component('blogItem', {
            templateUrl: 'view/blogItem.component.html',
            controller: Controller,
            controllerAs: 'vm'
        });

    Controller.$inject = ['$location', '$state', 'blog'];

    function Controller($location, $state, blog) {
        var vm = this;

        vm.blogItem = {};
        vm.$onInit = activate;

        /////////////////////

        /**
         * @ngdoc method
         * @name refigureApp.directive:blog#activate
         * @methodOf refigureApp.directive:blog
         * @description
         * Activates controller
         */
        function activate() {
            blog.getSingle($state.params.id).then(function (data) {
                $state.get('home.blogItem').data.headerTitle = data.HeaderTitle || data.Title;
                vm.blogItem = data;
                twttr.widgets.createShareButton(
                    $location.absUrl(),
                    document.getElementById('twitter-share'),
                    {
                        size: 'large',
                        url: $location.absUrl(),
                        text: data.Title,
                        via: 'scimpact_org',
                        related: 'twitterapi,twitter'
                    }
                );
            });
            twttr.widgets.createTimeline(
                {
                    sourceType: 'profile',
                    screenName: 'scimpact_org'
                },
                document.getElementById('twitter-feed'),
                {
                    height: 1000
                }
            );
        }
    }
})(window.angular, window.twttr);


text:
bool WildcardMatch(const std::string &pattern, const std::string &str);

#endif // WildcardMatch_h__


text:
TAcceso *Acceso;
//---------------------------------------------------------------------------
__fastcall TAcceso::TAcceso(TComponent* Owner)
    : TForm(Owner)
{
    this->usuarios = NULL;
    this->controlUsuarios = NULL;

    this->delincuentes = NULL;
    this->controlDelincuentes = NULL;
}
//---------------------------------------------------------------------------
__fastcall TAcceso::~TAcceso()
{
    if(this->controlUsuarios != NULL)
        delete this->controlUsuarios;

    if(this->controlDelincuentes != NULL)
        delete this->controlDelincuentes;

    if(this->usuarios != NULL)
        delete this->usuarios;

    if(this->delincuentes != NULL)
        delete this->delincuentes;
}
//---------------------------------------------------------------------------
void __fastcall TAcceso::FormCreate(TObject *Sender)
{
    read("./Data/users.bin", (ContenedorPersonas *) this->usuarios);
    read("./Data/outlaws.bin", (ContenedorPersonas *) this->delincuentes);

    if(this->usuarios == NULL)
        this->usuarios = new ArbolPersonas();

    if(this->delincuentes == NULL)
        this->delincuentes = new ArbolPersonas();

    this->controlUsuarios = new ControladorPersonas();
    this->controlDelincuentes = new ControladorPersonas();

    this->controlUsuarios->registrarModelo((ContenedorPersonas **) &(this->usuarios));
    this->controlDelincuentes->registrarModelo((ContenedorPersonas **) &(this->delincuentes));
}
//---------------------------------------------------------------------------
void TAcceso::InvocaConfidentes (void)
{
    int vistaID;

    this->controlDelincuentes->limpiarVistas();

    TConfidentes * auxForm = new TConfidentes(this);
    auxForm->registrarControlador(this->controlDelincuentes);
    this->controlDelincuentes->registrarVista(auxForm, vistaID);
    auxForm->setVistaID(vistaID);
    auxForm->Show();
    auxForm->setIndice(0);
}
//---------------------------------------------------------------------------
void __fastcall TAcceso::LoginClick(TObject *Sender)
{
    int vistaID;

    this->controlUsuarios->limpiarVistas();
    this->controlDelincuentes->limpiarVistas();

    if(this->usuarios->getNumero() > 0)
    {
        Usuario * aux = NULL;
        int i, total = this->usuarios->getNumero();
        std::string nombre = this->Nombre->Text.c_str();
        std::string password = this->Contrasenya->Text.c_str();
        bool salir = false;

        for(i = 0; (i < total) && (!salir); ++i)
        {
            if(this->usuarios->getPersona(i, (Persona *) aux))
            {
                if(aux->getNombre() == nombre)
                {
                    if(aux->getPassword() == password)
                    {
                        if(aux->getClassName() == "Administrador")
                        {
                            TUsuarios * auxForm = new TUsuarios(this, "./Data/users.bin");
                            auxForm->registrarControlador(this->controlUsuarios);
                            this->controlUsuarios->registrarVista(auxForm, vistaID);
                            auxForm->setVistaID(vistaID);
                            auxForm->Show();
                            auxForm->setIndice(0);
                        }
                        else if(aux->getClassName() == "Policia")
                        {
                            TDelincuentes * auxForm = new TDelincuentes(this, "./Data/outlaws.bin");
                            auxForm->registrarControlador(this->controlDelincuentes);
                            this->controlDelincuentes->registrarVista(auxForm, vistaID);
                            auxForm->setVistaID(vistaID);
                            auxForm->Show();
                            auxForm->setIndice(0);
                        }
                    }
                    else
                    {
                        MessageBox(Application->Handle, "Contraseña incorrecta.",
                                   "Log-in", MB_ICONWARNING);
                    }
                    salir = true;
                }
            }
        }

        if(!salir)
        {
            MessageBox(Application->Handle, "Usuario incorrecto.",
                       "Log-in", MB_ICONWARNING);
        }
    }
    else
    {
        if((this->Nombre->Text == "yo") && (this->Contrasenya->Text == "yo"))
        {
            TUsuarios * auxForm = new TUsuarios(this, "./Data/users.bin");
            auxForm->registrarControlador(this->controlUsuarios);
            this->controlUsuarios->registrarVista(auxForm, vistaID);
            auxForm->setVistaID(vistaID);
            auxForm->Show();
        }
    }
}
//---------------------------------------------------------------------------
void __fastcall TAcceso::SalirClick(TObject *Sender)
{
    //write("./Data/users.bin", (ContenedorPersonas *) this->usuarios);
    //write("./Data/outlaws.bin", (ContenedorPersonas *) this->delincuentes);
    this->Close();
}
//---------------------------------------------------------------------------
void __fastcall TAcceso::mnuLoginClick(TObject *Sender)
{
    this->LoginClick(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TAcceso::mnuSalirClick(TObject *Sender)
{
    this->SalirClick(Sender);
}
//---------------------------------------------------------------------------


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

		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Elaeocarpus factsheet on ARKive - Elaeocarpus blascoi</title>
        <link rel="canonical" href="http://www.arkive.org/elaeocarpus/elaeocarpus-blascoi/" />
		<link rel="stylesheet" type="text/css" media="screen,print" href="/rcss/factsheet.css" />
		<link rel="icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

Elaeocarpus (Elaeocarpus blascoi)

Kingdom	Plantae

Phylum	Tracheophyta

Class	Magnoliopsida

Order	Malvales

Family	Elaeocarpaceae

Genus	Elaeocarpus (1)

Classifed as Endangered (EN) on the IUCN Red List (1)

Information on Elaeocarpus blascoi is currently being researched and written and will appear here shortly

This information is awaiting authentication by a species expert, and will be updated as soon as possible. If you are able to help please contact:
arkive@wildscreen.org.uk

IUCN Red List (March, 2010)
http://www.iucnredlist.org


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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainWearActivity"
    tools:deviceIds="wear_square">

    <TextView android:id="@+id/headingTextView" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="@string/listener_square" />

    <TextView android:id="@+id/dataTextView" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Data" />

    <!--TextView android:id="@+id/messageTextView" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:text="Message" /-->

</LinearLayout>

<!--RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" tools:context=".MainWearActivity"
    tools:deviceIds="wear_round">

    <TextView android:id="@+id/text" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" android:text="@string/listener_round" />
</RelativeLayout-->


text:
import { diffByUnit, diffDay, diffDayTime } from '../../util'
import EventDateProfile from './EventDateProfile'

export default class EventDefDateMutation {

  clearEnd: boolean = false
  forceTimed: boolean = false
  forceAllDay: boolean = false

  // Durations. if 0-ms duration, will be null instead.
  // Callers should not set this directly.
  dateDelta: any
  startDelta: any
  endDelta: any

  static createFromDiff(dateProfile0, dateProfile1, largeUnit) {
    let clearEnd = dateProfile0.end && !dateProfile1.end
    let forceTimed = dateProfile0.isAllDay() && !dateProfile1.isAllDay()
    let forceAllDay = !dateProfile0.isAllDay() && dateProfile1.isAllDay()
    let dateDelta
    let endDiff
    let endDelta
    let mutation

    // subtracts the dates in the appropriate way, returning a duration
    function subtractDates(date1, date0) { // date1 - date0
      if (largeUnit) {
        return diffByUnit(date1, date0, largeUnit) // poorly named
      } else if (dateProfile1.isAllDay()) {
        return diffDay(date1, date0) // poorly named
      } else {
        return diffDayTime(date1, date0) // poorly named
      }
    }

    dateDelta = subtractDates(dateProfile1.start, dateProfile0.start)

    if (dateProfile1.end) {
      // use unzonedRanges because dateProfile0.end might be null
      endDiff = subtractDates(
        dateProfile1.unzonedRange.getEnd(),
        dateProfile0.unzonedRange.getEnd()
      )
      endDelta = endDiff.subtract(dateDelta)
    }

    mutation = new EventDefDateMutation()
    mutation.clearEnd = clearEnd
    mutation.forceTimed = forceTimed
    mutation.forceAllDay = forceAllDay
    mutation.setDateDelta(dateDelta)
    mutation.setEndDelta(endDelta)

    return mutation
  }

  /*
  returns an undo function.
  */
  buildNewDateProfile(eventDateProfile, calendar) {
    let start = eventDateProfile.start.clone()
    let end = null
    let shouldRezone = false

    if (eventDateProfile.end && !this.clearEnd) {
      end = eventDateProfile.end.clone()
    } else if (this.endDelta && !end) {
      end = calendar.getDefaultEventEnd(eventDateProfile.isAllDay(), start)
    }

    if (this.forceTimed) {
      shouldRezone = true

      if (!start.hasTime()) {
        start.time(0)
      }

      if (end && !end.hasTime()) {
        end.time(0)
      }
    } else if (this.forceAllDay) {

      if (start.hasTime()) {
        start.stripTime()
      }

      if (end && end.hasTime()) {
        end.stripTime()
      }
    }

    if (this.dateDelta) {
      shouldRezone = true

      start.add(this.dateDelta)

      if (end) {
        end.add(this.dateDelta)
      }
    }

    // do this before adding startDelta to start, so we can work off of start
    if (this.endDelta) {
      shouldRezone = true

      end.add(this.endDelta)
    }

    if (this.startDelta) {
      shouldRezone = true

      start.add(this.startDelta)
    }

    let slots = calendar.opt('slots')
    let snapOnSlots = calendar.opt('snapOnSlots')
    if (!eventDateProfile.isAllDay() && !this.forceAllDay && slots && snapOnSlots) {
      let dateRange
      if (snapOnSlots.snapPolicy === 'closest') {
        dateRange = calendar.computeSnapPolicyClosest(start, end, slots)
      } else { // snapOnSlots.snapPolicy === "enlarge"
        dateRange = calendar.computeSnapPolicyEnlarge(start, end, slots)
      }

      // snap event boundary to slot boundary
      start = dateRange.start
      end = dateRange.end
    }

    if (shouldRezone) {
      start = calendar.applyTimezone(start)

      if (end) {
        end = calendar.applyTimezone(end)
      }
    }

    // TODO: okay to access calendar option?
    if (!end && calendar.opt('forceEventDuration')) {
      end = calendar.getDefaultEventEnd(eventDateProfile.isAllDay(), start)
    }

    return new EventDateProfile(start, end, calendar)
  }

  setDateDelta(dateDelta) {
    if (dateDelta && dateDelta.valueOf()) {
      this.dateDelta = dateDelta
    } else {
      this.dateDelta = null
    }
  }

  setStartDelta(startDelta) {
    if (startDelta && startDelta.valueOf()) {
      this.startDelta = startDelta
    } else {
      this.startDelta = null
    }
  }

  setEndDelta(endDelta) {
    if (endDelta && endDelta.valueOf()) {
      this.endDelta = endDelta
    } else {
      this.endDelta = null
    }
  }

  isEmpty() {
    return !this.clearEnd && !this.forceTimed && !this.forceAllDay &&
      !this.dateDelta && !this.startDelta && !this.endDelta
  }

}


text:
package org.nkjmlab.webui.service.user.model;

import java.util.Date;
import java.util.Locale;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.nkjmlab.util.bean.BeanUtils;
import org.nkjmlab.util.db.RelatedWithTable;

import net.sf.persist.annotations.NoColumn;
import net.sf.persist.annotations.Table;

@Table(name = UserAccountsTable.TABLE_NAME)
public class UserAccount implements RelatedWithTable {

	private static final String SALT = "801iljmlkgfa796y19holj1ljl";

	private Date createdAt;
	private Date modifiedAt;
	private String userId;
	private String groupName;
	private String nickname;
	private String firstName;
	private String lastName;
	private String password;
	private String role;
	private String mail;
	private String language;
	private String options;

	private String encryptedInputPassword;

	@NoColumn
	public String getEncryptedInputPassword() {
		return encryptedInputPassword;
	}

	@NoColumn
	public void setEncryptedInputPassword(String encryptedInputPassword) {
		this.encryptedInputPassword = encryptedInputPassword;
		this.password = DigestUtils.sha256Hex(encryptedInputPassword + getSalt());
	}

	public enum Role {
		ADMIN(9), DEVELOPER(7), OPERATOR(5), RESTRICTED_OPERATOR(4), USER(3);

		private int level;

		Role(int level) {
			this.level = level;
		}

		public int getLevel() {
			return level;
		}
	}

	public UserAccount() {
	}

	public UserAccount(String userId, String groupName, String encrypedInputPassword,
			String langage, String nickname, Role role) {
		this.userId = userId;
		setGroupName(groupName);
		setLanguage(langage);
		setNickname(nickname);
		setEncryptedInputPassword(encrypedInputPassword);
		this.role = role == null ? Role.USER.name() : role.name();
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date created) {
		this.createdAt = created;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String name) {
		this.nickname = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getOptions() {
		return options;
	}

	public void setOptions(String options) {
		this.options = options;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mailAddress) {
		this.mail = mailAddress;
	}

	public boolean validate(String password) {
		return this.password.equals(DigestUtils.sha256Hex(password + getSalt()));
	}

	private String getSalt() {
		return SALT;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public Date getModifiedAt() {
		return modifiedAt;
	}

	public void setModifiedAt(Date modified) {
		this.modifiedAt = modified;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public boolean isAdmin() {
		return getRoleObject().getLevel() >= Role.ADMIN.getLevel();
	}

	private Role getRoleObject() {
		return Role.valueOf(getRole());
	}

	public boolean isOperator() {
		return getRoleObject().getLevel() >= Role.RESTRICTED_OPERATOR.getLevel();
	}

	public boolean isSameUserAccount(UserAccount account) {
		if (userId.equals(account.getUserId())) {
			return true;
		}
		return false;
	}

	public void setIfAbsent(UserAccount src) {
		BeanUtils.setIfAbsent(this, src);
	}

	@NoColumn
	public Locale getLocale() {
		try {
			return Locale.forLanguageTag(language);
		} catch (Throwable t) {
			return Locale.US;
		}
	}

}


text: function() return aura_env.texture end


text:
using System;
using System.IO;

namespace Hpdi.VssPhysicalLib
{
    /// <summary>
    /// VSS record representing a file checkout.
    /// </summary>
    /// <author>Trevor Robinson</author>
    public class CheckoutRecord : VssRecord
    {
        public const string SIGNATURE = "CF";

        string user;
        DateTime dateTime;
        string workingDir;
        string machine;
        string project;
        string comment;
        int revision;
        int flags;
        bool exclusive;
        int prevCheckoutOffset;
        int thisCheckoutOffset;
        int checkouts;

        public override string Signature { get { return SIGNATURE; } }
        public string User { get { return user; } }
        public DateTime DateTime { get { return dateTime; } }
        public string WorkingDir { get { return workingDir; } }
        public string Machine { get { return machine; } }
        public string Project { get { return project; } }
        public string Comment { get { return comment; } }
        public int Revision { get { return revision; } }
        public int Flags { get { return flags; } }
        public bool Exclusive { get { return exclusive; } }
        public int PrevCheckoutOffset { get { return prevCheckoutOffset; } }
        public int ThisCheckoutOffset { get { return thisCheckoutOffset; } }
        public int Checkouts { get { return checkouts; } }

        public override void Read(BufferReader reader, RecordHeader header)
        {
            base.Read(reader, header);

            user = reader.ReadString(32);
            dateTime = reader.ReadDateTime();
            workingDir = reader.ReadString(260);
            machine = reader.ReadString(32);
            project = reader.ReadString(260);
            comment = reader.ReadString(64);
            revision = reader.ReadInt16();
            flags = reader.ReadInt16();
            exclusive = (flags & 0x40) != 0;
            prevCheckoutOffset = reader.ReadInt32();
            thisCheckoutOffset = reader.ReadInt32();
            checkouts = reader.ReadInt32();
        }

        public override void Dump(TextWriter writer)
        {
            writer.WriteLine("  User: {0} @ {1}", user, dateTime);
            writer.WriteLine("  Working: {0}", workingDir);
            writer.WriteLine("  Machine: {0}", machine);
            writer.WriteLine("  Project: {0}", project);
            writer.WriteLine("  Comment: {0}", comment);
            writer.WriteLine("  Revision: #{0:D3}", revision);
            writer.WriteLine("  Flags: {0:X4}{1}", flags,
                exclusive ? " (exclusive)" : "");
            writer.WriteLine("  Prev checkout offset: {0:X6}", prevCheckoutOffset);
            writer.WriteLine("  This checkout offset: {0:X6}", thisCheckoutOffset);
            writer.WriteLine("  Checkouts: {0}", checkouts);
        }
    }
}


text:
class BuildOptions
  # @private
  def initialize(args, options)
    @args = args
    @options = options
  end

  # True if a {Formula} is being built with a specific option
  # (which isn't named `with-*` or `without-*`).
  # @deprecated
  def include?(name)
    @args.include?("--#{name}")
  end

  # True if a {Formula} is being built with a specific option.
  #
args << "--i-want-spam" if build.with? "spam"
  #
  # args << "--qt-gui" if build.with? "qt" # "--with-qt" ==> build.with? "qt"
  #
  # # If a formula presents a user with a choice, but the choice must be fulfilled:
  # if build.with? "example2"
  #   args << "--with-example2"
  # else
  #   args << "--with-example1"
  # end

  def with?(val)
    option_names = val.respond_to?(:option_names) ? val.option_names : [val]

    option_names.any? do |name|
      if option_defined? "with-#{name}"
        include? "with-#{name}"
      elsif option_defined? "without-#{name}"
        !include? "without-#{name}"
      else
        false
      end
    end
  end

  # True if a {Formula} is being built without a specific option.
  #
args << "--no-spam-plz" if build.without? "spam"

  def without?(val)
    !with?(val)
  end

  # True if a {Formula} is being built as a bottle (i.e. binary package).
  def bottle?
    include? "build-bottle"
  end

  # True if a {Formula} is being built with {Formula.head} instead of {Formula.stable}.
  #
args << "--some-new-stuff" if build.head?

  #
# If there are multiple conditional arguments use a block instead of lines.
  #  if build.head?
  #    args << "--i-want-pizza"
  #    args << "--and-a-cold-beer" if build.with? "cold-beer"
  #  end

  def head?
    include? "HEAD"
  end

  # True if a {Formula} is being built with {Formula.devel} instead of {Formula.stable}.
  #
args << "--some-beta" if build.devel?

  def devel?
    include? "devel"
  end

  # True if a {Formula} is being built with {Formula.stable} instead of {Formula.devel} or {Formula.head}. This is the default.
  #
args << "--some-beta" if build.devel?

  def stable?
    !(head? || devel?)
  end

  # True if a {Formula} is being built universally.
  # e.g. on newer Intel Macs this means a combined x86_64/x86 binary/library.
  #
args << "--universal-binary" if build.universal?

  def universal?
    include?("universal") && option_defined?("universal")
  end

  # True if a {Formula} is being built in C++11 mode.
  def cxx11?
    include?("c++11") && option_defined?("c++11")
  end

  # True if the build has any arguments or options specified.
  def any_args_or_options?
    !@args.empty? || !@options.empty?
  end

  # @private
  def used_options
    @options & @args
  end

  # @private
  def unused_options
    @options - @args
  end

  # @private
  def invalid_options
    @args - @options - BuildOptions.formula_install_options
  end

  # @private
  def invalid_option_names
    invalid_options.map(&:flag).sort
  end

  def self.formula_install_options
    @formula_install_options ||= ARGV.formula_install_option_names.map do |option_name|
      Option.new option_name[2..-1]
    end
  end

  private

  def option_defined?(name)
    @options.include? name
  end
end


text:
namespace FootballDatabase.Models
{
    public class Trainer
    {
        private const int MinNameLength = 2;
        private const int MaxNameLength = 50;
        private const int MinAge = 12;
        private const int MaxAge = 120;
        private const double MinSalary = 0.0;
        private const int MinYears = 0;

        public Trainer()
        {
            this.IsDeleted = false;
        }

        public int Id { get; set; }

        // [Required]
        // [MinLength(MinNameLength)]
        // [MaxLength(MaxNameLength)]
        public string Name { get; set; }

        // [Range(MinAge, MaxAge)]
        public int Age { get; set; }

        // [MinLength(MinNameLength)]
        // [MaxLength(MaxNameLength)]
        public string Nationality { get; set; }

        // [Range(MinSalary, Double.MaxValue)]
        public decimal? Salary { get; set; }

        // [Range(MinYears, Double.MaxValue)]
        public int? Contract { get; set; }

        public int TeamId { get; set; }

        public bool IsDeleted { get; set; }

        // [MinLength(MinNameLength)]
        // [MaxLength(MaxNameLength)]
        public virtual Team Team { get; set; }

        public override string ToString()
        {
             return string.Format($@"Id: {this.Id}, Name: {this.Name}, Age: {this.Age}, Nationality: {this.Nationality}, Salary: {this.Salary}, Contract(in years): {this.Contract}");
        }
    }
}