text:
//
// Renderable thing
//

#include "renderable.hh"

#include "sys/msys.h"
#include <GL/gl.h>

#include "anims.hh"

Renderable::Renderable(date deathDate,
		       Shader::id shaderId,
		       date birthDate,
		       float size,
		       unsigned int numberOfVertices,
		       VBO::id vboId):
  _visible(true),
//   _transparent(false),
  _id(0),
  _shaderId(shaderId),
  _textureId(Texture::none),
  _texture2Id(Texture::none),
  _bumpTextureId(Texture::none),
  _specularTextureId(Texture::none),
  _vboId(vboId),
  _numberOfVertices(numberOfVertices),
  _size(size),
  _distance(0),
  _birthDate(birthDate),
  _deathDate(deathDate),
  _animId(Anim::none),
  _animationStartDate(birthDate),
  _animationStopDate(-1),
  _animationStepShift(0)
{
  assert(size >= 0.f);
  assert(_birthDate <= _deathDate);

  _sortHint = ((_shaderId & 0xff) << 16) | ((_vboId & 0xff) << 8);

  // Le renderable est créé avec la matrice de transformation en l'état
  glGetFloatv(GL_MODELVIEW_MATRIX, _viewMatrix);
}

Renderable::~Renderable()
{
}

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

/*
#define ACCESSOR(t, x) t Renderable::x() const {return _##x;}

ACCESSOR(int, sortHint);
ACCESSOR(bool, visible);

bool Renderable::operator > (const Renderable & other) const
{
  // FIXME : fonction de comparaison plus efficace
  assert(visible() && other.visible());

  // FIXME : ajouter la distance au sortHint
  return (_sortHint > other.sortHint());
}

void Renderable::setVisible(bool visible)
{
  _visible = visible;
}

ACCESSOR(bool, transparent);

//
// identifiants de l'objet, de textures, de shader, de VBO
//

ACCESSOR(int, id);
*/
void Renderable::setId(int id) { _id = id; }
/*
ACCESSOR(Anim::id, animId);
ACCESSOR(Texture::id, textureId);
ACCESSOR(Texture::id, bumpTextureId);
ACCESSOR(Texture::id, specularTextureId);
ACCESSOR(Shader::id, shaderId);
ACCESSOR(VBO::id, vboId);
*/
void Renderable::setAnimation(Anim::id animId)
{
  _animId = animId;
}

void Renderable::setAnimation(Anim::id animId,
			      date startDate)
{
  _animId = animId;
  _animationStartDate = startDate;

#if DEBUG
  if (animId != Anim::none)
  {
    Anim::Anim & animation = Anim::list[animId];
    assert(animation.size > 1); // Voir ^^^^^^
    const Anim::Keyframe & last = animation.last();
    assert(last.date() > 0.98f && last.date() < 1.02f);
  }
#endif // DEBUG

}

void Renderable::setAnimationStepShift(float stepShift)
{
  assert(stepShift >= 0.f); // Simple warning
  _animationStepShift = stepShift;
}

void Renderable::setAnimationStopDate(date stopDate)
{
  _animationStopDate = stopDate;
}

/*
void Renderable::setTexture(Texture::id textureId)
{
  _textureId = textureId;
}

void Renderable::setBumpTexture(Texture::id bumpTextureId)
{
  _bumpTextureId = bumpTextureId;
}

void Renderable::setSpecularTexture(Texture::id specularTextureId)
{
  _specularTextureId = specularTextureId;
}
*/
void Renderable::setTextures(Texture::id textureId,
			     Texture::id bumpTextureId,
			     Texture::id specularTextureId)
{
  _textureId = textureId;
  _texture2Id = textureId;
  _bumpTextureId = bumpTextureId;
  _specularTextureId = specularTextureId;

  _sortHint = (_sortHint & 0xffffff00) | (_textureId & 0xff);
}

/*
void Renderable::setTexture(Texture::id texture2Id)
{
  _texture2Id = texture2Id;
}
ACCESSOR(unsigned int, numberOfVertices);
ACCESSOR(float, size);

ACCESSOR(float, distance);

ACCESSOR(const float *, viewMatrix);

ACCESSOR(date, birthDate);
ACCESSOR(date, deathDate);
*/
void Renderable::setDeathDate(date deathDate)
{
  _deathDate = deathDate;
}
/*
ACCESSOR(float, animationStepShift);
ACCESSOR(date, animationStartDate);
ACCESSOR(date, animationStopDate);
*/


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<base href="../../../../" />

		<link type="text/css" rel="stylesheet" href="page.css" />

[name]

			Questa classe rappresenta un'astrazione dell'API WebXR Device ed è utilizzata internamente da [page:WebGLRenderer].
			[name] inoltre fornisce un'interfaccia pubblica che permette agli utenti di abilitare e disabilitare XR ed
			eseguire attività relative a XR come ad esempio il recupero dei controller.

Proprietà

[property:Boolean cameraAutoUpdate]

			Indica se la telecamera XR del manager deve essere aggiornata automaticamente o no. Il valore predefinito è `true`.

[property:Boolean enabled]

			Questo flag notifica al renderer di essere pronto per il rendering XR. L'impostazione predefinita è `false`.
			Impostalo a `true` se stai utilizzando XR nella tua applicazione.

[property:Boolean isPresenting]

			Indica se la presentazione XR è attiva o meno. Il valore predefinito è `false`. Questo flag è di sola
			lettura e impostato automaticamente da [name].

Metodi

[method:ArrayCamera getCamera]()

			Restituisce un'istanza di [page:ArrayCamera] che rappresenta la telecamera XR sessione XR attiva.
			Per ogni vista contiene un oggetto telecamera separato nella sua proprietà [page:ArrayCamera.cameras telecamere].

			Il `fov` della telecamera non viene utilizzato attualmente e non riflette il fov della telecamera XR. Se hai bisogno del fov a
			livello di app, devi calcolare manualmente dalle matrici di proiezione della telecamera XR.

[method:Group getController]( [param:Integer index] )

		[page:Integer index] — L'indice del controller.

		Restituisce un [page:Group gruppo] che rappresenta il cosidetto spazio *target ray* del controller XR.
		Utilizza questo spazio per visualizzare gli oggetti 3D che supportano l'utente nel puntare attività come
		l'intersezione dell'interfaccia utente.

[method:Group getControllerGrip]( [param:Integer index] )

		[page:Integer index] — L'indice del controller.

		Restituisce un [page:Group gruppo] che rappresenta il cosidetto spazio `grip` del controller XR.
		Utilizza questo spazio se l'utente terrà altri oggetti 3D come una spada laser.

		Nota: Se vuoi mostrare qualcosa nella mano dell'utente e offrire un raggio di puntamento allo stesso tempo, ti consigliamo di allegare
		l'oggetto tenuto in mano al gruppo restituito da [page:.getControllerGrip]() e il raggio al gruppo restituito da [page:.getController]().
		L'idea è quella di avere due gruppi diversi in due coordinate delle spazio diverse per lo stesso controller WebXR.

[method:Float getFoveation]()

			Restituisce la quantità di foveazione utilizzata dal compositore XR per il livello di proiezione.

[method:Group getHand]( [param:Integer index] )

		[page:Integer index] — L'indice del controller.

		Restituisce un [page:Group gruppo] che rappresenta il cosidetto spazio `hand` o `joint` per il controller XR.
		Utilizza questo spazio per visualizzare le mani dell'utente quando vengono utilizzati i controller non fisici.

