text:
"""
Gradient Boosted Trees Regression Example.
"""
from __future__ import print_function

from pyspark import SparkContext
# $example on$
from pyspark.mllib.tree import GradientBoostedTrees, GradientBoostedTreesModel
from pyspark.mllib.util import MLUtils
# $example off$

if __name__ == "__main__":
    sc = SparkContext(appName="PythonGradientBoostedTreesRegressionExample")
    # $example on$
    # Load and parse the data file.
    data = MLUtils.loadLibSVMFile(sc, "data/mllib/sample_libsvm_data.txt")
    # Split the data into training and test sets (30% held out for testing)
    (trainingData, testData) = data.randomSplit([0.7, 0.3])

    # Train a GradientBoostedTrees model.
    #  Notes: (a) Empty categoricalFeaturesInfo indicates all features are continuous.
    #         (b) Use more iterations in practice.
    model = GradientBoostedTrees.trainRegressor(trainingData,
                                                categoricalFeaturesInfo={}, numIterations=3)

    # Evaluate model on test instances and compute test error
    predictions = model.predict(testData.map(lambda x: x.features))
    labelsAndPredictions = testData.map(lambda lp: lp.label).zip(predictions)
    testMSE = labelsAndPredictions.map(lambda (v, p): (v - p) * (v - p)).sum() /\
        float(testData.count())
    print('Test Mean Squared Error = ' + str(testMSE))
    print('Learned regression GBT model:')
    print(model.toDebugString())

    # Save and load model
    model.save(sc, "target/tmp/myGradientBoostingRegressionModel")
    sameModel = GradientBoostedTreesModel.load(sc, "target/tmp/myGradientBoostingRegressionModel")
    # $example off$


text:
import { Story } from '@storybook/react/types-6-0';
import React, { ComponentProps } from 'react';
import { PageHeader } from './PageHeader';

// This default export determines where your story goes in the story list
export default {
  title: 'Layout/PageHeader',
  component: PageHeader
};

const Template: Story<ComponentProps<typeof PageHeader>> = (args) => <PageHeader {...args} />;

export const EmptyPageHeader = Template.bind({});
EmptyPageHeader.args = {
  model: {
    main: {
      text: 'main',
      url: './',
      children: [
        {
          text: 'sub',
          url: './sub'
        }
      ]
    },
    node: {
      text: 'sub',
      url: './sub'
    }
  }
};

redpajama_set_name: RedPajamaGithub


text:
package mil.nga.giat.geowave.core.store.data.field.base;

import java.nio.ByteBuffer;
import java.nio.ShortBuffer;

import mil.nga.giat.geowave.core.index.ByteArrayId;
import mil.nga.giat.geowave.core.store.data.field.FieldReader;
import mil.nga.giat.geowave.core.store.data.field.FieldSerializationProviderSpi;
import mil.nga.giat.geowave.core.store.data.field.FieldWriter;

public class PrimitiveShortArraySerializationProvider implements
		FieldSerializationProviderSpi<short[]>
{
	@Override
	public FieldReader<short[]> getFieldReader() {
		return new PrimitiveShortArrayReader();
	}

	@Override
	public FieldWriter<Object, short[]> getFieldWriter() {
		return new PrimitiveShortArrayWriter();
	}

	private static class PrimitiveShortArrayReader implements
			FieldReader<short[]>
	{

		@Override
		public short[] readField(
				final byte[] fieldData ) {
			if ((fieldData == null) || (fieldData.length < 2)) {
				return null;
			}
			final ShortBuffer buff = ByteBuffer.wrap(
					fieldData).asShortBuffer();
			final short[] result = new short[buff.remaining()];
			buff.get(result);
			return result;
		}
	}

	private static class PrimitiveShortArrayWriter implements
			FieldWriter<Object, short[]>
	{
		@Override
		public byte[] writeField(
				final short[] fieldValue ) {
			if (fieldValue == null) {
				return new byte[] {};
			}

			final ByteBuffer buf = ByteBuffer.allocate(2 * fieldValue.length);
			for (final short value : fieldValue) {
				buf.putShort(value);
			}
			return buf.array();
		}

		@Override
		public byte[] getVisibility(
				final Object rowValue,
				final ByteArrayId fieldId,
				final short[] fieldValue ) {
			return new byte[] {};
		}
	}

}


text:
using System;

