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

<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<title>  Disaster Aid for Windows users only? - The Web Standards Project</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="The Web Standards Project is a grassroots coalition fighting for standards which ensure simple, affordable access to web technologies for all." />
<meta name="MSSmartTagsPreventParsing" content="true" />

<link rel="stylesheet" type="text/css" media="screen, projection" href="/wp/wp-content/themes/web-standards-project/styles.css" />
<link rel="stylesheet" type="text/css" media="print" href="/wp/wp-content/themes/web-standards-project/print.css" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="/feed/index.html" />
<link rel="alternate" type="text/xml" title="RSS .92" href="/feed/rss/index.html" />
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="/feed/atom/index.html" />
<link rel="pingback" href="/wp/xmlrpc.php" />
<link rel="Shortcut Icon" type="image/ico" href="/files/theme/wasp.ico" />
<link rel="home" title="Web Standards Project Home" href="/index.html" />
	<link rel='archives' title='March 2013' href='/2013/03/index.html' />
	<link rel='archives' title='February 2012' href='/2012/02/index.html' />
	<link rel='archives' title='December 2011' href='/2011/12/index.html' />
	<link rel='archives' title='November 2011' href='/2011/11/index.html' />
	<link rel='archives' title='March 2011' href='/2011/03/index.html' />
	<link rel='archives' title='February 2011' href='/2011/02/index.html' />
	<link rel='archives' title='January 2011' href='/2011/01/index.html' />
	<link rel='archives' title='August 2010' href='/2010/08/index.html' />
	<link rel='archives' title='June 2010' href='/2010/06/index.html' />
	<link rel='archives' title='March 2010' href='/2010/03/index.html' />
	<link rel='archives' title='February 2010' href='/2010/02/index.html' />
	<link rel='archives' title='January 2010' href='/2010/01/index.html' />
	<link rel='archives' title='November 2009' href='/2009/11/index.html' />
	<link rel='archives' title='June 2009' href='/2009/06/index.html' />
	<link rel='archives' title='May 2009' href='/2009/05/index.html' />
	<link rel='archives' title='April 2009' href='/2009/04/index.html' />
	<link rel='archives' title='March 2009' href='/2009/03/index.html' />
	<link rel='archives' title='February 2009' href='/2009/02/index.html' />
	<link rel='archives' title='January 2009' href='/2009/01/index.html' />
	<link rel='archives' title='December 2008' href='/2008/12/index.html' />
	<link rel='archives' title='November 2008' href='/2008/11/index.html' />
	<link rel='archives' title='October 2008' href='/2008/10/index.html' />
	<link rel='archives' title='September 2008' href='/2008/09/index.html' />
	<link rel='archives' title='August 2008' href='/2008/08/index.html' />
	<link rel='archives' title='July 2008' href='/2008/07/index.html' />
	<link rel='archives' title='June 2008' href='/2008/06/index.html' />
	<link rel='archives' title='May 2008' href='/2008/05/index.html' />
	<link rel='archives' title='April 2008' href='/2008/04/index.html' />
	<link rel='archives' title='March 2008' href='/2008/03/index.html' />
	<link rel='archives' title='February 2008' href='/2008/02/index.html' />
	<link rel='archives' title='January 2008' href='/2008/01/index.html' />
	<link rel='archives' title='December 2007' href='/2007/12/index.html' />
	<link rel='archives' title='November 2007' href='/2007/11/index.html' />
	<link rel='archives' title='October 2007' href='/2007/10/index.html' />
	<link rel='archives' title='September 2007' href='/2007/09/index.html' />
	<link rel='archives' title='August 2007' href='/2007/08/index.html' />
	<link rel='archives' title='June 2007' href='/2007/06/index.html' />
	<link rel='archives' title='May 2007' href='/2007/05/index.html' />
	<link rel='archives' title='April 2007' href='/2007/04/index.html' />
	<link rel='archives' title='March 2007' href='/2007/03/index.html' />
	<link rel='archives' title='February 2007' href='/2007/02/index.html' />
	<link rel='archives' title='January 2007' href='/2007/01/index.html' />
	<link rel='archives' title='December 2006' href='/2006/12/index.html' />
	<link rel='archives' title='November 2006' href='/2006/11/index.html' />
	<link rel='archives' title='October 2006' href='/2006/10/index.html' />
	<link rel='archives' title='September 2006' href='/2006/09/index.html' />
	<link rel='archives' title='August 2006' href='/2006/08/index.html' />
	<link rel='archives' title='July 2006' href='/2006/07/index.html' />
	<link rel='archives' title='June 2006' href='/2006/06/index.html' />
	<link rel='archives' title='May 2006' href='/2006/05/index.html' />
	<link rel='archives' title='April 2006' href='/2006/04/index.html' />
	<link rel='archives' title='March 2006' href='/2006/03/index.html' />
	<link rel='archives' title='February 2006' href='/2006/02/index.html' />
	<link rel='archives' title='January 2006' href='/2006/01/index.html' />
	<link rel='archives' title='December 2005' href='../../../12/index.html' />
	<link rel='archives' title='November 2005' href='../../../11/index.html' />
	<link rel='archives' title='October 2005' href='../../../10/index.html' />
	<link rel='archives' title='September 2005' href='../../index.html' />
	<link rel='archives' title='August 2005' href='../../../08/index.html' />
	<link rel='archives' title='July 2005' href='../../../07/index.html' />
	<link rel='archives' title='June 2005' href='../../../06/index.html' />
	<link rel='archives' title='May 2005' href='../../../05/index.html' />
	<link rel='archives' title='April 2005' href='../../../04/index.html' />
	<link rel='archives' title='March 2005' href='../../../03/index.html' />
	<link rel='archives' title='February 2005' href='../../../02/index.html' />
	<link rel='archives' title='January 2005' href='../../../01/index.html' />
	<link rel='archives' title='December 2004' href='/2004/12/index.html' />
	<link rel='archives' title='November 2004' href='/2004/11/index.html' />
	<link rel='archives' title='October 2004' href='/2004/10/index.html' />
	<link rel='archives' title='September 2004' href='/2004/09/index.html' />
	<link rel='archives' title='August 2004' href='/2004/08/index.html' />
	<link rel='archives' title='July 2004' href='/2004/07/index.html' />
	<link rel='archives' title='June 2004' href='/2004/06/index.html' />
	<link rel='archives' title='May 2004' href='/2004/05/index.html' />
	<link rel='archives' title='April 2004' href='/2004/04/index.html' />
	<link rel='archives' title='March 2004' href='/2004/03/index.html' />
	<link rel='archives' title='February 2004' href='/2004/02/index.html' />
	<link rel='archives' title='January 2004' href='/2004/01/index.html' />
	<link rel='archives' title='December 2003' href='/2003/12/index.html' />
	<link rel='archives' title='November 2003' href='/2003/11/index.html' />
	<link rel='archives' title='October 2003' href='/2003/10/index.html' />
	<link rel='archives' title='September 2003' href='/2003/09/index.html' />
	<link rel='archives' title='August 2003' href='/2003/08/index.html' />
	<link rel='archives' title='July 2003' href='/2003/07/index.html' />
	<link rel='archives' title='June 2003' href='/2003/06/index.html' />
	<link rel='archives' title='May 2003' href='/2003/05/index.html' />
	<link rel='archives' title='April 2003' href='/2003/04/index.html' />
	<link rel='archives' title='March 2003' href='/2003/03/index.html' />
	<link rel='archives' title='February 2003' href='/2003/02/index.html' />
	<link rel='archives' title='January 2003' href='/2003/01/index.html' />
	<link rel='archives' title='December 2002' href='/2002/12/index.html' />
	<link rel='archives' title='November 2002' href='/2002/11/index.html' />
	<link rel='archives' title='October 2002' href='/2002/10/index.html' />
	<link rel='archives' title='September 2002' href='/2002/09/index.html' />
	<link rel='archives' title='August 2002' href='/2002/08/index.html' />
	<link rel='archives' title='July 2002' href='/2002/07/index.html' />
	<link rel='archives' title='June 2002' href='/2002/06/index.html' />
	<link rel='archives' title='April 2002' href='/2002/04/index.html' />
	<link rel='archives' title='March 2002' href='/2002/03/index.html' />
	<link rel='archives' title='December 2001' href='/2001/12/index.html' />
	<link rel='archives' title='September 2001' href='/2001/09/index.html' />
	<link rel='archives' title='November 2000' href='/2000/11/index.html' />
	<link rel='archives' title='July 2000' href='/2000/07/index.html' />
	<link rel='archives' title='April 2000' href='/2000/04/index.html' />
	<link rel='archives' title='March 1999' href='/1999/03/index.html' />
	<link rel='archives' title='October 1998' href='/1998/10/index.html' />
	<link rel='archives' title='August 1998' href='/1998/08/index.html' />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="/wp/xmlrpc0db0.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="/wp/wp-includes/wlwmanifest.xml" />
<link rel='prev' title='Slashdot Goes CSS: Help Beta Test' href='../../06/slashdot-goes-css-help-beta-test/index.html' />
<link rel='next' title='Searching for Standards' href='../../08/searching-for-standards/index.html' />
<meta name="generator" content="WordPress 3.3.1" />
<link rel='canonical' href='index.html' />
<link rel='shortlink' href='../../../../index27cd.html?p=525' />

Working together for standards  The Web Standards Project

		Skip to content

				<form id="fm-search" method="get" action="http://www.webstandards.org/index.php">
			<fieldset>
				<legend>Search</legend>
				Search WaSP
				<input id="s" name="s" class="search" value="" />
				<input type="submit" class="submit" name="submit" value="Go!" />
			</fieldset>
		</form>

Home

About

Learn

Action

Buzz

Press

Disaster Aid for Windows users only?

By Holly Marie Koltz | September 7th, 2005 | Filed in Accessibility, Web Standards (general)

								Skip to comment form

At Boing Boing yesterday:  FEMA to Mac, Linux users: drop dead.

Bottom line: if you’re not using Windows + IE, it appears that you won’t be able to file a disaster assistance claim on Fema.gov.

A Javascript enabled browser is another requirement. The  Federal Emergency Management Agency (FEMA)  offers federal aid to disaster areas in the United States, such as the recent Katrina hurricane disaster.

 The Online registration requires Microsoft’s Internet Explorer 6.0 or above. If you do not have Internet Explorer 6.0 or higher, you may still be able to access the Individual Assistance Center where you can check the status of your application and update your information.

Also visit FEMA Registration Requirements (FAQ) for more information.

There are a few comments that follow the Boing Boing entry, where  users have been able to access the process using Opera, or Firefox with  a user agent switching extension  to emulate Internet Explorer, however, in a better situation, none of this should be necessary if the process were available to a wide variety of users and browsers. The last thing a disaster victim wants to worry about or figure out is  how to manipulate their computer browser in order to apply for aid.

Software requirements are not the only problem for users or victims, however. If a blind or low vision user, or a person accesses the site  with  a device that does not display images and tries to start the registration process, the first item  they will encounter is  a captcha when they visit the  *Register for Assistance*  link . Captcha is server  generated characters  in picture format  that must be entered and submitted before the application process begins. Users that cannot see or make out these images will not be able to enter the characters into the form.  Applications are not accepted via mail.  Information packets can be mailed to the applicants, though are  mail services or mailing addresses  available for displaced victims? More information found at  FEMA: Registration Requirements.

The FEMA agency  website  has a published Section 508 Accessibility Statement.

			Return to top

Post a Reply

Comments are closed.

Back to Top

All of the entries posted in WaSP Buzz express the opinions of their individual authors. They do not necessarily reflect the plans or positions of the Web Standards Project as a group.