[method:String getReferenceSpace]()

			Restituisce lo spazio di riferimento.

[method:XRSession getSession]()

			Restituisce l'oggetto `XRSession` il quale permette una maggiore gestione delle sessioni WebXR attive a livello di applicazione.

[method:undefined setFoveation]( [param:Float foveation] )

		[page:Float foveation] — Il foveazione da impostare.

		Specifica la quantità di foveazione utilizzata dal compositore XR per il livello. Deve essere un valore tra `0` e `1`.

[method:undefined setFramebufferScaleFactor]( [param:Float factor], [param:Boolean limited] )

		[page:Float factor] — Il fattore di scala del framebuffer da impostare.

		[page:Boolean limited] — Whether the framebuffer scale factor should be reduced to the native limit if the value ends up being higher than the device's capabilities. Default is `false`.

		Specifica il fattore di ridimensionamento da utilizzare per determinare la dimensione del framebuffer durante il rendering
		su un dispositivo XR. Il valore è relativo alla risoluzione del dispositivo XR predefinito. Il valore predefinito è `1`.
		Un valore di `0.5` specificherebbe un framebuffer con il 50% della risoluzione nativa del display.

		Nota: Non è possibile modificare il fattore di scala del framebuffer durante la presentazione del contenuto.

[method:undefined setReferenceSpace]( [param:XRReferenceSpace referenceSpace] )

		[page:XRReferenceSpace referenceSpace] — Uno spazio personalizzato di riferimento.

		Può essere utilizzato per configurare uno spazio personalizzato di riferimento il quale sovrascrive
		lo spazio di riferimento predefinito.

[method:undefined setReferenceSpaceType]( [param:String referenceSpaceType] )

		[page:String referenceSpaceType] — Il tipo dello spazio di riferimento da impostare.

		Può essere utilizzare per configurare una relazione spaziale con l'ambiente fisico dell'utente. A seconda di come l'utente
		si muove nello spazio 3D, l'impostazione di uno spazio di riferimento appropriato può migliorare il tracciamento.
		Il valore predefinito è `local-floor`.
		Consultare l'[link:https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType MDN] per i possibli valori e i relativi casi d'uso.

[method:undefined updateCamera]( [param:PerspectiveCamera camera] )

			Aggiorna lo stato della telecamera XR. Utilizza questo metodo a livello di app, se imposti [page:.cameraAutoUpdate] a `false`.
			Questo metodo richiede la telecamera non XR della scena come parametro. La trasformazione della telecamera passata viene automaticamente
			regolata sulla posizione della telecamera XR quando si chiama questo metodo.

		Nota: Non è possibile modificare il tipo dello spazio di riferimento durante la presentazione del contenuto XR.

Source

			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

redpajama_set_name: RedPajamaGithub


text:
layout: article
title: ARTICLE TITLE
article_url: ARTICLE URL
author: ARTICLE AUTHOR
publisher: ARTICLE PUBLISHER
publisher_url: ARTICLE PUBLISHER URL
published_date: YYYY-MM-DD
tags:
  - your
  - tags
---

INFORMATION ABOUT THE ARTICLE


text:
package dao

import (
	"context"
	"fmt"
	"io/ioutil"
	"net/http"

	"go-common/app/interface/openplatform/seo/conf"
	"go-common/library/cache/memcache"
	"go-common/library/log"
)

const (
	_pro  = "pro"
	_item = "item"
)

// Dao dao
type Dao struct {
	c  *conf.Config
	mc *memcache.Pool
}

// New init memcache
func New(c *conf.Config) (dao *Dao) {
	dao = &Dao{
		c:  c,
		mc: memcache.NewPool(c.Memcache),
	}
	return
}

// Close close the resource.
func (d *Dao) Close() {
	d.mc.Close()
}

// Ping dao ping
func (d *Dao) Ping(c context.Context) (err error) {
	if err = d.pingMC(c); err != nil {
		log.Error("pingMC error(%+v)", err)
		return
	}
	return
}

// pingMc ping memcache
func (d *Dao) pingMC(c context.Context) (err error) {
	con := d.mc.Get(c)
	defer con.Close()
	item := memcache.Item{Key: "ping", Value: []byte{1}, Expiration: 1}
	err = con.Set(&item)
	return
}

// getUrl get page url
// page: pro, item
func getUrl(id int, name string, bot bool) string {
	p := conf.GetPage(name)
	if p == nil {
		return ""
	}
	url := p.Bfs
	if !bot {
		url = p.Url
	}
	return fmt.Sprintf(url, id)
}

// getKey get page cache key
// name: pro, item
// return key: pro:bot:1001, pro:app:1001
// return key: item:bot:1001, item:app:1001
func getKey(id int, name string, bot bool) string {
	ua := "bot"
	if !bot {
		ua = "app"
	}
	return fmt.Sprintf("%s:%s:%d", name, ua, id)
}

// GetFile get page from file
func (d *Dao) GetFile(c context.Context, path string) (res []byte, err error) {
	log.Info(path)
	res, err = ioutil.ReadFile(path)
	return
}

// GetUrl get page from url
func (d *Dao) GetUrl(c context.Context, url string) (res []byte, err error) {
	log.Info(url)
	r, err := http.Get(url)
	if err != nil {
		return
	}
	defer r.Body.Close()
	if err == nil {
		res, err = ioutil.ReadAll(r.Body)
	}
	return
}

// GetCache get page from cache
func (d *Dao) GetCache(c context.Context, key string) (res []byte, err error) {
	log.Info(key)
	con := d.mc.Get(c)
	defer con.Close()

	item, err := con.Get(key)
	if err != nil {
		return
	}
	err = con.Scan(item, &res)
	return
}

// AddCache add page to cache
func (d *Dao) AddCache(c context.Context, key string, val []byte) (err error) {
	log.Info(key)
	item := &memcache.Item{
		Key:        key,
		Value:      val,
		Flags:      memcache.FlagRAW,
		Expiration: conf.Conf.Seo.Expire,
	}
	con := d.mc.Get(c)
	defer con.Close()
	if err = con.Set(item); err != nil {
		log.Error("key(%s) error(%v)", key, err)
	}
	return
}

// DelCache delete page cache
func (d *Dao) DelCache(c context.Context, key string) (err error) {
	con := d.mc.Get(c)
	defer con.Close()
	return con.Delete(key)
}

// ClearCache clear all page cache
func (d *Dao) ClearCache(c context.Context) (err error) {
	return
}


text:
package oet.wouter.ejbtesting.interceptors.order;

public class ClassLevelInterceptorOne extends AbstractInterceptor {
}


text:
declare module "*.json";

// Deprecated NodeJS API usages in webpack
declare namespace NodeJS {
	interface Process {
		binding(internalModule: string): any;
	}
	interface ProcessVersions {
		pnp: "1" | "3";
	}
}

declare module "neo-async" {
	interface QueueObject<T, E> {
		push(item: T): void;
		drain: () => void;
		error: (err: E) => void;
	}

	export interface Dictionary<T> {
		[key: string]: T;
	}
	export type IterableCollection<T> = T[] | Iterable<T> | Dictionary<T>;

	export interface ErrorCallback<T> {
		(err?: T): void;
	}
	export interface AsyncBooleanResultCallback<E> {
		(err?: E, truthValue?: boolean): void;
	}
	export interface AsyncResultCallback<T, E> {
		(err?: E, result?: T): void;
	}
	export interface AsyncResultArrayCallback<T, E> {
		(err?: E, results?: Array<T | undefined>): void;
	}
	export interface AsyncResultObjectCallback<T, E> {
		(err: E | undefined, results: Dictionary<T | undefined>): void;
	}

