text:
package org.kwstudios.play.kwbungeelobby.toolbox;

import java.util.Set;

import org.bukkit.configuration.file.FileConfiguration;

public class ConfigFactory {

	// private static final File CONFIG_DIRECTORY = new File("KWPlugin");
	// private static final File CONFIG_FILE = new File("KWPlugin/config.yml");
	// private static YamlConfiguration config = null;

	// public static YamlConfiguration getConfig() {
	// createConfigFile();
	// if (config == null) {
	// config = YamlConfiguration.loadConfiguration(configFile);
	// }
	// return config;
	// }

	public static Boolean getBoolean(String path, String key, FileConfiguration fileConfiguration) {
		return fileConfiguration.getBoolean(path + "." + key);
	}

	public synchronized static void setBoolean(String path, String key, Boolean value,
			FileConfiguration fileConfiguration) {
		fileConfiguration.set(path + "." + key, value);
		// save();
	}

	public static String getString(String path, String key, FileConfiguration fileConfiguration) {
		return fileConfiguration.getString(path + "." + key);
	}

	public synchronized static void setString(String path, String key, String value,
			FileConfiguration fileConfiguration) {
		fileConfiguration.set(path + "." + key, value);
		// save();
	}

	public static int getInt(String path, String key, FileConfiguration fileConfiguration) {
		return fileConfiguration.getInt(path + "." + key);
	}

	public synchronized static void setInt(String path, String key, int value, FileConfiguration fileConfiguration) {
		fileConfiguration.set(path + "." + key, value);
		// save();
	}

	public static double getDouble(String path, String key, FileConfiguration fileConfiguration) {
		return fileConfiguration.getDouble(path + "." + key);
	}

	public synchronized static void setDouble(String path, String key, double value,
			FileConfiguration fileConfiguration) {
		fileConfiguration.set(path + "." + key, value);
		// save();
	}

	public static Set<String> getKeysUnderPath(String path, boolean deep, FileConfiguration fileConfiguration) {
		if (fileConfiguration != null) {
			if (fileConfiguration.getConfigurationSection(path) != null) {
				Set<String> keys = fileConfiguration.getConfigurationSection(path).getKeys(deep);
				return keys;
			}
		}

		return null;
	}

	public static String getValueOrSetDefault(String path, String key, String defaultValue,
			FileConfiguration fileConfiguration) {
		if (!fileConfiguration.isSet(path + "." + key)) {
			ConfigFactory.setString(path, key, defaultValue, fileConfiguration);
			return defaultValue;
		} else {
			String value = ConfigFactory.getString(path, key, fileConfiguration);
			if (value.trim().isEmpty()) {
				ConfigFactory.setString(path, key, defaultValue, fileConfiguration);
				return defaultValue;
			} else {
				return value;
			}
		}
	}

	public static int getValueOrSetDefault(String path, String key, int defaultValue,
			FileConfiguration fileConfiguration) {
		if (!fileConfiguration.isSet(path + "." + key)) {
			ConfigFactory.setInt(path, key, defaultValue, fileConfiguration);
			return defaultValue;
		} else {
			String value = ConfigFactory.getString(path, key, fileConfiguration);
			if (!ValueChecker.isInt(value)) {
				ConfigFactory.setInt(path, key, defaultValue, fileConfiguration);
				return defaultValue;
			} else {
				return Integer.parseInt(value);
			}
		}
	}

	public static double getValueOrSetDefault(String path, String key, double defaultValue,
			FileConfiguration fileConfiguration) {
		if (!fileConfiguration.isSet(path + "." + key)) {
			ConfigFactory.setDouble(path, key, defaultValue, fileConfiguration);
			return defaultValue;
		} else {
			String value = ConfigFactory.getString(path, key, fileConfiguration);
			if (!ValueChecker.isDouble(value)) {
				ConfigFactory.setDouble(path, key, defaultValue, fileConfiguration);
				return defaultValue;
			} else {
				return Double.parseDouble(value);
			}
		}
	}

	public static boolean getValueOrSetDefault(String path, String key, boolean defaultValue,
			FileConfiguration fileConfiguration) {
		if (!fileConfiguration.isSet(path + "." + key)) {
			ConfigFactory.setBoolean(path, key, defaultValue, fileConfiguration);
			return defaultValue;
		} else {
			boolean value = ConfigFactory.getBoolean(path, key, fileConfiguration);
			return value;
		}
	}

	// private static void save(FileConfiguration fileConfiguration) {
	// createConfigFile();
	// try {
	// fileConfiguration.sa;
	// } catch (IOException e) {
	// e.printStackTrace();
	// }
	// }

	// private static void createConfigFile() {
	// if (!configDirectory.exists()) {
	// configDirectory.mkdir();
	// }
	//
	// if (!configFile.exists()) {
	// try {
	// configFile.createNewFile();
	// } catch (IOException e) {
	// e.printStackTrace();
	// }
	// }
	// }

}


text:
#if !defined(AFX_PARSERDM_H__B1595620_0773_4C66_9C3F_F21B121112AE__INCLUDED_)
#define AFX_PARSERDM_H__B1595620_0773_4C66_9C3F_F21B121112AE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ParserGeneral.h"
#include "dmvSystemData.h"
#include "dmvArticulationData.h"
#include "dmvObject.h"
#include "dmvRigidBodyData.h"
#include "dmvMobileBaseLinkData.h"
#include "dmvMDHLinkData.h"
#include "dmvRevoluteLinkData.h"
#include "dmvRevDCMotorData.h"
#include "dmvSphericalLinkData.h"
#include "dmvZScrewTxLinkData.h"
#include "dmvSecJointData.h"
#include "dmvSecRevJntData.h"
#include "dmvSecPrisJntData.h"
#include "dmvSecSpherJntData.h"

enum actuatorTypes {NOMOTOR = 0, DCMOTOR = 1};

class CParserDM : public CParserGeneral
{
public:
	CParserDM();
	virtual ~CParserDM();
	static BOOL ParseDMFile(CString strFile, CdmvSystemData **ppCdmvSystemData);

private:
	static BOOL ParseJointFriction(ifstream &istrmDMFile, int &rnCurrentLineNumber,
				CdmvSystemData **ppCdmvSystemData, CdmvSecJointData *pCdmvSecJointData);
	static BOOL ParseSecondarySphericalJoint (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvSecSpherJntData *pCdmvSecSpherJntData);
	static BOOL ParseSecondaryPrismaticJoint (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvSecPrisJntData *pCdmvSecPrisJntData);
	static BOOL ParseSecondaryRevoluteJoint (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvSecRevJntData *pCdmvSecRevJntData);
	static BOOL ParseSecondaryJointData (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvArticulationData *pCdmvClosedArticulationData, CdmvSecJointData *pCdmvSecJointData);
	static BOOL ParseStabilization (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvSecJointData *pCdmvSecJointData);
	static BOOL ParseSecondaryJoints (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvArticulationData *pCdmvClosedArticulationData);
	static BOOL ParseZScrewTxLinkParameters (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvZScrewTxLinkData *pCdmvZScrewTxLinkData);
	static BOOL ParseSphericalLinkParameters (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvSphericalLinkData *pCdmvSphericalLinkData);
	static BOOL ParseRevDCMotorParameters (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvRevDCMotorData* pCdmvRevDCMotorData);
	static BOOL ParseJointFriction (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvLinkData* pCdmvLinkData);
	static BOOL ParseActuator (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvRevoluteLinkData* pCdmvRevoluteLinkData);
	static BOOL ParseMDHParameters (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvMDHLinkData* pCdmvMDHLinkData);
	static BOOL ParseContactParameters (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvRigidBodyData* pCdmvRigidBodyData);
	static BOOL ParseMobileBaseParameters (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData **ppCdmvSystemData, CdmvMobileBaseLinkData *pCdmvMobileBaseLinkData);
	static BOOL ParseRigidBodyParameters (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvRigidBodyData* pCdmvRigidBodyData);
	static BOOL ParseToBlockEnd (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData **ppCdmvSystemData);
	static BOOL ParseName (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData **ppCdmvSystemData, CdmvObject *pCdmvObject);
	static BOOL ParseToBlockBegin (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData);
	static BOOL ParseLinkBranch (ifstream & istrmDMFile, int & rnCurrentLineNumber, CdmvSystemData** ppCdmvSystemData, CdmvLinkData* pCdmvLinkData);
	static BOOL ParseArticulationPose (ifstream &strmDMFile, int & rnCurrentLineNumber,
		CdmvSystemData **ppCdmvSystemData, CdmvArticulationData *pCdmvArticulationData);
	static BOOL ParseGraphicsFile (ifstream & istrmDMFile, int & rnCurrentLineNumber,
		CdmvSystemData **ppCdmvSystemData, CdmvObject *pCdmvObject);
	static BOOL ParseClosedArticulation (ifstream & istrmDMFile, int & rnCurrentLineNumber,
		CdmvSystemData **ppCdmvSystemData);
	static BOOL ParseArticulation (ifstream & istrmDMFile, int & rnCurrentLineNumber,
		CdmvSystemData **ppCdmvSystemData);
	static BOOL ParseFileVersion1 (ifstream & istrmDMFile, int & rnCurrentLineNumber,
		CdmvSystemData **ppCdmvSystemData);
	static void FormatError (ifstream & istrmDMFile, int nCurrentLineNumber,
		CdmvSystemData** ppCdmvSystemData, CString strMessage);
	static void ParseError (ifstream & istrmDMFile, int nCurrentLineNumber,
		CdmvSystemData** ppCdmvSystemData, CString strMessage);
	static void ValidationError(ifstream &istrmDMFile, int nCurrentLineNumber,
		CdmvSystemData** ppCdmvSystemData, CString strMessage);
};

#endif // !defined(AFX_PARSERDM_H__B1595620_0773_4C66_9C3F_F21B121112AE__INCLUDED_)

redpajama_set_name: RedPajamaGithub


text:
package mb.scopegraph.regexp;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.BeforeClass;
import org.junit.Test;

import com.google.common.collect.Lists;

import mb.scopegraph.regexp.impl.RegExpBuilder;

public class RegExpTest {

    private static IRegExpBuilder<Integer> b;

    @BeforeClass public static void beforeClass() {
        b = new RegExpBuilder<>();
    }

    @Test public void testConstruct() {
        IRegExp<Integer> re;
        re = b.emptySet();
        re = b.emptyString();
        re = b.complement(re);
        re = b.closure(re);
    }

