text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Titles -->
    <!-- Common Menu items -->
    <string name="menu_refresh">Refrescar</string>
    <!-- Common Buttons -->
    <string name="btn_delete">Eliminar</string>
    <string name="btn_update">Atualizar</string>
</resources>

redpajama_set_name: RedPajamaGithub


text:
package fj.function;

/**
 * A transformation function of arity-5 from A, B, C, D and E to F that may throw an Exception.
 *
 * Used to instantiate a lambda that may throw an Exception before converting to an F5.
 *
 * @see fj.Try#f(Try5)
 * @version %build.number%
 */

public interface Try5 {

    F f(A a, B b, C c, D d, E e) throws Z;

}


text:
#ifndef AVCODEC_DIRACTAB_H
#define AVCODEC_DIRACTAB_H

#include <stdint.h>

/* Tables here are shared between the Dirac/VC-2 decoder and the VC-2 encoder */

/* Default quantization tables for each wavelet transform */
extern const uint8_t ff_dirac_default_qmat[7][4][4];

/* Scaling factors needed for quantization/dequantization */
extern const int32_t ff_dirac_qscale_tab[116];

/* Scaling offsets needed for quantization/dequantization, for intra frames */
extern const int32_t ff_dirac_qoffset_intra_tab[120];

/* Scaling offsets needed for quantization/dequantization, for inter frames */
extern const int ff_dirac_qoffset_inter_tab[122];

#endif /* AVCODEC_DIRACTAB_H */


text:
<title>mofs.srv._FuzzyControl_IO.FuzzyControl_IO Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="search/search.css" rel="stylesheet" type="text/css"/>

Main Page

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Hierarchy

Class Members

 All Classes Namespaces Files Functions Variables Typedefs

mofs

srv

_FuzzyControl_IO

FuzzyControl_IO

Static Private Attributes |
List of all members

mofs.srv._FuzzyControl_IO.FuzzyControl_IO Class Reference

Inheritance diagram for mofs.srv._FuzzyControl_IO.FuzzyControl_IO:

[legend]

Static Private Attributes

string 	_md5sum = 'fba685fbdda96b6ff62d5238836ec32a'

 	_request_class = FuzzyControl_IORequest

 	_response_class = FuzzyControl_IOResponse

string 	_type = 'mofs/FuzzyControl_IO'

Detailed Description

Definition at line 199 of file _FuzzyControl_IO.py.

Member Data Documentation

          string mofs.srv._FuzzyControl_IO.FuzzyControl_IO._md5sum = 'fba685fbdda96b6ff62d5238836ec32a'

staticprivate

Definition at line 201 of file _FuzzyControl_IO.py.

          mofs.srv._FuzzyControl_IO.FuzzyControl_IO._request_class = FuzzyControl_IORequest

staticprivate

Definition at line 202 of file _FuzzyControl_IO.py.

          mofs.srv._FuzzyControl_IO.FuzzyControl_IO._response_class = FuzzyControl_IOResponse

staticprivate

Definition at line 203 of file _FuzzyControl_IO.py.

          string mofs.srv._FuzzyControl_IO.FuzzyControl_IO._type = 'mofs/FuzzyControl_IO'

staticprivate

Definition at line 200 of file _FuzzyControl_IO.py.

The documentation for this class was generated from the following file:

_FuzzyControl_IO.py

mofs

Author(s): miguel

autogenerated on Wed Oct 16 2013 14:44:05


text:
Plans

{{ plan }}

    Plan is not running

  	Jobs Execution ({{ completedJobs() / jobs.length * 100 | number: 0 }}% complete, started {{ planObject.start_timestamp * 1000|date:'medium' }}, finished {{ planObject.end_timestamp * 1000|date:'medium' }})
    <input type="sarch" class="form-control input-sm" placeholder="Filter" class="pull-right" ng-model="filter">

    			Module name
    			Options
    			Host
    			Status

	    	  	{{ job.module }}
            {{ job.module }}
	    	  	{{ job.options }}
	    	  	{{ job.host }}
	    	  	{{ job.status }}
	    	  	{{ job.status }}
	    	  	{{ job.status }}
	    	  	{{ job.status }}
	    	  	{{ job.status }}
	    	  	{{ job.status }}
            {{ job.status }}
            {{ job.status }}

              <button ng-if="!job.showLog && job.output != nil && job.output != ''" class="btn btn-xs btn-info" ng-click="showLog($index)">Log</button>
              <button ng-if="job.showLog" class="btn btn-xs btn-info active" ng-click="showLog($index)">Log</button>
              <button ng-if="!job.showReqs && job.requirements.length > 0" class="btn btn-xs btn-success" ng-click="showReqs($index)">Reqs</button>
              <button ng-if="job.showReqs && job.requirements.length > 0" class="btn btn-xs btn-success active" ng-click="showReqs($index)">Reqs</button>

{{job.output}}

Requirements

                {{ findJob(job.host, req.name, req.opts).status }}
                {{ findJob(job.host, req.name, req.opts).status }}
                {{ findJob(job.host, req.name, req.opts).status }}
                {{ findJob(job.host, req.name, req.opts).status }}
                {{ findJob(job.host, req.name, req.opts).status }}
                {{ findJob(job.host, req.name, req.opts).status }}
                {{ findJob(job.host, req.name, req.opts).status }}
                {{ findJob(job.host, req.name, req.opts).status }}
                {{ req.name }} {{ req.opts }}


text:
package com.amazonaws.services.lexruntime.model.transform;

