text:
<!doctype html>

        <meta charset="utf-8">

        <title>Tangible immersion for ecological design</title>

        <meta name="description" content="Slides for Immersive Tangible Landscape ICC 2017 talk">
        <meta name="author" content="NCSU GeoForAll Lab members">

        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

        <link rel="stylesheet" href="css/reveal.css">
        <link rel="stylesheet" href="css/theme/osgeorel_greyscale.css" id="theme">

        <link rel="stylesheet" href="lib/css/zenburn.css">

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

 VRIG OCT 2018

 Rapid VR prototyping with Tangible Landscape

Payam Tabrizian, Anna Petrasova, Vaclav Petras, Brendan Harmon, Helena Mitasova

 North Carolina State University

   Good morning everyone and thank you x for introduction, today I will talk
about Immersive Tangible landscape modelling.

Tangible Landscape

A tangible user interface powered by open source GIS

2013-present

Realtime 3D scanning

with Kinect sensor

Tanigble interaction with GIS

<video  data-autoplay class="stretch" style="margin-top: 1em" controls>
<source src="video/tl_flow.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

With Tangible Landscape you can hold a GIS in your hands - feeling the shape of the earth, sculpting its topography, and directing the flow of water.

How it works ?

    For implementing the concept, we added a 3D modeling and game engine software, called blender,
    to the tangible landscape setup with outputs to a display and an immersive virtual reality headset.

GRASS GIS

free and open source (reduced cost of the system, more flexibility)

wide range of geospatial analyses (hydrology, remote sensing, vector network analysis, 3D rasters, ...)

easy to script in Python

fast algorithms in C/C++

Blender

Free and open source 3d modelling and game engine software

Easy scripting (Python)

GIS and Virtual reality plugin

High-quality real-time rendering and shading

    What is Blender? Why Blender?
    Blender is a free and open source program for modeling, rendering, simulation, animation, and game design.
    The software has an internal python-based IDE and add-ons for importing GIS data to georeference the scene, and displaying the viewport in HMDs.
    It also allows realtime high-quality rendering and shading.

 Software Architecture

    Briefly describing the workflow, GRASS GIS and Blender are loosely coupled through file-based communication. As user interacts with the tangible model or objects, GRASS GIS sends a copy of the geo-coordinated information or simulation to a specified system directory.
    We implemented a monitoring module in blender scripting environment that constantly watches the directory, identifies the type of incoming information, and apply relevant operations needed to update the 3d model. The input data can range from geospatial features like a raster or a point cloud, simple coordinates as a text file, or signals that prompt a command such as removing an object from the scene.

Interactions

        <col width="16%">
        <col width="18%">
        <col width="18%">
        <col width="18%">
        <col width="18%">

            surface
            points
            lines
            areas
            areas

To make Tangible Landscape more flexible, we developed multiple ways to interact with the physical models.
Here we use tangible objects, like a wooden marker to specify point locations on the landscape,lets say view points or trailheads, single trees and etc.

Recently, we have started to experiment with using laser pointer to draw objects, such as points, lines or polygons.

Another option is to use colored sand to create polygons where the color represents certain attribute of the polygon and the height of the sand can represent intensity of that property.

Our most recent interaction is creating areas using colored felt of different shapes placed on the model.

These interactions can be combined to achieve intuitive interactions for particular application.

Now I will show you some of the applications we developed for different study sites, using different geospatial models and each of them has different type of interaction.

 Landform and water bodies

    Now lets see how some of the landscape features are processed through the application.
    For example, when landscape is manipulated with hand, a geotiff raster and a polygon related to water is processed.
    As users carves the landscape, Water flow and accumulation simulations are continuously projected onto the physical model.
    Numeric indicators about the depth and surface area of the retained water is projected.
    At the same time, point-cloud and water polygon is transferred to blender update the 3D model.

 Vegetated surfaces

  Users can design tree patches using colored felt pieces. They can either draw and cut their prefered shapes using scissors, or select from a library of cutouts with various shapes.
  Each color represents a landscape class based on National landcover datast classification, like decidous, evergreen etc. For instance in this example green denotes evergreen class and
  eastern pine trees, red means decidous and red maple, blue represents wetland species and river birch.
  Grass GIS applies image segmentation and classification to the scanned image to assign RGB values to their corresponding landscape classes.
  Using landscape structure analysis we compute and project various metrics related to landscape heterogeneity, biodiversity and complexity,
  which as you can see is projected below the landscape model.

  After importing, Blender applies a particle system modifier to populate corresponding species in each patch based on a predefined spacing and density,related to each specie.
  Some degree of randomness is applied to the size, rotation and sucsession of species to mimic the realworld representation of a patch.

 Linear features, pathes

 (Show the trail and wooden cubes.)
 Additionally users can uses tangible objects, in this case wooden cubes to designtate a pathway, in this example a baord walk.
 As user inserts each of the chekpoints, Grass GIS, recalculetes and projects an optimal route using an algorithm that computes the least cost walking path.
 A profile of the road and the slope of the segments are projected as feedback (show them).

 Additionally, the polyline feature is processed in Blender as a walktrough simulation that can viewed on screen or in HMD.

 Camera control

   The 3D model is interactive so anytime during the interaction users can freely navigate in the environment and explore diffrent vantage points using the mouse.
   But we wanted to keep that feature interactive as well. We used wooden marker with colored tip, that denotes the viewers location and direction of view.
   The feature is exported as a polyline feature. Once imported in blender, The scene camera is then relocated to the line's starting point and the direction of view is aligned to the line's endpoint.

 Immersion

   <video data-autoplay class="stretch"  src="video/immersion.mp4" frameborder="0">

Using a virtual reality addon, blender viewport is continuously displayed in both viewport and headmounted display,
so users can pick up the headset and get immersed in their prefered views.
One additional camera is also set to follow the imported trail feature to initiate a walkthrough animation if required.

 Realism

 Realism

Optionally, user can manipulate degree of realism. We assigned each 3D feature from the sky to the trees to a low-poly counterpart.
Both low-poly models and blender scene are rendered in realtime and update almost instantly.

 Road map: EVEE

 Realtime render engine (OpenGL 3.0)

Source:  @huanghai0712

Tangible Landscape with robotic fabrication, streaming data, and autonomous construction

Bi-directionally coupling physical and digital landscapes

Open source

Tangible Landscape plugin for GRASS GIS

        github.com/tangible-landscape/grass-tangible-landscape

GRASS GIS module for importing data from Kinect v2

        github.com/tangible-landscape/r.in.kinect

Tangible Landscape repository on Open Science Framework

        osf.io/w8nr6

This system and all other development made by our team is free and open source and we are committed to help you setting up your own Tangible landscape system.

Resources

Tangible Landscape website:  tangible-landscape.github.io

Tangible Landscape wiki:
github.com/tangible-landscape/grass-tangible-landscape/wiki

Book:
        Tangible Modeling with Open Source GIS

    Immersive Tangible Geospatial Modeling. Proceedings of ACM SIGSPATIAL 2016.

If you are interested to learn more about Tangible landscape, These are some useful resources that can get you started.

   <video data-autoplay class="stretch"  src="video/case_study_video.mp4" frameborder="0">

     While I am taking the questions, you can look at this video to see how an ecological scientist and designer work together to design a landscape.
     Through the design process, please note that how the developments enables the dialogue between ecological assessment and aesthetic evaluation.


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Social Likes LiveJournal button</title>
	<link href="../social-likes_classic.css" rel="stylesheet">

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

LiveJournal button

LiveJournal

redpajama_set_name: RedPajamaGithub


text:
The React DevTools extension consists of multiple pieces:
* The **frontend** portion is the extension you see (the Components tree, the Profiler, etc.).
* The **backend** portion is invisible. It runs in the same context as React itself. When React commits changes to e.g. the DOM, the backend is responsible for notifying the frontend by sending a message through the **bridge** (an abstraction around e.g. `postMessage`).

