text:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical"
        >
    <com.amap.api.navi.AMapNaviView
            android:id="@+id/navi_map"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />
</LinearLayout>


text:
import os
import time

import flask

from app import database_write, get_public_url
from mollie.api.client import Client
from mollie.api.error import Error

PUBLIC_URL = get_public_url()

def main():
    try:
        #
        # Initialize the Mollie API library with your API key.
        #
        # See: https://www.mollie.com/dashboard/settings/profiles
        #
        api_key = os.environ.get("MOLLIE_API_KEY", "test_test")
        mollie_client = Client()
        mollie_client.set_api_key(api_key)

        #
        # First, let the customer pick the bank in a simple HTML form. This step is actually optional.
        #
        if "issuer" not in flask.request.form:
            body = '<form method="post">Select your bank: <select name="issuer">'
            for issuer in mollie_client.methods.get("ideal", include="issuers").issuers:
                body += f'<option value="{issuer.id}">{issuer.name}</option>'
            body += '<option value="">or select later</option>'
            body += "</select><button>OK</button></form>"
            return body

        else:
            #
            # Get the posted issuer id.
            #
            issuer_id = None

            if flask.request.form["issuer"]:
                issuer_id = str(flask.request.form["issuer"])

        #
        # Generate a unique webshop order id for this example. It is important to include this unique attribute
        # in the redirectUrl (below) so a proper return page can be shown to the customer.
        #
        my_webshop_id = int(time.time())

        #
        # Payment parameters:
        # amount        Currency and value. This example creates a € 10,- payment.
        # description   Description of the payment.
        # webhookUrl    Webhook location, used to report when the payment changes state.
        # redirectUrl   Redirect location. The customer will be redirected there after the payment.
        # metadata      Custom metadata that is stored with the payment.
        # method        Payment method "ideal".
        # issuer        The customer's bank. If empty the customer can select it later.
        #
        payment = mollie_client.payments.create(
            {
                "amount": {"currency": "EUR", "value": "10.00"},
                "description": "My first API payment",
                "webhookUrl": f"{PUBLIC_URL}02-webhook-verification",
                "redirectUrl": f"{PUBLIC_URL}03-return-page?my_webshop_id={my_webshop_id}",
                "metadata": {
                    "my_webshop_id": str(my_webshop_id),
                },
                "method": "ideal",
                "issuer": issuer_id,
            }
        )

        #
        # In this example we store the order with its payment status in a database.
        #
        data = {"status": payment.status}
        database_write(my_webshop_id, data)

        #
        # Send the customer off to complete the payment.
        #
        return flask.redirect(payment.checkout_url)

    except Error as err:
        return f"API call failed: {err}"

if __name__ == "__main__":
    print(main())

redpajama_set_name: RedPajamaGithub


text:
Specifies a single color to fill the background of the scene with. The scene background is displayed behind any scene objects, stars and atmosphere.

**Referenced by:** [environment](environment.md)

### Properties

| Property | Details
| --- | ---
| [color](color.md) | Color is represented as a three or four-element array.
| transparency | The value has to lie between `100` (full transparency) and `0` (full opacity).
| type | The type of background.<br>Value of this property must be `color`


text:
from copy import copy
import pickle
from pathlib import Path

import numpy as np
from scipy.spatial.distance import euclidean

import simtk.openmm.app as omma
import simtk.openmm as omm
import simtk.unit as unit

import mdtraj as mdj

from openmm_systems.test_systems import LennardJonesPair

# components for the apparatus
from wepy.resampling.distances.distance import Distance
from wepy.resampling.resamplers.wexplore import WExploreResampler
from wepy.boundary_conditions.unbinding import UnbindingBC
from wepy.runners.openmm import OpenMMRunner, OpenMMState
from wepy.walker import Walker
from wepy.runners.openmm import UNIT_NAMES, GET_STATE_KWARG_DEFAULTS
from wepy.reporter.hdf5 import WepyHDF5Reporter

from wepy.reporter.dashboard import DashboardReporter

from wepy.reporter.receptor.dashboard import ReceptorBCDashboardSection
from wepy.reporter.wexplore.dashboard import WExploreDashboardSection
from wepy.reporter.openmm import OpenMMRunnerDashboardSection

from wepy.reporter.restree import ResTreeReporter
from wepy.util.mdtraj import mdtraj_to_json_topology

from wepy.work_mapper.mapper import Mapper

from wepy.orchestration.orchestrator import Orchestrator
from wepy.orchestration.snapshot import WepySimApparatus
from wepy.orchestration.configuration import Configuration

## PARAMETERS

output_dir = Path("_output")

# Platform used for OpenMM which uses different hardware computation
# kernels. Options are: Reference, CPU, OpenCL, CUDA.

# we use the Reference platform because this is just a test
PLATFORM = 'Reference'

# Langevin Integrator
TEMPERATURE= 300.0*unit.kelvin
FRICTION_COEFFICIENT = 1/unit.picosecond
# step size of time integrations
STEP_SIZE = 0.002*unit.picoseconds

# Resampler parameters

# the maximum weight allowed for a walker
PMAX = 0.5
# the minimum weight allowed for a walker
PMIN = 1e-12

# the maximum number of regions allowed under each parent region
MAX_N_REGIONS = (10, 10, 10, 10)

# the maximum size of regions, new regions will be created if a walker
# is beyond this distance from each voronoi image unless there is an
# already maximal number of regions
MAX_REGION_SIZES = (1, 0.5, .35, .25) # nanometers

# boundary condition parameters

# maximum distance between between any atom of the ligand and any
# other atom of the protein, if the shortest such atom-atom distance
# is larger than this the ligand will be considered unbound and
# restarted in the initial state
CUTOFF_DISTANCE = 1.0 # nm

# reporting parameters

# these are the properties of the states (i.e. from OpenMM) which will
# be saved into the HDF5
SAVE_FIELDS = ('positions', 'box_vectors', 'velocities')
# these are the names of the units which will be stored with each
# field in the HDF5
UNITS = UNIT_NAMES

# orchestration parameters
N_WALKERS = 48

## System and OpenMMRunner

# make the test system
test_sys = LennardJonesPair()

# make the integrator
integrator = omm.LangevinIntegrator(TEMPERATURE, FRICTION_COEFFICIENT, STEP_SIZE)

# make a context and set the positions
context = omm.Context(test_sys.system, copy(integrator))
context.setPositions(test_sys.positions)

# get the data from this context so we have a state to start the
# simulation with
get_state_kwargs = dict(GET_STATE_KWARG_DEFAULTS)
init_sim_state = context.getState(**get_state_kwargs)
init_state = OpenMMState(init_sim_state)

# initialize the runner
runner = OpenMMRunner(test_sys.system, test_sys.topology, integrator, platform=PLATFORM)

## Distance Metric
# we define a simple distance metric for this system, assuming the
# positions are in a 'positions' field
class PairDistance(Distance):

    def __init__(self, metric=euclidean):
        self.metric = metric

    def image(self, state):
        return state['positions']

    def image_distance(self, image_a, image_b):
        dist_a = self.metric(image_a[0], image_a[1])
        dist_b = self.metric(image_b[0], image_b[1])

        return np.abs(dist_a - dist_b)

# make a distance object which can be used to compute the distance
# between two walkers, for our scorer class
distance = PairDistance()

## Resampler
resampler = WExploreResampler(distance=distance,
                              init_state=init_state,
                              max_region_sizes=MAX_REGION_SIZES,
                              max_n_regions=MAX_N_REGIONS,
                              pmin=PMIN, pmax=PMAX)

## Boundary Conditions

# the mdtraj here is needed for the distance function
mdtraj_topology = mdj.Topology.from_openmm(test_sys.topology)

## Reporters if we want them
json_str_top = mdtraj_to_json_topology(mdtraj_topology)

# initialize the unbinding boundary conditions
ubc = UnbindingBC(cutoff_distance=CUTOFF_DISTANCE,
                  initial_state=init_state,
                  topology=json_str_top,
                  ligand_idxs=np.array(test_sys.ligand_indices),
                  receptor_idxs=np.array(test_sys.receptor_indices))

# make a dictionary of units for adding to the HDF5
units = dict(UNIT_NAMES)

hdf5_reporter_kwargs = {'save_fields' : SAVE_FIELDS,
                        'resampler' : resampler,
                        'boundary_conditions' : ubc,
                        'topology' : json_str_top,
                        'units' : units}

wexplore_dash = WExploreDashboardSection(resampler=resampler)
openmm_dash = OpenMMRunnerDashboardSection(runner=runner,
                                           step_time=STEP_SIZE)
ubc_dash = ReceptorBCDashboardSection(bc=ubc)

dashboard_reporter_kwargs = {
    'resampler_dash' : wexplore_dash,
    'runner_dash' : openmm_dash,
    'bc_dash' : ubc_dash,
}

# Resampling Tree
restree_reporter_kwargs = {'resampler' : resampler,
                           'boundary_condition' : ubc,
                           'node_radius' : 3.0,
                           'row_spacing' : 5.0,
                           'step_spacing' : 20.0,
                           'progress_key' : 'min_distances',
                           'max_progress_value' : ubc.cutoff_distance,
                           'colormap_name' : 'plasma'}