	export interface AsyncFunction<T, E> {
		(callback: (err?: E, result?: T) => void): void;
	}
	export interface AsyncFunctionEx<T, E> {
		(callback: (err?: E, ...results: T[]) => void): void;
	}
	export interface AsyncIterator<T, E> {
		(item: T, callback: ErrorCallback<E>): void;
	}
	export interface AsyncForEachOfIterator<T, E> {
		(item: T, key: number | string, callback: ErrorCallback<E>): void;
	}
	export interface AsyncResultIterator<T, R, E> {
		(item: T, callback: AsyncResultCallback<R, E>): void;
	}
	export interface AsyncMemoIterator<T, R, E> {
		(memo: R | undefined, item: T, callback: AsyncResultCallback<R, E>): void;
	}
	export interface AsyncBooleanIterator<T, E> {
		(item: T, callback: AsyncBooleanResultCallback<E>): void;
	}

	export interface AsyncWorker<T, E> {
		(task: T, callback: ErrorCallback<E>): void;
	}
	export interface AsyncVoidFunction<E> {
		(callback: ErrorCallback<E>): void;
	}

	export type AsyncAutoTasks<R extends Dictionary<any>, E> = {
		[K in keyof R]: AsyncAutoTask<R[K], R, E>;
	};
	export type AsyncAutoTask<R1, R extends Dictionary<any>, E> =
		| AsyncAutoTaskFunctionWithoutDependencies<R1, E>
		| (keyof R | AsyncAutoTaskFunction<R1, R, E>)[];
	export interface AsyncAutoTaskFunctionWithoutDependencies<R1, E> {
		(cb: AsyncResultCallback<R1, E> | ErrorCallback<E>): void;
	}
	export interface AsyncAutoTaskFunction<R1, R extends Dictionary<any>, E> {
		(results: R, cb: AsyncResultCallback<R1, E> | ErrorCallback<E>): void;
	}

	export function each<T, E>(
		arr: IterableCollection<T>,
		iterator: AsyncIterator<T, E>,
		callback?: ErrorCallback<E>
	): void;

	export function eachLimit<T, E>(
		arr: IterableCollection<T>,
		limit: number,
		iterator: AsyncIterator<T, E>,
		callback?: ErrorCallback<E>
	): void;

	export function map<T, R, E>(
		arr: T[] | IterableIterator<T>,
		iterator: AsyncResultIterator<T, R, E>,
		callback?: AsyncResultArrayCallback<R, E>
	): void;
	export function map<T, R, E>(
		arr: Dictionary<T>,
		iterator: AsyncResultIterator<T, R, E>,
		callback?: AsyncResultArrayCallback<R, E>
	): void;

	export function parallel<T, E>(
		tasks: Array<AsyncFunction<T, E>>,
		callback?: AsyncResultArrayCallback<T, E>
	): void;
	export function parallel<T, E>(
		tasks: Dictionary<AsyncFunction<T, E>>,
		callback?: AsyncResultObjectCallback<T, E>
	): void;

	export function queue<T, E>(
		worker: AsyncIterator<T, E>,
		concurrency?: number
	): QueueObject<T, E>;

	export const forEach: typeof each;
	export const forEachLimit: typeof eachLimit;
}

// There are no typings for @webassemblyjs/ast
declare module "@webassemblyjs/ast" {
	export function traverse(
		ast: any,
		visitor: {
			ModuleImport?: (p: NodePath<ModuleImport>) => void;
			ModuleExport?: (p: NodePath<ModuleExport>) => void;
			Start?: (p: NodePath<Start>) => void;
			Global?: (p: NodePath<Global>) => void;
		}
	): void;
	export class NodePath<T> {
		node: T;
	}
	export class Node {}
	export class Identifier extends Node {
		value: string;
	}
	export class Start extends Node {
		index: Identifier;
	}
	export class ModuleImportDescription {
		type: string;
		valtype?: string;
		id?: Identifier;
		signature?: Signature;
	}
	export class ModuleImport extends Node {
		module: string;
		descr: ModuleImportDescription;
		name: string;
	}
	export class ModuleExport extends Node {
		name: string;
		descr: ModuleExportDescr;
	}
	type Index = Identifier | NumberLiteral;
	export class ModuleExportDescr extends Node {
		type: string;
		exportType: string;
		id: Index;
	}
	export class NumberLiteral extends Node {
		value: number;
		raw: string;
	}
	export class FloatLiteral extends Node {}
	export class GlobalType extends Node {
		valtype: string;
	}
	export class Global extends Node {
		init: Instruction[];
		globalType: GlobalType;
	}
	export class FuncParam extends Node {
		valtype: string;
	}
	export class Instruction extends Node {
		id: string;
		args: NumberLiteral[];
	}
	export class CallInstruction extends Instruction {}
	export class ObjectInstruction extends Instruction {}
	export class Func extends Node {
		signature: Signature;
	}
	export class Signature {
		type: "Signature";
		params: FuncParam[];
		results: string[];
	}
	export class TypeInstruction extends Node {}
	export class IndexInFuncSection extends Node {}
	export function indexLiteral(index: number): Index;
	export function numberLiteralFromRaw(num: number): NumberLiteral;
	export function floatLiteral(
		value: number,
		nan?: boolean,
		inf?: boolean,
		raw?: string
	): FloatLiteral;
	export function global(globalType: string, nodes: Node[]): Global;
	export function identifier(identifier: string): Identifier;
	export function funcParam(valType: string, id: Identifier): FuncParam;
	export function instruction(inst: string, args?: Node[]): Instruction;
	export function callInstruction(funcIndex: Index): CallInstruction;
	export function objectInstruction(
		kind: string,
		type: string,
		init: Node[]
	): ObjectInstruction;
	export function signature(params: FuncParam[], results: string[]): Signature;
	export function func(initFuncId, signature: Signature, funcBody): Func;
	export function typeInstruction(
		id: Identifier,
		functype: Signature
	): TypeInstruction;
	export function indexInFuncSection(index: Index): IndexInFuncSection;
	export function moduleExport(
		identifier: string,
		descr: ModuleExportDescr
	): ModuleExport;
	export function moduleExportDescr(
		type: string,
		index: Index
	): ModuleExportDescr;

	export function getSectionMetadata(ast: any, section: string);
	export class FuncSignature {
		args: string[];
		result: string[];
	}
	export function moduleContextFromModuleAST(ast: any): any;

	// Node matcher
	export function isGlobalType(n: Node): boolean;
	export function isTable(n: Node): boolean;
	export function isMemory(n: Node): boolean;
	export function isFuncImportDescr(n: Node): boolean;
}

declare module "webpack-sources" {
	export type MapOptions = { columns?: boolean; module?: boolean };

	export abstract class Source {
		size(): number;

		map(options?: MapOptions): Object;

		sourceAndMap(options?: MapOptions): {
			source: string | Buffer;
			map: Object;
		};

		updateHash(hash: import("./lib/util/Hash")): void;

		source(): string | Buffer;

		buffer(): Buffer;
	}

	export class RawSource extends Source {
		constructor(source: string | Buffer, convertToString?: boolean);

		isBuffer(): boolean;
	}

	export class OriginalSource extends Source {
		constructor(source: string | Buffer, name: string);

