text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class FcoeFaultPnicHasNoPortSet extends FcoeFault {
  public String nicDevice;

  public String getNicDevice() {
    return this.nicDevice;
  }

  public void setNicDevice(String nicDevice) {
    this.nicDevice=nicDevice;
  }
}

redpajama_set_name: RedPajamaGithub


text: package tcpinfo


text:
package com.smcpartners.shape.usecases.inactivate_user;

import com.smcpartners.shape.shared.dto.common.BooleanValueDTO;
import com.smcpartners.shape.shared.usecasecommon.UseCaseException;

import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

/**
 * Responsible:

 * 1.  Support REST framework

 *

 * Created by johndestefano on 3/15/16.
 *

 *

 * Changes:

 * 1.

 *

 */
@Path("/admin")
public interface InactivateUserService {
    /**
     * Inactivate the user
     *
     * @throws UseCaseException
     */
    @PUT
    @Path("/inactivate/{targetuserid}")
    @Produces("application/json")
    BooleanValueDTO inactivateUser(@PathParam("targetuserid") String targetUserId) throws UseCaseException;
}


text:
Use [Ninite](https://ninite.com) to install.
1. 7-zip (compression software)
2. VLC Player (Video and Media player)
3. Foxit Reader (PDF)
4. ImgBurn
5. InfraRecorder (DVD burning Image creation)
6. MalwareBytes (Security Malware)
7. [Notepad ++](https://notepad-plus-plus.org/)

Others:
- Microsoft Security Essentials (also available on Ninite)
- [f.lux](https://justgetflux.com)

Test Time.bat:
```bat
net stop  w32time
net start w32time
w32tm /resync /nowait
```
Above script should re-synch the time but doesn't seem to work.

More from Ninite
1. [LibreOffice](https://www.libreoffice.org/)
2. Handbreak
3. GiMP
4. Audacity
5. Revo Uninstaller?
6. Adopt Open JDK ??
7. Zoom

Office:
- [OnlyOffice](https://www.onlyoffice.com/en/download-desktop.aspx)

Media Related:
[Lightworks](https://www.lwks.com) (video editor)
[OBS Studio](https://obsproject.com) (video streaming)
[AffinityPhoto](https://affinity.serif.com/en-gb/photo/) (image editing)
[Audacity](https://www.audacityteam.org/download/windows/)
[FireAlpaca](https://firealpaca.com/download/)

Windows 10:
[New Terminal](https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701?activetab=pivot:overviewtab)

Windows Command for Checksums:
`CertUtil -hashfile file_name sha256`


text:
/**
 * React Native App
 * https://github.com/ztplz/CNode-react-native
 * email: mysticzt@gmail.com
 */

import {
  CHANGE_MODE,
  CHANGE_THEMECOLOR,
  USER_LOGIN,
  USER_LOGOUT
} from '../constants/actionTypes';

export function changeMode(payload) {
  console.log('changeMode');
  return {
    type: CHANGE_MODE,
    payload
  }
}

export function changeThemecolor(payload) {
  console.log('changeThemecolor');
  return {
    type: CHANGE_THEMECOLOR,
    payload
  }
}

export function userLogin(payload) {
  console.log('userLogin');
  return {
    type: USER_LOGIN,
    payload
  }
}

export function userLogout(payload) {
  return {
    type: USER_LOGOUT,
    payload
  }
}


text:
import {AmpEvents} from '../../src/amp-events';
import {createCustomEvent} from '../../src/event-helper';
import {
  createFixtureIframe,
  expectBodyToBecomeVisible,
  poll,
} from '../../testing/iframe.js';

describe
  .configure()
  .enableIe()
  .retryOnSaucelabs()
  .run('Rendering of amp-img', () => {
    const timeout = window.ampTestRuntimeConfig.mochaTimeout;

    let fixture;
    beforeEach(() => {
      return createFixtureIframe('test/fixtures/images.html', 500).then((f) => {
        fixture = f;
      });
    });

    it('should show the body in image test', () => {
      return expectBodyToBecomeVisible(fixture.win, timeout);
    });

    it('should be present', () => {
      expect(fixture.doc.querySelectorAll('amp-img')).to.have.length(16);
      // 5 image visible in 500 pixel height. Note that there will be no load
      // event for the inabox image.
      return fixture.awaitEvent(AmpEvents.LOAD_START, 3).then(function () {
        expect(fixture.doc.querySelectorAll('amp-img img[src]')).to.have.length(
          4
        );
      });
    });

    it('should resize and load more elements', () => {
      // Note that there will be no load event for the inabox image.
      const p = fixture.awaitEvent(AmpEvents.LOAD_START, 11).then(function () {
        expect(fixture.doc.querySelectorAll('amp-img img[src]')).to.have.length(
          12
        );
        fixture.iframe.height = 2000;
        fixture.win.dispatchEvent(
          createCustomEvent(fixture.win, 'resize', null)
        );
        return fixture.awaitEvent(AmpEvents.LOAD_START, 13).then(function () {
          expect(
            fixture.doc.querySelectorAll('amp-img img[src]')
          ).to.have.length(14);
        });
      });
      fixture.iframe.height = 1500;
      fixture.win.dispatchEvent(createCustomEvent(fixture.win, 'resize', null));
      return p;
    });

    it('should respect media queries', () => {
      return fixture
        .awaitEvent(AmpEvents.LOAD_START, 3)
        .then(() => {
          return new Promise((res) => setTimeout(res, 1));
        })
        .then(function () {
          const smallScreen = fixture.doc.getElementById('img3');
          const largeScreen = fixture.doc.getElementById('img3_1');
          expect(smallScreen.className).to.not.match(
            /i-amphtml-hidden-by-media-query/
          );
          expect(largeScreen.className).to.match(
            /i-amphtml-hidden-by-media-query/
          );
          expect(smallScreen.offsetHeight).to.not.equal(0);
          expect(largeScreen.offsetHeight).to.equal(0);
          fixture.iframe.width = 600;
          fixture.win.dispatchEvent(
            createCustomEvent(fixture.win, 'resize', null)
          );
          return fixture
            .awaitEvent(AmpEvents.LOAD_START, 4)
            .then(() => fixture.awaitEvent(AmpEvents.UNLOAD, 1))
            .then(function () {
              expect(smallScreen.className).to.match(
                /i-amphtml-hidden-by-media-query/
              );
              expect(largeScreen.className).to.not.match(
                /i-amphtml-hidden-by-media-query/
              );
              expect(smallScreen.offsetHeight).to.equal(0);
              expect(largeScreen.offsetHeight).to.not.equal(0);
            });
        });
    });

    it('should not load image if already present (inabox)', () => {
      return fixture.awaitEvent(AmpEvents.LOAD_START, 3).then(function () {
        const ampImage = fixture.doc.getElementById('img8');
        expect(ampImage).is.ok;
        expect(ampImage.querySelectorAll('img').length).to.equal(1);
      });
    });
  });

// Move IE tests into its own `describe()`
// so that we can load a different fixture.
describe
  .configure()
  .enableIe()
  .run('Rendering of amp-img', () => {
    let fixture;
    beforeEach(() => {
      return createFixtureIframe('test/fixtures/images-ie.html', 500).then(
        (f) => {
          fixture = f;
        }
      );
    });

    // IE doesn't support the srcset attribute, so if the developer
    // provides a srcset but no src to amp-img, it should set the src
    // attribute to the first entry in srcset.
    describe
      .configure()
      .ifIe()
      .run('srcset support - Internet Explorer edge cases', () => {
        it('should guarantee src if srcset is not supported', () => {
          const imageLoadedPromise = waitForImageToLoad(
            fixture.doc,
            'img[amp-img-id="srcset"]'
          );
          return imageLoadedPromise.then(() => {
            const ampImg = fixture.doc.getElementById('srcset');
            const img = ampImg.querySelector('img[amp-img-id="srcset"]');
            expect(img.getAttribute('src')).to.equal(
              '/examples/img/hero@1x.jpg'
            );
          });
        });
      });

    // IE can't scale SVG images, so intrinsic sizers use a PNG instead.
    describe
      .configure()
      .enableIe()
      .run('intrinsic layout', () => {
        it('renders intrinsic layout with correct size', () => {
          const imageLoadedPromise = waitForImageToLoad(
            fixture.doc,
            'img[amp-img-id="intrinsic"]'
          );
          return imageLoadedPromise.then(() => {
            const ampImg = fixture.doc.getElementById('intrinsic');
            const width = parseInt(ampImg.getAttribute('width'), 10);
            const height = parseInt(ampImg.getAttribute('height'), 10);
            const bounds = ampImg.getBoundingClientRect();

            expect(bounds.width / bounds.height).to.be.closeTo(
              width / height,
              0.001
            );
          });
        });
      });
  });

function waitForImageToLoad(document, selector) {
  return poll(
    'wait for img to load',
    () => {
      const img = document.querySelector(selector);
      return img !== null;
    },
    () => {},
    8000
  );
}


text:
package org.jboss.pnc.integration.Utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class AuthResource {

    public static boolean authEnabled() throws IOException {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        InputStream stream = classLoader.getResourceAsStream("auth.properties");
        Properties properties = new Properties();
        properties.load(stream);
        String value = properties.getProperty("authentication.test.enabled");
        return value.equals("true") ? true : false;
       }

}


text:
package com.b2international.snowowl.snomed.core.store;

import static com.google.common.base.Preconditions.checkState;

import java.util.UUID;

import javax.annotation.OverridingMethodsMustInvokeSuper;

import com.b2international.snowowl.core.domain.TransactionContext;
import com.b2international.snowowl.snomed.core.domain.refset.SnomedRefSetType;
import com.b2international.snowowl.snomed.datastore.SnomedRefSetUtil;
import com.b2international.snowowl.snomed.datastore.index.entry.SnomedConceptDocument;
import com.b2international.snowowl.snomed.datastore.index.entry.SnomedRefSetMemberIndexEntry;
import com.b2international.snowowl.snomed.datastore.index.entry.SnomedRefSetMemberIndexEntry.Builder;

/**
 * @since 4.5
 */
public abstract class SnomedMemberBuilder<B extends SnomedMemberBuilder<B>> extends SnomedComponentBuilder<B, SnomedRefSetMemberIndexEntry.Builder, SnomedRefSetMemberIndexEntry> {

	private String referenceSetId;
	private String referencedComponent;

	protected SnomedMemberBuilder() {
	}

	/**
	 * Specifies the referenced component ID of the new reference set member.
	 *
	 * @param referencedComponent
	 *            - the referenced component to refer to
	 * @return
	 */
	public final B withReferencedComponent(String referencedComponent) {
		this.referencedComponent = referencedComponent;
		return getSelf();
	}

	/**
	 * Specifies the reference set where this reference set member belongs.
	 *
	 * @param referenceSetId
	 *            - the identifier concept ID of the reference set
	 * @return
	 */
	public final B withRefSet(String referenceSetId) {
		this.referenceSetId = referenceSetId;
		return getSelf();
	}

	public final SnomedRefSetMemberIndexEntry addTo(TransactionContext context) {
		final SnomedRefSetMemberIndexEntry member = build(context);
		context.add(member);
		return member;
	}

	protected final String getReferencedComponentId() {
		return referencedComponent;
	}

	@Override
	protected final Builder create() {
		return SnomedRefSetMemberIndexEntry.builder();
	}

	@Override
	@OverridingMethodsMustInvokeSuper
	public void init(SnomedRefSetMemberIndexEntry.Builder component, TransactionContext context) {
		super.init(component, context);
		final SnomedConceptDocument refSet = context.lookup(referenceSetId, SnomedConceptDocument.class);
		checkState(refSet.getRefSetType() != null, "RefSet properties are missing from identifier concept document %s", referenceSetId);
		component
			.referencedComponentId(referencedComponent)
			.refsetId(referenceSetId)
			.referenceSetType(refSet.getRefSetType());

		if (refSet.getRefSetType() == SnomedRefSetType.CONCRETE_DATA_TYPE) {
			component.field(SnomedRefSetMemberIndexEntry.Fields.DATA_TYPE, SnomedRefSetUtil.getDataType(referenceSetId));
		}
	}

	@Override
	protected String generateId() {
		return UUID.randomUUID().toString();
	}

}


text:
package com.amazonaws.services.sagemaker.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Represents the JSON dataset format used when running a monitoring job.
 *

 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class MonitoringJsonDatasetFormat implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * Indicates if the file should be read as a json object per line.
     *

     */
    private Boolean line;

    /**
     *

     * Indicates if the file should be read as a json object per line.
     *

     *
     * @param line
     *        Indicates if the file should be read as a json object per line.
     */

    public void setLine(Boolean line) {
        this.line = line;
    }

    /**
     *

     * Indicates if the file should be read as a json object per line.
     *

     *
     * @return Indicates if the file should be read as a json object per line.
     */

    public Boolean getLine() {
        return this.line;
    }

    /**
     *

     * Indicates if the file should be read as a json object per line.
     *

     *
     * @param line
     *        Indicates if the file should be read as a json object per line.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public MonitoringJsonDatasetFormat withLine(Boolean line) {
        setLine(line);
        return this;
    }

    /**
     *

     * Indicates if the file should be read as a json object per line.
     *

     *
     * @return Indicates if the file should be read as a json object per line.
     */

    public Boolean isLine() {
        return this.line;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getLine() != null)
            sb.append("Line: ").append(getLine());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof MonitoringJsonDatasetFormat == false)
            return false;
        MonitoringJsonDatasetFormat other = (MonitoringJsonDatasetFormat) obj;
        if (other.getLine() == null ^ this.getLine() == null)
            return false;
        if (other.getLine() != null && other.getLine().equals(this.getLine()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getLine() == null) ? 0 : getLine().hashCode());
        return hashCode;
    }

    @Override
    public MonitoringJsonDatasetFormat clone() {
        try {
            return (MonitoringJsonDatasetFormat) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.sagemaker.model.transform.MonitoringJsonDatasetFormatMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
import unittest
from datetime import timedelta
from unittest.mock import MagicMock, patch

from airflow import DAG
from airflow.exceptions import AirflowException
from airflow.models import TaskInstance
from airflow.providers.amazon.aws.operators.emr_add_steps import EmrAddStepsOperator
from airflow.utils import timezone

DEFAULT_DATE = timezone.datetime(2017, 1, 1)

ADD_STEPS_SUCCESS_RETURN = {
    'ResponseMetadata': {
        'HTTPStatusCode': 200
    },
    'StepIds': ['s-2LH3R5GW3A53T']
}

class TestEmrAddStepsOperator(unittest.TestCase):
    # When
    _config = [{
        'Name': 'test_step',
        'ActionOnFailure': 'CONTINUE',
        'HadoopJarStep': {
            'Jar': 'command-runner.jar',
            'Args': [
                '/usr/lib/spark/bin/run-example',
                '{{ macros.ds_add(ds, -1) }}',
                '{{ ds }}'
            ]
        }
    }]

    def setUp(self):
        self.args = {
            'owner': 'airflow',
            'start_date': DEFAULT_DATE
        }

        # Mock out the emr_client (moto has incorrect response)
        self.emr_client_mock = MagicMock()

        # Mock out the emr_client creator
        emr_session_mock = MagicMock()
        emr_session_mock.client.return_value = self.emr_client_mock
        self.boto3_session_mock = MagicMock(return_value=emr_session_mock)

        self.mock_context = MagicMock()

        self.operator = EmrAddStepsOperator(
            task_id='test_task',
            job_flow_id='j-8989898989',
            aws_conn_id='aws_default',
            steps=self._config,
            dag=DAG('test_dag_id', default_args=self.args)
        )

    def test_init(self):
        self.assertEqual(self.operator.job_flow_id, 'j-8989898989')
        self.assertEqual(self.operator.aws_conn_id, 'aws_default')

    def test_render_template(self):
        ti = TaskInstance(self.operator, DEFAULT_DATE)
        ti.render_templates()

        expected_args = [{
            'Name': 'test_step',
            'ActionOnFailure': 'CONTINUE',
            'HadoopJarStep': {
                'Jar': 'command-runner.jar',
                'Args': [
                    '/usr/lib/spark/bin/run-example',
                    (DEFAULT_DATE - timedelta(days=1)).strftime("%Y-%m-%d"),
                    DEFAULT_DATE.strftime("%Y-%m-%d"),
                ]
            }
        }]

        self.assertListEqual(self.operator.steps, expected_args)

    def test_execute_returns_step_id(self):
        self.emr_client_mock.add_job_flow_steps.return_value = ADD_STEPS_SUCCESS_RETURN

        with patch('boto3.session.Session', self.boto3_session_mock):
            self.assertEqual(self.operator.execute(self.mock_context), ['s-2LH3R5GW3A53T'])

    def test_init_with_cluster_name(self):
        expected_job_flow_id = 'j-1231231234'

        self.emr_client_mock.add_job_flow_steps.return_value = ADD_STEPS_SUCCESS_RETURN

        with patch('boto3.session.Session', self.boto3_session_mock):
            with patch('airflow.providers.amazon.aws.hooks.emr.EmrHook.get_cluster_id_by_name') \
                    as mock_get_cluster_id_by_name:
                mock_get_cluster_id_by_name.return_value = expected_job_flow_id

                operator = EmrAddStepsOperator(
                    task_id='test_task',
                    job_flow_name='test_cluster',
                    cluster_states=['RUNNING', 'WAITING'],
                    aws_conn_id='aws_default',
                    dag=DAG('test_dag_id', default_args=self.args)
                )

                operator.execute(self.mock_context)

        ti = self.mock_context['ti']

        ti.xcom_push.assert_called_once_with(key='job_flow_id', value=expected_job_flow_id)

    def test_init_with_nonexistent_cluster_name(self):
        cluster_name = 'test_cluster'

        with patch('airflow.providers.amazon.aws.hooks.emr.EmrHook.get_cluster_id_by_name') \
                as mock_get_cluster_id_by_name:
            mock_get_cluster_id_by_name.return_value = None

            operator = EmrAddStepsOperator(
                task_id='test_task',
                job_flow_name=cluster_name,
                cluster_states=['RUNNING', 'WAITING'],
                aws_conn_id='aws_default',
                dag=DAG('test_dag_id', default_args=self.args)
            )

            with self.assertRaises(AirflowException) as error:
                operator.execute(self.mock_context)
            self.assertEqual(str(error.exception), f'No cluster found for name: {cluster_name}')

if __name__ == '__main__':
    unittest.main()


text:
class RenameCategoryAssignmentToCategorization < ActiveRecord::Migration
  def self.up
    rename_table :category_assignments, :categorizations
    rename_column :categorizations, :content_type, :categorizable_type
    rename_column :categorizations, :content_id, :categorizable_id
  end

  def self.down
    rename_column :categorizations, :categorizable_id, :content_id
    rename_column :categorizations, :categorizable_type, :content_type
    rename_table :categorizations, :category_assignments
  end
end


text:
package reka.jdbc;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import org.apache.commons.dbcp2.DriverManagerConnectionFactory;
import org.apache.commons.dbcp2.PoolableConnection;
import org.apache.commons.dbcp2.PoolableConnectionFactory;
import org.apache.commons.dbcp2.PoolingDataSource;
import org.apache.commons.pool2.ObjectPool;
import org.apache.commons.pool2.impl.GenericObjectPool;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import reka.data.MutableData;

public class DBCP2ConnectionProvider implements JdbcConnectionProvider {

	private final Logger log = LoggerFactory.getLogger(getClass());

	private final PoolableConnectionFactory factory;
	private final ObjectPool<PoolableConnection> pool;
	private final PoolingDataSource<PoolableConnection> ds;

	public DBCP2ConnectionProvider(String url, String username, String password, boolean poolStatements) {
		factory = new PoolableConnectionFactory(new DriverManagerConnectionFactory(url, username, password), null);
		factory.setPoolStatements(poolStatements);
		GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
		poolConfig.setMaxTotal(Runtime.getRuntime().availableProcessors() * 2);
		pool = new GenericObjectPool<>(factory, poolConfig);
		factory.setPool(pool);
		ds = new PoolingDataSource<>(pool);
	}

	@Override
	public void close() throws Exception {
		log.info("closing connection pool");
		pool.close();
	}

	@Override
	public Connection getConnection() throws SQLException {
		return ds.getConnection();
	}

	@Override
	public DataSource dataSource() {
		return ds;
	}

	@Override
	public void writeStats(MutableData data) {

		int active = pool.getNumActive();
		if (active >= 0) data.putInt("active", active);

		int idle = pool.getNumIdle();
		if (idle >= 0) data.putInt("idle", idle);

	}

	@Override
	public void finished(Connection connection) throws SQLException {
		connection.close();
	}

}


text:
// Fig. 10.5: fig10_05.cpp
// Aiming base-class and derived-class pointers at base-class
// and derived-class objects, respectively.
#include <iostream>

using std::cout;
using std::endl;
using std::fixed;

#include <iomanip>

using std::setprecision;

#include "point.h"   // Point class definition
#include "circle.h"  // Circle class definition

int main()
{
   Point point( 30, 50 );
   Point *pointPtr = 0;    // base-class pointer

   Circle circle( 120, 89, 2.7 );
   Circle *circlePtr = 0;  // derived-class pointer

   // set floating-point numeric formatting
   cout << fixed << setprecision( 2 );

   // output objects point and circle
   cout << "Print point and circle objects:"
        << "\nPoint: ";
   point.print();   // invokes Point's print
   cout << "\nCircle: ";
   circle.print();  // invokes Circle's print

   // aim base-class pointer at base-class object and print
   pointPtr = &point;
   cout << "\n\nCalling print with base-class pointer to "
        << "\nbase-class object invokes base-class print "
        << "function:\n";
   pointPtr->print();  // invokes Point's print

   // aim derived-class pointer at derived-class object
   // and print
   circlePtr = &circle;
   cout << "\n\nCalling print with derived-class pointer to "
        << "\nderived-class object invokes derived-class "
        << "print function:\n";
   circlePtr->print();  // invokes Circle's print

   // aim base-class pointer at derived-class object and print
   pointPtr = &circle;
   cout << "\n\nCalling print with base-class pointer to "
        << "derived-class object\ninvokes base-class print "
        << "function on that derived-class object\n";
   pointPtr->print();  // invokes Point's print
   cout << endl;

   return 0;

} // end main


text:
///*
// * SUMO-FC quantification
// */
//package statAlignReadsInChr;
//
//import java.io.BufferedReader;
//import java.io.File;
//import java.io.FileNotFoundException;
//import java.io.FileReader;
//import java.io.FileWriter;
//import java.io.IOException;
//import java.util.HashMap;
//import java.util.HashSet;
//import java.util.Iterator;
//import java.util.logging.Level;
//import java.util.logging.Logger;
//import net.sf.samtools.SAMFileReader;
//import net.sf.samtools.SAMRecord;
//
///**
// *
// * @author ZHAO Qi
// * @date 2015-2-4 16:04:13
// * @version 1.6.0
// */
//public class StatAlignReadsInChr {
//
//    private HashSet<String> nameset = new HashSet<String>();
//    private HashMap<String,ChrOutTerm> outmap=new HashMap<String,ChrOutTerm>();
//    private String outfile;
//    private SAMFileReader sr;
//    private BufferedReader br;
//    private String gfffile;
//
//    public StatAlignReadsInChr(String bamfile, String gfffile,String outfile) throws FileNotFoundException, IOException {
//        sr = new SAMFileReader(new File(bamfile));
//        this.outfile = outfile;
//        this.gfffile=gfffile;
//        this.intialOutmap();
//        this.processBam();
//        this.write();
//        sr.close();
//    }
//     public StatAlignReadsInChr(String samfile, String gfffile,String outfile,String issam) throws FileNotFoundException, IOException {
//         br = new BufferedReader(new FileReader(new File(samfile)));
//        this.outfile = outfile;
//        this.gfffile=gfffile;
//        this.intialOutmap();
//        this.processSam();
//        this.write();
//    }
//
//    public void intialOutmap() throws FileNotFoundException, IOException{
//        BufferedReader br = new BufferedReader(new FileReader(new File(gfffile)));
//        String tempstr="";
//        while (br.ready()) {
//            tempstr=br.readLine().trim().split("\t")[0];
//            if(nameset.add(tempstr)){
//               ChrOutTerm ct=new ChrOutTerm(tempstr);
//               outmap.put(tempstr, ct);
//            }
//        }
//        br.close();
//    }
//    public void processBam() {
//        String tempchr;
//        for (Iterator it = sr.iterator(); it.hasNext();) {
//            SAMRecord sam=(SAMRecord) it.next();
//            if (!sam.getReadUnmappedFlag()) {
//                tempchr=sam.getReferenceName();
//               outmap.get(tempchr).addCount();
//            }
//        }
//    }
//
//    public void processSam() throws IOException {
//        String tempchr;
//        while (br.ready()) {
//            String temstr=br.readLine();
//            if(!temstr.startsWith("@SQ")){
//               tempchr=temstr.split("\t")[2];
//               outmap.get(tempchr).addCount();
//            }
//        }
//        br.close();
//
//    }
//
//    public void write(){
//        try {
//            FileWriter fw = new FileWriter(outfile);
//            for (Iterator it = nameset.iterator(); it.hasNext();) {
//                String str=(String)it.next();
//                fw.append(outmap.get(str).toString()+"\r\n");
//            }
//            fw.flush();
//            fw.close();
//        } catch (IOException ex) {
//            Logger.getLogger(StatAlignReadsInChr.class.getName()).log(Level.SEVERE, null, ex);
//        }
//    }
//
//    public static void main(String[] args) throws IOException {
//        new StatAlignReadsInChr("F:\\resouces\\projects\\SUMO-FC\\S1C_TATA_mapped.sam","F:\\resouces\\projects\\SUMO-FC\\humanorfForHtseq.gff","F:\\resouces\\projects\\SUMO-FC\\count.result","true");
//    }
//}


text:
<wicket:extend xmlns:wicket="http://www.w3.org/1999/xhtml">
    <div wicket:id="tablePanel" class="classes-table-panel"></div>
</wicket:extend>


text:
<?php
/** @author Andrei Baibaratsky */

class MailgunListMember implements MailgunObject
{
    private $_address;
    private $_name;
    private $_vars = array();
    private $_isSubscribed;

    /**
     * @param array $data
     * @return MailgunListMember
     */
    public static function load($data)
    {
        $member = new self($data['address'], $data['name']);
        $member->setIsSubscribed($data['subscribed']);

        foreach ($data['vars'] as $name => $value) {
            $member->addVar($name, $value);
        }

        return $member;
    }

    /**
     * @param string $address
     * @param string $name
     */
    public function __construct($address, $name = null)
    {
        $this->_address = $address;
        $this->_name = $name;
    }

    /**
     * @return array POST-data for Mailgun API request
     */
    public function getPostData()
    {
        $data = array(
            'address' => $this->_address,
        );

        if (!empty($this->_name)) {
            $data['name'] = $this->_name;
        }
        if (!empty($this->_vars)) {
            $data['vars'] = json_encode($this->_vars);
        }
        if (isset($this->_isSubscribed)) {
            $data['subscribed'] = $this->_isSubscribed ? 'yes' : 'no';
        }

        return $data;
    }

    /**
     * @param string $address
     */
    public function setAddress($address)
    {
        $this->_address = $address;
    }

    /**
     * @return string
     */
    public function getAddress()
    {
        return $this->_address;
    }

    /**
     * @param string $name
     */
    public function setName($name)
    {
        $this->_name = $name;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->_name;
    }

    /**
     * Append a custom variable
     * @param string $name  Variable name
     * @param string $value Variable value
     */
    public function addVar($name, $value)
    {
        $this->_vars[$name] = $value;
    }

    /**
     * @return array List of attached variables in 'name' => 'value' format
     */
    public function getVars()
    {
        return $this->_vars;
    }

    /**
     * @param mixed $isSubscribed
     */
    public function setIsSubscribed($isSubscribed)
    {
        $this->_isSubscribed = $isSubscribed;
    }

    /**
     * @return mixed
     */
    public function getIsSubscribed()
    {
        return $this->_isSubscribed;
    }
}


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

using SharpDX.Mathematics.Interop;

namespace SharpDX.Direct2D1.Effects
{
    /// <summary>
    /// Built in ColorMatrix effect.
    /// </summary>
    public class ColorMatrix : Effect
    {
        /// <summary>
        /// Initializes a new instance of <see cref="ColorMatrixEffect"/> effect.
        /// </summary>
        /// <param name="context"></param>
        public ColorMatrix(DeviceContext context) : base(context, Effect.ColorMatrix)
        {
        }

        /// <summary>
        /// A 5x4 matrix of float values. The elements in the matrix are not bounded and are unitless.
        /// The default is the identity matrix.
        /// </summary>
        public RawMatrix5x4 Matrix
        {
            get
            {
                return GetMatrix5x4Value((int)ColorMatrixProperties.ColorMatrix);
            }
            set
            {
                SetValue((int)ColorMatrixProperties.ColorMatrix, value);
            }
        }

        /// <summary>
        /// The alpha mode of the output. This can be either premultiplied or straight. See Alpha modes for more info.
        /// </summary>
        public AlphaMode AlphaMode
        {
            get
            {
                return GetEnumValue<AlphaMode>((int)ColorMatrixProperties.AlphaMode);
            }
            set
            {
                SetEnumValue((int)ColorMatrixProperties.AlphaMode, value);
            }
        }

        /// <summary>
        /// Whether the effect clamps color values to between 0 and 1 before the effect passes the values to the next effect in the graph. The effect clamps the values before it premultiplies the alpha .
        /// if you set this to TRUE the effect will clamp the values.
        /// If you set this to FALSE, the effect will not clamp the color values, but other effects and the output surface may clamp the values if they are not of high enough precision.
        /// </summary>
        public bool ClampOutput
        {
            get
            {
                return GetBoolValue((int)ColorMatrixProperties.ClampOutput);
            }
            set
            {
                SetValue((int)ColorMatrixProperties.ClampOutput, value);
            }
        }
    }
}


text:
copyright:
 years: 2015, 2017

---

{:new_window: target="_blank"}
{:shortdesc: .shortdesc}
{:screen:.screen}
{:codeblock:.codeblock}

# 対話式通知とサイレント通知
{: #interactive-notifications}
最終更新日: 2017 年 3 月 3 日
{: .last-updated}

対話式通知により、ユーザーはアプリケーションを開かずに通知に応答することができます。対話式通知が到着すると、デバイスは通知メッセージとともにアクション・ボタンを表示します。対話式通知は、バージョン 8 以降の iOS デバイスでサポートされています。バージョン 8 より前の iOS デバイスに送信された対話式通知については、通知アクションは表示されません。

## 対話式通知の送信
{: #send_interactive_notifications}

対話式通知は、Push ダッシュボードを使用するか、[REST API 資料](t_restapi.html)を参照して、送信できます。

{{site.data.keyword.mobilepushshort}} コンソールから以下を実行します。

1. Push ダッシュボードの通知タブで、**「通知の送信」**をクリックします。
2. 通知の受信側を選択して、**「次へ」**をクリックします。
3. 「通知の作成」ページで、「タイプ」を「デフォルト」または「混合」のいずれかに設定し、「詳細オプション」タブの下で「カテゴリー」値を指定することで、対話式プッシュを送信できます。クライアント上でカテゴリー値を構成するには、ネイティブ iOS アプリケーション・セクションで**「対話式{{site.data.keyword.mobilepushshort}}の処理 (Handling interactive {{site.data.keyword.mobilepushshort}})」**にチェック・マークを付けます。

## iOS アプリケーションでの対話式通知の処理
{: #send_interactive_notifications_ios}

### Swift
{: #send_interactive_notifications_ios_swift}

対話式通知を受け取るには、以下の手順を実行します。

1. リモート通知の受信時にバックグラウンド・タスクを実行するアプリケーション機能を使用可能にします。
1. アクション・カテゴリーで `BMSPush` SDK を初期化します。
	```
	let myBMSClient = BMSClient.sharedInstance
	myBMSClient.initialize(bluemixRegion: BMSClient.Region.usSouth)
	let push =  BMSPushClient.sharedInstance
    let actionOne = BMSPushNotificationAction(identifierName: "FIRST", buttonTitle: "Accept", isAuthenticationRequired: false, defineActivationMode: UIUserNotificationActivationMode.background)
   	let actionTwo = BMSPushNotificationAction(identifierName: "SECOND", buttonTitle: "Reject", isAuthenticationRequired: false, defineActivationMode: UIUserNotificationActivationMode.background)
   	let category = BMSPushNotificationActionCategory(identifierName: "category", buttonActions: [actionOne, actionTwo])
   	let notifOptions = BMSPushClientOptions(categoryName: [category])
	push.initializeWithAppGUID(appGUID: "YOUR_APP_GUID", clientSecret:"YOUR_APP_CLIENT_SECRET", options: notifOptions)
	```
		{: codeblock}

1. 以下のように、AppDelegate に新しいコールバック・メソッドを実装します。
	```
	 func userNotificationCenter(_ center: UNUserNotificationCenter,
       didReceive response: UNNotificationResponse,
       withCompletionHandler completionHandler: @escaping () -> Void) {
            switch response.actionIdentifier {
		    case "FIRST":
		      print("FIRST")
		    case "SECOND":
		      print("SECOND")
		    default:
		      print("Unknown action")
		    }
		completionHandler
	}
	```
	{: codeblock}
5. ユーザーがアクション・ボタンをクリックすると、この新しいコールバック・メソッドが呼び出されます。このメソッドの実装では、指定の ID に関連付けられたタスクを行い、`completionHandler` パラメーター内のブロックを実行する必要があります。

### Cordova
{: #send_interactive_notifications_ios_cordova}

Cordova iOS アプリケーションで要アクション通知を取得するには、以下のステップを実行します。

1. `BMSPush.initialize` メソッド内にカテゴリー・フィールドを追加します。
   ```
	var category =  {"Category_Name":[{"IdentifierName_1":"actionName_1"},{"IdentifierName_2":"actionName_2"}]}
       BMSPush.initialize(appGUID,clientSecret,category);
    ```
	{: codeblock}
2. AppDelegate に新しいコールバック・メソッドを実装します。
3. ユーザーがアクション・ボタンをクリックすると、この新しいコールバック・メソッドが呼び出されます。このメソッドの実装は、指定された ID に関連付けられたタスクを実行し、completionHandler パラメーターでブロックを実行する必要があります。

## iOS のサイレント通知の処理
{: #send_silent_notifications_for_ios}

サイレント通知は、デバイスの画面に表示されません。これらの通知は、アプリケーションがバックグラウンドで受け取ります。その結果、アプリケーションは最大で 30 秒までウェイク状態になり、指定されたバックグラウンド・タスクを実行します。ユーザーは、この通知の着信に気付かない可能性があります。iOS のサイレント通知を送信するには、[REST API ![外部リンク・アイコン](../../icons/launch-glyph.svg "外部リンク・アイコン")](https://mobile.{DomainName}/imfpush/){: new_window}を使用します。

1. サイレント・プッシュ通知を送信するには、プロジェクトの `appDelegate.m` ファイルで以下のメソッドを実装します。Swift では、サーバーから送信される、サイレント通知の `contentAvailable` 値は 1 になります。
```
//For Swift
	 func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
       let contentAPS = userInfo["aps"] as [NSObject : AnyObject]
       if let contentAvailable = contentAPS["content-available"] as? Int {
           //silent or mixed push
           if contentAvailable == 1 {
               completionHandler(UIBackgroundFetchResult.NewData)
           } else {
               completionHandler(UIBackgroundFetchResult.NoData)
           }
       } else {
    //Default notification
           completionHandler(UIBackgroundFetchResult.NoData)
       }
    }
```
	{: codeblock}


text:
<?php

namespace Twig\Tests\Profiler\Dumper;

use Twig\Profiler\Dumper\HtmlDumper;

class HtmlTest extends AbstractTest
{
    public function testDump()
    {
        $dumper = new HtmlDumper();
        $this->assertStringMatchesFormat(<<<EOF

main %d.%dms/%d%
└ index.twig %d.%dms/%d%
  └ embedded.twig::block(body)
  └ embedded.twig
  │ └ included.twig
  └ index.twig::macro(foo)
  └ embedded.twig
    └ included.twig

EOF
        , $dumper->dump($this->getProfile()));
    }
}


text:
using System.Runtime.Serialization;

namespace System.Runtime
{
    [Serializable]
    [System.Runtime.CompilerServices.TypeForwardedFrom("System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
    public sealed class AmbiguousImplementationException : Exception
    {
        public AmbiguousImplementationException()
            : base(SR.AmbiguousImplementationException_NullMessage)
        {
            HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
        }

        public AmbiguousImplementationException(string? message)
            : base(message)
        {
            HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
        }

        public AmbiguousImplementationException(string? message, Exception? innerException)
            : base(message, innerException)
        {
            HResult = HResults.COR_E_AMBIGUOUSIMPLEMENTATION;
        }

        private AmbiguousImplementationException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}


text:
ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['stableinterface'],
                    'supported_by': 'community'}

DOCUMENTATION = '''
---
module: cs_zone_facts
short_description: Gathering facts of zones from Apache CloudStack based clouds.
description:
  - Gathering facts from the API of a zone.
  - Sets Ansible facts accessable by the key C(cloudstack_zone) and since version 2.6 also returns results.
version_added: '2.1'
author: René Moser (@resmo)
options:
  name:
    description:
      - Name of the zone.
    type: str
    required: true
    aliases: [ zone ]
extends_documentation_fragment: cloudstack
'''

EXAMPLES = '''
- name: Gather facts from a zone
  cs_zone_facts:
    name: ch-gva-1
  register: zone
  delegate_to: localhost

- name: Show the returned results of the registered variable
  debug:
    var: zone

- name: Show the facts by the ansible_facts key cloudstack_zone
  debug:
    var: cloudstack_zone
'''

RETURN = '''
---
id:
  description: UUID of the zone.
  returned: success
  type: str
  sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6
name:
  description: Name of the zone.
  returned: success
  type: str
  sample: zone01
dns1:
  description: First DNS for the zone.
  returned: success
  type: str
  sample: 8.8.8.8
dns2:
  description: Second DNS for the zone.
  returned: success
  type: str
  sample: 8.8.4.4
internal_dns1:
  description: First internal DNS for the zone.
  returned: success
  type: str
  sample: 8.8.8.8
internal_dns2:
  description: Second internal DNS for the zone.
  returned: success
  type: str
  sample: 8.8.4.4
dns1_ipv6:
  description: First IPv6 DNS for the zone.
  returned: success
  type: str
  sample: "2001:4860:4860::8888"
dns2_ipv6:
  description: Second IPv6 DNS for the zone.
  returned: success
  type: str
  sample: "2001:4860:4860::8844"
allocation_state:
  description: State of the zone.
  returned: success
  type: str
  sample: Enabled
domain:
  description: Domain the zone is related to.
  returned: success
  type: str
  sample: ROOT
network_domain:
  description: Network domain for the zone.
  returned: success
  type: str
  sample: example.com
network_type:
  description: Network type for the zone.
  returned: success
  type: str
  sample: basic
local_storage_enabled:
  description: Local storage offering enabled.
  returned: success
  type: bool
  sample: false
securitygroups_enabled:
  description: Security groups support is enabled.
  returned: success
  type: bool
  sample: false
guest_cidr_address:
  description: Guest CIDR address for the zone
  returned: success
  type: str
  sample: 10.1.1.0/24
dhcp_provider:
  description: DHCP provider for the zone
  returned: success
  type: str
  sample: VirtualRouter
zone_token:
  description: Zone token
  returned: success
  type: str
  sample: ccb0a60c-79c8-3230-ab8b-8bdbe8c45bb7
tags:
  description: List of resource tags associated with the zone.
  returned: success
  type: dict
  sample: [ { "key": "foo", "value": "bar" } ]
'''

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.cloudstack import (
    AnsibleCloudStack,
    cs_argument_spec,
)

class AnsibleCloudStackZoneFacts(AnsibleCloudStack):

    def __init__(self, module):
        super(AnsibleCloudStackZoneFacts, self).__init__(module)
        self.returns = {
            'dns1': 'dns1',
            'dns2': 'dns2',
            'internaldns1': 'internal_dns1',
            'internaldns2': 'internal_dns2',
            'ipv6dns1': 'dns1_ipv6',
            'ipv6dns2': 'dns2_ipv6',
            'domain': 'network_domain',
            'networktype': 'network_type',
            'securitygroupsenabled': 'securitygroups_enabled',
            'localstorageenabled': 'local_storage_enabled',
            'guestcidraddress': 'guest_cidr_address',
            'dhcpprovider': 'dhcp_provider',
            'allocationstate': 'allocation_state',
            'zonetoken': 'zone_token',
        }

    def get_zone(self):
        return super(AnsibleCloudStackZoneFacts, self).get_zone()

def main():
    argument_spec = cs_argument_spec()
    argument_spec.update(dict(
        zone=dict(required=True, aliases=['name']),
    ))

    module = AnsibleModule(
        argument_spec=argument_spec,
        supports_check_mode=True,
    )

    acs_zone_facts = AnsibleCloudStackZoneFacts(module=module)
    result = acs_zone_facts.get_result_and_facts(
        facts_name='cloudstack_zone',
        resource=acs_zone_facts.get_zone()
    )
    module.exit_json(**result)

if __name__ == '__main__':
    main()


text:
package ru.stqa.pft.addressbook.tests;

import org.hamcrest.CoreMatchers;
import org.hamcrest.MatcherAssert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import ru.stqa.pft.addressbook.model.ContactData;

import java.util.Arrays;
import java.util.stream.Collectors;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

public class ContactPhoneTests extends TestBase {

    @BeforeMethod
    public void ensurePreconditions() {
        app.goTo().ContactPage();
        if (app.contact().all().size() == 0) {
            app.contact().create(new ContactData()
                    .withContactFirstName("ilya_test").withContactLastName("ilya_test")
                    .withContactHomePhone("111").withContactMobilePhone("222").withContactWorkPhone("333")
                    .withContactEmail("ilya@test").withContactEmail2("vasya@yandex.ru").withContactEmail3("alex@mail.ru")
                    .withContactAddress("Russia, Ryazan"));
        }
    }

    @Test
    public void testContactPhones() {
        app.goTo().gotoToHomePage();
        ContactData contact = app.contact().all().iterator().next();
        ContactData contactInfoFromEditForm = app.contact().infoFromEditForm(contact);

        assertThat(contact.getAllPhones(), equalTo(mergePhones(contactInfoFromEditForm)));
    }

    private String mergePhones(ContactData contact) {
        return Arrays.asList(contact.getContactHomePhone(), contact.getContactMobilePhone(), contact.getContactWorkPhone())
                .stream().filter((s) -> ! s.equals(""))
                .map(ContactPhoneTests::cleaned)
                .collect(Collectors.joining("\n"));
    }

    public static String cleaned(String phone) {
        return phone.replaceAll("\\s", "").replaceAll("[-()]", "");
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.wearable.view.BoxInsetLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="umich.cse.yctung.wear.MainActivity"
    tools:deviceIds="wear">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="10dp"
        android:background="@color/blue"
        app:layout_box="all">

        <TextView
            android:id="@+id/textDebug"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="debug info:"
            app:layout_box="all"/>

        <TextView
            android:id="@+id/textInfo"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Info.........................."
            android:textColor="@color/black"
            android:layout_gravity="center"
            app:layout_box="all"/>

        <ImageButton
            android:id="@+id/buttonSetting"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@mipmap/ic_setting"
            android:background="?android:selectableItemBackground"
            android:layout_gravity="bottom|start"
            app:layout_box="all"
            />

        <Button
            android:id="@+id/buttonStart"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:text="Start"
            app:layout_box="all"
            />

    </FrameLayout>

</android.support.wearable.view.BoxInsetLayout>


text:
from uuid import uuid4

from .constants import WSU_NS

def ns(namespace, tagname):
    return '{%s}%s' % (namespace, tagname)

ID_ATTR = ns(WSU_NS, 'Id')

def get_unique_id():
    return 'id-{0}'.format(uuid4())

def ensure_id(node):
    """Ensure given node has a wsu:Id attribute; add unique one if not.

    Return found/created attribute value.

    """
    id_val = node.get(ID_ATTR)
    if not id_val:
        id_val = get_unique_id()
        node.set(ID_ATTR, id_val)
    return id_val


text:
<!doctype html>

  <title>Tutorial: Subtractive Synth | MOTW 2015</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <link rel="import" href="assets/motw-doc-header.html">

Subtractive Synth

Theremin

A simple subtractive monophonic synth with the filter control.

Press keys to change the pitch: [ a, w, s, e, d, f, t, g, y, h, j, k ]

For example: play k j d h g a s d f

    <spiral-knob id="k-vib-rate" label="Vib Rate" value="7.5" min-value="0.1" max-value="20"></spiral-knob>
    <spiral-knob id="k-vib-amt" label="Vib Amt" value="25" min-value="5" max-value="30"></spiral-knob>
    <spiral-knob id="k-freq-bpf" label="Passband" value="1532" min-value="60" max-value="5000"></spiral-knob>
    <spiral-knob id="k-width-bpf" label="Width" value="1.37" min-value="0.1" max-value="2"></spiral-knob>
    <spiral-knob id="k-freq-lpf" label="Cutoff" value="587" min-value="60" max-value="1000"></spiral-knob>
    <spiral-knob id="k-reso-lpf" label="Reso" value="9.8" min-value="0.1" max-value="20"></spiral-knob>
    <spiral-knob id="k-amp" label="Amp" value="0.8" min-value="0.0" max-value="1.0"></spiral-knob>


text:
package com.yellow5a5.sample;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.yellow5a5.crashanalysis.activity.UmbrellaCorporationActivity;

public class MainActivity extends AppCompatActivity {

    private Button mBtn1;
    private Button mBtn2;
    private Button mBtn3;

    private int flag;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mBtn1 = (Button) findViewById(R.id.demo_btn1);
        mBtn2 = (Button) findViewById(R.id.demo_btn2);
        mBtn3 = (Button) findViewById(R.id.demo_btn3);

        Log.e(MainActivity.class.getName(), "onCreate: MainActivity");
        initListener();

    }

    private void initListener() {
        mBtn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                Thread subThread = new Thread(new Runnable() {
//                    @Override
//                    public void run() {
                        throw new ArrayIndexOutOfBoundsException();
//                    }
//                });
//                CrashAnalysisCenter.getInstance().setTarget(subThread);
//                subThread.start();
            }
        });

        mBtn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });

        mBtn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent intent = new Intent(MainActivity.this, UmbrellaCorporationActivity.class);
                startActivity(intent);
            }
        });
    }
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/monitoring/v3/alert.proto

namespace Google\Cloud\Monitoring\V3;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A content string and a MIME type that describes the content string's
 * format.
 *
 * Generated from protobuf message google.monitoring.v3.AlertPolicy.Documentation
 */
class AlertPolicy_Documentation extends \Google\Protobuf\Internal\Message
{
    /**
     * The text of the documentation, interpreted according to `mime_type`.
     * The content may not exceed 8,192 Unicode characters and may not exceed
     * more than 10,240 bytes when encoded in UTF-8 format, whichever is
     * smaller.
     *
     * Generated from protobuf field string content = 1;
     */
    private $content = '';
    /**
     * The format of the `content` field. Presently, only the value
     * `"text/markdown"` is supported. See
     * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information.
     *
     * Generated from protobuf field string mime_type = 2;
     */
    private $mime_type = '';

    public function __construct() {
        \GPBMetadata\Google\Monitoring\V3\Alert::initOnce();
        parent::__construct();
    }

    /**
     * The text of the documentation, interpreted according to `mime_type`.
     * The content may not exceed 8,192 Unicode characters and may not exceed
     * more than 10,240 bytes when encoded in UTF-8 format, whichever is
     * smaller.
     *
     * Generated from protobuf field string content = 1;
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * The text of the documentation, interpreted according to `mime_type`.
     * The content may not exceed 8,192 Unicode characters and may not exceed
     * more than 10,240 bytes when encoded in UTF-8 format, whichever is
     * smaller.
     *
     * Generated from protobuf field string content = 1;
     * @param string $var
     * @return $this
     */
    public function setContent($var)
    {
        GPBUtil::checkString($var, True);
        $this->content = $var;

        return $this;
    }

    /**
     * The format of the `content` field. Presently, only the value
     * `"text/markdown"` is supported. See
     * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information.
     *
     * Generated from protobuf field string mime_type = 2;
     * @return string
     */
    public function getMimeType()
    {
        return $this->mime_type;
    }

    /**
     * The format of the `content` field. Presently, only the value
     * `"text/markdown"` is supported. See
     * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information.
     *
     * Generated from protobuf field string mime_type = 2;
     * @param string $var
     * @return $this
     */
    public function setMimeType($var)
    {
        GPBUtil::checkString($var, True);
        $this->mime_type = $var;

        return $this;
    }

}


text:
package com.amazonaws.services.ecr.model;

import java.io.Serializable;

/**
 *
 */
public class GetDownloadUrlForLayerResult implements Serializable, Cloneable {

    /**
     *

     * The pre-signed Amazon S3 download URL for the requested layer.
     *

     */
    private String downloadUrl;
    /**
     *

     * The digest of the image layer to download.
     *

     */
    private String layerDigest;

    /**
     *

     * The pre-signed Amazon S3 download URL for the requested layer.
     *

     *
     * @param downloadUrl
     *        The pre-signed Amazon S3 download URL for the requested layer.
     */
    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    /**
     *

     * The pre-signed Amazon S3 download URL for the requested layer.
     *

     *
     * @return The pre-signed Amazon S3 download URL for the requested layer.
     */
    public String getDownloadUrl() {
        return this.downloadUrl;
    }

    /**
     *

     * The pre-signed Amazon S3 download URL for the requested layer.
     *

     *
     * @param downloadUrl
     *        The pre-signed Amazon S3 download URL for the requested layer.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public GetDownloadUrlForLayerResult withDownloadUrl(String downloadUrl) {
        setDownloadUrl(downloadUrl);
        return this;
    }

    /**
     *

     * The digest of the image layer to download.
     *

     *
     * @param layerDigest
     *        The digest of the image layer to download.
     */
    public void setLayerDigest(String layerDigest) {
        this.layerDigest = layerDigest;
    }

    /**
     *

     * The digest of the image layer to download.
     *

     *
     * @return The digest of the image layer to download.
     */
    public String getLayerDigest() {
        return this.layerDigest;
    }

    /**
     *

     * The digest of the image layer to download.
     *

     *
     * @param layerDigest
     *        The digest of the image layer to download.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public GetDownloadUrlForLayerResult withLayerDigest(String layerDigest) {
        setLayerDigest(layerDigest);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDownloadUrl() != null)
            sb.append("DownloadUrl: " + getDownloadUrl() + ",");
        if (getLayerDigest() != null)
            sb.append("LayerDigest: " + getLayerDigest());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof GetDownloadUrlForLayerResult == false)
            return false;
        GetDownloadUrlForLayerResult other = (GetDownloadUrlForLayerResult) obj;
        if (other.getDownloadUrl() == null ^ this.getDownloadUrl() == null)
            return false;
        if (other.getDownloadUrl() != null
                && other.getDownloadUrl().equals(this.getDownloadUrl()) == false)
            return false;
        if (other.getLayerDigest() == null ^ this.getLayerDigest() == null)
            return false;
        if (other.getLayerDigest() != null
                && other.getLayerDigest().equals(this.getLayerDigest()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime
                * hashCode
                + ((getDownloadUrl() == null) ? 0 : getDownloadUrl().hashCode());
        hashCode = prime
                * hashCode
                + ((getLayerDigest() == null) ? 0 : getLayerDigest().hashCode());
        return hashCode;
    }

    @Override
    public GetDownloadUrlForLayerResult clone() {
        try {
            return (GetDownloadUrlForLayerResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}


text:
using Newtonsoft.Json;

namespace LAM.BotFramework.Entities
{
    /// <summary>
    /// Main Object for question structure
    /// Revised LAM 22.03
    /// </summary>
    public class QuestionRow
    {
        [JsonProperty("q")]
        public string QuestionText { get; set; }
        [JsonProperty("type")]
        public string QuestionType { get; set; } //Text, Message, MessageEnd, LUIS, QnAMaker, Integer
        [JsonProperty("max")]
        public string Max { get; set; } //Max for Integer/Numbers
        [JsonProperty("options")]
        public string Options { get; set; } //JSON format or....
        [JsonProperty("nextq")]
        public string NextQ { get; set; } //{intent:'Yes', nextq:'6'},{intent:'No', nextq:'7'}
        [JsonProperty("node")]
        public string NodeName { get; set; } //Node Name = Variable Name
        [JsonProperty("sub")]
        public string Sub { get; set; }  //subroutine that the node belogs to
        [JsonProperty("langdet")]
        public string LangDet { get; set; } //allow language detection on this node
        [JsonProperty("bypass")]
        public string BypassNode { get; set; } //bypass this node if variable with NodeName already exists
    }
}


text:
package com.equalexperts.fb;

import java.util.stream.Collectors;
import java.util.stream.IntStream;

class FizzBuzzCalculator {
  static String evaluate(final int min, final int max) {
    return IntStream.rangeClosed(min, max)
        .mapToObj(FizzBuzzCalculator::evaluate)
        .collect(Collectors.joining(" "));
  }

  private static String evaluate(final int fizzBuzz) {
    final String stringFizzBuzz = String.valueOf(fizzBuzz);

    if (isLucky(stringFizzBuzz)) {
      return "lucky";
    } else if (isFizz(fizzBuzz) && isBuzz(fizzBuzz)) {
      return "fizzbuzz";
    } else if (isFizz(fizzBuzz)) {
      return "fizz";
    } else if (isBuzz(fizzBuzz)) {
      return "buzz";
    } else {
      return stringFizzBuzz;
    }
  }

  private static boolean isLucky(final String fizzBuzz) {
    return fizzBuzz.contains("3");
  }

  private static boolean isFizz(final int fizzBuzz) {
    return isDivisibleBy(fizzBuzz, 3);
  }

  private static boolean isBuzz(final int fizzBuzz) {
    return isDivisibleBy(fizzBuzz, 5);
  }

  private static boolean isDivisibleBy(final int dividend, final int divisor) {
    return dividend % divisor == 0;
  }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

$form = ActiveForm::begin([
    'action' => '/tour/change-plugins/?id=' .$tour->id,
    'enableClientValidation' => false]);
?>

Плагины

    <?php
    foreach ($plugins as $plugin):

        $checked = in_array($plugin->id, $existPluginIds) ? true : false;
        $checkedAttr = $checked ? 'checked="checked"' : '';

        ?>
        <input type="checkbox" name="TourPlugin[<?= $plugin->id ?>]" <?= $checkedAttr ?> ><span<?= $checked ? ' style="font-weight: bold;"' : '' ?>><?= $plugin->name ?>

    <?php endforeach; ?>

            <a href="<?= $this->referer ?>" class="btn-smart btn-large">Отмена
            <?= Html::submitButton('Сохранить', ['class' => 'btn-smart btn-large btn-smart-blue event-create-spin']) ?>

 <?php ActiveForm::end(); ?>


text:
<!doctype html>

    <meta charset="utf-8">

    <title>amp-story share menu visual diff</title>
    <meta name="viewport"
          content="width=device-width,minimum-scale=1,initial-scale=1">
    <link rel="canonical" href="./share-menu.html">

    <amp-story standalone publisher="AMP Team" title="Visual Diff Test"
        publisher-logo-src="/examples/visual-tests/photos/120.png"
        poster-portrait-src="/examples/visual-tests/picsum.photos/image981_900x1600.jpg"
        poster-landscape-src="/examples/visual-tests/picsum.photos/image981_1600x900.jpg"
        poster-square-src="/examples/visual-tests/picsum.photos/image981_1600x1600.jpg">

      <amp-story-page id="cover">
        <amp-story-grid-layer template="fill">
          <amp-img layout="fill" src="/examples/visual-tests/picsum.photos/image981_1600x900.jpg" width="3" height="5">
          </amp-img>
        </amp-story-grid-layer>
        <amp-story-grid-layer template="vertical">

مرحبا بالعالم

        </amp-story-grid-layer>
      </amp-story-page>
      <amp-story-social-share layout="nodisplay">

      </amp-story-social-share>
    </amp-story>


text:
from __future__ import absolute_import

import six

from django.core.urlresolvers import reverse
from exam import fixture

from sentry.models import ProjectStatus, UserOption, UserOptionValue
from sentry.testutils import TestCase

class NotificationSettingsTest(TestCase):
    @fixture
    def path(self):
        return reverse('sentry-account-settings-notifications')

    def params(self, without=()):
        params = {
            'alert_email': 'foo@example.com',
        }
        return dict((k, v) for k, v in six.iteritems(params) if k not in without)

    def test_requires_authentication(self):
        self.assertRequiresAuthentication(self.path)

    def test_renders_with_required_context(self):
        user = self.create_user('foo@example.com')
        organization = self.create_organization()
        team = self.create_team(organization=organization)
        project = self.create_project(organization=organization, team=team)
        team2 = self.create_team(organization=organization)
        self.create_project(
            organization=organization, team=team, status=ProjectStatus.PENDING_DELETION
        )
        self.create_project(organization=organization, team=team2)
        self.create_member(organization=organization, user=user, teams=[project.team])
        self.login_as(user)
        resp = self.client.get(self.path)
        assert resp.status_code == 200
        self.assertTemplateUsed('sentry/account/notifications.html')
        assert 'form' in resp.context
        assert 'settings_form' in resp.context
        assert 'reports_form' in resp.context
        assert len(resp.context['project_forms']) == 1

    def test_valid_params(self):
        self.login_as(self.user)

        params = self.params()

        resp = self.client.post(self.path, params)
        assert resp.status_code == 302

        options = UserOption.objects.get_all_values(user=self.user)

        assert options.get('alert_email') == 'foo@example.com'

    def test_can_change_workflow(self):
        self.login_as(self.user)

        resp = self.client.post(self.path, {
            'workflow_notifications': '1',
        })
        assert resp.status_code == 302

        options = UserOption.objects.get_all_values(user=self.user)

        assert options.get('workflow:notifications') == '0'

        resp = self.client.post(self.path, {
            'workflow_notifications': '',
        })
        assert resp.status_code == 302

        options = UserOption.objects.get_all_values(user=self.user)

        assert options.get('workflow:notifications') == \
            UserOptionValue.participating_only

    def test_can_change_subscribe_by_default(self):
        self.login_as(self.user)

        resp = self.client.post(self.path, {
            'subscribe_by_default': '1',
        })
        assert resp.status_code == 302

        options = UserOption.objects.get_all_values(user=self.user)

        assert options.get('subscribe_by_default') == '1'

    def test_can_disable_reports(self):
        self.login_as(self.user)

        org1 = self.create_organization(name='foo', owner=self.user)
        org2 = self.create_organization(name='bar', owner=self.user)

        resp = self.client.post(self.path, {
            'reports-organizations': org1.id,
        })
        assert resp.status_code == 302

        options = UserOption.objects.get_all_values(user=self.user)

        disabled_orgs = set(options.get('reports:disabled-organizations', []))
        assert org1.id not in disabled_orgs
        assert org2.id in disabled_orgs


text:
package retrystrategy_test

import (
	"errors"

	. "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/ginkgo"
	. "github.com/cloudfoundry/bosh-utils/internal/github.com/onsi/gomega"

	boshlog "github.com/cloudfoundry/bosh-utils/logger"

	. "github.com/cloudfoundry/bosh-utils/retrystrategy"
)

var _ = Describe("AttemptRetryStrategy", func() {
	var (
		logger boshlog.Logger
	)

	BeforeEach(func() {
		logger = boshlog.NewLogger(boshlog.LevelNone)
	})

	Describe("Try", func() {
		Context("when there are errors during a try", func() {
			It("retries until the max attempts are used up", func() {
				retryable := newSimpleRetryable([]attemptOutput{
					{
						IsRetryable: true,
						AttemptErr:  errors.New("first-error"),
					},
					{
						IsRetryable: true,
						AttemptErr:  errors.New("second-error"),
					},
					{
						IsRetryable: true,
						AttemptErr:  errors.New("third-error"),
					},
				})
				attemptRetryStrategy := NewAttemptRetryStrategy(3, 0, retryable, logger)
				err := attemptRetryStrategy.Try()
				Expect(err).To(HaveOccurred())
				Expect(err.Error()).To(ContainSubstring("third-error"))
				Expect(retryable.Attempts).To(Equal(3))
			})
		})

		Context("when the attempt is not retryable", func() {
			It("stops trying", func() {
				retryable := newSimpleRetryable([]attemptOutput{
					{
						IsRetryable: true,
						AttemptErr:  errors.New("first-error"),
					},
					{
						IsRetryable: false,
						AttemptErr:  errors.New("second-error"),
					},
				})
				attemptRetryStrategy := NewAttemptRetryStrategy(10, 0, retryable, logger)
				err := attemptRetryStrategy.Try()
				Expect(err).To(HaveOccurred())
				Expect(err.Error()).To(ContainSubstring("second-error"))
				Expect(retryable.Attempts).To(Equal(2))
			})
		})

		Context("when there are no errors", func() {
			It("does not retry", func() {
				retryable := newSimpleRetryable([]attemptOutput{
					{
						IsRetryable: true,
						AttemptErr:  nil,
					},
				})
				attemptRetryStrategy := NewAttemptRetryStrategy(3, 0, retryable, logger)
				err := attemptRetryStrategy.Try()
				Expect(err).ToNot(HaveOccurred())
				Expect(retryable.Attempts).To(Equal(1))
			})
		})
	})
})


text:
package com.twitter.finagle.service

import com.twitter.conversions.time._
import com.twitter.finagle.{IndividualRequestTimeoutException, MockTimer, Service}
import com.twitter.util.{Await, Promise, Time}
import org.specs.SpecificationWithJUnit
import org.specs.mock.Mockito

class TimeoutFilterSpec extends SpecificationWithJUnit with Mockito {
  "TimeoutFilter" should {
    val timer = new MockTimer
    val promise = new Promise[String] {
      @volatile var interrupted: Option[Throwable] = None
      setInterruptHandler { case exc => interrupted = Some(exc) }
    }
    val service = new Service[String, String] {
      def apply(request: String) = promise
    }
    val timeout = 1.second
    val exception = new IndividualRequestTimeoutException(timeout)
    val timeoutFilter = new TimeoutFilter[String, String](timeout, exception, timer)
    val timeoutService = timeoutFilter.andThen(service)

    "the request succeeds when the service succeeds" in {
      promise.setValue("1")
      val res = timeoutService("blah")
      res.isDefined must beTrue
      Await.result(res) mustBe "1"
    }

    "times out a request that is not successful, cancels underlying" in Time.withCurrentTimeFrozen { tc =>
      val res = timeoutService("blah")
      res.isDefined must beFalse
      promise.interrupted must beNone
      tc.advance(2.seconds)
      timer.tick()
      res.isDefined must beTrue
      promise.interrupted must beLike {
        case Some(_: java.util.concurrent.TimeoutException) => true
      }
     Await.result(res) must throwA(exception)
    }
  }
}


text:
<!DOCTYPE html>

	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="SemiColonWeb" />

	<link href="http://fonts.googleapis.com/css?family=Lato:300,400,400italic,600,700|Raleway:300,400,500,600,700|Crete+Round:400italic" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
	<link rel="stylesheet" href="style.css" type="text/css" />
	<link rel="stylesheet" href="css/dark.css" type="text/css" />
	<link rel="stylesheet" href="css/font-icons.css" type="text/css" />
	<link rel="stylesheet" href="css/animate.css" type="text/css" />
	<link rel="stylesheet" href="css/magnific-popup.css" type="text/css" />

	<link rel="stylesheet" href="css/responsive.css" type="text/css" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />

	<link rel="stylesheet" type="text/css" href="include/rs-plugin/css/settings.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="include/rs-plugin/css/layers.css">
	<link rel="stylesheet" type="text/css" href="include/rs-plugin/css/navigation.css">

	<title>Home - Restuarant | Canvas</title>

							<div class="tp-caption ltl tp-resizeme revo-slider-caps-text uppercase"
							data-x="600"
							data-y="215"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1000"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3;">Finger Lickin' Good

							<div class="tp-caption ltl tp-resizeme revo-slider-emphasis-text nopadding noborder"
							data-x="597"
							data-y="230"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1200"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3; font-size: 60px;">Delicious Recipes

							<div class="tp-caption ltl tp-resizeme revo-slider-desc-text tleft"
							data-x="600"
							data-y="340"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1400"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3; max-width: 550px; white-space: normal;">Welcome to the Home of Fabulously Tasty homemade food that's gonna make you forget your mom.!

Browse Menu

							<div class="tp-caption ltl tp-resizeme revo-slider-caps-text uppercase"
							data-x="0"
							data-y="215"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1000"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3; color: #222;">Easy Seat Reservations

							<div class="tp-caption ltl tp-resizeme revo-slider-emphasis-text nopadding noborder"
							data-x="-3"
							data-y="230"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1200"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3; color: #222; font-size: 60px;">Book your Tables

							<div class="tp-caption ltl tp-resizeme revo-slider-desc-text tleft"
							data-x="0"
							data-y="340"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1400"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3; color: #222; max-width: 550px; white-space: normal;">Try our Mobile App to Reserve Tables in our Restaurant to avoid the Queue.

Reserve Now

							<div class="tp-caption ltl tp-resizeme revo-slider-caps-text uppercase"
							data-x="440"
							data-y="215"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1000"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3;">Wide Array of Options

							<div class="tp-caption ltl tp-resizeme revo-slider-emphasis-text nopadding noborder"
							data-x="287"
							data-y="230"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1200"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3;">Full Featured Menus

							<div class="tp-caption ltl tp-resizeme revo-slider-desc-text"
							data-x="245"
							data-y="340"
							data-transform_in="x:0;y:150;z:0;rotationZ:0;scaleX:1;scaleY:1;skewX:0;skewY:0;s:800;e:Power4.easeOutQuad;"
							data-speed="800"
							data-start="1400"
							data-easing="easeOutQuad"
							data-splitin="none"
							data-splitout="none"
							data-elementdelay="0.01"
							data-endelementdelay="0.1"
							data-endspeed="1000"
							data-endeasing="Power4.easeIn" style="z-index: 3; max-width: 650px; white-space: normal;">Choose from Continental, Oriental, Italian or Thai Cuisines. Or Simply create your own Mix.

Start Now

Home

Home - Corporate

Corporate - Layout 1

Corporate - Layout 2

Corporate - Layout 3

Corporate - Layout 4

Home - Portfolio

Portfolio - Layout 1

Portfolio - Layout 2

Portfolio - Masonry

Portfolio - AJAX

Home - Blog

Blog - Layout 1

Blog - Layout 2

Blog - Layout 3

Home - Shop

Shop - Layout 1

Shop - Layout 2

Home - Magazine

Magazine - Layout 1

Magazine - Layout 2

Magazine - Layout 3

Home - Landing Page

Landing Page - Layout 1

Landing Page - Layout 2

Landing Page - Layout 3

Landing Page - Layout 4

Landing Page - Layout 5

Home - Full Screen

Full Screen - Image

Full Screen - Slider

Full Screen - Video

Home - One Page

One Page - Default

One Page - Submenu

One Page - Dots Style

Home - Wedding

Home - Restaurant

Home - Events

Home - Parallax

Home - App Showcase

Menu

Staff

Gallery

Reviews

Blog

Contact

Demos

Why choose Us.Because we are Reliable.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi rem, facilis nobis voluptatum est voluptatem accusamus molestiae eaque perspiciatis mollitia.

Our Mission.To Redefine your Brand.

Quos, non, esse eligendi ab accusantium voluptatem. Maxime eligendi beatae, atque tempora ullam. Vitae delectus quia, consequuntur rerum molestias quo.

What we Do.Make our Customers Happy.

Porro repellat vero sapiente amet vitae quibusdam necessitatibus consectetur, labore totam. Accusamus perspiciatis asperiores labore esse ab accusantium ea modi ut.

Brilliant Service

"Momentum poverty tackling fellows social impact. Expanding community ownership, future affiliate protect civil society. Bloomberg."

						<video poster="images/videos/glorias-fajitas.jpg" preload="auto" loop autoplay muted>
							<source src='images/videos/glorias-fajitas.mp4' type='video/mp4' />
							<source src='images/videos/glorias-fajitas.webm' type='video/webm' />
						</video>

Exclusive Bar AvailableStart getting high

International Food MenuWorld Famous Recipes

Breakfast AvailableSpecialized Morning Menus

Quiet Cafe DiningPrivate & Personalized

Fresh from the Garden.

								Duis mollis, est non commodo luctus. Donec sed odio dui

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, repudiandae, maxime, earum, sapiente assumenda non odit laborum qui vero vel quos sint excepturi in laudantium.

							View Recipes

You'll be Lovin' It.

								Duis mollis, est non commodo luctus. Donec sed odio dui

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, repudiandae, maxime, earum, sapiente assumenda non odit laborum qui vero vel quos sint excepturi in laudantium.

							More Details

Opening Hours

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam aspernatur facilis cumque amet suscipit odio.

 Mondays-Fridays: 10AM to 7PM

 Saturdays: 11AM to 3PM

 Sundays: Closed

Our Buffet Menu

Our Buffet Menu is unique & filling consisting of different types of 5 Starters, 12 Full-Course Dishes, 9 Desserts & 3 Mocktails which you are gonna relish to the core.

						 Browse Menu

Gallery

Reviews

"Globalization fairness non-partisan visionary, institutions Aga Khan resolve. Results public-private partnerships, international development elevate scalable."

											John Doe, New York Magazine

"Medicine; experience in the field climate change achieve voice public-private partnerships process our ambitions. Sanitation."

											Mary Jane, Chicago News

"Healthcare forward-thinking public service, social innovation making progress. Arab Spring social analysis, equality treatment, diversification."

											Luis Frank, France

Need to make a Reservation? Call +165.4455.6254

						Copyrights © 2014 All Rights Reserved by Canvas Inc.

Terms of Use / Privacy Policy


text:
int xwalk_tizen_set_home_for_user_app(void) {
#if !defined(OS_TIZEN_MOBILE)
  return 0;
#endif

  // Tizen doesn't set HOME by default on login for user "app".
  uid_t uid = getuid();
  struct passwd* passwd = getpwuid(uid);

  if (!passwd)
    return -ENOENT;

  if (strcmp(passwd->pw_name, "app")) {
    fprintf(stderr, "User is not 'app', launching an application will not work\n");
    return -EINVAL;
  }

  if (setenv("HOME", passwd->pw_dir, true) != 0) {
    fprintf(stderr, "Couldn't set 'HOME' env variable to '%s'\n", passwd->pw_dir);
    return -EINVAL;
  }

  return 0;
}


text:
#include <stddef.h>
#include <stdint.h>

#include <memory>

#include "p2p/base/mdns_message.h"
#include "rtc_base/message_buffer_reader.h"

namespace webrtc {

void FuzzOneInput(const uint8_t* data, size_t size) {
  MessageBufferReader buf(reinterpret_cast<const char*>(data), size);
  auto mdns_msg = std::make_unique<MdnsMessage>();
  mdns_msg->Read(&buf);
}

}  // namespace webrtc


text:
001    package org.apache.commons.ssl.asn1;
002
003    import java.io.ByteArrayOutputStream;
004    import java.io.IOException;
005    import java.util.Enumeration;
006    import java.util.Vector;
007
008    public class BERConstructedOctetString
009        extends DEROctetString {
010        private static final int MAX_LENGTH = 1000;
011
012        /** convert a vector of octet strings into a single byte string */
013        static private byte[] toBytes(
014            Vector octs) {
015            ByteArrayOutputStream bOut = new ByteArrayOutputStream();
016
017            for (int i = 0; i != octs.size(); i++) {
018                try {
019                    DEROctetString o = (DEROctetString) octs.elementAt(i);
020
021                    bOut.write(o.getOctets());
022                }
023                catch (ClassCastException e) {
024                    throw new IllegalArgumentException(octs.elementAt(i).getClass().getName() + " found in input should only contain DEROctetString");
025                }
026                catch (IOException e) {
027                    throw new IllegalArgumentException("exception converting octets " + e.toString());
028                }
029            }
030
031            return bOut.toByteArray();
032        }
033
034        private Vector octs;
035
036        /** @param string the octets making up the octet string. */
037        public BERConstructedOctetString(
038            byte[] string) {
039            super(string);
040        }
041
042        public BERConstructedOctetString(
043            Vector octs) {
044            super(toBytes(octs));
045
046            this.octs = octs;
047        }
048
049        public BERConstructedOctetString(
050            DERObject obj) {
051            super(obj);
052        }
053
054        public BERConstructedOctetString(
055            DEREncodable obj) {
056            super(obj.getDERObject());
057        }
058
059        public byte[] getOctets() {
060            return string;
061        }
062
063        /** return the DER octets that make up this string. */
064        public Enumeration getObjects() {
065            if (octs == null) {
066                return generateOcts().elements();
067            }
068
069            return octs.elements();
070        }
071
072        private Vector generateOcts() {
073            int start = 0;
074            int end = 0;
075            Vector vec = new Vector();
076
077            while ((end + 1) < string.length) {
078                if (string[end] == 0 && string[end + 1] == 0) {
079                    byte[] nStr = new byte[end - start + 1];
080
081                    System.arraycopy(string, start, nStr, 0, nStr.length);
082
083                    vec.addElement(new DEROctetString(nStr));
084                    start = end + 1;
085                }
086                end++;
087            }
088
089            byte[] nStr = new byte[string.length - start];
090
091            System.arraycopy(string, start, nStr, 0, nStr.length);
092
093            vec.addElement(new DEROctetString(nStr));
094
095            return vec;
096        }
097
098        public void encode(
099            DEROutputStream out)
100            throws IOException {
101            if (out instanceof ASN1OutputStream || out instanceof BEROutputStream) {
102                out.write(CONSTRUCTED | OCTET_STRING);
103
104                out.write(0x80);
105
106                //
107                // write out the octet array
108                //
109                if (octs != null) {
110                    for (int i = 0; i != octs.size(); i++) {
111                        out.writeObject(octs.elementAt(i));
112                    }
113                } else {
114                    for (int i = 0; i < string.length; i += MAX_LENGTH) {
115                        int end;
116
117                        if (i + MAX_LENGTH > string.length) {
118                            end = string.length;
119                        } else {
120                            end = i + MAX_LENGTH;
121                        }
122
123                        byte[] nStr = new byte[end - i];
124
125                        System.arraycopy(string, i, nStr, 0, nStr.length);
126
127                        out.writeObject(new DEROctetString(nStr));
128                    }
129                }
130
131                out.write(0x00);
132                out.write(0x00);
133            } else {
134                super.encode(out);
135            }
136        }
137    }


text:
**NOTE** : This library is in Alpha stage. Use it at your own PERIL.

EasyPush allows you to send push notification easily to iOS and Android device
using AWS SNS.

TODO: Write more

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'easy_push'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install easy_push

## Usage

TODO: WRITE instruction here

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/easy_push. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
package ru.evgenyhodz;

import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * @author Evgeny Khodzitskiy (evgeny.hodz@gmail.com)
 * @since 27.01.2017
 */
public class SimpleArrayTest {
    /**
     * ENG:
     * Constant for test.
     * RUS:
     * Константа для теста.
     */
    private static final int SIZE = 1;
    /**
     * Ref to tested class.
     */
    private SimpleArray<String> simpleArray;
    /**
     * Ref to some value for container.
     */
    private String text;
    /**
     * Another reference.
     */
    private String anotherText;

    /**
     * Creating container and objects for tests.
     */
    @Before
    public void create() {
        simpleArray = new SimpleArray<>(SIZE);
        text = "Success";
        anotherText = "Victory";
    }

    /**
     * Checking of add() method.
     */
    @Test
    public void add() {
        simpleArray.add(text);
        assertThat(simpleArray.get(0), is("Success"));
    }

    /**
     * Checking of get(int position) method.
     * Throws exception because container is empty.
     */
    @Test(expected = NullPointerException.class)
    public void get() {
        assertThat(simpleArray.get(0), is("null"));
    }

    /**
     * Checking of update(int position, T value) method.
     */
    @Test
    public void update() {
        simpleArray.add(text);
        simpleArray.update(0, anotherText);
        assertThat(simpleArray.get(0), is("Victory"));

    }

    /**
     * Checking delete(int position) method.
     * Throws exception, because we deleted value from container,
     * and because method get() throws exception if position is empty.
     */
    @Test(expected = NullPointerException.class)
    public void delete() {
        simpleArray.add(text);
        simpleArray.delete(0);
        assertThat(simpleArray.get(0), is("null"));
    }

}


text:
import os
import textwrap
import unittest
from jinja2 import Template

from conans.model.ref import ConanFileReference
from parameterized import parameterized
from conans.test.utils.tools import TestClient

class PythonRequireExportSourcesTest(unittest.TestCase):
    def setUp(self):
        self.pyreq = ConanFileReference.loads("py/req@user/channel")
        conanfile = textwrap.dedent("""\
            import os
            from conans import ConanFile, tools

            class PyReq(ConanFile):
                exports_sources = "exports_sources.txt", "more_exports_sources.txt"
                exports = "exports.txt", "more_exports.txt"

                def source(self, is_empty):
                    self.output.info(">>>> PyReq::source")
                    self.output.info(">>>> - source_folder: {{}}".format(self.source_folder))
                    file_list = sorted(os.listdir(self.source_folder))
                    self.output.info(">>>> - source list: {{}}".format(file_list))
                    if is_empty:
                        assert not file_list, "No files expected, found {{}}".format(file_list)
                    else:
                        assert file_list, "Files expected, but it is empty"
                        assert sorted(["more_exports_sources.txt", "more_exports.txt"]) == file_list
            """.format(pyreq_name=self.pyreq.name))

        self.t = TestClient()
        self.t.save({"conanfile.py": conanfile,
                     "exports_sources.txt": "exports_sources: {}".format(str(self.pyreq)),
                     "exports.txt": "exports: {}".format(str(self.pyreq))})
        self.t.run("export . {}".format(self.pyreq))
        package_layout = self.t.cache.package_layout(self.pyreq)
        self.assertListEqual(['exports_sources.txt'],
                             os.listdir(package_layout.export_sources()))
        self.assertListEqual(sorted(['exports.txt', 'conanfile.py', 'conanmanifest.txt']),
                             sorted(os.listdir(package_layout.export())))

    @parameterized.expand([(False, ), (True, )])
    def test_locate_pyreq_folders(self, empty_exports):
        conanfile = Template(textwrap.dedent("""\
            from conans import ConanFile, python_requires

            base = python_requires("{{ pyreq }}")

            class MyLib(base.PyReq):
                {% if empty %}
                exports_sources = None
                exports = None
                {% endif %}

                def source(self):
                    super(MyLib, self).source(is_empty={{ empty }})

                    self.output.info(">>>> MyLib::source")
                    pyreq = self.python_requires['{{ pyreq.name }}']
                    self.output.info(" - pyreq::ref: {{{}}}".format(str(pyreq.ref)))
                    self.output.info(" - pyreq::exports_sources: {{{}}}".format(pyreq.exports_sources_folder))
                    self.output.info(" - pyreq::exports: {{{}}}".format(pyreq.exports_folder))

            """))
        content = conanfile.render(pyreq=self.pyreq, empty=empty_exports)

        ref = ConanFileReference.loads("lib/version@user/channel")
        self.t.save({"conanfile.py": content}, clean_first=True)
        if not empty_exports:
            # Write some files, these will be exported because they match patterns in pyreq
            self.t.save({"more_exports.txt": "...",
                         "more_exports_sources.txt": "..."})
        self.t.run("create . {}".format(ref))

        # Check things written in 'source' method (source folder executed in consumer context)
        source_folder = self.t.cache.package_layout(ref).source()
        self.assertIn(">>>> PyReq::source", self.t.out)
        self.assertIn(">>>> - source_folder: {}".format(source_folder), self.t.out)
        if not empty_exports:
            self.assertIn(">>>> - source list: ['more_exports.txt', 'more_exports_sources.txt']",
                          self.t.out)
        else:
            self.assertIn(">>>> - source list: []", self.t.out)

        # Access to sources from pyreq, check folders match
        pyreq_layout = self.t.cache.package_layout(self.pyreq)
        self.assertIn(" - pyreq::ref: {}".format(self.pyreq), self.t.out)
        self.assertIn(" - pyreq::exports_sources: %s" % pyreq_layout.export_sources(), self.t.out)
        self.assertIn(" - pyreq::exports: %s" % pyreq_layout.export(), self.t.out)