text:
namespace SharpCompress.Compressor.PPMd.I1
{
    using System;

    internal class Allocator
    {
        public uint AllocatorSize;
        public Pointer BaseUnit;
        public uint GlueCount;
        public Pointer Heap;
        private const uint HeapOffset = 0x1d8;
        public Pointer HighUnit;
        private const uint IndexCount = 0x26;
        private static readonly byte[] indexToUnits = new byte[0x26];
        private const uint LocalOffset = 4;
        public Pointer LowUnit;
        public byte[] Memory;
        public MemoryNode[] MemoryNodes = new MemoryNode[0x26];
        private const uint N1 = 4;
        private const uint N2 = 4;
        private const uint N3 = 4;
        private const uint N4 = 0x1a;
        private const uint NodeOffset = 0x10;
        public Pointer Text;
        private const uint UnitSize = 12;
        private static readonly byte[] unitsToIndex;

        static Allocator()
        {
            uint index = 0;
            uint num2 = 1;
            while (index < 4)
            {
                indexToUnits[index] = (byte) num2;
                index++;
                num2++;
            }
            num2++;
            while (index < 8)
            {
                indexToUnits[index] = (byte) num2;
                index++;
                num2 += 2;
            }
            num2++;
            while (index < 12)
            {
                indexToUnits[index] = (byte) num2;
                index++;
                num2 += 3;
            }
            num2++;
            while (index < 0x26)
            {
                indexToUnits[index] = (byte) num2;
                index++;
                num2 += 4;
            }
            unitsToIndex = new byte[0x80];
            for (num2 = index = 0; num2 < 0x80; num2++)
            {
                index += (uint)((indexToUnits[index] < (num2 + 1)) ? 1 : 0);
                unitsToIndex[num2] = (byte) index;
            }
        }

        public Pointer AllocateContext()
        {
            if (this.HighUnit != this.LowUnit)
            {
                return (this.HighUnit -= 12);
            }
            if (this.MemoryNodes[0].Available)
            {
                return this.MemoryNodes[0].Remove();
            }
            return this.AllocateUnitsRare(0);
        }

        public Pointer AllocateUnits(uint unitCount)
        {
            uint index = unitsToIndex[(int) ((IntPtr) (unitCount - 1))];
            if (this.MemoryNodes[index].Available)
            {
                return this.MemoryNodes[index].Remove();
            }
            Pointer lowUnit = this.LowUnit;
            this.LowUnit += indexToUnits[index] * 12;
            if (this.LowUnit <= this.HighUnit)
            {
                return lowUnit;
            }
            this.LowUnit -= indexToUnits[index] * 12;
            return this.AllocateUnitsRare(index);
        }

        private Pointer AllocateUnitsRare(uint index)
        {
            if (this.GlueCount == 0)
            {
                this.GlueFreeBlocks();
                if (this.MemoryNodes[index].Available)
                {
                    return this.MemoryNodes[index].Remove();
                }
            }
            uint num = index;
            do
            {
                if (++num == 0x26)
                {
                    this.GlueCount--;
                    num = (uint) (indexToUnits[index] * 12);
                    return (((this.BaseUnit - this.Text) > num) ? (this.BaseUnit -= num) : Pointer.Zero);
                }
            }
            while (!this.MemoryNodes[num].Available);
            Pointer pointer = this.MemoryNodes[num].Remove();
            this.SplitBlock(pointer, num, index);
            return pointer;
        }

        private void CopyUnits(Pointer target, Pointer source, uint unitCount)
        {
            do
            {
                target[0] = source[0];
                target[1] = source[1];
                target[2] = source[2];
                target[3] = source[3];
                target[4] = source[4];
                target[5] = source[5];
                target[6] = source[6];
                target[7] = source[7];
                target[8] = source[8];
                target[9] = source[9];
                target[10] = source[10];
                target[11] = source[11];
                target += 12;
                source += 12;
            }
            while (--unitCount != 0);
        }

        public void ExpandText()
        {
            MemoryNode node;
            MemoryNode node2;
            uint[] numArray = new uint[0x26];
        Label_0052:
            node2 = node = this.BaseUnit;
            if (node2.Stamp == uint.MaxValue)
            {
                this.BaseUnit = (Pointer) (node + node.UnitCount);
                numArray[unitsToIndex[node.UnitCount - 1]]++;
                node.Stamp = 0;
                goto Label_0052;
            }
            for (uint i = 0; i < 0x26; i++)
            {
                for (node = this.MemoryNodes[i]; numArray[i] != 0; node = node.Next)
                {
                    while (node.Next.Stamp == 0)
                    {
                        node.Unlink();
                        this.MemoryNodes[i].Stamp--;
                        if ((numArray[i] -= 1) == 0)
                        {
                            break;
                        }
                    }
                }
            }
        }

        public Pointer ExpandUnits(Pointer oldPointer, uint oldUnitCount)
        {
            uint index = unitsToIndex[(int) ((IntPtr) (oldUnitCount - 1))];
            uint num2 = unitsToIndex[oldUnitCount];
            if (index == num2)
            {
                return oldPointer;
            }
            Pointer target = this.AllocateUnits(oldUnitCount + 1);
            if (target != Pointer.Zero)
            {
                this.CopyUnits(target, oldPointer, oldUnitCount);
                this.MemoryNodes[index].Insert(oldPointer, oldUnitCount);
            }
            return target;
        }

        public void FreeUnits(Pointer pointer, uint unitCount)
        {
            uint index = unitsToIndex[(int) ((IntPtr) (unitCount - 1))];
            this.MemoryNodes[index].Insert(pointer, indexToUnits[index]);
        }

        public uint GetMemoryUsed()
        {
            uint num = (this.AllocatorSize - (this.HighUnit - this.LowUnit)) - (this.BaseUnit - this.Text);
            for (uint i = 0; i < 0x26; i++)
            {
                num -= (uint) ((12 * indexToUnits[i]) * this.MemoryNodes[i].Stamp);
            }
            return num;
        }
        private void GlueFreeBlocks() {
            MemoryNode memoryNode = new MemoryNode(LocalOffset, Memory);
            memoryNode.Stamp = 0;
            memoryNode.Next = MemoryNode.Zero;
            memoryNode.UnitCount = 0;

            MemoryNode memoryNode0;
            MemoryNode memoryNode1;
            MemoryNode memoryNode2;

            if (LowUnit != HighUnit)
                LowUnit[0] = 0;

            // Find all unused memory nodes.

            memoryNode1 = memoryNode;
            for (uint index = 0; index < IndexCount; index++) {
                while (MemoryNodes[index].Available) {
                    memoryNode0 = MemoryNodes[index].Remove();
                    if (memoryNode0.UnitCount != 0) {
                        while ((memoryNode2 = memoryNode0 + memoryNode0.UnitCount).Stamp == uint.MaxValue) {
                            memoryNode0.UnitCount = memoryNode0.UnitCount + memoryNode2.UnitCount;
                            memoryNode2.UnitCount = 0;
                        }
                        memoryNode1.Link(memoryNode0);
                        memoryNode1 = memoryNode0;
                    }
                }
            }

            // Coalesce the memory represented by the unused memory nodes.

            while (memoryNode.Available) {
                memoryNode0 = memoryNode.Remove();
                uint unitCount = memoryNode0.UnitCount;
                if (unitCount != 0) {
                    for (; unitCount > 128; unitCount -= 128, memoryNode0 += 128)
                        MemoryNodes[IndexCount - 1].Insert(memoryNode0, 128);

                    uint index = unitsToIndex[unitCount - 1];
                    if (indexToUnits[index] != unitCount) {
                        uint unitCountDifference = unitCount - indexToUnits[--index];
                        MemoryNodes[unitCountDifference - 1].Insert(memoryNode0 + (unitCount - unitCountDifference),
                                                                    unitCountDifference);
                    }

                    MemoryNodes[index].Insert(memoryNode0, indexToUnits[index]);
                }
            }

            GlueCount = 1 << 13;
        }
        //private void GlueFreeBlocks()
        //{
        //    MemoryNode node2;
        //    MemoryNode node = new MemoryNode(4, this.Memory);
        //    node.Stamp = 0;
        //    node.Next = MemoryNode.Zero;
        //    node.UnitCount = 0;
        //    if (this.LowUnit != this.HighUnit)
        //    {
        //        this.LowUnit[0] = 0;
        //    }
        //    MemoryNode node3 = node;
        //    uint index = 0;
        //    while (index < 0x26)
        //    {
        //        while (this.MemoryNodes[index].Available)
        //        {
        //            MemoryNode node4;
        //            MemoryNode node5;
        //            node2 = this.MemoryNodes[index].Remove();
        //            if (node2.UnitCount == 0)
        //            {
        //                continue;
        //            }
        //            goto Label_00AE;
        //        Label_008C:
        //            node2.UnitCount += node4.UnitCount;
        //            node4.UnitCount = 0;
        //        Label_00AE:
        //            node5 = node4 = node2 + ((MemoryNode) node2.UnitCount);
        //            if (node5.Stamp == uint.MaxValue)
        //            {
        //                goto Label_008C;
        //            }
        //            node3.Link(node2);
        //            node3 = node2;
        //        }
        //        index++;
        //    }
        //    while (node.Available)
        //    {
        //        node2 = node.Remove();
        //        uint unitCount = node2.UnitCount;
        //        if (unitCount != 0)
        //        {
        //            while (unitCount > 0x80)
        //            {
        //                this.MemoryNodes[0x25].Insert(node2, 0x80);
        //                unitCount -= 0x80;
        //                node2 += 0x80;
        //            }
        //            index = unitsToIndex[(int) ((IntPtr) (unitCount - 1))];
        //            if (indexToUnits[index] != unitCount)
        //            {
        //                uint num3 = unitCount - indexToUnits[(int) ((IntPtr) (--index))];
        //                this.MemoryNodes[(int) ((IntPtr) (num3 - 1))].Insert(node2 + ((MemoryNode) (unitCount - num3)), num3);
        //            }
        //            this.MemoryNodes[index].Insert(node2, indexToUnits[index]);
        //        }
        //    }
        //    this.GlueCount = 0x2000;
        //}

        public void Initialize()
        {
            for (int i = 0; i < IndexCount; i++)
            {
                this.MemoryNodes[i] = new MemoryNode((uint) (0x10L + (i * 12)), this.Memory);
                this.MemoryNodes[i].Stamp = 0;
                this.MemoryNodes[i].Next = MemoryNode.Zero;
                this.MemoryNodes[i].UnitCount = 0;
            }
            this.Text = this.Heap;
            uint num2 = UnitSize * (((this.AllocatorSize / 8) / UnitSize) * 7);
            this.HighUnit = this.Heap + ( this.AllocatorSize);
            this.LowUnit = this.HighUnit - ( num2);
            this.BaseUnit = this.HighUnit - ( num2);
            this.GlueCount = 0;
        }

        public Pointer MoveUnitsUp(Pointer oldPointer, uint unitCount)
        {
            uint index = unitsToIndex[(int) ((IntPtr) (unitCount - 1))];
            if ((oldPointer > (this.BaseUnit + 0x4000)) || (oldPointer > this.MemoryNodes[index].Next))
            {
                return oldPointer;
            }
            Pointer target = this.MemoryNodes[index].Remove();
            this.CopyUnits(target, oldPointer, unitCount);
            unitCount = indexToUnits[index];
            if (oldPointer != this.BaseUnit)
            {
                this.MemoryNodes[index].Insert(oldPointer, unitCount);
            }
            else
            {
                this.BaseUnit += (unitCount * UnitSize);
            }
            return target;
        }