# TODO make the restree reporter work

reporter_classes = [
    WepyHDF5Reporter,
    DashboardReporter,
    #ResTreeReporter,
]
reporter_kwargs = [
    hdf5_reporter_kwargs,
    dashboard_reporter_kwargs,
    #restree_reporter_kwargs,
]

sim_apparatus = WepySimApparatus(runner,
                                 resampler=resampler,
                                 boundary_conditions=ubc)

# we also create a default configuration for the orchestrator that
# will be used unless one is given at runtime for the creation of a
# simulation manager
configuration = Configuration(reporter_classes=reporter_classes,
                              reporter_partial_kwargs=reporter_kwargs)

# we also want to set up the orchestrator with some default walkers to
# use to get us started. Otherwise these could be provided from a
# snapshot or on their own. Ideally we only want to have a single
# script setting up an orchestrator and then manage everything else on
# the command line intereactively from then on out
init_weight = 1.0 / N_WALKERS
init_walkers = [Walker(OpenMMState(init_sim_state), init_weight) for i in range(N_WALKERS)]

# then create the seed/root/master orchestrator which will be used
# from here on out
orch = Orchestrator(
    orch_path=str(output_dir / 'LJ-pair.orch.sqlite'),
    mode='w',
)

# set the defaults
orch.set_default_sim_apparatus(sim_apparatus)
orch.set_default_init_walkers(init_walkers)
orch.set_default_configuration(configuration)
orch.gen_default_snapshot()


text:
<subsystem xmlns="urn:jboss:domain:modeshape:3.0">
    <repository name="sample" event-bus-size="2048" lock-timeout-millis="1000">
        <db-persistence url="jdbc:h2:mem:modeshape;DB_CLOSE_DELAY=0" driver="org.h2.Driver"
                        username="sa" password="sa"/>
        <node-types>
            <node-type>custom.cnd</node-type>
        </node-types>
        <workspaces>
            <workspace name="predefinedWorkspace1"/>
            <workspace name="predefinedWorkspace2">
                <initial-content>initial-content-default.xml</initial-content>
            </workspace>
            <workspace name="predefinedWorkspace3"/>
            <initial-content>initial-content-default.xml</initial-content>
        </workspaces>
        <journaling max-days-to-keep-records="15"/>
        <file-binary-storage path="modeshape/compositeBinaryStoreRepository/binaries/fs1"/>
        <sequencers>
            <sequencer classname="ddl" name="modeshape-sequencer-ddl" path-expression="//a/b"/>
            <sequencer classname="java" name="modeshape-sequencer-java" path-expression="//a/b"/>
        </sequencers>
        <external-sources>
            <source cacheable="false"
                    classname="org.modeshape.connector.filesystem.FileSystemConnector"
                    directoryPath="." name="filesystem" readonly="true" exposeAsWorkspace="ws-fs">
                <projection>default:/projection1 => /</projection>
                <projection>other:/projection1 => /</projection>
            </source>
            <source cacheable="false"
                    classname="org.modeshape.connector.git.GitConnector"
                    directoryPath="." module="org.modeshape.connector.git"
                    name="git" queryableBranches="master,2.x"
                    readonly="true" remoteName="upstream,origin"/>
            <source
                    classname="org.modeshape.connector.meta.jdbc.JdbcMetadataConnector"
                    dataSourceJndiName="java:jboss/datasources/ExampleDS"
                    module="org.modeshape.connector.jdbc.metadata" name="jdbc-metadata">
                <projection>default:/ModeShapeTestDb => /</projection>
            </source>
        </external-sources>
        <text-extractors>
            <text-extractor classname="tika" name="tika-extractor1"/>
            <text-extractor
                    classname="org.modeshape.extractor.tika.TikaTextExtractor" name="tika-extractor2"/>
        </text-extractors>
    </repository>
    <webapp name="modeshape-cmis.war"/>
</subsystem>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="list_of_countries">
        <item>Agrigento</item> <item>Alessandria</item>
        <item>Ancona</item> <item>Aosta</item> <item>Arezzo</item>
        <item>Ascoli Piceno</item> <item>Asti</item> <item>Avellino</item>
        <item>Bari</item> <item>Barletta-Andria-Trani</item> <item>Belluno</item>
        <item>Benevento</item> <item>Bergamo</item> <item>Biella</item>
        <item>Bologna</item> <item>Bolzano</item> <item>Brescia</item>
        <item>Brindisi</item> <item>Cagliari</item> <item>Caltanissetta</item>
        <item>Campobasso</item> <item>Carbonia-Iglesias</item> <item>Caserta</item>
        <item>Catania</item> <item>Catanzaro</item> <item>Chieti</item>
        <item>Como</item> <item>Cosenza</item> <item>Cremona</item> <item>Crotone</item>
        <item>Cuneo</item> <item>Enna</item> <item>Fermo</item> <item>Ferrara</item>
        <item>Florence</item> <item>Foggia</item> <item>Forlì-Cesena</item> <item>Frosinone</item>
        <item>Genova</item> <item>Gorizia</item> <item>Grosseto</item> <item>Imperia</item>
        <item>Isernia</item> <item>La Spezia</item> <item>L\'Aquila</item> <item>Latina</item>
        <item>Lecce</item> <item>Lecco</item> <item>Livorno</item> <item>Lodi</item>
        <item>Lucca</item> <item>Macerata</item> <item>Mantova</item> <item>Massa-Carrara</item>
        <item>Matera</item> <item>Medio Campidano</item> <item>Messina</item> <item>Milano</item>
        <item>Modena</item> <item>Monza e della Brianza</item> <item>Napoli</item> <item>Novara</item>
        <item>Nuoro</item> <item>Ogliastra</item> <item>Olbia-Tempio</item> <item>Oristano</item>
        <item>Padova</item> <item>Palermo</item> <item>Parma</item> <item>Pavia</item>
        <item>Perugia</item> <item>Pesaro e Urbino</item> <item>Pescara</item>
        <item>Piacenza</item> <item>Pisa</item> <item>Pistoia</item> <item>Pordenone</item>
        <item>Potenza</item> <item>Prato</item> <item>Ragusa</item> <item>Ravenna</item>
        <item>Reggio Calabria</item> <item>Reggio Emilia</item> <item>Rieti</item>
        <item>Rimini</item> <item>Roma</item> <item>Rovigo</item> <item>Salerno</item>
        <item>Sassari</item> <item>Savona</item> <item>Siena</item> <item>Siracusa</item>
        <item>Sondrio</item> <item>Taranto</item> <item>Teramo</item> <item>Terni</item>
        <item>Trapani</item> <item>Trento</item> <item>Treviso</item> <item>Trieste</item>
        <item>Torino</item> <item>Udine</item> <item>Varese</item> <item>Venezia</item>
        <item>Verbano-Cusio-Ossola</item> <item>Vercelli</item> <item>Verona</item>
        <item>Vibo Valentia</item> <item>Vicenza</item> <item>Viterbo</item>
    </string-array>
</resources>


text:
from lxml import etree as et

arights = ('read-only', 'read-write', 'write-only', 'writeOnce', 'read-writeOnce')

__version__ = '1.0.1'

default_xml = ('<device><name>NEW_DEVICE</name>'
               '<version>1.0</version>'
               '<description>Default CMSIS device</description>'
               '<addressUnitBits>8</addressUnitBits>'
               '<width>32</width>'
               '<size>0x20</size>'
               '<access>read-write</access>'
               '<resetValue>0x00000000</resetValue>'
               '<resetMask>0xFFFFFFFF</resetMask>'
               '<peripherals><peripheral>'
               '<name>NEW_PERIPHERAL</name>'
               '<groupName>DEVICE PERIPHERALS</groupName>'
               '<baseAddress>0xDEADBEEF</baseAddress>'
               '<addressBlock><offset>0x00</offset><size>0x400</size><usage>registers</usage></addressBlock>'
               '<interrupt><name>NEW_INTERRUPT</name><description>Default interrupt</description><value>1</value></interrupt>'
               '<registers><register>'
               '<name>NEW_REGISTER</name><displayName>NEW_REGISTER</displayName>'
               '<description>Default register</description>'
               '<addressOffset>0x00</addressOffset>'
               '<fields><field><name>NEW_BITFIELD</name><description>Default bitfield</description>'
               '<bitOffset>0</bitOffset><bitWidth>1</bitWidth></field></fields>'
               '</register></registers>'
               '</peripheral></peripherals></device>'
               )

def str_cleanup(s):
    try:
        s = s.encode('ascii', errors='ignore')
        return ' '.join(s.split())
    except:
        return None

def toInt(val, fault=None):
    try:
        return int(val, 0)
    except:
        return fault

def get_from_xml(node, attr):
    try:
        return node.find(attr).text
    except:
        return None

