text:
package org.globsframework.model.globaccessor.set;

import org.globsframework.model.MutableGlob;

public interface GlobSetLongAccessor extends GlobSetAccessor {

    void setNative(MutableGlob glob, long value);

    void set(MutableGlob glob, Long value);

}

redpajama_set_name: RedPajamaGithub


text:
class DashboardController < ApplicationController
  restrict_to :user

  def index
    @projects = ProjectPermission.find_all_projects_for_user(current_user)
  end
end


text:
  Close

Address Book

Add a new entry

      Empty. Create an alias for your addresses

        {{success|translate}}

          Entry
          Creator
          Date
          Visible

          {{info.label}}

          {{::addr}}

        {{$root.wallet.publicKeyRing.nicknameForCopayer(info.copayerId)}}
        <time>{{::info.createdTs | amCalendar}}</time>

    <form ng-show="showForm" class="m0" name="addressBookForm"
      ng-disabled="loading"
      ng-submit="submitAddressBook(addressBookForm)" novalidate>

          {{error|translate}}

        Address
          Required

          Not valid

        <input type="text" name="newaddress"
        placeholder="{{'Address'|translate}}" ng-model="newaddress" valid-address required>

      Label
        Required

          <input type="text" name="newlabel"
          placeholder="{{'Label'|translate}}" ng-model="newlabel" required>

      Cancel
      <button class="primary right"
        ng-disabled="addressBookForm.$invalid || loading"
        ng-click="submitAddressBook(addressBookForm)">{{'Add'|translate}}</button>
    </form>

       Add entry


text:
layout: home
excerpt: "HeartWear: Never Miss a Beat"
share: FALSE
tags:
image:
  feature: hwbanner1.png
  credit: Lexie & RRC
  creditlink:
---

# Get your loved one the help they need before a medical event happens.
Heart failure (HF) affects almost 5 million patients in the United States and is a leading cause of morbidity and mortality.

Rapid and irregular heartrate - otherwise known as tachycardia, like HF, affects millions of patients and markedly increases in prevalence with age.

A single tachycardic event may reduce a patient's quality of life, functional status, and may cause permant damange to the muscles of the heart.  As the US population ages, the number of patients afflicted with tachycardia and heart failure will continue to grow.

## Never Miss A Beat.
Harnessing the power of widely availible and fitness trackers, HeartWear connects you to your loved one's heartbeat.

With this technology the wearer's heartrate will be monitored around the clock.  Using Google Cloud Messaging and NFC, we can alert you, as your loved one's designated emergency contact, that their heart rate has reached a dangeous level indicative of a tachycardiac event.

**Github Project Link**
[Heart Wear](https://github.com/nlinscott/heartwear)

**References.**
Pulignano, Giovanni, et al. "Clinical features and outcomes of elderly outpatients with heart failure followed up in hospital cardiology units: data from a large nationwide cardiology database (IN-CHF Registry)." American heart journal 143.1 (2002): 45-55.


text:
/**
 * a part of mod_websocket
 **/

#ifndef _MOD_WEBSOCKET_CONFIG_H_
#define _MOD_WEBSOCKET_CONFIG_H_

// a key of environment var
#define	MOD_WEBSOCKET_CONFIG_PATH	"MOD_WEBSOCKET_CONFIG_PATH"

typedef enum {
    HOST,
    PORT,
    TYPE,
    SUBPROTO,
    LOCALE,
    ORIGINS
} mod_websocket_key_t;

typedef struct {
    mod_websocket_key_t key;
    void *val;
} mod_websocket_assign_t;

typedef struct _mod_websocket_origin_list_t {
    char *origin;
    struct _mod_websocket_origin_list_t *next;
} mod_websocket_origin_t;

typedef struct _mod_websocket_backend_t {
    char *host;					// IPAddr or FQDN
    int port;					// port number
    int type;					// 0: text, 1: binary
    char *subproto;				// null if not set
    mod_websocket_origin_t *origins;		// null if not set
    char *locale;				// null if not set
    struct _mod_websocket_backend_t *next;	// exists at least 1 object
} mod_websocket_backend_t;

typedef struct _mod_websocket_resource_t {
    char *key;
    mod_websocket_backend_t *backends;
    struct _mod_websocket_resource_t *next;
} mod_websocket_resource_t;

typedef struct {
    mod_websocket_resource_t *resources;
    int ping_interval;
    int timeout;
    int debug;
} mod_websocket_config_t;

#ifdef  __cplusplus
extern "C" {
#endif

    mod_websocket_config_t *mod_websocket_config_parse(const char *);
    void mod_websocket_config_free(mod_websocket_config_t *);
    void mod_websocket_config_print(mod_websocket_config_t *);

#ifdef  __cplusplus
}
#endif

#endif /* _MOD_WEBSOCKET_CONFIG_H_ */


text:
namespace BrainFuckInterpreterLib
{
    internal enum SyntaxError
    {
        None = 0,
        UnbalancedSquareBraces = 1,
        UnexpectedClosingSquareBrace = 2
    }
}


text:
package jwt

import (
	"crypto/subtle"
	"fmt"
	"time"
)

// Claims must just have a Valid method that determines
// if the token is invalid for any supported reason
type Claims interface {
	Valid() error
}

// RegisteredClaims are a structured version of the JWT Claims Set,
// restricted to Registered Claim Names, as referenced at
// https://datatracker.ietf.org/doc/html/rfc7519#section-4.1
//
// This type can be used on its own, but then additional private and
// public claims embedded in the JWT will not be parsed. The typical usecase
// therefore is to embedded this in a user-defined claim type.
//
// See examples for how to use this with your own claim types.
type RegisteredClaims struct {
	// the `iss` (Issuer) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.1
	Issuer string `json:"iss,omitempty"`

	// the `sub` (Subject) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2
	Subject string `json:"sub,omitempty"`

	// the `aud` (Audience) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3
	Audience ClaimStrings `json:"aud,omitempty"`

	// the `exp` (Expiration Time) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
	ExpiresAt *NumericDate `json:"exp,omitempty"`

	// the `nbf` (Not Before) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.5
	NotBefore *NumericDate `json:"nbf,omitempty"`

	// the `iat` (Issued At) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.6
	IssuedAt *NumericDate `json:"iat,omitempty"`

	// the `jti` (JWT ID) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7
	ID string `json:"jti,omitempty"`
}

// Valid validates time based claims "exp, iat, nbf".
// There is no accounting for clock skew.
// As well, if any of the above claims are not in the token, it will still
// be considered a valid claim.
func (c RegisteredClaims) Valid() error {
	vErr := new(ValidationError)
	now := TimeFunc()

	// The claims below are optional, by default, so if they are set to the
	// default value in Go, let's not fail the verification for them.
	if !c.VerifyExpiresAt(now, false) {
		delta := now.Sub(c.ExpiresAt.Time)
		vErr.Inner = fmt.Errorf("token is expired by %v", delta)
		vErr.Errors |= ValidationErrorExpired
	}

	if !c.VerifyIssuedAt(now, false) {
		vErr.Inner = fmt.Errorf("token used before issued")
		vErr.Errors |= ValidationErrorIssuedAt
	}

	if !c.VerifyNotBefore(now, false) {
		vErr.Inner = fmt.Errorf("token is not valid yet")
		vErr.Errors |= ValidationErrorNotValidYet
	}

	if vErr.valid() {
		return nil
	}

	return vErr
}

// VerifyAudience compares the aud claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *RegisteredClaims) VerifyAudience(cmp string, req bool) bool {
	return verifyAud(c.Audience, cmp, req)
}

// VerifyExpiresAt compares the exp claim against cmp (cmp < exp).
// If req is false, it will return true, if exp is unset.
func (c *RegisteredClaims) VerifyExpiresAt(cmp time.Time, req bool) bool {
	if c.ExpiresAt == nil {
		return verifyExp(nil, cmp, req)
	}

	return verifyExp(&c.ExpiresAt.Time, cmp, req)
}

// VerifyIssuedAt compares the iat claim against cmp (cmp >= iat).
// If req is false, it will return true, if iat is unset.
func (c *RegisteredClaims) VerifyIssuedAt(cmp time.Time, req bool) bool {
	if c.IssuedAt == nil {
		return verifyIat(nil, cmp, req)
	}

	return verifyIat(&c.IssuedAt.Time, cmp, req)
}

// VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf).
// If req is false, it will return true, if nbf is unset.
func (c *RegisteredClaims) VerifyNotBefore(cmp time.Time, req bool) bool {
	if c.NotBefore == nil {
		return verifyNbf(nil, cmp, req)
	}

	return verifyNbf(&c.NotBefore.Time, cmp, req)
}

// VerifyIssuer compares the iss claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *RegisteredClaims) VerifyIssuer(cmp string, req bool) bool {
	return verifyIss(c.Issuer, cmp, req)
}

// StandardClaims are a structured version of the JWT Claims Set, as referenced at
// https://datatracker.ietf.org/doc/html/rfc7519#section-4. They do not follow the
// specification exactly, since they were based on an earlier draft of the
// specification and not updated. The main difference is that they only
// support integer-based date fields and singular audiences. This might lead to
// incompatibilities with other JWT implementations. The use of this is discouraged, instead
// the newer RegisteredClaims struct should be used.
//
// Deprecated: Use RegisteredClaims instead for a forward-compatible way to access registered claims in a struct.
type StandardClaims struct {
	Audience  string `json:"aud,omitempty"`
	ExpiresAt int64  `json:"exp,omitempty"`
	Id        string `json:"jti,omitempty"`
	IssuedAt  int64  `json:"iat,omitempty"`
	Issuer    string `json:"iss,omitempty"`
	NotBefore int64  `json:"nbf,omitempty"`
	Subject   string `json:"sub,omitempty"`
}

// Valid validates time based claims "exp, iat, nbf". There is no accounting for clock skew.
// As well, if any of the above claims are not in the token, it will still
// be considered a valid claim.
func (c StandardClaims) Valid() error {
	vErr := new(ValidationError)
	now := TimeFunc().Unix()

	// The claims below are optional, by default, so if they are set to the
	// default value in Go, let's not fail the verification for them.
	if !c.VerifyExpiresAt(now, false) {
		delta := time.Unix(now, 0).Sub(time.Unix(c.ExpiresAt, 0))
		vErr.Inner = fmt.Errorf("token is expired by %v", delta)
		vErr.Errors |= ValidationErrorExpired
	}

	if !c.VerifyIssuedAt(now, false) {
		vErr.Inner = fmt.Errorf("token used before issued")
		vErr.Errors |= ValidationErrorIssuedAt
	}

	if !c.VerifyNotBefore(now, false) {
		vErr.Inner = fmt.Errorf("token is not valid yet")
		vErr.Errors |= ValidationErrorNotValidYet
	}

	if vErr.valid() {
		return nil
	}

	return vErr
}

// VerifyAudience compares the aud claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool {
	return verifyAud([]string{c.Audience}, cmp, req)
}

// VerifyExpiresAt compares the exp claim against cmp (cmp < exp).
// If req is false, it will return true, if exp is unset.
func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
	if c.ExpiresAt == 0 {
		return verifyExp(nil, time.Unix(cmp, 0), req)
	}

	t := time.Unix(c.ExpiresAt, 0)
	return verifyExp(&t, time.Unix(cmp, 0), req)
}

