text:
package org.apache.metamodel.excel;

import static org.junit.Assert.*;

import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;

import org.apache.metamodel.DataContext;
import org.apache.metamodel.MetaModelHelper;
import org.apache.metamodel.UpdateCallback;
import org.apache.metamodel.UpdateScript;
import org.apache.metamodel.data.DataSet;
import org.apache.metamodel.data.Row;
import org.apache.metamodel.data.Style;
import org.apache.metamodel.data.StyleBuilder;
import org.apache.metamodel.insert.InsertInto;
import org.apache.metamodel.query.Query;
import org.apache.metamodel.schema.Column;
import org.apache.metamodel.schema.ColumnType;
import org.apache.metamodel.schema.Schema;
import org.apache.metamodel.schema.Table;
import org.apache.metamodel.schema.naming.CustomColumnNamingStrategy;
import org.apache.metamodel.update.Update;
import org.apache.metamodel.util.DateUtils;
import org.apache.metamodel.util.FileHelper;
import org.apache.metamodel.util.FileResource;
import org.apache.metamodel.util.Month;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.rules.TestName;

public class ExcelDataContextTest {
    @Rule
    public TemporaryFolder folder = new TemporaryFolder();

    @Rule
    public TestName testName = new TestName();

    /**
     * Creates a copy of a particular file - to avoid changing of Excel files
     * under source control
     *
     * @param path
     * @return
     */
    private File copyOf(String path) {
        final File srcFile = new File(path);
        final File destFile = new File(folder.getRoot(), testName.getMethodName() + "-" + srcFile.getName());
        FileHelper.copy(srcFile, destFile);
        return destFile;
    }

    @Test
    public void testErroneousConstructors() throws Exception {
        try {
            new ExcelDataContext(null);
            fail("Exception expected");
        } catch (IllegalArgumentException e) {
            assertEquals("File cannot be null", e.getMessage());
        }

        File file = copyOf("src/test/resources/empty_file.xls");
        try {
            new ExcelDataContext(file, null);
            fail("Exception expected");
        } catch (IllegalArgumentException e) {
            assertEquals("ExcelConfiguration cannot be null", e.getMessage());
        }
    }

    @Test
    public void testEmptyFile() throws Exception {
        File file = copyOf("src/test/resources/empty_file.xls");
        ExcelDataContext dc = new ExcelDataContext(file);

        assertNull(dc.getSpreadsheetReaderDelegateClass());
        assertEquals(2, dc.getDefaultSchema().getTableCount());

        Table table = dc.getDefaultSchema().getTables().get(0);
        assertEquals("sheet", table.getName());
        assertEquals(0, table.getColumnCount());

        assertSame(file, ((FileResource) dc.getResource()).getFile());
    }

    @Test
    public void testEmptyFileNoHeaderLine() throws Exception {
        DataContext dc = new ExcelDataContext(copyOf("src/test/resources/empty_file.xls"), new ExcelConfiguration(
                ExcelConfiguration.NO_COLUMN_NAME_LINE, false, false));
        assertEquals(2, dc.getDefaultSchema().getTableCount());

        Table table = dc.getDefaultSchema().getTables().get(0);
        assertEquals("sheet", table.getName());
        assertEquals(0, table.getColumnCount());
    }

    @Test
    public void testUnexistingHeaderLine() throws Exception {
        DataContext dc = new ExcelDataContext(copyOf("src/test/resources/xls_people.xls"), new ExcelConfiguration(20,
                true, false));
        assertEquals(2, dc.getDefaultSchema().getTableCount());

        Table table = dc.getDefaultSchema().getTables().get(0);
        assertEquals("xls_people", table.getName());
        assertEquals(0, table.getColumnCount());
    }

    @Test
    public void testSkipEmptyColumns() throws Exception {
        ExcelConfiguration conf = new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, true, true);
        ExcelDataContext dc = new ExcelDataContext(copyOf("src/test/resources/skipped_lines.xlsx"), conf);
        Table table = dc.getDefaultSchema().getTables().get(0);
        assertEquals("[hello, world]", Arrays.toString(table.getColumnNames().toArray()));