import java.util.Map;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.lexruntime.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * DialogActionMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class DialogActionMarshaller {

    private static final MarshallingInfo<String> TYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("type").build();
    private static final MarshallingInfo<String> INTENTNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("intentName").build();
    private static final MarshallingInfo<Map> SLOTS_BINDING = MarshallingInfo.builder(MarshallingType.MAP).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("slots").build();
    private static final MarshallingInfo<String> SLOTTOELICIT_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("slotToElicit").build();
    private static final MarshallingInfo<String> FULFILLMENTSTATE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("fulfillmentState").build();
    private static final MarshallingInfo<String> MESSAGE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("message").build();
    private static final MarshallingInfo<String> MESSAGEFORMAT_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("messageFormat").build();

    private static final DialogActionMarshaller instance = new DialogActionMarshaller();

    public static DialogActionMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(DialogAction dialogAction, ProtocolMarshaller protocolMarshaller) {

        if (dialogAction == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(dialogAction.getType(), TYPE_BINDING);
            protocolMarshaller.marshall(dialogAction.getIntentName(), INTENTNAME_BINDING);
            protocolMarshaller.marshall(dialogAction.getSlots(), SLOTS_BINDING);
            protocolMarshaller.marshall(dialogAction.getSlotToElicit(), SLOTTOELICIT_BINDING);
            protocolMarshaller.marshall(dialogAction.getFulfillmentState(), FULFILLMENTSTATE_BINDING);
            protocolMarshaller.marshall(dialogAction.getMessage(), MESSAGE_BINDING);
            protocolMarshaller.marshall(dialogAction.getMessageFormat(), MESSAGEFORMAT_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
layout: post
title:  "How we use Pivotal Tracker at Ombu Labs"
date: 2018-09-06 11:10:00
categories: ["agile", "pivotal-tracker"]
author: "etagwerker"
---

We tend to use [GitHub](https://github.com) for everything at [Ombu Labs](https://www.ombulabs.com), but sometimes our clients
prefer [Pivotal Tracker](https://www.pivotaltracker.com). We have no problem
with Pivotal Tracker, we just like to keep everything in one place, that is why
we prefer GitHub for everything.

There are many things that are easier with Pivotal Tracker, as long as you are
using it the right way. Some of its features are very useful for agile teams like
ours. This is how we like to use it to ship value with every sprint and keep
track of our [velocity](http://wiki.c2.com/?ProjectVelocity).

## Step 1: Filing user stories

Every single thing has to be tracked according to the type of story. Most of the user
stories are either *features* or *bugs*, although sometimes there will be *chores* to be
done. If a *chore* reoccurs many times, then it's probably time to write a *feature*
to reduce the time spent completing that *chore*.

## Step 2: Describing user stories

Every [user story](https://www.mountaingoatsoftware.com/agile/user-stories) should
be a simple description of a feature:

```
As a < type of user >, I want < some goal > so that < some business goal >.
```

The description of the user story should be very clear about the expected outcome.
This will explain what is the exit criteria for the story. It is very helpful
for designers and developers to understand what needs to happen for a user to
be happy with the feature.

This is an example from one of our recent projects ([https://audit.fastruby.io/](https://audit.fastruby.io/)):

```
As a user I want to submit my Gemfile.lock
so that I can see an audit analysis of its vulnerabilities.
```

If the client requested this feature, you should add them as the *Requester* of
the story. If it was you, then you can add yourself to it.

## Step 3: Estimating user stories

Before you start working on a user story, you will need to estimate it. You
can estimate it with 0, 1, 2, 3, 5, or 8 points. We prefer to use a [Fibonacci](https://en.wikipedia.org/wiki/Fibonacci_number)
sequence to estimate stories.

If a story is more complicated than 8 points, you should break it down in two or
more stories. When you estimate, you must remember that you are [estimating
complexity](https://rubygarage.org/blog/3-reasons-to-estimate-with-story-points),
**not hours**. Different developers might take different amount of time
in completing that story, so **we shouldn't estimate hours**.

For the example we mentioned before, we estimate that that story has 3 points of
complexity.

Story points are not hours. Given a user story that has 3 story points of complexity,
a Senior Developer might take 2 hours shipping it, a Junior Developer might take
5 hours shipping it.

## Step 4: Starting and finishing user stories

You should always pick the first unassigned story from the top of the backlog.
If the first story is assigned to someone, you may check with them if they need
your help with it.

Once you start a story, the clock starts ticking on that story. You should try
to finish it as soon as possible.

When the time comes and you're done working on the code and tests for that story,
you will submit a pull request and attach it to the user story. At that point,
you can click the *Finish* button.

## Step 5: Delivering a user story

When your pull request has been approved by a code reviewer, you or the reviewer
can merge this pull request and deploy it. If the code doesn't get deployed
automatically (**it should!**), you should deploy it to staging so that the
*Requester* can accept or reject the implementation.

Before you click *Deliver* you should perform a quick [smoke test](http://wiki.c2.com/?SmokeTest) to make sure
that your changes were successfully deployed to the staging environment.

After that, you can go ahead and *Deliver* the user story. This will move the
story to an Accept/Reject state:

## Step 6: Accepting or rejecting a user story

If the *requester* approves the story, they will mark it as accepted. No more
work is necessary in this user story. Great!

If they reject the story, they should provide a detailed description about the
rejection. If you were the *requester* you can ask yourself this question to
describe the problem/s:

- What did you expect and what did actually happen?
- What cases worked and what cases didn't work as expected?
- Was the interface clear enough to understand what was going on?
- Did you test many cases and it failed with an edge case?

If possible, describe the exact scenario and steps that you took to find a
problem with the user story. If you think that adding a screenshot will help,
you should add it as a comment after you reject the story.

## Step 7: Restarting a rejected user story

There will be times when your implementation is not good enough. It may fall
short in terms of usability, performance, or behavior. The good news is that
our process works. Someone verified a feature you implemented and found issues
with the implementation.

When the time comes, you will find a user story in this state:

You can simply restart the user story and resume working on it. If you need to
submit another pull request to patch the feature, you can continue with step 4.

## Conclusion

[Pivotal Tracker](https://www.pivotaltracker.com/) provides a great way to track team velocity. This helps in determining when a big feature will be shipped. As much as we like
to use [GitHub](https://github.com/) for everything, Pivotal Tracker integrates nicely with them (they recently launched this integration!) which improves traceability from feature to
implementation.

It is not our first choice when it comes to project management tools, but we
can adapt to our client's tools and thrive using it. Pivotal Tracker is more
advanced than GitHub Projects and it provides great features for managing your
user stories, backlog, icebox, and team velocity.

At [Ombu Labs](https://www.ombulabs.com) we like to invite all stakeholders to our project management
tools. I like how Pivotal Tracker makes it easy to communicate that some stories
will be delivered in this sprint and some will have to wait until the next sprint.
It is a great way to manage expectations.


text:
static void print_usage(char *argv0)
{
	printf("SeaCat.io Agent %s for %s\n", SEACAT_VERSION "", SEACAT_ARCHCODE "");
	printf("\n%s\n", seacatio_ascii);
	printf("(C) 2014-2017 TeskaLabs Ltd\n");
	printf("https://www.seacat.io/\n\n");
	printf("Build uses:\n\tSeaCat C-Core %s\n\t%s\n\tlibev %d.%d\n\n", seacatcc_version(), SSLeay_version(SSLEAY_VERSION), ev_version_major(), ev_version_minor());
	printf("This product includes software developed by the OpenSSL Project\nfor use in the OpenSSL Toolkit (http://www.openssl.org/)\n\n");
	printf("Usage: %s [ -vh ] [ -c FILE ]\n\n", argv0);

	printf("Arguments:\n");
	printf(" -c [--config] FILE     : Specify file path to configuration file\n                          default value location: '%s'\n", sca_config.config_file);
	printf(" -v [--verbose]         : Print more information (enable debug output)\n");
	printf(" -h [--help]            : Show this help\n");
}

static void optparse(int argc, char **argv)
{
	int c;

	while (1)
	{
		static struct option long_options[] =
		{
			{"verbose", no_argument,  0,  'v' },
			{"help", no_argument, 0, 'h'},
			{"config", required_argument, 0, 'c'},
			{0, 0, 0, 0}
		};

		// getopt_long stores the option index here.
		int option_index = 0;

		c = getopt_long(argc, argv, "vhc:", long_options, &option_index);

		// Detect the end of the options.
		if (c == -1) break;

		switch (c)
		{
			case 'h':
				print_usage(argv[0]);
				exit(EXIT_SUCCESS);

			case 'v':
				ft_config.log_verbose = true;
				break;

			case 'c':
				sca_config.config_file = strdup(optarg);
				break;

			case '?':
				exit(EXIT_FAILURE);

			default:
				exit(EXIT_FAILURE);
		}
	}

	// Print any remaining command line arguments (not options)
	if (optind < argc)
	{
		fprintf(stderr, "Unknown options on command line:\n");
		while (optind < argc) fprintf(stderr, "  %s\n", argv[optind++]);
		exit(EXIT_FAILURE);
	}

}

///

struct sca_app sca_app;

int main(int argc, char **argv)
{
	// Set configuration values
	sca_config_environ();

	optparse(argc, argv);

	bool ok = sca_app_init(&sca_app);
	if (!ok) return EXIT_FAILURE;

	int ret = sca_app_run(&sca_app);

	FT_DEBUG("Exiting with status %d", ret);

	sca_app_fini(&sca_app);
	return ret;
}


text:
// Copyright (c)  2011 Google, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

/**
 * @fileoverview Mocked-out jstestdriver api that lets me test locally.
 *
 * @author konigsberg@google.com (Robert Konigsberg)
 */
var jstestdriver = {
  jQuery : jQuery
};

var jstd = {
  include : function(name) {
    this.sucker("Not including " + name);
  },
  sucker : function(text) {
    console.log(text + ", sucker!");
  }
};

function TestCase(name) {
  jstd.sucker("Not really creating TestCase(" + name + ")");
  this.name = name;
  this.toString = function() {
    return "Fake test case " + name;
  };

  var emptyFunction = function() { return this; };
  emptyFunction.prototype.setUp = function() { };
  emptyFunction.prototype.tearDown = function() { };
  emptyFunction.prototype.runTest = function(name) {
    try {
      this.setUp();
      var fn = this[name];
      fn.apply(this, []);
      this.tearDown();
    } catch (e) {
      console.log(e.stack);
    }
  };
  return emptyFunction;
};


text:
'use strict';

var jwt = require('jsonwebtoken'),
    uuid = require('uuid'),
    fs = require('fs');

var privateCertificate = fs.readFileSync('jwtRS256.key');
var publicCertificate = fs.readFileSync('jwtRS256.key.pub');

exports.create_jwt = function(iss, sub, aud) {
    return jwt.sign(
        {
            iss: iss,
            sub: sub,
            aud: aud,
            jti: uuid.v4()
        },
        privateCertificate,
        {
            algorithm: 'RS256',
            expiresIn: '2h'
        }
    );
};

exports.verify = function(token, issuer, callback) {
    jwt.verify(
        token,
        publicCertificate,
        {
            issuer: issuer,
            algorithms: ['RS256']
        },
        callback
    );
};


text:
using System;

namespace OtpNet
{
    /// <summary>
    /// Calculate HMAC-Based One-Time-Passwords (HOTP) from a secret key
    /// </summary>
    /// <remarks>
    /// The specifications for this are found in RFC 4226
    /// http://tools.ietf.org/html/rfc4226
    /// </remarks>
    public class Hotp : Otp
    {
        private readonly int hotpSize;

        /// <summary>
        /// Create a HOTP instance
        /// </summary>
        /// <param name="secretKey">The secret key to use in HOTP calculations</param>
        /// <param name="mode">The hash mode to use</param>
        /// <param name="hotpSize">The number of digits that the returning HOTP should have.  The default is 6.</param>
        public Hotp(byte[] secretKey, OtpHashMode mode = OtpHashMode.Sha1, int hotpSize = 6)
            : base(secretKey, mode)
        {
            VerifyParameters(hotpSize);

            this.hotpSize = hotpSize;
        }

        /// <summary>
        /// Create a HOTP instance
        /// </summary>
        /// <param name="key">The key to use in HOTP calculations</param>
        /// <param name="mode">The hash mode to use</param>
        /// <param name="hotpSize">The number of digits that the returning HOTP should have.  The default is 6.</param>
        public Hotp(IKeyProvider key, OtpHashMode mode = OtpHashMode.Sha1, int hotpSize = 6)
            : base(key, mode)
        {
            VerifyParameters(hotpSize);

            this.hotpSize = hotpSize;
        }

        private static void VerifyParameters(int hotpSize)
        {
            if(!(hotpSize >= 6))
                throw new ArgumentOutOfRangeException("hotpSize");
            if(!(hotpSize <= 8))
                throw new ArgumentOutOfRangeException("hotpSize");
        }

        /// <summary>
        /// Takes a counter and then computes a HOTP value
        /// </summary>
        /// <param name="timestamp">The timestamp to use for the HOTP calculation</param>
        /// <returns>a HOTP value</returns>
        public string ComputeHOTP(long counter)
        {
            return this.Compute(counter, this.hashMode);
        }

        /// <summary>
        /// Verify a value that has been provided with the calculated value
        /// </summary>
        /// <param name="hotp">the trial HOTP value</param>
        /// <param name="counter">The counter value to verify/param>
        /// <returns>True if there is a match.</returns>
        public bool VerifyHotp(string hotp, long counter)
        {
            if(hotp == ComputeHOTP(counter))
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// Takes a time step and computes a HOTP code
        /// </summary>
        /// <param name="counter">counter</param>
        /// <param name="mode">The hash mode to use</param>
        /// <returns>HOTP calculated code</returns>
        protected override string Compute(long counter, OtpHashMode mode)
        {
            var data = KeyUtilities.GetBigEndianBytes(counter);
            var otp = this.CalculateOtp(data, mode);
            return Digits(otp, this.hotpSize);
        }
    }
}


text:
		<title>RunThis.Club | Organize Your Club</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta name="description" content="Simplify club communications with a built-in calendar, notification sender, discussion board, survey system, and attendance tracker.">
		<meta name="keywords" content="club, organize, manage, attendance, school, notification, run, coordinate, group, event, activity, calendar">
		<link href="stylesheets/general.css" rel="stylesheet" type="text/css">
		<link href="stylesheets/view_activity.css" rel="stylesheet" type="text/css">
		<link href="stylesheets/messages.css" rel="stylesheet" type="text/css">
		<link href="stylesheets/view_entity.css" rel="stylesheet" type="text/css">
		<link href="stylesheets/body_form.css" rel="stylesheet" type="text/css">
		<link rel="shortcut icon" href="imgs/favicon.ico" type="image/x-icon">
		<link rel="icon" href="imgs/favicon.ico" type="image/x-icon">

						|         |         |

						LOGIN

						REGISTER

Title

Menu

Overview

Participants (0)

Discussion

Member Area

Modify Activity

Join Activity

Leave Activity

										Filter
										<input type="checkbox" id="userPositionFilterCheckbox">

											Position#
											None found

												<input type="checkbox" checked="true" name="activityshowActivityCreator">

Creator
0
												<input type="checkbox" checked="true" name="activityshowActivityAdmin">

Admin
0
												<input type="checkbox" checked="true" name="activityshowActivityMember">

Member
0
												<input type="checkbox" checked="true" name="activityshowActivityCandidate">

Candidates
0

<input type="checkbox" name="userListActionsShowInfo">

										Show user info

<input type="checkbox" name="userListActionsShowName">

										Display real name instead of username

								<form id="activity-discussion-message-form" class="bodyForm discussion-message-form">
									<input type="hidden" name="discussion-form-actionID" value="1">
									<input type="text" name="discussion-form-title" placeholder="Title">
									<textarea name="discussion-form-content" placeholder="Message" textarea></textarea>
									<input type="submit" value="Post Message">
								</form>

										<button onclick="inviteMembers()">Invite Members</button>
										<button onclick="getDirectLink()">Direct Link</button>

										Send notifications via email to members:

Limit of 5 notifications per hour

Users can choose whether or not to receive notifications in their settings

No insulting or offensive language

Next →

										<input type="checkbox" value="newForm.html">

Create Survey

										<input type="checkbox" value="modifyMemberArea.html">

Members' Area

									<button id="deleteThumbnailButton" onclick="deleteThumbnail()">Delete Thumbnail</button>
									<button id="deleteActivityButton" onclick="deleteActivity()">Delete Activity</button>

									<form id="modifyActivityForm" class="bodyForm" enctype="multipart/form-data">
										<input type="hidden" name="activityID" id="modify-activity-activityID">
										Name:
				 						<input type="text" name="activityName" placeholder="Name">
										Description:
				 						<textarea name="activityDescription" preview></textarea>
										Group:* Denotes current group

										<select name="activityGroupID" id="activityGroupSelect">
											<option value="" id="activityGroupSelectNone">None</option>
										</select>

<input type="checkbox" name="activityEditable" value="1">

											Automatically give admin priveleges to group's admins.

				 						Date:mm/dd/yyyy
										<input type="text" id="modifyActivityDate" name="activityTime1" class="date-input">
										Time:
										<input type="text" id="modifyActivityTime" name="activityTime2" class="time-input">
										# of Hours:
				 						<input type="text" id="modifyActivityHours" name="activityHours" placeholder="Hours" class="number-input">
										Location: Ex. Room #
				 						<input type="text" name="activityLocation" placeholder="Location">
										Street Address:
				 						<input type="text" name="activityMapLocation" placeholder="Address" id="modifyActivityMapLocation">
										Tags:Separate tags with commas
				 						<input type="text" name="activityTags" placeholder="Tags">
				 						Privacy options:
										<select name="activityPrivate" id="activityPrivateSelect">
											<option value="0">Public</option>
											<optgroup label="Anyone can view details and users."></optgroup>
				            	<option value="1">Restricted</option>
											<optgroup label="People outside not in the activity can only view overview."></optgroup>
											<optgroup label="Requires approval from admin or creator to join."></optgroup>
				            	<option value="2">Private</option>
											<optgroup label="People outside group must use access key to view activity."></optgroup>
										</select>
										Thumbnail:
										<input type="file" name="activityThumbnail" accept="image/*" id="activityThumbnail">
										Modify slideshow images:

											<input type="text" name="deleteIMGS" placeholder="imgs" id="modifyActivityDeleteImgs">

										<input type="submit" name="submit" value="Save Changes">
									</form>


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class Deal_page extends CI_Controller{
        public function __construct(){
                parent::__construct();
                $this->load->model("hotdealsearch_model");
                $this->load->model("classifed_model");
                $this->load->library('pagination');
               }
        public function index(){
          if ($this->session->userdata('login_id')) {
            $saved_searchexist = $this->classifed_model->saved_searchexist($this->session->userdata('login_id'));
          }
          else{
            $saved_searchexist = array();
          }

           if ((time() - $this->session->userdata('saved_time1')) > 5 ){
                   $this->session->unset_userdata('saved_time1');
                   $this->session->unset_userdata('saved_msg1');
                }
          if ($this->input->get()) {
            $this->session->unset_userdata('search_subsubsub');
            $this->session->unset_userdata('access_sub');
            $this->session->unset_userdata('hotlaptop_sub');
            $this->session->unset_userdata('accessories');
            $this->session->unset_userdata('search_proptype');
            $this->session->unset_userdata('search_resisub');
            $this->session->unset_userdata('search_commsub');
            $this->session->unset_userdata('resi_prop');
            $this->session->unset_userdata('comm_prop');
            $this->session->unset_userdata('search_acctype');

          $this->session->unset_userdata('cat_id');
          $this->session->unset_userdata('seller_id');
          $this->session->unset_userdata('bus_id');
          $this->session->unset_userdata('search_sub');
          $this->session->unset_userdata('search_subsub');
          $this->session->unset_userdata('search_bustype');
          $this->session->unset_userdata('dealurgent');
          $this->session->unset_userdata('dealtitle');
          $this->session->unset_userdata('dealprice');
          $this->session->unset_userdata('recentdays');
          $this->session->unset_userdata('location');
          $this->session->unset_userdata('latt');
          $this->session->unset_userdata('longg');

          /*motor point starts*/
            $this->session->unset_userdata('car_van_bus');
            $this->session->unset_userdata('motor_hm');
            $this->session->unset_userdata('bikes_sub');
            $this->session->unset_userdata('plant_farm');
            $this->session->unset_userdata('boats_sub');
            if($this->input->get('search_subsubsub')){
                       $this->session->set_userdata('search_subsubsub',$this->input->get('search_subsubsub'));
                }else{
                     $this->session->set_userdata('search_subsubsub',array());
                }
            if($this->input->get('access_sub')){
                       $this->session->set_userdata('access_sub',$this->input->get('access_sub'));
                }else{
                     $this->session->set_userdata('access_sub',array());
                }
            if($this->input->get('search_acctype')){
                       $this->session->set_userdata('search_acctype',$this->input->get('search_acctype'));
                }else{
                     $this->session->set_userdata('search_acctype','all');
                }
            if($this->input->get('resi_prop')){
                       $this->session->set_userdata('resi_prop',$this->input->get('resi_prop'));
                }else{
                     $this->session->set_userdata('resi_prop',array());
                }
                if($this->input->get('comm_prop')){
                       $this->session->set_userdata('comm_prop',$this->input->get('comm_prop'));
                }else{
                     $this->session->set_userdata('comm_prop',array());
                }
                if($this->input->get('search_resisub')){
                       $this->session->set_userdata('search_resisub',$this->input->get('search_resisub'));
                }else{
                     $this->session->set_userdata('search_resisub','');
                }
                if($this->input->get('search_commsub')){
                       $this->session->set_userdata('search_commsub',$this->input->get('search_commsub'));
                }else{
                     $this->session->set_userdata('search_commsub','');
                }
                if($this->input->get('search_proptype')){
                       $this->session->set_userdata('search_proptype',$this->input->get('search_proptype'));
                }else{
                     $this->session->set_userdata('search_proptype','all');
                }
                if($this->input->get('accessories')){
                       $this->session->set_userdata('accessories',$this->input->get('accessories'));
                }else{
                     $this->session->set_userdata('accessories','');
                }

                if($this->input->get('hotlaptop_sub')){
                       $this->session->set_userdata('hotlaptop_sub',$this->input->get('hotlaptop_sub'));
                }else{
                     $this->session->set_userdata('hotlaptop_sub','');
                }

                if($this->input->get('car_van_bus')){
                     $this->session->set_userdata('car_van_bus',$this->input->get('car_van_bus'));
                }
                else{
                    $this->session->set_userdata('car_van_bus',array());
                }
                if($this->input->get('motor_hm')){
                     $this->session->set_userdata('motor_hm',$this->input->get('motor_hm'));
                }
                else{
                    $this->session->set_userdata('motor_hm',array());
                }
                if($this->input->get('bikes_sub')){
                     $this->session->set_userdata('bikes_sub',$this->input->get('bikes_sub'));
                }
                else{
                    $this->session->set_userdata('bikes_sub',array());
                }
                if($this->input->get('plant_farm')){
                     $this->session->set_userdata('plant_farm',$this->input->get('plant_farm'));
                }
                else{
                    $this->session->set_userdata('plant_farm',array());
                }
                if($this->input->get('boats_sub')){
                     $this->session->set_userdata('boats_sub',$this->input->get('boats_sub'));
                }
                else{
                    $this->session->set_userdata('boats_sub','');
                }
                /*motor point ends*/

            if($this->input->get('category_name')){
                 $this->session->set_userdata('cat_id',$this->input->get('category_name'));
            }
            else{
                $this->session->set_userdata('cat_id','all');
            }
            if($this->input->get('seller_deals')){
                 $this->session->set_userdata('seller_id',$this->input->get('seller_deals'));
            }
             else{
                $this->session->set_userdata('seller_id',array());
            }
            if($this->input->get('business_type')){
                 $this->session->set_userdata('bus_id',$this->input->get('business_type'));
            }else{
                $this->session->set_userdata('bus_id','all');
            }

            if($this->input->get('search_sub')){
                 $this->session->set_userdata('search_sub',$this->input->get('search_sub'));
            }
            else{
                $this->session->set_userdata('search_sub',array());
            }
             if($this->input->get('search_subsub')){
                   $this->session->set_userdata('search_subsub',$this->input->get('search_subsub'));
              }
              else{
                  $this->session->set_userdata('search_subsub',array());
              }

            if($this->input->get('dealtitle_sort')){
                       $this->session->set_userdata('dealtitle',$this->input->get('dealtitle_sort'));
              }else{
                   $this->session->set_userdata('dealtitle','Any');
              }
              if($this->input->get('dealurgent')){
                       $this->session->set_userdata('dealurgent' ,$this->input->get('dealurgent'));
                }else{
                     $this->session->set_userdata('dealurgent',array());
                }
              if($this->input->get('price_sort')){
                     $this->session->set_userdata('dealprice',$this->input->get('price_sort'));
              }else{
                   $this->session->set_userdata('dealprice','Any');
              }
              if($this->input->get('recentdays_sort')){
                     $this->session->set_userdata('recentdays',$this->input->get('recentdays_sort'));
              }else{
                   $this->session->set_userdata('recentdays','Any');
              }
              if ($this->input->get('list-autocomplete') != '' || $this->input->get('list-autocomplete') != '0'){
                   $this->session->set_userdata('location',$this->input->get('list-autocomplete'));
              }
              else{
                $this->session->set_userdata('location','');
              }

          }

          if ($this->session->userdata('login_id') == '') {
                    $login_status = 'no';
                    $login = '';
                    $favourite_list = array();
                }
                else{
                    $login_status = 'yes';
                    $login = $this->session->userdata('login_id');
                    $favourite_list = $this->classifed_model->favourite_list();
                }

          $config = array();
            $config['base_url'] = base_url().'deal_page/index';
            $config['total_rows'] = count($this->hotdealsearch_model->count_hotdeal_search());
            $config['per_page'] = 30;
             $config['next_link'] = 'Next';
              $config['prev_link'] = 'Previous';
            $config['full_tag_open'] ='
';
            $config['full_tag_close'] ='
';
            $this->pagination->initialize($config);
            $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
            $search_option = array(
                'limit' =>$config['per_page'],
                'start' =>$page
                );
              $result = $this->hotdealsearch_model->hotdeal_search($search_option);
              $category = $this->hotdealsearch_model->category();
              $public_adview = $this->classifed_model->publicads_service();
              $this->session->set_userdata("saved_search1", $this->current_url());
                $data   =   array(
                        "title"     =>  "Classifieds",
                        "content"   =>  "deal_page",
                          'category' => $category,
                          'dealsresult' => $result,
                          'login_status' =>$login_status,
                        'login' =>$login,
                        'paging_links' =>$this->pagination->create_links(),
                        'favourite_list'=>$favourite_list,
                        "public_adview" => $public_adview,
                        "saved_searchexist"=>$saved_searchexist,
                        "onhotdeal" =>$this->session->userdata('onhotdeal')
                );
           /*business and consumer count for hot deals*/
          $data['busconcount'] = $this->hotdealsearch_model->busconcount_hotdeals();
          $data['sellercount'] = $this->hotdealsearch_model->sellercount_hotdeals();
          if ($this->session->userdata('cat_id') == 1) {
             $data['sellerneededcount'] = $this->hotdealsearch_model->sellerneededhot_jobs();
           }
           else if ($this->session->userdata('cat_id') == 2) {
             $data['sellerneededcount'] = $this->hotdealsearch_model->sellerneededhot_services();
           }
           else if ($this->session->userdata('cat_id') == 3) {
             $data['sellerneededcount'] = $this->hotdealsearch_model->sellerneededhot_motors();
           }
           else if ($this->session->userdata('cat_id') == 4) {
             $data['sellerneededcount'] = $this->hotdealsearch_model->sellerneededhot_property();
           }
           else if ($this->session->userdata('cat_id') == 5) {
             $data['sellerneededcount'] = $this->hotdealsearch_model->sellerneededhot_pets();
           }
           else if ($this->session->userdata('cat_id') == 6) {
             $data['sellerneededcount'] = $this->hotdealsearch_model->sellerneededhot_clothstyle();
           }
           else if ($this->session->userdata('cat_id') == 7) {
             $data['sellerneededcount'] = $this->hotdealsearch_model->sellerneededhot_kitchen();
           }
           else if ($this->session->userdata('cat_id') == 8) {
             $data['sellerneededcount'] = $this->hotdealsearch_model->sellerneededhot_ezone();
           }
           /*services sub sub*/
           $data['subcat_prof'] = $this->hotdealsearch_model->subcat_prof_hotdeals();
           $data['subcat_pop'] = $this->hotdealsearch_model->subcat_pop_hotdeals();

           /*jobs*/
          $data['subcat_cnt'] = $this->hotdealsearch_model->jobs_hotdeals();

          /*motor sub sub*/
         $data['subcat_cars'] = $this->hotdealsearch_model->subcat_cars_hotdeals();
         $data['subcat_bikes'] = $this->hotdealsearch_model->subcat_bikes_hotdeals();
         $data['subcat_motorhomes'] = $this->hotdealsearch_model->subcat_motorhomes_hotdeals();
         $data['subcat_vans'] = $this->hotdealsearch_model->subcat_vans_hotdeals();
         $data['subcat_buses'] = $this->hotdealsearch_model->subcat_buses_hotdeals();
         $data['subcat_plant'] = $this->hotdealsearch_model->subcat_plant_hotdeals();
         $data['subcat_farming'] = $this->hotdealsearch_model->subcat_farming_hotdeals();
         $data['subcat_boats'] = $this->hotdealsearch_model->subcat_boatscnt_hotdeals();
         $data['subcat_motoraccess'] = $this->hotdealsearch_model->subcat_motoraccess_hotdeals();
           /*find a property sub sub*/
         $data['cnt_findpropery'] = $this->hotdealsearch_model->cnt_findpropery_hotdeal();
         $data['subcat_resi'] = $this->hotdealsearch_model->subcat_resi_hotdeals();
         $data['subcat_comm'] = $this->hotdealsearch_model->subcat_comm_hotdeals();
         $data['resi_sub'] = $this->hotdealsearch_model->resi_sub_hotdeals();
         $data['comm_sub'] = $this->hotdealsearch_model->comm_sub_hotdeals();
          /*pets sub sub*/
         $data['subcat_pets'] = $this->hotdealsearch_model->subcat_pets_hotdeals();
         $data['subcat_bigpets'] = $this->hotdealsearch_model->subcat_bigpets_hotdeals();
         $data['subcat_smallpets'] = $this->hotdealsearch_model->subcat_smallpets_hotdeals();
         $data['subcat_petsaccess'] = $this->hotdealsearch_model->subcat_petsaccess_hotdeals();
          /*cloths and life styles*/
         $data['subcat_women'] = $this->hotdealsearch_model->subcat_women_hotdeals();
         $data['subcat_men'] = $this->hotdealsearch_model->subcat_men_hotdeals();
         $data['subcat_boy'] = $this->hotdealsearch_model->subcat_boy_hotdeals();
         $data['subcat_girl'] = $this->hotdealsearch_model->subcat_girl_hotdeals();
         $data['subcat_bboy'] = $this->hotdealsearch_model->subcat_bboy_hotdeals();
         $data['subcat_bgirl'] = $this->hotdealsearch_model->subcat_bgirl_hotdeals();
         /*home kitchen*/
         $data['subcat_kitchen'] = $this->hotdealsearch_model->subcat_kitchen_hotdeals();
         $data['subcat_home'] = $this->hotdealsearch_model->subcat_home_hotdeals();
         $data['subcat_decor'] = $this->hotdealsearch_model->subcat_decor_hotdeals();
         /*ezone*/
         $data['cnt_accessories'] = $this->hotdealsearch_model->cnt_accessories_hotdeals();
         // $data['cnt_ezone'] = $this->hotdealsearch_model->cnt_ezone_hotdeals();
         $data['subcat_phone'] = $this->hotdealsearch_model->subcat_phone_hotdeals();
         $data['subcat_homeapp'] = $this->hotdealsearch_model->subcat_homeapp_hotdeals();
         $data['subcat_smallapp'] = $this->hotdealsearch_model->subcat_smallapp_hotdeals();
         $data['subcat_lappy'] = $this->hotdealsearch_model->subcat_lappy_hotdeals();
         $data['subcat_access'] = $this->hotdealsearch_model->subcat_access_hotdeals();
         $data['accesories_mtablets'] = $this->hotdealsearch_model->accesories_mtablets_hotdeals();
         $data['accesories_computers'] = $this->hotdealsearch_model->accesories_computers_hotdeals();
         $data['accesories_headphone'] = $this->hotdealsearch_model->accesories_headphone_hotdeals();
         $data['accesories_audiovideo'] = $this->hotdealsearch_model->accesories_audiovideo_hotdeals();
         $data['accesories_camera'] = $this->hotdealsearch_model->accesories_camera_hotdeals();

         $data['subcat_pcare'] = $this->hotdealsearch_model->subcat_pcare_hotdeals();
         $data['subcat_henter'] = $this->hotdealsearch_model->subcat_henter_hotdeals();
         $data['subcat_gaming'] = $this->hotdealsearch_model->subcat_gaming_hotdeals();
         $data['subcat_pgraphy'] = $this->hotdealsearch_model->subcat_pgraphy_hotdeals();
         $data['subcat_computers'] = $this->hotdealsearch_model->subcat_computers_hotdeals();
         $data['subcat_networks'] = $this->hotdealsearch_model->subcat_networks_hotdeals();
         $data['subcat_softwares'] = $this->hotdealsearch_model->subcat_softwares_hotdeals();
         $data['hotlaptops_cnt'] = $this->hotdealsearch_model->hotlaptops_cnt();
           /*packages count*/
          $data['deals_pck'] = $this->hotdealsearch_model->hotdeals_pck_hotdeals();
            $this->load->view("classified_layout/inner_template",$data);
        }

        public function getcityname(){
                $latt = $this->input->post('latt');
                $longg = $this->input->post('longg');
                $url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=".$latt.",".$longg."&sensor=true";
                $ch = curl_init();
                // Disable SSL verification
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                // Will return the response, if false it print the response
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                // Set the url
                curl_setopt($ch, CURLOPT_URL,$url);
                // Execute
                $result=curl_exec($ch);
                // Closing
                curl_close($ch);
                $json_response = json_decode($result, true);
                $res_array = array(
                        'cityname'=>$json_response['results'][0]['address_components'][1]['short_name']
                        );
                echo json_encode($res_array);
        }

        public function current_url()
        {
            $CI =& get_instance();

            $url = $CI->config->site_url($CI->uri->uri_string());
            return $_SERVER['QUERY_STRING'] ? $url.'?'.$_SERVER['QUERY_STRING'] : $url;
        }

        public function addsave_search(){
            $save = $this->classifed_model->addsaved_hotdeals();
            if ($save == 1) {
                $this->session->set_userdata('saved_msg1', 'Your search is saved');
                $this->session->set_userdata('saved_time1', time());
                echo 1;
            }
            else{
                echo 0;
            }
        }

        public function search_exists(){
          $exist = $this->classifed_model->hotsearch_exists();
          if ($exist > 0) {
            echo 1;
          }
          else{
            echo 0;
          }
        }
}


text:
package net.bhardy.braintree.scala

import _root_.org.junit.runner.RunWith
import _root_.org.scalatest.FunSpec
import _root_.org.scalatest.junit.JUnitRunner
import _root_.org.scalatest.matchers.MustMatchers

@RunWith(classOf[JUnitRunner])
class ValidationErrorCodeSpec extends FunSpec with MustMatchers {
  describe("findByCode") {
    it("happy case") {
      val code = ValidationErrorCode.findByCode("81801")
      code must be === ValidationErrorCode.ADDRESS_CANNOT_BE_BLANK
    }

    it("falls back when not found") {
      val code = ValidationErrorCode.findByCode("-9999")
      code must be === ValidationErrorCode.UNKNOWN_VALIDATION_ERROR
    }
  }
}


text:
<?php
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
		$is_ajax = $_REQUEST['is_ajax'];
		if(isset($is_ajax) && $is_ajax) {
		include_once('assets/config/database.php');
		$admin = $mysqli->real_escape_string($_REQUEST['admin_id']);
			if($admin == 1) {
				$getpost = $mysqli->real_escape_string($_REQUEST['content']);
				$mysqli->query("UPDATE ".$prefix."properties SET homecontent = '$getpost'");
			}
		}
}
?>


text:
/*
 * stdlib.h
 *
 * Definitions for common types, variables, and functions.
 */

#ifndef _STDLIB_H_
#define _STDLIB_H_

#include <stddef.h>

#include "ieeefp.h"
#include "ansi.h"
#include "types.h"

#include "alloca.h"

#include "reent.h"

_BEGIN_STD_C

typedef struct
{
  int quot; /* quotient */
  int rem; /* remainder */
} div_t;

typedef struct
{
  long quot; /* quotient */
  long rem; /* remainder */
} ldiv_t;

typedef struct
{
  long long int quot; /* quotient */
  long long int rem; /* remainder */
} lldiv_t;

#ifndef NULL
	#define NULL 0
#endif

#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0

#define RAND_MAX __RAND_MAX

typedef int _mbstate_t;
typedef __WCHAR_TYPE__ wchar_t;
int	_EXFUN(__locale_mb_cur_max,(_VOID));

#define MB_CUR_MAX __locale_mb_cur_max()

_VOID	_EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
int	_EXFUN(abs,(int));
int	_EXFUN(atexit,(_VOID (*__func)(_VOID)));
double	_EXFUN(atof,(const char *__nptr));

float	_EXFUN(atoff,(const char *__nptr));

int	_EXFUN(atoi,(const char *__nptr));
long	_EXFUN(atol,(const char *__nptr));
long long	_EXFUN(atoll,(const char *__nptr));
_PTR	_EXFUN(bsearch,(const _PTR __key,
		       const _PTR __base,
		       size_t __nmemb,
		       size_t __size,
		       int _EXFNPTR(_compar,(const _PTR, const _PTR))));
_PTR	_EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size));
div_t	_EXFUN(div,(int __numer, int __denom));
_VOID	_EXFUN(exit,(int __status) _ATTRIBUTE ((noreturn)));
_VOID	_EXFUN_NOTHROW(free,(_PTR));
char *  _EXFUN(getenv,(const char *__string));
char *	_EXFUN(_getenv_r,(struct _reent *, const char *__string));
char *	_EXFUN(_findenv,(_CONST char *, int *));
char *	_EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));

extern char *suboptarg;			/* getsubopt(3) external variable */
int	_EXFUN(getsubopt,(char **, char * const *, char **));

long	_EXFUN(labs,(long));
ldiv_t	_EXFUN(ldiv,(long __numer, long __denom));
_PTR	_EXFUN_NOTHROW(malloc,(size_t __size));
int	_EXFUN(mblen,(const char *, size_t));
int	_EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *));
int	_EXFUN(mbtowc,(wchar_t *, const char *, size_t));
int	_EXFUN(_mbtowc_r,(struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *));
int	_EXFUN(wctomb,(char *, wchar_t));
int	_EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *));
size_t	_EXFUN(mbstowcs,(wchar_t *, const char *, size_t));
size_t	_EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *));
size_t	_EXFUN(wcstombs,(char *, const wchar_t *, size_t));
size_t	_EXFUN(_wcstombs_r,(struct _reent *, char *, const wchar_t *, size_t, _mbstate_t *));

_VOID	_EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR)));
int	_EXFUN(rand,(_VOID));
_PTR	_EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size));

_PTR	_EXFUN(reallocf,(_PTR __r, size_t __size));

_VOID	_EXFUN(srand,(unsigned __seed));
double	_EXFUN(strtod,(const char *__n, char **__end_PTR));
double	_EXFUN(_strtod_r,(struct _reent *,const char *__n, char **__end_PTR));
float	_EXFUN(strtof,(const char *__n, char **__end_PTR));

/* the following strtodf interface is deprecated...use strtof instead */
# ifndef strtodf
#  define strtodf strtof
# endif

long	_EXFUN(strtol,(const char *__n, char **__end_PTR, int __base));
long	_EXFUN(_strtol_r,(struct _reent *,const char *__n, char **__end_PTR, int __base));
unsigned long _EXFUN(strtoul,(const char *__n, char **__end_PTR, int __base));
unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__n, char **__end_PTR, int __base));