This site is valid XHTML 1.0 Strict, CSS | Get Buzz via RSS or Atom | Colophon | Legal


text:
#ifndef CCN_CCN_DEFINED
#define CCN_CCN_DEFINED

#include <stdint.h>
#include <ccn/coding.h>
#include <ccn/charbuf.h>
#include <ccn/indexbuf.h>

/**
 * A macro that clients may use to cope with an evolving API.
 *
 * The decimal digits of this use the pattern MMVVXXX, where MM is the
 * major release number and VV is the minor version level.
 * XXX will be bumped when an API change is made, but it will not be
 * directly tied to the patch level in a release number.
 * Thus CCN_API_VERSION=1000 would have corresponded to the first public
 * release (0.1.0), but that version did not have this macro defined.
 */
#define CCN_API_VERSION 8002

#if !defined(DEPRECATED)
/*
 * only certain compilers support __attribute__((deprecated))
 */
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
    #define DEPRECATED __attribute__((deprecated))
#else
    #define DEPRECATED
#endif
#endif

/**
 * Limits
 *
 */
#define CCN_MAX_CONTENT_PAYLOAD 8192
#define CCN_MAX_MESSAGE_BYTES 8800

/**
 * Interest lifetime default.
 *
 * If the interest lifetime is not explicit, this is the default value.
 */
#define CCN_INTEREST_LIFETIME_SEC 4
#define CCN_INTEREST_LIFETIME_MICROSEC (CCN_INTEREST_LIFETIME_SEC * 1000000)

/* opaque declarations */
struct ccn;
struct ccn_pkey;

/* forward declarations */
struct ccn_closure;
struct ccn_upcall_info;
struct ccn_parsed_interest;
struct ccn_parsed_ContentObject;
struct ccn_parsed_Link;

/*
 * Types for implementing upcalls
 * To receive notifications of incoming interests and content, the
 * client creates closures (using client-managed memory).
 */

/**
 * This tells what kind of event the upcall is handling.
 *
 * The KEYMISSING and RAW codes are used only if deferred verification has been
 * requested.
 */
enum ccn_upcall_kind {
    CCN_UPCALL_FINAL,             /**< handler is about to be deregistered */
    CCN_UPCALL_INTEREST,          /**< incoming interest */
    CCN_UPCALL_CONSUMED_INTEREST, /**< incoming interest, someone has answered */
    CCN_UPCALL_CONTENT,           /**< incoming verified content */
    CCN_UPCALL_INTEREST_TIMED_OUT,/**< interest timed out */
    CCN_UPCALL_CONTENT_UNVERIFIED,/**< content that has not been verified */
    CCN_UPCALL_CONTENT_BAD,       /**< verification failed */
    CCN_UPCALL_CONTENT_KEYMISSING,/**< key has not been fetched */
    CCN_UPCALL_CONTENT_RAW        /**< verification has not been attempted */
};

/**
 * Upcalls return one of these values.
 */
enum ccn_upcall_res {
    CCN_UPCALL_RESULT_ERR = -1, /**< upcall detected an error */
    CCN_UPCALL_RESULT_OK = 0,   /**< normal upcall return */
    CCN_UPCALL_RESULT_REEXPRESS = 1, /**< reexpress the same interest again */
    CCN_UPCALL_RESULT_INTEREST_CONSUMED = 2,/**< upcall claims to consume interest */
    CCN_UPCALL_RESULT_VERIFY = 3, /**< force an unverified result to be verified */
    CCN_UPCALL_RESULT_FETCHKEY = 4 /**< request fetching of an unfetched key */
};

/**
 * @typedef ccn_handler
 * This is the procedure type for the closure's implementation.
 */
typedef enum ccn_upcall_res (*ccn_handler)(
    struct ccn_closure *selfp,
    enum ccn_upcall_kind kind,
    struct ccn_upcall_info *info  /**< details about the event */
);

/**
 * Handle for upcalls that allow clients receive notifications of
 * incoming interests and content.
 *
 * The client is responsible for managing this piece of memory and the
 * data therein. The refcount should be initially zero, and is used by the
 * library to keep to track of multiple registrations of the same closure.
 * When the count drops back to 0, the closure will be called with
 * kind = CCN_UPCALL_FINAL so that it has an opportunity to clean up.
 */
struct ccn_closure {
    ccn_handler p;      /**< client-supplied handler */
    void *data;         /**< for client use */
    intptr_t intdata;   /**< for client use */
    int refcount;       /**< client should not update this directly */
};

/**
 * Additional information provided in the upcall.
 */
struct ccn_upcall_info {
    struct ccn *h;              /**< The ccn library handle */
    /* Interest (incoming or matched) */
    const unsigned char *interest_ccnb;
    struct ccn_parsed_interest *pi;
    struct ccn_indexbuf *interest_comps;
    int matched_comps;
    /* Incoming content for CCN_UPCALL_CONTENT* - otherwise NULL */
    const unsigned char *content_ccnb;
    struct ccn_parsed_ContentObject *pco;
    struct ccn_indexbuf *content_comps;
};

/*
 * ccn_create: create a client handle
 * Creates and initializes a client handle, not yet connected.
 * On error, returns NULL and sets errno.
 * Errors: ENOMEM
 */
struct ccn *ccn_create(void);

/*
 * ccn_connect: connect to local ccnd
 * Use NULL for name to get the default.
 * Normal return value is the fd for the connection.
 * On error, returns -1.
 */
int ccn_connect(struct ccn *h, const char *name);

/*
 * ccn_get_connection_fd: get connection socket fd
 * This is in case the client needs to know the associated
 * file descriptor, e.g. for use in select/poll.
 * The client should not use this fd for actual I/O.
 * Normal return value is the fd for the connection.
 * Returns -1 if the handle is not connected.
 */
int ccn_get_connection_fd(struct ccn *h);

/*
 * ccn_disconnect: disconnect from local ccnd
 * This breaks the connection and discards buffered I/O,
 * but leaves other state intact.  Interests that are pending at disconnect
 * will be reported as timed out, and interest filters active at disconnect
 * will be re-registered if a subsequent ccn_connect on the handle succeeds.
 */
int ccn_disconnect(struct ccn *h);

/*
 * ccn_destroy: destroy handle
 * Releases all resources associated with *hp and sets it to NULL.
 */
void ccn_destroy(struct ccn **hp);

/* Control where verification happens */
int ccn_defer_verification(struct ccn *h, int defer);

/***********************************
 * Writing Names
 * Names for interests are constructed in charbufs using
 * the following routines.
 */

/*
 * ccn_name_init: reset charbuf to represent an empty Name in binary format
 * Return value is 0, or -1 for error.
 */
int ccn_name_init(struct ccn_charbuf *c);

/*
 * ccn_name_append: add a Component to a Name
 * The component is an arbitrary string of n octets, no escaping required.
 * Return value is 0, or -1 for error.
 */
int ccn_name_append(struct ccn_charbuf *c, const void *component, size_t n);

/*
 * ccn_name_append_str: add a Component that is a \0 terminated string.
 * The component added is the bytes of the string without the \0.
 * This function is convenient for those applications that construct
 * component names from simple strings.
 * Return value is 0, or -1 for error
 */
int ccn_name_append_str(struct ccn_charbuf *c, const char *s);

/*
 * ccn_name_append_components: add sequence of ccnb-encoded Components
 *    to a ccnb-encoded Name
 * start and stop are offsets from ccnb
 * Return value is 0, or -1 for obvious error
 */
int ccn_name_append_components(struct ccn_charbuf *c,
                               const unsigned char *ccnb,
                               size_t start, size_t stop);

enum ccn_marker {
    CCN_MARKER_NONE = -1,
    CCN_MARKER_SEQNUM  = 0x00, /**< consecutive block sequence numbers */
    CCN_MARKER_CONTROL = 0xC1, /**< commands, etc. */
    CCN_MARKER_OSEQNUM = 0xF8, /**< deprecated */
    CCN_MARKER_BLKID   = 0xFB, /**< nonconsecutive block ids */
    CCN_MARKER_VERSION = 0xFD  /**< timestamp-based versioning */
};

/*
 * ccn_name_append_numeric: add binary Component to ccnb-encoded Name
 * These are special components used for marking versions, fragments, etc.
 * Return value is 0, or -1 for error
 * see doc/technical/NameConventions.html
 */
int ccn_name_append_numeric(struct ccn_charbuf *c,
                            enum ccn_marker tag, uintmax_t value);

/*
 * ccn_name_append_nonce: add nonce Component to ccnb-encoded Name
 * Uses %C1.N.n marker.
 * see doc/technical/NameConventions.html
 */
int ccn_name_append_nonce(struct ccn_charbuf *c);

/*
 * ccn_name_split: find Component boundaries in a ccnb-encoded Name
 * Thin veneer over ccn_parse_Name().
 * returns -1 for error, otherwise the number of Components
 * components arg may be NULL to just do a validity check
 */
int ccn_name_split(const struct ccn_charbuf *c,
                   struct ccn_indexbuf* components);

/*
 * ccn_name_chop: Chop the name down to n components.
 * returns -1 for error, otherwise the new number of Components
 * components arg may be NULL; if provided it must be consistent with
 * some prefix of the name, and is updated accordingly.
 * n may be negative to say how many components to remove instead of how
 * many to leave, e.g. -1 will remove just the last component.
 */
int ccn_name_chop(struct ccn_charbuf *c,
                  struct ccn_indexbuf* components, int n);

/***********************************
 * Authenticators and signatures for content are constructed in charbufs
 * using the following routines.
 */

enum ccn_content_type {
    CCN_CONTENT_DATA = 0x0C04C0,
    CCN_CONTENT_ENCR = 0x10D091,
    CCN_CONTENT_GONE = 0x18E344,
    CCN_CONTENT_KEY  = 0x28463F,
    CCN_CONTENT_LINK = 0x2C834A,
    CCN_CONTENT_NACK = 0x34008A
};

/***********************************
 * ccn_express_interest:
 * Use the above routines to set up namebuf.
 * Matching occurs only on the first prefix_comps components of
 * the name, or on all components if prefix_comps is -1.
 * Any remaining components serve to establish the starting point for
 * the search for matching content.
 * The namebuf may be reused or destroyed after the call.
 * If action is not NULL, it is invoked when matching data comes back.
 * If interest_template is supplied, it should contain a ccnb formatted
 * interest message to provide the other portions of the interest.
 * It may also be reused or destroyed after the call.
 * When an interest times out, the upcall may return
 * CCN_UPCALL_RESULT_REEXPRESS to simply re-express the interest.
 * The default is to unregister the handler.  The common use will be for
 * the upcall to register again with an interest modified to prevent matching
 * the same interest again.
 */
int ccn_express_interest(struct ccn *h,
                         struct ccn_charbuf *namebuf,
                         struct ccn_closure *action,
                         struct ccn_charbuf *interest_template);

/*
 * Register to receive interests on a prefix
 */
int ccn_set_interest_filter(struct ccn *h, struct ccn_charbuf *namebuf,
                            struct ccn_closure *action);

/*
 * Variation allows non-default forwarding flags
 */
int ccn_set_interest_filter_with_flags(struct ccn *h,
                                       struct ccn_charbuf *namebuf,
                                       struct ccn_closure *action,
                                       int forw_flags);

/*
 * ccn_put: send ccn binary
 * This checks for a single well-formed ccn binary object and
 * sends it out (or queues it to be sent).  For normal clients,
 * this should be a ContentObject sent in response to an Interest,
 * but ccn_put does not check for that.
 * Returns -1 for error, 0 if sent completely, 1 if queued.
 */
