text:
#define _CRT_SECURE_NO_DEPRECATE //do not use windows secure crt
#include "yocto3d/yocto_realtimeclock.h"
#include "yocto3d/yapi/yjson.h"
#include "yocto3d/yapi/yapi.h"
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

YRealTimeClock::YRealTimeClock(const string& func): YFunction(func)
//--- (RealTimeClock initialization)
    ,_unixTime(UNIXTIME_INVALID)
    ,_dateTime(DATETIME_INVALID)
    ,_utcOffset(UTCOFFSET_INVALID)
    ,_timeSet(TIMESET_INVALID)
    ,_valueCallbackRealTimeClock(NULL)
//--- (end of RealTimeClock initialization)
{
    _className="RealTimeClock";
}

YRealTimeClock::~YRealTimeClock()
{
//--- (YRealTimeClock cleanup)
//--- (end of YRealTimeClock cleanup)
}
//--- (YRealTimeClock implementation)
// static attributes
const string YRealTimeClock::DATETIME_INVALID = YAPI_INVALID_STRING;

int YRealTimeClock::_parseAttr(yJsonStateMachine& j)
{
    if(!strcmp(j.token, "unixTime")) {
        if(yJsonParse(&j) != YJSON_PARSE_AVAIL) goto failed;
        _unixTime =  atol(j.token);
        return 1;
    }
    if(!strcmp(j.token, "dateTime")) {
        if(yJsonParse(&j) != YJSON_PARSE_AVAIL) goto failed;
        _dateTime =  _parseString(j);
        return 1;
    }
    if(!strcmp(j.token, "utcOffset")) {
        if(yJsonParse(&j) != YJSON_PARSE_AVAIL) goto failed;
        _utcOffset =  atoi(j.token);
        return 1;
    }
    if(!strcmp(j.token, "timeSet")) {
        if(yJsonParse(&j) != YJSON_PARSE_AVAIL) goto failed;
        _timeSet =  (Y_TIMESET_enum)atoi(j.token);
        return 1;
    }
    failed:
    return YFunction::_parseAttr(j);
}

/**
 * Returns the current time in Unix format (number of elapsed seconds since Jan 1st, 1970).
 *
 * @return an integer corresponding to the current time in Unix format (number of elapsed seconds
 * since Jan 1st, 1970)
 *
 * On failure, throws an exception or returns Y_UNIXTIME_INVALID.
 */
s64 YRealTimeClock::get_unixTime(void)
{
    if (_cacheExpiration <= YAPI::GetTickCount()) {
        if (this->load(YAPI::DefaultCacheValidity) != YAPI_SUCCESS) {
            return YRealTimeClock::UNIXTIME_INVALID;
        }
    }
    return _unixTime;
}

/**
 * Changes the current time. Time is specifid in Unix format (number of elapsed seconds since Jan 1st, 1970).
 * If current UTC time is known, utcOffset will be automatically adjusted for the new specified time.
 *
 * @param newval : an integer corresponding to the current time
 *
 * @return YAPI_SUCCESS if the call succeeds.
 *
 * On failure, throws an exception or returns a negative error code.
 */
int YRealTimeClock::set_unixTime(s64 newval)
{
    string rest_val;
    char buf[32]; sprintf(buf, "%u", (u32)newval); rest_val = string(buf);
    return _setAttr("unixTime", rest_val);
}

/**
 * Returns the current time in the form "YYYY/MM/DD hh:mm:ss"
 *
 * @return a string corresponding to the current time in the form "YYYY/MM/DD hh:mm:ss"
 *
 * On failure, throws an exception or returns Y_DATETIME_INVALID.
 */
string YRealTimeClock::get_dateTime(void)
{
    if (_cacheExpiration <= YAPI::GetTickCount()) {
        if (this->load(YAPI::DefaultCacheValidity) != YAPI_SUCCESS) {
            return YRealTimeClock::DATETIME_INVALID;
        }
    }
    return _dateTime;
}

/**
 * Returns the number of seconds between current time and UTC time (time zone).
 *
 * @return an integer corresponding to the number of seconds between current time and UTC time (time zone)
 *
 * On failure, throws an exception or returns Y_UTCOFFSET_INVALID.
 */
int YRealTimeClock::get_utcOffset(void)
{
    if (_cacheExpiration <= YAPI::GetTickCount()) {
        if (this->load(YAPI::DefaultCacheValidity) != YAPI_SUCCESS) {
            return YRealTimeClock::UTCOFFSET_INVALID;
        }
    }
    return _utcOffset;
}

/**
 * Changes the number of seconds between current time and UTC time (time zone).
 * The timezone is automatically rounded to the nearest multiple of 15 minutes.
 * If current UTC time is known, the current time will automatically be updated according to the
 * selected time zone.
 *
 * @param newval : an integer corresponding to the number of seconds between current time and UTC time (time zone)
 *
 * @return YAPI_SUCCESS if the call succeeds.
 *
 * On failure, throws an exception or returns a negative error code.
 */
int YRealTimeClock::set_utcOffset(int newval)
{
    string rest_val;
    char buf[32]; sprintf(buf, "%d", newval); rest_val = string(buf);
    return _setAttr("utcOffset", rest_val);
}

/**
 * Returns true if the clock has been set, and false otherwise.
 *
 * @return either Y_TIMESET_FALSE or Y_TIMESET_TRUE, according to true if the clock has been set, and
 * false otherwise
 *
 * On failure, throws an exception or returns Y_TIMESET_INVALID.
 */
Y_TIMESET_enum YRealTimeClock::get_timeSet(void)
{
    if (_cacheExpiration <= YAPI::GetTickCount()) {
        if (this->load(YAPI::DefaultCacheValidity) != YAPI_SUCCESS) {
            return YRealTimeClock::TIMESET_INVALID;
        }
    }
    return _timeSet;
}

/**
 * Retrieves $AFUNCTION$ for a given identifier.
 * The identifier can be specified using several formats:
 *

 *
FunctionLogicalName

 *
ModuleSerialNumber.FunctionIdentifier

 *
ModuleSerialNumber.FunctionLogicalName

 *
ModuleLogicalName.FunctionIdentifier

 *
ModuleLogicalName.FunctionLogicalName

 *

 *
 * This function does not require that $THEFUNCTION$ is online at the time
 * it is invoked. The returned object is nevertheless valid.
 * Use the method YRealTimeClock.isOnline() to test if $THEFUNCTION$ is
 * indeed online at a given time. In case of ambiguity when looking for
 * $AFUNCTION$ by logical name, no error is notified: the first instance
 * found is returned. The search is performed first by hardware name,
 * then by logical name.
 *
 * @param func : a string that uniquely characterizes $THEFUNCTION$
 *
 * @return a YRealTimeClock object allowing you to drive $THEFUNCTION$.
 */
YRealTimeClock* YRealTimeClock::FindRealTimeClock(string func)
{
    YRealTimeClock* obj = NULL;
    obj = (YRealTimeClock*) YFunction::_FindFromCache("RealTimeClock", func);
    if (obj == NULL) {
        obj = new YRealTimeClock(func);
        YFunction::_AddToCache("RealTimeClock", func, obj);
    }
    return obj;
}

/**
 * Registers the callback function that is invoked on every change of advertised value.
 * The callback is invoked only during the execution of ySleep or yHandleEvents.
 * This provides control over the time when the callback is triggered. For good responsiveness, remember to call
 * one of these two functions periodically. To unregister a callback, pass a null pointer as argument.
 *
 * @param callback : the callback function to call, or a null pointer. The callback function should take two
 *         arguments: the function object of which the value has changed, and the character string describing
 *         the new advertised value.
 * @noreturn
 */
int YRealTimeClock::registerValueCallback(YRealTimeClockValueCallback callback)
{
    string val;
    if (callback != NULL) {
        YFunction::_UpdateValueCallbackList(this, true);
    } else {
        YFunction::_UpdateValueCallbackList(this, false);
    }
    _valueCallbackRealTimeClock = callback;
    // Immediately invoke value callback with current value
    if (callback != NULL && this->isOnline()) {
        val = _advertisedValue;
        if (!(val == "")) {
            this->_invokeValueCallback(val);
        }
    }
    return 0;
}

int YRealTimeClock::_invokeValueCallback(string value)
{
    if (_valueCallbackRealTimeClock != NULL) {
        _valueCallbackRealTimeClock(this, value);
    } else {
        YFunction::_invokeValueCallback(value);
    }
    return 0;
}

YRealTimeClock *YRealTimeClock::nextRealTimeClock(void)
{
    string  hwid;

    if(YISERR(_nextFunction(hwid)) || hwid=="") {
        return NULL;
    }
    return YRealTimeClock::FindRealTimeClock(hwid);
}

YRealTimeClock* YRealTimeClock::FirstRealTimeClock(void)
{
    vector<YFUN_DESCR>   v_fundescr;
    YDEV_DESCR             ydevice;
    string              serial, funcId, funcName, funcVal, errmsg;

    if(YISERR(YapiWrapper::getFunctionsByClass("RealTimeClock", 0, v_fundescr, sizeof(YFUN_DESCR), errmsg)) ||
       v_fundescr.size() == 0 ||
       YISERR(YapiWrapper::getFunctionInfo(v_fundescr[0], ydevice, serial, funcId, funcName, funcVal, errmsg))) {
        return NULL;
    }
    return YRealTimeClock::FindRealTimeClock(serial+"."+funcId);
}

//--- (end of YRealTimeClock implementation)

//--- (RealTimeClock functions)
//--- (end of RealTimeClock functions)


text:
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */

#ifndef NATIVE_EXTENSION_VTK_VTKCONTROLPOINTSITEMWRAP_H
#define NATIVE_EXTENSION_VTK_VTKCONTROLPOINTSITEMWRAP_H

#include <nan.h>

#include <vtkSmartPointer.h>
#include <vtkControlPointsItem.h>

#include "vtkPlotWrap.h"
#include "../../plus/plus.h"

class VtkControlPointsItemWrap : public VtkPlotWrap
{
	public:
		using Nan::ObjectWrap::Wrap;
		static void Init(v8::Local<v8::Object> exports);
		static void InitPtpl();
		static void ConstructorGetter(
			v8::Local<v8::String> property,
			const Nan::PropertyCallbackInfo<v8::Value>& info);

		VtkControlPointsItemWrap(vtkSmartPointer<vtkControlPointsItem>);
		VtkControlPointsItemWrap();
		~VtkControlPointsItemWrap( );
		static Nan::Persistent<v8::FunctionTemplate> ptpl;

	private:
		static void New(const Nan::FunctionCallbackInfo<v8::Value>& info);