int	_EXFUN(system,(const char *__string));

long    _EXFUN(a64l,(const char *__input));
char *  _EXFUN(l64a,(long __input));
char *  _EXFUN(_l64a_r,(struct _reent *,long __input));
int	_EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg));
_VOID	_EXFUN(_Exit,(int __status) _ATTRIBUTE ((noreturn)));
int	_EXFUN(putenv,(char *__string));
int	_EXFUN(_putenv_r,(struct _reent *, char *__string));
_PTR	_EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t));
int	_EXFUN(setenv,(const char *__string, const char *__value, int __overwrite));
int	_EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite));

char *	_EXFUN(gcvt,(double,int,char *));
char *	_EXFUN(gcvtf,(float,int,char *));
char *	_EXFUN(fcvt,(double,int,int *,int *));
char *	_EXFUN(fcvtf,(float,int,int *,int *));
char *	_EXFUN(ecvt,(double,int,int *,int *));
char *	_EXFUN(ecvtbuf,(double, int, int*, int*, char *));
char *	_EXFUN(fcvtbuf,(double, int, int*, int*, char *));
char *	_EXFUN(ecvtf,(float,int,int *,int *));
char *	_EXFUN(dtoa,(double, int, int, int *, int*, char**));
int	_EXFUN(rand_r,(unsigned *__seed));