        public Pointer ShrinkUnits(Pointer oldPointer, uint oldUnitCount, uint newUnitCount)
        {
            uint index = unitsToIndex[(int) ((IntPtr) (oldUnitCount - 1))];
            uint num2 = unitsToIndex[(int) ((IntPtr) (newUnitCount - 1))];
            if (index != num2)
            {
                if (this.MemoryNodes[num2].Available)
                {
                    Pointer target = this.MemoryNodes[num2].Remove();
                    this.CopyUnits(target, oldPointer, newUnitCount);
                    this.MemoryNodes[index].Insert(oldPointer, indexToUnits[index]);
                    return target;
                }
                this.SplitBlock(oldPointer, index, num2);
            }
            return oldPointer;
        }

        public void SpecialFreeUnits(Pointer pointer)
        {
            if (pointer != this.BaseUnit)
            {
                this.MemoryNodes[0].Insert(pointer, 1);
            }
            else
            {
                MemoryNode node = pointer;
                node.Stamp = uint.MaxValue;
                this.BaseUnit += 12;
            }
        }

        private void SplitBlock(Pointer pointer, uint oldIndex, uint newIndex)
        {
            uint unitCount = (uint) (indexToUnits[oldIndex] - indexToUnits[newIndex]);
            Pointer memoryNode = pointer + (indexToUnits[newIndex] * 12);
            uint index = unitsToIndex[(int) ((IntPtr) (unitCount - 1))];
            if (indexToUnits[index] != unitCount)
            {
                uint num3 = indexToUnits[(int) ((IntPtr) (--index))];
                this.MemoryNodes[index].Insert(memoryNode, num3);
                memoryNode += (num3 * UnitSize);
                unitCount -= num3;
            }
            this.MemoryNodes[unitsToIndex[(int) ((IntPtr) (unitCount - 1))]].Insert(memoryNode, unitCount);
        }

        public void Start(int allocatorSize)
        {
            uint num = (uint) allocatorSize;
            if (this.AllocatorSize != num)
            {
                this.Stop();
                this.Memory = new byte[0x1d8 + num];
                this.Heap = new Pointer(0x1d8, this.Memory);
                this.AllocatorSize = num;
            }
        }

        public void Stop()
        {
            if (this.AllocatorSize != 0)
            {
                this.AllocatorSize = 0;
                this.Memory = null;
                this.Heap = Pointer.Zero;
            }
        }
    }
}


text:
#include "condor_common.h"
#include "condor_debug.h"
#include "sysapi.h"
#include "sysapi_externs.h"

#if defined(LINUX)
#include <stdio.h>

int
sysapi_phys_memory_raw_no_param(void)
{

	double bytes;
	double megs;

	/* in bytes */
	bytes =
		(double)sysconf(_SC_PHYS_PAGES) * (double)sysconf(_SC_PAGESIZE);

	/* convert it to Megabytes */
	megs = bytes / (1024.0*1024.0);

	if (megs > INT_MAX) {
		return INT_MAX;
	}

	return (int)megs;
}

#elif defined(WIN32)

int
sysapi_phys_memory_raw_no_param(void)
{
	MEMORYSTATUSEX statex;

	statex.dwLength = sizeof(statex);

	GlobalMemoryStatusEx(&statex);

	return (int)(statex.ullTotalPhys/(1024*1024));
}

// See GNATS 529. This code should now detect >= 2Gigs properly.
#elif defined(Darwin) || defined(CONDOR_FREEBSD)
#include <sys/sysctl.h>
int
sysapi_phys_memory_raw_no_param(void)
{
	int megs;
	uint64_t mem = 0;
	size_t len = sizeof(mem);

#ifdef Darwin
	if (sysctlbyname("hw.memsize", &mem, &len, NULL, 0) < 0)
#elif defined(CONDOR_FREEBSD)
	if (sysctlbyname("hw.physmem", &mem, &len, NULL, 0) < 0)
#endif
	{
        dprintf(D_ALWAYS,
			"sysapi_phys_memory_raw(): sysctlbyname(\"hw.memsize\") "
			"failed: %d(%s)\n",
			errno, strerror(errno));
		return -1;
	}

	megs = mem / (1024 * 1024);

	return megs;
}
#else
#error "sysapi.h: Please define a sysapi_phys_memory_raw() for this platform!"
#endif

int sysapi_phys_memory_raw(void)
{
	sysapi_internal_reconfig();
	return sysapi_phys_memory_raw_no_param();
}

/* This is the cooked version of sysapi_phys_memory_raw(). Where as the raw
	function gives you the raw number, this function can process the number
	for you for some reason and return that instead.
*/
int
sysapi_phys_memory(void)
{
	int mem;
	sysapi_internal_reconfig();
	mem = _sysapi_memory;
	if (!_sysapi_memory) {
		mem = sysapi_phys_memory_raw();
	}
	if (mem < 0) return mem;
	mem -= _sysapi_reserve_memory;
	if (mem < 0) return 0;
	return mem;
}

redpajama_set_name: RedPajamaGithub


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

    <include layout="@layout/header"
        android:id="@+id/included_header"/>

  <!-- ****************************************************** Save Button ******************************************************-->

  <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin">
    <Button
      android:id="@+id/servo_controller_saveButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginRight="5dp"
      android:layout_marginEnd="5dp"
      android:text="@string/done_button"
      android:onClick="saveServoController"
      android:layout_gravity="center_horizontal"/>

    <Button
      android:id="@+id/servo_controller_cancelButton"
      android:layout_toRightOf="@id/servo_controller_saveButton"
      android:layout_toEndOf="@id/servo_controller_saveButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginRight="5dp"
      android:layout_marginEnd="5dp"
      android:text="@string/cancel"
      android:onClick="cancelServoController"
      android:layout_gravity="center_horizontal"/>

  </RelativeLayout>

  <!-- just draw a grey line -->
  <View
    android:layout_height="2dip"
    android:background="@android:color/darker_gray"
    android:layout_width="match_parent"/>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:keepScreenOn="true"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">

        <EditText
            android:id="@+id/servocontroller_name"
            android:textStyle="bold"
            android:textSize="18sp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/servo_controller_name"
            android:inputType="text"
            android:maxLength="200"
            android:hint="@string/name_prompt_text">
        </EditText>

        <TextView
            android:id="@+id/controller_name_text"
            android:layout_marginBottom="30dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/servo_controller_name_prompt">
        </TextView>

      <!-- just draw a red line -->
      <View
        android:layout_height="2dip"
        android:background="#FF0000"
        android:layout_width="match_parent"/>

        <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
                     android:id="@+id/tableLayout_pwm_devices"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent" >

            <!-- 2 columns -->
            <TableRow
                android:id="@+id/table_header"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="5dip" >

                <TextView
                    android:id="@+id/port_title"
                    android:paddingRight="10dp"
                    android:paddingEnd="5dp"
                    android:paddingLeft="5dp"
                    android:text="@string/port"
                    android:textStyle="bold"
                    android:textSize="12sp" />

                <TextView
                    android:id="@+id/attached_title"
                    android:text="@string/attached"
                    android:textStyle="bold"
                    android:textSize="12sp" />

            </TableRow>

            <!-- just draw a red line -->
            <View
                android:layout_height="2dip"
                android:background="#FF0000" />

            <!-- ****************************************************** Servo 1 ******************************************************-->
          <LinearLayout
            android:id="@+id/linearLayout_servo1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="vertical" >
          </LinearLayout>

            <!-- ****************************************************** Servo 2 ******************************************************-->
          <LinearLayout
            android:id="@+id/linearLayout_servo2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="vertical" >
          </LinearLayout>

            <!-- ****************************************************** Servo 3 ******************************************************-->
          <LinearLayout
            android:id="@+id/linearLayout_servo3"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="vertical" >
          </LinearLayout>

            <!-- ****************************************************** Servo 4 ******************************************************-->
          <LinearLayout
            android:id="@+id/linearLayout_servo4"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="vertical" >
          </LinearLayout>

            <!-- ****************************************************** Servo 5 ******************************************************-->
          <LinearLayout
            android:id="@+id/linearLayout_servo5"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="vertical" >
          </LinearLayout>

            <!-- ****************************************************** Servo 6 ******************************************************-->
          <LinearLayout
            android:id="@+id/linearLayout_servo6"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:orientation="vertical" >
          </LinearLayout>

        </TableLayout>
    </LinearLayout>
  </ScrollView>
</LinearLayout>
<!-- From: file:/local/mnt/workspace/jenkins-slave/workspace/FTC_External_Apps_Package/First/lib/FtcCommon/src/main/res/layout/servos.xml --><!-- From: file:/C:/Users/Sa'id/Desktop/Robotics/ftc_app-master/FtcRobotController/build/intermediates/exploded-aar/FtcCommon-release/res/layout/servos.xml -->


text:
package org.apache.beam.sdk.io.fs;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.beam.sdk.coders.AtomicCoder;
import org.apache.beam.sdk.coders.BooleanCoder;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.io.FileSystems;

/** A {@link Coder} for {@link ResourceId}. */
public class ResourceIdCoder extends AtomicCoder<ResourceId> {
  private static final Coder<String> STRING_CODER = StringUtf8Coder.of();
  private static final Coder<Boolean> BOOL_CODER = BooleanCoder.of();

  /** Creates a {@link ResourceIdCoder}. */
  public static ResourceIdCoder of() {
    return new ResourceIdCoder();
  }

  @Override
  public void encode(ResourceId value, OutputStream os) throws IOException {
    STRING_CODER.encode(value.toString(), os);
    BOOL_CODER.encode(value.isDirectory(), os);
  }

  @Override
  public ResourceId decode(InputStream is) throws IOException {
    String spec = STRING_CODER.decode(is);
    boolean isDirectory = BOOL_CODER.decode(is);
    return FileSystems.matchNewResource(spec, isDirectory);
  }

  @Override
  public boolean consistentWithEquals() {
    return true;
  }
}


text:
package wm.xmwei.ui.view.draptopout;

import android.webkit.WebView;
import android.widget.AbsListView;
import android.widget.ScrollView;

/**
 * Created by chenupt@gmail.com on 1/30/15.
 * Description : Attach top helper
 */
public class AttachUtil {

    public static boolean isAdapterViewAttach(AbsListView listView){
        if (listView != null && listView.getChildCount() > 0) {
            if (listView.getChildAt(0).getTop() < 0) {
                return false;
            }
        }
        return true;
    }

//    public static boolean isRecyclerViewAttach(RecyclerView recyclerView){
//        if (recyclerView != null && recyclerView.getChildCount() > 0) {
//            if (recyclerView.getChildAt(0).getTop() < 0) {
//                return false;
//            }
//        }
//        return true;
//    }

    public static boolean isScrollViewAttach(ScrollView scrollView){
        if (scrollView != null) {
            if (scrollView.getScrollY() > 0) {
                return false;
            }
        }
        return true;
    }

    public static boolean isWebViewAttach(WebView webView){
        if (webView != null) {
            if (webView.getScrollY() > 0) {
                return false;
            }
        }
        return true;
    }
}