		getName(): string;
	}

	export class ReplaceSource extends Source {
		constructor(source: Source, name?: string);

		replace(start: number, end: number, newValue: string, name?: string): void;
		insert(pos: number, newValue: string, name?: string): void;

		getName(): string;
		original(): string;
		getReplacements(): {
			start: number;
			end: number;
			content: string;
			insertIndex: number;
			name: string;
		}[];
	}

	export class SourceMapSource extends Source {
		constructor(
			source: string | Buffer,
			name: string,
			sourceMap: Object | string | Buffer,
			originalSource?: string | Buffer,
			innerSourceMap?: Object | string | Buffer,
			removeOriginalSource?: boolean
		);

		getArgsAsBuffers(): [
			Buffer,
			string,
			Buffer,
			Buffer | undefined,
			Buffer | undefined,
			boolean
		];
	}

	export class ConcatSource extends Source {
		constructor(...args: (string | Source)[]);

		getChildren(): Source[];

		add(item: string | Source): void;
		addAllSkipOptimizing(items: Source[]): void;
	}

	export class PrefixSource extends Source {
		constructor(prefix: string, source: string | Source);

		original(): Source;
		getPrefix(): string;
	}

	export class CachedSource extends Source {
		constructor(source: Source);
		constructor(source: Source | (() => Source), cachedData?: any);

		original(): Source;
		originalLazy(): Source | (() => Source);
		getCachedData(): any;
	}

	export class SizeOnlySource extends Source {
		constructor(size: number);
	}

	interface SourceLike {
		source(): string | Buffer;
	}

	export class CompatSource extends Source {
		constructor(sourceLike: SourceLike);

		static from(sourceLike: SourceLike): Source;
	}
}

declare module "browserslist" {
	function browserslist(query: string): string[] | undefined;
	namespace browserslist {
		export function loadConfig(
			options:
				| {
						config: string;
						env?: string;
				  }
				| {
						path: string;
						env?: string;
				  }
		): string | undefined;
		export function findConfig(path: string): Record<string, string[]>;
	}
	export = browserslist;
}

// TODO remove that when @types/estree is updated
interface ImportAttributeNode {
	type: "ImportAttribute";
	key: import("estree").Identifier | import("estree").Literal;
	value: import("estree").Literal;
}

type TODO = any;

type RecursiveArrayOrRecord<T> =
	| { [index: string]: RecursiveArrayOrRecord<T> }
	| Array<RecursiveArrayOrRecord<T>>
	| T;


text:
package de.johmat.myjojox.utils.data.json.kombi;

import de.johmat.myjojox.utils.data.json.IJSONFinishWrite;

/**
 *
 * @author MyJojoX
 *
 * @version 1.0
 */
public interface IJSONPrepare extends IJSONFinishWrite {}


text:
<!DOCTYPE HTML>