        DataSet ds = dc.executeQuery(dc.query().from(table).select("hello").toQuery());
        assertTrue(ds.next());
        assertEquals("1", ds.getRow().getValue(0));
    }

    @Test
    public void testDontSkipEmptyLinesNoHeader() throws Exception {
        ExcelConfiguration conf = new ExcelConfiguration(ExcelConfiguration.NO_COLUMN_NAME_LINE, false, true);
        ExcelDataContext dc = new ExcelDataContext(copyOf("src/test/resources/skipped_lines.xlsx"), conf);
        Table table = dc.getDefaultSchema().getTables().get(0);
        assertEquals("[G, H]", Arrays.toString(table.getColumnNames().toArray()));

        assertEquals(6, table.getColumnByName("G").getColumnNumber());
        assertEquals(7, table.getColumnByName("H").getColumnNumber());

        DataSet ds = dc.executeQuery(dc.query().from(table).select("G").toQuery());

        // 5 empty lines
        for (int i = 0; i < 5; i++) {
            assertTrue(ds.next());
            Object value = ds.getRow().getValue(0);
            assertNull("Values was: " + value + " at row " + i, value);
        }

        assertTrue(ds.next());
        assertEquals("hello", ds.getRow().getValue(0));
        assertTrue(ds.next());
        assertEquals("1", ds.getRow().getValue(0));
    }

    @Test
    public void testDontSkipEmptyLinesAbsoluteHeader() throws Exception {
        ExcelConfiguration conf = new ExcelConfiguration(6, false, true);
        ExcelDataContext dc = new ExcelDataContext(copyOf("src/test/resources/skipped_lines.xlsx"), conf);
        Table table = dc.getDefaultSchema().getTables().get(0);
        assertEquals("[hello, world]", Arrays.toString(table.getColumnNames().toArray()));
        assertEquals(6, table.getColumnByName("hello").getColumnNumber());
        assertEquals(7, table.getColumnByName("world").getColumnNumber());

        DataSet ds = dc.executeQuery(dc.query().from(table).select("hello").toQuery());
        assertTrue(ds.next());
        assertEquals("1", ds.getRow().getValue(0));
    }

    @Test
    public void testInvalidFormula() throws Exception {
        ExcelDataContext dc = new ExcelDataContext(copyOf("src/test/resources/invalid_formula.xls"));
        Table table = dc.getDefaultSchema().getTables().get(0);

        assertEquals("[name]", Arrays.toString(table.getColumnNames().toArray()));

        Query q = dc.query().from(table).select("name").toQuery();

        DataSet ds = dc.executeQuery(dc.query().from(table).selectCount().toQuery());
        assertTrue(ds.next());
        assertEquals(3, Integer.parseInt(ds.getRow().getValue(0).toString()));
        assertFalse(ds.next());
        assertFalse(ds.next());
        ds.close();

        ds = dc.executeQuery(q);

        Row row;

        assertTrue(ds.next());
        row = ds.getRow();
        assertEquals("TismmerswerskisMFSTLandsmeers                                                          ", row
                .getValue(0).toString());

        assertTrue(ds.next());
        row = ds.getRow();
        assertEquals("-\"t\" \"houetismfsthueiss\"", row.getValue(0).toString());

        assertTrue(ds.next());
        row = ds.getRow();
        assertEquals("TismmerswerskisMFSTLandsmeers                                                          ", row
                .getValue(0).toString());

        assertFalse(ds.next());
        ds.close();
    }

    @Test
    public void testEvaluateFormula() throws Exception {
        ExcelDataContext dc = new ExcelDataContext(copyOf("src/test/resources/xls_formulas.xls"));

        Table table = dc.getDefaultSchema().getTables().get(0);
        Column[] columns = table.getColumns().toArray(new Column[0]);

        assertEquals("[some number, some mixed formula, some int only formula]",
                Arrays.toString(table.getColumnNames().toArray()));

        Query q = dc.query().from(table).select(columns).toQuery();
        DataSet ds = dc.executeQuery(q);
        Object value;

        assertTrue(ds.next());
        assertEquals("1", ds.getRow().getValue(columns[0]));
        value = ds.getRow().getValue(columns[1]);
        assertEquals(String.class, value.getClass());
        assertEquals("1", value);

        value = ds.getRow().getValue(columns[2]);
        assertEquals(String.class, value.getClass());
        assertEquals("1", value);

        assertTrue(ds.next());
        assertEquals("2", ds.getRow().getValue(columns[0]));
        value = ds.getRow().getValue(columns[1]);
        assertEquals(String.class, value.getClass());
        assertEquals("3", value);

        value = ds.getRow().getValue(columns[2]);
        assertEquals(String.class, value.getClass());
        assertEquals("3", value);

        assertTrue(ds.next());
        assertEquals("3", ds.getRow().getValue(columns[0]));
        value = ds.getRow().getValue(columns[1]);
        assertEquals(String.class, value.getClass());
        assertEquals("8", value);

        value = ds.getRow().getValue(columns[2]);
        assertEquals(String.class, value.getClass());
        assertEquals("8", value);

        assertTrue(ds.next());
        assertEquals("4", ds.getRow().getValue(columns[0]));
        value = ds.getRow().getValue(columns[1]);
        assertEquals(String.class, value.getClass());
        assertEquals("12", value);

        value = ds.getRow().getValue(columns[2]);
        assertEquals(String.class, value.getClass());
        assertEquals("12", value);

        assertTrue(ds.next());
        assertEquals("5", ds.getRow().getValue(columns[0]));
        value = ds.getRow().getValue(columns[1]);
        assertEquals(String.class, value.getClass());
        assertEquals("yes", value);

        value = ds.getRow().getValue(columns[2]);
        assertEquals(String.class, value.getClass());
        assertEquals("5", value);

        assertTrue(ds.next());
        assertEquals("6", ds.getRow().getValue(columns[0]));
        value = ds.getRow().getValue(columns[1]);
        assertEquals(String.class, value.getClass());
        assertEquals("no", value);

        value = ds.getRow().getValue(columns[2]);
        assertEquals(String.class, value.getClass());
        assertEquals("6", value);

        assertFalse(ds.next());
    }

    @Test
    public void testSingleCellSheet() throws Exception {
        ExcelDataContext dc = new ExcelDataContext(copyOf("src/test/resources/xls_single_cell_sheet.xls"));

        Table table = dc.getDefaultSchema().getTableByName("Sheet1");

        assertNotNull(table);

        assertEquals("[A, hello]", Arrays.toString(table.getColumnNames().toArray()));

        Query q = dc.query().from(table).select(table.getColumns()).toQuery();
        DataSet ds = dc.executeQuery(q);
        assertFalse(ds.next());
    }

    @Test
    public void testOpenXlsxFormat() throws Exception {
        ExcelDataContext dc = new ExcelDataContext(copyOf("src/test/resources/Spreadsheet2007.xlsx"));
        Schema schema = dc.getDefaultSchema();
        assertEquals("Schema[name=testOpenXlsxFormat-Spreadsheet2007.xlsx]", schema.toString());

        assertEquals("[Sheet1, Sheet2, Sheet3]", Arrays.toString(schema.getTableNames().toArray()));

        assertEquals(0, schema.getTableByName("Sheet2").getColumnCount());
        assertEquals(0, schema.getTableByName("Sheet3").getColumnCount());

        Table table = schema.getTableByName("Sheet1");

        assertEquals("[string, number, date]", Arrays.toString(table.getColumnNames().toArray()));

        Query q = dc.query().from(table).select(table.getColumns()).orderBy(table.getColumnByName("number")).toQuery();
        DataSet ds = dc.executeQuery(q);
        List<Object[]> objectArrays = ds.toObjectArrays();
        assertEquals(4, objectArrays.size());
        assertEquals("[hello, 1, 2010-01-01 00:00:00]", Arrays.toString(objectArrays.get(0)));
        assertEquals("[world, 2, 2010-01-02 00:00:00]", Arrays.toString(objectArrays.get(1)));
        assertEquals("[foo, 3, 2010-01-03 00:00:00]", Arrays.toString(objectArrays.get(2)));
        assertEquals("[bar, 4, 2010-01-04 00:00:00]", Arrays.toString(objectArrays.get(3)));
    }

    @Test
    public void testConfigurationWithoutHeader() throws Exception {
        File file = copyOf("src/test/resources/xls_people.xls");
        DataContext dc = new ExcelDataContext(file, new ExcelConfiguration(ExcelConfiguration.NO_COLUMN_NAME_LINE,
                true, true));
        Table table = dc.getDefaultSchema().getTables().get(0);

        String[] columnNames = table.getColumnNames().toArray(new String[0]);
        assertEquals("[A, B, C, D]", Arrays.toString(columnNames));

        Query q = dc.query().from(table).select(table.getColumnByName("A")).toQuery();
        assertEquals("SELECT xls_people.A FROM testConfigurationWithoutHeader-xls_people.xls.xls_people", q.toSql());

        DataSet dataSet = dc.executeQuery(q);
        assertTrue(dataSet.next());
        assertEquals("id", dataSet.getRow().getValue(0));
        for (int i = 1; i <= 9; i++) {
            assertTrue(dataSet.next());
            assertEquals(i + "", dataSet.getRow().getValue(0));
        }

        assertFalse(dataSet.next());
    }

    @Test
    public void testConfigurationNonDefaultColumnNameLineNumber() throws Exception {
        File file = copyOf("src/test/resources/xls_people.xls");
        DataContext dc = new ExcelDataContext(file, new ExcelConfiguration(2, true, true));
        Table table = dc.getDefaultSchema().getTables().get(0);

        String[] columnNames = table.getColumnNames().toArray(new String[0]);
        assertEquals("[1, mike, male, 18]", Arrays.toString(columnNames));

        Query q = dc.query().from(table).select(table.getColumnByName("1")).toQuery();
        assertEquals("SELECT xls_people.1 FROM testConfigurationNonDefaultColumnNameLineNumber-xls_people.xls.xls_people", q.toSql());

        DataSet dataSet = dc.executeQuery(q);
        assertTrue(dataSet.next());
        assertEquals("2", dataSet.getRow().getValue(0));
        for (int i = 3; i <= 9; i++) {
            assertTrue(dataSet.next());
            assertEquals(i + "", dataSet.getRow().getValue(0));
        }
        assertFalse(dataSet.next());
    }

    @Test
    public void testGetSchemas() throws Exception {
        File file = copyOf("src/test/resources/xls_people.xls");
        DataContext dc = new ExcelDataContext(file);
        Schema[] schemas = dc.getSchemas().toArray(new Schema[0]);
        assertEquals(2, schemas.length);
        Schema schema = schemas[1];
        assertEquals("testGetSchemas-xls_people.xls", schema.getName());
        assertEquals(2, schema.getTableCount());
        Table table = schema.getTables().get(0);
        assertEquals("xls_people", table.getName());

        assertEquals(4, table.getColumnCount());
        assertEquals(0, table.getRelationshipCount());

        Column[] columns = table.getColumns().toArray(new Column[0]);
        assertEquals("id", columns[0].getName());
        assertEquals("name", columns[1].getName());
        assertEquals("gender", columns[2].getName());
        assertEquals("age", columns[3].getName());
    }

    @Test
    public void testMaterializeTable() throws Exception {
        File file = copyOf("src/test/resources/xls_people.xls");
        ExcelDataContext dc = new ExcelDataContext(file);
        Table table = dc.getDefaultSchema().getTables().get(0);
        DataSet dataSet = dc.materializeMainSchemaTable(table, table.getColumns(), -1);
        assertTrue(dataSet.next());
        assertEquals("Row[values=[1, mike, male, 18]]", dataSet.getRow().toString());
        assertTrue(dataSet.next());
        assertEquals("Row[values=[2, michael, male, 19]]", dataSet.getRow().toString());
        assertTrue(dataSet.next());
        assertEquals("Row[values=[3, peter, male, 18]]", dataSet.getRow().toString());
        assertTrue(dataSet.next());
        assertTrue(dataSet.next());
        assertTrue(dataSet.next());
        assertTrue(dataSet.next());
        assertTrue(dataSet.next());
        assertTrue(dataSet.next());
        assertEquals("Row[values=[9, carrie, female, 17]]", dataSet.getRow().toString());
        assertFalse(dataSet.next());
        assertNull(dataSet.getRow());
    }

    @Test
    public void testMissingValues() throws Exception {
        File file = copyOf("src/test/resources/xls_missing_values.xls");
        DataContext dc = new ExcelDataContext(file);
        Schema schema = dc.getDefaultSchema();
        assertEquals(2, schema.getTableCount());

        Table table = schema.getTables().get(0);
        assertEquals("[Column[name=a,columnNumber=0,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                + "Column[name=b,columnNumber=1,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                + "Column[name=c,columnNumber=2,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                + "Column[name=d,columnNumber=3,type=VARCHAR,nullable=true,nativeType=null,columnSize=null]]",
                Arrays.toString(table.getColumns().toArray()));

        Query q = new Query().select(table.getColumns()).from(table);
        DataSet ds = dc.executeQuery(q);
        assertTrue(ds.next());
        assertEquals("[1, 2, 3, null]", Arrays.toString(ds.getRow().getValues()));
        assertTrue(ds.next());
        assertEquals("[5, null, 7, 8]", Arrays.toString(ds.getRow().getValues()));
        assertTrue(ds.next());
        assertEquals("[9, 10, 11, 12]", Arrays.toString(ds.getRow().getValues()));
        assertFalse(ds.next());
    }

    @Test
    public void testMissingColumnHeader() throws Exception {
        File file = copyOf("src/test/resources/xls_missing_column_header.xls");
        DataContext dc = new ExcelDataContext(file);
        Schema schema = dc.getDefaultSchema();
        assertEquals(2, schema.getTableCount());

        Table table = schema.getTables().get(0);
        assertEquals("[Column[name=a,columnNumber=0,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                + "Column[name=b,columnNumber=1,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                + "Column[name=A,columnNumber=2,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                + "Column[name=d,columnNumber=3,type=VARCHAR,nullable=true,nativeType=null,columnSize=null]]",
                Arrays.toString(table.getColumns().toArray()));

        Query q = new Query().select(table.getColumns()).from(table);
        DataSet ds = dc.executeQuery(q);
        assertTrue(ds.next());
        assertEquals("[1, 2, 3, 4]", Arrays.toString(ds.getRow().getValues()));
        assertTrue(ds.next());
        assertEquals("[5, 6, 7, 8]", Arrays.toString(ds.getRow().getValues()));
        assertTrue(ds.next());
        assertEquals("[9, 10, 11, 12]", Arrays.toString(ds.getRow().getValues()));
        assertFalse(ds.next());
    }

    @Test
    public void testXlsxFormulas() throws Exception {
        File file = copyOf("src/test/resources/formulas.xlsx");
        ExcelDataContext dc = new ExcelDataContext(file);

        assertEquals("[sh1, default_table]", Arrays.toString(dc.getDefaultSchema().getTableNames().toArray()));
        assertEquals(XlsxSpreadsheetReaderDelegate.class, dc.getSpreadsheetReaderDelegateClass());

        Table table = dc.getDefaultSchema().getTableByName("sh1");
        assertEquals("[Foo, Bar]", Arrays.toString(table.getColumnNames().toArray()));

        Query q = dc.query().from(table).select("Foo").toQuery();
        DataSet ds = dc.executeQuery(q);

        assertTrue(ds.next());
        assertEquals("1", ds.getRow().getValue(0).toString());
        assertEquals("", ds.getRow().getStyle(0).toString());
        assertTrue(ds.next());
        assertEquals("2", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("3", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("4", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("5", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("6", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("7", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("8", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("9", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("10", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("11", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("12", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("13", ds.getRow().getValue(0).toString());
        assertFalse(ds.next());

        q = dc.query().from(table).select("Bar").toQuery();
        ds = dc.executeQuery(q);

        assertTrue(ds.next());
        assertEquals("lorem", ds.getRow().getValue(0).toString());
        assertEquals("", ds.getRow().getStyle(0).toString());
        assertTrue(ds.next());
        assertEquals("ipsum", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("21", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("foo", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("bar", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("baz", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals(null, ds.getRow().getValue(0));
        assertNotNull(null, ds.getRow().getStyle(0));
        assertTrue(ds.next());
        assertEquals("!\"#¤%&/()<>=?", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("here are", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("some invalid", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("formulas:", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("#DIV/0!", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("0", ds.getRow().getValue(0).toString());
        assertFalse(ds.next());
    }

    @Test
    public void testTicket99defect() throws Exception {
        File file = copyOf("src/test/resources/ticket_199_inventory.xls");
        DataContext dc = new ExcelDataContext(file);
        Schema schema = dc.getDefaultSchema();
        assertEquals(
                "[Table[name=Sheet1,type=TABLE,remarks=null], Table[name=Sheet2,type=TABLE,remarks=null], Table[name=Sheet3,type=TABLE,remarks=null]]",
                Arrays.toString(schema.getTables().toArray()));

        assertEquals(0, schema.getTableByName("Sheet2").getColumnCount());
        assertEquals(0, schema.getTableByName("Sheet3").getColumnCount());

        Table table = schema.getTableByName("Sheet1");
        assertEquals(

                "[Column[name=Pkg No.,columnNumber=0,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                        + "Column[name=Description,columnNumber=1,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                        + "Column[name=Room,columnNumber=2,type=VARCHAR,nullable=true,nativeType=null,columnSize=null], "
                        + "Column[name=Level,columnNumber=3,type=VARCHAR,nullable=true,nativeType=null,columnSize=null]]",
                Arrays.toString(table.getColumns().toArray()));
    }

    @Test
    public void testInsertInto() throws Exception {
        final File file = copyOf("src/test/resources/xls_people.xls");

        final ExcelDataContext dc = new ExcelDataContext(file);
        final Table table = dc.getDefaultSchema().getTables().get(0);
        final Column nameColumn = table.getColumnByName("name");

        dc.executeUpdate(new UpdateScript() {
            @Override
            public void run(UpdateCallback cb) {
                Style clownStyle = new StyleBuilder().bold().foreground(255, 0, 0).background(0, 0, 255).create();

                Style thirtyStyle = new StyleBuilder().italic().underline().centerAligned().foreground(10, 10, 200)
                        .create();

                cb.insertInto(table).value("id", 1000).value(nameColumn, "pennywise the [clown]", clownStyle)
                        .value("gender", "male").value("age", 30, thirtyStyle).execute();
            }
        });

        DataSet ds = dc.query().from(table).select(nameColumn).orderBy(nameColumn).execute();
        assertTrue(ds.next());
        assertEquals("barbara", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("bob", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("carrie", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("charlotte", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("hillary", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("michael", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("mike", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("pennywise the [clown]", ds.getRow().getValue(0).toString());
        assertEquals("font-weight: bold;color: rgb(255,0,0);background-color: rgb(0,0,255);", ds.getRow().getStyle(0)
                .toString());
        assertTrue(ds.next());
        assertEquals("peter", ds.getRow().getValue(0).toString());
        assertTrue(ds.next());
        assertEquals("vera", ds.getRow().getValue(0).toString());
        assertFalse(ds.next());
        ds.close();

        ds = dc.query().from(table).select("age").where("age").eq(30).execute();
        assertTrue(ds.next());
        assertEquals("30", ds.getRow().getValue(0));
        assertEquals("font-style: italic;text-decoration: underline;text-align: center;color: rgb(0,0,255);", ds
                .getRow().getStyle(0).toCSS());
        assertFalse(ds.next());
    }

    @Test
    public void testCreateTableXls() throws Exception {
        // run the same test with both XLS and XLSX (because of different
        // workbook implementations)
        runCreateTableTest(new File("target/xls_people_created.xls"));
    }

    @Test
    public void testCreateTableXlsx() throws Exception {
        // run the same test with both XLS and XLSX (because of different
        // workbook implementations)
        runCreateTableTest(new File("target/xls_people_created.xlsx"));
    }

    private void runCreateTableTest(File file) {
        if (file.exists()) {
            assertTrue(file.delete());
        }
        final ExcelDataContext dc = new ExcelDataContext(file);
        dc.executeUpdate(new UpdateScript() {
            @Override
            public void run(UpdateCallback cb) {
                Schema schema = dc.getDefaultSchema();
                Table table1 = cb.createTable(schema, "my_table_1").withColumn("foo").withColumn("bar")
                        .withColumn("baz").execute();

                assertEquals(2, schema.getTableCount());
                assertSame(table1.getSchema(), schema);
                assertSame(table1, schema.getTables().get(0));

                Table table2 = cb.createTable(schema, "my_table_2").withColumn("foo").withColumn("bar")
                        .withColumn("baz").execute();

                assertSame(table2.getSchema(), schema);
                assertSame(table2, schema.getTables().get(1));
                assertEquals(2, schema.getTableCount());

                cb.insertInto(table1).value("foo", 123.0).value("bar", "str 1").value("baz", true).execute();
            }
        });

        dc.refreshSchemas();

        Schema schema = dc.getDefaultSchema();
        assertEquals(2, schema.getTableCount());
        assertEquals("[my_table_1, my_table_2]", Arrays.toString(schema.getTableNames().toArray()));

        dc.executeUpdate(new UpdateScript() {
            @Override
            public void run(UpdateCallback cb) {
                cb.insertInto(dc.getTableByQualifiedLabel("my_table_1")).value("foo", 456.2)
                        .value("bar", "парфюмерия +и косметика").value("baz", false).execute();
            }
        });

        dc.executeUpdate(new UpdateScript() {
            @Override
            public void run(UpdateCallback cb) {
                cb.insertInto("my_table_1").value("foo", 789).value("bar", DateUtils.get(2011, Month.JULY, 8))
                        .value("baz", false).execute();
            }
        });

        DataSet ds = dc.query().from("my_table_1").select("foo").and("bar").and("baz").execute();
        assertTrue(ds.next());
        assertEquals("Row[values=[123, str 1, true]]", ds.getRow().toString());
        assertTrue(ds.next());
        assertEquals("Row[values=[456.2, парфюмерия +и косметика, false]]", ds.getRow().toString());
        assertTrue(ds.next());
        assertEquals("Row[values=[789, 2011-07-08 00:00:00, false]]", ds.getRow().toString());
        assertFalse(ds.next());
        ds.close();

        dc.executeUpdate(new UpdateScript() {
            @Override
            public void run(UpdateCallback callback) {
                callback.deleteFrom("my_table_1").where("foo").greaterThan("124").execute();
            }
        });

        assertEquals("1",
                MetaModelHelper.executeSingleRowQuery(dc, dc.query().from("my_table_1").selectCount().toQuery())
                        .getValue(0).toString());

        ds = dc.query().from("my_table_1").select("foo").and("bar").and("baz").execute();
        assertTrue(ds.next());
        assertEquals("Row[values=[123, str 1, true]]", ds.getRow().toString());
        assertFalse(ds.next());
        ds.close();

        dc.executeUpdate(new UpdateScript() {
            @Override
            public void run(UpdateCallback callback) {
                callback.dropTable("my_table_1").execute();
            }
        });

        assertEquals("[my_table_2]", schema.getTableNames().toString());

        dc.refreshSchemas();

        assertEquals("[my_table_2, default_table]", dc.getDefaultSchema().getTableNames().toString());
        assertEquals(2, dc.getDefaultSchema().getTableCount());
    }

    @Test
    public void testGetStyles() throws Exception {
        DataContext dc = new ExcelDataContext(copyOf("src/test/resources/styles.xlsx"));
        Table table = dc.getDefaultSchema().getTables().get(0);
        assertEquals("[style name, example]", Arrays.toString(table.getColumnNames().toArray()));

        DataSet ds = dc.query().from(table).select(table.getColumns()).execute();
        assertTrue(ds.next());
        assertEquals("Row[values=[bold, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("font-weight: bold;", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[italic, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("font-style: italic;", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[underline, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("text-decoration: underline;", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[custom text col, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("color: rgb(138,67,143);", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[yellow text col, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("color: rgb(255,255,0);", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[custom bg, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("background-color: rgb(136,228,171);", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[yellow bg, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("background-color: rgb(255,255,0);", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[center align, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("text-align: center;", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[font size 8, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("font-size: 8pt;", ds.getRow().getStyle(1).toCSS());

        assertTrue(ds.next());
        assertEquals("Row[values=[font size 16, foo]]", ds.getRow().toString());
        assertEquals("", ds.getRow().getStyle(0).toCSS());
        assertEquals("font-size: 16pt;", ds.getRow().getStyle(1).toCSS());

        assertFalse(ds.next());
    }

    /**
     * Tests that you can execute a query on a ExcelDataContext even though the
     * schema has not yet been (explicitly) loaded.
     */
    @Test
    public void testExecuteQueryBeforeLoadingSchema() throws Exception {
        // first use one DataContext to retreive the schema/table/column objects
        ExcelDataContext dc1 = new ExcelDataContext(copyOf("src/test/resources/Spreadsheet2007.xlsx"));
        Schema schema = dc1.getDefaultSchema();
        Table table = schema.getTable(0);
        Column column = table.getColumn(0);

        // query another DataContext using the schemas of the one above
        ExcelDataContext dc2 = new ExcelDataContext(copyOf("src/test/resources/Spreadsheet2007.xlsx"));
        DataSet ds = dc2.executeQuery(new Query().from(table).select(column));

        // previously we would crash at this point!

        assertNotNull(ds);
        ds.close();
    }

    @Test
    public void testCustomColumnNames() throws Exception {
        final String firstColumnName = "first";
        final String secondColumnName = "second";
        final String thirdColumnName = "third";

        final ExcelConfiguration configuration = new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE,
                new CustomColumnNamingStrategy(firstColumnName, secondColumnName, thirdColumnName), true, false);
        final DataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/Spreadsheet2007.xlsx"),
                configuration);
        final Table table = dataContext.getDefaultSchema().getTable(0);

        assertNotNull(table.getColumnByName(firstColumnName));
        assertNotNull(table.getColumnByName(secondColumnName));
        assertNotNull(table.getColumnByName(thirdColumnName));
    }

    @Test
    public void testDetectingDifferentDataTypesInXls() throws Exception {
        detectingDataTypes("src/test/resources/different_datatypes.xls");
    }

    @Test
    public void testDifferentDataTypesInXlsx() throws Exception {
        detectingDataTypes("src/test/resources/different_datatypes.xlsx");
    }

    private void detectingDataTypes(final String file) {
        final DataContext dataContext = new ExcelDataContext(copyOf(file), new ExcelConfiguration(
                ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, false, true, 19));

        final Schema schema = dataContext.getDefaultSchema();
        assertEquals(2, schema.getTableCount());

        final Table table = schema.getTables().get(0);
        assertEquals("INTEGER", table.getColumns().get(0).getName());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(0).getType());
        assertEquals("TEXT", table.getColumns().get(1).getName());
        assertEquals(ColumnType.STRING, table.getColumns().get(1).getType());
        assertEquals("FORMULA", table.getColumns().get(2).getName());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(2).getType());
        assertEquals("MIXING_DOUBLE_AND_INT", table.getColumns().get(3).getName());
        assertEquals(ColumnType.DOUBLE, table.getColumns().get(3).getType());
        assertEquals("MIXING_OTHER_DATATYPES", table.getColumns().get(4).getName());
        assertEquals(ColumnType.STRING, table.getColumns().get(4).getType());
        final DataSet countDataSet = dataContext.query().from(table).selectCount().execute();
        assertTrue(countDataSet.next());
        assertEquals(20L, countDataSet.getRow().getValue(0));
        assertFalse(countDataSet.next());
    }

    @Test
    public void testCellValueWithWrongDatatypeIsSetToNull() {
        // Unless Integers and Doubles are mixed all other incorrect values will be converted to null with a warning
        final DataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/different_datatypes.xls"),
                new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, false, true, 19));
        final Table table = dataContext.getDefaultSchema().getTables().get(0);
        final DataSet testWrongDatatypeDataSet = dataContext
                .query()
                .from(table)
                .select("MIXING_DOUBLE_AND_INT")
                .execute();
        IntStream.range(0, 19).forEach(i -> {
            assertTrue(testWrongDatatypeDataSet.next());
            assertNotNull(testWrongDatatypeDataSet.getRow().getValue(0));
        });
        assertTrue(testWrongDatatypeDataSet.next());
        assertNull(testWrongDatatypeDataSet.getRow().getValue(0));
        assertFalse(testWrongDatatypeDataSet.next());
    }

    @Test
    public void testDetectingDataTypeNotSkippingLinesAndColumnsUsingNameLine() {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/skipped_lines.xlsx"),
                new ExcelConfiguration(6, null, false, false, true, 3));
        final Table table = dataContext.getDefaultSchema().getTables().get(0);
        assertEquals(ColumnType.STRING, table.getColumns().get(0).getType());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(6).getType());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(7).getType());
    }

    @Test
    public void testDetectingDataTypeNotSkippingLinesAndColumnsNoNameLine() {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/skipped_lines.xlsx"),
                new ExcelConfiguration(ExcelConfiguration.NO_COLUMN_NAME_LINE, null, false, false, true, 3));
        final Table table = dataContext.getDefaultSchema().getTables().get(0);
        assertEquals(ColumnType.STRING, table.getColumns().get(0).getType());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(6).getType());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(7).getType());
    }

    @Test
    public void testDetectingDataTypeSkippingLinesAndColumnsUsingNameLine() {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/skipped_lines.xlsx"),
                new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, true, true, 3));
        final Table table = dataContext.getDefaultSchema().getTables().get(0);
        assertEquals(ColumnType.INTEGER, table.getColumns().get(0).getType());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(1).getType());
    }

    @Test
    public void testDetectingDataTypeSkippingLinesAndColumnsNoNameLine() {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/skipped_lines.xlsx"),
                new ExcelConfiguration(ExcelConfiguration.NO_COLUMN_NAME_LINE, null, true, true, true, 3));
        final Table table = dataContext.getDefaultSchema().getTables().get(0);
        assertEquals(ColumnType.INTEGER, table.getColumns().get(0).getType());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(1).getType());
    }

    @Test
    public void testToMuchNumberOfLinesToScan() throws Exception {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/skipped_lines.xlsx"),
                new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, true, true, 4));

        final Table table = dataContext.getDefaultSchema().getTables().get(0);
        assertEquals("hello", table.getColumns().get(0).getName());
        assertEquals("world", table.getColumns().get(1).getName());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(0).getType());
        assertEquals(ColumnType.INTEGER, table.getColumns().get(1).getType());
        final DataSet dataSet = dataContext.query().from(table).selectCount().execute();
        assertTrue(dataSet.next());
        assertEquals(3L, dataSet.getRow().getValue(0));
    }

    @Test
    public void testToMissingValueDoesntEffectDetectedType() throws Exception {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/xls_missing_values.xls"),
                new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, false, true, 3));

        final Table table = dataContext.getDefaultSchema().getTables().get(0);
        final Column columnB = table.getColumns().get(1);
        assertEquals("b", columnB.getName());
        assertEquals(ColumnType.INTEGER, columnB.getType());
        final DataSet dataSetColumnB = dataContext.query().from(table).select(columnB).execute();
        assertTrue(dataSetColumnB.next());
        assertTrue(dataSetColumnB.next());
        assertNull(dataSetColumnB.getRow().getValue(0));

        final Column columnD = table.getColumns().get(3);
        assertEquals("d", columnD.getName());
        assertEquals(ColumnType.INTEGER, columnD.getType());
        final DataSet dataSetColumnD = dataContext.query().from(table).select(columnD).where(columnD).eq(12).execute();
        assertTrue(dataSetColumnD.next());
        assertEquals(12, dataSetColumnD.getRow().getValue(0));
    }

    @Test
    public void testInsertingValueOfValidColumnType() {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/different_datatypes.xls"),
                new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, false, true, 19));
        final Table table = dataContext.getDefaultSchema().getTable(0);
        dataContext.executeUpdate(new InsertInto(table).value("INTEGER", Integer.valueOf(123)));
        final DataSet dataSet = dataContext.query().from(table).selectAll().where("INTEGER").eq(123).execute();
        assertTrue(dataSet.next());
    }

    @Test
    public void testInsertingValueOfInvalidColumnType() {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/different_datatypes.xls"),
                new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, false, true, 19));
        final Table table = dataContext.getDefaultSchema().getTable(0);
        dataContext.executeUpdate(new InsertInto(table).value("INTEGER", "this is not an integer"));
    }

    @Test
    public void testUpdatingValueOfValidColumnType() {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/different_datatypes.xls"),
                new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, false, true, 19));
        final Table table = dataContext.getDefaultSchema().getTable(0);
        dataContext.executeUpdate(new Update(table).value("INTEGER", 1).value("INTEGER", Integer.valueOf(123)));
        final DataSet dataSet = dataContext.query().from(table).selectAll().where("INTEGER").eq(123).execute();
        assertTrue(dataSet.next());
    }

    @Test
    public void testUpdatingValueOfInvalidColumnType() {
        final ExcelDataContext dataContext = new ExcelDataContext(copyOf("src/test/resources/different_datatypes.xls"),
                new ExcelConfiguration(ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE, null, true, false, true, 19));
        final Table table = dataContext.getDefaultSchema().getTable(0);
        dataContext.executeUpdate(new Update(table).value("INTEGER", 1).value("INTEGER", "this is not an integer"));
    }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $model common\models\ExerciseSubject */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => 'Exercise Subjects', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

        <?php
        echo Html::beginTag('button',['value'=> Url::to(['exercise-subject/index']),
        'class' => 'btn btn-primary modalButton']);
        echo Html::tag('span','',['class' => 'glyphicon glyphicon-menu-left']);
        echo Html::endTag('button'); ?>
        <?= Html::button('Изменить',['value'=> Url::to(['exercise-subject/update','id' => $model->id]),
        'class' => 'btn btn-primary modalButton']); ?>
        <?= Html::button('Удалить', ['value' => Url::to(['exercise-subject/delete','id' => $model->id]),
            'class' => 'btn btn-danger modalButton',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                //'method' => 'post',
            ],
        ]) ?>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            //'id',
            'name',
            //'teacher_id',
        ],
    ]) ?>