    @Test public void testSymbolMatching() {
        IRegExp<Integer> re = b.symbol(1);
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        assertFalse(m.isFinal());
        m = m.match(1);
        assertTrue(m.isAccepting());
        assertTrue(m.isFinal());
        m = m.match(3);
        assertFalse(m.isAccepting());
    }

    @Test public void testClosureMatching() {
        IRegExp<Integer> re = b.closure(b.symbol(1));
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        m = m.match(1);
        assertTrue(m.isAccepting());
        m = m.match(Lists.newArrayList(1, 1, 1, 1, 1));
        assertTrue(m.isAccepting());
        m = m.match(3);
        assertFalse(m.isAccepting());
    }

    @Test public void testEmptySetMatching() {
        IRegExp<Integer> re = b.emptySet();
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        assertFalse(m.isAccepting());
    }

    @Test public void testEmptyStringMatching() {
        IRegExp<Integer> re = b.emptyString();
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        assertTrue(m.isAccepting());
        m = m.match(3);
        assertFalse(m.isAccepting());
    }

    @Test public void testConcatMatching() {
        IRegExp<Integer> re = b.concat(b.symbol(1), b.symbol(3));
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        m = m.match(1);
        assertFalse(m.isFinal());
        assertFalse(m.isAccepting());
        m = m.match(3);
        assertTrue(m.isFinal());
        assertTrue(m.isAccepting());
    }

    @Test public void testNestedConcatMatching() {
        IRegExp<Integer> re = b.concat(b.concat(b.symbol(1), b.symbol(3)), b.symbol(5));
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        m = m.match(1);
        assertFalse(m.isFinal());
        assertFalse(m.isAccepting());
        m = m.match(3);
        assertFalse(m.isFinal());
        assertFalse(m.isAccepting());
        m = m.match(5);
        assertTrue(m.isFinal());
        assertTrue(m.isAccepting());
    }

    @Test public void testComplementMatching() {
        IRegExp<Integer> re = b.complement(b.symbol(1));
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        assertTrue(m.isAccepting());
        m = m.match(1);
        assertFalse(m.isAccepting());
        m = m.match(3);
        assertTrue(m.isAccepting());
    }

    @Test public void testAndMatching() {
        IRegExp<Integer> re = b.and(b.symbol(1), b.closure(b.symbol(1)));
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        assertFalse(m.isAccepting());
        m = m.match(1);
        assertTrue(m.isAccepting());
        m = m.match(1);
        assertFalse(m.isAccepting());
    }

    @Test public void testOrMatching() {
        IRegExp<Integer> re = b.closure(b.or(b.symbol(1), b.symbol(3)));
        IRegExpMatcher<Integer> m = RegExpMatcher.create(re);
        assertTrue(m.isAccepting());
        m = m.match(1);
        assertTrue(m.isAccepting());
        m = m.match(3);
        assertTrue(m.isAccepting());
        m = m.match(1);
        assertTrue(m.isAccepting());
        m = m.match(7);
        assertFalse(m.isAccepting());
    }

}


text:
<!--
*** Please remove the following help text before submitting: ***

Pull requests without a rationale and clear improvement may be closed
immediately.

GUI-related pull requests should be opened against
https://github.com/bitcoin-core/gui
first. See CONTRIBUTING.md
-->

<!--
Please provide clear motivation for your patch and explain how it improves
Particl Core user experience or Particl Core developer experience
significantly:

* Any test improvements or new tests that improve coverage are always welcome.
* All other changes should have accompanying unit tests (see `src/test/`) or
  functional tests (see `test/`). Contributors should note which tests cover
  modified code. If no tests exist for a region of modified code, new tests
  should accompany the change.
* Bug fixes are most welcome when they come with steps to reproduce or an
  explanation of the potential issue as well as reasoning for the way the bug
  was fixed.
* Features are welcome, but might be rejected due to design or scope issues.
  If a feature is based on a lot of dependencies, contributors should first
  consider building the system outside of Particl Core, if possible.
* Refactoring changes are only accepted if they are required for a feature or
  bug fix or otherwise improve developer experience significantly. For example,
  most "code style" refactoring changes require a thorough explanation why they
  are useful, what downsides they have and why they *significantly* improve
  developer experience or avoid serious programming bugs. Note that code style
  is often a subjective matter. Unless they are explicitly mentioned to be
  preferred in the [developer notes](/doc/developer-notes.md), stylistic code
  changes are usually rejected.
-->

<!--
Particl Core has a thorough review process and even the most trivial change
needs to pass a lot of eyes and requires non-zero or even substantial time
effort to review. There is a huge lack of active reviewers on the project, so
patches often sit for a long time.
-->


text:
package org.apache.bigtop.itest.hive;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;

import java.sql.SQLException;
import java.sql.Statement;

// This does not test every option that Hive supports, but does try to touch the major
// options, especially anything unique to Hive.  See each test for areas tested and not tested.
public class TestSql extends JdbcConnector {
    private static final Log LOG = LogFactory.getLog(TestSql.class.getName());

    @Test
    public void db() throws SQLException {
        final String db1 = "bigtop_sql_db1";
        final String db2 = "bigtop_sql_db2";
        try (Statement stmt = conn.createStatement()) {
            stmt.execute("drop database if exists " + db1 + " cascade");

            // Simple create database
            stmt.execute("create database " + db1);
            stmt.execute("drop database " + db1);

            stmt.execute("drop schema if exists " + db2 + " cascade");

            String location = getProperty(LOCATION, "a writable directory in HDFS");

            // All the bells and whistles
            stmt.execute("create schema if not exists " + db2 + " comment 'a db' location '" + location +
                    "' with dbproperties ('a' = 'b')");

            stmt.execute("alter database " + db2 + " set dbproperties ('c' = 'd')");

            stmt.execute("drop database " + db2 + " restrict");
        }
    }

    @Test
    public void table() throws SQLException {
        final String table1 = "bigtop_sql_table1";
        final String table2 = "bigtop_sql_table2";
        final String table3 = "bigtop_sql_table3";
        final String table4 = "bigtop_sql_table4";
        final String table5 = "bigtop_sql_table5";

        try (Statement stmt = conn.createStatement()) {
            stmt.execute("drop table if exists " + table1);
            stmt.execute("drop table if exists " + table2);
            stmt.execute("drop table if exists " + table3);
            stmt.execute("drop table if exists " + table4);
            stmt.execute("drop table if exists " + table5);

            String location = getProperty(LOCATION, "a writable directory in HDFS");
            stmt.execute("create external table " + table1 + "(a int, b varchar(32)) location '" +
                    location + "'");

            // With a little bit of everything, except partitions, we'll do those below
            stmt.execute("create table if not exists " + table2 +
                    "(c1 tinyint," +
                    " c2 smallint," +
                    " c3 int comment 'a column comment'," +
                    " c4 bigint," +
                    " c5 float," +
                    " c6 double," +
                    " c7 decimal," +
                    " c8 decimal(12)," +
                    " c9 decimal(8,2)," +
                    " c10 timestamp," +
                    " c11 date," +
                    " c12 string," +
                    " c13 varchar(120)," +
                    " c14 char(10)," +
                    " c15 boolean," +
                    " c16 binary," +
                    " c17 array<string>," +
                    " c18 map <string, string>," +
                    " c19 struct<s1:int, s2:bigint>," +
                    " c20 uniontype<int, string>) " +
                    "comment 'table comment'" +
                    "clustered by (c1) sorted by (c2) into 10 buckets " +
                    "stored as orc " +
                    "tblproperties ('a' = 'b')");

            // Not testing SKEWED BY, ROW FORMAT, STORED BY (storage handler

            stmt.execute("create temporary table " + table3 + " like " + table2);

            stmt.execute("insert into " + table1 + " values (3, 'abc'), (4, 'def')");

            stmt.execute("create table " + table4 + " as select a, b from " + table1);

            stmt.execute("truncate table " + table4);

            stmt.execute("alter table " + table4 + " rename to " + table5);
            stmt.execute("alter table " + table2 + " set tblproperties ('c' = 'd')");

            // Not testing alter of clustered or sorted by, because that's suicidal
            // Not testing alter of skewed or serde properties since we didn't test it for create
            // above.

            stmt.execute("drop table " + table1 + " purge");
            stmt.execute("drop table " + table2);
            stmt.execute("drop table " + table3);
            stmt.execute("drop table " + table5);
        }
    }

    @Test
    public void partitionedTable() throws SQLException {
        final String table1 = "bigtop_sql_ptable1";
        try (Statement stmt = conn.createStatement()) {
            stmt.execute("drop table if exists " + table1);

            stmt.execute("create table " + table1 +
                    "(c1 int," +
                    " c2 varchar(32))" +
                    "partitioned by (p1 string comment 'a partition column')" +
                    "stored as orc");

            stmt.execute("alter table " + table1 + " add partition (p1 = 'a')");
            stmt.execute("insert into " + table1 + " partition (p1 = 'a') values (1, 'abc')");
            stmt.execute("insert into " + table1 + " partition (p1 = 'a') values (2, 'def')");
            stmt.execute("insert into " + table1 + " partition (p1 = 'a') values (3, 'ghi')");
            stmt.execute("alter table " + table1 + " partition (p1 = 'a') concatenate");
            stmt.execute("alter table " + table1 + " touch partition (p1 = 'a')");

            stmt.execute("alter table " + table1 + " add columns (c3 float)");
            stmt.execute("alter table " + table1 + " drop partition (p1 = 'a')");

            // Not testing rename partition, exchange partition, msck repair, archive/unarchive,
            // set location, enable/disable no_drop/offline, compact (because not everyone may have
            // ACID on), change column

            stmt.execute("drop table " + table1);

        }
    }

    @Test
    public void view() throws SQLException {
        final String table1 = "bigtop_sql_vtable1";
        final String view1 = "bigtop_sql_view1";
        final String view2 = "bigtop_sql_view2";
        try (Statement stmt = conn.createStatement()) {
            stmt.execute("drop table if exists " + table1);
            stmt.execute("drop view if exists " + view1);
            stmt.execute("drop view if exists " + view2);
            stmt.execute("create table " + table1 + "(a int, b varchar(32))");
            stmt.execute("create view " + view1 + " as select a from " + table1);

            stmt.execute("create view if not exists " + view2 +
                    " comment 'a view comment' " +
                    "tblproperties ('a' = 'b') " +
                    "as select b from " + table1);

            stmt.execute("alter view " + view1 + " as select a, b from " + table1);
            stmt.execute("alter view " + view2 + " set tblproperties('c' = 'd')");

            stmt.execute("drop view " + view1);
            stmt.execute("drop view " + view2);
        }
    }