// VerifyIssuedAt compares the iat claim against cmp (cmp >= iat).
// If req is false, it will return true, if iat is unset.
func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
	if c.IssuedAt == 0 {
		return verifyIat(nil, time.Unix(cmp, 0), req)
	}

	t := time.Unix(c.IssuedAt, 0)
	return verifyIat(&t, time.Unix(cmp, 0), req)
}

// VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf).
// If req is false, it will return true, if nbf is unset.
func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool {
	if c.NotBefore == 0 {
		return verifyNbf(nil, time.Unix(cmp, 0), req)
	}

	t := time.Unix(c.NotBefore, 0)
	return verifyNbf(&t, time.Unix(cmp, 0), req)
}

// VerifyIssuer compares the iss claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool {
	return verifyIss(c.Issuer, cmp, req)
}

// ----- helpers

func verifyAud(aud []string, cmp string, required bool) bool {
	if len(aud) == 0 {
		return !required
	}
	// use a var here to keep constant time compare when looping over a number of claims
	result := false

	var stringClaims string
	for _, a := range aud {
		if subtle.ConstantTimeCompare([]byte(a), []byte(cmp)) != 0 {
			result = true
		}
		stringClaims = stringClaims + a
	}

	// case where "" is sent in one or many aud claims
	if len(stringClaims) == 0 {
		return !required
	}

	return result
}

func verifyExp(exp *time.Time, now time.Time, required bool) bool {
	if exp == nil {
		return !required
	}
	return now.Before(*exp)
}

func verifyIat(iat *time.Time, now time.Time, required bool) bool {
	if iat == nil {
		return !required
	}
	return now.After(*iat) || now.Equal(*iat)
}

func verifyNbf(nbf *time.Time, now time.Time, required bool) bool {
	if nbf == nil {
		return !required
	}
	return now.After(*nbf) || now.Equal(*nbf)
}

func verifyIss(iss string, cmp string, required bool) bool {
	if iss == "" {
		return !required
	}
	if subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 {
		return true
	} else {
		return false
	}
}


text:
These dotfiles configure my personal system, and helps me get everything up and running with my configuration/preferences.

## 1. Install

```markdown
git clone https://github.com/davidochoa/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
setup/init.sh
```

## 2. Backup

Please refer to the [Backup readme](README-backup.md)

## 3. Apps

Please refer to the [Apps readme](README-apps.md)


text:
package empleados.domain;

public class Escritor extends Empleado {

	private int tipoDeEscritura = 2;

	public Escritor() {
		super(null);
	}

	public Escritor(String nombre, String puesto, int nivel) {
		this(nombre, puesto, nivel, 2, 0.0); // manda a llamar el contructor de
												// esta clase
	}

	/**
	 * Tambien podemos recibir el tipo de escritura
	 * @param nombre
	 * @param puesto
	 * @param nivel
	 * @param tipoDeEscritura
	 */

	public Escritor(String nombre, String puesto, int nivel,
			int tipoDeEscritura, double sueldo) {
		super(nombre, puesto, nivel, sueldo);
		this.tipoDeEscritura = tipoDeEscritura; // atributo particular a este
												// clase
	}

	public int getTipoDeEscritura() {
		return tipoDeEscritura;
	}

	public void setTipoDeEscritura(int tipoDeEscritura) {
		this.tipoDeEscritura = tipoDeEscritura;
	}

	public String getTipoDeEscrituraEnTexto() {
		if (this.tipoDeEscritura == 1) {
			return "Escritura a Mano";
		} else if (this.tipoDeEscritura == 2) {
			return "Escritura a Computadora";
		} else {
			return "Metodo de Escritura no definido";
		}
	}

	public void desplegarInformacion() {
		System.out.println("Nombre del Empleado: " + this.nombre);
		System.out.println("Puesto: " + this.puesto);
		System.out.println("Nivel: " + this.nivel);
		System.out.println("Tipo de Escritura: " + this.tipoDeEscritura);

	}

	public String obtenerDetalles() {
		return super.obtenerDetalles() + ", Tipo de Escritura="
				+ tipoDeEscritura + "]";
	}

}


text:
import resolveArrayValue from '../resolveArrayValue'

describe('Resolving array values', () => {
  it('should return a concatenated css value', () => {
    expect(resolveArrayValue('width', ['300px', '100px'])).toEqual(
      '300px;width:100px'
    )
  })

  it('should hyphenate property names', () => {
    expect(resolveArrayValue('WebkitFlex', [1, 2, 3])).toEqual(
      '1;-webkit-flex:2;-webkit-flex:3'
    )
  })
})


text:
<!DOCTYPE html >

          <title>Bs3LinkedListGroup - net.liftmodules.FoBoBs.snippet.FoBo.Bs3LinkedListGroup</title>
          <meta name="description" content="Bs3LinkedListGroup - net.liftmodules.FoBoBs.snippet.FoBo.Bs3LinkedListGroup" />
          <meta name="keywords" content="Bs3LinkedListGroup net.liftmodules.FoBoBs.snippet.FoBo.Bs3LinkedListGroup" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

net.liftmodules.FoBoBs.snippet.FoBo

Bs3LinkedListGroup

            Related Docs:
            object Bs3LinkedListGroup
            | package FoBo

        trait

        Bs3LinkedListGroup extends FlexMenuBuilder with DispatchSnippet

Bs3LinkedListGroup Snippet Bootstrap v3.x

This snippet object transforms lift SiteMap menu items associated with a specified loc
group name's into a collection of Bootstrap list group items.

This is a simple but flexible list group item snippet that can be used when constructing list group menus.
The current implementation is flat and dose not support transformation of Lift PlaceHolder's and submenu's as for example
the BsNavbar dose nor dose it support transformations into menu headers or menu dividers as the Bootstrap v2 TBNavlist
but you can of course add your own menu section header's between loc groups in the list group as shown in the example below.

Snippet Usage:

<span data-lift="FoBo.Bs3LinkedListGroup.builder?group=[LocGroup name]"></span>

Snippet Params:

Param group - The LocGroup name

Result: The above will result in

<a class="list-group-item active" href="[current active loc link url]">[Loc link text]</a>
<a class="list-group-item" href="[loc link url]">[Loc link text]</a>
 :

This will be expand into a twitter bootstrap navlist's built from the named
Lift menu locGroup content.

Example - Linked list group with several linked list (loc) groups combined and enclosed in a list group div with a
application specific styled menu section header before the last group.

<d i v class="list-group">
      <span data-lift="FoBo.Bs3LinkedListGroup.builder?group=lg1"></span>
      <span data-lift="FoBo.Bs3LinkedListGroup.builder?group=user"></span>
      <span class="list-group-item mylgheader">Example menu section header</span>
      <span data-lift="FoBo.Bs3LinkedListGroup.builder?group=lg2"></span>
       :
</d i v>

Result: This will create a list group of linked items associated with the specified
LocGroup names 'lg1, user, lg2, ...'.

Since

v1.1

          Linear Supertypes

DispatchSnippet, FlexMenuBuilder, AnyRef, Any

            Known Subclasses

Bs3LinkedListGroup

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

Bs3LinkedListGroup

DispatchSnippet

FlexMenuBuilder

AnyRef

Any

Hide All

Show all

            Visibility

Public

All

Type Members

        type

        DispatchIt = PartialFunction[String, (NodeSeq) ⇒ NodeSeq]

Definition Classes

DispatchSnippet

        type

        StructBuildItem = AnyRef { def buildItem(kids: List[net.liftweb.sitemap.MenuItem],current: Boolean,path: Boolean): net.liftweb.common.Box[net.liftweb.sitemap.MenuItem] }

Definition Classes

FlexMenuBuilder

Value Members

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        buildInnerTag(contents: NodeSeq, path: Boolean, current: Boolean): Elem

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        buildItemMenu[A](loc: Loc[A], currLoc: Box[Loc[_]], expandAll: Boolean): List[MenuItem]

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        buildTBDivider(contents: NodeSeq, path: Boolean, current: Boolean): Elem

        def

        buildTBNavHeader(contents: NodeSeq, path: Boolean, current: Boolean): Elem

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        def

        dispatch: DispatchIt

Definition Classes

Bs3LinkedListGroup → DispatchSnippet

        def

        emptyGroup: NodeSeq

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        emptyMenu: NodeSeq

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        emptyPlaceholder: NodeSeq

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        expandAll: Boolean

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        expandAny: Boolean

Attributes

protected

Definition Classes

FlexMenuBuilder

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        def

        linkToSelf: Boolean

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        def

        overridenDispatch: DispatchIt

        def

        render: NodeSeq

Definition Classes

