text:
#include "bus_if.h"
#include <sys/eventhandler.h>
#include <sys/sysctl.h>
#if __FreeBSD_version >= 500000
#include <sys/lock.h>
#include <sys/mutex.h>
#endif

#include <machine/bus.h>
#include <machine/resource.h>

struct acpi_softc {
    device_t		acpi_dev;
    dev_t		acpi_dev_t;

    struct resource	*acpi_irq;
    int			acpi_irq_rid;
    void		*acpi_irq_handle;

    int			acpi_enabled;
    int			acpi_sstate;
    int			acpi_sleep_disabled;

    struct sysctl_ctx_list acpi_sysctl_ctx;
    struct sysctl_oid	*acpi_sysctl_tree;
#define ACPI_POWER_BUTTON_DEFAULT_SX	ACPI_STATE_S5;
#define ACPI_SLEEP_BUTTON_DEFAULT_SX	ACPI_STATE_S1;
#define ACPI_LID_SWITCH_DEFAULT_SX	ACPI_STATE_S1;
    int			acpi_power_button_sx;
    int			acpi_sleep_button_sx;
    int			acpi_lid_switch_sx;

    int			acpi_standby_sx;
    int			acpi_suspend_sx;

    int			acpi_sleep_delay;
    int			acpi_s4bios;
    int			acpi_disable_on_poweroff;

    int			acpi_verbose;

    bus_dma_tag_t	acpi_waketag;
    bus_dmamap_t	acpi_wakemap;
    vm_offset_t		acpi_wakeaddr;
    vm_paddr_t		acpi_wakephys;

    struct sysctl_ctx_list	 acpi_battery_sysctl_ctx;
    struct sysctl_oid		*acpi_battery_sysctl_tree;
};

struct acpi_device {
    /* ACPI ivars */
    ACPI_HANDLE			ad_handle;
    int				ad_magic;
    void			*ad_private;

    /* resources */
    struct resource_list	ad_rl;

};

#if __FreeBSD_version < 500000
/*
 * In 4.x, ACPI is protected by splhigh().
 */
# define ACPI_LOCK			s = splhigh()
# define ACPI_UNLOCK			splx(s)
# define ACPI_ASSERTLOCK
# define ACPI_MSLEEP(a, b, c, d, e)	tsleep(a, c, d, e)
# define ACPI_LOCK_DECL			int s
# define kthread_create(a, b, c, d, e, f)	kthread_create(a, b, c, f)
# define tc_init(a)			init_timecounter(a)
#elif 0
/*
 * The ACPI subsystem lives under a single mutex.  You *must*
 * acquire this mutex before calling any of the acpi_ or Acpi* functions.
 */
extern struct mtx	acpi_mutex;
# define ACPI_LOCK			mtx_lock(&acpi_mutex)
# define ACPI_UNLOCK			mtx_unlock(&acpi_mutex)
# define ACPI_ASSERTLOCK		mtx_assert(&acpi_mutex, MA_OWNED)
# define ACPI_MSLEEP(a, b, c, d, e)	msleep(a, b, c, d, e)
# define ACPI_LOCK_DECL
#else
# define ACPI_LOCK
# define ACPI_UNLOCK
# define ACPI_ASSERTLOCK
# define ACPI_MSLEEP(a, b, c, d, e)	tsleep(a, c, d, e)
# define ACPI_LOCK_DECL
#endif

/*
 * ACPI CA does not define layers for non-ACPI CA drivers.
 * We define some here within the range provided.
 */
#define	ACPI_BUS		0x00010000
#define	ACPI_SYSTEM		0x00020000
#define	ACPI_POWER		0x00040000
#define	ACPI_EC			0x00080000
#define	ACPI_AC_ADAPTER		0x00100000
#define	ACPI_BATTERY		0x00110000
#define	ACPI_BUTTON		0x00120000
#define	ACPI_PROCESSOR		0x00140000
#define	ACPI_THERMAL		0x00180000
#define	ACPI_FAN		0x00200000

/*
 * Constants for different interrupt models used with acpi_SetIntrModel().
 */
#define	ACPI_INTR_PIC		0
#define	ACPI_INTR_APIC		1
#define	ACPI_INTR_SAPIC		2

/* XXX this is no longer referenced anywhere, remove? */
#if 0
/*
 * This is a cheap and nasty way to get around the horrid counted list
 * argument format that AcpiEvalateObject uses.
 */
#define ACPI_OBJECTLIST_MAX	16
struct acpi_object_list {
    UINT32	count;
    ACPI_OBJECT	*pointer[ACPI_OBJECTLIST_MAX];
    ACPI_OBJECT	object[ACPI_OBJECTLIST_MAX];
};

static __inline struct acpi_object_list *
acpi_AllocObjectList(int nobj)
{
    struct acpi_object_list	*l;
    int				i;

    if (nobj > ACPI_OBJECTLIST_MAX)
	return(NULL);
    if ((l = AcpiOsAllocate(sizeof(*l))) == NULL)
	return(NULL);
    bzero(l, sizeof(*l));
    for (i = 0; i < ACPI_OBJECTLIST_MAX; i++)
	l->pointer[i] = &l->object[i];
    l->count = nobj;
    return(l);
}
#endif /* unused */

/*
 * Note that the low ivar values are reserved to provide
 * interface compatibility with ISA drivers which can also
 * attach to ACPI.
 */
#define ACPI_IVAR_HANDLE	0x100
#define ACPI_IVAR_MAGIC		0x101
#define ACPI_IVAR_PRIVATE	0x102

static __inline ACPI_HANDLE
acpi_get_handle(device_t dev)
{
    uintptr_t up;
    ACPI_HANDLE	h;

    if (BUS_READ_IVAR(device_get_parent(dev), dev, ACPI_IVAR_HANDLE, &up))
	return(NULL);
    h = (ACPI_HANDLE)up;
    return(h);
}

static __inline int
acpi_set_handle(device_t dev, ACPI_HANDLE h)
{
    uintptr_t up;

    up = (uintptr_t)h;
    return(BUS_WRITE_IVAR(device_get_parent(dev), dev, ACPI_IVAR_HANDLE, up));
}

static __inline int
acpi_get_magic(device_t dev)
{
    uintptr_t up;
    int	m;

    if (BUS_READ_IVAR(device_get_parent(dev), dev, ACPI_IVAR_MAGIC, &up))
	return(0);
    m = (int)up;
    return(m);
}

static __inline int
acpi_set_magic(device_t dev, int m)
{
    uintptr_t up;

    up = (uintptr_t)m;
    return(BUS_WRITE_IVAR(device_get_parent(dev), dev, ACPI_IVAR_MAGIC, up));
}

static __inline void *
acpi_get_private(device_t dev)
{
    uintptr_t up;
    void *p;

    if (BUS_READ_IVAR(device_get_parent(dev), dev, ACPI_IVAR_PRIVATE, &up))
	return(NULL);
    p = (void *)up;
    return(p);
}

static __inline int
acpi_set_private(device_t dev, void *p)
{
    uintptr_t up;

    up = (uintptr_t)p;
    return(BUS_WRITE_IVAR(device_get_parent(dev), dev, ACPI_IVAR_PRIVATE, up));
}

static __inline ACPI_OBJECT_TYPE
acpi_get_type(device_t dev)
{
    ACPI_HANDLE		h;
    ACPI_OBJECT_TYPE	t;

    if ((h = acpi_get_handle(dev)) == NULL)
	return(ACPI_TYPE_NOT_FOUND);
    if (AcpiGetType(h, &t) != AE_OK)
	return(ACPI_TYPE_NOT_FOUND);
    return(t);
}

#ifdef ACPI_DEBUGGER
extern void		acpi_EnterDebugger(void);
#endif

#ifdef ACPI_DEBUG
#include <sys/cons.h>
#define STEP(x)		do {printf x, printf("\n"); cngetc();} while (0)
#else
#define STEP(x)
#endif

#define ACPI_VPRINT(dev, acpi_sc, x...) do {				\
	if (acpi_get_verbose(acpi_sc))					\
		device_printf(dev, x);					\
} while (0)

#define ACPI_DEVINFO_PRESENT(x)	(((x) & 0x9) == 9)
extern BOOLEAN		acpi_DeviceIsPresent(device_t dev);
extern BOOLEAN		acpi_BatteryIsPresent(device_t dev);
extern BOOLEAN		acpi_MatchHid(device_t dev, char *hid);
extern ACPI_STATUS	acpi_GetHandleInScope(ACPI_HANDLE parent, char *path, ACPI_HANDLE *result);
extern ACPI_BUFFER	*acpi_AllocBuffer(int size);
extern ACPI_STATUS	acpi_EvaluateInteger(ACPI_HANDLE handle, char *path, int *number);
extern ACPI_STATUS	acpi_ConvertBufferToInteger(ACPI_BUFFER *bufp, int *number);
extern ACPI_STATUS	acpi_ForeachPackageObject(ACPI_OBJECT *obj,
						  void (* func)(ACPI_OBJECT *comp, void *arg),
						  void *arg);
extern ACPI_STATUS	acpi_FindIndexedResource(ACPI_BUFFER *buf, int index, ACPI_RESOURCE **resp);
extern ACPI_STATUS	acpi_AppendBufferResource(ACPI_BUFFER *buf, ACPI_RESOURCE *res);
extern ACPI_STATUS	acpi_SetIntrModel(int model);

extern ACPI_STATUS	acpi_SetSleepState(struct acpi_softc *sc, int state);
extern ACPI_STATUS	acpi_Enable(struct acpi_softc *sc);
extern ACPI_STATUS	acpi_Disable(struct acpi_softc *sc);

struct acpi_parse_resource_set {
    void	(* set_init)(device_t dev, void **context);
    void	(* set_done)(device_t dev, void *context);
    void	(* set_ioport)(device_t dev, void *context, u_int32_t base, u_int32_t length);
    void	(* set_iorange)(device_t dev, void *context, u_int32_t low, u_int32_t high,
				u_int32_t length, u_int32_t align);
    void	(* set_memory)(device_t dev, void *context, u_int32_t base, u_int32_t length);
    void	(* set_memoryrange)(device_t dev, void *context, u_int32_t low, u_int32_t high,
				    u_int32_t length, u_int32_t align);
    void	(* set_irq)(device_t dev, void *context, u_int32_t *irq, int cout);
    void	(* set_drq)(device_t dev, void *context, u_int32_t *drq, int count);
    void	(* set_start_dependant)(device_t dev, void *context, int preference);
    void	(* set_end_dependant)(device_t dev, void *context);
};