    // Not testing indices because they are currently useless in Hive
    // Not testing macros because as far as I know no one uses them

    @Test
    public void function() throws SQLException {
        final String func1 = "bigtop_sql_func1";
        final String func2 = "bigtop_sql_func2";
        try (Statement stmt = conn.createStatement()) {
            stmt.execute("create temporary function " + func1 +
                    " as 'org.apache.hadoop.hive.ql.udf.UDFToInteger'");
            stmt.execute("drop temporary function " + func1);

            stmt.execute("drop function if exists " + func2);

            stmt.execute("create function " + func2 +
                    " as 'org.apache.hadoop.hive.ql.udf.UDFToInteger'");
            stmt.execute("drop function " + func2);
        }
    }

    // Not testing grant/revoke/roles as different vendors use different security solutions
    // and hence different things will work here.

    // This covers insert (non-partitioned, partitioned, dynamic partitions, overwrite, with
    // values and select), and multi-insert.  Load is not tested as there's no guarantee that the
    // test machine has access to HDFS and thus the ability to upload a file.
    @Test
    public void insert() throws SQLException {
        final String table1 = "bigtop_insert_table1";
        final String table2 = "bigtop_insert_table2";
        try (Statement stmt = conn.createStatement()) {
            stmt.execute("drop table if exists " + table1);
            stmt.execute("create table " + table1 +
                    "(c1 tinyint," +
                    " c2 smallint," +
                    " c3 int," +
                    " c4 bigint," +
                    " c5 float," +
                    " c6 double," +
                    " c7 decimal(8,2)," +
                    " c8 varchar(120)," +
                    " c9 char(10)," +
                    " c10 boolean)" +
                    " partitioned by (p1 string)");

            // insert with partition
            stmt.execute("explain insert into " + table1 + " partition (p1 = 'a') values " +
                    "(1, 2, 3, 4, 1.1, 2.2, 3.3, 'abcdef', 'ghi', true)," +
                    "(5, 6, 7, 8, 9.9, 8.8, 7.7, 'jklmno', 'pqr', true)");

            stmt.execute("set hive.exec.dynamic.partition.mode=nonstrict");

            // dynamic partition
            stmt.execute("explain insert into " + table1 + " partition (p1) values " +
                    "(1, 2, 3, 4, 1.1, 2.2, 3.3, 'abcdef', 'ghi', true, 'b')," +
                    "(5, 6, 7, 8, 9.9, 8.8, 7.7, 'jklmno', 'pqr', true, 'b')");

            stmt.execute("drop table if exists " + table2);

            stmt.execute("create table " + table2 +
                    "(c1 tinyint," +
                    " c2 smallint," +
                    " c3 int," +
                    " c4 bigint," +
                    " c5 float," +
                    " c6 double," +
                    " c7 decimal(8,2)," +
                    " c8 varchar(120)," +
                    " c9 char(10)," +
                    " c10 boolean)");

            stmt.execute("explain insert into " + table2 + " values " +
                    "(1, 2, 3, 4, 1.1, 2.2, 3.3, 'abcdef', 'ghi', true)," +
                    "(5, 6, 7, 8, 9.9, 8.8, 7.7, 'jklmno', 'pqr', true)");

            stmt.execute("explain insert overwrite table " + table2 + " select c1, c2, c3, c4, c5, c6, " +
                    "c7, c8, c9, c10 from " + table1);

            // multi-insert
            stmt.execute("from " + table1 +
                    " insert into table " + table1 + " partition (p1 = 'c') " +
                    " select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10" +
                    " insert into table " + table2 + " select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10");
        }
    }

    // This tests CTEs
    @Test
    public void cte() throws SQLException {
        final String table1 = "bigtop_cte_table1";
        try (Statement stmt = conn.createStatement()) {
            stmt.execute("drop table if exists " + table1);
            stmt.execute("create table " + table1 + "(c1 int, c2 varchar(32))");
            stmt.execute("with cte1 as (select c1 from " + table1 + " where c1 < 10) " +
                    " select c1 from cte1");
        }
    }

    // This tests select, including CTEs, all/distinct, single tables, joins (inner & outer),
    // group by (w/ and w/o having), order by, cluster by/distribute by/sort by, limit, union,
    // subqueries, and over.

    @Test
    public void select() throws SQLException {
        final String[] tables = {"bigtop_select_table1", "bigtop_select_table2"};
        try (Statement stmt = conn.createStatement()) {
            for (int i = 0; i < tables.length; i++) {
                stmt.execute("drop table if exists " + tables[i]);
                stmt.execute("create table " + tables[i] + "(c1 int, c2 varchar(32))");
            }

            // single table queries tested above in several places

            stmt.execute("explain select all a.c2, SUM(a.c1), SUM(b.c1) " +
                    "from " + tables[0] + " a join " + tables[1] + " b on (a.c2 = b.c2) " +
                    "group by a.c2 " +
                    "order by a.c2 asc " +
                    "limit 10");

            stmt.execute("explain select distinct a.c2 " +
                    "from " + tables[0] + " a left outer join " + tables[1] + " b on (a.c2 = b.c2) " +
                    "order by a.c2 desc ");

            stmt.execute("explain select a.c2, SUM(a.c1) " +
                    "from " + tables[0] + " a right outer join " + tables[1] + " b on (a.c2 = b.c2) " +
                    "group by a.c2 " +
                    "having SUM(b.c1) > 0 " +
                    "order by a.c2 ");

            stmt.execute("explain select a.c2, rank() over (partition by a.c1) " +
                    "from " + tables[0] + " a full outer join " + tables[1] + " b on (a.c2 = b.c2) ");

            stmt.execute("explain select c2 from " + tables[0] + " union all select c2 from " + tables[1]);

            stmt.execute("explain select * from " + tables[0] + " distribute by c1 sort by c2");
            stmt.execute("explain select * from " + tables[0] + " cluster by c1");

            stmt.execute("explain select * from (select c1 from " + tables[0] + ") t");
            stmt.execute("explain select * from " + tables[0] + " where c1 in (select c1 from " + tables[1] +
                    ")");

        }

    }

    // Update and delete are not tested because not everyone configures their system to run
    // with ACID.

}


text:
package org.gdl2.cdshooks;

import lombok.Value;
import org.gdl2.expression.ExpressionItem;

import java.util.List;

@Value
public class UseTemplate {
    private String templateId;
    private List<ExpressionItem> assignments;
}


text:
using Microsoft.Owin;
using Owin;

[assembly: OwinStartupAttribute(typeof(AtomicArcade.Startup))]
namespace AtomicArcade
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
        }
    }
}


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Kaj je oddaljena prijava?</title>
<link rel="stylesheet" type="text/css" href="../vodnik_1404.css">
<link rel="shortcut icon" href="https://www.ubuntu.si/favicon.ico">

Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu

Novice

Forum

Kaj je Ubuntu?

Pogosta vprašanja

Skupnost

Povezave

 »  Namizni vodnik Ubuntu » Omreženje, splet, pošta in klepet » Souporaba »

Kaj je oddaljena prijava?

Ubuntu lahko uporabite kot odjemalec oddaljenega namizje iz prijavnega zaslona z uporabo Ubuntujeve zmožnosti seja za gosta. To pomeni, da na računalniku odjemalca ne potrebujete uporabniškega računa. Trenutno je edini podprti protokol RDP (Remote Desktop Protocol).

Sistem je zasnovan tako, da Ubuntu One varno shrani vaše prijavne podatke. Zato si vam ni treba zapomniti poveril za več oddaljenih računalnikov, saj se lahko prijavite z e-poštnim naslovom in geslom Ubuntu One.

Ubuntu vključuje tudi program Remmina, odjemalec oddaljenega namizja. Prišel vam bo prav, če se z oddaljenimi računalniki raje povezujete, ko ste prijavljeni kot običajni uporabnik.

Izklop oddaljene prijave

Če ne uporabljate oddaljene prijave pri prijavnem  zaslonu, lahko odstranite storitev oddaljene prijave.

Za odprtje Programskega središča kliknite na to povezavo.

Kliknite na gumb Odstrani.

Več podrobnosti

Souporaba — Souporaba namizja, Souporaba datotek…

Material v tem dokumentu je na voljo pod prosto licenco. To je prevod dokumentacije Ubuntu, ki jo je sestavila Ubuntu dokumentacijska ekpa za Ubuntu. V slovenščino jo je prevedla skupina Ubuntu prevajalcev. Za poročanje napak v prevodih v tej dokumentaciji ali Ubuntuju pošljite sporočilo na dopisni seznam.


text:
<!doctype html>

<meta charset="utf-8">
<title>第一次接触ng todoList,产出物 – 2shou's Blog</title>
<meta name="description" content="ng">
<meta name="keywords" content="ng, todolist">

<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="第一次接触ng todoList,产出物">
<meta property="og:description" content="ng">
<meta property="og:url" content="http://www.2shouweb.cn/ng-todoList/">
<meta property="og:site_name" content="2shou's Blog">

<link rel="canonical" href="http://www.2shouweb.cn/ng-todoList/">
<link href="http://www.2shouweb.cn/feed.xml" type="application/atom+xml" rel="alternate" title="2shou's Blog Feed">

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="http://www.2shouweb.cn/assets/css/main.css">

<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">

<meta http-equiv="cleartype" content="on">

<link rel="shortcut icon" href="http://www.2shouweb.cn/favicon.ico">

<link rel="shortcut icon" href="http://www.2shouweb.cn/favicon.png">

<link rel="apple-touch-icon-precomposed" href="http://www.2shouweb.cn/images/apple-touch-icon-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://www.2shouweb.cn/images/apple-touch-icon-72x72-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://www.2shouweb.cn/images/apple-touch-icon-114x114-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://www.2shouweb.cn/images/apple-touch-icon-144x144-precomposed.png">

	<button class="dl-trigger">Open Menu</button>

Home

			About

2shou's blog

my own blog;

Learn More

					 Email

					 GitHub

			Posts

All Posts

All Tags

第一次接触ng todoList,产出物

<time datetime="2015-09-13T00:00:00-04:00">September 13, 2015</time>

          Reading time ~2 minutes

简介

听说ng很屌 ,今天看了看,顺便写了个简单的web 应用程序

为什么需要ng?

类似 Backbone 或者 JavaScriptMVC,anguar是一个快速的前端开发解决方案。没有其它的插件或者架构足以开发数据驱动的web应用。下面列出了AnguarJS的一些特性:

方便的REST: RESTful逐渐成为了标准的服务器和客户端沟通的方式。使用一行javascript代码,你就可以快速的从服务器端得到数据。AugularJS将这些变成了JS对象,作为Model,遵循MVVM(model view view-model)设计模式。

MVVM救星:Model将和ViewModel互动(通过$scope对象),将监听Model的变化。这些可以通过View来发送和渲染,由HTML来展示你的代码。View可以通过$routeProvider对象来支配,所以你可以深度的链接和组织你的View和Controller,将他们变成导航URL。AngualrJS同时提供了无状态的Controller,可以用来初始化和控制$scope对象。

数据绑定和依赖注入:在MVVM设计模式中的任何东西无论发生任何事情都自动的和UI通信。这帮助我们去除了wrapper,getter/setter方法或者class定义。AngularJS将帮助我们处理所有的这些内容,所以你可以处理数据像处理基本javascript数据类型,例如,数组一样简单。当然你也可以通过自定义处理复杂数据。正因为所有事情的发生都是自动的,所以你不必调用一个main()来执行你的代码,而是通过依赖关系来驱动。

可扩展的HTML:大多数的网站都是使用非语义的<div>标签来搭建的。你需要自己在CSS的class中定义相关的DOM层次结构。而使用AngularJS,你可以操作XML一样操作HTML,给你无穷的方式来完成标签和属性定义。AngularJS通过自己的编译器和directives来完成相关的设置。

使用HTML模板:如果你曾经使用过Mustache , Hogan.js,或者handlerbars的话,你就可以快速的理解AngularJS的模板引擎语法,应为它是纯HTML的。AngularJS通过DOM浏览来完成此类功能,使用上面提到的directives。模板被作为DOM元素传递到Angular的编译器中,可以被扩展,执行或者重用。这很关键,这样一来你就拥有了DOM组件,而非字符串,允许你直接的操作扩展DOM树。

企业级别的测试:AnguarJS并不依赖于第三方的插件或者是框架,包括测试。如果你熟悉QUnit, Mocha 或者 Jasmine的话,那么对于理解Angular的单元测试和Scenario Runner来说就非常简单。

以上的这些基本的原则能够帮助知道你使用Angular来创建高效性能可维护的代码。只要你有代码保存数据,AnguarJS会帮助你处理所有的重量级内容,提供一个富客户端的超棒体验!

问题

表示开始的时候还遇到一些问题,提交两次相同的内容ng就会报错,百度了一下是这样写的 track By $index ,结果一直报错 最后谷歌了一下 By的B其实是小写的。。不是故意黑百度的,
缺少的js和css请自行下载引用更换路径
# 代码

源码如下

<!DOCTYPE html>
<html lang="en" ng-app="todoList">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>TODOLIST</title>
    <!-- Latest compiled and minified CSS -->
    <style>
        .list-group li{ display: block; overflow: hidden;}
        .right{
            float: right;
            margin-right: 10px; display: block; cursor: pointer;}
    </style>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body ng-controller="TaskCtrl" style="padding: 10px;">
<div class="input-group">
    <input type="text" ng-model="task" class="form-control"/>
    <span class="input-group-btn">
        <button class="btn btn-default" ng-click="add()">提交</button>
    </span>
</div>
<h4 ng-if="tasks.length>0">任务列表</h4>
<ul class="list-group">
    <li ng-repeat="item in tasks track by $index" class="list-group-item">
        <a ng-click="tasks.splice($index,1)" class="right">删除</a>
    </li>
</ul>
<script src="../js/angular.min.js"></script>
<script>
    angular.module('todoList',[])
            .controller('TaskCtrl',function($scope){
                $scope.task="";
                $scope.tasks=[];
                $scope.add= function(){
                    $scope.tasks.push($scope.task);
                }
            })
</script>
</body>
</html>

本文原创

        ngtodolist
        第一次接触ng todoList,产出物 was published on <time datetime="2015-09-13T00:00:00-04:00">September 13, 2015</time>

        2shou's blog

      Read More

node express初学

        Published on September 25, 2015

react mbe_ui浅析

        Published on September 16, 2015

    © 2015 2shou's blog. Powered by Jekyll using the HPSTR Theme.

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus</a


text:
package com.ociweb.grove;

import org.junit.Test;

/**
 * Unit test for simple App.
 */
public class AppTest {

	 @Test
	    public void testApp()
	    {
//	    	DeviceRuntime runtime = DeviceRuntime.test(new IoTApp());
//	    	NonThreadScheduler scheduler = (NonThreadScheduler)runtime.getScheduler();
//	    	TestHardware hardware = (TestHardware)runtime.getHardware();
//
//	    	scheduler.startup();
//
//	    	int iterations = 10;
//			while (--iterations >= 0) {
//
//					scheduler.run();
//
//					//test application here
//
//			}
//
//			scheduler.shutdown();

	    }
}