redpajama_set_name: RedPajamaGithub


text:
layout: tag_posts
title: Posts with tag "sql"
tag: sql
---


text:
"""
A unified data anlaysis and visualization platform for computational and
theoretical chemists, physicists, etc. Support for molecular geometry and
orbital visualization is provided via the `Jupyter`_ notebook, a web-browser
based interactive (multi-programming language) environment.

.. extended description (todo)

Warning:
    This package uses the `atomic`_ unit system (Hartree) by default.

.. _atomic: https://en.wikipedia.org/wiki/Atomic_units

Supported Software
---------------------
The list below contains third-party software that is supported by this package.
For specific features supported (per software), see the appropriate description
below.

- :mod:`~exatomic.adf.__init__`: `Amsterdam Density Functional`_
- :mod:`~exatomic.gaussian.__init__`: `Gaussian`_
- :mod:`~exatomic.molcas.__init__`: `OpenMolcas`_
- :mod:`~exatomic.nbo.__init__`: `NBO`_
- :mod:`~exatomic.nwchem.__init__`: `NWChem`_
- :mod:`~exatomic.qe.__init__`: `Quantum ESPRESSO`_
- :mod:`~exatomic.interfaces.__init__`: Additional 3rd party support

.. _Jupyter: https://jupyter.org
.. _Amsterdam Density Functional: https://www.scm.com
.. _Gaussian: http://gaussian.com/
.. _OpenMolcas: https://gitlab.com/Molcas/OpenMolcas
.. _NBO: http://nbo6.chem.wisc.edu/
.. _NWChem: http://www.nwchem-sw.org/index.php/Main_Page
.. _Quantum ESPRESSO: http://www.quantum-espresso.org/
"""
from __future__ import absolute_import
__js_version__ = "^0.5.0"

