text:
package com.maven.project.hib.model;

public class Role implements java.io.Serializable {

	// Constants--------------------------------------------------
	private static final long serialVersionUID = 3080092207392512016L;

	// Properties--------------------------------------------------
	private String roleId;
	private String description;

	// Constructors--------------------------------------------------
	public Role() {
	}

	public Role(String roleId) {
		this.roleId = roleId;
	}

	public Role(String roleId, String description) {
		this.roleId = roleId;
		this.description = description;
	}

	// Getters & Setters--------------------------------------------------
	public String getRoleId() {
		return this.roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="robots" content="noindex">

	<title>File Modules/Rest/DTO/CategoryDTO.php | Phalcon REST API</title>

	<link rel="stylesheet" href="resources/style.css?e99947befd7bf673c6b43ff75e9e0f170c88a60e">

		Overview

Namespaces

						Application

						Aware

						Helpers

						Models

						Modules

						Rest

						Aware

						Controllers

						DTO

						Events

						BeforeDispatchLoop

						BeforeException

						BeforeExecuteRoute

						Exceptions

						Services

						Validators

						Services

						Advanced

						Cache

						Database

						Develop

						Mail

						Mappers

						Security

						PHP

	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text" placeholder="Search">
	</form>

				Overview

Namespace

Class

				Tree

						Deprecated

						Todo

				Download

 1: <?php
 2: namespace Application\Modules\Rest\DTO;
 3:
 4: use Application\Aware\AbstractDTO;
 5: use Application\Helpers\Node;
 6:
 7: /**
 8:  * Class CategoryDTO. Data Transfer Object for categories relationships
 9:  *
10:  * @package Application\Modules\Rest
11:  * @subpackage DTO
12:  * @since PHP >=5.6
13:  * @version 1.0
14:  * @author Stanislav WEB | Lugansk <stanisov@gmail.com>
15:  * @filesource /Application/Modules/Rest/CategoryDTO.php
16:  */
17: class CategoryDTO extends AbstractDTO
18: {
19:     /**
20:      * Categories collection
21:      *
22:      * @var array
23:      */
24:     public $categories = [];
25:
26:     /**
27:      * Setup categories
28:      *
29:      * @param \Phalcon\Mvc\Model\Resultset\Simple $categories
30:      * @return $this
31:      */
32:     public function setCategories(\Phalcon\Mvc\Model\Resultset\Simple $categories) {
33:
34:         $this->categories = Node::setNestedTree($categories->toArray());
35:         $this->categories['total'] = $this->total($categories);
36:         $this->categories['limit'] = $this->limit($categories);
37:         $this->categories['offset'] = $this->offset();
38:
39:         return $this;
40:     }
41:
42:     /**
43:      * Reverse object to real array for all public properties
44:      *
45:      * @param object $object
46:      * @return mixed
47:      */
48:     public function toArray() {
49:         return  get_object_vars($this);
50:     }
51: }
52:

		Phalcon REST API API documentation generated by ApiGen

redpajama_set_name: RedPajamaGithub


text:
package aQute.bnd.component;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import org.osgi.service.component.annotations.ReferenceCardinality;

import aQute.bnd.header.Attrs;
import aQute.bnd.header.OSGiHeader;
import aQute.bnd.header.Parameters;
import aQute.bnd.osgi.Analyzer;
import aQute.bnd.osgi.Clazz;
import aQute.bnd.osgi.Constants;
import aQute.bnd.osgi.Descriptors;
import aQute.bnd.osgi.Instruction;
import aQute.bnd.osgi.Instructions;
import aQute.bnd.osgi.Processor;
import aQute.bnd.service.AnalyzerPlugin;
import aQute.bnd.version.Version;
import aQute.bnd.xmlattribute.XMLAttributeFinder;
import aQute.lib.strings.Strings;

/**
 * Analyze the class space for any classes that have an OSGi annotation for DS.
 */
public class DSAnnotations implements AnalyzerPlugin {

	public enum Options {
		inherit, felixExtensions, extender, nocapabilities, norequirements,

		version {
			@Override
			void process(DSAnnotations anno, Attrs attrs) {
				String v = attrs.get("minimum");
				if (v != null && v.length() > 0) {
					anno.minVersion = new Version(v);
				}
			}

			@Override
			void reset(DSAnnotations anno) {
				anno.minVersion = AnnotationReader.V1_3;
			}
		};

		void process(DSAnnotations anno, Attrs attrs) {

		}

		void reset(DSAnnotations anno) {

		}

		static void parseOption(Map.Entry<String,Attrs> entry, EnumSet<Options> options, DSAnnotations state) {
			String s = entry.getKey();
			boolean negation = false;
			if (s.startsWith("!")) {
				negation = true;
				s = s.substring(1);
			}
			Options option = Options.valueOf(s);
			if (negation) {
				options.remove(option);
				option.reset(state);
			} else {
				options.add(option);
				Attrs attrs;
				if ((attrs = entry.getValue()) != null) {
					option.process(state, attrs);
				}
			}

		}
	};

	Version minVersion;

	public boolean analyzeJar(Analyzer analyzer) throws Exception {
		Parameters header = OSGiHeader.parseHeader(analyzer.getProperty(Constants.DSANNOTATIONS, "*"));
		if (header.size() == 0)
			return false;

		minVersion = AnnotationReader.V1_3;
		Parameters optionsHeader = OSGiHeader.parseHeader(analyzer.mergeProperties(Constants.DSANNOTATIONS_OPTIONS));
		EnumSet<Options> options = EnumSet.noneOf(Options.class);
		for (Map.Entry<String,Attrs> entry : optionsHeader.entrySet()) {
			try {
				Options.parseOption(entry, options, this);
			} catch (IllegalArgumentException e) {
				analyzer.error("Unrecognized %s value %s with attributes %s, expected values are %s",
						Constants.DSANNOTATIONS_OPTIONS, entry.getKey(), entry.getValue(),
						EnumSet.allOf(Options.class));
			}
		}
		// obsolete but backwards compatible, use the options instead
		if (Processor.isTrue(analyzer.getProperty("-dsannotations-inherit")))
			options.add(Options.inherit);
		if (Processor.isTrue(analyzer.getProperty("-ds-felix-extensions")))
			options.add(Options.felixExtensions);

		Instructions instructions = new Instructions(header);
		Collection<Clazz> list = analyzer.getClassspace().values();
		String sc = analyzer.getProperty(Constants.SERVICE_COMPONENT);
		List<String> names = new ArrayList<String>();
		if (sc != null && sc.trim().length() > 0)
			names.add(sc);

		TreeSet<String> provides = new TreeSet<String>();
		TreeSet<String> requires = new TreeSet<String>();
		Version maxVersion = AnnotationReader.V1_0;

		XMLAttributeFinder finder = new XMLAttributeFinder(analyzer);
		boolean componentProcessed = false;
		for (Clazz c : list) {
			for (Instruction instruction : instructions.keySet()) {

				if (instruction.matches(c.getFQN())) {
					if (instruction.isNegated())
						break;
					ComponentDef definition = AnnotationReader.getDefinition(c, analyzer, options, finder, minVersion);
					if (definition != null) {
						componentProcessed = true;
						definition.sortReferences();
						definition.prepare(analyzer);

						String name = "OSGI-INF/"
								+ analyzer.validResourcePath(definition.name, "Invalid component name") + ".xml";
						names.add(name);
						analyzer.getJar().putResource(name, new TagResource(definition.getTag()));

						if (definition.service != null && !options.contains(Options.nocapabilities)) {
							String[] objectClass = new String[definition.service.length];

							for (int i = 0; i < definition.service.length; i++) {
								Descriptors.TypeRef tr = definition.service[i];
								objectClass[i] = tr.getFQN();
							}
							Arrays.sort(objectClass);
							addServiceCapability(objectClass, provides);
						}

						if (!options.contains(Options.norequirements)) {
							MergedRequirement serviceReqMerge = new MergedRequirement("osgi.service");
							for (ReferenceDef ref : definition.references.values()) {
								addServiceRequirement(ref, serviceReqMerge);
							}
							requires.addAll(serviceReqMerge.toStringList());
						}
						maxVersion = ComponentDef.max(maxVersion, definition.version);
					}
				}
			}
		}
		if (componentProcessed
				&& (options.contains(Options.extender) || (maxVersion.compareTo(AnnotationReader.V1_3) >= 0))) {
			maxVersion = ComponentDef.max(maxVersion, AnnotationReader.V1_3);
			addExtenderRequirement(requires, maxVersion);
		}
		sc = Processor.append(names.toArray(new String[0]));
		analyzer.setProperty(Constants.SERVICE_COMPONENT, sc);
		updateHeader(analyzer, Constants.REQUIRE_CAPABILITY, requires);
		updateHeader(analyzer, Constants.PROVIDE_CAPABILITY, provides);
		return false;
	}

	private void addServiceCapability(String[] objectClass, Set<String> provides) {
		if (objectClass.length > 0) {
			Parameters p = new Parameters();
			Attrs a = new Attrs();
			StringBuilder sb = new StringBuilder();
			String sep = "";
			for (String oc : objectClass) {
				sb.append(sep).append(oc);
				sep = ",";
			}
			a.put("objectClass:List<String>", sb.toString());
			p.put("osgi.service", a);
			String s = p.toString();
			provides.add(s);
		}
	}

	private void addServiceRequirement(ReferenceDef ref, MergedRequirement requires) {
		String objectClass = ref.service;
		ReferenceCardinality cardinality = ref.cardinality;
		boolean optional = cardinality == ReferenceCardinality.OPTIONAL || cardinality == ReferenceCardinality.MULTIPLE;
		boolean multiple = cardinality == ReferenceCardinality.MULTIPLE
				|| cardinality == ReferenceCardinality.AT_LEAST_ONE;

		String filter = "(objectClass=" + objectClass + ")";
		requires.put(filter, "active", optional, multiple);
	}

	private void addExtenderRequirement(Set<String> requires, Version version) {
		Version next = new Version(version.getMajor() + 1);
		Parameters p = new Parameters();
		Attrs a = new Attrs();
		a.put(Constants.FILTER_DIRECTIVE,
				"\"(&(osgi.extender=osgi.component)(version>=" + version + ")(!(version>=" + next + ")))\"");
		p.put("osgi.extender", a);
		String s = p.toString();
		requires.add(s);
	}

	/**
	 * Updates specified header, sorting and removing duplicates. Destroys
	 * contents of set parameter.
	 *
	 * @param analyzer
	 * @param name header name
	 * @param set values to add to header; contents are not preserved.
	 */
	private void updateHeader(Analyzer analyzer, String name, TreeSet<String> set) {
		if (!set.isEmpty()) {
			String value = analyzer.getProperty(name);
			if (value != null) {
				Parameters p = OSGiHeader.parseHeader(value);
				for (Map.Entry<String,Attrs> entry : p.entrySet()) {
					StringBuilder sb = new StringBuilder(entry.getKey());
					if (entry.getValue() != null) {
						sb.append(";");
						entry.getValue().append(sb);
					}
					set.add(sb.toString());
				}
			}
			String header = Strings.join(set);
			analyzer.setProperty(name, header);
		}
	}

	@Override
	public String toString() {
		return "DSAnnotations";
	}
}


text:
package org.jetbrains.plugins.javaFX.fxml;

import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.application.PluginPathManager;
import com.intellij.psi.codeStyle.JavaCodeStyleSettings;
import com.intellij.util.VisibilityUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.javaFX.fxml.codeInsight.inspections.JavaFxUnresolvedFxIdReferenceInspection;

import java.util.List;

public class JavaFXUnresolvedFxIdReferenceInspectionTest extends AbstractJavaFXQuickFixTest {

  @Override
  protected void enableInspections() {
    myFixture.enableInspections(new JavaFxUnresolvedFxIdReferenceInspection());
  }

  public void testUnknownRef() {
    doTest("Controller", VisibilityUtil.ESCALATE_VISIBILITY);
  }

  public void testRootType() {
    myFixture.configureByFiles(getTestName(true) + ".fxml");
    final List<IntentionAction> intentionActions = myFixture.filterAvailableIntentions(getHint("unknown"));
    assertEmpty(intentionActions);
  }

  public void testIncludeBtnWithController() {
    myFixture.addFileToProject("btn.fxml", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                                           "<?import javafx.scene.control.*?>\n" +
                                           "<Button/>");
    doTest("MyController", VisibilityUtil.ESCALATE_VISIBILITY);
  }

  public void testFieldsFromControllerSuper() {
    myFixture.addClass("import javafx.scene.control.RadioButton;\n" +
                       "public class SuperController {\n" +
                       "    public RadioButton option1;\n" +
                       "}\n");
    myFixture.addClass("public class Controller extends SuperController {}");
    final String testFxml = getTestName(true) + ".fxml";
    myFixture.configureByFile(testFxml);
    myFixture.testHighlighting(true, false, false, testFxml);
  }

  private void doTest(final String controllerName, final String defaultVisibility) {
    JavaCodeStyleSettings settings = JavaCodeStyleSettings.getInstance(getProject());
    settings.VISIBILITY = defaultVisibility;
    doTest(controllerName);
  }

  private void doTest(final String controllerName) {
    myFixture.configureByFiles(getTestName(true) + ".fxml", controllerName + ".java");
    final IntentionAction singleIntention = myFixture.findSingleIntention(getHint("unknown"));
    assertNotNull(singleIntention);
    myFixture.launchAction(singleIntention);
    myFixture.checkResultByFile(controllerName + ".java", controllerName + "_after.java", true);
  }

  @Override
  protected String getHint(String tagName) {
    return "Create field '" + tagName + "'";
  }

  @NotNull
  @Override
  protected String getTestDataPath() {
    return PluginPathManager.getPluginHomePath("javaFX") + "/testData/inspections/unresolvedFxId/";
  }
}


text:
#ifndef __INCORE_DOT_H__
#define __INCORE_DOT_H__

#include <linux/fs.h>

#define DIO_WAIT	0x00000010
#define DIO_METADATA	0x00000020
#define DIO_ALL		0x00000100

struct gfs2_log_operations;
struct gfs2_log_element;
struct gfs2_holder;
struct gfs2_glock;
struct gfs2_quota_data;
struct gfs2_trans;
struct gfs2_ail;
struct gfs2_jdesc;
struct gfs2_sbd;

typedef void (*gfs2_glop_bh_t) (struct gfs2_glock *gl, unsigned int ret);

/*
 * Structure of operations that are associated with each
 * type of element in the log.
 */

struct gfs2_log_operations {
	void (*lo_add) (struct gfs2_sbd *sdp, struct gfs2_log_element *le);
	void (*lo_incore_commit) (struct gfs2_sbd *sdp, struct gfs2_trans *tr);
	void (*lo_before_commit) (struct gfs2_sbd *sdp);
	void (*lo_after_commit) (struct gfs2_sbd *sdp, struct gfs2_ail *ai);
	void (*lo_before_scan) (struct gfs2_jdesc *jd,
				struct gfs2_log_header_host *head, int pass);
	int (*lo_scan_elements) (struct gfs2_jdesc *jd, unsigned int start,
				 struct gfs2_log_descriptor *ld, __be64 *ptr,
				 int pass);
	void (*lo_after_scan) (struct gfs2_jdesc *jd, int error, int pass);
	const char *lo_name;
};

struct gfs2_log_element {
	struct list_head le_list;
	const struct gfs2_log_operations *le_ops;
};

struct gfs2_bitmap {
	struct buffer_head *bi_bh;
	char *bi_clone;
	u32 bi_offset;
	u32 bi_start;
	u32 bi_len;
};

struct gfs2_rgrpd {
	struct list_head rd_list;	/* Link with superblock */
	struct list_head rd_list_mru;
	struct list_head rd_recent;	/* Recently used rgrps */
	struct gfs2_glock *rd_gl;	/* Glock for this rgrp */
	struct gfs2_rindex_host rd_ri;
	struct gfs2_rgrp_host rd_rg;
	u64 rd_rg_vn;
	struct gfs2_bitmap *rd_bits;
	unsigned int rd_bh_count;
	struct mutex rd_mutex;
	u32 rd_free_clone;
	struct gfs2_log_element rd_le;
	u32 rd_last_alloc_data;
	u32 rd_last_alloc_meta;
	struct gfs2_sbd *rd_sbd;
};

enum gfs2_state_bits {
	BH_Pinned = BH_PrivateStart,
	BH_Escaped = BH_PrivateStart + 1,
};

BUFFER_FNS(Pinned, pinned)
TAS_BUFFER_FNS(Pinned, pinned)
BUFFER_FNS(Escaped, escaped)
TAS_BUFFER_FNS(Escaped, escaped)

struct gfs2_bufdata {
	struct buffer_head *bd_bh;
	struct gfs2_glock *bd_gl;

	struct list_head bd_list_tr;
	struct gfs2_log_element bd_le;

	struct gfs2_ail *bd_ail;
	struct list_head bd_ail_st_list;
	struct list_head bd_ail_gl_list;
};

struct gfs2_glock_operations {
	void (*go_xmote_th) (struct gfs2_glock *gl);
	void (*go_xmote_bh) (struct gfs2_glock *gl);
	void (*go_drop_th) (struct gfs2_glock *gl);
	void (*go_inval) (struct gfs2_glock *gl, int flags);
	int (*go_demote_ok) (struct gfs2_glock *gl);
	int (*go_lock) (struct gfs2_holder *gh);
	void (*go_unlock) (struct gfs2_holder *gh);
	const int go_type;
};

enum {
	/* Actions */
	HIF_MUTEX		= 0,
	HIF_PROMOTE		= 1,

	/* States */
	HIF_HOLDER		= 6,
	HIF_FIRST		= 7,
	HIF_ABORTED		= 9,
	HIF_WAIT		= 10,
};

struct gfs2_holder {
	struct list_head gh_list;

	struct gfs2_glock *gh_gl;
	pid_t gh_owner_pid;
	unsigned int gh_state;
	unsigned gh_flags;

	int gh_error;
	unsigned long gh_iflags;
	unsigned long gh_ip;
};

enum {
	GLF_LOCK		= 1,
	GLF_STICKY		= 2,
	GLF_DEMOTE		= 3,
	GLF_DIRTY		= 5,
};

struct gfs2_glock {
	struct hlist_node gl_list;
	unsigned long gl_flags;		/* GLF_... */
	struct lm_lockname gl_name;
	atomic_t gl_ref;

	spinlock_t gl_spin;

	unsigned int gl_state;
	unsigned int gl_hash;
	unsigned int gl_demote_state; /* state requested by remote node */
	unsigned long gl_demote_time; /* time of first demote request */
	pid_t gl_owner_pid;
	unsigned long gl_ip;
	struct list_head gl_holders;
	struct list_head gl_waiters1;	/* HIF_MUTEX */
	struct list_head gl_waiters3;	/* HIF_PROMOTE */

	const struct gfs2_glock_operations *gl_ops;

	struct gfs2_holder *gl_req_gh;
	gfs2_glop_bh_t gl_req_bh;

	void *gl_lock;
	char *gl_lvb;
	atomic_t gl_lvb_count;

	u64 gl_vn;
	unsigned long gl_stamp;
	void *gl_object;

	struct list_head gl_reclaim;

	struct gfs2_sbd *gl_sbd;

	struct inode *gl_aspace;
	struct gfs2_log_element gl_le;
	struct list_head gl_ail_list;
	atomic_t gl_ail_count;
};

struct gfs2_alloc {
	/* Quota stuff */

	struct gfs2_quota_data *al_qd[2*MAXQUOTAS];
	struct gfs2_holder al_qd_ghs[2*MAXQUOTAS];
	unsigned int al_qd_num;

	u32 al_requested; /* Filled in by caller of gfs2_inplace_reserve() */
	u32 al_alloced; /* Filled in by gfs2_alloc_*() */

	/* Filled in by gfs2_inplace_reserve() */

	unsigned int al_line;
	char *al_file;
	struct gfs2_holder al_ri_gh;
	struct gfs2_holder al_rgd_gh;
	struct gfs2_rgrpd *al_rgd;

};

enum {
	GIF_INVALID		= 0,
	GIF_QD_LOCKED		= 1,
	GIF_PAGED		= 2,
	GIF_SW_PAGED		= 3,
};

struct gfs2_inode {
	struct inode i_inode;
	struct gfs2_inum_host i_num;

	unsigned long i_flags;		/* GIF_... */

	struct gfs2_dinode_host i_di; /* To be replaced by ref to block */

	struct gfs2_glock *i_gl; /* Move into i_gh? */
	struct gfs2_holder i_iopen_gh;
	struct gfs2_holder i_gh; /* for prepare/commit_write only */
	struct gfs2_alloc i_alloc;
	u64 i_last_rg_alloc;

	spinlock_t i_spin;
	struct rw_semaphore i_rw_mutex;
	unsigned long i_last_pfault;

	struct buffer_head *i_cache[GFS2_MAX_META_HEIGHT];
};

/*
 * Since i_inode is the first element of struct gfs2_inode,
 * this is effectively a cast.
 */
static inline struct gfs2_inode *GFS2_I(struct inode *inode)
{
	return container_of(inode, struct gfs2_inode, i_inode);
}

/* To be removed? */
static inline struct gfs2_sbd *GFS2_SB(struct inode *inode)
{
	return inode->i_sb->s_fs_info;
}

enum {
	GFF_DID_DIRECT_ALLOC	= 0,
	GFF_EXLOCK = 1,
};

struct gfs2_file {
	unsigned long f_flags;		/* GFF_... */
	struct mutex f_fl_mutex;
	struct gfs2_holder f_fl_gh;
};

struct gfs2_revoke {
	struct gfs2_log_element rv_le;
	u64 rv_blkno;
};

struct gfs2_revoke_replay {
	struct list_head rr_list;
	u64 rr_blkno;
	unsigned int rr_where;
};

enum {
	QDF_USER		= 0,
	QDF_CHANGE		= 1,
	QDF_LOCKED		= 2,
};

struct gfs2_quota_lvb {
        __be32 qb_magic;
        u32 __pad;
        __be64 qb_limit;      /* Hard limit of # blocks to alloc */
        __be64 qb_warn;       /* Warn user when alloc is above this # */
        __be64 qb_value;       /* Current # blocks allocated */
};

struct gfs2_quota_data {
	struct list_head qd_list;
	unsigned int qd_count;

	u32 qd_id;
	unsigned long qd_flags;		/* QDF_... */

	s64 qd_change;
	s64 qd_change_sync;

	unsigned int qd_slot;
	unsigned int qd_slot_count;

	struct buffer_head *qd_bh;
	struct gfs2_quota_change *qd_bh_qc;
	unsigned int qd_bh_count;

	struct gfs2_glock *qd_gl;
	struct gfs2_quota_lvb qd_qb;

	u64 qd_sync_gen;
	unsigned long qd_last_warn;
	unsigned long qd_last_touched;
};

struct gfs2_log_buf {
	struct list_head lb_list;
	struct buffer_head *lb_bh;
	struct buffer_head *lb_real;
};

struct gfs2_trans {
	unsigned long tr_ip;

	unsigned int tr_blocks;
	unsigned int tr_revokes;
	unsigned int tr_reserved;

	struct gfs2_holder tr_t_gh;

	int tr_touched;

	unsigned int tr_num_buf;
	unsigned int tr_num_buf_new;
	unsigned int tr_num_buf_rm;
	struct list_head tr_list_buf;

	unsigned int tr_num_revoke;
	unsigned int tr_num_revoke_rm;
};

struct gfs2_ail {
	struct list_head ai_list;

	unsigned int ai_first;
	struct list_head ai_ail1_list;
	struct list_head ai_ail2_list;

	u64 ai_sync_gen;
};

struct gfs2_jdesc {
	struct list_head jd_list;

	struct inode *jd_inode;
	unsigned int jd_jid;
	int jd_dirty;

	unsigned int jd_blocks;
};

#define GFS2_GLOCKD_DEFAULT	1
#define GFS2_GLOCKD_MAX		16

#define GFS2_QUOTA_DEFAULT	GFS2_QUOTA_OFF
#define GFS2_QUOTA_OFF		0
#define GFS2_QUOTA_ACCOUNT	1
#define GFS2_QUOTA_ON		2

#define GFS2_DATA_DEFAULT	GFS2_DATA_ORDERED
#define GFS2_DATA_WRITEBACK	1
#define GFS2_DATA_ORDERED	2

struct gfs2_args {
	char ar_lockproto[GFS2_LOCKNAME_LEN]; /* Name of the Lock Protocol */
	char ar_locktable[GFS2_LOCKNAME_LEN]; /* Name of the Lock Table */
	char ar_hostdata[GFS2_LOCKNAME_LEN]; /* Host specific data */
	int ar_spectator; /* Don't get a journal because we're always RO */
	int ar_ignore_local_fs; /* Don't optimize even if local_fs is 1 */
	int ar_localflocks; /* Let the VFS do flock|fcntl locks for us */
	int ar_localcaching; /* Local-style caching (dangerous on multihost) */
	int ar_debug; /* Oops on errors instead of trying to be graceful */
	int ar_upgrade; /* Upgrade ondisk/multihost format */
	unsigned int ar_num_glockd; /* Number of glockd threads */
	int ar_posix_acl; /* Enable posix acls */
	int ar_quota; /* off/account/on */
	int ar_suiddir; /* suiddir support */
	int ar_data; /* ordered/writeback */
};

struct gfs2_tune {
	spinlock_t gt_spin;

	unsigned int gt_ilimit;
	unsigned int gt_ilimit_tries;
	unsigned int gt_ilimit_min;
	unsigned int gt_demote_secs; /* Cache retention for unheld glock */
	unsigned int gt_incore_log_blocks;
	unsigned int gt_log_flush_secs;
	unsigned int gt_jindex_refresh_secs; /* Check for new journal index */

	unsigned int gt_scand_secs;
	unsigned int gt_recoverd_secs;
	unsigned int gt_logd_secs;
	unsigned int gt_quotad_secs;

	unsigned int gt_quota_simul_sync; /* Max quotavals to sync at once */
	unsigned int gt_quota_warn_period; /* Secs between quota warn msgs */
	unsigned int gt_quota_scale_num; /* Numerator */
	unsigned int gt_quota_scale_den; /* Denominator */
	unsigned int gt_quota_cache_secs;
	unsigned int gt_quota_quantum; /* Secs between syncs to quota file */
	unsigned int gt_atime_quantum; /* Min secs between atime updates */
	unsigned int gt_new_files_jdata;
	unsigned int gt_new_files_directio;
	unsigned int gt_max_readahead; /* Max bytes to read-ahead from disk */
	unsigned int gt_lockdump_size;
	unsigned int gt_stall_secs; /* Detects trouble! */
	unsigned int gt_complain_secs;
	unsigned int gt_reclaim_limit; /* Max num of glocks in reclaim list */
	unsigned int gt_statfs_quantum;
	unsigned int gt_statfs_slow;
};

enum {
	SDF_JOURNAL_CHECKED	= 0,
	SDF_JOURNAL_LIVE	= 1,
	SDF_SHUTDOWN		= 2,
	SDF_NOATIME		= 3,
};

#define GFS2_FSNAME_LEN		256

struct gfs2_sbd {
	struct super_block *sd_vfs;
	struct super_block *sd_vfs_meta;
	struct kobject sd_kobj;
	unsigned long sd_flags;	/* SDF_... */
	struct gfs2_sb_host sd_sb;

	/* Constants computed on mount */

	u32 sd_fsb2bb;
	u32 sd_fsb2bb_shift;
	u32 sd_diptrs;	/* Number of pointers in a dinode */
	u32 sd_inptrs;	/* Number of pointers in a indirect block */
	u32 sd_jbsize;	/* Size of a journaled data block */
	u32 sd_hash_bsize;	/* sizeof(exhash block) */
	u32 sd_hash_bsize_shift;
	u32 sd_hash_ptrs;	/* Number of pointers in a hash block */
	u32 sd_qc_per_block;
	u32 sd_max_dirres;	/* Max blocks needed to add a directory entry */
	u32 sd_max_height;	/* Max height of a file's metadata tree */
	u64 sd_heightsize[GFS2_MAX_META_HEIGHT];
	u32 sd_max_jheight; /* Max height of journaled file's meta tree */
	u64 sd_jheightsize[GFS2_MAX_META_HEIGHT];

	struct gfs2_args sd_args;	/* Mount arguments */
	struct gfs2_tune sd_tune;	/* Filesystem tuning structure */

	/* Lock Stuff */

	struct lm_lockstruct sd_lockstruct;
	struct list_head sd_reclaim_list;
	spinlock_t sd_reclaim_lock;
	wait_queue_head_t sd_reclaim_wq;
	atomic_t sd_reclaim_count;
	struct gfs2_holder sd_live_gh;
	struct gfs2_glock *sd_rename_gl;
	struct gfs2_glock *sd_trans_gl;

	/* Inode Stuff */

	struct inode *sd_master_dir;
	struct inode *sd_jindex;
	struct inode *sd_inum_inode;
	struct inode *sd_statfs_inode;
	struct inode *sd_ir_inode;
	struct inode *sd_sc_inode;
	struct inode *sd_qc_inode;
	struct inode *sd_rindex;
	struct inode *sd_quota_inode;

	/* Inum stuff */

	struct mutex sd_inum_mutex;

	/* StatFS stuff */

	spinlock_t sd_statfs_spin;
	struct mutex sd_statfs_mutex;
	struct gfs2_statfs_change_host sd_statfs_master;
	struct gfs2_statfs_change_host sd_statfs_local;
	unsigned long sd_statfs_sync_time;

	/* Resource group stuff */

	u64 sd_rindex_vn;
	spinlock_t sd_rindex_spin;
	struct mutex sd_rindex_mutex;
	struct list_head sd_rindex_list;
	struct list_head sd_rindex_mru_list;
	struct list_head sd_rindex_recent_list;
	struct gfs2_rgrpd *sd_rindex_forward;
	unsigned int sd_rgrps;

	/* Journal index stuff */

	struct list_head sd_jindex_list;
	spinlock_t sd_jindex_spin;
	struct mutex sd_jindex_mutex;
	unsigned int sd_journals;
	unsigned long sd_jindex_refresh_time;

	struct gfs2_jdesc *sd_jdesc;
	struct gfs2_holder sd_journal_gh;
	struct gfs2_holder sd_jinode_gh;

	struct gfs2_holder sd_ir_gh;
	struct gfs2_holder sd_sc_gh;
	struct gfs2_holder sd_qc_gh;

	/* Daemon stuff */

	struct task_struct *sd_scand_process;
	struct task_struct *sd_recoverd_process;
	struct task_struct *sd_logd_process;
	struct task_struct *sd_quotad_process;
	struct task_struct *sd_glockd_process[GFS2_GLOCKD_MAX];
	unsigned int sd_glockd_num;

	/* Quota stuff */

	struct list_head sd_quota_list;
	atomic_t sd_quota_count;
	spinlock_t sd_quota_spin;
	struct mutex sd_quota_mutex;

	unsigned int sd_quota_slots;
	unsigned int sd_quota_chunks;
	unsigned char **sd_quota_bitmap;

	u64 sd_quota_sync_gen;
	unsigned long sd_quota_sync_time;

	/* Log stuff */

	spinlock_t sd_log_lock;

	unsigned int sd_log_blks_reserved;
	unsigned int sd_log_commited_buf;
	unsigned int sd_log_commited_revoke;

	unsigned int sd_log_num_gl;
	unsigned int sd_log_num_buf;
	unsigned int sd_log_num_revoke;
	unsigned int sd_log_num_rg;
	unsigned int sd_log_num_databuf;
	unsigned int sd_log_num_jdata;
	unsigned int sd_log_num_hdrs;

	struct list_head sd_log_le_gl;
	struct list_head sd_log_le_buf;
	struct list_head sd_log_le_revoke;
	struct list_head sd_log_le_rg;
	struct list_head sd_log_le_databuf;

	unsigned int sd_log_blks_free;
	struct mutex sd_log_reserve_mutex;

	u64 sd_log_sequence;
	unsigned int sd_log_head;
	unsigned int sd_log_tail;
	int sd_log_idle;

	unsigned long sd_log_flush_time;
	struct rw_semaphore sd_log_flush_lock;
	struct list_head sd_log_flush_list;

	unsigned int sd_log_flush_head;
	u64 sd_log_flush_wrapped;

	struct list_head sd_ail1_list;
	struct list_head sd_ail2_list;
	u64 sd_ail_sync_gen;

	/* Replay stuff */

	struct list_head sd_revoke_list;
	unsigned int sd_replay_tail;

	unsigned int sd_found_blocks;
	unsigned int sd_found_revokes;
	unsigned int sd_replayed_blocks;

	/* For quiescing the filesystem */

	struct gfs2_holder sd_freeze_gh;
	struct mutex sd_freeze_lock;
	unsigned int sd_freeze_count;

	/* Counters */

	atomic_t sd_glock_count;
	atomic_t sd_glock_held_count;
	atomic_t sd_inode_count;
	atomic_t sd_reclaimed;

	char sd_fsname[GFS2_FSNAME_LEN];
	char sd_table_name[GFS2_FSNAME_LEN];
	char sd_proto_name[GFS2_FSNAME_LEN];

	/* Debugging crud */

	unsigned long sd_last_warning;
	struct vfsmount *sd_gfs2mnt;
	struct dentry *debugfs_dir;    /* debugfs directory */
	struct dentry *debugfs_dentry_glocks; /* for debugfs */
};

#endif /* __INCORE_DOT_H__ */


text:
package jp.ne.opt.redshiftfake.read

import jawn.ast._

import scala.annotation.tailrec

class Jsonpaths(rawJsonpaths: String) {
  sealed abstract class Path
  object Path {
    case class Property(name: String) extends Path
    case class Index(n: Int) extends Path
  }

  private[this] class Jsonpath(rawJsonpath: String) {
    /**
     * FIXME: Too naive and inefficient implementation.
     */
    private[this] val parsedJsonpath: Seq[Path] = rawJsonpath.drop(1).split(']').map(_.drop(1)).map { path =>
      val singleQuoteLiteral = """'(\w*)'""".r
      val doubleQuoteLiteral = """"(\w*)"""".r
      path match {
        case singleQuoteLiteral(string) => Path.Property(string)
        case doubleQuoteLiteral(string) => Path.Property(string)
        case _ => Path.Index(path.toInt)
      }
    }

    def jValueOf(parsedDocument: JValue): JValue = {
      @tailrec def loop(j: JValue, paths: Seq[Path]): JValue = paths match {
        case Nil => j
        case h +: t => h match {
          case Path.Property(name) => loop(j.get(name), t)
          case Path.Index(n) => loop(j.get(n), t)
        }
      }
      loop(parsedDocument, parsedJsonpath)
    }
  }

  class IndexedReader(document: String) {
    private[this] val parsedDocument = JParser.parseFromString(document).get

    def valueAt(index: Int): Option[String] = {
      val jValue = parsedJsonpaths(index).jValueOf(parsedDocument)
      jValue match {
        case JNull => None
        case JString(s) => Some(s)
        case _ => Some(jValue.render())
      }
    }
  }

  private[this] val parsedJsonpaths: Vector[Jsonpath] = JParser.parseFromString(rawJsonpaths).toOption.map(_.get("jsonpaths")).collect {
    case JArray(array) => array.map(p => new Jsonpath(p.asString))
  }.get.toVector

  val columnSize = parsedJsonpaths.size

  def mkReader(document: String): IndexedReader = new IndexedReader(document)
}


text:
require 'ostruct'
module PartsFactory

  def self.build(config, parts_class = Parts)
    parts_class.new(
      config.collect {|part_config|
        create_part(part_config) } )
  end

  def self.create_part(part_config)
    OpenStruct.new(
      name:        part_config[0],
      description: part_config[1],
      needs_spare: part_config.fetch(2, true))
  end
end


text:
    #include <win32/osMutexImpl.h>
#elif AMDT_BUILD_TARGET == AMDT_LINUX_OS
    #include <linux/osMutexImpl.h>
#else
    #error Unknown build configuration!
#endif

// Local:
#include <amdt_os_wrappers/Include/osMutex.h>

// ---------------------------------------------------------------------------
// Name:        osMutex::osMutex
// Description: Constructor
// Author:      AMD Developer Tools Team
// Date:        29/3/2004
// ---------------------------------------------------------------------------
osMutex::osMutex()
{
    // Create our OS specific Mutex implementation:
    _pImplementation = new osMutexImpl;

}

// ---------------------------------------------------------------------------
// Name:        osMutex::~osMutex
// Description: Destructor.
// Author:      AMD Developer Tools Team
// Date:        29/3/2004
// ---------------------------------------------------------------------------
osMutex::~osMutex()
{
    delete _pImplementation;
    _pImplementation = NULL;
}

// ---------------------------------------------------------------------------
// Name:        osMutex::lock
// Description: "Locks" (try to own) the Mutex. If the Mutex is currently owned
//              by another thread, this function will halt its calling thread until
//              the Mutex is "Unlocked".
// Return Val:  bool - Success / failure.
// Author:      AMD Developer Tools Team
// Date:        30/3/2004
// ---------------------------------------------------------------------------
bool osMutex::lock()
{
    return _pImplementation->lock();
}

// ---------------------------------------------------------------------------
// Name:        osMutex::unlock
// Description: Unlocks the Mutex. (Release its ownership).
// Return Val:  bool - Success / failure.
// Author:      AMD Developer Tools Team
// Date:        30/3/2004
// ---------------------------------------------------------------------------
bool osMutex::unlock()
{
    return _pImplementation->unlock();
}


text:
package com.sequoiadb.spark.partitioner

/**
 * Source File Name = SequoiadbPartition.scala
 * Description      = Partition unit for SequoiaDB
 * When/how to use  = SequoiadbPartition is used by RDD to get partition information
 * Restrictions     = N/A
 * Change Activity:
 * Date     Who                Description
 * ======== ================== ================================================
 * 20150305 Tao Wang           Initial Draft
 */
import org.apache.spark.Partition
import org.bson.BSONObject
import org.bson.BasicBSONObject
import org.bson.types.BasicBSONList

/**
 * A SequoiaDB Partition is a minimum unit of repeatable-read operation
 * In the current release each SequoiadbPartition represent a shard
 * in the cluster, that means whenever a partition operation failed during the middle
 * it's always safe to restart from scratch on a different node
 * @param index Partition index
 * @param hosts Hosts that hold partition data
 * @param collection The collection need to read for such partition
 * @param metaObjStr When query by table scan, will be used
 */
case class SequoiadbPartition(
  var index: Int,
  scanType: Int,
  hosts: Seq[SequoiadbHost],
  collection: SequoiadbCollection,
  metaObjStr: Option[String]) extends Partition


text:
/*
 * 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 com.facebook.presto.sql.parser;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenSource;

import java.util.List;
import java.util.Objects;
import java.util.Set;

import static java.util.Objects.requireNonNull;

public class StatementSplitter
{
    private final List<Statement> completeStatements;
    private final String partialStatement;

    public StatementSplitter(String sql)
    {
        this(sql, ImmutableSet.of(";"));
    }

    public StatementSplitter(String sql, Set<String> delimiters)
    {
        TokenSource tokens = getLexer(sql, delimiters);
        ImmutableList.Builder<Statement> list = ImmutableList.builder();
        StringBuilder sb = new StringBuilder();
        while (true) {
            Token token = tokens.nextToken();
            if (token.getType() == Token.EOF) {
                break;
            }
            if (token.getType() == SqlBaseParser.DELIMITER) {
                String statement = sb.toString().trim();
                if (!statement.isEmpty()) {
                    list.add(new Statement(statement, token.getText()));
                }
                sb = new StringBuilder();
            }
            else {
                sb.append(token.getText());
            }
        }
        this.completeStatements = list.build();
        this.partialStatement = sb.toString().trim();
    }

    public List<Statement> getCompleteStatements()
    {
        return completeStatements;
    }

    public String getPartialStatement()
    {
        return partialStatement;
    }

    public static String squeezeStatement(String sql)
    {
        TokenSource tokens = getLexer(sql, ImmutableSet.<String>of());
        StringBuilder sb = new StringBuilder();
        while (true) {
            Token token = tokens.nextToken();
            if (token.getType() == Token.EOF) {
                break;
            }
            if (token.getType() == SqlBaseLexer.WS) {
                sb.append(' ');
            }
            else {
                sb.append(token.getText());
            }
        }
        return sb.toString().trim();
    }

    public static boolean isEmptyStatement(String sql)
    {
        TokenSource tokens = getLexer(sql, ImmutableSet.<String>of());
        while (true) {
            Token token = tokens.nextToken();
            if (token.getType() == Token.EOF) {
                return true;
            }
            if (token.getChannel() != Token.HIDDEN_CHANNEL) {
                return false;
            }
        }
    }

    private static TokenSource getLexer(String sql, Set<String> terminators)
    {
        requireNonNull(sql, "sql is null");
        CharStream stream = new CaseInsensitiveStream(new ANTLRInputStream(sql));
        return new DelimiterLexer(stream, terminators);
    }

    public static class Statement
    {
        private final String statement;
        private final String terminator;

        public Statement(String statement, String terminator)
        {
            this.statement = requireNonNull(statement, "statement is null");
            this.terminator = requireNonNull(terminator, "terminator is null");
        }

        public String statement()
        {
            return statement;
        }

        public String terminator()
        {
            return terminator;
        }

        @Override
        public boolean equals(Object obj)
        {
            if (this == obj) {
                return true;
            }
            if ((obj == null) || (getClass() != obj.getClass())) {
                return false;
            }
            Statement o = (Statement) obj;
            return Objects.equals(statement, o.statement) &&
                    Objects.equals(terminator, o.terminator);
        }

        @Override
        public int hashCode()
        {
            return Objects.hash(statement, terminator);
        }

        @Override
        public String toString()
        {
            return statement + terminator;
        }
    }
}


text:
@class OCMockObject;

@interface TestHelper : NSObject

+ (OCMockObject *)mockAPIClientReturningMatches:(NSArray *)matches;
+ (OCMockObject *)mockAPIClientReturningPlayers:(NSArray *)players;
+ (OCMockObject *)mockAPIClientReturningRankedPlayers:(NSArray *)players;

@end


text:
namespace Microsoft.Azure.Synapse
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for SparkBatchOperations.
    /// </summary>
    public static partial class SparkBatchOperationsExtensions
    {
            /// <summary>
            /// List all spark batch jobs which are running under a particular spark pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='fromParameter'>
            /// Optional param specifying which index the list should begin from.
            /// </param>
            /// <param name='size'>
            /// Optional param specifying the size of the returned list.
            /// By default it is 20 and that is the maximum.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            public static ExtendedLivyListBatchResponse List(this ISparkBatchOperations operations, string workspaceName, string sparkPoolName, int? fromParameter = default(int?), int? size = default(int?), bool? detailed = default(bool?))
            {
                return operations.ListAsync(workspaceName, sparkPoolName, fromParameter, size, detailed).GetAwaiter().GetResult();
            }

            /// <summary>
            /// List all spark batch jobs which are running under a particular spark pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='fromParameter'>
            /// Optional param specifying which index the list should begin from.
            /// </param>
            /// <param name='size'>
            /// Optional param specifying the size of the returned list.
            /// By default it is 20 and that is the maximum.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ExtendedLivyListBatchResponse> ListAsync(this ISparkBatchOperations operations, string workspaceName, string sparkPoolName, int? fromParameter = default(int?), int? size = default(int?), bool? detailed = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListWithHttpMessagesAsync(workspaceName, sparkPoolName, fromParameter, size, detailed, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Create new spark batch job.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='livyRequest'>
            /// Livy compatible batch job request payload.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            public static ExtendedLivyBatchResponse Create(this ISparkBatchOperations operations, string workspaceName, string sparkPoolName, ExtendedLivyBatchRequest livyRequest, bool? detailed = default(bool?))
            {
                return operations.CreateAsync(workspaceName, sparkPoolName, livyRequest, detailed).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Create new spark batch job.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='livyRequest'>
            /// Livy compatible batch job request payload.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ExtendedLivyBatchResponse> CreateAsync(this ISparkBatchOperations operations, string workspaceName, string sparkPoolName, ExtendedLivyBatchRequest livyRequest, bool? detailed = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateWithHttpMessagesAsync(workspaceName, sparkPoolName, livyRequest, detailed, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets a single spark batch job.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='batchId'>
            /// Identifier for the batch job.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            public static ExtendedLivyBatchResponse Get(this ISparkBatchOperations operations, string workspaceName, string sparkPoolName, int batchId, bool? detailed = default(bool?))
            {
                return operations.GetAsync(workspaceName, sparkPoolName, batchId, detailed).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets a single spark batch job.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='batchId'>
            /// Identifier for the batch job.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ExtendedLivyBatchResponse> GetAsync(this ISparkBatchOperations operations, string workspaceName, string sparkPoolName, int batchId, bool? detailed = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(workspaceName, sparkPoolName, batchId, detailed, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Cancels a running spark batch job.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='batchId'>
            /// Identifier for the batch job.
            /// </param>
            public static void Delete(this ISparkBatchOperations operations, string workspaceName, string sparkPoolName, int batchId)
            {
                operations.DeleteAsync(workspaceName, sparkPoolName, batchId).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Cancels a running spark batch job.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='batchId'>
            /// Identifier for the batch job.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task DeleteAsync(this ISparkBatchOperations operations, string workspaceName, string sparkPoolName, int batchId, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.DeleteWithHttpMessagesAsync(workspaceName, sparkPoolName, batchId, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

    }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Bull. Herb. Boissier 1: 36 (1892)

#### Original name
Callopisma ochrochroum Müll. Arg.

### Remarks
null


text:
// This file is automatically generated.

package adila.db;

/*
 * LG
 *
 * DEVICE: cosmo_724-xxx
 * MODEL: LG-P920h
 */
final class cosmo5f7242dxxx {
    public static final String DATA = "LG||";
}


text:
package lizard.system;

/** Any software component that has a start-stop lifecycle  */

public interface LifeCycle {
    enum Status { UNSTARTED, FAILED, STOPPED, OK }

    /** Start service element.  When this call returns the element is usable. */
    public void start() ;

    /** Stop this service - no guarantee that the element has actually stopped
     * when this call returns but the eleemnt is to be considered not for use.
     */
    public void stop() ;

    /** "Running" means after .start() and before .stop() */
    public boolean isRunning() ;

    /** A service element can go bad */
    public boolean hasFailed() ;

    public void setStatus(Status status) ;

//    public void addLifeCycleListener(LifeCycle.Listener listener);
//
//    public void removeLifeCycleListener(LifeCycle.Listener listener);
//
//    /** Listener.
//     * A listener for Lifecycle events.
//     */
//    public interface Listener extends EventListener
//    {
//        public void lifeCycleStarting(LifeCycle event);
//        public void lifeCycleStarted(LifeCycle event);
//        public void lifeCycleFailure(LifeCycle event,Throwable cause);
//        public void lifeCycleStopping(LifeCycle event);
//        public void lifeCycleStopped(LifeCycle event);
//    }
}


text:
from django.http import HttpResponse
from ServerApp.forms import UploadFileForm
from ServerApp.upload_file_handler import handle_uploaded_file
from django.views.decorators.csrf import csrf_exempt

def index(request):
    return HttpResponse("Hello, world. You're at the RFHistory index.")

@csrf_exempt
def upload_output(request):
    if request.method == 'POST':
        form = UploadFileForm(request.POST, request.FILES)
        if form.is_valid():
            handle_uploaded_file(request.FILES['file'])
            return HttpResponse(status=200)
    return HttpResponse(status=400)


text:
Contact Us

Lorem ipsum dolor sit amet consectetur.

                    <form name="sentMessage" id="contactForm" novalidate method="POST" action="http://formspree.io/byronkosciuczyk@gmail.com">

                                    <input type="text" name="name" class="form-control" placeholder="Your Name *" id="name" required data-validation-required-message="Please enter your name.">

                                    <input type="email" name="email" class="form-control" placeholder="Your Email *" id="email" required data-validation-required-message="Please enter your email address.">

                                    <input type="tel" name="phone" class="form-control" placeholder="Your Phone" id="phone" >

                                    <textarea class="form-control" name="message" placeholder="Your Message *" id="message" required data-validation-required-message="Please enter a message."></textarea>

                                <button type="submit" class="btn btn-xl">Send Message</button>

                    </form>


text:
@implementation NUIButtonRenderer

+ (void)render:(UIButton*)button withClass:(NSString*)className
{
    [NUIViewRenderer renderSize:button withClass:className];
    // UIButtonTypeRoundedRect's first two sublayers contain its background and border, which
    // need to be hidden for NUI's rendering to be displayed correctly. Ideally we would switch
    // over to a UIButtonTypeCustom, but this appears to be impossible.
    if (button.buttonType == UIButtonTypeRoundedRect) {
        if ([button.layer.sublayers count] > 2) {
            [button.layer.sublayers[0] setOpacity:0.0f];
            [button.layer.sublayers[1] setOpacity:0.0f];
        }
    }

    // Set padding
    if ([NUISettings hasProperty:@"padding" withClass:className]) {
        [button setTitleEdgeInsets:[NUISettings getEdgeInsets:@"padding" withClass:className]];
    }

    // Set background color
    if ([NUISettings hasProperty:@"background-color" withClass:className]) {
        [button setBackgroundImage:[NUISettings getImageFromColor:@"background-color" withClass:className] forState:UIControlStateNormal];
    }
    if ([NUISettings hasProperty:@"background-color-selected" withClass:className]) {
        [button setBackgroundImage:[NUISettings getImageFromColor:@"background-color-selected" withClass:className] forState:UIControlStateSelected];
    }
    if ([NUISettings hasProperty:@"background-color-highlighted" withClass:className]) {
        [button setBackgroundImage:[NUISettings getImageFromColor:@"background-color-highlighted" withClass:className] forState:UIControlStateHighlighted];
    }
    if ([NUISettings hasProperty:@"background-color-disabled" withClass:className]) {
        [button setBackgroundImage:[NUISettings getImageFromColor:@"background-color-disabled" withClass:className] forState:UIControlStateDisabled];
    }

    // Set background gradient
    if ([NUISettings hasProperty:@"background-color-top" withClass:className]) {
        CAGradientLayer *gradientLayer = [NUIGraphics
                                          gradientLayerWithTop:[NUISettings getColor:@"background-color-top" withClass:className]
                                          bottom:[NUISettings getColor:@"background-color-bottom" withClass:className]
                                          frame:button.bounds];
        int backgroundLayerIndex = [button.layer.sublayers count] == 1 ? 0 : 1;
        if (button.nuiIsApplied) {
            [[button.layer.sublayers objectAtIndex:backgroundLayerIndex] removeFromSuperlayer];
        }
        [button.layer insertSublayer:gradientLayer atIndex:backgroundLayerIndex];
    }

    // Set background image
    if ([NUISettings hasProperty:@"background-image" withClass:className]) {
        [button setBackgroundImage:[NUISettings getImage:@"background-image" withClass:className] forState:UIControlStateNormal];
    }
    if ([NUISettings hasProperty:@"background-image-selected" withClass:className]) {
        [button setBackgroundImage:[NUISettings getImage:@"background-image-selected" withClass:className] forState:UIControlStateSelected];
    }
    if ([NUISettings hasProperty:@"background-image-highlighted" withClass:className]) {
        [button setBackgroundImage:[NUISettings getImage:@"background-image-highlighted" withClass:className] forState:UIControlStateHighlighted];
    }
    if ([NUISettings hasProperty:@"background-image-disabled" withClass:className]) {
        [button setBackgroundImage:[NUISettings getImage:@"background-image-disabled" withClass:className] forState:UIControlStateDisabled];
    }

    [NUILabelRenderer renderText:button.titleLabel withClass:className];

    // Set text align
    if ([NUISettings hasProperty:@"text-align" withClass:className]) {
        [button setContentHorizontalAlignment:[NUISettings getControlContentHorizontalAlignment:@"text-align" withClass:className]];
    }

    // Set font color
    if ([NUISettings hasProperty:@"font-color" withClass:className]) {
        [button setTitleColor:[NUISettings getColor:@"font-color" withClass:className] forState:UIControlStateNormal];
    }
    if ([NUISettings hasProperty:@"font-color-selected" withClass:className]) {
        [button setTitleColor:[NUISettings getColor:@"font-color-selected" withClass:className] forState:UIControlStateSelected];
    }
    if ([NUISettings hasProperty:@"font-color-highlighted" withClass:className]) {
        [button setTitleColor:[NUISettings getColor:@"font-color-highlighted" withClass:className] forState:UIControlStateHighlighted];
    }
    if ([NUISettings hasProperty:@"font-color-disabled" withClass:className]) {
        [button setTitleColor:[NUISettings getColor:@"font-color-disabled" withClass:className] forState:UIControlStateDisabled];
    }

    // Set text shadow color
    if ([NUISettings hasProperty:@"text-shadow-color" withClass:className]) {
        [button setTitleShadowColor:[NUISettings getColor:@"text-shadow-color" withClass:className] forState:UIControlStateNormal];
    }
    if ([NUISettings hasProperty:@"text-shadow-color-selected" withClass:className]) {
        [button setTitleShadowColor:[NUISettings getColor:@"text-shadow-color-selected" withClass:className] forState:UIControlStateSelected];
    }
    if ([NUISettings hasProperty:@"text-shadow-color-highlighted" withClass:className]) {
        [button setTitleShadowColor:[NUISettings getColor:@"text-shadow-color-highlighted" withClass:className] forState:UIControlStateHighlighted];
    }

    // title insets
    if ([NUISettings hasProperty:@"title-insets" withClass:className]) {
        [button setTitleEdgeInsets:[NUISettings getEdgeInsets:@"title-insets" withClass:className]];
    }

    // content insets
    if ([NUISettings hasProperty:@"content-insets" withClass:className]) {
        [button setContentEdgeInsets:[NUISettings getEdgeInsets:@"content-insets" withClass:className]];
    }

    [NUIViewRenderer renderBorder:button withClass:className];

    // We need to apply the corner radius to all sublayers so that the shadow displays correctly
    if ([NUISettings hasProperty:@"corner-radius" withClass:className]) {
        CGFloat r = [NUISettings getFloat:@"corner-radius" withClass:className];
        for (CALayer* layer in button.layer.sublayers) {
            layer.cornerRadius = r;
        }
    }

    [NUIViewRenderer renderShadow:button withClass:className];
}

@end


text:
<?php

namespace FL\UserBundle\Entity;

use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="users")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(type="string", length=255)
     */
    private $firstname;