namespace _4HexadacimalToDecimal
{
    class HexadacimalToDecimal
    {
        static void Main()
        {
            Console.Write("Enter hexadecimal number: ");
            string input = Console.ReadLine();

            int number = 0;

            if (input[0] == '-')
            {
                string str = input.Substring(1);
                number = Convert.ToInt32(str, 16);
                number *= -1;
            }
            else
            {
                number = Convert.ToInt32(input, 16);
            }

            Console.WriteLine("Decimal representation: {0}", number);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using CSC.CSClassroom.Model.Assignments;
using CSC.CSClassroom.Model.Assignments.ServiceResults;
using CSC.CSClassroom.WebApp.Extensions;
using CSC.CSClassroom.WebApp.Providers;
using CSC.CSClassroom.WebApp.ViewHelpers.NestedTables;
using Newtonsoft.Json;

namespace CSC.CSClassroom.WebApp.ViewModels.Assignment
{
	/// <summary>
	/// A report for a single student's results for an assignment group.
	/// </summary>
	public class AssignmentGroupResultViewModel : TableEntry
	{
		/// <summary>
		/// The name of the homework assignment.
		/// </summary>
		[TableColumn("Assignment")]
		public string AssignmentName { get; }

		/// <summary>
		/// The student's score for the assignment.
		/// </summary>
		[TableColumn("Score")]
		public string Score { get; }

		/// <summary>
		/// The due date for the assignment.
		/// </summary>
		[TableColumn("Due Date")]
		public string DueDate { get; }

		/// <summary>
		/// The assignment status.
		/// </summary>
		[TableColumn("Status")]
		public string Status { get; }

		/// <summary>
		/// The results for each question.
		/// </summary>
		[SubTable(typeof(StudentQuestionResultViewModel), typeof(AssignmentSubmissionViewModel), typeof(AssignmentResultViewModel))]
		[JsonProperty(PropertyName = "childTableData")]
		public List<object> ChildTableData { get; }

		/// <summary>
		/// Constructor.
		/// </summary>
		public AssignmentGroupResultViewModel(
			AssignmentGroupResult result,
			IAssignmentDisplayProviderFactory displayProviderFactory)
		{
			Score = GetColoredText
			(
				"black",
				$"{result.Score} / {result.TotalPoints}",
				bold: false,
				preventWrapping: true
			);

			Status = GetColoredText
			(
				result.Status.GetColor(),
				result.Status.GetText(),
				result.Status.GetBold(),
				preventWrapping: true
			);

			if (result.AssignmentResults.Count == 1)
			{
				var assignmentResult = result.AssignmentResults[0];
				var displayProvider = displayProviderFactory.CreateDisplayProvider
				(
					assignmentResult
				);

				var assignmentUrl = displayProvider.GetAssignmentUrl();

				AssignmentName = assignmentUrl != null
					? GetLink
						(
							assignmentUrl,
							result.AssignmentGroupName,
							preventWrapping: true
						)
					: GetColoredText
						(
							"black",
							result.AssignmentGroupName,
							bold: false,
							preventWrapping: true
						);

				DueDate = GetColoredText
				(
					"black",
					displayProvider.GetAssignmentDueDate(),
					bold: false,
					preventWrapping: true
				);

				ChildTableData = displayProvider.GetChildTableData();
			}
			else
			{
				AssignmentName = GetColoredText
				(
					"black",
					result.AssignmentGroupName,
					bold: false,
					preventWrapping: true
				);

				DueDate = result.AssignmentResults.Any(a => a.AssignmentDueDate.HasValue)
					? "Multiple"
					: "Unassigned";

				ChildTableData = result.AssignmentResults
					.Select
					(
						assignmentResult => new AssignmentResultViewModel
						(
							assignmentResult,
							displayProviderFactory.CreateDisplayProvider(assignmentResult)
						)
					).Cast<object>().ToList();
			}
		}
	}
}


text:
package io.crate.expression.scalar;

import io.crate.expression.symbol.Literal;
import io.crate.types.ArrayType;
import io.crate.types.LongType;
import org.junit.Test;

import java.util.List;

public class CollectionCountFunctionTest extends AbstractScalarFunctionsTest {

    @Test
    public void testEvaluate() throws Exception {
        assertEvaluate(
            "collection_count(long_array)",
            2L,
            Literal.of(List.of(3L, 7L), new ArrayType<>(LongType.INSTANCE))
        );
    }
}


text:
define(['Backbone', 'app/models/player'], function(Backbone, model){
  var Players = Backbone.Collection.extend({
    model: model
  });

  return Players;
});


text:
#include "fc3d_Solvers.h"
#include "fc3d_compute_error.h"
#include "NCP_Solvers.h"
#include "SiconosBlas.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
/* #define DEBUG_STDOUT */
/* #define DEBUG_MESSAGES */
#include "debug.h"
#include <math.h>
#include "numerics_verbose.h"

void fc3d_proximal(FrictionContactProblem* problem, double *reaction, double *velocity, int* info, SolverOptions* options)
{
  /* int and double parameters */
  int* iparam = options->iparam;
  double* dparam = options->dparam;

  /* Number of contacts */
  int nc = problem->numberOfContacts;
  NumericsMatrix* M = problem->M;

  /* Dimension of the problem */
  int n = 3 * nc;

  /* Maximum number of iterations */
  int itermax = iparam[SICONOS_IPARAM_MAX_ITER];
  /* Tolerance */
  double tolerance = dparam[SICONOS_DPARAM_TOL];
  double norm_q = cblas_dnrm2(nc*3 , problem->q , 1);
  if (verbose > 0){
    solver_options_print(options);
  }

  if (options->numberOfInternalSolvers < 1)
  {
    numerics_error("fc3d_proximal", "The PROX method needs options for the internal solvers, options[0].numberOfInternalSolvers should be >1");
  }
  SolverOptions *internalsolver_options = options->internalSolvers;

  /*****  PROXIMAL Iterations *****/
  int iter = 0; /* Current iteration number */
  double error = 1.; /* Current error */
  int hasNotConverged = 1;

  int isVariable = 1;
  double alpha = dparam[3];
  double sigma= 0.0;
  double nu =0.0;

  if (iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY] ==
      SICONOS_FRICTION_3D_PROXIMAL_REGULARIZATION) /* Only regularization */
  {
    if (fabs(dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA]) < 1e-12)
    {
      fprintf(stderr, "Numerics,  fc3d_proximal. Initial alpha parameters equal 0 \n");
      exit(EXIT_FAILURE);
    }
    else if (dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA] < -1e-12)
    {
      internalsolver_options->dparam[0]=options->dparam[0];
      alpha = - dparam[3];
      isVariable = 0;
    }
    else
    {
      internalsolver_options->dparam[0]=options->dparam[0];
      isVariable = 1;
      alpha = dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA];
    }
  }
  else if (iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY] ==
        SICONOS_FRICTION_3D_PROXIMAL_PROX)
  {
    if (fabs(dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA]) < 1e-12)
    {
      fprintf(stderr, "Numerics,  fc3d_proximal. Initial alpha parameters equal 0 \n");
      exit(EXIT_FAILURE);
    }
    else if (dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA] < -1e-12)
    {
      alpha = - dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA];
      isVariable = 0;
    }
    else
    {
      isVariable = 1;

      sigma = options->dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_SIGMA];
      nu = options->dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_NU];

      fc3d_compute_error(problem, reaction , velocity, tolerance, options, norm_q,  &error);

      alpha = sigma*pow(error,nu);
      DEBUG_PRINTF("Initial error = %g\n",error);
      if (error < tolerance) hasNotConverged = 0;
    }
  }
  else
    numerics_error("fc3d_proximal", "Proximal strategy is unknown");

  double * reactionold = (double *)malloc(n * sizeof(double));
  cblas_dcopy(n , reaction , 1 , reactionold , 1);

  internalSolverPtr internalsolver =0;
  options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_CUMULATIVE_ITER_DONE]= 0;

  if (internalsolver_options)
  {
    if (internalsolver_options->solverId == SICONOS_FRICTION_3D_NSGS)
    {
      internalsolver = &fc3d_nsgs;
    }
    else if (internalsolver_options->solverId == SICONOS_FRICTION_3D_DeSaxceFixedPoint)
    {
      internalsolver = &fc3d_DeSaxceFixedPoint;
    }
    else if (internalsolver_options->solverId == SICONOS_FRICTION_3D_EG)
    {
      internalsolver = &fc3d_ExtraGradient;
    }
    else if (internalsolver_options->solverId == SICONOS_FRICTION_3D_NSN_AC)
    {
      internalsolver = &fc3d_nonsmooth_Newton_AlartCurnier;
    }
    else if (internalsolver_options->solverId == SICONOS_FRICTION_3D_NSN_FB)
    {
      internalsolver = &fc3d_nonsmooth_Newton_FischerBurmeister;
    }
    else
      numerics_error("fc3d_proximal", "unknown internal solver");
  }
  else
  {
    numerics_error("fc3d_proximal", "The PROX method needs options for the internal solvers, soptions->internalSolvers should be different from NULL");
  }

  DEBUG_PRINTF("isVariable = %i\n",isVariable);
  DEBUG_PRINTF("options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY] = %i\n",options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY]);

  if (verbose > 0){
    printf("---- FC3D - PROXIMAL - Start with alpha = %12.8e\n", alpha);

    if (isVariable)
      printf("---- FC3D - PROXIMAL - Variable alpha strategy\n");
    else
      printf("---- FC3D - PROXIMAL - Fixed alpha strategy\n");

    if (options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY]==SICONOS_FRICTION_3D_PROXIMAL_REGULARIZATION)
      printf("---- FC3D - PROXIMAL - Only regularization \n");
  }

  if (iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY] ==
      SICONOS_FRICTION_3D_PROXIMAL_REGULARIZATION)
      {

    DEBUG_PRINTF("hasNotConverged = %i \n",hasNotConverged);
    while ((iter < itermax) && (hasNotConverged > 0))
    {
      ++iter;
      cblas_dcopy(n , reaction , 1 , reactionold , 1);
      /* add proximal regularization on q */
      cblas_daxpy(n, -alpha, reactionold, 1, problem->q , 1) ;

      /* add proximal regularization on M */
      NM_add_to_diag3(M, alpha);
      numerics_printf("---- FC3D - PROXIMAL - alpha = %8.4e\n",alpha);

      fc3d_set_internalsolver_tolerance(problem,options,internalsolver_options, error);
      DEBUG_PRINTF("internal solver tolerance = %21.8e \n",internalsolver_options->dparam[0]);

      /* call internal solver */
      (*internalsolver)(problem, reaction , velocity , info , internalsolver_options);

      if (verbose >0 && *info)
        printf("---- FC3D - PROXIMAL - internalsolver no convergence\n");

      int iter_internalsolver = internalsolver_options->iparam[SICONOS_IPARAM_ITER_DONE];
      options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_CUMULATIVE_ITER_DONE ] +=iter_internalsolver;
      DEBUG_PRINTF("iter_internalsolver = %i\n",iter_internalsolver);
      DEBUG_PRINTF("info = %i\n",*info);
      DEBUG_PRINTF("options->iparam[SICONOS_IPARAM_ITER_DONE] = %i\n",options->iparam[SICONOS_IPARAM_ITER_DONE]);

      /* **** Criterium convergence **** */

      /* substract proximal regularization on q */
      cblas_daxpy(n, alpha, reactionold, 1, problem->q, 1) ;
      /* substract proximal regularization on M */
      NM_add_to_diag3(M, -alpha);

      fc3d_compute_error(problem, reaction , velocity, tolerance, options, norm_q, &error);
      if (verbose > 0)
        printf("---- FC3D - PROXIMAL - Iteration %i Residual = %14.7e with alpha = %12.8e\n\n", iter, error, alpha);

      /* update alpha */
      if (isVariable)
      {
        if (*info){
          alpha = alpha*5;
        }
        else{
          alpha = alpha/10.0;
        }
      }
      DEBUG_PRINTF("alpha = %8.4e\n",alpha);

      if (options->callback)
      {
        options->callback->collectStatsIteration(options->callback->env, nc * 3,
                                                 reaction, velocity,
                                                 error, NULL);
      }

      if (error < tolerance) hasNotConverged = 0;
      *info = hasNotConverged;
    }
  }
  /* { */
  /*   double alpha_old = alpha; */
  /*   while ((iter < itermax) && (hasNotConverged > 0)) */
  /*   { */
  /*     ++iter; */
  /*     //Add proximal regularization on M */
  /*     //This code looked weird before. Do we add (alpha - alpha_old) ? */
  /*     double pert = alpha; */
  /*     if (iter > 0) */
  /*     { */
  /*       pert -= alpha_old; */
  /*     } */
  /*     NM_add_to_diag3(M, pert); */

  /*     DEBUG_PRINTF("internal solver tolerance = %21.8e \n",internalsolver_options->dparam[0]); */

  /*     (*internalsolver)(problem, reaction , velocity , info , internalsolver_options); */

  /*     /\* **** Criterium convergence **** *\/ */
  /*     fc3d_compute_error(problem, reaction , velocity, tolerance, options, norm_q, &error); */

  /*     int iter_internalsolver = internalsolver_options->iparam[SICONOS_IPARAM_ITER_DONE]; */
  /*     options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_CUMULATIVE_ITER_DONE] */
  /*       +=iter_internalsolver; */

  /*     DEBUG_PRINTF("iter_internalsolver = %i\n",iter_internalsolver); */
  /*     DEBUG_PRINTF("info = %i\n",*info); */
  /*     DEBUG_PRINTF("options->iparam[SICONOS_IPARAM_ITER_DONE] = %i\n",options->iparam[SICONOS_IPARAM_ITER_DONE]); */
  /*     DEBUG_PRINTF("alpha = %8.4e\n",alpha); */

  /*     if (options->callback) */
  /*     { */
  /*       options->callback->collectStatsIteration(options->callback->env, nc * 3, */
  /*                                                reaction, velocity, */
  /*                                                error, NULL); */
  /*     } */

  /*     if (verbose > 0) */
  /*       printf("---- FC3D - PROXIMAL - Iteration %i Residual = %14.7e with alpha = %12.8e\n\n", iter, error, alpha); */
  /*     if (isVariable) */
  /*     { */
  /*       alpha_old =alpha; */
  /*       alpha = alpha*10; */
  /*     } */
  /*     if (error < tolerance) hasNotConverged = 0; */
  /*     *info = hasNotConverged; */
  /*   } */
  /* } */
  else if (iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY] ==
           SICONOS_FRICTION_3D_PROXIMAL_PROX) // Real PROX iparam[9] == 0
  {

    DEBUG_PRINTF("hasNotConverged = %i \n",hasNotConverged);
    while ((iter < itermax) && (hasNotConverged > 0))
    {
      ++iter;
      cblas_dcopy(n , reaction , 1 , reactionold , 1);
      /* add proximal regularization on q */
      cblas_daxpy(n, -alpha, reactionold, 1, problem->q , 1) ;

      /* add proximal regularization on M */
      NM_add_to_diag3(M, alpha);

      fc3d_set_internalsolver_tolerance(problem,options,internalsolver_options, error);
      DEBUG_PRINTF("internal solver tolerance = %21.8e \n",internalsolver_options->dparam[0]);

      /* call internal solver */
      (*internalsolver)(problem, reaction , velocity , info , internalsolver_options);

      if (verbose >0 && *info)
        printf("---- FC3D - PROXIMAL - internalsolver no convergence\n");

      int iter_internalsolver = internalsolver_options->iparam[SICONOS_IPARAM_ITER_DONE];
      options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_CUMULATIVE_ITER_DONE ] +=iter_internalsolver;
      DEBUG_PRINTF("iter_internalsolver = %i\n",iter_internalsolver);
      DEBUG_PRINTF("info (internal solver)= %i\n",*info);

      /* **** Criterium convergence **** */

      /* substract proximal regularization on q */
      cblas_daxpy(n, alpha, reactionold, 1, problem->q, 1) ;
      /* substract proximal regularization on M */
      NM_add_to_diag3(M, -alpha);

      fc3d_compute_error(problem, reaction , velocity, tolerance, options, norm_q, &error);

      /* update alpha */
      if (isVariable)
      {
        if (*info){
          alpha = alpha*10;
        }
        else{
          alpha = sigma*pow(error,nu);
        }
      }
      DEBUG_PRINTF("alpha = %8.4e\n",alpha);

      if (options->callback)
      {
        options->callback->collectStatsIteration(options->callback->env, nc * 3,
                                                 reaction, velocity,
                                                 error, NULL);
      }

      if (verbose > 0)
        printf("---- FC3D - PROXIMAL - Iteration %i Residual = %14.7e with alpha = %12.8e\n\n", iter, error, alpha);

      if (error < tolerance) hasNotConverged = 0;
      *info = hasNotConverged;
    }
  }
  else
    numerics_error("fc3d_proximal", "Proximal strategy is unknown");

  if (verbose > 0)
  {
    printf("---- FC3D - PROXIMAL - # Iteration %i Final Residual = %14.7e  \n", iter, error);
    printf("---- FC3D - PROXIMAL - # Iteration of internal solver %i \n", options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_CUMULATIVE_ITER_DONE]);
  }

  iparam[SICONOS_IPARAM_ITER_DONE] = iter;
  dparam[SICONOS_DPARAM_RESIDU] = error;

  free(reactionold);

}