text:
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [#filter: containers\threadsafe #]
***/

#pragma once

#include "base/system/include/scopeLock.h"
#include "base/system/include/spinLock.h"

namespace base
{

    //---

    /// locked array for iteration
    template< typename T, typename TLock = threads::SpinLock >
    class ThreadSafeLockedArray  : public base::NoCopy
    {
    public:
        FORCEINLINE ThreadSafeLockedArray()
            : m_array(nullptr)
            , m_lock(nullptr)
        {}

        FORCEINLINE ThreadSafeLockedArray(ThreadSafeLockedArray<T, TLock>&& other)
            : m_array(other.m_array)
            , m_lock(other.m_lock)
        {
            other.m_array = nullptr;
            other.m_lock = nullptr;
        }

        FORCEINLINE ~ThreadSafeLockedArray()
        {
            if (m_lock)
                m_lock->release();
        }

        FORCEINLINE ThreadSafeLockedArray(Array<T>* ar, TLock* lock)
            : m_array(ar)
            , m_lock(lock)
        {
            lock->acquire();
        }

        ///--

        //! Get array
        FORCEINLINE const Array<T>& getArray() const
        {
            return *m_array;
        }

        //! Get array
        FORCEINLINE Array<T>& getArray()
        {
            return *m_array;
        }

        ///--

    private:
        Array<T>* m_array;
        TLock* m_lock;
    };

    //---

    /// const locked array for iteration
    template< typename T, typename TLock = threads::SpinLock >
    class ThreadSafeLockedConstArray : public base::NoCopy
    {
    public:
        FORCEINLINE ThreadSafeLockedConstArray()
            : m_array(nullptr)
            , m_lock(nullptr)
        {}

        FORCEINLINE ThreadSafeLockedConstArray(ThreadSafeLockedConstArray<T, TLock>&& other)
            : m_array(other.m_array)
            , m_lock(other.m_lock)
        {
            other.m_array = nullptr;
            other.m_lock = nullptr;
        }

        FORCEINLINE ~ThreadSafeLockedConstArray()
        {
            if (m_lock)
                m_lock->release();
        }

        FORCEINLINE ThreadSafeLockedConstArray(const Array<T>* ar, TLock* lock)
            : m_array(ar)
            , m_lock(lock)
        {
            lock->acquire();
        }

        ///--

        //! Get array
        FORCEINLINE const Array<T>& getArray() const
        {
            return *m_array;
        }

        ///--

    private:
        const Array<T>* m_array;
        TLock* m_lock;
    };

    //---

    /// basic thread safe array
    /// nothing fancy, keep browsing
    template< typename T, typename TLock = threads::SpinLock >
    class ThreadSafeArray
    {
    public:
        FORCEINLINE ThreadSafeArray()
        {}

        FORCEINLINE ThreadSafeArray(const ThreadSafeArray<T>& other)
        {
            TContextLock lock(other.m_lock);
            m_elements = other.m_elements;
        }

        FORCEINLINE ThreadSafeArray(ThreadSafeArray<T>&& other)
        {
            TContextLock lock(other.m_lock);
            std::swap(m_elements, other.m_elements);
        }

        FORCEINLINE ThreadSafeArray(const Array<T>& other)
            : m_elements(other)
        {}

        FORCEINLINE ThreadSafeArray(Array<T>&& other)
            : m_elements(std::move(other))
        {}

        // extract elements
        FORCEINLINE void extract(Array<T>& outArray)
        {
            TContextLock lock(m_lock);
            std::swap(outArray, m_elements);
        }

        // get number of elements in the array
        // NOTE: NOT thread safe, do not use for iteration
        FORCEINLINE const Uint32 sizeUnsafe() const
        {
            return m_elements.size(); // TODO
        }

        // add element to array
        FORCEINLINE const Uint32 pushBack(const T& element)
        {
            TContextLock lock(m_lock);
            const auto index = m_elements.size();
            m_elements.pushBack(element);
            return index;
        }

        // remove element from array
        FORCEINLINE void remove(const T& element)
        {
            TContextLock lock(m_lock);
            m_elements.remove(element);
        }

        // clear array
        FORCEINLINE void clear()
        {
            TContextLock lock(m_lock);
            m_elements.clear();
        }

        // check if element is in array
        FORCEINLINE const Bool contains(const T& element) const
        {
            TContextLock lock(m_lock);
            return m_elements.contains(element);
        }

        //--

        // lock for iteration
        FORCEINLINE ThreadSafeLockedArray<T, TLock> lock()
        {
            return ThreadSafeLockedArray<T, TLock>(&m_elements, &m_lock);
        }

        // lock for iteration
        FORCEINLINE ThreadSafeLockedConstArray<T, TLock> lock() const
        {
            return ThreadSafeLockedConstArray<T, TLock>(&m_elements, &m_lock);
        }

        //--

    private:
        typedef threads::ScopeLock<TLock> TContextLock;

        mutable TLock m_lock;
        Array<T> m_elements;
    };

} // base


text:
window.ParsleyConfig = window.ParsleyConfig || {};
window.ParsleyConfig.i18n = window.ParsleyConfig.i18n || {};

window.ParsleyConfig.i18n.es = $.extend(window.ParsleyConfig.i18n.es || {}, {
  defaultMessage: "Este valor parece ser inválido.",
  type: {
    email:        "Este valor debe ser un correo válido.",
    url:          "Este valor debe ser una URL válida.",
    number:       "Este valor debe ser un número válido.",
    integer:      "Este valor debe ser un número válido.",
    digits:       "Este valor debe ser un dígito válido.",
    alphanum:     "Este valor debe ser alfanumérico."
  },
  notblank:       "Este valor no debe estar en blanco.",
  required:       "Este valor es requerido.",
  pattern:        "Este valor es incorrecto.",
  min:            "Este valor no debe ser menor que %s.",
  max:            "Este valor no debe ser mayor que %s.",
  range:          "Este valor debe estar entre %s y %s.",
  minlength:      "Este valor es muy corto. La longitud mínima es de %s caracteres.",
  maxlength:      "Este valor es muy largo. La longitud máxima es de %s caracteres.",
  length:         "La longitud de este valor debe estar entre %s y %s caracteres.",
  mincheck:       "Debe seleccionar al menos %s opciones.",
  maxcheck:       "Debe seleccionar %s opciones o menos.",
  rangecheck:     "Debe seleccionar entre %s y %s opciones.",
  equalto:        "Este valor debe ser idéntico."
});

// If file is loaded after Parsley main file, auto-load locale
if ('undefined' !== typeof window.ParsleyValidator)
  window.ParsleyValidator.addCatalog('es', window.ParsleyConfig.i18n.es, true);


text:
'use strict'

var createShader = require('gl-shader')
var createBuffer = require('gl-buffer')
var search = require('binary-search-bounds')
var snapPoints = require('snap-points-2d')
var pool = require('typedarray-pool')
var SHADERS = require('./lib/shader')
var normalize = require('array-normalize')
var getBounds = require('array-bounds')

module.exports = createScatter2D

function Scatter2D(plot, positionBufferHi, positionBufferLo, pickBuffer, weightBuffer, shader, pickShader) {
  this.plot             = plot
  this.positionBufferHi = positionBufferHi
  this.positionBufferLo = positionBufferLo
  this.pickBuffer       = pickBuffer
  this.weightBuffer     = weightBuffer
  this.shader           = shader
  this.pickShader       = pickShader
  this.scales           = []
  this.size             = 12.0
  this.borderSize       = 1.0
  this.pointCount       = 0
  this.color            = [1, 0, 0, 1]
  this.borderColor      = [0, 0, 0, 1]
  this.bounds           = [Infinity, Infinity, -Infinity, -Infinity]
  this.pickOffset       = 0
  this.points           = null
  this.xCoords          = null
  this.snapPoints       = true
}

var proto = Scatter2D.prototype
var scaleHi = new Float32Array(2)
var scaleLo = new Float32Array(2)
var translateHi = new Float32Array(2)
var translateLo = new Float32Array(2)
var PICK_VEC4 = [0, 0, 0, 0]

proto.dispose = function() {
  this.shader.dispose()
  this.pickShader.dispose()
  this.positionBufferHi.dispose()
  this.positionBufferLo.dispose()
  this.pickBuffer.dispose()
  if(this.xCoords) pool.free(this.xCoords)
  this.plot.removeObject(this)
}

proto.update = function(options) {
  options = options || {}

  function dflt(opt, value) {
    return opt in options ? options[opt] : value
  }

  this.size         = dflt('size', 12)
  this.color        = dflt('color', [1, 0, 0, 1]).slice()
  this.borderSize   = dflt('borderSize', 1)
  this.borderColor  = dflt('borderColor', [0, 0, 0, 1]).slice()
  this.snapPoints   = dflt('snapPoints', true)

  //do not recalc points if there is no positions
  if (options.positions != null) {
    if(this.xCoords) pool.free(this.xCoords)

    this.points             = options.positions
    var pointCount          = this.points.length >>> 1

    var packedId = pool.mallocInt32(pointCount)
    var packedW = pool.mallocFloat32(pointCount)
    var packed = pool.mallocFloat64(2 * pointCount)
    packed.set(this.points)

    if (this.snapPoints) {
      this.scales = snapPoints(packed, packedId, packedW, this.bounds)
    }
    else {
      //get bounds
      this.bounds = getBounds(packed, 2)

      // rescale packed to unit box
      normalize(packed, 2, this.bounds)

      // generate fake ids
      for (var i = 0; i < pointCount; i++) {
        packedId[i] = i
        packedW[i] = 1
      }
    }

    var xCoords             = pool.mallocFloat64(pointCount)
    var packedHi            = pool.mallocFloat32(2 * pointCount)
    var packedLo            = pool.mallocFloat32(2 * pointCount)
    packedHi.set(packed)
    for(var i = 0, j = 0; i < pointCount; i++, j += 2) {
      packedLo[j] = packed[j] - packedHi[j]
      packedLo[j + 1] = packed[j + 1] - packedHi[j + 1]
      xCoords[i] = packed[j]
    }
    this.positionBufferHi.update(packedHi)
    this.positionBufferLo.update(packedLo)
    this.pickBuffer.update(packedId)
    this.weightBuffer.update(packedW)

    pool.free(packedHi)
    pool.free(packedLo)
    pool.free(packedW)
    pool.free(packed)
    pool.free(packedId)

    this.xCoords = xCoords
    this.pointCount = pointCount
    this.pickOffset = 0
  }
}

proto.draw = function(pickOffset) {
  var pick = pickOffset !== void(0)

  var plot             = this.plot
  var shader           = pick ? this.pickShader : this.shader
  var scales           = this.scales
  var positionBufferHi = this.positionBufferHi
  var positionBufferLo = this.positionBufferLo
  var pickBuffer       = this.pickBuffer
  var bounds           = this.bounds
  var size             = this.size
  var borderSize       = this.borderSize
  var gl               = plot.gl
  var pixelRatio       = pick ? plot.pickPixelRatio : plot.pixelRatio
  var viewBox          = plot.viewBox
  var dataBox          = plot.dataBox

  if(this.pointCount === 0)
    return pickOffset

  var boundX  = bounds[2] - bounds[0]
  var boundY  = bounds[3] - bounds[1]
  var dataX   = dataBox[2] - dataBox[0]
  var dataY   = dataBox[3] - dataBox[1]
  var screenX = (viewBox[2] - viewBox[0]) * pixelRatio / plot.pixelRatio
  var screenY = (viewBox[3] - viewBox[1]) * pixelRatio / plot.pixelRatio

  var pixelSize = this.pixelSize = Math.min(dataX / screenX, dataY / screenY)

  var scaleX = 2 * boundX / dataX
  var scaleY = 2 * boundY / dataY

  scaleHi[0] = scaleX
  scaleHi[1] = scaleY

  scaleLo[0] = scaleX - scaleHi[0]
  scaleLo[1] = scaleY - scaleHi[1]

  var translateX = (bounds[0] - dataBox[0] - 0.5 * dataX) / boundX
  var translateY = (bounds[1] - dataBox[1] - 0.5 * dataY) / boundY

  translateHi[0] = translateX
  translateHi[1] = translateY

  translateLo[0] = translateX - translateHi[0]
  translateLo[1] = translateY - translateHi[1]

  shader.bind()
  shader.uniforms.scaleHi     = scaleHi
  shader.uniforms.scaleLo     = scaleLo
  shader.uniforms.translateHi = translateHi
  shader.uniforms.translateLo = translateLo
  shader.uniforms.color       = this.color
  shader.uniforms.borderColor = this.borderColor
  shader.uniforms.pointSize   = pixelRatio * (size + borderSize)
  shader.uniforms.centerFraction = this.borderSize === 0 ? 2 : size / (size + borderSize + 1.25)

  positionBufferHi.bind()
  shader.attributes.positionHi.pointer()

  positionBufferLo.bind()
  shader.attributes.positionLo.pointer()

  if(pick) {
    this.pickOffset = pickOffset
    PICK_VEC4[0] = ( pickOffset        & 0xff)
    PICK_VEC4[1] = ((pickOffset >> 8)  & 0xff)
    PICK_VEC4[2] = ((pickOffset >> 16) & 0xff)
    PICK_VEC4[3] = ((pickOffset >> 24) & 0xff)
    shader.uniforms.pickOffset = PICK_VEC4

    pickBuffer.bind()
    shader.attributes.pickId.pointer(gl.UNSIGNED_BYTE)

  } else {

    shader.uniforms.useWeight = 1
    this.weightBuffer.bind()
    shader.attributes.weight.pointer()

  }

  var firstLevel = true

  if (this.snapPoints) {
    for(var scaleNum = scales.length - 1; scaleNum >= 0; scaleNum--) {
      var lod = scales[scaleNum]
      if(lod.pixelSize < pixelSize && scaleNum > 1)
        continue

      var range = this.getVisibleRange(lod)
      var startOffset = range[0], endOffset = range[1]

      if(endOffset > startOffset)
        gl.drawArrays(gl.POINTS, startOffset, endOffset - startOffset)

      if(!pick && firstLevel) {
        firstLevel = false
        shader.uniforms.useWeight = 0
      }
    }
  }
  else {
    gl.drawArrays(gl.POINTS, 0, this.pointCount)
  }

  return pickOffset + this.pointCount
}

proto.getVisibleRange = function (lod) {
  var dataBox = this.plot.dataBox,
      bounds = this.bounds,
      pixelSize = this.pixelSize,
      size = this.size,
      pixelRatio = this.plot.pixelRatio,
      boundX  = bounds[2] - bounds[0],
      boundY  = bounds[3] - bounds[1]

  if (!lod) {
    for(var scaleNum = this.scales.length - 1, lod; scaleNum >= 0; scaleNum--) {
      lod = this.scales[scaleNum];
      if(!(lod.pixelSize < pixelSize && scaleNum > 1)) break;
    }
  }

  var xCoords = this.xCoords
  var xStart = (dataBox[0] - bounds[0] - pixelSize * size * pixelRatio) / boundX
  var xEnd   = (dataBox[2] - bounds[0] + pixelSize * size * pixelRatio) / boundX

  var intervalStart = lod.offset
  var intervalEnd   = lod.count + intervalStart

  var startOffset = search.ge(xCoords, xStart, intervalStart, intervalEnd - 1)
  var endOffset   = search.lt(xCoords, xEnd, startOffset, intervalEnd - 1) + 1

  return [startOffset, endOffset]
}

proto.drawPick = proto.draw

proto.pick = function(x, y, value) {
  var pointId = value - this.pickOffset
  return pointId < 0 || pointId >= this.pointCount
    ? null : {
    object:  this,
    pointId: pointId,
    dataCoord: [ this.points[2 * pointId], this.points[2 * pointId + 1] ]
  }
}

function createScatter2D(plot, options) {
  var gl = plot.gl
  var positionBufferHi = createBuffer(gl)
  var positionBufferLo = createBuffer(gl)
  var pickBuffer = createBuffer(gl)
  var weightBuffer = createBuffer(gl)
  var shader = createShader(gl, SHADERS.pointVertex, SHADERS.pointFragment)
  var pickShader = createShader(gl, SHADERS.pickVertex, SHADERS.pickFragment)

  var result = new Scatter2D(plot, positionBufferHi, positionBufferLo, pickBuffer, weightBuffer, shader, pickShader)
  result.update(options)

  plot.addObject(result) // register with plot

  return result
}


text:
/**
 * @defgroup    drivers_tcs37727 TCS37727 Light-To-Digital Converter
 * @ingroup     drivers_sensors
 * @brief       Driver for the AMS TCS37727 Color Light-To-Digital Converter
 *
 *
 * @{
 *
 * @file
 * @brief       Interface definition for the TCS37727 sensor driver.
 *
 * @author      Felix Siebel <f.siebel@phytec.de>
 * @author      Johann Fischer <j.fischer@phytec.de>
 */

#ifndef TCS37727_H
#define TCS37727_H

#include <stdint.h>
#include <stdbool.h>
#include "periph/i2c.h"

#ifdef __cplusplus
extern "C"
{
#endif

#ifndef TCS37727_I2C_ADDRESS
#define TCS37727_I2C_ADDRESS    0x29    /**< Default Device Address */
#endif

#ifndef TCS37727_ATIME_DEFAULT
#define TCS37727_ATIME_DEFAULT  200000  /**< Default RGBC integration time */
#endif

/**
 * @brief Struct for storing TCS37727 sensor data
 */
typedef struct {
    uint32_t red;           /**< IR compensated channels red */
    uint32_t green;         /**< IR compensated channels green */
    uint32_t blue;          /**< IR compensated channels blue */
    uint32_t clear;         /**< channels clear */
    uint32_t lux;           /**< Lux */
    uint32_t ct;            /**< Color temperature */
} tcs37727_data_t;

/**
 * @brief Device descriptor for TCS37727 sensors.
 */
typedef struct {
    i2c_t i2c;              /**< I2C device the sensor is connected to */
    uint8_t addr;           /**< the sensor's slave address on the I2C bus */
    bool initialized;       /**< sensor status, true if sensor is initialized */
    int atime_us;           /**< atime value conveted to microseconds */
    int again;              /**< amount of gain */
} tcs37727_t;

/**
 * @brief Initialise the TCS37727 sensor driver.
 * Settings: Gain 4x, Proximity Detection off
 *
 * @param[out] dev          device descriptor of sensor to initialize
 * @param[in]  i2c          I2C bus the sensor is connected to
 * @param[in]  address      sensor's I2C slave address
 * @param[in]  atime_us     rgbc RGBC integration time in microseconds
 *
 * @return                  0 on success
 * @return                  -1 if initialization of I2C bus failed
 * @return                  -2 if sensor test failed
 * @return                  -3 if sensor configuration failed
 */
int tcs37727_init(tcs37727_t *dev, i2c_t i2c, uint8_t address, int atime_us);

/**
 * @brief Set RGBC enable, this activates periodic RGBC measurements.
 *
 * @param[out] dev          device descriptor of sensor
 *
 * @return                  0 on success
 * @return                  -1 on error
 */
int tcs37727_set_rgbc_active(tcs37727_t *dev);

/**
 * @brief Set RGBC disable, this deactivates periodic RGBC measurements.
 * Also turns off the sensor when proximity measurement is disabled.
 *
 * @param[in]  dev          device descriptor of sensor
 *
 * @return                  0 on success
 * @return                  -1 on error
 */
int tcs37727_set_rgbc_standby(tcs37727_t *dev);

/**
 * @brief Read sensor's data.
 * Besides an Autogain routine is called. If a maximum or minimum threshold
 * value of the channel clear is reached, then the gain will be changed
 * correspond to max or min threshold.
 *
 * @param[in]  dev         device descriptor of sensor
 * @param[out] data        device sensor data
 *
 * @return                  0 on success
 * @return                  -1 on error
 */
int tcs37727_read(tcs37727_t *dev, tcs37727_data_t *data);

#ifdef __cplusplus
}
#endif

#endif
/** @} */


text:
package org.apache.gobblin.runtime.api;

import java.util.Map;

import org.apache.gobblin.configuration.State;

/**
 * For generating additional event metadata to associate with Task Events.
 */
public interface TaskEventMetadataGenerator {
  /**
   * Generate a map of additional metadata for the specified event name.
   * @param eventName the event name used to determine which additional metadata should be emitted
   * @return {@link Map} with the additional metadata
   */
  Map<String, String> getMetadata(State taskState, String eventName);
}


text:
const cachedSetTimeout = setTimeout;

function createSleepPromise(timeout, { useCachedSetTimeout }) {
    const timeoutFunction = useCachedSetTimeout ? cachedSetTimeout : setTimeout;

    return new Promise((resolve) => {
        timeoutFunction(resolve, timeout);
    });
}

export default function sleep(timeout, { useCachedSetTimeout } = {}) {
    const sleepPromise = createSleepPromise(timeout, { useCachedSetTimeout });

    // Pass value through, if used in a promise chain
    function promiseFunction(value) {
        return sleepPromise.then(() => value);
    }

    // Normal promise
    // eslint-disable-next-line functional/immutable-data
    promiseFunction.then = (...args) => sleepPromise.then(...args);
    // eslint-disable-next-line functional/immutable-data
    promiseFunction.catch = Promise.resolve().catch;

    return promiseFunction;
}


text:
#ifndef TENSORFLOW_PLATFORM_DEFAULT_MUTEX_H_
#define TENSORFLOW_PLATFORM_DEFAULT_MUTEX_H_

// IWYU pragma: private, include "third_party/tensorflow/core/platform/mutex.h"
// IWYU pragma: friend third_party/tensorflow/core/platform/mutex.h

#include <chrono>
#include <condition_variable>
#include <mutex>
#include "tensorflow/core/platform/thread_annotations.h"

namespace tensorflow {

#undef mutex_lock

enum LinkerInitialized { LINKER_INITIALIZED };

class condition_variable;

// Mimic std::mutex + C++17's shared_mutex, adding a LinkerInitialized
// constructor interface.  This type is as fast as mutex, but is also a shared
// lock.
class LOCKABLE mutex {
 public:
  mutex();
  // The default implementation of the underlying mutex is safe to use after
  // the linker initialization to zero.
  explicit mutex(LinkerInitialized x) {}

  void lock() EXCLUSIVE_LOCK_FUNCTION();
  bool try_lock() EXCLUSIVE_TRYLOCK_FUNCTION(true);
  void unlock() UNLOCK_FUNCTION();

  void lock_shared() SHARED_LOCK_FUNCTION();
  bool try_lock_shared() SHARED_TRYLOCK_FUNCTION(true);
  void unlock_shared() UNLOCK_FUNCTION();

  struct external_mu_space {
    void* space[2];
  };

 private:
  friend class condition_variable;
  external_mu_space mu_;
};

// Mimic a subset of the std::unique_lock<tensorflow::mutex> functionality.
class SCOPED_LOCKABLE mutex_lock {
 public:
  typedef ::tensorflow::mutex mutex_type;

  explicit mutex_lock(mutex_type& mu) EXCLUSIVE_LOCK_FUNCTION(mu) : mu_(&mu) {
    mu_->lock();
  }

  mutex_lock(mutex_type& mu, std::try_to_lock_t) EXCLUSIVE_LOCK_FUNCTION(mu)
      : mu_(&mu) {
    if (!mu.try_lock()) {
      mu_ = nullptr;
    }
  }

  // Manually nulls out the source to prevent double-free.
  // (std::move does not null the source pointer by default.)
  mutex_lock(mutex_lock&& ml) noexcept EXCLUSIVE_LOCK_FUNCTION(ml.mu_)
      : mu_(ml.mu_) {
    ml.mu_ = nullptr;
  }
  ~mutex_lock() UNLOCK_FUNCTION() {
    if (mu_ != nullptr) {
      mu_->unlock();
    }
  }
  mutex_type* mutex() { return mu_; }

  operator bool() const { return mu_ != nullptr; }

 private:
  mutex_type* mu_;
};

// Catch bug where variable name is omitted, e.g. mutex_lock (mu);
#define mutex_lock(x) static_assert(0, "mutex_lock_decl_missing_var_name");

// Mimic a subset of the std::shared_lock<tensorflow::mutex> functionality.
// Name chosen to minimise conflicts with the tf_shared_lock macro, below.
class SCOPED_LOCKABLE tf_shared_lock {
 public:
  typedef ::tensorflow::mutex mutex_type;

  explicit tf_shared_lock(mutex_type& mu) SHARED_LOCK_FUNCTION(mu) : mu_(&mu) {
    mu_->lock_shared();
  }

  tf_shared_lock(mutex_type& mu, std::try_to_lock_t) SHARED_LOCK_FUNCTION(mu)
      : mu_(&mu) {
    if (!mu.try_lock_shared()) {
      mu_ = nullptr;
    }
  }

  // Manually nulls out the source to prevent double-free.
  // (std::move does not null the source pointer by default.)
  tf_shared_lock(tf_shared_lock&& ml) noexcept SHARED_LOCK_FUNCTION(ml.mu_)
      : mu_(ml.mu_) {
    ml.mu_ = nullptr;
  }
  ~tf_shared_lock() UNLOCK_FUNCTION() {
    if (mu_ != nullptr) {
      mu_->unlock_shared();
    }
  }
  mutex_type* mutex() { return mu_; }

  operator bool() const { return mu_ != nullptr; }

 private:
  mutex_type* mu_;
};

// Catch bug where variable name is omitted, e.g. tf_shared_lock (mu);
#define tf_shared_lock(x) \
  static_assert(0, "tf_shared_lock_decl_missing_var_name");

// Mimic std::condition_variable.
class condition_variable {
 public:
  condition_variable();

  void wait(mutex_lock& lock);
  template <class Rep, class Period>
  std::cv_status wait_for(mutex_lock& lock,
                          std::chrono::duration<Rep, Period> dur) {
    return wait_until_system_clock(lock,
                                   std::chrono::system_clock::now() + dur);
  }
  void notify_one();
  void notify_all();

  struct external_cv_space {
    void* space[2];
  };

 private:
  friend ConditionResult WaitForMilliseconds(mutex_lock* mu,
                                             condition_variable* cv, int64 ms);
  std::cv_status wait_until_system_clock(
      mutex_lock& lock,
      const std::chrono::system_clock::time_point timeout_time);
  external_cv_space cv_;
};

inline ConditionResult WaitForMilliseconds(mutex_lock* mu,
                                           condition_variable* cv, int64 ms) {
  std::cv_status s = cv->wait_for(*mu, std::chrono::milliseconds(ms));
  return (s == std::cv_status::timeout) ? kCond_Timeout : kCond_MaybeNotified;
}

}  // namespace tensorflow

#endif  // TENSORFLOW_PLATFORM_DEFAULT_MUTEX_H_


text:
@import UIKit;
#import "WEAppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([WEAppDelegate class]));
    }
}