int ccn_put(struct ccn *h, const void *p, size_t length);

/*
 * ccn_output_is_pending:
 * This is for client-managed select or poll.
 * Returns 1 if there is data waiting to be sent, else 0.
 */
int ccn_output_is_pending(struct ccn *h);

/*
 * ccn_run: process incoming
 * This may serve as the main event loop for simple apps by passing
 * a timeout value of -1.
 * The timeout is in milliseconds.
 */
int ccn_run(struct ccn *h, int timeout);

/*
 * ccn_set_run_timeout: modify ccn_run timeout
 * This may be called from an upcall to change the timeout value.
 * The timeout is in milliseconds.  Returns old value.
 */
int ccn_set_run_timeout(struct ccn *h, int timeout);

/*
 * ccn_get: Get a single matching ContentObject
 * This is a convenience for getting a single matching ContentObject.
 * Blocks until a matching ContentObject arrives or there is a timeout.
 * If h is NULL or ccn_get is called from inside an upcall, a new connection
 * will be used and upcalls from other requests will not be processed while
 * ccn_get is active.
 * The pcobuf and compsbuf arguments may be supplied to save the work of
 * re-parsing the ContentObject.  Either or both may be NULL if this
 * information is not actually needed.
 * flags are not currently used, should be 0.
 * Returns 0 for success, -1 for an error.
 */
int ccn_get(struct ccn *h,
            struct ccn_charbuf *name,
            struct ccn_charbuf *interest_template,
            int timeout_ms,
            struct ccn_charbuf *resultbuf,
            struct ccn_parsed_ContentObject *pcobuf,
            struct ccn_indexbuf *compsbuf,
            int flags);

#define CCN_GET_NOKEYWAIT 1

/* Handy if the content object didn't arrive in the usual way. */
int ccn_verify_content(struct ccn *h,
                       const unsigned char *msg,
                       struct ccn_parsed_ContentObject *pco);

/***********************************
 * Binary decoding
 * These routines require that the whole binary object be buffered.
 */

struct ccn_buf_decoder {
    struct ccn_skeleton_decoder decoder;
    const unsigned char *buf;
    size_t size;
};

struct ccn_buf_decoder *ccn_buf_decoder_start(struct ccn_buf_decoder *d,
    const unsigned char *buf, size_t size);

void ccn_buf_advance(struct ccn_buf_decoder *d);
int ccn_buf_advance_past_element(struct ccn_buf_decoder *d);

/* The match routines return a boolean - true for match */
/* XXX - note, ccn_buf_match_blob doesn't match - it extracts the blob! */
int ccn_buf_match_dtag(struct ccn_buf_decoder *d, enum ccn_dtag dtag);

int ccn_buf_match_some_dtag(struct ccn_buf_decoder *d);

int ccn_buf_match_some_blob(struct ccn_buf_decoder *d);
int ccn_buf_match_blob(struct ccn_buf_decoder *d,
                       const unsigned char **bufp, size_t *sizep);

int ccn_buf_match_udata(struct ccn_buf_decoder *d, const char *s);

int ccn_buf_match_attr(struct ccn_buf_decoder *d, const char *s);

/* On error, the parse routines enter an error state and return a negative value. */
int ccn_parse_required_tagged_BLOB(struct ccn_buf_decoder *d,
                                   enum ccn_dtag dtag,
                                   int minlen, int maxlen);
int ccn_parse_optional_tagged_BLOB(struct ccn_buf_decoder *d,
                                   enum ccn_dtag dtag,
                                   int minlen, int maxlen);
int ccn_parse_nonNegativeInteger(struct ccn_buf_decoder *d);
int ccn_parse_optional_tagged_nonNegativeInteger(struct ccn_buf_decoder *d,
                                                 enum ccn_dtag dtag);
int ccn_parse_uintmax(struct ccn_buf_decoder *d, uintmax_t *result);
int ccn_parse_tagged_string(struct ccn_buf_decoder *d,
                            enum ccn_dtag dtag, struct ccn_charbuf *store);
/* check the decoder error state for these two - result can't be negative */
uintmax_t ccn_parse_required_tagged_binary_number(struct ccn_buf_decoder *d,
                                                  enum ccn_dtag dtag,
                                                  int minlen, int maxlen);
uintmax_t ccn_parse_optional_tagged_binary_number(struct ccn_buf_decoder *d,
                                                  enum ccn_dtag dtag,
                                                  int minlen, int maxlen,
                                                  uintmax_t default_value);
/**
 * Enter an error state if element closer not found.
 */
void ccn_buf_check_close(struct ccn_buf_decoder *d);

/*
 * ccn_ref_tagged_BLOB: Get address & size associated with blob-valued element
 * Returns 0 for success, negative value for error.
 */
int ccn_ref_tagged_BLOB(enum ccn_dtag tt,
                        const unsigned char *buf,
                        size_t start, size_t stop,
                        const unsigned char **presult, size_t *psize);

/*
 * ccn_ref_tagged_string: Get address & size associated with
 * string(UDATA)-valued element.   Note that since the element closer
 * is a 0 byte, the string result will be correctly interpreted as a C string.
 * Returns 0 for success, negative value for error.
 */
int ccn_ref_tagged_string(enum ccn_dtag tt,
                        const unsigned char *buf,
                        size_t start, size_t stop,
                        const unsigned char **presult, size_t *psize);

int ccn_fetch_tagged_nonNegativeInteger(enum ccn_dtag tt,
            const unsigned char *buf, size_t start, size_t stop);

/*********** Interest parsing ***********/

/*
 * The parse of an interest results in an array of offsets into the
 * wire representation, with the start and end of each major element and
 * a few of the inportant sub-elements.  The following enum allows those
 * array items to be referred to symbolically.  The *_B_* indices correspond
 * to beginning offsets and the *_E_* indices correspond to ending offsets.
 * An omitted element has its beginning and ending offset equal to each other.
 * Normally these offsets will end up in non-decreasing order.
 * Some aliasing tricks may be played here, e.g. since
 * offset[CCN_PI_E_ComponentLast] is always equal to
 * offset[CCN_PI_E_LastPrefixComponent],
 * we may define CCN_PI_E_ComponentLast = CCN_PI_E_LastPrefixComponent.
 * However, code should not rely on that,
 * since it may change from time to time as the
 * interest schema evolves.
 */
enum ccn_parsed_interest_offsetid {
    CCN_PI_B_Name,
    CCN_PI_B_Component0,
    CCN_PI_B_LastPrefixComponent,
    CCN_PI_E_LastPrefixComponent,
    CCN_PI_E_ComponentLast = CCN_PI_E_LastPrefixComponent,
    CCN_PI_E_Name,
    CCN_PI_B_MinSuffixComponents,
    CCN_PI_E_MinSuffixComponents,
    CCN_PI_B_MaxSuffixComponents,
    CCN_PI_E_MaxSuffixComponents,
    CCN_PI_B_PublisherID, // XXX - rename
    CCN_PI_B_PublisherIDKeyDigest,
    CCN_PI_E_PublisherIDKeyDigest,
    CCN_PI_E_PublisherID,
    CCN_PI_B_Exclude,
    CCN_PI_E_Exclude,
    CCN_PI_B_ChildSelector,
    CCN_PI_E_ChildSelector,
    CCN_PI_B_AnswerOriginKind,
    CCN_PI_E_AnswerOriginKind,
    CCN_PI_B_Scope,
    CCN_PI_E_Scope,
    CCN_PI_B_InterestLifetime,
    CCN_PI_E_InterestLifetime,
    CCN_PI_B_Nonce,
    CCN_PI_E_Nonce,
    CCN_PI_B_OTHER,
    CCN_PI_E_OTHER,
    CCN_PI_E
};

struct ccn_parsed_interest {
    int magic;
    int prefix_comps;
    int min_suffix_comps;
    int max_suffix_comps;
    int orderpref;
    int answerfrom;
    int scope;
    unsigned short offset[CCN_PI_E+1];
};

enum ccn_parsed_Link_offsetid {
    CCN_PL_B_Name,
    CCN_PL_B_Component0,
    CCN_PL_E_ComponentLast,
    CCN_PL_E_Name,
    CCN_PL_B_Label,
    CCN_PL_E_Label,
    CCN_PL_B_LinkAuthenticator,
    CCN_PL_B_PublisherID,
    CCN_PL_B_PublisherDigest,
    CCN_PL_E_PublisherDigest,
    CCN_PL_E_PublisherID,
    CCN_PL_B_NameComponentCount,
    CCN_PL_E_NameComponentCount,
    CCN_PL_B_Timestamp,
    CCN_PL_E_Timestamp,
    CCN_PL_B_Type,
    CCN_PL_E_Type,
    CCN_PL_B_ContentDigest,
    CCN_PL_E_ContentDigest,
    CCN_PL_E_LinkAuthenticator,
    CCN_PL_E
};

struct ccn_parsed_Link {
    int name_ncomps;
    int name_component_count;
    int publisher_digest_type;
    int type;
    unsigned short offset[CCN_PL_E+1];
};

/*
 * ccn_parse_Link:
 * Returns number of name components, or a negative value for an error.
 * Fills in *link.
 * If components is not NULL, it is filled with byte indexes of
 * the start of each Component of the Name of the Link,
 * plus one additional value for the index of the end of the last component.
 */
int
ccn_parse_Link(struct ccn_buf_decoder *d,
                   struct ccn_parsed_Link *link,
                   struct ccn_indexbuf *components);

/*
 * ccn_append_Link: TODO: fill in documentation
 */
int
ccnb_append_Link(struct ccn_charbuf *buf,
                 const struct ccn_charbuf *name,
                 const char *label,
                 const struct ccn_charbuf *linkAuthenticator
                 );

/*
 * ccn_parse_LinkAuthenticator:
 */
int
ccn_parse_LinkAuthenticator(struct ccn_buf_decoder *d,
               struct ccn_parsed_Link *link);

/*
 * ccn_parse_Collection_start: TODO: fill in documentation
 */

int
ccn_parse_Collection_start(struct ccn_buf_decoder *d);

/*
 * ccn_parse_Collection_next: TODO: fill in documentation
 */

int
ccn_parse_Collection_next(struct ccn_buf_decoder *d,
                          struct ccn_parsed_Link *link,
                          struct ccn_indexbuf *components);

/*
 * Bitmasks for AnswerOriginKind
 */
#define CCN_AOK_CS      0x1     /* Answer from content store */
#define CCN_AOK_NEW     0x2     /* OK to produce new content */
#define CCN_AOK_DEFAULT (CCN_AOK_CS | CCN_AOK_NEW)
#define CCN_AOK_STALE   0x4     /* OK to answer with stale data */
#define CCN_AOK_EXPIRE  0x10    /* Mark as stale (must have Scope 0) */

/*
 * ccn_parse_interest:
 * Returns number of name components, or a negative value for an error.
 * Fills in *interest.
 * If components is not NULL, it is filled with byte indexes of
 * the start of each Component of the Name of the Interest,
 * plus one additional value for the index of the end of the last component.
 */
int
ccn_parse_interest(const unsigned char *msg, size_t size,
                   struct ccn_parsed_interest *interest,
                   struct ccn_indexbuf *components);

/*
 * Returns the lifetime of the interest in units of 2**(-12) seconds
 * (the same units as timestamps).
 */
intmax_t ccn_interest_lifetime(const unsigned char *msg,
                               const struct ccn_parsed_interest *pi);
/*
 * As above, but result is in seconds.  Any fractional part is truncated, so
 * this is not useful for short-lived interests.
 */