		static void DeselectAllPoints(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetBounds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetControlPointsIds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetEndPointsMovable(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetEndPointsRemovable(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetEndPointsXMovable(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetEndPointsYMovable(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetLabelFormat(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetScreenPointRadius(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetSelectedPointBrush(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetSelectedPointPen(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetShowLabels(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetStrokeMode(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetSwitchPointsMode(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetUserBounds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetValidBounds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void Paint(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void RemoveCurrentPoint(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void ResetBounds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SelectAllPoints(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetEndPointsRemovable(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetEndPointsXMovable(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetEndPointsYMovable(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetLabelFormat(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetScreenPointRadius(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetShowLabels(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetSwitchPointsMode(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetUserBounds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetValidBounds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SpreadPoints(const Nan::FunctionCallbackInfo<v8::Value>& info);

#ifdef VTK_NODE_PLUS_VTKCONTROLPOINTSITEMWRAP_CLASSDEF
		VTK_NODE_PLUS_VTKCONTROLPOINTSITEMWRAP_CLASSDEF
#endif
};

#endif

redpajama_set_name: RedPajamaGithub


text:
package models.id.ac.unpar.siamodels.matakuliah;

import models.id.ac.unpar.siamodels.MataKuliah;

@MataKuliah(kode = "AIF101", nama = "Pemrograman Berorientasi Objek ", sks = 6)
public class AIF101  {

}


text:
<!--
  - Copyright 2013-2016 consulo.io
  -
  - Licensed under the Apache License, Version 2.0 (the "License");
  - you may not use this file except in compliance with the License.
  - You may obtain a copy of the License at
  -
  - http://www.apache.org/licenses/LICENSE-2.0
  -
  - Unless required by applicable law or agreed to in writing, software
  - distributed under the License is distributed on an "AS IS" BASIS,
  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - See the License for the specific language governing permissions and
  - limitations under the License.
  -->
<consulo-plugin>
  <extensionPoints>
    <extensionPoint name="logProvider" interface="com.intellij.vcs.log.VcsLogProvider" area="PROJECT"/>
    <extensionPoint name="logHighlighterFactory" interface="com.intellij.vcs.log.ui.VcsLogHighlighterFactory" area="PROJECT"/>
  </extensionPoints>

  <extensions defaultExtensionNs="com.intellij">
    <changesViewContent tabName="Log" className="com.intellij.vcs.log.impl.VcsLogContentProvider"
                        predicateClassName="com.intellij.vcs.log.impl.VcsLogContentProvider$VcsLogVisibilityPredicate"/>

    <applicationService serviceInterface="com.intellij.vcs.log.graph.PermanentGraphBuilder"
                        serviceImplementation="com.intellij.vcs.log.graph.PermanentGraphBuilderImpl"/>

    <projectService serviceImplementation="com.intellij.vcs.log.impl.VcsProjectLog"/>
    <projectService serviceInterface="com.intellij.vcs.log.VcsLogObjectsFactory"
                    serviceImplementation="com.intellij.vcs.log.impl.VcsLogObjectsFactoryImpl"/>
    <projectService serviceInterface="com.intellij.vcs.log.data.VcsLogTabsProperties"
                    serviceImplementation="com.intellij.vcs.log.data.VcsLogTabsProperties"/>
    <projectService serviceInterface="com.intellij.vcs.log.VcsUserRegistry"
                    serviceImplementation="com.intellij.vcs.log.data.VcsUserRegistryImpl"/>

    <statistics.usagesCollector implementation="com.intellij.vcs.log.statistics.VcsLogRepoSizeCollector"/>
    <statistics.usagesCollector implementation="com.intellij.vcs.log.statistics.VcsLogFeaturesCollector"/>

    <logHighlighterFactory implementation="com.intellij.vcs.log.ui.MyCommitsHighlighter$Factory"/>
    <logHighlighterFactory implementation="com.intellij.vcs.log.ui.MergeCommitsHighlighter$Factory"/>
    <logHighlighterFactory implementation="com.intellij.vcs.log.ui.CurrentBranchHighlighter$Factory"/>

    <postStartupActivity implementation="com.intellij.vcs.log.impl.VcsProjectLog$InitLogStartupActivity"/>

    <cachesInvalidator implementation="com.intellij.vcs.log.impl.VcsLogCachesInvalidator" />
  </extensions>

  <actions>
    <action class="com.intellij.vcs.log.ui.actions.VcsLogCreatePatchAction" id="Vcs.Log.CreatePatch"
            use-shortcut-of="ChangesView.CreatePatch"/>
    <action class="com.intellij.vcs.log.ui.actions.GoToHashOrRefAction" id="Vcs.Log.GoToRef" icon="consulo.platform.base.PlatformIconGroup@actions.menu_find"
            use-shortcut-of="Find"
            text="Go To Hash/Branch/Tag" description="Specify hash or name of a branch or a tag to navigate to the commit it points"/>
    <action class="com.intellij.vcs.log.ui.actions.VcsLogQuickSettingsActions" id="Vcs.Log.QuickSettings"
            icon="consulo.platform.base.PlatformIconGroup@general.gearplain" text="Quick Settings" description="Quick Settings"/>
    <action class="com.intellij.vcs.log.ui.actions.VcsLogTextFilterSettingsActions" id="Vcs.Log.QuickTextFilterSettings"
            icon="consulo.platform.base.PlatformIconGroup@general.gearplain" text="Text Filter Settings" description="Text Filter Settings"/>
    <action class="com.intellij.vcs.log.ui.actions.IntelliSortChooserToggleAction" id="Vcs.Log.IntelliSortChooser"/>
    <action class="com.intellij.vcs.log.ui.actions.VcsShowLogAction" id="Vcs.Show.Log" text="Show VCS Log">
      <add-to-group group-id="Vcs.Show.Toolwindow.Tab"/>
    </action>
    <action class="com.intellij.vcs.log.ui.actions.CompactReferencesViewAction" id="Vcs.Log.CompactReferencesView"/>
    <action class="com.intellij.vcs.log.ui.actions.ShowTagNamesAction" id="Vcs.Log.ShowTagNames"/>
    <action class="com.intellij.vcs.log.ui.actions.CollapseGraphAction" id="Vcs.Log.CollapseAll"/>
    <action class="com.intellij.vcs.log.ui.actions.ExpandGraphAction" id="Vcs.Log.ExpandAll"/>
    <action class="com.intellij.vcs.log.ui.actions.ShowLongEdgesAction" id="Vcs.Log.ShowLongEdges"/>
    <action class="com.intellij.vcs.log.ui.actions.ShowDetailsAction" id="Vcs.Log.ShowDetailsAction"/>
    <action class="com.intellij.vcs.log.ui.actions.ShowRootsColumnAction" id="Vcs.Log.ShowRootsColumnAction"/>
    <action class="com.intellij.vcs.log.ui.actions.FocusTextFilterAction" id="Vcs.Log.FocusTextFilter">
      <keyboard-shortcut first-keystroke="control L" keymap="$default"/>
      <keyboard-shortcut first-keystroke="control L" keymap="Visual Studio" remove="true"/>
    </action>
    <group class="com.intellij.vcs.log.ui.actions.HighlightersActionGroup" id="Vcs.Log.HighlightersActionGroup"/>
    <action class="com.intellij.vcs.log.ui.actions.OpenAnotherLogTabAction" id="Vcs.Log.OpenAnotherTab"/>
    <action class="com.intellij.vcs.log.ui.actions.CloseLogTabAction" id="Vcs.Log.CloseLogTabAction"/>
    <action class="com.intellij.vcs.log.ui.actions.RefreshLogAction" id="Vcs.Log.Refresh" use-shortcut-of="Refresh"/>
    <action class="com.intellij.vcs.log.ui.actions.ShowGraphHistoryAction" id="Vcs.Show.Graph.History"
            text="Show History as Graph" description="Show History as Graph" internal="true"/>
    <action class="com.intellij.vcs.log.ui.actions.ShowCommitTooltipAction" id="Vcs.Log.ShowTooltip"
            text="Show Commit Tooltip" description="Show tooltip for currently selected commit in the Log"
            use-shortcut-of="QuickJavaDoc"/>
    <action class="com.intellij.vcs.log.ui.actions.EnableFilterByRegexAction" id="Vcs.Log.EnableFilterByRegexAction"
            text="Regex"/>
    <action class="com.intellij.vcs.log.ui.actions.EnableMatchCaseAction" id="Vcs.Log.MatchCaseAction"
            text="Match Case"/>

    <group id="Vcs.Log.Settings">
      <reference id="Vcs.Log.ShowRootsColumnAction"/>
      <reference id="Vcs.Log.CompactReferencesView"/>
      <reference id="Vcs.Log.ShowTagNames"/>
      <separator/>
      <reference id="Vcs.Log.CollapseAll"/>
      <reference id="Vcs.Log.ExpandAll"/>
      <reference id="Vcs.Log.HighlightersActionGroup"/>
      <separator/>
      <reference id="ContextHelp"/>
    </group>
    <group id="Vcs.Log.TextFilterSettings">
      <reference id="Vcs.Log.EnableFilterByRegexAction"/>
      <reference id="Vcs.Log.MatchCaseAction"/>
    </group>
    <group id="Vcs.Log.Toolbar.Internal">
      <reference id="Vcs.Log.ShowLongEdges"/>
      <reference id="Vcs.Log.Refresh"/>
      <reference id="Vcs.Log.GoToRef"/>
      <group id="Vcs.Log.Toolbar"/>
      <separator/>
      <reference ref="Vcs.Log.OpenAnotherTab"/>
      <reference ref="Vcs.Log.CloseLogTabAction"/>
    </group>
    <group id="Vcs.Log.ContextMenu">
      <reference id="Vcs.CopyRevisionNumberAction"/>
      <reference id="Vcs.Log.CreatePatch"/>
    </group>

    <group id="Log.KeymapGroup" text="Log">
      <reference ref="Vcs.Log.CreatePatch"/>
      <separator/>
      <reference ref="Vcs.Log.GoToRef"/>
      <reference ref="Vcs.Log.FocusTextFilter"/>
      <reference ref="Vcs.Log.QuickTextFilterSettings"/>
      <reference ref="Vcs.Log.EnableFilterByRegexAction"/>
      <reference ref="Vcs.Log.MatchCaseAction"/>
      <separator/>
      <reference ref="Vcs.Log.IntelliSortChooser"/>
      <reference ref="Vcs.Log.CollapseAll"/>
      <reference ref="Vcs.Log.ExpandAll"/>
      <reference ref="Vcs.Log.ShowLongEdges"/>
      <separator/>
      <reference ref="Vcs.Log.QuickSettings"/>
      <reference ref="Vcs.Log.CompactReferencesView"/>
      <reference ref="Vcs.Log.ShowTagNames"/>
      <reference ref="Vcs.Log.ShowDetailsAction"/>
      <reference ref="Vcs.Log.ShowRootsColumnAction"/>
      <separator/>
      <reference ref="Vcs.Log.Refresh"/>
      <reference ref="Vcs.Log.OpenAnotherTab"/>
      <reference ref="Vcs.Log.CloseLogTabAction"/>

      <add-to-group group-id="Vcs.KeymapGroup"/>
    </group>
  </actions>

</consulo-plugin>


text:
namespace Microsoft.CSharp.RuntimeBinder.Semantics
{
    internal class IndexerSymbol : PropertySymbol
    {
    }
}


text:
package org.springframework.boot.actuate.autoconfigure.endpoint;

import java.time.Duration;
import java.util.function.Function;

import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor;
import org.springframework.boot.context.properties.bind.BindResult;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.core.env.Environment;
import org.springframework.core.env.PropertyResolver;

/**
 * Function for use with {@link CachingOperationInvokerAdvisor} that extracts caching
 * time-to-live from a {@link PropertyResolver resolved property}.
 *
 * @author Stephane Nicoll
 * @author Phillip Webb
 */
class EndpointIdTimeToLivePropertyFunction implements Function<EndpointId, Long> {

	private static final Bindable<Duration> DURATION = Bindable.of(Duration.class);

	private final Environment environment;

	/**
	 * Create a new instance with the {@link PropertyResolver} to use.
	 * @param environment the environment
	 */
	EndpointIdTimeToLivePropertyFunction(Environment environment) {
		this.environment = environment;
	}

	@Override
	public Long apply(EndpointId endpointId) {
		String name = String.format("management.endpoint.%s.cache.time-to-live",
				endpointId.toLowerCaseString());
		BindResult<Duration> duration = Binder.get(this.environment).bind(name, DURATION);
		return duration.map(Duration::toMillis).orElse(null);
	}

}


text:
package com.sxt.service.product.impl;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.sxt.enums.MessageTypeEnum;
import com.sxt.inter.IBorrowInvestor;
import com.sxt.inter.IBorrowPlan;
import com.sxt.inter.IMemberMoney;
import com.sxt.inter.IMemberMoneyDetail;
import com.sxt.inter.IMembers;
import com.sxt.inter.IPeProduct;
import com.sxt.inter.IPeProductDetail;
import com.sxt.inter.IRepaymentDetail;
import com.sxt.inter.IRewardRecord;
import com.sxt.inter.dto.LocalUserDto;
import com.sxt.models.BorrowInvestor;
import com.sxt.models.Members;
import com.sxt.models.PeProduct;
import com.sxt.models.RewardRecord;
import com.sxt.service.LdContractService;
import com.sxt.service.LdMemberRewardService;
import com.sxt.service.LdParameterService;
import com.sxt.service.MessageService;
import com.sxt.service.ProductService;
import com.sxt.service.product.PeProductService;
@Service
public class PeProductServiceImpl implements PeProductService {
	private static Log logger = LogFactory.getLog(PeProductServiceImpl.class);
	@Autowired
	private IPeProduct iPeProduct;

	@Autowired
	private IPeProductDetail iPeProductDetail;

	@Autowired
	private IBorrowInvestor iBorrowInvestor;

	@Autowired
	private IMemberMoney iMemberMoney;

	@Autowired
	private IMembers iMembers;

	@Autowired
	private IMemberMoneyDetail iMemberMoneyDetail;

	@Autowired
	private IBorrowPlan  iBorrowPlan;

	@Autowired
	private IRepaymentDetail  iRepaymentDetail;

	@Autowired
	private LdParameterService  ldParameterService;

	@Autowired
	private IRewardRecord  iRewardRecord;

	@Autowired
	private MessageService messageService;

	@Autowired
	private LdMemberRewardService ldMemberRewardService;

	@Autowired
	private ProductService productService;

	@Autowired
	LdContractService ldContractService;

	public PeProduct fQueryProById(String product_id) {
		PeProduct siProduct=iPeProduct.fQueryProById(product_id);
		List<BorrowInvestor> bilist= iBorrowInvestor.fQuerySiproByPid(product_id);
		if(bilist.size()>0){
			siProduct.setCaninvest(siProduct.getBorrowMoney().subtract(iBorrowInvestor.querySumMoney(product_id)));
		}
		siProduct=iPeProduct.fQueryProById(product_id);
		return siProduct;
	}

	public List<PeProduct> fQueryListSiProByUid(int borrow_uid) {
		return iPeProduct.fQueryListSiProByUid(borrow_uid);
	}

	@Transactional(value = "transactionManager", propagation = Propagation.REQUIRED)
	@Override
	public void  payProduct(String productId, BigDecimal investmoney, String systemtradeno,
			LocalUserDto lud, String ip, HttpServletRequest request){
	}

	@Transactional(value = "transactionManager", propagation = Propagation.REQUIRED)
	@Override
	public void payProductByReward(String productId, BigDecimal investmoney, String systemtradeno,
			RewardRecord rewardRecord, LocalUserDto lud, String ip, HttpServletRequest request){
	}

	/**
	 * 给借款人发送短信
	 * @param messageService
	 * @param product
	 */
	@Transactional(value = "transactionManager", propagation = Propagation.REQUIRED)
	public void sendMessageFullProduct(MessageService messageService,PeProduct product){
		Members borrowMember = iMembers.fQueryNameByUid(product.getBorrowUid());
		Map<String, Object> para = new HashMap<String, Object>();
		para.put("userName", borrowMember.getUserName());
		para.put("id", product.getProductId());
		messageService.sendMessage(borrowMember.getUserPhone(), MessageTypeEnum.FULL_SCALE, para, borrowMember.getUid().toString());
	}

	@Override
	public Integer fqueryCountbyCiProductId(String ci_product_id) {
		// TODO Auto-generated method stub
		return iPeProduct.fqueryCountbyCiProductId(ci_product_id);
	}

	public List<PeProduct> fqueryPeProductbyCiProductId(Map<String,Object> param){
		return iPeProduct.fqueryPeProductbyCiProductId(param);
	}

	public PeProduct getProductById(String productId){
		return iPeProduct.getProductById(productId);
	}
	public String querySiproductByProid(String productId){
		return iPeProduct.querySiproductByProid(productId);
	}

	@Override
	public void update(PeProduct product) {
		// TODO Auto-generated method stub

	}

	@Override
	public void updateByProductIdAndStatus(Map<String, Object> param) {
		// TODO Auto-generated method stub

	}
}


text:
package com.android.internal.telephony;

import static com.android.internal.telephony.RILConstants.*;

import android.content.Context;
import android.media.AudioManager;
import android.os.AsyncResult;
import android.os.Message;
import android.os.Parcel;
import android.telephony.PhoneNumberUtils;
import android.telephony.Rlog;
import android.telephony.SignalStrength;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;

import com.android.internal.telephony.uicc.IccCardApplicationStatus;
import com.android.internal.telephony.uicc.IccCardStatus;

/**
 * Provides SignalStrength correction for old Zenfone5RIL extends RIL
 */
public class Zenfone5RIL extends RIL {

    public Zenfone5RIL(Context context, int NetworkType, int cdmaSubscription, Integer instanceId) {
        super(context, NetworkType, cdmaSubscription, instanceId);
       mQANElements = 5;
    }
//
    //@Override
    //protected Object
    //responseSignalStrength(Parcel p) {
        //int numInts = 12;
        //int response[];
//
        //response = new int[numInts];
        //for (int i = 0 ; i < numInts ; i++) {
            //if (i > 6 && i < 12) {
        //We dont have LTE so mark these as INVALID
                //response[i] = SignalStrength.INVALID;
            //} else {
                //response[i] = p.readInt();
            //}
        //}
//
        //return new SignalStrength(response[0], response[1], response[2], response[3], response[4], response[5],
                //response[6], response[7],response[8], response[9], response[10], response[11], true);
    //}

}


text:
require 'gosu'
require 'schnitzel/version'
require 'schnitzel/core_ext/array'
require 'schnitzel/gosu_ext/image'
require 'schnitzel/window'
require 'schnitzel/game'
require 'schnitzel/node'
require 'schnitzel/sprite'
require 'schnitzel/scene'
require 'schnitzel/text'
require 'schnitzel/fps_counter'


text:
require 'spec_helper'

module LeakStopper
  describe Pattern do

    describe "::initialize" do
      it "should work given a valid hash" do
        a_pattern = Pattern.new(sample_yaml_pattern)
        a_pattern.name.should == sample_yaml_pattern["name"]
        a_pattern.regex.should == sample_yaml_pattern["regex"]
        a_pattern.description.should == sample_yaml_pattern["description"]
        a_pattern.is_valid?.should be_true
      end

      it "should behave correctly given {}" do
        a_pattern = Pattern.new({})
        a_pattern.is_valid?.should be_false
      end

      it "should behave correctly given ''" do
        a_pattern = Pattern.new('')
        a_pattern.is_valid?.should be_false
      end

      it "should behave correctly given nil" do
        a_pattern = Pattern.new(nil)
        a_pattern.is_valid?.should be_false
      end
    end

  end
end


text:
using namespace std;

coords player::movement_destination(const gaem_screen & screen, int key) {
	switch(key) {
		case 'W':
			return {position.x, position.y - 1};
		case 'w':
		case KEY_UP:
			return {position.x, position.y - (2 * !screen.is_free(position.below()))};

		case 'S':
		case 's':
		case KEY_DOWN:
			return {position.x, position.y + 1};

		case 'A':
			return {position.x - 1, position.y};
		case 'a':
		case KEY_LEFT:
			return {position.x - 1 - screen.is_free(position.below()), position.y};

		case 'D':
			return {position.x + 1, position.y};
		case 'd':
		case KEY_RIGHT:
			return {position.x + 1 + screen.is_free(position.below()), position.y};
	}
	return position;
}

bool player::is_player() const {
	return true;
}


text:
"""Benchmark for KPL implementation of vocabulary columns + indicator from lists with dense inputs."""

from tensorflow.python import keras
from tensorflow.python.compat import v2_compat
from tensorflow.python.eager.def_function import function as tf_function
from tensorflow.python.feature_column import feature_column_v2 as fcv2
from tensorflow.python.framework import dtypes as dt
from tensorflow.python.keras.layers.preprocessing import category_encoding
from tensorflow.python.keras.layers.preprocessing import string_lookup
from tensorflow.python.keras.layers.preprocessing.benchmarks import feature_column_benchmark as fc_bm
from tensorflow.python.platform import test as tf_test

# This is required as of 3/2021 because otherwise we drop into graph mode.
v2_compat.enable_v2_behavior()

NUM_REPEATS = 10
BATCH_SIZES = [32, 256]

def embedding_varlen(batch_size, max_length):
  """Benchmark a variable-length embedding."""
  # Data and constants.
  vocab_size = 32768
  vocab = fc_bm.create_vocabulary(vocab_size)
  data = fc_bm.create_string_data(
      max_length, batch_size * NUM_REPEATS, vocab, pct_oov=0.15)

  # Keras implementation
  model = keras.Sequential()
  model.add(keras.Input(shape=(max_length,), name="data", dtype=dt.string))
  model.add(string_lookup.StringLookup(vocabulary=vocab, mask_token=None))
  model.add(
      category_encoding.CategoryEncoding(
          num_tokens=vocab_size + 1, output_mode="count"))

  # FC implementation
  fc = fcv2.indicator_column(
      fcv2.categorical_column_with_vocabulary_list(
          key="data", vocabulary_list=vocab, num_oov_buckets=1))

  # Wrap the FC implementation in a tf.function for a fair comparison
  @tf_function()
  def fc_fn(tensors):
    fc.transform_feature(fcv2.FeatureTransformationCache(tensors), None)

  # Benchmark runs
  keras_data = {
      "data": data.to_tensor(default_value="", shape=(batch_size, max_length))
  }
  k_avg_time = fc_bm.run_keras(keras_data, model, batch_size, NUM_REPEATS)

  fc_data = {
      "data": data.to_tensor(default_value="", shape=(batch_size, max_length))
  }
  fc_avg_time = fc_bm.run_fc(fc_data, fc_fn, batch_size, NUM_REPEATS)

  return k_avg_time, fc_avg_time

class BenchmarkLayer(fc_bm.LayerBenchmark):
  """Benchmark the layer forward pass."""

  def benchmark_layer(self):
    for batch in BATCH_SIZES:
      name = "vocab_list_indicator|dense|batch_%s" % batch
      k_time, f_time = embedding_varlen(batch_size=batch, max_length=256)
      self.report(name, k_time, f_time, NUM_REPEATS)

if __name__ == "__main__":
  tf_test.main()


text:
package org.apache.camel.processor.idempotent.hazelcast;

import com.hazelcast.config.Config;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.IMap;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class HazelcastIdempotentRepositoryTest extends CamelTestSupport {

    private IMap<String, Boolean> cache;
    private HazelcastIdempotentRepository repo;
    private HazelcastInstance hazelcastInstance;

    private String key01 = "123";
    private String key02 = "456";

    @BeforeAll
    void setupHazelcast() throws Exception {
        Config config = new Config();
        config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
        config.getNetworkConfig().getJoin().getAutoDetectionConfig().setEnabled(false);
        hazelcastInstance = Hazelcast.newHazelcastInstance(null);
        cache = hazelcastInstance.getMap("myRepo");
        repo = new HazelcastIdempotentRepository(hazelcastInstance, "myRepo");
    }

    @AfterAll
    void teardownHazelcast() {
        hazelcastInstance.getLifecycleService().terminate();
    }

    @BeforeEach
    void clearCache() {
        cache.clear();
    }

    @Test
    public void testAdd() throws Exception {
        // ADD first key
        assertTrue(repo.add(key01));
        assertTrue(cache.containsKey(key01));

        // try to ADD the same key again
        assertFalse(repo.add(key01));
        assertEquals(1, cache.size());

        // try to ADD an other one
        assertTrue(repo.add(key02));
        assertEquals(2, cache.size());
    }

    @Test
    public void testConfirm() throws Exception {
        // ADD first key and confirm
        assertTrue(repo.add(key01));
        assertTrue(repo.confirm(key01));

        // try to confirm a key that isn't there
        assertFalse(repo.confirm(key02));
    }

    @Test
    public void testContains() throws Exception {
        assertFalse(repo.contains(key01));

        // ADD key and check again
        assertTrue(repo.add(key01));
        assertTrue(repo.contains(key01));

    }

    @Test
    public void testRemove() throws Exception {
        // ADD key to remove
        assertTrue(repo.add(key01));
        assertTrue(repo.add(key02));
        assertEquals(2, cache.size());

        // CLEAR repo
        repo.clear();
        assertEquals(0, cache.size());
    }

    @Test
    public void testClear() throws Exception {
        // ADD key to remove
        assertTrue(repo.add(key01));
        assertEquals(1, cache.size());

        // remove key
        assertTrue(repo.remove(key01));
        assertEquals(0, cache.size());

        // try to remove a key that isn't there
        assertFalse(repo.remove(key02));
    }

    @Test
    public void testRepositoryInRoute() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:out");
        mock.expectedBodiesReceived("a", "b");
        // c is a duplicate

        // should be started
        assertTrue(repo.getStatus().isStarted(), "Should be started");

        // send 3 message with one duplicated key (key01)
        template.sendBodyAndHeader("direct://in", "a", "messageId", key01);
        template.sendBodyAndHeader("direct://in", "b", "messageId", key02);
        template.sendBodyAndHeader("direct://in", "c", "messageId", key01);

        MockEndpoint.assertIsSatisfied(context);
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct://in")
                        .idempotentConsumer(header("messageId"), repo)
                        .to("mock://out");
            }
        };
    }

}


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

#include "data/constructs/value.h"

#include <utility>

namespace cclient {
namespace data {

Value::Value() : valueSize(0) {
  value = new uint8_t[0];
  offset = 0;
}

Value::~Value() {
  if (value != NULL) delete[] value;
}

/**
 * Sets the value using the value and the corresponding size and offset.
 */
void Value::setValue(uint8_t *val, size_t size, uint32_t ptrOff) {
  if ((size + ptrOff) > valueSize) {
    uint8_t *oldVal = value;
    value = new uint8_t[size + ptrOff];
    if (oldVal != NULL) {
      memcpy(value, oldVal, ptrOff);
      delete[] oldVal;
    }
    valueSize = size + ptrOff;
  }

  if (size > 0) memcpy(value + ptrOff, val, size);

  offset = size;
}

void Value::setValue(const std::string &val) {
  setValue((uint8_t *)val.c_str(), val.size());
}

/**
 * Appends val to the current value.
 */
void Value::append(uint8_t *val, size_t size) {
  if ((size + offset) > valueSize) {
    uint8_t *oldVal = value;
    value = new uint8_t[size + offset];
    memcpy(value, oldVal, offset);
    delete[] oldVal;
    valueSize = size + offset;
  }

  memcpy(value + offset, val, size);

  offset += size;
}

/**
 * Deep copies the object.
 */
void Value::deepCopy(Value *v) {
  v->value = value;
  v->valueSize = valueSize;
  v->offset = offset;
  value = NULL;
  offset = 0;
  valueSize = 0;
}

uint8_t *Value::data() { return value; }

size_t Value::size() { return offset; }

std::shared_ptr<streams::StreamInterface> Value::getStream() {
  return shared_from_this();
}

std::pair<uint8_t *, size_t> Value::getValue() const {
  return std::make_pair(value, valueSize);
}

std::string Value::getValueAsString() const {
  if (valueSize > 0 && value) {
    return std::string((char *)(value), valueSize);
  } else {
    return std::string("");
  }
}

uint64_t Value::write(cclient::data::streams::OutputStream *outStream) {
  outStream->writeInt(valueSize);
  return outStream->writeBytes(value, valueSize);
}

uint64_t Value::read(cclient::data::streams::InputStream *in) {
  if (value != NULL) delete[] value;

  uint32_t size = in->readInt();
  value = new uint8_t[size];
  valueSize = size;
  return in->readBytes(value, size);
}

bool Value::operator==(const Value &rhs) const {
  if (valueSize == rhs.valueSize && offset == rhs.offset) {
    return (memcmp(value, rhs.value, valueSize) == 0);
  } else
    return false;
}

bool Value::operator!=(const Value &rhs) const { return !(*this == rhs); }
}  // namespace data
}  // namespace cclient


text:
package gov.nih.nci.caadapter.ui.common.tree;

import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeNode;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Insets;
import java.awt.dnd.Autoscroll;
import java.util.Hashtable;
import java.util.Vector;

/**
 * This class defines the default implementation of JTree with Autoscroll knowledge.
 * @author OWNER: Scott Jiang
 * @author LAST UPDATE $Author: phadkes $
 * @version Since caAdapter v1.2
 *          revision    $Revision: 1.2 $
 *          date        $Date: 2008-06-09 19:53:51 $
 */
public class AutoscrollableTree extends JTree implements Autoscroll
{
	/*****
	 * Overload all JTree constructors to seamlessly provide both JTree and Autoscroll
	 * implementation.
	 */
	/**
	 * Returns a JTree with a sample model.
	 * The default model used by the tree defines a leaf node as any node
	 * without children.
	 *
	 * @see javax.swing.tree.DefaultTreeModel#asksAllowsChildren
	 */
	public AutoscrollableTree()
	{
		super(new DefaultMutableTreeNode("Loading...", true));
	}

	/**
	 * Returns a JTree with each element of the
	 * specified array as the
	 * child of a new root node which is not displayed.
	 * By default, the tree defines a leaf node as any node without
	 * children.
	 *
	 * @param value an array of Objects
	 * @see javax.swing.tree.DefaultTreeModel#asksAllowsChildren
	 */
	public AutoscrollableTree(Object[] value)
	{
		super(value);
	}

	/**
	 * Returns a JTree with each element of the specified
	 * Vector as the
	 * child of a new root node which is not displayed. By default, the
	 * tree defines a leaf node as any node without children.
	 *
	 * @param value a Vector
	 * @see javax.swing.tree.DefaultTreeModel#asksAllowsChildren
	 */
	public AutoscrollableTree(Vector<?> value)
	{
		super(value);
	}

	/**
	 * Returns a JTree created from a Hashtable
	 * which does not display with root.
	 * Each value-half of the key/value pairs in the HashTable
	 * becomes a child of the new root node. By default, the tree defines
	 * a leaf node as any node without children.
	 *
	 * @param value a Hashtable
	 * @see javax.swing.tree.DefaultTreeModel#asksAllowsChildren
	 */
	public AutoscrollableTree(Hashtable<?, ?> value)
	{
		super(value);
	}

	/**
	 * Returns a JTree with the specified
	 * TreeNode as its root,
	 * which displays the root node.
	 * By default, the tree defines a leaf node as any node without children.
	 *
	 * @param root a TreeNode object
	 * @see javax.swing.tree.DefaultTreeModel#asksAllowsChildren
	 */
	public AutoscrollableTree(TreeNode root)
	{
		super(root);
	}

	/**
	 * Returns a JTree with the specified TreeNode
	 * as its root, which
	 * displays the root node and which decides whether a node is a
	 * leaf node in the specified manner.
	 *
	 * @param root               a TreeNode object
	 * @param asksAllowsChildren if false, any node without children is a
	 *                           leaf node; if true, only nodes that do not allow
	 *                           children are leaf nodes
	 * @see javax.swing.tree.DefaultTreeModel#asksAllowsChildren
	 */
	public AutoscrollableTree(TreeNode root, boolean asksAllowsChildren)
	{
		super(root, asksAllowsChildren);
	}

	/**
	 * Returns an instance of JTree which displays the root node
	 * -- the tree is created using the specified data model.
	 *
	 * @param newModel the TreeModel to use as the data model
	 */
	public AutoscrollableTree(TreeModel newModel)
	{
		super(newModel);
	}

	/**
	 * This method returns the Insets describing
	 * the autoscrolling region or border relative
	 * to the geometry of the implementing Component.
	 *

	 * This value is read once by the DropTarget
	 * upon entry of the drag Cursor
	 * into the associated Component.
	 *

	 *
	 * @return the Insets
	 */
	public Insets getAutoscrollInsets()
	{
		/**todo: Implement this java.awt.dnd.Autoscroll method*/
		int margin = 50;
		Rectangle bounds = this.getVisibleRect();
		Insets si = new Insets(bounds.y + margin,
				bounds.x + margin,
				bounds.height - margin,
				bounds.width - margin);
		return si;
	}

	/**
	 * notify the Component to autoscroll
	 *
	 * @param p A Point indicating the
	 *          location of the cursor that triggered this operation.
	 */
	public void autoscroll(Point p)
	{
		/**todo: Implement this java.awt.dnd.Autoscroll method*/
		int crow = this.getClosestRowForLocation(p.x, p.y);
		Rectangle rbounds = getRowBounds(crow);
		//Rectangle bounds = rbounds;
		int size = 30;
		if (rbounds != null)
			size = (int) rbounds.getHeight();
		int hsize = size / 2;
		//	int hsize=size*2;
		Rectangle rect = new Rectangle(p.x - hsize, p.y - hsize, size, size);
		this.scrollRectToVisible(rect);
	}
}
/**
 * HISTORY      : $Log: not supported by cvs2svn $
 * HISTORY      : Revision 1.1  2007/04/03 16:17:14  wangeug
 * HISTORY      : initial loading
 * HISTORY      :
 * HISTORY      : Revision 1.10  2006/08/02 18:44:24  jiangsc
 * HISTORY      : License Update
 * HISTORY      :
 * HISTORY      : Revision 1.9  2006/01/03 19:16:53  jiangsc
 * HISTORY      : License Update
 * HISTORY      :
 * HISTORY      : Revision 1.8  2006/01/03 18:56:25  jiangsc
 * HISTORY      : License Update
 * HISTORY      :
 * HISTORY      : Revision 1.7  2005/12/29 23:06:13  jiangsc
 * HISTORY      : Changed to latest project name.
 * HISTORY      :
 * HISTORY      : Revision 1.6  2005/12/29 15:39:06  chene
 * HISTORY      : Optimize imports
 * HISTORY      :
 * HISTORY      : Revision 1.5  2005/12/14 21:37:17  jiangsc
 * HISTORY      : Updated license information
 * HISTORY      :
 * HISTORY      : Revision 1.4  2005/11/29 16:23:53  jiangsc
 * HISTORY      : Updated License
 * HISTORY      :
 * HISTORY      : Revision 1.3  2005/08/08 17:12:54  jiangsc
 * HISTORY      : Support Abstract Datatype.
 * HISTORY      :
 * HISTORY      : Revision 1.2  2005/08/04 22:22:23  jiangsc
 * HISTORY      : Updated license and class header information.
 * HISTORY      :
 */


text:
SYNONYM

#### According to
GRIN Taxonomy for Plants

#### Published in
Linnaea 1:539. 1826

#### Original name
null

### Remarks
null


text:
namespace gpos
{

	//---------------------------------------------------------------------------
	//	@class:
	//		CErrorHandlerTest
	//
	//	@doc:
	//		Static unit tests for error handler base class
	//
	//---------------------------------------------------------------------------
	class CErrorHandlerTest
	{
		public:

			// unittests
			static GPOS_RESULT EresUnittest();
			static GPOS_RESULT EresUnittest_Basic();

#ifdef GPOS_DEBUG
			static GPOS_RESULT EresUnittest_BadRethrow();
			static GPOS_RESULT EresUnittest_BadReset();
			static GPOS_RESULT EresUnittest_Unhandled();
#endif // GPOS_DEBUG

	};
}

#endif // !GPOS_CErrorHandlerTest_H

// EOF


text:
<?php

/**
 * A shim to make the Sentry client library behave like an ExceptionTracker.
 *
 * @author Conor McDermottroe <conor@mcdermottroe.com>
 */
class Sentry
extends ExceptionTracker
{
    private $_raven_client;

    /**
     * Get an instance of this class.
     *
     * @return Sentry An instance of this class.
     */
    public static function getInstance() {
        return new Sentry(Environment::get('SENTRY_DSN'));
    }

    /**
     * Create a new Sentry.
     *
     * @param string $dsn The Sentry DSN to connect to.
     */
    public function __construct($dsn) {
        $this->_raven_client = new Raven_Client($dsn);
    }

    /**
     * {@inheritdoc}
     *
     * @param Exception $exception See {@link ExceptionTracker#captureException()}
     *
     * @return void
     */
    public function captureException($exception) {
        // We ignore 4xx errors
        if ($exception->getCode() < 400 || $exception->getCode() >= 500) {
            $this->_raven_client->captureException($exception);
            NewRelic::noticeError($exception->getMessage(), $exception);
        }
    }

    /**
     * {@inheritdoc}
     *
     * @return void
     */
    public function registerHandlers() {
        $error_handler = new Raven_ErrorHandler($this->_raven_client);
        set_error_handler(array($error_handler, 'handleError'));
        set_exception_handler(array($error_handler, 'handleException'));
    }
}

?>


text:
'use strict'

// Core modules.
var Assert = require('assert')

// Create root instance. Exported as module.
//   * `options` (object): instance options as key-value pairs.
//
// The options are:
//   * `interval` (integer): millisecond interval for timeout checks. Default: 111.
//   * `timeout` (integer): common millisecond timeout.
//      Can be overridden by work item options. Default: 2222.
function make_GateExecutor (options) {
  options = options || {}
  options.interval = null == options.interval ? 111 : options.interval
  options.timeout = null == options.timeout ? 2222 : options.timeout

  Assert('object' === typeof options)
  Assert('number' === typeof options.interval)
  Assert('number' === typeof options.timeout)
  Assert(0 < options.interval)
  Assert(0 < options.timeout)

  return new GateExecutor(options, 0)
}

// Create a new instance.
//   * `options` (object): instance options as key-value pairs.
//   * `instance_counter` (integer): count number of instances created;
//     used as identifier.
function GateExecutor (options, instance_counter) {
  var self = this

  Assert('object' === typeof options)
  Assert('number' === typeof instance_counter)

  self.id = ++instance_counter

  // Work queue.
  var q = []

  // Work-in-progress set.
  var progress = {

    // Lookup work by id.
    lookup: {},

    // Work history - a list of work items in the order executed.
    history: []
  }

  // List of work items to check for timeouts.
  var timeout_checklist = []

  // Internal state.
  var s = {

    // Count of work items added to this instance. Used as generated work identifier.
    work_counter: 0,

    // When `true`, the instance is in a gated state, and work cannot proceed
    // until the gated in-progress work item is completed.
    gate: false,

    // When `true`, the instance processes work items as they arrive.
    // When `false`, no processing happens, and the instance must be started by
    // calling the `start` method.
    running: false,

    // A function called when the work queue and work-in-progress set
    // are empty.  Set by calling the `clear` method. Will be called
    // each time the instance empty.
    clear: null,

    // A function called once only when the work queue and
    // work-in-progress set are first emptied after each start. Set as
    // an optional argument to the `start` method.
    firstclear: null,

    // Timeout interval reference value returned by `setInterval`.
    // Timeouts are not checked using `setTimeout`, as it is more
    // efficient, and more than sufficient, to check timeouts periodically.
    tm_in: null
  }

  // Process the next work item.
  function processor () {

    // If not running, don't process any work items.
    if (!s.running) {
      return
    }

    // The timeout interval check is stopped and started only as needed.
    if (!self.isclear() && !s.tm_in) {
      s.tm_in = setInterval(timeout_check, options.interval)
    }

    // Process the next work item, returning `true` if there was one.
    do {
      var next = false
      var work = null

      // Remove next work item from the front of the work queue.
      if (!s.gate) {
        work = q.shift()
      }

      if (work) {
        Assert('object' === typeof work)
        Assert('string' === typeof work.id)
        Assert('function' === typeof work.fn)

        // Add work item to the work-in-progress set.
        progress.lookup[work.id] = work
        progress.history.push(work)

        // If work item is a gate, set the state of the instance as
        // gated.  This work item will need to complete before later
        // work items in the queue can be processed.
        s.gate = work.gate

        // Call the work item function (which does the real work),
        // passing a callback. This callback has no arguments
        // (including no error!).  It is called only to indicate
        // completion of the work item.  Work items must handle their
        // own errors and results.
        work.start = Date.now()
        work.callback = make_work_fn_callback(work)

        timeout_checklist.push(work)
        work.fn(work.callback)

        next = true
      }
    }

    // Keep processing work items until none are left or a gate is reached.
    while (next)
  }

  // Create the callback for the work function
  function make_work_fn_callback (work) {
    return function work_fn_callback () {
      if (work.done) {
        return
      }

      // Remove the work item from the work-in-progress set.  As
      // work items may complete out of order, prune the history
      // from the front until the first incomplete work
      // item. Later complete work items will eventually be
      // reached on another processing round.
      work.done = true
      delete progress.lookup[work.id]

      while (progress.history[0] && progress.history[0].done) {
        progress.history.shift()
      }

      while (timeout_checklist[0] && timeout_checklist[0].done) {
        timeout_checklist.shift()
      }

      // If the work item was a gate, it is now complete, and the
      // instance can be ungated, allowing later work items in the
      // queue to be processed.
      if (work.gate) {
        s.gate = false
      }

      // If work queue and work-in-progress set are empty, then
      // call the registered clear functions.
      if (0 === q.length && 0 === progress.history.length) {
        clearInterval(s.tm_in)
        s.tm_in = null

        if (s.firstclear) {
          var fc = s.firstclear
          s.firstclear = null
          fc()
        }

        if (s.clear) {
          s.clear()
        }
      }

      // Process each work item on next tick to avoid lockups.
      setImmediate(processor)
    }
  }

  // To be run periodically via setInterval. For timed out work items,
  // calls the done callback to allow work queue to proceed, and makes
  // the work item as finished. Work items can receive notification of
  // timeouts by providing an `on_timeout` callback property in the
  // work definition object. Work items must handle timeout errors
  // themselves, gate-executor cares only for the fact that a timeout
  // happened, so it can continue processing.
  function timeout_check () {
    var now = Date.now()
    var work = null

    for (var i = 0; i < timeout_checklist.length; ++i) {
      work = timeout_checklist[i]

      if (!work.gate && !work.done && work.tm < now - work.start) {
        if (work.ontm) {
          work.ontm()
        }

        work.callback()
      }
    }
  }

  // Start processing work items. Must be called to start processing.
  // Can be called at anytime, interspersed with calls to other
  // methods, including `add`. Takes a function as argument, which is
  // called only once on the next time the queues are clear.
  self.start = function (firstclear) {
    Assert(null == firstclear || 'function' === typeof firstclear)

    // Allow API chaining by not starting in current execution path.
    setImmediate(function () {
      s.running = true

      if (firstclear) {
        s.firstclear = firstclear
      }

      processor()
    })

    return self
  }

  // Pause the processing of work items. Newly added items, and items
  // not yet started, will not proceed, but items already in progress
  // will complete, and the clear function will be called once all in
  // progress items finish.
  self.pause = function () {
    s.running = false
  }

  // Submit a function that will be called each time there are no more
  // work items to process. Multiple calls to this method will replace
  // the previously registered clear function.
  self.clear = function (done) {
    Assert('function' === typeof done)
    s.clear = done
    return self
  }

  // Returns `true` when there are no more work items to process.
  self.isclear = function () {
    return (0 === q.length && 0 === progress.history.length)
  }

  // Add a work item. This is an object with fields:
  //   * `fn` (function): the function that performs the work. Takes a
  //     single argument, the callback function to call when the work is
  //     complete. THis callback does **not** accept errors or
  //     results. It's only purpose is to indicate that the work is
  //     complete (whether failed or not). The work function itself must
  //     handle callbacks to the application. Required.
  //   * `id` (string): identifier for the work item. Optional.
  //   * `tm` (integer): millisecond timeout specific to this work item,
  //     overrides general timeout. Optional.
  //   * `dn` (string): description of the work item, used in the
  //     state description. Optional.
  self.add = function (work) {
    Assert('object' === typeof work)
    Assert('function' === typeof work.fn)
    Assert(null == work.id || 'string' === typeof work.id)
    Assert(null == work.tm || 'number' === typeof work.tm)
    Assert(null == work.dn || 'string' === typeof work.dn)

    s.work_counter += 1
    work.id = work.id || '' + s.work_counter
    work.ge = self.id
    work.tm = null == work.tm ? options.timeout : work.tm

    work.dn = (work.dn ||
               work.fn.name ||
               '' + Date.now())

    q.push(work)

    if (s.running) {
      // Work items are **not** processed in the current execution path!
      // This prevents lockup, and avoids false positives in unit tests.
      // Work items are assumed to be inherently asynchronous.
      setImmediate(processor)
    }

    return self
  }

  // Create a new gate. Returns a new `GateExecutor` instance.  All
  // work items added to the new instance must complete before the
  // gate is cleared, and work items in the queue can be processed.  A
  // gate is cleared when the new instance is **first** cleared. Work
  // items subsequently added to the new instance are not considered
  // part of the gate. Gates can extend to any depth and form a tree
  // structure that requires breadth-first traversal in terms of the
  // work item queue. Gates do not have timeouts, and can only be
  // cleared when all added work items complete.
  self.gate = function () {
    var ge = new GateExecutor(options, instance_counter)

    var fn = function gate (done) {
      // This is the work function of the gate, which starts the new
      // instance, and considers the gate work item complete when the
      // work queue clears for the first time.
      ge.start(done)
    }

    self.add({gate: ge, fn: fn})

    return ge
  }

  // Return a data structure describing the current state of the work
  // queues, and organised as a tree structure indicating the gating
  // relationships.
  self.state = function () {
    var out = []

    // First list any in-progress work items.
    for (var hI = 0; hI < progress.history.length; ++hI) {
      var pe = progress.history[hI]
      if (!pe.done) {
        out.push({s: 'a', ge: pe.ge, d: pe.dn, id: pe.id})
      }
    }

    // Then list any waiting work items.
    for (var qI = 0; qI < q.length; ++qI) {
      var qe = q[qI]
      if (qe.gate) {
        // Go down a level when there's a gate.
        out.push(qe.gate.state())
      }
      else {
        out.push({s: 'w', ge: qe.ge, d: qe.dn, id: qe.id})
      }
    }

    out.internal = {
      qlen: q.length,
      hlen: progress.history.length,
      klen: Object.keys(progress.lookup).length,
      tlen: timeout_check.length
    }

    return out
  }
}

// The module function
module.exports = make_GateExecutor


text:
<?xml version="1.0" ?>
<tei>
	<teiHeader>
		<fileDesc xml:id="55005697"/>
	</teiHeader>
	<text xml:lang="en">
		<front>
<lb/>
	<docTitle>
	<titlePart>Detection of Polyps via Shape and Appearance Modeling<lb/></titlePart>
	</docTitle>

	<byline>
	<docAuthor>Paulo R. S. Mendonça,<lb/> 1 Rahul Bhotika,<lb/> 1 Fei Zhao,<lb/> 1<lb/> John Melonakos,<lb/> 2 and Saad Sirohey<lb/> 3<lb/></docAuthor>
	</byline>

	<byline>
	<affiliation>1 GE Global Research, One Research Circle,</affiliation>
	</byline>

	<address>Niskayuna, NY 12309, USA<lb/></address>

	<byline>
	<affiliation>2 School of ECE, Georgia Institute of Technology,</affiliation>
	</byline>

	<address>Atlanta, GA 30332, USA<lb/></address>

	<byline>
	<affiliation>3 GE Healthcare,</affiliation>
	</byline>

	<address>Waukesha, WI 53188, USA<lb/></address>

Abstract. This paper describes a CAD system for the detection of colorectal<lb/> polyps in CT. It is based on stochastic shape and appearance modeling of struc-<lb/>tures of the colon and rectum, in contrast to the data-driven approaches more<lb/> commonly found in the literature it derives predictive stochastic models for the<lb/> features used for classification. The method makes extensive use of medical do-<lb/>main knowledge in the design of the models and in the setting of their parameters.<lb/> The proposed approach was successfully tested on challenging datasets acquired<lb/> under a protocol with little colonic preparation; such protocol reduces patient<lb/> discomfort and potentially improves compliance.<lb/>

		</front>
	</text>
</tei>


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jada.ngeditor.controller.commands;

import jada.ngeditor.controller.Command;
import jada.ngeditor.controller.GUIEditor;
import jada.ngeditor.model.elements.GElement;
import java.awt.geom.Point2D;
import javax.swing.undo.AbstractUndoableEdit;
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoManager;

/**
 *
 * @author cris
 */
public class AddElementCommand extends AbstractUndoableEdit implements Command{
    private final GUIEditor editor;
    private GElement child;
    private Point2D point;
    private final UndoManager manager;
    private GElement parent;
    private boolean pointMode = false;

    public AddElementCommand(GUIEditor editor,UndoManager manager){
        this.editor = editor;
        this.manager = manager;
    }

    @Override
    public void redo() throws CannotRedoException {
        super.redo();
        if(pointMode){
            this.editor.addElement(child, point);
        }else{
            this.editor.addElement(child, parent);
        }
    }

    @Override
    public void undo() throws CannotUndoException {
        super.undo();
        this.editor.removeElement(child);
    }

    @Override
    public void perform() throws Exception {
        if(child == null || (point == null && pointMode) || (parent == null && !pointMode)){
            throw new IllegalStateException("No child or point to add");
        }
        if(pointMode){
            this.editor.addElement(child, point);
        }else{
            this.editor.addElement(child, parent);
        }
    }

    /**
     * @param child the child to set
     */
    public void setChild(GElement child) {
        this.child = child;
    }

    /**
     * @param point the point to set
     */
    public void setPoint(Point2D point) {
        pointMode = true;
        this.point = point;
    }

    public void setParent(GElement parent){
        pointMode= false;
        this.parent = parent;
    }

    public void setParentSelected(){
        this.setParent(editor.getGui().getSelection().getFirst());
    }

    @Override
    public boolean isActive() {
        return !(child == null || point == null);
    }

    @Override
    public String getName() {
        return "Add Element";
    }

}


text:
{% extends "caravel/datasource.html" %}

{% block viz %}
No data: review your incantations.
{% endblock %}


text:
package com.bumptech.glide.samples.gallery;

import android.Manifest.permission;
import android.annotation.TargetApi;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.ContextCompat;
import android.widget.Toast;
import com.bumptech.glide.MemoryCategory;

/**
 * Displays a {@link HorizontalGalleryFragment}.
 */
public class MainActivity extends FragmentActivity {

  private static final int REQUEST_READ_STORAGE = 0;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);
    GlideApp.get(this).setMemoryCategory(MemoryCategory.HIGH);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
        && ContextCompat.checkSelfPermission(this, permission.READ_EXTERNAL_STORAGE)
        != PackageManager.PERMISSION_GRANTED) {
      requestStoragePermission();
    } else {
      replaceFragment();
    }
  }

  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  private void requestStoragePermission() {
     ActivityCompat.requestPermissions(this,
        new String[]{permission.READ_EXTERNAL_STORAGE},
        REQUEST_READ_STORAGE);
  }

  private void replaceFragment() {
    Fragment fragment = new HorizontalGalleryFragment();
    getSupportFragmentManager()
        .beginTransaction()
        .replace(R.id.fragment_container, fragment)
        .commit();
  }

  @Override
  public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
      @NonNull int[] grantResults) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    switch (requestCode) {
      case REQUEST_READ_STORAGE: {
        // If request is cancelled, the result arrays are empty.
        if (grantResults.length > 0
            && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
          replaceFragment();
        } else {
          Toast.makeText(this, "Storage permission is required", Toast.LENGTH_LONG)
              .show();
          requestStoragePermission();
        }
      }
    }
  }
}


text:
Spring Boot Java example
========================

This simple app publishes and recevies messages using beetle.

To run it simply call in the directory:

```shell
mvn spring-boot:run
```


text:
#pragma once
#include <aws/quicksight/QuickSight_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace QuickSight
{
namespace Model
{

  /**
   *
A sheet, which is an object that contains a set of visuals that are
   * viewed together on one page in the Amazon QuickSight console. Every analysis and
   * dashboard contains at least one sheet. Each sheet contains at least one
   * visualization widget, for example a chart, pivot table, or narrative insight.
   * Sheets can be associated with other components, such as controls, filters, and
   * so on.

See Also:
   AWS
   * API Reference

   */
  class AWS_QUICKSIGHT_API Sheet
  {
  public:
    Sheet();
    Sheet(Aws::Utils::Json::JsonView jsonValue);
    Sheet& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The unique identifier associated with a sheet.

     */
    inline const Aws::String& GetSheetId() const{ return m_sheetId; }

    /**
     *
The unique identifier associated with a sheet.

     */
    inline bool SheetIdHasBeenSet() const { return m_sheetIdHasBeenSet; }

    /**
     *
The unique identifier associated with a sheet.

     */
    inline void SetSheetId(const Aws::String& value) { m_sheetIdHasBeenSet = true; m_sheetId = value; }

    /**
     *
The unique identifier associated with a sheet.

     */
    inline void SetSheetId(Aws::String&& value) { m_sheetIdHasBeenSet = true; m_sheetId = std::move(value); }

    /**
     *
The unique identifier associated with a sheet.

     */
    inline void SetSheetId(const char* value) { m_sheetIdHasBeenSet = true; m_sheetId.assign(value); }

    /**
     *
The unique identifier associated with a sheet.

     */
    inline Sheet& WithSheetId(const Aws::String& value) { SetSheetId(value); return *this;}

    /**
     *
The unique identifier associated with a sheet.

     */
    inline Sheet& WithSheetId(Aws::String&& value) { SetSheetId(std::move(value)); return *this;}

    /**
     *
The unique identifier associated with a sheet.

     */
    inline Sheet& WithSheetId(const char* value) { SetSheetId(value); return *this;}

    /**
     *
The name of a sheet. This name is displayed on the sheet's tab in the
     * QuickSight console.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
The name of a sheet. This name is displayed on the sheet's tab in the
     * QuickSight console.

     */
    inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }

    /**
     *
The name of a sheet. This name is displayed on the sheet's tab in the
     * QuickSight console.

     */
    inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }

    /**
     *
The name of a sheet. This name is displayed on the sheet's tab in the
     * QuickSight console.

     */
    inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }

    /**
     *
The name of a sheet. This name is displayed on the sheet's tab in the
     * QuickSight console.

     */
    inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }

    /**
     *
The name of a sheet. This name is displayed on the sheet's tab in the
     * QuickSight console.

     */
    inline Sheet& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
The name of a sheet. This name is displayed on the sheet's tab in the
     * QuickSight console.

     */
    inline Sheet& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
The name of a sheet. This name is displayed on the sheet's tab in the
     * QuickSight console.

     */
    inline Sheet& WithName(const char* value) { SetName(value); return *this;}

  private:

    Aws::String m_sheetId;
    bool m_sheetIdHasBeenSet;

    Aws::String m_name;
    bool m_nameHasBeenSet;
  };

} // namespace Model
} // namespace QuickSight
} // namespace Aws


text:
@implementation DatabaseListViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    @weakify(self);
    [RACObserve(self, databases) subscribeNext:^(id x) {
        @strongify(self);
        [self.tableView reloadData];
    }];

    [[[[TRDClientManager sharedManager].client fetchAllDatabases] collect]
      subscribeNext:^(NSArray *databases) {
          @strongify(self);
          self.databases = databases;
      } error:^(NSError *error) {
          @strongify(self);
          [self showError:error];
      }
    ];
}

- (RACSignal *)fetchJobsWithDatabase:(TRDDatabase *)database
{
    return [[[TRDClientManager sharedManager].client fetchJobsWithDatabase:database.name] collect];
}

- (void)showError:(NSError *)error
{
    [[[UIAlertView alloc] initWithTitle:@"Error"
                                message:error.description
                               delegate:nil
                      cancelButtonTitle:@"OK"
                      otherButtonTitles:nil] show];
}

#pragma mark - UITableView delegates

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.databases count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIdentifier = @"DatabaseCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                      reuseIdentifier:cellIdentifier];
    }
    cell.textLabel.text = ((TRDDatabase *)self.databases[indexPath.row]).name;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        @weakify(self);
        TRDDatabase *database = self.databases[indexPath.row];
        [[self fetchJobsWithDatabase:database] subscribeNext:^(NSArray *jobs) {
            @strongify(self)
            JobListViewController *jobListViewController = [self.splitViewController.viewControllers lastObject];
            jobListViewController.jobs = jobs;
        }];
    } else {
        [self performSegueWithIdentifier:@"ShowJobsInDatabase" sender:self];
    }
}

#pragma mark - Segue

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    TRDDatabase *database = self.databases[self.tableView.indexPathForSelectedRow.row];
    [[self fetchJobsWithDatabase:database] subscribeNext:^(NSArray *jobs) {
        JobListViewController *jobListViewController = segue.destinationViewController;
        jobListViewController.jobs = jobs;
        jobListViewController.navigationItem.title = database.name;
    }];
}

@end


text:
import {Injectable} from 'angular2/core';
import {Http, Headers} from 'angular2/http';
import {UrlConstants} from '../url_constants';
import {Permission, Role, Resource, Page, TableDef, ColumnDef} from '../../models/core/core';
import {Observable} from 'rxjs/Observable';

@Injectable()
export class TableDefService {

  constructor(private http: Http) { }

  findOne(id: number): TableDef {

  }

  save(tableDef: TableDef): TableDef {

  }
}


text:
/*!
  \file     RemoveSmallClusters.h
  \author   Tody
  RemoveSmallClusters definition.
  \date     2016/03/07
*/

#ifndef REMOVESMALLCLUSTERS_H
#define REMOVESMALLCLUSTERS_H

#include "Eigen/Dense"
#include "Eigen/Sparse"

//! RemoveSmallClusters implementation.
class RemoveSmallClusters
{
public :
    //! Constructor.
    RemoveSmallClusters ( const Eigen::VectorXi& clusterIDs, const Eigen::VectorXd& Area_f, const Eigen::SparseMatrix<double>& M )
    {
        _Area_f = Area_f;
        _M = M;
        _clusterIDs = clusterIDs;
        compute();
    }

    //! Destructor.
    virtual ~RemoveSmallClusters() {}

    //! Out clusterIDs.
    const Eigen::VectorXi clusterIDs() const { return _clusterIDs;}

private:
    void compute();

    void computeClusterAreas ( Eigen::VectorXd& Area_c );

    void removeSmallClusters ( const Eigen::VectorXd& Area_c );

    void optimizeWeight();

    void computeWeightConstraint ( Eigen::SparseMatrix<double>& A, Eigen::MatrixXd& b );

private:
    Eigen::VectorXi _clusterIDs;
    Eigen::VectorXd _Area_f;
    Eigen::SparseMatrix<double> _M;
};

#endif


text:
require 'octokit'

module Bunto
  unless const_defined? :Errors
    module Errors
      FatalException = Class.new(::RuntimeError) unless const_defined? :FatalException
    end
  end

  module GitHubMetadata
    NoRepositoryError = Class.new(Bunto::Errors::FatalException)

    autoload :Client,     'bunto-github-metadata/client'
    autoload :Pages,      'bunto-github-metadata/pages'
    autoload :Repository, 'bunto-github-metadata/repository'
    autoload :Sanitizer,  'bunto-github-metadata/sanitizer'
    autoload :Value,      'bunto-github-metadata/value'
    autoload :VERSION,    'bunto-github-metadata/version'

    class << self
      attr_accessor :repository
      attr_writer :client

      def environment
        Bunto.respond_to?(:env) ? Bunto.env : (Pages.env || 'development')
      end

      def client
        @client ||= Client.new
      end

      def values
        @values ||= Hash.new
      end
      alias_method :to_h, :values
      alias_method :to_liquid, :to_h

      def clear_values!
        @values = Hash.new
      end

      def reset!
        clear_values!
        @client = nil
        @repository = nil
      end

      def [](key)
        values[key.to_s]
      end

      def register_value(key, value)
        values[key.to_s] = Value.new(key.to_s, value)
      end

      # Reset our values hash.
      def init!
        clear_values!

        # Environment-Specific
        register_value('environment', proc { Pages.env })
        register_value('hostname', proc { Pages.github_hostname })
        register_value('pages_env', proc { Pages.env })
        register_value('pages_hostname', proc { Pages.pages_hostname })
        register_value('api_url', proc { Pages.api_url })
        register_value('help_url', proc { Pages.help_url })

        register_value('versions', proc {
          begin
            require 'github-pages'
            GitHubPages.versions
          rescue LoadError; Hash.new end
        })

        # The Juicy Stuff
        register_value('public_repositories',  proc { |_,r| r.owner_public_repositories })
        register_value('organization_members', proc { |_,r| r.organization_public_members })
        register_value('build_revision',       proc {
          ENV['BUNTO_BUILD_REVISION'] || `git rev-parse HEAD`.strip
        })
        register_value('project_title',        proc { |_,r| r.name })
        register_value('project_tagline',      proc { |_,r| r.tagline })
        register_value('owner_name',           proc { |_,r| r.owner })
        register_value('owner_url',            proc { |_,r| r.owner_url })
        register_value('owner_gravatar_url',   proc { |_,r| r.owner_gravatar_url })
        register_value('repository_url',       proc { |_,r| r.repository_url })
        register_value('repository_nwo',       proc { |_,r| r.nwo })
        register_value('repository_name',      proc { |_,r| r.name})
        register_value('zip_url',              proc { |_,r| r.zip_url })
        register_value('tar_url',              proc { |_,r| r.tar_url })
        register_value('clone_url',            proc { |_,r| r.repo_clone_url })
        register_value('releases_url',         proc { |_,r| r.releases_url })
        register_value('issues_url',           proc { |_,r| r.issues_url })
        register_value('wiki_url',             proc { |_,r| r.wiki_url })
        register_value('language',             proc { |_,r| r.language })
        register_value('is_user_page',         proc { |_,r| r.user_page? })
        register_value('is_project_page',      proc { |_,r| r.project_page? })
        register_value('show_downloads',       proc { |_,r| r.show_downloads? })
        register_value('url',                  proc { |_,r| r.pages_url })
        register_value('contributors',         proc { |_,r| r.contributors })
        register_value('releases',             proc { |_,r| r.releases })

        values
      end

      if Bunto.const_defined? :Site
        require_relative 'bunto-github-metadata/ghp_metadata_generator'
      end
    end

    init!
  end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>Code Igniter User Guide</title>

<link rel='stylesheet' type='text/css' media='all' href='../docs.css' />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />
<meta name='author' content='Rick Ellis' />
<meta name='description' content='Code Igniter User Guide' />

Code Igniter User Guide Version 1.0

Code Igniter Home  ›
User Guide Home  ›
Goals

Full Table of Contents

Design and Architectural Goals

Our goal for Code Igniter is <dfn>maximum performance, capability, and flexibility in the smallest, lightest possible package</dfn>.

To meet this goal we are committed to benchmarking, re-factoring, and simplifying at every step of the development process,
rejecting anything that doesn't further the stated objective.

From an technical and architectural standpoint, Code Igniter was created with the following objectives:

Dynamic Instantiation.  In Code Igniter, components are loaded and routines executed only when requested, rather than globally.  No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default.  The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.

Loose Coupling.  Coupling is the degree to which components of a system rely on each other.  The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.

Component Singularity.  Singularity is the degree to which components have a narrowly focused purpose.  In Code Igniter, each class and its functions are highly autonomous in order to allow maximum usefulness.

Code Igniter is a dynamically instantiated, loosely coupled system with high component singularity. It strives for simplicity, flexibility, and high performance in a small footprint package.

Top of Page  ·  User Guide Home

Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.


text:
/**
* @file surgeonCaseDetailExamination.controller.js
* @namespace nocc.surgeon.controllers
* @author    abidibo <abidibo@gmail.com>
*/
(function () {
    'use strict';

    angular
        .module('nocc.surgeon.controllers')
        .controller('SurgeonCaseDetailExaminationCtrl', SurgeonCaseDetailExaminationCtrl);

    SurgeonCaseDetailExaminationCtrl.$inject = ['$scope', '$state', 'examinationService', 'followupService', 'dialogs', 'request', 'STATUS', 'FU_STATUS_DICT', 'FU_TYPE_DICT'];

    /**
     * @namespace SurgeonCaseDetailExaminationCtrl
     * @description Controller of the surgeon case detail view, examinations
     * @permissions isSurgeonCase
     */
    function SurgeonCaseDetailExaminationCtrl($scope, $state, examinationService, followupService, dialogs, request, STATUS, FU_STATUS_DICT, FU_TYPE_DICT) {

        var vm = this;
        vm.caseObj = $scope.model.caseObj;
        vm.can_edit_initial = false;

        vm.activeTab_initial = false;
        vm.activeTab_followup = false;
        vm.activeTab_adj = false;
        vm.activeTab_final = false;
        vm['activeTab_' + $state.params.activeTab] = true;

        vm.examinations = [];
        vm.fu_examinations = [];
        vm.adj_examinations = [];
        vm.final_examinations = [];

        examinationService.list(vm.caseObj.id).then(function(response) {
            response.data.forEach(function(e) {
                if(e.follow_up) {
                    if(e.follow_up_obj.type == FU_TYPE_DICT.adjuvant) {
                        vm.adj_examinations.push(e);
                    }
                    else if(e.follow_up_obj.type == FU_TYPE_DICT.final) {
                        vm.final_examinations.push(e);
                    }
                    else {
                        vm.fu_examinations.push(e);
                    }
                }
                else {
                    vm.examinations.push(e);
                }
            });
        }, function() {
            // @TODO
            console.log('error');
        });

        // reset actions bar
        $scope.bar.actions = [];

        vm.openExaminationText = function(examination) {
            dialogs.notify('Referto', examination.text);
        };

        if(vm.caseObj.status === STATUS.open) {
            surgeonCaseDetailExaminationCtrlActive({can_edit_initial: true}, vm, $scope, dialogs, examinationService);
        }
        else if(vm.caseObj.status === STATUS.started) {
            followupService.list(vm.caseObj.id, FU_TYPE_DICT.initial, [FU_STATUS_DICT.accepted]).then(function(response) {
                if(response.data.length) {
                    vm.followups = response.data;
                    surgeonCaseDetailExaminationCtrlActive({can_edit_followup: true}, vm, $scope, dialogs, examinationService);
                }
            });
        }
        else if(vm.caseObj.status === STATUS.adjuvant_started) {
            followupService.list(vm.caseObj.id, FU_TYPE_DICT.adjuvant, [FU_STATUS_DICT.accepted]).then(function(response) {
                if(response.data.length) {
                    vm.followups = response.data;
                    surgeonCaseDetailExaminationCtrlActive({can_edit_adjuvant: true}, vm, $scope, dialogs, examinationService);
                }
            });
        }
        else if(vm.caseObj.status === STATUS.ended) {
            followupService.list(vm.caseObj.id, FU_TYPE_DICT.final, [FU_STATUS_DICT.accepted]).then(function(response) {
                if(response.data.length) {
                    vm.followups = response.data;
                    surgeonCaseDetailExaminationCtrlActive({can_edit_final: true}, vm, $scope, dialogs, examinationService);
                }
            });
        }

    }

    /**
     * Open status
     */
    function surgeonCaseDetailExaminationCtrlActive(opts, vm, $scope, dialogs, examinationService) {

        vm.can_edit_initial = typeof opts['can_edit_initial'] === 'undefined' ? false : opts['can_edit_initial'];
        vm.can_edit_followup = typeof opts['can_edit_followup'] === 'undefined' ? false : opts['can_edit_followup'];
        vm.can_edit_adjuvant = typeof opts['can_edit_adjuvant'] === 'undefined' ? false : opts['can_edit_adjuvant'];
        vm.can_edit_final = typeof opts['can_edit_final'] === 'undefined' ? false : opts['can_edit_final'];

        vm.canEdit = function(examination) {
            if(vm.can_edit_initial && !examination.follow_up) {
                return true;
            }
            if((vm.can_edit_followup || vm.can_edit_adjuvant || vm.can_edit_final) && examination.follow_up) {
                return true;
            }

            return false;
        };

        vm.addEditExamination = function(examination, followup) {
            var exsl;
            var obj = {
                ctrl: vm,
                examination: examination
            };
            if(vm.can_edit_followup) {
                obj.exsl = 'fu_examinations';
                obj.followups = vm.followups;
            }
            else if(vm.can_edit_adjuvant) {
                obj.exsl = 'adj_examinations';
                obj.followups = vm.followups;
            }
            else if(vm.can_edit_final) {
                obj.exsl = 'final_examinations';
                obj.followups = vm.followups;
            }
            else {
                obj.exsl = 'examinations';
            }
            dialogs.create(
                'surgeon/templates/add_examination.tpl.html',
                'SurgeonAddEditExaminationCtrl',
                obj,
                { copy: false }
            );
        };

        /**
         * @summary Opens a dialog displaying a confirmation message and deletes the examinaion if the user confirms
         * @param {Object} examination
         */
        vm.confirmAndDeleteExamination = function(examination) {
            var dlg = dialogs.confirm('Sicuro di voler eliminare l\'esame clinico?', '', { size: 'sm' });
            dlg.result.then(function(btn){
                examinationService.kill(vm.caseObj.id, examination.id).then(
                    function() {
                        if(vm.can_edit_followup) {
                            vm.fu_examinations.splice(vm.fu_examinations.indexOf(examination), 1);
                        }
                        else {
                            vm.examinations.splice(vm.examinations.indexOf(examination), 1);
                        }
                    },
                    function() {
                        console.log('error'); // @TODO
                    }
                );
            },function(btn){
                // cancel
            });
        };

        $scope.bar.actions = [
            {
                fa: 'plus-circle',
                exec: vm.addEditExamination
            }
        ];

    }

})();


text:
package com.streamsets.datacollector.credential.aws.secrets.manager;

import com.amazonaws.secretsmanager.caching.SecretCache;
import com.amazonaws.services.secretsmanager.model.AWSSecretsManagerException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.streamsets.pipeline.api.StageException;
import com.streamsets.pipeline.api.credential.CredentialValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Map;

public class AWSSecretsManagerCredentialValue implements CredentialValue {

  private static final Logger LOG = LoggerFactory.getLogger(AWSSecretsManagerCredentialValue.class);

  private final String name;
  private final String key;
  private final boolean alwaysRefresh;
  private final SecretCache secretCache;

  AWSSecretsManagerCredentialValue(
      String name, String key, boolean alwaysRefresh, SecretCache secretCache
  ) {
    this.name = name;
    this.key = key;
    this.alwaysRefresh = alwaysRefresh;
    this.secretCache = secretCache;
    LOG.debug(
        "Created AWSSecretsManagerCredentialValue with name '{}', key '{}', and alwaysRefresh '{}'",
        name,
        key,
        alwaysRefresh
    );
  }

  @Override
  public String get() {
    if (alwaysRefresh) {
      try {
        LOG.trace("Force refreshing '{}'", name);
        secretCache.refreshNow(name);
      } catch (InterruptedException ie) {
        LOG.warn("Encountered InterruptedException while refreshing credential '{}'", name, ie);
      }
    }
    try {
      String json = secretCache.getSecretString(name);
      if (json == null) {
        throw new StageException(Errors.AWS_SECRETS_MANAGER_CRED_STORE_02, name);
      }
      return parseJSONAndGetValue(json, key, name);

    } catch (AWSSecretsManagerException ex) {
      throw new StageException(Errors.AWS_SECRETS_MANAGER_CRED_STORE_03, name, ex);
    }
  }

  @Override
  public String toString() {
    return "AWSSecretsManagerCredentialValue{name='".concat(name).concat("', key='").concat(key).concat("', " +
        "alwaysRefresh=").concat(String.valueOf(alwaysRefresh)).concat("'}");
  }

  private static String parseJSONAndGetValue(String json, String key, String name) {
    try {
      ObjectMapper mapper = new ObjectMapper();
      Map<String, Object> map = mapper.readValue(json, Map.class);
      String value = map.get(key) == null ? null : map.get(key).toString();
      if (value == null) {
        throw new StageException(Errors.AWS_SECRETS_MANAGER_CRED_STORE_04, key, name);
      }
      return value;
    } catch (IOException ioe) {
      throw new StageException(Errors.AWS_SECRETS_MANAGER_CRED_STORE_04, key, name, ioe);
    }
  }
}


text:
FROM httpd:alpine
LABEL author="Nicola Worthington <nicolaw@tfb.net>"

ENV TC_JSON_API_PORT 8081
ENV TC_JSON_API_URL "location.protocol + '//' + location.hostname + ':' + '${TC_JSON_API_PORT}' + '/public/index.php/'"
ENV HEALTHCHECK_URL http://localhost:80/Keira2/index.html

# Add packages.
RUN apk add --no-cache git curl

# Install Keira2 according to https://github.com/Helias/Keira2.
RUN git clone --depth 1 --single-branch  https://github.com/Helias/Keira2.git /usr/local/apache2/htdocs/Keira2
RUN sed -r -e 's@^(\s*app\.defaultAPI\s*=\s*).+;@\1'"${TC_JSON_API_URL}"';@g;' \
  < /usr/local/apache2/htdocs/Keira2/config.js.dist \
  > /usr/local/apache2/htdocs/Keira2/config.js
COPY index.html "/usr/local/apache2/htdocs/index.html"
COPY htaccess "/usr/local/apache2/htdocs/.htaccess"

# https://github.com/moby/moby/pull/33249
HEALTHCHECK --interval=60s --timeout=3s --retries=3 --start-period=30s \
  CMD curl -sSLIf "${HEALTHCHECK_URL}" || exit 1


text:
===============
TPCDS Connector
===============

The TPCDS connector provides a set of schemas to support the TPC
Benchmark™ DS (TPC-DS). TPC-DS is a database benchmark used to measure the
performance of complex decision support databases.

This connector can also be used to test the capabilities and query
syntax of Presto without configuring access to an external data
source. When you query a TPCDS schema, the connector generates the
data on the fly using a deterministic algorithm.

Configuration
-------------

To configure the TPCDS connector, create a catalog properties file
``etc/catalog/tpcds.properties`` with the following contents:

.. code-block:: none

    connector.name=tpcds

TPCDS Schemas
-------------

The TPCDS connector supplies several schemas::

    SHOW SCHEMAS FROM tpcds;

.. code-block:: none

           Schema
    --------------------
     information_schema
     sf1
     sf10
     sf100
     sf1000
     sf10000
     sf100000
     sf300
     sf3000
     sf30000
     tiny
    (11 rows)

Ignore the standard schema ``information_schema`` which exists in every
catalog and is not directly provided by the TPCDS connector.

Every TPCDS schema provides the same set of tables. Some tables are
identical in all schemas. The *scale factor* of the tables in a particular
schema is determined from the schema name. For example, the schema
``sf1`` corresponds to scale factor ``1`` and the schema ``sf300``
corresponds to scale factor ``300``. Every unit in the scale factor
corresponds to a gigabyte of data. For example, for scale factor ``300``,
a total of ``300`` gigabytes will be generated. The ``tiny`` schema is an
alias for scale factor ``0.01``, which is a very small data set useful for
testing.


text: from traitsui.wx.compound_editor import *


text:
import { TextBase } from '../text-base';
import { EventData } from '../../data/observable';

/**
 * Represents a standard Button widget.
 */
export class Button extends TextBase {
	/**
	 * String value used when hooking to tap event.
	 */
	public static tapEvent: string;

	/**
	 * Gets the native [android widget](http://developer.android.com/reference/android/widget/Button.html) that represents the user interface for this component. Valid only when running on Android OS.
	 */
	android: any /* android.widget.Button */;

	/**
	 * Gets the native [UIButton](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIButton_Class/) that represents the user interface for this component. Valid only when running on iOS.
	 */
	ios: any /* UIButton */;

	/**
	 * Gets or sets whether the Button wraps text or not.
	 */
	textWrap: boolean;

	/**
	 * A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
	 * @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
	 * @param callback - Callback function which will be executed when event is raised.
	 * @param thisArg - An optional parameter which will be used as `this` context for callback execution.
	 */
	on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);

	/**
	 * Raised when a tap event occurs.
	 */
	on(event: 'tap', callback: (args: EventData) => void, thisArg?: any);
}


text: DEPRECATED (moved to tendermint/tmlibs): Common go functions


text:
layout: post
title: "Drupal revealed as 2008 open source CMS award winner"
author: hoatle
date: 2008-11-06 22:21
comments: true
categories:
    - "en"
tags:
    - "drupal"
    - "cms"
    - "award"
    - "winner"
cover:
description:
keywords:
published: true
---

Packt's annual Open Source Content Management System (CMS) Award reached its climax today with the announcement that Drupal has won the Overall category, collecting a first prize of $5,000. Three months after it was launched and a staggering 20,000 votes later, Drupal finished ahead of Joomla! and DotNetNuke to retain the Award it won in 2007.

<!-- more -->

Released as an Open Source project by founder Dries Buytaert in 2001, Drupal has grown substantially and has been downloaded almost 1.5 million times in the last 12 months. It is currently being applied by companies such as Warner Brothers Music, MTV UK, and the New York Observer amongst others.

"These awards are a testament to the valuable contributions from dedicated Drupal community members around the globe" said Buytaert in response to the news. "Working together, the Drupal community is building the future of the dynamic web so that anyone can quickly build great social publishing websites" he concluded.

With votes coming from a panel of industry experts and visitors to Packt's website, this year's Awards proved to be the most popular and also the highest quality. The task of selecting a top three from the finalists was a difficult one for the judges due to their high standards and myriad features.

Finishing in second place and receiving $3,000 was Joomla!, the youngest of the three finalists and a previous winner of the Overall Award. Judges were impressed with Joomla's ease of installation and ability to get a website up-and-running in a short space of time. Particular praise was reserved for its sizeable and enthusiastic community, which has allowed the project to grow so quickly in such a short space of time.

In third place and receiving $2,000 was DotNetNuke, the only CMS in the final that is written in VB.NET for the ASP.NET framework. DotNetNuke received positive feedback from judges who were impressed with its ease of development and security implementation features.

Alongside the Overall Award, Packt ran categories for best Open Source PHP Content Management System and best Open Source CMS that isn't written in PHP. The final category was the Most Promising Open Source CMS, which was won by SilverStripe. Packt handed out a total of $20,000 in prize money to the winning Content Management Systems.

Winners in the other final categories include:

* Most Promising: **SilverStripe**
* Best Open Source PHP: **Drupal**
* Best non PHP Open Source CMS: **Plone**

The Awards were designed to recognize and reward Open Source CMS's for their consistently high standards in what is an extremely competitive field. The result of this year's Award confirms this quality and also suggests that there isn't necessarily one CMS that is the best, more that there is the best one to fit an individual user's needs and requirements.

Full results of the 2008 Open Source CMS Award can be found at http://www.PacktPub.com/Award