text:
<?php

namespace OckCyp\CoversValidator\Tests\Loader;

use OckCyp\CoversValidator\Loader\ConfigLoader;
use OckCyp\CoversValidator\Model\ConfigurationHolder;
use OckCyp\CoversValidator\Tests\FileTestCase;

class ConfigLoaderTest extends FileTestCase
{
    /**
     * @covers \OckCyp\CoversValidator\Loader\ConfigLoader::loadConfig
     */
    public function testLoadsConfig()
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0" standalone="yes" ?><phpunit />');
        file_put_contents('temp-config.xml', $xml->asXML());

        $this->assertInstanceOf(
            ConfigurationHolder::class,
            ConfigLoader::loadConfig('temp-config.xml')
        );
    }
}


text:
"""Probabilistic potentials"""
__author__ = 'thor'

import pandas as pd
from numpy import *
from matplotlib.pyplot import *
import numpy as np
from collections import Counter

# from numpy.random import rand
# from numpy.random import permutation

import ut.pcoll.order_conserving as colloc

# import ut as ut
from ut.daf.op import cartesian_product
from ut.daf.gr import group_and_count
from ut.daf.ch import ch_col_names
from ut.daf.manip import reorder_columns_as
from ut.util.ulist import ascertain_list
from ut.util.prand import rand_numbers_summing_to_one
from ut.pplot.color import shifted_color_map