text:
Kirby Plugin to serve a JSON Feed. This plugin implements some of the structure fields of the [JSON Feed Spec Version 1](https://jsonfeed.org/version/1).

## Installation

Put the `json-feed.php` File in the `/site/plugins/json-feed` folder.

### Advanced: Git Submodules

```shell
git submodule add https://github.com/stefanzweifel/kirby-json-feed.git site/plugins/json-feed
```

## Usage

1. Create a new page. For example "feed" (Create folder `feed` in `content` folder. Create an empty file `feed.txt` in it)
2. Create a new template `feed.php` in `/site/template/`
3. Use the following snippet to build your feed:

```php
<?php

    echo page('posts')->children()->visible()->flip()->limit(10)->jsonfeed(array(
      'title' => 'My Blog JSON Feed',
      'feed' => url('feed')
    ));

?>
```

Currently the following options can be passed to the `jsonfeed` method:

- `title`: The title which should be display in the feed
- `feed`: The URL where the JSON Feed will be available (e.g http://domain.com/feed)
- `datefield`: The Field which should be used for the `date_modified` key (Defaults to `date`)
- `textfield`: The Field which should be used for the `content_html` key (Defaults to `text`)

4. Visit `/feed` on your site and you should see your new JSON RSS Feed.

## List of Supported RSS Readers

A short ongoing list of RSS Readers which already support the JSON Format.

- [Feedbin](https://feedbin.com) - [Blogpost](https://feedbin.com/blog/2017/05/22/feedbin-supports-json-feed/)
- [Newsblur](http://newsblur.com) - [Blogpost](http://blog.newsblur.com/post/160982162270/newsblur-now-supports-the-new-json-feed-spec)

Feel free to open an Issue or Pull request if you know more readers which support this new standard (Or if there's another list of supported readers).

## License

MIT


text:
using DataNirvana.Config;
using DataNirvana.Document;
using DataNirvana.DomainModel.Document;
using MGL.Data.DataUtilities;
using MGL.DomainModel;
using MGL.Web.WebUtilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GHSP.WebAdmin {
    public partial class TagList : MGLBasePage {

        //-------------------------------------------------------------------------------------------------------------------------------------------------------------
        protected override void OnInit(EventArgs e) {

            Functionality = "Administration";
            IsSecurePage = true;
            RequireRedirectOnSessionEnd = true;
            MgPageType = MGPageType.ASPX;

            base.OnInit(e);

        }

        //-------------------------------------------------------------------------------------------------------------------------------------------------------------
        protected void Page_Load(object sender, EventArgs e) {
            // To avoid the problem of the same file being uploaded twice .... (with minor changes)...
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

            if (Page.IsPostBack == false) {
                // Eaaaaasy
            } else {
                //_____ Lets try to get the add or delete the tag
                string errorMessage = "";
                bool success = false;

                if (string.IsNullOrEmpty(DoDelete.Value) == true) {
                    success = AddTag(TBTag.Value, out errorMessage);
                } else {
                    //_____ Delete the organisation
                    int tagToDelete = 0;
                    int.TryParse(DoDelete.Value, out tagToDelete);
                    success = DeleteTag(tagToDelete, out errorMessage);
                }

                ctlInfoSplash.SetupInfoSplash(success, errorMessage, false);
            }

            //_____ Always display all the organisations and refresh it even on postback to show the new organisation ...
            // 5-Oct-2015 - refactored to just use a KeyValuePair with the ID and name of each organisation for simplicity ...
            StringBuilder str = new StringBuilder();
            //str.Append("
");
            str.Append("
");
            //foreach (Organisation org in KeyInfo.AllOrganisations) {
            int counter = 0;

            foreach (WebDocTag tag in KeyInfo.Tags) {

                string css = (counter++ % 2 == 0) ? "B1" : "B2";
                //str.Append("
" + org.OrganisationName + "
");
                //str.Append("
" + tag.Value + "
");
                str.Append("

" + tag.Name + "
	Show content »	");
                // primary btn-lg

                // 4-Dec-16 - Add the delete buttons ...
                str.Append("Delete »	");

                str.Append("
");

            }
            //str.Append("
");
            str.Append("
");

            // now set the inner html of the list div ...
            TagFullList.InnerHtml = str.ToString();

        }

        //---------------------------------------------------------------------------------------------------------------------------------------------------------------
        ///
        ///     Bind the search results object after all the sorting etc has taken place ...
        ///
        protected void Page_PreRender(object sender, EventArgs e) {

            StringBuilder jsStr = new StringBuilder();

            //_____ 22-Mar-2016 - Append the list of static resources
            jsStr.Append(HTMLUtilities.BuildStaticResourcesHTML(this.Page, new string[] { "Scripts/DataManipulation.js" }));

            JS.Controls.Add(new LiteralControl(jsStr.ToString()));

        }

        //-------------------------------------------------------------------------------------------------------------------------------------------------------
        protected bool AddTag(string tagName, out string errorMessage) {

            bool success = false;
            errorMessage = "";

            string tagTN = WebDocProcessing.dbTNWebDocTag;

            try {

                //___ Check it is not shit
                if (tagName == null || tagName == "" || tagName.Trim() == "") {
                    errorMessage = "No new tag was provided - please try again.";
                } else {

                    // clean it up a bit
                    tagName = tagName.Trim();
                    tagName = tagName.Replace("  ", " ");
                    tagName = tagName.Replace("  ", " ");
                    tagName = tagName.Replace("  ", " ");
                    tagName = tagName.Replace("  ", " ");
                    tagName = tagName.Replace("  ", " ");
                    tagName = tagName.Replace("  ", " ");
                    tagName = tagName.Replace("  ", " ");

                    //_____ See if it exists already
                    bool alreadyExists = false;
                    foreach( WebDocTag wdt in KeyInfo.Tags) {
                        if ( wdt.Name.Equals( tagName, StringComparison.CurrentCultureIgnoreCase) == true) {
                            alreadyExists = true;
                            break;
                        }
                    }

                    if (alreadyExists == true) {
                        errorMessage = "The tag name '" + tagName + "' already exists!  Please check the name and try again.";
                    } else {

                        // OK here lets setup the processing obj
                        WebDocProcessing wdp = new WebDocProcessing(MGLSessionInterface.Instance().Config);

                        //_____ So now then lets try to insert it ...
                        success = wdp.InsertWebDocTag(tagName);

                        //_____ Lastly, if added then we need to reset the global organisation variables ....
                        if (success == false) {
                            errorMessage = "Could not insert the new tag name '" + tagName + "'.  This should not normally happen - please inform a website administrator and provide them with a screenshot.";
                        } else {
                            int b4Count = KeyInfo.Tags.Count;

                            // then lastly - if this is successful - we need to refresh the global list of tags ...
                            lock (KeyInfo.Tags) {
                                KeyInfo.Tags = wdp.GetAllWebDocTags();
                            }

                            // Success is that the number of tags increments by one
                            success = ((b4Count + 1) == KeyInfo.Tags.Count);
                            if (success == false) {
                                errorMessage = "Could not update the website global variables after adding new tag '" + tagName
                                    + "'. This should not normally happen - please inform a website administrator and provide them with a screenshot.";
                            } else {
                                errorMessage = "The new tag '" + tagName + "' has been added successfully.";
                                //TBTag.Value = tagName;
                                TBTag.Value = "";
                                DoDelete.Value = "";
                            }
                        }
                    }
                }

            } catch (Exception ex) {

                ctlInfoSplash.SetupInfoSplash(false, "General error trying to add the tag.  Please try again.", false);
                Logger.LogError(7, "Error adding a new tag: " + ex.ToString());

            }

            return success;
        }

        //-------------------------------------------------------------------------------------------------------------------------------------------------------
        protected bool DeleteTag(int tagID, out string errorMessage) {

            bool success = false;
            errorMessage = "";

            try {

                //___ Check it is not shit
                if (tagID <= 0) {
                    errorMessage = "No tag was selected.  Please try again.";
                } else {

                    string tagName = "";
                    foreach (WebDocTag wdt in KeyInfo.Tags) {
                        if (wdt.ID == tagID) {
                            tagName = wdt.Name;
                            break;
                        }
                    }

                    // OK here lets setup the processing obj
                    WebDocProcessing wdp = new WebDocProcessing(MGLSessionInterface.Instance().Config);

                    //_____ So now then lets try to delete it ... and all the associated XRefs ...
                    success = wdp.DeleteWebDocTag(tagID);

                    //_____ Lastly, if added then we need to reset the global organisation variables ....
                    if (success == false) {
                        errorMessage = "Could not delete the tag with ID " + tagID + ".  This should not normally happen - please inform a website administrator and provide them with a screenshot.";
                    } else {
                        int b4Count = KeyInfo.Tags.Count;

                        // then lastly - if this is successful - we need to refresh the global list of tags ...
                        lock (KeyInfo.Tags) {
                            KeyInfo.Tags = wdp.GetAllWebDocTags();
                        }

                        // Success is that the number of tags increments by one
                        success = ((b4Count - 1) == KeyInfo.Tags.Count);
                        if (success == false) {
                            errorMessage = "Could not update the website global variables after deleting the tag with ID " + tagID
                                + ". This should not normally happen - please inform a website administrator and provide them with a screenshot.";
                        } else {
                            errorMessage = "The tag '" + tagName + "' and all corresponding cross-references have been successfully deleted.";
                            TBTag.Value = "";
                            DoDelete.Value = "";
                        }

                    }
                }

            } catch (Exception ex) {

                ctlInfoSplash.SetupInfoSplash(false, "General error trying to delete the organisation.  Please try again.", false);
                Logger.LogError(7, "Error deleting the organisation: " + ex.ToString());

            }

            return success;
        }

    }
}


text:
import mergeAll from './mergeAll';
import Observable from '../Observable';
import Scheduler from '../Scheduler';
import { CoreOperators } from '../CoreOperators';

/**
 * Joins this observable with multiple other observables by subscribing to them one at a time, starting with the source,
 * and merging their results into the returned observable. Will wait for each observable to complete before moving
 * on to the next.
 * @params {...Observable} the observables to concatenate
 * @params {Scheduler} [scheduler] an optional scheduler to schedule each observable subscription on.
 * @returns {Observable} All values of each passed observable merged into a single observable, in order, in serial fashion.
 */
export default function concat<R>(...observables: (Observable<any>|Scheduler)[]): Observable<R> {
  let args = <any[]>observables;
  args.unshift(this);
  if (args.length > 1 && typeof args[args.length - 1].schedule === 'function') {
    args.splice(args.length - 2, 0, 1);
  }
  return (<CoreOperators<any>>Observable.fromArray(args)).mergeAll(1);
}


text:
package org.kul.net;

import java.util.HashMap;

import org.kul.StringArgsParsingService;

public class NetworkParameterHandler {

  private static NetworkParameterHandler instance;

  public static NetworkParameterHandler INSTANCE(){
    return instance == null ? (instance = new NetworkParameterHandler()) : instance;
  }

  public NetworkParameters handle(final String args[]){
    return new NetworkParameters(){{
      HashMap<String, String> argMap = StringArgsParsingService.INSTANCE().returnParsedArguments(args);
      for(String s : argMap.keySet()){
        if(s.equals("host"))  { setHost(argMap.get(s));}
        if(s.equals("port"))  { setPort(argMap.get(s));}
      }
    }};
  }

}


text:
(function(window, undefined){

    function Addon(){}

    // c.f. http://stackoverflow.com/questions/3772788/how-to-load-file-from-inside-firefox-plugin
    Addon.prototype.readFile = function(file){
        try {
            var ioService = Components
                .classes["@mozilla.org/network/io-service;1"]
                .getService(Components.interfaces.nsIIOService);
            var scriptableStream = Components
                .classes["@mozilla.org/scriptableinputstream;1"]
                .getService(Components.interfaces.nsIScriptableInputStream);
            var channel = ioService.newChannel(file,null,null);
            var input = channel.open();
            scriptableStream.init(input);
            var str = scriptableStream.read(input.available());
            scriptableStream.close();
            input.close();
            return(str);
        } catch(e){
            return(false);
        }
    };

    Addon.prototype.writeFile = function(file, contents){
        try {
            var output    = FileUtils.openFileOutputStream(file)
              , converter = FileUtils.getUnicodeConverter("UTF-8")
              , text      = converter.ConvertFromUnicode(contents)
              ;
            output.write(text, text.length);
            var fin = converter.Finish();
            if(fin.length > 0){ output.write(fin, fin.length); }
            output.close();
            return(true);
        } catch(e){
            return(false);
        }
    };

    Addon.prototype.openFileDialog = function(title){
        return showFilePicker(
                window
              , title
              , Components.interfaces.nsIFilePicker.modeSave
              , Format.TEST_CASE_EXPORT_DIRECTORY_PREF
              , function(fp){ return fp.file; }
        );
    };

    if(!window.UOCHAN){
        window.UOCHAN = {};
    }
    if(!window.UOCHAN.addon){
        window.UOCHAN.addon = new Addon();
    }
}(window));


text:
{% for asset in asset_list %}
<form class="form-horizontal" action="/asset/upd/" method="post">
  <input type="hidden" name="id" id="id" value="{{ asset['id'] }}"/>

    资产编号:

      <input type="text" class="form-control" name="sn" id="sn" value="{{ asset['sn'] }}" readonly="readonly">

    IP地址 :

        <input type="text" class="form-control" name="ip" id="ip" value="{{ asset['ip'] }}">

    主机名:

        <input type="text" class="form-control" name="hostname" id="hostname" value="{{ asset['hostname'] }}">

    机房:

        <select  class="form-control" name="idc_id" id="idc_id">
          {% for _id, _value in idcs %}
            <option value="{{_id}}">{{_value}}</option>
          {% endfor %}
        </select>

    采购日期:

        <input type="text" class="form-control" name="purchase_date" id="purchase_date" value="{{ asset['purchase_date'] }}">

    保修时间(年):

        <input type="text" class="form-control" name="warranty" id="warranty" value="{{ asset['warranty'] }}">

    供应商:

        <input type="text" class="form-control" name="vendor" id="vendor" value="{{ asset['vendor'] }}">

    型号:

        <input type="text" class="form-control" name="model" id="model" value="{{ asset['model'] }}">

    使用人:

        <input type="text" class="form-control" name="admin" id="admin" value="{{ asset['admin'] }}">

    业务:

        <input type="text" class="form-control" name="business" id="business" value="{{ asset['business'] }}">

    操作系统:

        <input type="text" class="form-control" name="os" id="os" value="{{ asset['os'] }}">

    CPU核数:

<input type="text" class="form-control" name="cpu" id="cpu" data-slider-id='ex1Slider' data-slider-min="0" data-slider-max="64" data-slider-step="1" data-slider-value="{{ asset['cpu'] }}">

    内存(G):

<input type="text" class="form-control" name="ram" id="ram" data-slider-id='ex1Slider' data-slider-min="0" data-slider-max="200" data-slider-step="1" data-slider-value="{{ asset['ram'] }}">

    磁盘大小(G):

<input type="text" class="form-control" name="disk" id="disk" data-slider-id='ex1Slider' data-slider-min="0" data-slider-max="2048" data-slider-step="1" data-slider-value="{{ asset['disk'] }}">

</form>
{% endfor%}


text:
title: Special Pythagorean triplet
localeTitle: Triplete de Pitágoras Especial
---
## Problema 9: triplete pitagórico especial

Esto es un talón. [Ayuda a nuestra comunidad a expandirla](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/coding-interview-prep/project-euler/problem-9-special-pythagorean-triplet/index.md) .

[Esta guía rápida de estilo ayudará a asegurar que su solicitud de extracción sea aceptada](https://github.com/freecodecamp/guides/blob/master/README.md) .


text:
import React from 'react';
import ReactDOM from 'react-dom';

import JqxCalendar from '../../../jqwidgets-react/react_jqxcalendar.js';
import JqxPanel from '../../../jqwidgets-react/react_jqxpanel.js';

class App extends React.Component {
    componentDidMount() {
        let panelID = this.refs.myPanel.componentSelector;
        document.getElementById(panelID).style.border = 'none';

        this.refs.myCalendar.on('change viewChange', (event) => {
            let date = event.args.date;
            let view = event.args.view;
            let viewFrom = view.from;
            let viewTo = view.to;
            this.refs.myPanel.clearcontent();
            if (event.type === 'viewChange') {
                this.refs.myPanel.prepend('
Event Type: viewChange
Date: ' + date + '
View: ' + viewFrom + ' - ' + viewTo + '
');
            }
            else {
                this.refs.myPanel.prepend('
Event Type: change
Date: ' + date + '
');
            }
        });
    }
    render() {
        return (

                <JqxCalendar ref='myCalendar' style={{ marginTop: 3 }}
                    width={220} height={220}
                />

                        Events:
                        <JqxPanel ref='myPanel' width={600} height={250} />

        )
    }
}

ReactDOM.render(<App />, document.getElementById('app'));


text:
/* jshint node:true */

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

(function() {
    "use strict";

    var xmlDeclaration = true;
    var xmlVersion = "1.0";
    var xmlEncoding = "UTF-8";
    var attributeString = "@";
    var valueString = "#";
    var prettyPrinting = true;
    var indentString = "\t";
    var convertMap = {};
    var useCDATA = false;

    module.exports = function (root, data, options) {
        return toXML(init(root, data, options));
    };

    // Initialization
    var init = function(root, data, options) {
        // Set option defaults
        setOptionDefaults();

        // Error checking for root element
        if (typeof root !== "string") {
            throw new Error("root element must be a string");
        }
        else if (root === "") {
            throw new Error("root element cannot be empty");
        }

        // Error checking and variable initialization for options
        if (typeof options === "object" && options !== null) {
            if ("declaration" in options) {
                if ("include" in options.declaration) {
                    if (typeof options.declaration.include === "boolean") {
                        xmlDeclaration = options.declaration.include;
                    }
                    else {
                        throw new Error("declaration.include option must be a boolean");
                    }
                }

                if ("encoding" in options.declaration) {
                    if (typeof options.declaration.encoding === "string" || options.declaration.encoding === null) {
                        xmlEncoding = options.declaration.encoding;
                    }
                    else {
                        throw new Error("declaration.encoding option must be a string or null");
                    }
                }
            }
            if ("attributeString" in options) {
                if (typeof options.attributeString === "string") {
                    attributeString = options.attributeString;
                }
                else {
                    throw new Error("attributeString option must be a string");
                }
            }
            if ("valueString" in options) {
                if (typeof options.valueString === "string") {
                    valueString = options.valueString;
                }
                else {
                    throw new Error("valueString option must be a string");
                }
            }
            if ("prettyPrinting" in options) {
                if ("enabled" in options.prettyPrinting) {
                    if (typeof options.prettyPrinting.enabled === "boolean") {
                        prettyPrinting = options.prettyPrinting.enabled;
                    }
                    else {
                        throw new Error("prettyPrinting.enabled option must be a boolean");
                    }
                }

                if ("indentString" in options.prettyPrinting) {
                    if (typeof options.prettyPrinting.indentString === "string") {
                        indentString = options.prettyPrinting.indentString;
                    }
                    else {
                        throw new Error("prettyPrinting.indentString option must be a string");
                    }
                }
            }
            if ("convertMap" in options) {
                if (Object.prototype.toString.call(options.convertMap) === "[object Object]") {
                    convertMap = options.convertMap;
                }
                else {
                    throw new Error("convertMap option must be an object");
                }
            }
            if ("useCDATA" in options) {
                if (typeof options.useCDATA === "boolean") {
                    useCDATA = options.useCDATA;
                }
                else {
                    throw new Error("useCDATA option must be a boolean");
                }
            }
        }

        // Error checking and variable initialization for data
        if (typeof data !== "string" && typeof data !== "object" && typeof data !== "number" &&
            typeof data !== "boolean" && data !== null) {
            throw new Error("data must be an object (excluding arrays) or a JSON string");
        }

        if (data === null) {
            throw new Error("data must be an object (excluding arrays) or a JSON string");
        }

        if (Object.prototype.toString.call(data) === "[object Array]") {
            throw new Error("data must be an object (excluding arrays) or a JSON string");
        }

        if (typeof data === "string") {
            data = JSON.parse(data);
        }

        var tempData = {};
        tempData[root] = data; // Add root element to object

        return tempData;
    };

    // Convert object to XML
    var toXML = function(object) {
        // Initialize arguments, if necessary
        var xml = arguments[1] || "";
        var level = arguments[2] || 0;

        var i = null;
        var tempObject = {};

        for (var property in object) {
            if (object.hasOwnProperty(property)) {
                // Element name cannot start with a number
                var elementName = property;
                if (/^\d/.test(property)) {
                    elementName = "_" + property;
                }

                // Arrays
                if (Object.prototype.toString.call(object[property]) === "[object Array]") {
                    // Create separate XML elements for each array element
                    for (i = 0; i < object[property].length; i++) {
                        tempObject = {};
                        tempObject[property] = object[property][i];

                        xml = toXML(tempObject, xml, level);
                    }
                }
                // JSON-type objects with properties
                else if (Object.prototype.toString.call(object[property]) === "[object Object]") {
                    xml += addIndent("<" + elementName, level);

                    // Add attributes
                    var lengthExcludingAttributes = Object.keys(object[property]).length;
                    if (Object.prototype.toString.call(object[property][attributeString]) === "[object Object]") {
                        lengthExcludingAttributes -= 1;
                        for (var attribute in object[property][attributeString]) {
                            if (object[property][attributeString].hasOwnProperty(attribute)) {
                                xml += " " + attribute + "=\"" +
                                    toString(object[property][attributeString][attribute], true) + "\"";
                            }
                        }
                    }
                    else if (typeof object[property][attributeString] !== "undefined") {
                        // Fix for the case where an object contains a single property with the attribute string as its
                        // name, but this property contains no attributes; in that case, lengthExcludingAttributes
                        // should be set to zero to ensure that the object is considered an empty object for the
                        // purposes of the following if statement.
                        lengthExcludingAttributes -= 1;
                    }

                    if (lengthExcludingAttributes === 0) { // Empty object
                        xml += addBreak("/>");
                    }
                    else if (lengthExcludingAttributes === 1 && valueString in object[property]) { // Value string only
                        xml += addBreak(">" + toString(object[property][valueString], false) + "</" + elementName + ">");
                    }
                    else { // Object with properties
                        xml += addBreak(">");

                        // Create separate object for each property and pass to this function
                        for (var subProperty in object[property]) {
                            if (object[property].hasOwnProperty(subProperty) && subProperty !== attributeString && subProperty !== valueString) {
                                tempObject = {};
                                tempObject[subProperty] = object[property][subProperty];

                                xml = toXML(tempObject, xml, level + 1);
                            }
                        }

                        xml += addBreak(addIndent("</" + elementName + ">", level));
                    }
                }
                // Everything else
                else {
                    xml += addBreak(addIndent("<" + elementName + ">" + toString(object[property], false) + "</" +
                        elementName + ">", level));
                }
            }
        }

        // Finalize XML at end of process
        if (level === 0) {
            // Strip trailing whitespace
            xml = xml.replace(/\s+$/g, "");

            // Add XML declaration
            if (xmlDeclaration) {
                if (xmlEncoding === null) {
                    xml = addBreak("<?xml version=\"" + xmlVersion + "\"?>") + xml;
                }
                else {
                    xml = addBreak("<?xml version=\"" + xmlVersion + "\" encoding=\"" + xmlEncoding + "\"?>") + xml;
                }
            }
        }

        return xml;
    };

    // Add indenting to data for pretty printing
    var addIndent = function(data, level) {
        if (prettyPrinting) {

            var indent = "";
            for (var i = 0; i < level; i++) {
                indent += indentString;
            }
            data = indent + data;
        }

        return data;
    };

    // Add line break to data for pretty printing
    var addBreak = function(data) {
        return prettyPrinting ? data + "\n" : data;
    };

    // Convert anything into a valid XML string representation
    var toString = function(data, isAttribute) {
        // Recursive function used to handle nested functions
        var functionHelper = function(data) {
            if (Object.prototype.toString.call(data) === "[object Function]") {
                return functionHelper(data());
            }
            else {
                return data;
            }
        };

        // Convert map
        if (Object.prototype.toString.call(data) in convertMap) {
            data = convertMap[Object.prototype.toString.call(data)](data);
        }
        else if ("*" in convertMap) {
            data = convertMap["*"](data);
        }
        // Functions
        else if (Object.prototype.toString.call(data) === "[object Function]") {
            data = functionHelper(data());
        }
        // Empty objects
        else if (Object.prototype.toString.call(data) === "[object Object]" && Object.keys(data).length === 0) {
            data = "";
        }

        // Cast data to string
        if (typeof data !== "string") {
            data = (data === null || typeof data === "undefined") ? "" : data.toString();
        }

        // Output as CDATA instead of escaping if option set (and only if not an attribute value)
        if (useCDATA && !isAttribute) {
            data = "<![CDATA[" + data.replace(/]]>/gm, "]]]]><![CDATA[>") + "]]>";
        }
        else {
            // Escape illegal XML characters
            data = data.replace(/&/gm, "&")
                .replace(/</gm, "<")
                .replace(/>/gm, ">")
                .replace(/"/gm, """)
                .replace(/'/gm, "'");
        }

        return data;
    };

    // Revert options back to their default settings
    var setOptionDefaults = function() {
        useCDATA = false;
        convertMap = {};
        xmlDeclaration = true;
        xmlVersion = "1.0";
        xmlEncoding = "UTF-8";
        attributeString = "@";
        valueString = "#";
        prettyPrinting = true;
        indentString = "\t";
    };
})();


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Elateraecium salacicola Thirum., F. Kern & B.V. Patil

### Remarks
null


text:
package models;

import play.mvc.*;
import play.libs.*;
import play.libs.F.*;
import scala.concurrent.Await;
import scala.concurrent.duration.Duration;
import akka.actor.*;
import static akka.pattern.Patterns.ask;
import collsion.Collision;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.ArrayNode;

import java.util.*;

import static java.util.concurrent.TimeUnit.*;

/**
 * A chat room is an Actor.
 */
public class GameRoom extends UntypedActor {

	// Default room.
	public static ActorRef defaultRoom = Akka.system().actorOf(Props.create(GameRoom.class));

	/**
	 * Join the default room.
	 */
	public static void join(final String username, WebSocket.In<JsonNode> in, WebSocket.Out<JsonNode> out) throws Exception{

		// Send the Join message to the room
		String result = (String)Await.result(ask(defaultRoom,new Messages.Join(username, out), 1000), Duration.create(1, SECONDS));

		if("OK".equals(result)) {

			// For each event received on the socket,
			in.onMessage(new Callback<JsonNode>() {
				public void invoke(JsonNode event) {

					switch (event.get("type").asText()) {
					case "message":  defaultRoom.tell(new Messages.Talk(username, event.get("text").asText()), null);
						break;
					case "configuration":  defaultRoom.tell(new Messages.GameConfiguration(username, event.get("numberOfPlayers").asInt(), event.get("numberOfPlayers").asDouble()), null);
					break;
					  case "play":  defaultRoom.tell(new Messages.StartGame(username, null), null);
          break;
					default:
						defaultRoom.tell(new Messages.Unknown(username, event.get("type").asText()), null);
						break;
					}

				}
			});

			// When the socket is closed.
			in.onClose(new Callback0() {
				public void invoke() {

					// Send a Quit message to the room.
					defaultRoom.tell(new Messages.Quit(username), null);

				}
			});

		} else {

			// Cannot connect, create a Json error.
			ObjectNode error = Json.newObject();
			error.put("error", result);

			// Send the error to the socket.
			out.write(error);

		}

	}

	// Members of this room.
	Map<String, WebSocket.Out<JsonNode>> members = new HashMap<String, WebSocket.Out<JsonNode>>();
	Map<String, String> players = new HashMap<String, String>();
	Map<String, String> host = new HashMap<String, String>();
	public static Map<String, GameRoomData> game_list = new HashMap<String, GameRoomData>();

	public void onReceive(Object message) throws Exception {

		if(message instanceof Messages.CreateGame) {

			// Received a CreateGame message
			Messages.CreateGame create = (Messages.CreateGame)message;

			players.put(create.username, create.room_name);
			host.put(create.room_name, create.username);

		} else if(message instanceof Messages.JoinGameRoom) {

			// Received a JoinGameRoom message
			Messages.JoinGameRoom join = (Messages.JoinGameRoom)message;

			players.put(join.username, join.room_name);

		} else if(message instanceof Messages.Join) {

			// Received a Join message
			Messages.Join join = (Messages.Join)message;

			// Check if this username is free.
			if(members.containsKey(join.username)) {
				getSender().tell("This username is already used", getSelf());
			} else {
				members.put(join.username, join.channel);
				String room = players.get(join.username);
				int numberOfPlayers = ++game_list.get(room).numberOfPlayers;

				notifyAll(JsonMessages.Join(join.username), room);
				notifyAll(JsonMessages.Configuration(game_list.get(room)), room);
				getSender().tell("OK", getSelf());
			}

		} else if(message instanceof Messages.GameConfiguration) {

			// Received a GameConfiguration message
			Messages.GameConfiguration conf = (Messages.GameConfiguration)message;

			String room = players.get(conf.username);
			String roomhost = host.get(room);

			if(roomhost != null && roomhost.equals(conf.username)) {
				game_list.get(room).maxNumberOfPlayers=conf.maxNumberOfPlayers;
				game_list.get(room).radius=conf.radius;
				notifyAll(JsonMessages.Configuration(game_list.get(room)), room);
			}

		} else if(message instanceof Messages.StartGame)  {

			// Received a StartGame message
			Messages.StartGame start = (Messages.StartGame)message;

			System.out.println("StartGame ");

			String roomname = players.get(start.username);
			String roomhost = host.get(roomname);

			if(roomhost != null && roomhost.equals(start.username)) {

				Game.game_list.put(roomname, game_list.get(roomname));
				Game.collision.put(roomname, new Collision(game_list.get(roomname).radius));
				//Game.defaultRoom.tell(new Messages.CreateGame(start.username, start.roomname), null);

				for(Map.Entry<String, String> entry: players.entrySet()) {
				  Game.players.put(entry.getKey(), entry.getValue());
				}
				Game.host.put(start.username, roomname);

				host.remove(roomname);
				game_list.remove(roomname);
				System.out.println("Usuwanie "+game_list.size());
				notifyAll(JsonMessages.StartGame(), roomname);
			}
			else {
				Game.defaultRoom.tell(new Messages.JoinGame(start.username, roomname), null);
			}

		} else if(message instanceof Messages.InitializedGame)  {

      // Received a Talk message
      Messages.InitializedGame init = (Messages.InitializedGame)message;

      sendJSON(init.username, JsonMessages.Init());

    } else if(message instanceof Messages.Leave)  {

			// Received a Talk message
			Messages.Leave leave = (Messages.Leave)message;

			System.out.println("LeaveGameRoom");

			String roomhost = host.get(leave.roomname);

			if(roomhost != null && roomhost.equals(leave.username)) {
				host.remove(leave.roomname);
				game_list.remove(leave.roomname);
				notifyAll(JsonMessages.Leave(leave.username), leave.roomname);
			}

		} else if(message instanceof Messages.Talk)  {

			// Received a Talk message
			Messages.Talk talk = (Messages.Talk)message;

			notifyAll(JsonMessages.Talk(talk.username, talk.text), players.get(talk.username));

		} else if(message instanceof Messages.Quit)  {

			// Received a Quit message
			Messages.Quit quit = (Messages.Quit)message;

			System.out.println("Quit");

			members.remove(quit.username);
			String room = players.get(quit.username);
			players.remove(quit.username);

			if(game_list.get(room) != null)
			  game_list.get(room).numberOfPlayers--;

			notifyAll(JsonMessages.Quit(quit.username), room);

		} else if(message instanceof Messages.Unknown)  {

			// Received a Unknown message
			Messages.Unknown unknown = (Messages.Unknown)message;

			sendJSON(unknown.username, JsonMessages.Unknown("unknown type: "+unknown.unknownType));

		} else {
			unhandled(message);
		}

	}

	// Send a Json event to all members
	public void notifyAll(ObjectNode event, String room) {
		for(Map.Entry<String, String> entry: players.entrySet()) {

			if(entry.getValue().equals(room)) {

				ArrayNode m = event.putArray("members");
				for(String u: members.keySet()) {
					m.add(u);
				}

				members.get(entry.getKey()).write(event);
			}
		}
	}

	public static class GameRoomData {
		final String room_name;
		final String host_name;
		int numberOfPlayers;
		int maxNumberOfPlayers;
		double radius;

		public boolean isFull() {
		  return numberOfPlayers == maxNumberOfPlayers;
		}

		public GameRoomData(String room_name, String host_name) {
			this.host_name = host_name;
			this.room_name = room_name;
			numberOfPlayers = 0;
			maxNumberOfPlayers = 1;
			radius = 30;
		}
	}

	// Send a Json event to given member
	public void sendJSON(String username, ObjectNode event) {

		ArrayNode m = event.putArray("members");
		for(String u: members.keySet()) {
			m.add(u);
		}

		members.get(username).write(event);
	}
}


text:
var Path = require('path');
var Hoek = require('hoek');
var MimeDb = require('mime-db');

// Declare internals

var internals = {};

internals.compressibleRx = /^text\/|\+json$|\+text$|\+xml$/;

module.exports = internals.Mimos = function (options) {

    options = options || {};

    Hoek.assert(this.constructor === internals.Mimos, 'Mimos must be created with new');

    var result = options.override ? internals.compile(options.override) : internals.base;
    this._byType = result.byType;
    this._byExtension = result.byExtension;
};

internals.compile = function (override) {

    var db = Hoek.clone(MimeDb);
    Hoek.merge(db, override, true, false);

    var result = {
        byType: db,
        byExtension: {}
    };

    var keys = Object.keys(result.byType);
    for (var i = 0, il = keys.length; i < il; i++) {
        var type = keys[i];
        var mime = result.byType[type];
        mime.type = mime.type || type;
        mime.source = mime.source || 'mime-db';
        mime.extensions = mime.extensions || [];
        mime.compressible = (mime.compressible !== undefined ? mime.compressible : internals.compressibleRx.test(type));

        Hoek.assert(!mime.predicate || typeof mime.predicate === 'function', 'predicate option must be a function');

        for (var j = 0, jl = mime.extensions.length; j < jl; j++) {
            var ext = mime.extensions[j];
            result.byExtension[ext] = mime;
        }
    }

    return result;
};

internals.base = internals.compile();       // Prevents an expensive copy on each constructor when no customization is needed

internals.Mimos.prototype.path = function (path) {

    var extension = Path.extname(path).slice(1).toLowerCase();
    var mime = this._byExtension[extension] || {};

    if (mime.predicate) {
         return mime.predicate(Hoek.clone(mime));
    }

    return mime;
};

internals.Mimos.prototype.type = function (type) {

    type = type.split(';', 1)[0].trim().toLowerCase();
    var mime = this._byType[type];
    if (!mime) {
        mime = {
            type: type,
            source: 'mimos',
            extensions: [],
            compressible: internals.compressibleRx.test(type)
        };

        this._byType[type] = mime;
        return mime;
    }

    if (mime.predicate) {
        return mime.predicate(Hoek.clone(mime));
    }

    return mime;
};


text:
/**
 * Bit Bit Tests
 */
const BitBit = require('../index');
const chai = require('chai');
const expect = chai.expect;
const assert = require('assert');

chai.use(require('chai-shallow-deep-equal'));

const schema = {
  level: [0, 7],      // 0 - 128 levels
  class: [8, 9],      // 4 total classes (0 - 3)
  isAwesome: [10],    // Boolean - whether player is awesome
};

const schemaB = {
  'class.index': [0, 1],      // 0 - 3
  'playerValues[0]': [2],     // Boolean Value
  'playerValues[1]': [3, 3],  // Single Bit Number Value
};

const bitPlayer = new BitBit(schema);
const bitPlayer2 = new BitBit(schemaB);

describe('Bit Bit Conversion Unit Tests', () => {
  it('should convert an object to a bit value based on a schema and back and ignore extra fields', () => {
    let val = bitPlayer.pack({
      isAwesome: true,
      level: 100,
      class: 0,
      name: 'Bob',
    });

    expect(val).to.equal(1124);

    let obj = bitPlayer.unpack(val);

    expect(obj).to.shallowDeepEqual({
      isAwesome: true,
      level: 100,
      class: 0,
    });
  });

  it('should unpack a value and convert it to the proper object', () => {
    let obj = bitPlayer.unpack(300);

    expect(obj).to.shallowDeepEqual({
      level: 44,
      class: 1,
    });
  });

  it('should ignore if a field is not a boolean or number even if it is in the schema', () => {
    let val = bitPlayer.pack({
      level: '500',
      class: 1,
    });

    expect(val).to.equal(256);
  });

  it('should limit fields to the maximum and not break', () => {
    let val = bitPlayer.pack({
      level: 384,       // 128 + 256
      class: 0,
      isAwesome: false,
    });

    expect(val).to.equal(128);

    let obj = bitPlayer.unpack(val);

    expect(obj).to.shallowDeepEqual({
      level: 128,
      class: 0,
      isAwesome: false,
    });
  });

  it('should let you use lodash notation in the schema to access nested fields', () => {
    let val = bitPlayer2.pack({
      class: {
        index: 3,
        name: 'Mage',
      },
      playerValues: [
        true,
        1,
      ],
    });

    expect(val).to.equal(15);

    let obj = bitPlayer2.unpack(val);

    expect(obj).to.shallowDeepEqual({
      class: {
        index: 3,
      },
      playerValues: [true, 1],
    });
  });

  describe('Error Handling', () => {
    it('should throw an error if no schema is given', () => checkThrown());

    it('should throw an error if the schema was not an object', () => checkThrown([]));

    it('should throw an error if the schema has no fields', () => checkThrown({}));

    it('should throw an error if the schema has fields that do not have an array', () => checkThrown({ field: 5 }));

    it('should throw an error if the array in the field is empty', () => checkThrown({ field: [] }));

    it('should throw an error if the array has more than 2 fields', () => checkThrown({ field: [0, 1, 2] }));

    it('should throw an error if the array has values that are not numbers', () => checkThrown({ field: ['A'] }));

    // TODO - make this work
    it.skip('should throw an error if the schema has fields with values that overlap', () => checkThrown({ fieldA: [0, 2], fieldB: [1, 3] }));
  });
});

function checkThrown(schema) {
  let errorHappened = false;
  try {
    new BitBit(schema);
  } catch (e) {
    errorHappened = true;
  }

  assert(errorHappened, 'Should have thrown an error');
}


text:
package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"os/exec"
)

func main() {
	runCmd()
	fmt.Println()
	runCmdWithPipe()
}

func runCmdWithPipe() {
	fmt.Println("Run command `ps aux | grep apipe`: ")
	cmd1 := exec.Command("ps", "aux")
	cmd2 := exec.Command("grep", "apipe")
	var outputBuf1 bytes.Buffer
	cmd1.Stdout = &outputBuf1
	if err := cmd1.Start(); err != nil {
		fmt.Printf("Error: The first command can not be startup %s\n", err)
		return
	}
	if err := cmd1.Wait(); err != nil {
		fmt.Printf("Error: Couldn't wait for the first command: %s\n", err)
		return
	}
	cmd2.Stdin = &outputBuf1
	var outputBuf2 bytes.Buffer
	cmd2.Stdout = &outputBuf2
	if err := cmd2.Start(); err != nil {
		fmt.Printf("Error: The second command can not be startup: %s\n", err)
		return
	}
	if err := cmd2.Wait(); err != nil {
		fmt.Printf("Error: Couldn't wait for the second command: %s\n", err)
		return
	}
	fmt.Printf("%s\n", outputBuf2.Bytes())
}

func runCmd() {
	useBufferedIO := false
	fmt.Println("Run command `echo -n \"My first command comes from golang.\"`: ")
	cmd0 := exec.Command("echo", "-n", "My first command comes from golang.")
	stdout0, err := cmd0.StdoutPipe()
	if err != nil {
		fmt.Printf("Error: Couldn't obtain the stdout pipe for command No.0: %s\n", err)
		return
	}
	if err := cmd0.Start(); err != nil {
		fmt.Printf("Error: The command No.0 can not be startup: %s\n", err)
		return
	}
	if !useBufferedIO {
		var outputBuf0 bytes.Buffer
		for {
			tempOutput := make([]byte, 5)
			n, err := stdout0.Read(tempOutput)
			if err != nil {
				if err == io.EOF {
					break
				} else {
					fmt.Printf("Error: Couldn't read data from the pipe: %s\n", err)
					return
				}
			}
			if n > 0 {
				outputBuf0.Write(tempOutput[:n])
			}
		}
		fmt.Printf("%s\n", outputBuf0.String())
	} else {
		outputBuf0 := bufio.NewReader(stdout0)
		output0, _, err := outputBuf0.ReadLine()
		if err != nil {
			fmt.Printf("Error: Couldn't read data from the pipe: %s\n", err)
			return
		}
		fmt.Printf("%s\n", string(output0))
	}
}


text:
<?php
/*
Template Name: MAP Elenco percorso Sidebar Right
*/
?>
<?php acf_form_head(); ?>
<?php get_header(); ?>
<?php get_template_part('_page-image'); ?>

<?php while(have_posts()): the_post(); ?>

<?php echo wpb_page_title(); ?>

			<article id="entry-<?php the_ID(); ?>" <?php post_class('entry'); ?>>

					<?php the_content(); ?>

<?php
//$idframe=$_GET['gid'];//questo numero varia ed è da associare al frame
$page_id=$_GET['page_id'];
$percorso_id=$_GET['percorso_id'];

$key="mykey";
$lat = get_post_meta($post->ID, 'lat', true);
$lon = get_post_meta($post->ID, 'lon', true);
//echo"";
//echo"";
?>

			<?php comments_template(); ?>

<?php endwhile; ?>

        <?php
echo"

";

        $return='1951';//la pagina dell'elenco dei percorsi rimane sempre la stessa e senza variabile
echo"

torna all'elenco percorsi

";
echo"

";
echo"

Elenco POI

";
echo"";
echo"

";
?>
			<?php get_sidebar(); ?>

<?php get_footer(); ?>


text:
'''
Show standard cURL behaviour from an AppVM and a TemplateVM (with/without firewall)
'''
from pyqubes.vm import TemplateVM

internet_test_command = 'curl http://ipecho.net/plain'

# Create a pyqubes TemplateVM representing the existing QubesOS TemplateVM
vm_vanilla = TemplateVM('fedora-23')
# Create a new AppVM
example_app = vm_vanilla.create_app('example-app-pyqu-ex-1')

# Start the AppVM
with example_app.animate:
    # AppVMs have an open firewall by default
    example_app.run(internet_test_command)
example_app.remove()

# Start the TemplateVM
with vm_vanilla.animate:
    # To the same in a template, open the firewall temporarily
    with vm_vanilla.internet:
        vm_vanilla.run(internet_test_command)
    # It will be closed automatically
    vm_vanilla.run(internet_test_command)


text:
The next steps provides the easiest and recommended way to set up your
environment to use pandas. Other installation options can be found in
the [advanced installation page]({{ base_url}}/docs/getting_started/install.html).

1. Download [Anaconda](https://www.anaconda.com/distribution/) for your operating system and
   the latest Python version, run the installer, and follow the steps. Please note:

    - It is not needed (and discouraged) to install Anaconda as root or administrator.
    - When asked if you wish to initialize Anaconda3, answer yes.
    - Restart the terminal after completing the installation.

    Detailed instructions on how to install Anaconda can be found in the
    [Anaconda documentation](https://docs.anaconda.com/anaconda/install/).

2. In the Anaconda prompt (or terminal in Linux or MacOS), start JupyterLab:

3. In JupyterLab, create a new (Python 3) notebook:

4. In the first cell of the notebook, you can import pandas and check the version with:

5. Now you are ready to use pandas, and you can write your code in the next cells.

## Tutorials

You can learn more about pandas in the [tutorials]({{ base_url }}/docs/getting_started/intro_tutorials/),
and more about JupyterLab in the
[JupyterLab documentation](https://jupyterlab.readthedocs.io/en/stable/user/interface.html).

## Books

The book we recommend to learn pandas is [Python for Data Analysis](https://amzn.to/2KI5JJw),
by [Wes McKinney](https://wesmckinney.com/), creator of pandas.

## Videos

## Cheat sheet

[pandas cheat sheet](https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf)


text:
/**
 *
Title:

 *
Description:

 *
Copyright:TODO

 *@author
 *@version 1.0
 */

package edu.common.dynamicextensions.entitymanager;

import java.util.List;

/**
 * This is an interface to operate on the entity record
 * @author Rahul Ner
 * @author vishvesh Mulay
 *
 */
public interface EntityRecordInterface
{

	/**
	 * @return the recordId
	 */
	Long getRecordId();

	/**
	 * @param recordId the recordId to set
	 */
	void setRecordId(Long recordId);

	/**
	 * @return List list of record values
	 */
	List getRecordValueList();

	/**
	 * @param recordValueList list of record values
	 */
	void setRecordValueList(List recordValueList);

	/**
	 * @param index index
	 * @param value value
	 */
	void addRecordValue(int index,Object value);
}


text:
import os
basedir = os.path.abspath(os.path.dirname(__file__))

class Config:
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    MAIL_SERVER = os.environ.get('MAIL_SERVER')
    MAIL_PORT = 25
    MAIL_USE_TLS = False
    MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
    FLASKY_MAIL_SUBJECT_PREFIX = '[Flasky]'
    FLASKY_MAIL_SENDER = 'Flasky Admin <'+str(MAIL_USERNAME)+'>'
    FLASKY_ADMIN = os.environ.get('FLASKY_ADMIN')
    FLASKY_POSTS_PER_PAGE = 5
    FLASKY_FOLLOWERS_PER_PAGE = 10
    FLASKY_COMMENTS_PER_PAGE = 5

    @staticmethod
    def init_app(app):
        pass

class DevelopmentConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
        'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')

class TestingConfig(Config):
    TESTING = True
    SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or \
        'sqlite:///' + os.path.join(basedir, 'data-test.sqlite')

class ProductionConfig(Config):
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
        'sqlite:///' + os.path.join(basedir, 'data.sqlite')

config = {
    'development': DevelopmentConfig,
    'testing': TestingConfig,
    'production': ProductionConfig,

    'default': DevelopmentConfig
}


text:
export class Departamento{
    "id":number;
    "descricao": string
}


text:
module CodeDrivenDevelopment
  module Rule
    class Default < AbstractRule
      def test
      end
    end
  end
end


text:
using SX.WebCore.ViewModels;
using System;

namespace GE.WebUI.ViewModels
{
    public sealed class VMLCNBCategory
    {
        public VMLCNBCategory()
        {
            News = new VMLCNBNews[0];
            SubCategories = new VMLCNBCategory[0];
            Tags = new SxVMMaterialTag[0];
        }

        public string Id { get; set; }
        public string Title { get; set; }
        public Guid? FrontPictureId { get; set; }

        public VMLCNBNews[] News { get; set; }
        public VMLCNBCategory[] SubCategories { get; set; }
        public SxVMMaterialTag[] Tags { get; set; }
    }
}