FlexMenuBuilder

        def

        renderItem(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        renderItemInPath(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        renderItemWithInfo(info: List[Box[Function0[_]]], renderInner: (Seq[MenuItem]) ⇒ NodeSeq, item: MenuItem): Elem

        def

        renderLink(uri: NodeSeq, text: NodeSeq, path: Boolean, current: Boolean): NodeSeq

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        renderLinkWithTarget(uri: NodeSeq, text: NodeSeq, path: Boolean, current: Boolean, f: Function0[_]): NodeSeq

        def

        renderOuterTag(inner: NodeSeq, top: Boolean): NodeSeq

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        renderPlaceholder(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        renderSelf(item: MenuItem): NodeSeq

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        renderSelfLinked(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        renderSelfNotLinked(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        renderWhat(expandAll: Boolean): Seq[MenuItem]

Attributes

protected

Definition Classes

FlexMenuBuilder

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toRender: Seq[MenuItem]

Definition Classes

FlexMenuBuilder

        def

        toString(): String

Definition Classes

AnyRef → Any

        def

        updateForCurrent(nodes: Elem, current: Boolean): Elem

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        def

        updateForPath(nodes: Elem, path: Boolean): Elem

Definition Classes

Bs3LinkedListGroup → FlexMenuBuilder

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from DispatchSnippet

Inherited from FlexMenuBuilder

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
/**
 * Created by Florin Chelaru ( florin [dot] chelaru [at] gmail [dot] com )
 * Date: 9/9/2015
 * Time: 1:41 PM
 */

goog.provide('vs.directives.Window');

/**
 * @constructor
 * @extends {ngu.Directive}
 */
vs.directives.Window = function() {
  ngu.Directive.apply(this, arguments);

  /**
   * @type {jQuery}
   * @private
   */
  this._$window = null;
};

goog.inherits(vs.directives.Window, ngu.Directive);

/**
 * @type {jQuery}
 * @name vs.directives.Window#$window
 */
vs.directives.Window.prototype.$window;

Object.defineProperties(vs.directives.Window.prototype, {
  '$window': { get: /** @type {function (this:vs.directives.Window)} */ (function() { return this._$window; })}
});

/**
 * @type {{pre: (undefined|function(angular.Scope, jQuery, angular.Attributes, (*|undefined))), post: (undefined|function(angular.Scope, jQuery, angular.Attributes, (*|undefined)))}|function(angular.Scope, jQuery, angular.Attributes, (*|undefined))}
 */
vs.directives.Window.prototype.link = {
  'pre': function($scope, $element, $attrs, controller) {
    ngu.Directive.prototype.link['pre'].apply(this, arguments);
    var $window = $('

').appendTo($element.parent());
    var style = $scope.$eval($attrs['vsStyle'] || '{}');

    var box = {
      'top': style['top'] || ($element.css('top') ? (parseInt($element.css('top'), 10) + parseInt($window.css('padding-top'), 10)) + 'px' : undefined),
      'left': style['left'] || $element.css('left') || undefined,
      'bottom': style['bottom'] || $element.css('bottom') || undefined,
      'right': style['right'] || $element.css('right') || undefined,
      'width': style['width'] || ($element.width() + 'px'),
      'height': style['height'] || ($element.height() + 'px')
    };

    /*$window.css({
      'top': (parseInt($element.css('top'), 10) + parseInt($window.css('padding-top'), 10)) + 'px',
      'left': $element.css('left'),
      'bottom': $element.css('bottom'),
      'right': $element.css('right')
    });*/
    $window.css(box);

    $element.css({
      'top': '',
      'left': '',
      'bottom': '',
      'right': ''
    });

    $window.append($element);

    // Bring to front when selected
    $window.on('mousedown', function() {
      $window.siblings().css('zIndex', 0);
      $window.css('zIndex', 1);
    });

    this._$window = $window;
  },
  'post': ngu.Directive.prototype.link['post']
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2013 SlimRoms Project

     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.
-->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
    android:title="@string/status_bar_clock_title">

       <SwitchPreference
            android:key="status_bar_show_clock"
            android:title="@string/status_bar_show_clock_title"
            android:defaultValue="true" />

        <com.android.settings.cyanogenmod.SystemSettingSwitchPreference
            android:key="clock_use_second"
            android:title="@string/status_bar_show_clock_second_title"
            android:defaultValue="false"
            android:dependency="status_bar_show_clock" />

        <com.android.settings.widget.SeekBarPreferenceCham
            android:key="font_size_clock"
            android:title="@string/clock_font_size_title"
            android:defaultValue="14"
            android:max="23"
            settings:min="4"
            settings:unitsLeft=""
            settings:unitsRight="dp"
            android:dependency="status_bar_show_clock" />

        <net.margaritov.preference.colorpicker.ColorPickerPreference
            android:key="clock_color"
            android:title="@string/clock_color_title"
            android:defaultValue="0xffffff"
            android:dependency="status_bar_show_clock" />

         <ListPreference
             android:key="font_style"
             android:entries="@array/clock_font_style_entries"
             android:entryValues="@array/clock_font_style_values"
             android:title="@string/clock_font_style_title"
             android:dependency="status_bar_show_clock" />

        <ListPreference
            android:key="clock_style"
            android:entries="@array/clock_style_entries"
            android:entryValues="@array/clock_style_values"
            android:title="@string/clock_title_enable"
            android:dependency="status_bar_show_clock" />

        <ListPreference
            android:key="status_bar_am_pm"
            android:dialogTitle="@string/status_bar_am_pm_title"
            android:title="@string/status_bar_am_pm_title"
            android:entries="@array/entries_status_bar_am_pm"
            android:entryValues="@array/values_status_bar_am_pm"
            android:dependency="status_bar_show_clock" />

        <ListPreference
            android:key="clock_date_display"
            android:title="@string/clock_date_display"
            android:summary="@string/clock_date_display_summary"
            android:entries="@array/clock_date_display_entries"
            android:entryValues="@array/clock_date_display_values"
            android:dependency="status_bar_show_clock" />

        <ListPreference
            android:key="clock_date_position"
            android:title="@string/clock_date_position"
            android:entries="@array/clock_date_position_entries"
            android:entryValues="@array/clock_date_position_values"
            android:dependency="status_bar_show_clock" />

        <ListPreference
            android:key="clock_date_style"
            android:title="@string/clock_date_style"
            android:entries="@array/clock_date_style_entries"
            android:entryValues="@array/clock_date_style_values"
            android:dependency="status_bar_show_clock" />

        <ListPreference
            android:key="clock_date_format"
            android:title="@string/clock_date_format"
            android:entries="@array/clock_date_format_entries_values"
            android:entryValues="@array/clock_date_format_entries_values"
            android:dependency="status_bar_show_clock" />

</PreferenceScreen>


text:
#ifndef lnav_file_range_hh
#define lnav_file_range_hh

#include <sys/types.h>

#include "intern_string.hh"

using file_off_t = int64_t;
using file_size_t = uint64_t;
using file_ssize_t = int64_t;

class file_range {
public:
    struct metadata {
        bool m_valid_utf{true};
        bool m_has_ansi{false};
    };

    file_off_t fr_offset{0};
    file_ssize_t fr_size{0};
    metadata fr_metadata;

    void clear()
    {
        this->fr_offset = 0;
        this->fr_size = 0;
    }

    ssize_t next_offset() const { return this->fr_offset + this->fr_size; }

    bool empty() const { return this->fr_size == 0; }
};

struct source_location {
    source_location()
        : sl_source(intern_string::lookup("unknown")), sl_line_number(0)
    {
    }

    explicit source_location(intern_string_t source, int32_t line = 0)
        : sl_source(source), sl_line_number(line)
    {
    }

    intern_string_t sl_source;
    int32_t sl_line_number;
};

#endif


text:
"""change index_vm_valid_profiles_cd_ref to unique index

Revision ID: 7471f51011c8
Revises: 1eb624249f2b
Create Date: 2021-11-08 10:59:23.047142

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '7471f51011c8'
down_revision = '1eb624249f2b'
branch_labels = None
depends_on = None

def upgrade():
    op.execute("DROP INDEX gn_profiles.index_vm_valid_profiles_cd_ref")
    op.execute("CREATE UNIQUE INDEX index_vm_valid_profiles_cd_ref ON gn_profiles.vm_valid_profiles USING btree (cd_ref)")

def downgrade():
    op.execute("DROP INDEX gn_profiles.index_vm_valid_profiles_cd_ref")
    op.execute("CREATE INDEX index_vm_valid_profiles_cd_ref ON gn_profiles.vm_valid_profiles USING btree (cd_ref)")


text:
package io.mycat.config.util;

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

import org.slf4j.Logger; import org.slf4j.LoggerFactory;

import io.mycat.config.model.SystemConfig;

/**
 *
 * @author yanglixue
 *
 */
public class DnPropertyUtil {

	private static final Logger LOGGER = LoggerFactory.getLogger("DnPropertyUtil");

	/**
	 * 加载dnindex.properties属性文件
	 * @return 属性文件
	 */
	public static Properties loadDnIndexProps() {
		Properties prop = new Properties();
		File file = new File(SystemConfig.getHomePath(), "conf"
				+ File.separator + "dnindex.properties");
		if (!file.exists()) {
			return prop;
		}
		FileInputStream filein = null;
		try {
			filein = new FileInputStream(file);
			prop.load(filein);
		} catch (Exception e) {
			LOGGER.warn("load DataNodeIndex err:" + e);
		} finally {
			if (filein != null) {
				try {
					filein.close();
				} catch (IOException e) {
				}
			}
		}
		return prop;
	}

}


text:
import { NativeScriptModule } from "nativescript-angular/platform";
import { NgModule } from "@angular/core";
import { NativeScriptHttpModule } from "nativescript-angular/http";
import { NativeScriptRouterModule } from "nativescript-angular/router";

import { appRoutes } from "./app.routing";
import { AppComponent } from "./app.component";

import { registerElement } from 'nativescript-angular/element-registry';

registerElement('TNSOTPublisher', () => require('nativescript-opentok').TNSOTPublisher);
registerElement("TNSOTSubscriber", () => require("nativescript-opentok").TNSOTSubscriber);

@NgModule({
  providers: [],
  imports: [
    NativeScriptModule,
    NativeScriptHttpModule,
    NativeScriptRouterModule,
    NativeScriptRouterModule.forRoot(appRoutes),
  ],
  declarations: [
      AppComponent,
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }


text:
author: Jeff Van Campen
comments: true
date: 2009-11-20 18:14:55+00:00
layout: post
slug: vonnegut-after-dresden
title: Vonnegut after Dresden
wordpress_id: 672
category: notes
tags:
- Dresden
- Kurt Vonnegut
- trauma
- World War II
---

The superb [Letters of Note](http://www.lettersofnote.com/) has a remarkable letter written by a young Kurt Vonnegut to his family shortly after the bombing of Dresden.

> On about February 14th the Americans came over, followed by the R.A.F. their combined labors killed 250,000 people in twenty-four hours and destroyed all of Dresden -- possibly the world's most beautiful city. But not me.
>
> After that we were put to work carrying corpses from Air-Raid shelters; women, children, old men; dead from concussion, fire or suffocation. Civilians cursed us and threw rocks as we carried bodies to huge funeral pyres in the city.

This was a key and traumatic event in Vonnegut's life, but he is almost casual in his description the carpet bombing of Dresden and its aftermath. I guess this is the nature of trauma: we hold things at a distance until we are better able to deal with them. It took Vonnegut over 20 years.

So it goes.


text:
<?php

$I = new FunctionalTester($scenario);
$I->am('Nook member');
$I->wantTo('post a status to my profile');

$I->signIn();

$I->amOnPage('statuses');

$I->postAStatus('my first status');

$I->seeCurrentUrlEquals('/statuses');
$I->see('my first status');


text:
import { resolve } from 'node:path'
import { strictEqual, doNotThrow, truthy } from 'source/common/verify.js'

import {
  findUpPackageRoot,
  getPathNpmExecutable, getSudoArgs,
  getPathNpmGlobalRoot, fromGlobalNodeModules,
  getPathNpm, fromNpmNodeModules,
  hasRepoVersion
} from './npm.js'

const { describe, it, info = console.log } = globalThis

describe('Node.Module.Software.npm', () => {
  it('findUpPackageRoot()', () => {
    strictEqual(
      findUpPackageRoot(__dirname),
      resolve(__dirname, '../../../../')
    )

    // console.log(require.resolve('@dr-js/core/module/common/verify'))
    strictEqual(
      findUpPackageRoot(require.resolve('@dr-js/core/module/common/verify')),
      resolve(__dirname, __dirname.includes('output-gitignore') ? '../' : './', '../../../../node_modules/@dr-js/core/')
    )

    strictEqual(
      findUpPackageRoot('/not/exist/path/'),
      undefined
    )
  })

  it('getPathNpmExecutable()', () => {
    doNotThrow(getPathNpmExecutable)

    info(`[getPathNpmExecutable] ${getPathNpmExecutable()}`)
  })

  it('getSudoArgs()', () => {
    doNotThrow(getSudoArgs)

    info(`[getSudoArgs] ${getSudoArgs()}`)
  })

  it('getPathNpmGlobalRoot()', () => {
    doNotThrow(getPathNpmGlobalRoot)

    info(`[getPathNpmGlobalRoot] ${getPathNpmGlobalRoot()}`)
    info(`[fromGlobalNodeModules] ${fromGlobalNodeModules('test-global-package-name')}`)
  })

  it('getPathNpm()', () => {
    doNotThrow(getPathNpm)

    info(`[getPathNpm] ${getPathNpm()}`)

    // dependency of npm, which is a LOT of package to borrow
    // strictEqual(require(fromNpmNodeModules('libnpx/package.json')).name, 'libnpx') // TODO: `npm@7` do not have a separate `npx`
    strictEqual(require(fromNpmNodeModules('semver/package.json')).name, 'semver')
    strictEqual(require(fromNpmNodeModules('tar/package.json')).name, 'tar')

    strictEqual(require(fromNpmNodeModules('agent-base/package.json')).name, 'agent-base')
    strictEqual(require(fromNpmNodeModules('http-proxy-agent/package.json')).name, 'http-proxy-agent')
    strictEqual(require(fromNpmNodeModules('https-proxy-agent/package.json')).name, 'https-proxy-agent')

    // HACK: check can borrow `make-fetch-happen/agent.js` for lazy proxy agent
    strictEqual(require(fromNpmNodeModules('make-fetch-happen/package.json')).name, 'make-fetch-happen')

    { // test sample usage: https://www.npmjs.com/package/semver
      const semver = require(fromNpmNodeModules('semver'))
      truthy(semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3'))
      strictEqual(semver.valid(semver.coerce('v2')), '2.0.0')
      strictEqual(semver.valid(semver.coerce('42.6.7.9.3-alpha')), '42.6.7')
    }
  })

  it('hasRepoVersion', async () => { // TODO: kinda slow
    truthy(await hasRepoVersion('@dr-js/core', '0.4.0'))
    truthy(!await hasRepoVersion('@dr-js/core', '0.4.0-version-should-not-exist'))
    truthy(!await hasRepoVersion('@dr-js/package-should-not-exist', '0.4.0'))
  })
})


text:
package xworker.chart.jfree.dataobject.data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jfree.data.DomainOrder;
import org.jfree.data.general.DatasetChangeEvent;
import org.jfree.data.general.DatasetChangeListener;
import org.jfree.data.general.DatasetGroup;
import org.jfree.data.xy.DefaultWindDataset;
import org.jfree.data.xy.WindDataset;
import org.xmeta.Thing;

import xworker.dataObject.DataObject;

public class ReWindDataset implements DataObjectReloadableDataset, WindDataset{
	private Thing config;
	DefaultWindDataset dataset = new DefaultWindDataset();
	List<DatasetChangeListener> listeners = new ArrayList<DatasetChangeListener>();

	public ReWindDataset(Thing config){
		this.config = config;
	}

	@Override
	public void reload(List<DataObject> datas) {
		//先清空数据

		String windSeries = config.getString("windSeries");
		String windDate = config.getString("windDate");
		String windDirection = config.getString("windDirection");
		String windForce = config.getString("windForce");

		Map<String, List<Object[]>> items = new HashMap<String, List<Object[]>>();
		for(DataObject r : datas){
			String name = r.getString(windSeries);
			List<Object[]> ds = items.get(name);
			if(ds == null){
				ds = new ArrayList<Object[]>();
				items.put(name, ds);
			}

			Object[] os = new Object[3];
			os[0] = r.getData(windDate);
			os[1] = r.getDouble(windDirection);
			os[2] = r.getDouble(windForce);

			ds.add(os);
		}

		String[] keys = new String[items.size()];
		items.keySet().toArray(keys);
		Object[][][] objs = new Object[items.size()][][];

		for(int i=0; i<keys.length; i++){
			List<Object[]> ds = items.get(keys[i]);
			objs[i] = new Object[ds.size()][];
			for(int n=0; n<ds.size(); n++){
				objs[i][n] = ds.get(n);
			}
		}

		dataset = new DefaultWindDataset(keys, objs);

		DatasetChangeEvent event  = new DatasetChangeEvent(this, dataset);
		for(DatasetChangeListener l: listeners){
			l.datasetChanged(event);
		}
	}

	@Override
	public DomainOrder getDomainOrder() {
		return dataset.getDomainOrder();
	}

	@Override
	public int getItemCount(int series) {
		return dataset.getItemCount(series);
	}

	@Override
	public Number getX(int series, int item) {
		return dataset.getX(series, item);
	}

	@Override
	public double getXValue(int series, int item) {
		return dataset.getXValue(series, item);
	}

	@Override
	public Number getY(int series, int item) {
		return dataset.getY(series, item);
	}

	@Override
	public double getYValue(int series, int item) {
		return dataset.getYValue(series, item);
	}

	@Override
	public int getSeriesCount() {
		return dataset.getSeriesCount();
	}

	@Override
	public Comparable getSeriesKey(int series) {
		return dataset.getSeriesKey(series);
	}

	@Override
	public int indexOf(Comparable arg0) {
		return dataset.indexOf(arg0);
	}

	@Override
	public void addChangeListener(DatasetChangeListener listener) {
		listeners.add(listener);
	}

	@Override
	public DatasetGroup getGroup() {
		return dataset.getGroup();
	}

	@Override
	public void removeChangeListener(DatasetChangeListener listener) {
		listeners.remove(listener);
	}

	@Override
	public void setGroup(DatasetGroup group) {
		dataset.setGroup(group);
	}

	@Override
	public Number getWindDirection(int series, int item) {
		return dataset.getWindDirection(series, item);
	}

	@Override
	public Number getWindForce(int series, int item) {
		return dataset.getWindForce(series, item);
	}

}


text:
layout: docs_0_2
title: Docs
activeTab: docs
activePill: listeners
activeSubPill: custom
---
# Custom Listener

You can implement your own listener builder.  Write an actor class, make it available on the class path, and
set the config to the [fully qualified class name](https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html).

{% highlight javascript %}
// Domain Object
{
  domain-name: "example.com"
  listeners: [
    {id: my_listener, builder: "com.example.MyListenerBuilder"}
  ]

  listener-config {

    // id used in the listeners list
    my_listener {

      // The settings in this object will be provided to the listener builder
      ???: ...
    }
  }
}

{% endhighlight %}

The class to be loaded must implement `shield.actors.config.listener.ListenerBuilder`, and have a constructor that takes
two parameters:

* `id: String` - The id of the listener to be built
* `settings: shield.config.DomainSettings` - The domain settings, which provides access to the settings for the listener to be built

{% highlight scala %}

trait ListenerBuilder extends Actor {
  val settings = Settings(context.system)
}

{% endhighlight %}

To register the listener with Shield, the builder actor must send a `shield.actors.config.ConfigWatcherMsgs.ListenerUpdated`
message to its parent actor.  It can do this multiple times if it wants to change actors used by Shield.  If you're swapping
actors, you should wait for Spray's global request timeout to elapse before killing the old listener actor, to allow any
in flight requests to be drained.

{% highlight scala %}

case class ListenerUpdated(id: String, listener: ActorRef)

{% endhighlight %}

The actor that gets registered as a listener will receive `shield.actors.RequestProcessorCompleted` messages.  It is
then free to whatever it wants.

{% highlight scala %}

// Incoming message
case class RequestProcessorCompleted(
  completion: ResponseCompleted,
  overallTiming: Long,
  middlewareTiming: Map[String, Long]
)

case class ResponseCompleted(
  request: HttpRequest,
  details: ResponseDetails
)

case class ResponseDetails(
  serviceLocation: ServiceLocation,
  serviceName: String,
  template: EndpointTemplate,
  explicitCacheParams: Option[Set[Param]],
  response: HttpResponse
)

{% endhighlight %}


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateSitesOptionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sites_options', function (Blueprint $table) {
            $table->unsignedBigInteger('site_id');
            $table->string('option', 100);
            $table->text('value');

            $table->engine = 'InnoDB';

            $table->index('site_id');
            $table->index('option');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('sites_options');
    }
}


text:
using System;

namespace ClosedXML.Excel
{
    public class XLDecimalCriteria : XLValidationCriteria
    {
        public XLDecimalCriteria(IXLDataValidation dataValidation)
            : base(dataValidation)
        {
        }

        public void Between(Double minValue, Double maxValue) => base.Between(minValue.ToInvariantString(), maxValue.ToInvariantString());

        public void EqualOrGreaterThan(Double value) => base.EqualOrGreaterThan(value.ToInvariantString());

        public void EqualOrLessThan(Double value) => base.EqualOrLessThan(value.ToInvariantString());

        public void EqualTo(Double value) => base.EqualTo(value.ToInvariantString());

        public void GreaterThan(Double value) => base.GreaterThan(value.ToInvariantString());

        public void LessThan(Double value) => base.LessThan(value.ToInvariantString());

        public void NotBetween(Double minValue, Double maxValue) => base.NotBetween(minValue.ToInvariantString(), maxValue.ToInvariantString());

        public void NotEqualTo(Double value) => base.NotEqualTo(value.ToInvariantString());
    }
}


text:
/*
 * XSEC
 *
 * XSECAlgorithmMapper := Provides a table of AlgorithmHandlers
 *						  Mapped by Type URI
 *
 * $Id$
 *
 */

#ifndef XSECALGMAPPER_INCLUDE
#define XSECALGMAPPER_INCLUDE

// XSEC Includes

#include <xsec/framework/XSECDefs.hpp>

#include <vector>

class XSECAlgorithmHandler;

/**
 * @ingroup internal
 *\@{*/

/**
 * @brief Holder class for mapping Algorithms to Handlers
 *
 */

class XSEC_EXPORT XSECAlgorithmMapper {

public:

	/** @name Constructors and Destructors */
	//@{

	XSECAlgorithmMapper(void);
	~XSECAlgorithmMapper();

	//@}

	/** @name Default mapping strings */
	//@{

	static const XMLCh s_defaultEncryptionMapping[];

	/** @name Map Methods */
	//@{

	/**
	 * \brief Map a URI to a handler
	 */

	const XSECAlgorithmHandler* mapURIToHandler(const XMLCh* URI) const;

	//@}

	/** @name Registration Methods */
	//@{

	/**
	 * \brief Register a new handler
	 */

	void registerHandler(const XMLCh* URI, const XSECAlgorithmHandler& handler);

	/**
	 * \brief Indicate an algorithm is approved for use, implying others are not.
	 */

	void whitelistAlgorithm(const XMLCh* URI);

    /**
     * \brief Indicate an algorithm is not approved for use, implying others are.
     */

	void blacklistAlgorithm(const XMLCh* URI);

	//@}

private:

	struct MapperEntry {

		XMLCh* mp_uri;
		XSECAlgorithmHandler* mp_handler;

	};

	MapperEntry* findEntry(const XMLCh* URI) const;

#if defined(XSEC_NO_NAMESPACES)
	typedef vector<MapperEntry*>			MapperEntryVectorType;
    typedef vector<XMLCh*>                  WhitelistVectorType;
#else
	typedef std::vector<MapperEntry*>		MapperEntryVectorType;
    typedef std::vector<XMLCh*>             WhitelistVectorType;
#endif

	MapperEntryVectorType		            m_mapping;
    WhitelistVectorType                     m_whitelist,m_blacklist;
};

/*\@}*/

#endif /* XSECALGMAPPER_INCLUDE */


text:
package com.cmart.util;

public class Address {
	private long id;
	private long userID;
	private String street;
	private String town;
	private String zip;
	private int state;
	private Boolean isDefault;

	/**
	 * Create an address
	 * @param id The ID of the address
	 * @param userID The userID of the user that lives at this address
	 * @param street The street of the address
	 * @param town The town of the address
	 * @param zip The zip code of the address
	 * @param state The state ID of the address
	 * @param isDefault Whether the address if the user's default address
	 */
	public Address(long id, long userID, String street, String town, String zip, int state, Boolean isDefault){
		this.id = id;
		this.userID = userID;
		this.street = street;
		this.town = town;
		this.zip = zip;
		this.state = state;
		this.isDefault = isDefault;
	}

	/**
	 * Get the address's ID
	 * @return The address ID
	 */
	public long getId(){
		return this.id;
	}

	/**
	 * Get the user ID of the user that lives at this address
	 * @return The user ID of the user that lives at this address
	 */
	public long getUserID(){
		return this.userID;
	}

	/**
	 * Get the street of this address
	 * @return The street address of this address
	 */
	public String getStreet(){
		return this.street;
	}

	/**
	 * Get the town of this address
	 * @return The town that this address is in
	 */
	public String getTown(){
		return this.town;
	}

	/**
	 * Get the zip code of this address
	 * @return The zip code of this address
	 */
	public String getZip(){
		return this.zip;
	}

	/**
	 * Get the state of this address
	 * @return The state this address is in
	 */
	public int getState(){
		return this.state;
	}

	/**
	 * Get whether this address is the user's default address
	 * @return
	 */
	public Boolean getIsDefault(){
		return this.isDefault;
	}

	//TODO: check 'id' and 'addressid' in the code to see why there is a difference/wherer used
	/**
	 * Get the json string that represents this address
	 * @return The JSON string of this address
	 */
	public String toJSON(){
		StringBuffer buf = new StringBuffer();

		buf.append("{\"addressid\":\"");
		buf.append(this.getId());
		buf.append("\",\"userid\":");
		buf.append(this.getUserID());
		buf.append(",\"street\":\"");
		buf.append(this.getStreet());
		buf.append("\",\"town\":\"");
		buf.append(this.getTown());
		buf.append("\",\"zip\":\"");
		buf.append(this.getZip());
		buf.append("\",\"state\":\"");
		buf.append(this.getState());
		buf.append("\",\"isdefault\":\"");
		buf.append(this.getIsDefault());
		buf.append("\"}");

		return buf.toString();
	}

	/**
	 * Get the CSV of this address
	 * @return The CSV of this address
	 */
	public String toCSVString(){
		StringBuffer sb = new StringBuffer(128);
		sb.append(id);
		sb.append(',');
		sb.append(userID);
		sb.append(',');
		sb.append(street);
		sb.append(',');
		sb.append(town);
		sb.append(',');
		sb.append(zip);
		sb.append(',');
		sb.append(state);
		sb.append(',');
		sb.append(isDefault);
		sb.append(',');

		return sb.toString();
	}
}


text:
export const PENCIL = 'PENCIL';
export const ERASER = 'ERASER';
export const BUCKET = 'BUCKET';
export const MOVE = 'MOVE';
export const EYEDROPPER = 'EYEDROPPER';
export const COLOR_PICKER = 'COLOR_PICKER';


text:
from deviantart.oauth import Deviantart
from django import template
from django.http.request import QueryDict

register = template.Library()

@register.simple_tag()
def dA(endpoint, **params):
    deviantart = Deviantart()
    qd = QueryDict(mutable=True)
    qd.update(params)
    return deviantart.get(endpoint + '?' + qd.urlencode())


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Observable_
{
    class Program
    {
        // カスタムイベント引数
        public class CustomEventArgs : EventArgs
        {
            private string message;
            public string Message
            {
                get
                {
                    return message;
                }
                private set
                {
                    message = value;
                }
            }
            public CustomEventArgs(string message)
            {
                this.message = message;
            }
        }
        // カスタムイベントハンドラデリゲート
        public delegate void CustomEventHandler(object sender, CustomEventArgs e);
        // カスタムイベントソース
        public class CustomEventSource
        {
            public event CustomEventHandler CustomEvent;
            public void OnCustomEvent(string message)
            {
                if (CustomEvent != null)
                {
                    CustomEvent(this, new CustomEventArgs(message));
                }
            }
        }
        // カスタムイベントハンドラの実装
        static void CustomEvent_OnCustomEvent(object sender, CustomEventArgs e)
        {
            Console.WriteLine("sender = " + sender.ToString());
            Console.WriteLine("e.Message = " + e.Message);
        }
        // メインメソッド
        static void Main(string[] args)
        {
            // カスタムイベントソースの生成.
            var ev = new CustomEventSource();

            // カスタムイベントが発生するごとに通知するobservableの作成.
            var observable = Observable.FromEvent<CustomEventHandler, CustomEventArgs>(
                h1 => (s,e) => h1(e), // CustomEvent_OnCustomEvent(sender, e) => IObservable(e)に変換.
                h2 => {
                    Console.WriteLine("Add Event.");
                    ev.CustomEvent += h2;
                },
                h2 => {
                    Console.WriteLine("Remove Event.");
                    ev.CustomEvent -= h2;
                }
            );

            // 登録.
            var subscribe = observable.Subscribe(e => Console.WriteLine("e.Message = " + e.Message), ex => Console.WriteLine("ex = " + ex), () => Console.WriteLine("Complete."));

            // イベント発生.
            ev.OnCustomEvent("A");
            Thread.Sleep(3000); // 3秒休止.
            ev.OnCustomEvent("B");
            Thread.Sleep(3000); // 3秒休止.
            ev.OnCustomEvent("C");

            // 解除.
            subscribe.Dispose();
        }
    }
}


text:
* Update dependencies from bower and npm
* Update Apache Server Configs to v2.11.0
* Rename Apple touch icon to `apple-touch-icon.png` and add<br>
  `<link>` in `templates/header.html`
  ([h5bp/html5-boilerplate#1622](https://github.com/h5bp/html5-boilerplate/pull/1622))
* Removed obsolete sourcemapping option
* Update `apple-touch-icon-precomposed.png`
  ([h5bp/html5-boilerplate#1599](https://github.com/h5bp/html5-boilerplate/pull/1599))
* Remove `trailing` JSHint option
* Upgrade `console.log` / `console.warn` (#112)
* Remove timestamp logging when running Karma
* Integrate jit-grunt
* Remove proxy from Karma configuration since it is not needed
* Remove `connect:test` task from Grunt
* Order .jshintrc options alphabetically
* Update 404 to latest from HTML5 Boilerplate
* Make structure for test suites easier to unterstand
* Add `auto` to the Google Universal Analytics tracker create method
* Add `timeline` and `timelineEnd` to the list of `console` methods

### 1.3.0 (4 June 2014)
* Update to Apache Server Configs v2.4.0
* Add `lang=""` to `<html>`
* Use `<!doctype html>` instead of `<!DOCTYPE html>`
* Update component jQuery to 1.11.1
* Update component Modernizr to v2.8.0
* Update npm packages to their latest version

### 1.2.0 (2 April 2014)
* Update component normalize.scss to v3.0.1
* Use INIT logo for tiles and icons (#105)
* Use load-grunt-tasks instead of matchdep
* Add config option to add custom concat tasks (#87)
* Use load-grunt-tasks instead of matchdep
* Clean up Karma configuration and make coverage working with new version
* Add `grunt/tasks` folder for own tasks
* Add directory `grunt/plugins` to include plugins for Grunt config
* Rename `tasks` to `grunt`
* Update bower components to lastest version
* Update dependencies to latest version
* Add Sass 3.3 sourcemaps support (#99)
* Fix output style again
* Revert "Use libsass instead of Ruby Sass"
* Fix non-compressed output on Sass files in build (#101)
* Move karma.config.js file to `tasks` directory
* Add `/browserconfig.xml` file and tile images

### 1.1.1 (04 March 2014)
* Fix Grunt-Modernizr task for latest update
* Update npm dependencies to latest versions
* Use constant instead of string for Karma log level
* Fix path of jQuery in config.js in order of v1.11.0 update
* Update jQuery to v1.11.0
* Update normalize-scss to v3.0.0
* Fix npm postinstall script for win32 systems (#89)
* Update to Apache Server Configs v2.2.0

### 1.1.0 (29 January 2014)
* Further optimize `apple-touch-icon-precomposed`
* Add `Disallow:` to `robots.txt`
* Update 404 to reduce uncopressed size
* Update Bower packages and npm dependencies to latest
* Update to Apache Server Configs v2.1.0
* Simplified default template markup (#81)
* Add time-grunt to measure grunt's execution time
* Use libsass instead of Ruby Sass
* Clean up karma.conf.js
* Use xtend instead of deprecated Grunt dependency Lodash
* Update Grunt to 0.4.2
* Minor updates of IE 6, 7 support
* Removing .ir class, as it was done on HTML5 Boilerplate

### 1.0.2 (11 December 2013)
* Minor updates to .htaccess
* Clean up Gruntfile
* Remove grunt-concurrent
* Update Modernizr to v2.7.1

### 1.0.1 (26 November 2013)
* Update dependencies and devDependencies
* Move Karma tests in `grunt build` without using concurrent (#62)
* Remove regexp option from JSHint options
* Fix broken link in template

### 1.0.0 (20 November 2013)

#### Additions
* Use Bower for package management and replace vendor packages (#24)
* Add Karma as Test Suite
* Add test integration with Jasmine
* Add default markup (#31)
* Add Grunt task to optimize images (#26)
* Move all Grunt tasks into own file
* Add node-matchdep to automatically fetch dependencies
* Add a build step for HTML files (#5)
* Add an option to use templates for content
* Add documentation about how to write modules with Sass
* Add default logo.svg

#### Updates
* Update Modernizr to 2.7.0
* Update RequireJS to 2.1.9
* Update to Apache Server Configs v2.0.0
* Update jQuery to 1.10.2
* Update normalize.css to 2.1.2 (removes IE 6 and 7 support)
* Use Sass-Mixins v0.6.0
* Update to Google Universal Analytics
* Update 404 template to latest version from HTML5 Boilerplate

#### Removals
* Remove CC for IE7
* Remove Chrome Frame support (#28)
* Use only one Apple Touch Icon

#### Other
* Restructre copying of files and dist-folder structure (#11)
* Remove media-query files in favor of inline media-queries
* Add AUTHORS file instead of specifiying it in package.json
* Use a variable for main text color (#30)
* Add .bowerrc configuration file for Bower
* Add folder CSS to .gitignore

### 0.9.1 (04 April 2013)

* Add grunt-concurrent to run tasks concurrently (#22)
* Update normalize.css to 1.1.2
* Update jQuery to 1.10.1

### 0.9.0 (18 April 2013)

* Add Travis CI
* Include RequireJS
* Rename log.js to console.js

### 0.8.3 (09 April 2013)

* Update .htaccess to reflect latest changes
* Remove Google Analytics protocol check (see h5bp/html5-boilerplate#1319)
* Update normalize.css to version 1.1.1
* Update versions of Grunt modules

### 0.8.2 (26 February 2013)

* Add node server with grunt-contrib-connect
* Remove WEBrick server

### 0.8.1 (05 February 2013)

* Update jQuery to version 1.9.1 including source map

### 0.8.0 (27 January, 2013)

* Add source-maps for JavaScript files (See #9 and #10)
* Add wildcard option for jQuery version (#8)

### 0.7.0 (21 January, 2013)

* Improve log.js removing function name for noop
* Update favion to lastest with HiDPI version
* Update jQuery to version 1.9.0 including source map
* Update to lastest styles from HTML5 Boilerplate
* Update normalize.css to version 1.1.0
* Update to reflect latest changes in Grunt

### 0.6.0 (06 November, 2012)

* Update .htaccess to HTML5 Boilerplate's latest version
* Update log.js to reflect HTML5 BP's latest log stub method
* Update Gruntfile and package.json to work with latest draft of Grunt 0.4.0

### 0.5.0 (26 September, 2012)

* Rename production-package to "dist"
* Update jQuery to 1.8.2
* Add grunt-modernizr task
* Add .jshintrc file
* Add CONTRIBUTING.md file

### 0.4.0 (10 September, 2012)

* Add Changelog
* Update jQuery and Modernizr to latest versions
* Update .editorconfig with more options
* Update humans.txt file

### 0.3.0 (23 August, 2012)

* Update normalize.css to 1.0.1, image-replacement, docs and other stuff to
	reflect HTML5 Boilerplate 4.0.0 structure better

### 0.2.0 (26 July, 2012)

* Include a Grunt-task for HTML-validation
* Add seperate Grunt-tasks for development and production

### 0.1.0 (9 July, 2012)

* Include HTML5 Boilerplate
* Add .editorconfig file
* Include SCSS-file-structure
* Add initial Gruntfile.js and package.json
* Include MIT License
* Include ruby-server


text:
package org.codehaus.griffon.compile.core.ast.transform;

import griffon.transform.FXObservable;
import griffon.util.GriffonNameUtils;
import groovyjarjarasm.asm.Opcodes;
import javafx.beans.property.*;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.ObservableMap;
import javafx.collections.ObservableSet;
import org.codehaus.griffon.compile.core.AnnotationHandler;
import org.codehaus.griffon.compile.core.AnnotationHandlerFor;
import org.codehaus.groovy.ast.ASTNode;
import org.codehaus.groovy.ast.AnnotatedNode;
import org.codehaus.groovy.ast.AnnotationNode;
import org.codehaus.groovy.ast.ClassHelper;
import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.FieldNode;
import org.codehaus.groovy.ast.GenericsType;
import org.codehaus.groovy.ast.MethodNode;
import org.codehaus.groovy.ast.Parameter;
import org.codehaus.groovy.ast.PropertyNode;
import org.codehaus.groovy.ast.expr.ArgumentListExpression;
import org.codehaus.groovy.ast.expr.BinaryExpression;
import org.codehaus.groovy.ast.expr.BooleanExpression;
import org.codehaus.groovy.ast.expr.CastExpression;
import org.codehaus.groovy.ast.expr.ClassExpression;
import org.codehaus.groovy.ast.expr.ConstantExpression;
import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
import org.codehaus.groovy.ast.expr.Expression;
import org.codehaus.groovy.ast.expr.FieldExpression;
import org.codehaus.groovy.ast.expr.ListExpression;
import org.codehaus.groovy.ast.expr.MapExpression;
import org.codehaus.groovy.ast.expr.MethodCallExpression;
import org.codehaus.groovy.ast.expr.VariableExpression;
import org.codehaus.groovy.ast.stmt.BlockStatement;
import org.codehaus.groovy.ast.stmt.EmptyStatement;
import org.codehaus.groovy.ast.stmt.ExpressionStatement;
import org.codehaus.groovy.ast.stmt.IfStatement;
import org.codehaus.groovy.ast.stmt.ReturnStatement;
import org.codehaus.groovy.ast.stmt.Statement;
import org.codehaus.groovy.control.CompilePhase;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
import org.codehaus.groovy.runtime.MetaClassHelper;
import org.codehaus.groovy.syntax.SyntaxException;
import org.codehaus.groovy.syntax.Token;
import org.codehaus.groovy.syntax.Types;
import org.codehaus.groovy.transform.GroovyASTTransformation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static org.codehaus.groovy.ast.ClassHelper.LIST_TYPE;
import static org.codehaus.groovy.ast.ClassHelper.MAP_TYPE;

/**
 * Handles generation of code for the {@code @FXObservable}
 *

 * Generally, it adds (if needed) a javafx.beans.property.Property type
 *

 * It also generates the setter and getter and wires the them through the
 * javafx.beans.property.Property.
 *
 * @author Andres Almiray
 */
@AnnotationHandlerFor(FXObservable.class)
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
public class FXObservableASTTransformation extends AbstractASTTransformation implements AnnotationHandler {
    private static final ClassNode FXOBSERVABLE_CNODE = makeClassSafe(FXObservable.class);

    private static final ClassNode OBJECT_PROPERTY_CNODE = makeClassSafe(ObjectProperty.class);
    private static final ClassNode BOOLEAN_PROPERTY_CNODE = makeClassSafe(BooleanProperty.class);
    private static final ClassNode DOUBLE_PROPERTY_CNODE = makeClassSafe(DoubleProperty.class);
    private static final ClassNode FLOAT_PROPERTY_CNODE = makeClassSafe(FloatProperty.class);
    private static final ClassNode INT_PROPERTY_CNODE = makeClassSafe(IntegerProperty.class);
    private static final ClassNode LONG_PROPERTY_CNODE = makeClassSafe(LongProperty.class);
    private static final ClassNode STRING_PROPERTY_CNODE = makeClassSafe(StringProperty.class);
    private static final ClassNode LIST_PROPERTY_CNODE = makeClassSafe(ListProperty.class);
    private static final ClassNode MAP_PROPERTY_CNODE = makeClassSafe(MapProperty.class);
    private static final ClassNode SET_PROPERTY_CNODE = makeClassSafe(SetProperty.class);

    private static final ClassNode SIMPLE_BOOLEAN_PROPERTY_CNODE = makeClassSafe(SimpleBooleanProperty.class);
    private static final ClassNode SIMPLE_DOUBLE_PROPERTY_CNODE = makeClassSafe(SimpleDoubleProperty.class);
    private static final ClassNode SIMPLE_FLOAT_PROPERTY_CNODE = makeClassSafe(SimpleFloatProperty.class);
    private static final ClassNode SIMPLE_INT_PROPERTY_CNODE = makeClassSafe(SimpleIntegerProperty.class);
    private static final ClassNode SIMPLE_LONG_PROPERTY_CNODE = makeClassSafe(SimpleLongProperty.class);
    private static final ClassNode SIMPLE_STRING_PROPERTY_CNODE = makeClassSafe(SimpleStringProperty.class);
    private static final ClassNode SIMPLE_LIST_PROPERTY_CNODE = makeClassSafe(SimpleListProperty.class);
    private static final ClassNode SIMPLE_MAP_PROPERTY_CNODE = makeClassSafe(SimpleMapProperty.class);
    private static final ClassNode SIMPLE_SET_PROPERTY_CNODE = makeClassSafe(SimpleSetProperty.class);
    private static final ClassNode SIMPLE_OBJECT_PROPERTY_CNODE = makeClassSafe(SimpleObjectProperty.class);

    private static final ClassNode OBSERVABLE_LIST_CNODE = makeClassSafe(ObservableList.class);
    private static final ClassNode OBSERVABLE_MAP_CNODE = makeClassSafe(ObservableMap.class);
    private static final ClassNode OBSERVABLE_SET_CNODE = makeClassSafe(ObservableSet.class);
    private static final ClassNode FXCOLLECTIONS_CNODE = makeClassSafe(FXCollections.class);
    private static final ClassNode SET_TYPE = makeClassSafe(Set.class);

    private static final Map<ClassNode, ClassNode> PROPERTY_TYPE_MAP = new HashMap<>();

    static {
        PROPERTY_TYPE_MAP.put(ClassHelper.STRING_TYPE, STRING_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.boolean_TYPE, BOOLEAN_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.Boolean_TYPE, BOOLEAN_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.double_TYPE, DOUBLE_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.Double_TYPE, DOUBLE_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.float_TYPE, FLOAT_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.Float_TYPE, FLOAT_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.int_TYPE, INT_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.Integer_TYPE, INT_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.long_TYPE, LONG_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.Long_TYPE, LONG_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.short_TYPE, INT_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.Short_TYPE, INT_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.byte_TYPE, INT_PROPERTY_CNODE);
        PROPERTY_TYPE_MAP.put(ClassHelper.Byte_TYPE, INT_PROPERTY_CNODE);
        //PROPERTY_TYPE_MAP.put(ClassHelper.char_TYPE, INT_PROPERTY_CNODE);
        //PROPERTY_TYPE_MAP.put(ClassHelper.Character_TYPE, INT_PROPERTY_CNODE);
    }

    private static final Map<ClassNode, ClassNode> PROPERTY_IMPL_MAP = new HashMap<ClassNode, ClassNode>();

    static {
        PROPERTY_IMPL_MAP.put(BOOLEAN_PROPERTY_CNODE, SIMPLE_BOOLEAN_PROPERTY_CNODE);
        PROPERTY_IMPL_MAP.put(DOUBLE_PROPERTY_CNODE, SIMPLE_DOUBLE_PROPERTY_CNODE);
        PROPERTY_IMPL_MAP.put(FLOAT_PROPERTY_CNODE, SIMPLE_FLOAT_PROPERTY_CNODE);
        PROPERTY_IMPL_MAP.put(INT_PROPERTY_CNODE, SIMPLE_INT_PROPERTY_CNODE);
        PROPERTY_IMPL_MAP.put(LONG_PROPERTY_CNODE, SIMPLE_LONG_PROPERTY_CNODE);
        PROPERTY_IMPL_MAP.put(STRING_PROPERTY_CNODE, SIMPLE_STRING_PROPERTY_CNODE);
        PROPERTY_IMPL_MAP.put(LIST_PROPERTY_CNODE, SIMPLE_LIST_PROPERTY_CNODE);
        PROPERTY_IMPL_MAP.put(MAP_PROPERTY_CNODE, SIMPLE_MAP_PROPERTY_CNODE);
        PROPERTY_IMPL_MAP.put(SET_PROPERTY_CNODE, SIMPLE_SET_PROPERTY_CNODE);
        //PROPERTY_IMPL_MAP.put(OBJECT_PROPERTY_CNODE, SIMPLE_OBJECT_PROPERTY_CNODE);
    }

    /**
     * Convenience method to see if an annotated node is {@code @FXObservable}.
     *
     * @param node the node to check
     * @return true if the node is observable
     */
    public static boolean hasFXObservableAnnotation(AnnotatedNode node) {
        for (AnnotationNode annotation : node.getAnnotations()) {
            if (FXOBSERVABLE_CNODE.equals(annotation.getClassNode())) {
                return true;
            }
        }
        return false;
    }

    /**
     * This ASTTransformation method is called when the compiler encounters our annotation.
     *
     * @param nodes      An array of nodes.  Index 0 is the annotation that triggered the call, index 1
     *                   is the annotated node.
     * @param sourceUnit The SourceUnit describing the source code in which the annotation was placed.
     */
    @Override
    public void visit(ASTNode[] nodes, SourceUnit sourceUnit) {
        if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) {
            throw new IllegalArgumentException("Internal error: wrong types: "
                + nodes[0].getClass().getName() + " / " + nodes[1].getClass().getName());
        }

        AnnotationNode node = (AnnotationNode) nodes[0];
        AnnotatedNode parent = (AnnotatedNode) nodes[1];
        ClassNode declaringClass = parent.getDeclaringClass();

        if (parent instanceof FieldNode) {
            int modifiers = ((FieldNode) parent).getModifiers();
            if ((modifiers & Modifier.FINAL) != 0) {
                String msg = "@griffon.transform.FXObservable cannot annotate a final property.";
                generateSyntaxErrorMessage(sourceUnit, node, msg);
            }
            addJavaFXProperty(sourceUnit, node, declaringClass, (FieldNode) parent);
        } else {
            addJavaFXPropertyToClass(sourceUnit, node, (ClassNode) parent);
        }
    }

    /**
     * Adds a JavaFX property to the class in place of the original Groovy property.  A pair of synthetic
     * getter/setter methods is generated to provide pseudo-access to the original property.
     *
     * @param source         The SourceUnit in which the annotation was found
     * @param node           The node that was annotated
     * @param declaringClass The class in which the annotation was found
     * @param field          The field upon which the annotation was placed
     */
    private void addJavaFXProperty(SourceUnit source, AnnotationNode node, ClassNode declaringClass, FieldNode field) {
        String fieldName = field.getName();
        for (PropertyNode propertyNode : declaringClass.getProperties()) {
            if (propertyNode.getName().equals(fieldName)) {
                if (field.isStatic()) {
                    String message = "@griffon.transform.FXObservable cannot annotate a static property.";
                    generateSyntaxErrorMessage(source, node, message);
                } else {
                    createPropertyGetterSetter(declaringClass, propertyNode);
                }
                return;
            }
        }

        String message = "@griffon.transform.FXObservable must be on a property, not a field. Try removing the private, " +
            "protected, or public modifier.";
        generateSyntaxErrorMessage(source, node, message);
    }

    /**
     * Iterate through the properties of the class and convert each eligible property to a JavaFX property.
     *
     * @param source    The SourceUnit
     * @param node      The AnnotationNode
     * @param classNode The declaring class
     */
    private void addJavaFXPropertyToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) {
        for (PropertyNode propertyNode : classNode.getProperties()) {
            FieldNode field = propertyNode.getField();
            // look to see if per-field handlers will catch this one...
            if (hasFXObservableAnnotation(field)
                || ((field.getModifiers() & Modifier.FINAL) != 0)
                || field.isStatic()) {
                // explicitly labeled properties are already handled,
                // don't transform final properties
                // don't transform static properties
                continue;
            }
            createPropertyGetterSetter(classNode, propertyNode);
        }
    }

    /**
     * Creates the JavaFX property and three methods for accessing the property and a pair of
     * getter/setter methods for accessing the original (now synthetic) Groovy property.  For
     * example, if the original property was "String firstName" then these three methods would
     * be generated:
     *

     * public String getFirstName()
     * public void setFirstName(String value)
     * public StringProperty firstNameProperty()
     *
     * @param classNode    The declaring class in which the property will appear
     * @param originalProp The original Groovy property
     */
    private void createPropertyGetterSetter(ClassNode classNode, PropertyNode originalProp) {
        Expression initExp = originalProp.getInitialExpression();
        originalProp.getField().setInitialValueExpression(null);

        PropertyNode fxProperty = createFXProperty(originalProp);

        List<AnnotationNode> methodAnnotations = new ArrayList<>();
        List<AnnotationNode> fieldAnnotations = new ArrayList<>();
        for (AnnotationNode annotation : originalProp.getField().getAnnotations()) {
            if (FXOBSERVABLE_CNODE.equals(annotation.getClassNode())) continue;
            Class annotationClass = annotation.getClassNode().getTypeClass();
            Target target = (Target) annotationClass.getAnnotation(Target.class);
            if (isTargetAllowed(target, ElementType.METHOD)) {
                methodAnnotations.add(annotation);
            } else if (isTargetAllowed(target, ElementType.FIELD)) {
                fieldAnnotations.add(annotation);
            }
        }

        String getterName = "get" + MetaClassHelper.capitalize(originalProp.getName());
        if (classNode.getMethods(getterName).isEmpty()) {
            Statement getterBlock = createGetterStatement(createFXProperty(originalProp));
            createGetterMethod(classNode, originalProp, getterName, getterBlock, methodAnnotations);
            methodAnnotations = null;
        } else {
            wrapGetterMethod(classNode, originalProp.getName(), methodAnnotations);
            methodAnnotations = null;
        }

        String setterName = "set" + MetaClassHelper.capitalize(originalProp.getName());
        if (classNode.getMethods(setterName).isEmpty()) {
            Statement setterBlock = createSetterStatement(createFXProperty(originalProp));
            createSetterMethod(classNode, originalProp, setterName, setterBlock, methodAnnotations);
        } else {
            wrapSetterMethod(classNode, originalProp.getName(), methodAnnotations);
        }

        // We want the actual name of the field to be different from the getter (Prop vs Property) so
        // that the getter takes precedence when we say this.somethingProperty.
        FieldNode fxFieldShortName = createFieldNodeCopy(originalProp.getName() + "Prop", null, fxProperty.getField());
        createPropertyAccessor(classNode, createFXProperty(originalProp), fxFieldShortName, initExp);

        classNode.removeField(originalProp.getName());
        classNode.addField(fxFieldShortName);
        fxFieldShortName.addAnnotations(fieldAnnotations);
    }

    private boolean isTargetAllowed(Target target, ElementType elementType) {
        if (target == null) {
            return false;
        }
        for (ElementType et : target.value()) {
            if (et == elementType) {
                return true;
            }
        }
        return false;
    }

    /**
     * Creates a new PropertyNode for the JavaFX property based on the original property.  The new property
     * will have "Property" appended to its name and its type will be one of the *Property types in JavaFX.
     *
     * @param orig The original property
     * @return A new PropertyNode for the JavaFX property
     */
    private PropertyNode createFXProperty(PropertyNode orig) {
        ClassNode origType = orig.getType();
        ClassNode newType = PROPERTY_TYPE_MAP.get(origType);

        // For the ObjectProperty, we need to add the generic type to it.
        if (newType == null) {
            if (isTypeCompatible(ClassHelper.LIST_TYPE, origType) || isTypeCompatible(OBSERVABLE_LIST_CNODE, origType)) {
                newType = makeClassSafe(SIMPLE_LIST_PROPERTY_CNODE);
                GenericsType[] genericTypes = origType.getGenericsTypes();
                newType.setGenericsTypes(genericTypes);
            } else if (isTypeCompatible(ClassHelper.MAP_TYPE, origType) || isTypeCompatible(OBSERVABLE_MAP_CNODE, origType)) {
                newType = makeClassSafe(SIMPLE_MAP_PROPERTY_CNODE);
                GenericsType[] genericTypes = origType.getGenericsTypes();
                newType.setGenericsTypes(genericTypes);
            } else if (isTypeCompatible(SET_TYPE, origType) || isTypeCompatible(OBSERVABLE_SET_CNODE, origType)) {
                newType = makeClassSafe(SIMPLE_SET_PROPERTY_CNODE);
                GenericsType[] genericTypes = origType.getGenericsTypes();
                newType.setGenericsTypes(genericTypes);
            } else { // Object Type
                newType = makeClassSafe(OBJECT_PROPERTY_CNODE);
                ClassNode genericType = origType;
                if (genericType.isPrimaryClassNode()) {
                    genericType = ClassHelper.getWrapper(genericType);
                }
                newType.setGenericsTypes(new GenericsType[]{new GenericsType(genericType)});
            }
        }

        FieldNode fieldNode = createFieldNodeCopy(orig.getName() + "Property", newType, orig.getField());
        return new PropertyNode(fieldNode, orig.getModifiers(), orig.getGetterBlock(), orig.getSetterBlock());
    }

    private boolean isTypeCompatible(ClassNode base, ClassNode target) {
        return target.equals(base) || target.implementsInterface(base) || target.declaresInterface(base);
    }

    /**
     * Creates a setter method and adds it to the declaring class.  The setter has the form:
     *

     * void <setter>(<type> fieldName)
     *
     * @param declaringClass The class to which the method is added
     * @param propertyNode   The property node being accessed by this setter
     * @param setterName     The name of the setter method
     * @param setterBlock    The code body of the method
     */
    protected void createSetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String setterName,
                                      Statement setterBlock, List<AnnotationNode> annotations) {
        Parameter[] setterParameterTypes = {new Parameter(propertyNode.getType(), "value")};
        int mod = propertyNode.getModifiers() | Opcodes.ACC_FINAL;

        MethodNode setter = new MethodNode(setterName, mod, ClassHelper.VOID_TYPE, setterParameterTypes,
            ClassNode.EMPTY_ARRAY, setterBlock);
        if (annotations != null) setter.addAnnotations(annotations);
        setter.setSynthetic(true);
        declaringClass.addMethod(setter);
    }

    /**
     * If the setter already exists, this method should wrap it with our code and then a call to the original
     * setter.
     *

     * TODO: Not implemented yet
     *
     * @param classNode    The declaring class to which the method will be added
     * @param propertyName The name of the original Groovy property
     */
    private void wrapSetterMethod(ClassNode classNode, String propertyName, List<AnnotationNode> annotations) {
        System.out.println(
            String.format("wrapSetterMethod for '%s', property '%s' not yet implemented",
                classNode.getName(), propertyName));
    }

    /**
     * Creates a getter method and adds it to the declaring class.
     *
     * @param declaringClass The class to which the method is added
     * @param propertyNode   The property node being accessed by this getter
     * @param getterName     The name of the getter method
     * @param getterBlock    The code body of the method
     */
    protected void createGetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String getterName,
                                      Statement getterBlock, List<AnnotationNode> annotations) {
        int mod = propertyNode.getModifiers() | Opcodes.ACC_FINAL;
        MethodNode getter = new MethodNode(getterName, mod, propertyNode.getType(), Parameter.EMPTY_ARRAY,
            ClassNode.EMPTY_ARRAY, getterBlock);
        if (annotations != null) getter.addAnnotations(annotations);
        getter.setSynthetic(true);
        declaringClass.addMethod(getter);
    }

    /**
     * If the getter already exists, this method should wrap it with our code.
     *

     * TODO: Not implemented yet -- what to do with the returned value from the original getter?
     *
     * @param classNode    The declaring class to which the method will be added
     * @param propertyName The name of the original Groovy property
     */
    private void wrapGetterMethod(ClassNode classNode, String propertyName, List<AnnotationNode> annotations) {
        System.out.println(
            String.format("wrapGetterMethod for '%s', property '%s' not yet implemented",
                classNode.getName(), propertyName));
    }

    /**
     * Creates the body of a property access method that returns the JavaFX *Property instance.  If
     * the original property was "String firstName" then the generated code would be:
     *

     * if (firstNameProperty == null) {
     * firstNameProperty = new javafx.beans.property.StringProperty()
     * }
     * return firstNameProperty
     *
     * @param classNode        The declaring class to which the JavaFX property will be added
     * @param fxProperty       The new JavaFX property
     * @param fxFieldShortName
     * @param initExp          The initializer expression from the original Groovy property declaration
     */
    private void createPropertyAccessor(ClassNode classNode, PropertyNode fxProperty, FieldNode fxFieldShortName,
                                        Expression initExp) {
        FieldExpression fieldExpression = new FieldExpression(fxFieldShortName);

        ArgumentListExpression ctorArgs = initExp == null ?
            ArgumentListExpression.EMPTY_ARGUMENTS :
            new ArgumentListExpression(initExp);

        BlockStatement block = new BlockStatement();
        ClassNode fxType = fxProperty.getType();
        ClassNode implNode = PROPERTY_IMPL_MAP.get(fxType);
        if (implNode == null) {
            if (fxType.getTypeClass() == SIMPLE_LIST_PROPERTY_CNODE.getTypeClass()) {
                if (initExp != null) {
                    if (initExp instanceof ListExpression ||
                        (initExp instanceof CastExpression &&
                            (((CastExpression) initExp).getType().equals(LIST_TYPE) ||
                                ((CastExpression) initExp).getType().declaresInterface(LIST_TYPE))) ||
                        (initExp instanceof ConstructorCallExpression &&
                            (((ConstructorCallExpression) initExp).getType().equals(LIST_TYPE) ||
                                ((ConstructorCallExpression) initExp).getType().declaresInterface(LIST_TYPE)))
                        ) {
                        ctorArgs = new ArgumentListExpression(
                            new MethodCallExpression(
                                new ClassExpression(FXCOLLECTIONS_CNODE),
                                "observableList",
                                ctorArgs)
                        );
                    }
                }
                implNode = fxType;
            } else if (fxType.getTypeClass() == SIMPLE_MAP_PROPERTY_CNODE.getTypeClass()) {
                if (initExp != null) {
                    if (initExp instanceof MapExpression ||
                        (initExp instanceof CastExpression &&
                            (((CastExpression) initExp).getType().equals(MAP_TYPE) ||
                                ((CastExpression) initExp).getType().declaresInterface(MAP_TYPE))) ||
                        (initExp instanceof ConstructorCallExpression &&
                            (((ConstructorCallExpression) initExp).getType().equals(MAP_TYPE) ||
                                ((ConstructorCallExpression) initExp).getType().declaresInterface(MAP_TYPE)))
                        ) {
                        ctorArgs = new ArgumentListExpression(
                            new MethodCallExpression(
                                new ClassExpression(FXCOLLECTIONS_CNODE),
                                "observableMap",
                                ctorArgs)
                        );
                    }
                }
                implNode = fxType;
            } else if (fxType.getTypeClass() == SIMPLE_SET_PROPERTY_CNODE.getTypeClass()) {
                if (initExp != null) {
                    if ((initExp instanceof CastExpression &&
                        (((CastExpression) initExp).getType().equals(SET_TYPE) ||
                            ((CastExpression) initExp).getType().declaresInterface(SET_TYPE))) ||
                        (initExp instanceof ConstructorCallExpression &&
                            (((ConstructorCallExpression) initExp).getType().equals(SET_TYPE) ||
                                ((ConstructorCallExpression) initExp).getType().declaresInterface(SET_TYPE)))
                        ) {
                        ctorArgs = new ArgumentListExpression(
                            new MethodCallExpression(
                                new ClassExpression(FXCOLLECTIONS_CNODE),
                                "observableSet",
                                ctorArgs)
                        );
                    }
                }
                implNode = fxType;
            } else {
                implNode = makeClassSafe(SIMPLE_OBJECT_PROPERTY_CNODE);
                GenericsType[] origGenerics = fxProperty.getType().getGenericsTypes();
                //List<GenericsType> copyGenericTypes = new ArrayList<GenericsType>();
                //for()
                implNode.setGenericsTypes(origGenerics);
            }
        }
        Expression initExpression = new ConstructorCallExpression(implNode, ctorArgs);

        IfStatement ifStmt = new IfStatement(
            new BooleanExpression(
                new BinaryExpression(
                    fieldExpression,
                    Token.newSymbol(Types.COMPARE_EQUAL, 0, 0),
                    ConstantExpression.NULL
                )
            ),
            new ExpressionStatement(
                new BinaryExpression(
                    fieldExpression,
                    Token.newSymbol(Types.EQUAL, 0, 0),
                    initExpression
                )
            ),
            EmptyStatement.INSTANCE
        );
        block.addStatement(ifStmt);
        block.addStatement(new ReturnStatement(fieldExpression));

        String getterName = getFXPropertyGetterName(fxProperty);
        MethodNode accessor = new MethodNode(getterName, fxProperty.getModifiers(), fxProperty.getType(),
            Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, block);
        accessor.setSynthetic(true);
        classNode.addMethod(accessor);

        // Create the xxxxProperty() method that merely calls getXxxxProperty()
        block = new BlockStatement();

        VariableExpression thisExpression = VariableExpression.THIS_EXPRESSION;
        ArgumentListExpression emptyArguments = ArgumentListExpression.EMPTY_ARGUMENTS;

        MethodCallExpression getProperty = new MethodCallExpression(thisExpression, getterName, emptyArguments);
        block.addStatement(new ReturnStatement(getProperty));

        String javaFXPropertyFunction = fxProperty.getName();

        accessor = new MethodNode(javaFXPropertyFunction, fxProperty.getModifiers(), fxProperty.getType(),
            Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, block);
        accessor.setSynthetic(true);
        classNode.addMethod(accessor);

        // Create the xxxx() method that merely calls getXxxxProperty()
        block = new BlockStatement();

        thisExpression = VariableExpression.THIS_EXPRESSION;
        emptyArguments = ArgumentListExpression.EMPTY_ARGUMENTS;

        getProperty = new MethodCallExpression(thisExpression, getterName, emptyArguments);
        block.addStatement(new ReturnStatement(getProperty));
        javaFXPropertyFunction = fxProperty.getName().replace("Property", "");

        accessor = new MethodNode(javaFXPropertyFunction, fxProperty.getModifiers(), fxProperty.getType(),
            Parameter.EMPTY_ARRAY, ClassNode.EMPTY_ARRAY, block);
        accessor.setSynthetic(true);
        classNode.addMethod(accessor);
    }

    /**
     * Creates the body of a setter method for the original property that is actually backed by a
     * JavaFX *Property instance:
     *

     * Object $property = this.someProperty()
     * $property.setValue(value)
     *
     * @param fxProperty The original Groovy property that we're creating a setter for.
     * @return A Statement that is the body of the new setter.
     */
    protected Statement createSetterStatement(PropertyNode fxProperty) {
        String fxPropertyGetter = getFXPropertyGetterName(fxProperty);
        VariableExpression thisExpression = VariableExpression.THIS_EXPRESSION;
        ArgumentListExpression emptyArgs = ArgumentListExpression.EMPTY_ARGUMENTS;

        MethodCallExpression getProperty = new MethodCallExpression(thisExpression, fxPropertyGetter, emptyArgs);

        ArgumentListExpression valueArg = new ArgumentListExpression(new Expression[]{new VariableExpression("value")});
        MethodCallExpression setValue = new MethodCallExpression(getProperty, "setValue", valueArg);

        return new ExpressionStatement(setValue);
    }

    /**
     * Creates the body of a getter method for the original property that is actually backed by a
     * JavaFX *Property instance:
     *

     * Object $property = this.someProperty()
     * return $property.getValue()
     *
     * @param fxProperty The new JavaFX property.
     * @return A Statement that is the body of the new getter.
     */
    protected Statement createGetterStatement(PropertyNode fxProperty) {
        String fxPropertyGetter = getFXPropertyGetterName(fxProperty);
        VariableExpression thisExpression = VariableExpression.THIS_EXPRESSION;
        ArgumentListExpression emptyArguments = ArgumentListExpression.EMPTY_ARGUMENTS;

        // We're relying on the *Property() method to provide the return value - is this still needed??
//        Expression defaultReturn = defaultReturnMap.get(originalProperty.getType());
//        if (defaultReturn == null)
//            defaultReturn = ConstantExpression.NULL;

        MethodCallExpression getProperty = new MethodCallExpression(thisExpression, fxPropertyGetter, emptyArguments);
        MethodCallExpression getValue = new MethodCallExpression(getProperty, "getValue", emptyArguments);

        return new ReturnStatement(new ExpressionStatement(getValue));
    }

    /**
     * Generates a SyntaxErrorMessage based on the current SourceUnit, AnnotationNode, and a specified
     * error message.
     *
     * @param sourceUnit The SourceUnit
     * @param node       The node that was annotated
     * @param msg        The error message to display
     */
    private void generateSyntaxErrorMessage(SourceUnit sourceUnit, AnnotationNode node, String msg) {
        SyntaxException error = new SyntaxException(msg, node.getLineNumber(), node.getColumnNumber());
        sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(error, sourceUnit));
    }

    /**
     * Creates a copy of a FieldNode with a new name and, optionally, a new type.
     *
     * @param newName The name for the new field node.
     * @param newType The new type of the field.  If null, the old FieldNode's type will be used.
     * @param f       The FieldNode to copy.
     * @return The new FieldNode.
     */
    private FieldNode createFieldNodeCopy(String newName, ClassNode newType, FieldNode f) {
        if (newType == null)
            newType = f.getType();
        newType = newType.getPlainNodeReference();

        return new FieldNode(newName, f.getModifiers(), newType, f.getOwner(), f.getInitialValueExpression());
    }

    /**
     * Generates the correct getter method name for a JavaFX property.
     *
     * @param fxProperty The property for which the getter should be generated.
     * @return The getter name as a String.
     */
    private String getFXPropertyGetterName(PropertyNode fxProperty) {
        return GriffonNameUtils.getGetterName(fxProperty.getName());
    }
}


text:
layout: post
title:      "How I Made it Through Learn "
date:       2017-10-23 23:31:59 -0400
permalink:  how_i_made_it_through_learn
---

As soon as I complete this blog post, I will have officially completed all my requirements for graduation. When I combined the difficulties of surviving in New York, as well as my natural high anxiety, it has been one of the most challenging periods of my life.

However, throughout the two years I've been studying programming, I've learned some lessons that have made me more determined.

Anytime I had to look at the solution branch, I was struck by imposter syndrome. But coding felt so natural to me, so I kept going.

Wired magazine or Tech Crunch would run stories about the death of coding, and I'd get worried. I'd turn to friends or if it was late at night Quora for re-assurance.  These stories won't end. Talking about the oncoming A.I. apocalypse is too great for readership.

I'd worry about stories about the dangers of bootcamps. These are another popular angle, particularly with the recent closing of Dev Bootcamp. There was also the endless amount of message boards of people claiming that coding bootcamps wouldn't properly teach you how to code.

However, many of the outcomes I'd see from my fellow classmates clearly didn't reflect the scenarios presented. Eventually, I learned to just keep going.

Stories and people will doubt you, but they are only distractions. Surround yourself with those who will support your journey, and don't let doomsday journalism sidetrack you. The people who succeed are the ones that block out the noise and just code.


text:
TaskHandle LaunchDAQ();
void TurnOffDAQ(TaskHandle taskHandle, float endtime);
void TurnOffDAQ(TaskHandle taskHandle);
void InsertSign(TaskHandle taskHandle, float signature);