import ut.pplot.get
from functools import reduce

class Pot(object):
    def __init__(self, data=None):
        if isinstance(data, Pot):
            self.tb = data.tb
        elif isinstance(data, float) or isinstance(data, int):
            self.tb = pd.DataFrame([{'pval': data}])
        elif data is not None:
            if isinstance(data, pd.DataFrame):
                # inject the dataframe in the tb attribute: It's the potential data
                assert 'pval' in data.columns, 'dataframe had no pval column'
                self.tb = data
            elif isinstance(data, dict):
                if 'pval' not in list(data.keys()):
                    data = dict(data, pval=len(data[list(data.keys())[0]]) * [1])
                self.tb = pd.DataFrame(data=data)
            else:
                try:
                    self.tb = data.tb.copy()
                except Exception:
                    raise ValueError('Unknown construction type')
        else:
            self.tb = pd.DataFrame({'pval': 1}, index=[''])  # default "unit" potential
        self.tb.index = [''] * len(self.tb)

    def vars(self):
        return colloc.setdiff(list(self.tb.columns), ['pval'])

    ###########################################
    # OPERATIONS
    ###########################################
    def get_slice(self, intercept_dict):
        """
        Return sub-pot going through specific "intercept points"
        For example, if X is a pot on ABC, then X.get_slice({'A':0, 'B':1}) is the pot on C taken from ABC where
        A=0 and B=1.
        It's like a subplane of points defined by given axis intercepts.
        """
        tb = self.tb.copy()
        for k, v in intercept_dict.items():
            tb = tb[tb[k] == v]
            del tb[k]
        return Pot(tb)

    def project_to(self, var_list=[]):
        """
        project to a subset of variables (marginalize out other variables)
        """
        var_list = colloc.intersect(ascertain_list(var_list), self.vars())
        if var_list:  # if non-empty, marginalize out other variables
            return Pot(
                self.tb[var_list + ['pval']].groupby(var_list).sum().reset_index()
            )
        else:  # if _var_list is empty, return a singleton potential containing the sum of the vals of self.tb
            return Pot(pd.DataFrame({'pval': self.tb['pval'].sum()}, index=['']))

    def __rshift__(self, var_list):
        return self.project_to(var_list)

    def normalize(self, var_list=[]):
        """
        'Normalization' of the pot with respect to _var_list.
        Will define the pot by the projection of the pot on a subset of the variables.

        Note: If this subset is the empty set, this will correspond to "full normalization", i.e. dividing the vals by
        the sum of all vals.

        Use:
            * This can be used to transform a count potential into a probability potential
            (if your sample is large enough!)
            * Conditional Probability: P(A|B) = P(AB) / P(B)
        """
        return self / self.project_to(var_list)

    def __or__(self, item):
        """
        If item is empty/none/false, a string or a list, it normalizes according to item.
        If item is a dict, it normalizes according to the keys, and slices according to the dict.
        --> This resembles P(A|B=1) kind of thing...
        """
        print(
            "I'm trying to discourage using | now (might want to use it for fuzzy logic at some point"
        )
        print('--> Use / instead of |. ')
        if isinstance(item, str):
            return self / self.project_to([item])
        elif isinstance(item, list):
            return self / self.project_to(item)
        elif isinstance(item, dict):
            intercept_dict = item
            var_list = colloc.intersect(self.vars(), list(intercept_dict.keys()))
            return (self / self.project_to(var_list)).get_slice(intercept_dict)
        else:
            TypeError('Unknown item type')

    def __getitem__(self, item):
        """
        This function is called when accessing the pot with [] brackets, and will return a slice of projection of the
        pot depending on the type of item.
        """
        if item:
            if isinstance(item, dict):
                return self.get_slice(item)
            elif isinstance(item, list):
                return self.project_to(item)
            elif isinstance(item, str):
                return self.project_to(item)
            else:
                raise TypeError(
                    'Unknown type for item (must be None, dict, list, or string)'
                )
        else:
            return Pot(pd.DataFrame({'pval': self.tb['pval'].sum()}, index=['']))

    def __add__(self, pot):
        return Pot(_val_add_(self._merge_(pot)))
        # if isinstance(y, float) | isinstance(y, int):
        #     self.tb['pval'] += y
        # else:
        #     pass

    def __mul__(self, pot):
        """
        Multiply two potentials
        """
        return Pot(_val_prod_(self._merge_(pot)))

    def __div__(self, item):
        """
        Operation depends on what item's type is. If item is a:
            Pot: perform potential division (like multiplication but with pvals divided).
            empty/none/false, a string or a list: normalize according to item.
            dict: it normalizes according to the keys, and slices according to the dict.
        --> This resembles P(A|B=1) kind of thing...
        """
        if isinstance(item, Pot):
            return Pot(_val_div_(self._merge_(item)))
        elif isinstance(item, str):
            return self.normalize([item])
        elif isinstance(item, list):
            return self.normalize(item)
        elif isinstance(item, dict):
            intercept_dict = item
            var_list = colloc.intersect(self.vars(), list(intercept_dict.keys()))
            return self.normalize(var_list).get_slice(intercept_dict)
        else:
            TypeError('Unknown item type')

    def __truediv__(self, item):
        return self.__div__(item)

    def assimilate(self, pot):
        """
        Assimilate information given by input pot (returning the result).
        Assimilation means multiplication followed by a projection to the original variables.
        This is used, for example, when wanting to compute P(X|D=data) as the normalization of P(D=data|X) * P(X)
        (Bayes rule). We can write that as P(X) absorbing P(D=data|X). The result has the dimensions of X.
        """
        return self.__mul__(pot).normalize([]).project_to(self.vars())

    def unassimilate(self, pot):
        """
        Inverse of assimilate.
        """
        return self.__div__(pot).normalize([]).project_to(self.vars())

    ###########################################
    # Usable UTILS
    ###########################################
    def order_vars(self, var_list, sort_pts=True):
        self.tb = reorder_columns_as(self.tb, ascertain_list(var_list))
        if sort_pts:
            self.sort_pts()
        return self

    def sort_pts(self, var_list=None, **kwargs):
        var_list = var_list or self.vars()
        self.tb = self.tb.sort_values(by=var_list, **kwargs)
        return self

    def pval(self):
        return self.tb.pval

    def pval_of(self, var_val_dict, default_val=0.0):
        t = self.get_slice(var_val_dict)
        n = len(t.tb)
        if n == 0:
            return default_val
        elif n == 1:
            return t.tb.pval[0]
        else:
            raise RuntimeError('In pval_of(): get_slice returned more than one value')

    def binarize(self, var_values_to_map_to_1_dict):
        """
        maps specified variables to {0, 1}
            var_values_to_map_to_1_dict is a {variable_name: values to map to 1} specification dict
        """
        for var_name, vals_to_map_to_1 in var_values_to_map_to_1_dict.items():
            tb = self.tb.copy()
            if not hasattr(vals_to_map_to_1, '__iter__'):
                vals_to_map_to_1 = [vals_to_map_to_1]
            lidx = tb[var_name].isin(vals_to_map_to_1)
            tb[var_name] = 0
            tb[var_name].loc[lidx] = 1
        tb = tb.groupby(self.vars()).sum().reset_index(drop=False)
        return Pot(tb)

    def round(self, ndigits=None, inplace=False):
        if ndigits is None:
            ndigits = abs(int(math.log10(self.tb['pval'].min()))) + 1 + 2
            print(ndigits)
        rounded_pvals = [round(x, ndigits) for x in self.tb['pval']]
        if inplace:
            self.tb['pval'] = rounded_pvals
        else:
            x = Pot(self)
            x.tb['pval'] = rounded_pvals
            return x

    def rect_perspective_df(self):
        vars = self.vars()
        assert (
            len(self.vars()) == 2
        ), 'You can only get the rect_perspective_df of a pot with exactly two variables'
        return self.tb.set_index([vars[0], vars[1]]).unstack(vars[1])['pval']

    ###########################################
    # Hidden UTILS
    ###########################################
    def _merge_(self, pot):
        """
        Util function. Shouldn't really be used directly by the user.
        Merge (join) two pots.
        An inner merge of the two pots, on the intersection of their variables (if non-empty) will be performed,
        producing val_x and val_y columns that will contain the original left and right values, aligned with the join.
        Note: If the vars intersection is empty, the join will correspond to the cartesian product of the variables.
        """
        on = colloc.intersect(
            self.vars(), pot.vars()
        )  # we will merge on the intersection of the variables (not pval)
        if on:
            return pd.merge(
                self.tb, pot.tb, how='inner', on=on, sort=True, suffixes=('_x', '_y')
            )
        else:  # if no common variables, take the cartesian product
            return cartesian_product(self.tb, pot.tb)

    def __str__(self):
        """
        This will return a string that represents the underlying dataframe (used when printing the pot)
        """
        return self.tb.__repr__()

    def __repr__(self):
        """
        This is used by iPython to display a variable.
        I chose to do thing differently than __str__.
        Here the dataframe is indexed by the vars and then made into a string.
        This provides a hierarchical progression perspective to the variable combinations.
        """
        if self.vars():
            return self.tb.set_index(self.vars()).__str__()
        else:
            return self.tb.__repr__()

    # def assert_pot_validity(self):
    #    assert 'pval' in self.tb.columns, "the potential dataframe has no column named 'pval'"
    #    assert len(self.tb.)

    #################################################################################
    # FACTORIES

    @classmethod
    def binary_pot(cls, varname, prob=1):
        return Pot(pd.DataFrame({varname: [0, 1], 'pval': [1 - prob, prob]}))

    @classmethod
    def from_points_to_count(cls, pts, vars=None):
        """
        By "points" I mean a collection (through some data structure) of multi-dimensional coordinates.
        By default, all unique points will be grouped and the pval will be the cardinality of each group.
        """
        if isinstance(pts, pd.DataFrame):
            # tb = group_and_count(pts)
            # tb = ch_col_names(tb, 'pval', 'count')
            return Pot(group_and_count(pts, count_col='pval'))
        else:
            counts = Counter(pts)
            if vars is None:
                example_key = list(counts.keys())[0]
                vars = list(range(len(example_key)))
            return Pot(
                pd.DataFrame(
                    [
                        dict(pval=v, **{kk: vv for kk, vv in zip(vars, k)})
                        for k, v in counts.items()
                    ]
                )
            )

    @classmethod
    def from_count_df_to_count(cls, count_df, count_col='pval'):
        """
        Creates a potential from a dataframe specifying point counts (where the count column name is specified by
        count_col
        """
        pot_vars = list(colloc.setdiff(count_df.columns, [count_col]))
        tb = count_df[pot_vars + [count_col]].groupby(pot_vars).sum().reset_index()
        tb = ch_col_names(tb, 'pval', count_col)
        return Pot(tb)

    @classmethod
    def from_points_to_bins(cls, pts, **kwargs):
        """
        Creates a potential from a dataframe specifying point counts (where the count column name is specified by
        count_col
        """
        if isinstance(pts, pd.DataFrame):

            tb = group_and_count(pts)
            tb = ch_col_names(tb, 'pval', 'count')
            return Pot(tb)

    @classmethod
    def rand(
        cls,
        n_var_vals=[2, 2],
        var_names=None,
        granularity=None,
        try_to_get_unique_values=False,
    ):
        # check inputs
        assert (
            len(n_var_vals) <= 26
        ), "You can't request more than 26 variables: That's just crazy"
        if var_names is None:
            var_names = [str(chr(x)) for x in range(ord('A'), ord('Z'))]
        assert len(n_var_vals) <= len(
            var_names
        ), "You can't have less var_names than you have n_var_vals"
        assert min(array(n_var_vals)) >= 2, 'n_var_vals elements should be >= 2'

        # make the df by taking the cartesian product of the n_var_vals defined ranges
        df = reduce(
            cartesian_product,
            [
                pd.DataFrame(data=list(range(x)), columns=[y])
                for x, y in zip(n_var_vals, var_names)
            ],
        )

        n_vals = len(df)

        def _get_random_pvals():
            if granularity is None:
                if n_vals > 18:
                    x = np.random.rand(n_vals)
                    return x / sum(x)
                elif n_vals == 4:
                    return np.random.permutation([0.1, 0.2, 0.3, 0.4])
                else:
                    if n_vals <= 12:
                        return rand_numbers_summing_to_one(n_vals, 0.05)
                    else:
                        return rand_numbers_summing_to_one(n_vals, 0.01)
            else:
                return rand_numbers_summing_to_one(n_vals, granularity)

        # choose random vals
        if try_to_get_unique_values:
            if not isinstance(try_to_get_unique_values, int):
                try_to_get_unique_values = 1000
            for i in range(try_to_get_unique_values):
                pvals = _get_random_pvals()
                if len(unique(pvals)) == n_vals:
                    break
        else:
            pvals = _get_random_pvals()

        df['pval'] = list(map(float, pvals))

        return Pot(df)