    /**
     * @ORM\Column(type="string", length=255)
     */
    private $lastname;

    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set firstname
     *
     * @param string $firstname
     * @return User
     */
    public function setFirstname($firstname)
    {
        $this->firstname = $firstname;

        return $this;
    }

    /**
     * Get firstname
     *
     * @return string
     */
    public function getFirstname()
    {
        return $this->firstname;
    }

    /**
     * Set lastname
     *
     * @param string $lastname
     * @return User
     */
    public function setLastname($lastname)
    {
        $this->lastname = $lastname;

        return $this;
    }

    /**
     * Get lastname
     *
     * @return string
     */
    public function getLastname()
    {
        return $this->lastname;
    }
}


text:
<!DOCTYPE html>

  <title>Archie - Helping the Blind See the World</title>
  <link rel="stylesheet" type="text/css" href="style.css">

    <video id="camera" autoplay></video>
    <canvas id="photo" ></canvas>

          <canvas id="tiny" width="10" height ="10"> </canvas>


text:
namespace matcher
{
/// Returns closest to the latLon node from osm or empty node if none is close enough.
pugi::xml_node GetBestOsmNode(pugi::xml_document const & osmResponse, ms::LatLon const & latLon);
/// Returns a way from osm with similar geometry or empty node if can't find such way.
pugi::xml_node GetBestOsmWayOrRelation(pugi::xml_document const & osmResponse,
                                       vector<m2::PointD> const & geometry);
/// Returns value form [-1, 1]. Negative values are used as penalty, positive as score.
/// |lhs| and |rhs| - triangulated polygons;
double ScoreTriangulatedGeometries(vector<m2::PointD> const & lhs, vector<m2::PointD> const & rhs);
}  // namespace osm