double _EXFUN(drand48,(_VOID));
double _EXFUN(_drand48_r,(struct _reent *));
double _EXFUN(erand48,(unsigned short [3]));
double _EXFUN(_erand48_r,(struct _reent *, unsigned short [3]));
long   _EXFUN(jrand48,(unsigned short [3]));
long   _EXFUN(_jrand48_r,(struct _reent *, unsigned short [3]));
_VOID  _EXFUN(lcong48,(unsigned short [7]));
_VOID  _EXFUN(_lcong48_r,(struct _reent *, unsigned short [7]));
long   _EXFUN(lrand48,(_VOID));
long   _EXFUN(_lrand48_r,(struct _reent *));
long   _EXFUN(mrand48,(_VOID));
long   _EXFUN(_mrand48_r,(struct _reent *));
long   _EXFUN(nrand48,(unsigned short [3]));
long   _EXFUN(_nrand48_r,(struct _reent *, unsigned short [3]));
unsigned short *
       _EXFUN(seed48,(unsigned short [3]));
unsigned short *
       _EXFUN(_seed48_r,(struct _reent *, unsigned short [3]));
_VOID  _EXFUN(srand48,(long));
_VOID  _EXFUN(_srand48_r,(struct _reent *, long));
long long _EXFUN(atoll,(const char *__nptr));
long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr));
long long _EXFUN(llabs,(long long));
lldiv_t	_EXFUN(lldiv,(long long __numer, long long __denom));
long long _EXFUN(strtoll,(const char *__n, char **__end_PTR, int __base));
long long _EXFUN(_strtoll_r,(struct _reent *, const char *__n, char **__end_PTR, int __base));
unsigned long long _EXFUN(strtoull,(const char *__n, char **__end_PTR, int __base));
unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__n, char **__end_PTR, int __base));