class ProbPot(Pot):
    def __init__(self, data=None):
        super(ProbPot, self).__init__(data=data)

    def prob_of(self, var_val_dict):
        t = self.get_slice(var_val_dict)
        n = len(t.tb)
        if n == 0:
            return 0.0
        elif n == 1:
            return t.tb.pval[0]
        else:
            raise RuntimeError('In prob_of(): get_slice returned more than one value')

    def given(self, conditional_vars):
        return ProbPot(self.__div__(conditional_vars))

    def relative_risk(self, event_var, exposure_var, event_val=1, exposed_val=1):
        prob = self >> [event_var, exposure_var]
        prob.binarize({event_var: event_val, exposure_var: exposed_val})
        return (prob / {exposure_var: 1})[{event_var: 1}] / (prob / {exposure_var: 0})[
            {event_var: 1}
        ]

    @staticmethod
    def plot_relrisk_matrix(relrisk):
        t = relrisk.copy()
        matrix_shape = (t['exposure'].nunique(), t['event'].nunique())
        m = ut.daf.to.map_vals_to_ints_inplace(t, cols_to_map=['exposure'])
        m = m['exposure']
        ut.daf.to.map_vals_to_ints_inplace(
            t, cols_to_map={'event': dict(list(zip(m, list(range(len(m))))))}
        )
        RR = zeros(matrix_shape)
        RR[t['exposure'], t['event']] = t['relative_risk']
        RR[list(range(len(m))), list(range(len(m)))] = nan

        RRL = np.log2(RR)

        def normalizor(X):
            min_x = nanmin(X)
            range_x = nanmax(X) - min_x
            return lambda x: (x - min_x) / range_x

        normalize_this = normalizor(RRL)
        center = normalize_this(0)

        color_map = shifted_color_map(
            cmap=cm.get_cmap('coolwarm'), start=0, midpoint=center, stop=1
        )
        imshow(RRL, cmap=color_map, interpolation='none')

        xticks(list(range(shape(RRL)[0])), m, rotation=90)
        yticks(list(range(shape(RRL)[1])), m)
        cbar = colorbar()
        cbar.ax.set_yticklabels(
            [
                '%.02f' % x
                for x in np.exp2(
                    array(ut.pplot.get.get_colorbar_tick_labels_as_floats(cbar))
                )
            ]
        )

#
#
# class ValPot(Pot):
#     def __init__(self, **kwargs):
#         super(ValPot, self).__init__(**kwargs)

##### Data Prep utils
def from_points_to_binary(d, mid_fun=median):
    dd = d.copy()
    columns = d.columns
    for c in columns:
        dd[c] = list(map(int, d[c] > mid_fun(d[c])))
    return dd

##### Other utils

def relative_risk(joint_prob_pot, event_var, exposure_var):
    prob = joint_prob_pot >> [event_var, exposure_var]
    return (prob / {exposure_var: 1})[{event_var: 1}] / (prob / {exposure_var: 0})[
        {event_var: 1}
    ]

def _val_prod_(tb):
    """
    multiplies column val_x and val_y creating column pval (and removing val_x and val_y)
    """
    tb['pval'] = tb['pval_x'] * tb['pval_y']
    tb.drop(labels=['pval_x', 'pval_y'], axis=1, inplace=True)
    return tb

def _val_div_(tb):
    """
    divides column val_x and val_y creating column pval (and removing val_x and val_y)
    Note: 0/0 will be equal to 0
    """
    tb['pval'] = np.true_divide(tb['pval_x'], tb['pval_y']).fillna(0)
    tb.drop(labels=['pval_x', 'pval_y'], axis=1, inplace=True)
    return tb

def _val_add_(tb):
    """
    divides column val_x and val_y creating column pval (and removing val_x and val_y)
    Note: 0/0 will be equal to 0
    """
    tb['pval'] = tb['pval_x'] + tb['pval_y']
    tb.drop(labels=['pval_x', 'pval_y'], axis=1, inplace=True)
    return tb


text:
<!-- http://www.w3.org/TR/xmlschema-guide2versioning -->
Error: download errorhttp://www.w3.org/TR/xmlschema-guide2versioning


text:
typedef std::vector<std::vector<int> > map2d;

class obstacleDetection {

 public:
  obstacleDetection(boost::asio::io_service& io);

  ~obstacleDetection();

  void init(char* port,uint32_t baud,float edgeSize,float cellSize);

  void updateMap();

  unsigned char* getMap();

  void finish();

  unsigned char* m_displayMap;

protected:

  float m_edgeSize;
  float m_cellSize;
  int m_numCells;

  XV11Laser m_laser;
  LaserScan m_scan;

  map2d m_obstacleMap;
};


text:
class Curl
{
private:
	void* curl;
	char errorBuffer[256];
public:
	Curl();
	~Curl();

	void readWebDocument(std::stringstream& ss, const char* fileName);
	void readWebDocument(std::stringstream& ss, std::string&& fileName);
	void readWebDocument(std::stringstream& ss, const std::string& fileName);

	std::stringstream readWebDocument(const char* fileName);
	std::stringstream readWebDocument(std::string&& fileName);
	std::stringstream readWebDocument(const std::string& fileName);
};