text:
#ifndef ASYLO_CRYPTO_SIGNING_KEY_H_
#define ASYLO_CRYPTO_SIGNING_KEY_H_

#include <cstdint>
#include <string>

#include "asylo/crypto/algorithms.pb.h"
#include "asylo/crypto/keys.pb.h"
#include "asylo/crypto/util/byte_container_view.h"
#include "asylo/crypto/x509_signer.h"
#include "asylo/util/cleansing_types.h"
#include "asylo/util/status.h"
#include "asylo/util/statusor.h"

namespace asylo {

// VerifyingKey abstracts a verifying key from an asymmetric key-pair.
class VerifyingKey {
 public:
  virtual ~VerifyingKey() = default;

  virtual bool operator==(const VerifyingKey &other) const = 0;

  virtual bool operator!=(const VerifyingKey &other) const;

  // Returns the signature scheme used by this VerifyingKey.
  virtual SignatureScheme GetSignatureScheme() const = 0;

  // Serializes this VerifyingKey into a DER-encoded key structure and returns
  // the serialized key.
  virtual StatusOr<std::string> SerializeToDer() const = 0;

  // Serializes this VerifyingKey into a PEM-encoded key structure and returns
  // the serialized key.
  virtual StatusOr<std::string> SerializeToPem() const = 0;