def _jupyter_nbextension_paths():
    """Jupyter notebook extension directory paths."""
    return [{
        'section': "notebook",
        'src': "static/js",
        'dest': "exatomic",
        'require': "exatomic/extension"
    }]

import os
import tempfile
import logging.config
import yaml

with open(os.path.join(os.path.dirname(__file__),
          'conf', 'logging.yml'), 'r') as f:
    _log = yaml.safe_load(f.read())
_log['handlers']['file']['filename'] = os.path.join(tempfile.gettempdir(),
                                                    'exa.log')
logging.config.dictConfig(_log)

def func_log(func):
    name = '.'.join([func.__module__,
                     func.__name__])
    return logging.getLogger(name)

from ._version import __version__
from . import core
from .core import Universe, Editor, Atom, AtomicField, Frame, Tensor, add_tensor
from .interfaces import XYZ, Cube
from .widgets import DemoContainer, DemoUniverse, UniverseWidget, TensorContainer


text:
package com.whitebearsolutions.imagine.wbsairback.rs.model.advanced;

import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.transform.stream.StreamSource;

@XmlRootElement(name = "advancedStorage")
public class AdvancedStorageRs {

	private String name;
	private String typeConnection;
	private String typeStorage;

	private List<VariableRs> variables;
	private List<StepStorageRs> steps;

	public AdvancedStorageRs() {}

	/**
	 * Obtiene el xml que representa a este objeto
	 * @return
	 */
	public String getXML() {
		String xml = "";
		try {
			JAXBContext jc = JAXBContext.newInstance( AdvancedStorageRs.class );
			Marshaller m = jc.createMarshaller();
			StringWriter stringWriter = new StringWriter();
			m.marshal(this, stringWriter);
			xml = stringWriter.toString();
		} catch (JAXBException ex) {}
		return xml;
	}

	/**
	 * Convierte una lista de mapas de storages a objetos storage
	 * @param mapPools
	 * @return
	 */
	public static List<AdvancedStorageRs> listMapToObject(Map<String, Map<String, Object>> mapAdvancedStorages) throws Exception {
		List<AdvancedStorageRs> storages = new ArrayList<AdvancedStorageRs>();
		if (mapAdvancedStorages != null && mapAdvancedStorages.size()>0) {
			for (String nameScript : mapAdvancedStorages.keySet()) {
				AdvancedStorageRs storage = mapToObject(mapAdvancedStorages.get(nameScript));
				storages.add(storage);
			}
		}
		return storages;
	}

	public static List<AdvancedStorageRs> listMapToObject(List<Map<String, Object>> mapAdvancedStorages) throws Exception {
		List<AdvancedStorageRs> storages = new ArrayList<AdvancedStorageRs>();
		if (mapAdvancedStorages != null && mapAdvancedStorages.size()>0) {
			for (Map<String, Object> map : mapAdvancedStorages) {
				AdvancedStorageRs storage = mapToObject(map);
				storages.add(storage);
			}
		}
		return storages;
	}

	public static AdvancedStorageRs fromXML(String xml) {
		try {
			if (xml != null && xml.length()>0) {
				String nameEntity = "advancedStorage";
				JAXBContext jc = JAXBContext.newInstance( AdvancedStorageRs.class );
				Unmarshaller um = jc.createUnmarshaller();
				if (xml.indexOf("<"+nameEntity+">") > -1 && xml.indexOf("</"+nameEntity+">") > -1) {
					AdvancedStorageRs o = (AdvancedStorageRs) um.unmarshal( new StreamSource( new StringReader( xml.substring(xml.indexOf("<"+nameEntity+">"), xml.indexOf("</"+nameEntity+">")+("</"+nameEntity+">").length()).toString() ) ) );
					return o;
				}
			}
			return null;
		} catch (JAXBException ex) {
			return null;
		}
	}