extern struct acpi_parse_resource_set	acpi_res_parse_set;
extern ACPI_STATUS	acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
					     struct acpi_parse_resource_set *set);
/* XXX until Intel fix this in their headers, based on NEXT_RESOURCE */
#define ACPI_RESOURCE_NEXT(Res)      (ACPI_RESOURCE *)((UINT8 *) Res + Res->Length)

/*
 * ACPI event handling
 */
extern UINT32		acpi_eventhandler_power_button_for_sleep(void *context);
extern UINT32		acpi_eventhandler_power_button_for_wakeup(void *context);
extern UINT32		acpi_eventhandler_sleep_button_for_sleep(void *context);
extern UINT32		acpi_eventhandler_sleep_button_for_wakeup(void *context);

#define ACPI_EVENT_PRI_FIRST      0
#define ACPI_EVENT_PRI_DEFAULT    10000
#define ACPI_EVENT_PRI_LAST       20000

typedef void (*acpi_event_handler_t)(void *, int);

EVENTHANDLER_DECLARE(acpi_sleep_event, acpi_event_handler_t);
EVENTHANDLER_DECLARE(acpi_wakeup_event, acpi_event_handler_t);

/*
 * Device power control.
 */
extern ACPI_STATUS	acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state);

/*
 * Misc.
 */
static __inline struct acpi_softc *
acpi_device_get_parent_softc(device_t child)
{
    device_t	parent;

    parent = device_get_parent(child);
    if (parent == NULL) {
	return(NULL);
    }
    return(device_get_softc(parent));
}

static __inline int
acpi_get_verbose(struct acpi_softc *sc)
{
    if (sc)
	return(sc->acpi_verbose);
    return(0);
}

extern char	*acpi_name(ACPI_HANDLE handle);
extern int	acpi_avoid(ACPI_HANDLE handle);
extern int	acpi_disabled(char *subsys);

extern void	acpi_device_enable_wake_capability(ACPI_HANDLE h, int enable);
extern void	acpi_device_enable_wake_event(ACPI_HANDLE h);

extern int	acpi_machdep_init(device_t dev);
extern void	acpi_install_wakeup_handler(struct acpi_softc *sc);
extern int	acpi_sleep_machdep(struct acpi_softc *sc, int state);

/*
 * Battery Abstraction.
 */
struct acpi_battinfo;
struct acpi_battdesc;

extern int	acpi_battery_register(int, int);
extern int	acpi_battery_get_battinfo(int, struct acpi_battinfo *);
extern int	acpi_battery_get_units(void);
extern int	acpi_battery_get_info_expire(void);
extern int	acpi_battery_get_battdesc(int, struct acpi_battdesc *);

extern int	acpi_cmbat_get_battinfo(int, struct acpi_battinfo *);

/*
 * AC adapter interface.
 */

extern int	acpi_acad_get_acline(int *);

#if __FreeBSD_version >= 500000
#ifndef ACPI_MAX_THREADS
#define ACPI_MAX_THREADS	3
#endif
#if ACPI_MAX_THREADS > 0
#define ACPI_USE_THREADS
#endif
#endif

#ifdef ACPI_USE_THREADS
/*
 * ACPI task kernel thread initialization.
 */
extern int	acpi_task_thread_init(void);
#endif


text:
$worker_test_count = 0
$worker_success = false

class TestPlainJob
  def self.queue; "test-plain"; end
  def self.perform(x, y); $worker_test_count += x + y + 1; end
end

class TestJob
  include Backburner::Queue
  queue_priority :medium
  queue_respond_timeout 300
  def self.perform(x, y); $worker_test_count += x + y; end
end

class TestFailJob
  include Backburner::Queue
  def self.perform(x, y); raise RuntimeError; end
end

class TestRetryJob
  include Backburner::Queue
  def self.perform(x, y)
    $worker_test_count += 1
    raise RuntimeError unless $worker_test_count > 2
    $worker_success = true
  end
end

class TestConfigurableRetryJob
  include Backburner::Queue
  def self.perform(retry_count)
    $worker_test_count += 1
    raise RuntimeError unless $worker_test_count > retry_count
    $worker_success = true
  end
end

class TestAsyncJob
  include Backburner::Performable
  def self.foo(x, y); $worker_test_count = x * y; end
end

class TestLambdaQueueJob
  include Backburner::Queue
  queue lambda { |klass| klass.calculated_queue_name }
  def self.calculated_queue_name; 'lambda-queue' end
end

redpajama_set_name: RedPajamaGithub


text:
//
// Copyright 2020 Google Inc.
//
// 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.
//

#import <XCTest/XCTest.h>

NS_ASSUME_NONNULL_BEGIN

/*
 * Encapsulates shared behavior for continuous scanner test cases.
 */
@interface GSCXContinuousScannerTestCase : XCTestCase

/**
 * @return @c YES if the application should be terminated in tearDown, @c NO otherwise. Defaults to
 * @c NO.
 */
- (BOOL)shouldTerminateOnTeardown;

@end

NS_ASSUME_NONNULL_END


text:
<?php
/**
 * Configuration file for the "yii asset" console command.
 */

// In the console environment, some path aliases may not exist. Please define these:
// Yii::setAlias('@webroot', __DIR__ . '/../web');
// Yii::setAlias('@web', '/');
include 'app/config/bootstrap.php';

return [
    'jsCompressor' => 'gulp compress-js --gulpfile tools/gulp/gulpfile.js --src {from} --dist {to}',
    'cssCompressor' => 'gulp compress-css --gulpfile tools/gulp/gulpfile.js --src {from} --dist {to}',
    // Whether to delete asset source after compression:
    'deleteSource' => false,
    // The list of asset bundles to compress:
    // Asset bundle for compression output:
    'bundles' => [
        'yii\web\JqueryAsset',
        'yii\web\YiiAsset',
        'yii\jui\JuiAsset',
        'yii\bootstrap\BootstrapAsset',
        'yii\bootstrap\BootstrapPluginAsset',
        'rmrevin\yii\fontawesome\AssetBundle',
        'app\themes\adminlte2\AdminltePluginsAsset',
        'app\plugins\menu\assets\MenuAsset',
        'app\themes\adminlte2\ThemeAsset',
        'nirvana\showloading\ShowLoadingAsset',
        'app\themes\adminlte2\AdminLteAsset',
        'app\themes\adminlte2\ShowLoadingAsset',
        'lo\modules\noty\assets\NotyAsset'
    ],
    'targets' => [
        'allShared' => [
            'class' => 'yii\web\AssetBundle',
            'basePath' => '@webroot/assets',
            'baseUrl' => '@web/assets',
            'js' => 'all-shared-{hash}.js',
            'css' => 'all-shared-{hash}.css',
            'depends' => [
                'yii\bootstrap\BootstrapAsset',
                'yii\bootstrap\BootstrapPluginAsset',
                'rmrevin\yii\fontawesome\AssetBundle',
                'yii\web\JqueryAsset',
            ],
        ],
        'allBackEnd' => [
            'class' => 'yii\web\AssetBundle',
            'basePath' => '@webroot/assets',
            'baseUrl' => '@web/assets',
            'js' => 'all-backend-{hash}.js',
            'css' => 'all-backend-{hash}.css',
            'depends' => [
                'yii\web\YiiAsset',
                'yii\jui\JuiAsset',
                'app\themes\adminlte2\AdminltePluginsAsset',
                'app\plugins\menu\assets\MenuAsset',
                'app\themes\adminlte2\ThemeAsset',
                'nirvana\showloading\ShowLoadingAsset',
                'app\themes\adminlte2\AdminLteAsset',
                'app\themes\adminlte2\ShowLoadingAsset',
                'lo\modules\noty\assets\NotyAsset'
            ],
        ],
        'allFrontEnd' => [
            'class' => 'yii\web\AssetBundle',
            'basePath' => '@webroot/assets',
            'baseUrl' => '@web/assets',
            'js' => 'all-frontend-{hash}.js',
            'css' => 'all-frontend-{hash}.css',
            'depends' => [

            ],
        ],
    ],
    // Asset manager configuration:
    'assetManager' => [
        'basePath' => '@webroot/static/assets',
        'baseUrl' => '@web/static/assets',
    ],
];