  // Returns an AsymmetricSigningKeyProto representation of this VerifyingKey
  // that uses |encoding|.
  StatusOr<AsymmetricSigningKeyProto> SerializeToKeyProto(
      AsymmetricKeyEncoding encoding) const;

  // Verifies that |signature| is a valid signature over a hash of |message|
  // produced by the underlying hash function. Returns a non-OK Status if
  // verification failed or an error occurred during verification.
  virtual Status Verify(ByteContainerView message,
                        ByteContainerView signature) const = 0;
  virtual Status Verify(ByteContainerView message,
                        const Signature &signature) const = 0;
};

// SigningKey abstracts a signing key from an asymmetric key-pair.
class SigningKey : public X509Signer {
 public:
  // Returns the signature scheme used by this SigningKey.
  virtual SignatureScheme GetSignatureScheme() const = 0;

  // Serializes this SigningKey into a DER-encoded key structure and returns the
  // serialized key.
  virtual StatusOr<CleansingVector<uint8_t>> SerializeToDer() const = 0;

  // Returns an AsymmetricSigningKeyProto representation of this SigningKey.
  StatusOr<AsymmetricSigningKeyProto> SerializeToKeyProto(
      AsymmetricKeyEncoding encoding) const;

  // Returns a VerifyingKey that can verify signatures produced by this
  // SigningKey.
  virtual StatusOr<std::unique_ptr<VerifyingKey>> GetVerifyingKey() const = 0;