int ccn_interest_lifetime_seconds(const unsigned char *msg,
                                  const struct ccn_parsed_interest *pi);

/*********** ContentObject parsing ***********/
/* Analogous to enum ccn_parsed_interest_offsetid, but for content */
enum ccn_parsed_content_object_offsetid {
    CCN_PCO_B_Signature,
    CCN_PCO_B_DigestAlgorithm,
    CCN_PCO_E_DigestAlgorithm,
    CCN_PCO_B_Witness,
    CCN_PCO_E_Witness,
    CCN_PCO_B_SignatureBits,
    CCN_PCO_E_SignatureBits,
    CCN_PCO_E_Signature,
    CCN_PCO_B_Name,
    CCN_PCO_B_Component0,
    CCN_PCO_E_ComponentN,
    CCN_PCO_E_ComponentLast = CCN_PCO_E_ComponentN,
    CCN_PCO_E_Name,
    CCN_PCO_B_SignedInfo,
    CCN_PCO_B_PublisherPublicKeyDigest,
    CCN_PCO_E_PublisherPublicKeyDigest,
    CCN_PCO_B_Timestamp,
    CCN_PCO_E_Timestamp,
    CCN_PCO_B_Type,
    CCN_PCO_E_Type,
    CCN_PCO_B_FreshnessSeconds,
    CCN_PCO_E_FreshnessSeconds,
    CCN_PCO_B_FinalBlockID,
    CCN_PCO_E_FinalBlockID,
    CCN_PCO_B_KeyLocator,
    /* Exactly one of Key, Certificate, or KeyName will be present */
    CCN_PCO_B_Key_Certificate_KeyName,
    CCN_PCO_B_KeyName_Name,
    CCN_PCO_E_KeyName_Name,
    CCN_PCO_B_KeyName_Pub,
    CCN_PCO_E_KeyName_Pub,
    CCN_PCO_E_Key_Certificate_KeyName,
    CCN_PCO_E_KeyLocator,
    CCN_PCO_B_ExtOpt,
    CCN_PCO_E_ExtOpt,
    CCN_PCO_E_SignedInfo,
    CCN_PCO_B_Content,
    CCN_PCO_E_Content,
    CCN_PCO_E
};

struct ccn_parsed_ContentObject {
    int magic;
    enum ccn_content_type type;
    int name_ncomps;
    unsigned short offset[CCN_PCO_E+1];
    unsigned char digest[32];	/* Computed only when needed */
    int digest_bytes;
};

/*
 * ccn_parse_ContentObject:
 * Returns 0, or a negative value for an error.
 * Fills in *x with offsets of constituent elements.
 * If components is not NULL, it is filled with byte indexes
 * of the start of each Component of the Name of the ContentObject,
 * plus one additional value for the index of the end of the last component.
 * Sets x->digest_bytes to 0; the digest is computed lazily by calling
 * ccn_digest_ContentObject.
 */
int ccn_parse_ContentObject(const unsigned char *msg, size_t size,
                            struct ccn_parsed_ContentObject *x,
                            struct ccn_indexbuf *components);

void ccn_digest_ContentObject(const unsigned char *msg,
                              struct ccn_parsed_ContentObject *pc);

/*
 * ccn_parse_Name: Parses a ccnb-encoded name
 * components may be NULL, otherwise is filled in with Component boundary offsets
 * Returns the number of Components in the Name, or -1 if there is an error.
 */
int ccn_parse_Name(struct ccn_buf_decoder *d, struct ccn_indexbuf *components);

/*
 * ccn_compare_names:
 * Returns a value that is negative, zero, or positive depending upon whether
 * the Name element of a is less, equal, or greater than the Name element of b.
 * a and b may point to the start of ccnb-encoded elements of type Name,
 * Interest, or ContentObject.  The size values should be large enough to
 * encompass the entire Name element.
 * The ordering used is the canonical ordering of the ccn name hierarchy.
 */
int ccn_compare_names(const unsigned char *a, size_t asize,
                      const unsigned char *b, size_t bsize);

/***********************************
 * Reading Names:
 * Names may be (minimally) read using the following routines,
 * based on the component boundary markers generated from a parse.
 */

/*
 * ccn_indexbuf_comp_strcmp: perform strcmp of given val against
 * name component at given index i (counting from 0).
 * Uses conventional string ordering, not the canonical CCNx ordering.
 * Returns negative, 0, or positive if val is less than, equal to,
 * or greater than the component.
 * Safe even on binary components, though the result may not be useful.
 * NOTE - this ordering is different from the canonical ordering
 * used by ccn_compare_names();
 */
int ccn_name_comp_strcmp(const unsigned char *data,
                         const struct ccn_indexbuf *indexbuf,
                         unsigned int i,
                         const char *val);

/*
 * ccn_name_comp_get: return a pointer to and size of component at
 * given index i.  The first component is index 0.
 */
int ccn_name_comp_get(const unsigned char *data,
                      const struct ccn_indexbuf *indexbuf,
                      unsigned int i,
                      const unsigned char **comp, size_t *size);

int ccn_name_next_sibling(struct ccn_charbuf *c);

/***********************************
 * Reading content objects
 */

int ccn_content_get_value(const unsigned char *data, size_t data_size,
                          const struct ccn_parsed_ContentObject *content,
                          const unsigned char **value, size_t *size);

/* checking for final block given upcall info */
int ccn_is_final_block(struct ccn_upcall_info *info);

/* checking for final block given parsed content object */
int ccn_is_final_pco(const unsigned char *ccnb,
                     struct ccn_parsed_ContentObject *pco,
                     struct ccn_indexbuf *comps);

/* content-object signing */

/**
 * Parameters for creating signed content objects.
 *
 * A pointer to one of these may be passed to ccn_sign_content() for
 * cases where the default signing behavior does not suffice.
 * For the default (sign with the user's default key pair), pass NULL
 * for the pointer.
 *
 * The recommended way to us this is to create a local variable:
 *
 *   struct ccn_signing_params myparams = CCN_SIGNING_PARAMS_INIT;
 *
 * and then fill in the desired fields.  This way if additional parameters
 * are added, it won't be necessary to go back and modify exiting clients.
 *
 * The template_ccnb may contain a ccnb-encoded SignedInfo to supply
 * selected fields from under the direction of sp_flags.
 * It is permitted to omit unneeded fields from the template, even if the
 * schema says they are manditory.
 *
 * If the pubid is all zero, the user's default key pair is used for
 * signing.  Otherwise the corresponding private key must have already
 * been supplied to the handle using ccn_load_private_key() or equivalent.
 *
 * The default signing key is obtained from ~/.ccnx/.ccnx_keystore unless
 * the CCNX_DIR is used to override the directory location.
 */

struct ccn_signing_params {
    int api_version;
    int sp_flags;
    struct ccn_charbuf *template_ccnb;
    unsigned char pubid[32];
    enum ccn_content_type type;
    int freshness;
    // XXX where should digest_algorithm fit in?
};

#define CCN_SIGNING_PARAMS_INIT \
  { CCN_API_VERSION, 0, NULL, {0}, CCN_CONTENT_DATA, -1 }

#define CCN_SP_TEMPL_TIMESTAMP      0x0001
#define CCN_SP_TEMPL_FINAL_BLOCK_ID 0x0002
#define CCN_SP_TEMPL_FRESHNESS      0x0004
#define CCN_SP_TEMPL_KEY_LOCATOR    0x0008
#define CCN_SP_FINAL_BLOCK          0x0010
#define CCN_SP_OMIT_KEY_LOCATOR     0x0020
#define CCN_SP_TEMPL_EXT_OPT        0x0040

int ccn_sign_content(struct ccn *h,
                     struct ccn_charbuf *resultbuf,
                     const struct ccn_charbuf *name_prefix,
                     const struct ccn_signing_params *params,
                     const void *data, size_t size);

int ccn_load_signing_key(struct ccn *h,
                         const char *keystore_path,
                         const char *keystore_passphrase,
                         struct ccn_charbuf *pubid_out);

int ccn_load_default_key(struct ccn *h,
                         const char *keystore_path,
                         const char *keystore_passphrase);

int ccn_get_public_key(struct ccn *h,
                       const struct ccn_signing_params *params,
                       struct ccn_charbuf *digest_result,
                       struct ccn_charbuf *result);

int ccn_chk_signing_params(struct ccn *h,
                           const struct ccn_signing_params *params,
                           struct ccn_signing_params *result,
                           struct ccn_charbuf **ptimestamp,
                           struct ccn_charbuf **pfinalblockid,
                           struct ccn_charbuf **pkeylocator,
                           struct ccn_charbuf **pextopt);

/* Create a default keystore path */
int ccn_create_keystore_path(struct ccn *h, char *dir, struct ccn_charbuf **path);

/* Get a default for the keystore password */
const char *ccn_get_password(void);

/* Get a key digest from an ASCII suffix */
int ccn_get_key_digest_from_suffix(struct ccn *h, char *dir, char *suffix,
                const char *password, struct ccn_charbuf *key_digest);

/* low-level content-object signing */

#define CCN_SIGNING_DEFAULT_DIGEST_ALGORITHM "SHA256"

int ccn_signed_info_create(
    struct ccn_charbuf *c,              /* filled with result */
    const void *publisher_key_id,	/* input, (sha256) hash */
    size_t publisher_key_id_size, 	/* input, 32 for sha256 hashes */
    const struct ccn_charbuf *timestamp,/* input ccnb blob, NULL for "now" */
    enum ccn_content_type type,         /* input */
    int freshness,			/* input, -1 means omit */
    const struct ccn_charbuf *finalblockid, /* input, NULL means omit */
    const struct ccn_charbuf *key_locator); /* input, optional, ccnb encoded */

int ccn_encode_ContentObject(struct ccn_charbuf *buf,
                             const struct ccn_charbuf *Name,
                             const struct ccn_charbuf *SignedInfo,
                             const void *data,
                             size_t size,
                             const char *digest_algorithm,
                             const struct ccn_pkey *private_key);

/***********************************
 * Matching
 */

/*
 * ccn_content_matches_interest: Test for a match
 * Return 1 if the ccnb-encoded content_object matches the
 * ccnb-encoded interest_msg, otherwise 0.
 * The implicit_content_digest boolean says whether or not the
 * final name component is implicit (as in the on-wire format)
 * or explicit (as within ccnd's content store).
 * Valid parse information (pc and pi) may be provided to speed things
 * up; if NULL they will be reconstructed internally.
 */
int ccn_content_matches_interest(const unsigned char *content_object,
                                 size_t content_object_size,
                                 int implicit_content_digest,
                                 struct ccn_parsed_ContentObject *pc,
                                 const unsigned char *interest_msg,
                                 size_t interest_msg_size,
                                 const struct ccn_parsed_interest *pi);

/*
 * Test whether the given raw name is int the Exclude set.
 */
int ccn_excluded(const unsigned char *excl,
                 size_t excl_size,
                 const unsigned char *nextcomp,
                 size_t nextcomp_size);

/***********************************
 * StatusResponse
 */
int ccn_encode_StatusResponse(struct ccn_charbuf *buf,
                              int errcode, const char *errtext);

/***********************************
 * Debugging
 */

/*
 * ccn_perror: produce message on standard error output describing the last
 * error encountered during a call using the given handle.
 * ccn_seterror records error info, ccn_geterror gets it.
 */
void ccn_perror(struct ccn *h, const char *s);
int ccn_seterror(struct ccn *h, int error_code);
int ccn_geterror(struct ccn *h);

/***********************************
 * Low-level binary formatting
 */