text:
HyperTrack Python Bindings
==========================
[![Build Status](https://travis-ci.org/hypertrack/hypertrack-python.svg)](https://travis-ci.org/hypertrack/hypertrack-python/)
[![PyPI version](https://badge.fury.io/py/hypertrack.svg)](https://badge.fury.io/py/hypertrack)
[![Coverage Status](https://coveralls.io/repos/github/hypertrack/hypertrack-python/badge.svg?branch=master)](https://coveralls.io/github/hypertrack/hypertrack-python?branch=master)
[![Code Health](https://landscape.io/github/hypertrack/hypertrack-python/master/landscape.png)](https://landscape.io/github/hypertrack/hypertrack-python/master)
[![Slack Status](http://slack.hypertrack.io/badge.svg)](http://slack.hypertrack.io)

A python wrapper for the [HyperTrack api](http://docs.hypertrack.io).

Installation
------------
```
pip install hypertrack
```

Usage
------

You'll need your hypertrack secret key. You can find this from your account page.
Then, you can just import hypertrack and set your secret key on it.

```python
import hypertrack

hypertrack.secret_key = 'c237rtyfeo9893u2t4ghoevslsd'
hypertrack.api_version = 'v2' # optional. defaults to v1

customer = hypertrack.Customer.create(
    name='John Doe',
    email='john@customer.com',
    phone='+15555555555',
)

print customer
```

Documentation
-------------

For detailed documentation of the methods available, please visit the official [HyperTrack API documentation](http://docs.hypertrack.io).

Testing
-------
We commit to being compatible with Python 2.6+, Python 3.3+ and PyPy. We need to test against all of these environments to ensure compatibility. Travis CI will automatically run our tests on push. For local testing, we use pytest to handle testing across environments.

You will need to install pytest first which you can do using the following command:
```
pip install pytest
```

For running the tests, use the following command:
```
py.test
```
This will run all the tests for the packages.


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

<title>Scheduled (Spring Framework 5.1.18.RELEASE API)</title>
<meta name="date" content="2020-09-15">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Spring Framework

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

org.springframework.scheduling.annotation

Annotation Type Scheduled

@Target(value={METHOD,ANNOTATION_TYPE})
 @Retention(value=RUNTIME)
 @Documented
 @Repeatable(value=Schedules.class)
public @interface Scheduled

An annotation that marks a method to be scheduled. Exactly one of
 the cron(), fixedDelay(), or fixedRate()
 attributes must be specified.

The annotated method must expect no arguments. It will typically have
 a void return type; if not, the returned value will be ignored
 when called through the scheduler.

Processing of @Scheduled annotations is performed by
 registering a ScheduledAnnotationBeanPostProcessor. This can be
 done manually or, more conveniently, through the <task:annotation-driven/>
 element or @EnableScheduling annotation.

This annotation may be used as a meta-annotation to create custom
 composed annotations with attribute overrides.

Since:

3.0

Author:

Mark Fisher, Juergen Hoeller, Dave Syer, Chris Beams

See Also:

EnableScheduling,
ScheduledAnnotationBeanPostProcessor,
Schedules

Field Summary

Fields

Modifier and Type
Fields and Description

static String
CRON_DISABLED

A special cron expression value that indicates a disabled trigger: "-".

Optional Element Summary

Optional Elements

Modifier and Type
Optional Element and Description

String
cron

A cron-like expression, extending the usual UN*X definition to include triggers
 on the second as well as minute, hour, day of month, month and day of week.

long
fixedDelay

Execute the annotated method with a fixed period in milliseconds between the
 end of the last invocation and the start of the next.

String
fixedDelayString

Execute the annotated method with a fixed period in milliseconds between the
 end of the last invocation and the start of the next.

long
fixedRate

Execute the annotated method with a fixed period in milliseconds between
 invocations.

String
fixedRateString

Execute the annotated method with a fixed period in milliseconds between
 invocations.

long
initialDelay

Number of milliseconds to delay before the first execution of a
 fixedRate() or fixedDelay() task.

String
initialDelayString

Number of milliseconds to delay before the first execution of a
 fixedRate() or fixedDelay() task.

String
zone

A time zone for which the cron expression will be resolved.

Field Detail

CRON_DISABLED

public static final String CRON_DISABLED

A special cron expression value that indicates a disabled trigger: "-".

This is primarily meant for use with ${...} placeholders, allowing for
 external disabling of corresponding scheduled methods.

Since:

5.1

Element Detail

cron

public abstract String cron

A cron-like expression, extending the usual UN*X definition to include triggers
 on the second as well as minute, hour, day of month, month and day of week.

E.g. "0 * * * * MON-FRI" means once per minute on weekdays
 (at the top of the minute - the 0th second).

The special value "-" indicates a disabled cron trigger,
 primarily meant for externally specified values resolved by a ${...} placeholder.

Returns:

an expression that can be parsed to a cron schedule

See Also:

CronSequenceGenerator

Default:

""

zone

public abstract String zone

A time zone for which the cron expression will be resolved. By default, this
 attribute is the empty String (i.e. the server's local time zone will be used).

Returns:

a zone id accepted by TimeZone.getTimeZone(String),
 or an empty String to indicate the server's default time zone

Since:

4.0

See Also:

CronTrigger.CronTrigger(String, java.util.TimeZone),
TimeZone

Default:

""

fixedDelay

public abstract long fixedDelay

Execute the annotated method with a fixed period in milliseconds between the
 end of the last invocation and the start of the next.

Returns:

the delay in milliseconds

Default:

-1L

fixedDelayString

public abstract String fixedDelayString

Execute the annotated method with a fixed period in milliseconds between the
 end of the last invocation and the start of the next.

Returns:

the delay in milliseconds as a String value, e.g. a placeholder
 or a java.time.Duration compliant value

Since:

3.2.2

Default:

""

fixedRate

public abstract long fixedRate

Execute the annotated method with a fixed period in milliseconds between
 invocations.

Returns:

the period in milliseconds

Default:

-1L

fixedRateString

public abstract String fixedRateString

Execute the annotated method with a fixed period in milliseconds between
 invocations.

Returns:

the period in milliseconds as a String value, e.g. a placeholder
 or a java.time.Duration compliant value

Since:

3.2.2

Default:

""

initialDelay

public abstract long initialDelay

Number of milliseconds to delay before the first execution of a
 fixedRate() or fixedDelay() task.

Returns:

the initial delay in milliseconds

Since:

3.2

Default:

-1L

initialDelayString

public abstract String initialDelayString

Number of milliseconds to delay before the first execution of a
 fixedRate() or fixedDelay() task.

Returns:

the initial delay in milliseconds as a String value, e.g. a placeholder
 or a java.time.Duration compliant value

Since:

3.2.2

Default:

""

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Spring Framework

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element


text:
In this folder you can find some example projects with RxDB. If you have coding-skills, please help to add examples for the missing environments/frameworks.

Technology           | Status
-------------------- | ---------------------
browser (vanilla-js) | [done](./vanilla)
nodeJS               | [done](./node)
react-native         | [done](./react-native)
ionic2               | [done](./ionic2)
electron             | [done](./electron)
angular              | [done](./angular)
react                | [done](./react)
svelte               | [done](./svelte)
vuejs                | [done](./vue)
supabase             | [done](./supabase/)


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

<TITLE>
Constant Field Values
</TITLE>

<META NAME="date" CONTENT="2013-08-20">

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

      Overview
      Package
      Class
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Constant Field Values

Contents

mars.*

mars.*

mars.ErrorList

public static final String
ERROR_MESSAGE_PREFIX
"Error"

public static final String
FILENAME_PREFIX
" in "

public static final String
LINE_PREFIX
" line "

public static final String
MESSAGE_SEPARATOR
": "

public static final String
POSITION_PREFIX
" column "

public static final String
WARNING_MESSAGE_PREFIX
"Warning"

mars.ErrorMessage

public static final boolean
ERROR
false

public static final boolean
WARNING
true

mars.Globals

public static final String
helpPath
"/help/"

public static final String
imagesPath
"/images/"

public static final String
version
"4.4"

mars.Settings

public static final int
ASSEMBLE_ALL_ENABLED
3

public static final int
ASSEMBLE_ON_OPEN_ENABLED
2

public static final int
AUTO_INDENT
19

public static final int
BARE_MACHINE_ENABLED
1

public static final int
CARET_BLINK_RATE
4

public static final int
DATA_SEGMENT_HIGHLIGHTING
12

public static final int
DATASEGMENT_HIGHLIGHT_BACKGROUND
8

public static final int
DATASEGMENT_HIGHLIGHT_FONT
5

public static final int
DATASEGMENT_HIGHLIGHT_FOREGROUND
9

public static final int
DELAYED_BRANCHING_ENABLED
8

public static final int
DISPLAY_ADDRESSES_IN_HEX
5

public static final int
DISPLAY_VALUES_IN_HEX
6

public static final int
EDITOR_CURRENT_LINE_HIGHLIGHTING
15

public static final int
EDITOR_FONT
0

public static final int
EDITOR_LINE_NUMBERS_DISPLAYED
9

public static final int
EDITOR_POPUP_PREFIX_LENGTH
6

public static final int
EDITOR_TAB_SIZE
5

public static final int
EVEN_ROW_BACKGROUND
0

public static final int
EVEN_ROW_FONT
1

public static final int
EVEN_ROW_FOREGROUND
1

public static final int
EXCEPTION_HANDLER
0

public static final int
EXCEPTION_HANDLER_ENABLED
7

public static final int
EXTENDED_ASSEMBLER_ENABLED
0

public static final int
GENERIC_TEXT_EDITOR
18

public static final int
LABEL_SORT_STATE
2

public static final int
LABEL_WINDOW_VISIBILITY
4

public static final int
MEMORY_CONFIGURATION
3

public static final int
ODD_ROW_BACKGROUND
2

public static final int
ODD_ROW_FONT
2

public static final int
ODD_ROW_FOREGROUND
3

public static final int
POPUP_INSTRUCTION_GUIDANCE
16

public static final int
POPUP_SYSCALL_INPUT
17

public static final int
PROGRAM_ARGUMENTS
11

public static final int
REGISTER_HIGHLIGHT_BACKGROUND
10

public static final int
REGISTER_HIGHLIGHT_FONT
6

public static final int
REGISTER_HIGHLIGHT_FOREGROUND
11

public static final int
REGISTERS_HIGHLIGHTING
13

public static final int
SELF_MODIFYING_CODE_ENABLED
20

public static final int
START_AT_MAIN
14

public static final int
TEXT_COLUMN_ORDER
1

public static final int
TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_BACKGROUND
6

public static final int
TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_FONT
4

public static final int
TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_FOREGROUND
7

public static final int
TEXTSEGMENT_HIGHLIGHT_BACKGROUND
4

public static final int
TEXTSEGMENT_HIGHLIGHT_FONT
3

public static final int
TEXTSEGMENT_HIGHLIGHT_FOREGROUND
5

public static final int
WARNINGS_ARE_ERRORS
10

mars.assembler.*

mars.assembler.DataTypes

public static final int
BYTE_SIZE
1

public static final int
CHAR_SIZE
1

public static final int
DOUBLE_SIZE
8

public static final int
FLOAT_SIZE
4

public static final int
HALF_SIZE
2

public static final double
LOW_DOUBLE_VALUE
-1.7976931348623157E308

public static final double
LOW_FLOAT_VALUE
-3.4028234663852886E38

public static final int
MAX_BYTE_VALUE
127

public static final double
MAX_DOUBLE_VALUE
1.7976931348623157E308

public static final double
MAX_FLOAT_VALUE
3.4028234663852886E38

public static final int
MAX_HALF_VALUE
32767

public static final int
MAX_UHALF_VALUE
65535

public static final int
MAX_WORD_VALUE
2147483647

public static final int
MIN_BYTE_VALUE
-128

public static final int
MIN_HALF_VALUE
-32768

public static final int
MIN_UHALF_VALUE
0

public static final int
MIN_WORD_VALUE
-2147483648

public static final int
WORD_SIZE
4

mars.assembler.Symbol

public static final boolean
DATA_SYMBOL
true

public static final boolean
TEXT_SYMBOL
false

mars.assembler.SymbolTable

public static final int
NOT_FOUND
-1

mars.assembler.TokenTypes

public static final String
TOKEN_DELIMITERS
"\t ,()"

mars.mips.*

mars.mips.hardware.AccessNotice

public static final int
READ
0

public static final int
WRITE
1

mars.mips.hardware.Coprocessor0

public static final int
CAUSE
13

public static final int
DEFAULT_STATUS_VALUE
65297

public static final int
EPC
14

public static final int
EXCEPTION_LEVEL
1

public static final int
STATUS
12

public static final int
VADDR
8

mars.mips.hardware.Memory

public static final boolean
BIG_ENDIAN
false

public static final boolean
LITTLE_ENDIAN
true

public static final int
WORD_LENGTH_BYTES
4

mars.mips.hardware.RegisterFile

public static final int
GLOBAL_POINTER_REGISTER
28

public static final int
STACK_POINTER_REGISTER
29

mars.mips.instructions.Instruction

public static final int
INSTRUCTION_LENGTH
4

public static final int
INSTRUCTION_LENGTH_BITS
32

mars.simulator.*

mars.simulator.Exceptions

public static final int
ADDRESS_EXCEPTION_LOAD
4

public static final int
ADDRESS_EXCEPTION_STORE
5

public static final int
ARITHMETIC_OVERFLOW_EXCEPTION
12

public static final int
BREAKPOINT_EXCEPTION
9

public static final int
DIVIDE_BY_ZERO_EXCEPTION
15

public static final int
EXTERNAL_INTERRUPT_DISPLAY
128

public static final int
EXTERNAL_INTERRUPT_KEYBOARD
64

public static final int
FLOATING_POINT_OVERFLOW
16

public static final int
FLOATING_POINT_UNDERFLOW
17

public static final int
RESERVED_INSTRUCTION_EXCEPTION
10

public static final int
SYSCALL_EXCEPTION
8

public static final int
TRAP_EXCEPTION
13

mars.simulator.Simulator

public static final int
BREAKPOINT
1

public static final int
CLIFF_TERMINATION
5

public static final int
EXCEPTION
2

public static final int
MAX_STEPS
3

public static final int
NO_DEVICE
0

public static final int
NORMAL_TERMINATION
4

public static final int
PAUSE_OR_STOP
6

mars.simulator.SimulatorNotice

public static final int
SIMULATOR_START
0

public static final int
SIMULATOR_STOP
1

mars.tools.*

mars.tools.BHTSimGUI

public static final String
BHT_DO_NOT_TAKE_BRANCH
"NOT TAKE"

public static final String
BHT_TAKE_BRANCH
"TAKE"

mars.tools.BHTSimulator

public static final int
BHT_DEFAULT_HISTORY
1

public static final boolean
BHT_DEFAULT_INITVAL
false

public static final int
BHT_DEFAULT_SIZE
16

public static final String
BHT_HEADING
"Branch History Table Simulator"

public static final String
BHT_NAME
"BHT Simulator"

public static final String
BHT_VERSION
"Version 1.0 (Ingo Kofler)"

mars.tools.DigitalLabSim

public static final int
EXTERNAL_INTERRUPT_HEXA_KEYBOARD
512

public static final int
EXTERNAL_INTERRUPT_TIMER
256

mars.util.*

mars.util.EditorFont

public static final int
DEFAULT_SIZE
12

public static final int
MAX_SIZE
72

public static final int
MIN_SIZE
6

mars.util.SystemIO

public static final int
SYSCALL_BUFSIZE
128

public static final int
SYSCALL_MAXFILES
32

mars.venus.*

mars.venus.Editor

public static final int
MAX_BLINK_RATE
1000

public static final int
MAX_TAB_SIZE
32

public static final int
MIN_BLINK_RATE
0

public static final int
MIN_TAB_SIZE
1

mars.venus.FileStatus

public static final int
EDITED
4

public static final int
NEW_EDITED
2

public static final int
NEW_NOT_EDITED
1

public static final int
NO_FILE
0

public static final int
NOT_EDITED
3

public static final int
OPENING
8

public static final int
RUNNABLE
5

public static final int
RUNNING
6

public static final int
TERMINATED
7

mars.venus.HelpHelpAction

public static final String
descriptionDetailSeparator
":"

mars.venus.NumberDisplayBaseChooser

public static final int
ASCII
0

public static final int
DECIMAL
10

public static final int
HEXADECIMAL
16

mars.venus.RunSpeedPanel

public static final double
UNLIMITED_SPEED
40.0

mars.venus.SettingsHighlightingAction

public static final String
APPLY_TOOL_TIP_TEXT
"Apply current settings now and leave dialog open"

public static final String
CANCEL_TOOL_TIP_TEXT
"Close dialog without applying current settings"

public static final String
CLOSE_TOOL_TIP_TEXT
"Apply current settings and close dialog"

public static final String
RESET_TOOL_TIP_TEXT
"Reset to initial settings without applying"

mars.venus.editors.MARSTextEditingArea

public static final int
TEXT_FOUND
1

public static final int
TEXT_NOT_FOUND
0

public static final int
TEXT_REPLACED_FOUND_NEXT
2

public static final int
TEXT_REPLACED_NOT_FOUND_NEXT
3

mars.venus.editors.jeditsyntax.InputHandler

public static final String
SMART_HOME_END_PROPERTY
"InputHandler.homeEnd"

mars.venus.editors.jeditsyntax.tokenmarker.Token

public static final byte
COMMENT1
1

public static final byte
COMMENT2
2

public static final byte
END
127

public static final byte
ID_COUNT
12

public static final byte
INTERNAL_FIRST
100

public static final byte
INTERNAL_LAST
126

public static final byte
INVALID
10

public static final byte
KEYWORD1
6

public static final byte
KEYWORD2
7

public static final byte
KEYWORD3
8

public static final byte
LABEL
5

public static final byte
LITERAL1
3

public static final byte
LITERAL2
4

public static final byte
MACRO_ARG
11

public static final byte
NULL
0

public static final byte
OPERATOR
9

      Overview
      Package
      Class
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
package eu.stratosphere.emma.zeppelin

import java.io._
import java.net.URL
import java.util.{Map => JMap}
import java.util.Properties

import org.apache.zeppelin.interpreter.InterpreterResult

import scala.collection.JavaConversions._
import scala.Console.{withErr, withOut}
import scala.language.implicitConversions
import scala.tools.jline_embedded.console.completer._
import scala.tools.nsc._
import scala.tools.nsc.interpreter._
import scala.tools.nsc.interpreter.Completion._

class EmmaRepl(properties: Properties) {
  import EmmaRepl._

  private val options = defaults ++ properties
  private val buffer  = new ByteArrayOutputStream
  private val writer  = new PrintWriter(buffer)
  private var jLine: ArgumentCompleter = _

  private val scalaRepl = {
    val settings = new Settings(writer.println)
    settings.embeddedDefaults(Thread.currentThread.getContextClassLoader)
    settings.usejavacp.value = true

    for (dir <- options get `codegen.dir`)
      settings.classpath append dir

    options get `x.backend` match {
      case Some("flink") =>
        for (path <- options get `flink.path`)
          settings.classpath append path.\*

      case Some("spark") =>
        for (path <- options get `spark.path`)
          settings.classpath append path.\*

      case _ =>
    }

    new IMain(settings, writer)
  }

  def init() {
    scalaRepl.initializeSynchronous()
    scalaRepl.ensureClassLoader()
    val completion = new JLineCompletion(scalaRepl)
    jLine = new ArgumentCompleter(scalaToJline(completion.completer()))
    jLine setStrict false

    val runtime = options get `x.backend` match {
      case Some(backend) => s"${backend.capitalize}()"
      case None => "Native()"
    }

    val cp = scalaRepl.compilerClasspath map { _.getFile } mkString ":"

    scalaRepl beQuietDuring {
      for ((key, value) <- options) interpret(s"""sys.props += "$key" -> "$value"""")
      interpret(s"""sys.props += "${`runtime.cp`}" -> "$cp"""")
      interpret("import eu.stratosphere.emma.api._")
      interpret(s"val engine = new eu.stratosphere.emma.runtime.$runtime")
      interpret(s"val native = eu.stratosphere.emma.runtime.Native()")
    }
  }

  def close(): Unit = {
    interpret("engine.closeSession()")
    interpret("native.closeSession()")
    scalaRepl.close()
    writer.close()
    buffer.close()
  }

  def complete(buffer: String, cursor: Int): JList[String] = {
    val candidates = new java.util.ArrayList[CharSequence]
    jLine.complete(buffer, cursor, candidates)
    candidates map { _.toString }
  }

  def interpret(str: String): InterpreterResult =
    withOut(buffer) {
      withErr(buffer) {
        val code = scalaRepl interpret s"$str\n"
        writer.flush()
        val message = buffer.toString.trim.comprehend
        buffer.reset()
        new InterpreterResult(code, message)
      }
    }

  private def jarsIn(dir: String) = for {
    file <- new File(dir).listFiles
    path  = file.getAbsolutePath
    if path endsWith ".jar"
  } yield new URL(s"file://$path")

  private def scalaToJline(sc: ScalaCompleter): Completer = new Completer {
    def complete(buffer: String, cursor: Int, candidates: JList[CharSequence]) = {
      val str = if (buffer == null) "" else buffer
      val Candidates(cur, cs) = sc.complete(str, cursor)
      candidates addAll cs
      cur
    }
  }

  private implicit def irToCode(ir: IR.Result): InterpreterResult.Code = {
    import InterpreterResult.Code

    ir match {
      case IR.Success    => Code.SUCCESS
      case IR.Incomplete => Code.INCOMPLETE
      case IR.Error      => Code.ERROR
    }
  }
}

object EmmaRepl {
  val `codegen.dir` = "emma.codegen.dir"
  val `x.backend`   = "emma.execution.backend"
  val `x.mode`      = "emma.execution.mode"
  val `x.host`      = "emma.execution.host"
  val `x.port`      = "emma.execution.port"
  val `flink.path`  = "emma.flink.path"
  val `spark.path`  = "emma.spark.path"
  val `runtime.cp`  = "emma.runtime.classpath"

  val defaults: JMap[String, String] = Map(
    `codegen.dir` -> s"${sys props "java.io.tmpdir"}/emma/codegen",
    `x.backend`   -> "native",
    `x.mode`      -> "local",
    `x.host`      -> "localhost",
    `x.port`      -> "6123",
    `flink.path`  -> "./interpreter/emma/flink",
    `spark.path`  -> "./interpreter/emma/spark")

  val descriptions: JMap[String, String] = Map(
    `codegen.dir` -> "Temporary directory for Emma-generated classes",
    `x.backend`   -> "Runtime backend {[native],flink,spark}",
    `x.mode`      -> "Execution mode {[local],remote}",
    `x.host`      -> "Master node address (when mode=remote)",
    `x.port`      -> "Runtime backend port number",
    `flink.path`  -> "Path to the emma-flink library (jars)",
    `spark.path`  -> "Path to the emma-spark library (jars)")

  implicit class Wildcard(val self: String) extends AnyVal {
    def \* = self.reverse.dropWhile { _ == '/' }.reverse + "/*"
  }

  implicit class Comprehend(val self: String) extends AnyVal {
    def isComprehension: Boolean =
      self.takeWhile { _ == '~' }.length > 10

    def comprehend: String = if (isComprehension)
      self.split("~+").map { _.trim }.filter { _.nonEmpty }.sliding(2, 2).map {
        case Array(head, code) =>

{head}

{code}

        case _ => ""
      }.mkString("%html ", "\n", "")
    else self
  }
}


text:
var client = new WindowsAzure.MobileServiceClient("your-azure-mobile-application-URL", "your-azure-application-KEY");
console.log("Azure application URL: " + client.applicationUrl);
console.log("Azure application KEY: " + client.applicationKey.replace(/./gi,'*')); //KEEP IT SECRET!!!

//user authentication, to make it work follow this guide: http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-users-html/?fb=it-it#add-authentication
if (client.currentUser === null) {
    client.login("facebook")
    .then((u: Microsoft.WindowsAzure.User) => alert(u.level))
    .done(() => alert("USER: " + client.currentUser.userId),
            (e) => alert("ERROR: " + e));
} else { client.logout(); }

//define an interface that map to server side Table data
interface TodoItem { id?: number; text?: string; complete?: boolean; }
var data: TodoItem[];
var tableTodoItems = client.getTable('todoitem');

//read all data from server using Promise .then() and error handling in .done()
tableTodoItems.read()
.then((retList: TodoItem[]) => {
    data = retList; return retList.length
})
.done((n: number) =>
    alert(n + " items downloaded"), (e) => alert("ERROR: " + e));

//define simple handler used in callback calls for insert/update and delete
function handlerInsUpd(e: any, i: any) { if (!e) data.push(<TodoItem> i); };
function handlerDelErr(e: any) { if (e) alert("ERROR: " + e); }

//insert one data passing info in POST + custom data in QueryString + simple callback handler
tableTodoItems.insert({ text: 'hello world!', complete: false }, {timestamp: new Date()} , handlerInsUpd);

//update last item changing complete and calling simple handler when done
var todo = data.pop();
todo.complete = !todo.complete;
tableTodoItems.update(todo, null, handlerInsUpd)

//delete first item
tableTodoItems.del({ id: data[0].id },null).done(null, handlerDelErr)

//testing some simple Query fluent
var query = tableTodoItems.select('text', 'id')
            .where({ complete: false })
            .orderBy('text')
query.read().done(printOut);  //Execute query remotly and return data filtered

//testing more complicated Query in composition with previous using function Predicate and Projection
var minlength = 15; //parameter value for filter Predicate
query.where(function (len?: number) { return this.text != null && this.text.length > len }, minlength)
    .orderByDescending('id').skip(2).take(3) //some other ordering and paging filters
    .select(function () { return { abc: this.text + '|' + this.id }; }) //Projection
    .read().done(printOut); //return 3 object {abd: 'ttttttttttttttt|ID'}

//function that printout the query result in JSON
function printOut(ret:any[]) {
    if (!ret) console.log("NO DATA FOUND!")
    else for (var i = 0; i < ret.length; i++) {
        console.log(JSON.stringify(ret[i])); }
}