  // Signs a hash of the given |message| produced by the underlying hash
  // function, and places the resulting signature in |signature|. Returns a
  // non-OK Status if the signing operation failed.
  virtual Status Sign(ByteContainerView message,
                      std::vector<uint8_t> *signature) const = 0;
  virtual Status Sign(ByteContainerView message,
                      Signature *signature) const = 0;
};

}  // namespace asylo

#endif  // ASYLO_CRYPTO_SIGNING_KEY_H_


text:
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Microsoft.Xrm.Client;
using Microsoft.Xrm.Sdk.Metadata;

namespace Microsoft.Xrm.Portal.Web.UI.CrmEntityFormView
{
	public sealed class GridLayoutRowTemplate : RowTemplate
	{
		public GridLayoutRowTemplate(XNode rowNode, int languageCode, EntityMetadata entityMetadata, ICellTemplateFactory cellTemplateFactory) : base(rowNode, languageCode, entityMetadata, cellTemplateFactory) { }

		protected override void InstantiateLayoutIn(Control container, IEnumerable<ICellTemplate> cellTemplates)
		{
			var layoutContainer = new HtmlGenericControl("div");

			container.Controls.Add(layoutContainer);

			var layoutContainerCssClasses = new List<string>();

			var hasLayout = false;

			switch (cellTemplates.Count())
			{
			case 2:
				layoutContainerCssClasses.Add("yui-g");
				hasLayout = true;
				break;
			case 3:
				layoutContainerCssClasses.Add("yui-gb");
				hasLayout = true;
				break;
			}

			if (layoutContainerCssClasses.Any())
			{
				layoutContainer.Attributes["class"] = string.Join(" ", layoutContainerCssClasses.ToArray());
			}

			var index = 0;

			foreach (var template in cellTemplates)
			{
				var cellContainer = new HtmlGenericControl("div");

				layoutContainer.Controls.Add(cellContainer);

				var cellContainerCssClasses = new List<string> { "cell", "{0}-cell".FormatWith(template.CssClass) };

				if (hasLayout)
				{
					cellContainerCssClasses.Add("yui-u");
				}

				if (hasLayout && index == 0)
				{
					cellContainerCssClasses.Add("first");
				}

				cellContainer.Attributes["class"] = string.Join(" ", cellContainerCssClasses.ToArray());

				template.InstantiateIn(cellContainer);

				index++;
			}
		}
	}
}