One of the largest performance bottlenecks of the old React DevTools was the amount of bridge traffic. Each time React commits an update, the backend sends every fiber that changed across the bridge, resulting in a lot of (JSON) serialization. The primary goal for the DevTools rewrite was to reduce this traffic. Instead of sending everything across the bridge, **the backend should only send the minimum amount required to render the Components tree**. The frontend can request more information (e.g. an element's props) on demand, only as needed.

The old DevTools also rendered the entire application tree in the form of a large DOM structure of nested nodes. A secondary goal of the rewrite was to avoid rendering unnecessary nodes by using a windowing library (specifically [react-window](https://github.com/bvaughn/react-window)).

## Components panel

### Serializing the tree

Every React commit that changes the tree in a way DevTools cares about results in an "_operations_" message being sent across the bridge. These messages are lightweight patches that describe the changes that were made. (We don't resend the full tree structure like in legacy DevTools.)

The payload for each message is a typed array. The first two entries are numbers that identify which renderer and root the update belongs to (for multi-root support). Then the strings are encoded in a [string table](#string-table). The rest of the array depends on the operations being made to the tree.

No updates are required for most commits because we only send the following bits of information: element type, id, parent id, owner id, name, and key. Additional information (e.g. props, state) requires a separate ["_inspectElement_" message](#inspecting-an-element).

#### String table

The string table is encoded right after the first two numbers.

It consists of:

1. the total length of next items that belong to string table
2. for each string in a table:
  1. encoded size
  2. a list of its UTF encoded codepoints

For example, for `Foo` and `Bar` we would see:

```
[
  8,   // string table length
  3,   // encoded display name size
  70,  // "F"
  111, // "o"
  111, // "o"
  3,   // encoded display name size
  66,  // "B"
  97,  // "a"
  114, // "r"
]
```

Later operations will reference strings by a one-based index. For example, `1` would mean `"Foo"`, and `2` would mean `"Bar"`. The `0` string id always represents `null` and isn't explicitly encoded in the table.

#### Adding a root node

Adding a root to the tree requires sending 4 numbers:

1. add operation constant (`1`)
1. fiber id
1. element type constant (`8 === ElementTypeRoot`)
1. profiling supported flag

For example, adding a root fiber with an id of 1:
```js
[
  1, // add operation
  1, // fiber id
  8, // ElementTypeRoot
  1, // this root's renderer supports profiling
]
```

#### Adding a leaf node

Adding a leaf node takes a variable number of numbers since we need to decode the name (and potentially the key):

1. add operation constant (`1`)
1. fiber id
1. element type constant (e.g. `1 === ElementTypeClass`)
1. parent fiber id
1. owner fiber id
1. string table id for `displayName`
1. string table id for `key`

For example, adding a function component `<Foo>` with an id 2:
```js
[
  1,   // add operation
  2,   // fiber id
  1,   // ElementTypeClass
  1,   // parent id
  0,   // owner id
  3,   // encoded display name size
  1,   // id of "Foo" displayName in the string table
  0,   // id of null key in the string table (always zero for null)
]
```

#### Removing a node

Removing a fiber from the tree (a root or a leaf) requires sending:

1. remove operation constant (`2`)
1. how many items were removed
1. number of children
   * (followed by a children-first list of removed fiber ids)

For example, removing fibers with ids of 35 and 21:
```js
[
  2, // remove operation
  2, // number of removed fibers
  35, // first removed id
  21, // second removed id
]
```

#### Re-ordering children

1. re-order children constant (`3`)
1. fiber id
1. number of children
   * (followed by an ordered list of child fiber ids)

For example:
```js
[
  3,  // re-order operation
  15, // fiber id
  2,  // number of children
  35, // first child id
  21, // second child id
]
```

#### Updating tree base duration

While profiling is in progress, we send an extra operation any time a fiber is added or a updated in a way that affects its tree base duration. This information is needed by the Profiler UI in order to render the "snapshot" and "ranked" chart views.

1. tree base duration constant (`4`)
1. fiber id
1. tree base duration

For example, updating the base duration for a fiber with an id of 1:
```js
[
  4,  // tree base duration operation
  1,  // fiber id
  32, // new tree base duration value
]
```

## Reconstructing the tree

The frontend stores its information about the tree in a map of id to objects with the following keys:

* id: `number`
* parentID: `number`
* children: `Array<number>`
* type: `number` (constant)
* displayName: `string | null`
* key: `number | string | null`
* ownerID: `number`
* depth: `number` 1
* weight: `number` 2

1 The `depth` value determines how much padding/indentation to use for the element when rendering it in the Components panel. (This preserves the appearance of a nested tree, even though the view is a flat list.)

2 The `weight` of an element is the number of elements (including itself) below it in the tree. We cache this property so that we can quickly determine the total number of Components as well as to find the Nth element within that set. (This enables us to use windowing.) This value needs to be adjusted each time elements are added or removed from the tree, but we amortize this over time to avoid any big performance hits when rendering the tree.

#### Finding the element at index N

The tree data structure lets us impose an order on elements and "quickly" find the Nth one using the `weight` attribute.

First we find which root contains the index:
```js
let rootID;
let root;
let rootWeight = 0;
for (let i = 0; i < this._roots.length; i++) {
  rootID = this._roots[i];
  root = this._idToElement.get(rootID);
  if (root.children.length === 0) {
    continue;
  } else if (rootWeight + root.weight > index) {
    break;
  } else {
    rootWeight += root.weight;
  }
}
```

We skip the root itself because don't display them in the tree:
```js
const firstChildID = root.children[0];
```

Then we traverse the tree to find the element:
```js
let currentElement = this._idToElement.get(firstChildID);
let currentWeight = rootWeight;
while (index !== currentWeight) {
  for (let i = 0; i < currentElement.children.length; i++) {
    const childID = currentElement.children[i];
    const child = this._idToElement.get(childID);
    const { weight } = child;
    if (index <= currentWeight + weight) {
      currentWeight++;
      currentElement = child;
      break;
    } else {
      currentWeight += weight;
    }
  }
}
```

## Inspecting an element

When an element is mounted in the tree, DevTools sends a minimal amount of information about it across the bridge. This information includes its display name, type, and key- but does _not_ include things like props or state. (These values are often expensive to serialize and change frequently, which would add a significant amount of load to the bridge.)

Instead DevTools lazily requests additional information about an element only when it is selected in the "Components" tab. At that point, the frontend requests this information by sending a special "_inspectElement_" message containing the id of the element being inspected. The backend then responds with an "_inspectedElement_" message containing the additional details.

### Polling strategy

Elements can update frequently, especially in response to things like scrolling events. Since props and state can be large, we avoid sending this information across the bridge every time the selected element is updated. Instead, the frontend polls the backend for updates about once a second. The backend tracks when the element was last "inspected" and sends a special no-op response if it has not re-rendered since then.

### Deeply nested properties

Even when dealing with a single component, serializing deeply nested properties can be expensive. Because of this, DevTools uses a technique referred to as "dehyration" to only send a shallow copy of the data on initial inspection. DevTools then fills in the missing data on demand as a user expands nested objects or arrays. Filled in paths are remembered (for the currently inspected element) so they are not "dehyrated" again as part of a polling update.

### Inspecting hooks

Hooks present a unique challenge for the DevTools because of the concept of _custom_ hooks. (A custom hook is essentially any function that calls at least one of the built-in hooks. By convention custom hooks also have names that begin with "use".)

So how does DevTools identify custom functions called from within third party components? It does this by temporarily overriding React's built-in hooks and shallow rendering the component in question. Whenever one of the (overridden) built-in hooks are called, it parses the call stack to spot potential custom hooks (functions between the component itself and the built-in hook). This approach enables it to build a tree structure describing all of the calls to both the built-in _and_ custom hooks, along with the values passed to those hooks. (If you're interested in learning more about this, [here is the source code](https://github.com/facebook/react/blob/master/packages/react-debug-tools/src/ReactDebugHooks.js).)

> **Note**: DevTools obtains hooks info by re-rendering a component.
> Breakpoints will be invoked during this additional (shallow) render,
> but DevTools temporarily overrides `console` methods to suppress logging.

### Performance implications

To mitigate the performance impact of re-rendering a component, DevTools does the following:
* Only function components that use _at least one hook_ are rendered. (Props and state can be analyzed without rendering.)
* Rendering is always shallow.
* Rendering is throttled to occur, at most, once per second.
* Rendering is skipped if the component has not updated since the last time its properties were inspected.

## Profiler

The Profiler UI is a powerful tool for identifying and fixing performance problems. The primary goal of the new profiler is to minimize its impact (CPU usage) while profiling is active. This can be accomplished by:
* Minimizing bridge traffic.
* Making expensive computations lazy.

The majority of profiling information is stored on the backend. The backend push-notifies the frontend of when profiling starts or stops by sending a "_profilingStatus_" message. The frontend also asks for the current status after mounting by sending a "_getProfilingStatus_" message. (This is done to support the reload-and-profile functionality.)

When profiling begins, the frontend takes a snapshot/copy of each root. This snapshot includes the id, name, key, and child IDs for each node in the tree. (This information is already present on the frontend, so it does not require any additional bridge traffic.) While profiling is active, each time React commits– the frontend also stores a copy of the "_operations_" message (described above). Once profiling has finished, the frontend can use the original snapshot along with each of the stored "_operations_" messages to reconstruct the tree for each of the profiled commits.

When profiling begins, the backend records the base durations of each fiber currently in the tree. While profiling is in progress, the backend also stores some information about each commit, including:
* Commit time and duration
* Which elements were rendered during that commit
* Which interactions (if any) were part of the commit
* Which props and state changed (if enabled in profiler settings)

This information will eventually be required by the frontend in order to render its profiling graphs, but it will not be sent across the bridge until profiling has completed (to minimize the performance impact of profiling).

### Combining profiling data

Once profiling is finished, the frontend requests profiling data from the backend one renderer at a time by sending a "_getProfilingData_" message. The backend responds with a "_profilingData_" message that contains per-root commit timing and duration information. The frontend then combines this information with its own snapshots to form a complete picture of the profiling session. Using this data, charts and graphs are lazily computed (and incrementally cached) on demand, based on which commits and views are selected in the Profiler UI.

### Importing/exporting data

Because all of the data is merged in the frontend after a profiling session is completed, it can be exported and imported (as a single JSON object), enabling profiling sessions to be shared between users.


text:
from distutils.core import setup

setup(
    name='django-formset-helper',
    version='0.1',
    url='https://github.com/henryfentanes/django-formset-helper',
    install_requires=[
        'Django >= 1.6',
        'django-extra-views'],
    description='Helper templatetag to use with formsets',
    license="MIT",
    author='Henry Fentanes',
    author_email='henryfentanes@gmail.com',
    packages=['django_formset_helper'],
    package_dir={'django_formset_helper': 'django_formset_helper'},
    include_package_data=True,
    package_data={'django_formset_helper': ['*']},
    classifiers=[
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2'],
)


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
All Classes
</TITLE>

<META NAME="date" CONTENT="2009-06-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

All Classes

BoundedFeatureDictionary

Conceptualizer

ConceptualizerImpl

DelimitedDictionaryFeatureExtractor

DenseMapVector

DenseMapVectorFactory

DiskBufferedDoubleMatrix

DoubleMatrix

DoubleMatrixBase

EigenSpace

EigenSpaceImpl

EigenStatus

EigenUpdater

FeatureDictionary

FeatureDictionary.Feature

FeatureExpander

FeatureExtractor

FileUtils

FixedSizeSortedSet

HashMapDoubleMatrix

HashMapVector

HashMapVectorFactory

HebbianSolver

HebbianUpdater

Idf

ImmutableSparseDoubleMatrix

ImmutableSparseMapVector

ImmutableStreamBufferedDoubleMatrix

IntDoublePair

MapVector

MultiThreadedEigenVerifier

ParallelMultiplyingDiskBufferedDoubleMatrix

ParallelMultiplyingDiskBufferedDoubleMatrix.MultiplierCallable

PartialMatrixEigenVerifier

PrecisionUtils

RowNormalizer

RowSortedDoubleMatrix

SimpleEigenVerifier

SingleFileDiskBufferedDoubleMatrix

SingularVectorVerifier

TrainingState

VectorFactory


text:
namespace android.net
{
	[global::MonoJavaBridge.JavaClass()]
	public partial class LocalServerSocket : java.lang.Object
	{
		internal new static global::MonoJavaBridge.JniGlobalHandle staticClass;
		protected LocalServerSocket(global::MonoJavaBridge.JNIEnv @__env) : base(@__env)
		{
		}
		private static global::MonoJavaBridge.MethodId _m0;
		public virtual void close()
		{
			global::MonoJavaBridge.JavaBridge.CallVoidMethod(this, global::android.net.LocalServerSocket.staticClass, "close", "()V", ref global::android.net.LocalServerSocket._m0);
		}
		private static global::MonoJavaBridge.MethodId _m1;
		public virtual global::android.net.LocalSocket accept()
		{
			return global::MonoJavaBridge.JavaBridge.CallObjectMethod(this, global::android.net.LocalServerSocket.staticClass, "accept", "()Landroid/net/LocalSocket;", ref global::android.net.LocalServerSocket._m1) as android.net.LocalSocket;
		}
		public new global::java.io.FileDescriptor FileDescriptor
		{
			get
			{
				return getFileDescriptor();
			}
		}
		private static global::MonoJavaBridge.MethodId _m2;
		public virtual global::java.io.FileDescriptor getFileDescriptor()
		{
			return global::MonoJavaBridge.JavaBridge.CallSealedClassObjectMethod<java.io.FileDescriptor>(this, global::android.net.LocalServerSocket.staticClass, "getFileDescriptor", "()Ljava/io/FileDescriptor;", ref global::android.net.LocalServerSocket._m2) as java.io.FileDescriptor;
		}
		public new global::android.net.LocalSocketAddress LocalSocketAddress
		{
			get
			{
				return getLocalSocketAddress();
			}
		}
		private static global::MonoJavaBridge.MethodId _m3;
		public virtual global::android.net.LocalSocketAddress getLocalSocketAddress()
		{
			return global::MonoJavaBridge.JavaBridge.CallObjectMethod(this, global::android.net.LocalServerSocket.staticClass, "getLocalSocketAddress", "()Landroid/net/LocalSocketAddress;", ref global::android.net.LocalServerSocket._m3) as android.net.LocalSocketAddress;
		}
		private static global::MonoJavaBridge.MethodId _m4;
		public LocalServerSocket(java.lang.String arg0) : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			if (global::android.net.LocalServerSocket._m4.native == global::System.IntPtr.Zero)
				global::android.net.LocalServerSocket._m4 = @__env.GetMethodIDNoThrow(global::android.net.LocalServerSocket.staticClass, "<init>", "(Ljava/lang/String;)V");
			global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.net.LocalServerSocket.staticClass, global::android.net.LocalServerSocket._m4, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
			Init(@__env, handle);
		}
		private static global::MonoJavaBridge.MethodId _m5;
		public LocalServerSocket(java.io.FileDescriptor arg0) : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			if (global::android.net.LocalServerSocket._m5.native == global::System.IntPtr.Zero)
				global::android.net.LocalServerSocket._m5 = @__env.GetMethodIDNoThrow(global::android.net.LocalServerSocket.staticClass, "<init>", "(Ljava/io/FileDescriptor;)V");
			global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.net.LocalServerSocket.staticClass, global::android.net.LocalServerSocket._m5, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
			Init(@__env, handle);
		}
		static LocalServerSocket()
		{
			global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
			global::android.net.LocalServerSocket.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/net/LocalServerSocket"));
		}
	}
}


text:
"""
Django settings for business_directory project.

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

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

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
from os.path import join, dirname

from configurations import Configuration, values

BASE_DIR = dirname(dirname(__file__))

class Common(Configuration):

    # APP CONFIGURATION
    DJANGO_APPS = (
        # Default Django apps:
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.sites',
        'django.contrib.messages',
        'django.contrib.staticfiles',

        # Useful template tags:
        # 'django.contrib.humanize',

        # Admin
        'django.contrib.admin',
    )
    THIRD_PARTY_APPS = (
        'authtools',

        'crispy_forms',  # Form layouts
        'avatar',  # for user avatars
        'allauth',  # registration
        'allauth.account',  # registration
        'allauth.socialaccount',  # registration

        'djangocms_text_ckeditor',
        'cms',  # django CMS itself
        'mptt',  # utilities for implementing a modified pre-order traversal tree
        'menus',  # helper for model independent hierarchical website navigation
        # 'south',  # intelligent schema and data migrations
        'sekizai',  # for javascript and css management
        'djangocms_admin_style',  # for the admin skin. You **must** add 'djangocms_admin_style' in the list **before** 'django.contrib.admin'.

        'haystack',
        'django_messages',
        'admin_notifications',
        'tagging',
    )

    # Apps specific for this project go here.
    LOCAL_APPS = (
        'users',  # custom users app
        # Your stuff: custom apps go here
        'profiles',
        'careers',
        'aldryn_blog',
    )

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
    INSTALLED_APPS = DJANGO_APPS + LOCAL_APPS + THIRD_PARTY_APPS
    # END APP CONFIGURATION

    # MIDDLEWARE CONFIGURATION
    MIDDLEWARE_CLASSES = (
        # Make sure djangosecure.middleware.SecurityMiddleware is listed first
        'djangosecure.middleware.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',
        'cms.middleware.user.CurrentUserMiddleware',
        'cms.middleware.page.CurrentPageMiddleware',
        'cms.middleware.toolbar.ToolbarMiddleware',
        'cms.middleware.language.LanguageCookieMiddleware',
    )
    # END MIDDLEWARE CONFIGURATION

    # MIGRATIONS CONFIGURATION
    MIGRATION_MODULES = {
        'sites': 'contrib.sites.migrations',
    }
    # END MIGRATIONS CONFIGURATION

    # DEBUG
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
    DEBUG = values.BooleanValue(False)

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
    TEMPLATE_DEBUG = DEBUG
    # END DEBUG

    # SECRET CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
    # Note: This key only used for development and testing.
    #       In production, this is changed to a values.SecretValue() setting
    SECRET_KEY = "CHANGEME!!!"
    # END SECRET CONFIGURATION

    # FIXTURE CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS
    FIXTURE_DIRS = (
        join(BASE_DIR, 'fixtures'),
    )
    # END FIXTURE CONFIGURATION

    # EMAIL CONFIGURATION
    EMAIL_BACKEND = values.Value('django.core.mail.backends.smtp.EmailBackend')
    # END EMAIL CONFIGURATION

    # MANAGER CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
    ADMINS = (
        ("""Mike Mitrofanov""", 'michael.mitrofanov@gmail.com'),
    )

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
    MANAGERS = ADMINS
    # END MANAGER CONFIGURATION

    # DATABASE CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
    DATABASES = values.DatabaseURLValue('postgres://business_directory:123@localhost/business_directory')
    # END DATABASE CONFIGURATION

    # CACHING
    # Do this here because thanks to django-pylibmc-sasl and pylibmc
    # memcacheify (used on heroku) is painful to install on windows.
    CACHES = {
        'default': {
            'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
            'LOCATION': ''
        }
    }
    # END CACHING

    # GENERAL CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#time-zone
    TIME_ZONE = 'America/Los_Angeles'

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
    LANGUAGE_CODE = 'en'

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#site-id
    SITE_ID = 1

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
    USE_I18N = True

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#use-l10n
    USE_L10N = True

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
    USE_TZ = True
    # END GENERAL CONFIGURATION

    # TEMPLATE CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
    TEMPLATE_CONTEXT_PROCESSORS = (
        'django.contrib.auth.context_processors.auth',
        "allauth.account.context_processors.account",
        "allauth.socialaccount.context_processors.socialaccount",
        'django.core.context_processors.debug',
        'django.core.context_processors.i18n',
        'django.core.context_processors.media',
        'django.core.context_processors.static',
        'django.core.context_processors.tz',
        'django.contrib.messages.context_processors.messages',
        'django.core.context_processors.request',
        # Your stuff: custom template context processers go here
        'sekizai.context_processors.sekizai',
        'cms.context_processors.cms_settings',
        'django_messages.context_processors.inbox',
    )

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
    TEMPLATE_DIRS = (
        join(BASE_DIR, 'templates'),
    )

    TEMPLATE_LOADERS = (
        'django.template.loaders.filesystem.Loader',
        'django.template.loaders.app_directories.Loader',
    )

    # See: http://django-crispy-forms.readthedocs.org/en/latest/install.html#template-packs
    CRISPY_TEMPLATE_PACK = 'bootstrap3'
    # END TEMPLATE CONFIGURATION

    # STATIC FILE CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
    STATIC_ROOT = join(os.path.dirname(BASE_DIR), 'staticfiles')

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
    STATIC_URL = '/static/'

    # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
    STATICFILES_DIRS = (
        join(BASE_DIR, 'static'),
    )

    # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
    STATICFILES_FINDERS = (
        'django.contrib.staticfiles.finders.FileSystemFinder',
        'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    )
    # END STATIC FILE CONFIGURATION

    # MEDIA CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
    MEDIA_ROOT = join(BASE_DIR, 'media')

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#media-url
    MEDIA_URL = '/media/'
    RESUME_ROOT = join(MEDIA_ROOT, 'resumes')
    # END MEDIA CONFIGURATION

    # URL Configuration
    ROOT_URLCONF = 'urls'

    # See: https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application
    WSGI_APPLICATION = 'wsgi.application'
    # End URL Configuration

    # AUTHENTICATION CONFIGURATION
    AUTHENTICATION_BACKENDS = (
        "django.contrib.auth.backends.ModelBackend",
        "allauth.account.auth_backends.AuthenticationBackend",
    )

    # Some really nice defaults
    # ACCOUNT_AUTHENTICATION_METHOD = "username"
    ACCOUNT_AUTHENTICATION_METHOD = 'email'
    ACCOUNT_UNIQUE_EMAIL = True
    ACCOUNT_EMAIL_REQUIRED = True
    ACCOUNT_USERNAME_REQUIRED = False
    # ACCOUNT_EMAIL_VERIFICATION = "mandatory"
    ACCOUNT_EMAIL_VERIFICATION = "none"
    ACCOUNT_USER_MODEL_USERNAME_FIELD = None
    ACCOUNT_SIGNUP_FORM_CLASS = "users.forms.CustomSignupForm"

    # END AUTHENTICATION CONFIGURATION

    # Custom user app defaults
    # Select the correct user model
    AUTH_USER_MODEL = "users.User"
    LOGIN_REDIRECT_URL = "users:redirect"
    LOGIN_URL = "account_login"
    # END Custom user app defaults

    # SLUGLIFIER
    AUTOSLUG_SLUGIFY_FUNCTION = "slugify.slugify"
    # END SLUGLIFIER

    # LOGGING CONFIGURATION
    # See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
    # A sample logging configuration. The only tangible logging
    # performed by this configuration is to send an email to
    # the site admins on every HTTP 500 error when DEBUG=False.
    # See http://docs.djangoproject.com/en/dev/topics/logging for
    # more details on how to customize your logging configuration.
    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'filters': {
            'require_debug_false': {
                '()': 'django.utils.log.RequireDebugFalse'
            }
        },
        'handlers': {
            'mail_admins': {
                'level': 'ERROR',
                'filters': ['require_debug_false'],
                'class': 'django.utils.log.AdminEmailHandler'
            }
        },
        'loggers': {
            'django.request': {
                'handlers': ['mail_admins'],
                'level': 'ERROR',
                'propagate': True,
            },
        }
    }
    # END LOGGING CONFIGURATION

    # Your common stuff: Below this line define 3rd party library settings
    CMS_TEMPLATES = (
        ('template_1.html', 'Template One'),
    )

    LANGUAGES = [
        ('en', 'English'),
    ]

    HAYSTACK_CONNECTIONS = {
        'default': {
            'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
            'URL': 'http://127.0.0.1:8983/solr'
        },
    }


text:
Is this a:
- [ ] Issue with the OpenXml library
- [ ] Question on library usage

If you have answered that this is a question, please ask it on StackOverflow instead of here.
This issue tracker is meant to track product issues while StackOverflow excels at answering questions

---------------- Remove this line and above before posting ----------------

**Description**

Please provide a simple description of the issue encountered.

**Information**

- .NET Target: (ie .NET Framework, .NET Core, UWP, Xamarin, etc)
- DocumentFormat.OpenXml Version: (ie 2.7.2)

**Repro**

```csharp
// Please add a self-contained, minimum viable repro of the issue.
// If you require external resources, please provide a gist or GitHub repro
// An Xunit style test is preferred, but a console application would work too.
```

**Observed**

Please add your observed behavior here

**Expected**

Please add your expected behavior here.


text:
package ru.job4j.blockingalgo.pcpatern;

/**
 * Class responsible for consume the {@link Item} produced by {@link Producer}.
 *
 * @author Alexander Bondarev(mailto:bondarew2507@gmail.com).
 * @since 09.11.2017.
 */
public class Consumer implements Runnable {

    private ItemQueue queue;

    private String name;

    public Consumer(ItemQueue queue, String name) {
        this.queue = queue;
        this.name = name;
    }

    /**
     * Consume work from Producer through queue. (Just print to console).
     *
     * @throws InterruptedException exception.
     */
    public void consume() throws InterruptedException {
        Item item = queue.take();
        System.out.println(String.format("%S consume item %s produced by %s.",
                                         this.name, item.getId(), item.getProducer()
                           ));
    }

    @Override
    public void run() {
        while (true) {
            try {
                consume();
            } catch (InterruptedException e) {
                e.printStackTrace();
                return;
            }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/FilterCamera.iml" filepath="$PROJECT_DIR$/FilterCamera.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/filterlib/filterlib.iml" filepath="$PROJECT_DIR$/filterlib/filterlib.iml" />
    </modules>
  </component>
</project>


text:
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
// Additional Copyrights
//		Copyright 2004 John Vanderbeck
//		Copyright 2016 Chris Calef
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// This code implements support for SQLite into Torque and TorqueScript
//
// Essentially this creates a scriptable object that interfaces with SQLite.
//-----------------------------------------------------------------------------

#include "SQLiteObject.h"

#include "console/simBase.h"
#include "console/engineAPI.h"

#include "console/consoleInternal.h"
#include <cstdlib>

IMPLEMENT_CONOBJECT(SQLiteObject);

SQLiteObject::SQLiteObject()
{
   m_pDatabase = NULL;
   m_szErrorString = NULL;
   m_iLastResultSet = 0;
   m_iNextResultSet = 1;
}

SQLiteObject::~SQLiteObject()
{
	S32 index;
	// if we still have a database open, close it
	CloseDatabase();
	// Clear out any error string we may have left
	ClearErrorString();
	// Clean up result sets
	//
	// Boy oh boy this is such a crazy hack!
	// I can't seem to iterate through a vector and clean it up without screwing the vector.
	// So (HACK HACK HACK) what i'm doing for now is making a temporary vector that
	// contains a list of the result sets that the user hasn't cleaned up.
	// Clean up all those result sets, then delete the temp vector.
	Vector<S32> vTemp;
	Vector<S32>::iterator iTemp;

	VectorPtr<sqlite_resultset*>::iterator i;
	for (i = m_vResultSets.begin(); i != m_vResultSets.end(); i++)
	{
		vTemp.push_back((*i)->iResultSet);
	}
	index = 0;
	for (iTemp = vTemp.begin(); iTemp != vTemp.end(); iTemp++)
	{
		Con::warnf("SQLiteObject Warning: Result set #%i was not cleared by script.  Clearing it now.", vTemp[index]);
		ClearResultSet(vTemp[index]);
		index++;
	}

	m_vResultSets.clear();

}

bool SQLiteObject::processArguments(S32 argc, const char **argv)
{
	if (argc == 0)
		return true;
	else
		return true;
}

bool SQLiteObject::onAdd()
{
	if (!Parent::onAdd())
		return false;

	const char *name = getName();
	if (name && name[0] && getClassRep())
	{
		Namespace *parent = getClassRep()->getNameSpace();
		Con::linkNamespaces(parent->mName, name);
		mNameSpace = Con::lookupNamespace(name);
	}

	return true;
}

// This is the function that gets called when an instance
// of your object is being removed from the system and being
// destroyed.  Use this to do your clean up and what not.
void SQLiteObject::onRemove()
{
	CloseDatabase();
	Parent::onRemove();
}

// To be honest i'm not 100% sure on when this is called yet.
// Basically its used to set the values of any persistant fields
// the object has.  Similiar to the way datablocks work.  I'm
// just not sure how and when this gets called.
void SQLiteObject::initPersistFields()
{
	Parent::initPersistFields();
}

//-----------------------------------------------------------------------
// These functions below are our custom functions that we will tie into
// script.

S32 Callback(void *pArg, S32 argc, char **argv, char **columnNames)
{
	// basically this callback is called for each row in the SQL query result.
	// for each row, argc indicates how many columns are returned.
	// columnNames[i] is the name of the column
	// argv[i] is the value of the column

	sqlite_resultrow* pRow;
	sqlite_resultset* pResultSet;
	char* name;
	char* value;
	S32 i;

	if (argc == 0)
		return 0;

	pResultSet = (sqlite_resultset*)pArg;
	if (!pResultSet)
		return -1;

	// create a new result row
	pRow = new sqlite_resultrow;
	pResultSet->iNumCols = argc;
	// loop through all the columns and stuff them into our row
	for (i = 0; i < argc; i++)
	{
		// DBEUG CODE
  //      Con::printf("%s = %s\n", columnNames[i], argv[i] ? argv[i] : "NULL");
		name = new char[dStrlen(columnNames[i]) + 1];
		dStrcpy(name, columnNames[i]);
		pRow->vColumnNames.push_back(name);
		if (argv[i])
		{
			value = new char[dStrlen(argv[i]) + 1];
			dStrcpy(value, argv[i]);
			pRow->vColumnValues.push_back(value);
		}
		else
		{
			value = new char[10];
			dStrcpy(value, "NULL");
			pRow->vColumnValues.push_back(value);
		}
	}
	pResultSet->iNumRows++;
	pResultSet->vRows.push_back(pRow);

	// return 0 or else the sqlexec will be aborted.
	return 0;
}

bool SQLiteObject::OpenDatabase(const char* filename)
{
	// check to see if we already have an open database, and
	// if so, close it.
	CloseDatabase();

	Con::printf("CALLING THE OLD OPEN DATABASE FUNCTION!!!!!!!!!!!!!!!!!!");

	// We persist the error string so that the script may make a
	 // GetLastError() call at any time.  However when we get
	 // ready to make a call which could result in a new error,
	 // we need to clear what we have to avoid a memory leak.
	ClearErrorString();

	S32 isOpen = sqlite3_open(filename, &m_pDatabase);
	if (isOpen == SQLITE_ERROR)
	{
		// there was an error and the database could not
		// be opened.
		m_szErrorString = (char *)sqlite3_errmsg(m_pDatabase);
		Con::executef(this, "2", "onOpenFailed()", m_szErrorString);
		return false;
	}
	else
	{
		// database was opened without error
		Con::executef(this, "1", "onOpened()");

		//Now, for OpenSimEarth, load spatialite dll, so we can have GIS functions.
		//S32 canLoadExt = sqlite3_load_extension(m_pDatabase,"mod_spatialite.dll",0,0);
		//Con::printf("opened spatialite extension: %d",canLoadExt);
		//Sigh, no luck yet. Cannot find function GeomFromText().
	}
	return true;
}

S32 SQLiteObject::ExecuteSQL(const char* sql)
{
	S32 iResult;
	sqlite_resultset* pResultSet;

	// create a new resultset
	pResultSet = new sqlite_resultset;

	if (pResultSet)
	{
		pResultSet->bValid = false;
		pResultSet->iCurrentColumn = 0;
		pResultSet->iCurrentRow = 0;
		pResultSet->iNumCols = 0;
		pResultSet->iNumRows = 0;
		pResultSet->iResultSet = m_iNextResultSet;
		pResultSet->vRows.clear();
		m_iLastResultSet = m_iNextResultSet;
		m_iNextResultSet++;
	}
	else
		return 0;

	iResult = sqlite3_exec(m_pDatabase, sql, Callback, (void*)pResultSet, &m_szErrorString);
	if (iResult == 0)
	{
		//SQLITE_OK
		SaveResultSet(pResultSet);
		Con::executef(this, "1", "onQueryFinished()");
		return pResultSet->iResultSet;
	}
	else
	{
		// error occured
		Con::executef(this, "2", "onQueryFailed", m_szErrorString);
		Con::errorf("SQLite failed to execute query, error %s", m_szErrorString);
		delete pResultSet;
		return 0;
	}

	return 0;
}

void SQLiteObject::CloseDatabase()
{
	if (m_pDatabase)
		sqlite3_close(m_pDatabase);

	m_pDatabase = NULL;
}

//(The following function is courtesy of sqlite.org, minus changes to use m_pDatabase instead of pInMemory.)
/*
** This function is used to load the contents of a database file on disk
** into the "main" database of open database connection pInMemory, or
** to save the current contents of the database opened by pInMemory into
** a database file on disk. pInMemory is probably an in-memory database,
** but this function will also work fine if it is not.
**
** Parameter zFilename points to a null-terminated string containing the
** name of the database file on disk to load from or save to. If parameter
** isSave is non-zero, then the contents of the file zFilename are
** overwritten with the contents of the database opened by pInMemory. If
** parameter isSave is zero, then the contents of the database opened by
** pInMemory are replaced by data loaded from the file zFilename.
**
** If the operation is successful, SQLITE_OK is returned. Otherwise, if
** an error occurs, an SQLite error code is returned.
*/
S32 SQLiteObject::loadOrSaveDb(const char *zFilename, bool isSave)
{
	S32 rc;                   /* Function return code */
	sqlite3 *pFile;           /* Database connection opened on zFilename */
	sqlite3_backup *pBackup;  /* Backup object used to copy data */
	sqlite3 *pTo;             /* Database to copy to (pFile or pInMemory) */
	sqlite3 *pFrom;           /* Database to copy from (pFile or pInMemory) */

							  /* Open the database file identified by zFilename. Exit early if this fails
							  ** for any reason. */

	Con::printf("calling loadOrSaveDb, isSave = %d", isSave);

	if (isSave == false)
	{//If we're loading, have to create the memory database.
		if (!(SQLITE_OK == sqlite3_open(":memory:", &m_pDatabase)))
		{
			Con::printf("Unable to open a memory database!");
			return 0;
		}
	}
	rc = sqlite3_open(zFilename, &pFile);
	if (rc == SQLITE_OK) {

		/* If this is a 'load' operation (isSave==0), then data is copied
		** from the database file just opened to database pInMemory.
		** Otherwise, if this is a 'save' operation (isSave==1), then data
		** is copied from pInMemory to pFile.  Set the variables pFrom and
		** pTo accordingly. */
		pFrom = (isSave ? m_pDatabase : pFile);
		pTo = (isSave ? pFile : m_pDatabase);

		/* Set up the backup procedure to copy from the "main" database of
		** connection pFile to the main database of connection pInMemory.
		** If something goes wrong, pBackup will be set to NULL and an error
		** code and message left in connection pTo.
		**
		** If the backup object is successfully created, call backup_step()
		** to copy data from pFile to pInMemory. Then call backup_finish()
		** to release resources associated with the pBackup object.  If an
		** error occurred, then an error code and message will be left in
		** connection pTo. If no error occurred, then the error code belonging
		** to pTo is set to SQLITE_OK.
		*/
		pBackup = sqlite3_backup_init(pTo, "main", pFrom, "main");
		if (pBackup) {
			(void)sqlite3_backup_step(pBackup, -1);
			(void)sqlite3_backup_finish(pBackup);
		}
		rc = sqlite3_errcode(pTo);
	}

	/* Close the database connection opened on database file zFilename
	** and return the result of this function. */
	(void)sqlite3_close(pFile);

	//if (isSave ==  true)  // Actually, cancel this, I'm sure it will happen automatically and if we don't do it here, we can also use
	//{                     // this function for periodic saves, such as after saving mission.
	//	sqlite3_close(m_pDatabase);
	//}

	Con::printf("finished loadOrSaveDb, rc = %d", rc);

	if (rc == 0)
		return true;
	else
		return false;
}

void SQLiteObject::NextRow(S32 resultSet)
{
	sqlite_resultset* pResultSet;

	pResultSet = GetResultSet(resultSet);
	if (!pResultSet)
		return;

	pResultSet->iCurrentRow++;
}

bool SQLiteObject::EndOfResult(S32 resultSet)
{
	sqlite_resultset* pResultSet;

	pResultSet = GetResultSet(resultSet);
	if (!pResultSet)
		return true;

	if (pResultSet->iCurrentRow >= pResultSet->iNumRows)
		return true;

	return false;
}

void SQLiteObject::ClearErrorString()
{
	if (m_szErrorString)
		sqlite3_free(m_szErrorString);

	m_szErrorString = NULL;
}

void SQLiteObject::ClearResultSet(S32 index)
{
	if (index <= 0)
		return;

	sqlite_resultset* resultSet;
	S32 iResultSet;

	// Get the result set specified by index
	resultSet = GetResultSet(index);
	iResultSet = GetResultSetIndex(index);
	if ((!resultSet) || (!resultSet->bValid))
	{
		Con::warnf("Warning SQLiteObject::ClearResultSet(%i) failed to retrieve specified result set.  Result set was NOT cleared.", index);
		return;
	}
	// Now we have the specific result set to be cleared.
	// What we need to do now is iterate through each "Column" in each "Row"
	// and free the strings, then delete the entries.
	VectorPtr<sqlite_resultrow*>::iterator iRow;
	VectorPtr<char*>::iterator iColumnName;
	VectorPtr<char*>::iterator iColumnValue;

	for (iRow = resultSet->vRows.begin(); iRow != resultSet->vRows.end(); iRow++)
	{
		// Iterate through rows
		// for each row iterate through all the column values and names
		for (iColumnName = (*iRow)->vColumnNames.begin(); iColumnName != (*iRow)->vColumnNames.end(); iColumnName++)
		{
			// Iterate through column names.  Free the memory.
			delete[](*iColumnName);
		}
		for (iColumnValue = (*iRow)->vColumnValues.begin(); iColumnValue != (*iRow)->vColumnValues.end(); iColumnValue++)
		{
			// Iterate through column values.  Free the memory.
			delete[](*iColumnValue);
		}
		// free memory used by the row
		delete (*iRow);
	}
	// empty the resultset
	resultSet->vRows.clear();
	resultSet->bValid = false;
	delete resultSet;
	m_vResultSets.erase_fast(iResultSet);
}

sqlite_resultset* SQLiteObject::GetResultSet(S32 iResultSet)
{
	// Get the result set specified by iResultSet
	VectorPtr<sqlite_resultset*>::iterator i;
	for (i = m_vResultSets.begin(); i != m_vResultSets.end(); i++)
	{
		if ((*i)->iResultSet == iResultSet)
			break;
	}

	return *i;
}

S32 SQLiteObject::GetResultSetIndex(S32 iResultSet)
{
	S32 iIndex;
	// Get the result set specified by iResultSet
	VectorPtr<sqlite_resultset*>::iterator i;
	iIndex = 0;
	for (i = m_vResultSets.begin(); i != m_vResultSets.end(); i++)
	{
		if ((*i)->iResultSet == iResultSet)
			break;
		iIndex++;
	}

	return iIndex;
}

bool SQLiteObject::SaveResultSet(sqlite_resultset* pResultSet)
{
	// Basically just add this to our vector.  It should already be filled up.
	pResultSet->bValid = true;
	m_vResultSets.push_back(pResultSet);

	return true;
}

S32 SQLiteObject::GetColumnIndex(S32 iResult, const char* columnName)
{
	S32 iIndex;
	VectorPtr<char*>::iterator i;
	sqlite_resultset* pResultSet;
	sqlite_resultrow* pRow;

	pResultSet = GetResultSet(iResult);
	if (!pResultSet)
		return 0;

	pRow = pResultSet->vRows[0];
	if (!pRow)
		return 0;

	iIndex = 0;
	for (i = pRow->vColumnNames.begin(); i != pRow->vColumnNames.end(); i++)
	{
		if (dStricmp((*i), columnName) == 0)
			return iIndex + 1;
		iIndex++;
	}

	return 0;
}

S32 SQLiteObject::numResultSets()
{
	return m_vResultSets.size();
}

void SQLiteObject::escapeSingleQuotes(const char* source, char *dest)
{
	//To Do: This function needs to step through the source string and insert another single quote
	//immediately after every single quote it finds.

}

//-----------------------------------------------------------------------
// These functions are the code that actually tie our object into the scripting
// language.  As you can see each one of these is called by script and in turn
// calls the C++ class function.
// FIX: change all these to DefineEngineMethod!

ConsoleMethod(SQLiteObject, openDatabase, bool, 3, 3, "(const char* filename) Opens the database specifed by filename.  Returns true or false.")
{
	return object->OpenDatabase(argv[2]);
}

DefineEngineMethod(SQLiteObject, loadOrSaveDb, bool, (const char* filename, bool isSave), ,
	"Loads or saves a cached database from the disk db specifed by filename. Second argument determines loading (false) or saving (true). Returns true or false.")
{
	return object->loadOrSaveDb(filename, isSave);
}

ConsoleMethod(SQLiteObject, closeDatabase, void, 2, 2, "Closes the active database.")
{
	object->CloseDatabase();
}

ConsoleMethod(SQLiteObject, query, S32, 4, 0, "(const char* sql, S32 mode) Performs an SQL query on the open database and returns an identifier to a valid result set. mode is currently unused, and is reserved for future use.")
{
	S32 iCount;
	S32 iIndex, iLen, iNewIndex, iArg, iArgLen, i;
	char* szNew;

	if (argc == 4)
		return object->ExecuteSQL(argv[2]);
	else if (argc > 4)
	{
		// Support for printf type querys, as per Ben Garney's suggestion
		// Basically what this does is allow the user to insert question marks into their query that will
		// be replaced with actual data.  For example:
		// "SELECT * FROM data WHERE id=? AND age<7 AND name LIKE ?"

		// scan the query and count the question marks
		iCount = 0;
		iLen = dStrlen(argv[2]);
		for (iIndex = 0; iIndex < iLen; iIndex++)
		{
			if (argv[2][iIndex] == '?')
				iCount++;
		}

		// now that we know how many replacements we have, we need to make sure we
		// have enough arguments to replace them all.  All arguments above 4 should be our data
		if (argc - 4 == iCount)
		{
			// ok we have the correct number of arguments
			// so now we need to calc the length of the new query string.  This is easily achieved.
			// We simply take our base string length, subtract the question marks, then add in
			// the number of total characters used by our arguments.
			iLen = dStrlen(argv[2]) - iCount;
			for (iIndex = 1; iIndex <= iCount; iIndex++)
			{
				iLen = iLen + dStrlen(argv[iIndex + 3]);
			}
			// iLen should now be the length of our new string
			szNew = new char[iLen];

			// now we need to replace all the question marks with the actual arguments
			iLen = dStrlen(argv[2]);
			iNewIndex = 0;
			iArg = 1;
			for (iIndex = 0; iIndex <= iLen; iIndex++)
			{
				if (argv[2][iIndex] == '?')
				{
					// ok we need to replace this question mark with the actual argument
					// and iterate our pointers and everything as needed.  This is no doubt
					// not the best way to do this, but it works for me for now.
					// My god this is really a mess.
					iArgLen = dStrlen(argv[iArg + 3]);
					// copy first character
					szNew[iNewIndex] = argv[iArg + 3][0];
					// copy rest of characters, and increment iNewIndex
					for (i = 1; i < iArgLen; i++)
					{
						iNewIndex++;
						szNew[iNewIndex] = argv[iArg + 3][i];
					}
					iArg++;

				}
				else
					szNew[iNewIndex] = argv[2][iIndex];

				iNewIndex++;
			}
		}
		else
			return 0; // incorrect number of question marks vs arguments
		Con::printf("Old SQL: %s\nNew SQL: %s", argv[2].getStringValue(), szNew);
		return object->ExecuteSQL(szNew);
	}

	return 0;
}

ConsoleMethod(SQLiteObject, clearResult, void, 3, 3, "(S32 resultSet) Clears memory used by the specified result set, and deletes the result set.")
{
	object->ClearResultSet(dAtoi(argv[2]));
}

ConsoleMethod(SQLiteObject, nextRow, void, 3, 3, "(S32 resultSet) Moves the result set's row pointer to the next row.")
{
	sqlite_resultset* pResultSet;
	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		pResultSet->iCurrentRow++;
	}
}

ConsoleMethod(SQLiteObject, previousRow, void, 3, 3, "(S32 resultSet) Moves the result set's row pointer to the previous row")
{
	sqlite_resultset* pResultSet;
	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		pResultSet->iCurrentRow--;
	}
}

ConsoleMethod(SQLiteObject, firstRow, void, 3, 3, "(S32 resultSet) Moves the result set's row pointer to the very first row in the result set.")
{
	sqlite_resultset* pResultSet;
	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		pResultSet->iCurrentRow = 0;
	}
}

ConsoleMethod(SQLiteObject, lastRow, void, 3, 3, "(S32 resultSet) Moves the result set's row pointer to the very last row in the result set.")
{
	sqlite_resultset* pResultSet;
	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		pResultSet->iCurrentRow = pResultSet->iNumRows - 1;
	}
}

ConsoleMethod(SQLiteObject, setRow, void, 4, 4, "(S32 resultSet S32 row) Moves the result set's row pointer to the row specified.  Row indices start at 1 not 0.")
{
	sqlite_resultset* pResultSet;
	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		pResultSet->iCurrentRow = dAtoi(argv[3]) - 1;
	}
}

ConsoleMethod(SQLiteObject, getRow, S32, 3, 3, "(S32 resultSet) Returns what row the result set's row pointer is currently on.")
{
	sqlite_resultset* pResultSet;
	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		return pResultSet->iCurrentRow + 1;
	}
	else
		return 0;
}

ConsoleMethod(SQLiteObject, numRows, S32, 3, 3, "(S32 resultSet) Returns the number of rows in the result set.")
{
	sqlite_resultset* pResultSet;
	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		return pResultSet->iNumRows;
	}
	else
		return 0;
}

ConsoleMethod(SQLiteObject, numColumns, S32, 3, 3, "(S32 resultSet) Returns the number of columns in the result set.")
{
	sqlite_resultset* pResultSet;
	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		return pResultSet->iNumCols;
	}
	else
		return 0;
}

ConsoleMethod(SQLiteObject, endOfResult, bool, 3, 3, "(S32 resultSet) Checks to see if the internal pointer for the specified result set is at the end, indicating there are no more rows left to read.")
{
	return object->EndOfResult(dAtoi(argv[2]));
}

ConsoleMethod(SQLiteObject, EOR, bool, 3, 3, "(S32 resultSet) Same as endOfResult().")
{
	return object->EndOfResult(dAtoi(argv[2]));
}

ConsoleMethod(SQLiteObject, EOF, bool, 3, 3, "(S32 resultSet) Same as endOfResult().")
{
	return object->EndOfResult(dAtoi(argv[2]));
}

ConsoleMethod(SQLiteObject, getColumnIndex, S32, 4, 4, "(resultSet columnName) Looks up the specified column name in the specified result set, and returns the columns index number.  A return value of 0 indicates the lookup failed for some reason (usually this indicates you specified a column name that doesn't exist or is spelled wrong).")
{
	return object->GetColumnIndex(dAtoi(argv[2]), argv[3]);
}

ConsoleMethod(SQLiteObject, getColumnName, const char *, 4, 4, "(resultSet columnIndex) Looks up the specified column index in the specified result set, and returns the column's name.  A return value of an empty string indicates the lookup failed for some reason (usually this indicates you specified a column index that is invalid or exceeds the number of columns in the result set). Columns are index starting with 1 not 0")
{
	sqlite_resultset* pResultSet;
	sqlite_resultrow* pRow;
	S32 iColumn;

	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		pRow = pResultSet->vRows[pResultSet->iCurrentRow];
		if (!pRow)
			return "";

		// We assume they specified column by index.  If they know the column name they wouldn't be calling this function :)
		iColumn = dAtoi(argv[3]);
		if (iColumn == 0)
			return "";  // column indices start at 1, not 0

		 // now we should have an index for our column name
		if (pRow->vColumnNames[iColumn])
			return pRow->vColumnNames[iColumn];
		else
			return "";
	}
	else
		return "";
}

ConsoleMethod(SQLiteObject, getColumn, const char *, 4, 4, "(resultSet column) Returns the value of the specified column (Column can be specified by name or index) in the current row of the specified result set. If the call fails, the returned string will indicate the error.")
{
	sqlite_resultset* pResultSet;
	sqlite_resultrow* pRow;
	S32 iColumn;

	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{
		if (pResultSet->vRows.size() == 0)
			return "NULL";

		pRow = pResultSet->vRows[pResultSet->iCurrentRow];
		if (!pRow)
			return "invalid_row";

		// Is column specified by a name or an index?
		iColumn = dAtoi(argv[3]);
		if (iColumn == 0)
		{
			// column was specified by a name
			iColumn = object->GetColumnIndex(dAtoi(argv[2]), argv[3]);
			// if this is still 0 then we have some error
			if (iColumn == 0)
				return "invalid_column";
		}

		// We temporarily padded the index in GetColumnIndex() so we could return a
		// 0 for error.  So now we need to drop it back down.
		iColumn--;

		// now we should have an index for our column data
		if (pRow->vColumnValues[iColumn])
			return pRow->vColumnValues[iColumn];
		else
			return "NULL";
	}
	else
		return "invalid_result_set";
}

ConsoleMethod(SQLiteObject, getColumnNumeric, F32, 4, 4, "(resultSet column) Returns the value of the specified column (Column can be specified by name or index) in the current row of the specified result set. If the call fails, the returned string will indicate the error.")
{
	sqlite_resultset* pResultSet;
	sqlite_resultrow* pRow;
	S32 iColumn;

	pResultSet = object->GetResultSet(dAtoi(argv[2]));
	if (pResultSet)
	{

		if (pResultSet->vRows.size() == 0)
			return -1;

		pRow = pResultSet->vRows[pResultSet->iCurrentRow];
		if (!pRow)
			return -1;//"invalid_row";

		 // Is column specified by a name or an index?
		iColumn = dAtoi(argv[3]);
		if (iColumn == 0)
		{
			// column was specified by a name
			iColumn = object->GetColumnIndex(dAtoi(argv[2]), argv[3]);
			// if this is still 0 then we have some error
			if (iColumn == 0)
				return -1;//"invalid_column";
		}

		// We temporarily padded the index in GetColumnIndex() so we could return a
		// 0 for error.  So now we need to drop it back down.
		iColumn--;

		// now we should have an index for our column data
		if (pRow->vColumnValues[iColumn])
			return dAtof(pRow->vColumnValues[iColumn]);
		else
			return 0;
	}
	else
		return -1;//"invalid_result_set";
}

ConsoleMethod(SQLiteObject, escapeString, const char *, 3, 3, "(string) Escapes the given string, making it safer to pass into a query.")
{
	// essentially what we need to do here is scan the string for any occurrences of: ', ", and \
    // and prepend them with a slash: \', \", \\

	// to do this we first need to know how many characters we are replacing so we can calculate
	// the size of the new string
	S32 iCount;
	S32 iIndex, iLen, iNewIndex;
	char* szNew;

	iCount = 0;
	iLen = dStrlen(argv[2]);
	for (iIndex = 0; iIndex < iLen; iIndex++)
	{
		if (argv[2][iIndex] == '\'')
			iCount++;
		else if (argv[2][iIndex] == '\"')
			iCount++;
		else if (argv[2][iIndex] == '\\')
			iCount++;

	}
	//   Con::printf("escapeString counts %i instances of characters to be escaped.  New string will be %i characters longer for a total of %i characters.", iCount, iCount, iLen+iCount);
	szNew = new char[iLen + iCount];
	iNewIndex = 0;
	for (iIndex = 0; iIndex <= iLen; iIndex++)
	{
		if (argv[2][iIndex] == '\'')
		{
			szNew[iNewIndex] = '\\';
			iNewIndex++;
			szNew[iNewIndex] = '\'';
		}
		else if (argv[2][iIndex] == '\"')
		{
			szNew[iNewIndex] = '\\';
			iNewIndex++;
			szNew[iNewIndex] = '\"';
		}
		else if (argv[2][iIndex] == '\\')
		{
			szNew[iNewIndex] = '\\';
			iNewIndex++;
			szNew[iNewIndex] = '\\';
		}
		else
			szNew[iNewIndex] = argv[2][iIndex];

		iNewIndex++;
	}
	//   Con::printf("Last characters of each string (new, old): %s, %s", argv[2][iIndex-1], szNew[iNewIndex-1]);
	//   Con::printf("Old String: %s\nNew String: %s", argv[2], szNew);

	return szNew;
}

ConsoleMethod(SQLiteObject, numResultSets, S32, 2, 2, "numResultSets()")
{
	return object->numResultSets();
}

ConsoleMethod(SQLiteObject, getLastRowId, S32, 2, 2, "getLastRowId()")
{
	return object->getLastRowId();
}


text:
namespace cv {

namespace gimpl
{
    struct GRuntimeArgs;
};

// FIXME: GAPI_EXPORTS is here only due to tests and Windows linker issues
class GAPI_EXPORTS GCompiled::Priv
{
    // NB: For now, a GCompiled keeps the original ade::Graph alive.
    // If we want to go autonomous, we might to do something with this.
    GMetaArgs  m_metas;    // passed by user
    GMetaArgs  m_outMetas; // inferred by compiler
    std::unique_ptr<cv::gimpl::GAbstractExecutor> m_exec;

    void checkArgs(const cv::gimpl::GRuntimeArgs &args) const;

public:
    void setup(const GMetaArgs &metaArgs,
               const GMetaArgs &outMetas,
               std::unique_ptr<cv::gimpl::GAbstractExecutor> &&pE);
    bool isEmpty() const;

    bool canReshape() const;
    void reshape(const GMetaArgs& inMetas, const GCompileArgs &args);
    void prepareForNewStream();

    void run(cv::gimpl::GRuntimeArgs &&args);
    const GMetaArgs& metas() const;
    const GMetaArgs& outMetas() const;

    const cv::gimpl::GModel::Graph& model() const;
};

}

#endif // OPENCV_GAPI_GCOMPILED_PRIV_HPP


text:
Scalable spatial-temporal BFAST
=================

Reproduction of the computations on the article "Spatio-Temporal Change Detection from Multidimensional Arrays: detecting deforestation from MODIS time series"

Files:

LICENSE - License file.

README.md - This file.

Docker files:

Dockerfile - Script for building a Docker Image.

setup.sh - Host script for removing former containers and images from host machine. Then, it creates a Docker image called "sstbfast_img".

Container files:

containerSetup.sh - Script for setting up SciDB. Then it runs the experiment.

createArray.afl - Array Functional Language script for creating an array to store MODIS data.

downloaddata.sh - Script for downloading MODIS data.

removeArrayVersions.sh - Script for removing array's versions.

SciDB configuration files:

conf - SHIM configuration file. Shim is a web service that allows to query SciDB.

iquery.conf - IQUERY configuration file.

scidb_docker.ini - SciDB's configuration file.

setEnvironment.sh - Script for setting environment variables for SciDB's users.

startScidb.sh - Script for starting SciDB.

stopScidb.sh - Script for stopping SciDB.

Install additional software:

installBoost_1570.sh - Script for installing the Boost libraries.

installGribModis2SciDB.sh - Script for installing the tool which export MODIS data to SciDB's binary.

installPackages.R - R script for installing R packages.

installParallel.sh - Script for installing GNU Parallel.

installR.sh - Script for installing R.

libr_exec.so - Precompiled r_exec library for SciDB 14.12.

Scripts for running the expriement:

reprosarefp.R - Main R script of Scalable spatial-temporal BFAST.

rexec_sar_efp_f.R - Auxiliary R script of Scalable spatial-temporal BFAST.

SAR_efp_R.R - R script for processing Scalable spatial-temporal BFAST without using SciDB. NOTE: This script is provided for comparing the results.

Pre-requisites:

Internet access

Docker.io

SSH

The host's ports 49905 and 49905 must be available.

Instructions:

NOTE: The execution of these scripts can span for several days.

Clone the project and then go to the cloned folder: git clone https://github.com/ifgi/scalable-spatial-temporal-BFAST.git

Modify the configuration file scidb_docker.ini according to your needs and your hardware.

Enable setup.sh for execution chmod +x setup.sh and run it ./setup.sh. This creates a new Docker image from the Dockerfile and then starts a container.

Log into the container: ssh -p 49905 root@localhost. The default password is xxxx.xxxx.xxxx

Execute the script /root/./containerSetup.sh. This script sets SciDB, downloads MODIS data to SciDB, and finally executes the experiment.


text:
<?php

/**
 * This service change a number to base 64 with radom char
 *
 * @author Gérald Chablowski
 */

namespace UrlShortenerBundle\Services;

class Base62Service {

    private $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHUJKLMNOPQRSTUVWXYZ';

    /**
     * Change a number in base64 with a radom chars
     *
     * @param int $n
     * @return string
     */
    public function num_to_base62($n) {
        if ($n > 62) {
            return $this->num_to_base62(floor($n / 62)) . $this->chars[$n % 62];
        } else {
            return $short = $this->chars[$n];
        }
    }

}


text:
supported_platforms = [ 'ubuntu', 'centos' ]
if not supported_platforms.include? node[:platform]
  Chef::Log.info("#{node[:platform]} is not yet supported :(")
  exit(1)
end

# 1- Install
include_recipe "expect::#{node[:platform]}"


text:
'use strict';

module.exports = require('./components/menubar/Menubar');


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.preferences;

import android.content.Context;
import android.content.SharedPreferences;

import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.crash.MinidumpUploadService.ProcessType;
import org.chromium.chrome.browser.util.FeatureUtilities;

import java.util.Locale;

/**
 * ChromePreferenceManager stores and retrieves various values in Android shared preferences.
 */
public class ChromePreferenceManager {
    private static final String TAG = "preferences";

    private static final String PROMOS_SKIPPED_ON_FIRST_START = "promos_skipped_on_first_start";
    private static final String SIGNIN_PROMO_LAST_SHOWN = "signin_promo_last_timestamp_key";
    private static final String SHOW_SIGNIN_PROMO = "show_signin_promo";
    private static final String ALLOW_LOW_END_DEVICE_UI = "allow_low_end_device_ui";
    private static final String PREF_WEBSITE_SETTINGS_FILTER = "website_settings_filter";
    private static final String CONTEXTUAL_SEARCH_PROMO_OPEN_COUNT =
            "contextual_search_promo_open_count";
    private static final String CONTEXTUAL_SEARCH_TAP_TRIGGERED_PROMO_COUNT =
            "contextual_search_tap_triggered_promo_count";
    private static final String CONTEXTUAL_SEARCH_TAP_COUNT = "contextual_search_tap_count";
    private static final String CONTEXTUAL_SEARCH_PEEK_PROMO_SHOW_COUNT =
            "contextual_search_peek_promo_show_count";
    private static final String CONTEXTUAL_SEARCH_LAST_ANIMATION_TIME =
            "contextual_search_last_animation_time";
    private static final String CONTEXTUAL_SEARCH_TAP_QUICK_ANSWER_COUNT =
            "contextual_search_tap_quick_answer_count";
    private static final String HERB_FLAVOR_KEY = "herb_flavor";
    private static final String INSTANT_APPS_KEY = "applink.app_link_enabled";
    private static final String CHROME_DEFAULT_BROWSER = "applink.chrome_default_browser";

    private static final String SUCCESS_UPLOAD_SUFFIX = "_crash_success_upload";
    private static final String FAILURE_UPLOAD_SUFFIX = "_crash_failure_upload";

    private static final int SIGNIN_PROMO_CYCLE_IN_DAYS = 120;
    private static final long MILLISECONDS_IN_DAY = 1000 * 60 * 60 * 24;

    private static ChromePreferenceManager sPrefs;

    private final SharedPreferences mSharedPreferences;
    private final Context mContext;

    private ChromePreferenceManager(Context context) {
        mContext = context.getApplicationContext();
        mSharedPreferences = ContextUtils.getAppSharedPreferences();
    }

    /**
     * Get the static instance of ChromePreferenceManager if exists else create it.
     * @param context
     * @return the ChromePreferenceManager singleton
     */
    @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD")
    public static synchronized ChromePreferenceManager getInstance(Context context) {
        if (sPrefs == null) {
            sPrefs = new ChromePreferenceManager(context);
        }
        return sPrefs;
    }

    /**
     * @return Number of times of successful crash upload.
     */
    public int getCrashSuccessUploadCount(@ProcessType String process) {
        // Convention to keep all the key in preference lower case.
        return mSharedPreferences.getInt(successUploadKey(process), 0);
    }

    public void setCrashSuccessUploadCount(@ProcessType String process, int count) {
        SharedPreferences.Editor sharedPreferencesEditor;

        sharedPreferencesEditor = mSharedPreferences.edit();
        // Convention to keep all the key in preference lower case.
        sharedPreferencesEditor.putInt(successUploadKey(process), count);
        sharedPreferencesEditor.apply();
    }

    public void incrementCrashSuccessUploadCount(@ProcessType String process) {
        setCrashSuccessUploadCount(process, getCrashSuccessUploadCount(process) + 1);
    }

    private String successUploadKey(@ProcessType String process) {
        return process.toLowerCase(Locale.US) + SUCCESS_UPLOAD_SUFFIX;
    }

    /**
     * @return Number of times of failure crash upload after reaching the max number of tries.
     */
    public int getCrashFailureUploadCount(@ProcessType String process) {
        return mSharedPreferences.getInt(failureUploadKey(process), 0);
    }

    public void setCrashFailureUploadCount(@ProcessType String process, int count) {
        SharedPreferences.Editor sharedPreferencesEditor;

        sharedPreferencesEditor = mSharedPreferences.edit();
        sharedPreferencesEditor.putInt(failureUploadKey(process), count);
        sharedPreferencesEditor.apply();
    }

    public void incrementCrashFailureUploadCount(@ProcessType String process) {
        setCrashFailureUploadCount(process, getCrashFailureUploadCount(process) + 1);
    }

    private String failureUploadKey(@ProcessType String process) {
        return process.toLowerCase(Locale.US) + FAILURE_UPLOAD_SUFFIX;
    }

    /**
     * @return Whether the promotion for data reduction has been skipped on first invocation.
     */
    public boolean getPromosSkippedOnFirstStart() {
        return mSharedPreferences.getBoolean(PROMOS_SKIPPED_ON_FIRST_START, false);
    }

    /**
     * Marks whether the data reduction promotion was skipped on first
     * invocation.
     * @param displayed Whether the promotion was shown.
     */
    public void setPromosSkippedOnFirstStart(boolean displayed) {
        SharedPreferences.Editor ed = mSharedPreferences.edit();
        ed.putBoolean(PROMOS_SKIPPED_ON_FIRST_START, displayed);
        ed.apply();
    }

    /**
     * @return The value for the website settings filter (the one that specifies
     * which sites to show in the list).
     */
    public String getWebsiteSettingsFilterPreference() {
        return mSharedPreferences.getString(
                ChromePreferenceManager.PREF_WEBSITE_SETTINGS_FILTER, "");
    }

    /**
     * Sets the filter value for website settings (which websites to show in the list).
     * @param prefValue The type to restrict the filter to.
     */
    public void setWebsiteSettingsFilterPreference(String prefValue) {
        SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
        sharedPreferencesEditor.putString(
                ChromePreferenceManager.PREF_WEBSITE_SETTINGS_FILTER, prefValue);
        sharedPreferencesEditor.apply();
    }

    /**
     * This value may have been explicitly set to false when we used to keep existing low-end
     * devices on the normal UI rather than the simplified UI. We want to keep the existing device
     * settings. For all new low-end devices they should get the simplified UI by default.
     * @return Whether low end device UI was allowed.
     */
    public boolean getAllowLowEndDeviceUi() {
        return mSharedPreferences.getBoolean(ALLOW_LOW_END_DEVICE_UI, true);
    }

    /**
     * Signin promo could be shown at most once every 12 weeks. This method checks
     * wheter the signin promo has already been shown in the current cycle.
     * @return Whether the signin promo has been shown in the current cycle.
     */
    public boolean getSigninPromoShown() {
        long signinPromoLastShown = mSharedPreferences.getLong(SIGNIN_PROMO_LAST_SHOWN, 0);
        long numDaysElapsed =
                (System.currentTimeMillis() - signinPromoLastShown) / MILLISECONDS_IN_DAY;
        return numDaysElapsed < SIGNIN_PROMO_CYCLE_IN_DAYS;
    }

    /**
     * Sets the preference for tracking when the signin promo was last shown.
     */
    public void setSigninPromoShown() {
        SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
        sharedPreferencesEditor.putLong(SIGNIN_PROMO_LAST_SHOWN, System.currentTimeMillis());
        sharedPreferencesEditor.apply();
    }

    /**
     * @return Whether the signin promo has been marked to be shown on next startup.
     */
    public boolean getShowSigninPromo() {
        return mSharedPreferences.getBoolean(SHOW_SIGNIN_PROMO, false);
    }

    /**
     * Sets the preference to indicate that the signin promo should be shown on next startup.
     * @param shouldShow Whether the signin promo should be shown.
     */
    public void setShowSigninPromo(boolean shouldShow) {
        SharedPreferences.Editor sharedPreferencesEditor = mSharedPreferences.edit();
        sharedPreferencesEditor.putBoolean(SHOW_SIGNIN_PROMO, shouldShow).apply();
    }

    /**
     * @return Number of times the panel was opened with the promo visible.
     */
    public int getContextualSearchPromoOpenCount() {
        return mSharedPreferences.getInt(CONTEXTUAL_SEARCH_PROMO_OPEN_COUNT, 0);
    }

    /**
     * Sets the number of times the panel was opened with the promo visible.
     * @param count Number of times the panel was opened with a promo visible.
     */
    public void setContextualSearchPromoOpenCount(int count) {
        writeInt(CONTEXTUAL_SEARCH_PROMO_OPEN_COUNT, count);
    }

    /**
     * @return Number of times the Peek Promo was shown.
     */
    public int getContextualSearchPeekPromoShowCount() {
        return mSharedPreferences.getInt(CONTEXTUAL_SEARCH_PEEK_PROMO_SHOW_COUNT, 0);
    }

    /**
     * Sets the number of times the Peek Promo was shown.
     * @param count Number of times the Peek Promo was shown.
     */
    public void setContextualSearchPeekPromoShowCount(int count) {
        writeInt(CONTEXTUAL_SEARCH_PEEK_PROMO_SHOW_COUNT, count);
    }

    /**
     * @return The last time the search provider icon was animated on tap.
     */
    public long getContextualSearchLastAnimationTime() {
        return mSharedPreferences.getLong(CONTEXTUAL_SEARCH_LAST_ANIMATION_TIME, 0);
    }

    /**
     * Sets the last time the search provider icon was animated on tap.
     * @param time The last time the search provider icon was animated on tap.
     */
    public void setContextualSearchLastAnimationTime(long time) {
        SharedPreferences.Editor ed = mSharedPreferences.edit();
        ed.putLong(CONTEXTUAL_SEARCH_LAST_ANIMATION_TIME, time);
        ed.apply();
    }

    /**
     * @return Number of times the promo was triggered to peek by a tap gesture, or a negative value
     *         if in the disabled state.
     */
    public int getContextualSearchTapTriggeredPromoCount() {
        return mSharedPreferences.getInt(CONTEXTUAL_SEARCH_TAP_TRIGGERED_PROMO_COUNT, 0);
    }

    /**
     * Sets the number of times the promo was triggered to peek by a tap gesture.
     * Use a negative value to record that the counter has been disabled.
     * @param count Number of times the promo was triggered by a tap gesture, or a negative value
     *        to record that the counter has been disabled.
     */
    public void setContextualSearchTapTriggeredPromoCount(int count) {
        writeInt(CONTEXTUAL_SEARCH_TAP_TRIGGERED_PROMO_COUNT, count);
    }

    /**
     * @return Number of tap gestures that have been received since the last time the panel was
     *         opened.
     */
    public int getContextualSearchTapCount() {
        return mSharedPreferences.getInt(CONTEXTUAL_SEARCH_TAP_COUNT, 0);
    }

    /**
     * Sets the number of tap gestures that have been received since the last time the panel was
     * opened.
     * @param count Number of taps that have been received since the last time the panel was opened.
     */
    public void setContextualSearchTapCount(int count) {
        writeInt(CONTEXTUAL_SEARCH_TAP_COUNT, count);
    }

    /**
     * @return Number of Tap triggered Quick Answers (that "do answer") that have been shown since
     *         the last time the panel was opened.
     */
    public int getContextualSearchTapQuickAnswerCount() {
        return mSharedPreferences.getInt(CONTEXTUAL_SEARCH_TAP_QUICK_ANSWER_COUNT, 0);
    }

    /**
     * Sets the number of tap triggered Quick Answers (that "do answer") that have been shown since
     * the last time the panel was opened.
     * @param count Number of Tap triggered Quick Answers (that "do answer") that have been shown
     *              since the last time the panel was opened.
     */
    public void setContextualSearchTapQuickAnswerCount(int count) {
        writeInt(CONTEXTUAL_SEARCH_TAP_QUICK_ANSWER_COUNT, count);
    }

    /**
     * @return Which UI prototype the user is testing. This is cached from native via
     *         {@link FeatureUtilities#cacheHerbFlavor}.
     */
    public String getCachedHerbFlavor() {
        return mSharedPreferences.getString(HERB_FLAVOR_KEY, ChromeSwitches.HERB_FLAVOR_DISABLED);
    }

    /**
     * Caches which UI prototype the user is testing.
     */
    public void setCachedHerbFlavor(String flavor) {
        writeString(HERB_FLAVOR_KEY, flavor);
    }

    /** Checks the cached value for the app link feature. */
    public boolean getCachedInstantAppsEnabled() {
        return mSharedPreferences.getBoolean(INSTANT_APPS_KEY, false);
    }

    /** Writes the cached value for whether app link is enabled. */
    public void setCachedInstantAppsEnabled(boolean isEnabled) {
        SharedPreferences.Editor ed = mSharedPreferences.edit();
        ed.putBoolean(INSTANT_APPS_KEY, isEnabled);
        ed.apply();
    }

    public boolean getCachedChromeDefaultBrowser() {
        return mSharedPreferences.getBoolean(CHROME_DEFAULT_BROWSER, false);
    }

    public void setCachedChromeDefaultBrowser(boolean isDefault) {
        SharedPreferences.Editor ed = mSharedPreferences.edit();
        ed.putBoolean(CHROME_DEFAULT_BROWSER, isDefault);
        ed.apply();
    }

    /**
     * Writes the given int value to the named shared preference.
     *
     * @param key The name of the preference to modify.
     * @param value The new value for the preference.
     */
    private void writeInt(String key, int value) {
        SharedPreferences.Editor ed = mSharedPreferences.edit();
        ed.putInt(key, value);
        ed.apply();
    }

    /**
     * Writes the given String to the named shared preference.
     *
     * @param key The name of the preference to modify.
     * @param value The new value for the preference.
     */
    private void writeString(String key, String value) {
        SharedPreferences.Editor ed = mSharedPreferences.edit();
        ed.putString(key, value);
        ed.apply();
    }
}


text:
thymol.applicationContext.createVariable("foo", 'foo' );
thymol.applicationContext.createVariable("obj", { "foo": "bar" } );
thymol.ready(function () {
	thymol.configurePreExecution( function() {
		thymol.inlineQuote="\"";
	});
});


text:
package com.github.florent37.orm.model;

import fr.xebia.android.freezer.annotations.Model;

import java.util.List;

/**
 * Created by florentchampigny on 19/01/2016.
 */
@Model
public class User {
    int age;
    String name;
    Cat cat;
    List<Dog> dogs;
    boolean hacker;

    public User(){}

    public User(int age, String name, Cat cat, List<Dog> dogs, boolean hacker) {
        this.age = age;
        this.name = name;
        this.cat = cat;
        this.dogs = dogs;
        this.hacker = hacker;
    }

    public User(int age, String name) {
        this.age = age;
        this.name = name;
    }

    @Override public String toString() {
        return "User{" +
                " name='" + name + '\'' +
                '}';
    }

    public void setAge(int age) {
        this.age = age;
    }

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

    public void setCat(Cat cat) {
        this.cat = cat;
    }

    public void setDogs(List<Dog> dogs) {
        this.dogs = dogs;
    }

    public void setHacker(boolean hacker) {
        this.hacker = hacker;
    }

    public int getAge() {
        return age;
    }

    public String getName() {
        return name;
    }

    public Cat getCat() {
        return cat;
    }

    public List<Dog> getDogs() {
        return dogs;
    }

    public boolean isHacker() {
        return hacker;
    }
}


text:
namespace AutoMapper.Mappers
{
	public class StringMapper : IObjectMapper
	{
		public object Map(ResolutionContext context, IMappingEngineRunner mapper)
		{
			if (context.SourceValue == null)
			{
				return mapper.FormatValue(context.CreateValueContext(null));
			}
			return mapper.FormatValue(context);
		}

		public bool IsMatch(ResolutionContext context)
		{
			return context.DestinationType.Equals(typeof(string));
		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
         xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         id="WebApp_ID" version="2.4">
    <display-name>StudentsWebProject</display-name>
    <welcome-file-list>
        <welcome-file>StudentsCourseServlet</welcome-file>
    </welcome-file-list>
      <servlet>
        <servlet-name>SpringMVC</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
        <param-name>contextConfiguration</param-name>
        <param-value>/WEB-INF/springconfig.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>SpringMVC</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

</web-app>


text:
import type { SpanningCellConfig, TableUserConfig } from './types/api';
import type { Row, TableConfig } from './types/internal';
/**
 * Makes a new configuration object out of the userConfig object
 * using default values for the missing configuration properties.
 */
export declare const makeTableConfig: (rows: Row[], config?: TableUserConfig, injectedSpanningCellConfig?: SpanningCellConfig[] | undefined) => TableConfig;