<title>Uses of Class org.apache.sysds.runtime.matrix.data.Pair (Apache SystemDS 2.3.0-SNAPSHOT API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Uses of Class
org.apache.sysds.runtime.matrix.data.Pair

Packages that use Pair

Package
Description

org.apache.sysds.hops.codegen.template

org.apache.sysds.runtime.controlprogram.context

org.apache.sysds.runtime.functionobjects

org.apache.sysds.runtime.instructions.spark.data

org.apache.sysds.runtime.instructions.spark.utils

org.apache.sysds.runtime.iogen

org.apache.sysds.runtime.matrix.data

org.apache.sysds.runtime.transform.decode

org.apache.sysds.runtime.transform.meta

org.apache.sysds.runtime.util

Uses of Pair in org.apache.sysds.hops.codegen.template

Methods in org.apache.sysds.hops.codegen.template that return Pair

Modifier and Type
Method
Description

abstract Pair<Hop[],CNodeTpl>
TemplateBase.constructCplan(Hop hop,
              CPlanMemoTable memo,
              boolean compileLiterals)

Constructs a single cplan rooted at the given hop, according
 to the plan given in the memo structure for this particular
 hop and its recursive inputs.

Pair<Hop[],CNodeTpl>
TemplateCell.constructCplan(Hop hop,
              CPlanMemoTable memo,
              boolean compileLiterals)

Pair<Hop[],CNodeTpl>
TemplateMultiAgg.constructCplan(Hop hop,
              CPlanMemoTable memo,
              boolean compileLiterals)

Pair<Hop[],CNodeTpl>
TemplateOuterProduct.constructCplan(Hop hop,
              CPlanMemoTable memo,
              boolean compileLiterals)

Pair<Hop[],CNodeTpl>
TemplateRow.constructCplan(Hop hop,
              CPlanMemoTable memo,
              boolean compileLiterals)

Uses of Pair in org.apache.sysds.runtime.controlprogram.context

Methods in org.apache.sysds.runtime.controlprogram.context that return Pair

Modifier and Type
Method
Description

Pair<MatrixObject,Boolean>
ExecutionContext.getDenseMatrixOutputForGPUInstruction(String varName,
                                     long numRows,
                                     long numCols)

Allocates a dense matrix on the GPU (for output)

Pair<MatrixObject,Boolean>
ExecutionContext.getSparseMatrixOutputForGPUInstruction(String varName,
                                      long numRows,
                                      long numCols,
                                      long nnz)

Allocates a sparse matrix in CSR format on the GPU.

Uses of Pair in org.apache.sysds.runtime.functionobjects

Methods in org.apache.sysds.runtime.functionobjects that return Pair

Modifier and Type
Method
Description

Pair<MatrixIndexes,Double>
CTable.execute(long row,
       double v2,
       double w)

Uses of Pair in org.apache.sysds.runtime.instructions.spark.data

Method parameters in org.apache.sysds.runtime.instructions.spark.data with type arguments of type Pair

Modifier and Type
Method
Description

void
FrameReblockBuffer.flushBufferToBinaryBlocks(ArrayList<Pair<Long,FrameBlock>> outList)

Uses of Pair in org.apache.sysds.runtime.instructions.spark.utils

Methods in org.apache.sysds.runtime.instructions.spark.utils that return Pair

Modifier and Type
Method
Description

static Pair<MatrixIndexes,MatrixBlock>
SparkUtils.fromIndexedMatrixBlockToPair(IndexedMatrixValue in)

static Pair<Long,FrameBlock>
SparkUtils.toIndexedFrameBlock(scala.Tuple2<Long,FrameBlock> in)

Methods in org.apache.sysds.runtime.instructions.spark.utils that return types with arguments of type Pair

Modifier and Type
Method
Description

static List<Pair<MatrixIndexes,MatrixBlock>>
SparkUtils.fromIndexedMatrixBlockToPair(List<IndexedMatrixValue> in)

static List<Pair<Long,Long>>
SparkUtils.toIndexedLong(List<scala.Tuple2<Long,Long>> in)

Methods in org.apache.sysds.runtime.instructions.spark.utils with parameters of type Pair

Modifier and Type
Method
Description

static org.apache.spark.api.java.JavaPairRDD<Long,FrameBlock>
FrameRDDConverterUtils.dataFrameToBinaryBlock(org.apache.spark.api.java.JavaSparkContext sc,
                      org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> df,
                      DataCharacteristics mc,
                      boolean containsID,
                      Pair<String[],Types.ValueType[]> out)

static scala.Tuple2<Long,FrameBlock>
SparkUtils.fromIndexedFrameBlock(Pair<Long,FrameBlock> in)

Method parameters in org.apache.sysds.runtime.instructions.spark.utils with type arguments of type Pair

Modifier and Type
Method
Description

static List<scala.Tuple2<Long,FrameBlock>>
SparkUtils.fromIndexedFrameBlock(List<Pair<Long,FrameBlock>> in)

Uses of Pair in org.apache.sysds.runtime.iogen

Methods in org.apache.sysds.runtime.iogen that return Pair

Modifier and Type
Method
Description

Pair<Integer,Integer>
RawRow.findAtValue(ValueTrimFormat vtf,
           int rawIndex,
           int numericIndex)

Pair<Integer,Integer>
RawRow.findAtValue(ValueTrimFormat vtf,
           int rawIndex,
           int numericIndex,
           boolean update)

Pair<Integer,Integer>
RawRow.findSequenceValues(ArrayList<ValueTrimFormat> vtfs,
                  int startIndex,
                  boolean update)

Pair<Integer,Integer>
RawRow.findValue(ValueTrimFormat vtf,
         boolean forward)

Pair<Integer,Integer>
RawRow.findValue(ValueTrimFormat vtf,
         boolean forward,
         boolean update)

Pair<String,String>
RawRow.getDelims()

Pair<HashSet<String>,Integer>
RawRow.getDelimsSet()

Uses of Pair in org.apache.sysds.runtime.matrix.data

Methods in org.apache.sysds.runtime.matrix.data that return Pair

Modifier and Type
Method
Description

Pair<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Text>
BinaryBlockToTextCellConverter.next()

Pair<K2,V2>
Converter.next()

Pair<MatrixIndexes,MatrixCell>
TextToBinaryCellConverter.next()

Methods in org.apache.sysds.runtime.matrix.data that return types with arguments of type Pair

Modifier and Type
Method
Description

static ArrayList<Pair<Long,FrameBlock>>
OperationsOnMatrixValues.performSlice(Pair<Long,FrameBlock> in,
            IndexRange ixrange,
            int blen)

This function will get slice of the input frame block overlapping in overall slice(Range), slice has requested for.

Methods in org.apache.sysds.runtime.matrix.data with parameters of type Pair

Modifier and Type
Method
Description

static void
OperationsOnMatrixValues.performShift(Pair<Long,FrameBlock> in,
            IndexRange ixrange,
            int blenLeft,
            long rlen,
            long clen,
            ArrayList<Pair<Long,FrameBlock>> outlist)

static ArrayList<Pair<Long,FrameBlock>>
OperationsOnMatrixValues.performSlice(Pair<Long,FrameBlock> in,
            IndexRange ixrange,
            int blen)

This function will get slice of the input frame block overlapping in overall slice(Range), slice has requested for.

Method parameters in org.apache.sysds.runtime.matrix.data with type arguments of type Pair

Modifier and Type
Method
Description

static void
OperationsOnMatrixValues.performShift(Pair<Long,FrameBlock> in,
            IndexRange ixrange,
            int blenLeft,
            long rlen,
            long clen,
            ArrayList<Pair<Long,FrameBlock>> outlist)

void
FrameBlock.slice(ArrayList<Pair<Long,FrameBlock>> outlist,
     IndexRange range,
     int rowCut)

Uses of Pair in org.apache.sysds.runtime.transform.decode

Methods in org.apache.sysds.runtime.transform.decode with parameters of type Pair

Modifier and Type
Method
Description

static void
DecoderRecode.parseRecodeMapEntry(String entry,
                   Pair<String,String> pair)

Parses a line of <token, ID, count> into <token, ID> pairs, where
 quoted tokens (potentially including separators) are supported.

Uses of Pair in org.apache.sysds.runtime.transform.meta

Constructor parameters in org.apache.sysds.runtime.transform.meta with type arguments of type Pair

Constructor
Description

TfOffsetMap(List<Pair<Long,Long>> rmRows)

Uses of Pair in org.apache.sysds.runtime.util

Methods in org.apache.sysds.runtime.util with parameters of type Pair

Modifier and Type
Method
Description

static IndexRange
UtilFunctions.getSelectedRangeForZeroOut(Pair<Long,FrameBlock> in,
                          int blen,
                          IndexRange indexRange,
                          long lSrcRowIndex,
                          long lDestRowIndex)

static int
LocalFileUtils.readBlockSequenceFromLocal(String fname,
                          Pair<MatrixIndexes,MatrixValue>[] outValues,
                          HashMap<MatrixIndexes,Integer> outMap)

static void
LocalFileUtils.writeBlockSequenceToLocal(String fname,
                         Pair<MatrixIndexes,MatrixValue>[] inValues,
                         int len)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

All Classes

JavaScript is disabled on your browser.

Copyright © 2021 The Apache Software Foundation. All rights reserved.


text:
<?php

namespace Magento\User\Controller\Adminhtml\User;

use Magento\Framework\Exception\AuthenticationException;
use Magento\Framework\Exception\State\UserLockedException;
use Magento\Security\Model\SecurityCookie;

class Save extends \Magento\User\Controller\Adminhtml\User
{
    /**
     * @var SecurityCookie
     */
    private $securityCookie;

    /**
     * Get security cookie
     *
     * @return SecurityCookie
     * @deprecated
     */
    private function getSecurityCookie()
    {
        if (!($this->securityCookie instanceof SecurityCookie)) {
            return \Magento\Framework\App\ObjectManager::getInstance()->get(SecurityCookie::class);
        } else {
            return $this->securityCookie;
        }
    }

    /**
     * @return void
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     */
    public function execute()
    {
        $userId = (int)$this->getRequest()->getParam('user_id');
        $data = $this->getRequest()->getPostValue();
        if (!$data) {
            $this->_redirect('adminhtml/*/');
            return;
        }
        /** @var $model \Magento\User\Model\User */
        $model = $this->_userFactory->create()->load($userId);
        if ($userId && $model->isObjectNew()) {
            $this->messageManager->addError(__('This user no longer exists.'));
            $this->_redirect('adminhtml/*/');
            return;
        }
        $model->setData($this->_getAdminUserData($data));
        $uRoles = $this->getRequest()->getParam('roles', []);
        if (count($uRoles)) {
            $model->setRoleId($uRoles[0]);
        }

        /** @var $currentUser \Magento\User\Model\User */
        $currentUser = $this->_objectManager->get('Magento\Backend\Model\Auth\Session')->getUser();
        if ($userId == $currentUser->getId() && $this->_objectManager->get(
            'Magento\Framework\Validator\Locale'
        )->isValid(
            $data['interface_locale']
        )
        ) {
            $this->_objectManager->get(
                'Magento\Backend\Model\Locale\Manager'
            )->switchBackendInterfaceLocale(
                $data['interface_locale']
            );
        }

        /** Before updating admin user data, ensure that password of current admin user is entered and is correct */
        $currentUserPasswordField = \Magento\User\Block\User\Edit\Tab\Main::CURRENT_USER_PASSWORD_FIELD;
        $isCurrentUserPasswordValid = isset($data[$currentUserPasswordField])
            && !empty($data[$currentUserPasswordField]) && is_string($data[$currentUserPasswordField]);
        try {
            if (!($isCurrentUserPasswordValid)) {
                throw new AuthenticationException(__('You have entered an invalid password for current user.'));
            }
            $currentUser->performIdentityCheck($data[$currentUserPasswordField]);
            $model->save();

            $model->sendNotificationEmailsIfRequired();

            $this->messageManager->addSuccess(__('You saved the user.'));
            $this->_getSession()->setUserData(false);
            $this->_redirect('adminhtml/*/');
        } catch (UserLockedException $e) {
            $this->_auth->logout();
            $this->getSecurityCookie()->setLogoutReasonCookie(
                \Magento\Security\Model\AdminSessionsManager::LOGOUT_REASON_USER_LOCKED
            );
            $this->_redirect('adminhtml/*/');
        } catch (\Magento\Framework\Exception\AuthenticationException $e) {
            $this->messageManager->addError(__('You have entered an invalid password for current user.'));
            $this->redirectToEdit($model, $data);
        } catch (\Magento\Framework\Validator\Exception $e) {
            $messages = $e->getMessages();
            $this->messageManager->addMessages($messages);
            $this->redirectToEdit($model, $data);
        } catch (\Magento\Framework\Exception\LocalizedException $e) {
            if ($e->getMessage()) {
                $this->messageManager->addError($e->getMessage());
            }
            $this->redirectToEdit($model, $data);
        }
    }

    /**
     * @param \Magento\User\Model\User $model
     * @param array $data
     * @return void
     */
    protected function redirectToEdit(\Magento\User\Model\User $model, array $data)
    {
        $this->_getSession()->setUserData($data);
        $arguments = $model->getId() ? ['user_id' => $model->getId()] : [];
        $arguments = array_merge($arguments, ['_current' => true, 'active_tab' => '']);
        $this->_redirect('adminhtml/*/edit', $arguments);
    }
}


text:
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="OUICE, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.">

<title>
  {% if page.layout == "home" %}
    {{ page.title }}
  {% else %}
    {{ page.title }} · OU ICE
  {% endif %}
</title>

<!-- OU ICE core CSS -->
{% if site.github %}
<link href="../dist/css/ouice.min.css" rel="stylesheet">
{% else %}
<link href="../dist/css/ouice.css" rel="stylesheet">
{% endif %}
{% if page.slug == "css" or page.slug == "components" or page.slug == "js" %}
  <!-- Optional OU ICE Theme -->
{% if site.github %}
  <link href="data:text/css;charset=utf-8," data-href="../dist/css/ouice-theme.min.css" rel="stylesheet" id="bs-theme-stylesheet">
{% else %}
  <link href="data:text/css;charset=utf-8," data-href="../dist/css/ouice-theme.css" rel="stylesheet" id="bs-theme-stylesheet">
{% endif %}
{% endif %}

<!-- Documentation extras -->
{% if site.github %}
<link href="../assets/css/docs.min.css" rel="stylesheet">
{% else %}
<link href="../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<link href="../assets/css/src/pygments-manni.css" rel="stylesheet">
<link href="../assets/css/src/docs.css" rel="stylesheet">
{% endif %}
<!--[if lt IE 9]><script src="../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../assets/js/ie-emulation-modes-warning.js"></script>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- Favicons -->
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="icon" href="/favicon.ico">


text:
package com.google.javascript.rhino.jstype;

import static com.google.javascript.rhino.jstype.TernaryValue.UNKNOWN;

import com.google.javascript.rhino.ErrorReporter;
import com.google.javascript.rhino.Node;

/**
 * The {@code Unknown} type.
 */
public class UnknownType extends ObjectType {
  private static final long serialVersionUID = 1L;

  // See the explanation of checked unknown types in JSTypeNative.
  private final boolean isChecked;

  UnknownType(JSTypeRegistry registry, boolean isChecked) {
    super(registry);
    this.isChecked = isChecked;
  }

  @Override
  public boolean isUnknownType() {
    return true;
  }

  @Override
  public boolean isCheckedUnknownType() {
    return isChecked;
  }

  @Override
  public boolean canBeCalled() {
    return true;
  }

  @Override
  public boolean matchesNumberContext() {
    return true;
  }

  @Override
  public boolean matchesObjectContext() {
    return true;
  }

  @Override
  public boolean matchesStringContext() {
    return true;
  }

  @Override
  public boolean matchesSymbolContext() {
    return true;
  }

  @Override
  public TernaryValue testForEquality(JSType that) {
    return UNKNOWN;
  }

  @Override
  public boolean isNullable() {
    return true;
  }

  @Override
  public boolean isVoidable() {
    return true;
  }

  @Override
  public boolean isSubtype(JSType that) {
    return isSubtype(that, null, SubtypingMode.NORMAL);
  }

  @Override
  protected boolean isSubtype(JSType that,
      ImplCache implicitImplCache, SubtypingMode subtypingMode) {
    return true;
  }

  @Override
  public <T> T visit(Visitor<T> visitor) {
    return visitor.caseUnknownType();
  }

  @Override <T> T visit(RelationshipVisitor<T> visitor, JSType that) {
    return visitor.caseUnknownType(this, that);
  }

  @Override
  StringBuilder appendTo(StringBuilder sb, boolean forAnnotations) {
    return sb.append(getReferenceName());
  }

  @Override
  boolean defineProperty(String propertyName, JSType type,
      boolean inferred, Node propertyNode) {
    // nothing to define
    return true;
  }

  @Override
  public ObjectType getImplicitPrototype() {
    return null;
  }

  @Override
  public FunctionType getConstructor() {
    return null;
  }

  @Override
  public String getReferenceName() {
    return isChecked ? "??" : "?";
  }

  @Override
  public String getDisplayName() {
    return "Unknown";
  }

  @Override
  public boolean hasDisplayName() {
    return true;
  }

  @Override
  public BooleanLiteralSet getPossibleToBooleanOutcomes() {
    return BooleanLiteralSet.BOTH;
  }

  @Override
  JSType resolveInternal(ErrorReporter reporter) {
    return this;
  }

  @Override
  int recursionUnsafeHashCode() {
    return System.identityHashCode(this);
  }
}


text:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * PageStudio
 *
 * A web application for managing website content. For use with PHP 5.4+
 *
 * This application is based on the PHP framework,
 * PIP http://gilbitron.github.io/PIP/. PIP has been greatly altered to
 * work for the purposes of our development team. Additional resources
 * and concepts have been borrowed from CodeIgniter,
 * http://codeigniter.com for further improvement and reliability.
 *
 * @package     PageStudio
 * @author      Cosmo Mathieu <cosmo@cosmointeractive.co>
 */

// ------------------------------------------------------------------------

/**
 * Database wrapper
 *
 * Provides an abstract method to work with the database using the PDO engine.
 * Also includes insert, delete, and update methods to simplify work.
 * Based on the YouTube video by phpAcademy on OOP.
 * For further improvements http://www.phpclasses.org/package/8933-PHP-Wrapper-to-access-MySQL-databases-using-PDO.html#view_files/files/57797
 */
class Database
{
    /**
     * Private static property
     * @access      private
     * @var         $_instance Store instance of the database
     */
    private static $_instance = null;

    /**
     * Private variables
     */
    private $_pdo,              // storage for PDO object
            $_query,            // Stored query
            $_error = false,    // PDO exception error
            $_results,          // Results of the database query
            $_count = 0;        // Store results returned

    /**
     * Constructor
     */
    private function __construct()
    {
        try {
            $this->_pdo = new PDO(
                'mysql:dbname=' . Config::get('mysql/db') . ';' .
                'host=' . Config::get('mysql/host'),
                Config::get('mysql/username'),   //Username
                Config::get('mysql/password')    //Password
            );
        } catch(PDOException $e) {
            die($e->getMessage());
        }
    }

    /**
     * Return the database instance object, create the object if not set
     *
     * @access     public
     * @param      $_instance
     * @return     object
     */
    public static function getInstance()
    {
        if( ! isset(self::$_instance)) {
            self::$_instance = new Database();
        }
        return self::$_instance;
    }

    /**
     * Method to prepare SQL statements
     *
     * @access     public
     * @param      string $sql
     * @param      array $params Array containing SQL parameters
     * @return     object
     */
    public function query($sql, $params = array())
    {
        $x = 1;
        $this->_error = false;
        if($this->_query = $this->_pdo->prepare($sql)) {
            if(count($params)) {
                foreach($params as $param) {
                    $this->_query->bindValue($x, $param);
                    $x++;
                }
            }

            /**
             * Extract bind PDO values if query executed properly
             * and return result sets
             */
            if($this->_query->execute()) {
                $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);
                $this->_count = $this->_query->rowCount();
            } else {
                $this->_error = true;
            }
        }

        return $this;
    }

    /**
     * Prepare statement
     *
     * Provides a quick and simplified method to make conditional queries
     *
     * @access     public
     * @param      var $action Field to look up
     * @param      string $table Table to access
     * @param      array $where Array to hold Value of the query
     * @return     Object
     */
    public function action($action, $table, $where = array())
    {
        /**
         * Check that all values are passed in
         */
        if(count($where) === 3) {
            $operators  = array('=', '<', '>=', '<=');

            /**
             * Extract variables from array $where
             */
            $field      = $where[0];
            $operator   = $where[1];
            $value      = $where[2];

            //Check if operator is of allowed type
            //Perform query if condition is met
            // if (in_array($operator, $operators)) {
                // $sql = "{$action} FROM {$table} WHERE {$field} {$operator} ?";
                // if( ! $this->query($sql, array($value))->error()) {
                    // return $this;
                // }
            // }

            /** @note     Adding the ability to do AND statements. */
            if (in_array($operator, $operators)) {
                if(is_array($value)) {
                    $cnt = 0;
                    foreach($value as $condition) {
                        $x = "{$field} {$operator} ?";
                        if($cnt > 0) {
                            $x .= " AND {$field} {$operator} ?";
                        }
                        $cnt++;
                    }
                } else {
                    $x = "{$field} {$operator} ?";
                }

                $sql = "{$action} FROM {$table} WHERE ";
                $sql .= $x;
                if( ! $this->query($sql, array($value))->error()) {
                    return $this;
                }
            }
        }
    }

    /**
     * Return the results of the query
     *
     * @access     public
     * @param      array $_results
     * @return     object
     */
    public function results()
    {
        return $this->_results;
    }

    /**
     * Prepare statement
     *
     * Provides a simplified method to make queries
     *
     * @access     public
     * @param
     * @return
     */
    public function get($table, $where)
    {
        return $this->action('SELECT *', $table, $where);
    }

    /**
     * Method to simplify database object item
     *
     * @access     public
     * @param      var $table Database table to access
     * @param      var $where
     * @return     bool
     */
    public function delete($table, $where)
    {
        return $this->action('DELETE', $table, $where);
    }

    /**
     * Method to insert data into the MySQL table. This function prepares
     * the sql PDO query, executes it and return true/false respectively
     *
     * @access     public
     * @param      var $table Database table to access
     * @param      array $fields Fields to update
     * @return     bool
     */
    public function insert($table, $fields = array())
    {
        //Check if fields has any value
        if(count($fields)) {
            $keys = array_keys($fields);
            $values = null;
            $x = 1;

            //Bind values in the array to the "?" character
            foreach($fields as $field) {
                $values .= "?";
                if($x < count($fields)) {
                    $values .= ', ';
                }
                $x++;
            }

            $sql = "INSERT INTO " . $table . " (`" . implode('`, `', $keys) . "`) VALUES ({$values})";

            if( ! $this->query($sql, $fields)->error()) {
                return true;
            }
        }
        return false;
    }

    /**
     * Method to update a table record
     *
     * <code>
     * Database::getInstance()->update($table, $id, array(
     *     $field => $value
     * )
     * </code>
     *
     * @access     public
     * @param      var $table
     * @param      int $id
     * @param      array $fields
     */
    public function update($table, $id, $fields = array(), $field = 'id')
    {
        //Check if fields has any value
        if(count($fields)) {
            $set = '';
            $x = 1;

            foreach($fields as $name => $value) {
                $set .= "{$name} = ?";
                if($x < count($fields)) {
                    $set .= ', ';
                }
                $x++;
            }

            $sql = "UPDATE {$table} SET {$set} WHERE {$field} = {$id}";

            if( ! $this->query($sql, $fields)->error()) {
                return true;
            }
        }
        return false;
    }

    /**
     * Provides a way to check if a query was successful or not
     *
     * @access     public
     * @param      int $_count The count of a query attempt
     * @return     int
     */
    public function count()
    {
        return $this->_count;
    }

    /**
     * Return PDO Exception errors
     *
     * @access     public
     * @param      int $_error The error count
     * @return     bool
     */
    public function error()
    {
        return $this->_error;
    }

}