text:
package com.amazonaws.services.simpleworkflow.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Provides the details of the StartTimerFailed event.
 *

 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class StartTimerFailedEventAttributes implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The timerId provided in the StartTimer decision that failed.
     *

     */
    private String timerId;
    /**
     *

     * The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.
     *

     * <note>
     *

     * If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked
     * sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to
     * Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * </note>
     */
    private String cause;
    /**
     *

     * The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the
     * StartTimer decision for this activity task. This information can be useful for diagnosing problems
     * by tracing back the chain of events leading up to this event.
     *

     */
    private Long decisionTaskCompletedEventId;

    /**
     *

     * The timerId provided in the StartTimer decision that failed.
     *

     *
     * @param timerId
     *        The timerId provided in the StartTimer decision that failed.
     */

    public void setTimerId(String timerId) {
        this.timerId = timerId;
    }

    /**
     *

     * The timerId provided in the StartTimer decision that failed.
     *

     *
     * @return The timerId provided in the StartTimer decision that failed.
     */

    public String getTimerId() {
        return this.timerId;
    }

    /**
     *

     * The timerId provided in the StartTimer decision that failed.
     *

     *
     * @param timerId
     *        The timerId provided in the StartTimer decision that failed.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public StartTimerFailedEventAttributes withTimerId(String timerId) {
        setTimerId(timerId);
        return this;
    }

    /**
     *

     * The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.
     *

     * <note>
     *

     * If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked
     * sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to
     * Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * </note>
     *
     * @param cause
     *        The cause of the failure. This information is generated by the system and can be useful for diagnostic
     *        purposes.
 <note>
     *

     *        If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it
     *        lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage
     *        Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * @see StartTimerFailedCause
     */

    public void setCause(String cause) {
        this.cause = cause;
    }

    /**
     *

     * The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.
     *

     * <note>
     *

     * If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked
     * sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to
     * Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * </note>
     *
     * @return The cause of the failure. This information is generated by the system and can be useful for diagnostic
     *         purposes.
 <note>
     *

     *         If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it
     *         lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage
     *         Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * @see StartTimerFailedCause
     */

    public String getCause() {
        return this.cause;
    }

    /**
     *

     * The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.
     *

     * <note>
     *

     * If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked
     * sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to
     * Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * </note>
     *
     * @param cause
     *        The cause of the failure. This information is generated by the system and can be useful for diagnostic
     *        purposes.
 <note>
     *

     *        If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it
     *        lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage
     *        Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * @return Returns a reference to this object so that method calls can be chained together.
     * @see StartTimerFailedCause
     */

    public StartTimerFailedEventAttributes withCause(String cause) {
        setCause(cause);
        return this;
    }

    /**
     *

     * The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.
     *

     * <note>
     *

     * If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked
     * sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to
     * Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * </note>
     *
     * @param cause
     *        The cause of the failure. This information is generated by the system and can be useful for diagnostic
     *        purposes.
 <note>
     *

     *        If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it
     *        lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage
     *        Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * @see StartTimerFailedCause
     */

    public void setCause(StartTimerFailedCause cause) {
        withCause(cause);
    }

    /**
     *

     * The cause of the failure. This information is generated by the system and can be useful for diagnostic purposes.
     *

     * <note>
     *

     * If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it lacked
     * sufficient permissions. For details and example IAM policies, see Using IAM to Manage Access to
     * Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * </note>
     *
     * @param cause
     *        The cause of the failure. This information is generated by the system and can be useful for diagnostic
     *        purposes.
 <note>
     *

     *        If cause is set to OPERATION_NOT_PERMITTED, the decision failed because it
     *        lacked sufficient permissions. For details and example IAM policies, see Using IAM to Manage
     *        Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
     *

     * @return Returns a reference to this object so that method calls can be chained together.
     * @see StartTimerFailedCause
     */

    public StartTimerFailedEventAttributes withCause(StartTimerFailedCause cause) {
        this.cause = cause.toString();
        return this;
    }

    /**
     *

     * The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the
     * StartTimer decision for this activity task. This information can be useful for diagnosing problems
     * by tracing back the chain of events leading up to this event.
     *

     *
     * @param decisionTaskCompletedEventId
     *        The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in
     *        the StartTimer decision for this activity task. This information can be useful for diagnosing
     *        problems by tracing back the chain of events leading up to this event.
     */

    public void setDecisionTaskCompletedEventId(Long decisionTaskCompletedEventId) {
        this.decisionTaskCompletedEventId = decisionTaskCompletedEventId;
    }

    /**
     *

     * The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the
     * StartTimer decision for this activity task. This information can be useful for diagnosing problems
     * by tracing back the chain of events leading up to this event.
     *

     *
     * @return The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted
     *         in the StartTimer decision for this activity task. This information can be useful for
     *         diagnosing problems by tracing back the chain of events leading up to this event.
     */

    public Long getDecisionTaskCompletedEventId() {
        return this.decisionTaskCompletedEventId;
    }

    /**
     *

     * The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in the
     * StartTimer decision for this activity task. This information can be useful for diagnosing problems
     * by tracing back the chain of events leading up to this event.
     *

     *
     * @param decisionTaskCompletedEventId
     *        The ID of the DecisionTaskCompleted event corresponding to the decision task that resulted in
     *        the StartTimer decision for this activity task. This information can be useful for diagnosing
     *        problems by tracing back the chain of events leading up to this event.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public StartTimerFailedEventAttributes withDecisionTaskCompletedEventId(Long decisionTaskCompletedEventId) {
        setDecisionTaskCompletedEventId(decisionTaskCompletedEventId);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getTimerId() != null)
            sb.append("TimerId: ").append(getTimerId()).append(",");
        if (getCause() != null)
            sb.append("Cause: ").append(getCause()).append(",");
        if (getDecisionTaskCompletedEventId() != null)
            sb.append("DecisionTaskCompletedEventId: ").append(getDecisionTaskCompletedEventId());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof StartTimerFailedEventAttributes == false)
            return false;
        StartTimerFailedEventAttributes other = (StartTimerFailedEventAttributes) obj;
        if (other.getTimerId() == null ^ this.getTimerId() == null)
            return false;
        if (other.getTimerId() != null && other.getTimerId().equals(this.getTimerId()) == false)
            return false;
        if (other.getCause() == null ^ this.getCause() == null)
            return false;
        if (other.getCause() != null && other.getCause().equals(this.getCause()) == false)
            return false;
        if (other.getDecisionTaskCompletedEventId() == null ^ this.getDecisionTaskCompletedEventId() == null)
            return false;
        if (other.getDecisionTaskCompletedEventId() != null && other.getDecisionTaskCompletedEventId().equals(this.getDecisionTaskCompletedEventId()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getTimerId() == null) ? 0 : getTimerId().hashCode());
        hashCode = prime * hashCode + ((getCause() == null) ? 0 : getCause().hashCode());
        hashCode = prime * hashCode + ((getDecisionTaskCompletedEventId() == null) ? 0 : getDecisionTaskCompletedEventId().hashCode());
        return hashCode;
    }

    @Override
    public StartTimerFailedEventAttributes clone() {
        try {
            return (StartTimerFailedEventAttributes) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.simpleworkflow.model.transform.StartTimerFailedEventAttributesMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Chocolatey" file="LocalSourceViewModel.cs">
//   Copyright 2014 - Present Rob Reynolds, the maintainers of Chocolatey, and RealDimensions Software, LLC
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Reactive.Linq;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Xml;
using AutoMapper;
using Caliburn.Micro;
using ChocolateyGui.Base;
using ChocolateyGui.Enums;
using ChocolateyGui.Models;
using ChocolateyGui.Models.Messages;
using ChocolateyGui.Properties;
using ChocolateyGui.Services;
using ChocolateyGui.Utilities.Extensions;
using ChocolateyGui.ViewModels.Items;
using Serilog;

namespace ChocolateyGui.ViewModels
{
    public sealed class LocalSourceViewModel : Screen, ISourceViewModelBase, IHandleWithTask<PackageChangedMessage>
    {
        private static readonly ILogger Logger = Log.ForContext<LocalSourceViewModel>();
        private readonly IChocolateyService _chocolateyService;
        private readonly List<IPackageViewModel> _packages;
        private readonly IPersistenceService _persistenceService;
        private readonly IProgressService _progressService;
        private readonly IConfigService _configService;
        private readonly IEventAggregator _eventAggregator;
        private readonly IMapper _mapper;
        private bool _exportAll = true;
        private bool _hasLoaded;
        private bool _matchWord;
        private ObservableCollection<IPackageViewModel> _packageViewModels;
        private string _searchQuery;
        private bool _showOnlyPackagesWithUpdate;
        private string _sortColumn;
        private bool _sortDescending;
        private bool _isLoading;
        private bool _firstLoadIncomplete = true;
        private ListViewMode _listViewMode;

        public LocalSourceViewModel(
            IChocolateyService chocolateyService,
            IProgressService progressService,
            IPersistenceService persistenceService,
            IConfigService configService,
            IEventAggregator eventAggregator,
            string displayName,
            IMapper mapper)
        {
            _chocolateyService = chocolateyService;
            _progressService = progressService;
            _persistenceService = persistenceService;
            _configService = configService;

            ListViewMode = _configService.GetSettings().DefaultToTileViewForLocalSource ? ListViewMode.Tile : ListViewMode.Standard;

            DisplayName = displayName;

            _packages = new List<IPackageViewModel>();
            Packages = new ObservableCollection<IPackageViewModel>();
            PackageSource = CollectionViewSource.GetDefaultView(Packages);
            PackageSource.Filter = FilterPackage;

            if (eventAggregator == null)
            {
                throw new ArgumentNullException(nameof(eventAggregator));
            }

            _eventAggregator = eventAggregator;
            _mapper = mapper;
            _eventAggregator.Subscribe(this);
        }

        public ListViewMode ListViewMode
        {
            get { return _listViewMode; }
            set { this.SetPropertyValue(ref _listViewMode, value); }
        }

        public bool ShowOnlyPackagesWithUpdate
        {
            get { return _showOnlyPackagesWithUpdate; }
            set { this.SetPropertyValue(ref _showOnlyPackagesWithUpdate, value); }
        }

        public bool MatchWord
        {
            get { return _matchWord; }
            set { this.SetPropertyValue(ref _matchWord, value); }
        }

        public ObservableCollection<IPackageViewModel> Packages
        {
            get { return _packageViewModels; }
            set { this.SetPropertyValue(ref _packageViewModels, value); }
        }

        public ICollectionView PackageSource { get; }

        public string SearchQuery
        {
            get { return _searchQuery; }
            set { this.SetPropertyValue(ref _searchQuery, value); }
        }

        public string SortColumn
        {
            get { return _sortColumn; }
            set { this.SetPropertyValue(ref _sortColumn, value); }
        }

        public bool SortDescending
        {
            get { return _sortDescending; }
            set { this.SetPropertyValue(ref _sortDescending, value); }
        }

        public bool IsLoading
        {
            get { return _isLoading; }
            set { this.SetPropertyValue(ref _isLoading, value); }
        }

        public bool FirstLoadIncomplete
        {
            get { return _firstLoadIncomplete; }
            set { this.SetPropertyValue(ref _firstLoadIncomplete, value); }
        }

        public bool CanUpdateAll()
        {
            return Packages.Any(p => p.CanUpdate);
        }

        public async void UpdateAll()
        {
            try
            {
                await _progressService.StartLoading(Resources.LocalSourceViewModel_Packages, true);
                IsLoading = true;

                _progressService.WriteMessage(Resources.LocalSourceViewModel_FetchingPackages);
                var token = _progressService.GetCancellationToken();
                var packages = Packages.Where(p => p.CanUpdate && !p.IsPinned).ToList();
                double current = 0.0f;
                foreach (var package in packages)
                {
                    if (token.IsCancellationRequested)
                    {
                        await _progressService.StopLoading();
                        IsLoading = false;
                        return;
                    }

                    _progressService.Report(Math.Min(current++ / packages.Count, 100));
                    await package.Update();
                }

                await _progressService.StopLoading();
                IsLoading = false;
                ShowOnlyPackagesWithUpdate = false;
                RefreshPackages();
            }
            catch (Exception ex)
            {
                Logger.Fatal("Updated all has failed.", ex);
                throw;
            }
        }

        public void ExportAll()
        {
            _exportAll = false;

            try
            {
                var fileStream = _persistenceService.SaveFile("*.config", Resources.LocalSourceViewModel_ConfigFiles);

                if (fileStream == null)
                {
                    return;
                }

                var settings = new XmlWriterSettings { Indent = true };

                using (var xw = XmlWriter.Create(fileStream, settings))
                {
                    xw.WriteStartDocument();
                    xw.WriteStartElement("packages");

                    foreach (var package in Packages)
                    {
                        xw.WriteStartElement("package");
                        xw.WriteAttributeString("id", package.Id);
                        xw.WriteAttributeString("version", package.Version.ToString());
                        xw.WriteEndElement();
                    }

                    xw.WriteEndElement();
                }
            }
            catch (Exception ex)
            {
                Logger.Fatal("Export all has failed.", ex);
                throw;
            }
            finally
            {
                _exportAll = true;
            }
        }

        public bool CanExportAll()
        {
            return _exportAll;
        }

        public bool CanRefreshPackages()
        {
            return _hasLoaded && !IsLoading;
        }

        public async void RefreshPackages()
        {
            await LoadPackages();
        }

        public async Task Handle(PackageChangedMessage message)
        {
            switch (message.ChangeType)
            {
                case PackageChangeType.Pinned:
                    PackageSource.Refresh();
                    break;
                case PackageChangeType.Unpinned:
                    var package = Packages.First(p => p.Id == message.Id);
                    if (package.LatestVersion != null)
                    {
                        PackageSource.Refresh();
                    }
                    else
                    {
                        var outOfDatePackages =
                            await _chocolateyService.GetOutdatedPackages(package.IsPrerelease, package.Id);
                        foreach (var update in outOfDatePackages)
                        {
                            await _eventAggregator.PublishOnUIThreadAsync(new PackageHasUpdateMessage(update.Item1, update.Item2));
                        }

                        PackageSource.Refresh();
                    }

                    break;

                case PackageChangeType.Uninstalled:
                    Packages.Remove(Packages.First(p => p.Id == message.Id));
                    break;

                default:
                    await LoadPackages();
                    break;
            }
        }

#pragma warning disable RECS0165 // Asynchronous methods should return a Task instead of void
        protected override async void OnInitialize()
#pragma warning restore RECS0165 // Asynchronous methods should return a Task instead of void
        {
            try
            {
                if (_hasLoaded)
                {
                    return;
                }

                Observable.FromEventPattern<EventArgs>(_configService, "SettingsChanged")
                    .ObserveOnDispatcher()
                    .Subscribe(eventPattern => ListViewMode = ((AppConfiguration)eventPattern.Sender).DefaultToTileViewForLocalSource ? ListViewMode.Tile : ListViewMode.Standard);

                await LoadPackages();

                Observable.FromEventPattern<PropertyChangedEventArgs>(this, "PropertyChanged")
                    .Where(
                        eventPattern =>
                            eventPattern.EventArgs.PropertyName == nameof(MatchWord) ||
                            eventPattern.EventArgs.PropertyName == nameof(SearchQuery) ||
                            eventPattern.EventArgs.PropertyName == nameof(ShowOnlyPackagesWithUpdate))
                    .ObserveOnDispatcher()
                    .Subscribe(eventPattern => PackageSource.Refresh());

                Observable.FromEventPattern<PropertyChangedEventArgs>(this, "PropertyChanged")
                    .Where(eventPattern => eventPattern.EventArgs.PropertyName == nameof(ListViewMode))
                    .ObserveOnDispatcher()
                    .Subscribe(eventPattern =>
                    {
                        if (ListViewMode == ListViewMode.Tile)
                        {
                            // reset custom sorting for now
                            var listColView = PackageSource as ListCollectionView;
                            if (listColView != null)
                            {
                                listColView.CustomSort = null;
                            }
                        }
                    });

                _hasLoaded = true;

                var chocoPackage = _packages.FirstOrDefault(p => p.Id.ToLower() == "chocolatey");
                if (chocoPackage != null && chocoPackage.CanUpdate)
                {
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                    _progressService.ShowMessageAsync(Resources.LocalSourceViewModel_Chocolatey, Resources.LocalSourceViewModel_UpdateAvailableForChocolatey)
                        .ConfigureAwait(false);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                }
            }
            catch (Exception ex)
            {
                Logger.Fatal("Local source control view model failed to load.", ex);
                throw;
            }
        }

        private bool FilterPackage(object packageObject)
        {
            var package = (IPackageViewModel)packageObject;
            var include = true;
            if (!string.IsNullOrWhiteSpace(SearchQuery))
            {
                if (MatchWord)
                {
                    include &= string.Compare(
                        package.Title ?? package.Id,
                        SearchQuery,
                        StringComparison.OrdinalIgnoreCase) == 0;
                }
                else
                {
                    include &= CultureInfo.CurrentCulture.CompareInfo.IndexOf(
                                   package.Title ?? package.Id,
                                   SearchQuery,
                                   CompareOptions.OrdinalIgnoreCase) >= 0;
                }
            }

            if (ShowOnlyPackagesWithUpdate)
            {
                include &= package.CanUpdate && !package.IsPinned;
            }

            return include;
        }

        private async Task LoadPackages()
        {
            if (IsLoading)
            {
                return;
            }

            IsLoading = true;
            try
            {
                _packages.Clear();
                Packages.Clear();

                var packages = (await _chocolateyService.GetInstalledPackages())
                    .Select(Mapper.Map<IPackageViewModel>).ToList();

                foreach (var packageViewModel in packages)
                {
                    _packages.Add(packageViewModel);
                    Packages.Add(packageViewModel);
                }

                FirstLoadIncomplete = false;

                var updates = await _chocolateyService.GetOutdatedPackages();
                foreach (var update in updates)
                {
                    await _eventAggregator.PublishOnUIThreadAsync(new PackageHasUpdateMessage(update.Item1, update.Item2));
                }

                PackageSource.Refresh();
            }
            catch (ConnectionClosedException)
            {
                Logger.Warning("Threw connection closed message while processing load packages.");
            }
            catch (Exception ex)
            {
                Logger.Fatal("Packages failed to load", ex);
                throw;
            }
            finally
            {
                IsLoading = false;
            }
        }
    }
}


text:
package com.github.sampengilly.springjavafx.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import javax.naming.ConfigurationException;

/**
 * @author Sam Pengilly
 */