text:
package jp.co.ipublishing.aeskit.shelter;

import android.support.annotation.NonNull;
import android.util.SparseArray;

import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;

import java.util.List;

import jp.co.ipublishing.aeskit.shelter.models.Shelter;
import jp.co.ipublishing.aeskit.shelter.models.ShelterStatus;
import jp.co.ipublishing.aeskit.shelter.models.ShelterStatuses;
import rx.Observable;

/**
 * 避難所情報ストア。
 */
public interface ShelterStore {
    /**
     * 避難所を取得する。
     *
     * @param center 中心位置
     * @param bounds 範囲
     * @return Observableオブジェクト
     */
    @NonNull
    Observable<List<Shelter>> fetchShelters(@NonNull LatLng center, @NonNull LatLngBounds bounds);

    /**
     * 一番近い避難所を取得する。
     *
     * @param target 現在位置
     * @return Observableオブジェクト
     */
    @NonNull
    Observable<Shelter> fetchNearShelter(@NonNull LatLng target);

    /**
     * 最寄りの避難所を取得する。
     *
     * @param target          現在位置
     * @param ignoreShelterId 無視する避難所のID
     * @return Observableオブジェクト
     */
    @NonNull
    Observable<List<Shelter>> fetchNearShelters(@NonNull LatLng target, int ignoreShelterId);

    /**
     * 避難所を取得する。
     *
     * @param shelterId 避難所ID
     * @return Observableオブジェクト
     */
    @NonNull
    Observable<Shelter> fetchShelter(int shelterId);