class basedata(object):
    def __init__(self, parent=None):
        self.parent = parent
        self._name = 'new'
        self._desc = None
        self._rsize = None
        self.rvalue = None
        self._access = None

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, val):
        try:
            s = val.encode('ascii', errors='ignore')
            self._name = '_'.join(s.split())
        except:
            pass

    @property
    def desc(self):
        return self._desc

    @desc.setter
    def desc(self, val):
        self._desc = str_cleanup(val)

    @property
    def access(self):
        return self._access

    @access.setter
    def access(self, val):
        self._access = val if val in arights else None

    @property
    def rsize(self):
        return '0x{0:02X}'.format(self._rsize) if self._rsize else None

    @rsize.setter
    def rsize(self, val):
        self._rsize = toInt(val)

    @property
    def vsize(self):
        if self._rsize:
            return self.rsize
        else:
            if self.parent:
                return self.parent.vsize
            else:
                return 0

    @property
    def vvalue(self):
        if self.rvalue:
            return self.rvalue
        else:
            if self.parent:
                return self.parent.vvalue
            else:
                return None

    @property
    def vaccess(self):
        if self.access:
            return self.access
        else:
            if self.parent:
                return self.parent.vaccess
            else:
                return 'undefined'

class field(basedata):
    def __init__(self, parent, xml=None):
        basedata.__init__(self, parent)
        self._bitw = 1
        self._bito = 0
        if xml is not None:
            self.fromXML(xml)

    @property
    def bitw(self):
        return str(self._bitw)

    @bitw.setter
    def bitw(self, val):
        self._bitw = toInt(val, self._bitw)

    @property
    def bito(self):
        return str(self._bito)

    @bito.setter
    def bito(self, val):
        self._bito = toInt(val, self._bito)

    @property
    def valid(self):
        if self.name and self.desc and self.bito and self.bitw:
            if (self._bito + self._bitw) <= int(self.vsize, 0):
                return True
        return False

    def fromXML(self, node):
        self.name = get_from_xml(node, 'name')
        self.desc = get_from_xml(node, 'description')
        self.bitw = get_from_xml(node, 'bitWidth')
        self.bito = get_from_xml(node, 'bitOffset')
        self.access = get_from_xml(node, 'access')

    def toXML(self, node=None):
        if node is None:
            node = et.Element('field')
        et.SubElement(node, 'name').text = self.name
        if self.desc:
            et.SubElement(node, 'description').text = self.desc
        et.SubElement(node, 'bitOffset').text = self.bito
        et.SubElement(node, 'bitWidth').text = self.bitw
        if self.access:
            et.SubElement(node, 'access').text = self.access
        return node

class register(basedata):
    def __init__(self, parent, xml=None):
        basedata.__init__(self, parent)
        self._dispname = None
        self._offset = 0
        self.fields = []
        if xml is not None:
            self.fromXML(xml)

    @property
    def dispname(self):
        return self._dispname

    @dispname.setter
    def dispname(self, val):
        self._dispname = str_cleanup(val)

    @property
    def offset(self):
        return '0x{0:04X}'.format(self._offset)

    @offset.setter
    def offset(self, val):
        self._offset = toInt(val, self._offset)

    @property
    def valid(self):
        return (self.name and self.desc)

    def fromXML(self, node):
        del self.fields[:]
        self.name = get_from_xml(node, 'name')
        self.dispname = get_from_xml(node, 'displayName')
        self.desc = get_from_xml(node, 'description')
        self.offset = get_from_xml(node, 'addressOffset')
        self.rsize = get_from_xml(node, 'size')
        self.rvalue = get_from_xml(node, 'resetValue')
        self.access = get_from_xml(node, 'access')
        for x in node.findall('./fields/field'):
            self.fields.append(field(self, x))
        self.sortField()

    def toXML(self, node=None):
        if node is None:
            node = et.Element('register')
        et.SubElement(node, 'name').text = self.name
        if self.dispname:
            et.SubElement(node, 'displayName').text = self.dispname
        if self.desc:
            et.SubElement(node, 'description').text = self.desc
        et.SubElement(node, 'addressOffset').text = self.offset
        if self.rsize:
            et.SubElement(node, 'size').text = self.rsize
        if self.access:
            et.SubElement(node, 'access').text = self.access
        if self.rvalue:
            et.SubElement(node, 'resetValue').text = self.rvalue
        if self.fields:
            f = et.SubElement(node, 'fields')
            for x in self.fields:
                x.toXML(et.SubElement(f, 'field'))
        return node

    def newField(self, name=''):
        r = 0
        for x in sorted(self.fields, key=lambda x: x._bito, reverse=False):
            if r < x._bito:
                break
            r = x._bito + x._bitw
        if r < int(self.vsize, 0):
            f = field(self)
            f._bito = r
            if name:
                f.name = name
            return f
        else:
            return None

    def addField(self, field):
        field.parent = self
        self.fields.append(field)
        self.sortField()

    def sortField(self):
        self.fields.sort(key=lambda x: x._bito, reverse=True)

    def delField(self, item):
        self.fields.remove(item)

    def validate(self, callback):
        names = []
        cap = int(self.vsize, 0)
        ofs = 0
        for x in sorted(self.fields, key=lambda x: x._bito):
            if x.name in names:
                if callback('Duplicated bitfield name %s in %s' % (x.name, self.name)):
                    return True
            elif x._bito + x._bitw > cap:
                if callback('Bitfield %s is out of bounds in %s' % (x.name, self.name)):
                    return True
            elif ofs > x._bito:
                if callback('Bitfields %s and %s overlapped in %s' % (x.name, names[-1], self.name)):
                    return True
            elif x.vaccess == 'undefined':
                if callback('Undefined access level for %s in %s' % (x.name, self.name)):
                    return True
            else:
                names.append(x.name)
                ofs = x._bito + x._bitw
        return False

class interrupt(basedata):
    def __init__(self, parent, xml=None):
        basedata.__init__(self, parent)
        self._value = 0
        if xml is not None:
            self.fromXML(xml)

    @property
    def value(self):
        return str(self._value)

    @value.setter
    def value(self, val):
        self._value = toInt(val, self._value)

    @property
    def valid(self):
        return (self.name and self.desc)

    def fromXML(self, node):
        self.name = get_from_xml(node, 'name')
        self.desc = get_from_xml(node, 'description')
        self.value = get_from_xml(node, 'value')

    def toXML(self, node=None):
        if node is None:
            node = et.Element('interrupt')
        et.SubElement(node, 'name').text = self.name
        if self.desc:
            et.SubElement(node, 'description').text = self.desc
        et.SubElement(node, 'value').text = self.value
        return node

class peripheral(basedata):
    def __init__(self, parent, xml=None):
        basedata.__init__(self, parent)
        self.ref = None
        self.group = None
        self._address = 0
        self._aoffset = 0
        self._asize = 0x400
        self.interrupts = []
        self.registers = []
        if xml is not None:
            self.fromXML(xml)

    @property
    def asize(self):
        return '0x{0:04X}'.format(self._asize)

    @asize.setter
    def asize(self, val):
        self._asize = toInt(val, self._asize)

    @property
    def aoffset(self):
        return '0x{0:08X}'.format(self._aoffset)

    @aoffset.setter
    def aoffset(self, val):
        self._aoffset = toInt(val, self._aoffset)

    @property
    def address(self):
        return '0x{0:08X}'.format(self._address)

    @address.setter
    def address(self, val):
        self._address = toInt(val, self._address)

    def fromXML(self, node):
        del self.interrupts[:]
        del self.registers[:]
        self.name = get_from_xml(node, 'name')
        if 'derivedFrom' in node.attrib:
            ref = node.attrib['derivedFrom']
            for x in self.parent.peripherals:
                if x.name == ref:
                    self.ref = x
                    break
        else:
            self.ref = None
        self.desc = get_from_xml(node, 'description')
        self.group = get_from_xml(node, 'groupName')
        self.address = get_from_xml(node, 'baseAddress')
        self.aoffset = get_from_xml(node, './addressBlock/offset')
        self.asize = get_from_xml(node, './addressBlock/size')

        for x in node.findall('./interrupt'):
            self.interrupts.append(interrupt(self, x))

        for x in node.findall('./registers/register'):
            self.registers.append(register(self, x))
        self.registers.sort(key=lambda x: x._offset, reverse=False)

    def toXML(self, node=None):
        if node is None:
            node = et.Element('peripheral')
        if self.ref:
            node.set('derivedFrom', self.ref.name)
        et.SubElement(node, 'name').text = self.name
        if self.group:
            et.SubElement(node, 'groupName').text = self.group
        if self.desc:
            et.SubElement(node, 'description').text = self.desc
        et.SubElement(node, 'baseAddress').text = self.address

        a = et.SubElement(node, 'addressBlock')
        et.SubElement(a, 'offset').text = self.aoffset
        et.SubElement(a, 'size').text = self.asize
        et.SubElement(a, 'usage').text = 'registers'

        for x in self.interrupts:
            x.toXML(et.SubElement(node, 'interrupt'))
        if self.registers:
            r = et.SubElement(node, 'registers')
            for x in self.registers:
                x.toXML(et.SubElement(r, 'register'))
        return node

    def newRegister(self, name=''):
        o = 0
        sz = int(self.vsize, 0) / 8
        for x in sorted(self.registers, key=lambda x: x._offset, reverse=False):
            if o < x._offset:
                break
            o = x._offset + sz
        if o < self._asize:
            r = register(self)
            r._offset = o
            if name:
                r.name = name
            return r
        else:
            return None

    def setRef(self, ref):
        if ref:
            for x in self.parent.peripherals:
                if x == self:
                    return False
                if x.name == ref:
                    self.ref = x
                    return True
            return False
        else:
            self.ref = None
            return True

    def addRegister(self, item):
        item.parent = self
        self.registers.append(item)
        self.registers.sort(key=lambda x: x._offset, reverse=False)

    def delRegister(self, item):
        self.registers.remove(item)

    def newInterrupt(self, name=''):
        ni = interrupt(self)
        if name:
            ni.name = name
        return ni

    def addInterrupt(self, reg):
        if not next((i for i in self.interrupts if i.value == reg.value), None):
            self.interrupts.append(reg)

    def delInterrupt(self, item):
        self.interrupts.remove(item)

    def validate(self, callback):
        names = []
        ofs = 0
        for x in sorted(self.registers, key=lambda x: x._offset, reverse=False):
            rsize = int(x.vsize, 0) / 8
            if x.name in names:
                if callback('Duplicated register name %s in %s' % (x.name, self.name)):
                    return True
            elif x._offset < ofs:
                if callback('Registers %s and %s in %s is overlapped' % (x.name, names[-1], self.name)):
                    return True
            elif x._offset + rsize > self._asize:
                if callback('Register %s is out of bounds in %s' % (x.name, self.name)):
                    return True
            elif x.vaccess == 'undefined':
                if callback('Undefined access level for %s in %s' % (x.name, self.name)):
                    return True
            else:
                if x.validate(callback):
                    return True
                names.append(x.name)
                ofs = x._offset + rsize
        return False