@Configuration
@Import({PropertyPlaceholderAutoConfiguration.class})
class JavaFxConfiguration {

    private final Logger logger = LoggerFactory.getLogger(JavaFxConfiguration.class);

    @Value("${spring.javafx.fxml-naming-scheme:com.github.sampengilly.springjavafx.config.DefaultFxmlNamingScheme}")
    private String fxmlNamingSchemeName;

    @Bean
    public FxmlNamingScheme fxmlNamingScheme()
            throws ClassNotFoundException, ConfigurationException, IllegalAccessException, InstantiationException {

        logger.debug(String.format("Configured naming scheme: '%s'", fxmlNamingSchemeName));

        Class<?> namingScheme = Class.forName(fxmlNamingSchemeName);
        if (!classIsFxmlNamingScheme(namingScheme)) {
            throw new ConfigurationException(
                    String.format("Class with name: '%s' does not implement FxmlNamingScheme", fxmlNamingSchemeName));
        }

        return (FxmlNamingScheme) namingScheme.newInstance();
    }

    private boolean classIsFxmlNamingScheme(Class<?> classToTest) {
        return FxmlNamingScheme.class.isAssignableFrom(classToTest);
    }

}


text:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#ifdef USE_MALLOC_WRAPPERS
/* Don't wrap ourselves */
#  undef USE_MALLOC_WRAPPERS
#endif
#include "malloc_wrap.h"

void *wrap_calloc(size_t nmemb, size_t size,
				  const char *file, unsigned int line, const char *func) {
	void *p = calloc(nmemb, size);
	if (NULL == p) {
		fprintf(stderr,
				"[%s] Failed to allocate %zd bytes at %s line %u: %s\n",
				func, nmemb * size, file, line, strerror(errno));
		exit(EXIT_FAILURE);
	}
	return p;
}

void *wrap_malloc(size_t size,
				  const char *file, unsigned int line, const char *func) {
	void *p = malloc(size);
	if (NULL == p) {
		fprintf(stderr,
				"[%s] Failed to allocate %zd bytes at %s line %u: %s\n",
				func, size, file, line, strerror(errno));
		exit(EXIT_FAILURE);
	}
	return p;
}

void *wrap_realloc(void *ptr, size_t size,
				   const char *file, unsigned int line, const char *func) {
	void *p = realloc(ptr, size);
	if (NULL == p) {
		fprintf(stderr,
				"[%s] Failed to allocate %zd bytes at %s line %u: %s\n",
				func, size, file, line, strerror(errno));
		exit(EXIT_FAILURE);
	}
	return p;
}

char *wrap_strdup(const char *s,
				  const char *file, unsigned int line, const char *func) {
	char *p = strdup(s);
	if (NULL == p) {
		fprintf(stderr,
				"[%s] Failed to allocate %zd bytes at %s line %u: %s\n",
				func, strlen(s), file, line, strerror(errno));
		exit(EXIT_FAILURE);
	}
	return p;
}


text:
Python Bindings for Halide
--------------------------

By Connelly Barnes, 2012-2013.

This library allows you to write Halide code in Python 2.7. The library has currently only been tested on Mac OS
and Linux (Debian, Ubuntu), against a Halide source build, and is more experimental than the C++ Halide.

Installation
------------

### Prerequisites

Install SWIG 2.0.4+, and Python libraries Numpy, and Python Image Library (PIL).

On Mac:

    brew install swig         % Assumes you have Homebrew package manager (use your preferred package manager)
    sudo easy_install pip
    sudo pip install numpy pil

On Ubuntu Linux:

    sudo apt-get install python-dev libpng12-dev python-imaging python-numpy swig

### Building and Installing the Python bindings

Quick install:

    sudo make install         % Install
    make test                 % Optional: run unit tests

Detailed installation:

You can build Halide by using 'make' in the parent directory. This is done automatically by the Makefile for the Python bindings. The following make options are then provided for the Python bindings:

    sudo make clean           % Clean in case any problems occurred
    make                      % Build in place
    make test                 % Run unit tests
    sudo make install         % Build and install

Documentation and Examples
--------------------------