    /**
     * 避難所状況を更新する。
     *
     * @param statuses 避難所状況
     * @return Observableオブジェクト
     */
    @NonNull
    Observable<Void> updateStatuses(@NonNull SparseArray<ShelterStatus> statuses);

    /**
     * アプリ内から避難所の状況を取得する。
     *
     * @return Observableオブジェクト
     */
    @NonNull
    Observable<ShelterStatuses> fetchStatuses();
}


text:
// -*- Mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2020 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0

package com.google.appinventor.components.runtime;

import android.Manifest;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Intent;
import android.net.Uri;
import android.provider.MediaStore;
import android.util.Log;
import android.webkit.MimeTypeMap;

import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.annotations.UsesPermissions;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.common.YaVersion;
import com.google.appinventor.components.runtime.util.ErrorMessages;
import com.google.appinventor.components.runtime.util.FileUtil;
import com.google.appinventor.components.runtime.util.MediaUtil;
import com.google.appinventor.components.runtime.util.QUtil;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;

/**
 * A special-purpose button. When the user taps an `ImagePicker`, the device's image gallery
 * appears, and the user can choose an image. After an image is picked, it is saved, and the
 * {@link #Selection()} property will be the name of the file where the image is stored. In order
 * to not fill up storage, a maximum of 10 images will be stored. Picking more images will delete
 * previous images, in order from oldest to newest.
 *
 * @author halabelson@google.com (Hal Abelson)
 */
@DesignerComponent(version = YaVersion.IMAGEPICKER_COMPONENT_VERSION,
    description = "A special-purpose button. When the user taps an image picker, the " +
          "device's image gallery appears, and the user can choose an image. After an image is " +
          "picked, it is saved, and the Selected " +
          "property will be the name of the file where the image is stored. In order to not " +
          "fill up storage, a maximum of 10 images will be stored.  Picking more images " +
          "will delete previous images, in order from oldest to newest.",
    category = ComponentCategory.MEDIA)

@UsesPermissions(permissionNames = "android.permission.WRITE_EXTERNAL_STORAGE")
@SimpleObject
public class ImagePicker extends Picker implements ActivityResultListener {

  private static final String LOG_TAG = "ImagePicker";

  // directory on external storage for storing the files for the saved images
  private static final String imagePickerDirectoryName = "/Pictures/_app_inventor_image_picker";

  // prefix for image file names
  private static final String FILE_PREFIX = "picked_image";

 // max number of files to save in image directory
  private static int maxSavedFiles = 10;

  // The media path (URI) for the selected image file created by MediaUtil
  private String selectionURI;

  // The path to the saved image
  private String selectionSavedImage = "";

  // Flag to indicate whether we have permission to write imgaes to external storage
  private boolean havePermission = false;

  /**
   * Create a new ImagePicker component.
   *
   * @param container the parent container.
   */
  public ImagePicker(ComponentContainer container) {
    super(container);
  }

  /**
   * Path to the file containing the image that was selected.
   */
  @SimpleProperty(description = "Path to the file containing the image that was selected.",
      category = PropertyCategory.BEHAVIOR)
  public String Selection() {
    return selectionSavedImage;
  }

  @Override
  protected Intent getIntent() {
    return new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
  }

  @Override
  public void click() {
    if (!havePermission) {
      container.$form().askPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE,
          new PermissionResultHandler() {
            @Override
            public void HandlePermissionResponse(String permission, boolean granted) {
              if (granted) {
                havePermission = true;
                click();
              } else {
                container.$form().dispatchPermissionDeniedEvent(ImagePicker.this, "Click",
                    permission);
              }
            }
          });
      return;
    }
    super.click();
  }

  /**
   * Callback method to get the result returned by the image picker activity
   *
   * @param requestCode a code identifying the request.
   * @param resultCode a code specifying success or failure of the activity
   * @param data the returned data, in this case an Intent whose data field
   *        contains the image's content URI.
   */
  public void resultReturned(int requestCode, int resultCode, Intent data) {
    if (requestCode == this.requestCode && resultCode == Activity.RESULT_OK) {
      Uri selectedImage = data.getData();
      selectionURI = selectedImage.toString();
      Log.i(LOG_TAG, "selectionURI = " + selectionURI);

      // get the file type extension from the intent data Uri
      ContentResolver cR = container.$context().getContentResolver();
      MimeTypeMap mime = MimeTypeMap.getSingleton();
      String extension = "." + mime.getExtensionFromMimeType(cR.getType(selectedImage));
      Log.i(LOG_TAG, "extension = " + extension);

      // save the image to a temp file in external storage, using a name
      // that includes the extension
      saveSelectedImageToExternalStorage(extension);
      AfterPicking();
    }
  }

  private void saveSelectedImageToExternalStorage(String extension) {
    if (container.$form().isDeniedPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
      container.$form().dispatchPermissionDeniedEvent(this, "ImagePicker",
          Manifest.permission.WRITE_EXTERNAL_STORAGE);
      return;

    }
    // clear imageFile for new save attempt
    // This will be the stored picture
    selectionSavedImage = "";
    // create a temp file for holding the image that was picked
    // This is not the external stored file: This is in the internal directory used by MediaUtil
    File tempFile = null;

    // copy the picture at the image URI to the temp file
    try {
      tempFile = MediaUtil.copyMediaToTempFile(container.$form(), selectionURI);
    } catch (IOException e) {
      Log.i(LOG_TAG, "copyMediaToTempFile failed: " + e.getMessage());
      container.$form().dispatchErrorOccurredEvent(this, "ImagePicker",
          ErrorMessages.ERROR_CANNOT_COPY_MEDIA, e.getMessage());
      return;
    }

    // copy the temp file to external storage
    Log.i(LOG_TAG, "temp file path is: " + tempFile.getPath());
    // Copy file will signal a screen error if the copy fails.
    copyToExternalStorageAndDeleteSource(tempFile, extension);
  }

  private void copyToExternalStorageAndDeleteSource(File source, String extension) {

    File dest = null;

    String fullDirname = QUtil.getExternalStoragePath(container.$form()) + imagePickerDirectoryName;
    File destDirectory = new File(fullDirname);

    try {
      destDirectory.mkdirs();
      dest = File.createTempFile (FILE_PREFIX, extension,  destDirectory);

      selectionSavedImage = dest.getPath();
      // Uncomment this to delete imageFile when the application stops
      // dest.deleteOnExit();
      Log.i(LOG_TAG, "saved file path is: " + selectionSavedImage);

      FileUtil.copyFile(source.getAbsolutePath(), dest.getAbsolutePath());

      Log.i(LOG_TAG, "Image was copied to " + selectionSavedImage);
      // this can be uncommented to show the alert, but the alert
      // is pretty annoying
      // new (container.$form()).ShowAlert("Image was copied to " + selectedImage);

    } catch(IOException e) {
      String err =  "destination is " + selectionSavedImage + ": " + "error is "  + e.getMessage();
      Log.i(LOG_TAG, "copyFile failed. " + err);
      container.$form().dispatchErrorOccurredEvent(this, "SaveImage",
          ErrorMessages.ERROR_CANNOT_SAVE_IMAGE, err);
      selectionSavedImage = "";
      dest.delete();
    }

    // clean up the temp file.  This isn't critical because MudiaUtil.copyMediaToTempFile
    // marks this with deleteOnExit, but it's nice to clean up here.
    source.delete();
    trimDirectory(maxSavedFiles, destDirectory);
  }

  // keep only the last N files, where N = maxSavedFiles
  private void trimDirectory(int maxSavedFiles, File directory) {

    File[] files = directory.listFiles();

    Arrays.sort(files, new Comparator<File>(){
      public int compare(File f1, File f2)
      {
        return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());
      } });

    int excess = files.length - maxSavedFiles;
    for (int i = 0; i < excess; i++) {
      files[i].delete();
    }

  }

}


text:
<?php

/**
 * This is the model class for table "navigation".
 *
 * The followings are the available columns in table 'navigation':
 * @property integer $id
 * @property integer $object_id
 * @property string $url
 * @property string $target
 * @property integer $is_visible
 * @property string $created_at
 * @property integer $created_by
 * @property string $created_ip
 * @property string $modified_at
 * @property integer $modified_by
 * @property string $modified_ip
 */