	public static List<AdvancedStorageRs> xmlToList(String xml, String idList) {
		try {
			String nameEntity = "advancedStorage";
			List<AdvancedStorageRs> listObjects = new ArrayList<AdvancedStorageRs>();

			if (xml != null && xml.length()>0) {
				int iInitList = xml.indexOf("<"+idList+">");
				int iEndList = xml.indexOf("</"+idList+">");
				if ( iInitList > 0 && iEndList > -1) {
					String list = xml.substring(iInitList+("<"+idList+">").length(), iEndList);
					while (list.indexOf("<"+nameEntity+">")>-1) {
						String deviceXml = list.substring(list.indexOf("<"+nameEntity+">"), list.indexOf("</"+nameEntity+">")+("</"+nameEntity+">").length());
						listObjects.add(fromXML(deviceXml));
						if (list.length() > list.indexOf("</"+nameEntity+">")+("</"+nameEntity+">").length()) {
							list = list.substring(list.indexOf("</"+nameEntity+">")+("</"+nameEntity+">").length());
						} else {
							break;
						}
					}
				}
			}
			return listObjects;
		} catch (Exception ex) {
			return null;
		}
	}

	/**
	 * Convierte un mapa de valores de un pool a un objeto Pool
	 * @param mapPool
	 * @return
	 */
	public static AdvancedStorageRs mapToObject(Map<String, Object> map) throws Exception {
		AdvancedStorageRs storage = new AdvancedStorageRs();

		Object p = map.get("name");
		if (p != null && !((String)p).isEmpty())
			storage.setName((String) p);
		p = map.get("typeConnection");
		if (p != null && !((String)p).isEmpty())
			storage.setTypeConnection((String) p);
		p = map.get("typeStorage");
		if (p != null && !((String)p).isEmpty())
			storage.setTypeStorage((String) p);
		p = map.get("steps");
		if (p != null) {
			@SuppressWarnings("unchecked")
			Map<String, Object> steps = (Map<String, Object>) map.get("steps");
			if (!steps.isEmpty())
				storage.setSteps(StepStorageRs.listMapToObject(steps));
		}
		p = map.get("variables");
		if (p != null) {
			@SuppressWarnings("unchecked")
			Map<String, Map<String, String>> variables = (Map<String, Map<String, String>>) map.get("variables");
			if (!variables.isEmpty())
				storage.setVariables(VariableRs.listMapToObject(variables));
		}

		return storage;
	}

	// ####### GETTERS Y SETTERS #################################

	@XmlElement(required=true)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@XmlElementWrapper(name="variables")
	@XmlElementRef()
	public List<VariableRs> getVariables() {
		return variables;
	}

	public void setVariables(List<VariableRs> variables) {
		this.variables = variables;
	}

	public String getTypeConnection() {
		return typeConnection;
	}

	public void setTypeConnection(String typeConnection) {
		this.typeConnection = typeConnection;
	}

	public String getTypeStorage() {
		return typeStorage;
	}

	public void setTypeStorage(String typeStorage) {
		this.typeStorage = typeStorage;
	}

	@XmlElementWrapper(name="steps", required=true)
	@XmlElementRef()
	public List<StepStorageRs> getSteps() {
		return steps;
	}

	public void setSteps(List<StepStorageRs> steps) {
		this.steps = steps;
	}

}


text:
angular.module('advanced-search-list')
.component('aslSelect', {
  templateUrl: 'select/select.html',
  bindings: {
    option: '=',
    update: '&',
    delete: '&'
  }
});


text:
package info.dgjones.abora.gold.nlinks;

import info.dgjones.abora.gold.collection.basic.PtrArray;
import info.dgjones.abora.gold.java.AboraSupport;
import info.dgjones.abora.gold.java.exception.PasseException;
import info.dgjones.abora.gold.java.missing.smalltalk.Set;
import info.dgjones.abora.gold.nkernel.FeEdition;
import info.dgjones.abora.gold.nkernel.FeLabel;
import info.dgjones.abora.gold.nkernel.FeRangeElement;
import info.dgjones.abora.gold.nlinks.FePath;
import info.dgjones.abora.gold.spaces.integers.IntegerPos;
import info.dgjones.abora.gold.spaces.integers.IntegerRegion;
import info.dgjones.abora.gold.wrapper.FeWrapper;
import info.dgjones.abora.gold.wrapper.FeWrapperSpec;
import info.dgjones.abora.gold.xcvr.Rcvr;

/**
 * A sequence of Labels, used for context information in a LinkEnd.
 */
public class FePath extends FeWrapper {

	protected static FeWrapperSpec ThePathSpec;
/*
udanax-top.st:25046:
FeWrapper subclass: #FePath
	instanceVariableNames: ''
	classVariableNames: 'ThePathSpec {FeWrapperSpec} '
	poolDictionaries: ''
	category: 'Xanadu-nlinks'!
*/
/*
udanax-top.st:25050:
FePath comment:
'A sequence of Labels, used for context information in a LinkEnd.'!
*/
/*
udanax-top.st:25052:
(FePath getOrMakeCxxClassDescription)
	attributes: ((Set new) add: #ON.CLIENT; add: #CONCRETE; yourself)!
*/
/*
udanax-top.st:25123:
FePath class
	instanceVariableNames: ''!
*/
/*
udanax-top.st:25126:
(FePath getOrMakeCxxClassDescription)
	attributes: ((Set new) add: #ON.CLIENT; add: #CONCRETE; yourself)!
*/
public static void initializeClassAttributes() {
	AboraSupport.findAboraClass(FePath.class).setAttributes( new Set().add("ONCLIENT").add("CONCRETE"));
/*

Generated during transformation: AddMethod
*/
}
/**
 * The first label in the sequence
 * @deprecated
 */
public FeLabel first() {
	throw new PasseException();
/*
udanax-top.st:25057:FePath methodsFor: 'smalltalk: passe'!
{FeLabel} first
	"The first label in the sequence"
	self passe.
	^(self edition get: IntegerZero) cast: FeLabel!
*/
}
/**
 * Replace what is in the container at my path after index with contained.
 * @deprecated
 */
public FeEdition replace(FeEdition container, FeRangeElement contained, int index, int count) {
	throw new PasseException();
/*
udanax-top.st:25062:FePath methodsFor: 'smalltalk: passe'!
{FeEdition} replace: container {FeEdition}
	with: contained {FeRangeElement}
	with: index {IntegerVar}
	with: count {IntegerVar}
	"Replace what is in the container at my path after index with contained."

	| labels {XnRegion} |
	index = count ifTrue: [^contained cast: FeEdition].
	labels := container positionsLabelled: ((self edition get: index integer) cast: FeLabel).
	^container with: labels theOne
		with: (self replace: ((container get: labels theOne) cast: FeEdition)
			with: contained
			with: index + 1
			with: count)!
*/
}
/**
 * Replace whatever is at this path in the container with the newValue. Fail if at any point
 * there is not precisely one choice.
 * @deprecated
 */
public FeEdition replaceIn(FeEdition container, FeRangeElement value) {
	throw new PasseException();
/*
udanax-top.st:25077:FePath methodsFor: 'smalltalk: passe'!
{FeEdition} replaceIn: container {FeEdition} with: value {FeRangeElement}
	"Replace whatever is at this path in the container with the newValue. Fail if at any point there is not precisely one choice."

	self passe.
	^self replace: container with: value with: IntegerVarZero with: self edition count!
*/
}
/**
 * The remaining path after the first label in the sequence
 * @deprecated
 */
public FePath rest() {
	throw new PasseException();
/*
udanax-top.st:25083:FePath methodsFor: 'smalltalk: passe'!
{FePath} rest
	"The remaining path after the first label in the sequence"
	self passe.
	^(FePath construct: (self edition
		transformedBy: ((IntegerMapping make: -1)
			restrict: (IntegerRegion after: 1)))) cast: FePath!
*/
}
/**
 * Append it to the beginning of the path
 * @deprecated
 */
public FePath withFirst(FeLabel label) {
	throw new PasseException();
/*
udanax-top.st:25090:FePath methodsFor: 'smalltalk: passe'!
{FePath} withFirst: label {FeLabel}
	"Append it to the beginning of the path"
	self passe.
	^(FePath construct: ((self edition
			transformedBy: ((IntegerMapping make: 1)
				restrict: (IntegerRegion after: 1)))
		with: IntegerZero with: label)) cast: FePath!
*/
}
/**
 * Append it to the end of the path
 * @deprecated
 */
public FePath withLast(FeLabel label) {
	throw new PasseException();
/*
udanax-top.st:25098:FePath methodsFor: 'smalltalk: passe'!
{FePath} withLast: label {FeLabel}
	"Append it to the end of the path"
	self passe.
	^(FePath construct: (self edition
		with: self edition count with: label)) cast: FePath!
*/
}
/**
 * Follow a path down into an Edition and return what is at the end of the path. Fail if at
 * any point there is not precisely one choice.
 */
public FeRangeElement follow(FeEdition edition) {
	FeRangeElement result;
	FeLabel label;
	result = edition;
	for (int index = 0; index < edition().count(); index ++ ) {
		label = (FeLabel) (edition().get(IntegerPos.make(index)));
		result = ((FeEdition) result).get((((FeEdition) result).positionsLabelled(label)).theOne());
	}
	return result;
/*
udanax-top.st:25106:FePath methodsFor: 'operations'!
{FeRangeElement CLIENT} follow: edition {FeEdition}
	"Follow a path down into an Edition and return what is at the end of the path. Fail if at any point there is not precisely one choice."

	| result {FeRangeElement} label {FeLabel} |
	result := edition.
	IntegerVarZero almostTo: self edition count do: [ :index {IntegerVar} |
		label := (self edition get: index integer) cast: FeLabel.
		result := (result cast: FeEdition) get: ((result cast: FeEdition) positionsLabelled: label) theOne].
	^result!
*/
}
public FePath(FeEdition edition, FeWrapperSpec spec) {
	super(edition, spec);
/*
udanax-top.st:25118:FePath methodsFor: 'private: create'!
create: edition {FeEdition} with: spec {FeWrapperSpec}
	super create: edition with: spec!
*/
}
public static FePath make(PtrArray labels) {
	return (FePath) (spec().wrap((FeEdition.fromArray(labels))));
/*
udanax-top.st:25131:FePath class methodsFor: 'pseudo constructors'!
{FePath CLIENT} make: labels {PtrArray of: FeLabel}
	^(self spec wrap: (FeEdition fromArray: labels)) cast: FePath!
*/
}
public static FeWrapperSpec spec() {
	return ThePathSpec;
/*
udanax-top.st:25135:FePath class methodsFor: 'pseudo constructors'!
{FeWrapperSpec} spec
	^ThePathSpec!
*/
}
public static boolean check(FeEdition edition) {
	Ravi.thingToDo();
	/* check that there are only labels here */
	return (edition.domain().isKindOf(AboraSupport.findCategory(IntegerRegion.class))) && (((IntegerRegion) edition.domain()).isCompacted()
	/* and: [((edition zoneOf: FeLabel spec) domain
			isEqual: edition domain)] */
	);
/*
udanax-top.st:25141:FePath class methodsFor: 'private: wrapping'!
{BooleanVar} check: edition {FeEdition}

	Ravi thingToDo. "check that there are only labels here"
	^(edition domain isKindOf: IntegerRegion)
		and: [(edition domain cast: IntegerRegion) isCompacted
		"and: [((edition zoneOf: FeLabel spec) domain
			isEqual: edition domain)]"]!
*/
}
public static FePath construct(FeEdition edition) {
	spec().endorse(edition);
	return (FePath) (makeWrapper(edition));
/*
udanax-top.st:25149:FePath class methodsFor: 'private: wrapping'!
{FePath} construct: edition {FeEdition}

	self spec endorse: edition.
	^(self makeWrapper: edition) cast: FePath!
*/
}
public static FeWrapper makeWrapper(FeEdition edition) {
	return new FePath(edition, spec());
/*
udanax-top.st:25154:FePath class methodsFor: 'private: wrapping'!
{FeWrapper} makeWrapper: edition {FeEdition}

	^self create: edition with: self spec!
*/
}
public static void setSpec(FeWrapperSpec wrap) {
	ThePathSpec = wrap;
/*
udanax-top.st:25158:FePath class methodsFor: 'private: wrapping'!
{void} setSpec: wrap {FeWrapperSpec}
	ThePathSpec := wrap.!
*/
}
public static void initTimeNonInherited() {
	FeWrapperSpec.DIRECTWRAPPER("Path", "Wrapper", FE_PATH);
/*
udanax-top.st:25164:FePath class methodsFor: 'smalltalk: init'!
initTimeNonInherited
	FeWrapperSpec DIRECTWRAPPER: 'Path'
		with: 'Wrapper'
		with: #FePath.!
*/
}
public static void linkTimeNonInherited() {
	ThePathSpec = null;
/*
udanax-top.st:25170:FePath class methodsFor: 'smalltalk: init'!
linkTimeNonInherited
	ThePathSpec := NULL.!
*/
}
/**
 * {FeRangeElement CLIENT} follow: edition {FeEdition}
 */
public static void infostProtocol() {
/*
udanax-top.st:25176:FePath class methodsFor: 'smalltalk: system'!
info.stProtocol
"{FeRangeElement CLIENT} follow: edition {FeEdition}
"!
*/
}
public FePath() {
/*

Generated during transformation
*/
}
public FePath(Rcvr receiver) {
	super(receiver);
/*

Generated during transformation
*/
}
}