int fc3d_proximal_setDefaultSolverOptions(SolverOptions* options)
{
  if (verbose > 0)
  {
    printf("Set the Default SolverOptions for the PROX Solver\n");
  }

  /*  strcpy(options->solverName,"PROX");*/
  options->solverId = SICONOS_FRICTION_3D_PROX;
  options->numberOfInternalSolvers = 1;
  options->isSet = 1;
  options->filterOn = 1;
  options->iSize = 10;
  options->dSize = 10;
  options->iparam = (int *)calloc(options->iSize, sizeof(int));
  options->dparam = (double *)calloc(options->dSize, sizeof(double));
  solver_options_nullify(options);

  options->iparam[SICONOS_IPARAM_MAX_ITER] = 1000;

  options->iparam[SICONOS_FRICTION_3D_IPARAM_INTERNAL_ERROR_STRATEGY] =
    SICONOS_FRICTION_3D_INTERNAL_ERROR_STRATEGY_ADAPTIVE ;
  /* no overrelaxation by default */
  options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_RELAXATION] = 0;
  /* fixed regularization or proximal */
  options->iparam[SICONOS_FRICTION_3D_PROXIMAL_IPARAM_STRATEGY ] =
    SICONOS_FRICTION_3D_PROXIMAL_PROX;

  options->dparam[SICONOS_DPARAM_TOL] = 1e-4;
  options->dparam[SICONOS_FRICTION_3D_DPARAM_INTERNAL_ERROR_RATIO] =10.0;

  /* default value for proximal parameter alpha; */
  options->dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_ALPHA] = 1.e4;
  /* default value for sigma; */
  options->dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_SIGMA] = 5.0;
  /* default value for nu; */
  options->dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_NU] = 1.0;
  /* default value for relaxation parameter omega */
  options->dparam[SICONOS_FRICTION_3D_PROXIMAL_DPARAM_RELAXATION] = 1.5;

  options->internalSolvers = (SolverOptions *)malloc(sizeof(SolverOptions));
  fc3d_nonsmooth_Newton_AlartCurnier_setDefaultSolverOptions(options->internalSolvers);

  return 0;
}