class device(basedata):
    def __init__(self, xml=None):
        basedata.__init__(self, None)
        self.vendor = None
        self.width = '32'
        self.rsize = '0x20'
        self.rvalue = '0x00000000'
        self.rmask = '0xFFFFFFFF'
        self.access = 'read-write'
        self.peripherals = []
        if xml is not None:
            self.fromXML(xml)

    def fromString(self, str):
        xml = et.fromstring(str)
        self.fromXML(xml)

    def fromXML(self, node):
        del self.peripherals[:]
        self.vendor = get_from_xml(node, 'vendor')
        self.name = get_from_xml(node, 'name')
        self.desc = get_from_xml(node, 'description')
        self.width = get_from_xml(node, 'width')
        self.rsize = get_from_xml(node, 'size')
        self.access = get_from_xml(node, 'access')
        self.rvalue = get_from_xml(node, 'resetValue')
        self.rmask = get_from_xml(node, 'resetMask')
        for x in node.findall('./peripherals/peripheral'):
            self.peripherals.append(peripheral(self, x))

    def toXML(self, node=None):
        if node is None:
            node = et.Element('export_device')
        if self.vendor:
            et.SubElement(node, 'vendor').text = self.vendor
        et.SubElement(node, 'name').text = self.name
        et.SubElement(node, 'version').text = '1.0'
        et.SubElement(node, 'description').text = self.desc
        et.SubElement(node, 'addressUnitBits').text = '8'
        et.SubElement(node, 'width').text = self.width
        et.SubElement(node, 'size').text = self.rsize
        et.SubElement(node, 'access').text = self.access
        et.SubElement(node, 'resetValue').text = self.rvalue
        et.SubElement(node, 'resetMask').text = self.rmask
        p = et.SubElement(node, 'peripherals')
        for per in self.peripherals:
            per.toXML(et.SubElement(p, 'peripheral'))
        return node

    def newPeripheral(self, name=''):
        p = peripheral(self)
        p.name = name
        return p

    def delPeripheral(self, item):
        self.peripherals.remove(item)

    def addPeripheral(self, item):
        item.parent = self
        self.peripherals.append(item)

    def movePeripheral(self, dest, item):
        uindex = 1 + self.peripherals.index(dest)
        iindex = self.peripherals.index(item)
        if iindex != uindex:
            self.peripherals.insert(uindex, self.peripherals.pop(iindex))

    def validate(self, callback):
        names = []
        vectors = []
        ofs = 0
        for x in sorted(self.peripherals, key=lambda x: x._address + x._aoffset):
            if x.name in names:
                if callback('Duplicated peripheral name %s' % (x.name)):
                    return True
            if ofs > x._address + x._aoffset:
                if callback('Peripherals %s and %s is overlapped' % (x.name, names[-1])):
                    return True
            if x.validate(callback):
                return True
            names.append(x.name)
            ofs = x._address + x._aoffset + x._asize
            for i in x.interrupts:
                if i.value in vectors:
                    if callback('Duplicated interrupt vector %s' % (i.name)):
                        return True
                vectors.append(i.value)
        return False

    def load(self, name):
        xml = et.parse(name)
        self.fromXML(xml)

    def save(self, name):
        xs = 'http://www.w3.org/2001/XMLSchema-instance'
        xml = et.Element('device', schemaVersion='1.1',
                         nsmap={'xs': xs},
                         attrib={'{' + xs + '}noNamespaceSchemaLocation': 'CMSIS-SVD_Schema_1_1.xsd'})
        xml.addprevious(et.Comment('generated by SVD editor ' + __version__))
        self.toXML(xml)
        tree = et.ElementTree(xml)
        tree.write(name, encoding='utf-8', xml_declaration=True, standalone=True, pretty_print=True)


text:
package org.wso2.carbon.identity.sso.saml.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.carbon.identity.sso.saml.SAMLECPConstants;
import org.wso2.carbon.identity.sso.saml.exception.IdentitySAML2ECPException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Base64;
import java.util.Iterator;
import javax.servlet.http.HttpServletResponse;
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPHeaderElement;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

/**
 * A Utility which provides functionality to handle SOAP requests and responses.
 */
public class SAMLSOAPUtils {

    private static final Log log = LogFactory.getLog(SAMLSOAPUtils.class);

    /**
     *
     * Decode the request received by the samlecp servlet.
     * Validate the SOAP message
     * Check whether the SOAP body contains a valid SAML request
     * @param soapMessage
     * @return
     * @throws IdentitySAML2ECPException
     */
    public static String decodeSOAPMessage(SOAPMessage soapMessage) throws IdentitySAML2ECPException,
            TransformerException {
        SOAPBody body;
        String samlRequest = null;
        String strElement;
        if (soapMessage != null) {
            try {
                body = soapMessage.getSOAPPart().getEnvelope().getBody();
            } catch (SOAPException e) {
                String err = "Invalid SOAP Request";
                throw new IdentitySAML2ECPException(err, e);
            }
            int elementSize = 0;
            Iterator<?> elements = body.getChildElements();
            while (elements.hasNext()) {
                SOAPElement element = (SOAPElement) elements.next();
                strElement = convertSOAPElementToString(element);
                samlRequest = Base64.getEncoder().encodeToString(strElement.getBytes());
                elementSize += 1;
            }
            if (elementSize == 0) {
                String err = "SOAP message body cannot be Null";
                throw new IdentitySAML2ECPException(err);
            } else if (elementSize > 1) {
                String err = "SOAP Message body should Only contain a valid SAML Request";
                throw new IdentitySAML2ECPException(err);
            }
        } else {
            String err = "Empty SOAP Request";
            throw new IdentitySAML2ECPException(err);
        }
        return samlRequest;
    }