Consult the [module documentation](http://connellybarnes.com/documents/halide/).

Check out the code for the example applications in the apps/ subdirectory. You can run them individually or as a batch:

    make run_apps             % Run apps/*.py with GUI output
    make run_apps_headless    % Run apps; output to apps/out*.png

License
-------

The Python bindings use the same [MIT license](https://github.com/halide/Halide/blob/master/LICENSE.txt) as Halide.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

		<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0">

		<title>Culture</title>

		<?php include ("inc/header.php"); ?>

Culture

Dominican Culture and customs have an european basis, influenced by native Taíno and African elements. These
									 are evident on the following aspects:

Cuisine

Dominican cuisine is influenced mostly by the Spanish, Taíno, and African elements of our culture. The
								 typical cuisine resembles other caribbean dishes. The main lunch dish is called "La Bandera" consists of
								 a type of meat, rice and beans. The traditional breakfast dish is called "Mangú", a name originating from
								 United States interventions where the navy were introduced this dish and they always exclaimed "Man,
								 Good!" and thus this named catched on for this dish. The dish consists of sunnyside eggs, mangú (mashed,
								 boiled plantains) topped by onions, deep-fried meat (Dominican salami, typically), and fried cheese.
								 Mofongo is another popular dish made by deep fried mashed plantains along with several seasonings and
								 regularly accompanied by meat. Sancocho is another traditional dish, consisting of stew often made with
								 several varieties of meat.

Other favorite Dominican foods include chicharrón, yuca, casabe, pastelitos (empanadas), batata, yam,
								 pasteles en hoja, chimichurris, and tostones. Popular sweets include: arroz con leche, habichuelas con
								 dulce, flan, dulce de leche, etc. The famous dominican beverages are: Morir Soñando, Ron Brugal and Ron
								 Barceló, Presidente Beer, Mama Juana, mabí, etc.

Music and dance

Merengue

The Dominican Republic is world renown for originating two world popular musical styles, Merengue and Bachata.
								 Merengue is a musical genre characterized by its fast-paced, lively rhythm and dance. Music is composed using
								 instruments such as: drums, brass, chorded instruments, and accordion. In addition, traditional instruments
								 are also added, la tambora and la güira. Merengue was promoted internationally by popular artists such as
								 Joseito Mateo, Wilfrido Vargas, Johnny Ventura, Los Hermanos Rosario, Juan Luis Guerra, Fernando Villalona,
								 Eddy Herrera, Sergio Vargas, Toño Rosario, Milly Quezada, and Chichí Peralta, etc.

Bachata

In the other hand, Bachata, a genre of music and dance that origins reside in the rural and marginal
								 neighborhoods of the country, is characterized by its coordinated movements and more sensual steps.
								 Originally referred to as "amargue", meaning bitterness, until the more neutral but ambiguous term
								 bachata became popular. Bachata has been thoroughly influenced by several elements of Latin American
								 Guitar styles as well as bolero and merengue. Bachata has become extremely popular due to the global
								 exposure that some artists have given it such as: Anthony Santos, Zacharias Ferreira, Joe Veras,
								 Raulín Rodríguez, Frank Reyes, Fernando Villalona, Hector Acosta, Aventura, etc. Currently,
								 Prince Royce and Romeo Santos are the two most active and popular artists forming part of this
								 musical genre.

Palo

Palo is another genre of music originated in the country. Mostly born of Afro-Dominican roots, this
								 sacred music can be found in certain parts of the country. Its principal components are the drum and
								 human voice. Palo is played at religious ceremonies such as a saint's religious day, secular parties
								 or special occasions.

Other Popular Genres

Another widespread genre on the country is Salsa music, with dominican influencers such as Johnny
								 Pacheco and Gilberto Santa Rosa responsible for the popularization of the genre. During the late 1960s
								 Dominican musicians like Johnny Pacheco, creator of the Fania All Stars, played a significant role in
								 the development and popularization of the genre. Other genres authored by dominican artists include
								 Dembow, Reggaeton, Trap, Hip-Hop and Rock.

Sports

The Dominican Republic is world renowned for producing the most foreign Major League Baseball players.
								 Baseball is, without a doubt, the most popular sport in the country. With hundreds of baseball fields,
								 there is always an opportunity for a Dominican to enjoy this sport. Even on their free time, young kids
							   play the game of "Vitilla" which consists of hitting a gallon cap with a broomstick, which Dominican
								 Players attribute to their hitting abilities. Dominican Baseball season starts on October and ends
								 with the playoffs in January. Famous Dominican baseball players include Juan Marichal, Pedro
								 Martínez, Adrián Beltré, Robinson Canó, Rico Carty, Starling Marte, Vladimir Guerrero, Manny Ramírez,
								 José Bautista, Edwin Encarnación, Hanley Ramírez, David Ortiz, Albert Pujols,  Sammy Sosa, etc. In 2013,
								 the Dominican team participated in the World Baseball Classic and went undefeated in the way to their first
								 title.

Basketball is another popular sport, producing NBA players such as Tito Horford, Al Horford, Félipe
								 López, Francisco Garcia and Karl-Anthony Towns. Olympic sports are also widespread, with gold medalist
								 hurdler Félix Sánchez.

National symbols

The Dominican Republic values immensely its national symbols, the flag, the coat of arms and the national
								 anthem. Also relevant, the national flower is the Bayahibe Rose and the national bird is the Cigua Palmera.

The flag is composed of a four quarters, alternating blue and red, divided by a large white cross. The
								 blood shed by its founding fathers and liberators is represented by the red. Blue expresses that the nation
								 is protected by God. The white cross signifies the Dominican's character towards peace, dignity and unity.
								 In the center of the flag is situated the coat of arms composed of several parts. A gold cross representing
								 slavery abolishment. Arrows expressing the significance of the military. A shield, with the flag colors, surrounded by an olive branch and palm branch with a bible underneath it. A blue ribbon above the shield quotes "Dios, Patria y Libertad", meaning God, Patriotism & Liberty, while a red ribbon under the shield quotes "Dominican Republic".

  <?php include ("inc/footer.php"); ?>


text:
class Component:
    """Application component
    """
    app = None
    logger = None

    def init_app(self, app):
        self.app = app
        if not self.logger:
            self.logger = app.logger
        return self

    @property
    def green_pool(self):
        if self.app:
            return self.app.green_pool

    @property
    def config(self):
        if self.app:
            return self.app.config


text:
{% extends "customer/emails/base.html" %}
{% load i18n %}

{% block tbody %}

            {% blocktrans with name=site.name %}You're receiving this e-mail because your password has been changed at {{ name }}.{% endblocktrans %}

            {% trans "If it wasn't you who changed it, please reset your password immediately:" %}

            Reset password

            {% trans "Otherwise, you can ignore this email." %}

{% endblock %}


text:
class PopulateOtpColumn < ActiveRecord::Migration
  def up
    User.reset_column_information

    User.find_each do |user|
      user.otp_secret_key = user.read_attribute('otp_secret_key')
      user.save!
    end
  end

  def down
    User.reset_column_information

    User.find_each do |user|
      user.otp_secret_key = ROTP::Base32.random_base32
      user.save!
    end
  end
end


text:
class MeterReview < ApplicationRecord
  belongs_to :school
  belongs_to :user
  belongs_to :consent_grant

  has_many :meters
  has_and_belongs_to_many :consent_documents

  validates_presence_of :school, :user, :consent_grant

  before_destroy do |review|
    review.meters.clear
    review.consent_documents.clear
  end
end


text:
import io.undertow.io.IoCallback;
import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.server.handlers.form.FormData;
import io.undertow.server.handlers.form.FormDataParser;
import io.undertow.server.handlers.form.MultiPartParserDefinition;
import io.undertow.util.HttpString;
import io.undertow.util.StatusCodes;

import java.io.File;
import java.io.RandomAccessFile;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.ForkJoinPool;
import java.util.stream.Stream;

import static java.util.stream.Collectors.summingLong;
import static java.util.stream.Collectors.toList;

/**
 * Created by ssfak on 2/11/15.
 */
class UploadHandler implements HttpHandler {
    private final MultiPartParserDefinition m;
    private final String tempUploadDir;
    private final String tempStoreDir;

    public UploadHandler(String tempUploadDir, String tempStoreDir) {
        this.m = new MultiPartParserDefinition();
        this.m.setMaxIndividualFileSize(10 * 1024 * 1024);
        this.tempUploadDir = tempUploadDir;
        this.tempStoreDir = tempStoreDir;
    }

    private static String partFileName(int chunkNumber) {
        return String.format("part_%05d", chunkNumber);
    }

    @Override
    public void handleRequest(HttpServerExchange exchange) throws Exception {
        //  System.out.println(exchange.isInIoThread() + " " + Thread.currentThread().getName());

        if (exchange.isInIoThread()) {
            exchange.dispatch(this);
            return;
        }
        exchange.startBlocking();

        try (FormDataParser formDataParser = m.create(exchange)) {

            FormData data = formDataParser.parseBlocking();

            String user = data.getFirst("username").getValue();

            int chunkNumber = Integer.parseInt(data.getFirst("resumableChunkNumber").getValue());
            int totalChunks = Integer.parseInt(data.getFirst("resumableTotalChunks").getValue());
            long chunkSize = Long.parseLong(data.getFirst("resumableChunkSize").getValue());

            String identifier = data.getFirst("resumableIdentifier").getValue();
            long totalSize = Long.parseLong(data.getFirst("resumableTotalSize").getValue());
            String filename = data.getFirst("resumableFilename").getValue();

            final Path tempFile = data.getFirst("file").getPath();

            if (chunkNumber < totalChunks && tempFile.toFile().length() < chunkSize) {
            /*

                The chuck has not been transferred in its entirety!
                Say to client to re-upload it

                The documentation at https://github.com/23/resumable.js says:
                    For every request, you can confirm reception in HTTP status codes:
                    200: The chunk was accepted and correct. No need to re-upload.
                    404, 415. 500, 501: The file for which the chunk was uploaded is not supported, cancel the entire upload.
                    Anything else: Something went wrong, but try re-uploading the file.

            */
                exchange.setStatusCode(StatusCodes.BAD_REQUEST); // 400
                exchange.endExchange();
                return;
            }
            final Path dir = Files.createDirectories(Paths.get(tempUploadDir + identifier));
            final String partFileName = partFileName(chunkNumber);
            final Path partFile = Paths.get(dir.toString(), partFileName);
            Files.move(tempFile, partFile);

            List<File> parts;
            try (final Stream<Path> pathStream = Files.walk(dir, 1)) {
                parts = pathStream
                        .map(Path::toFile)
                        .filter(file -> file.isFile() && file.getName().startsWith("part"))
                        .collect(toList());
            }
            final long curSize = parts.stream().collect(summingLong(File::length));

            System.out.printf("[%s]: CurSize: %d TotalSize: %d\n", Thread.currentThread().getName(), curSize, totalSize);

            if (curSize >= totalSize) {
                try {
                    Path finalFile = Files.createFile(Paths.get(dir.toString(), filename));

                    try (RandomAccessFile raf = new RandomAccessFile(finalFile.toString(), "rw")) {
                        for (int i = 1; i <= totalChunks; ++i) {
                            final String fileName = partFileName(i);
                            final Path partPath = Paths.get(dir.toString(), fileName);
                            raf.write(Files.readAllBytes(partPath));
                            Files.delete(partPath);
                        }
                        System.out.println(Thread.currentThread().getName() + " Created... ");

                        if (ZipUtils.isZipFile(finalFile)) {
                            ForkJoinPool.commonPool().execute(() -> {
                                Path outputDir = Paths.get(tempStoreDir, identifier);
                                try {
                                    ZipUtils.unzipFile(outputDir, finalFile.toFile());
                                    List<DICOMClient.Instance> lst = MHAClinicalAPI.dicomClient.sendDcmFile(outputDir);
                                    MHAClinicalAPI.store_images(user, lst);

                                } catch (Throwable t) {
                                    t.printStackTrace();
                                }
                            });
                        }
                        exchange.setStatusCode(StatusCodes.OK);
                        exchange.getResponseHeaders().put(HttpString.tryFromString("Access-Control-Allow-Origin"), "*");
                        exchange.getResponseSender().send("Filename: " + filename + " saved...", IoCallback.END_EXCHANGE);
                    }
                } catch (FileAlreadyExistsException ex) {
                    System.out.println(Thread.currentThread().getName() + " Final file exists...");
                }
            } else {
                exchange.setStatusCode(StatusCodes.OK);
                exchange.getResponseHeaders().put(HttpString.tryFromString("Access-Control-Allow-Origin"), "*");
                exchange.getResponseSender().send("OK", IoCallback.END_EXCHANGE);
            }
        }
    }
}


text:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>

<link href="doc-style.css" type="text/css" rel="StyleSheet">

Managed Object Types	Data Object Types	All Properties	All Methods

Enum -
						ReplicationVmState

Since

vSphere API 5.0

Enum Description

         Describes the current state of a replicated VirtualMachine

Enum Constants

Name	Description

active
      The VirtualMachine is in the process of having
 a consistent instance created.

error
      The VirtualMachine is unable to replicate due to
 errors.

 XXX Currently unused.

idle
      The VirtualMachine is being replicated but is not
 currently in the process of having a consistent instance created.

none
      The VirtualMachine has no current replication state.
 This is a virtual machine that is configured for replication, but is
 powered off and not undergoing offline replication.

paused
      The VirtualMachine replication is paused.

syncing
      One or more of the VirtualMachine disks is in the
 process of an initial synchronization with the remote site.

Show WSDL type definition

<textarea cols="20" rows="10" name="wsdl-textarea" wrap="off" readonly="1" id="wsdl-textarea">         <simpleType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="ReplicationVmState">
            <restriction base="xsd:string">
               <enumeration value="none"/>
               <enumeration value="paused"/>
               <enumeration value="syncing"/>
               <enumeration value="idle"/>
               <enumeration value="active"/>
               <enumeration value="error"/>
            </restriction>
         </simpleType></textarea>

Top of page

Managed Object Types	Data Object Types	All Properties	All Methods


text:
<?php

// $Id: ci_type_attr_form_view.class.php 1570 2009-01-13 12:44:02Z ogrebg $

require_once(TANGRA_MAIN_DIR.'form/fields/integer_positive/form_field_integer_positive_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/select/form_field_select_semidynamic_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');

class VPage_News_List_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_category = $form->get_field('category');
		$f_category_view = new Form_Field_Select_Semidynamic_View($form->get_name().'_'.$f_category->get_name(), $f_category);
		$this->add_field_view('category', $f_category_view);

		$f_items = $form->get_field('items');
		$f_items_view = new Form_Field_Integer_Positive_View($form->get_name().'_'.$f_items->get_name(), $f_items);
		$this->add_field_view('items', $f_items_view);
	}
}