text:
namespace media {

WebMClusterParser::WebMClusterParser(
    int64 timecode_scale,
    int audio_track_num,
    base::TimeDelta audio_default_duration,
    int video_track_num,
    base::TimeDelta video_default_duration,
    const WebMTracksParser::TextTracks& text_tracks,
    const std::set<int64>& ignored_tracks,
    const std::string& audio_encryption_key_id,
    const std::string& video_encryption_key_id,
    const LogCB& log_cb)
    : timecode_multiplier_(timecode_scale / 1000.0),
      ignored_tracks_(ignored_tracks),
      audio_encryption_key_id_(audio_encryption_key_id),
      video_encryption_key_id_(video_encryption_key_id),
      parser_(kWebMIdCluster, this),
      last_block_timecode_(-1),
      block_data_size_(-1),
      block_duration_(-1),
      block_add_id_(-1),
      block_additional_data_size_(-1),
      discard_padding_(-1),
      cluster_timecode_(-1),
      cluster_start_time_(kNoTimestamp()),
      cluster_ended_(false),
      audio_(audio_track_num, false, audio_default_duration, log_cb),
      video_(video_track_num, true, video_default_duration, log_cb),
      ready_buffer_upper_bound_(kNoDecodeTimestamp()),
      log_cb_(log_cb) {
  for (WebMTracksParser::TextTracks::const_iterator it = text_tracks.begin();
       it != text_tracks.end();
       ++it) {
    text_track_map_.insert(std::make_pair(
        it->first, Track(it->first, false, kNoTimestamp(), log_cb_)));
  }
}

WebMClusterParser::~WebMClusterParser() {}

void WebMClusterParser::Reset() {
  last_block_timecode_ = -1;
  cluster_timecode_ = -1;
  cluster_start_time_ = kNoTimestamp();
  cluster_ended_ = false;
  parser_.Reset();
  audio_.Reset();
  video_.Reset();
  ResetTextTracks();
  ready_buffer_upper_bound_ = kNoDecodeTimestamp();
}

int WebMClusterParser::Parse(const uint8* buf, int size) {
  audio_.ClearReadyBuffers();
  video_.ClearReadyBuffers();
  ClearTextTrackReadyBuffers();
  ready_buffer_upper_bound_ = kNoDecodeTimestamp();

  int result = parser_.Parse(buf, size);

  if (result < 0) {
    cluster_ended_ = false;
    return result;
  }

  cluster_ended_ = parser_.IsParsingComplete();
  if (cluster_ended_) {
    // If there were no buffers in this cluster, set the cluster start time to
    // be the |cluster_timecode_|.
    if (cluster_start_time_ == kNoTimestamp()) {
      // If the cluster did not even have a |cluster_timecode_|, signal parse
      // error.
      if (cluster_timecode_ < 0)
        return -1;

      cluster_start_time_ = base::TimeDelta::FromMicroseconds(
          cluster_timecode_ * timecode_multiplier_);
    }

    // Reset the parser if we're done parsing so that
    // it is ready to accept another cluster on the next
    // call.
    parser_.Reset();

    last_block_timecode_ = -1;
    cluster_timecode_ = -1;
  }

  return result;
}

const WebMClusterParser::BufferQueue& WebMClusterParser::GetAudioBuffers() {
  if (ready_buffer_upper_bound_ == kNoDecodeTimestamp())
    UpdateReadyBuffers();

  return audio_.ready_buffers();
}

const WebMClusterParser::BufferQueue& WebMClusterParser::GetVideoBuffers() {
  if (ready_buffer_upper_bound_ == kNoDecodeTimestamp())
    UpdateReadyBuffers();

  return video_.ready_buffers();
}

const WebMClusterParser::TextBufferQueueMap&
WebMClusterParser::GetTextBuffers() {
  if (ready_buffer_upper_bound_ == kNoDecodeTimestamp())
    UpdateReadyBuffers();

  // Translate our |text_track_map_| into |text_buffers_map_|, inserting rows in
  // the output only for non-empty ready_buffer() queues in |text_track_map_|.
  text_buffers_map_.clear();
  for (TextTrackMap::const_iterator itr = text_track_map_.begin();
       itr != text_track_map_.end();
       ++itr) {
    const BufferQueue& text_buffers = itr->second.ready_buffers();
    if (!text_buffers.empty())
      text_buffers_map_.insert(std::make_pair(itr->first, text_buffers));
  }

  return text_buffers_map_;
}

WebMParserClient* WebMClusterParser::OnListStart(int id) {
  if (id == kWebMIdCluster) {
    cluster_timecode_ = -1;
    cluster_start_time_ = kNoTimestamp();
  } else if (id == kWebMIdBlockGroup) {
    block_data_.reset();
    block_data_size_ = -1;
    block_duration_ = -1;
    discard_padding_ = -1;
    discard_padding_set_ = false;
  } else if (id == kWebMIdBlockAdditions) {
    block_add_id_ = -1;
    block_additional_data_.reset();
    block_additional_data_size_ = -1;
  }

  return this;
}

bool WebMClusterParser::OnListEnd(int id) {
  if (id != kWebMIdBlockGroup)
    return true;

  // Make sure the BlockGroup actually had a Block.
  if (block_data_size_ == -1) {
    MEDIA_LOG(log_cb_) << "Block missing from BlockGroup.";
    return false;
  }

  bool result = ParseBlock(false, block_data_.get(), block_data_size_,
                           block_additional_data_.get(),
                           block_additional_data_size_, block_duration_,
                           discard_padding_set_ ? discard_padding_ : 0);
  block_data_.reset();
  block_data_size_ = -1;
  block_duration_ = -1;
  block_add_id_ = -1;
  block_additional_data_.reset();
  block_additional_data_size_ = -1;
  discard_padding_ = -1;
  discard_padding_set_ = false;
  return result;
}

bool WebMClusterParser::OnUInt(int id, int64 val) {
  int64* dst;
  switch (id) {
    case kWebMIdTimecode:
      dst = &cluster_timecode_;
      break;
    case kWebMIdBlockDuration:
      dst = &block_duration_;
      break;
    case kWebMIdBlockAddID:
      dst = &block_add_id_;
      break;
    default:
      return true;
  }
  if (*dst != -1)
    return false;
  *dst = val;
  return true;
}

bool WebMClusterParser::ParseBlock(bool is_simple_block, const uint8* buf,
                                   int size, const uint8* additional,
                                   int additional_size, int duration,
                                   int64 discard_padding) {
  if (size < 4)
    return false;

  // Return an error if the trackNum > 127. We just aren't
  // going to support large track numbers right now.
  if (!(buf[0] & 0x80)) {
    MEDIA_LOG(log_cb_) << "TrackNumber over 127 not supported";
    return false;
  }

  int track_num = buf[0] & 0x7f;
  int timecode = buf[1] << 8 | buf[2];
  int flags = buf[3] & 0xff;
  int lacing = (flags >> 1) & 0x3;

  if (lacing) {
    MEDIA_LOG(log_cb_) << "Lacing " << lacing << " is not supported yet.";
    return false;
  }

  // Sign extend negative timecode offsets.
  if (timecode & 0x8000)
    timecode |= ~0xffff;

  const uint8* frame_data = buf + 4;
  int frame_size = size - (frame_data - buf);
  return OnBlock(is_simple_block, track_num, timecode, duration, flags,
                 frame_data, frame_size, additional, additional_size,
                 discard_padding);
}

bool WebMClusterParser::OnBinary(int id, const uint8* data, int size) {
  switch (id) {
    case kWebMIdSimpleBlock:
      return ParseBlock(true, data, size, NULL, -1, -1, 0);

    case kWebMIdBlock:
      if (block_data_) {
        MEDIA_LOG(log_cb_) << "More than 1 Block in a BlockGroup is not "
                              "supported.";
        return false;
      }
      block_data_.reset(new uint8[size]);
      memcpy(block_data_.get(), data, size);
      block_data_size_ = size;
      return true;

    case kWebMIdBlockAdditional: {
      uint64 block_add_id = base::HostToNet64(block_add_id_);
      if (block_additional_data_) {
        // TODO(vigneshv): Technically, more than 1 BlockAdditional is allowed
        // as per matroska spec. But for now we don't have a use case to
        // support parsing of such files. Take a look at this again when such a
        // case arises.
        MEDIA_LOG(log_cb_) << "More than 1 BlockAdditional in a BlockGroup is "
                              "not supported.";
        return false;
      }
      // First 8 bytes of side_data in DecoderBuffer is the BlockAddID
      // element's value in Big Endian format. This is done to mimic ffmpeg
      // demuxer's behavior.
      block_additional_data_size_ = size + sizeof(block_add_id);
      block_additional_data_.reset(new uint8[block_additional_data_size_]);
      memcpy(block_additional_data_.get(), &block_add_id,
             sizeof(block_add_id));
      memcpy(block_additional_data_.get() + 8, data, size);
      return true;
    }
    case kWebMIdDiscardPadding: {
      if (discard_padding_set_ || size <= 0 || size > 8)
        return false;
      discard_padding_set_ = true;

      // Read in the big-endian integer.
      discard_padding_ = static_cast<int8>(data[0]);
      for (int i = 1; i < size; ++i)
        discard_padding_ = (discard_padding_ << 8) | data[i];

      return true;
    }
    default:
      return true;
  }
}

bool WebMClusterParser::OnBlock(bool is_simple_block, int track_num,
                                int timecode,
                                int  block_duration,
                                int flags,
                                const uint8* data, int size,
                                const uint8* additional, int additional_size,
                                int64 discard_padding) {
  DCHECK_GE(size, 0);
  if (cluster_timecode_ == -1) {
    MEDIA_LOG(log_cb_) << "Got a block before cluster timecode.";
    return false;
  }

  // TODO(acolwell): Should relative negative timecode offsets be rejected?  Or
  // only when the absolute timecode is negative?  See http://crbug.com/271794
  if (timecode < 0) {
    MEDIA_LOG(log_cb_) << "Got a block with negative timecode offset "
                       << timecode;
    return false;
  }

  if (last_block_timecode_ != -1 && timecode < last_block_timecode_) {
    MEDIA_LOG(log_cb_)
        << "Got a block with a timecode before the previous block.";
    return false;
  }

  Track* track = NULL;
  StreamParserBuffer::Type buffer_type = DemuxerStream::AUDIO;
  std::string encryption_key_id;
  if (track_num == audio_.track_num()) {
    track = &audio_;
    encryption_key_id = audio_encryption_key_id_;
  } else if (track_num == video_.track_num()) {
    track = &video_;
    encryption_key_id = video_encryption_key_id_;
    buffer_type = DemuxerStream::VIDEO;
  } else if (ignored_tracks_.find(track_num) != ignored_tracks_.end()) {
    return true;
  } else if (Track* const text_track = FindTextTrack(track_num)) {
    if (is_simple_block)  // BlockGroup is required for WebVTT cues
      return false;
    if (block_duration < 0)  // not specified
      return false;
    track = text_track;
    buffer_type = DemuxerStream::TEXT;
  } else {
    MEDIA_LOG(log_cb_) << "Unexpected track number " << track_num;
    return false;
  }

  last_block_timecode_ = timecode;

  base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds(
      (cluster_timecode_ + timecode) * timecode_multiplier_);

  scoped_refptr<StreamParserBuffer> buffer;
  if (buffer_type != DemuxerStream::TEXT) {
    // The first bit of the flags is set when a SimpleBlock contains only
    // keyframes. If this is a Block, then inspection of the payload is
    // necessary to determine whether it contains a keyframe or not.
    // http://www.matroska.org/technical/specs/index.html
    bool is_keyframe =
        is_simple_block ? (flags & 0x80) != 0 : track->IsKeyframe(data, size);

    // Every encrypted Block has a signal byte and IV prepended to it. Current
    // encrypted WebM request for comments specification is here
    // http://wiki.webmproject.org/encryption/webm-encryption-rfc
    scoped_ptr<DecryptConfig> decrypt_config;
    int data_offset = 0;
    if (!encryption_key_id.empty() &&
        !WebMCreateDecryptConfig(
             data, size,
             reinterpret_cast<const uint8*>(encryption_key_id.data()),
             encryption_key_id.size(),
             &decrypt_config, &data_offset)) {
      return false;
    }

    // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId
    // type with remapped bytestream track numbers and allow multiple tracks as
    // applicable. See https://crbug.com/341581.
    buffer = StreamParserBuffer::CopyFrom(
        data + data_offset, size - data_offset,
        additional, additional_size,
        is_keyframe, buffer_type, track_num);

    if (decrypt_config)
      buffer->set_decrypt_config(decrypt_config.Pass());
  } else {
    std::string id, settings, content;
    WebMWebVTTParser::Parse(data, size, &id, &settings, &content);

    std::vector<uint8> side_data;
    MakeSideData(id.begin(), id.end(),
                 settings.begin(), settings.end(),
                 &side_data);

    // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId
    // type with remapped bytestream track numbers and allow multiple tracks as
    // applicable. See https://crbug.com/341581.
    buffer = StreamParserBuffer::CopyFrom(
        reinterpret_cast<const uint8*>(content.data()),
        content.length(),
        &side_data[0],
        side_data.size(),
        true, buffer_type, track_num);
  }

  buffer->set_timestamp(timestamp);
  if (cluster_start_time_ == kNoTimestamp())
    cluster_start_time_ = timestamp;

  if (block_duration >= 0) {
    buffer->set_duration(base::TimeDelta::FromMicroseconds(
        block_duration * timecode_multiplier_));
  } else {
    DCHECK_NE(buffer_type, DemuxerStream::TEXT);
    buffer->set_duration(track->default_duration());
  }

  if (discard_padding != 0) {
    buffer->set_discard_padding(std::make_pair(
        base::TimeDelta(),
        base::TimeDelta::FromMicroseconds(discard_padding / 1000)));
  }

  return track->AddBuffer(buffer);
}

WebMClusterParser::Track::Track(int track_num,
                                bool is_video,
                                base::TimeDelta default_duration,
                                const LogCB& log_cb)
    : track_num_(track_num),
      is_video_(is_video),
      default_duration_(default_duration),
      estimated_next_frame_duration_(kNoTimestamp()),
      log_cb_(log_cb) {
  DCHECK(default_duration_ == kNoTimestamp() ||
         default_duration_ > base::TimeDelta());
}

WebMClusterParser::Track::~Track() {}

DecodeTimestamp WebMClusterParser::Track::GetReadyUpperBound() {
  DCHECK(ready_buffers_.empty());
  if (last_added_buffer_missing_duration_)
    return last_added_buffer_missing_duration_->GetDecodeTimestamp();

  return DecodeTimestamp::FromPresentationTime(base::TimeDelta::Max());
}

void WebMClusterParser::Track::ExtractReadyBuffers(
    const DecodeTimestamp before_timestamp) {
  DCHECK(ready_buffers_.empty());
  DCHECK(DecodeTimestamp() <= before_timestamp);
  DCHECK(kNoDecodeTimestamp() != before_timestamp);

  if (buffers_.empty())
    return;

  if (buffers_.back()->GetDecodeTimestamp() < before_timestamp) {
    // All of |buffers_| are ready.
    ready_buffers_.swap(buffers_);
    DVLOG(3) << __FUNCTION__ << " : " << track_num_ << " All "
             << ready_buffers_.size() << " are ready: before upper bound ts "
             << before_timestamp.InSecondsF();
    return;
  }

  // Not all of |buffers_| are ready yet. Move any that are ready to
  // |ready_buffers_|.
  while (true) {
    const scoped_refptr<StreamParserBuffer>& buffer = buffers_.front();
    if (buffer->GetDecodeTimestamp() >= before_timestamp)
      break;
    ready_buffers_.push_back(buffer);
    buffers_.pop_front();
    DCHECK(!buffers_.empty());
  }

  DVLOG(3) << __FUNCTION__ << " : " << track_num_ << " Only "
           << ready_buffers_.size() << " ready, " << buffers_.size()
           << " at or after upper bound ts " << before_timestamp.InSecondsF();
}

bool WebMClusterParser::Track::AddBuffer(
    const scoped_refptr<StreamParserBuffer>& buffer) {
  DVLOG(2) << "AddBuffer() : " << track_num_
           << " ts " << buffer->timestamp().InSecondsF()
           << " dur " << buffer->duration().InSecondsF()
           << " kf " << buffer->IsKeyframe()
           << " size " << buffer->data_size();

  if (last_added_buffer_missing_duration_) {
    base::TimeDelta derived_duration =
        buffer->timestamp() - last_added_buffer_missing_duration_->timestamp();
    last_added_buffer_missing_duration_->set_duration(derived_duration);

    DVLOG(2) << "AddBuffer() : applied derived duration to held-back buffer : "
             << " ts "
             << last_added_buffer_missing_duration_->timestamp().InSecondsF()
             << " dur "
             << last_added_buffer_missing_duration_->duration().InSecondsF()
             << " kf " << last_added_buffer_missing_duration_->IsKeyframe()
             << " size " << last_added_buffer_missing_duration_->data_size();
    scoped_refptr<StreamParserBuffer> updated_buffer =
        last_added_buffer_missing_duration_;
    last_added_buffer_missing_duration_ = NULL;
    if (!QueueBuffer(updated_buffer))
      return false;
  }

  if (buffer->duration() == kNoTimestamp()) {
    last_added_buffer_missing_duration_ = buffer;
    DVLOG(2) << "AddBuffer() : holding back buffer that is missing duration";
    return true;
  }

  return QueueBuffer(buffer);
}

void WebMClusterParser::Track::ApplyDurationEstimateIfNeeded() {
  if (!last_added_buffer_missing_duration_)
    return;

  last_added_buffer_missing_duration_->set_duration(GetDurationEstimate());

  DVLOG(2) << "ApplyDurationEstimateIfNeeded() : new dur : "
           << " ts "
           << last_added_buffer_missing_duration_->timestamp().InSecondsF()
           << " dur "
           << last_added_buffer_missing_duration_->duration().InSecondsF()
           << " kf " << last_added_buffer_missing_duration_->IsKeyframe()
           << " size " << last_added_buffer_missing_duration_->data_size();

  // Don't use the applied duration as a future estimation (don't use
  // QueueBuffer() here.)
  buffers_.push_back(last_added_buffer_missing_duration_);
  last_added_buffer_missing_duration_ = NULL;
}

void WebMClusterParser::Track::ClearReadyBuffers() {
  // Note that |buffers_| are kept and |estimated_next_frame_duration_| is not
  // reset here.
  ready_buffers_.clear();
}

void WebMClusterParser::Track::Reset() {
  ClearReadyBuffers();
  buffers_.clear();
  last_added_buffer_missing_duration_ = NULL;
}

bool WebMClusterParser::Track::IsKeyframe(const uint8* data, int size) const {
  // For now, assume that all blocks are keyframes for datatypes other than
  // video. This is a valid assumption for Vorbis, WebVTT, & Opus.
  if (!is_video_)
    return true;

  // Make sure the block is big enough for the minimal keyframe header size.
  if (size < 7)
    return false;

  // The LSb of the first byte must be a 0 for a keyframe.
  // http://tools.ietf.org/html/rfc6386 Section 19.1
  if ((data[0] & 0x01) != 0)
    return false;

  // Verify VP8 keyframe startcode.
  // http://tools.ietf.org/html/rfc6386 Section 19.1
  if (data[3] != 0x9d || data[4] != 0x01 || data[5] != 0x2a)
    return false;

  return true;
}

bool WebMClusterParser::Track::QueueBuffer(
    const scoped_refptr<StreamParserBuffer>& buffer) {
  DCHECK(!last_added_buffer_missing_duration_);

  // WebMClusterParser::OnBlock() gives MEDIA_LOG and parse error on decreasing
  // block timecode detection within a cluster. Therefore, we should not see
  // those here.
  DecodeTimestamp previous_buffers_timestamp = buffers_.empty() ?
      DecodeTimestamp() : buffers_.back()->GetDecodeTimestamp();
  CHECK(previous_buffers_timestamp <= buffer->GetDecodeTimestamp());

  base::TimeDelta duration = buffer->duration();
  if (duration < base::TimeDelta() || duration == kNoTimestamp()) {
    MEDIA_LOG(log_cb_) << "Invalid buffer duration: " << duration.InSecondsF();
    return false;
  }

  // The estimated frame duration is the minimum non-zero duration since the
  // last initialization segment.  The minimum is used to ensure frame durations
  // aren't overestimated.
  if (duration > base::TimeDelta()) {
    if (estimated_next_frame_duration_ == kNoTimestamp()) {
      estimated_next_frame_duration_ = duration;
    } else {
      estimated_next_frame_duration_ =
          std::min(duration, estimated_next_frame_duration_);
    }
  }

  buffers_.push_back(buffer);
  return true;
}

base::TimeDelta WebMClusterParser::Track::GetDurationEstimate() {
  base::TimeDelta duration = estimated_next_frame_duration_;
  if (duration != kNoTimestamp()) {
    DVLOG(3) << __FUNCTION__ << " : using estimated duration";
  } else {
    DVLOG(3) << __FUNCTION__ << " : using hardcoded default duration";
    if (is_video_) {
      duration = base::TimeDelta::FromMilliseconds(
          kDefaultVideoBufferDurationInMs);
    } else {
      duration = base::TimeDelta::FromMilliseconds(
          kDefaultAudioBufferDurationInMs);
    }
  }

  DCHECK(duration > base::TimeDelta());
  DCHECK(duration != kNoTimestamp());
  return duration;
}

void WebMClusterParser::ClearTextTrackReadyBuffers() {
  text_buffers_map_.clear();
  for (TextTrackMap::iterator it = text_track_map_.begin();
       it != text_track_map_.end();
       ++it) {
    it->second.ClearReadyBuffers();
  }
}

void WebMClusterParser::ResetTextTracks() {
  ClearTextTrackReadyBuffers();
  for (TextTrackMap::iterator it = text_track_map_.begin();
       it != text_track_map_.end();
       ++it) {
    it->second.Reset();
  }
}

void WebMClusterParser::UpdateReadyBuffers() {
  DCHECK(ready_buffer_upper_bound_ == kNoDecodeTimestamp());
  DCHECK(text_buffers_map_.empty());

  if (cluster_ended_) {
    audio_.ApplyDurationEstimateIfNeeded();
    video_.ApplyDurationEstimateIfNeeded();
    // Per OnBlock(), all text buffers should already have valid durations, so
    // there is no need to call ApplyDurationEstimateIfNeeded() on text tracks
    // here.
    ready_buffer_upper_bound_ =
        DecodeTimestamp::FromPresentationTime(base::TimeDelta::Max());
    DCHECK(ready_buffer_upper_bound_ == audio_.GetReadyUpperBound());
    DCHECK(ready_buffer_upper_bound_ == video_.GetReadyUpperBound());
  } else {
    ready_buffer_upper_bound_ = std::min(audio_.GetReadyUpperBound(),
                                         video_.GetReadyUpperBound());
    DCHECK(DecodeTimestamp() <= ready_buffer_upper_bound_);
    DCHECK(kNoDecodeTimestamp() != ready_buffer_upper_bound_);
  }

  // Prepare each track's ready buffers for retrieval.
  audio_.ExtractReadyBuffers(ready_buffer_upper_bound_);
  video_.ExtractReadyBuffers(ready_buffer_upper_bound_);
  for (TextTrackMap::iterator itr = text_track_map_.begin();
       itr != text_track_map_.end();
       ++itr) {
    itr->second.ExtractReadyBuffers(ready_buffer_upper_bound_);
  }
}

WebMClusterParser::Track*
WebMClusterParser::FindTextTrack(int track_num) {
  const TextTrackMap::iterator it = text_track_map_.find(track_num);

  if (it == text_track_map_.end())
    return NULL;

  return &it->second;
}

}  // namespace media