    /**
     *
     * Creates a SOAP Fault message including the fault code and fault string.
     * @param faultString detailed error message
     * @param faultcode
     * @return
     */
    public static String createSOAPFault(String faultString, String faultcode) throws TransformerException,
            SOAPException {
        SOAPMessage soapMsg;
        MessageFactory factory = MessageFactory.newInstance();
        soapMsg = factory.createMessage();
        SOAPPart part = soapMsg.getSOAPPart();
        SOAPEnvelope envelope = part.getEnvelope();
        SOAPBody body = envelope.getBody();
        SOAPFault fault = body.addFault();
        fault.setFaultString(faultString);
        fault.setFaultCode(new QName(SAMLECPConstants.SOAPNamespaceURI.SOAP_NAMESPACE_URI, faultcode));
        return convertSOAPMsgToString(soapMsg).replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "");
    }

    /**
     *
     * @param samlRes SAML Response
     * @param acUrl Assertion Consumer URL
     * @return
     */
    public static String createSOAPMessage(String samlRes, String acUrl) throws TransformerException, SOAPException {
        SOAPMessage soapMsg;
        MessageFactory factory = MessageFactory.newInstance();
        soapMsg = factory.createMessage();
        SOAPPart part = soapMsg.getSOAPPart();
        SOAPEnvelope envelope = part.getEnvelope();
        SOAPHeader header = envelope.getHeader();
        SOAPHeaderElement soapHeaderElement = header.addHeaderElement(envelope.createName(
                SAMLECPConstants.SOAPECPHeaderElements.SOAP_ECP_HEADER_LOCAL_NAME,
                SAMLECPConstants.SOAPECPHeaderElements.SOAP_ECP_HEADER_PREFIX,
                SAMLECPConstants.SOAPECPHeaderElements.SOAP_ECP_HEADER_URI));
        soapHeaderElement.setMustUnderstand(true);
        soapHeaderElement.setActor(SAMLECPConstants.SOAPHeaderElements.SOAP_HEADER_ELEMENT_ACTOR);
        soapHeaderElement.addAttribute(new QName(SAMLECPConstants.SOAPHeaderElements.SOAP_HEADER_ELEMENT_ACS_URL),
                acUrl);
        SOAPBody body = envelope.getBody();
        String rawxml = "<![CDATA[" + samlRes + "]]>";
        body.addTextNode(rawxml);
        return convertSOAPMsgToString(soapMsg).replace("<![CDATA[", "").replace("]]>", "");
    }

    /**
     *Converts a  SOAP Message to String.
     * @param soapMessage
     * @return
     */
    public static String convertSOAPMsgToString(SOAPMessage soapMessage) throws TransformerException {
        String strElement;
        final StringWriter stringWriter = new StringWriter();
        IdentityUtil.getSecuredTransformerFactory().newTransformer().transform(
                new DOMSource(soapMessage.getSOAPPart()), new StreamResult(stringWriter));
        strElement = stringWriter.toString();
        return strElement;
    }

    /**
     *Send the SOAP fault with the servlet response.
     * @param resp Servlet response
     * @param faultsring SOAP Fault code
     * @param faultcode SOAP fault code
     */
    public static void sendSOAPFault(HttpServletResponse resp, String faultsring, String faultcode) {
        PrintWriter out = null;
        String soapFault = null;
        try {
            out = resp.getWriter();
            soapFault = SAMLSOAPUtils.createSOAPFault(faultsring, faultcode);
        } catch (SOAPException | TransformerException | IOException e) {
            String message = "Error Generating the SOAP Fault";
            log.error(message, e);
            resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
            resp.setContentType("text/html;charset=UTF-8");
        }
        log.error(soapFault);
        resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        resp.setContentType("text/html;charset=UTF-8");
        if (out != null) {
            out.print(soapFault);
        }
    }

    /**
     * Converts SOAPElement to String.
     * @param element SOAPElement
     * @return
     * @throws TransformerException
     */
    public static String convertSOAPElementToString(SOAPElement element) throws TransformerException {
        String strElement;
        StringWriter stringWriter = new StringWriter();
        IdentityUtil.getSecuredTransformerFactory().newTransformer().transform(
                new DOMSource(element), new StreamResult(stringWriter));
        strElement = stringWriter.toString().replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "");
        return strElement;
    }
}