text:
KDD Cup 1999

start from `sh unzip.sh`


text:
import React from 'react';

import { lazyLoad } from '@react-page/editor';
import createMarkPlugin from '../../pluginFactories/createMarkPlugin';

const ItalicIcon = lazyLoad(() => import('@material-ui/icons/FormatItalic'));

export default createMarkPlugin({
  type: 'EMPHASIZE/EM',
  tagName: 'em',
  icon: <ItalicIcon />,
  label: 'Italic',
  hotKey: 'mod+i',
});


text:
Function Get-GitLabIssue {
    [cmdletbinding(DefaultParameterSetName='User')]
    [OutputType('GitLab.Issue')]
    param(
        [Parameter(ParameterSetName='GroupID')]
        [Int]$GroupID,

        [Parameter(ParameterSetName='User')]
        [Parameter(ParameterSetName='GroupID')]
        [ValidateSet('All','CreatedByMe','AssignedToMe')]
		[String]$Scope,

        [Parameter(ParameterSetName='User')]
        [Parameter(ParameterSetName='GroupID')]
        [ValidateSet("opened", "closed")]
        [String]$State
	)

    $Request = @{
        URI = '/issues'
        Method = 'GET'
    }

    # https://docs.gitlab.com/ee/api/issues.html

    $GetUrlParameters = @()

    if($State)
    {
        $GetUrlParameters += @{state=$State}
    }

    if($Scope)
    {
        # Set the expected API value for the scope. Kebab case will change in Gitlab 11.
        if($Scope -eq 'CreatedByMe') {
            $GetUrlParameters += @{scope='created-by-me'}
        }
        elseif($Scope -eq 'AssignedToMe') {
            $GetUrlParameters += @{scope='assigned-to-me'}
        }
        elseif($Scope -eq 'all') {
            $GetUrlParameters += @{scope='all'}
        }
        else {
        }
    }
    else {
        # Defaults to issues 'created' by the user.
    }

    $URLParameters = GetMethodParameters -GetURLParameters $GetUrlParameters

	switch($PSCmdlet.ParameterSetName) {
        'GroupID' { $Request.URI = "/groups/$GroupID/issues$URLParameters"; break; }
        'User' { $Request.URI = "/issues$URLParameters"; break; }
    }

	QueryGitLabAPI -Request $Request -ObjectType 'GitLab.Issue'
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Novitates Mycologicae 99 (1939)

#### Original name
Paxillus tricholoma var. subcinerea Velen.

### Remarks
null


text:
module Cryptoexchange::Exchanges
  module Extstock
    module Services
      class Trades < Cryptoexchange::Services::Market
        def fetch(market_pair)
          output = super(ticker_url(market_pair))
          adapt(output, market_pair)
        end

        def ticker_url(market_pair)
          "#{Cryptoexchange::Exchanges::Extstock::Market::API_URL}/trades/#{market_pair.base}_#{market_pair.target}"
        end

        def adapt(output, market_pair)
          output["data"].collect do |trade|
            tr = Cryptoexchange::Models::Trade.new
            tr.trade_id  = trade['trade_id']
            tr.base      = market_pair.base
            tr.target    = market_pair.target
            tr.market    = Extstock::Market::NAME
            tr.type      = trade['type']
            tr.price     = trade['price']
            tr.amount    = trade['base_volume']
            tr.timestamp = trade['trade_timestamp']
            tr.payload   = trade
            tr
          end
        end
      end
    end
  end
end


text:
|Build Status| |Documentation Status|

=======
seekret
=======

Go library and command line to seek for secrets on various sources.

************
Command Line
************

Description
===========

``seekret`` inspect different sources (files into a directory or git
repositories) to seek for secrets. It can be used to prevent that secrets are
published in exposed locations.

Installing seekret
==================

``seekret`` can be directly installed by using go get.

::

    go get github.com/apuigsech/seekret/cmd/seekret

The requirements for a success installation are:

 * pkg-config
 * golang >= 1.6
 * libgit2 >= 2.23

Usage
=====

General Options
~~~~~~~~~~~~~~~

::

    NAME:
       seekret - seek for secrets on various sources.

    USAGE:
       seekret [global options] command [command options] [arguments...]

    VERSION:
       0.0.1

    AUTHOR(S):
       Albert Puigsech Galicia <albert@puigsech.com>

    COMMANDS:
       seek:
         git    seek for seecrets on a git repository.
         dir    seek for seecrets on a directory.

    GLOBAL OPTIONS:
       --exception FILE, -x FILE    load exceptions from FILE.
       --rules PATH         PATH with rules. [$SEEKRET_RULES_PATH]
       --format value, -f value specify the output format. (default: "human")
       --known FILE, -k FILE  load known secrets from FILE.
       --workers value, -w value  number of workers used for the inspection (default: 4)
       --help, -h           show help
       --version, -v        print the version

``-x, --exception``

``--rules``

``-f, --format``

``-k, --known``

``-w, --workers``

Options for Git
~~~~~~~~~~~~~~~

::

    NAME:
       seekret git - seek for seecrets on a git repository.

    USAGE:
       seekret git [command options] [arguments...]

    CATEGORY:
       seek

    OPTIONS:
       --count value, -c value  (default: 0)

``-c, --count``

Options for Dir
~~~~~~~~~~~~~~~

::

    NAME:
       seekret dir - seek for seecrets on a directory.

    USAGE:
       seekret dir [command options] [arguments...]

    CATEGORY:
       seek

    OPTIONS:
       --recursive, -r
       --hidden

``-r, --recursive``

``-h, --hidden``

Examples
========

Scan all files from all commits in a local repo::

    seekret git /path/to/repo

Scan all files from all commits in a remote repo::

    seekret git http://github.com/apuigsech/seekret-exposed

Scan all files from the last commit in a local repo::

    seekret git --count 1 /path/to/repo

Scan all files (including hidden) in a local folder::

    seekret dir --recursive --hidden /path/to/dir

Hands-On
========

The repository seekret-secrets is prepare to test seekret, and can be used to
perform the following hands-on examples:

1. Inspect remote git repository::

    seekret --rules $GOPATH/src/github.com/apuigsech/seekret/rules/ git https://github.com/apuigsech/seekret-secrets.git

2. Inspect local got repository::

    git clone https://github.com/apuigsech/seekret-secrets.git /tmp/seekret-secrets
    seekret --rules $GOPATH/src/github.com/apuigsech/seekret/rules/ git /tmp/seekret-secrets

3. Inspect only the last 2 commits::

    seekret --rules $GOPATH/src/github.com/apuigsech/seekret/rules/ git -c 2 /tmp/seekret-secrets

4. Inspect with exceptions::

    seekret --rules $GOPATH/src/github.com/apuigsech/seekret/rules/ -x /tmp/seekret-secrets/.exception_1 git /tmp/seekret-secrets

*******
Library
*******

Importing seekret Library
=========================

::

    import seekret "github.com/apuigsech/seekret/lib"

Init Seekret context
====================

::

    s := seekret.NewSeekret()

Loading Rules
=============

::

    s.LoadRulesFromPath("/path/to/main/rues:/path/to/other/rules:/path/to/more/rules")

::

    s.LoadRulesFromDir("/path/to/rules")

::

    s.LoadRulesFromFile("/path/to/file.rule")

Loading Objects
===============

::

    opts := map[string]interface{} {
      "hidden": true,
      "recursive": false,
    }
    s.LoadObjects("dir", "/path/to/inspect", opts)

::

    opts := map[string]interface{} {
      "count": 10,
    }
    s.LoadObjects("dir", "/repo/to/inspect", opts)

Loading Exceptions
==================

::

    s.LoadExceptionsFromFile("/path/to/exceptions/file")

Inspect
=======

::

    s.Inspect(5)

Get Inspect Results
===================

::

    secretsList := s.ListSecrets()

*****
Rules
*****

Secret identification is performed by using a set of rules specified on the
rules files. Those files, with '.rule' extension are defined by using YAML
following this format:

::

    rulename:
      match: [regexp]
      unmatch:
        - [regexp]
        - [regexp]
        - ...

For the contents of a file is considered a secret, it must comply with the
'match' regexp and not comply ANY of the 'unmatch' reg rule and comply match
ANY of the unmatch.

**********
Exceptions
**********

Exceptions determine conditions under which content should not be considered
a secret. The exceptions are specified by using a YAML file that follows this
format:

::

      ...
    -
      rule: [rulename]
      object: [regexp]
      line: [linenumber]
      content: [regexp]
    -
      ...

The conditions are optional, so it is not necessary to specify them all, but
for a content deemed exception must meet all the specified conditions.

The meaning of the various conditions explained:

``rule``
Contains the name of the rule.

``object``
Contains a regexp that should match the object name (usually the filename).

``line``
Contains the line number into the object.

``content``
Contains a regexp that should match the content.

.. |Build Status| image:: https://travis-ci.org/apuigsech/seekret.svg
   :target: https://travis-ci.org/apuigsech/seekret
   :width: 88px
   :height: 20px
.. |Documentation Status| image:: https://godoc.org/github.com/apuigsech/seekret?status.svg
   :target: https://godoc.org/github.com/apuigsech/seekret
   :width: 88px
   :height: 20px


text:
<?php

namespace frontend\models\Search;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Advert;

/**
 * AdvertSearch represents the model behind the search form about `app\models\Advert`.
 */
class AdvertSearch extends Advert
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'price', 'fk_agent', 'bedroom', 'livingroom', 'parking', 'kitchen', 'hot', 'sold', 'recommend', 'createAt', 'ipdatedAt'], 'integer'],
            [['address', 'general_image', 'description', 'location', 'type'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Advert::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'price' => $this->price,
            'fk_agent' => $this->fk_agent,
            'bedroom' => $this->bedroom,
            'livingroom' => $this->livingroom,
            'parking' => $this->parking,
            'kitchen' => $this->kitchen,
            'hot' => $this->hot,
            'sold' => $this->sold,
            'recommend' => $this->recommend,
            'createAt' => $this->createAt,
            'ipdatedAt' => $this->ipdatedAt,
        ]);

        $query->andFilterWhere(['like', 'address', $this->address])
            ->andFilterWhere(['like', 'general_image', $this->general_image])
            ->andFilterWhere(['like', 'description', $this->description])
            ->andFilterWhere(['like', 'location', $this->location])
            ->andFilterWhere(['like', 'type', $this->type]);

        return $dataProvider;
    }
}