/* End of file database.php */
/* Location: ./system/database.php */


text:
module Joybox
  module Core

    class SpriteBatch < CCSpriteBatchNode

      extend Joybox::Common::Initialize

      def defaults
        {
          capacity: 29
        }
      end

      def initialize(options = {})
        options = options.nil? ? defaults : defaults.merge!(options)
        initialize_with_file_name(options) if options.has_key? (:file_name)
        initialize_with_texture(options) if options.has_key? (:texture)
      end

      private

      def initialize_with_file_name(options = {})
        initWithFile(options[:file_name], capacity: options[:capacity])
      end

      def initialize_with_texture(options = {})
        initWithTexture(options[:texture], capacity: options[:capacity])
      end

    end

  end
end


text:
namespace tensorflow {

using shape_inference::Dimension;
using shape_inference::InferenceContext;
using shape_inference::Shape;

using tensorforest::CheckTensorBounds;
using tensorforest::Sum;
using tensorforest::BestSplitDominatesClassification;
using tensorforest::BestSplitDominatesRegression;

REGISTER_OP("FinishedNodes")
    .Attr("regression: bool = false")
    .Attr("num_split_after_samples: int")
    .Attr("min_split_samples: int")
    .Attr("dominate_fraction: float = 0.99")
    .Input("leaves: int32")
    .Input("node_to_accumulator: int32")
    .Input("split_sums: float")
    .Input("split_squares: float")
    .Input("accumulator_sums: float")
    .Input("accumulator_squares: float")
    .Input("birth_epochs: int32")
    .Input("current_epoch: int32")
    .Output("finished: int32")
    .Output("stale: int32")
    .SetShapeFn([](InferenceContext* c) {
      c->set_output(0, c->Vector(InferenceContext::kUnknownDim));
      c->set_output(1, c->Vector(InferenceContext::kUnknownDim));
      return Status::OK();
    })
    .Doc(R"doc(
Determines which of the given leaf nodes are done accumulating.

leaves:= A 1-d int32 tensor.  Lists the nodes that are currently leaves.
node_to_accumulator: If the i-th node is fertile, `node_to_accumulator[i]`
  is it's accumulator slot.  Otherwise, `node_to_accumulator[i]` is -1.
split_sums:= a 3-d tensor where `split_sums[a][s]` summarizes the
  training labels for examples that fall into the fertile node associated with
  accumulator slot s and have then taken the *left* branch of candidate split
  s.  For a classification problem, `split_sums[a][s][c]` is the count of such
  examples with class c and for regression problems, `split_sums[a][s]` is the
  sum of the regression labels for such examples.
split_squares: Same as split_sums, but it contains the sum of the
  squares of the regression labels.  Only used for regression.  For
  classification problems, pass a dummy tensor into this.
accumulator_sums: For classification, `accumulator_sums[a][c]` records how
  many training examples have class c and have ended up in the fertile node
  associated with accumulator slot a.  It has the total sum in entry 0 for
  convenience. For regression, it is the same except it contains the sum
  of the input labels that have been seen, and entry 0 contains the number
  of training examples that have been seen.
accumulator_squares: Same as accumulator_sums, but it contains the sum of the
  squares of the regression labels.  Only used for regression.  For
  classification problems, pass a dummy tensor into this.
birth_epochs:= A 1-d int32 tensor.  `birth_epochs[i]` contains the epoch
  the i-th node was created in.
current_epoch:= A 1-d int32 tensor with shape (1).  `current_epoch[0]`
  stores the current epoch number.
finished:= A 1-d int32 tensor containing the indices of the finished nodes.
  Nodes are finished if they have received at least num_split_after_samples
  samples, or if they have received min_split_samples and the best scoring
  split is sufficiently greater than the next best split.
stale:= A 1-d int32 tensor containing the fertile nodes that were created two
  or more epochs ago.

)doc");

class FinishedNodes : public OpKernel {
 public:
  explicit FinishedNodes(OpKernelConstruction* context)
      : OpKernel(context) {
    OP_REQUIRES_OK(context, context->GetAttr(
        "regression", &regression_));
    OP_REQUIRES_OK(context, context->GetAttr(
        "num_split_after_samples", &num_split_after_samples_));
    OP_REQUIRES_OK(context, context->GetAttr(
        "min_split_samples", &min_split_samples_));
    OP_REQUIRES_OK(context, context->GetAttr(
        "dominate_fraction", &dominate_fraction_));
  }