text:
package com.amazonaws.services.quicksight.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListTemplatesResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * A structure containing information about the templates in the list.
     *

     */
    private java.util.List<TemplateSummary> templateSummaryList;
    /**
     *

     * The token for the next set of results, or null if there are no more results.
     *

     */
    private String nextToken;
    /**
     *

     * The HTTP status of the request.
     *

     */
    private Integer status;
    /**
     *

     * The Amazon Web Services request ID for this operation.
     *

     */
    private String requestId;

    /**
     *

     * A structure containing information about the templates in the list.
     *

     *
     * @return A structure containing information about the templates in the list.
     */

    public java.util.List<TemplateSummary> getTemplateSummaryList() {
        return templateSummaryList;
    }

    /**
     *

     * A structure containing information about the templates in the list.
     *

     *
     * @param templateSummaryList
     *        A structure containing information about the templates in the list.
     */

    public void setTemplateSummaryList(java.util.Collection<TemplateSummary> templateSummaryList) {
        if (templateSummaryList == null) {
            this.templateSummaryList = null;
            return;
        }

        this.templateSummaryList = new java.util.ArrayList<TemplateSummary>(templateSummaryList);
    }

    /**
     *

     * A structure containing information about the templates in the list.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setTemplateSummaryList(java.util.Collection)} or {@link #withTemplateSummaryList(java.util.Collection)}
     * if you want to override the existing values.
     *

     *
     * @param templateSummaryList
     *        A structure containing information about the templates in the list.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListTemplatesResult withTemplateSummaryList(TemplateSummary... templateSummaryList) {
        if (this.templateSummaryList == null) {
            setTemplateSummaryList(new java.util.ArrayList<TemplateSummary>(templateSummaryList.length));
        }
        for (TemplateSummary ele : templateSummaryList) {
            this.templateSummaryList.add(ele);
        }
        return this;
    }

    /**
     *

     * A structure containing information about the templates in the list.
     *

     *
     * @param templateSummaryList
     *        A structure containing information about the templates in the list.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListTemplatesResult withTemplateSummaryList(java.util.Collection<TemplateSummary> templateSummaryList) {
        setTemplateSummaryList(templateSummaryList);
        return this;
    }

    /**
     *

     * The token for the next set of results, or null if there are no more results.
     *

     *
     * @param nextToken
     *        The token for the next set of results, or null if there are no more results.
     */

    public void setNextToken(String nextToken) {
        this.nextToken = nextToken;
    }

    /**
     *

     * The token for the next set of results, or null if there are no more results.
     *

     *
     * @return The token for the next set of results, or null if there are no more results.
     */

    public String getNextToken() {
        return this.nextToken;
    }

    /**
     *

     * The token for the next set of results, or null if there are no more results.
     *

     *
     * @param nextToken
     *        The token for the next set of results, or null if there are no more results.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListTemplatesResult withNextToken(String nextToken) {
        setNextToken(nextToken);
        return this;
    }

    /**
     *

     * The HTTP status of the request.
     *

     *
     * @param status
     *        The HTTP status of the request.
     */

    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     *

     * The HTTP status of the request.
     *

     *
     * @return The HTTP status of the request.
     */

    public Integer getStatus() {
        return this.status;
    }

    /**
     *

     * The HTTP status of the request.
     *

     *
     * @param status
     *        The HTTP status of the request.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListTemplatesResult withStatus(Integer status) {
        setStatus(status);
        return this;
    }

    /**
     *

     * The Amazon Web Services request ID for this operation.
     *

     *
     * @param requestId
     *        The Amazon Web Services request ID for this operation.
     */

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    /**
     *

     * The Amazon Web Services request ID for this operation.
     *

     *
     * @return The Amazon Web Services request ID for this operation.
     */

    public String getRequestId() {
        return this.requestId;
    }

    /**
     *

     * The Amazon Web Services request ID for this operation.
     *

     *
     * @param requestId
     *        The Amazon Web Services request ID for this operation.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListTemplatesResult withRequestId(String requestId) {
        setRequestId(requestId);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getTemplateSummaryList() != null)
            sb.append("TemplateSummaryList: ").append(getTemplateSummaryList()).append(",");
        if (getNextToken() != null)
            sb.append("NextToken: ").append(getNextToken()).append(",");
        if (getStatus() != null)
            sb.append("Status: ").append(getStatus()).append(",");
        if (getRequestId() != null)
            sb.append("RequestId: ").append(getRequestId());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListTemplatesResult == false)
            return false;
        ListTemplatesResult other = (ListTemplatesResult) obj;
        if (other.getTemplateSummaryList() == null ^ this.getTemplateSummaryList() == null)
            return false;
        if (other.getTemplateSummaryList() != null && other.getTemplateSummaryList().equals(this.getTemplateSummaryList()) == false)
            return false;
        if (other.getNextToken() == null ^ this.getNextToken() == null)
            return false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
            return false;
        if (other.getStatus() == null ^ this.getStatus() == null)
            return false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
            return false;
        if (other.getRequestId() == null ^ this.getRequestId() == null)
            return false;
        if (other.getRequestId() != null && other.getRequestId().equals(this.getRequestId()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getTemplateSummaryList() == null) ? 0 : getTemplateSummaryList().hashCode());
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
        hashCode = prime * hashCode + ((getRequestId() == null) ? 0 : getRequestId().hashCode());
        return hashCode;
    }

    @Override
    public ListTemplatesResult clone() {
        try {
            return (ListTemplatesResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace JsonHelper
{
    internal enum JsonToken
    {
        None,
        Number,

        Null = 'n',
        True = 't',
        False = 'f',

        Object = '{',
        EndObject = '}',

        Array = '[',
        EndArray = ']',

        String = '"',

        Colon = ':',
        Comma = ','
    }

    public unsafe class JsonParser
    {
        private string json;
        private int index;

        [ThreadStatic]
        private static StringBuilder buffer = new StringBuilder();

        public JsonParser()
        {
        }

        public object Parse(string input)
        {
            Assert(input == null, "输入数据不能为空");

            this.json = input;
            this.index = 0;

            switch (GetToken())
            {
                case JsonToken.Object:
                    return ParseObject();

                case JsonToken.Array:
                    return ParseArray();

                default:
                    throw new ArgumentException("JSON格式错误!");
            }
        }

        private JsonToken GetToken()
        {
            char ch;
            fixed (char* p = json)
            {
                // 忽略空白符
                char* pStart = p + index;
                char* pCur = p + index;
                while (*pCur != '\0' && IsWhiteSpace(*pCur))
                {
                    pCur++;
                }

                index += (int)(pCur - pStart);
                ch = Char.ToLower(*pCur);
            }

            Assert(ch == '\0', "JSON格式错误!");

            switch (ch)
            {
                case '[':
                case ']':
                case '{':
                case '}':
                case '"':
                case ':':
                case ',':
                case 'n':
                case 't':
                case 'f':
                    return (JsonToken)ch;

                default:
                    if (ch == '-' || ch == '.' || IsNumberChar(ch))
                        return JsonToken.Number;

                    throw new ArgumentException("JSON格式错误!");
            }
        }

        private object ParseValue()
        {
            JsonToken token;
            switch ((token = GetToken()))
            {
                case JsonToken.Object:
                    return ParseObject();

                case JsonToken.Array:
                    return ParseArray();

                case JsonToken.String:
                    return ParseString();

                case JsonToken.Number:
                    return ParseNumber();

                case JsonToken.True:
                case JsonToken.False:
                case JsonToken.Null:
                    return ParseOtherValue(token);

                default:
                    throw new ArgumentException("JSON格式错误!");
            }
        }

        private object ParseObject()
        {
            index++; // 跳过 { 字符

            var obj = new Dictionary<string, object>();
            var token = GetToken();
            if (token != JsonToken.EndObject)
            {
                while (true)
                {
                    // pair<string : value>
                    if (token != JsonToken.String)
                        throw new ArgumentException("JSON格式错误!");

                    var name = ParseString();

                    if ((token = GetToken()) != JsonToken.Colon)
                        throw new ArgumentException("JSON格式错误!");

                    index++;

                    obj.Add(name, ParseValue());

                    // next token
                    if ((token = GetToken()) != JsonToken.Comma)
                        break;

                    index++;
                    token = GetToken();
                }

                if (token != JsonToken.EndObject)
                    throw new ArgumentException("JSON格式错误!");
            }

            index++; // 跳过 } 字符

            return obj;
        }

        private object ParseArray()
        {
            index++; // 跳过 [ 符号

            var array = new ArrayList();
            var token = GetToken();
            if (token != JsonToken.EndArray)
            {
                while (true)
                {
                    array.Add(ParseValue());

                    // next token
                    if ((token = GetToken()) != JsonToken.Comma)
                        break;
                    index++;
                }

                if (token != JsonToken.EndArray)
                    throw new ArgumentException("JSON格式错误!");
            }

            index++; // 跳过 ] 符号
            return array;
        }

        private double ParseNumber()
        {
            fixed (char* p = json)
            {
                int len, start = index;
                char* pStart = p + index;
                char* pCur = p + index;

                // 简单读取, 完整的数值类型还需要考虑科学记数法。
                for (; *pCur != '\0' && (IsNumberChar(*pCur) || *pCur == '.' || *pCur == '-');
                    pCur++)
                    ;

                len = (int)(pCur - pStart);
                index += len;
                return double.Parse(new string(p, start, len));
            }
        }

        private string ParseString()
        {
            index++;

            fixed (char* p = json)
            {
                char* pStart = p + index;
                char* pCur = p + index;

                buffer.Clear();
                for (; *pCur != '\0'; pCur++)
                {
                    if (*pCur == '\\')
                    {
                        char escape;
                        pCur = Escape(pCur, out escape);
                        if (escape != '\0')
                            buffer.Append(escape);

                        continue;
                    }

                    if (*pCur == '"')
                        break;

                    buffer.Append(*pCur);
                }

                index += (int)(pCur - pStart) + 1;
                return buffer.ToString();
            }
        }

        private object ParseOtherValue(JsonToken token)
        {
            fixed (char* p = json)
            {
                switch (token)
                {
                    case JsonToken.True:
                        Assert(string.CompareOrdinal("true", new string(p, index, 4)) != 0, "JSON格式错误!");
                        index += 4;
                        return true;

                    case JsonToken.False:
                        Assert(string.CompareOrdinal("false", new string(p, index, 5)) != 0, "JSON格式错误!");
                        index += 5;
                        return false;

                    case JsonToken.Null:
                        Assert(string.CompareOrdinal("null", new string(p, index, 4)) != 0, "JSON格式错误!");
                        index += 4;
                        return null;

                    default:
                        throw new ArgumentException("参数错误!");
                }
            }
        }

        private static bool IsNumberChar(char ch)
        {
            return (ch - '0' >= 0) && (ch - '0' <= 9);
        }

        private static bool IsWhiteSpace(char ch)
        {
            return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n';
        }

        private static void Assert(bool check, string message)
        {
            if (check)
                throw new ArgumentException(message);
        }

        private static char* Escape(char* p, out char ch)
        {
            ch = '\0';
            switch (*(++p))
            {
                case '"':
                case '\\':
                case '/':
                    ch = *p;
                    break;

                case 'b':
                    ch = '\b';
                    break;

                case 'f':
                    ch = '\f';
                    break;

                case 'n':
                    ch = '\n';
                    break;

                case 'r':
                    ch = '\r';
                    break;

                case 't':
                    ch = '\t';
                    break;

                case 'u':
                    ch = Unicode(++p);
                    p += 3;
                    break;
            }

            return p;
        }

        private static char Unicode(char* p)
        {
            return (char)int.Parse(new string(p, 0, 4), NumberStyles.HexNumber);
        }
    }
}


text:
package org.visallo.core.model.ontology;

import org.json.JSONArray;
import org.json.JSONException;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLOntologyLoaderConfiguration;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.vertexium.Authorizations;
import org.vertexium.query.Query;
import org.visallo.core.model.properties.types.VisalloProperty;
import org.visallo.core.security.VisalloVisibility;
import org.visallo.core.user.User;
import org.visallo.web.clientapi.model.ClientApiObject;
import org.visallo.web.clientapi.model.ClientApiOntology;

import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Set;

public interface OntologyRepository {
    String ENTITY_CONCEPT_IRI = "http://www.w3.org/2002/07/owl#Thing";
    String ROOT_CONCEPT_IRI = "http://visallo.org#root";
    String TYPE_RELATIONSHIP = "relationship";
    String TYPE_CONCEPT = "concept";
    String TYPE_PROPERTY = "property";
    String VISIBILITY_STRING = "ontology";
    String CONFIG_INTENT_CONCEPT_PREFIX = "ontology.intent.concept.";
    String CONFIG_INTENT_RELATIONSHIP_PREFIX = "ontology.intent.relationship.";
    String CONFIG_INTENT_PROPERTY_PREFIX = "ontology.intent.property.";
    String PUBLIC = "public-ontology";
    VisalloVisibility VISIBILITY = new VisalloVisibility(VISIBILITY_STRING);

    void clearCache();

    void clearCache(String workspaceId);

    Iterable<Relationship> getRelationships(String workspaceId);

    Iterable<Relationship> getRelationships(Iterable<String> ids, String workspaceId);

    Iterable<OntologyProperty> getProperties(String workspaceId);

    Iterable<OntologyProperty> getProperties(Iterable<String> ids, String workspaceId);

    String getDisplayNameForLabel(String relationshipIRI, String workspaceId);

    OntologyProperty getPropertyByIRI(String propertyIRI, String workspaceId);

    Iterable<OntologyProperty> getPropertiesByIRI(List<String> propertyIRIs, String workspaceId);

    OntologyProperty getRequiredPropertyByIRI(String propertyIRI, String workspaceId);

    Relationship getRelationshipByIRI(String relationshipIRI, String workspaceId);

    Iterable<Relationship> getRelationshipsByIRI(List<String> relationshipIRIs, String workspaceId);

    boolean hasRelationshipByIRI(String relationshipIRI, String workspaceId);

    Iterable<Concept> getConceptsWithProperties(String workspaceId);

    Concept getRootConcept(String workspaceId);

    Concept getEntityConcept();

    Concept getEntityConcept(String workspaceId);

    Concept getParentConcept(Concept concept, String workspaceId);

    Set<Concept> getAncestorConcepts(Concept concept, String workspaceId);

    Set<Concept> getConceptAndAncestors(Concept concept, String workspaceId);

    Concept getConceptByIRI(String conceptIRI, String workspaceId);

    Iterable<Concept> getConceptsByIRI(List<String> conceptIRIs, String workspaceId);

    Set<Concept> getConceptAndAllChildrenByIri(String conceptIRI, String workspaceId);

    Set<Concept> getConceptAndAllChildren(Concept concept, String workspaceId);

    Set<Relationship> getRelationshipAndAllChildren(Relationship relationship, String workspaceId);

    Set<Relationship> getRelationshipAndAllChildrenByIRI(String relationshipIRI, String workspaceId);

    Relationship getParentRelationship(Relationship relationship, String workspaceId);

    Set<Relationship> getAncestorRelationships(Relationship relationship, String workspaceId);

    Set<Relationship> getRelationshipAndAncestors(Relationship relationship, String workspaceId);

    Iterable<Concept> getConcepts(Iterable<String> ids, String workspaceId);

    void deleteConcept(String conceptTypeIri, User user, String workspaceId);

    void deleteProperty(String conceptTypeIri, User user, String workspaceId);

    void deleteRelationship(String conceptTypeIri, User user, String workspaceId);

    Concept getOrCreateConcept(Concept parent, String conceptIRI, String displayName, File inDir, User user, String workspaceId);

    Concept getOrCreateConcept(Concept parent, String conceptIRI, String displayName, String glyphIconHref, String color, File inDir, User user, String workspaceId);

    Concept getOrCreateConcept(Concept parent, String conceptIRI, String displayName, File inDir, boolean deleteChangeableProperties, User user, String workspaceId);

    Concept getOrCreateConcept(Concept parent, String conceptIRI, String displayName, String glyphIconHref, String color, File inDir, boolean deleteChangeableProperties, User user, String workspaceId);

    Relationship getOrCreateRelationshipType(
            Relationship parent,
            Iterable<Concept> domainConcepts,
            Iterable<Concept> rangeConcepts,
            String relationshipIRI,
            boolean deleteChangeableProperties,
            User user,
            String workspaceId
    );

    Relationship getOrCreateRelationshipType(
            Relationship parent,
            Iterable<Concept> domainConcepts,
            Iterable<Concept> rangeConcepts,
            String relationshipIRI,
            String displayName,
            boolean deleteChangeableProperties,
            User user,
            String workspaceId
    );

    void addDomainConceptsToRelationshipType(String relationshipIri, List<String> conceptIris, User user, String workspaceId);

    void addRangeConceptsToRelationshipType(String relationshipIri, List<String> conceptIris, User user, String workspaceId);

    OntologyProperty getOrCreateProperty(OntologyPropertyDefinition ontologyPropertyDefinition, User user, String workspaceId);

    OWLOntologyManager createOwlOntologyManager(OWLOntologyLoaderConfiguration config, IRI excludeDocumentIRI) throws Exception;

    void resolvePropertyIds(JSONArray filterJson, String workspaceId) throws JSONException;

    void importResourceOwl(Class baseClass, String fileName, String iri, Authorizations authorizations);

    void importFile(File inFile, IRI documentIRI, Authorizations authorizations) throws Exception;

    void importFileData(byte[] inFileData, IRI documentIRI, File inDir, Authorizations authorizations) throws Exception;

    void writePackage(File file, IRI documentIRI, Authorizations authorizations) throws Exception;

    ClientApiOntology getClientApiObject(String workspaceId);

    Ontology getOntology(String workspaceId);

    String guessDocumentIRIFromPackage(File inFile) throws Exception;

    Concept getConceptByIntent(String intent, String workspaceId);

    String getConceptIRIByIntent(String intent, String workspaceId);

    Concept getRequiredConceptByIntent(String intent, String workspaceId);

    Concept getRequiredConceptByIRI(String iri, String workspaceId);

    String getRequiredConceptIRIByIntent(String intent, String workspaceId);

    Relationship getRelationshipByIntent(String intent, String workspaceId);

    String getRelationshipIRIByIntent(String intent, String workspaceId);

    Relationship getRequiredRelationshipByIntent(String intent, String workspaceId);

    String getRequiredRelationshipIRIByIntent(String intent, String workspaceId);

    OntologyProperty getPropertyByIntent(String intent, String workspaceId);

    String getPropertyIRIByIntent(String intent, String workspaceId);

    <T extends VisalloProperty> T getVisalloPropertyByIntent(String intent, Class<T> visalloPropertyType, String workspaceId);

    <T extends VisalloProperty> T getRequiredVisalloPropertyByIntent(String intent, Class<T> visalloPropertyType, String workspaceId);

    List<OntologyProperty> getPropertiesByIntent(String intent, String workspaceId);

    OntologyProperty getRequiredPropertyByIntent(String intent, String workspaceId);

    String getRequiredPropertyIRIByIntent(String intent, String workspaceId);

    OntologyProperty getDependentPropertyParent(String iri, String workspaceId);

    void addConceptTypeFilterToQuery(Query query, String conceptTypeIri, boolean includeChildNodes, String workspaceId);

    void addConceptTypeFilterToQuery(Query query, Collection<ElementTypeFilter> filters, String workspaceId);

    void addEdgeLabelFilterToQuery(Query query, String edgeLabel, boolean includeChildNodes, String workspaceId);

    void addEdgeLabelFilterToQuery(Query query, Collection<ElementTypeFilter> filters, String workspaceId);

    void updatePropertyDependentIris(OntologyProperty property, Collection<String> dependentPropertyIris, User user, String workspaceId);

    void updatePropertyDomainIris(OntologyProperty property, Set<String> domainIris, User user, String workspaceId);

    String generateDynamicIri(Class type, String displayName, String workspaceId, String... extended);

    void publishConcept(Concept concept, User user, String workspaceId);

    void publishRelationship(Relationship relationship, User user, String workspaceId);

    void publishProperty(OntologyProperty property, User user, String workspaceId);

    class ElementTypeFilter implements ClientApiObject {
        public String iri;
        public boolean includeChildNodes;

        public ElementTypeFilter() {

        }

        public ElementTypeFilter(String iri, boolean includeChildNodes) {
            this.iri = iri;
            this.includeChildNodes = includeChildNodes;
        }
    }
}


text:
;(function ($, crud){
    var mdes = {};
    bind_events();
    $.widget("crud.crud_editor", {
        options: {},
        _create: function(){
            switch (this.element.data('type'))
            {
                case 'tinymce':
                    createTinyMCE(this.element);
                break;
                case 'summernote':
                    createSummernote(this.element);
                break;
                case 'mde':
                    createMDE(this.element);
                break;
                default:
                    createTextarea(this.element);
                break;
            }
        }
    });

    function createMDE(elem)
    {
        mdes[elem.attr('id')] = new SimpleMDE({
            element: elem[0],
            toolbar: ["heading","bold", "italic", "strikethrough", "|", "code","quote","|","unordered-list","ordered-list","|","link","image","table","|","clean-block","|","preview","guide"],
            spellChecker:false
        });
    }

    function createSummernote(elem)
    {
        $('.note-popover').hide();
        var toolbar = crud.action(elem, 'summernote_build_toolbar');
        if (!toolbar) {
            toolbar = [
                ['style', ['style', 'bold', 'italic', 'underline', 'clear']],
                ['font', ['strikethrough', 'superscript', 'subscript']],
                ['fontsize', ['fontsize']],
                ['color', ['color']],
                ['para', ['ul', 'ol', 'paragraph']],
                ['insert', elem.data('no-media') ? ['link', 'anchor', 'table', 'hr'] : ['picture', 'link', 'anchor', 'video', 'table', 'hr']],
                ['misc', ['codeview', 'typo', 'typo2']]
            ];
        }

        var popover = crud.action($.summernote.options.popover, 'summernote_build_popover') || $.summernote.options.popover;
        var buttons = {anchor: snAnchorButton(), typo: snTypoButton(), typo2: snTypoButton2()};
        buttons = crud.action(buttons, 'summernote_build_buttons') || buttons;

        elem.summernote({
            //FIXME
            lang: 'ru-RU',
            toolbar: toolbar,
            callbacks: {
                onPaste: function (e) {
                    var ed = $(this);

                    setTimeout(function () {
                        var cleaned = crud.action(ed, 'summernote_paste_html');
                        if (cleaned) {
                            ed.summernote('code', cleaned);
                        }
                    }, 10);
                },
            },
            popover: popover,
            modules: $.extend($.summernote.options.modules, {anchorDialog: snAnchorDialog()}),
            buttons: buttons,
            //modules: {
            //AnchorDialog: getAnchorDialog()
            //},
            height: elem.data('height'), linksArray: crud.win.crudAttachOptions
        });
    }

    function createTinyMCE(elem)
    {
        //if (container)
        //{
        //    container.append($('<input type="hidden" name="_attach_to_link_" id="_attach_to_link_" />'))
        //}
        tinymce.init({
            selector: elem.attr('id'),
            height: elem.data('height'),
            toolbar: "paste  | undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media | code",
            plugins: ["image", "link", "media", "code"] ,
            paste_as_text: true,
            automatic_uploads: false,
            relative_urls : false,
            remove_script_host : false,
            convert_urls : true,
            image_advtab: true,

            file_picker_callback: function(callback, value, meta) {
                if (!$('#tiny_file').length)
                {
                    $('<input type="file" class="input" name="tiny_file" id="tiny_file" style="display: none"/>').appendTo('body');

                    $('#tiny_file').on('change', function (event) {

                        $('.mce-widget.mce-btn.mce-primary.mce-first').css({left:'350px', width:'100px'}).find('button span').text('Loading...');
                        var formData = new FormData();
                        formData.append("file", this.files[0]);
                        $.ajax({
                            url : '/admin/crud/attach_upload',
                            type : 'POST',
                            data : formData,
                            processData: false,
                            contentType: false,
                            success : function(data) {
                                $('.mce-widget.mce-btn.mce-primary.mce-first').css({left:'411px', width:'50px'}).find('button span').text('Ok');

                                $('#_attach_to_link_').val($('#_attach_to_link_').val() + ' '+data.id);
                                if (meta.filetype == 'file') {
                                    callback(data.url);
                                }

                                // Provide image and alt text for the image dialog
                                if (meta.filetype == 'image') {
                                    callback(data.url, {width:data.width, height:data.height});
                                }
                            }
                        });
                    });

                }
                $('#tiny_file').trigger('click');

            },
            //FIXME
            language: i18n.say('locale_short')
        });

    }

    function createTextarea(elem)
    {
        elem.css('height', elem.data('height'));
    }

    function snAnchorDialog()
    {
        var AnchorDialog = function (context) {
            var self = this;
            var ui = $.summernote.ui;

            var $editor = context.layoutInfo.editor;
            var options = context.options;
            var lang = options.langInfo;

            this.initialize = function () {
                var $container = options.dialogsInBody ? $(document.body) : $editor;

                var body = '
' +
                    'Имя якоря' +
                    '<input class="note-anchor-name form-control" type="text" />' +
                    '
';
                var footer = '<button href="#" class="btn btn-primary note-anchor-btn disabled" disabled>Вставить</button>';

                this.$dialog = ui.dialog({
                    className: 'anchor-dialog',
                    title: 'Вставить якорь',
                    fade: options.dialogsFade,
                    body: body,
                    footer: footer
                }).render().appendTo($container);
            };

            this.destroy = function () {
                ui.hideDialog(this.$dialog);
                this.$dialog.remove();
            };

            this.showAnchorDialog = function (ancInfo) {
                return $.Deferred(function (deferred) {
                    var $ancName = self.$dialog.find('.note-anchor-name'),
                        $ancBtn = self.$dialog.find('.note-anchor-btn');

                    ui.onDialogShown(self.$dialog, function () {
                        context.triggerEvent('dialog.shown');

                        $ancName.val(ancInfo.name);

                        $ancName.on('input', function () {
                            ui.toggleBtn($ancBtn, $ancName.val());
                            // if linktext was modified by keyup,
                            // stop cloning text from linkUrl
                            ancInfo.name = $ancName.val();
                        });

                        $ancBtn.one('click', function (event) {
                            event.preventDefault();

                            deferred.resolve({
                                range: ancInfo.range,
                                name: $ancName.val()
                            });
                            self.$dialog.modal('hide');
                        });
                    });

                    ui.onDialogHidden(self.$dialog, function () {
                        // detach events
                        $ancName.off('input keypress');
                        $ancBtn.off('click');

                        if (deferred.state() === 'pending') {
                            deferred.reject();
                        }
                    });

                    ui.showDialog(self.$dialog);
                }).promise();
            };

            /**
             * @param {Object} layoutInfo
             */
            this.show = function () {
                //var ancInfo = context.invoke('editor.getLinkInfo');
                var ancInfo = snAnchorInfo(context);

                context.invoke('editor.saveRange');
                this.showAnchorDialog(ancInfo).then(function (ancInfo) {
                    context.invoke('editor.restoreRange');
                    //context.invoke('editor.createAnchor', ancInfo);
                    snCreateAnchor(context, ancInfo);
                }).fail(function () {
                    context.invoke('editor.restoreRange');
                });
            };
            //context.memo('help.anchorDialog.show', options.langInfo.help['anchorDialog.show']);
        };

        return AnchorDialog;
    }

    function snCreateAnchor(context, ancInfo)
    {
        var ancName = ancInfo.name;
        var rng = ancInfo.range || context.invoke('editor.createRange');
        //var isTextChanged = rng.toString() !== linkText;

        //if (options.onCreateLink) {
        //    linkUrl = options.onCreateLink(linkUrl);
        //}

        //console.log(rng);

        var anchors = [rng.insertNode($('')[0])];
        //var anchor = rng.insertNode($('')[0]);
        //if (isTextChanged) {
        //    rng = rng.deleteContents();
        //    var anchor = rng.insertNode($('' + linkText + '')[0]);
        //    anchors.push(anchor);
        //} else {
        //    anchors = style.styleNodes(rng, {
        //        nodeName: 'A',
        //        expandClosestSibling: true,
        //        onlyPartialContains: true
        //    });
        //}

        //$.each(anchors, function (idx, anchor) {
        //    $(anchor).attr('href', linkUrl);
        //    if (isNewWindow) {
        //        $(anchor).attr('target', '_blank');
        //    } else {
        //        $(anchor).removeAttr('target');
        //    }
        //});

        return rng.select();

        //var startRange = range.createFromNodeBefore(list.head(anchors));
        //var startPoint = startRange.getStartPoint();
        //var endRange = range.createFromNodeAfter(list.last(anchors));
        //var endPoint = endRange.getEndPoint();
        //
        //range.create(
        //    startPoint.node,
        //    startPoint.offset,
        //    endPoint.node,
        //    endPoint.offset
        //).select();
    }

    function snAnchorInfo(context)
    {
        var checkAnc = function (node) {return node && node.nodeName.toUpperCase() === 'A'};
        var rng = context.invoke('editor.createRange').expand(checkAnc);

        // Get the first anchor on range(for edit).
        var $anchor = $(rng.nodes(checkAnc)[0]);

        return {
            range: rng,
            name: $anchor.length ? $anchor.attr('name') : ''
        };
    }

    function snAnchorButton()
    {
        var AnchorButton = function (context) {
            var ui = $.summernote.ui;

            // create button
            var button = ui.button({
                contents: '',
                tooltip: 'Якорь',
                click: function () {
                    // invoke insertText method with 'hello' on editor module.
                    context.invoke('anchorDialog.show');
                    //context.createInvokeHandler('anchorDialog.show')
                }
            });

            return button.render();   // return button as jquery object
        }
        return AnchorButton;
    }

    function snTypoButton()
    {
        var TypoButton = function (context) {
            var ui = $.summernote.ui;

            // create button
            var button = ui.button({
                contents: '',
                tooltip: 'Типограф (typograf.artlebedev.ru)',
                click: function () {
                    if (confirm('Содержимое будет модифицировано. Продолжить ?'))
                    {
                        $.post('/typo/check', {content: context.code()}, function(res){
                            context.code(res);
                        });
                    }
                }
            });

            return button.render();   // return button as jquery object
        }
        return TypoButton;
    }

    function snTypoButton2()
    {
        var TypoButton2 = function (context) {
            var ui = $.summernote.ui;

            // create button
            var button = ui.button({
                contents: '',
                tooltip: 'Типограф (www.typograf.ru)',
                click: function () {
                    if (confirm('Содержимое будет модифицировано. Продолжить ?'))
                    {
                        $.post('/typo/check2', {content: context.code()}, function(res){
                            context.code(res);
                        });
                    }
                }
            });

            return button.render();   // return button as jquery object
        }
        return TypoButton2;
    }

    function bind_events()
    {
        crud.bind("form.before_validate", function(data){
            $('textarea[data-widget=crud_editor]', data['form']).each(function(){
                switch($(this).data('type'))
                {
                    case 'mde':
                        if (mdes[this.id])
                        {
                            $(this).val(mdes[this.id].value());
                        }
                    break;
                    case 'summernote':
                        var v = crud.action($(this), 'summernote_save_html');
                        if (v === false) {
                            v = $(this).summernote('code');
                        }
                        $(this).val(v);
                    break;
                }
                $(this).trigger('change');
            });
        });
    }

})(jQuery, CRUD)