text:
/*
	this is the JS for the main jsPlumb demo.  it is shared between the YUI, jQuery and MooTools
	demo pages.
*/
;(function() {

	window.jsPlumbDemo = {

		init : function() {

			jsPlumb.DefaultDragOptions = { cursor: "pointer", zIndex:2000 };

			var connectorStrokeColor = "rgba(50, 50, 200, 1)",
				connectorHighlightStrokeColor = "rgba(180, 180, 200, 1)",
				hoverPaintStyle = { strokeStyle:"#7ec3d9" };			// hover paint style is merged on normal style, so you
			                                                        // don't necessarily need to specify a lineWidth

			//
			// connect window1 to window2 with a 13 px wide olive colored Bezier, from the BottomCenter of
			// window1 to 3/4 of the way along the top edge of window2.  give the connection a 1px black outline,
			// and allow the endpoint styles to derive their color and outline from the connection.
			// label it "Connection One" with a label at 0.7 of the length of the connection, and put an arrow that has a 50px
			// wide tail at a point 0.2 of the length of the connection.  we use 'cssClass' and 'endpointClass' to assign
			// our own css classes, and the Label overlay has three css classes specified for it too.  we also give this
			// connection a 'hoverPaintStyle', which defines the appearance when the mouse is hovering over it.
			//
			var connection1 = jsPlumb.connect({
				source:"window1",
			   	target:"window2",
				connector:"Bezier",
			   	cssClass:"c1",
			   	endpoint:"Blank",
			   	endpointClass:"c1Endpoint",
			   	anchors:["BottomCenter", [ 0.75, 0, 0, -1 ]],
			   	paintStyle:{
					lineWidth:6,
					strokeStyle:"#a7b04b",
					outlineWidth:1,
					outlineColor:"#666"
				},
				endpointStyle:{ fillStyle:"#a7b04b" },
			   	hoverPaintStyle:hoverPaintStyle,
			   	overlays : [ ["Label", {
			   					cssClass:"l1 component label",
			   					label : "Connection One",
			   					location:0.7,
			   					id:"label",
			   					events:{
									"click":function(label, evt) {
										alert("clicked on label for connection 1");
			   						}
			   					}
			   				  } ],
			   				["Arrow", {
			   					cssClass:"l1arrow",
				   				location:0.5, width:30
	   						}]
			]});

	        var w23Stroke = "rgb(189,11,11)";
	        var connection3 = jsPlumb.connect({
					source:"window2",
	      				target:"window3",
	      				paintStyle:{
							lineWidth:8,
							strokeStyle:w23Stroke,
							outlineColor:"#666",
							outlineWidth:1
						},
                        detachable:false,
	      				hoverPaintStyle:hoverPaintStyle,
	      				anchors:[ [ 0.3 , 1, 0, 1 ], "TopCenter" ],
	      				endpoint:"Rectangle",
	      				endpointStyles:[
	      		        	{ gradient : { stops:[[0, w23Stroke], [1, "#558822"]] }},
		    			{ gradient : {stops:[[0, w23Stroke], [1, "#882255"]] }}
		    		]
			});

			var connection2 = jsPlumb.connect({source:'window3', target:'window4',
		        				 paintStyle:{
	    				 		    lineWidth:10,
	    				 			strokeStyle:connectorStrokeColor,
	    				 			outlineColor:"#666",
	    				 			outlineWidth:1
	    				 		 },
		        				 hoverPaintStyle:hoverPaintStyle,
		        				 anchor:"AutoDefault",
                                 detachable:false,
		        				 endpointStyle:{
			        				 	gradient : {
			        				 		stops:[[0, connectorStrokeColor], [1, connectorHighlightStrokeColor]],
			        				 		offset:17.5,
			        				 		innerRadius:15
			        				 	},
			        				 	radius:35
			        			 },
		        				 label : function(connection) {
			        				 var d = new Date();
			        				 var fmt = function(n, m) { m = m || 10;  return (n < m ? new Array(("" + m).length - (""+n).length + 1).join("0") : "") + n; };
			        				 return (fmt(d.getHours()) + ":" + fmt(d.getMinutes()) + ":" + fmt(d.getSeconds())+ "." + fmt(d.getMilliseconds(), 100));
			        			 },
			        			 labelStyle:{
			        				 cssClass:"component label"
			        			 }
		        			});

            /*
            this connects window5 with window6 using a Flowchart connector that is painted green,
            with large Dot endpoints that are placed in the center of each element.  there is a
            label at the default location of 0.5, and the connection is marked as not being
            detachable.
             */
	        var conn4Color = "rgba(46,164,26,0.8)";
	        var connection4 = jsPlumb.connect({
		        						source:'window5',
		        						target:'window6',
		        						connector:"Flowchart",
		        						anchors:["Center", "Center"],
		        						paintStyle:{
											lineWidth:9,
											strokeStyle:conn4Color,
											outlineColor:"#666",
					 						outlineWidth:1,
					 						joinstyle:"round"
					 					},
		        						hoverPaintStyle:hoverPaintStyle,
                                        detachable:false,
		        						endpointsOnTop:false,
		        						endpointStyle:{ radius:95, fillStyle:conn4Color },
		        						labelStyle : { cssClass:"component label" },
		        						label : "big\nendpoints"
		        				});

	        var connection5 = jsPlumb.connect({
		        					source:"window4",
		        					target:"window5",
		        					anchors:["BottomRight", "TopLeft"],
		        					paintStyle:{
										lineWidth:7,
										strokeStyle:"rgb(131,8,135)",
//										outlineColor:"#666",
//						 				outlineWidth:1,
						 				dashstyle:"4 2",
						 				joinstyle:"miter"
	   								},
                                    tooltip:"This connection will appear dashed when using SVG or VML.  This effect is achieved through CSS - see the accompanying stylesheet for this demo",
		        					hoverPaintStyle:hoverPaintStyle,
		        					endpoint:["Image", {url:"../img/endpointTest1.png"}],
		        					connector:"Straight",
		        					endpointsOnTop:true,
									overlays:[ ["Label", {
													cssClass:"component label",
							    			        label : "4 - 5",
							    			        location:0.3
                                                }],
							    			    "Arrow"

									]});

			var stateMachineConnector = {
				connector:"StateMachine",
				paintStyle:{lineWidth:3,strokeStyle:"#056"},
				hoverPaintStyle:{strokeStyle:"#dbe300"},
				endpoint:"Blank",
				anchor:"Continuous",
				overlays:[ ["PlainArrow", {location:1, width:20, length:12} ]]
			};

			jsPlumb.connect({
				source:"window3",
				target:"window7"
			}, stateMachineConnector);

			jsPlumb.connect({
				source:"window7",
				target:"window3"
			}, stateMachineConnector);

			// jsplumb event handlers

			// double click on any connection
			jsPlumb.bind("dblclick", function(connection, originalEvent) { alert("double click on connection from " + connection.sourceId + " to " + connection.targetId); });
			// single click on any endpoint
			jsPlumb.bind("endpointClick", function(endpoint, originalEvent) { alert("click on endpoint on element " + endpoint.elementId); });
			// context menu (right click) on any component.
			jsPlumb.bind("contextmenu", function(component, originalEvent) {
                alert("context menu on component " + component.id);
                originalEvent.preventDefault();
                return false;
            });

			// make all .window divs draggable
			jsPlumb.draggable(jsPlumb.getSelector(".window"));

		}
	};
})();