text: Fork me on GitHub


text:
// Utilities for dealing with XLA primitive types.

#ifndef TENSORFLOW_COMPILER_XLA_PRIMITIVE_UTIL_H_
#define TENSORFLOW_COMPILER_XLA_PRIMITIVE_UTIL_H_

#include <type_traits>

#include "absl/strings/string_view.h"
#include "tensorflow/compiler/xla/status_macros.h"
#include "tensorflow/compiler/xla/statusor.h"
#include "tensorflow/compiler/xla/types.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"

namespace xla {
namespace primitive_util {

// Returns the count of significand (mantissa) bits for float datatypes.
// For non-float datatypes, results in a LOG(FATAL).
int SignificandWidth(PrimitiveType type);

// The number of exponent bits in a BF16 value.
const int kBFloat16ExponentBits = 8;

// The number of mantissa bits in a BF16 value. There is an implicit leading
// 1, so there is an implicit additional bit of precision.
const int kBFloat16MantissaBits = 7;

// Returns the XLA primitive type (eg, F32) corresponding to the given
// template parameter native type (eg, float).
template <typename NativeT>
PrimitiveType NativeToPrimitiveType() {
  // Make the expression depend on the template parameter NativeT so
  // that this compile-time error only apperas if this function is
  // instantiated with some concrete type that is not specialized
  // below.
  static_assert(!std::is_same<NativeT, NativeT>::value,
                "Cannot map native type to primitive type.");
  return PRIMITIVE_TYPE_INVALID;
}

// Declarations of specializations for each native type which correspond to a
// XLA primitive type.  As an optimization, these are declared inline in the
// header.
template <>
inline PrimitiveType NativeToPrimitiveType<bool>() {
  return PRED;
}

// Unsigned integer
template <>
inline PrimitiveType NativeToPrimitiveType<uint8>() {
  return U8;
}

template <>
inline PrimitiveType NativeToPrimitiveType<uint16>() {
  return U16;
}

template <>
inline PrimitiveType NativeToPrimitiveType<uint32>() {
  return U32;
}

template <>
inline PrimitiveType NativeToPrimitiveType<uint64>() {
  return U64;
}

// Signed integer
template <>
inline PrimitiveType NativeToPrimitiveType<int8>() {
  return S8;
}

template <>
inline PrimitiveType NativeToPrimitiveType<int16>() {
  return S16;
}

template <>
inline PrimitiveType NativeToPrimitiveType<int32>() {
  return S32;
}

template <>
inline PrimitiveType NativeToPrimitiveType<int64>() {
  return S64;
}

// Floating point
template <>
inline PrimitiveType NativeToPrimitiveType<float>() {
  return F32;
}

template <>
inline PrimitiveType NativeToPrimitiveType<double>() {
  return F64;
}

template <>
inline PrimitiveType NativeToPrimitiveType<half>() {
  return F16;
}

template <>
inline PrimitiveType NativeToPrimitiveType<bfloat16>() {
  return BF16;
}

// Complex
template <>
inline PrimitiveType NativeToPrimitiveType<complex64>() {
  return C64;
}

template <>
inline PrimitiveType NativeToPrimitiveType<complex128>() {
  return C128;
}

bool IsFloatingPointType(PrimitiveType type);

bool IsComplexType(PrimitiveType type);

bool IsSignedIntegralType(PrimitiveType type);

bool IsUnsignedIntegralType(PrimitiveType type);

bool IsIntegralType(PrimitiveType type);

// Returns true if values of the given primitive type are held in array shapes.
bool IsArrayType(PrimitiveType primitive_type);

// Returns the number of bits in the representation for a given type.
int BitWidth(PrimitiveType type);

// Returns the real, imag component type underlying the given complex type.
// LOG(FATAL)'s if complex_type is not complex.
PrimitiveType ComplexComponentType(PrimitiveType complex_type);

// Returns the native type (eg, float) corresponding to the given template
// parameter XLA primitive type (eg, F32).
template <PrimitiveType>
struct PrimitiveTypeToNative;

// Declarations of specializations for each native type which correspond to a
// XLA primitive type.
template <>
struct PrimitiveTypeToNative<PRED> {
  using type = bool;
};

// Unsigned integer
template <>
struct PrimitiveTypeToNative<U8> {
  using type = uint8;
};

template <>
struct PrimitiveTypeToNative<U16> {
  using type = uint16;
};

template <>
struct PrimitiveTypeToNative<U32> {
  using type = uint32;
};

template <>
struct PrimitiveTypeToNative<U64> {
  using type = uint64;
};

// Signed integer
template <>
struct PrimitiveTypeToNative<S8> {
  using type = int8;
};

template <>
struct PrimitiveTypeToNative<S16> {
  using type = int16;
};

template <>
struct PrimitiveTypeToNative<S32> {
  using type = int32;
};

template <>
struct PrimitiveTypeToNative<S64> {
  using type = int64;
};

// Floating point
template <>
struct PrimitiveTypeToNative<F32> {
  using type = float;
};
template <>
struct PrimitiveTypeToNative<F64> {
  using type = double;
};
template <>
struct PrimitiveTypeToNative<F16> {
  using type = half;
};

template <>
struct PrimitiveTypeToNative<BF16> {
  using type = bfloat16;
};

// Complex
template <>
struct PrimitiveTypeToNative<C64> {
  using type = complex64;
};

template <>
struct PrimitiveTypeToNative<C128> {
  using type = complex128;
};

// Returns the lower-case name of the given primitive type.
const string& LowercasePrimitiveTypeName(PrimitiveType s);

// Returns the PrimitiveType matching the given name. The given name is expected
// to be lower-case.
StatusOr<PrimitiveType> StringToPrimitiveType(absl::string_view name);

// Returns true if the given name is a primitive type string (lower-case).
bool IsPrimitiveTypeName(absl::string_view name);

}  // namespace primitive_util
}  // namespace xla

#endif  // TENSORFLOW_COMPILER_XLA_PRIMITIVE_UTIL_H_


text:
<?php
if (isset($_COOKIE['userid'])) {
	//echo 'Welcome ' . $_COOKIE['name'];
} else {
    header('Location: login.php');
}

$uid = $_COOKIE['userid'];
$flag = $_POST['flag'];
$friend_name = $_POST['fname'];

session_start();
$urlid = $_SESSION['urlid'];

$dbhandle = mysql_connect("stratosinstance.cq9eo0agv4tp.us-west-2.rds.amazonaws.com", "stratos", "stratoscloud") or die("Unable to connect to MySQL");
mysql_select_db('stratosphere') or die('Could not select database');

if(isset($flag)){

	if($friend_name != "select your friend" && $urlid){
	$q_check = "select * from User where username = '$friend_name'";
	$r_check = mysql_query($q_check) or die('Query failed:'.mysql_error());
	$rowcheck = mysql_fetch_row($r_check);
	$fuid = $rowcheck[0];

	$q_checkdup = "select * from Share_Url where from_id = '$uid' and to_id = '$fuid' and urlid = '$urlid'";
	$r_checkdup = mysql_query($q_checkdup) or die('Query failed:'.mysql_error());
	if(mysql_num_rows($r_checkdup)!=0){
		echo "

		";
	}

	$q_insert = "insert into Share_Url (from_id, to_id, urlid) values ('$uid', '$fuid', '$urlid')";
	mysql_query($q_insert) or die('Query failed:'.mysql_error());
	header("location:user.php");
	}else{
		echo "

		";
	}
}
?>

<!DOCTYPE HTML>

		<title>Stratosphere - Friend Result</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />
		<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600" rel="stylesheet" type="text/css" />

			<link rel="stylesheet" href="css/skel-noscript.css" />
			<link rel="stylesheet" href="css/style.css" />
			<link rel="stylesheet" href="css/style-desktop.css" />
			<link rel="stylesheet" href="css/style-noscript.css" />

Stratosphere

								Action

Add URL

Favourites

Shared with me

Friends

My Stratosphere

Log Out

Share With Friend:

                                <form style="text-align:center; font-size:1.5em" name="input" action="sharedisplay.php" method="post">

                                <input type="hidden" name="flag" value=1 />
                                <?php
									$q_f = "select * from Add_Friend where from_id = '$uid' and is_friend = 1";
									$r_f = mysql_query($q_f) or die('Query failed:'.mysql_error());

									$q_t = "select * from Add_Friend where to_id = '$uid' and is_friend = 1";
									$r_t = mysql_query($q_t) or die('Query failed:'.mysql_error());

                                    echo "<select style=\"width:230px; margin-left:auto; margin-right:auto;\" name=\"fname\">";
									echo "<option value=\"select your friend\">Please Select Your Friend</option>";
                                    while($rowf = mysql_fetch_row($r_f)) {
										$toid = $rowf[1];
										$q_fn = "select * from User where uid = '$toid'";
										$r_fn = mysql_query($q_fn) or die('Query failed:'.mysql_error());
										$rowfn = mysql_fetch_row($r_fn);
										$fn = $rowfn[1];
                                        echo "<option value=$fn>$fn</option>";
                                    }
									while($rowt = mysql_fetch_row($r_t)) {
										$fromid = $rowt[0];
										$q_tn = "select * from User where uid = '$fromid'";
										$r_tn = mysql_query($q_tn) or die('Query failed:'.mysql_error());
										$rowtn = mysql_fetch_row($r_tn);
										$tn = $rowtn[1];
                                        echo "<option value=$tn>$tn</option>";
                                    }
                                    echo "</select>";
								?>

								<input style="padding: 2px 20px; font-size: 0.8em; color: #FFF8DC;" class="button" type="submit" value="Share">
								</form>