text:
// SPDX-License-Identifier: BSD-3-Clause

#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"

float64_t
 softfloat_normRoundPackToF64( bool sign, int_fast16_t exp, uint_fast64_t sig )
{
    int_fast8_t shiftCount;
    union ui64_f64 uZ;

    shiftCount = softfloat_countLeadingZeros64( sig ) - 1;
    exp -= shiftCount;
    if ( (10 <= shiftCount) && ((uint16_t) exp < 0x7FD) ) {
        uZ.ui = packToF64UI( sign, sig ? exp : 0, sig<<(shiftCount - 10) );
        return uZ.f;
    } else {
        return softfloat_roundPackToF64( sign, exp, sig<<shiftCount );
    }

}


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="horizontal" >

    <EditText android:id="@+id/email_address"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:hint="@string/email_address"
     />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="verifyEmail"
        android:text="@string/button_submit" />

</LinearLayout>


text:
  Lamagistère est
      une commune géographiquement positionnée dans le département de Tarn-et-Garonne en Midi-Pyrénées. Elle comptait 1 220 habitants en 2008.

La ville compte quelques  aménagements, elle propose entre autres un terrain de tennis et un terrain de sport.

Le parc d'habitations, à Lamagistère, était réparti en 2011 en 66 appartements et 551 maisons soit
 un marché plutôt équilibré.

À Lamagistère, la valorisation moyenne à la vente d'un appartement se situe à zero € du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 725 € du m². À la location la valeur moyenne se situe à 4,69 € du m² mensuel.

À coté de Lamagistère sont situées les villes de
Saint-Loup à 4 km, 443 habitants,
Golfech située à 2 km, 814 habitants,
Clermont-Soubiran située à 1 km, 378 habitants,
Saint-Romain-le-Noble localisée à 5 km, 406 habitants,
Valence située à 5 km, 5 103 habitants,
Saint-Nicolas-de-la-Balerme à 5 km, 401 habitants,
 entre autres. De plus, Lamagistère est située à seulement 19 km de Agen.


text:
import {Type} from 'angular2/src/core/facade/lang';
import {GetterFn, SetterFn, MethodFn} from './types';
import {List} from 'angular2/src/core/facade/collection';

export interface PlatformReflectionCapabilities {
  isReflectionEnabled(): boolean;
  factory(type: Type): Function;
  interfaces(type: Type): List<any>;
  parameters(type: Type): List<List<any>>;
  annotations(type: Type): List<any>;
  getter(name: string): GetterFn;
  setter(name: string): SetterFn;
  method(name: string): MethodFn;
}