  void Compute(OpKernelContext* context) override {
    const Tensor& leaf_tensor = context->input(0);
    const Tensor& node_to_accumulator = context->input(1);
    const Tensor& split_sums = context->input(2);
    const Tensor& split_squares = context->input(3);
    const Tensor& accumulator_sums = context->input(4);
    const Tensor& accumulator_squares = context->input(5);
    const Tensor& birth_epochs = context->input(6);
    const Tensor& current_epoch = context->input(7);

    OP_REQUIRES(context, leaf_tensor.shape().dims() == 1,
                errors::InvalidArgument(
                    "leaf_tensor should be one-dimensional"));
    OP_REQUIRES(context, node_to_accumulator.shape().dims() == 1,
                errors::InvalidArgument(
                    "node_to_accumulator should be one-dimensional"));
    OP_REQUIRES(context, split_sums.shape().dims() == 3,
                errors::InvalidArgument(
                    "split_sums should be three-dimensional"));
    OP_REQUIRES(context, accumulator_sums.shape().dims() == 2,
                errors::InvalidArgument(
                    "accumulator_sums should be two-dimensional"));
    OP_REQUIRES(context, birth_epochs.shape().dims() == 1,
                errors::InvalidArgument(
                    "birth_epochs should be one-dimensional"));
    OP_REQUIRES(
        context,
        birth_epochs.shape().dim_size(0) ==
        node_to_accumulator.shape().dim_size(0),
        errors::InvalidArgument(
            "birth_epochs and node_to_accumulator should be the same size."));

    // Check tensor bounds.
    if (!CheckTensorBounds(context, leaf_tensor)) return;
    if (!CheckTensorBounds(context, node_to_accumulator)) return;
    if (!CheckTensorBounds(context, split_sums)) return;
    if (!CheckTensorBounds(context, split_squares)) return;
    if (!CheckTensorBounds(context, accumulator_sums)) return;
    if (!CheckTensorBounds(context, accumulator_squares)) return;
    if (!CheckTensorBounds(context, birth_epochs)) return;
    if (!CheckTensorBounds(context, current_epoch)) return;

    const auto leaves = leaf_tensor.unaligned_flat<int32>();
    const auto node_map = node_to_accumulator.unaligned_flat<int32>();
    const auto sums = accumulator_sums.tensor<float, 2>();
    const auto start_epochs = birth_epochs.unaligned_flat<int32>();
    const int32 epoch = current_epoch.unaligned_flat<int32>()(0);

    const int32 num_leaves = static_cast<int32>(
        leaf_tensor.shape().dim_size(0));
    const int32 num_accumulators = static_cast<int32>(
        accumulator_sums.shape().dim_size(0));

    std::vector<int32> finished_leaves;
    std::vector<int32> stale;
    for (int32 i = 0; i < num_leaves; i++) {
      const int32 leaf = internal::SubtleMustCopy(leaves(i));
      OP_REQUIRES(context, FastBoundsCheck(leaf, node_map.size()),
                  errors::InvalidArgument("leaf not in valid range."))
      const int32 accumulator = internal::SubtleMustCopy(node_map(leaf));
      if (accumulator < 0) {
        continue;
      }

      OP_REQUIRES(context, FastBoundsCheck(accumulator, num_accumulators),
                  errors::InvalidArgument("accumulator not in valid range."))
      // The first column holds the number of samples seen.
      // For classification, this should be the sum of the other columns.
      int32 count = sums(accumulator, 0);

      if (epoch > start_epochs(leaf) + 1) {
        if (count >= min_split_samples_) {
          finished_leaves.push_back(leaf);
        } else {
          stale.push_back(leaf);
        }
        continue;
      }

      if (count >= num_split_after_samples_) {
        finished_leaves.push_back(leaf);
        continue;
      }

      if (count < min_split_samples_) {
        continue;
      }

      bool finished = false;
      if (regression_) {
        finished = BestSplitDominatesRegression(
            accumulator_sums, accumulator_squares,
            split_sums, split_squares, accumulator);
      } else {
        finished = BestSplitDominatesClassification(
            accumulator_sums, split_sums, accumulator, dominate_fraction_);
      }

      if (finished) {
        finished_leaves.push_back(leaf);
      }
    }

    // Copy to output.
    Tensor* output_finished = nullptr;
    TensorShape finished_shape;
    finished_shape.AddDim(finished_leaves.size());
    OP_REQUIRES_OK(context,
                   context->allocate_output(0, finished_shape,
                                            &output_finished));
    auto out_finished = output_finished->unaligned_flat<int32>();

    for (int32 i = 0; i < finished_leaves.size(); i++) {
      out_finished(i) = finished_leaves[i];
    }

    Tensor* output_stale = nullptr;
    TensorShape stale_shape;
    stale_shape.AddDim(stale.size());
    OP_REQUIRES_OK(context,
                   context->allocate_output(1, stale_shape,
                                            &output_stale));
    auto out_stale = output_stale->unaligned_flat<int32>();

    for (int32 i = 0; i < stale.size(); i++) {
      out_stale(i) = stale[i];
    }
  }

 private:
  bool regression_;
  int32 num_split_after_samples_;
  int32 min_split_samples_;
  float dominate_fraction_;
};

REGISTER_KERNEL_BUILDER(Name("FinishedNodes").Device(DEVICE_CPU),
                        FinishedNodes);

}  // namespace tensorflow