text:
Examples
========

Airfoil
-------
This example on building an airfoil NURBS curve with occ_airconics is included in the [occ_airconics core Qt viewer examples](https://github.com/p-chambers/occ_airconics/tree/master/examples/core).

First import the primitives module in which the Airfoil class is contained and the `pythonocc-core` Qt viewer:
```python
from airconics import primitives
# Visualisation with Python-OCC (ensure plot windows are set to qt)
from OCC.Display.SimpleGui import init_display
display, start_display, add_menu, add_function_to_menu = init_display()
```

Next, define the inputs to Airfoil class. In this example, we'll use the `SeligProfile` type airfoil, leading edge point in origin, unit chord along x axis, no rotation around the x or y axes.

*Note: This class also supports construction of NACA 4 digit profiles using input keyword `NACA4Profile`. See [Airfoil API reference](http://occ-airconics.readthedocs.io/en/latest/reference.html#airconics.primitives.Airfoil).*

```python
LEPoint = [0., 0., 0.]
ChordLength = 1
Rotation = 0
Twist = 0
AirfoilSeligName = 'dae11'

# Instantiate class to set up a generic airfoil with these basic parameters
Af = primitives.Airfoil(LEPoint, ChordLength, Rotation, Twist,
                        SeligProfile=AirfoilSeligName)
```

Finally, display the curve and chord line

```python
display.DisplayShape(Af.Curve, update=True)
display.DisplayShape(Af.ChordLine, update=True)
start_display()
```

![Airfoil curve and chordline](Images/Airfoil.png)

Transonic Airliner
------------------

In this example, the transonic airliner geometry example from the Rhinoceros Airconics plugin [1] is shown. All renderings are static images here, but represent interactive renderings when run as an IPython notebook available [here](https://github.com/p-chambers/occ_airconics/blob/master/examples/notebooks/notebook_examples.ipynb). Interactive shapes can be viewed by clicking the shape hyperlinks however, as produced by the *PythonOCC* *x3dom* renderer.

For examples using the *pythonocc-core* Qt viewer, refer to the *occ-airconics* [examples/core directory](https://github.com/p-chambers/occ_airconics/tree/master/examples/core)

```python
from airconics import liftingsurface, engine, fuselage_oml
import airconics.AirCONICStools as act
from airconics.Addons.WebServer.TornadoWeb import TornadoWebRenderer
from IPython.display import display
```

### Parameter Definitions
Parameters used here correspond to a geometry similar to that of the Boeing 787-8

```python
Propulsion=1
EngineDia=2.9
FuselageScaling=[55.902, 55.902, 55.902]
WingScaleFactor=44.56
WingChordFactor=1.0
Topology=1
EngineSpanStation=0.31
EngineCtrBelowLE=0.3558
EngineCtrFwdOfLE=0.9837
Scarf_deg=3

# Derived Parameters
FuselageHeight = FuselageScaling[2]*0.105
FuselageLength = FuselageScaling[0]
FuselageWidth  = FuselageScaling[1]*0.106
WingApex = [0.1748*FuselageLength,0,-0.0523*FuselageHeight]
# Fin:
FinChordFact = 1.01
FinScaleFact = WingScaleFactor/2.032
# TailPlane
TPChordFact = 1.01
TPScaleFact = WingScaleFactor * 0.388
# Engine:
NacelleLength = 1.95*EngineDia
```

### Wing, Transonic Airliner

Formulation of lifting surfaces in `occ_airconics` (and AirCONICS) follows the suggestions in Sobester [2] in which geometry--attached curvilinear functionals are used instead of parameters for shape definition. That is, \\(G(\bf{f}, \bf{X})\\), where

$$\qquad \textbf{f} = \left[ f_1(\textbf{X}_1), f_2(\textbf{X}_2), ... f_m(\textbf{X}_m)\right],$$
and

$$\textbf{X}_i = \left[x_1^i, x_2^i,...\right], \forall i = 1,...m$$

as opposed to the conventional \\(G(\bf{X})\\) formulation where the shape \\(G\\) changes in response to changes in design parameters \\(\textbf{X}\\). The functions \\(f_i\\) are defined by:

> $$Sweep (\epsilon)$$

> $$Chord (\epsilon)$$

> $$Rotation (\epsilon)$$

> $$Twist (\epsilon)$$

> $$Airfoil (\epsilon)$$

where \\(\epsilon\\) represents the spanwise coordinate ranging from 0 at the root of the wing to 1 at the tip. Output of the airfoil function uses the `airconics.primitives.Airfoil` class here, which fits a NURBS curve to airfoil coordinates.

The following code demonstrates construction of a wing using built in examples for a transonic airliner wing and tailplane (below).

```python
# Import all example functional definitions for the Common Research Model (CRM) Wing:
from airconics.examples.wing_example_transonic_airliner import *

# Position of the apex of the wing
P = WingApex

# Class definition
NSeg = 11
ChordFactor = 1
ScaleFactor = 50

# Generate (surface building is done during construction of the class)
Wing = liftingsurface.LiftingSurface(P, mySweepAngleFunctionAirliner,
                                        myDihedralFunctionAirliner,
                                        myTwistFunctionAirliner,
                                        myChordFunctionAirliner,
                                        myAirfoilFunctionAirliner,
                                        SegmentNo=NSeg,
                                        ScaleFactor=WingScaleFactor,
                                        ChordFactor=WingChordFactor)

# Evaluate the root chord:
RootChord = Wing.RootChord

# Display
renderer = TornadoWebRenderer()
Wing.Display(renderer)
display(renderer)
```

[![occ airconics wing](Images/Wing.png)](_interact/x3domwing.html)

[Interactive x3dom output](_interact/x3domwing.html)

### Tailplane, Transonic Airliner

The same `Lifting Surface` class is used here to generate the fin and tailplane of the aircraft, using a different set of input functionals (also defined in `airconics.examples`).

```python
from OCC.gp import gp_Ax1, gp_Pnt, gp_Dir
from airconics.examples.tailplane_example_transonic_airliner import *

# Position of the apex of the fin
P = [36.98-0.49-0.02, 0.0, 2.395-0.141]

SegmentNo = 10

Fin = liftingsurface.LiftingSurface(P, mySweepAngleFunctionFin,
                                    myDihedralFunctionFin,
                                    myTwistFunctionFin,
                                    myChordFunctionFin,
                                    myAirfoilFunctionFin,
                                    SegmentNo=SegmentNo,
                                    ChordFactor=FinChordFact,
                                    ScaleFactor=FinScaleFact)

#    Create the rotation axis centered at the apex point in the x direction
RotAxis = gp_Ax1(gp_Pnt(*P), gp_Dir(1, 0, 0))

Fin.RotateComponents(RotAxis, 90)

# Position of the apex of the tailplane
P = [43, 0.000, 1.633+0.02]

SegmentNo = 100
ChordFactor = 1.01
ScaleFactor = 17.3

TP = liftingsurface.LiftingSurface(P, mySweepAngleFunctionTP,
                                   myDihedralFunctionTP,
                                   myTwistFunctionTP,
                                   myChordFunctionTP,
                                   myAirfoilFunctionTP,
                                   SegmentNo=SegmentNo,
                                   ChordFactor=TPChordFact,
                                   ScaleFactor=TPScaleFact)

# Display
renderer = TornadoWebRenderer()
Fin.Display(renderer)
TP.Display(renderer)
display(renderer)
```
[![occ_airconics fin and tailplane rendering](Images/Fin_Tailplane.png)](_interact/x3domfin_tp.html)

[Interactive x3dom Fin](_interact/x3domfin_tp.html)

### Fuselage Transonic Airliner

Fuselage shapes are created following the parameterisation used in Sobester [3]. That is, the outer mould line (OML) is split into a `Nose`, `Central` and `Tail` section, the length of which is described on input to `Fuselage` class as a percentage of the total length. Rib curves are then formed by fitting a NURBS curve to the intersection points of sectional planar cuts and the guide curves of the extremeties of the OML e.g. Port, top and bottom curves. The OML is fitted in `occ_airconics` using the Open CASCADE `ThruSections` loft.

```python
NoseLengthRatio=0.182
TailLengthRatio=0.293

Fus = fuselage_oml.Fuselage(NoseLengthRatio, TailLengthRatio,
                            Scaling=FuselageScaling,
                            NoseCoordinates=[0., 0., 0],
                            CylindricalMidSection=False,
                            Maxi_attempt=5)

# Display
renderer = TornadoWebRenderer()
Fus.Display(renderer)
display(renderer)
```

    ('Surface fit attempt ', 1)
    ('Attempting thrusections surface fit with network density                setup ', array([35, 30, 15,  5, 20]))
    Network surface fit succesful on attempt 1

[![occ_airconics Fuselage rendering](Images/Fuselage.png)](_interact/x3domfuselage.html)

[Interactive x3dom Fuselage](_interact/x3domfuselage.html)

### Wing-Body Fairing:
The wing-body fairing is here created as a simple ellipsoid shape around the root section of the wing.

*Note that this component will be displayed only in the final model.*

```python
# WingBodyFairing: A simple ellipsoid:
from airconics.base import AirconicsShape
WTBFZ = RootChord*0.009 #787: 0.2
WTBFheight = 1.8*0.1212*RootChord #787:2.7
WTBFwidth = 1.08*FuselageWidth
WTBFXCentre = WingApex[0] + RootChord/2.0 + RootChord*0.1297 # 787: 23.8
WTBFlength = 1.167*RootChord #787:26

WBF_shape = act.make_ellipsoid([WTBFXCentre, 0, WTBFZ], WTBFlength, WTBFwidth, WTBFheight)
WBF = AirconicsShape(components={'WBF': WBF_shape})
```

### Engine + Pylon

First, obtain the wing section and chord at which the engine will be fitted, then fit then engine. The default inputs to the Engine class produce a turbofan engine with Nacelle similar to that of the RR Trent 1000 / GEnx and its pylon (**currently a flat plate only**).

```python
from airconics import engine

EngineSection, Chord = act.CutSect(Wing['Surface'], EngineSpanStation)
CEP = Chord.EndPoint()
Centreloc = [CEP.X()-EngineCtrFwdOfLE*NacelleLength,
            CEP.Y(),
            CEP.Z()-EngineCtrBelowLE*NacelleLength]

eng =  engine.Engine(Chord,
                     CentreLocation=Centreloc,
                     ScarfAngle=Scarf_deg,
                     HighlightRadius=EngineDia/2.0,
                     MeanNacelleLength=NacelleLength)

# Display
renderer = TornadoWebRenderer()
eng.Display(renderer)
display(renderer)
```
[![occ_airconics Engine rendering](Images/Engine.png)](_interact/x3domengine.html)

[Interactive x3dom Engine](_interact/x3domengine.html)

### Miscelaneous operations

```python
# Trim the inboard section of the main wing:
CutCirc = act.make_circle3pt([0,WTBFwidth/4.,-45], [0,WTBFwidth/4.,45], [90,WTBFwidth/4.,0])
CutCircDisk = act.PlanarSurf(CutCirc)
Wing['Surface'] = act.TrimShapebyPlane(Wing['Surface'], CutCircDisk)

#Mirror the main wing and tailplane using class methods:
Wing2 = Wing.MirrorComponents(plane='xz')
TP2 = TP.MirrorComponents(plane='xz')
eng2 = eng.MirrorComponents(plane='xz')
```

    can work? True
    error status: - Ok
    Note: MirrorComponents currently mirrors only the shape
    components, other attributes will not be mirrored

    Note: MirrorComponents currently mirrors only the shape
    components, other attributes will not be mirrored

    Note: MirrorComponents currently mirrors only the shape
    components, other attributes will not be mirrored

### Ipython Cell Renderer:
Now render the finished airliner model:

```python
from airconics.Addons.WebServer import TornadoWeb
renderer = TornadoWeb.TornadoWebRenderer()
#    display all entities:
# Fuselage and wing-body fairing
Fus.Display(renderer)
WBF.Display(renderer)

# #The Wings:
Wing.Display(renderer)
Wing2.Display(renderer)

#The Tailplane:
TP.Display(renderer)
TP2.Display(renderer)

#The Fin:
Fin.Display(renderer)

#The Engines:
eng.Display(renderer)
eng2.Display(renderer)

# Finally show the renderer
display(renderer)
```

[![occ_airconics Airliner rendering](Images/Airliner.png)](_interact/x3domairliner.html)

[Interactive x3dom Airliner](_interact/x3domairliner.html)

## Topology model

This is a work in progress towards a topologically flexible model based on the tree-type definition described in Sobester [1]. Note the geometry is not currently defined by the tree however, the tree is simply stored as a result of adding components - this is for demonstration only, and the process is yet to be automated.

### Transonic Airliner Topology

First, we'll try to add the previously created [transonic airliner](#transonic-airliner) components to a `Topology`, including the number of descendant nodes that will be attached to each, and then display the resulting tree graph. The LISP representation of this tree could be described as

**Fuselage(Fin, Mirror[ (TailPlane, Wing(Engine))]**,

where opening brackets indicate that the following component is to be `atttached' to the preceeding shape. Using the shorthand described in [1], this is equivalent to \\(E(L, \|L, L(P))\\), where \\(E\\) is an enclosure/fuselage object, \\(L\\) is a lifting surface, \\(|\\) is a mirror plane and \\(P\\) is a propulsion unit [1]. Study the Airliner model above and recursively work through the components, starting from the fuselage, and think about the sub-components are attached to them to assert that this is true.

The \\(xz\\) mirror plane is included in this representation, between central objects (Fuselage, Fin) and the mirrored objects (Tail Plane, Wing, Engine). Notice that the dotted line box surrounds the entities that will be mirrored when `Topology.Build()` is called.

```python
from airconics import Topology
from IPython.display import Image
import pydot
```

```python
topo_renderer = TornadoWebRenderer()

topo = Topology()

# Note: no checks are done on the validity of the tree yet,
topo.AddPart(Fus, 'Fuselage', 3)
topo.AddPart(Fin, 'Fin', 0)

# Need to add a mirror plane here, arity zero
from OCC.gp import gp_Ax2, gp_Dir, gp_Pnt
xz_pln = gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0))
topo.AddPart(xz_pln, 'Mirror', 0)

# These are the mirrored entities, with their arities
topo.AddPart(TP, 'Tail Plane', 0)
topo.AddPart(Wing, 'Wing', 1)
topo.AddPart(eng, 'Engine', 0)

# print the Topology (resembles a LISP tree)
print(topo)

# Create the graph with pydot
graph = pydot.graph_from_dot_data(topo.export_graphviz())
Image(graph.create_png())
```

    Skipping geometry construction for Topology
    E(L, |L, L(P))

![png](Images/notebook_examples_files/notebook_examples_26_1.png)

```python
# This line will mirror geometry 'under' (added after) the mirror plane
topo.Build()

topo.Display(topo_renderer)
display(topo_renderer)
```

    <class 'OCC.gp.gp_Ax2'>
    Note: MirrorComponents currently mirrors only the shape
    components, other attributes will not be mirrored

    Skipping geometry construction for AirconicsShape
    <class 'OCC.gp.gp_Ax2'>
    Note: MirrorComponents currently mirrors only the shape
    components, other attributes will not be mirrored

    Skipping geometry construction for AirconicsShape
    <class 'OCC.gp.gp_Ax2'>
    Note: MirrorComponents currently mirrors only the shape
    components, other attributes will not be mirrored

    Skipping geometry construction for AirconicsShape
    Could not display shape type <class 'OCC.gp.gp_Ax2'>: skipping

[![occ_airconics Airliner rendering](Images/Airliner.png)](_interact/x3domairliner.html)

[Interactive x3dom Airliner](_interact/x3domairliner.html)

Let's try some further tests to the topology class representation using some other examples. For now, these are empty geometries, and inputs to the `Fuselage`, `LiftingSurface` and `Engine` classes are not yet included in the `Topology` tree.

### Predator UAV
![Predator UAV](Images/predator.jpg)
**Photo source: US Air Force**

```python
# Setup
# Create mock components, without generating any geometry
fus = Fuselage(construct_geometry=False)
engine = Engine(construct_geometry=False)
fin = LiftingSurface(construct_geometry=False)
mirror_pln = gp_Ax2()
wing = LiftingSurface(construct_geometry=False)
Vfin = LiftingSurface(construct_geometry=False)

# For now we must manually add parts and affinities
topo = Topology()
topo.AddPart(fus, 'Fuselage', 4)
topo.AddPart(engine, 'engine', 0)
topo.AddPart(fin, 'fin', 0)
topo.AddPart(mirror_pln, 'mirror_pln', 0)
topo.AddPart(wing, 'wing', 0)
topo.AddPart(Vfin, 'V-Fin', 0)

print(topo)

graph = pydot.graph_from_dot_data(topo.export_graphviz())
Image(graph.create_png())
```

    Skipping geometry construction for Fuselage
    No HChord specified to fit engine to: creating default
    Skipping geometry construction for Engine
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Skipping geometry construction for Topology
    E(P, L, |L, L)

![png](Images/notebook_examples_files/notebook_examples_30_1.png)

### Fairchild Republic A-10 Thunderbolt
![Tunderbolt aircraft](Images/thunderbolt.jpg)
**Photo source: Airman Magazine 1999**

```python
# Setup
# Create mock components, without generating any geometry
fus = Fuselage(construct_geometry=False)
mirror_pln = gp_Ax2()
engine = Engine(construct_geometry=False)
wing = LiftingSurface(construct_geometry=False)
tailplane = LiftingSurface(construct_geometry=False)
tail_fin = LiftingSurface(construct_geometry=False)

topo = Topology()
topo.AddPart(fus, 'Fuselage', 3)
topo.AddPart(mirror_pln, 'mirror', 0)
topo.AddPart(engine, 'powerplant', 0)
topo.AddPart(tailplane, 'Tailplane', 1)
topo.AddPart(tail_fin, "Tail fin", 0)
topo.AddPart(wing, "wing", 0)

print(topo)

graph = pydot.graph_from_dot_data(topo.export_graphviz())
Image(graph.create_png())
```

    Skipping geometry construction for Fuselage
    No HChord specified to fit engine to: creating default
    Skipping geometry construction for Engine
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Skipping geometry construction for Topology
    E(|P, L(L), L)

![png](Images/notebook_examples_files/notebook_examples_32_1.png)

### Scaled Composites Proteus
![SC Proteus aircraft](Images/Proteus.jpg)
**Photo source: NASA**

```python
# Setup
# Create mock components, without generating any geometry
fus = Fuselage(construct_geometry=False)
mirror_pln = gp_Ax2()
engine = Engine(construct_geometry=False)
wing_in = LiftingSurface(construct_geometry=False)
tailplane = LiftingSurface(construct_geometry=False)
pod = Fuselage(construct_geometry=False)
finup = LiftingSurface(construct_geometry=False)
findown = LiftingSurface(construct_geometry=False)
wing_out = LiftingSurface(construct_geometry=False)

topo = Topology()
topo.AddPart(fus, 'Fuselage', 3)
topo.AddPart(mirror_pln, 'mirror', 0)
topo.AddPart(engine, 'powerplant', 0)
topo.AddPart(wing, "wing", 0)
topo.AddPart(wing_in, "TP/inbbd wing", 1)
topo.AddPart(pod, 'Pod/tail boom', 3)
topo.AddPart(wing_out, "outbd wing", 0)
topo.AddPart(finup, "Fin (up)", 0)
topo.AddPart(findown, "Fin (down)", 0)

for node in topo._Tree:
    print(node)

graph = pydot.graph_from_dot_data(topo.export_graphviz())
Image(graph.create_png())
```

    Skipping geometry construction for Fuselage
    No HChord specified to fit engine to: creating default
    Skipping geometry construction for Engine
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Skipping geometry construction for Fuselage
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Lifting Surface functional parameters not defined:
    Initialising without geometry construction
    Skipping geometry construction for LiftingSurface
    Skipping geometry construction for Topology
    (Fuselage, E, 3)
    (mirror, |, 0)
    (powerplant, P, 0)
    (wing, L, 0)
    (TP/inbbd wing, L, 1)
    (Pod/tail boom, E, 3)
    (outbd wing, L, 0)
    (Fin (up), L, 0)
    (Fin (down), L, 0)

![png](Images/notebook_examples_files/notebook_examples_34_1.png)

## References

[1] Sobester, A., "Four Suggestions for Better Parametric Geometries,"
    10th AIAA Multidisciplinary Design Optimization Conference,
    AIAA SciTech, American Institute of Aeronautics and Astronautics,
    jan 2014.

[2] Sobester, A., "Self-Designing Parametric Geometries," 56th AIAA/ASCE/AH-
    S/ASC Structures, Structural Dynamics, and Materials Conference, AIAA
    SciTech, American Institute of Aeronautics and Astronautics, jan 2015.

```python

```


text:
import { ItemGroup, ItemData } from '../types/item'

import { Accordion, AccordionItem } from './accordion'
import Item from './item'

interface Props {
	items: ItemGroup[]
	selected: ItemData
}

export default ({ props }) => {
	const { items, selected } = props as Props

	return (
		<Accordion>
			{
				items.map(group => {
					return (
						<AccordionItem name={ `${ group.name } (${ group.items.length })` } group="item">
							{
								group.items.map(item => (
									<Item item={ item } selected={ selected } />
								))
							}
						</AccordionItem>
					)
				})
			}
		</Accordion>
	)
}

redpajama_set_name: RedPajamaGithub


text:
<com.marvinlabs.widget.progresspanel.ProgressPanel xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/progress_panel"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    style="@style/MarvinLabs.MainContainer"
    tools:context=".DemoActivity">

    <ListView
        android:id="@id/content_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.marvinlabs.widget.progresspanel.ProgressPanel>


text:
require "snmp2mkr/version"
require "snmp2mkr/cli"
require "snmp2mkr/engine"


text:
#ifndef BOOST_PP_IS_ITERATING
#if !defined(FUSION_AS_SET_0932005_1341)
#define FUSION_AS_SET_0932005_1341

#include <boost/preprocessor/iterate.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/fusion/container/set/set.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>

namespace boost { namespace fusion { namespace detail
{
    template <int size>
    struct as_set;

    template <>
    struct as_set<0>
    {
        template <typename Iterator>
        struct apply
        {
            typedef set<> type;
        };

        template <typename Iterator>
        BOOST_FUSION_GPU_ENABLED
        static typename apply<Iterator>::type
        call(Iterator)
        {
            return set<>();
        }
    };
}}}

#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/container/set/detail/preprocessed/as_set.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/as_set" FUSION_MAX_SET_SIZE_STR ".hpp")
#endif

/*=============================================================================
    Copyright (c) 2001-2011 Joel de Guzman

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

    This is an auto-generated file. Do not edit!
==============================================================================*/

#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif

namespace boost { namespace fusion { namespace detail
{
#define BOOST_FUSION_NEXT_ITERATOR(z, n, data)                                  \
    typedef typename fusion::result_of::next<BOOST_PP_CAT(I, n)>::type          \
        BOOST_PP_CAT(I, BOOST_PP_INC(n));

#define BOOST_FUSION_NEXT_CALL_ITERATOR(z, n, data)                             \
    typename gen::BOOST_PP_CAT(I, BOOST_PP_INC(n))                              \
        BOOST_PP_CAT(i, BOOST_PP_INC(n)) = fusion::next(BOOST_PP_CAT(i, n));

#define BOOST_FUSION_VALUE_OF_ITERATOR(z, n, data)                              \
    typedef typename fusion::result_of::value_of<BOOST_PP_CAT(I, n)>::type      \
        BOOST_PP_CAT(T, n);

#define BOOST_PP_FILENAME_1 <boost/fusion/container/set/detail/as_set.hpp>
#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_SET_SIZE)
#include BOOST_PP_ITERATE()

#undef BOOST_FUSION_NEXT_ITERATOR
#undef BOOST_FUSION_NEXT_CALL_ITERATOR
#undef BOOST_FUSION_VALUE_OF_ITERATOR

}}}

#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif

#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES

#endif
#else // defined(BOOST_PP_IS_ITERATING)
///////////////////////////////////////////////////////////////////////////////
//
//  Preprocessor vertical repetition code
//
///////////////////////////////////////////////////////////////////////////////

#define N BOOST_PP_ITERATION()

    template <>
    struct as_set<N>
    {
        template <typename I0>
        struct apply
        {
            BOOST_PP_REPEAT(N, BOOST_FUSION_NEXT_ITERATOR, _)
            BOOST_PP_REPEAT(N, BOOST_FUSION_VALUE_OF_ITERATOR, _)
            typedef set<BOOST_PP_ENUM_PARAMS(N, T)> type;
        };

        template <typename Iterator>
        BOOST_FUSION_GPU_ENABLED
        static typename apply<Iterator>::type
        call(Iterator const& i0)
        {
            typedef apply<Iterator> gen;
            typedef typename gen::type result;
            BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _)
            return result(BOOST_PP_ENUM_PARAMS(N, *i));
        }
    };

#undef N
#endif // defined(BOOST_PP_IS_ITERATING)


text:
let app = require("./app.js");

app.config(["$routeProvider",function($route) {
    $route
    .when('/', {
        templateUrl: "./views/home.html",
    })
    .when('/ng', {
        templateUrl: "./views/angular.html",
    })
    .when('/coolstuff', {
        templateUrl: "./views/coolstuff.html",
        controller: "coolController",
    })
    .when('/explain', {
        templateUrl: "./views/process.html",
    })
    .when('/explain1',{
        templateUrl: "./views/process_general.html",
    })
    .when('/explain2',{
        templateUrl: "./views/process_user.html",
    })
    .when('/explain3',{
        templateUrl: "./views/process_cool.html",
    })
    .when('/edit',{
        templateUrl: "./views/profile.html",
        controller: "editController",
    })
    .otherwise({
        template: "
This page does not exist. Honest.
",
    })
}]);


text:
package com.orange.entity.scene;

import com.orange.content.SceneBundle;

import android.view.KeyEvent;

public interface IScene extends IBaseScene{

	public void onSceneCreate(SceneBundle bundle);
	public void onSceneResume();
	public void onScenePause();
	public void onSceneDestroy();

	public boolean onKeyDown(int keyCode, KeyEvent event);
	public boolean onKeyUp(int keyCode, KeyEvent event);

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/bcg"
              android:orientation="vertical">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:clipToPadding="false"
        android:padding="8dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone"
                app:cardUseCompatPadding="true">

                <EditText
                    android:id="@+id/name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/name"/>
            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                app:cardUseCompatPadding="true">

                <EditText
                    android:id="@+id/address"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/address"/>
            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:visibility="gone"
                app:cardUseCompatPadding="true">

                <EditText
                    android:id="@+id/city"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/city"/>
            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:visibility="gone"
                app:cardUseCompatPadding="true">

                <EditText
                    android:id="@+id/postal_code"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/postal_code"
                    android:inputType="number"/>
            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                app:cardUseCompatPadding="true">

                <EditText
                    android:id="@+id/phone_number"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/phone_number"
                    android:inputType="phone"/>
            </android.support.v7.widget.CardView>

        </LinearLayout>
    </ScrollView>

    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="16dp">

        <Button
            android:id="@+id/add_address_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/add_address_button"/>

        <ProgressBar
            android:id="@+id/progress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:visibility="gone"/>
    </FrameLayout>
</LinearLayout>


text:
#include "IAnimationNode.h"
#include "IAnimationGraph.h"

namespace animation
{

	class IAnimationNodeConstruct
	{
	public:
		IAnimationNodeConstruct() { }
		virtual ~IAnimationNodeConstruct() { }
		virtual IAnimationNode* create(const std::string& _name, IAnimationGraph* _holder) = 0;
	};

	template <typename Type>
	class AnimationNodeConstruct :
		public IAnimationNodeConstruct
	{
	public:
		AnimationNodeConstruct() { }
		virtual ~AnimationNodeConstruct() { }
		virtual IAnimationNode* create(const std::string& _name, IAnimationGraph* _holder)
		{
			return new Type(_name, _holder);
		}
	};

} // namespace animation

#endif // __I_ANIMATION_NODE_CONSTRUCT_H__


text:
TOC
===

1. [HelloWorld](HelloWorld)
1. [HelloWorld_with_Type_annotations](HelloWorld_with_Type_annotations)
1. [HelloWorld_with_interface](HelloWorld_with_interface)
1. [HelloWorld_with_class](HelloWorld_with_class)
1. [HelloWorld_with_npm](HelloWorld_with_npm)


text:
Scapegoat
=========

A minimal node module providing utility methods to `escape` and `unescape` HTML entities

See the associated blog post, ["Creating and publishing a node.js module."](https://quickleft.com/blog/creating-and-publishing-a-node-js-module/)

## Installation

```shell
  npm install scapegoat --save
```

## Usage

```js
  var scapegoat = require('scapegoat')
      escape = scapegoat.escape,
      unescape = scapegoat.unescape;

  var html = '<h1>Hello World</h1>',
      escaped = escape(html),
      unescaped = unescape(escaped);

  console.log('html', html, 'escaped', escaped, 'unescaped', unescaped);
```

## Tests

```shell
   npm test
```

## Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.

## Release History

* 1.0.0 Refactor to avoid double unescape and to use npm scripts instead
  of makefile.  Also add link to associated blog post.
* 0.1.0 Initial release


text:
ALTER TABLE PID_ENTITY_ACCESSION
 DROP PRIMARY KEY CASCADE
/
DROP TABLE PID_ENTITY_ACCESSION CASCADE CONSTRAINTS PURGE
/

--
-- PID_ENTITY_ACCESSION  (Table)
--
CREATE TABLE PID_ENTITY_ACCESSION ( ID NUMBER NOT NULL, ACCESSION VARCHAR2(2500 BYTE) NOT NULL, DATABASE VARCHAR2(2500 BYTE) NOT NULL, PID_PHYSICALENTITY_ID NUMBER NOT NULL, BIG_ID VARCHAR2(2500 BYTE) NULL, PRIMARY KEY (ID), UNIQUE (ACCESSION, DATABASE), UNIQUE (BIG_ID) DISABLE, UNIQUE (ACCESSION, DATABASE, PID_PHYSICALENTITY_ID) ) TABLESPACE CABIO_FUT NOLOGGING NOCOMPRESS NOCACHE NOPARALLEL MONITORING
/


text:
#ifndef TENSORFLOW_CORE_LIB_CORE_THREADPOOL_OPTIONS_H_
#define TENSORFLOW_CORE_LIB_CORE_THREADPOOL_OPTIONS_H_

#include "tensorflow/core/platform/threadpool_options.h"

#endif  // TENSORFLOW_CORE_LIB_CORE_THREADPOOL_OPTIONS_H_


text:
"""actions module contains all actions."""

import os
import glob

modules = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = [ os.path.basename(f)[:-3] for f in modules]


text:
package org.jetbrains.idea.svn.lowLevel;

import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;

import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * User: Irina.Chernushina
 * Date: 7/30/12
 * Time: 5:41 PM
 */
public class SVNStoppableOutputStream extends OutputStream {
  private final OutputStream myLogStream;

  public SVNStoppableOutputStream(final OutputStream logStream) {
    myLogStream = logStream;
  }

  @Override
  public void write(int b) throws IOException {
    check();
    myLogStream.write(b);
  }

  @Override
  public void close() throws IOException {
    check();
    myLogStream.close();
  }

  @Override
  public void flush() throws IOException {
    check();
    myLogStream.flush();
  }

  @Override
  public void write(byte[] b, int off, int len) throws IOException {
    check();
    myLogStream.write(b, off, len);
  }

  private void check() throws IOException {
    ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    if (indicator != null && indicator.isCanceled()) {
      throw new IOException("Write request to canceled by user");
    }
  }
}


text:
require 'helper'

class TestServer < Test::Unit::TestCase
  should "return the default domain" do
    assert_not_nil NIS::yp_get_default_domain()
  end

  context "The NIS server (default domain)" do
    setup do
      @domain = NIS::yp_get_default_domain()
    end

    should "return a result on yp_match with the current user" do
      user = ENV['USER']
      result = NIS::yp_match(@domain, "passwd.byname", user)
      assert_not_nil result
      values = result.split(":")
      assert_equal user, values[0]
      assert values.length > 1
    end

    should "not return a result on yp_match with an inexisting user" do
      user = "thisisreallynotausernameihope"
      exception = assert_raise(NIS::YPError) { result = NIS::yp_match(@domain, "passwd.byname", user) }
      assert_equal NIS::YPERR_KEY, exception.code
    end
  end
end


text:
title: Immutant 0.1.0 Released
author: The Immutant Team
version: 0.1.0
layout: release
tags: [ releases ]
---

We're pleased as punch to announce the first official release of
Immutant - version **_0.1.0_**. We consider this release to be beta quality,
and lacks some of the features and API stability that will end up in the
1.0.0 release.

## What is Immutant?

Immutant is an application server for [Clojure](http://clojure.org).
It's an integrated platform built on [JBoss AS7](http://www.jboss.org/as7)
that aims to reduce the [incidental complexity](http://en.wikipedia.org/wiki/Accidental_complexity)
that comes along with real world applications.

## What's in this release?

For this first release, we've focused on the basics of application
[deployment](#{doc_chapter_for_version( '0.1.0', 'deployment' )})
and [initialization](#{doc_chapter_for_version( '0.1.0', 'initialization' )})
along with a few components:

* [Ring support](#{doc_chapter_for_version( '0.1.0', 'web' )})
* [Messaging](#{doc_chapter_for_version( '0.1.0', 'messaging' )})
* [Caching](#{doc_chapter_for_version( '0.1.0', 'caching' )})
* [Long-running services (daemons)](#{doc_chapter_for_version( '0.1.0', 'daemons' )})
* [Scheduled jobs](#{doc_chapter_for_version( '0.1.0', 'jobs' )})
* [REPL support](#{doc_chapter_for_version( '0.1.0', 'interactive' )})

## What's next?

Now that we have 0.1.0 out the door, we'll be focusing on:

* XA Transaction support
* Benchmarking to identify (and resolve!) performance bottlenecks
* Getting Immutant running on [OpenShift](http://openshift.com)
* General API simplification and improvement

## Get It

The simplest way to install 0.1.0 is via our Leiningen plugin. See
our [install page](/install/) for more details. Once you have it installed,
take a look at our [Getting Started](/news/tags/getting-started/) tutorials.
We'll be updating those and adding more in the next couple of weeks.

## Get In Touch

If you have any questions, issues, or other feedback about Immutant, you
can find us on [#immutant on freenode](/community/) or
[our mailing lists](/community/mailing_lists).
We'll also be at [Clojure/West](http://clojurewest.org) where Jim will be
[presenting Immutant](http://clojurewest.org/sessions/#crossley)
and we would love to chat with you.


text:
Edit Settings

Edit Filetypes


text:
//Problem 13. Count words

//Write a program that reads a list of words from the file words.txt and finds how many times each of the words is contained in another file test.txt.
//The result should be written in the file result.txt and the words should be sorted by the number of their occurrences in descending order.
//Handle all possible exceptions in your methods.

using System;
using System.Collections.Generic;
using System.IO;
using System.Security;
using System.Text.RegularExpressions;
using System.Linq;

class CountWords
{
    static void Main()
    {
        try
        {
            //path of the files
            const string textPath = "../../textfiles/text.txt";
            const string wordsPath = "../../textfiles/words.txt";
            const string resultPath = "../../textfiles/result.txt";
            //list for storage of the words
            List<string> wordsList = new List<string>();

            string[] words = File.ReadAllLines(wordsPath);

            //goes through every string row of the text array
            for (int i = 0; i < words.Length; i++)
            {
                //splits row and assigns it to an array
                string[] currentRow = words[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                //adds words to the words list
                foreach (var word in currentRow)
                {
                    if (!wordsList.Contains(word.ToLower()))
                    {
                        wordsList.Add(word.ToLower());
                    }
                }
            }
            //creates a dictionary to hold word/count pairs
            var wordsCount = new Dictionary<string, int>();

            string[] text = File.ReadAllLines(textPath);

            //goes through every string row of the text array
            for (int i = 0; i < text.Length; i++)
            {
                //splits row and assigns it to an array
                string[] currentRow = text[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                //adds word/count pairs to the dictionary
                for (int j = 0; j < currentRow.Length; j++)
                {

                    string currentWord = currentRow[j].ToLower().Trim(',', ' ', '-',';', ':', '/', '\\', '\"', '.');
                    if (wordsList.Contains(currentWord))
                    {
                        if (wordsCount.ContainsKey(currentWord))
                        {
                            wordsCount[currentWord]++;
                        }

                        else
                        {
                            wordsCount[currentWord] = 1;
                        }
                    }

                }
            }

            //writes results to the results file
            using (StreamReader reader = new StreamReader(textPath))
            {
                using (StreamWriter writer = new StreamWriter(resultPath))
                {
                        foreach (var word in wordsCount.OrderByDescending(key => key.Value))
                        {
                            writer.WriteLine(word.Key + ": " + word.Value + " time/s");
                        }
                }
            }

            //prints the results
            ReadFile(textPath, "text");
            ReadFile(wordsPath, "words");
            ReadFile(resultPath, "result");
        }
        catch (SecurityException e)
        {
            Console.WriteLine(e.Message);
        }
        catch (NotSupportedException e)
        {
            Console.WriteLine(e.Message);
        }
        catch (FileNotFoundException e)
        {
            Console.WriteLine(e.Message);
        }
        catch (UnauthorizedAccessException e)
        {
            Console.WriteLine(e.Message);
        }
        catch (DirectoryNotFoundException e)
        {
            Console.WriteLine(e.Message);
        }
        catch (PathTooLongException e)
        {
            Console.WriteLine(e.Message);
        }
        catch (IOException e)
        {
            Console.WriteLine(e.Message);
        }
        catch (ArgumentNullException e)
        {
            Console.WriteLine(e.Message);
        }
        catch (ArgumentException e)
        {
            Console.WriteLine(e.Message);
        }
    }
    //method for printing
    static void ReadFile(string path, string name)
    {
        Console.WriteLine("----------------------------------------------");
        Console.WriteLine("Reading file " + name + "...");
        using (StreamReader readFile = new StreamReader(path))
        {
            while (!readFile.EndOfStream)
            {
                string line = readFile.ReadLine();

                Console.WriteLine(line);

            }
            Console.WriteLine("End of file " + name + ".");
        }
    }
}


text:
package com.intellij.openapi.vcs;

import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.Ref;
import com.intellij.util.PairProcessor;

import java.util.Comparator;
import java.util.Iterator;
import java.util.ListIterator;

/**
 * @author irengrig
 */
public class MembershipMap<Key, Val> extends AreaMap<Key, Val> {
  public static<Key extends Comparable<Key>, Val> MembershipMap<Key, Val> createMembershipMap(final PairProcessor<Key, Key> keysResemblance) {
    return new MembershipMap<>(keysResemblance, new ComparableComparator<>());
  }

  public static<Key, Val> MembershipMap<Key, Val> createMembershipMap(final PairProcessor<Key, Key> keysResemblance, final Comparator<Key> comparator) {
    return new MembershipMap<>(keysResemblance, comparator);
  }

  private MembershipMap(final PairProcessor<Key, Key> keysResemblance, final Comparator<Key> comparator) {
    super(keysResemblance, comparator);
  }

  public void putOptimal(final Key key, final Val val) {
    final int idx = putIfNoParent(key, val);
    if (idx < 0) return;

    if (idx + 1 < myKeys.size()) {
      for (final ListIterator<Key> listIterator = myKeys.listIterator(idx + 1); listIterator.hasNext();) {
        final Key next = listIterator.next();
        if (myKeysResemblance.process(key, next)) {
          listIterator.remove();
          myMap.remove(next);
        } else {
          break;
        }
      }
    }
  }

  public void optimizeMap(final PairProcessor<Val, Val> valuesAreas) {
    int i = 0;
    for (Iterator<Key> iterator = myKeys.iterator(); iterator.hasNext();) {
      final Key key = iterator.next();
      final Val value = myMap.get(key);

      // go for parents
      for (int j = i - 1; j >= 0; -- j) {
        final Key innerKey = myKeys.get(j);
        if (myKeysResemblance.process(innerKey, key)) {
          if (valuesAreas.process(myMap.get(innerKey), value)) {
            -- i;
            iterator.remove();
            myMap.remove(key);
          }
          // otherwise we found a "parent", and do not remove the child
          break;
        }
      }
      ++ i;
    }
  }

  public Pair<Key, Val> getMapping(final Key key) {
    final Ref<Pair<Key, Val>> result = new Ref<>();
    getSimiliar(key, new PairProcessor<Key, Val>() {
      @Override
      public boolean process(final Key key, final Val val) {
        result.set(Pair.create(key, val));
        return true;
      }
    });
    return result.get();
  }
}


text:
<DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
    <title>Kamal Traders - Flower Toran - 23</title>

    <link href="/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="/css/anime.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Home

Torans

Bouquet

Flower Gate

All Categories

Flower Toran - 23

Flower Toran To decorate :
1) Home, Office, events, Weddings
2) Best for decoration in festivals like Diwali , Ganesh Chaturvati,
3) TV Serials Decoration
4) Reasonable prices
5) Best Quality Material
6) Trusted and fast delivery.

Order Now.

Price : Rs. 145.00

    Call Me

Home

Products

Categories

About Us

Contact Us

Terms & Conditions

          © 2015 Copyright Kamal Traders


text:
using System;
using System.Collections.Generic;
using System.Text;
using DTcms.Common;
using LitJson;

namespace DTcms.API.OAuth
{
    public class kaixin_helper
    {
        public kaixin_helper()
        { }

        /// <summary>
        /// 取得Access Token
        /// </summary>
        /// <param name="code">临时Authorization Code,官方提示10分钟过期</param>
        /// <param name="state">防止CSRF攻击,成功授权后回调时会原样带回</param>
        /// <returns>Dictionary</returns>
        public static JsonData get_access_token(string code, string state)
        {
            //获得配置信息
            oauth_config config = oauth_helper.get_config("kaixin");
            string send_url = "https://api.kaixin001.com/oauth2/access_token?grant_type=authorization_code&code=" + code + "&client_id=" + config.oauth_app_id + "&client_secret=" + config.oauth_app_key + "&state=" + state + "&redirect_uri=" + Utils.UrlEncode(config.return_uri);
            //发送并接受返回值
            string result = Utils.HttpGet(send_url);
            if (result.Contains("error"))
            {
                return null;
            }
            try
            {
                JsonData jd = JsonMapper.ToObject(result);
                if (jd.Count > 0)
                {
                    return jd;
                }
            }
            catch
            {
                return null;
            }
            return null;
        }

        /// <summary>
        /// 获取登录用户自己的详细信息
        /// </summary>
        /// <param name="access_token">临时的Access Token</param>
        /// <param name="open_id">用户属性,以英文逗号分隔</param>
        /// <returns>JsonData</returns>
        public static JsonData get_info(string access_token, string fields)
        {
            string send_url = "https://api.kaixin001.com/users/me.json?fields=" + fields + "&access_token=" + access_token;
            //发送并接受返回值
            string result = Utils.HttpGet(send_url);
            if (result.Contains("error"))
            {
                return null;
            }
            try
            {
                JsonData jd = JsonMapper.ToObject(result);
                if (jd.Count > 0)
                {
                    return jd;
                }
            }
            catch
            {
                return null;
            }
            return null;
        }

    }
}


text:
<?php

// searches for admin settings

require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');

$query = trim(optional_param('query', '', PARAM_NOTAGS));  // Search string

$PAGE->set_context(context_system::instance());

admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page

$adminroot = admin_get_root(); // need all settings here
$adminroot->search = $query; // So we can reference it in search boxes later in this invocation
$statusmsg = '';
$errormsg  = '';
$focus = '';

// now we'll deal with the case that the admin has submitted the form with changed settings
if ($data = data_submitted() and confirm_sesskey()) {
    if (admin_write_settings($data)) {
        $statusmsg = get_string('changessaved');
    }
    $adminroot = admin_get_root(true); //reload tree

    if (!empty($adminroot->errors)) {
        $errormsg = get_string('errorwithsettings', 'admin');
        $firsterror = reset($adminroot->errors);
        $focus = $firsterror->id;
    }
}

// and finally, if we get here, then there are matching settings and we have to print a form
// to modify them
echo $OUTPUT->header($focus);

if ($errormsg !== '') {
    echo $OUTPUT->notification($errormsg);

} else if ($statusmsg !== '') {
    echo $OUTPUT->notification($statusmsg, 'notifysuccess');
}

$resultshtml = admin_search_settings_html($query); // case insensitive search only

echo '<form action="search.php" method="post" id="adminsettings">';
echo '
';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="query" value="'.s($query).'" />';
echo '
';
echo '<fieldset>';
echo '

';
if ($resultshtml != '') {
    echo $resultshtml;
} else {
    echo get_string('noresults','admin');
}
echo '</fieldset>';
echo '</form>';

echo $OUTPUT->footer();


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Geo Location Clustering</title>

    <link href="../../css/bootstrap.min.css" rel="stylesheet">

    <link href="../../css/scrolling-nav.css" rel="stylesheet">

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

Geo Location Clustering (documents in /gov/nasa/climate/)


text:
package com.exlibris.dps;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for linkContactToProdcuer complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="linkContactToProdcuer">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="arg0" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="arg1" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="arg2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="arg3" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "linkContactToProdcuer", propOrder = {
    "arg0",
    "arg1",
    "arg2",
    "arg3"
})
public class LinkContactToProdcuer {

    protected String arg0;
    protected String arg1;
    protected String arg2;
    protected String arg3;

    /**
     * Gets the value of the arg0 property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getArg0() {
        return arg0;
    }

    /**
     * Sets the value of the arg0 property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setArg0(String value) {
        this.arg0 = value;
    }

    /**
     * Gets the value of the arg1 property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getArg1() {
        return arg1;
    }

    /**
     * Sets the value of the arg1 property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setArg1(String value) {
        this.arg1 = value;
    }

    /**
     * Gets the value of the arg2 property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getArg2() {
        return arg2;
    }

    /**
     * Sets the value of the arg2 property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setArg2(String value) {
        this.arg2 = value;
    }

    /**
     * Gets the value of the arg3 property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getArg3() {
        return arg3;
    }

    /**
     * Sets the value of the arg3 property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setArg3(String value) {
        this.arg3 = value;
    }

}


text:
kitIdea is an extension for the Customer Relationship Management (CRM) [KeepInTouch] [3] and the Content Management Systems [WebsiteBaker] [1] or [LEPTON CMS] [2]. It enables the flexible creating and sharing of ideas.

#### Requirements

* minimum PHP 5.2.x
* using [WebsiteBaker] [1] _or_ using [LEPTON CMS] [2]
* [wblib] [10] must be installed
* [LibraryAdmin] [11] must be installed
* [lib_jquery] [12] must be installed
* [dbConnect_LE] [4] must be installed
* [Dwoo] [5] must be installed
* [DropletsExtension] [6] must be installed
* [KeepInTouch] [3] must be installed
* [kitForm] [13] must be installed
* [kitDirList] [14] must be installed

#### Installation

* download the actual [kitIdea_x.xx.zip] [7] installation archive
* in CMS backend select the file from "Add-ons" -> "Modules" -> "Install module"

#### First Steps

Please visit the [phpManufaktur] [8] to get more informations about **kitIdea** and join the [Addons Support Group] [9].

[1]: http://websitebaker2.org "WebsiteBaker Content Management System"
[2]: http://lepton-cms.org "LEPTON CMS"
[3]: https://addons.phpmanufaktur.de/download.php?file=KeepInTouch
[4]: https://addons.phpmanufaktur.de/download.php?file=dbConnect_LE
[5]: https://addons.phpmanufaktur.de/download.php?file=Dwoo
[6]: https://addons.phpmanufaktur.de/download.php?file=DropletsExtension
[7]: https://addons.phpmanufaktur.de/download.php?file=kitIdea
[8]: http://phpmanufaktur.de/cms/websitebaker/addons/kitidea.php
[9]: https://phpmanufaktur.de/support
[10]: https://github.com/webbird/wblib/downloads
[11]: http://jquery.lepton-cms.org/modules/download_gallery/dlc.php?file=75&id=1318585713
[12]: http://jquery.lepton-cms.org/modules/download_gallery/dlc.php?file=76&id=1320743410
[13]: https://addons.phpmanufaktur.de/download.php?file=kitForm
[14]: https://addons.phpmanufaktur.de/download.php?file=kitDirList


text:
<?php

namespace paslandau\QueryScraper\Results;

use paslandau\QueryScraper\Requests\QueryRequestInterface;

class Result implements ResultInterface
{
    /**
     * @var QueryRequestInterface
     */
    private $request;
    /**
     * @var null|mixed
     */
    private $result;
    /**
     * @var \Exception|null
     */
    private $exception;

    /**
     * @param QueryRequestInterface $request
     * @param mixed|null $result [optional]. Default: null.
     * @param \Exception|null $exception [optional]. Default: null.
     */
    function __construct($request, $result = null, \Exception $exception = null)
    {
        $this->exception = $exception;
        $this->request = $request;
        $this->result = $result;
    }

    /**
     * @return \Exception|null
     */
    public function getException()
    {
        return $this->exception;
    }

    /**
     * @param \Exception|null $exception
     */
    public function setException($exception)
    {
        $this->exception = $exception;
    }

    /**
     * @return QueryRequestInterface
     */
    public function getRequest()
    {
        return $this->request;
    }

    /**
     * @param QueryRequestInterface $request
     */
    public function setRequest($request)
    {
        $this->request = $request;
    }

    /**
     * @return mixed
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * @param null|mixed $result
     */
    public function setResult($result)
    {
        $this->result = $result;
    }
}


text:
title: Telerik.Web.UI.SchedulerAppointmentWebServiceUpdating
description: Telerik.Web.UI.SchedulerAppointmentWebServiceUpdating
slug: Telerik.Web.UI.SchedulerAppointmentWebServiceUpdating
---

# Telerik.Web.UI.SchedulerAppointmentWebServiceUpdating  : Telerik.Web.UI.SchedulerAppointmentCancelEventArgs

## Inheritance Hierarchy

* [Telerik.Web.UI.SchedulerAppointmentCancelEventArgs]({%slug Telerik.Web.UI.SchedulerAppointmentCancelEventArgs%})
* *[Telerik.Web.UI.SchedulerAppointmentWebServiceUpdating]({%slug Telerik.Web.UI.SchedulerAppointmentWebServiceUpdating%})*


text:
'use strict';

import { Keybinding, KeyCode, KeyCodeUtils, KeyMod } from 'vs/base/common/keyCodes';
import * as platform from 'vs/base/common/platform';
import * as browser from 'vs/base/browser/browser';

let KEY_CODE_MAP: { [keyCode: number]: KeyCode } = {};
(function () {
	KEY_CODE_MAP[3] = KeyCode.PauseBreak; // VK_CANCEL 0x03 Control-break processing
	KEY_CODE_MAP[8] = KeyCode.Backspace;
	KEY_CODE_MAP[9] = KeyCode.Tab;
	KEY_CODE_MAP[13] = KeyCode.Enter;
	KEY_CODE_MAP[16] = KeyCode.Shift;
	KEY_CODE_MAP[17] = KeyCode.Ctrl;
	KEY_CODE_MAP[18] = KeyCode.Alt;
	KEY_CODE_MAP[19] = KeyCode.PauseBreak;
	KEY_CODE_MAP[20] = KeyCode.CapsLock;
	KEY_CODE_MAP[27] = KeyCode.Escape;
	KEY_CODE_MAP[32] = KeyCode.Space;
	KEY_CODE_MAP[33] = KeyCode.PageUp;
	KEY_CODE_MAP[34] = KeyCode.PageDown;
	KEY_CODE_MAP[35] = KeyCode.End;
	KEY_CODE_MAP[36] = KeyCode.Home;
	KEY_CODE_MAP[37] = KeyCode.LeftArrow;
	KEY_CODE_MAP[38] = KeyCode.UpArrow;
	KEY_CODE_MAP[39] = KeyCode.RightArrow;
	KEY_CODE_MAP[40] = KeyCode.DownArrow;
	KEY_CODE_MAP[45] = KeyCode.Insert;
	KEY_CODE_MAP[46] = KeyCode.Delete;

	KEY_CODE_MAP[48] = KeyCode.KEY_0;
	KEY_CODE_MAP[49] = KeyCode.KEY_1;
	KEY_CODE_MAP[50] = KeyCode.KEY_2;
	KEY_CODE_MAP[51] = KeyCode.KEY_3;
	KEY_CODE_MAP[52] = KeyCode.KEY_4;
	KEY_CODE_MAP[53] = KeyCode.KEY_5;
	KEY_CODE_MAP[54] = KeyCode.KEY_6;
	KEY_CODE_MAP[55] = KeyCode.KEY_7;
	KEY_CODE_MAP[56] = KeyCode.KEY_8;
	KEY_CODE_MAP[57] = KeyCode.KEY_9;

	KEY_CODE_MAP[65] = KeyCode.KEY_A;
	KEY_CODE_MAP[66] = KeyCode.KEY_B;
	KEY_CODE_MAP[67] = KeyCode.KEY_C;
	KEY_CODE_MAP[68] = KeyCode.KEY_D;
	KEY_CODE_MAP[69] = KeyCode.KEY_E;
	KEY_CODE_MAP[70] = KeyCode.KEY_F;
	KEY_CODE_MAP[71] = KeyCode.KEY_G;
	KEY_CODE_MAP[72] = KeyCode.KEY_H;
	KEY_CODE_MAP[73] = KeyCode.KEY_I;
	KEY_CODE_MAP[74] = KeyCode.KEY_J;
	KEY_CODE_MAP[75] = KeyCode.KEY_K;
	KEY_CODE_MAP[76] = KeyCode.KEY_L;
	KEY_CODE_MAP[77] = KeyCode.KEY_M;
	KEY_CODE_MAP[78] = KeyCode.KEY_N;
	KEY_CODE_MAP[79] = KeyCode.KEY_O;
	KEY_CODE_MAP[80] = KeyCode.KEY_P;
	KEY_CODE_MAP[81] = KeyCode.KEY_Q;
	KEY_CODE_MAP[82] = KeyCode.KEY_R;
	KEY_CODE_MAP[83] = KeyCode.KEY_S;
	KEY_CODE_MAP[84] = KeyCode.KEY_T;
	KEY_CODE_MAP[85] = KeyCode.KEY_U;
	KEY_CODE_MAP[86] = KeyCode.KEY_V;
	KEY_CODE_MAP[87] = KeyCode.KEY_W;
	KEY_CODE_MAP[88] = KeyCode.KEY_X;
	KEY_CODE_MAP[89] = KeyCode.KEY_Y;
	KEY_CODE_MAP[90] = KeyCode.KEY_Z;

	KEY_CODE_MAP[93] = KeyCode.ContextMenu;

	KEY_CODE_MAP[96] = KeyCode.NUMPAD_0;
	KEY_CODE_MAP[97] = KeyCode.NUMPAD_1;
	KEY_CODE_MAP[98] = KeyCode.NUMPAD_2;
	KEY_CODE_MAP[99] = KeyCode.NUMPAD_3;
	KEY_CODE_MAP[100] = KeyCode.NUMPAD_4;
	KEY_CODE_MAP[101] = KeyCode.NUMPAD_5;
	KEY_CODE_MAP[102] = KeyCode.NUMPAD_6;
	KEY_CODE_MAP[103] = KeyCode.NUMPAD_7;
	KEY_CODE_MAP[104] = KeyCode.NUMPAD_8;
	KEY_CODE_MAP[105] = KeyCode.NUMPAD_9;
	KEY_CODE_MAP[106] = KeyCode.NUMPAD_MULTIPLY;
	KEY_CODE_MAP[107] = KeyCode.NUMPAD_ADD;
	KEY_CODE_MAP[108] = KeyCode.NUMPAD_SEPARATOR;
	KEY_CODE_MAP[109] = KeyCode.NUMPAD_SUBTRACT;
	KEY_CODE_MAP[110] = KeyCode.NUMPAD_DECIMAL;
	KEY_CODE_MAP[111] = KeyCode.NUMPAD_DIVIDE;

	KEY_CODE_MAP[112] = KeyCode.F1;
	KEY_CODE_MAP[113] = KeyCode.F2;
	KEY_CODE_MAP[114] = KeyCode.F3;
	KEY_CODE_MAP[115] = KeyCode.F4;
	KEY_CODE_MAP[116] = KeyCode.F5;
	KEY_CODE_MAP[117] = KeyCode.F6;
	KEY_CODE_MAP[118] = KeyCode.F7;
	KEY_CODE_MAP[119] = KeyCode.F8;
	KEY_CODE_MAP[120] = KeyCode.F9;
	KEY_CODE_MAP[121] = KeyCode.F10;
	KEY_CODE_MAP[122] = KeyCode.F11;
	KEY_CODE_MAP[123] = KeyCode.F12;
	KEY_CODE_MAP[124] = KeyCode.F13;
	KEY_CODE_MAP[125] = KeyCode.F14;
	KEY_CODE_MAP[126] = KeyCode.F15;
	KEY_CODE_MAP[127] = KeyCode.F16;
	KEY_CODE_MAP[128] = KeyCode.F17;
	KEY_CODE_MAP[129] = KeyCode.F18;
	KEY_CODE_MAP[130] = KeyCode.F19;

	KEY_CODE_MAP[144] = KeyCode.NumLock;
	KEY_CODE_MAP[145] = KeyCode.ScrollLock;

	KEY_CODE_MAP[186] = KeyCode.US_SEMICOLON;
	KEY_CODE_MAP[187] = KeyCode.US_EQUAL;
	KEY_CODE_MAP[188] = KeyCode.US_COMMA;
	KEY_CODE_MAP[189] = KeyCode.US_MINUS;
	KEY_CODE_MAP[190] = KeyCode.US_DOT;
	KEY_CODE_MAP[191] = KeyCode.US_SLASH;
	KEY_CODE_MAP[192] = KeyCode.US_BACKTICK;
	KEY_CODE_MAP[219] = KeyCode.US_OPEN_SQUARE_BRACKET;
	KEY_CODE_MAP[220] = KeyCode.US_BACKSLASH;
	KEY_CODE_MAP[221] = KeyCode.US_CLOSE_SQUARE_BRACKET;
	KEY_CODE_MAP[222] = KeyCode.US_QUOTE;
	KEY_CODE_MAP[223] = KeyCode.OEM_8;

	KEY_CODE_MAP[226] = KeyCode.OEM_102;

	if (browser.isIE) {
		KEY_CODE_MAP[91] = KeyCode.Meta;
	} else if (browser.isFirefox) {
		KEY_CODE_MAP[59] = KeyCode.US_SEMICOLON;
		KEY_CODE_MAP[107] = KeyCode.US_EQUAL;
		KEY_CODE_MAP[109] = KeyCode.US_MINUS;
		if (platform.isMacintosh) {
			KEY_CODE_MAP[224] = KeyCode.Meta;
		}
	} else if (browser.isWebKit) {
		KEY_CODE_MAP[91] = KeyCode.Meta;
		if (platform.isMacintosh) {
			// the two meta keys in the Mac have different key codes (91 and 93)
			KEY_CODE_MAP[93] = KeyCode.Meta;
		} else {
			KEY_CODE_MAP[92] = KeyCode.Meta;
		}
	}
})();

export function lookupKeyCode(e: KeyboardEvent): KeyCode {
	return KEY_CODE_MAP[e.keyCode] || KeyCode.Unknown;
}

let extractKeyCode = function extractKeyCode(e: KeyboardEvent): KeyCode {
	if (e.charCode) {
		// "keypress" events mostly
		let char = String.fromCharCode(e.charCode).toUpperCase();
		return KeyCodeUtils.fromString(char);
	}
	return lookupKeyCode(e);
};

export function setExtractKeyCode(newExtractKeyCode: (e: KeyboardEvent) => KeyCode): void {
	extractKeyCode = newExtractKeyCode;
}

export interface IKeyboardEvent {
	readonly browserEvent: KeyboardEvent;
	readonly target: HTMLElement;

	readonly ctrlKey: boolean;
	readonly shiftKey: boolean;
	readonly altKey: boolean;
	readonly metaKey: boolean;
	readonly keyCode: KeyCode;

	toKeybinding(): Keybinding;
	equals(keybinding: number): boolean;

	preventDefault(): void;
	stopPropagation(): void;
}

const ctrlKeyMod = (platform.isMacintosh ? KeyMod.WinCtrl : KeyMod.CtrlCmd);
const altKeyMod = KeyMod.Alt;
const shiftKeyMod = KeyMod.Shift;
const metaKeyMod = (platform.isMacintosh ? KeyMod.CtrlCmd : KeyMod.WinCtrl);

export class StandardKeyboardEvent implements IKeyboardEvent {

	public readonly browserEvent: KeyboardEvent;
	public readonly target: HTMLElement;

	public readonly ctrlKey: boolean;
	public readonly shiftKey: boolean;
	public readonly altKey: boolean;
	public readonly metaKey: boolean;
	public readonly keyCode: KeyCode;

	private _asKeybinding: Keybinding;

	constructor(source: KeyboardEvent) {
		let e = <KeyboardEvent>source;

		this.browserEvent = e;
		this.target = <HTMLElement>e.target;

		this.ctrlKey = e.ctrlKey;
		this.shiftKey = e.shiftKey;
		this.altKey = e.altKey;
		this.metaKey = e.metaKey;
		this.keyCode = extractKeyCode(e);

		// console.info(e.type + ": keyCode: " + e.keyCode + ", which: " + e.which + ", charCode: " + e.charCode + ", detail: " + e.detail + " ====> " + this.keyCode + ' -- ' + KeyCode[this.keyCode]);

		this.ctrlKey = this.ctrlKey || this.keyCode === KeyCode.Ctrl;
		this.altKey = this.altKey || this.keyCode === KeyCode.Alt;
		this.shiftKey = this.shiftKey || this.keyCode === KeyCode.Shift;
		this.metaKey = this.metaKey || this.keyCode === KeyCode.Meta;

		this._asKeybinding = this._computeKeybinding();
	}

	public preventDefault(): void {
		if (this.browserEvent && this.browserEvent.preventDefault) {
			this.browserEvent.preventDefault();
		}
	}

	public stopPropagation(): void {
		if (this.browserEvent && this.browserEvent.stopPropagation) {
			this.browserEvent.stopPropagation();
		}
	}

	public toKeybinding(): Keybinding {
		return this._asKeybinding;
	}

	public equals(other: number): boolean {
		return this._asKeybinding.value === other;
	}

	private _computeKeybinding(): Keybinding {
		let key = KeyCode.Unknown;
		if (this.keyCode !== KeyCode.Ctrl && this.keyCode !== KeyCode.Shift && this.keyCode !== KeyCode.Alt && this.keyCode !== KeyCode.Meta) {
			key = this.keyCode;
		}

		let result = 0;
		if (this.ctrlKey) {
			result |= ctrlKeyMod;
		}
		if (this.altKey) {
			result |= altKeyMod;
		}
		if (this.shiftKey) {
			result |= shiftKeyMod;
		}
		if (this.metaKey) {
			result |= metaKeyMod;
		}
		result |= key;

		return new Keybinding(result);
	}
}


text:
package net.daergoth.core.rule;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * JPA Entity class for {@code Rule}s.
 * Each {@code Rule} has a list of {@code Condition}s and a list of {@code Action}s.
 * All of the actions will be executed, if all conditions are met.
 *
 * @see net.daergoth.core.rule.Condition
 * @see net.daergoth.core.rule.Action
 */
@Entity
@Table(name = "rules")
@NamedQueries({
	@NamedQuery(name = "Rule.findAll", query = "SELECT r FROM Rule r")
})
public class Rule implements Serializable{

	private static final long serialVersionUID = 3811655697634424417L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Column(nullable = false)
	private String name;

	@Column(nullable = false)
	private boolean enabled = true;

	@Column
	@OneToMany(cascade = CascadeType.ALL)
	private List<Condition> conditions;

	@Column
	@OneToMany(cascade = CascadeType.ALL)
	private List<Action> actions;

	/**
	 * Getter for the {@code Rule}'s ID.
	 * @return the ID of the rule
	 */
	public Long getId() {
		return id;
	}

	/**
	 * Setter for the {@code Rule}'s ID.
	 * @param id the new ID for the rule
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * Getter for the {@code Rule}'s name.
	 * @return the name of the rule
	 */
	public String getName() {
		return name;
	}

	/**
	 * Setter for the {@code Rule}'s name.
	 * @param name the new of the rule
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Getter for the {@code Rule}'s status.
	 * @return the status of the rule
	 */
	public boolean isEnabled() {
		return enabled;
	}

	/**
	 * Setter for the {@code Rule}'s status.
	 * @param enabled the new status for the rule
	 */
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	/**
	 * Getter for the {@code Rule}'s {@code Condition}s.
	 * @return a list of conditions of the rule
	 */
	public List<Condition> getConditions() {
		return conditions;
	}

	/**
	 * Setter for the {@code Rule}'s {@code Condition}s.
	 * @param conditions list of the new conditions for the rule
	 */
	public void setConditions(List<Condition> conditions) {
		this.conditions = conditions;
	}

	/**
	 * Getter for the {@code Rule}'s {@code Action}s.
	 * @return a list of actions of the rule
	 */
	public List<Action> getActions() {
		return actions;
	}

	/**
	 * Setter for the {@code Rule}'s {@code Action}s.
	 * @param actions list of the new actions for the rule
	 */
	public void setActions(List<Action> actions) {
		this.actions = actions;
	}

}


text:
Wordpress to Ghost Post Processor
=================================

This script takes the output from the [Ghost Wordpress Plugin](http://www.wordpress.org/plugins/ghost/) and updates the image URLs to point to a server of your choice. While the Ghost Wordpress plugin works great with other image providers, it's not so great for using your own server for serving media, which this server fixes

Install the post processor:

```
npm install wp2ghostpp
```

Run the post processor:

```
wp2ghostpp
```

The post processor will prompt you for the needed information. Alternately, you can supply a configuration file with the ```-f``` flag. See the example config file.


text:
/**
  @file videocapture_basic.cpp
  @brief A very basic sample for using VideoCapture and VideoWriter
  @author PkLab.net
  @date Aug 24, 2016
*/

#include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <stdio.h>

using namespace cv;
using namespace std;

int main(int, char**)
{
    Mat frame;
    //--- INITIALIZE VIDEOCAPTURE
    VideoCapture cap;
    // open the default camera using default API
    // cap.open(0);
    // OR advance usage: select any API backend
    int deviceID = 0;             // 0 = open default camera
    int apiID = cv::CAP_ANY;      // 0 = autodetect default API
    // open selected camera using selected API
    cap.open(deviceID, apiID);
    // check if we succeeded
    if (!cap.isOpened()) {
        cerr << "ERROR! Unable to open camera\n";
        return -1;
    }

    //--- GRAB AND WRITE LOOP
    cout << "Start grabbing" << endl
        << "Press any key to terminate" << endl;
    for (;;)
    {
        // wait for a new frame from camera and store it into 'frame'
        cap.read(frame);
        // check if we succeeded
        if (frame.empty()) {
            cerr << "ERROR! blank frame grabbed\n";
            break;
        }
        // show live and wait for a key with timeout long enough to show images
        imshow("Live", frame);
        if (waitKey(5) >= 0)
            break;
    }
    // the camera will be deinitialized automatically in VideoCapture destructor
    return 0;
}


text:
import { MongoObservable } from 'meteor-rxjs';
import { Meteor } from 'meteor/meteor';

import { Activity } from '../models/activity.model';

export const Activities = new MongoObservable.Collection<Activity>('activities');

function loggedIn() {
  return !!Meteor.user();
}

Activities.allow({
  insert: loggedIn,
  update: loggedIn,
  remove: loggedIn
});


text:
"""
Django settings for reservas project.

Generated by 'django-admin startproject' using Django 1.10.3.

For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '#kj+dmt)6abcnmn^h3f2cy@ofrx*$cmn=ek*f0(109r@9rc#q@'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'reservas.reservasapi',
]

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',),
    'PAGE_SIZE': 10
}

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'reservas.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'reservas.wsgi.application'

# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]

# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

STATIC_URL = '/static/'


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W27353_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Table of Contents — Cook 5300 12-13 8T2 Sundry Attachments

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
default["chef_client"]["interval"] = "1800"
default["chef_client"]["splay"]    = "20"
default["chef_client"]["log_dir"]  = "/var/log/chef"
default["chef_client"]["server_url"] = "http://localhost:4000"
default["chef_client"]["validation_client_name"] = "chef-validator"

case platform
when "arch"
  default["chef_client"]["init_style"]  = "arch"
  default["chef_client"]["run_path"]    = "/var/run/chef"
  default["chef_client"]["cache_path"]  = "/var/cache/chef"
  default["chef_client"]["backup_path"] = "/var/lib/chef"
when "debian","ubuntu","redhat","centos","fedora"
  default["chef_client"]["init_style"]  = "init"
  default["chef_client"]["run_path"]    = "/var/run/chef"
  default["chef_client"]["cache_path"]  = "/var/cache/chef"
  default["chef_client"]["backup_path"] = "/var/lib/chef"
when "openbsd","freebsd","mac_os_x"
  default["chef_client"]["init_style"]  = "bsd"
  default["chef_client"]["run_path"]    = "/var/run"
  default["chef_client"]["cache_path"]  = "/var/chef/cache"
  default["chef_client"]["backup_path"] = "/var/chef/cache"
else
  default["chef_client"]["init_style"]  = "none"
  default["chef_client"]["run_path"]    = "/var/run"
  default["chef_client"]["cache_path"]  = "/var/chef/cache"
  default["chef_client"]["backup_path"] = "/var/chef/backup"
end


text:
var w = window.innerWidth;
var h = window.innerHeight;
document.getElementById("txt").innerHTML = "Width: " + w + "<br>Height: " + h;


text:
package com.cartoon.jgp;

import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MyAccountMessage extends AppCompatActivity implements View.OnClickListener{

    private TextView back;           //标题栏的返回按钮
    private TextView inform;         //通知按钮
    private TextView aboutMe;        //关于我的按钮

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.myaccountmessage);
        initView();      //绑定页面的控件
        back.setOnClickListener(this);
        inform.setOnClickListener(this);
        aboutMe.setOnClickListener(this);
        switchFragment(0);
    }
    private void initView(){
        back=(TextView)findViewById(R.id.myAccountMessageBack);
        inform=(TextView)findViewById(R.id.myAccountMessageInform);
        aboutMe=(TextView)findViewById(R.id.myAccountMessageAboutme);
    }
    @Override
    public void onClick(View v){
        switch (v.getId()){
            case R.id.myAccountMessageBack:{
                Intent intent=new Intent(MyAccountMessage.this,MyAccount.class);
                intent.putExtra("data_return",2);
                setResult(RESULT_OK,intent);
                finish();
                break;
            }
            case R.id.myAccountMessageInform:{
                switchFragment(0);
                break;
            }
            case R.id.myAccountMessageAboutme:{
                switchFragment(1);
                break;
            }
        }
    }
    @Override
    public void onBackPressed(){
        Intent intent=new Intent(MyAccountMessage.this,MyAccount.class);
        intent.putExtra("data_return",2);
        setResult(RESULT_OK,intent);
        finish();
    }
    private void switchFragment(int flag) {
        switch (flag) {
            case 0:{
                MyAccountMessageInform inform=new MyAccountMessageInform();
                FragmentManager fragmentManager=getFragmentManager();
                FragmentTransaction transaction=fragmentManager.beginTransaction();
                transaction.replace(R.id.myAccountMessageFrame,inform);
                transaction.commit();
                break;
            }
            case 1:{
                MyAccountMessageAboutMe aboutMe=new MyAccountMessageAboutMe();
                FragmentManager fragmentManager=getFragmentManager();
                FragmentTransaction transaction=fragmentManager.beginTransaction();
                transaction.replace(R.id.myAccountMessageFrame,aboutMe);
                transaction.commit();
                break;
            }
        }
    }
}


text:
package com.capitalone.dashboard.jenkins;

import java.util.ArrayList;
import java.util.List;

public class JenkinsBuild {
    private List<Artifact> artifacts;
    private long timestamp;

    private JenkinsBuild() {
        // required for converter
    }

    private JenkinsBuild(Builder builder) {
        this.artifacts = builder.artifacts;
        this.timestamp = builder.timestamp;
    }

    @SuppressWarnings("PMD.AccessorClassGeneration")
    public static Builder newBuilder() {
        return new Builder();
    }

    public List<Artifact> getArtifacts() {
        return artifacts;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public static final class Builder {
        private List<Artifact> artifacts = new ArrayList<>();
        private long timestamp;

        private Builder() {
        }

        public Builder artifact(Artifact artifact) {
            this.artifacts.add(artifact);
            return this;
        }

        @SuppressWarnings("PMD.AccessorClassGeneration")
        public JenkinsBuild build() {
            return new JenkinsBuild(this);
        }

        public Builder timestamp(long timestamp) {
            this.timestamp = timestamp;
            return this;
        }
    }
}


text:
<?xml version="1.0"?>

<!DOCTYPE tables PUBLIC "-//uPortal//Tables/EN" "tables.dtd">

<tables>

    <name>UP_PERSON_DIR</name>
    <desc>Directory information for a given person, including the MD5 password. Emulates a simple external authentication service, like LDAP.</desc>
    <columns>
      <column> <name>USER_NAME</name>       <type>VARCHAR</type>   <param>35</param>
        <desc>Authentication prinicipal - Primary key and foreign key foreign key to external authentication system (which is what up_person_dir emulates)</desc>
      </column>
      <column> <name>ENCRPTD_PSWD</name>    <type>VARCHAR</type>   <param>64</param>
        <desc>MD5 authentication credential - or user's password</desc>
      </column>
      <column> <name>LST_PSWD_CGH_DT</name> <type>TIMESTAMP</type>
        <desc>Date of last password change</desc>
      </column>
      <column> <name>FIRST_NAME</name>	    <type>VARCHAR</type>   <param>15</param>
        <desc>Person's first name</desc>
      </column>
      <column> <name>LAST_NAME</name>       <type>VARCHAR</type>   <param>15</param>
        <desc>Person's last name</desc>
      </column>
      <column> <name>EMAIL</name>           <type>VARCHAR</type>   <param>60</param>
        <desc>Person's e-mail address</desc>
      </column>
    </columns>
    <not-null>USER_NAME</not-null>
    <primary-key>USER_NAME</primary-key>
    <index>
        <name>UPPD_NAME_PSWD_IDX</name>
        <column-ref>USER_NAME</column-ref>
        <column-ref>ENCRPTD_PSWD</column-ref>
    </index>

    <name>UP_GROUP</name>
    <desc>Entries that uniquely identify a uPortal group</desc>
    <columns>
      <column> <name>GROUP_ID</name>        <type>VARCHAR</type>     <param>240</param>
        <desc>Group ID is a unique sequence number used by the portal - primary key, see UP_SEQUENCE</desc>
      </column>
      <column> <name>CREATOR_ID</name>      <type>VARCHAR</type>     <param>240</param>
        <desc>Who created this group, foreign key USER_ID of table UP_USER</desc>
      </column>
      <column> <name>ENTITY_TYPE_ID</name>  <type>INTEGER</type>
        <desc>The entity to be called when a member of this group, foreign key ENTITY_TYPE_ID of table UP_ENTITY_TYPE</desc>
      </column>
      <column> <name>GROUP_NAME</name>      <type>VARCHAR</type>     <param>255</param>
        <desc>Short textual name of the group for finding group</desc>
      </column>
      <column> <name>DESCRIPTION</name>     <type>VARCHAR</type>     <param>255</param>
        <desc>Longer textual description of group to view a brief description of group</desc>
      </column>
    </columns>
    <primary-key>GROUP_ID</primary-key>
    <not-null>CREATOR_ID</not-null>
    <not-null>ENTITY_TYPE_ID</not-null>
    <not-null>GROUP_NAME</not-null>
    <not-null>GROUP_ID</not-null>
    <index>
        <name>UPG_GROUP_NAME_IDX</name>
        <column-ref>GROUP_NAME</column-ref>
    </index>

</tables>


text:
#ifndef HKP_CALLBACK_CONSTRAINT_MOTOR_H
#define HKP_CALLBACK_CONSTRAINT_MOTOR_H

#include <Physics/Constraint/Motor/LimitedForce/hkpLimitedForceConstraintMotor.h>

extern HK_EXPORT_PHYSICS const hkClass hkpCallbackConstraintMotorClass;
class hkpConstraintMotorInput;
class hkpConstraintMotorOutput;

/// This motor simply tries to reach and keep a desired target velocity.
class HK_EXPORT_PHYSICS hkpCallbackConstraintMotor : public hkpLimitedForceConstraintMotor
{
	public:

		typedef void (HK_CALL *CalcMotorDataCallbackFunc)(const class hkpCallbackConstraintMotor& motor, const hkpConstraintMotorInput* input, hkpConstraintMotorOutput* output);

		enum CallbackType
		{
			CALLBACK_MOTOR_TYPE_HAVOK_DEMO_SPRING_DAMPER,
			CALLBACK_MOTOR_TYPE_USER_0,
			CALLBACK_MOTOR_TYPE_USER_1,
			CALLBACK_MOTOR_TYPE_USER_2,
			CALLBACK_MOTOR_TYPE_USER_3,
		};

	public:

		HK_DECLARE_CLASS_ALLOCATOR( HK_MEMORY_CLASS_CONSTRAINT );
		HK_DECLARE_REFLECTION();

		/// Construct a motor with the given properties.
		hkpCallbackConstraintMotor( enum CallbackType callbackType, CalcMotorDataCallbackFunc callbackFunc );

		/// Serialization constructor.
		hkpCallbackConstraintMotor( hkFinishLoadedObjectFlag f ) : hkpLimitedForceConstraintMotor(f)  {}

		/// Motor clone method
		virtual hkpConstraintMotor* clone() const;

	public:

		CalcMotorDataCallbackFunc m_callbackFunc; //+overridetype(void*) +nosave
		hkEnum<CallbackType,hkUint32> m_callbackType;
		hkUlong m_userData0; // +default(0)
		hkUlong m_userData1; // +default(0)
		hkUlong m_userData2; // +default(0)
};

#endif // HKP_CALLBACK_CONSTRAINT_MOTOR_H

/*
 * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
 *
 * Confidential Information of Havok.  (C) Copyright 1999-2014
 * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
 * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
 * rights, and intellectual property rights in the Havok software remain in
 * Havok and/or its suppliers.
 *
 * Use of this software for evaluation purposes is subject to and indicates
 * acceptance of the End User licence Agreement for this product. A copy of
 * the license is included with this software and is also available at www.havok.com/tryhavok.
 *
 */


text:
namespace Microsoft.Azure.Management.Monitor.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// A management event rule condition.
    /// </summary>
    [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition")]
    public partial class ManagementEventRuleCondition : RuleCondition
    {
        /// <summary>
        /// Initializes a new instance of the ManagementEventRuleCondition
        /// class.
        /// </summary>
        public ManagementEventRuleCondition()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the ManagementEventRuleCondition
        /// class.
        /// </summary>
        /// <param name="dataSource">the resource from which the rule collects
        /// its data. For this type dataSource will always be of type
        /// RuleMetricDataSource.</param>
        /// <param name="aggregation">How the data that is collected should be
        /// combined over time and when the alert is activated. Note that for
        /// management event alerts aggregation is optional – if it is not
        /// provided then any event will cause the alert to activate.</param>
        public ManagementEventRuleCondition(RuleDataSource dataSource = default(RuleDataSource), ManagementEventAggregationCondition aggregation = default(ManagementEventAggregationCondition))
            : base(dataSource)
        {
            Aggregation = aggregation;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets how the data that is collected should be combined over
        /// time and when the alert is activated. Note that for management
        /// event alerts aggregation is optional – if it is not provided then
        /// any event will cause the alert to activate.
        /// </summary>
        [JsonProperty(PropertyName = "aggregation")]
        public ManagementEventAggregationCondition Aggregation { get; set; }

    }
}


text:
//Problem 6. Quadratic equation
//Write a script that reads the coefficients a, b and c of a quadratic equation ax2 + bx + c = 0 and solves it (prints its real roots).
//Calculates and prints its real roots.
//Note: Quadratic equations may have 0, 1 or 2 real roots.

function calculateQuadraticEquationRoots(a, b, c){
    var x1,
        x2,
        discriminant,
        output;

    output = 'The quadratic equation: ' + a + 'x*x + ' + b + 'x + ' + c + ' has ';

    discriminant = Math.sqrt(b * b - 4 * a * c);

    if (isNaN(discriminant)) {
        output += 'no real roots';
    } else if (discriminant === 0) {
        x1 = -b / (2 * a);
        output += 'one real root: x1=x2=' + x1;
    } else {
        x1 = (-b - discriminant) / (2 * a);
        x2 = (-b + discriminant) / (2 * a);
        output += 'two real roots: x1=' + x1 + ', x2=' + x2;
    }
    return output;
}

function onCalculateQuadraticEquationBtnClick(){
    var a, b, c;

    a = jsConsole.readFloat('#a_number');
    b = jsConsole.readFloat('#b_number');
    c = jsConsole.readFloat('#c_number');

    jsConsole.writeLine(calculateQuadraticEquationRoots(a, b, c));
}

console.log(calculateQuadraticEquationRoots(5, 2, 8));


text:
(function (ElementProto) {
    if (typeof ElementProto.matches !== 'function') {
        ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {
            var element = this;
            var elements = (element.document || element.ownerDocument).querySelectorAll(selector);
            var index = 0;

            while (elements[index] && elements[index] !== element) {
                ++index;
            }

            return Boolean(elements[index]);
        };
    }

    if (typeof ElementProto.closest !== 'function') {
        ElementProto.closest = function closest(selector) {
            var element = this;

            while (element && element.nodeType === 1) {
                if (element.matches(selector)) {
                    return element;
                }

                element = element.parentNode;
            }

            return null;
        };
    }
})(window.Element.prototype);