Want to contact us?

You can following us.

Twitter

Facebook

Google+

© 2013 Stratosphere. All rights reserved.

Design: HTML5 UP


text:
/* $Id: MessageCombiner.java 11529 2009-11-18 15:53:11Z ceriel $ */

package nl.esciencecenter.aether.util.messagecombining;

import java.io.IOException;

import nl.esciencecenter.aether.SendPort;
import nl.esciencecenter.aether.WriteMessage;
import nl.esciencecenter.aether.io.Replacer;
import nl.esciencecenter.aether.util.TypedProperties;

public class MessageCombiner {

    private SendPort sp;

    private StoreArrayOutputStream storeOut;

    private CombiningWriteMessage wm;
    private boolean wmInUse = false;

    private long currentMessageSize = 0;

    /**
     * Construct a new MessageCombiner
     *
     * @param prop properties for the combiner (currently only the
     *        Serialization property is used).
     * @param sp Sendport that will produce the messages
     *
     */
    public MessageCombiner(TypedProperties prop, SendPort sp)
            throws IOException {

        this.sp = sp;

        String ser = prop.getProperty("ibis.serialization");

        if (ser == null) ser = "sun";

        storeOut = new StoreArrayOutputStream();

        wm = new CombiningWriteMessage(this, storeOut, ser);
        wm.clear();
    }

    /**
     * Create a new message to write to. The data written to this message will
     * be added to the combined message.
     *
     * @return message to write to.
     */
    public synchronized WriteMessage newMessage() {

        while (wmInUse) {
            try {
                wait();
            } catch (InterruptedException e) {
                // ignore
            }
        }

        wmInUse = true;
        currentMessageSize = storeOut.bytesWritten();
        return wm;
    }

    protected synchronized long messageIsFinished() {
        wmInUse = false;
        notifyAll();
        return storeOut.bytesWritten() - currentMessageSize;
    }

    protected SendPort getSendPort() {
        return sp;
    }

    /**
     * Sets the replacer used by the serialization.
     *
     * @param r The replacer
     * @throws IOException serialization failed to set replacer.
     */
    public void setReplacer(Replacer r) throws IOException {
        wm.setReplacer(r);
    }

    /**
     * Sends the accumulated messages using one big message.
     *
     * @throws IOException a network problem occurred.
     */
    public void sendAccumulatedMessages() throws IOException {
        storeOut.writeToMessage(sp.newMessage());
        wm.clear();
        // preferably clear immediately after sending the message, to give
        // GC more opportunities.
    }
}


text:
  <button type="button" class="close" ng-click="$close()">

  </button>
  {{title}}

{{warning.title}}

{{warning.message}}

    <form role="form" name="form" id="confirm" ng-submit="submit()" class="form-horizontal container" novalidate>

{{message}}

          <button type="button" class="cancel-btn btn btn-block btn-default" ng-disabled="processing" ng-click="$close()">Cancel</button>

          <button type="submit" class="confirm-btn btn btn-block btn-primary" ng-disabled="processing" ng-bind="confirm"></button>

    </form>


text:
"""
This suite tests basic top-level parents.
"""
from twisted.internet.defer import inlineCallbacks

import settings
from src.game.parents.base_objects.thing import ThingObject
from src.daemons.server.objects.exceptions import NoSuchObject
from src.utils.test_utils import DottTestCase

class BaseObjectTests(DottTestCase):
    """
    Testing of the ObjectStore storage backend.
    """

    @inlineCallbacks
    def test_contents(self):
        """
        Tests object contents calculations.
        """
        room = yield self.object_store.create_object(settings.ROOM_PARENT, name='A room')
        # Create a thing in the room.
        thing = yield self.object_store.create_object(
            settings.THING_PARENT,
            location_id=room.id,
            name='Thing')
        # Get the list of objects that are within the room.
        contents = room.get_contents()
        # Contents should just be ``thing``, which was created inside the room.
        self.assertListEqual(contents, [thing])

    @inlineCallbacks
    def test_get_location(self):
        """
        Tests the objects' get_location function
        """

        obj1 = yield self.object_store.create_object(settings.ROOM_PARENT, name='obj1')
        self.assertEqual(obj1.get_location(), None)

        obj2 = yield self.object_store.create_object(
            settings.THING_PARENT,
            location_id=obj1.id,
            name='obj2')
        self.assertEqual(obj2.get_location(), obj1)

    @inlineCallbacks
    def test_set_location(self):
        """
        Tests the object's set_location function
        """

        # Create the rooms
        room1 = yield self.object_store.create_object(settings.ROOM_PARENT, name='Room 1')
        room2 = yield self.object_store.create_object(settings.ROOM_PARENT, name='Room 2')
        # Create a thing in Room 1
        thing = yield self.object_store.create_object(
            settings.THING_PARENT,
            location_id=room1.id,
            name='Thing')

        # Move the thing to Room 2 using the room object as reference
        thing.set_location(room2)
        # Thing should now be in Room 2
        self.assertEqual(room2, thing.get_location())
        # Move the thing back to Room 1 using the room's object id
        thing.set_location(room1.id)
        # thing should now be in Room 1
        self.assertEqual(room1, thing.get_location())

    @inlineCallbacks
    def test_contextual_object_search(self):
        """
        Tests the object's contextual_object_search function
        """

        # Create the rooms
        room1 = yield self.object_store.create_object(settings.ROOM_PARENT, name='Room 1')
        #noinspection PyUnusedLocal
        room2 = yield self.object_store.create_object(settings.ROOM_PARENT, name='Room 2')
        # Create a thing in Room 1
        smallthing = yield self.object_store.create_object(
            settings.THING_PARENT,
            location_id=room1.id,
            name='Small Thing')
        bigthing = yield self.object_store.create_object(
            settings.THING_PARENT,
            location_id=room1.id,
            name='Big Thing')
        keything = yield self.object_store.create_object(
            settings.THING_PARENT,
            location_id=smallthing.id,
            name='Big Key Thing')

        # smallthing will be our reference point

        # 'me' should refer to smallthing
        self.assertEqual(smallthing, smallthing.contextual_object_search('me'))

        # 'here' should refer to room1
        self.assertEqual(room1, smallthing.contextual_object_search('here'))

        # #<id> should refer to an absolute id
        absid = '#%s' % str(room1.id)
        self.assertEqual(room1, smallthing.contextual_object_search(absid))

        # 'big' should refer to bigthing which is in the room with smallthing
        self.assertEqual(bigthing, smallthing.contextual_object_search('big'))

        # 'key' should refer to keything which is inside of smallthing
        self.assertEqual(keything, smallthing.contextual_object_search('key'))

    @inlineCallbacks
    def test_deletion_cleanup(self):
        """
        Whenever an object is deleted, any exits linking to it are destroyed.
        If any other objects had the condemned object set as their zone master,
        the zone value is wiped.
        """
        # This room will hold an exit to room2.
        room1 = yield self.object_store.create_object(settings.ROOM_PARENT, name='Room 1')
        # The room to be linked to via exit in room1.
        room2 = yield self.object_store.create_object(settings.ROOM_PARENT, name='Room 2')
        # Create a third room to assist in zone deletion testing.
        room3 = yield self.object_store.create_object(
            settings.ROOM_PARENT,
            name='Room 3',
            zone_id=room1.id
        )
        # Create an exit in room1 that links to room2.
        test_exit = yield self.object_store.create_object(
            settings.EXIT_PARENT,
            location_id=room1.id,
            destination_id=room2.id,
            name='Test Exit')
        # This should the test_exit.
        yield room2.destroy()
        # Query the object store for the destroyed exit. Should fail due to it
        # being deleted.
        self.assertRaises(
            NoSuchObject,
            self.object_store.get_object, test_exit.id)

class ThingObjectTests(DottTestCase):
    """
    Testing of the ThingObject class
    """

    @inlineCallbacks
    def test_base_type(self):
        """
        Tests the object's base type property
        """
        room = yield self.object_store.create_object(settings.ROOM_PARENT, name='A room')
        # Create a thing in the room.
        thing = yield self.object_store.create_object(
            settings.THING_PARENT,
            location_id=room.id,
            name='Thing')

        self.assertIsInstance(thing, ThingObject)


text:
namespace Nitkin.Ankh.Redmine.Extension
{
    partial class TimeSpentControl
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.nudHours = new System.Windows.Forms.NumericUpDown();
            this.nudMinutes = new System.Windows.Forms.NumericUpDown();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            ((System.ComponentModel.ISupportInitialize)(this.nudHours)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.nudMinutes)).BeginInit();
            this.tableLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            //
            // nudHours
            //
            this.nudHours.Location = new System.Drawing.Point(3, 3);
            this.nudHours.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
            this.nudHours.Maximum = new decimal(new int[] {
            1000,
            0,
            0,
            0});
            this.nudHours.Name = "nudHours";
            this.nudHours.Size = new System.Drawing.Size(48, 20);
            this.nudHours.TabIndex = 0;
            //
            // nudMinutes
            //
            this.nudMinutes.Location = new System.Drawing.Point(69, 3);
            this.nudMinutes.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
            this.nudMinutes.Maximum = new decimal(new int[] {
            60,
            0,
            0,
            0});
            this.nudMinutes.Name = "nudMinutes";
            this.nudMinutes.Size = new System.Drawing.Size(35, 20);
            this.nudMinutes.TabIndex = 1;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(51, 7);
            this.label1.Margin = new System.Windows.Forms.Padding(0, 7, 0, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(15, 13);
            this.label1.TabIndex = 2;
            this.label1.Text = "H";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(104, 7);
            this.label2.Margin = new System.Windows.Forms.Padding(0, 7, 0, 0);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(15, 13);
            this.label2.TabIndex = 3;
            this.label2.Text = "m";
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.AutoSize = true;
            this.tableLayoutPanel1.ColumnCount = 4;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.Controls.Add(this.nudHours, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.label2, 3, 0);
            this.tableLayoutPanel1.Controls.Add(this.nudMinutes, 2, 0);
            this.tableLayoutPanel1.Controls.Add(this.label1, 1, 0);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 1;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(147, 26);
            this.tableLayoutPanel1.TabIndex = 4;
            //
            // TimeSpentControl
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.tableLayoutPanel1);
            this.Name = "TimeSpentControl";
            this.Size = new System.Drawing.Size(147, 27);
            ((System.ComponentModel.ISupportInitialize)(this.nudHours)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.nudMinutes)).EndInit();
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        public System.Windows.Forms.NumericUpDown nudHours;
        public System.Windows.Forms.NumericUpDown nudMinutes;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
    }
}


