text:
- everyone is equally entitled to have a safe use of the road
- Traffic rules have to contribute to a safe, swift and environmentally friendly flow of traffic.

## **page 2/14**

### Signs

The basic rule of priority is: give the right of way to **all drivers** approaching from your right.

sign B7 you must always first bring your vehicle to a **full stop** before driving on, even when there is no traffic in sight.

## **page 3/14**

### Traffic lights

- Driving on  a "priority road" means that all the drivers approaching this road from the right and the left **must** give the right of way to all the drivers on this road.

- you must stop at the red light and give the right of way to drivers at the crossing road ahead

**traffic lights take precedence over traffic signs and traffic rules.**

### Signals by authorised persons

**ignals by authorised persons take precedence over traffic lights (signals), traffic signs (signs and road markings) and traffic rules (the general rules of behaviour).**

Therefore the hierarchy of this sytem is:

1. Signals given by authorised persons.
2. Traffic lights (signals).
3. Signs and road markings.
4. General rules of behaviour

## **page 4/14**

### Validity of road signs

- Road signs mostly apply to the whole width of the road.
- Signs which prohibit parking (sign E1) or stopping (sign E2), only apply to the side of the road on which the sign is placed.

- sign (F1) prohibits motorvehicles to overtake each other

## **page 5/14**

### Mobile roadworks units

All drivers must obey the indications shown by these mobile roadworks units, whether they are stationary or moving.

## **page 6/14**

### Road markings

- the more paint that is used, the more important the message will be

### The most important road markings

### Lines across the road

#### Stop line

#### Shark's teeth

#### Double white speed zone lines

These white lines indicate the entry to and exit from 30 and 60 km/h speed zones

#### Double blue parking disc zone lines

These blue lines indicate the entry to and exit from a parking disc zone;

### Lines along the road

#### Solid white line

Drivers are not allowed to cross a solid white line which divides a carriageway into lanes

#### Solid and broken white lines

When driving on the side of the broken line, you may cross the lines to go to the other lane; when driving on the side of the solid line, you may not cross the lines

#### Broken yellow line

A broken yellow line means no parking; alongside a broken yellow line you may only stop for a moment for the purpose of picking up or setting down passengers or (un) loading goods

#### Solid yellow line

A solid yellow line means no stopping

#### Blue parking disc zone lines

These blue lines are placed alongside the parking bays and places within a parking disc zone

#### Hatch markings

Hatch markings define a dangerous areas where it is necessary to separate the streams of traffic completely, such as a sharp bend or hump, or where traffic turning needs protection

- you should not cross or drive on or over these markings.

### Other important road markings

#### Pedestrian crossing (also called a "zebra" crossing)

you have to give the right of way to pedestrians at or near this crossing with a clear intent to cross the street.

#### Turning lanes at junctions and crossings

- pedal cyclists and drivers of light-mopeds are allowed to use turning lanes, but it is not compulsory.

### Bus carriageways and bus lanes

- often buses will be sharing these carriageways with tram

- A "LIJNBUS" or "BUS" lane has a solid or broken boundary line on the carriageway. When the word "LIJNBUS" is shown, these may only be used by public transport buses, trams and taxis with a special license.

#### Zigzags

warn of a particular dangerous situation on the road ahead; this could be the narrowing of the road, the approach to a pedestrian crossing, the approach to a crossing point for pedestrians, pedal cyclists, light moped, mopeds, speed humps, cushions etc

#### Staircase markings

the road surface warn of a particular dangerous situation on the road ahead

### Merging point and Diverging point

- you must not cross these lines
- However there is one exception: when this point is situated in an open rush hour lane, drivers are allowed to follow this lane and drive across the white lines of these points.

#### Temporary road markings

- these take precedence over other white road markings.

## **page 7/14**

### Traffic lights (also referred to as signals)

Traffic lights can have three (green, yellow and red) or two (yellow and red) colours and are divided into two categories:

- Full traffic lights.
- Filter traffic lights.

### Full traffic lights (3-colours)

full traffic lights the oncoming traffic will also have full traffic lights, which meant that you'll both have green at the same time.

The diagonally positioned arrows in these lights indicate that you should turn left at the second road, as the first road on your left will be the carriageway for the oncoming traffic.

### Filter traffic lights (3-colours)

- Filter traffic lights for all drivers display lights with a directional arrow

- At filter traffic lights you should expedite your turn and clear the crossing as soon as possible.

- Also note that filter lights generally change sooner than full lights

### Three exceptions to the rule

1. Military convoys
2. Priority vehicles
3. Right turn on yellow/red

### Full or filter traffic lights (2-colours)

You'll often see these 2-coloured traffic lights at places where the right of way needs to be regulated temporarily

### Yellow flashing lights

- Traffic lights which are out (of action or of order) often have a flashing yellow light. In such a situation it is important to approach that junction carefully.

- A single yellow flashing light warns of a dangerous situation ahead, where extra caution and a reduced speed will be required;

- Sign J32 often warns of traffic lights ahead; these can be filter or full traffic lights (signals)
    - These signs are often placed before a hill or a blind bend.

## **page 8/14**

### Traffic lights at level crossings

- At a level crossing with barriers you must wait as long as the flashing red lights are on, even when the barriers go up.
- Never stop on or just after the crossing.
- When traffic is queueing you must not block the crossing.

- The AKI is a level crossing without any physical protection.

### Lights at bridges

- Bridge lights are single flashing or fixed red lights or twin flashing red lights.

The red pedestrian light shown above can be substituted by a yellow flashing light, which means that this light then warns of a danger.

## Flow control traffic light systems

- allow passenger cars on to the acceleration lane at certain intervals, facilitating joining the through carriageway of the motorway.
- it only apply to drivers of passenger cars and can be ignored by other drivers!

## **page 9/14**

### Speed limits

