text:
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding field 'Entity.fax'
        db.add_column(u'bazar_entity', 'fax',
                      self.gf('django.db.models.fields.CharField')(default='', max_length=15, blank=True),
                      keep_default=False)

    def backwards(self, orm):
        # Deleting field 'Entity.fax'
        db.delete_column(u'bazar_entity', 'fax')

    models = {
        u'auth.group': {
            'Meta': {'object_name': 'Group'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        u'auth.permission': {
            'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        u'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        u'bazar.entity': {
            'Meta': {'object_name': 'Entity'},
            'adress': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'fax': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'kind': ('django.db.models.fields.CharField', [], {'default': "'customer'", 'max_length': '40'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
            'phone': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'}),
            'town': ('django.db.models.fields.CharField', [], {'max_length': '75', 'blank': 'True'}),
            'zipcode': ('django.db.models.fields.CharField', [], {'max_length': '6', 'blank': 'True'})
        },
        u'bazar.note': {
            'Meta': {'object_name': 'Note'},
            'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
            'content': ('django.db.models.fields.TextField', [], {}),
            'created': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'entity': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['bazar.Entity']", 'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '150'})
        },
        u'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        u'taggit.tag': {
            'Meta': {'object_name': 'Tag'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'})
        },
        u'taggit.taggeditem': {
            'Meta': {'object_name': 'TaggedItem'},
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'taggit_taggeditem_tagged_items'", 'to': u"orm['contenttypes.ContentType']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
            'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'taggit_taggeditem_items'", 'to': u"orm['taggit.Tag']"})
        }
    }

    complete_apps = ['bazar']


text:
var config = require('config');
var pUtils = require('../src/PromiseUtils.js');
var sessionManager = require('./SessionDbManager');
var url = require('url');
//TODO: decouple stuff to implement walkable API

var viewHandler = require('../src/viewHandler');

const CREST = config.get('CREST');

module.exports = {
	getFleetInfo : function(key, callback){
		console.log("FleetInfoCallHandler :: getFleetInfo_parallel,", key);
		sessionManager.getSessionDetails(key, function(err, details){
			if(err){
				console.error("Error in getAuthOptionsSeed:", err);
				callback("Session retrieval failed, session may not exist");
				return;
			}
			if(!details || !details.key || !details.fleetid || !details.accessToken || !details.refreshtoken || !details.created){
				console.error("FleetInfoCaller :: getFleetInfo err, not all details are present:", details);
				callback("Session retrieval failed, session may not exist");
				return;
			}
			var authHeader = {"Authorization": "Bearer " + details.accessToken}
			var fleetUrl = url.format({protocol: 'https',
				host: 'crest-tq.eveonline.com', pathname: '/fleets/' + details.fleetid + '/'})
			var membersUrl = url.format({protocol: 'https',
				host: 'crest-tq.eveonline.com', pathname: '/fleets/' + details.fleetid + '/members/'})
			var wingsUrl = url.format({protocol: 'https',
				host: 'crest-tq.eveonline.com', pathname: '/fleets/' + details.fleetid + '/wings/'})
			var fleetOptions = {'uri' : fleetUrl, 'headers' : authHeader, 'json' : true}
			var membersOptions = {'uri' : membersUrl, 'headers' : authHeader, 'json' : true}
			var wingsOptions = {'uri' : wingsUrl, 'headers' : authHeader, 'json' : true}
			Promise.all([
				pUtils.remoteCall(fleetOptions),
				pUtils.remoteCall(membersOptions),
				pUtils.remoteCall(wingsOptions)])
			.then(function(values){
				console.log("getFleetInfo_parallel :: successful Promise.all([])");
				callback(null, {
					fleetinfo: 	viewHandler.getFleetDisplay(values[0]),
					members: 	viewHandler.getMemberDisplay(values[1]),
					wings: 		viewHandler.getWingDisplay(values[2])
				})
			}, function(reason){
				// console.error("FleetInfoCallHandler :: getFleetInfo_parallel :: failed with reason '",
				// 	reason,"' as reason, terminating session");
				// console.error(reason.response, " response");
				//Terminate Session
				console.error("FleetInfoCaller :: getFleetInfo_parallel :: failed at reason, terminating session");
				sessionManager.terminateFleetDBSession(key);
				// callback("Fleet Session Terminated : failure during fleet info calls");
				// callback(reason);
			}).catch(function(promiseErr){
				// console.error("FleetInfoCallHandler :: getFleetInfo_parallel :: caught error '",
					// promiseErr,"' as error, terminating session");
				//Terminate Session
				console.error("FleetInfoCaller :: getFleetInfo_parallel :: failed at error, terminating session");
				sessionManager.terminateFleetDBSession(key);
				// callback("Fleet Session Terminated : error during fleet info calls");
				// callback(promiseErr);
			})
		})
	}
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * Based on JUEL 2.2.1 code, 2006-2009 Odysseus Software GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.activiti.engine.impl.juel;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.Map.Entry;

/**
 * Simple (thread-safe) LRU cache.
 * After the cache size reached a certain limit, the least recently used entry is removed,
 * when adding a new entry.
 *
 * @author Christoph Beck
 */
public final class Cache implements TreeCache {
  private final Map<String,Tree> primary;
  private final Map<String,Tree> secondary;

  /**
   * Constructor.
   * Use a {@link WeakHashMap} as secondary map.
   * @param size maximum primary cache size
   */
	public Cache(int size) {
		this(size, new WeakHashMap<String,Tree>());
	}

	/**
	 * Constructor.
	 * If the least recently used entry is removed from the primary cache, it is added to
	 * the secondary map.
   * @param size maximum primary cache size
	 * @param secondary the secondary map (may be null)
	 */
	@SuppressWarnings("serial")
	public Cache(final int size, Map<String,Tree> secondary) {
		this.primary = Collections.synchronizedMap(new LinkedHashMap<String,Tree>(16, 0.75f, true) {
			@Override
			protected boolean removeEldestEntry(Entry<String,Tree> eldest) {
				if (size() > size) {
					if (Cache.this.secondary != null) { // move to secondary cache
						Cache.this.secondary.put(eldest.getKey(), eldest.getValue());
					}
					return true;
				}
				return false;
			}
		});
		this.secondary = secondary == null ? null : Collections.synchronizedMap(secondary);
	}

	public Tree get(String expression) {
		if (secondary == null) {
			return primary.get(expression);
		} else {
			Tree tree = primary.get(expression);
			if (tree == null) {
				tree = secondary.get(expression);
			}
			return tree;
		}
	}

	public void put(String expression, Tree tree) {
		primary.put(expression, tree);
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. Soc. mycol. Fr. 38(2): 84 (1922)

#### Original name
Tremella granuliformis Pat.

### Remarks
null


text:
package edu.gemini.seqexec.server

import java.util.logging.{Level, Logger}

import edu.gemini.seqexec.server.TaskRef._
import edu.gemini.seqexec.server.TcsController._
import edu.gemini.spModel.core.Wavelength
import squants.space.{Degrees, Nanometers, Millimeters}

import scalaz.EitherT
import scalaz.concurrent.Task

/**
 * Created by jluhrs on 8/3/15.
 */
object TcsControllerSim extends TcsController {
  import MountGuideOption._

  val guideState = newTaskRef(GuideConfig(MountGuideOff, M1GuideOff, M2GuideOff))
  val telescopeState = newTaskRef(TelescopeConfig(
    OffsetA(FocalPlaneOffset(OffsetX(Millimeters(0.0)), OffsetY(Millimeters(0.0)))),
    OffsetB(FocalPlaneOffset(OffsetX(Millimeters(0.0)), OffsetY(Millimeters(0.0)))),
    OffsetC(FocalPlaneOffset(OffsetX(Millimeters(0.0)), OffsetY(Millimeters(0.0)))),
    WavelengthA(Wavelength(Nanometers(445))),
    WavelengthB(Wavelength(Nanometers(445))),
    WavelengthC(Wavelength(Nanometers(445))),
    Beam.A))
  val guidersTrackState = newTaskRef(GuidersTrackingConfig(
    ProbeTrackingConfigP1(ProbeTrackingConfig.Parked),
    ProbeTrackingConfigP2(ProbeTrackingConfig.Parked),
    ProbeTrackingConfigOI(ProbeTrackingConfig.Parked),
    ProbeTrackingConfigAO(ProbeTrackingConfig.Parked)))
  val guidersActivityState = newTaskRef(GuidersEnabled(
    GuiderSensorOptionP1(GuiderSensorOff),
    GuiderSensorOptionP2(GuiderSensorOff),
    GuiderSensorOptionOI(GuiderSensorOff),
    GuiderSensorOptionAO(GuiderSensorOff)))
  val agState = newTaskRef(AGConfig(ScienceFoldPosition.Parked, HrwfsPickupPosition.Parked))
  val iaaState = newTaskRef(InstrumentAlignAngle(Degrees(0.0)))
  private val Log = Logger.getLogger(getClass.getName)

  override def getConfig: SeqAction[TcsConfig] = EitherT( for {
      a <- guideState.flatMap(_.get)
      b <- telescopeState.flatMap(_.get)
      c <- guidersTrackState.flatMap(_.get)
      d <- guidersActivityState.flatMap(_.get)
      e <- agState.flatMap(_.get)
      f <- iaaState.flatMap(_.get)
    } yield TrySeq(TcsConfig(a, b, c, d, e, f))
  )

  override def applyConfig(tc: TelescopeConfig, gtc: GuidersTrackingConfig, ge: GuidersEnabled, agc: AGConfig): SeqAction[Unit] =
    EitherT ( for {
        _ <- Task {
          Log.log(Level.INFO, "Applying TCS configuration")
          Thread.sleep(2000)
        }
        _ <- telescopeState.flatMap(_.put(tc))
        _ <- guidersTrackState.flatMap(_.put(gtc))
        _ <- guidersActivityState.flatMap(_.put(ge))
        _ <- agState.flatMap(_.put(agc))
      } yield TrySeq(())
    )

  override def guide(gc: GuideConfig): SeqAction[Unit] =
    EitherT ( for {
        _ <- Task {
          Log.log(Level.INFO, "Applying guiding configuration")
          Thread.sleep(1000)
        }
        _ <- guideState.flatMap(_.put(gc))
      } yield TrySeq(())
    )

}


text:
    #define BASIC_LIGHT_COUNT 1
#endif

// In pure forward shading models, we resolve all of the lights
// in one go (as opposed to other models, where a single light is
// resolved at a time). This cbuffer holds the settings for all
// of the lights in the scene.
cbuffer BasicLightingEnvironment : register(b10)
{
    AmbientDesc BasicAmbient;
    RangeFogDesc BasicRangeFog;
    LightDesc BasicLight[BASIC_LIGHT_COUNT];
}

#endif


text:
// This solution is temporary and will be replaced when
// https://github.com/ampproject/amp-toolbox/issues/378 is resolved.

const crypto = require('crypto');

const SUPPORTED_ALGORITHMS = new Set(['sha384']);

const DEFAULT_ALGORITHM = 'sha384';

/**
 * Calculates the hash of the given input and returns a valid CSP string for use
 * with amp-script.
 *
 * @param {string|DataView} src - Input script
 * @param {Object} [options] - The options object
 * @param {string} [options.algorithm] - Algorithm to use, defaults to sha384
 * @returns {string} The hash prefixed with the algorithm used
 */
function calculateHash(src, {algorithm = DEFAULT_ALGORITHM} = {}) {
  const algo = algorithm.toLowerCase();
  if (!SUPPORTED_ALGORITHMS.has(algo)) {
    throw new Error(`Unsupported algorithm for CSP: ${algo}`);
  }

  if (typeof src === 'string') {
    src = Buffer.from(src, 'utf8');
  }

  const hash = crypto.createHash(algo);
  const data = hash.update(src);
  const base64 = base64URLFormat(data.digest('base64'));
  return `${algo}-${base64}`;
}

function base64URLFormat(base64) {
  return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
}

module.exports = {calculateHash};


text:
<?xml version="1.0" encoding="utf-8"?>
<!--

    Copyright (C) 2015-2019 Philip Helger (www.helger.com)
    philip[at]helger[dot]com

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<web-app
  xmlns="http://java.sun.com/xml/ns/javaee"
  version="3.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
  <welcome-file-list>
    <welcome-file>secure</welcome-file>
  </welcome-file-list>
  <listener>
    <listener-class>com.helger.as4.server.servlet.AS4WebAppListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>AS4Servlet</servlet-name>
    <servlet-class>com.helger.as4.servlet.AS4Servlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>AS4Servlet</servlet-name>
    <url-pattern>/as4</url-pattern>
  </servlet-mapping>
</web-app>


text:
using System;
using RailDataEngine.Domain.Gateway;

namespace RailDataEngine.Domain.Entity.TrainMovements
{
    public class TrainActivation : IIdentifyable
    {
        public int Id { get; set; }
        public string TrainId { get; set; }
        public DateTime? CreationTimestamp { get; set; }
        public DateTime? OriginTimestamp { get; set; }
        public string TrainUid { get; set; }
        public string ScheduleOriginStanox { get; set; }
        public DateTime? ScheduleStartDate { get; set; }
        public DateTime? ScheduleEndDate { get; set; }
        public ScheduleSource? ScheduleSource { get; set; }
        public ScheduleType? ScheduleType { get; set; }
        public string OriginStanox { get; set; }
        public DateTime? OriginDepartureTimestamp { get; set; }
        public TrainCallType? CallType { get; set; }
        public TrainCallMode? CallMode { get; set; }
    }
}


text:
package net.omniscimus.fireworks.commands;

import java.text.ParseException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * This class contains methods to parse a time string.
 *
 * Example of a time string: "3h24m3s" means 3 hours, 24 minutes and 3 seconds.
 *
 * Allowed time characters:
 *

 *
y: years

 *
w: weeks

 *
d: days

 *
h: hours

 *
m: minutes

 *
s: seconds

 *

 *
 * @author Omniscimus
 */
public class TimeParser {

    private static final List<Character> DIGITS = Arrays.asList(
            new Character[] {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'});

    private static final Map<Character, Integer> TIME_UNITS = new HashMap<>();
    static {
        TIME_UNITS.put('s', 1);
        TIME_UNITS.put('m', 60 * TIME_UNITS.get('s'));
        TIME_UNITS.put('h', 60 * TIME_UNITS.get('m'));
        TIME_UNITS.put('d', 24 * TIME_UNITS.get('h'));
        TIME_UNITS.put('w', 7 * TIME_UNITS.get('d'));
        TIME_UNITS.put('y', (int) (365.25 * TIME_UNITS.get('d')));
    }

    /**
     * Converts a time string into an amount of seconds.
     *
     * @param time the time string
     * @return the amount of time time in the string, in seconds
     * @throws ParseException if the given string is not a valid time string
     */
    public static long parse(String time) throws ParseException {
        if (!time.matches("(\\d+y)?(\\d+w)?(\\d+d)?(\\d+h)?(\\d+m)?(\\d+s)?"))
            throw new ParseException("Invalid time string", 0);

        return parseNoCheck(time);
    }

    /**
     * Recursive method to parse the time in a string. Does not check if the
     * string is a valid time string for efficiency.
     *
     * @param time the time string
     * @return the amount of time in the string, in seconds
     */
    private static long parseNoCheck(String time) {
        if (time.isEmpty())
            return 0;

        int i = 0;
        while (DIGITS.contains(time.charAt(i))) {
            i++;
        }

        long number = Long.parseLong(time.substring(0, i));
        int multiplier = TIME_UNITS.get(time.charAt(i));

        return number * multiplier
                + parseNoCheck(time.substring(i + 1, time.length()));
    }

}


text:
The Creative Little WP Kit is a RAD (Rapid Application Development) solution for Wordpress.

> **Note:** This repository contains the core code of the Creative Little WP Kit. If you want to build your theme using Creative Little WP Kit, visit the main [Creative Little WP Kit](https://github.com/creativelittledots/wp-kit).

Creative Little WP Kit (Core) is automatically downloaded via Composer in Creative Little WP Kit, so please only use this repo to reference examples of usage.

## Requirements

Wordpress 4+

PHP 5.6+

## Official Repo

The official repo for WP Kit can be found [here](https://github.com/creativelittledots/WP-Kit).

## License

WP Kit Core is open-sourced software licensed under the MIT License.


text:
#ifndef ECHO_SERVICE_H
#define ECHO_SERVICE_H

#include <memory>
#include <string>
#include <vector>
#include "soa/service/zmq_endpoint.h"
#include "soa/service/service_base.h"
#include "jml/utils/exc_assert.h"

namespace Datacratic {

/*****************************************************************************/
/* ECHO SERVICE                                                              */
/*****************************************************************************/

/** Simple test service that listens on zeromq and simply echos everything
    that it gets back.
*/

struct EchoService : public ServiceBase {

    EchoService(std::shared_ptr<ServiceProxies> proxies,
                const std::string & name)
        : ServiceBase(name, proxies),
          toClients(getZmqContext())
    {
        proxies->config->removePath(serviceName());
        registerServiceProvider(serviceName(), { "echo" });

        auto handler = [=] (std::vector<std::string> message)
            {
                //cerr << "got message " << message << endl;
                ExcAssertEqual(message.size(), 3);
                ExcAssertEqual(message[1], "ECHO");
                message[1] = "REPLY";
                return message;
            };

        toClients.clientMessageHandler = handler;
    }

    ~EchoService()
    {
        shutdown();
    }

    void init()
    {
        toClients.init(getServices()->config, serviceName() + "/echo");
    }

    void start()
    {
        toClients.start();
    }

    void shutdown()
    {
        toClients.shutdown();
    }

    std::string bindTcp()
    {
        return toClients.bindTcp();
    }

    ZmqNamedClientBus toClients;
};

} // namespace Datacratic

#endif


text:
<?php

namespace models\Entities;

use Doctrine\Common\Collections\ArrayCollection;

/**
 * @Entity
 * @Table(name="Users")
 */
class User extends AbstractEntity {

    /**
     * @Id  @Column(type="integer")
     * @GeneratedValue
     */
    protected $UserId;

    /**
     * @Column(type="string") @var string
     */
    protected $Firstname;

    /**
     * @Column(type="string") @var string
     */
    protected $Lastname;

    /**
     * @Column(type="string") @var string
     */
    protected $Username;

    /**
     * @Column(type="string") @var string
     */
    protected $Password;

    /**
     * @Column(type="string") @var string
     */
    protected $RealPassword;

    /**
     * @Column(type="string") @var string
     */
    protected $Hash;

    /**
     * @Column(type="integer") @var integer
     */
    protected $Access = 0;

    /**
     * @Column(type="text") @var string
     */
    protected $Quota;

    /**
     * @Column(type="datetime") @var string
     */
    protected $Created;

    /**
     * @Column(type="datetime") @var string
     */
    protected $Updated;

    /**
     * @OneToOne(targetEntity="Image")
     * @JoinColumn(name="CoverId", referencedColumnName="ImageId" , onDelete="CASCADE")
     **/
    private $Cover;

    //private $Comments;

    public function __construct(){
        $this->Created = new \DateTime('now');
        $this->Updated = new \DateTime('now');
    }

    /* Setters and getters */
    public function getUserId()
    {
        return $this->UserId;
    }

    public function getFirstname()
    {
        return $this->Firstname;
    }

    public function getLastname()
    {
        return $this->Lastname;
    }

    public function getUsername()
    {
        return $this->Username;
    }

    public function getPassword()
    {
        return $this->Password;
    }

    public function getRealPassword()
    {
        return $this->RealPassword;
    }

    public function getHash()
    {
        return $this->Hash;
    }

    public function getAccess()
    {
        return $this->Access;
    }

    public function getCover(){
        return $this->Cover;
    }

    public function getQuota(){
        return $this->Quota;
    }

    public function getCreated()
    {
        return $this->Created;
    }

    public function getUpdated()
    {
        return $this->Updated;
    }

    public function getComments()
    {
        return $this->Comments;
    }

    public function setUserId($UserId)
    {
        $this->UserId = $UserId;
        return $this;
    }

    public function setFirstname($Firstname)
    {
        $this->Firstname = $Firstname;
        return $this;
    }

    public function setLastname($Lastname)
    {
        $this->Lastname = $Lastname;
        return $this;
    }

    public function setUsername($Username)
    {
        $this->Username = $Username;
        return $this;
    }

    public function setPassword($Password)
    {
        $this->Password = $Password;
        return $this;
    }

    public function setRealPassword($RealPassword)
    {
        $this->RealPassword = $RealPassword;
        return $this;
    }

    public function setHash($Hash)
    {
        $this->Hash = $Hash;
        return $this;
    }

    public function setAccess($Access)
    {
        $this->Access = $Access;
        return $this;
    }

    public function setCover($Cover){
        $this->Cover = $Cover;
    }

    public function setQuota($Quota){
        $this->Quota = $Quota;
    }

    public function setCreated($Created)
    {
        $this->Created = $Created;
        return $this;
    }

    public function setUpdated($Updated)
    {
        $this->Updated = $Updated;
        return $this;
    }

    public function setComments($Comments)
    {
        $this->Comments = $Comments;
        return $this;
    }
}


text:
package org.ovirt.engine.core.utils.network.predicate;

import java.util.function.Predicate;

import org.junit.Assert;
import org.junit.Test;
import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;

public abstract class AbstractVdsNetworkInterfacePredicateTest {

    private static final String VALID = "VALID";
    private static final String INVALID = "INVALID";
    private Predicate<VdsNetworkInterface> underTest;

    protected String getVALID() {
        return VALID;
    }

    protected String getINVALID() {
        return INVALID;
    }

    protected void setUnderTest(Predicate<VdsNetworkInterface> underTest) {
        this.underTest = underTest;
    }

    public abstract VdsNetworkInterface generateVdsNetworkInterface(String value);

    @Test
    public void checkNullAddress() {
        Assert.assertFalse(underTest.test(generateVdsNetworkInterface(null)));
    }

    @Test
    public void checkInvalidAddress() {
        Assert.assertFalse(underTest.test(generateVdsNetworkInterface(getINVALID())));
    }

    @Test
    public void checkValidAddress() {
        Assert.assertTrue(underTest.test(generateVdsNetworkInterface(getVALID())));
    }

}


text:
global DWT_MULTISITE "[default]=false"

# Manage settings files automatically.
# @see cwt/extensions/drupalwt/instance/post_init.hook.sh
# @see cwt/extensions/drupalwt/instance/post_rebuild.hook.sh
global DWT_MANAGE_SETTINGS_FILES "[default]=true [help]='After instance init and/or rebuild, this global determines wether the files sites/default/settings.php, sites/default/settings.local.php, and sites/sites.php (if this is a multi-site setup) will be automatically (re)written where appropriate. Also, if no sites/default/settings.php file exists, the Drupal core default file will be used. If this is a multi-site setup, all the settings files of all sites will also get (re)written.'"

global DWT_USE_SETTINGS_LOCAL_OVERRIDE "[default]=true [help]='When true, after instance init and/or rebuild, if no sites/default/settings.php file exists, the Drupal core default file will be used with local override support (i.e. the last lines about settings.local.php activated). Also, the generated Drupal settings file will be sites/default/settings.local.php.'"

global DWT_MANAGE_MULTISITE_SETTINGS_FILE "[default]=true [help]='Make (re)generating the multi-site settings file - e.g. sites/sites.php - optional.'"

# Make the automatic crontab setup for Drupal cron on local host during 'app
# install' opt-in.
global DWT_USE_CRONTAB "[default]=false [help]='When true, during app install, a generic crontab entry for running Drupal cron will be created on local host (if it has the crontab program installed).'"
# global DWT_CRON_FREQ "[default]='*/20 * * * *'"
global DWT_CRON_FREQ "[default]='0 * * * *'"

# [optional] Shorter generated make tasks names.
# @see u_instance_task_name() in cwt/instance/instance.inc.sh
global CWT_MAKE_TASKS_SHORTER "[append]='drupalwt/dwt'"


text:
package com.model.model.repository;

import com.model.model.entity.User;
import com.org.framework.data.BaseJpaRepository;

/**
 * DD Repository for User related actions and events
 *
 * @author: Y Kamesh Rao
 * @created: 3/25/12 11:02 AM
 * @company: © 2012, Kaleidosoft Labs
 */
public interface UserRepository extends BaseJpaRepository<User, Long> {
    /**
     * Finds a user with the given email
     *
     * @param email
     * @return
     */
    public User findByEmail(String email);

    /**
     * Finds a user with the given username
     *
     * @param username
     * @return
     */
    public User findByUsername(String username);
}


text:
import math
import pickle

import numpy
import scipy
import scipy.linalg

from ..math.matrix import Matrix
from ..math.text2matrix import Text2Matrix
from ..math.scipy_interface import ScipyInterface
from ..nlp.segmenter import Segmenter
from ..common.global_info import GlobalInfo
from ..common.configuration import Configuration

class Lda:
    def __init__(self, config, nodeName, loadFromFile = False):
        self.sourceDim = 0
        self.w = None
        if (loadFromFile):
            #add code
            pass

    def Train(self, x, y, k):
        #make yy unique
        yy = set(y)
        yy = list(yy)
        yy.sort()
        if (len(yy) <> 2):
            print "ERROR:input matrix should be 2-class classification problem"
            raise

        #check nDim
        if (k <= 0) or (k > x.nCol):
            print "k MUST > 0 and < x.nCol"
            raise
        self.sourceDim = x.nCol

        #calculate m1, m2
        denseMat = ScipyInterface.CsrToDense(x)
        print "denseMat_shape:", denseMat.shape
        m1 = numpy.zeros(denseMat.shape[1])
        m2 = numpy.zeros(denseMat.shape[1])
        for i in range(denseMat.shape[0]):
            if (y[i] == yy[0]):
                m1 += denseMat[i].ravel()
            else:
                m2 += denseMat[i].ravel()

        #calculate s1, s2, sw
        s1 = numpy.zeros((denseMat.shape[1], denseMat.shape[1]))
        s2 = numpy.zeros((denseMat.shape[1], denseMat.shape[1]))
        for i in range(denseMat.shape[0]):
            if (y[i] == yy[0]):
                vec = denseMat[i].ravel() - m1
                s1 += numpy.dot(vec, vec.transpose())
            else:
                vec = denseMat[i].ravel() - m2
                s2 += numpy.dot(vec, vec.transpose())
        sw = s1 + s2

        #calculate w
        sw = scipy.linalg.pinv(sw)
        self.w = numpy.dot(sw, m1 - m2)
        self.w = self.w[0:k]
        self.w = self.w / scipy.linalg.norm(self.w)

    def Test(self, x, y):
        #add code
        pass


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Novon 10:34. 2000

#### Original name
null

### Remarks
null


text:
using namespace ntuple;
using std::setw;

namespace {
  // 'using' declaration won't work because 'now' is a member function
  auto now = std::bind(&tbb::tick_count::now);
}

// ======================================================================
std::ostream&
art::operator<<(std::ostream& os, art::Statistics const& info)
{
  os << info.label << "  "
     << boost::format(" %=12g ") % info.min
     << boost::format(" %=12g ") % info.mean
     << boost::format(" %=12g ") % info.max
     << boost::format(" %=12g ") % info.median
     << boost::format(" %=12g ") % info.rms
     << boost::format(" %=10d ") % info.n;
  return os;
}

// ======================================================================

art::TimeTracker::TimeTracker(ServiceTable<Config> const & config, ActivityRegistry& iRegistry)
  : printSummary_{config().printSummary()}
  , dbMgr_{config().dbOutput().filename()}
  , overwriteContents_{config().dbOutput().overwrite()}
    // table headers
  , timeReportTuple_{"ReportType","Min","Mean","Max","Median","RMS","nEvts" }
  , timeEventTuple_ {"Run","Subrun","Event","Time" }
  , timeModuleTuple_{"Run","Subrun","Event","PathModuleId","Time"}
    // tables
  , timeReportTable_{dbMgr_, "TimeReport", timeReportTuple_, true} // always recompute reports
  , timeEventTable_ {dbMgr_, "TimeEvent" , timeEventTuple_ , overwriteContents_}
  , timeModuleTable_{dbMgr_, "TimeModule", timeModuleTuple_, overwriteContents_}
{
  iRegistry.sPreProcessPath.watch(this, &TimeTracker::prePathProcessing);

  iRegistry.sPostEndJob.watch(this, &TimeTracker::postEndJob);

  iRegistry.sPreProcessEvent.watch(this, &TimeTracker::preEventProcessing);
  iRegistry.sPostProcessEvent.watch(this, &TimeTracker::postEventProcessing);

  iRegistry.sPreModule.watch(this, &TimeTracker::preModule);
  iRegistry.sPostModule.watch(this, &TimeTracker::postModule);
}

//======================================================================
void
art::TimeTracker::prePathProcessing(std::string const& pathname)
{
  pathname_ = pathname;
}

//======================================================================
void
art::TimeTracker::postEndJob()
{
  timeEventTable_.flush();
  timeModuleTable_.flush();

  auto const evtStats =
    (timeEventTable_.lastRowid() == 0 ) ? Statistics{} : Statistics{"Full event", dbMgr_, "TimeEvent", "Time"};
  auto const& modules = sqlite::getUniqueEntries<std::string>(dbMgr_, "TimeModule", "PathModuleId", false);

  std::vector<Statistics> modStats;
  for (auto const& mod : modules) {
    std::string const ddl =
      "CREATE TABLE temp.tmpModTable AS "s +
      "SELECT * FROM TimeModule WHERE PathModuleId='"s+mod+"'"s;
    sqlite::exec(dbMgr_, ddl);
    modStats.emplace_back(mod, dbMgr_, "temp.tmpModTable", "Time");
    sqlite::dropTable(dbMgr_, "temp.tmpModTable");
  }

  if (dbMgr_.logToDb())
    logToDatabase_(evtStats, modStats);
  if (printSummary_)
    logToDestination_(evtStats, modStats);
}

//======================================================================
void
art::TimeTracker::preEventProcessing(Event const& ev)
{
  eventId_ = ev.id();
  eventStart_ = now();
}

void
art::TimeTracker::postEventProcessing(Event const&)
{
  double const t = (now()-eventStart_).seconds();
  timeEventTable_.insert(eventId_.run(),
                         eventId_.subRun(),
                         eventId_.event(),
                         t);
}

//======================================================================
void
art::TimeTracker::preModule(ModuleDescription const&)
{
  moduleStart_ = now();
}

void
art::TimeTracker::postModule(ModuleDescription const& desc)
{
  double const t = (now()-moduleStart_).seconds();
  timeModuleTable_.insert(eventId_.run(),
                          eventId_.subRun(),
                          eventId_.event(),
                          pathname_+":"s+desc.moduleLabel()+":"s+desc.moduleName(),
                          t);
}

//======================================================================
void
art::TimeTracker::logToDatabase_(Statistics const& evt,
                                 std::vector<Statistics> const& modules)
{
  if (evt.n == 0u) return;
  timeReportTable_.insert(evt.label,
                          evt.min,
                          evt.mean,
                          evt.max,
                          evt.median,
                          evt.rms,
                          evt.n);
  for (auto const& mod: modules) {
    timeReportTable_.insert(mod.label,
                            mod.min,
                            mod.mean,
                            mod.max,
                            mod.median,
                            mod.rms,
                            mod.n);
  }
}

void
art::TimeTracker::logToDestination_(Statistics const& evt [[gnu::unused]],
                                    std::vector<Statistics> const& modules)
{
  std::size_t width {30};
  cet::for_all(modules, [&width](auto const& mod) { width = std::max(width, mod.label.size()); });

  std::ostringstream msgOss;
  msgOss << std::string(width+4+5*14+12,'=') << "\n";
  msgOss << std::setw(width+2) << std::left << "TimeTracker printout (sec)"
         << boost::format(" %=12s ") % "Min"
         << boost::format(" %=12s ") % "Avg"
         << boost::format(" %=12s ") % "Max"
         << boost::format(" %=12s ") % "Median"
         << boost::format(" %=12s ") % "RMS"
         << boost::format(" %=10s ") % "nEvts" << "\n";

  msgOss << std::string(width+4+5*14+12,'=') << "\n";

  if (evt.n == 0u) {
    msgOss << "[ No processed events ]\n";
  }
  else {
    // N.B. setw(width) applies to the first field in
    //      ostream& art::operator<<(ostream&, Statistics const&).
    msgOss << setw(width) << evt << '\n';
    msgOss << std::string(width+4+5*14+12,'-') << "\n";
    if (modules.empty())
      msgOss << "[ No configured modules ]\n";
    for (auto const& mod : modules) {
      msgOss << setw(width) << mod << '\n';
    }
  }

  msgOss << std::string(width+4+5*14+12,'=') << "\n";
  mf::LogAbsolute("TimeTracker") << msgOss.str();
}

DEFINE_ART_SERVICE(art::TimeTracker)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revta Biol. trop. 48(2/3): 541 (2000)

#### Original name
Sirobasidium minutum Kisim.-Hor., Oberw. & L.D. Gómez

### Remarks
null


text:
const gulp = require('gulp');
const $ = require('gulp-load-plugins')();
const log = require('fancy-log');
const autoprefixer = require('autoprefixer');
const browserSync = require('browser-sync').create();
const config = {
  'src': '',
  'dest': 'dist/',
  'minify': true
};

// HTML
function html() {
  return gulp.src(config.src + '*.html')
    .pipe(browserSync.stream());
}

// Compile and autoprefix stylesheets
function styles() {
  return gulp.src(config.src + 'scss/*.scss')
    .pipe($.sass({
      precision: 8,
      outputStyle: 'expanded'
    }).on('error', $.sass.logError))
    .pipe($.postcss([
      autoprefixer()
    ]))
    .pipe(gulp.dest(config.dest + 'css'))
    .pipe(browserSync.stream())
    .pipe($.if(config.minify, $.cleanCss()))
    .pipe($.if(config.minify, $.rename({suffix: '.min'})))
    .pipe($.if(config.minify, gulp.dest(config.dest + 'css')))
    .pipe(browserSync.stream());
}

// Lint stylesheets
function stylelint() {
  return gulp.src(config.src + 'scss/**/*.scss')
    .pipe($.postcss([
      require('stylelint')({fix: true})
    ], {
      syntax: require('postcss-scss')
    }))
    .pipe(gulp.dest(config.src + 'scss'));
}

// Compile javascript
function scripts() {
  return gulp.src(config.src + 'js/*.js')
    .pipe(gulp.dest(config.dest + 'js'))
    .pipe(browserSync.stream())
    .pipe($.if(config.minify, $.uglify({output: {comments: /^!/i}}).on('error', function(error) {
      log.error(error.message);
      this.emit('end');
    })))
    .pipe($.if(config.minify, $.rename({suffix: '.min'})))
    .pipe($.if(config.minify, gulp.dest(config.dest + 'js')))
    .pipe(browserSync.stream());
}

// Lint javascript
function eslint() {
  return gulp.src(config.src + 'js/**/*.js')
    .pipe($.eslint({fix: true}))
    .pipe($.eslint.format())
    .pipe(gulp.dest(config.src + 'js'));
}

// Serve compiled files
function serve(done) {
  browserSync.init({
    server: true,
    notify: false,
    snippetOptions: {
      rule: {
        match: /<\/body>/i
      }
    }
    /*
    proxy: 'example.com',
    files: config.dest,
    serveStatic: [{
      route: '', // remote path
      dir: config.dest // local path
    }],
    */
  });
  done();
}

// Watch files for changes
function watch(done) {
  gulp.watch(config.src + '*.html', html);
  gulp.watch(config.src + 'scss/**/*.scss', styles);
  gulp.watch(config.src + 'js/**/*.js', scripts);
  done();
}

const build = gulp.parallel(html, styles, scripts);

gulp.task('build', build);
gulp.task('watch', watch);
gulp.task('lint', gulp.parallel(stylelint, eslint));
gulp.task('default', gulp.series(build, gulp.parallel(serve, watch)));


text:
layout: archive
permalink: 'tags/fun/'
redirect_from: 'archive/tags/fun/'
title: 'fun'
tag: 'fun'
---


text:
<?php
if ( ! class_exists( 'Tribe__Container' ) ) {
	/**
	 * Class Tribe__Container
	 *
	 * Tribe Dependency Injection Container.
	 */
	class Tribe__Container extends tad_DI52_Container {

		/**
		 * @var Tribe__Container
		 */
		protected static $instance;

		/**
		 * @return Tribe__Container
		 */
		public static function init() {
			if ( empty( self::$instance ) ) {
				self::$instance = new self();
			}

			return self::$instance;
		}
	}
}

if ( ! function_exists( 'tribe_singleton' ) ) {
	/**
	 * Registers a class as a singleton.
	 *
	 * Each call to obtain an instance of this class made using the `tribe( $slug )` function
	 * will return the same instance; the instances are built just in time (if not passing an
	 * object instance or callback function) and on the first request.
	 * The container will call the class `__construct` method on the class (if not passing an object
	 * or a callback function) and will try to automagically resolve dependencies.
	 *
	 * Example use:
	 *
	 *      tribe_singleton( 'tec.admin.class', 'Tribe__Admin__Class' );
	 *
	 *      // some code later...
	 *
	 *      // class is built here
	 *      tribe( 'tec.admin.class' )->doSomething();
	 *
	 * Need the class built immediately? Build it and register it:
	 *
	 *      tribe_singleton( 'tec.admin.class', new Tribe__Admin__Class() );
	 *
	 *      // some code later...
	 *
	 *      tribe( 'tec.admin.class' )->doSomething();
	 *
	 * Need a very custom way to build the class? Register a callback:
	 *
	 *      tribe_singleton( 'tec.admin.class', array( Tribe__Admin__Class__Factory, 'make' ) );
	 *
	 *      // some code later...
	 *
	 *      tribe( 'tec.admin.class' )->doSomething();
	 *
	 * Or register the methods that should be called on the object after its construction:
	 *
	 *      tribe_singleton( 'tec.admin.class', 'Tribe__Admin__Class', array( 'hook', 'register' ) );
	 *
	 *      // some code later...
	 *
	 *      // the `hook` and `register` methods will be called on the built instance.
	 *      tribe( 'tec.admin.class' )->doSomething();
	 *
	 * The class will be built only once (if passing the class name or a callback function), stored
	 * and the same instance will be returned from that moment on.
	 *
	 * @param string                 $slug                The human-readable and catchy name of the class.
	 * @param string|object|callable $class               The full class name or an instance of the class
	 *                                                    or a callback that will return the instance of the class.
	 * @param array                  $after_build_methods An array of methods that should be called on
	 *                                                    the built object after the `__construct` method; the methods
	 *                                                    will be called only once after the singleton instance
	 *                                                    construction.
	 */
	function tribe_singleton( $slug, $class, array $after_build_methods = null ) {
		Tribe__Container::init()->singleton( $slug, $class, $after_build_methods );
	}
}

if ( ! function_exists( 'tribe_register' ) ) {
	/**
	 * Registers a class.
	 *
	 * Each call to obtain an instance of this class made using the `tribe( $slug )` function
	 * will return a new instance; the instances are built just in time (if not passing an
	 * object instance, in that case it will work as a singleton) and on the first request.
	 * The container will call the class `__construct` method on the class (if not passing an object
	 * or a callback function) and will try to automagically resolve dependencies.
	 *
	 * Example use:
	 *
	 *      tribe_register( 'tec.some', 'Tribe__Some' );
	 *
	 *      // some code later...
	 *
	 *      // class is built here
	 *      $some_one = tribe( 'tec.some' )->doSomething();
	 *
	 *      // $some_two !== $some_one
	 *      $some_two = tribe( 'tec.some' )->doSomething();
	 *
	 * Need the class built immediately? Build it and register it:
	 *
	 *      tribe_register( 'tec.admin.class', new Tribe__Admin__Class() );
	 *
	 *      // some code later...
	 *
	 *      // $some_two === $some_one
	 *      // acts like a singleton
	 *      $some_one = tribe( 'tec.some' )->doSomething();
	 *      $some_two = tribe( 'tec.some' )->doSomething();
	 *
	 * Need a very custom way to build the class? Register a callback:
	 *
	 *      tribe_register( 'tec.some', array( Tribe__Some__Factory, 'make' ) );
	 *
	 *      // some code later...
	 *
	 *      // $some_two !== $some_one
	 *      $some_one = tribe( 'tec.some' )->doSomething();
	 *      $some_two = tribe( 'tec.some' )->doSomething();
	 *
	 * Or register the methods that should be called on the object after its construction:
	 *
	 *      tribe_singleton( 'tec.admin.class', 'Tribe__Admin__Class', array( 'hook', 'register' ) );
	 *
	 *      // some code later...
	 *
	 *      // the `hook` and `register` methods will be called on the built instance.
	 *      tribe( 'tec.admin.class' )->doSomething();
	 *
	 * @param string                 $slug                The human-readable and catchy name of the class.
	 * @param string|object|callable $class               The full class name or an instance of the class
	 *                                                    or a callback that will return the instance of the class.
	 * @param array                  $after_build_methods An array of methods that should be called on
	 *                                                    the built object after the `__construct` method; the methods
	 *                                                    will be called each time after the instance contstruction.
	 */
	function tribe_register( $slug, $class, array $after_build_methods = null ) {
		Tribe__Container::init()->bind( $slug, $class, $after_build_methods );
	}
}

if ( ! function_exists( 'tribe' ) ) {
	/**
	 * Returns a ready to use instance of the requested class.
	 *
	 * Example use:
	 *
	 *      tribe_singleton( 'common.main', 'Tribe__Main');
	 *
	 *      // some code later...
	 *
	 *      tribe( 'common.main' )->do_something();
	 *
	 * @param string|null $slug_or_class Either the slug of a binding previously registered using `tribe_singleton` or
	 *                                   `tribe_register` or the full class name that should be automagically created or
	 *                                   `null` to get the container instance itself.
	 *
	 * @return mixed|object|Tribe__Container The instance of the requested class. Please note that the cardinality of
	 *                                       the class is controlled registering it as a singleton using `tribe_singleton`
	 *                                       or `tribe_register`; if the `$slug_or_class` parameter is null then the
	 *                                       container itself will be returned.
	 */
	function tribe( $slug_or_class = null ) {
		$container = Tribe__Container::init();

		return null === $slug_or_class ? $container : $container->make( $slug_or_class );
	}
}

if ( ! function_exists( 'tribe_set_var' ) ) {
	/**
	 * Registers a value under a slug in the container.
	 *
	 * Example use:
	 *
	 *      tribe_set_var( 'tec.url', 'http://example.com' );
	 *
	 * @param string $slug  The human-readable and catchy name of the var.
	 * @param mixed  $value The variable value.
	 */
	function tribe_set_var( $slug, $value ) {
		$container = Tribe__Container::init();
		$container->setVar( $slug, $value );
	}
}

if ( ! function_exists( 'tribe_get_var' ) ) {
	/**
	 * Returns the value of a registered variable.
	 *
	 * Example use:
	 *
	 *      tribe_set_var( 'tec.url', 'http://example.com' );
	 *
	 *      $url = tribe_get_var( 'tec.url' );
	 *
	 * @param string $slug    The slug of the variable registered using `tribe_set_var`.
	 * @param null   $default The value that should be returned if the variable slug
	 *                        is not a registered one.
	 *
	 * @return mixed Either the registered value or the default value if the variable
	 *               is not registered.
	 */
	function tribe_get_var( $slug, $default = null ) {
		$container = Tribe__Container::init();

		try {
			$var = $container->getVar( $slug );
		} catch ( InvalidArgumentException $e ) {
			return $default;
		}

		return $var;
	}
}

if ( ! function_exists( 'tribe_register_provider' ) ) {
	/**
	 * Registers a service provider in the container.
	 *
	 * Service providers must implement the `tad_DI52_ServiceProviderInterface` interface or extend
	 * the `tad_DI52_ServiceProvider` class.
	 *
	 * @see tad_DI52_ServiceProvider
	 * @see tad_DI52_ServiceProviderInterface
	 *
	 * @param string $provider_class
	 */
	function tribe_register_provider( $provider_class ) {
		$container = Tribe__Container::init();

		$container->register( $provider_class );
	}

	if ( ! function_exists( 'tribe_callback' ) ) {
		/**
		 * Returns a lambda function suitable to use as a callback; when called the function will build the implementation
		 * bound to `$classOrInterface` and return the value of a call to `$method` method with the call arguments.
		 *
		 * @since  4.7
		 * @since  4.6.2  Included the $argsN params
		 *
		 * @param  string $slug       A class or interface fully qualified name or a string slug.
		 * @param  string $method     The method that should be called on the resolved implementation with the
		 *                            specified array arguments.
		 * @param  mixed  [$argsN]      (optional) Any number of arguments that will be passed down to the Callback
		 *
		 * @return callable A PHP Callable based on the Slug and Methods passed
		 */
		function tribe_callback( $slug, $method ) {
			$container = Tribe__Container::init();
			$arguments = func_get_args();
			$is_empty = 2 === count( $arguments );

			if ( $is_empty ) {
				$callable = $container->callback( $slug, $method );
			} else {
				$callback = $container->callback( 'callback', 'get' );
				$callable = call_user_func_array( $callback, $arguments );
			}

			return $callable;
		}
	}

	if ( ! function_exists( 'tribe_callback_return' ) ) {
		/**
		 * Returns a tribe_callback for a very simple Return value method
		 *
		 * Example of Usage:
		 *
		 *      add_filter( 'admin_title', tribe_callback_return( __( 'Ready to work.' ) ) );
		 *
		 * @since  4.6.2
		 *
		 * @param  mixed    $value  The value to be returned
		 *
		 * @return callable A PHP Callable based on the Slug and Methods passed
		 */
		function tribe_callback_return( $value ) {
			return tribe_callback( 'callback', 'return_value', $value );
		}
	}
}


text:
package sgdi.pr3.grupo03.situacion1.menus.season;

import org.bson.types.ObjectId;

import sgdi.pr3.grupo03.shared.ConsoleUtil;
import sgdi.pr3.grupo03.shared.CustomReferenceFieldInput;
import sgdi.pr3.grupo03.shared.ReferenceFieldType;
import sgdi.pr3.grupo03.situacion1.DBHelper;
import sgdi.pr3.grupo03.situacion1.menus.Menu;
import sgdi.pr3.grupo03.situacion1.menus.control.ChooseAction;
import sgdi.pr3.grupo03.situacion1.menus.control.MainMenu;
import sgdi.pr3.grupo03.situacion1.model.Season;
import sgdi.pr3.grupo03.situacion1.model.Series;

public class InsertSeason extends Menu<Void> {

	@Override
	public Void draw() {
		try {
			Season season = ConsoleUtil.getObject(Season.class,
					new CustomReferenceFieldInput() {

						@Override
						public ObjectId getReference(
								ReferenceFieldType refFieldType, String offset) {
							System.out
									.println(offset
											+ "Inserta el nombre de la serie en la que estará la temporada.");
							String seriesTitle = ConsoleUtil.getString();
							Series serie = DBHelper
									.getOneSeriesByTitle(seriesTitle);
							if (serie == null) {
								System.out
										.println(offset
												+ "No se ha encontrado ninguna serie con el título: "
												+ seriesTitle);
								return null;

							}
							return serie._id;
						}
					});
			if (season.seriesIdRef == null || !DBHelper.insertSeason(season)) {
				System.out
						.println("La temporada no se ha añadido correctamente.");
				controller.setMenu(ChooseAction.class, Season.class);
				return null;
			} else {
				System.out.println("La temporada se ha añadido correctamente.");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		controller.setMenu(MainMenu.class);
		return null;
	}

	@Override
	public void input(Void option) {
	}

}


text:
//-----------------------------------------------------------------------------
// Copyright 2016-2018, Oracle and/or its affiliates. All rights reserved.
//
// Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved.
//
// Portions Copyright 2001-2007, Computronix (Canada) Ltd., Edmonton, Alberta,
// Canada. All rights reserved.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// cxoVar.c
//   Defines Python types for Oracle variables.
//-----------------------------------------------------------------------------

#include "cxoModule.h"

//-----------------------------------------------------------------------------
// Declaration of common variable functions.
//-----------------------------------------------------------------------------
static void cxoVar_free(cxoVar*);
static PyObject *cxoVar_repr(cxoVar*);
static PyObject *cxoVar_externalCopy(cxoVar*, PyObject*);
static PyObject *cxoVar_externalSetValue(cxoVar*, PyObject*);
static PyObject *cxoVar_externalGetValue(cxoVar*, PyObject*, PyObject*);
static PyObject *cxoVar_externalGetActualElements(cxoVar*, void*);
static PyObject *cxoVar_externalGetValues(cxoVar*, void*);

//-----------------------------------------------------------------------------
// declaration of members for variables
//-----------------------------------------------------------------------------
static PyMemberDef cxoVarMembers[] = {
    { "bufferSize", T_INT, offsetof(cxoVar, bufferSize), READONLY },
    { "inconverter", T_OBJECT, offsetof(cxoVar, inConverter), 0 },
    { "numElements", T_INT, offsetof(cxoVar, allocatedElements),
            READONLY },
    { "outconverter", T_OBJECT, offsetof(cxoVar, outConverter), 0 },
    { "size", T_INT, offsetof(cxoVar, size), READONLY },
    { "type", T_OBJECT, offsetof(cxoVar, objectType), READONLY },
    { NULL }
};

//-----------------------------------------------------------------------------
// declaration of calculated members for variables
//-----------------------------------------------------------------------------
static PyGetSetDef cxoVarCalcMembers[] = {
    { "actualElements", (getter) cxoVar_externalGetActualElements, 0, 0, 0 },
    { "values", (getter) cxoVar_externalGetValues, 0, 0, 0 },
    { NULL }
};

//-----------------------------------------------------------------------------
// declaration of methods for variables
//-----------------------------------------------------------------------------
static PyMethodDef cxoVarMethods[] = {
    { "copy", (PyCFunction) cxoVar_externalCopy, METH_VARARGS },
    { "setvalue", (PyCFunction) cxoVar_externalSetValue, METH_VARARGS },
    { "getvalue", (PyCFunction) cxoVar_externalGetValue,
              METH_VARARGS  | METH_KEYWORDS },
    { NULL }
};

//-----------------------------------------------------------------------------
// declaration of all variable types
//-----------------------------------------------------------------------------
#define DECLARE_VARIABLE_TYPE(INTERNAL_NAME, EXTERNAL_NAME) \
    PyTypeObject INTERNAL_NAME = { \
        PyVarObject_HEAD_INIT(NULL, 0) \
        "cx_Oracle." #EXTERNAL_NAME,        /* tp_name */ \
        sizeof(cxoVar),                     /* tp_basicsize */ \
        0,                                  /* tp_itemsize */ \
        (destructor) cxoVar_free,           /* tp_dealloc */ \
        0,                                  /* tp_print */ \
        0,                                  /* tp_getattr */ \
        0,                                  /* tp_setattr */ \
        0,                                  /* tp_compare */ \
        (reprfunc) cxoVar_repr,             /* tp_repr */ \
        0,                                  /* tp_as_number */ \
        0,                                  /* tp_as_sequence */ \
        0,                                  /* tp_as_mapping */ \
        0,                                  /* tp_hash */ \
        0,                                  /* tp_call */ \
        0,                                  /* tp_str */ \
        0,                                  /* tp_getattro */ \
        0,                                  /* tp_setattro */ \
        0,                                  /* tp_as_buffer */ \
        Py_TPFLAGS_DEFAULT,                 /* tp_flags */ \
        0,                                  /* tp_doc */ \
        0,                                  /* tp_traverse */ \
        0,                                  /* tp_clear */ \
        0,                                  /* tp_richcompare */ \
        0,                                  /* tp_weaklistoffset */ \
        0,                                  /* tp_iter */ \
        0,                                  /* tp_iternext */ \
        cxoVarMethods,                      /* tp_methods */ \
        cxoVarMembers,                      /* tp_members */ \
        cxoVarCalcMembers                   /* tp_getset */ \
    };

DECLARE_VARIABLE_TYPE(cxoPyTypeBfileVar, BFILE)
DECLARE_VARIABLE_TYPE(cxoPyTypeBinaryVar, BINARY)
DECLARE_VARIABLE_TYPE(cxoPyTypeBlobVar, BLOB)
DECLARE_VARIABLE_TYPE(cxoPyTypeBooleanVar, BOOLEAN)
DECLARE_VARIABLE_TYPE(cxoPyTypeClobVar, CLOB)
DECLARE_VARIABLE_TYPE(cxoPyTypeCursorVar, CURSOR)
DECLARE_VARIABLE_TYPE(cxoPyTypeDateTimeVar, DATETIME)
DECLARE_VARIABLE_TYPE(cxoPyTypeFixedCharVar, FIXED_CHAR)
DECLARE_VARIABLE_TYPE(cxoPyTypeFixedNcharVar, FIXED_NCHAR)
DECLARE_VARIABLE_TYPE(cxoPyTypeIntervalVar, INTERVAL)
DECLARE_VARIABLE_TYPE(cxoPyTypeLongBinaryVar, LONG_BINARY)
DECLARE_VARIABLE_TYPE(cxoPyTypeLongStringVar, LONG_STRING)
DECLARE_VARIABLE_TYPE(cxoPyTypeNativeFloatVar, NATIVE_FLOAT)
DECLARE_VARIABLE_TYPE(cxoPyTypeNativeIntVar, NATIVE_INT)
DECLARE_VARIABLE_TYPE(cxoPyTypeNcharVar, NCHAR)
DECLARE_VARIABLE_TYPE(cxoPyTypeNclobVar, NCLOB)
DECLARE_VARIABLE_TYPE(cxoPyTypeNumberVar, NUMBER)
DECLARE_VARIABLE_TYPE(cxoPyTypeObjectVar, OBJECT)
DECLARE_VARIABLE_TYPE(cxoPyTypeRowidVar, ROWID)
DECLARE_VARIABLE_TYPE(cxoPyTypeStringVar, STRING)
DECLARE_VARIABLE_TYPE(cxoPyTypeTimestampVar, TIMESTAMP)

//-----------------------------------------------------------------------------
// cxoVar_new()
//   Allocate a new variable.
//-----------------------------------------------------------------------------
cxoVar *cxoVar_new(cxoCursor *cursor, Py_ssize_t numElements, cxoVarType *type,
        Py_ssize_t size, int isArray, cxoObjectType *objType)
{
    dpiObjectType *typeHandle = NULL;
    dpiOracleTypeNum oracleTypeNum;
    dpiNativeTypeNum nativeTypeNum;
    cxoVar *var;

    // attempt to allocate the object
    var = (cxoVar*) type->pythonType->tp_alloc(type->pythonType, 0);
    if (!var)
        return NULL;

    // perform basic initialization
    Py_INCREF(cursor->connection);
    var->connection = cursor->connection;
    if (objType) {
        Py_INCREF(objType);
        var->objectType = objType;
        typeHandle = objType->handle;
    }
    if (numElements == 0)
        numElements = 1;
    var->allocatedElements = (uint32_t) numElements;
    var->type = type;
    var->size = (size == 0) ? type->size : (uint32_t) size;
    var->isArray = isArray;

    // acquire and initialize DPI variable
    cxoTransform_getTypeInfo(type->transformNum, &oracleTypeNum,
            &nativeTypeNum);
    if (dpiConn_newVar(cursor->connection->handle, oracleTypeNum,
            nativeTypeNum, var->allocatedElements, var->size, 0, isArray,
            typeHandle, &var->handle, &var->data) < 0) {
        cxoError_raiseAndReturnNull();
        Py_DECREF(var);
        return NULL;
    }

    // get buffer size for information
    if (dpiVar_getSizeInBytes(var->handle, &var->bufferSize) < 0) {
        cxoError_raiseAndReturnNull();
        Py_DECREF(var);
        return NULL;
    }

    return var;
}

//-----------------------------------------------------------------------------
// cxoVar_free()
//   Free an existing variable.
//-----------------------------------------------------------------------------
static void cxoVar_free(cxoVar *var)
{
    if (var->handle) {
        Py_BEGIN_ALLOW_THREADS
        dpiVar_release(var->handle);
        Py_END_ALLOW_THREADS
        var->handle = NULL;
    }
    if (var->encodingErrors)
        PyMem_Free((void*) var->encodingErrors);
    Py_CLEAR(var->connection);
    Py_CLEAR(var->inConverter);
    Py_CLEAR(var->outConverter);
    Py_CLEAR(var->objectType);
    Py_TYPE(var)->tp_free((PyObject*) var);
}

//-----------------------------------------------------------------------------
// cxoVar_check()
//   Returns a boolean indicating if the object is a variable.
//-----------------------------------------------------------------------------
int cxoVar_check(PyObject *object)
{
    PyTypeObject *objectType = Py_TYPE(object);

    return (objectType == &cxoPyTypeBfileVar ||
            objectType == &cxoPyTypeBinaryVar ||
            objectType == &cxoPyTypeBlobVar ||
            objectType == &cxoPyTypeBooleanVar ||
            objectType == &cxoPyTypeClobVar ||
            objectType == &cxoPyTypeCursorVar ||
            objectType == &cxoPyTypeDateTimeVar ||
            objectType == &cxoPyTypeFixedCharVar ||
            objectType == &cxoPyTypeFixedNcharVar ||
            objectType == &cxoPyTypeIntervalVar ||
            objectType == &cxoPyTypeLongBinaryVar ||
            objectType == &cxoPyTypeLongStringVar ||
            objectType == &cxoPyTypeNativeFloatVar ||
            objectType == &cxoPyTypeNativeIntVar ||
            objectType == &cxoPyTypeNcharVar ||
            objectType == &cxoPyTypeNclobVar ||
            objectType == &cxoPyTypeNumberVar ||
            objectType == &cxoPyTypeObjectVar ||
            objectType == &cxoPyTypeRowidVar ||
            objectType == &cxoPyTypeStringVar ||
            objectType == &cxoPyTypeTimestampVar);
}

//-----------------------------------------------------------------------------
// cxoVar_newByValue()
//   Allocate a new variable by looking at the type of the data.
//-----------------------------------------------------------------------------
cxoVar *cxoVar_newByValue(cxoCursor *cursor, PyObject *value,
        Py_ssize_t numElements)
{
    PyObject *result, *inputTypeHandler = NULL;
    cxoObjectType *objType = NULL;
    cxoVarType *varType;
    Py_ssize_t size;
    cxoObject *obj;
    int isArray;

    // determine if an input type handler should be used; an input type handler
    // defined on the cursor takes precedence over one defined on the
    // connection to which the cursor belongs; the input type handler should
    // return a variable or None; the value None implies that the default
    // processing should take place just as if no input type handler was
    // defined
    if (cursor->inputTypeHandler && cursor->inputTypeHandler != Py_None)
        inputTypeHandler = cursor->inputTypeHandler;
    else if (cursor->connection->inputTypeHandler &&
            cursor->connection->inputTypeHandler != Py_None)
        inputTypeHandler = cursor->connection->inputTypeHandler;
    if (inputTypeHandler) {
        result = PyObject_CallFunction(inputTypeHandler, "OOn", cursor, value,
                numElements);
        if (!result)
            return NULL;
        if (result != Py_None) {
            if (!cxoVar_check(result)) {
                Py_DECREF(result);
                PyErr_SetString(PyExc_TypeError,
                        "expecting variable from input type handler");
                return NULL;
            }
            return (cxoVar*) result;
        }
        Py_DECREF(result);
    }

    // default processing
    varType = cxoVarType_fromPythonValue(value,
            &isArray, &size, &numElements, cursor->stmtInfo.isPLSQL);
    if (!varType)
        return NULL;
    if (varType->transformNum == CXO_TRANSFORM_OBJECT) {
        obj = (cxoObject*) value;
        objType = obj->objectType;
    }
    return cxoVar_new(cursor, numElements, varType, size, isArray, objType);
}

//-----------------------------------------------------------------------------
// cxoVar_newArrayByType()
//   Allocate a new PL/SQL array by looking at the Python data type.
//-----------------------------------------------------------------------------
static cxoVar *cxoVar_newArrayByType(cxoCursor *cursor,
        PyObject *value)
{
    PyObject *typeObj, *numElementsObj;
    cxoVarType *varType;
    uint32_t numElements;
    int ok;

    // validate parameters
    ok = (PyList_GET_SIZE(value) == 2);
    if (ok) {
        typeObj = PyList_GET_ITEM(value, 0);
        ok = PyType_Check(typeObj);
    }
    if (ok) {
        numElementsObj = PyList_GET_ITEM(value, 1);
        ok = PyInt_Check(numElementsObj);
    }
    if (!ok) {
        cxoError_raiseFromString(cxoProgrammingErrorException,
                "expecting an array of two elements [type, numelems]");
        return NULL;
    }

    // create variable
    varType = cxoVarType_fromPythonType((PyTypeObject*) typeObj);
    if (!varType)
        return NULL;
    numElements = PyInt_AsLong(numElementsObj);
    if (PyErr_Occurred())
        return NULL;
    return cxoVar_new(cursor, numElements, varType, varType->size, 1, NULL);
}

//-----------------------------------------------------------------------------
// cxoVar_newByType()
//   Allocate a new variable by looking at the Python data type.
//-----------------------------------------------------------------------------
cxoVar *cxoVar_newByType(cxoCursor *cursor, PyObject *value,
        uint32_t numElements)
{
    cxoVarType *varType;
    long size;

    // passing an integer is assumed to be a string
    if (PyInt_Check(value)) {
        size = PyInt_AsLong(value);
        if (PyErr_Occurred())
            return NULL;
        varType = cxoVarType_fromPythonType(&cxoPyTypeString);
        return cxoVar_new(cursor, numElements, varType, size, 0, NULL);
    }

    // passing an array of two elements to define an array
    if (PyList_Check(value))
        return cxoVar_newArrayByType(cursor, value);

    // handle directly bound variables
    if (cxoVar_check(value)) {
        Py_INCREF(value);
        return (cxoVar*) value;
    }

    // everything else ought to be a Python type
    if (PyType_Check(value)) {
        varType = cxoVarType_fromPythonType((PyTypeObject*) value);
        if (!varType)
            return NULL;
        return cxoVar_new(cursor, numElements, varType, varType->size, 0,
                NULL);
    }

    PyErr_SetString(PyExc_TypeError, "expecting type");
    return NULL;
}

//-----------------------------------------------------------------------------
// cxoVar_bind()
//   Allocate a variable and bind it to the given statement.
//-----------------------------------------------------------------------------
int cxoVar_bind(cxoVar *var, cxoCursor *cursor, PyObject *name, uint32_t pos)
{
    cxoBuffer nameBuffer;
    int status;

    // perform the bind
    if (name) {
        if (cxoBuffer_fromObject(&nameBuffer, name,
                cursor->connection->encodingInfo.encoding) < 0)
            return -1;
        status = dpiStmt_bindByName(cursor->handle, (char*) nameBuffer.ptr,
                nameBuffer.size, var->handle);
        cxoBuffer_clear(&nameBuffer);
    } else {
        status = dpiStmt_bindByPos(cursor->handle, pos, var->handle);
    }
    if (status < 0)
        return cxoError_raiseAndReturnInt();

    // set flag if bound to a DML returning statement and no data set
    if (cursor->stmtInfo.isReturning && !var->isValueSet)
        var->getReturnedData = 1;

    return 0;
}

//-----------------------------------------------------------------------------
// cxoVar_getArrayValue()
//   Return the value of the variable as an array.
//-----------------------------------------------------------------------------
static PyObject *cxoVar_getArrayValue(cxoVar *var, uint32_t numElements,
        dpiData *data)
{
    PyObject *value, *singleValue;
    uint32_t i;

    // use the first set of returned values if DML returning as array is not
    // enabled
    if (!(cxoFutureObj && cxoFutureObj->dmlReturningArray) &&
            var->getReturnedData && !data) {
        if (dpiVar_getReturnedData(var->handle, 0, &numElements, &data) < 0)
            return cxoError_raiseAndReturnNull();
    }

    value = PyList_New(numElements);
    if (!value)
        return NULL;

    for (i = 0; i < numElements; i++) {
        singleValue = cxoVar_getSingleValue(var, data, i);
        if (!singleValue) {
            Py_DECREF(value);
            return NULL;
        }
        PyList_SET_ITEM(value, i, singleValue);
    }

    return value;
}

//-----------------------------------------------------------------------------
// cxoVar_getSingleValue()
//   Return the value of the variable at the given position.
//-----------------------------------------------------------------------------
PyObject *cxoVar_getSingleValue(cxoVar *var, dpiData *data, uint32_t arrayPos)
{
    PyObject *value, *result;
    uint32_t numReturnedRows;
    dpiData *returnedData;

    // handle DML returning
    if (!data && var->getReturnedData) {
        if (cxoFutureObj && cxoFutureObj->dmlReturningArray) {
            if (dpiVar_getReturnedData(var->handle, arrayPos, &numReturnedRows,
                    &returnedData) < 0)
                return cxoError_raiseAndReturnNull();
            return cxoVar_getArrayValue(var, numReturnedRows, returnedData);
        }
        if (dpiVar_getReturnedData(var->handle, 0, &numReturnedRows,
                &data) < 0)
            return cxoError_raiseAndReturnNull();
        if (arrayPos >= var->allocatedElements &&
                arrayPos >= numReturnedRows) {
            PyErr_SetString(PyExc_IndexError,
                    "cxoVar_getSingleValue: array size exceeded");
            return NULL;
        }
        if (arrayPos >= numReturnedRows)
            data = var->data;
    }

    // in all other cases, just get the value stored at specified position
    if (data)
        data = &data[arrayPos];
    else data = &var->data[arrayPos];
    if (data->isNull)
        Py_RETURN_NONE;
    value = cxoTransform_toPython(var->type->transformNum, var->connection,
            var->objectType, &data->value, var->encodingErrors);
    if (value) {
        switch (var->type->transformNum) {
            case CXO_TRANSFORM_BFILE:
            case CXO_TRANSFORM_BLOB:
            case CXO_TRANSFORM_CLOB:
            case CXO_TRANSFORM_NCLOB:
                dpiLob_addRef(data->value.asLOB);
                break;
            case CXO_TRANSFORM_OBJECT:
                dpiObject_addRef(data->value.asObject);
                break;
            default:
                break;
        }
        if (var->outConverter && var->outConverter != Py_None) {
            result = PyObject_CallFunctionObjArgs(var->outConverter, value,
                    NULL);
            Py_DECREF(value);
            return result;
        }
    }

    return value;
}

//-----------------------------------------------------------------------------
// cxoVar_getValue()
//   Return the value of the variable.
//-----------------------------------------------------------------------------
PyObject *cxoVar_getValue(cxoVar *var, uint32_t arrayPos)
{
    uint32_t numElements;

    if (var->isArray) {
        if (dpiVar_getNumElementsInArray(var->handle, &numElements) < 0)
            return cxoError_raiseAndReturnNull();
        return cxoVar_getArrayValue(var, numElements, var->data);
    }
    if (arrayPos >= var->allocatedElements && !var->getReturnedData) {
        PyErr_SetString(PyExc_IndexError,
                "cxoVar_getSingleValue: array size exceeded");
        return NULL;
    }
    return cxoVar_getSingleValue(var, NULL, arrayPos);
}

//-----------------------------------------------------------------------------
// cxoVar_setValueBytes()
//   Set a value in the variable from a byte string of some sort.
//-----------------------------------------------------------------------------
static int cxoVar_setValueBytes(cxoVar *var, uint32_t pos, dpiData *data,
        cxoBuffer *buffer)
{
    dpiData *tempVarData, *sourceData;
    dpiOracleTypeNum oracleTypeNum;
    dpiNativeTypeNum nativeTypeNum;
    uint32_t i, numElements;
    dpiVar *tempVarHandle;
    int status;

    if (buffer->size > var->bufferSize) {
        cxoTransform_getTypeInfo(var->type->transformNum, &oracleTypeNum,
                &nativeTypeNum);
        if (dpiConn_newVar(var->connection->handle, oracleTypeNum,
                nativeTypeNum, var->allocatedElements, buffer->size, 0,
                var->isArray, NULL, &tempVarHandle, &tempVarData) < 0)
            return cxoError_raiseAndReturnInt();
        if (var->isArray) {
            if (dpiVar_getNumElementsInArray(var->handle, &numElements) < 0) {
                cxoError_raiseAndReturnInt();
                dpiVar_release(tempVarHandle);
                return -1;
            }
            if (dpiVar_setNumElementsInArray(tempVarHandle, numElements) < 0) {
                cxoError_raiseAndReturnInt();
                dpiVar_release(tempVarHandle);
                return -1;
            }
        }
        for (i = 0; i < var->allocatedElements; i++) {
            sourceData = &var->data[i];
            if (i == pos || sourceData->isNull)
                continue;
            if (dpiVar_setFromBytes(tempVarHandle, i,
                    sourceData->value.asBytes.ptr,
                    sourceData->value.asBytes.length) < 0) {
                cxoError_raiseAndReturnInt();
                dpiVar_release(tempVarHandle);
                return -1;
            }
        }
        dpiVar_release(var->handle);
        var->handle = tempVarHandle;
        var->data = tempVarData;
        var->size = buffer->numCharacters;
        var->bufferSize = buffer->size;
    }
    status = dpiVar_setFromBytes(var->handle, pos, buffer->ptr, buffer->size);
    if (status < 0)
        return cxoError_raiseAndReturnInt();
    return 0;
}

//-----------------------------------------------------------------------------
// cxoVar_setValueCursor()
//   Set the value of the variable (which is assumed to be a cursor).
//-----------------------------------------------------------------------------
static int cxoVar_setValueCursor(cxoVar *var, uint32_t pos, dpiData *data,
        PyObject *value)
{
    cxoCursor *cursor;
    dpiStmtInfo info;

    if (!PyObject_IsInstance(value, (PyObject*) &cxoPyTypeCursor)) {
        PyErr_SetString(PyExc_TypeError, "expecting cursor");
        return -1;
    }

    // if the cursor already has a handle, use it directly
    cursor = (cxoCursor *) value;
    if (cursor->handle) {
        if (dpiVar_setFromStmt(var->handle, pos, cursor->handle) < 0)
            return cxoError_raiseAndReturnInt();

    // otherwise, make use of the statement handle allocated by the variable
    // BUT, make sure the statement handle is still valid as it may have been
    // closed by some other code; the call to dpiStmt_getInfo() will ensure the
    // statement is still open; if an error occurs, this bind will be discarded
    // and a second attempt will be made with a new cursor
    } else {
        if (dpiStmt_getInfo(data->value.asStmt, &info) < 0)
            return cxoError_raiseAndReturnInt();
        cursor->handle = data->value.asStmt;
        dpiStmt_addRef(cursor->handle);
    }
    cursor->fixupRefCursor = 1;
    return 0;
}

//-----------------------------------------------------------------------------
// cxoVar_setSingleValue()
//   Set a single value in the variable.
//-----------------------------------------------------------------------------
static int cxoVar_setSingleValue(cxoVar *var, uint32_t arrayPos,
        PyObject *value)
{
    dpiDataBuffer tempDbValue, *dbValue;
    PyObject *convertedValue = NULL;
    cxoBuffer buffer;
    int result = 0;
    dpiData *data;

    // ensure we do not exceed the number of allocated elements
    if (arrayPos >= var->allocatedElements) {
        PyErr_SetString(PyExc_IndexError,
                "cxoVar_setSingleValue: array size exceeded");
        return -1;
    }

    // convert value, if necessary
    if (var->inConverter && var->inConverter != Py_None) {
        convertedValue = PyObject_CallFunctionObjArgs(var->inConverter, value,
                NULL);
        if (!convertedValue)
            return -1;
        value = convertedValue;
    }

    // tranform value from Python to value expected by ODPI-C
    data = &var->data[arrayPos];
    data->isNull = (value == Py_None);
    if (!data->isNull) {
        if (var->type->transformNum == CXO_TRANSFORM_CURSOR)
            result = cxoVar_setValueCursor(var, arrayPos, data, value);
        else {
            cxoBuffer_init(&buffer);
            if (var->type->size > 0)
                dbValue = &tempDbValue;
            else dbValue = &data->value;
            result = cxoTransform_fromPython(var->type->transformNum, value,
                    dbValue, &buffer, var->connection->encodingInfo.encoding,
                    var->connection->encodingInfo.nencoding, var, arrayPos);
            if (result == 0 && var->type->size > 0)
                result = cxoVar_setValueBytes(var, arrayPos, data, &buffer);
            cxoBuffer_clear(&buffer);
        }
    }
    Py_CLEAR(convertedValue);
    return result;
}

//-----------------------------------------------------------------------------
// cxoVar_setArrayValue()
//   Set all of the array values for the variable.
//-----------------------------------------------------------------------------
static int cxoVar_setArrayValue(cxoVar *var, PyObject *value)
{
    Py_ssize_t numElements, i;

    // ensure we have an array to set
    if (!PyList_Check(value)) {
        PyErr_SetString(PyExc_TypeError, "expecting array data");
        return -1;
    }

    // set the number of actual elements
    numElements = PyList_GET_SIZE(value);
    if (dpiVar_setNumElementsInArray(var->handle, (uint32_t) numElements) < 0)
        return cxoError_raiseAndReturnInt();

    // set all of the values
    for (i = 0; i < numElements; i++) {
        if (cxoVar_setSingleValue(var, i, PyList_GET_ITEM(value, i)) < 0)
            return -1;
    }

    return 0;
}

//-----------------------------------------------------------------------------
// cxoVar_setValue()
//   Set the value of the variable.
//-----------------------------------------------------------------------------
int cxoVar_setValue(cxoVar *var, uint32_t arrayPos, PyObject *value)
{
    var->isValueSet = 1;
    if (var->isArray) {
        if (arrayPos > 0) {
            cxoError_raiseFromString(cxoNotSupportedErrorException,
                    "arrays of arrays are not supported by the OCI");
            return -1;
        }
        return cxoVar_setArrayValue(var, value);
    }
    return cxoVar_setSingleValue(var, arrayPos, value);
}

//-----------------------------------------------------------------------------
// cxoVar_externalCopy()
//   Copy the contents of the source variable to the destination variable.
//-----------------------------------------------------------------------------
static PyObject *cxoVar_externalCopy(cxoVar *targetVar, PyObject *args)
{
    uint32_t sourcePos, targetPos;
    cxoVar *sourceVar;

    if (!PyArg_ParseTuple(args, "Oii", &sourceVar, &sourcePos, &targetPos))
        return NULL;
    if (Py_TYPE(targetVar) != Py_TYPE(sourceVar))
        return cxoError_raiseFromString(cxoProgrammingErrorException,
                "source and target variable type must match");
    if (dpiVar_copyData(targetVar->handle, targetPos, sourceVar->handle,
            sourcePos) < 0)
        return cxoError_raiseAndReturnNull();

    Py_RETURN_NONE;
}

//-----------------------------------------------------------------------------
// cxoVar_externalSetValue()
//   Set the value of the variable at the given position.
//-----------------------------------------------------------------------------
static PyObject *cxoVar_externalSetValue(cxoVar *var, PyObject *args)
{
    PyObject *value;
    uint32_t pos;

    if (!PyArg_ParseTuple(args, "iO", &pos, &value))
      return NULL;
    if (cxoVar_setValue(var, pos, value) < 0)
      return NULL;

    Py_RETURN_NONE;
}

//-----------------------------------------------------------------------------
// cxoVar_externalGetValue()
//   Return the value of the variable at the given position.
//-----------------------------------------------------------------------------
static PyObject *cxoVar_externalGetValue(cxoVar *var, PyObject *args,
        PyObject *keywordArgs)
{
    static char *keywordList[] = { "pos", NULL };
    uint32_t pos = 0;

    if (!PyArg_ParseTupleAndKeywords(args, keywordArgs, "|i", keywordList,
            &pos))
        return NULL;
    return cxoVar_getValue(var, pos);
}

//-----------------------------------------------------------------------------
// cxoVar_externalGetActualElements()
//   Return the values of the variable at all positions as a list.
//-----------------------------------------------------------------------------
static PyObject *cxoVar_externalGetActualElements(cxoVar *var,
        void *unused)
{
    uint32_t numElements = var->allocatedElements;

    if (var->isArray &&
            dpiVar_getNumElementsInArray(var->handle, &numElements) < 0)
        return cxoError_raiseAndReturnNull();
    return PyInt_FromLong(numElements);
}

//-----------------------------------------------------------------------------
// cxoVar_externalGetValues()
//   Return the values of the variable at all positions as a list.
//-----------------------------------------------------------------------------
static PyObject *cxoVar_externalGetValues(cxoVar *var, void *unused)
{
    uint32_t numElements = var->allocatedElements;

    if (var->isArray &&
            dpiVar_getNumElementsInArray(var->handle, &numElements) < 0)
        return cxoError_raiseAndReturnNull();
    return cxoVar_getArrayValue(var, numElements, NULL);
}

//-----------------------------------------------------------------------------
// cxoVar_repr()
//   Return a string representation of the variable.
//-----------------------------------------------------------------------------
static PyObject *cxoVar_repr(cxoVar *var)
{
    PyObject *value, *module, *name, *result;
    uint32_t numElements;

    if (var->isArray) {
        if (dpiVar_getNumElementsInArray(var->handle, &numElements) < 0)
            return cxoError_raiseAndReturnNull();
        value = cxoVar_getArrayValue(var, numElements, var->data);
    } else if (var->allocatedElements == 1)
        value = cxoVar_getSingleValue(var, NULL, 0);
    else value = cxoVar_getArrayValue(var, var->allocatedElements, NULL);
    if (!value)
        return NULL;
    if (cxoUtils_getModuleAndName(Py_TYPE(var), &module, &name) < 0) {
        Py_DECREF(value);
        return NULL;
    }
    result = cxoUtils_formatString("<%s.%s with value %r>",
            PyTuple_Pack(3, module, name, value));
    Py_DECREF(module);
    Py_DECREF(name);
    Py_DECREF(value);
    return result;
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: Matthew
 * Date: 21/04/2016
 * Time: 9:10 AM
 */

namespace Freshdesk\Resources\Traits;

/**
 * Update Trait
 *
 * @package Freshdesk\Resources\Traits
 */
trait UpdateTrait
{

    /**
     * @param integer $end string
     * @return string
     * @internal
     */
    abstract protected function endpoint($end = null);

    /**
     * @return \Freshdesk\Api
     * @internal
     */
    abstract protected function api();

    /**
     * Update a resource
     *
     * Updates the resources for the given $id with the supplied data/.
     *
     * @api
     * @param int $id The resource id
     * @param array $data The data
     * @return array|null
     * @throws \Freshdesk\Exceptions\AccessDeniedException
     * @throws \Freshdesk\Exceptions\ApiException
     * @throws \Freshdesk\Exceptions\AuthenticationException
     * @throws \Freshdesk\Exceptions\ConflictingStateException
     * @throws \Freshdesk\Exceptions\NotFoundException
     * @throws \Freshdesk\Exceptions\RateLimitExceededException
     * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException
     * @throws \Freshdesk\Exceptions\MethodNotAllowedException
     * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException
     * @throws \Freshdesk\Exceptions\ValidationException
     */
    public function update($id, array $data)
    {
        return $this->api()->request('PUT', $this->endpoint($id), $data);
    }
}


text:
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2  __attribute__((__ext_vector_type__(2)));
typedef float swift_float3  __attribute__((__ext_vector_type__(3)));
typedef float swift_float4  __attribute__((__ext_vector_type__(4)));
typedef double swift_double2  __attribute__((__ext_vector_type__(2)));
typedef double swift_double3  __attribute__((__ext_vector_type__(3)));
typedef double swift_double4  __attribute__((__ext_vector_type__(4)));
typedef int swift_int2  __attribute__((__ext_vector_type__(2)));
typedef int swift_int3  __attribute__((__ext_vector_type__(3)));
typedef int swift_int4  __attribute__((__ext_vector_type__(4)));
#endif

#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif

#if defined(__has_attribute) && __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
#else
# define SWIFT_RUNTIME_NAME(X)
#endif
#if defined(__has_attribute) && __has_attribute(swift_name)
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
#else
# define SWIFT_COMPILE_NAME(X)
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted)
#  define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
#  define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
#  define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
#  define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif

#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif

#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif

#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if defined(__has_attribute) && __has_attribute(objc_designated_initializer)
#  define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
#  define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM)
# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type
# if defined(__has_feature) && __has_feature(generalized_swift_name)
#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type
# else
#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name)
# endif
#endif
#if defined(__has_feature) && __has_feature(modules)
@import UIKit;
@import CoreGraphics;
@import Foundation;
#endif

#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
@class UIWindow;

SWIFT_CLASS("_TtC12MovingHelper11AppDelegate")
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, strong) UIWindow * _Nullable window;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

@class NSCoder;

/// A button subclass to make it simpler to display and update whether a Task is done or not.
SWIFT_CLASS("_TtC12MovingHelper8Checkbox")
@interface Checkbox : UIButton
@property (nonatomic) BOOL isChecked;
- (void)awakeFromNib;
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
@end

@class NSDate;
@class UITextField;
@class UILabel;
@class UIPickerView;
@class UITextView;
@class NSBundle;

SWIFT_CLASS("_TtC12MovingHelper20DetailViewController")
@interface DetailViewController : UIViewController
@property (nonatomic, weak) IBOutlet UITextField * _Null_unspecified titleTextField;
@property (nonatomic, weak) IBOutlet Checkbox * _Null_unspecified doneCheckbox;
@property (nonatomic, weak) IBOutlet UILabel * _Null_unspecified daysRemainingLabel;
@property (nonatomic, weak) IBOutlet UIPickerView * _Null_unspecified dueDatePicker;
@property (nonatomic, weak) IBOutlet UITextView * _Null_unspecified notesTextView;
@property (nonatomic, strong) NSDate * _Null_unspecified moveDate;
@property (nonatomic) BOOL inEditMode;
- (void)viewDidLoad;
- (void)viewWillAppear:(BOOL)animated;
- (IBAction)checkboxToggled;
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
@end

@interface DetailViewController (SWIFT_EXTENSION(MovingHelper)) <UIPickerViewDataSource>
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView * _Nonnull)pickerView;
- (NSInteger)pickerView:(UIPickerView * _Nonnull)pickerView numberOfRowsInComponent:(NSInteger)component;
@end

@interface DetailViewController (SWIFT_EXTENSION(MovingHelper)) <UIPickerViewDelegate>
- (NSString * _Null_unspecified)pickerView:(UIPickerView * _Nonnull)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
- (void)pickerView:(UIPickerView * _Nonnull)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
@end

@class UIStoryboardSegue;

SWIFT_CLASS("_TtC12MovingHelper20MasterViewController")
@interface MasterViewController : UITableViewController
- (void)viewDidLoad;
- (void)viewDidAppear:(BOOL)animated;
- (void)prepareForSegue:(UIStoryboardSegue * _Nonnull)segue sender:(id _Nullable)sender;
- (IBAction)calendarIconTapped;
- (nonnull instancetype)initWithStyle:(UITableViewStyle)style OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
@end

@interface MasterViewController (SWIFT_EXTENSION(MovingHelper))
@end

@interface MasterViewController (SWIFT_EXTENSION(MovingHelper))
- (void)updatedMovingDate;
@end

@class UITableView;
@class UIView;
@class NSIndexPath;
@class UITableViewCell;

@interface MasterViewController (SWIFT_EXTENSION(MovingHelper))
- (NSInteger)numberOfSectionsInTableView:(UITableView * _Nonnull)tableView;
- (CGFloat)tableView:(UITableView * _Nonnull)tableView heightForHeaderInSection:(NSInteger)section;
- (UIView * _Nullable)tableView:(UITableView * _Nonnull)tableView viewForHeaderInSection:(NSInteger)section;
- (NSInteger)tableView:(UITableView * _Nonnull)tableView numberOfRowsInSection:(NSInteger)section;
- (UITableViewCell * _Nonnull)tableView:(UITableView * _Nonnull)tableView cellForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath;
@end

@class UIDatePicker;

/// VC to use to select a moving date.
SWIFT_CLASS("_TtC12MovingHelper24MovingDateViewController")
@interface MovingDateViewController : UIViewController
@property (nonatomic, weak) IBOutlet UIDatePicker * _Null_unspecified whenMovingDatePicker;
@property (nonatomic, weak) IBOutlet UILabel * _Null_unspecified whenMovingLabel;
@property (nonatomic, weak) IBOutlet UILabel * _Null_unspecified daysLeftLabel;
@property (nonatomic, weak) IBOutlet UIButton * _Null_unspecified createTasksButton;
@property (nonatomic) BOOL updatingDate;
- (void)viewDidLoad;
- (NSDate * _Nonnull)twoMonthsFromToday;
- (IBAction)datePickerChanged;
- (IBAction)createTasks;
- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
@end

@interface NSDate (SWIFT_EXTENSION(MovingHelper))

/// The start of the day per NSCalendar rules for the receiver.
- (NSDate * _Nonnull)startOfDay;

/// The start of the current day per NSCalendar rules for the receiver.
+ (NSDate * _Nonnull)startOfToday;
@end

@interface NSDictionary (SWIFT_EXTENSION(MovingHelper))

/// Checks a dictionary for a value for a given key, and returns either its String value or an empty string.
///
/// \param key : The key to use to check the dictionary
///
/// \returns  The found string, or an empty string if it was not found.
- (NSString * _Nonnull)safeString:(NSString * _Nonnull)key;

/// Checks a dictionary for a value for a given key, and returns either its integer value or zero.
///
/// \param key : The key to use to check the dictionary
///
/// \returns  The found number, or zero if it was not found.
- (NSInteger)safeInt:(NSString * _Nonnull)key;

/// Checks a dictionary for a value for a given key, and returns either its boolean value or false.
///
/// \param key : The key to use to check the dictionary
///
/// \returns  The found boolean value, or false if it was not found.
- (BOOL)safeBoolean:(NSString * _Nonnull)key;
@end

@class NSDateFormatter;

/// A section header view which shows when tasks are due and changes color based on whether the due date has passed for the given move date.
SWIFT_CLASS("_TtC12MovingHelper21TaskSectionHeaderView")
@interface TaskSectionHeaderView : UITableViewCell
+ (NSDateFormatter * _Nonnull)dateFormatter;
@property (nonatomic, strong) IBOutlet UILabel * _Null_unspecified sectionNameLabel;
@property (nonatomic, strong) IBOutlet UILabel * _Null_unspecified deadlineDateLabel;
@property (nonatomic, strong) IBOutlet UILabel * _Null_unspecified fromNowOrAgoLabel;
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Nullable)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
@end

SWIFT_CLASS("_TtC12MovingHelper17TaskTableViewCell")
@interface TaskTableViewCell : UITableViewCell
@property (nonatomic, strong) IBOutlet UILabel * _Null_unspecified titleLabel;
@property (nonatomic, strong) IBOutlet UILabel * _Null_unspecified notesLabel;
@property (nonatomic, strong) IBOutlet Checkbox * _Null_unspecified checkbox;
- (void)configureForDoneState:(BOOL)done;
- (IBAction)tappedCheckbox;
- (nonnull instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString * _Nullable)reuseIdentifier OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
@end

@interface UITableViewCell (SWIFT_EXTENSION(MovingHelper))

/// \returns  The cell identifier based on the class's name, but not tied
/// to the project bundle. A class of FooTableViewCell would return "FooTableViewCell" as the identifier.
+ (NSString * _Nonnull)cellIdentifierFromClassName;
@end

#pragma clang diagnostic pop