text:
$(document).ready(function () {
    // use for searching an address
    // get the latitude and longitude
    // using Mapquest geo API
    $("#findLatLongBtn").click(function () {
        getPlaceCoordinates();
    });

    // use for submitting a html form
    // the form mut have post and method in place
    $('#addform').submit(function () {
        var name = $.trim($('#formName').val());
        // check for empty names
        if (name === '') {
            alert('Name field is empty.');
            return false;
        }
        // check for dates when not a date input type
        var dob = $.trim($('#formDateField').val());
        if ((dob === '') || (!isValidDate(dob))) {
            alert('Date field is empty or invalid.');
            return false;
        }
        // check for latitude and longitude
        var xlat = Number($.trim($('#formLatitude').val()));
        if ((xlat == NaN) || (xlat > 180) || (xlat < -180)) {
            alert('Latitude field is empty, invalid or out of range.');
            return false;
        }
        var xlng = Number($.trim($('#formLongitude').val()));
        if ((xlng == NaN) || (xlng > 180) || (xlng < -180)) {
            alert('Longitude field is empty, invalid or out of range.');
            return false;
        }
    });
});

// isValidDate check for date
function isValidDate(dateString) {
    var regEx = /^\d{4}-\d{2}-\d{2}$/;
    if (!dateString.match(regEx)) return false;
    var d = new Date(dateString);
    if (Number.isNaN(d.getTime())) return false;
    // no further checks
    return true;
}

// getPlaceCoordinates
function getPlaceCoordinates() {
    var address = $("#formAddress").val();
    // we are using MapQuest's Nominatim service
    var geocode = 'https://open.mapquestapi.com/geocoding/v1/address?key=some-key&format=json&location=' + address;
    // use jQuery to call the API and get the JSON results
    $.getJSON(geocode, function (data) {
        // get lat + lon from first match
        var latitude = data.results[0].locations[0].latLng.lat;
        var longitude = data.results[0].locations[0].latLng.lng;
        console.log("address=" + address + ", longitude=" + longitude);
        $("#addxlat").val(latitude);
        $("#addxlng").val(longitude);
    });
}


text:
{{ name }}

            <button md-mini-fab >
                <md-icon class="md-24">edit</md-icon>
            </button>

Birthday:

{{birthDay}}

Full Address:

{{fullAddress}}


text:
package org.apache.ignite.cache.store.jdbc.model;

import java.io.Serializable;

/**
 * OrganizationKey definition.
 */
public class OrganizationKey implements Serializable {
    /** */
    private static final long serialVersionUID = 0L;

    /** Value for id. */
    private Integer id;

    /**
     * Empty constructor.
     */
    public OrganizationKey() {
        // No-op.
    }

    /**
     * Full constructor.
     */
    public OrganizationKey(
        Integer id
    ) {
        this.id = id;
    }

    /**
     * Gets id.
     *
     * @return Value for id.
     */
    public Integer getId() {
        return id;
    }

    /**
     * Sets id.
     *
     * @param id New value for id.
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /** {@inheritDoc} */
    @Override public boolean equals(Object o) {
        if (this == o)
            return true;

        if (!(o instanceof OrganizationKey))
            return false;

        OrganizationKey that = (OrganizationKey)o;

        if (id != null ? !id.equals(that.id) : that.id != null)
            return false;

        return true;
    }

    /** {@inheritDoc} */
    @Override public int hashCode() {
        int res = id != null ? id.hashCode() : 0;

        return res;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return "OrganizationKey [id=" + id +
            "]";
    }
}


text:
import React from "react";
import {get} from "lodash";

export function renderCommitUrl (url) {
    return (url ? (
        {url.substring(url.indexOf("commit") + 7, url.indexOf("commit") + 14)}
    ) : null);
}

export function lastCommit (commits) {
    return get(commits, "0", null);
}


text:
<?php

/** @file
* @brief
*/

include ('../inc/includes.php');

$dropdown = new CartridgeItemType();
include (GLPI_ROOT . "/front/dropdown.common.php");
?>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Network;
using Network.Packets;
using Network.JsonConverters;
using JsonFx.Json;

namespace Network
{
	public class UserManager : IPacketManager
	{
		private static UserManager instance;

		private Dictionary<UserOperation, Action<object>> callbacks;

		public UserManager()
		{
			callbacks = new Dictionary<UserOperation, Action<object>>();
		}

		public void registerCallback(UserOperation operation, Action<object> callback) {
			this.registerCallback((int)operation, callback);
		}

		public void registerCallback(int operation, Action<object> callback) {

			UserOperation userOperation = (UserOperation)operation;

			if(callbacks.ContainsKey(userOperation)) {
				callbacks[userOperation] = callback;
			} else {
				callbacks.Add(userOperation, callback);
			}
		}

		public void handlePacket(int operation, string packet) {
			UserOperation key = (UserOperation)operation;

			if(callbacks.ContainsKey(key)) {
				Action<object> callback = callbacks[key];
				object _packet = this.Convert(operation, packet);
				callback.Invoke(_packet);
			}
		}

		public object Convert(int operation, string packet)
		{
			object _packet = null;
			UserOperation userOperation = (UserOperation)operation;

			JsonReader jsonReader = new JsonReader(packet);

			switch(userOperation)
			{
				case UserOperation.LOGIN:
					_packet = jsonReader.Deserialize<LoginReply>();
					break;
				case UserOperation.REGISTER:
					_packet = jsonReader.Deserialize<RegisterReply>();
					break;
                case UserOperation.CHARSELECT:
                case UserOperation.CREATECHAR:
                case UserOperation.DELETECHAR:
                case UserOperation.SELECTCHAR:
                    _packet = jsonReader.Deserialize<CharSelectPacket>();
                    break;
                default:
					break;
			}

			return _packet;
		}

		public static UserManager Instance
		{
			get {

				if(instance == null)
				{
					instance = new UserManager();
				}

				return instance;
			}
		}
	}
}


text:
package gov.nih.nci.cabig.caaers.domain;

import static gov.nih.nci.cabig.caaers.domain.DelayUnits.DAYS;
import static gov.nih.nci.cabig.caaers.domain.DelayUnits.HOURS;
import static gov.nih.nci.cabig.caaers.domain.DelayUnits.MINUTES;
import gov.nih.nci.cabig.caaers.CaaersTestCase;

import java.math.BigDecimal;

/**
 * @author Rhett Sutphin
 */

public class DelayUnitsTest extends CaaersTestCase {
    public void testMinutesToMinutes() throws Exception {
        assertEquals(new BigDecimal(34), MINUTES.toMinutes(new BigDecimal(34)));
    }

    public void testHoursToMinutes() throws Exception {
        assertEquals(new BigDecimal(180), HOURS.toMinutes(new BigDecimal(3)));
    }

    public void testDaysToMinutes() throws Exception {
        assertEquals(new BigDecimal(10080), DAYS.toMinutes(new BigDecimal(7)));
    }

    public void testMinutesFromMinutes() throws Exception {
        assertEquals(new BigDecimal(12), MINUTES.fromMinutes(new BigDecimal(12)));
    }

    public void testHoursFromMinutes() throws Exception {
        assertEquals(new BigDecimal(7), HOURS.fromMinutes(new BigDecimal(420)));
    }

    public void testDaysFromMinutes() throws Exception {
        assertEquals(new BigDecimal(2), DAYS.fromMinutes(new BigDecimal(2880)));
    }

    public void testMinutesIsExactMinutes() throws Exception {
        assertTrue(MINUTES.isExact(new BigDecimal(9)));
        assertFalse(MINUTES.isExact(new BigDecimal("9.1")));
    }

    public void testHoursIsExact() throws Exception {
        assertTrue(HOURS.isExact(new BigDecimal(60)));
        assertTrue(HOURS.isExact(new BigDecimal(240)));
        assertTrue(HOURS.isExact(new BigDecimal(0)));
        assertFalse(HOURS.isExact(new BigDecimal(220)));
        assertFalse(HOURS.isExact(new BigDecimal("59.7")));
    }

    public void testDaysIsExact() throws Exception {
        assertTrue(HOURS.isExact(new BigDecimal(1440)));
        assertTrue(HOURS.isExact(new BigDecimal(2880)));
        assertTrue(HOURS.isExact(new BigDecimal(0)));
        assertFalse(HOURS.isExact(new BigDecimal(1)));
        assertFalse(HOURS.isExact(new BigDecimal(1441)));
        assertFalse(HOURS.isExact(new BigDecimal("1440.2")));
    }

    public void testDisplayName() throws Exception {
        assertEquals("Hours", HOURS.getDisplayName());
        assertEquals("Minutes", MINUTES.getDisplayName());
        assertEquals("Days", DAYS.getDisplayName());
    }
}


text:
from photorename.photorename import rename

def main():
    rename()


text:
layout: post
microblog: true
date: 2009-06-23 03:00 +0300
guid: http://desparoz.micro.blog/2009/06/23/t2301459371.html
---
Off to the pool this morning. 2nd last day of this PADI Instructor Course in Fremantle. [www.divingidc.com/padi-idc/](http://www.divingidc.com/padi-idc/)