![Alt text](https://github.com/frhan/study/blob/master/images/TH_02_37.jpg)

## **page 10/14**

### Matrix signs

-Where the speed limit on a matrix signs differs from the speed limit on another sign, the lowest speed limit will apply.

### Where the speed limit on a matrix signs differs from the speed limit on another sign, the lowest speed limit will apply

- It is sensible to follow a recommended speed.

## **page 11/14**

What is your speed limit?

### Local roads

- Broken edge lines.
- No centre lines.
- All road users may use these local roads where no area has been set aside for certain types of road users, e.g. a cycle lane for pedal cyclists and a pavement for pedestrians etc.
- The markings on this road indicate that this is a local road within a 60 km/h zon

### Connecting roads

- Broken edge Lines.

- Generally solid centre lines.

- 80 km/h outside the built-up area and 50 km/h or 70 km/h inside the built-up area.

- Sometimes agricultural vehicles and brommobielen are allowed on these roads; in that case the centre lines are broken.

### Through roads

- Solid edge lines.
- Solid centre lines.
- Green filling between centre lines.

## **page 12/14**

### Following Distance

- Approx. 2s from the vehicle ahead

**Fd = velocity / 2 + 10%**
50 km/h, 50/2 = 25 + 2.5 = 27.5m

### Stopping Distance

**Stopping Distance = Reaction Distance + Braking Disatnce**

### Reaction Distance

- Driver recieves a singal to break , until the moment the driver presses the break
- 1s

**Rd =  (speed / 10) * 3**

## Breaking Distance

**Bd = {(speed / 10) * (spped / 10)} / 2**

- When you drive as fast, the breaking distance quadruples

## page 14/14

## NTK

- The risk of an accident on a moped increases by 25% compared to when driving a passenger car.

- Because the priority road sign (B1) is placed after the junction you are driving outside the built-up area; on such roads your speed limit is 80 km/h. Case in point: INSIDE the built-up area these signs are placed BEFORE a junction where priority is regulated and OUTSIDE the built-up area AFTER such a junction; this is done because you must not PARK on the CARRIAGEWAY of a PRIORITY road OUTSIDE the built-up area!

- At a speed of 30 km/h the distance covered during the time that you are actually braking is about (30 : 10) X 3 = 9 : 2 = 4.5 meters. Case in point: the OVERALL stopping distance will be 13.5 meters; this is the sum of the distance covered during the response time and the distance covered during the braking action. The distance covered during the response time will be approximately (30 : 10) x 3 = 9 meters; this means that the OVERALL stopping distance will be about 4.5 PLUS 9 = 13.5 meters here.

- Motorways are always outside the built-up area where the rule that drivers must give way to a bus that signals its intention to pull away does not apply

- Upon leaving this 30 km/h zone, the inside the built-up area default speed limit of 50 km/h will apply again, because 30 km/h speed zones are always inside the built-up area!

- Only when pedestrians and children are crossing at a school crossing patrol or on a pedestrian crossing are you legally obliged to give them the right of way.

- drivers of a brommobiel have to follow the rules and regulations that apply to passenger cars: they are obliged to drive on the carriageway and they may not follow a cycle lane, a cycle path or a compulsory combined cycle/moped path!

- Coasting means that although the vehicle is moving, it's not being driven by the engine.

- U-turn - pay attention to the fact that the spoiler or bumper does not touch the edge of the pavement

- driving a brommobiel (mobility car); when the police physically stops you for speeding when driving a snorfiets (light moped), bromfiets (moped) or a brommobiel at a speed of 30 kilometers or more above the maximum speed limit

- a main traffic artery is a road designed for higher speeds, e.g. a motorroad or a motorway. Case in point: an access road to inhabited areas, inside or outside the built-up area, can be recognized by the absence of a centre line and the suggested cycle lanes with a different coloured road surface. A connecting road will have a single or double centre line and broken or solid side lines; these roads often have adjacent farms, houses and other amenities.

- An EBSL is an Expanded Bicycle Streaming Lane, also referred to as an advanced stop line for cyclists, light mopeds and invalid carriages at junctions. Case in point: in Dutch this is called an OFOS (Opgeblazen Fiets Opstel Strook); this the advanced stop line for cyclists. Some signal-controlled junctions have an advanced stop line to allow fietsers (pedal cyclists), snorfietsers (light moped riders), invalid carriages and riders of the special types of mopeds, i.e. Segway, Stint, Swing, Trikke and Zappy3, to be positioned ahead of other traffic. All other drivers, including bromfietsers (moped riders) and brommobielen (mobility cars), may not use this area but must stop at the first white, or yellow if temporary, line reached. If the lights are yellow or red you should avoid blocking the way or encroaching on the marked area at other times, e.g. if the junction ahead is blocked.

- The 60 km/h zone signs indicate that this is outside the built-up area; inside the built-up area there would have been a 30 km/h zone. Case in point: the type of road can be recognized by the absence of a centre line and the suggested cycle lanes, often with a different coloured road surface. These roads often have adjacent farms, houses and other amenities.

- At higher revolutions the engine will have more power (torque), but a smaller speed range. This means that at lower gears the engine will deliver more power to the wheels, but that the speed that you will be able to reach will be limited. Case in point: lower revolutions mean less power, but a wider range of speed. Lower revolutions also mean more fuel efficiency, but less control over the vehicle.

- An "ABRI" is defined as a shelter, a small enclosed waiting area, that provides shelter against the elements for bus and tram passengers. Case in point: these are often found in public transportation, like a bus, a tram or a bus or train station. The word "abri" is derived from the French verb "abrier", which means "to shelter"; due to the European marketing monopoly of the French "Abribus" by the French company J.C. Decaux, the same word is used to define these shelters in most mainland European countrie

- Only on access roads to inhabited areas, autowegen (motorroads) and connecting roads can you expect junctions with roads on the same level. Case in point: only on autosnelwegen (motorways) you'll always have junctions with roads at different levels; on autowegen (motorroads) this is also possible, but not a condition. On access roads to inhabited areas and connecting roads you'll seldom come across junctions with roads at different levels

- This is an articulated lorry, also called an "artic"; this is a combination of a tractor unit pulling a semi-trailer. You can recognize an artic by the registration plate starting with the letter"O", which stands for "oplegger", which is Dutch for semi-trailer. The maximum permitted length of a single lorry, also called a "rigid" is 12 meters. For a lorry pulling a trailer, recognizable by the registration plate on the trailer starting with the letter "W" for "wagen" (an abbreviation of "aanhangwagen", which is Dutch for trailer), the maximum permitted length is 18,75 meters. Case in point: overtaking such a vehicle will require a longer overtaking distance and time!

- Outside the built-up area, the maximum speed limit can be 130 km/h. Case in point: this maximum speed limit applies on autosnelwegen (motorways); although this is the default maximum speed on motorways, the highway authority can determine that a lower maximum speed limit on a particular road or stretch of road is more in line with the environment (open road) and more beneficial for the flow of traffic.

-


text:
package org.mybatis.generator.codegen.mybatis3.javamapper.elements;

import java.util.Set;
import java.util.TreeSet;

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;
import org.mybatis.generator.api.dom.java.Interface;
import org.mybatis.generator.api.dom.java.JavaVisibility;
import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.java.Parameter;

/**
 *
 * @author Jeff Butler
 *
 */
public class SelectByWhereMethodGenerator extends
        AbstractJavaMapperMethodGenerator {

    public SelectByWhereMethodGenerator() {
        super();
    }

    @Override
    public void addInterfaceElements(Interface interfaze) {
        Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
        FullyQualifiedJavaType type = new FullyQualifiedJavaType(
                introspectedTable.getWhereType());
        importedTypes.add(type);
        importedTypes.add(FullyQualifiedJavaType.getNewListInstance());

        Method method = new Method();
        method.setVisibility(JavaVisibility.PUBLIC);

        FullyQualifiedJavaType returnType = FullyQualifiedJavaType
                .getNewListInstance();
        FullyQualifiedJavaType listType;
        if (introspectedTable.getRules().generateRecordWithBLOBsClass()) {
            listType = new FullyQualifiedJavaType(introspectedTable
                    .getRecordWithBLOBsType());
        } else {
            // the blob fields must be rolled up into the base class
            listType = new FullyQualifiedJavaType(introspectedTable
                    .getBaseRecordType());
        }

        importedTypes.add(listType);
        returnType.addTypeArgument(listType);
        method.setReturnType(returnType);
        method.setName(introspectedTable
                .getSelectByWhereStatementId());
        method.addParameter(new Parameter(type,
                "where", "@Param(\"where\")")); //$NON-NLS-1$ //$NON-NLS-2$

        context.getCommentGenerator().addGeneralMethodComment(method,
                "根据条件查询记录");

        addMapperAnnotations(interfaze, method);

        if (context.getPlugins()
                .clientSelectByExampleWithBLOBsMethodGenerated(method, interfaze,
                        introspectedTable)) {
            interfaze.addImportedTypes(importedTypes);
            interfaze.addMethod(method);
        }
    }

    public void addMapperAnnotations(Interface interfaze, Method method) {
    }
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package de.delbrueg.predictor.lookahead_distance;

/**
 * predicts the lookahead distance just by the track width
 * @author Tim
 */
public class SimplyTrackWidthLookAheadDistancePredictor extends LookAheadDistancePredictor{

    @Override
    public double predictMaxLookAheadDistance() {
        return trackWidth*7;
    }

    @Override
    public double predictLookAheadThreshold() {
        return trackWidth / 100.0;
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Factory (esoco-lib 1.3.0 API)</title>
<meta name="date" content="2018-10-29">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

de.esoco.lib.manage

Interface Factory<T,D extends ElementDefinition<T>,E extends java.lang.Exception>

Functional Interface:

This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface Factory<T,D extends ElementDefinition<T>,E extends java.lang.Exception>

The base interface that must be provided by factory implementations. The
 generic type parameters define the type of the elements created by this
 factory (T), the element definition subtype needed to create new objects (D),
 and the type of exceptions that may be thrown if the creation of new elements
 fails (E).

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

T
create(D rDefinition)

Creates and returns a new element that corresponds to the given element
 definition.

Method Detail

create

T create(D rDefinition)
  throws E extends java.lang.Exception

Creates and returns a new element that corresponds to the given element
 definition.

Parameters:

rDefinition - The definition of the element to create

Returns:

The new element instance

Throws:

E - Any kind of exception may be thrown by factory implementations

E extends java.lang.Exception

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package be.klak.rhino;

public interface RhinoRunnable {

	public void run(RhinoContext context);
}


text:
#ifndef SPWINPUT_WIN32_H
#define SPWINPUT_WIN32_H

/* src\Inventor\Win\devices\spwinput_win32.h.  Generated from spwinput_win32.h.in by configure. */

/*----------------------------------------------------------------------
 * (C) 1998-2009 3Dconnexion. All rights reserved.
 * Permission to use, copy, modify, and distribute this software for all
 * purposes and without fees is hereby grated provided that this copyright
 * notice appears in all copies.  Permission to modify this software is granted
 * and 3Dconnexion will support such modifications only is said modifications are
 * approved by 3Dconnexion.
 *
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */

#include <Inventor/Win/devices/spwinput.h>

#ifndef HAVE_WIN32_API
#error "Do not include this file unless HAVE_WIN32_API is set."
#endif /* !HAVE_WIN32_API */

#include <tchar.h>

/* some enumerated types used in spwinput_win32.cpp */
enum InitResult
   {
   NOT_LOADED,
   FAILED,
   LOADED
   };

enum ErrorCode
   {
   NO_DLL_ERROR=0,
   DLL_LOAD_FAILURE,
   DLL_FUNCTION_LOAD_FAILURE,
   DLL_VAR_LOAD_FAILURE
   };

enum SpwRetVal             /* Error return values.                           */
   {
   SPW_NO_ERROR,           /* No error.                                      */
   SPW_ERROR,              /* Error -- function failed.                      */
   SI_BAD_HANDLE,          /* Invalid SpaceWare handle.                      */
   SI_BAD_ID,              /* Invalid device ID.                             */
   SI_BAD_VALUE,           /* Invalid argument value.                        */
   SI_IS_EVENT,            /* Event is a SpaceWare event.                    */
   SI_SKIP_EVENT,          /* Skip this SpaceWare event.                     */
   SI_NOT_EVENT,           /* Event is not a SpaceWare event.                */
   SI_NO_DRIVER,           /* SpaceWare driver is not running.               */
   SI_NO_RESPONSE,         /* SpaceWare driver is not responding.            */
   SI_UNSUPPORTED,         /* The function is unsupported by this version.   */
   SI_UNINITIALIZED,       /* SpaceWare input library is uninitialized.      */
   SI_WRONG_DRIVER,        /* Driver is incorrect for this SpaceWare version.*/
   SI_INTERNAL_ERROR,      /* Internal SpaceWare error.                      */
   SI_BAD_PROTOCOL,        /* The transport protocol is unknown.             */
   SI_OUT_OF_MEMORY,       /* Unable to malloc space required.               */
   SPW_DLL_LOAD_ERROR,     /* Could not load siapp dlls                      */
   SI_NOT_OPEN,            /* Spaceball device not open                      */
   SI_ITEM_NOT_FOUND	   /* Item not found                                 */
   };

static enum SpwRetVal *pDllSpwRetVal;

/* some macros */
#define SPW_FALSE   (0)
#define SPW_TRUE    (!SPW_FALSE)

#define SPW_MAX(a,b)   (((a)>(b))?(a):(b))
#define SPW_MIN(a,b)   (((a)<(b))?(a):(b))

#define SPW_ABS(a)   (((a)<0)?(-(a)):(a))

#define SPW_SIGN(a)  ((a)>=0?1:-1)

#define SPW_BIND(min,n,max)   (SPW_MIN((max),SPW_MAX((min),(n))))

#define SPW_NUM_ELEMENTS_IN(a)   (sizeof(a)/sizeof((a)[0]))

#define SPW_PI   3.14159265358979324f

#define SPW_DEG_TO_RAD(d)   ((d)*SPW_PI/180.0f)
#define SPW_RAD_TO_DEG(r)   ((r)*180.0f/SPW_PI)

#define SPW_LENGTH_OF(a)   (sizeof(a)/sizeof((a)[0]))

#define SPW_END_OF(a)   (&(a)[SPW_LENGTH_OF(a)-1])

#define SPW_SQ(a)   ((a)*(a))

#define SPW_ABSDIFF(a, b) (fabs((double) (a) - (b)))

/* the accepted datatypes for spacetec products */

#define tchar_t				_TCHAR
#define char_t				char
#define uint32_t			unsigned long
#define sint32_t			long
#define boolean_t			unsigned char
#define void_t				void
#define window_handle_t		HWND

typedef long               SPWint32;
typedef short              SPWint16;
typedef char               SPWint8;
typedef int                SPWbool;
typedef unsigned long      SPWuint32;
typedef unsigned short     SPWuint16;
typedef unsigned char      SPWuint8;
typedef _TCHAR             SPWchar;
typedef _TCHAR*            SPWstring;
typedef float              SPWfloat32;
typedef double             SPWfloat64;

/*
 * UI modes
 */
#define SI_UI_ALL_CONTROLS    0xffffffffL
#define SI_UI_NO_CONTROLS     0x00000000L

/*
 *  These UI modes are left here for legacy applications.
 */
#define SI_UI_FILTERS         0x00000001L
#define SI_UI_FUNC_BUTTONS    0x00000002L
#define SI_UI_RESET_BUTTONS   0x00000004L
#define SI_UI_SENSITIVITY     0x00000008L
#define SI_UI_TUNING          0x00000010L
#define SI_UI_DIALOG_POPUP    0x00000020L

/*
 * Device types and classes
 */
typedef enum
   {
   SI_ALL_TYPES           = -1,
   SI_UNKNOWN_DEVICE      =  0,
   SI_SPACEBALL_2003      =  1,
   SI_SPACEBALL_3003      =  2,
   SI_SPACE_CONTROLLER    =  3,
   SI_AVENGER             =  4,
   SI_SPACEORB_360        =  5,
   SI_NAVIGATOR           =  6,
   SI_SPACEBALL_2003A     =  7,
   SI_SPACEBALL_2003B     =  8,
   SI_SPACEBALL_2003C     =  9,
   SI_SPACEBALL_3003A     =  10,
   SI_SPACEBALL_3003B     =  11,
   SI_SPACEBALL_3003C     =  12,
   SI_SPACEBALL_4000      =  13,
   SI_SPACEMOUSE_CLASSIC  =  14,
   SI_SPACEMOUSE_PLUS     =  15,
   SI_SPACEMOUSE_XT       =  16,
   SI_PUCKMAN             =  17,
   SI_CADMAN              =  18,
   SI_NUM_DEV_TYPES  /* Leave this last, add before it */
   } SiDevType;

/*
 *  These defintions of device classes are left in for legacy applications.
 */
#define SI_HIGH_END           63
#define SI_MED_END            62
#define SI_LOW_END            61

/*
 * Data retrieval mode, only SI_EVENT is currently supported.
 */
#define SI_EVENT              0x0001
#define SI_POLL               0x0002

/*
 * Get event flags
 */
#define SI_AVERAGE_EVENTS     0x0001

/*
 * This is an INTERNAL flag used by the polling mechanism, user applications
 * should NOT send this flag.
 */
#define SI_POLLED_REQUEST     0x0100

/*
 * SpaceWare event types
 */
typedef enum
   {
   SI_BUTTON_EVENT = 1,
   SI_MOTION_EVENT,
   SI_COMBO_EVENT, /* Not implemented */
   SI_ZERO_EVENT,
   SI_EXCEPTION_EVENT,
   SI_OUT_OF_BAND,
   SI_ORIENTATION_EVENT,
   SI_KEYBOARD_EVENT,
   SI_LPFK_EVENT
   } SiEventType;

/*
 * Data modes
 */
#define SI_MODE_NORMALIZE     0x0001
#define SI_MODE_COMPRESS      0x0002
#define SI_MODE_SENSITIVITY   0x0004
#define SI_MODE_TUNING        0x0008

/*
 * Motion data offsets
 */
#define SI_TX                 0              /* Translation X value */
#define SI_TY                 1              /* Translation Y value */
#define SI_TZ                 2              /* Translation Z value */
#define SI_RX                 3              /* Rotation X value */
#define SI_RY                 4              /* Rotation Y value */
#define SI_RZ                 5              /* Rotation Z value */

/*
 * Reserved buttons
 */

#define SI_RESET_BIT          0x00000001L
#define SI_PICK_BIT           0x80000000L
#define SI_DIALOG_BIT         0x40000000L

#define SI_RESET_BUTTON       0
#define SI_PICK_BUTTON        31
#define SI_DIALOG_BUTTON      30

/*
 * Miscellaneous
 */
#define SI_END_ARGS           0
#define SI_NO_HANDLE          ((SiHdl) NULL)
#define SI_ALL_HANDLES        ((SiHdl) NULL)
#define SI_ANY_HANDLE         ((SiHdl) NULL)
#define SI_NO_TRANSCTL        ((SiTransCtl) NULL)
#define SI_NO_MASK            ((SiTypeMask *) NULL)
#define SI_ANY_DEVICE         -1
#define SI_NO_DEVICE          -1
#define SI_NO_TYPE            -1
#define SI_NO_LIST            -1
#define SI_NO_BUTTON          -1
#define SI_STRSIZE            128
#define SI_MAXBUF             128
#define SI_KEY_MAXBUF         5120

typedef int SiDevID;          /* Device ID */
typedef void *SiHdl;          /* SpaceWare handle */
typedef void *SiTransCtl;     /* SpaceWare transport control handle */

typedef struct                /* Open data */
   {

   HWND hWnd;               /* Window handle for SpaceWare messages.        */
   SiTransCtl transCtl;     /* SpaceWare transport control handle. Reserved */
                            /* for the s80 transport mechanism.             */
   DWORD processID;         /* The process ID for this application.         */
   char exeFile[MAX_PATH];  /* The executable name of the process.          */
   SPWint32 libFlag;        /* Library version flag.                        */
   } SiOpenData;

typedef struct                /* Get event Data */
   {

   UINT msg;
   WPARAM wParam;
   LPARAM lParam;
   } SiGetEventData;

typedef struct                /* Device type mask */
   {
   unsigned char mask[8];
   } SiTypeMask;

typedef struct                /* Device port information */
   {
   SiDevID devID;             /* Device ID */
   int devType;               /* Device type */
   int devClass;              /* Device class */
   char devName[SI_STRSIZE];  /* Device name */
   char portName[SI_STRSIZE]; /* Port name */
   } SiDevPort;

typedef struct                /* Device information */
   {
   char firmware[SI_STRSIZE]; /* Firmware version */
   int devType;               /* Device type */
   int numButtons;            /* Number of buttons */
   int numDegrees;            /* Number of degrees of freedom */
   SPWbool canBeep;           /* Device beeps */
   int majorVersion;          /* Major version number */
   int minorVersion;          /* Minor version number */
   } SiDevInfo;

typedef struct                /* Version information */
   {
   int major;                 /* Major version number */
   int minor;                 /* Minor version number */
   int build;                 /* Build number */
   char version[SI_STRSIZE];  /* Version string */
   char date[SI_STRSIZE];     /* Date string */
   } SiVerInfo;

typedef struct                /* Sensitivity parameters */
   {
   char dummy;
   } SiSensitivity;

typedef struct                /* Tuning parameters */
   {
   char dummy;
   } SiTuning;

typedef struct
   {
   SPWuint8 code;                 /* Out of band message code */
   SPWuint8 message[SI_MAXBUF-1]; /* The actual message       */
   } SiSpwOOB;

typedef struct
   {
   SPWuint8 string[SI_KEY_MAXBUF];  /* String for keyboard data */
   } SiKeyboardData;

typedef struct
   {
   SPWuint32 lpfk;            /* LPFK number to send */
   } SiLpfkData;

typedef enum
   {
   SI_LEFT = 0,
   SI_RIGHT
   } SiOrientation;

typedef struct                /* Bitmasks of button states */
   {
   SPWuint32 last;            /* Buttons pressed as of last event */
   SPWuint32 current;         /* Buttons pressed as of this event */
   SPWuint32 pressed;         /* Buttons pressed this event */
   SPWuint32 released;        /* Buttons released this event */
   } SiButtonData;

typedef struct                /* SpaceWare data */
   {
   SiButtonData bData;        /* Button data */
   long mData[6];             /* Motion data (index via SI_TX, etc) */
   long period;               /* Period (milliseconds) */
   } SiSpwData;

typedef struct                /* SpaceWare event */
   {
   int type;                  /* Event type */
   union
      {
      SiSpwData spwData;           /* Button, motion, or combo data        */
      SiSpwOOB spwOOB;             /* Out of band message                  */
      SiOrientation spwOrientation;/* Which hand orientation is the device */
      char exData[SI_MAXBUF];      /* Exception data                       */
      SiKeyboardData spwKeyData;   /* String for keyboard data             */
      SiLpfkData spwLpfkData;      /* LPFK data                            */
      } u;
   } SiSpwEvent;

typedef struct                /* Event handler (for SiDispatch) */
   {
   int (*func) (SiOpenData *, SiGetEventData *, SiSpwEvent *, void *);
   void *data;
   } SiEventHandler;

typedef struct                /* SpaceWare event handlers */
   {
   SiEventHandler button;     /* Button event handler */
   SiEventHandler motion;     /* Motion event handler */
   SiEventHandler combo;      /* Combo event handler */
   SiEventHandler zero;       /* Zero event handler */
   SiEventHandler exception;  /* Exception event handler */
   } SiSpwHandlers;

enum SpwRetVal SiAndTypeMask (SiTypeMask *pTMaskA, SiTypeMask *pTMaskB);

/* interface specifications define parameter passing to DLL functions */
#ifdef __cplusplus
extern "C" {
#endif

typedef enum SpwRetVal (WINAPI *PFNSI_INIT) (void);
typedef void (WINAPI *PFNSI_TERMINATE) (void);
typedef void (WINAPI *PFNSI_OPENWININIT) (SiOpenData *pData, HWND hWnd);
typedef int (WINAPI *PFNSI_GETNUMDEVICES) (void);
typedef SiDevID (WINAPI *PFNSI_GETDEVICEID) (SiHdl hdl);
typedef int (WINAPI *PFNSI_DISPATCH) (SiHdl hdl, SiGetEventData *pData,
                SiSpwEvent *pEvent, SiSpwHandlers *pDHandlers);
typedef SiHdl (WINAPI *PFNSI_OPEN) (char *pAppName, SiDevID devID, SiTypeMask *pTMask, int mode,
              SiOpenData *pData);
typedef enum SpwRetVal (WINAPI *PFNSI_CLOSE) (SiHdl hdl);
typedef SPWbool (WINAPI *PFNSI_ISSPACEWAREEVENT) (SiGetEventData *pData, SiHdl *pHdl);
typedef void (WINAPI *PFNSI_GETEVENTWININIT) (SiGetEventData *pData, UINT msg, WPARAM wParam, LPARAM lParam);
typedef enum SpwRetVal (WINAPI *PFNSI_GETEVENT) (SiHdl hdl, int flags, SiGetEventData *pData,
                           SiSpwEvent *pEvent);
typedef enum SpwRetVal (WINAPI *PFNSI_BEEP) (SiHdl hdl, char *pString);
typedef enum SpwRetVal (WINAPI *PFNSI_REZERO) (SiHdl hdl);
typedef enum SpwRetVal (WINAPI *PFNSI_GRABDEVICE) (SiHdl hdl, SPWbool exclusive);
typedef enum SpwRetVal (WINAPI *PFNSI_RELEASEDEVICE) (SiHdl hdl);
typedef int (WINAPI *PFNSI_BUTTONPRESSED) (SiSpwEvent *pEvent);
typedef int (WINAPI *PFNSI_BUTTONRELEASED) (SiSpwEvent *pEvent);
typedef enum SpwRetVal (WINAPI *PFNSI_SETUIMODE) (SiHdl hdl, SPWuint32 mode);
typedef enum SpwRetVal (WINAPI *PFNSI_SETTYPEMASK) (SiTypeMask *pTMask, int type1, ...);
typedef enum SpwRetVal (WINAPI *PFNSI_GETDEVICEPORT) (SiDevID devID, SiDevPort *pPort);
typedef enum SpwRetVal (WINAPI *PFNSI_GETDRIVERINFO) (SiVerInfo *pInfo);
typedef void (WINAPI *PFNSI_GETLIBRARYINFO) (SiVerInfo *pInfo);
typedef enum SpwRetVal (WINAPI *PFNSI_GETDEVICEINFO) (SiHdl hdl, SiDevInfo *pInfo);
typedef char* (WINAPI *PFNSPW_ERRORSTRING) (enum SpwRetVal val);
typedef SiDevID (WINAPI *PFNSI_DEVICEINDEX) (int idx);

#ifdef __cplusplus
}
#endif

/* function pointers to functions in DLL */
static PFNSI_INIT              pfnSiInit;
static PFNSI_TERMINATE         pfnSiTerminate;
static PFNSI_OPENWININIT       pfnSiOpenWinInit;
static PFNSI_GETNUMDEVICES     pfnSiGetNumDevices;
static PFNSI_GETDEVICEID       pfnSiGetDeviceID;
static PFNSI_DISPATCH          pfnSiDispatch;
static PFNSI_OPEN              pfnSiOpen;
static PFNSI_CLOSE             pfnSiClose;
static PFNSI_DEVICEINDEX       pfnSiDeviceIndex;
static PFNSI_GETEVENTWININIT   pfnSiGetEventWinInit;
static PFNSI_GETEVENT          pfnSiGetEvent;
static PFNSI_ISSPACEWAREEVENT  pfnSiIsSpaceWareEvent;
static PFNSI_BEEP              pfnSiBeep;
static PFNSI_REZERO            pfnSiRezero;
static PFNSI_GRABDEVICE        pfnSiGrabDevice;
static PFNSI_RELEASEDEVICE     pfnSiReleaseDevice;
static PFNSI_BUTTONPRESSED     pfnSiButtonPressed;
static PFNSI_BUTTONRELEASED    pfnSiButtonReleased;
static PFNSI_SETUIMODE         pfnSiSetUiMode;
static PFNSI_SETTYPEMASK       pfnSiSetypeMask;
static PFNSI_GETDEVICEPORT     pfnSiGetDevicePort;
static PFNSI_GETDRIVERINFO     pfnSiGetDriverInfo;
static PFNSI_GETLIBRARYINFO    pfnSiGetLibraryInfo;
static PFNSI_GETDEVICEINFO     pfnSiGetDeviceInfo;
static PFNSPW_ERRORSTRING      pfnSpwErrorString;

#ifdef __cplusplus
extern "C" {
#endif
/* externally used functions */
int SiGetPortList (SiDevPort **ppPort);
void SiFreePortList (SiDevPort *pPort);
void SiTune2003 (SiSpwEvent *pEvent);
void SiTuneSC (SiSpwEvent *pEvent);

enum SpwRetVal SiInitialize(void);
void           SiTerminate(void);
int            SiGetNumDevices (void);
SiDevID        SiDeviceIndex (int idx);
int            SiDispatch (SiHdl hdl, SiGetEventData *pData,
                           SiSpwEvent *pEvent, SiSpwHandlers *pDHandlers);
void           SiOpenWinInit (SiOpenData *pData, HWND hWnd);
SiHdl          SiOpen (char *pAppName, SiDevID devID, SiTypeMask *pTMask, int mode,
                       SiOpenData *pData);
enum SpwRetVal SiClose (SiHdl hdl);
void           SiGetEventWinInit (SiGetEventData *pData,
                                  UINT msg, WPARAM wParam, LPARAM lParam);
enum SpwRetVal SiGetEvent (SiHdl hdl, int flags, SiGetEventData *pData,
                           SiSpwEvent *pEvent);
enum SpwRetVal SiBeep (SiHdl hdl, char *string);
enum SpwRetVal SiRezero (SiHdl hdl);
enum SpwRetVal SiGrabDevice (SiHdl hdl, SPWbool exclusive);
enum SpwRetVal SiReleaseDevice (SiHdl hdl);
int            SiButtonPressed (SiSpwEvent *pEvent);
int            SiButtonReleased (SiSpwEvent *pEvent);
enum SpwRetVal SiSetUiMode (SiHdl hdl, SPWuint32 mode);
enum SpwRetVal SiSetTypeMask (SiTypeMask *pTMask, int type1, ...);
enum           SpwRetVal SiGetDevicePort (SiDevID devID, SiDevPort *pPort);
enum           SpwRetVal SiGetDriverInfo (SiVerInfo *pInfo);
void           SiGetLibraryInfo (SiVerInfo *pInfo);
enum           SpwRetVal SiGetDeviceInfo (SiHdl hdl, SiDevInfo *pInfo);
char * SpwErrorString (enum SpwRetVal val);

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif

int SPW_CheckForSpaceballWin32(void * win);
int SPW_TranslateEventWin32(MSG * msg, SPW_InputEvent * sbEvent);
void SPW_disableSpaceBallWin32(void);
int SPW_SpaceBallExistsWin32(void);

#ifdef __cplusplus
}
#endif

#endif /* #ifndef SIAPP_H */


text:
package org.elasticsearch.hadoop.cascading.lingual;

import java.io.IOException;
import java.util.Properties;

import org.elasticsearch.hadoop.EsHadoopIllegalArgumentException;
import org.elasticsearch.hadoop.cascading.CascadingUtils;
import org.elasticsearch.hadoop.util.StringUtils;

import cascading.flow.FlowProcess;
import cascading.scheme.Scheme;
import cascading.scheme.SinkCall;
import cascading.scheme.SourceCall;
import cascading.tap.SinkMode;
import cascading.tap.Tap;
import cascading.tuple.Fields;

@SuppressWarnings("rawtypes")
public class EsFactory {

    @SuppressWarnings("serial")
    public static class EsScheme extends Scheme {
        Fields fields;

        EsScheme(Fields fields) {
            this.fields = fields;
        }

        @Override
        public void sourceConfInit(FlowProcess flowProcess, Tap tap, Object conf) {
            throw new UnsupportedOperationException();
        }

        @Override
        public void sinkConfInit(FlowProcess flowProcess, Tap tap, Object conf) {
            throw new UnsupportedOperationException();
        }

        @Override
        public boolean source(FlowProcess flowProcess, SourceCall sourceCall) throws IOException {
            throw new UnsupportedOperationException();
        }

        @Override
        public void sink(FlowProcess flowProcess, SinkCall sinkCall) throws IOException {
            throw new UnsupportedOperationException();
        }
    }

    public Tap createTap(Scheme scheme, String path, SinkMode sinkMode, Properties properties) {
        if (!(scheme instanceof EsScheme)) {
            throw new EsHadoopIllegalArgumentException("Unknown scheme; expected " + EsScheme.class.getName());
        }

        String host = properties.getProperty("host");
        String portString = properties.getProperty("port");
        int port = (StringUtils.hasText(portString) ? Integer.parseInt(portString) : -1);
        String query = properties.getProperty("query");

        return CascadingUtils.hadoopTap(host, port, path, query, ((EsScheme) scheme).fields, properties);
    }

    public Scheme createScheme(Fields fields, Properties properties) {
        return new EsScheme(fields);
    }
}


text:
@interface BraintreeDemoIntegrationViewController ()
@property (nonatomic, strong) IASKSpecifierValuesViewController *targetViewController;
@property (nonatomic, strong) IASKAppSettingsViewController *appSettingsViewController;
@property (nonatomic, strong) IASKSpecifier *specifier;
@end

@implementation BraintreeDemoIntegrationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"Integrations";

    // Integrations table view
    self.targetViewController = [[IASKSpecifierValuesViewController alloc] init];
    self.appSettingsViewController = [[IASKAppSettingsViewController alloc] init];
    self.appSettingsViewController.delegate = self;

    // Assume that "Integration" is the first row of the first section
    self.specifier  = [self.appSettingsViewController.settingsReader specifierForIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
    [self.targetViewController setCurrentSpecifier:self.specifier];
    self.targetViewController.settingsReader = self.appSettingsViewController.settingsReader;
    self.targetViewController.settingsStore = self.appSettingsViewController.settingsStore;
    IASK_IF_IOS7_OR_GREATER(self.targetViewController.view.tintColor = self.appSettingsViewController.view.tintColor;)

    // Add table view to self
    SlideNavigationController *snc = [SlideNavigationController sharedInstance];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.targetViewController.view.frame = CGRectMake(snc.portraitSlideOffset, 0, self.view.bounds.size.width - snc.portraitSlideOffset, self.view.bounds.size.height);
    [self.targetViewController viewWillAppear:NO]; // required. not animated
    [self.view addSubview:self.targetViewController.view];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appSettingChangedNotification:) name:kIASKAppSettingChanged object:nil];
}

- (void)appSettingChangedNotification:(NSNotification *)notification {
    SlideNavigationController *snc = [SlideNavigationController sharedInstance];
    if (snc.isMenuOpen) {
        [self.delegate integrationViewController:self didChangeAppSetting:notification.userInfo];
        [snc closeMenuWithCompletion:nil];
    }
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

@end


text:
SELECT TOP 100
    'https://www.brookes.ac.uk/' + lower(clv.AliasLink) AS url_alias,
    clv.content_id,
    clv.content_title,
    clv.Path,
    clv.template_id,
    tt.template_filename,
    tt.template_name,
    clv.content_type,
    clv.content_subtype,
    clv.private,
    clv.IsArchived,
    clv.published

FROM ContentListView AS clv, templates_tbl AS tt
WHERE clv.template_id = tt.template_id
AND AliasLink != ''
AND clv.private != 1
AND clv.IsArchived != 1
AND clv.published = 1
;


text:
layout: post
title: Finalmente la neve
excerpt: Venerdì 27 Dicembre 2013 , Passo Lavaze' wonderful place
visible: 1
---

Primo giorno di vera neve !!

Stupenda giornata oggi con i miei amici Gardener Stefano e Fanton Paolo al passo Lavaze'.

Inizio allenamento ore 10:00 , temperatura di -3 gradi e neve fresca caduta il giorno prima, ben 70 cm. Finalmente sono riusciti a battere la pista Malga Ora e a breve apriranno altre piste fantastiche per allungare i kilometri totali.

Dopo l'annullamento della gara Team Sprint di Fiera di Primiero, causa forte pioggia , non mi restava che fare qualche veloce oggi e la gara Base Tuono la prossima domenica.

Allenamento di oggi : 2 h totali a skating con lavori 6 x 3 min veloce controllato con recuperi di 3 min ; sensazione abbastanza buone.

Ecco alcune foto delle stupenda sciata di questa mattina!

Complimenti a Stefano Gardener per la caduta :)

Riccardo


text:
/*
 * Do not modify this file. This file is generated from the ec2-2015-04-15.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.EC2.Model
{
    ///
    ///
    ///
    public partial class DescribeSnapshotsResponse : AmazonWebServiceResponse
    {
        private string _nextToken;
        private List<Snapshot> _snapshots = new List<Snapshot>();

        ///
        /// Gets and sets the property NextToken.
        /// <para>
        /// The NextToken value to include in a future DescribeSnapshots
        /// request. When the results of a DescribeSnapshots request exceed MaxResults,
        /// this value can be used to retrieve the next page of results. This value is null
        /// when there are no more results to return.
        /// </para>
        ///
        public string NextToken
        {
            get { return this._nextToken; }
            set { this._nextToken = value; }
        }

        // Check to see if NextToken property is set
        internal bool IsSetNextToken()
        {
            return this._nextToken != null;
        }

        ///
        /// Gets and sets the property Snapshots.
        /// <para>
        /// Information about the snapshots.
        /// </para>
        ///
        public List<Snapshot> Snapshots
        {
            get { return this._snapshots; }
            set { this._snapshots = value; }
        }

        // Check to see if Snapshots property is set
        internal bool IsSetSnapshots()
        {
            return this._snapshots != null && this._snapshots.Count > 0;
        }

    }
}


text:
namespace Harmony.Infrastructure.MVVM
{
	public abstract class ViewModelBase: BindableViewModel
	{
		#region Methods

		public virtual void Initialize()
		{

		}

		#endregion
	}
}


text:
/*
 * A program that folds two strands of nucleic acids in a duplex.
 * These strands of nucleic acids can be composed of either DNA or RNA.
 *
 * (c) 2009 Mathews Lab, University of Rochester Medical Center.
 * Written by Jessica S. Reuter
 */

#include "DuplexFold.h"

///////////////////////////////////////////////////////////////////////////////
// Constructor.
///////////////////////////////////////////////////////////////////////////////
DuplexFold::DuplexFold() {

	// Initialize the calculation type description.
	calcType = "Duplex folding";

	// Initialize the nucleic acid type.
	isRNA = true;

	// Initialize the maximum internal bulge loop size.
	maxLoop = 6;

	// Initialize the maximum number of structures.
	maxStructures = 10;

	// Initialize the maximum percent energy difference.
	percent = 40;

	// Initialize the calculation temperature.
	temperature = 310.15;

	// Initialize the folding window size.
	windowSize = 0;
}

///////////////////////////////////////////////////////////////////////////////
// Parse the command line arguments.
///////////////////////////////////////////////////////////////////////////////
bool DuplexFold::parse( int argc, char** argv ) {

	// Create the command line parser and build in its required parameters.
	ParseCommandLine* parser = new ParseCommandLine( "DuplexFold" );
	parser->addParameterDescription( "seq file 1", "The name of a file containing a first input sequence." );
	parser->addParameterDescription( "seq file 2", "The name of a file containing a second input sequence." );
	parser->addParameterDescription( "ct file", "The name of a CT file to which output will be written." );

	// Add the DNA option.
	vector<string> dnaOptions;
	dnaOptions.push_back( "-d" );
	dnaOptions.push_back( "-D" );
	dnaOptions.push_back( "--DNA" );
	parser->addOptionFlagsNoParameters( dnaOptions, "Specify that the sequence is DNA, and DNA parameters are to be used. Default is to use RNA parameters." );

	// Add the maximum loop size option.
	vector<string> loopOptions;
	loopOptions.push_back( "-l" );
	loopOptions.push_back( "-L" );
	loopOptions.push_back( "--loop" );
	parser->addOptionFlagsWithParameters( loopOptions, "Specify a maximum internal/bulge loop size. Default is 6 unpaired numcleotides." );

	// Add the maximum number of structures option.
	vector<string> maxStructuresOptions;
	maxStructuresOptions.push_back( "-m" );
	maxStructuresOptions.push_back( "-M" );
	maxStructuresOptions.push_back( "--maximum" );
	parser->addOptionFlagsWithParameters( maxStructuresOptions, "Specify a maximum number of structures. Default is 10 structures." );

	// Add the percent energy difference option.
	vector<string> percentOptions;
	percentOptions.push_back( "-p" );
	percentOptions.push_back( "-P" );
	percentOptions.push_back( "--percent" );
	parser->addOptionFlagsWithParameters( percentOptions, "Specify a maximum percent energy difference. Default is 40 percent (specified as 40, not 0.4)." );

	// Add the temperature option.
	vector<string> tempOptions;
	tempOptions.push_back( "-t" );
	tempOptions.push_back( "-T" );
	tempOptions.push_back( "--temperature" );
	parser->addOptionFlagsWithParameters( tempOptions, "Specify the temperature at which calculation takes place in Kelvin. Default is 310.15 K, which is 37 degrees C." );

	// Add the window size option.
	vector<string> windowOptions;
	windowOptions.push_back( "-w" );
	windowOptions.push_back( "-W" );
	windowOptions.push_back( "--window" );
	parser->addOptionFlagsWithParameters( windowOptions, "Specify a window size. Default is 0 nucleotides." );

	// Parse the command line into pieces.
	parser->parseLine( argc, argv );

	// Get required parameters from the parser.
	if( !parser->isError() ) {
		seqFile1 = parser->getParameter( 1 );
		seqFile2 = parser->getParameter( 2 );
		ctFile = parser->getParameter( 3 );
	}

	// Get the DNA option.
	if( !parser->isError() ) { isRNA = !parser->contains( dnaOptions ); }

	// Get the maximum loop size option.
	if( !parser->isError() ) {
		parser->setOptionInteger( loopOptions, maxLoop );
		if( maxLoop < 0 ) { parser->setError( "maximum loop size" ); }
	}

	// Get the maximum number of structures option.
	if( !parser->isError() ) {
		parser->setOptionInteger( maxStructuresOptions, maxStructures );
		if( maxStructures <= 0 ) { parser->setError( "maximum number of structures" ); }
	}

	// Get the percent energy difference option.
	if( !parser->isError() ) {
		parser->setOptionDouble( percentOptions, percent );
		if( percent < 0 ) { parser->setError( "percent energy difference" ); }
	}

	// Get the temperature option.
	if( !parser->isError() ) {
		parser->setOptionDouble( tempOptions, temperature );
		if( temperature < 0 ) { parser->setError( "temperature" ); }
	}

	// Get the window size option.
	if( !parser->isError() ) {
		parser->setOptionInteger( windowOptions, windowSize );
		if( windowSize < 0 ) { parser->setError( "window size" ); }
	}

	// Delete the parser and return whether the parser encountered an error.
	bool noError = ( parser->isError() == false );
	delete parser;
	return noError;
}

///////////////////////////////////////////////////////////////////////////////
// Run calculations.
///////////////////////////////////////////////////////////////////////////////
void DuplexFold::run() {

	// Create a variable that handles errors.
	int error = 0;

	/*
	 * Use the constructor for HybridRNA that specifies two filenames and types.
	 * For both sequences, specify type = 2 (sequence file).
	 * isRNA identifies whether the strand is RNA (true) or DNA (false).
	 *
	 * After construction of the strand data structure, create the error checker which monitors for errors.
	 * Throughout, the error status of the calculation is checked with a variant of the isErrorStatus method, which returns 0 if no error occurred.
	 * The calculation proceeds as long as error = 0.
	 */
	cout << "Initializing nucleic acids..." << flush;
	HybridRNA* strand = new HybridRNA( seqFile1.c_str(), 2, seqFile2.c_str(), 2, isRNA );
	ErrorChecker<HybridRNA>* checker = new ErrorChecker<HybridRNA>( strand );
	error = checker->isErrorStatus();
	if( error == 0 ) { cout << "done." << endl; }

	/*
	 * Set the temperature using the SetTemperature method.
	 * Only set the temperature if a given temperature doesn't equal the default.
	 * If the temperature does need to be set, use the error checker's isErrorStatus method to check for errors.
	 */
	if( ( error == 0 ) && ( temperature != 310.15 ) ) {

		// Show a message saying that the temperature is being set.
		cout << "Setting temperature..." << flush;

		// Set the temperature and check for errors.
		int tempError = strand->SetTemperature( temperature );
		error = checker->isErrorStatus( tempError );

		// If no error occurred, print a message saying that temperature is set.
		if( error == 0 ) { cout << "done." << endl; }
	}

	/*
	 * Fold the hybrid strand using the FoldDuplex method.
	 * After the main calculation is complete, use the error checker's isErrorStatus method to check for errors.
	 */
	if( error == 0 ) {

		// Show a message saying that the main calculation has started.
		cout << "Folding duplex..." << endl;

		// Create the progress monitor.
		TProgressDialog* progress = new TProgressDialog();
		strand->SetProgress( *progress );

		// Do the main calculation and check for errors.
		int mainCalcError = strand->FoldDuplex( percent, maxStructures, windowSize, maxLoop );
		error = checker->isErrorStatus( mainCalcError );

		// Delete the progress monitor.
		strand->StopProgress();
		delete progress;

		// If no error occurred, print message that main calculation is done.
		if( error == 0 ) { cout << "done." << endl; }
	}

	/*
	 * Write a CT output file using the WriteCt method.
	 * After writing is complete, use the error checker's isErrorStatus method to check for errors.
	 */
	if( error == 0 ) {

		// Show a message saying that the CT file is being written.
		cout << "Writing output ct file..." << flush;

		// Write the CT file and check for errors.
		int writeError = strand->WriteCt( ctFile.c_str() );
		error = checker->isErrorStatus( writeError );

		// If no errors occurred, show a CT file writing completion message.
		if( error == 0 ) { cout << "done." << endl; }
	}

	// Delete the error checker and data structure.
	delete checker;
	delete strand;

	// Print confirmation of run finishing.
	if( error == 0 ) { cout << calcType << " complete." << endl; }
	else { cerr << calcType << " complete with errors." << endl; }
}

///////////////////////////////////////////////////////////////////////////////
// Main method to run the program.
///////////////////////////////////////////////////////////////////////////////
int main( int argc, char* argv[] ) {

	DuplexFold* runner = new DuplexFold();
	bool parseable = runner->parse( argc, argv );
	if( parseable == true ) { runner->run(); }
	delete runner;
	return 0;
}


text:
package algo.ch03.collinearpoints;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * A BruteForce solution for finding collinear points in a set of points.
 *
 * @author ISchwarz
 */
public class BruteCollinearPoints {

    private LineSegment[] segments;

    public BruteCollinearPoints(Point[] points) {
        checkDuplicatedEntries(points);
        ArrayList<LineSegment> foundSegments = new ArrayList<>();

        Point[] pointsCopy = Arrays.copyOf(points, points.length);
        Arrays.sort(pointsCopy);

        for (int p = 0; p < pointsCopy.length - 3; p++) {
            for (int q = p + 1; q < pointsCopy.length - 2; q++) {
                for (int r = q + 1; r < pointsCopy.length - 1; r++) {
                    for (int s = r + 1; s < pointsCopy.length; s++) {
                        if (pointsCopy[p].slopeTo(pointsCopy[q]) == pointsCopy[p].slopeTo(pointsCopy[r]) &&
                                pointsCopy[p].slopeTo(pointsCopy[q]) == pointsCopy[p].slopeTo(pointsCopy[s])) {
                            foundSegments.add(new LineSegment(pointsCopy[p], pointsCopy[s]));
                        }
                    }
                }
            }
        }

        segments = foundSegments.toArray(new LineSegment[foundSegments.size()]);
    }

    public int numberOfSegments() {
        return segments.length;
    }

    public LineSegment[] segments() {
        return Arrays.copyOf(segments, numberOfSegments());
    }

    private void checkDuplicatedEntries(Point[] points) {
        for (int i = 0; i < points.length - 1; i++) {
            for (int j = i + 1; j < points.length; j++) {
                if (points[i].compareTo(points[j]) == 0) {
                    throw new IllegalArgumentException("Duplicated entries in given points.");
                }
            }
        }
    }

}


text:
/**
 * Some description of this piece of shit
 */
var config = require('./data/config.json');
var application = require('./components/monosnap.js').getInstance(config);

application.start();


text:
HelloWorld
==========

** TODO: Add description **


text:
BSLS_IDENT_RCSID(balber_berencoderoptions_cpp,"$Id$ $CSID$")

#include <bdlat_attributeinfo.h>
#include <bdlat_formattingmode.h>
#include <bdlat_valuetypefunctions.h>
#include <bdlb_print.h>
#include <bdlb_printmethods.h>
#include <bdlb_string.h>

#include <bsls_assert.h>

#include <iomanip>
#include <limits>
#include <ostream>

namespace BloombergLP {

                      // -------------------------------
                      // class balber::BerEncoderOptions
                      // -------------------------------

// CONSTANTS
const char balber::BerEncoderOptions::CLASS_NAME[] =
                                                   "balber::BerEncoderOptions";
const int  balber::BerEncoderOptions::
              DEFAULT_INITIALIZER_TRACE_LEVEL                          = 0;
const int  balber::BerEncoderOptions::
              DEFAULT_INITIALIZER_BDE_VERSION_CONFORMANCE              = 10500;
const bool balber::BerEncoderOptions::
              DEFAULT_INITIALIZER_ENCODE_EMPTY_ARRAYS                  = true;
const bool balber::BerEncoderOptions::
              DEFAULT_INITIALIZER_ENCODE_DATE_AND_TIME_TYPES_AS_BINARY = false;
const int  balber::BerEncoderOptions::
              DEFAULT_INITIALIZER_DATETIME_FRACTIONAL_SECOND_PRECISION = 3;

const bdlat_AttributeInfo balber::BerEncoderOptions::ATTRIBUTE_INFO_ARRAY[] = {
    {
        e_ATTRIBUTE_ID_TRACE_LEVEL,
        "TraceLevel",
        sizeof("TraceLevel") - 1,
        "",
        bdlat_FormattingMode::e_DEC
    },
    {
        e_ATTRIBUTE_ID_BDE_VERSION_CONFORMANCE,
        "BdeVersionConformance",
        sizeof("BdeVersionConformance") - 1,
        "",
        bdlat_FormattingMode::e_DEC
    },
    {
        e_ATTRIBUTE_ID_ENCODE_EMPTY_ARRAYS,
        "EncodeEmptyArrays",
        sizeof("EncodeEmptyArrays") - 1,
        "",
        bdlat_FormattingMode::e_TEXT
    },
    {
        e_ATTRIBUTE_ID_ENCODE_DATE_AND_TIME_TYPES_AS_BINARY,
        "EncodeDateAndTimeTypesAsBinary",
        sizeof("EncodeDateAndTimeTypesAsBinary") - 1,
        "",
        bdlat_FormattingMode::e_TEXT
    },
    {
        e_ATTRIBUTE_ID_DATETIME_FRACTIONAL_SECOND_PRECISION,
        "DatetimeFractionalSecondPrecision",
        sizeof("DatetimeFractionalSecondPrecision") - 1,
        "",
        bdlat_FormattingMode::e_DEC
    }
};

namespace balber {

// CLASS METHODS
const bdlat_AttributeInfo *BerEncoderOptions::lookupAttributeInfo(
                                                        const char *name,
                                                        int         nameLength)
{
    switch(nameLength) {
        case 10: {
            if (name[0]=='T'
             && name[1]=='r'
             && name[2]=='a'
             && name[3]=='c'
             && name[4]=='e'
             && name[5]=='L'
             && name[6]=='e'
             && name[7]=='v'
             && name[8]=='e'
             && name[9]=='l')
            {
                return &ATTRIBUTE_INFO_ARRAY[e_ATTRIBUTE_INDEX_TRACE_LEVEL];
                                                                      // RETURN
            }
        } break;
        case 17: {
            if (name[0]=='E'
             && name[1]=='n'
             && name[2]=='c'
             && name[3]=='o'
             && name[4]=='d'
             && name[5]=='e'
             && name[6]=='E'
             && name[7]=='m'
             && name[8]=='p'
             && name[9]=='t'
             && name[10]=='y'
             && name[11]=='A'
             && name[12]=='r'
             && name[13]=='r'
             && name[14]=='a'
             && name[15]=='y'
             && name[16]=='s')
            {
                return &ATTRIBUTE_INFO_ARRAY[
                                        e_ATTRIBUTE_INDEX_ENCODE_EMPTY_ARRAYS];
                                                                      // RETURN
            }
        } break;
        case 21: {
            if (name[0]=='B'
             && name[1]=='d'
             && name[2]=='e'
             && name[3]=='V'
             && name[4]=='e'
             && name[5]=='r'
             && name[6]=='s'
             && name[7]=='i'
             && name[8]=='o'
             && name[9]=='n'
             && name[10]=='C'
             && name[11]=='o'
             && name[12]=='n'
             && name[13]=='f'
             && name[14]=='o'
             && name[15]=='r'
             && name[16]=='m'
             && name[17]=='a'
             && name[18]=='n'
             && name[19]=='c'
             && name[20]=='e')
            {
                return &ATTRIBUTE_INFO_ARRAY[
                                    e_ATTRIBUTE_INDEX_BDE_VERSION_CONFORMANCE];
                                                                      // RETURN
            }
        } break;
        case 30: {
            if (name[0]=='E'
             && name[1]=='n'
             && name[2]=='c'
             && name[3]=='o'
             && name[4]=='d'
             && name[5]=='e'
             && name[6]=='D'
             && name[7]=='a'
             && name[8]=='t'
             && name[9]=='e'
             && name[10]=='A'
             && name[11]=='n'
             && name[12]=='d'
             && name[13]=='T'
             && name[14]=='i'
             && name[15]=='m'
             && name[16]=='e'
             && name[17]=='T'
             && name[18]=='y'
             && name[19]=='p'
             && name[20]=='e'
             && name[21]=='s'
             && name[22]=='A'
             && name[23]=='s'
             && name[24]=='B'
             && name[25]=='i'
             && name[26]=='n'
             && name[27]=='a'
             && name[28]=='r'
             && name[29]=='y')
            {
                return &ATTRIBUTE_INFO_ARRAY[
                       e_ATTRIBUTE_INDEX_ENCODE_DATE_AND_TIME_TYPES_AS_BINARY];
                                                                      // RETURN
            }
        } break;
        case 33: {
            if (name[0]=='D'
             && name[1]=='a'
             && name[2]=='t'
             && name[3]=='e'
             && name[4]=='t'
             && name[5]=='i'
             && name[6]=='m'
             && name[7]=='e'
             && name[8]=='F'
             && name[9]=='r'
             && name[10]=='a'
             && name[11]=='c'
             && name[12]=='t'
             && name[13]=='i'
             && name[14]=='o'
             && name[15]=='n'
             && name[16]=='a'
             && name[17]=='l'
             && name[18]=='S'
             && name[19]=='e'
             && name[20]=='c'
             && name[21]=='o'
             && name[22]=='n'
             && name[23]=='d'
             && name[24]=='P'
             && name[25]=='r'
             && name[26]=='e'
             && name[27]=='c'
             && name[28]=='i'
             && name[29]=='s'
             && name[30]=='i'
             && name[31]=='o'
             && name[32]=='n')
            {
                return &ATTRIBUTE_INFO_ARRAY[
                    e_ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION];
            }
        } break;
    }
    return 0;
}

const bdlat_AttributeInfo *BerEncoderOptions::lookupAttributeInfo(int id)
{
    switch (id) {
      case e_ATTRIBUTE_ID_TRACE_LEVEL:
        return &ATTRIBUTE_INFO_ARRAY[e_ATTRIBUTE_INDEX_TRACE_LEVEL];
      case e_ATTRIBUTE_ID_BDE_VERSION_CONFORMANCE:
        return &ATTRIBUTE_INFO_ARRAY[
                                    e_ATTRIBUTE_INDEX_BDE_VERSION_CONFORMANCE];
      case e_ATTRIBUTE_ID_ENCODE_EMPTY_ARRAYS:
        return &ATTRIBUTE_INFO_ARRAY[e_ATTRIBUTE_INDEX_ENCODE_EMPTY_ARRAYS];
      case e_ATTRIBUTE_ID_ENCODE_DATE_AND_TIME_TYPES_AS_BINARY:
        return &ATTRIBUTE_INFO_ARRAY[
                       e_ATTRIBUTE_INDEX_ENCODE_DATE_AND_TIME_TYPES_AS_BINARY];
      case e_ATTRIBUTE_ID_DATETIME_FRACTIONAL_SECOND_PRECISION:
        return &ATTRIBUTE_INFO_ARRAY[
                       e_ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION];
      default:
        return 0;
    }
}

// CREATORS

BerEncoderOptions::BerEncoderOptions()
: d_datetimeFractionalSecondPrecision(
                      DEFAULT_INITIALIZER_DATETIME_FRACTIONAL_SECOND_PRECISION)
, d_traceLevel(DEFAULT_INITIALIZER_TRACE_LEVEL)
, d_bdeVersionConformance(DEFAULT_INITIALIZER_BDE_VERSION_CONFORMANCE)
, d_encodeEmptyArrays(DEFAULT_INITIALIZER_ENCODE_EMPTY_ARRAYS)
, d_encodeDateAndTimeTypesAsBinary(
                      DEFAULT_INITIALIZER_ENCODE_DATE_AND_TIME_TYPES_AS_BINARY)
{
}

BerEncoderOptions::BerEncoderOptions(const BerEncoderOptions& original)
: d_datetimeFractionalSecondPrecision(
                                  original.d_datetimeFractionalSecondPrecision)
, d_traceLevel(original.d_traceLevel)
, d_bdeVersionConformance(original.d_bdeVersionConformance)
, d_encodeEmptyArrays(original.d_encodeEmptyArrays)
, d_encodeDateAndTimeTypesAsBinary(original.d_encodeDateAndTimeTypesAsBinary)
{
}

BerEncoderOptions::~BerEncoderOptions()
{
}

// MANIPULATORS

BerEncoderOptions&
BerEncoderOptions::operator=(const BerEncoderOptions& rhs)
{
    if (this != &rhs) {
        d_traceLevel                     = rhs.d_traceLevel;
        d_bdeVersionConformance          = rhs.d_bdeVersionConformance;
        d_encodeEmptyArrays              = rhs.d_encodeEmptyArrays;
        d_encodeDateAndTimeTypesAsBinary =
                                          rhs.d_encodeDateAndTimeTypesAsBinary;
        d_datetimeFractionalSecondPrecision =
                                       rhs.d_datetimeFractionalSecondPrecision;
    }
    return *this;
}

void BerEncoderOptions::reset()
{
    d_traceLevel            = DEFAULT_INITIALIZER_TRACE_LEVEL;
    d_bdeVersionConformance = DEFAULT_INITIALIZER_BDE_VERSION_CONFORMANCE;
    d_encodeEmptyArrays     = DEFAULT_INITIALIZER_ENCODE_EMPTY_ARRAYS;
    d_encodeDateAndTimeTypesAsBinary =
                      DEFAULT_INITIALIZER_ENCODE_DATE_AND_TIME_TYPES_AS_BINARY;
    d_datetimeFractionalSecondPrecision =
                      DEFAULT_INITIALIZER_DATETIME_FRACTIONAL_SECOND_PRECISION;
}

// ACCESSORS

bsl::ostream& BerEncoderOptions::print(
    bsl::ostream& stream,
    int           level,
    int           spacesPerLevel) const
{
    if (level < 0) {
        level = -level;
    }
    else {
        bdlb::Print::indent(stream, level, spacesPerLevel);
    }

    int levelPlus1 = level + 1;

    if (0 <= spacesPerLevel) {
        // multiline

        stream << "[\n";

        bdlb::Print::indent(stream, levelPlus1, spacesPerLevel);
        stream << "TraceLevel = ";
        bdlb::PrintMethods::print(stream,
                                  d_traceLevel,
                                  -levelPlus1,
                                  spacesPerLevel);

        bdlb::Print::indent(stream, levelPlus1, spacesPerLevel);
        stream << "BdeVersionConformance = ";
        bdlb::PrintMethods::print(stream,
                                  d_bdeVersionConformance,
                                  -levelPlus1,
                                  spacesPerLevel);

        bdlb::Print::indent(stream, levelPlus1, spacesPerLevel);
        stream << "EncodeEmptyArrays = ";
        bdlb::PrintMethods::print(stream,
                                  d_encodeEmptyArrays,
                                  -levelPlus1,
                                  spacesPerLevel);

        bdlb::Print::indent(stream, levelPlus1, spacesPerLevel);
        stream << "EncodeDateAndTimeTypesAsBinary = ";
        bdlb::PrintMethods::print(stream,
                                  d_encodeDateAndTimeTypesAsBinary,
                                  -levelPlus1,
                                  spacesPerLevel);

        bdlb::Print::indent(stream, levelPlus1, spacesPerLevel);
        stream << "DatetimeFractionalSecondPrecision = ";
        bdlb::PrintMethods::print(stream,
                                  d_datetimeFractionalSecondPrecision,
                                 -levelPlus1,
                                  spacesPerLevel);

        bdlb::Print::indent(stream, level, spacesPerLevel);

        stream << "]\n";
    }
    else {
        // single line

        stream << '[';

        stream << ' ';
        stream << "TraceLevel = ";
        bdlb::PrintMethods::print(stream, d_traceLevel,
                                  -levelPlus1,
                                  spacesPerLevel);

        stream << ' ';
        stream << "BdeVersionConformance = ";
        bdlb::PrintMethods::print(stream, d_bdeVersionConformance,
                                  -levelPlus1,
                                  spacesPerLevel);

        stream << ' ';
        stream << "EncodeEmptyArrays = ";
        bdlb::PrintMethods::print(stream, d_encodeEmptyArrays,
                                  -levelPlus1,
                                  spacesPerLevel);

        stream << ' ';
        stream << "EncodeDateAndTimeTypesAsBinary = ";
        bdlb::PrintMethods::print(stream, d_encodeDateAndTimeTypesAsBinary,
                                  -levelPlus1,
                                  spacesPerLevel);

        stream << ' ';
        stream << "DatetimeFractionalSecondPrecision = ";
        bdlb::PrintMethods::print(stream, d_datetimeFractionalSecondPrecision,
                                 -levelPlus1, spacesPerLevel);

        stream << " ]";
    }

    return stream << bsl::flush;
}

}  // close package namespace
}  // close enterprise namespace

// ----------------------------------------------------------------------------
// Copyright 2015 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------


text:
from django.db import models
from django.utils.translation import ugettext_lazy as _

class TimeStampedModel(models.Model):
    """
    Base abstract model that provides
    created and modified fields.
    NOTE: Inherit subclasseses Meta from
    TimeStampedModel.Meta when overriding.
    """

    created = models.DateTimeField(auto_now_add=True)
    modified = models.DateTimeField(auto_now=True)

    class Meta:
        abstract = True
        get_latest_by = 'created'
        ordering = ['-created']

class KVS(models.Model):
    """
    Basic key-value storage model.
    """

    TYPE_MAP = (
        ('int', int),
        ('float', float)
    )

    TYPE_CHOICES = tuple((t, t) for t in dict(TYPE_MAP).keys())

    key = models.CharField(max_length=256, db_index=True)
    value_raw = models.TextField(_(u'raw value'), blank=True)
    value_type = models.CharField(
        _(u'value type'),
        choices=TYPE_CHOICES,
        help_text=_(u'Coerces raw value to given type if needed'),
        max_length=32,
        blank=True,
        null=True)

    class Meta:
        verbose_name = _(u'KVS item')
        verbose_name_plural = _(u'KVS items')

    def __unicode__(self):
        return u'{0}: {1}'.format(self.key, self.value)

    @property
    def value(self):
        """
        Coerces raw value to appropriate type if
        given, otherwise returns raw value (string)
        """
        return (
            self.value_raw if self.value_type is None
            else dict(self.TYPE_MAP)[self.value_type](self.value_raw)
        )