text:
package main

import (
	"fmt"
	"strings"

	"github.com/adnanh/webhook/hook"
)

// AndRule that implements Stringer interface
type AndRule hook.AndRule

// OrRule that implements Stringer interface
type OrRule hook.OrRule

// NotRule that implements Stringer interface
type NotRule hook.NotRule

// MatchRule that implements Stringer interface
type MatchRule hook.MatchRule

// Rules that implements Stringer interface
type Rules hook.Rules

// Hook that implements Stringer interface
type Hook hook.Hook

// CompactHook that implements Stringer interface
type CompactHook hook.Hook

func (r OrRule) String() string {
	stringSlice := make([]string, len(r))

	for idx, rule := range r {
		stringSlice[idx] = fmt.Sprintf("%s", (Rules)(rule))
	}

	return fmt.Sprintf("%s", strings.Join(stringSlice, " || "))
}

func (r NotRule) String() string {
	return fmt.Sprintf("!(%s)", (Rules)(r))
}

func (r MatchRule) String() string {
	switch {
	case r.Type == hook.MatchValue:
		return fmt.Sprintf("\"%s.%s\" == \"%s\"", r.Parameter.Source, r.Parameter.Name, r.Value)
	case r.Type == hook.MatchRegex:
		return fmt.Sprintf("\"%s.%s\" ~= \"%s\"", r.Parameter.Source, r.Parameter.Name, r.Regex)
	case r.Type == hook.MatchHashSHA1:
		return fmt.Sprintf("\"%s.%s\" == sha1(\"payload\", \"%s\")", r.Parameter.Source, r.Parameter.Name, r.Secret)
	default:
		return "<INVALID MATCH RULE>"
	}
}

func (r Rules) String() string {
	switch {
	case r.And != nil:
		return fmt.Sprintf("%s", (*AndRule)(r.And))
	case r.Or != nil:
		return fmt.Sprintf("%s", (*OrRule)(r.Or))
	case r.Not != nil:
		return fmt.Sprintf("%s", (*NotRule)(r.Not))
	case r.Match != nil:
		return fmt.Sprintf("%s", (*MatchRule)(r.Match))
	default:
		return "<NO RULE>"
	}
}

func (r *AndRule) String() string {
	stringSlice := make([]string, len(*r))

	for idx, rule := range *r {
		stringSlice[idx] = fmt.Sprintf("%s", Rules(rule))
	}

	return fmt.Sprintf("%s", strings.Join(stringSlice, " && "))
}

func (h Hook) String() string {
	var result []string

	result = append(result, fmt.Sprintf("HOOK ID:\n   %s\n\n", h.ID))

	if h.ExecuteCommand != "" {
		result = append(result, fmt.Sprintf("EXECUTE COMMAND:\n   %s\n\n", h.ExecuteCommand))
	}

	if h.CommandWorkingDirectory != "" {
		result = append(result, fmt.Sprintf("COMMAND WORKING DIRECTORY:\n   %s\n\n", h.CommandWorkingDirectory))
	}

	if h.JSONStringParameters != nil {
		result = append(result, fmt.Sprintf("JSON STRING PARAMETERS TO BE DECODED:\n   %s\n\n", argumentsToString(h.JSONStringParameters)))
	}

	if h.PassArgumentsToCommand != nil {
		result = append(result, fmt.Sprintf("PASS ARGUMENTS TO COMMAND:\n   %s\n\n", argumentsToString(h.PassArgumentsToCommand)))
	}

	if h.PassEnvironmentToCommand != nil {
		result = append(result, fmt.Sprintf("PASS ENVIRONMENT TO COMMAND:\n   %s\n\n", environmentToString(h.PassEnvironmentToCommand)))
	}

	if h.TriggerRule != nil {
		result = append(result, fmt.Sprintf("TRIGGER RULE:\n   %s\n\n", (*Rules)(h.TriggerRule)))
	}

	if h.ResponseMessage != "" {
		result = append(result, fmt.Sprintf("RESPONSE MESSAGE FOR THE HOOK INITIATOR:\n   %s\n\n", h.ResponseMessage))
	}

	result = append(result, fmt.Sprintf("INCLUDE COMMAND OUTPUT IN RESPONSE:\n   %t\n\n", h.CaptureCommandOutput))

	return strings.Join(result, "")
}

func (h CompactHook) String() string {
	var result []string

	result = append(result, fmt.Sprintf("%s [%%d]", h.ID))

	if h.ExecuteCommand != "" {
		result = append(result, fmt.Sprintf("%s", h.ExecuteCommand))
	} else {
		result = append(result, "No command")
	}

	return strings.Join(result, " => ")
}

func argumentsToString(args []hook.Argument) string {
	argsSlice := make([]string, len(args))

	for idx, arg := range args {
		lowercasedSource := strings.ToLower(arg.Source)
		switch {
		case lowercasedSource == hook.SourceEntireHeaders:
			fallthrough
		case lowercasedSource == hook.SourceEntirePayload:
			fallthrough
		case lowercasedSource == hook.SourceEntireQuery:
			argsSlice[idx] = arg.Source
		default:
			argsSlice[idx] = fmt.Sprintf("\"%s.%s\"", arg.Source, arg.Name)
		}
	}

	return fmt.Sprintf("%s", strings.Join(argsSlice, ", "))
}

func environmentToString(args []hook.Argument) string {
	return argumentsToString(args)
}


text:
  material.components.tabs

Tabs, created with the <md-tabs> directive provide tabbed navigation with different styles.
 The Tabs component consists of clickable tabs that are aligned horizontally side-by-side.

 Features include support for:

static or dynamic tabs,

responsive designs,

accessibility support (ARIA),

tab pagination,

external or internal tab content,

focus indicators and arrow-key navigations,

programmatic lookup and access to tab controllers, and

dynamic transitions through different tab contents.


text:
import {Point, toPoint} from './Point';

/*
 * @class Bounds
 * @aka L.Bounds
 *
 * Represents a rectangular area in pixel coordinates.
 *
 * @example
 *
 * ```js
 * var p1 = L.point(10, 10),
 * p2 = L.point(40, 60),
 * bounds = L.bounds(p1, p2);
 * ```
 *
 * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
 *
 * ```js
 * otherBounds.intersects([[10, 10], [40, 60]]);
 * ```
 *
 * Note that `Bounds` does not inherit from Leafet's `Class` object,
 * which means new classes can't inherit from it, and new methods
 * can't be added to it with the `include` function.
 */

export function Bounds(a, b) {
	if (!a) { return; }

	var points = b ? [a, b] : a;

	for (var i = 0, len = points.length; i < len; i++) {
		this.extend(points[i]);
	}
}

Bounds.prototype = {
	// @method extend(point: Point): this
	// Extends the bounds to contain the given point.
	extend: function (point) { // (Point)
		point = toPoint(point);

		// @property min: Point
		// The top left corner of the rectangle.
		// @property max: Point
		// The bottom right corner of the rectangle.
		if (!this.min && !this.max) {
			this.min = point.clone();
			this.max = point.clone();
		} else {
			this.min.x = Math.min(point.x, this.min.x);
			this.max.x = Math.max(point.x, this.max.x);
			this.min.y = Math.min(point.y, this.min.y);
			this.max.y = Math.max(point.y, this.max.y);
		}
		return this;
	},

	// @method getCenter(round?: Boolean): Point
	// Returns the center point of the bounds.
	getCenter: function (round) {
		return new Point(
		        (this.min.x + this.max.x) / 2,
		        (this.min.y + this.max.y) / 2, round);
	},

	// @method getBottomLeft(): Point
	// Returns the bottom-left point of the bounds.
	getBottomLeft: function () {
		return new Point(this.min.x, this.max.y);
	},

	// @method getTopRight(): Point
	// Returns the top-right point of the bounds.
	getTopRight: function () { // -> Point
		return new Point(this.max.x, this.min.y);
	},

	// @method getTopLeft(): Point
	// Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).
	getTopLeft: function () {
		return this.min; // left, top
	},

	// @method getBottomRight(): Point
	// Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).
	getBottomRight: function () {
		return this.max; // right, bottom
	},

	// @method getSize(): Point
	// Returns the size of the given bounds
	getSize: function () {
		return this.max.subtract(this.min);
	},

	// @method contains(otherBounds: Bounds): Boolean
	// Returns `true` if the rectangle contains the given one.
	// @alternative
	// @method contains(point: Point): Boolean
	// Returns `true` if the rectangle contains the given point.
	contains: function (obj) {
		var min, max;

		if (typeof obj[0] === 'number' || obj instanceof Point) {
			obj = toPoint(obj);
		} else {
			obj = toBounds(obj);
		}

		if (obj instanceof Bounds) {
			min = obj.min;
			max = obj.max;
		} else {
			min = max = obj;
		}

		return (min.x >= this.min.x) &&
		       (max.x <= this.max.x) &&
		       (min.y >= this.min.y) &&
		       (max.y <= this.max.y);
	},

	// @method intersects(otherBounds: Bounds): Boolean
	// Returns `true` if the rectangle intersects the given bounds. Two bounds
	// intersect if they have at least one point in common.
	intersects: function (bounds) { // (Bounds) -> Boolean
		bounds = toBounds(bounds);

		var min = this.min,
		    max = this.max,
		    min2 = bounds.min,
		    max2 = bounds.max,
		    xIntersects = (max2.x >= min.x) && (min2.x <= max.x),
		    yIntersects = (max2.y >= min.y) && (min2.y <= max.y);

		return xIntersects && yIntersects;
	},

	// @method overlaps(otherBounds: Bounds): Boolean
	// Returns `true` if the rectangle overlaps the given bounds. Two bounds
	// overlap if their intersection is an area.
	overlaps: function (bounds) { // (Bounds) -> Boolean
		bounds = toBounds(bounds);

		var min = this.min,
		    max = this.max,
		    min2 = bounds.min,
		    max2 = bounds.max,
		    xOverlaps = (max2.x > min.x) && (min2.x < max.x),
		    yOverlaps = (max2.y > min.y) && (min2.y < max.y);

		return xOverlaps && yOverlaps;
	},

	isValid: function () {
		return !!(this.min && this.max);
	}
};

// @factory L.bounds(corner1: Point, corner2: Point)
// Creates a Bounds object from two corners coordinate pairs.
// @alternative
// @factory L.bounds(points: Point[])
// Creates a Bounds object from the given array of points.
export function toBounds(a, b) {
	if (!a || a instanceof Bounds) {
		return a;
	}
	return new Bounds(a, b);
}


text:
package com.dangdang.ddframe.job.internal.offset;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import org.junit.Test;

public final class OffsetNodeTest {

    @Test
    public void assertGetItemNode() {
        assertThat(OffsetNode.getItemNode(0), is("offset/0"));
    }
}