/*
 * Append a ccnb start marker
 *
 * This forms the basic building block of ccnb-encoded data.
 * c is the buffer to append to.
 * Return value is 0, or -1 for error.
 */
int ccn_charbuf_append_tt(struct ccn_charbuf *c, size_t val, enum ccn_tt tt);

/**
 * Append a CCN_CLOSE
 *
 * Use this to close off an element in ccnb-encoded data.
 * @param c is the buffer to append to.
 * @returns 0 for success or -1 for error.
 */
int ccn_charbuf_append_closer(struct ccn_charbuf *c);

/***********************************
 * Slightly higher level binary formatting
 */

/*
 * Append a non-negative integer as a UDATA.
 */
int ccnb_append_number(struct ccn_charbuf *c, int nni);

/*
 * Append a binary timestamp
 * as a BLOB using the ccn binary Timestamp representation (12-bit fraction).
 */
int ccnb_append_timestamp_blob(struct ccn_charbuf *c,
                               enum ccn_marker marker,
                               intmax_t secs, int nsecs);

/*
 * Append a binary timestamp, using the current time.
 */
int ccnb_append_now_blob(struct ccn_charbuf *c, enum ccn_marker marker);

/*
 * Append a start-of-element marker.
 */
int ccnb_element_begin(struct ccn_charbuf *c, enum ccn_dtag dtag);

/*
 * Append an end-of-element marker.
 * This is the same as ccn_charbuf_append_closer()
 */
int ccnb_element_end(struct ccn_charbuf *c);

/*
 * Append a tagged BLOB
 */
int ccnb_append_tagged_blob(struct ccn_charbuf *c, enum ccn_dtag dtag,
                            const void *data, size_t size);

/*
 * Append a tagged binary number
 */
int ccnb_append_tagged_binary_number(struct ccn_charbuf *cb, enum ccn_dtag dtag,
                                     uintmax_t val);

/*
 * Append a tagged UDATA string
 */
int ccnb_append_tagged_udata(struct ccn_charbuf *c, enum ccn_dtag dtag,
                                     const void *data, size_t size);

/*
 * Append a tagged UDATA string, with printf-style formatting
 */
int ccnb_tagged_putf(struct ccn_charbuf *c, enum ccn_dtag dtag,
                     const char *fmt, ...);

/**
 * Versioning
 */

/* Not all of these flags make sense with all of the operations */
#define CCN_V_REPLACE  1 /**< if last component is version, replace it */
#define CCN_V_LOW      2 /**< look for early version */
#define CCN_V_HIGH     4 /**< look for newer version */
#define CCN_V_EST      8 /**< look for extreme */
#define CCN_V_LOWEST   (2|8)
#define CCN_V_HIGHEST  (4|8)
#define CCN_V_NEXT     (4|1)
#define CCN_V_PREV     (2|1)
#define CCN_V_NOW      16 /**< use current time */
#define CCN_V_NESTOK   32 /**< version within version is ok */
#define CCN_V_SCOPE0   64 /**< use scope 0 */
#define CCN_V_SCOPE1   128 /**< use scope 1 */
#define CCN_V_SCOPE2   256 /**< use scope 2 */

int ccn_resolve_version(struct ccn *h,
                        struct ccn_charbuf *name, /* ccnb encoded */
                        int versioning_flags,
                        int timeout_ms);

int ccn_create_version(struct ccn *h,
                       struct ccn_charbuf *name,
                       int versioning_flags,
                       intmax_t secs, int nsecs);

int ccn_guest_prefix(struct ccn *h, struct ccn_charbuf *result, int ms);

/* Deprecated functions after 0.7.1 */

int ccn_load_private_key(struct ccn *h,
                         const char *keystore_path,
                         const char *keystore_passphrase,
                         struct ccn_charbuf *pubid_out) DEPRECATED;

#endif

redpajama_set_name: RedPajamaGithub


text:
import * as React from 'react';
import { Form, FormGroup, RadioGroup, Icon, Button, Radio } from 'rsuite';
import DefaultPage from '@/components/Page';

export default function Page() {
  return (
    <DefaultPage
      examples={[
        'basic',
        'disabled',
        'radio-group',
        'radio-group-inline',
        'radio-group-inline-picker',
        'radio-group-controller'
      ]}
      dependencies={{ Form, FormGroup, RadioGroup, Icon, Button, Radio }}
    />
  );
}


text:
<!DOCTYPE HTML>
<!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
  <meta charset="utf-8">
  <title>Reference: Masonry layout using `grid-column/row` and `dense`</title>
  <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
  <style>
html,body {
  color:black; background-color:white; font:25px/1 monospace; padding:0; margin:0;
}

grid {
  display: inline-grid;
  gap: 10px 20px;
  grid-auto-columns: 80px;
  grid-template-rows: masonry;
  color: #444;
  border: 1px solid;
  padding: 2px;
}

item {
  background-color: #444;
  color: #fff;
  padding: 20px;
  margin: 3px;
  border: 5px solid blue;
}
</style>
</head>
<body>

<grid>
  <item>1</item>
  <item>3</item>
  <item>2</item>
  <item style="grid-column:span 3">4</item>
  <item>5</item>
  <item>6</item>
</grid>

</body>
</html>


text:
package com.vmware.vim25;
import lombok.Getter;
import lombok.Setter;

public class GuestRegValueNameSpec extends DynamicData {
    @Getter @Setter public GuestRegKeyNameSpec keyName;
    @Getter @Setter public String name;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using CoreQuiz.Data;
using CoreQuiz.Models;

namespace CoreQuiz.Controllers
{
    public class AnswersController : Controller
    {
        private readonly ApplicationDbContext _context;

        public AnswersController(ApplicationDbContext context)
        {
            _context = context;
        }

        // GET: Answers
        public async Task<IActionResult> Index()
        {
            return View(await _context.Answers.ToListAsync());
        }

        // GET: Answers/Details/5
        public async Task<IActionResult> Details(int? id)
        {
            if (id == null)
            {
                return NotFound();
            }

            var answer = await _context.Answers.SingleOrDefaultAsync(m => m.Id == id);
            if (answer == null)
            {
                return NotFound();
            }

            return View(answer);
        }

        // GET: Answers/Create
        public IActionResult Create()
        {
            return View();
        }

        // POST: Answers/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<IActionResult> Create([Bind("Id,CreateDateTime,IsCorrect,IsUserOption,Text")] Answer answer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(answer);
                await _context.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(answer);
        }

        // GET: Answers/Edit/5
        public async Task<IActionResult> Edit(int? id)
        {
            if (id == null)
            {
                return NotFound();
            }

            var answer = await _context.Answers.SingleOrDefaultAsync(m => m.Id == id);
            if (answer == null)
            {
                return NotFound();
            }
            return View(answer);
        }

        // POST: Answers/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<IActionResult> Edit(int id, [Bind("Id,CreateDateTime,IsCorrect,IsUserOption,Text")] Answer answer)
        {
            if (id != answer.Id)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(answer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AnswerExists(answer.Id))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                return RedirectToAction("Index");
            }
            return View(answer);
        }

        // GET: Answers/Delete/5
        public async Task<IActionResult> Delete(int? id)
        {
            if (id == null)
            {
                return NotFound();
            }

            var answer = await _context.Answers.SingleOrDefaultAsync(m => m.Id == id);
            if (answer == null)
            {
                return NotFound();
            }

            return View(answer);
        }

        // POST: Answers/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<IActionResult> DeleteConfirmed(int id)
        {
            var answer = await _context.Answers.SingleOrDefaultAsync(m => m.Id == id);
            _context.Answers.Remove(answer);
            await _context.SaveChangesAsync();
            return RedirectToAction("Index");
        }

        private bool AnswerExists(int id)
        {
            return _context.Answers.Any(e => e.Id == id);
        }
    }
}


text:
Create news items
#################

You now know how you can read data from a database using CodeIgniter, but
you haven't written any information to the database yet. In this section
you'll expand your news controller and model created earlier to include
this functionality.

.. note:: This section of the tutorial cannot be completed as certain
    portions of the framework, like the form helper and the validation
    library have not been completed yet.

Create a form
-------------

To input data into the database you need to create a form where you can
input the information to be stored. This means you'll be needing a form
with two fields, one for the title and one for the text. You'll derive
the slug from our title in the model. Create the new view at
*application/Views/News/Create.php*.

::

<?= esc($title); ?>

    <?= validation_errors(); ?>

    <?= form_open('news/create'); ?>

        Title
        <input type="input" name="title" />

        Text
        <textarea name="text"></textarea>

        <input type="submit" name="submit" value="Create news item" />

    </form>

There are only two things here that probably look unfamiliar to you: the
``form_open()`` function and the ``validation_errors()`` function.

The first function is provided by the :doc:`form
helper <../helpers/form_helper>` and renders the form element and
adds extra functionality, like adding a hidden :doc:`CSRF prevention
field <../libraries/security>`. The latter is used to report
errors related to form validation.