text:
This is a UE4 implementation of a night vision post process material.

It is an implementation based on this UDK tutorial:

http://luchadordev.com/tutorials/tutorial02-nv.html

and on this discussion thread:

https://forums.unrealengine.com/showthread.php?26829-Porting-Night-Vision-PP-Effect-from-UDK


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <predicate lemma="revitalize">
        <note>
            Frames file for 'revitalize' based on sentences in wsj.  Verbnet
            entry 31.1.
        </note>

        <roleset id="revitalize.01" name="make lively" vncls="31.1">
            <roles>
                <role descr="giver of new life" n="0">
                    <vnrole vncls="31.1" vntheta="Cause"/>
                </role>
                <role descr="thing that was dead" n="1">
                    <vnrole vncls="31.1" vntheta="Experiencer"/>
                </role>
            </roles>

            <example name="the one example">
                <inflection aspect="ns" form="gerund" person="ns" tense="present" voice="active"/>
                <text>
                    [The National Association of Broadcasters]-1 in June adopted an agenda
                    for *trace*-1 revitalizing AM radio that includes, among other
                    things, pursuing further FCC action on selecting an AM stereo
                    standard and seeking a law requiring all stereo receivers to
                    include AM stereo.
                </text>
                <arg n="0">*trace*</arg>
                <rel>revitalizing</rel>
                <arg n="1">AM radio</arg>
            </example>

            <note>
            </note>

        </roleset>
    </predicate>
</frameset>