class Navigation extends ActiveRecord
{
	public  $_sort_order_old;
    /**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'navigation';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('object_id, is_visible, sort_order, created_by, modified_by', 'numerical', 'integerOnly'=>true),
			array('url', 'length', 'max'=>255),
			array('target', 'length', 'max'=>25),
			array('created_ip, modified_ip', 'length', 'max'=>100),
			array('created_at, modified_at', 'safe'),
			// The following rule is used by search().
			// @todo Please remove those attributes that should not be searched.
			array('id, object_id, url, target, is_visible, created_at, created_by, created_ip, modified_at, modified_by, modified_ip', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
            'lang' => array(self::HAS_ONE, 'NavigationLang', 'navigation_id', 'condition' => '(langs LIKE :langMatch AND lang.lang=:lang) OR (langs NOT LIKE :langMatch AND lang.lang = "ru")', 'params' => array(':lang' => Yii::app()->language, ':langMatch' => '%|' . Yii::app()->language . '|%')),
            'lang_ru' => array(self::HAS_ONE, 'NavigationLang', 'navigation_id', 'condition'=>'lang=:lang','params'=>array(':lang' => 'ru')),
            'lang_es' => array(self::HAS_ONE, 'NavigationLang', 'navigation_id', 'condition'=>'lang=:lang','params'=>array(':lang' => 'es')),
            'lang_en' => array(self::HAS_ONE, 'NavigationLang', 'navigation_id', 'condition'=>'lang=:lang','params'=>array(':lang' => 'en')),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'object_id' => 'Object',
			'url' => 'Url',
			'target' => 'Target',
			'sort_order' => 'sort_order',
			'is_visible' => 'Is Visible',
			'created_at' => 'Created At',
			'created_by' => 'Created By',
			'created_ip' => 'Created Ip',
			'modified_at' => 'Modified At',
			'modified_by' => 'Modified By',
			'modified_ip' => 'Modified Ip',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 *
	 * Typical usecase:
	 * - Initialize the model fields with values from filter form.
	 * - Execute this method to get CActiveDataProvider instance which will filter
	 * models according to data in model fields.
	 * - Pass data provider to CGridView, CListView or any similar widget.
	 *
	 * @return CActiveDataProvider the data provider that can return the models
	 * based on the search/filter conditions.
	 */
	public function search()
	{
		// @todo Please modify the following code to remove attributes that should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('object_id',$this->object_id);
		$criteria->compare('url',$this->url,true);
		$criteria->compare('target',$this->target,true);
		$criteria->compare('sort_order',$this->sort_order);
		$criteria->compare('is_visible',$this->is_visible);
		$criteria->compare('created_at',$this->created_at,true);
		$criteria->compare('created_by',$this->created_by);
		$criteria->compare('created_ip',$this->created_ip,true);
		$criteria->compare('modified_at',$this->modified_at,true);
		$criteria->compare('modified_by',$this->modified_by);
		$criteria->compare('modified_ip',$this->modified_ip,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}

	/**
	 * Returns the static model of the specified AR class.
	 * Please note that you should have this exact method in all your CActiveRecord descendants!
	 * @param string $className active record class name.
	 * @return Navigation the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

    public function afterFind()
    {
        $this->_sort_order_old = $this->sort_order;
	}

    public function getTitleByLang($lang)
	{
        $navigationLang = NavigationLang::model()->find('navigation_id=:navigation_id AND lang=:lang', array('navigation_id'=>$this->id, 'lang'=>$lang));

		if($navigationLang)
        {
            return $navigationLang->title;
        }

        return $this->lang->title;
	}

    public function getPossiblePages()
	{
         Yii::import('application.modules.admin.modules.pages.models.*');

        $criteria = new CDbCriteria();
        $criteria->order = 'id';

        $models = Pages::model()->findAll($criteria);

        return CHtml::listData($models, 'id', 'lang.title');
	}

    public function getNavigationLangModel($lang)
	{
        $navigationLang = NavigationLang::model()->find('navigation_id=:navigation_id AND lang=:lang', array('navigation_id'=>$this->id, 'lang'=>$lang));

		if(!$navigationLang)
        {
            $navigationLang = new NavigationLang();
            //var_dump($this->lang);die;
            $navigationLang->attributes = $this->lang->attributes;
            $navigationLang->lang = $lang;
            $navigationLang->id = null;

            return $navigationLang;
        }

        return $navigationLang;
	}

	public function updatePosition($options = array()) {
		$location = array_key_exists('location', $options) ? $options['location'] : null;

        if ($this->isNewRecord)
        {
            $this->updateNeighborsPositions('insert');
        }
		elseif (isset($options['delete']) && $options['delete'] === TRUE)
        {
            $this->updateNeighborsPositions('remove');
        }
        else
        {
            $this->updateNeighborsPositions('shift', $location);
        }
	}

	public function updateNeighborsPositions($mode = 'shift', $location = 'top')
    {
		if ($mode == 'shift' && $this->sort_order > $this->_sort_order_old)
        {
            $this->sort_order--;
            $neighbors = $this->model()->findAll(array(
                'condition' => 'sort_order <= :sort_order_new AND sort_order > :sort_order_old AND location = :location',
                'params' => array(
                    ':sort_order_new' => $this->sort_order,
                    ':sort_order_old' => $this->_sort_order_old,
                    ':location' => $location
                ),
                'order' => 'sort_order',
                )
            );
        }
		elseif ($mode == 'shift' && $this->sort_order < $this->_sort_order_old)
        {
            $neighbors = $this->model()->findAll(array(
                'condition' => 'sort_order >= :sort_order_new AND sort_order < :sort_order_old AND location = :location',
                'params' => array(':sort_order_new' => $this->sort_order, ':sort_order_old' => $this->_sort_order_old,':location' => $location),
                'order' => 'sort_order',
                )
            );
        }
		elseif ($mode == 'insert')
        {
            $neighbors = $this->model()->findAll(array(
                'condition' => 'sort_order >= :current_sort_order AND location = :location',
                'params' => array(':current_sort_order' => $this->sort_order, ':location' => $location),
                'order' => 'sort_order',
                )
            );
        }
		elseif ($mode == 'remove' && !$this->isNewRecord)
        {
            $neighbors = $this->model()->findAll(array(
                'condition' => 'sort_order > :current_sort_order AND location = :location',
                'params' => array(':current_sort_order' => $this->_sort_order_old, ':location' => $location),
                'order' => 'sort_order',
                )
            );
        }
		else
        {
            return;
        }

		foreach ($neighbors as $neighbor)
        {
            switch ($mode)
            {
                case 'shift':
                    if ($this->sort_order < $this->_sort_order_old)
                    {
                        $neighbor->sort_order++ ;
                    }
                    else
                    {
                        $neighbor->sort_order-- ;
                    }
                    break;
                case 'insert':
                    $neighbor->sort_order ++;
                    break;
                case 'remove':
                    $neighbor->sort_order --;
                    break;
            }
            $neighbor->save();
        }
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>

Loading...

  kdtree

    kdtree(double **X, int n, int d): util.c
    kdtree(double **X, int n, int d): util.c

  kdtree_free

    kdtree_free(kdtree_t *tree): util.c
    kdtree_free(kdtree_t *tree): util.c

  kdtree_NN

    kdtree_NN(kdtree_t *tree, double *x): util.c
    kdtree_NN(kdtree_t *tree, double *x): util.c

Searching...

No Matches


text:
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:zstack="http://zstack.org/schema/zstack"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://zstack.org/schema/zstack
    http://zstack.org/schema/zstack/plugin.xsd"
    default-init-method="init" default-destroy-method="destroy">

    <bean id="LocalStorageFactory" class="org.zstack.storage.primary.local.LocalStorageFactory">
        <zstack:plugin>
            <zstack:extension interface="org.zstack.header.storage.primary.PrimaryStorageFactory" />
            <zstack:extension interface="org.zstack.header.Component" />
            <zstack:extension interface="org.zstack.header.vm.MarshalVmOperationFlowExtensionPoint" />
            <zstack:extension interface="org.zstack.header.host.HostDeleteExtensionPoint" />
            <zstack:extension interface="org.zstack.header.vm.VmAttachVolumeExtensionPoint" />
            <zstack:extension interface="org.zstack.header.vm.GetAttachableVolumeExtensionPoint" />
        </zstack:plugin>
    </bean>

    <bean id="LocalStorageAllocatorFactory" class="org.zstack.storage.primary.local.LocalStorageAllocatorFactory">
        <zstack:plugin>
            <zstack:extension interface="org.zstack.header.Component" />
            <zstack:extension interface="org.zstack.header.storage.primary.PrimaryStorageAllocatorStrategyFactory" />
            <zstack:extension interface="org.zstack.header.allocator.HostAllocatorFilterExtensionPoint" />
            <zstack:extension interface="org.zstack.header.storage.primary.PrimaryStorageAllocatorStrategyExtensionPoint" />
        </zstack:plugin>

        <property name="allocatorFlowNames">
            <list>
                <value>org.zstack.storage.primary.local.LocalStorageMainAllocatorFlow</value>
            </list>
        </property>
    </bean>

    <bean id="LocalStorageKvmSftpBackupStorageMediatorImpl" class="org.zstack.storage.primary.local.LocalStorageKvmSftpBackupStorageMediatorImpl">
        <zstack:plugin>
            <zstack:extension interface="org.zstack.storage.primary.local.LocalStorageBackupStorageMediator" />
        </zstack:plugin>
    </bean>

    <bean id="LocalStorageKvmFactory" class="org.zstack.storage.primary.local.LocalStorageKvmFactory">
        <zstack:plugin>
            <zstack:extension interface="org.zstack.storage.primary.local.LocalStorageHypervisorFactory" />
            <zstack:extension interface="org.zstack.kvm.KVMHostConnectExtensionPoint" />
        </zstack:plugin>
    </bean>

    <bean id="LocalStorageApiInterceptor" class="org.zstack.storage.primary.local.LocalStorageApiInterceptor">
        <zstack:plugin>
            <zstack:extension interface="org.zstack.header.apimediator.ApiMessageInterceptor" />
        </zstack:plugin>
    </bean>

</beans>


text:
// Google BSD license https://developers.google.com/google-bsd-license
// Copyright 2012 Google Inc. wrightt@google.com

#ifndef CHAR_BUFFER_H
#define	CHAR_BUFFER_H

#ifdef	__cplusplus
extern "C" {
#endif

#include <stdlib.h>

struct cb_struct {
  char *begin;
  char *head;
  char *tail;
  char *end;

  const char *in_head;
  const char *in_tail;
};
typedef struct cb_struct *cb_t;

cb_t cb_new();

void cb_free(cb_t buffer);

void cb_clear(cb_t buffer);

int cb_ensure_capacity(cb_t self, size_t needed);

// Instead of copying our input into our my->in, e.g.:
//    cb_ensure_capacity(my->in, length);
//    memcpy(my->in->tail, buf, length);
//    my->in->tail += length;
// we'll avoid the memcpy, if possible.  The shared pointer is
// "my->in_head".
int cb_begin_input(cb_t self, const char *buf, ssize_t length);

int cb_end_input(cb_t self);

// Print a buffer to a new string.
//
// @param to_buf
//    Output buffer, e.g. will be set to:
//    " 61 62 0A           ab.\n"+
//    " 63 0A              c.   +3\0"+
//    If NULL then nothing will be written but the return value will be the
//    required minimal length.
// @param buf
//    Input buffer, e.g. "ab\nc\ndef"
// @param length
//    Input length, e.g. 8
// @param max_width
//    Max line length, e.g. 25, or negative for no limit
// @param max_lines
//    Max number of lines, e.g. 2, or negative for no limit
// @result
//    Number of characters written, not including the trailing '\0', e.g. 51
size_t cb_sprint(char *to_buf, const char *buf, ssize_t length,
                 ssize_t max_width, ssize_t max_lines);

// Like cb_sprint, but dynamically allocates the *to_buf_ptr.
int cb_asprint(char **to_buf_ptr, const char *buf, ssize_t length,
               ssize_t max_width, ssize_t max_lines);

// Scans a printed string back into a buffer.
//
// @param to_buf Output buffer, e.g. will be set to:
//    Input buffer, e.g. "ab\nc\ndef"
// @param to_length Output length
// @param buf Input buffer, must match the cb_sprint no-limit format, e.g.:
//    " 61 62 0A           ab.\n"+
//    " 63 0A              c.\n"+
//    " 64 65 66           def\0"
// @result 0 for success
int cb_sscan(char *to_buf, size_t *to_length, const char *buf);

// Like cb_sscan, but dynamically allocates the *to_buf_ptr.
int cb_asscan(char **to_buf_ptr, size_t *to_length, const char *buf);

#ifndef __MACH__
char *strnstr(const char *s1, const char *s2, size_t n);
#endif

#ifdef	__cplusplus
}
#endif

#endif	/* CHAR_BUFFER_H */