Go back to your news controller. You're going to do two things here,
check whether the form was submitted and whether the submitted data
passed the validation rules. You'll use the :doc:`form
validation <../libraries/form_validation>` library to do this.

::

    public function create()
    {
        helper('form');
        $validator = new \CodeIgniter\Form\Validator();
        $model = new NewsModel();

        $data['title'] = 'Create a news item';

        $validator->setRules('title', 'Title', 'required');
        $validator->setRules('text', 'Text', 'required');

        if ($validator->run() === FALSE)
        {
            view('Templates/Header', $data);
            view('News/Create');
            view('Templates/Footer');

        }
        else
        {
            $model->save([
                'title' => $this->request->getVar('title'),
                'slug'  => urlTitle($this->request->getVar('title')),
                'text'  => $this->request->getVar('text'),
            ]);
            echo view('News/Success');
        }
    }

The code above adds a lot of functionality. The first few lines load the
form helper and the form validation library. After that, rules for the
form validation are set. The ``setRules()`` method takes three arguments;
the name of the input field, the name to be used in error messages, and
the rule. In this case the title and text fields are required.

CodeIgniter has a powerful form validation library as demonstrated
above. You can read :doc:`more about this library
here <../libraries/form_validation>`.

Continuing down, you can see a condition that checks whether the form
validation ran successfully. If it did not, the form is displayed, if it
was submitted **and** passed all the rules, the model is called. This
takes care of passing the news item into the model.
This contains a new function, url\_title(). This function -
provided by the :doc:`URL helper <../helpers/url_helper>` - strips down
the string you pass it, replacing all spaces by dashes (-) and makes
sure everything is in lowercase characters. This leaves you with a nice
slug, perfect for creating URIs.

After this, a view is loaded to display a success message. Create a view at
**application/Views/News/Success.php** and write a success message.

Model
-----

The only thing that remains is ensuring that your model is setup
to allow data to be saved properly. The ``save()`` method that was
used will determine whether the information should be inserted
or if the row already exists and should be updated, based on the presence
of a primary key. In this case, there is no ``id`` field passed to it,
so it will insert a new row into it's table, **news**.

However, by default the insert and update methods in the model will
not actually save any data because it doesn't know what fields are
safe to be updated. Edit the model to provide it a list of updatable
fields in the ``$allowedFields`` property.

::

    <?php
    class NewsModel extends \CodeIgniter\Model
    {
        protected $table = 'news';

        protected $allowedFields = ['title', 'slug', 'text'];
    }

This new property now contains the fields that we allow to be saved to the
database. Notice that we leave out the ``id``? That's because you will almost
never need to do that, since it is an auto-incrementing field in the database.
This helps protect against Mass Assignment Vulnerabilities. If your model is
handling your timestamps, you would also leave those out.

Routing
-------

Before you can start adding news items into your CodeIgniter application
you have to add an extra rule to *Config/Routes.php* file. Make sure your
file contains the following. This makes sure CodeIgniter sees 'create'
as a method instead of a news item's slug.

::

    $routes->post('news/create', 'News::create');
    $routes->add('news/(:segment)', 'News::view/$1');
    $routes->get('news', 'News::index');
    $routes->add('(:any)', 'Pages::view/$1');

Now point your browser to your local development environment where you
installed CodeIgniter and add index.php/news/create to the URL.
Congratulations, you just created your first CodeIgniter application!
Add some news and check out the different pages you made.


text:
#ifndef SKSL_ASTFLOATLITERAL
#define SKSL_ASTFLOATLITERAL

#include "SkSLASTExpression.h"

namespace SkSL {

/**
 * A literal floating point number.
 */
struct ASTFloatLiteral : public ASTExpression {
    ASTFloatLiteral(int offset, double value)
    : INHERITED(offset, kFloat_Kind)
    , fValue(value) {}

    String description() const override {
        return to_string(fValue);
    }

    const double fValue;

    typedef ASTExpression INHERITED;
};

} // namespace

#endif


text:
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Scanner;

public class AMinerTask {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        LinkedHashMap<String, Integer> resources = new LinkedHashMap<>();

        while (true) {
            String currResource = scanner.nextLine();

            if (currResource.equals("stop")) {
                break;
            }

            int currResourceAmt = Integer.parseInt(scanner.nextLine());

            if (!resources.containsKey(currResource)) {
                resources.put(currResource, 0);
            }

            resources.put(currResource, resources.get(currResource) + currResourceAmt);
        }

        for (String currResource : resources.keySet()) {
            System.out.println(currResource + " -> " + resources.get(currResource));
        }
    }
}


text:
#include <aws/appmesh/model/VirtualServiceBackend.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace AppMesh
{
namespace Model
{

VirtualServiceBackend::VirtualServiceBackend() :
    m_clientPolicyHasBeenSet(false),
    m_virtualServiceNameHasBeenSet(false)
{
}

VirtualServiceBackend::VirtualServiceBackend(JsonView jsonValue) :
    m_clientPolicyHasBeenSet(false),
    m_virtualServiceNameHasBeenSet(false)
{
  *this = jsonValue;
}

VirtualServiceBackend& VirtualServiceBackend::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("clientPolicy"))
  {
    m_clientPolicy = jsonValue.GetObject("clientPolicy");

    m_clientPolicyHasBeenSet = true;
  }

  if(jsonValue.ValueExists("virtualServiceName"))
  {
    m_virtualServiceName = jsonValue.GetString("virtualServiceName");

    m_virtualServiceNameHasBeenSet = true;
  }

  return *this;
}

JsonValue VirtualServiceBackend::Jsonize() const
{
  JsonValue payload;

  if(m_clientPolicyHasBeenSet)
  {
   payload.WithObject("clientPolicy", m_clientPolicy.Jsonize());

  }

  if(m_virtualServiceNameHasBeenSet)
  {
   payload.WithString("virtualServiceName", m_virtualServiceName);

  }

  return payload;
}

} // namespace Model
} // namespace AppMesh
} // namespace Aws


text:
<?php

namespace Maghead\Sharding\Manager;

use Maghead\Sharding\ShardMapping;
use Maghead\Sharding\Chunk;
use Maghead\Runtime\Config\Config;
use Maghead\Manager\ConfigManager as BaseConfigManager;

use MongoDB\Client;

class ConfigManager extends BaseConfigManager
{
    private $appId;

    private $client;

    private $collection;

    function __construct(Config $config)
    {
        parent::__construct($config);

        if ($url = $config->getConfigServerUrl()) {
            $this->appId = $config->getAppId();
            if (!$this->appId) {
                throw new \Exception("appId is required");
            }
            $this->client = new Client($url);
            $this->collection = $this->client->maghead->configs;
        }
    }

    /**
     * Update only one chunk from the shard mapping
     */
    public function updateShardMappingChunk(ShardMapping $mapping, Chunk $chunk)
    {
        $i = $mapping->searchChunk($chunk);
        if ($i === false) {
            throw new \InvalidArgumentException("Chunk {$chunk->index} not found.");
        }

        $this->config['sharding']['mappings'][$mapping->id]['chunks'][$i] = $chunk->toArray();
        if ($this->client) {
            return $this->collection->updateOne([
                "appId" => $this->appId,

                // locate the correct chunk index in '$'
                "sharding.mappings.{$mapping->id}.chunks.index" => $chunk->index,
            ], [
                '$set' => [ "sharding.mappings.{$mapping->id}.chunks.$" => $chunk->toArray() ]
            ], [ 'upsert' => true ]);
        }
    }

    /**
     * update the chunks of one shard mapping
     */
    public function updateShardMappingChunks(ShardMapping $mapping)
    {
        $this->config['sharding']['mappings'][$mapping->id] = $mapping->toArray();
        if ($this->client) {
            return $this->collection->updateOne([
                'appId' => $this->appId,
            ], [
                '$set' => [ "sharding.mappings.{$mapping->id}.chunks" => $mapping->getChunks() ]
            ], [ 'upsert' => true ]);
        }
    }

    /**
     * set (update) shard mapping config.
     *
     * If the config server url is defined, the whole shard mapping will be
     * updated to the config server.
     */
    public function setShardMapping(ShardMapping $mapping)
    {
        $this->config['sharding']['mappings'][$mapping->id] = $mapping->toArray();
        if ($this->client) {
            return $this->collection->updateOne([ 'appId' => $this->appId ], [
                '$set' => [ "sharding.mappings.{$mapping->id}" => $mapping->toArray() ]
            ], [ 'upsert' => true ]);
        }
    }

    public function removeShardMapping(ShardMapping $mapping)
    {
        unset($this->config['sharding']['mappings'][$mapping->id]);
        if ($this->client) {
            return $this->collection->updateOne([ 'appId' => $this->appId ], [
                '$unset' => [ "sharding.mappings.{$mapping->id}" => '' ]
            ], [ 'upsert' => true ]);
        }
    }

    public function removeShardMappingById($mappingId)
    {
        unset($this->config['sharding']['mappings'][$mappingId]);
        if ($this->client) {
            return $this->collection->updateOne([ 'appId' => $this->appId ], [
                '$unset' => [ "sharding.mappings.{$mappingId}" => '' ]
            ], [ 'upsert' => true ]);
        }
    }

    public function removeInstance($nodeId)
    {
        unset($this->config['instances'][$nodeId]);
        if ($this->client) {
            return $this->collection->updateOne([ 'appId' => $this->appId ], [
                '$unset' => [ "instances.{$nodeId}" => '' ]
            ], [ 'upsert' => true ]);
        }
    }

    public function addInstance($nodeId, $dsnArg, array $opts = null)
    {
        $node = parent::addInstance($nodeId, $dsnArg, $opts);
        if ($this->client) {
            return $this->collection->updateOne([ 'appId' => $this->appId ], [
                '$set' => [ "instances.{$nodeId}" => $node ]
            ], [ 'upsert' => true ]);
        }
    }

    public function addDatabaseConfig($nodeId, array $node)
    {
        parent::addDatabaseConfig($nodeId, $node);
        if ($this->client) {
            return $this->collection->updateOne([ 'appId' => $this->appId ], [
                '$set' => [ "databases.{$nodeId}" => $node ]
            ], [ 'upsert' => true ]);
        }
    }

    public function removeDatabase($nodeId)
    {
        unset($this->config['databases'][$nodeId]);
        if ($this->client) {
            return $this->collection->updateOne([ 'appId' => $this->appId ], [
                '$unset' => [ "databases.{$nodeId}" => '' ]
            ], [ 'upsert' => true ]);
        }
    }

}


text:
class BuilderWithToBuilderOnMethod<T, K> {
  public static @SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderWithToBuilderOnMethodBuilder<Z> {
    private @SuppressWarnings("all") @javax.annotation.Generated("lombok") String one;
    private @SuppressWarnings("all") @javax.annotation.Generated("lombok") Z bar;
    @SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderOnMethodBuilder() {
      super();
    }
    public @SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderOnMethodBuilder<Z> one(final String one) {
      this.one = one;
      return this;
    }
    public @SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderOnMethodBuilder<Z> bar(final Z bar) {
      this.bar = bar;
      return this;
    }
    public @SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderOnMethod<Z, String> build() {
      return BuilderWithToBuilderOnMethod.<Z>test(one, bar);
    }
    public @Override @SuppressWarnings("all") @javax.annotation.Generated("lombok") String toString() {
      return (((("BuilderWithToBuilderOnMethod.BuilderWithToBuilderOnMethodBuilder(one=" + this.one) + ", bar=") + this.bar) + ")");
    }
  }
  private String one;
  private String two;
  private T foo;
  private K bar;
  private int some;
  BuilderWithToBuilderOnMethod() {
    super();
  }
  public static <Z>BuilderWithToBuilderOnMethod<Z, String> test(String one, Z bar) {
    return new BuilderWithToBuilderOnMethod<Z, String>();
  }
  public static @SuppressWarnings("all") @javax.annotation.Generated("lombok") <Z>BuilderWithToBuilderOnMethodBuilder<Z> builder() {
    return new BuilderWithToBuilderOnMethodBuilder<Z>();
  }
  public @SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderOnMethodBuilder<T> toBuilder() {
    return new BuilderWithToBuilderOnMethodBuilder<T>().one(this.one).bar(this.foo);
  }
}


text:
package renewal

import (
	"crypto/x509"
	"testing"

	pkiutil "k8s.io/kubernetes/cmd/kubeadm/app/util/pkiutil"

	certutil "k8s.io/client-go/util/cert"
)

func TestFileRenewer(t *testing.T) {
	// creates a File renewer using a test Certificate authority
	fr := NewFileRenewer(testCACert, testCAKey)

	// renews a certificate
	certCfg := &pkiutil.CertConfig{
		Config: certutil.Config{
			CommonName: "test-certs",
			AltNames: certutil.AltNames{
				DNSNames: []string{"test-domain.space"},
			},
			Usages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
		},
	}

	cert, _, err := fr.Renew(certCfg)
	if err != nil {
		t.Fatalf("unexpected error renewing cert: %v", err)
	}

	// verify the renewed certificate
	pool := x509.NewCertPool()
	pool.AddCert(testCACert)

	_, err = cert.Verify(x509.VerifyOptions{
		DNSName:   "test-domain.space",
		Roots:     pool,
		KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
	})
	if err != nil {
		t.Errorf("couldn't verify new cert: %v", err)
	}

}


text:
/*!
 * Vanilla Javascript Boilerplate with optional jQuery initialization
 * Author: Jan Rembold
 * Git: https://github.com/janrembold
 * License: MIT
 */

(function (root, factory) {
    var pluginName = 'Boilerplate';

    if (typeof define === 'function' && define.amd) {
        define([], factory(pluginName));
    } else if (typeof exports === 'object') {
        module.exports = factory(pluginName);
    } else {
        root[pluginName] = factory(pluginName);
    }
}(this, function (pluginName) {
    'use strict';

    var defaults = {
        someDefaultOption: 'foo'
    };

    /**
     * Merge defaults with user options
     * @param {Object} defaults Default settings
     * @param {Object} options User options
     */
    var extend = function (target, options) {
        var prop, extended = {};
        for (prop in defaults) {
            if (Object.prototype.hasOwnProperty.call(defaults, prop)) {
                extended[prop] = defaults[prop];
            }
        }
        for (prop in options) {
            if (Object.prototype.hasOwnProperty.call(options, prop)) {
                extended[prop] = options[prop];
            }
        }
        return extended;
    };

    /**
     * Some private helper function
     */
    var privateFunction = function() {
        // private helper code goes here
    };

    /**
     * Plugin Object
     * @param element The html element to initialize
     * @param {Object} options User options
     * @constructor
     */
    function Plugin(element, options) {
        this.element = element;
        this.options = extend(defaults, options);

        //init code goes here
        console.log('Plugin inititalized');
    }

    // Plugin prototype
    Plugin.prototype = {

        doSomething: function() {
            this.element.innerHTML = this.options.someDefaultOption;
        }

    };

    // add lightweight jQuery wrapper, if available
    if(window.jQuery) {
        var $ = window.jQuery;

        $.fn[pluginName] = function ( options ) {
            options = options || {};

            return this.each(function() {
                // add plugin to element data
                if (!$.data(this, 'plugin_'+pluginName) ) {
                    options.element = this;
                    $.data(this, 'plugin_'+pluginName, new Plugin(this, options));
                }
            });
        };
    }

    return Plugin;
}));


text:
namespace Habitat.Accounts.Tests.Extensions
{
  using System.Net.Mail;
  using Ploeh.AutoFixture;
  using Ploeh.AutoFixture.AutoNSubstitute;
  using Ploeh.AutoFixture.Xunit2;

  internal class AutoEmailDataAttribute : AutoDataAttribute
  {
    public AutoEmailDataAttribute()
      : base(new Fixture().Customize(new AutoNSubstituteCustomization()))
    {
      this.Fixture.Register(() =>
        new MailMessage(this.Fixture.Create<MailAddress>().Address,
          this.Fixture.Create<MailAddress>().Address,
          this.Fixture.Create("subject"),
          this.Fixture.Create("body")));
    }
  }
}


text:
<!DOCTYPE html>

    <title>Articles</title>

A list of resources indexed by keyword

      <input class="typeahead form-control" type="text" placeholder="Keywords">

    {% for article in articles.articles %}

{% if article.title|length < 1 %}
            Twitter Img or Link -
            {% else %}
            {{ article.title }} -
            {% endif %}

             check keywords  -

            {% if article.published != None %}
            {{ article.published }} -
            {% endif %}

            Go to >

    {% endfor %}

    {% if bookmark %}

Next

    {% endif %}

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


text:
/* $Id: LengthPairProperty.java 1303891 2012-03-22 17:04:12Z vhennebert $ */

package org.apache.fop.fo.properties;

import org.apache.fop.datatypes.CompoundDatatype;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.util.CompareUtil;

/**
 * Superclass for properties wrapping a LengthPair value
 */
public class LengthPairProperty extends Property implements CompoundDatatype {
    private Property ipd;
    private Property bpd;

    /**
     * Inner class for creating instances of LengthPairProperty
     */
    public static class Maker extends CompoundPropertyMaker {

        /**
         * @param propId name of property for which this Maker should be created
         */
        public Maker(int propId) {
            super(propId);
        }

        /**
         * Create a new empty instance of LengthPairProperty.
         * @return the new instance.
         */
        public Property makeNewProperty() {
            return new LengthPairProperty();
        }

        /**
         * {@inheritDoc}
         */
        public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
            throws PropertyException {
            if (p instanceof LengthPairProperty) {
                return p;
            }
            return super.convertProperty(p, propertyList, fo);
        }
    }

    /**
     * Creates a new LengthPairProperty with empty values.
     */
    public LengthPairProperty() {
        super();
    }

    /**
     * Creates a new LengthPairProperty.
     * @param ipd inline-progression-dimension
     * @param bpd block-progression-dimension
     */
    public LengthPairProperty(Property ipd, Property bpd) {
        this();
        this.ipd = ipd;
        this.bpd = bpd;
    }

    /**
     * Creates a new LengthPairProperty which sets both bpd and ipd to the
     * same value.
     * @param len length for both dimensions
     */
    public LengthPairProperty(Property len) {
        this(len, len);
    }

    /**
     * {@inheritDoc}
     */
    public void setComponent(int cmpId, Property cmpnValue,
                             boolean bIsDefault) {
        if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
            bpd = cmpnValue;
        } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
            ipd = cmpnValue;
        }
    }

    /**
     * {@inheritDoc}
     */
    public Property getComponent(int cmpId) {
        if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
            return getBPD();
        } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
            return getIPD();
        } else {
            return null;    // SHOULDN'T HAPPEN
        }
    }

    /**
     * @return Property holding the ipd length
     */
    public Property getIPD() {
        return this.ipd;
    }

    /**
     * @return Property holding the bpd length
     */
    public Property getBPD() {
        return this.bpd;
    }

    /** {@inheritDoc} */
    public String toString() {
        return "LengthPair["
            + "ipd:" + getIPD().getObject()
            + ", bpd:" + getBPD().getObject() + "]";
    }

    /**
     * @return this.lengthPair
     */
    public LengthPairProperty getLengthPair() {
        return this;
    }

    /**
     * @return this.lengthPair cast as an Object
     */
    public Object getObject() {
        return this;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + CompareUtil.getHashCode(bpd);
        result = prime * result + CompareUtil.getHashCode(ipd);
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof LengthPairProperty)) {
            return false;
        }
        LengthPairProperty other = (LengthPairProperty) obj;
        return CompareUtil.equal(bpd, other.bpd) && CompareUtil.equal(ipd, other.ipd);
    }
}


text:
namespace SpeedSlidingTrainer.Desktop
{
    public partial class App
    {
    }
}


text:
import unittest

import handler

class Context:

    def __init__(self):
        self.logs = ""

    def get_remaining_time_in_millis(self):
        pass

    def log(self, msg):
        self.logs += msg

class TestCase(unittest.TestCase):

    def test_case(self):
        ctx = Context()
        handler.Handle({}, ctx)
        self.assertEqual(200, len(ctx.logs))


text:
#ifndef _OPENVX_H_
#define _OPENVX_H_

/*!
 * \file
 * \brief The top level OpenVX Header.
 * \author Erik Rainey <erik.rainey@gmail.com>
 */

/*! \brief Defines the maximum number of characters in a implementation string.
 * \ingroup group_context
 */
#define VX_MAX_IMPLEMENTATION_NAME (64)

/*! \brief Defines the maximum string length of a kernel name to be added to OpenVX.
 * \ingroup group_kernel
 */
#define VX_MAX_KERNEL_NAME (256)

/*! \brief Defines the maximum length of a message buffer to copy from the log.
 * \ingroup group_basic_features
 */
#define VX_MAX_LOG_MESSAGE_LEN (1024)

#include <VX/vx_vendors.h>
#include <VX/vx_types.h>
#include <VX/vx_kernels.h>
#include <VX/vx_api.h>
#include <VX/vx_nodes.h>

/*! Defines the major version number macro.
 * \ingroup group_basic_features
 */
#define VX_VERSION_MAJOR(x) ((x & 0xFF) << 8)

/*! Defines the minor version number macro.
 * \ingroup group_basic_features
 */
#define VX_VERSION_MINOR(x) ((x & 0xFF) << 0)

/*! \brief Defines the predefined version number for 1.0.
 * \ingroup group_basic_features
 */
#define VX_VERSION_1_0      (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(0))

/*! Defines the OpenVX Version Number.
 * \ingroup group_basic_features
 */
#define VX_VERSION          VX_VERSION_1_0

#endif


text:
#pragma once
#include <datalib/data_info/either.hpp>
#include <datalib/detail/stream/fwd.hpp>
#include <datalib/detail/stream/kstream.hpp>
#include <datalib/detail/mpl/seqeach.hpp>

namespace datalib {

/*
 * Note:
 *  Order of arguments matters in the either object !!!
 *  e.g.:
 *      <int, float> ---> will detect int, then float (everything fine)
 *      <float, int> ---> will detect float but not int, since a pure int can also be a float (i.e. '10' is a float too))
 */

// CXX14 HELP-ME

/*
 *  Ugly looping ahead, awating for C++14's generic lambdas
 *  For now, let's manually write the generic functors
 */
namespace detail
{
    template<class Either>
    struct lambda_either_read_val
    {
        Either&     either;
        imemstream& stream;
        int         index;      // index of the type that should be readen ( this is not the same as which() !!!)
        bool&       result;     // outputs the result of the operation (=true) but on failure doesn't change the variable

        // Local-Scope Captures
        lambda_either_read_val(imemstream& stream, Either& either, int index, bool& result) :
            stream(stream), either(either), index(index), result(result)
        {}

        // The Functor
        template<class Integral, typename TypeWr>
        typename std::enable_if<!std::is_same<typename TypeWr::type, boost::detail::variant::void_>::value, bool>::type
        /* bool */ operator()(Integral, TypeWr)
        {
            if(index == Integral::value)    // only execute the read when it's the specified index
            {
                // Try to perform the read
                typename TypeWr::type value;
                if(stream >> value)
                {
                    // Successful, tell about the success and move the value to the either object
                    either = std::move(value);
                    this->result = true;
                }
                return false;   // stop iteration
            }
            return true;
        }

        // Avoid boost's voidness type
        template<class Integral, typename TypeWr>
        typename std::enable_if<std::is_same<typename TypeWr::type, boost::detail::variant::void_>::value, bool>::type
        /* bool */ operator()(Integral, TypeWr)
        {
            return false;
        }
    };

    template<class Either>
    struct lambda_either_find_index
    {
        const Either&           either;
        icheckstream&           stream;
        icheckstream::reposer   xrepos; // Used to reposition back on I/O failure
        int&                    result; // The output index ( this is not the same as which() !!! )

        // Local-Scope Captures
        lambda_either_find_index(icheckstream& stream, const Either& either, int& result) :
            stream(stream), either(either), result(result), xrepos(stream)
        {}

        // The Functor
        template<class Integral, typename TypeWr>
        typename std::enable_if<!std::is_same<typename TypeWr::type, boost::detail::variant::void_>::value, bool>::type
        /* bool */ operator()(Integral, TypeWr)
        {
            auto& is = stream;

            // Since basic_icheckstream doesn't write anything in '>>' use a null reference,
            // we won't take the time to construct a proper object
            auto& dummy_ref = *((const typename TypeWr::type*)(nullptr));

            // Check if it's possible to take the text on the stream pointer to the specified type
            if(is >> dummy_ref)
            {
                // Yep! Stop repositioning, set return index and stop iteration
                xrepos(!!is);
                this->result = Integral::value;
                return false; // stop iteration
            }
            else
            {
                // Hm, it's not this index, clear error flags and reposition the stream back
                is.clear();
                xrepos.repos();
            }
            return true;
        }

        // Avoid boost's voidness type
        template<class Integral, typename TypeWr>
        typename std::enable_if<std::is_same<typename TypeWr::type, boost::detail::variant::void_>::value, bool>::type
        /* bool */ operator()(Integral, TypeWr)
        {
            return false;
        }

    };
}

/*
 *  Input Checker
 */
template<class CharT, class Traits, class ...Args> inline
basic_icheckstream<CharT, Traits>& operator>>(basic_icheckstream<CharT, Traits>& is, const either<Args...>& either)
{
    icheckstream::sentry xsentry(is);
    if(xsentry)
    {
        // Find index to associate the input to the either object
        int result = -1;
        detail::lambda_either_find_index<std::decay<decltype(either)>::type> fun(is, either, result);
        foreach_type_variadic<Args...>()(fun);

        // If no index could be associated with the input, it indicates failure
        if(result == -1) is.setstate(std::ios::failbit);
    }
    return is;
}

/*
 *  Input
 */
template<class CharT, class Traits, class ...Args> inline
basic_imemstream<CharT, Traits>& operator>>(basic_imemstream<CharT, Traits>& is, either<Args...>& either)
{
    basic_imemstream<CharT, Traits>::sentry xsentry(is);
    if(xsentry)
    {
        int type_index = -1;

        // Make a stream checker with the current stream position (because we need to know the type we need to read in the first place)
        auto tell = std::streamoff(is.rdbuf()->pubseekoff(0, std::ios::cur, std::ios::in));
        basic_icheckstream<CharT, Traits>  icheck((char*)(is.rdbuf()->buffer()) + tell, size_t(is.rdbuf()->size() - tell));
        // Find the index of the type we need to read (this index isn't the which()!)
        detail::lambda_either_find_index<std::decay<decltype(either)>::type> index_fun(icheck, either, type_index);
        foreach_type_variadic<Args...>()(index_fun);

        if(type_index != -1)
        {
            // Read from the stream the specified type into the either object
            bool reading_result = false;
            detail::lambda_either_read_val<std::decay<decltype(either)>::type> xreader_fun(is, either, type_index, reading_result);
            foreach_type_variadic<Args...>()(xreader_fun);
            if(!reading_result) is.setstate(std::ios::failbit); // :(
        }
        else
        {
            is.setstate(std::ios::failbit);
        }
    }
    return is;
}

}

namespace std {

/*
 *  Input
 */
template<class CharT, class Traits, class ...Args> inline
std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is_, datalib::either<Args...>& either)
{
    auto& is = static_cast<datalib::imemstream&>(is_);   // unsafe
    is >> either;
    return is;
}

} // namespace datalib

/*
 *  Output is implemented by the either class itself
 */


text:
namespace bela {
namespace strings_internal {

// Applies the ViableSubstitutions in subs_ptr to the std::wstring_view s, and
// stores the result in *result_ptr. Returns the number of substitutions that
// occurred.
int ApplySubstitutions(std::wstring_view s, std::vector<strings_internal::ViableSubstitution<wchar_t>> *subs_ptr,
                       std::wstring *result_ptr) {
  auto &subs = *subs_ptr;
  int substitutions = 0;
  size_t pos = 0;
  while (!subs.empty()) {
    auto &sub = subs.back();
    if (sub.offset >= pos) {
      if (pos <= s.size()) {
        StrAppend(result_ptr, s.substr(pos, sub.offset - pos), sub.replacement);
      }
      pos = sub.offset + sub.old.size();
      substitutions += 1;
    }
    sub.offset = s.find(sub.old, pos);
    if (sub.offset == std::wstring_view::npos) {
      subs.pop_back();
    } else {
      // Insertion sort to ensure the last ViableSubstitution continues to be
      // before all the others.
      size_t index = subs.size();
      while ((--index != 0U) && subs[index - 1].OccursBefore(subs[index])) {
        std::swap(subs[index], subs[index - 1]);
      }
    }
  }
  result_ptr->append(s.data() + pos, s.size() - pos);
  return substitutions;
}

int ApplySubstitutions(std::string_view s, std::vector<strings_internal::ViableSubstitution<char>> *subs_ptr,
                       std::string *result_ptr) {
  auto &subs = *subs_ptr;
  int substitutions = 0;
  size_t pos = 0;
  while (!subs.empty()) {
    auto &sub = subs.back();
    if (sub.offset >= pos) {
      if (pos <= s.size()) {
        StrAppend(result_ptr, s.substr(pos, sub.offset - pos), sub.replacement);
      }
      pos = sub.offset + sub.old.size();
      substitutions += 1;
    }
    sub.offset = s.find(sub.old, pos);
    if (sub.offset == std::wstring_view::npos) {
      subs.pop_back();
    } else {
      // Insertion sort to ensure the last ViableSubstitution continues to be
      // before all the others.
      size_t index = subs.size();
      while ((--index != 0U) && subs[index - 1].OccursBefore(subs[index])) {
        std::swap(subs[index], subs[index - 1]);
      }
    }
  }
  result_ptr->append(s.data() + pos, s.size() - pos);
  return substitutions;
}

} // namespace strings_internal

// We can implement this in terms of the generic StrReplaceAll, but
// we must specify the template overload because C++ cannot deduce the type
// of an initializer_list parameter to a function, and also if we don't specify
// the type, we just call ourselves.
//
// Note that we implement them here, rather than in the header, so that they
// aren't inlined.

std::wstring StrReplaceAll(std::wstring_view s,
                           std::initializer_list<std::pair<std::wstring_view, std::wstring_view>> replacements) {
  return StrReplaceAll<std::initializer_list<std::pair<std::wstring_view, std::wstring_view>>, wchar_t>(s,
                                                                                replacements);
}

int StrReplaceAll(std::initializer_list<std::pair<std::wstring_view, std::wstring_view>> replacements,
                  std::wstring *target) {
  return StrReplaceAll<std::initializer_list<std::pair<std::wstring_view, std::wstring_view>>, wchar_t>(replacements,
                                                                                target);
}

std::string StrReplaceAll(std::string_view s,
                          std::initializer_list<std::pair<std::string_view, std::string_view>> replacements) {
  return StrReplaceAll<std::initializer_list<std::pair<std::string_view, std::string_view>>, char>(s, replacements);
}

int StrReplaceAll(std::initializer_list<std::pair<std::string_view, std::string_view>> replacements,
                  std::string *target) {
  return StrReplaceAll<std::initializer_list<std::pair<std::string_view, std::string_view>>, char>(replacements,
                                                                                target);
}

} // namespace bela


text:
package wint.help.sql;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author pister
 * 2012-9-11 下午3:12:15
 */
public interface RowProcessor<T> {

    T processRow(ResultSet rs) throws SQLException;

}


text:
package tech.wetech.cms.model;

import java.util.List;

/**
 * 系统栏目树对象
 * @author cjbi
 *
 */
public class ChannelTree {

	private Integer id;
	private String name;
	private Integer pid;
	private Channel channel;
	private List<Channel> child;
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

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

	public Integer getPid() {
		return pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	public ChannelTree() {
	}

	public Channel getChannel() {
		return channel;
	}

	public void setChannel(Channel channel) {
		this.channel = channel;
	}

	public List<Channel> getChild() {
		return child;
	}

	public void setChild(List<Channel> child) {
		this.child = child;
	}

	public ChannelTree(Integer id, String name, Integer pid) {
		super();
		this.id = id;
		this.name = name;
		this.pid = pid;
	}

	@Override
	public String toString() {
		return "ChannelTree [id=" + id + ", name=" + name + ", pid=" + pid + ", channel=" + channel + ", child=" + child
				+ "]";
	}

}


text:
namespace IPC {
struct ChannelHandle;
class ChannelProxy;
class Message;
}  // namespace IPC

// This is the counterpart to AppShimController in
// chrome/app/chrome_main_app_mode_mac.mm. The AppShimHost owns itself, and is
// destroyed when the app it corresponds to is closed or when the channel
// connected to the app shim is closed.
class AppShimHost : public IPC::Listener,
                    public IPC::Sender,
                    public apps::AppShimHandler::Host,
                    public base::NonThreadSafe {
 public:
  AppShimHost();
  virtual ~AppShimHost();

  // Creates a new server-side IPC channel at |handle|, which should contain a
  // file descriptor of a channel created by an UnixDomainSocketAcceptor,
  // and begins listening for messages on it.
  void ServeChannel(const IPC::ChannelHandle& handle);

 protected:
  // IPC::Listener implementation.
  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
  virtual void OnChannelError() OVERRIDE;

  // IPC::Sender implementation.
  virtual bool Send(IPC::Message* message) OVERRIDE;

 private:
  // The app shim process is requesting to be associated with the given profile
  // and app_id. Once the profile and app_id are stored, and all future
  // messages from the app shim relate to this app. The app is launched
  // immediately if |launch_now| is true.
  void OnLaunchApp(const base::FilePath& profile_dir,
                   const std::string& app_id,
                   apps::AppShimLaunchType launch_type,
                   const std::vector<base::FilePath>& files);

  // Called when the app shim process notifies that the app was focused.
  void OnFocus(apps::AppShimFocusType focus_type,
               const std::vector<base::FilePath>& files);

  void OnSetHidden(bool hidden);

  // Called when the app shim process notifies that the app should quit.
  void OnQuit();

  // apps::AppShimHandler::Host overrides:
  virtual void OnAppLaunchComplete(apps::AppShimLaunchResult result) OVERRIDE;
  virtual void OnAppClosed() OVERRIDE;
  virtual void OnAppHide() OVERRIDE;
  virtual void OnAppRequestUserAttention() OVERRIDE;
  virtual base::FilePath GetProfilePath() const OVERRIDE;
  virtual std::string GetAppId() const OVERRIDE;

  // Closes the channel and destroys the AppShimHost.
  void Close();

  scoped_ptr<IPC::ChannelProxy> channel_;
  std::string app_id_;
  base::FilePath profile_path_;
  bool initial_launch_finished_;
};

#endif  // APPS_APP_SHIM_APP_SHIM_HOST_MAC_H_


text:
<?php
class MY_Model extends CI_Model{

  public $em;

  public function __construct(){
    parent::__construct();
    $this->em=$this->doctrine->em;
  }

}


text:
%% Copyright (C) 1995, 1996, 1997  Kurt Hornik
%%
%% This file is part of Octave.
%%
%% Octave is free software; you can redistribute it and/or modify it
%% under the terms of the GNU General Public License as published by
%% the Free Software Foundation; either version 2, or (at your option)
%% any later version.
%%
%% Octave is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%% General Public License for more details.
%%
%% You should have received a copy of the GNU General Public License
%% along with Octave; see the file COPYING.  If not, write to the Free
%% Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
%% 02110-1301, USA.

%% -*- texinfo -*-
%% @deftypefn {Function File} {} betapdf (@var{x}, @var{a}, @var{b})
%% For each element of @var{x}, returns the PDF at @var{x} of the beta
%% distribution with parameters @var{a} and @var{b}.
%% @end deftypefn

%% Author: KH <Kurt.Hornik@wu-wien.ac.at>
%% Description: PDF of the Beta distribution

function pdf = betapdf (x, a, b)

  if (nargin ~= 3)
    error('usage: betapdf(x,a,b)');
  end

  if (~isscalar (a) || ~isscalar(b))
    [retval, x, a, b] = common_size (x, a, b);
    if (retval > 0)
      error ('betapdf: x, a and b must be of common size or scalar');
    end
  end

  sz = size (x);
  pdf = zeros (sz);

  k = find (~(a > 0) | ~(b > 0) | isnan (x));
  if (any (k))
    pdf (k) = NaN;
  end

  k = find ((x > 0) & (x < 1) & (a > 0) & (b > 0));
  if (any (k))
    if (isscalar(a) && isscalar(b))
      pdf(k) = exp ((a - 1) .* log (x(k)) + (b - 1) .* log (1 - x(k))) ./ beta (a, b);
    else
      pdf(k) = exp ((a(k) - 1) .* log (x(k)) + (b(k) - 1) .* log (1 - x(k))) ./ beta (a(k), b(k));
    end
  end

end


text:
maintainer       "Dustin Sallings"
maintainer_email "dustin@couchbase.com"
license          "All rights reserved"
description      "Installs/Configures dev-packages"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version          "0.0.1"

%w{ fedora redhat centos ubuntu debian }.each do |os|
  supports os
end