char *	_EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));

int	_EXFUN(_system_r,(struct _reent *, const char *));

_VOID	_EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));

_END_STD_C

#endif /* _STDLIB_H_ */


text:
<?php

class PluginsfGuardLoginFailure extends BasesfGuardLoginFailure
{

  public static function trackFailure($username)
  {
    $failure = new sfGuardLoginFailure();
    $failure->setUsername($username);
    $failure->setFailedAt(time());
    $failure->setCookieId(array_key_exists('HTTP_COOKIE', $_SERVER) ? $_SERVER['HTTP_COOKIE']: null);
    $failure->setIpAddress(array_key_exists('REMOTE_ADDR', $_SERVER)? $_SERVER['REMOTE_ADDR']: null);
    $failure->save();
    if ( $context = sfContext::getInstance())
    {
      $context->getEventDispatcher()->notify(new sfEvent('sfGuardSecurePlugin', 'application.log', array(
      'message'        => sprintf ("Login failed for user=%s ip=%s", $failure->getUsername(), $failure->getIpAddress()),
      'priority'       => sfLogger::ERR,
    )));
    }
  }
}


text:
package domala.jdbc.query
import java.util
import java.util.function.Function

import domala.internal.expr.ExpressionEvaluator
import org.seasar.doma.internal.jdbc.sql.node.ExpandNode
import org.seasar.doma.jdbc.PreparedSql

import scala.collection.Iterable
import scala.collection.JavaConverters._

abstract class AbstractSelectQuery extends org.seasar.doma.jdbc.query.AbstractSelectQuery{

  protected def buildSqlDomala(sqlBuilder: (ExpressionEvaluator, Function[ExpandNode, util.List[String]]) => PreparedSql): Unit = {
    val evaluator: ExpressionEvaluator = new ExpressionEvaluator(this.parameters, this.config.getDialect.getExpressionFunctions, this.config.getClassHelper)
    this.sql = sqlBuilder.apply(evaluator, this.expandColumns _)
  }

  override def addParameter(name: String, tpe: Class[_], value: Any): Unit = {
    value match {
      case x: Iterable[_] =>
        val converted = x.asJava
        super.addParameter(name, converted.getClass, converted)
      case _ => super.addParameter(name, tpe, value)
    }
  }
}


text:
<TEMPLATE ID="pop_brown" FORMAT="WRAPPER">

<ELEMENT ID="CPUMCCR" SUB="LINK_VISITED_TEXT_COLOR" TYPE="READONLY" LOAD="THEME::LINK_VISITED_TEXT_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCCS" SUB="TABLE_HEADING_FONT_SIZE" TYPE="READONLY" LOAD="THEME::TABLE_HEADING_FONT_SIZE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCCT" SUB="DISCLAIMER_FONT_SIZE" TYPE="READONLY" LOAD="THEME::DISCLAIMER_FONT_SIZE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCCU" SUB="CONTENT_BACKGROUND_COLOR" TYPE="READONLY" LOAD="THEME::CONTENT_BACKGROUND_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCCV" SUB="TABLE_LISTING_BACKGROUND_COLOR" TYPE="READONLY" LOAD="THEME::TABLE_LISTING_BACKGROUND_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCCW" SUB="CONTENT_TEXT_COLOR" TYPE="READONLY" LOAD="THEME::CONTENT_TEXT_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCCX" SUB="TABLE_LISTING_FONT_SIZE" TYPE="READONLY" LOAD="THEME::TABLE_LISTING_FONT_SIZE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCCY" SUB="TABLE_LISTING_TEXT_COLOR" TYPE="READONLY" LOAD="THEME::TABLE_LISTING_TEXT_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCCZ" SUB="TABLE_LISTING_FONT_FACE" TYPE="READONLY" LOAD="THEME::TABLE_LISTING_FONT_FACE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDA" SUB="CONTENT_FONT_FACE" TYPE="READONLY" LOAD="THEME::CONTENT_FONT_FACE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDB" SUB="NAME" TYPE="READONLY" LOAD="THEME::NAME" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDC" SUB="DISCLAIMER_FONT_FACE" TYPE="READONLY" LOAD="THEME::DISCLAIMER_FONT_FACE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDD" SUB="PRETTY_NAME" TYPE="READONLY" LOAD="THEME::PRETTY_NAME" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDE" SUB="TABLE_HEADING_BACKGROUND_COLOR" TYPE="READONLY" LOAD="THEME::TABLE_HEADING_BACKGROUND_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDF" SUB="TABLE_LISTING_BACKGROUND_COLOR_ALTERNATE" TYPE="READONLY" LOAD="THEME::TABLE_LISTING_BACKGROUND_COLOR_ALTERNATE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDG" SUB="LINK_ACTIVE_TEXT_COLOR" TYPE="READONLY" LOAD="THEME::LINK_ACTIVE_TEXT_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDH" SUB="CONTENT_FONT_SIZE" TYPE="READONLY" LOAD="THEME::CONTENT_FONT_SIZE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDI" SUB="ALERT_COLOR" TYPE="READONLY" LOAD="THEME::ALERT_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDJ" SUB="DISCLAIMER_BACKGROUND_COLOR" TYPE="READONLY" LOAD="THEME::DISCLAIMER_BACKGROUND_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDK" SUB="TABLE_HEADING_FONT_FACE" TYPE="READONLY" LOAD="THEME::TABLE_HEADING_FONT_FACE" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDL" SUB="TABLE_HEADING_TEXT_COLOR" TYPE="READONLY" LOAD="THEME::TABLE_HEADING_TEXT_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDM" SUB="DISCLAIMER_TEXT_COLOR" TYPE="READONLY" LOAD="THEME::DISCLAIMER_TEXT_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDN" SUB="LINK_TEXT_COLOR" TYPE="READONLY" LOAD="THEME::LINK_TEXT_COLOR" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDO" SUB="HOMECATEGORY_URL" TYPE="READONLY" LOAD="URL::HOMECATEGORY_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDP" SUB="WRAPPER_URL" TYPE="READONLY" LOAD="URL::WRAPPER_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDQ" SUB="CART_URL" TYPE="READONLY" LOAD="URL::CART_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDR" SUB="SUBSCRIBE_URL" TYPE="READONLY" LOAD="URL::SUBSCRIBE_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDS" SUB="FEEDBACK_URL" TYPE="READONLY" LOAD="URL::FEEDBACK_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDT" SUB="LOGOUT_FUNCTION_URL" TYPE="READONLY" LOAD="URL::LOGOUT_FUNCTION_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDU" SUB="SHIPQUOTE_URL" TYPE="READONLY" LOAD="URL::SHIPQUOTE_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDV" SUB="PRIVACY_URL" TYPE="READONLY" LOAD="URL::PRIVACY_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDW" SUB="SITEBUTTON_URL" TYPE="READONLY" LOAD="URL::SITEBUTTON_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDX" SUB="HOMEPAGE_URL" TYPE="READONLY" LOAD="URL::HOMEPAGE_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDY" SUB="COUNTER_URL" TYPE="READONLY" LOAD="URL::COUNTER_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCDZ" SUB="RETURNS_URL" TYPE="READONLY" LOAD="URL::RETURNS_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEA" SUB="PASSWORD_URL" TYPE="READONLY" LOAD="URL::PASSWORD_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEB" SUB="UPDATE_PAYMENT_URL" TYPE="READONLY" LOAD="URL::UPDATE_PAYMENT_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEC" SUB="FORGOT_URL" TYPE="READONLY" LOAD="URL::FORGOT_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCED" SUB="NAVBUTTON_URL" TYPE="READONLY" LOAD="URL::NAVBUTTON_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEE" SUB="CONTACT_URL" TYPE="READONLY" LOAD="URL::CONTACT_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEF" SUB="LOGOUT_URL" TYPE="READONLY" LOAD="URL::LOGOUT_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEG" SUB="GALLERY_URL" TYPE="READONLY" LOAD="URL::GALLERY_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEH" SUB="REMOVE_URL" TYPE="READONLY" LOAD="URL::REMOVE_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEI" SUB="HOME_URL" TYPE="READONLY" LOAD="URL::HOME_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEJ" SUB="ABOUT_ZOOVY_URL" TYPE="READONLY" LOAD="URL::ABOUT_ZOOVY_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEK" SUB="NEWS_URL" TYPE="READONLY" LOAD="URL::NEWS_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEL" SUB="SECURE_URL" TYPE="READONLY" LOAD="URL::SECURE_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEM" SUB="ABOUT_URL" TYPE="READONLY" LOAD="URL::ABOUT_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEN" SUB="USERBUTTON_URL" TYPE="READONLY" LOAD="URL::USERBUTTON_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEO" SUB="CLOSED_URL" TYPE="READONLY" LOAD="URL::CLOSED_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEP" SUB="FASTORDER_URL" TYPE="READONLY" LOAD="URL::FASTORDER_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEQ" SUB="MAIL_FORM_URL" TYPE="READONLY" LOAD="URL::MAIL_FORM_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCER" SUB="GRAPHICS_URL" TYPE="READONLY" LOAD="URL::GRAPHICS_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCES" SUB="IMAGE_URL" TYPE="READONLY" LOAD="URL::IMAGE_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCET" SUB="CONTACTUS_URL" TYPE="READONLY" LOAD="URL::CONTACTUS_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEU" SUB="DYNAMIC_URL" TYPE="READONLY" LOAD="URL::DYNAMIC_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEV" SUB="NONSECURE_URL" TYPE="READONLY" LOAD="URL::NONSECURE_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEW" SUB="CONTACT_US_URL" TYPE="READONLY" LOAD="URL::CONTACT_US_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEX" SUB="SEARCH_URL" TYPE="READONLY" LOAD="URL::SEARCH_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEY" SUB="ABOUTUS_URL" TYPE="READONLY" LOAD="URL::ABOUTUS_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCEZ" SUB="CUSTOMER_MAIN_URL" TYPE="READONLY" LOAD="URL::CUSTOMER_MAIN_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFA" SUB="MERCHANT_LOGIN_URL" TYPE="READONLY" LOAD="URL::MERCHANT_LOGIN_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFB" SUB="CATEGORY_URL" TYPE="READONLY" LOAD="URL::CATEGORY_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFC" SUB="ADULT_URL" TYPE="READONLY" LOAD="URL::ADULT_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFD" SUB="CLAIM_URL" TYPE="READONLY" LOAD="URL::CLAIM_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFE" SUB="CLAIM_MULTI_URL" TYPE="READONLY" LOAD="URL::CLAIM_MULTI_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFF" SUB="ABOUT_US_URL" TYPE="READONLY" LOAD="URL::ABOUT_US_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFG" SUB="RESULTS_URL" TYPE="READONLY" LOAD="URL::RESULTS_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFH" SUB="PRODUCT_URL" TYPE="READONLY" LOAD="URL::PRODUCT_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFI" SUB="CONTINUE_URL" TYPE="READONLY" LOAD="URL::CONTINUE_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFJ" SUB="REDIR_URL" TYPE="READONLY" LOAD="URL::REDIR_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFK" SUB="KILL_COOKIES_URL" TYPE="READONLY" LOAD="URL::KILL_COOKIES_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFL" SUB="LOGIN_URL" TYPE="READONLY" LOAD="URL::LOGIN_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFM" SUB="CHECKOUT_URL" TYPE="READONLY" LOAD="URL::CHECKOUT_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFN" SUB="ORDER_STATUS_URL" TYPE="READONLY" LOAD="URL::ORDER_STATUS_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFO" SUB="NO_COOKIES_URL" TYPE="READONLY" LOAD="URL::NO_COOKIES_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFP" SUB="PAYPAL_URL" TYPE="READONLY" LOAD="URL::PAYPAL_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFQ" SUB="CANCEL_ORDER_URL" TYPE="READONLY" LOAD="URL::CANCEL_ORDER_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFR" SUB="MAIL_CONFIG_URL" TYPE="READONLY" LOAD="URL::MAIL_CONFIG_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFS" SUB="DISABLED_URL" TYPE="READONLY" LOAD="URL::DISABLED_URL" RAW="1"></ELEMENT>
<ELEMENT ID="CPUMCFT" TYPE="OUTPUT"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
]]>
</ELEMENT>
<ELEMENT ID="CPUMCFU" COLORS="128" TYPE="CONFIG" CATEGORIES="32768" TITLE="Popup - Brown" CREATED="0" PROPERTIES="0" OCREATED="20030520" SUBTYPE="P"><CSS><![CDATA[.zbody {  background-color: #FFFFFF; }
.zborder {  border: 1px solid #CCCCCC; }
.zbox {  border: 1px solid #CCCCCC; }
.zbox_body {  background-color: #FFFFFF; color: #000000; font-family: Arial, Helvetica; font-size: 11pt; }
.zbox_head {  background-color: #CCCCCC; color: #000000; font-family: Arial, Helvetica; font-size: 11pt; }
.zcolor {  background-color: #cccccc; color: #000000; }
.zcolor_contrast {  background-color: #4c4c4c; color: #7f7f7f; }
.zcolor_dark {  background-color: #8c8c8c; color: #000000; }
.zcolor_light {  background-color: #ffffff; color: #404040; }
.zform_button {  background-color: #ffffff; border: 1px solid #8c8c8c; color: #8c8c8c; font-family: Arial, Helvetica; font-size: 8pt; }
.zform_select {  background-color: #FFFFFF; border: 1px solid #8c8c8c; color: #000000; font-family: Arial, Helvetica; font-size: 8pt; }
.zform_textarea {  background-color: #FFFFFF; border: 1px solid #8c8c8c; color: #000000; font-family: Arial, Helvetica; font-size: 8pt; }
.zform_textbox {  background-color: #FFFFFF; border: 1px solid #8c8c8c; color: #000000; font-family: Arial, Helvetica; font-size: 8pt; }
.zhint {  color: #000000; font-family: Arial, Helvetica; font-size: 8pt; }
.zlink {  color: #000066; }
.zsmall {  color: #000000; font-family: Arial, Helvetica; font-size: 8pt; }
.ztab0 {  background-color: #ffffff; color: #404040; font-family: Arial, Helvetica; font-size: 9pt; }
.ztab1 {  background-color: #FFFFFF; color: #000000; font-family: Arial, Helvetica; font-size: 9pt; font-weight: bold; }
.ztabbody {  background-color: #CCCCCC; color: #000000; font-family: Arial, Helvetica; font-size: 8pt; }
.ztable_head {  background-color: #CCCCCC; color: #000000; font-family: Arial, Helvetica; font-size: 11pt; }
.ztable_row {  color: #000000; font-family: Arial, Helvetica; font-size: 11pt; }
.ztable_row0 {  background-color: #FFFFFF; color: #000000; font-family: Arial, Helvetica; font-size: 11pt; }
.ztable_row1 {  background-color: #EEEEEE; color: #000000; font-family: Arial, Helvetica; font-size: 11pt; }
.ztable_row_small {  color: #000000; font-family: Arial, Helvetica; font-size: 8pt; }
.ztable_row_title {  color: #000000; font-family: Arial, Helvetica; font-size: 13pt; font-weight: bold; }
.ztitle {  color: #000000; font-family: Arial, Helvetica; font-size: 12pt; font-weight: bold; }
.ztitle2 {  color: #000000; font-family: Arial, Helvetica; font-size: 11pt; font-weight: bold; }
.ztxt {  color: #000000; font-family: Arial, Helvetica; font-size: 11pt; }
.zwarn {  color: #FF0000; font-weight: bold; }
]]></CSS>
<THEME><![CDATA[alert_color=FF0000&content_background_color=FFFFFF&content_font_face=Arial%2c+Helvetica&content_font_size=3&content_text_color=000000&disclaimer_background_color=FFFFFF&disclaimer_font_face=Arial%2c+Helvetica&disclaimer_font_size=1&disclaimer_text_color=000000&link_active_text_color=000066&link_text_color=000066&link_visited_text_color=000066&name=&pretty_name=&table_heading_background_color=CCCCCC&table_heading_font_face=Arial%2c+Helvetica&table_heading_font_size=3&table_heading_text_color=000000&table_listing_background_color=FFFFFF&table_listing_background_color_alternate=EEEEEE&table_listing_font_face=Arial%2c+Helvetica&table_listing_font_size=3&table_listing_text_color=000000]]></THEME>
<THEME_OLD><![CDATA[disclaimer_text_color=000000&content_font_face=Arial%2c+Helvetica&table_listing_background_color_alternate=EEEEEE&table_heading_text_color=000000&pretty_name=Default&link_visited_text_color=000000&content_background_color=FFFFFF&table_heading_background_color=CCCCCC&link_text_color=000066&link_active_text_color=000033&table_listing_font_face=Arial%2c+Helvetica&content_text_color=000000&content_font_size=3&disclaimer_font_face=Arial%2c+Helvetica&name=default&table_listing_background_color=FFFFFF&disclaimer_background_color=999999&alert_color=FF0000&disclaimer_font_size=1&table_listing_text_color=000000&table_heading_font_face=Arial%2c+Helvetica&table_heading_font_size=3&table_listing_font_size=3]]></THEME_OLD>
<SITEBUTTONS><![CDATA[forward=l2_fashion2|gif|58|20&add_to_cart=l2_fashion2|gif|82|20&back=l2_fashion2|gif|60|20&default=l2_fashion2|gif|77|20&add_to_site=l2_fashion2|gif|122|32&checkout=l2_fashion2|gif|66|20&continue_shopping=l2_fashion2|gif|127|20&update_cart=l2_fashion2|gif|82|20&cancel=l2_fashion2|gif|47|20]]></SITEBUTTONS>
</ELEMENT>
<ELEMENT ID="CPUMCFV" TYPE="OUTPUT"><![CDATA[

]]>
</ELEMENT>
<ELEMENT ID="CPUMCFW" TYPE="HEAD"></ELEMENT>
<ELEMENT ID="CPUMCFX" TYPE="OUTPUT"><![CDATA[

		]]>
</ELEMENT>
<ELEMENT HEIGHT="65" ID="CPUMCFY" WIDTH="220" TYPE="LOGO" BGCOLOR="FFFFFF"></ELEMENT>
<ELEMENT ID="CPUMCFZ" TYPE="OUTPUT"><![CDATA[

 ]]>
</ELEMENT>
<ELEMENT ID="CPUMCGA" TYPE="TITLE"></ELEMENT>
<ELEMENT ID="CPUMCGB" TYPE="OUTPUT"><![CDATA[

]]>
</ELEMENT>
<ELEMENT ID="CPUMCGC" TYPE="BODY"></ELEMENT>
<ELEMENT ID="CPUMCGD" TYPE="OUTPUT"><![CDATA[

]]>
</ELEMENT>

</TEMPLATE>


text:
namespace CGAL
{

namespace internal
{

template<class Traits>
class Cone_tree_node
{
public:
  enum Node_type
  {
    ROOT = 0,
    FACE_SOURCE = 1,
    EDGE_SOURCE = 2,
    VERTEX_SOURCE = 3,
    INTERVAL = 4
  };

private:
  typedef typename Traits::Triangle_mesh Triangle_mesh;
  typedef typename Traits::FT FT;
  typedef typename Traits::Point_2 Point_2;
  typedef typename Traits::Triangle_2 Triangle_2;
  typedef typename Traits::Segment_2 Segment_2;
  typedef typename Traits::Ray_2 Ray_2;
  typedef typename boost::graph_traits<Triangle_mesh> Graph_traits;
  typedef typename Graph_traits::face_descriptor face_descriptor;
  typedef typename Graph_traits::halfedge_descriptor halfedge_descriptor;
  typedef typename Graph_traits::vertex_descriptor vertex_descriptor;
  typedef typename CGAL::internal::Cone_expansion_event<Traits> Cone_expansion_event;

private:
  // These could be pulled back into a 'context' class to save space
  Traits& m_traits;
  Triangle_mesh& m_graph;

  halfedge_descriptor m_entryEdge;

  Point_2 m_sourceImage;
  Triangle_2 m_layoutFace;
  FT m_pseudoSourceDistance;

  Point_2 m_windowLeft;
  Point_2 m_windowRight;

  size_t m_level;
  size_t m_treeId;

  Node_type m_nodeType;

  Cone_tree_node* m_leftChild;
  Cone_tree_node* m_rightChild;

  std::vector<Cone_tree_node*> m_middleChildren;
  Cone_tree_node* m_parent;

private:
  void on_child_link(Cone_tree_node* child)
  {
    child->m_parent = this;
    child->m_level = m_level + 1;
    child->m_treeId = m_treeId;
  }

public:
  Cone_tree_node(Traits& traits, Triangle_mesh& g, size_t treeId)
    : m_traits(traits)
    , m_graph(g)
    , m_sourceImage(Point_2(CGAL::ORIGIN))
    , m_layoutFace(Point_2(CGAL::ORIGIN),Point_2(CGAL::ORIGIN),Point_2(CGAL::ORIGIN))
    , m_pseudoSourceDistance(0.0)
    , m_level(0)
    , m_treeId(treeId)
    , m_nodeType(ROOT)
    , m_leftChild(NULL)
    , m_rightChild(NULL)
    , m_pendingLeftSubtree(NULL)
    , m_pendingRightSubtree(NULL)
    , m_pendingMiddleSubtree(NULL)
  {
  }

  Cone_tree_node(Traits& traits, Triangle_mesh& g, size_t treeId, halfedge_descriptor entryEdge)
    : m_traits(traits)
    , m_graph(g)
    , m_entryEdge(entryEdge)
    , m_sourceImage(Point_2(CGAL::ORIGIN))
    , m_layoutFace(Point_2(CGAL::ORIGIN),Point_2(CGAL::ORIGIN),Point_2(CGAL::ORIGIN))
    , m_pseudoSourceDistance(0.0)
    , m_level(0)
    , m_treeId(treeId)
    , m_nodeType(ROOT)
    , m_leftChild(NULL)
    , m_rightChild(NULL)
    , m_pendingLeftSubtree(NULL)
    , m_pendingRightSubtree(NULL)
    , m_pendingMiddleSubtree(NULL)
  {
  }

  Cone_tree_node(Traits& traits, Triangle_mesh& g, halfedge_descriptor entryEdge, const Triangle_2& layoutFace, const Point_2& sourceImage, const FT& pseudoSourceDistance, const Point_2& windowLeft, const Point_2& windowRight, Node_type nodeType = INTERVAL)
    : m_traits(traits)
    , m_graph(g)
    , m_entryEdge(entryEdge)
    , m_sourceImage(sourceImage)
    , m_layoutFace(layoutFace)
    , m_pseudoSourceDistance(pseudoSourceDistance)
    , m_windowLeft(windowLeft)
    , m_windowRight(windowRight)
    , m_nodeType(nodeType)
    , m_leftChild(NULL)
    , m_rightChild(NULL)
    , m_pendingLeftSubtree(NULL)
    , m_pendingRightSubtree(NULL)
    , m_pendingMiddleSubtree(NULL)
  {
  }

  size_t tree_id() const
  {
    return m_treeId;
  }

  size_t level() const
  {
    return m_level;
  }

  bool is_source_node() const
  {
    return m_nodeType == FACE_SOURCE || m_nodeType == EDGE_SOURCE || m_nodeType == VERTEX_SOURCE;
  }

  bool is_vertex_node() const
  {
    return m_nodeType == VERTEX_SOURCE;
  }

  bool is_root_node() const
  {
    return m_nodeType == ROOT;
  }

  Triangle_2 layout_face() const
  {
    return m_layoutFace;
  }

  face_descriptor current_face() const
  {
    return face(m_entryEdge, m_graph);
  }

  bool is_null_face() const
  {
    return current_face() == Graph_traits::null_face();
  }

  size_t edge_face_index() const
  {
    return CGAL::internal::edge_index(entry_edge(), m_graph);
  }

  halfedge_descriptor entry_edge() const
  {
    return m_entryEdge;
  }

  halfedge_descriptor left_child_edge() const
  {
    return opposite(prev(m_entryEdge, m_graph), m_graph);
  }

  halfedge_descriptor right_child_edge() const
  {
    return opposite(next(m_entryEdge, m_graph), m_graph);
  }

  vertex_descriptor target_vertex() const
  {
    return target(next(m_entryEdge, m_graph), m_graph);
  }

  Point_2 source_image() const
  {
    return m_sourceImage;
  }

  Node_type node_type() const
  {
    return m_nodeType;
  }

  FT distance_to_root(const Point_2& point) const
  {
    typename Traits::Compute_squared_distance_2 csd2(m_traits.compute_squared_distance_2_object());
    return CGAL::internal::select_sqrt(csd2(point, m_sourceImage)) + m_pseudoSourceDistance;
  }

  FT distance_from_source_to_root() const
  {
    return m_pseudoSourceDistance;
  }

  FT distance_from_target_to_root() const
  {
    return distance_to_root(target_point());
  }

  Ray_2 left_boundary() const
  {
    return Ray_2(source_image(), m_windowLeft);
  }

  Ray_2 right_boundary() const
  {
    return Ray_2(source_image(), m_windowRight);
  }

  Point_2 window_left() const
  {
    return m_windowLeft;
  }

  Point_2 window_right() const
  {
    return m_windowRight;
  }

  Ray_2 ray_to_target_vertex() const
  {
    return Ray_2(source_image(), target_point());
  }

  bool inside_window(const Point_2& point) const
  {
    typename Traits::Orientation_2 orientation_2(m_traits.orientation_2_object());
    Point_2 sourceImagePoint(source_image());
    CGAL::Orientation leftOrientation = orientation_2(sourceImagePoint, m_windowLeft, point);
    CGAL::Orientation rightOrientation = orientation_2(sourceImagePoint, m_windowRight, point);
    return (leftOrientation == CGAL::RIGHT_TURN || leftOrientation == CGAL::COLLINEAR) && (rightOrientation == CGAL::LEFT_TURN || rightOrientation == CGAL::COLLINEAR);
  }

  Point_2 target_point() const
  {
    typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object());
    return cv2(m_layoutFace, 2);
  }

  bool is_target_vertex_inside_window() const
  {
    return inside_window(target_point());
  }

  bool has_left_side() const
  {
    typename Traits::Orientation_2 orientation_2(m_traits.orientation_2_object());

    if (is_source_node())
    {
      return true;
    }

    CGAL::Orientation orientation = orientation_2(source_image(), m_windowLeft, target_point());

    return (orientation == CGAL::RIGHT_TURN || orientation == CGAL::COLLINEAR);
  }

  bool has_right_side() const
  {
    typename Traits::Orientation_2 orientation_2(m_traits.orientation_2_object());

    CGAL::Orientation orientation = orientation_2(source_image(), m_windowRight, target_point());

    return (orientation == CGAL::LEFT_TURN || orientation == CGAL::COLLINEAR);
  }

  Segment_2 left_child_base_segment() const
  {
    typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object());
    // reversed to maintain consistent triangle winding on the child
    return Segment_2(cv2(m_layoutFace, 0), cv2(m_layoutFace, 2));
  }

  Segment_2 right_child_base_segment() const
  {
    typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object());
    // reversed to maintain consistent triangle winding on the child
    return Segment_2(cv2(m_layoutFace, 2), cv2(m_layoutFace, 1));
  }

  Segment_2 entry_segment() const
  {
    typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object());
    return Segment_2(cv2(m_layoutFace, 0), cv2(m_layoutFace, 1));
  }

  bool has_middle_children() const
  {
    return m_middleChildren.size() > 0;
  }

  size_t num_middle_children() const
  {
    return m_middleChildren.size();
  }

  Cone_tree_node* get_middle_child(size_t i) const
  {
    return m_middleChildren.at(i);
  }

  void push_middle_child(Cone_tree_node* child)
  {
    if (m_pendingMiddleSubtree != NULL)
    {
      m_pendingMiddleSubtree->m_cancelled = true;
      m_pendingMiddleSubtree = NULL;
    }

    m_middleChildren.push_back(child);
    on_child_link(child);
  }

  Cone_tree_node* pop_middle_child()
  {
    Cone_tree_node* temp = m_middleChildren.back();
    m_middleChildren.pop_back();
    return temp;
  }

  void set_left_child(Cone_tree_node* child)
  {
    if (m_pendingLeftSubtree != NULL)
    {
      m_pendingLeftSubtree->m_cancelled = true;
      m_pendingLeftSubtree = NULL;
    }

    m_leftChild = child;
    on_child_link(child);
  }

  Cone_tree_node* get_left_child() const
  {
    return m_leftChild;
  }

  Cone_tree_node* remove_left_child()
  {
    Cone_tree_node* temp = m_leftChild;
    m_leftChild = NULL;
    return temp;
  }

  void set_right_child(Cone_tree_node* child)
  {
    if (m_pendingRightSubtree != NULL)
    {
      m_pendingRightSubtree->m_cancelled = true;
      m_pendingRightSubtree = NULL;
    }

    m_rightChild = child;
    on_child_link(child);
  }

  Cone_tree_node* get_right_child() const
  {
    return m_rightChild;
  }

  Cone_tree_node* remove_right_child()
  {
    Cone_tree_node* temp = m_rightChild;
    m_rightChild = NULL;
    return temp;
  }

  Cone_tree_node* parent() const
  {
    return m_parent;
  }

  bool is_left_child() const
  {
    return m_parent != NULL && m_parent->m_leftChild == this;
  }

  bool is_right_child() const
  {
    return m_parent != NULL && m_parent->m_rightChild == this;
  }

public:
  Cone_expansion_event* m_pendingLeftSubtree;
  Cone_expansion_event* m_pendingRightSubtree;
  Cone_expansion_event* m_pendingMiddleSubtree;

};

} // namespace internal

} // namespace CGAL

#endif // CGAL_SURFACE_MESH_SHORTEST_PATH_INTERNAL_CONE_TREE_H


text:
package  vnmr.bo;

/**
 * param identifier
 *
 * @author Glenn Sullivan
 */
public class Macro extends ID {
    /**
     * constructor
     */
    public Macro(String id) {
	super(id);
    } // Macro()

    /**
     * Get param name. For now, just use the id for the name.
     * @return name
     */
    public String getName() {
	return id;
    } // getName()

    /**
     * indicates whether the given object is equal to this one
     * @return boolean
     */
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (id != null && obj instanceof Macro)
	    return id.equals(((Macro)obj).id);
	return false;
    } // equals()

} // class Macro


text:
package org.apereo.cas.web.flow.authentication;

import org.apereo.cas.authentication.DefaultChainingMultifactorAuthenticationProvider;
import org.apereo.cas.authentication.MultifactorAuthenticationFailureModeEvaluator;
import org.apereo.cas.authentication.mfa.TestMultifactorAuthenticationProvider;
import org.apereo.cas.services.RegisteredServiceTestUtils;

import lombok.val;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.StaticApplicationContext;

import java.util.List;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

/**
 * This is {@link ChainingMultifactorAuthenticationProviderSelectorTests}.
 *
 * @author Misagh Moayyed
 * @since 6.3.0
 */
@Tag("MFA")
public class ChainingMultifactorAuthenticationProviderSelectorTests {

    @Test
    public void verifyMultipleProviders() {
        val evaluator = mock(MultifactorAuthenticationFailureModeEvaluator.class);
        val selector = new ChainingMultifactorAuthenticationProviderSelector(evaluator);

        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        val provider1 = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
        val provider2 = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);

        val result = selector.resolve(List.of(provider1, provider2),
            RegisteredServiceTestUtils.getRegisteredService(), RegisteredServiceTestUtils.getPrincipal());
        assertTrue(result instanceof DefaultChainingMultifactorAuthenticationProvider);
    }
}


text:
"""Test the getavalanchepeerinfo RPC."""
from random import choice

from test_framework.avatools import (
    avalanche_proof_from_hex,
    create_coinbase_stakes,
    get_ava_p2p_interface_no_handshake,
)
from test_framework.key import ECKey
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
    assert_equal,
    assert_raises_rpc_error,
    uint256_hex,
)
from test_framework.wallet_util import bytes_to_wif

class GetAvalanchePeerInfoTest(BitcoinTestFramework):
    def set_test_params(self):
        self.setup_clean_chain = True
        self.num_nodes = 1
        self.extra_args = [['-avalanche=1',
                            '-avaproofstakeutxodustthreshold=1000000',
                            '-avaproofstakeutxoconfirmations=1',
                            '-avacooldown=0']]

    def run_test(self):
        node = self.nodes[0]
        peercount = 5
        nodecount = 10

        self.log.info(
            f"Generating {peercount} peers with {nodecount} nodes each")

        addrkey0 = node.get_deterministic_priv_key()
        blockhashes = self.generatetoaddress(
            node, peercount, addrkey0.address, sync_fun=self.no_op)
        # Use the first coinbase to create a stake
        stakes = create_coinbase_stakes(node, blockhashes, addrkey0.key)

        def getProof(stake):
            privkey = ECKey()
            privkey.generate()
            pubkey = privkey.get_pubkey()

            proof_sequence = 11
            proof_expiration = 0
            proof = node.buildavalancheproof(
                proof_sequence, proof_expiration, bytes_to_wif(
                    privkey.get_bytes()),
                [stake])
            return (pubkey.get_bytes().hex(), proof)

        # Create peercount * nodecount node array
        nodes = [[get_ava_p2p_interface_no_handshake(node) for _ in range(
            nodecount)] for _ in range(peercount)]

        # Add peercount peers and bind all the nodes to each
        proofs = []
        for i in range(peercount):
            pubkey_hex, proof = getProof(stakes[i])
            proofs.append(proof)
            [node.addavalanchenode(n.nodeid, pubkey_hex, proof)
             for n in nodes[i]]

        self.log.info("Testing getavalanchepeerinfo...")
        avapeerinfo = node.getavalanchepeerinfo()

        assert_equal(len(avapeerinfo), peercount)
        for i, peer in enumerate(avapeerinfo):
            proofid_hex = uint256_hex(
                avalanche_proof_from_hex(
                    proofs[i]).proofid)
            assert_equal(peer["avalanche_peerid"], i)
            assert_equal(peer["proofid"], proofid_hex)
            assert_equal(peer["proof"], proofs[i])
            assert_equal(peer["nodecount"], nodecount)
            assert_equal(set(peer["node_list"]), set(
                [n.nodeid for n in nodes[i]]))

        self.log.info("Testing with a specified proofid")

        assert_raises_rpc_error(-8, "Proofid not found",
                                node.getavalanchepeerinfo, proofid="0" * 64)

        target_proof = choice(proofs)
        target_proofid = avalanche_proof_from_hex(target_proof).proofid
        avapeerinfo = node.getavalanchepeerinfo(
            proofid=uint256_hex(target_proofid))
        assert_equal(len(avapeerinfo), 1)
        assert_equal(avapeerinfo[0]["proof"], target_proof)

if __name__ == '__main__':
    GetAvalanchePeerInfoTest().main()


text:
package javax.usb.tck;

import javax.usb.*;
import javax.usb.util.*;

import org.junit.runner.RunWith;

import org.usb4java.javax.test.TCKRunner;

import junit.framework.TestCase;

/**
 * Default Control Pipe Test -- Error Conditions
 * using UsbUtilSynchronizedUsbDevice
 *

 * This test is the same as the DefaultControlPipeTestErrorConditions except a
 * UsbUtil.SynchronizedUsbDevice is used in place of a UsbDevice.
 *

 * This test verifies that control transfers operations work successfully
 * on the Default Control Pipe and that proper events are generated and proper
 * exceptions are thrown in the operation.
 *
 * @author Leslie Blair
 */

@SuppressWarnings("all")
@RunWith(TCKRunner.class)
public class DefaultControlPipeTestErrorConditionswithSynchronizedUsbDevice extends TestCase
{
    public void setUp() throws Exception
    {
        originalUsbDevice = FindProgrammableDevice.getInstance().getProgrammableDevice();
        usbDevice = new UsbUtil.SynchronizedUsbDevice(originalUsbDevice);
        assertNotNull("Device required for test not found",usbDevice);
        DCPIRPTestErrorConditions = new DefaultControlPipeTestErrorConditions(usbDevice);
        super.setUp();

    }
    public void tearDown() throws Exception
    {
        super.tearDown();
    }

    public void testUsbShortPacketException()
    {
        DCPIRPTestErrorConditions.testUsbShortPacketException();
    };

    // TODO No idea how to detect a STALL condition in libusb 0.1
    public void disabled_testUsbStallException()
    {
        DCPIRPTestErrorConditions.disabled_testUsbStallException();
    };

    public void testNotCallingsetDataForIRP()
    {
        DCPIRPTestErrorConditions.testNotCallingsetDataForIRP();
    };

    private UsbDevice originalUsbDevice;
    private UsbDevice usbDevice;
    DefaultControlPipeTestErrorConditions DCPIRPTestErrorConditions;
}


text:
require 'mongoid_denormalize/version'
require File.dirname(__FILE__) + '/railties/railtie' if defined?(Rails::Railtie)

# = Mongoid::Denormalize
#
# Helper module for denormalizing association attributes in Mongoid models.
module Mongoid::Denormalize
  extend ActiveSupport::Concern

  included do
    cattr_accessor :denormalize_definitions

    before_save :denormalize_from
    after_save :denormalize_to
  end

  module ClassMethods
    # Set a field or a number of fields to denormalize. Specify the associated object using the :from or :to options.
    #
    #   def Post
    #     include Mongoid::Document
    #     include Mongoid::Denormalize
    #
    #     referenced_in :user
    #     references_many :comments
    #
    #     denormalize :name, :avatar, :from => :user
    #     denormalize :created_at, :to => :comments
    #   end
    def denormalize(*args)
      *fields, options = args

      (self.denormalize_definitions ||= []) << { :fields => fields, :options => options }

      # Define schema
      unless options[:to]
        fields.each { |name| field "#{options[:from]}_#{name}", :type => options[:type] || String }
      end
    end

    def is_denormalized?
      true
    end
  end

  def denormalized_valid?
    denormalize_from
    !self.changed?
  end

  def repair_denormalized!
    self.save! unless denormalized_valid?
  end

  private
  def denormalize_from
    Array(self.denormalize_definitions).reject do |definition|
      definition[:options][:to]
    end.each do |definition|
      definition[:fields].each do |name|
        field = definition[:options][:from]
        # force reload if :from method is an association ; call it normally otherwise
        associated =  self.class.reflect_on_association(field) ? self.send(field, true) : self.send(field)
        self.send("#{field}_#{name}=", associated.try(name))
      end
    end
  end

  def denormalize_to
    Array(self.denormalize_definitions).find_all do |definition|
      definition[:options][:to]
    end.each do |definition|
      as = definition[:options][:as]

      assignments = definition[:fields].collect do |source_field|
        {
          :source_field => source_field.to_s,
          :value => self.send(source_field)
        }
      end

      Array(definition[:options][:to]).each do |association|
        relation = []
        reflect = self.class.reflect_on_association(association)
        relation = reflect.relation.macro unless reflect.nil? || reflect.relation.nil?

        reflect.klass.skip_callback(:save, :before, :denormalize_from) if reflect.klass.try(:is_denormalized?)

        associated = self.send(association)
        prefix = (as || reflect.inverse_of || reflect.inverse_class_name).to_s.underscore

        if [:embedded_in, :embeds_one, :referenced_in, :references_one, :has_one, :belongs_to].include? relation
          unless associated.blank?
            assign_and_save(associated, assignments, prefix)
          end
        else
          associated.to_a.each { |c| assign_and_save(c, assignments, prefix) }
        end

        reflect.klass.set_callback(:save, :before, :denormalize_from) if reflect.klass.try(:is_denormalized?)
      end
    end
  end

  def assign_and_save(obj, assignments, prefix)
    attributes_hash = Hash[assignments.collect { |assignment|
      if self.changed_attributes.has_key?(assignment[:source_field].to_s) ||
          self.changed_attributes.has_key?(assignment[:source_field].to_sym)
        ["#{prefix}_#{assignment[:source_field]}", assignment[:value]]
      end
    }.compact]

    unless attributes_hash.empty?
      # The more succinct update_attributes(changes, :without_protection => true) requires Mongoid 3.0.0,
      # but we only require 2.1.9
      obj.write_attributes(attributes_hash, false)
      obj.save(:validate => false)
    end
  end
end


text:
module PNM
    (
      Anymap(..)
    , Greymap(..)
    , parseP5
    ) where

{-- snippet imports --}
import qualified Data.ByteString.Lazy.Char8 as L8
import qualified Data.ByteString.Lazy as L
import Data.Char (isSpace)
{-- /snippet imports --}

{-- snippet Anymap --}
class Anymap a where
    anyWidth :: a -> Int
    anyHeight :: a -> Int
    anyParse :: L.ByteString -> [a]
    anyReadFile :: FilePath -> IO [a]
{-- /snippet Anymap --}

{-- snippet Greymap --}
data Greymap = Greymap {
      greyWidth :: Int
    , greyHeight :: Int
    , greyMax :: Int
    , greyData :: L.ByteString
    } deriving (Eq)
{-- /snippet Greymap --}

{-- snippet Show --}
instance Show Greymap where
    show (Greymap w h m _) = "Greymap " ++ show w ++ "x" ++ show h ++
                             " " ++ show m
{-- /snippet Show --}

{-- snippet parseP5.type --}
parseP5 :: L.ByteString -> Maybe (Greymap, L.ByteString)
{-- /snippet parseP5.type --}

{-- snippet parseP5 --}
matchHeader :: L.ByteString -> L.ByteString -> Maybe L.ByteString

-- "nat" here is short for "natural number"
getNat :: L.ByteString -> Maybe (Int, L.ByteString)

getBytes :: Int -> L.ByteString
         -> Maybe (L.ByteString, L.ByteString)

parseP5 s =
  case matchHeader (L8.pack "P5") s of
    Nothing -> Nothing
    Just s1 ->
      case getNat s1 of
        Nothing -> Nothing
        Just (width, s2) ->
          case getNat (L8.dropWhile isSpace s2) of
            Nothing -> Nothing
            Just (height, s3) ->
              case getNat (L8.dropWhile isSpace s3) of
                Nothing -> Nothing
                Just (maxGrey, s4)
                  | maxGrey > 255 -> Nothing
                  | otherwise ->
                      case getBytes 1 s4 of
                        Nothing -> Nothing
                        Just (_, s5) ->
                          case getBytes (width * height) s5 of
                            Nothing -> Nothing
                            Just (bitmap, s6) ->
                              Just (Greymap width height maxGrey bitmap, s6)
{-- /snippet parseP5 --}

{-- snippet parseP5.functions --}
-- L.ByteString -> L.ByteString -> Maybe L.ByteString
matchHeader prefix str
    | prefix `L8.isPrefixOf` str
        = Just (L8.dropWhile isSpace (L.drop (L.length prefix) str))
    | otherwise
        = Nothing

-- L.ByteString -> Maybe (Int, L.ByteString)
getNat s = case L8.readInt s of
             Nothing -> Nothing
             Just (num,rest)
                 | num <= 0    -> Nothing
                 | otherwise -> Just (fromIntegral num, rest)

-- Int -> L.ByteString -> Maybe (L.ByteString, L.ByteString)
getBytes n str = let count           = fromIntegral n
                     both@(prefix,_) = L.splitAt count str
                 in if L.length prefix < count
                    then Nothing
                    else Just both
{-- /snippet parseP5.functions --}

{-- snippet bind --}
(>>?) :: Maybe a -> (a -> Maybe b) -> Maybe b
Nothing >>? _ = Nothing
Just v  >>? f = f v
{-- /snippet bind --}

{-- snippet parseP5_take2 --}
parseP5_take2 :: L.ByteString -> Maybe (Greymap, L.ByteString)
parseP5_take2 s =
    matchHeader (L8.pack "P5") s       >>?
    \s -> skipSpace ((), s)           >>?
    (getNat . snd)                    >>?
    skipSpace                         >>?
    \(width, s) ->   getNat s         >>?
    skipSpace                         >>?
    \(height, s) ->  getNat s         >>?
    \(maxGrey, s) -> getBytes 1 s     >>?
    (getBytes (width * height) . snd) >>?
    \(bitmap, s) -> Just (Greymap width height maxGrey bitmap, s)

skipSpace :: (a, L.ByteString) -> Maybe (a, L.ByteString)
skipSpace (a, s) = Just (a, L8.dropWhile isSpace s)
{-- /snippet parseP5_take2 --}

parseAllP5 :: L.ByteString -> [Greymap]
parseAllP5 s = case parseP5_take2 s of
                 Nothing -> []
                 Just (g, s') -> g : parseAllP5 s'


text:
require 'test_helper'

class TimestampsTest < Test::Unit::TestCase
  context "included" do
    setup do
      @klass = Doc do
        key :first_name, String
      end
      @klass.timestamps!
    end

    should "set record_timestamps to true" do
      @klass.record_timestamps.should be(true)
    end
  end

  context "timestamping" do
    setup do
      @klass = Doc do
        key :first_name, String
        key :last_name, String
        key :age, Integer
        key :date, Date
      end
      @klass.timestamps!
    end

    context "when #record_timestamps is set to true" do
      should "set created_at and updated_at on create" do
        doc = @klass.new(:first_name => 'John', :age => 27)
        doc.created_at.should be(nil)
        doc.updated_at.should be(nil)
        doc.save
        doc.created_at.should_not be(nil)
        doc.updated_at.should_not be(nil)
      end

      should "not overwrite created_at if it already exists" do
        original_created_at = 1.month.ago
        doc = @klass.new(:first_name => 'John', :age => 27, :created_at => original_created_at)
        doc.created_at.to_i.should == original_created_at.to_i
        doc.updated_at.should be_nil
        doc.save
        doc.created_at.to_i.should == original_created_at.to_i
        doc.updated_at.should_not be_nil
      end

      should "set updated_at on field update but leave created_at alone" do
        doc = @klass.create(:first_name => 'John', :age => 27)
        old_created_at = doc.created_at
        old_updated_at = doc.updated_at
        doc.first_name = 'Johnny'

        Timecop.freeze(Time.now + 5.seconds) do
          doc.save
        end

        doc.created_at.should == old_created_at
        doc.updated_at.should_not == old_updated_at
      end

      should "set updated_at on document update but leave created_at alone" do
        doc = @klass.create(:first_name => 'John', :age => 27)
        old_created_at = doc.created_at.to_f

        new_updated_at = Time.now + 5.seconds
        Timecop.freeze(new_updated_at) do
          @klass.update(doc._id, { :first_name => 'Johnny' })
        end

        doc = doc.reload
        doc.created_at.to_f.should be_close(old_created_at, 0.001)
        doc.updated_at.to_f.should be_close(new_updated_at.to_f, 0.001)
      end
    end

    context "when #record_timestamps is set to false" do
      setup do
        @klass.record_timestamps = false
      end

      teardown do
        @klass.record_timestamps = true
      end

      should "not set created_at on document create" do
        doc = @klass.create(:first_name => "John")
        doc.created_at.should be_nil
      end

      should "not set updated_at on document create" do
        doc = @klass.create(:first_name => "John")
        doc.updated_at.should be_nil
      end
    end
  end
end