text:
package org.pentaho.di.trans.steps.rssinput;

import it.sauronsoftware.feed4j.FeedParser;
import it.sauronsoftware.feed4j.FeedXMLParseException;
import it.sauronsoftware.feed4j.UnsupportedFeedException;
import it.sauronsoftware.feed4j.bean.FeedItem;

import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

import org.dom4j.DocumentException;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.row.RowDataUtil;
import org.pentaho.di.core.row.RowMeta;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.BaseStep;
import org.pentaho.di.trans.step.StepDataInterface;
import org.pentaho.di.trans.step.StepInterface;
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.step.StepMetaInterface;
import org.xml.sax.SAXParseException;

/**
 * Read data from RSS and writes these to one or more output streams.

 *

 * When error handling is turned on:

 *

 *
The input row will be passed through if it is present

 *
The "Nr of errors" field will always be 1 (we do not presently check for multiple errors)

 *
The "Error descriptions" field contains a .toString of the caught exception (Usually contains useful info, such
 * as the HTTP return code)

 *
The "Error fields" contains the URL that caused the failure

 *
The "Error code" field contains one of the following Strings:
 *

 *
UnknownError - Unexpected; Check the "Error description" field

 *
XMLError - Typically the file is not XML; Could be non-xml HTML

 *
FileNotFound - Can be caused by a HTTP/404

 *
UnknownHost - Domain name cannot be resolved; May be caused by network outage

 *
TransferError - Can be caused by any Server error code (401, 403, 500, 502, etc...)

 *
BadURL - Url cannot be understood; May lack protocol (e.g.- http://) or use an unrecognized protocol

 *
BadRSSFormat - Typically the file is valid XML, but is not RSS

 *

 *

 *

 *
 * Notes:
 *
 * Turn on debug logging to see the full stack trace from a handled error.

 *
 * @author Samatar
 * @since 13-10-2007
 */
public class RssInput extends BaseStep implements StepInterface {
  private static Class<?> PKG = RssInput.class; // for i18n purposes, needed by Translator2!!

  private RssInputMeta meta;
  private RssInputData data;

  public RssInput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
    Trans trans ) {
    super( stepMeta, stepDataInterface, copyNr, transMeta, trans );
  }

  private boolean readNextUrl() throws Exception {
    // Clear out previous feed
    data.feed = null;
    data.itemssize = 0;

    if ( meta.urlInField() ) {
      data.readrow = getRow(); // Grab another row ...
      if ( data.readrow == null ) {
        if ( log.isDetailed() ) {
          logDetailed( BaseMessages.getString( PKG, "RssInput.Log.FinishedProcessing" ) );
        }
        return false;
      }
      if ( first ) {
        first = false;
        data.inputRowMeta = getInputRowMeta();
        data.outputRowMeta = data.inputRowMeta.clone();
        meta.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore );

        // Get total previous fields
        data.totalpreviousfields = data.inputRowMeta.size();

        // Create convert meta-data objects that will contain Date & Number formatters
        data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING );

        // Check is URL field is provided
        if ( Const.isEmpty( meta.getUrlFieldname() ) ) {
          logError( BaseMessages.getString( PKG, "RssInput.Log.UrlFieldNameMissing" ) );
          throw new KettleException( BaseMessages.getString( PKG, "RssInput.Log.UrlFieldNameMissing" ) );
        }

        // cache the position of the field
        if ( data.indexOfUrlField < 0 ) {
          data.indexOfUrlField = data.inputRowMeta.indexOfValue( meta.getUrlFieldname() );
          if ( data.indexOfUrlField < 0 ) {
            // The field is unreachable !
            logError( BaseMessages.getString( PKG, "RssInput.Log.ErrorFindingField" )
              + "[" + meta.getUrlFieldname() + "]" );
            throw new KettleException( BaseMessages.getString( PKG, "RssInput.Exception.ErrorFindingField", meta
              .getUrlFieldname() ) );
          }
        }

      }
      // get URL field value
      data.currenturl = data.inputRowMeta.getString( data.readrow, data.indexOfUrlField );

    } else {
      if ( data.last_url ) {
        return false;
      }
      if ( data.urlnr >= data.urlsize ) { // finished processing!

        if ( log.isDetailed() ) {
          logDetailed( BaseMessages.getString( PKG, "RssInput.Log.FinishedProcessing" ) );
        }
        return false;
      }
      // Is this the last url?
      data.last_url = ( data.urlnr == data.urlsize - 1 );
      data.currenturl = environmentSubstitute( meta.getUrl()[data.urlnr] );
    }

    if ( log.isDetailed() ) {
      logDetailed( BaseMessages.getString( PKG, "RssInput.Log.ReadingUrl", data.currenturl ) );
    }

    try {

      URL rss = new URL( data.currenturl );
      data.feed = FeedParser.parse( rss );
      data.itemssize = data.feed.getItemCount();
    } finally {

      // Move url pointer ahead!
      data.urlnr++;
      data.itemsnr = 0;

      if ( log.isDetailed() ) {
        logDetailed( BaseMessages.getString( PKG, "RssInput.Log.UrlReadFailed", data.currenturl ) );
      }
    }

    if ( log.isDetailed() ) {
      logDetailed( BaseMessages.getString( PKG, "RssInput.Log.UrlReaded", data.currenturl, data.itemssize ) );
    }

    return true;
  }

  private Object[] getOneRow() throws Exception {

    if ( meta.urlInField() ) {
      while ( ( data.itemsnr >= data.itemssize ) ) {
        if ( !readNextUrl() ) {
          return null;
        }
      }
    } else {
      while ( ( data.itemsnr >= data.itemssize ) || data.feed == null ) {
        if ( !readNextUrl() ) {
          return null;
        }
      }
    }

    // Create new row
    Object[] outputRowData = buildEmptyRow();

    if ( data.readrow != null ) {
      System.arraycopy( data.readrow, 0, outputRowData, 0, data.readrow.length );
    }

    // Get item
    FeedItem item = data.feed.getItem( data.itemsnr );

    if ( ( Const.isEmpty( meta.getRealReadFrom() ) || ( !Const.isEmpty( meta.getRealReadFrom() ) && item
      .getPubDate().compareTo( data.readfromdatevalide ) > 0 ) ) ) {

      // Execute for each Input field...
      for ( int j = 0; j < meta.getInputFields().length; j++ ) {
        RssInputField RSSInputField = meta.getInputFields()[j];

        String valueString = null;
        switch ( RSSInputField.getColumn() ) {
          case RssInputField.COLUMN_TITLE:
            valueString = item.getTitle();
            break;
          case RssInputField.COLUMN_LINK:
            valueString = item.getLink() == null ? "" : item.getLink().toString();
            break;
          case RssInputField.COLUMN_DESCRIPTION_AS_TEXT:
            valueString = item.getDescriptionAsText();
            break;
          case RssInputField.COLUMN_DESCRIPTION_AS_HTML:
            valueString = item.getDescriptionAsHTML();
            break;
          case RssInputField.COLUMN_COMMENTS:
            valueString = item.getComments() == null ? "" : item.getComments().toString();
            break;
          case RssInputField.COLUMN_GUID:
            valueString = item.getGUID();
            break;
          case RssInputField.COLUMN_PUB_DATE:
            valueString = item.getPubDate() == null ? "" : DateFormat.getInstance().format( item.getPubDate() );
            break;
          default:
            break;
        }

        // Do trimming
        switch ( RSSInputField.getTrimType() ) {
          case RssInputField.TYPE_TRIM_LEFT:
            valueString = Const.ltrim( valueString );
            break;
          case RssInputField.TYPE_TRIM_RIGHT:
            valueString = Const.rtrim( valueString );
            break;
          case RssInputField.TYPE_TRIM_BOTH:
            valueString = Const.trim( valueString );
            break;
          default:
            break;
        }

        // Do conversions
        //
        ValueMetaInterface targetValueMeta = data.outputRowMeta.getValueMeta( data.totalpreviousfields + j );
        ValueMetaInterface sourceValueMeta = data.convertRowMeta.getValueMeta( data.totalpreviousfields + j );
        outputRowData[data.totalpreviousfields + j] = targetValueMeta.convertData( sourceValueMeta, valueString );

        // Do we need to repeat this field if it is null?
        if ( meta.getInputFields()[j].isRepeated() ) {
          if ( data.previousRow != null && Const.isEmpty( valueString ) ) {
            outputRowData[data.totalpreviousfields + j] = data.previousRow[data.totalpreviousfields + j];
          }
        }

      } // end of loop over fields ...

      int rowIndex = data.nrInputFields;

      // See if we need to add the url to the row...
      if ( meta.includeUrl() ) {
        outputRowData[data.totalpreviousfields + rowIndex++] = data.currenturl;
      }
      // See if we need to add the row number to the row...
      if ( meta.includeRowNumber() ) {
        outputRowData[data.totalpreviousfields + rowIndex++] = new Long( data.rownr );
      }

      RowMetaInterface irow = getInputRowMeta();

      data.previousRow = irow == null ? outputRowData : irow.cloneRow( outputRowData ); // copy it to make
      // surely the next step doesn't change it in between...

      data.rownr++;

      putRow( data.outputRowMeta, outputRowData ); // copy row to output rowset(s);

      if ( meta.getRowLimit() > 0 && data.rownr > meta.getRowLimit() ) { // limit has been reached: stop now.
        return null;
      }
    }
    data.itemsnr++;
    return outputRowData;
  }

  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
    Object[] outputRowData = null;

    try {
      // Grab a row
      outputRowData = getOneRow();
      if ( outputRowData == null ) {
        setOutputDone(); // signal end to receiver(s)
        return false; // end of data or error.
      }
    } catch ( Exception e ) {
      if ( getStepMeta().isDoingErrorHandling() ) {
        RowMeta errorMeta = new RowMeta();
        Object[] errorData = new Object[0];

        if ( this.data.readrow != null ) {
          errorMeta.addRowMeta( getInputRowMeta() );
          errorData = this.data.readrow;
        }

        String errorCode = "UnknownError";

        // Determine error code
        if ( e instanceof FeedXMLParseException ) {
          if ( e.getCause() instanceof DocumentException ) {
            if ( ( (DocumentException) e.getCause() ).getNestedException() instanceof SAXParseException ) {
              errorCode = "XMLError";
            } else if ( ( (DocumentException) e.getCause() ).getNestedException() instanceof FileNotFoundException ) {
              errorCode = "FileNotFound";
            } else if ( ( (DocumentException) e.getCause() ).getNestedException() instanceof IOException ) {
              if ( ( (DocumentException) e.getCause() ).getNestedException() instanceof UnknownHostException ) {
                errorCode = "UnknownHost";
              } else {
                errorCode = "TransferError";
              }
            }
          }
        } else if ( e instanceof MalformedURLException ) {
          errorCode = "BadURL";
        } else if ( e instanceof UnsupportedFeedException ) {
          errorCode = "BadRSSFormat";
        }

        putError( errorMeta, errorData, 1, e.toString(), this.data.currenturl, errorCode );
        logError( BaseMessages.getString( PKG, "RssInput.ErrorProcessing.Run", e.toString() ) );

        ByteArrayOutputStream byteOS = new ByteArrayOutputStream();
        e.printStackTrace( new PrintStream( byteOS ) );
        logDebug( byteOS.toString() );
      } else {
        logError( BaseMessages.getString( PKG, "RssInput.Exception.Run", e.toString() ) );
        logError( Const.getStackTracker( e ) );
        setErrors( 1 );
        throw new KettleException( e );

      }
    }

    return true;

  }

  /**
   * Build an empty row based on the meta-data.
   *
   * @return
   */
  private Object[] buildEmptyRow() {
    Object[] rowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() );

    return rowData;
  }

  public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
    meta = (RssInputMeta) smi;
    data = (RssInputData) sdi;

    if ( super.init( smi, sdi ) ) {
      if ( meta.includeRowNumber() && Const.isEmpty( meta.getRowNumberField() ) ) {
        logError( BaseMessages.getString( PKG, "RssInput.Error.RowNumberFieldMissing" ) );
        return false;
      }
      if ( meta.includeUrl() && Const.isEmpty( meta.geturlField() ) ) {
        logError( BaseMessages.getString( PKG, "RssInput.Error.UrlFieldMissing" ) );
        return false;
      }

      if ( !Const.isEmpty( meta.getReadFrom() ) ) {
        // Let's check validity of the read from date
        try {
          SimpleDateFormat fdrss = new SimpleDateFormat( "yyyy-MM-dd" );
          fdrss.setLenient( false );
          data.readfromdatevalide = fdrss.parse( meta.getRealReadFrom() );
        } catch ( Exception e ) {
          logError( "can not validate ''Read From date'' : " + environmentSubstitute( meta.getReadFrom() ) );
          return false;
        }
      }
      if ( meta.urlInField() ) {
        if ( meta.getUrl() == null && meta.getUrl().length == 0 ) {
          logError( BaseMessages.getString( PKG, "RssInput.Log.UrlMissing" ) );
          return false;
        }

      } else {
        data.urlsize = meta.getUrl().length;
        try {
          // Create the output row meta-data
          data.outputRowMeta = new RowMeta();

          meta.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore );

          // Create convert meta-data objects that will contain Date & Number formatters
          data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING );
        } catch ( Exception e ) {
          logError( "Error initializing step: " + e.toString() );
          logError( Const.getStackTracker( e ) );
          return false;
        }

      }

      data.rownr = 1L;
      data.urlnr = 0;

      data.nrInputFields = meta.getInputFields().length;

      return true;
    }
    return false;
  }

  public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {
    meta = (RssInputMeta) smi;
    data = (RssInputData) sdi;
    if ( data.feed != null ) {
      data.feed = null;
    }

    super.dispose( smi, sdi );
  }

}


text:
import { Observable } from 'rx';
import { ofType, combineEpics } from 'redux-epic';

import { getJSON$ } from '../../utils/ajax-stream';
import {
  types,

  fetchUserComplete,
  fetchOtherUserComplete,
  createErrorObservable,
  showSignIn
} from './';
import { userFound } from '../routes/Profile/redux';

function getUserEpic(actions, _, { services }) {
  return actions::ofType('' + types.fetchUser)
    .flatMap(() => {
      return services.readService$({ service: 'user' })
        .filter(({ entities, result }) => entities && !!result)
        .map(fetchUserComplete)
        .defaultIfEmpty(showSignIn())
        .catch(createErrorObservable);
    });
}

function getOtherUserEpic(actions$) {
  return actions$::ofType(types.fetchOtherUser.start)
    .distinctUntilChanged()
    .flatMap(({ payload: otherUser }) => {
      return getJSON$(`/api/users/get-public-profile?username=${otherUser}`)
        .flatMap(response => Observable.of(
          fetchOtherUserComplete(response),
          userFound(!!response.result)
        ))
        .catch(createErrorObservable);
    });
}

export default combineEpics(
  getUserEpic,
  getOtherUserEpic
);

redpajama_set_name: RedPajamaGithub


text:
package com.emistoolbox.client.ui.pdf;

import com.emistoolbox.client.EmisEditor;
import com.emistoolbox.common.ChartColor;
import com.emistoolbox.common.renderer.pdfreport.layout.impl.CSSCreator;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.PopupPanel;

public class ChartColorEditor extends HTML implements EmisEditor<ChartColor>, HasValueChangeHandlers<ChartColor>
{
	private ChartColor color;
//	private Image uiPicker = new Image("images/palette.png");
	private HTML uiPicker = new HTML("");

	private PopupPanel uiPopup = new PopupPanel();

	public ChartColorEditor()
	{
		uiPopup.setModal(true);
		uiPopup.setAutoHideEnabled(true);

		set(null);
//		uiPicker.getElement().setId("colourPicker");
		uiPicker.addMouseDownHandler(new MouseDownHandler() {

			@Override
			public void onMouseDown(MouseDownEvent event) {
				int x = event.getX();
				int y = event.getY();

				String colours = getColor((Element) uiPicker.getElement().getFirstChild(), x, y);
				String[] values = colours.split(",");

				color = new ChartColor(new Integer(values[0]), new Integer(values[1]), new Integer(values[2]), new Integer(values[3]));
				uiPopup.hide();

				updateUi();

				ValueChangeEvent.fire(ChartColorEditor.this, color);
			}
		});

		uiPopup.add(uiPicker);

		addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				uiPopup.showRelativeTo(ChartColorEditor.this);
			}
		});
	}

	@Override
	public void commit()
	{}

	@Override
	public ChartColor get()
	{
		commit();
		return color;
	}

	@Override
	public void set(ChartColor color)
	{
		this.color = color;
		updateUi();
	}

	private native String getColor(Element img, int x, int y) /*-{
		var canvas = document.createElement('canvas');
		canvas.width = img.width;
		canvas.height = img.height;
		canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
		var values = canvas.getContext('2d').getImageData(x, y, 1, 1).data;

		return values[0] + "," + values[1] + "," + values[2] + "," + values[3];
	}-*/;

	private void updateUi()
	{
		if (color == null)
			setHTML("
XXX
");
		else
			setHTML("

");
	}

	@Override
	public HandlerRegistration addValueChangeHandler(ValueChangeHandler<ChartColor> handler)
	{ return super.addHandler(handler, ValueChangeEvent.getType()); }
}


text:
<?php

/**
 * @namespace
 */
namespace Yandex\Common\Exception;

/**
 * Parent Exception for all Yandex library packages
 *
 * @package  Yandex\Common\Exception
 *
 * @author   Anton Shevchuk
 * @created  26.06.13 13:56
 */
class YandexException extends \Exception
{
}


text:
"""Zerproc light platform."""
from __future__ import annotations

from datetime import timedelta
import logging
from typing import Any

import pyzerproc

from homeassistant.components.light import (
    ATTR_BRIGHTNESS,
    ATTR_HS_COLOR,
    ColorMode,
    LightEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import Event, HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_track_time_interval
import homeassistant.util.color as color_util

from .const import DATA_ADDRESSES, DATA_DISCOVERY_SUBSCRIPTION, DOMAIN

_LOGGER = logging.getLogger(__name__)

DISCOVERY_INTERVAL = timedelta(seconds=60)

async def discover_entities(hass: HomeAssistant) -> list[ZerprocLight]:
    """Attempt to discover new lights."""
    lights = await pyzerproc.discover()

    # Filter out already discovered lights
    new_lights = [
        light
        for light in lights
        if light.address not in hass.data[DOMAIN][DATA_ADDRESSES]
    ]

    entities = []
    for light in new_lights:
        hass.data[DOMAIN][DATA_ADDRESSES].add(light.address)
        entities.append(ZerprocLight(light))

    return entities

async def async_setup_entry(
    hass: HomeAssistant,
    config_entry: ConfigEntry,
    async_add_entities: AddEntitiesCallback,
) -> None:
    """Set up Zerproc light devices."""
    warned = False

    async def discover(*args):
        """Wrap discovery to include params."""
        nonlocal warned
        try:
            entities = await discover_entities(hass)
            async_add_entities(entities, update_before_add=True)
            warned = False
        except pyzerproc.ZerprocException:
            if warned is False:
                _LOGGER.warning("Error discovering Zerproc lights", exc_info=True)
                warned = True

    # Initial discovery
    hass.async_create_task(discover())

    # Perform recurring discovery of new devices
    hass.data[DOMAIN][DATA_DISCOVERY_SUBSCRIPTION] = async_track_time_interval(
        hass, discover, DISCOVERY_INTERVAL
    )

class ZerprocLight(LightEntity):
    """Representation of an Zerproc Light."""

    _attr_color_mode = ColorMode.HS
    _attr_icon = "mdi:string-lights"
    _attr_supported_color_modes = {ColorMode.HS}

    def __init__(self, light) -> None:
        """Initialize a Zerproc light."""
        self._light = light

    async def async_added_to_hass(self) -> None:
        """Run when entity about to be added to hass."""
        self.async_on_remove(
            self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self._hass_stop)
        )

    async def _hass_stop(self, event: Event) -> None:
        """Run on EVENT_HOMEASSISTANT_STOP."""
        await self.async_will_remove_from_hass()

    async def async_will_remove_from_hass(self) -> None:
        """Run when entity will be removed from hass."""
        try:
            await self._light.disconnect()
        except pyzerproc.ZerprocException:
            _LOGGER.debug(
                "Exception disconnecting from %s", self._light.address, exc_info=True
            )

    @property
    def name(self):
        """Return the display name of this light."""
        return self._light.name

    @property
    def unique_id(self):
        """Return the ID of this light."""
        return self._light.address

    @property
    def device_info(self) -> DeviceInfo:
        """Device info for this light."""
        return DeviceInfo(
            identifiers={(DOMAIN, self.unique_id)},
            manufacturer="Zerproc",
            name=self.name,
        )

    async def async_turn_on(self, **kwargs: Any) -> None:
        """Instruct the light to turn on."""
        if ATTR_BRIGHTNESS in kwargs or ATTR_HS_COLOR in kwargs:
            default_hs = (0, 0) if self.hs_color is None else self.hs_color
            hue_sat = kwargs.get(ATTR_HS_COLOR, default_hs)

            default_brightness = 255 if self.brightness is None else self.brightness
            brightness = kwargs.get(ATTR_BRIGHTNESS, default_brightness)

            rgb = color_util.color_hsv_to_RGB(
                hue_sat[0], hue_sat[1], brightness / 255 * 100
            )
            await self._light.set_color(*rgb)
        else:
            await self._light.turn_on()

    async def async_turn_off(self, **kwargs: Any) -> None:
        """Instruct the light to turn off."""
        await self._light.turn_off()

    async def async_update(self) -> None:
        """Fetch new state data for this light."""
        try:
            if not self.available:
                await self._light.connect()
            state = await self._light.get_state()
        except pyzerproc.ZerprocException:
            if self.available:
                _LOGGER.warning("Unable to connect to %s", self._light.address)
            self._attr_available = False
            return
        if not self.available:
            _LOGGER.info("Reconnected to %s", self._light.address)
            self._attr_available = True
        self._attr_is_on = state.is_on
        hsv = color_util.color_RGB_to_hsv(*state.color)
        self._attr_hs_color = hsv[:2]
        self._attr_brightness = int(round((hsv[2] / 100) * 255))


text:
setTimeout(function(){
  (function(){
    id = Ti.App.Properties.getString("tisink", "");
    var param, xhr;
    file = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,"examples/android_hide_softkeyboard.js");
    text = (file.read()).text
    xhr = Titanium.Network.createHTTPClient();
    xhr.open("POST", "http://tisink.nodester.com/");
    xhr.setRequestHeader("content-type", "application/json");
    param = {
      data: text,
      file: "android_hide_softkeyboard.js",
      id: id
    };
    xhr.send(JSON.stringify(param));
  })();
},0);
//TISINK----------------

var win = Ti.UI.currentWindow;

var l1 = Ti.UI.createLabel({
	text : 'Keyboard or Click focus TextField to Show Keyboard',
	top : 20, left : 10, right : 10, height : 40
});
win.add(l1);

var tf1 = Ti.UI.createTextField({
	top: 70, left: 10, right: 10, height:40,
	softKeyboardOnFocus : Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS
});

win.add(tf1);

var btn = Ti.UI.createButton({
	title: 'Request Hide Keyboard',
	top: 120, left: 10, right: 10, height:40,
	softKeyboardOnFocus : Ti.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS
});
win.add(btn);
btn.addEventListener('click', function() {
	Ti.UI.Android.hideSoftKeyboard();
});

//tf1.focus();


text:
module.exports.sendInfoEmail = function sendInfoEmail({ mail, props, path }) {
  const { name, email } = props.profile;

  return mail
    .sendTemplate({
      toName: name,
      toEmail: email,
      template_id: 'd-f13f51156976481fbda6a6e41c3b71dd',
      dynamic_template_data: {
        name,
      },
    })
    .then(path.success)
    .catch(path.error);
};

module.exports.getProfile = function getProfile({ firebase, props, path }) {
  const { uid } = props.data;

  return firebase
    .value(`profiles/${uid}`)
    .then(res => path.success({ profile: res.value }))
    .catch(path.error);
};

module.exports.updateProfile = function updateProfile({
  firebase,
  props,
  path,
}) {
  const { uid } = props.data;

  return firebase
    .set(`profiles/${uid}/mails/info`, true)
    .then(() => path.success())
    .catch(path.error);
};


text:
package org.apache.accumulo.server.client;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;

import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.ClientConfiguration;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.client.impl.Credentials;
import org.apache.accumulo.core.client.impl.TabletLocator;
import org.apache.accumulo.core.client.impl.TabletLocator.TabletLocation;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.file.FileOperations;
import org.apache.accumulo.core.file.FileSKVWriter;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.accumulo.server.fs.VolumeManager;
import org.apache.accumulo.server.fs.VolumeManagerImpl;
import org.apache.commons.lang.NotImplementedException;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.junit.Assert;
import org.junit.Test;

public class BulkImporterTest {

  static final SortedSet<KeyExtent> fakeMetaData = new TreeSet<>();
  static final Text tableId = new Text("1");
  static {
    fakeMetaData.add(new KeyExtent(tableId, new Text("a"), null));
    for (String part : new String[] {"b", "bm", "c", "cm", "d", "dm", "e", "em", "f", "g", "h", "i", "j", "k", "l"}) {
      fakeMetaData.add(new KeyExtent(tableId, new Text(part), fakeMetaData.last().getEndRow()));
    }
    fakeMetaData.add(new KeyExtent(tableId, null, fakeMetaData.last().getEndRow()));
  }

  class MockTabletLocator extends TabletLocator {
    int invalidated = 0;

    @Override
    public TabletLocation locateTablet(ClientContext context, Text row, boolean skipRow, boolean retry) throws AccumuloException, AccumuloSecurityException,
        TableNotFoundException {
      return new TabletLocation(fakeMetaData.tailSet(new KeyExtent(tableId, row, null)).first(), "localhost", "1");
    }

    @Override
    public <T extends Mutation> void binMutations(ClientContext context, List<T> mutations, Map<String,TabletServerMutations<T>> binnedMutations,
        List<T> failures) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
      throw new NotImplementedException();
    }

    @Override
    public List<Range> binRanges(ClientContext context, List<Range> ranges, Map<String,Map<KeyExtent,List<Range>>> binnedRanges) throws AccumuloException,
        AccumuloSecurityException, TableNotFoundException {
      throw new NotImplementedException();
    }

    @Override
    public void invalidateCache(KeyExtent failedExtent) {
      invalidated++;
    }

    @Override
    public void invalidateCache(Collection<KeyExtent> keySet) {
      throw new NotImplementedException();
    }

    @Override
    public void invalidateCache() {
      throw new NotImplementedException();
    }

    @Override
    public void invalidateCache(Instance instance, String server) {
      throw new NotImplementedException();
    }
  }

  @Test
  public void testFindOverlappingTablets() throws Exception {
    MockTabletLocator locator = new MockTabletLocator();
    FileSystem fs = FileSystem.getLocal(CachedConfiguration.getInstance());
    ClientContext context = new ClientContext(new MockInstance(), new Credentials("root", new PasswordToken("")), new ClientConfiguration());
    String file = "target/testFile.rf";
    fs.delete(new Path(file), true);
    FileSKVWriter writer = FileOperations.getInstance().openWriter(file, fs, fs.getConf(), context.getConfiguration());
    writer.startDefaultLocalityGroup();
    Value empty = new Value(new byte[] {});
    writer.append(new Key("a", "cf", "cq"), empty);
    writer.append(new Key("a", "cf", "cq1"), empty);
    writer.append(new Key("a", "cf", "cq2"), empty);
    writer.append(new Key("a", "cf", "cq3"), empty);
    writer.append(new Key("a", "cf", "cq4"), empty);
    writer.append(new Key("a", "cf", "cq5"), empty);
    writer.append(new Key("d", "cf", "cq"), empty);
    writer.append(new Key("d", "cf", "cq1"), empty);
    writer.append(new Key("d", "cf", "cq2"), empty);
    writer.append(new Key("d", "cf", "cq3"), empty);
    writer.append(new Key("d", "cf", "cq4"), empty);
    writer.append(new Key("d", "cf", "cq5"), empty);
    writer.append(new Key("dd", "cf", "cq1"), empty);
    writer.append(new Key("ichabod", "cf", "cq"), empty);
    writer.append(new Key("icky", "cf", "cq1"), empty);
    writer.append(new Key("iffy", "cf", "cq2"), empty);
    writer.append(new Key("internal", "cf", "cq3"), empty);
    writer.append(new Key("is", "cf", "cq4"), empty);
    writer.append(new Key("iterator", "cf", "cq5"), empty);
    writer.append(new Key("xyzzy", "cf", "cq"), empty);
    writer.close();
    VolumeManager vm = VolumeManagerImpl.get(context.getConfiguration());
    List<TabletLocation> overlaps = BulkImporter.findOverlappingTablets(context, vm, locator, new Path(file));
    Assert.assertEquals(5, overlaps.size());
    Collections.sort(overlaps);
    Assert.assertEquals(new KeyExtent(tableId, new Text("a"), null), overlaps.get(0).tablet_extent);
    Assert.assertEquals(new KeyExtent(tableId, new Text("d"), new Text("cm")), overlaps.get(1).tablet_extent);
    Assert.assertEquals(new KeyExtent(tableId, new Text("dm"), new Text("d")), overlaps.get(2).tablet_extent);
    Assert.assertEquals(new KeyExtent(tableId, new Text("j"), new Text("i")), overlaps.get(3).tablet_extent);
    Assert.assertEquals(new KeyExtent(tableId, null, new Text("l")), overlaps.get(4).tablet_extent);

    List<TabletLocation> overlaps2 = BulkImporter.findOverlappingTablets(context, vm, locator, new Path(file), new KeyExtent(tableId, new Text("h"), new Text(
        "b")));
    Assert.assertEquals(3, overlaps2.size());
    Assert.assertEquals(new KeyExtent(tableId, new Text("d"), new Text("cm")), overlaps2.get(0).tablet_extent);
    Assert.assertEquals(new KeyExtent(tableId, new Text("dm"), new Text("d")), overlaps2.get(1).tablet_extent);
    Assert.assertEquals(new KeyExtent(tableId, new Text("j"), new Text("i")), overlaps2.get(2).tablet_extent);
    Assert.assertEquals(locator.invalidated, 1);
  }

  @Test
  public void testSequentialTablets() throws Exception {
    // ACCUMULO-3967 make sure that the startRow we compute in BulkImporter is actually giving
    // a correct startRow so that findOverlappingTablets works as intended.

    // 1;2;1
    KeyExtent extent = new KeyExtent(new Text("1"), new Text("2"), new Text("1"));
    Assert.assertEquals(new Text("1\0"), BulkImporter.getStartRowForExtent(extent));

    // 1;2<
    extent = new KeyExtent(new Text("1"), new Text("2"), null);
    Assert.assertEquals(null, BulkImporter.getStartRowForExtent(extent));

    // 1<<
    extent = new KeyExtent(new Text("1"), null, null);
    Assert.assertEquals(null, BulkImporter.getStartRowForExtent(extent));

    // 1;8;7777777
    extent = new KeyExtent(new Text("1"), new Text("8"), new Text("7777777"));
    Assert.assertEquals(new Text("7777777\0"), BulkImporter.getStartRowForExtent(extent));
  }
}


text:
package org.noorganization.instalist.presenter.event;

import android.app.Activity;

/**
 * Event-Message for notifying about found plugins.
 * Created by damihe on 06.01.16.
 */
public class PluginFoundMessage {
    public String mName;
    public String mPackage;
    public Class<?> mMainActivity;
    public Class<?> mSettingsActivity;

    public PluginFoundMessage(String _name, Class<Activity> _mainActivity,
                              Class<Activity> _settingsActivity, String _package) {
        mName = _name;
        mMainActivity = _mainActivity;
        mSettingsActivity = _settingsActivity;
        mPackage = _package;
    }

    public PluginFoundMessage(String _name, String _package) {
        mName = _name;
        mPackage = _package;
    }
}


text:
<?xml version="1.0"?>

<configuration supports_final="false" supports_adding_forbidden="true">

  <property>
    <name>yarn.scheduler.capacity.resource-calculator</name>
    <description>
      The ResourceCalculator implementation to be used to compare Resources in the scheduler.
      The default i.e. org.apache.hadoop.yarn.util.resource.DefaultResourseCalculator only uses
      Memory while DominantResourceCalculator uses Dominant-resource to compare multi-dimensional
      resources such as Memory, CPU etc. A Java ResourceCalculator class name is expected.
    </description>
    <value>org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator</value>
    <display-name>CPU Scheduling</display-name>
    <value-attributes>
      <type>value-list</type>
      <entries>
        <entry>
          <value>org.apache.hadoop.yarn.util.resource.DominantResourceCalculator</value>
          Enabled
        </entry>
        <entry>
          <value>org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator</value>
          Disabled
        </entry>
      </entries>
      <selection-cardinality>1</selection-cardinality>
    </value-attributes>
    <on-ambari-upgrade add="false"/>
  </property>
  <property>
    <name>yarn.scheduler.capacity.root.accessible-node-labels</name>
    <value>*</value>
    <description/>
    <on-ambari-upgrade add="false"/>
  </property>

  <property>
    <name>capacity-scheduler</name>
    <description>Enter key=value (one per line) for all properties of capacity-scheduler.xml</description>
    <depends-on>
      <property>
        <type>hive-interactive-env</type>
        <name>enable_hive_interactive</name>
      </property>
      <property>
        <type>hive-interactive-env</type>
        <name>llap_queue_capacity</name>
      </property>
    </depends-on>
    <on-ambari-upgrade add="false"/>
  </property>
</configuration>


text:
import java.util.Objects;

class Test {
  String hundredTimes(String s) {
    Objects.requireNonNull(s);
    StringBuilder sb = new StringBuilder();
      sb.append(s.repeat(100));
    return sb.toString();
  }
}


text:
'use strict'

var util = require('util')
var express = require('express')
  , should = require('should')
  , qs = require('qs')
var Grant = require('../../').express()
  , oauth1 = require('../../lib/flow/oauth1')

describe('oauth1', function () {
  function url (path) {
    var c = config.server
    return c.protocol + '://' + c.host + path
  }

  var grant, app, server
  var config = {
    server: {protocol:'http', host:'localhost:5000', callback:'/'},
    twitter:{}
  }

  describe('success', function () {
    before(function (done) {
      grant = new Grant(config)
      app = express().use(grant)

      grant.config.twitter.request_url = url('/request_url')
      grant.config.twitter.authorize_url = '/authorize_url'
      grant.config.twitter.access_url = url('/access_url')

      app.post('/request_url', function (req, res) {
        res.end(qs.stringify({some:'data'}))
      })
      app.post('/access_url', function (req, res) {
        res.end(JSON.stringify({some:'data'}))
      })
      server = app.listen(5000, done)
    })

    it('step1', function (done) {
      oauth1.step1(grant.config.twitter, function (err, data) {
        should.deepEqual(data, {some:'data'})
        done()
      })
    })

    it('step2', function () {
      var url = oauth1.step2(grant.config.twitter, {oauth_token:'token'})
      url.should.equal('/authorize_url?oauth_token=token')
    })

    it('step3', function (done) {
      oauth1.step3(grant.config.twitter, {}, {oauth_token:'token'}, function (err, url) {
        url.should.equal('raw%5Bsome%5D=data')
        done()
      })
    })

    after(function (done) {
      server.close(done)
    })
  })

  describe('error', function () {
    before(function (done) {
      grant = new Grant(config)
      app = express().use(grant)

      grant.config.twitter.request_url = url('/request_err')
      grant.config.twitter.authorize_url = '/authorize_url'
      grant.config.twitter.access_url = url('/access_url')

      app.post('/request_url', function (req, res) {
        res.status(500).end(JSON.stringify({error:'invalid'}))
      })

      server = app.listen(5000, done)
    })

    it('step1 - network error', function (done) {
      oauth1.step1(grant.config.twitter, function (err, body) {
        err.should.equal('error%5BCannot%20POST%20%2Frequest_err%0A%5D=')
        should.deepEqual(qs.parse(err), {error: {'Cannot POST /request_err\n': ''}})
        done()
      })
    })
    it('step1 - error response', function (done) {
      grant.config.twitter.request_url = url('/request_url')
      oauth1.step1(grant.config.twitter, function (err, body) {
        err.should.equal('error%5Berror%5D=invalid')
        should.deepEqual(qs.parse(err), {error: {error:'invalid'}})
        done()
      })
    })

    it('step2 - mising oauth_token - error response', function () {
      var url = oauth1.step2(grant.config.twitter, {error:'invalid'})
      url.should.equal('/?error%5Berror%5D=invalid')
    })
    it('step2 - mising oauth_token - empty response', function () {
      var url = oauth1.step2(grant.config.twitter, {})
      url.should.equal('/?error%5Berror%5D=Grant%3A%20request_url')
    })

    it('step3 - mising oauth_token - response error', function (done) {
      oauth1.step3(grant.config.twitter, {}, {error:'invalid'}, function (err, body) {
        err.should.equal('error%5Berror%5D=invalid')
        should.deepEqual(qs.parse(err), {error: {error:'invalid'}})
        done()
      })
    })
    it('step3 - mising oauth_token - empty response', function (done) {
      oauth1.step3(grant.config.twitter, {}, {}, function (err, body) {
        err.should.equal('error%5Berror%5D=Grant%3A%20authorize_url')
        should.deepEqual(qs.parse(err), {error: {error:'Grant: authorize_url'}})
        done()
      })
    })

    after(function (done) {
      server.close(done)
    })
  })

  describe('custom', function () {
    describe('step1', function () {
      before(function (done) {
        util._extend(config, {
          copy:{}, etsy:{}, flickr:{}, freshbooks:{}, goodreads:{},
          linkedin:{}, trello:{}, tripit:{}
        })
        grant = new Grant(config)
        app = express().use(grant)

        app.post('/request_url', function (req, res) {
          res.end(qs.stringify({oauth:req.headers.authorization, scope:req.query.scope}))
        })
        server = app.listen(5000, done)
      })

      describe('querystring scope', function () {
        it('copy', function (done) {
          grant.config.copy.request_url = url('/request_url')
          grant.config.copy.scope = '{"profile":{"read":true}}'
          oauth1.step1(grant.config.copy, function (err, body) {
            body.scope.should.equal('{"profile":{"read":true}}')
            done()
          })
        })
        it('etsy', function (done) {
          grant.config.etsy.request_url = url('/request_url')
          grant.config.etsy.scope = 'email_r profile_r'
          oauth1.step1(grant.config.etsy, function (err, body) {
            body.scope.should.equal('email_r profile_r')
            done()
          })
        })
        it('linkedin', function (done) {
          grant.config.linkedin.request_url = url('/request_url')
          grant.config.linkedin.scope = 'scope1,scope2'
          oauth1.step1(grant.config.linkedin, function (err, body) {
            body.scope.should.equal('scope1,scope2')
            done()
          })
        })
      })

      describe('signature_method', function () {
        it('freshbooks', function (done) {
          grant.config.freshbooks.request_url = url('/request_url')
          oauth1.step1(grant.config.freshbooks, function (err, body) {
            body.oauth.should.match(/oauth_signature_method="PLAINTEXT"/)
            done()
          })
        })
      })

      describe('subdomain', function () {
        it('freshbooks', function (done) {
          grant.config.freshbooks.request_url = url('/[subdomain]')
          grant.config.freshbooks.subdomain = 'request_url'
          oauth1.step1(grant.config.freshbooks, function (err, body) {
            body.oauth.should.match(/OAuth/)
            done()
          })
        })
      })

      after(function (done) {
        server.close(done)
      })
    })

    describe('step2', function () {
      before(function () {
        grant = new Grant(config)
      })

      describe('custom_parameters', function () {
        it('flickr', function () {
          grant.config.flickr.scope = ['read','write']
          var url = oauth1.step2(grant.config.flickr, {oauth_token:'token'})
          var query = qs.parse(url.split('?')[1])
          should.deepEqual(query,
            {oauth_token:'token', perms:['read','write']})
        })

        it('trello', function () {
          grant.config.trello.scope = ['read','write']
          grant.config.trello.expiration = 'never'
          var url = oauth1.step2(grant.config.trello, {oauth_token:'token'})
          var query = qs.parse(url.split('?')[1])
          should.deepEqual(query,
            {oauth_token:'token', scope:['read','write'], expiration:'never'})
        })
      })

      describe('subdomain', function () {
        it('freshbooks', function () {
          grant.config.freshbooks.subdomain = 'grant'
          var url = oauth1.step2(grant.config.freshbooks, {oauth_token:'token'})
          url.indexOf('https://grant.freshbooks.com').should.equal(0)
        })
      })

      describe('oauth_callback', function () {
        it('tripit', function () {
          var uri = oauth1.step2(grant.config.tripit, {oauth_token:'token'})
          var query = qs.parse(uri.split('?')[1])
          should.deepEqual(query,
            {oauth_token:'token', oauth_callback:url('/connect/tripit/callback')})
        })
      })
    })

    describe('step3', function () {
      before(function (done) {
        grant = new Grant(config)
        app = express().use(grant)

        app.post('/access_url', function (req, res) {
          res.end(qs.stringify({oauth:req.headers.authorization}))
        })
        server = app.listen(5000, done)
      })

      describe('signature_method', function () {
        it('freshbooks', function (done) {
          grant.config.freshbooks.access_url = url('/access_url')
          oauth1.step3(grant.config.freshbooks, {}, {oauth_token:'token'}, function (err, response) {
            var query = qs.parse(response)
            query.raw.oauth.should.match(/oauth_signature_method="PLAINTEXT"/)
            done()
          })
        })
      })

      describe('oauth_verifier', function () {
        it('goodreads', function (done) {
          grant.config.goodreads.access_url = url('/access_url')
          oauth1.step3(grant.config.goodreads, {}, {oauth_token:'token'}, function (err, response) {
            var query = qs.parse(response)
            query.raw.oauth.should.not.match(/verifier/)
            done()
          })
        })
        it('tripit', function (done) {
          grant.config.tripit.access_url = url('/access_url')
          oauth1.step3(grant.config.tripit, {}, {oauth_token:'token'}, function (err, response) {
            var query = qs.parse(response)
            query.raw.oauth.should.not.match(/verifier/)
            done()
          })
        })
      })

      describe('subdomain', function () {
        it('freshbooks', function (done) {
          grant.config.freshbooks.access_url = url('/[subdomain]')
          grant.config.freshbooks.subdomain = 'access_url'
          oauth1.step3(grant.config.freshbooks, {}, {oauth_token:'token'}, function (err, url) {
            url.should.be.type('string')
            done()
          })
        })
      })

      after(function (done) {
        server.close(done)
      })
    })
  })
})


text:
USING_NS_CC;
using namespace CocosDenshion;

enum class PhysicsCategory
{
    None = 0,
    Monster = (1 << 0),  //1
    Projectile = (1 << 1), //2
    All =   PhysicsCategory::Monster | PhysicsCategory::Projectile //3
};

Scene* HelloWorld::createScene()
{
    //this line will add physics to our scene
    auto scene = Scene::createWithPhysics();
    scene->getPhysicsWorld()->setGravity(Vec2(0,0));
    //toggle debug draw
    //scene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL);

    // 'layer' is an autorelease object
    auto layer = HelloWorld::create();

    // add layer as a child to scene
    scene->addChild(layer);

    // return the scene
    return scene;
}

// on "init" you need to initialize your instance
bool HelloWorld::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Layer::init() )
    {
        return false;
    }

    auto origin = Director::getInstance()->getVisibleOrigin();
    auto winSize = Director::getInstance()->getVisibleSize();

    auto background = DrawNode::create();
    background->drawSolidRect(origin, winSize, Color4F(0.6,0.6,0.6,1.0));
    this->addChild(background);

    //add player
    _player = Sprite::create("player.png");
    _player->setPosition(Vec2(winSize.width * 0.1, winSize.height * 0.5 ));
    this->addChild(_player);

    //spawn monster repeatly
    srand((unsigned int)time(nullptr));
    this->schedule(schedule_selector(HelloWorld::addMonster), 1.5);

    //3 enable touch
    //we can also call this->setTouchEnabled(true);
    //this->setTouchMode(Touch::DispatchMode::ONE_BY_ONE);
    //but it is deprecated in v3.x

    auto eventListener = EventListenerTouchOneByOne::create();
    eventListener->onTouchBegan = CC_CALLBACK_2(HelloWorld::onTouchBegan, this);
    //the second node parameter can't be nullptr
    this->getEventDispatcher()->addEventListenerWithSceneGraphPriority(eventListener, _player);

    //add contact event listener
    auto contactListener = EventListenerPhysicsContact::create();
    contactListener->onContactBegin = CC_CALLBACK_1(HelloWorld::onContactBegan, this);
    _eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this);

    //play background music
    SimpleAudioEngine::getInstance()->playBackgroundMusic(BACKGROUND_MUSIC_SFX,true);

    _monstersDestroyed = 0;

    return true;
}

bool HelloWorld::onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *unused_event)
{
    SimpleAudioEngine::getInstance()->playEffect(PEW_PEW_SFX);

    // 0  - get the  _player object
    //auto node = unused_event->getCurrentTarget();

    // 1 - Choose one of the touches to work with
    Vec2 touchLocation = touch->getLocation();

    // 2 - Set up initial location of projectile
    auto projectile = Sprite::create("projectile.png");
    projectile->setPosition(_player->getPosition());

    //add physics
    auto projectileSize = projectile->getContentSize();
    auto physicsBody = PhysicsBody::createCircle(projectileSize.width/2 );
    physicsBody->setDynamic(true);
    physicsBody->setCategoryBitmask((int)PhysicsCategory::Projectile);
    physicsBody->setContactTestBitmask((int)PhysicsCategory::Monster);
    physicsBody->setCollisionBitmask((int)PhysicsCategory::None);

    projectile->setPhysicsBody(physicsBody);

    // 3 - Determine offset of location to projectile
    Vec2 offset = touchLocation - _player->getPosition();

    // 4 - Bail out if you are shooting down or backwards
    if (offset.x < 0)
    {
        return true;
    }

    // 5 - OK to add now - you've double checked position
    this->addChild(projectile);

    // 6 - Get the direction of where to shoot
    offset.normalize();

    // 7 - Make it shoot far enough to be guaranteed off screen
    auto shootAmount = offset * 1000;

    // 8 - Add the shoot amount to the current position
    auto realDest = shootAmount + projectile->getPosition();

    // 9 - Create the actions
    auto actionMove = MoveTo::create(2.0f, realDest);
    auto actionRemove = RemoveSelf::create();

    projectile->runAction(Sequence::create(actionMove,actionRemove, nullptr));

    return true;
}

void HelloWorld::addMonster(float dt)
{
    //in c++11, we prefer auto in local variable decleration over regular class pointers
    auto monster = Sprite::create("monster.png");

    //add physics
    auto monsterSize = monster->getContentSize();
    auto physicsBody = PhysicsBody::createBox(Size(monsterSize.width , monsterSize.height),
                                              PhysicsMaterial(0.1f, 1.0f, 0.0f));
    physicsBody->setDynamic(true);
    //cocos2d-x lack the collision group, I think we should add it
    physicsBody->setCategoryBitmask((int)PhysicsCategory::Monster);
    physicsBody->setContactTestBitmask((int)PhysicsCategory::Projectile);
    physicsBody->setCollisionBitmask((int)PhysicsCategory::None);

    monster->setPhysicsBody(physicsBody);

    //1
    auto monsterContentSize = monster->getContentSize();
    auto selfContentSize = this->getContentSize();
    int minY = monsterContentSize.height/2;
    int maxY = selfContentSize.height - monsterContentSize.height/2;
    int rangeY = maxY - minY;
    //we must call srand(time(NULL)) before calling rand() to get a random number
    int randomY = (rand() % rangeY) + minY;

    //2
    monster->setPosition(Vec2(selfContentSize.width + monsterContentSize.width/2, randomY));
    this->addChild(monster);

    //3
    int minDuration = 2.0;
    int maxDuration = 4.0;
    int rangeDuration = maxDuration - minDuration;
    int randomDuration = (rand() % rangeDuration) + minDuration;

    //4
    auto actionMove = MoveTo::create(randomDuration, Vec2(-monsterContentSize.width/2, randomY));
    auto actionRemove = RemoveSelf::create();
    //in c++ 11, it's better to use nullptr instead of NULL
   // monster->runAction(Sequence::create(actionMove,actionRemove, nullptr));

    auto loseAction = CallFunc::create([=](){
        auto reveal = TransitionFlipX::create(0.5, GameOverScene::create(this->getContentSize(), false));
        Director::getInstance()->replaceScene(reveal);
    });
    monster->runAction(Sequence::create(actionMove,loseAction, actionRemove,nullptr));
}

bool HelloWorld::onContactBegan(cocos2d::PhysicsContact &contact)
{
    auto nodeA = contact.getShapeA()->getBody()->getNode();
    auto nodeB = contact.getShapeB()->getBody()->getNode();

    //caculate the score
    _monstersDestroyed++;
    if (_monstersDestroyed > 3) {
        auto reveal = TransitionFlipX::create(0.5, GameOverScene::create(this->getContentSize(), true));
        Director::getInstance()->replaceScene(reveal);
    }

    nodeA->removeFromParent();
    nodeB->removeFromParent();
    return true;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>Option: theme_advanced_statusbar_location</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />

Option: theme_advanced_statusbar_location

		This option enables you to specify where the element statusbar with the path and resize tool should be located. This option can be set to "top", "bottom" or "none". The default value is set to "none". This option can only be used when theme is set to advanced and when the theme_advanced_layout_manager option is set to the default value of "SimpleLayout".

Example of usage of the theme_advanced_statusbar_location option:

tinyMCE.init({
	...
	theme_advanced_statusbar_location : "bottom"
});

Index

Copyright © 2003-2006 Moxiecode Systems AB


text:
.class Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager$ResultsTuple;
.super Ljava/lang/Object;
.source "ThreadedStorageService.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ResultsTuple"
.end annotation

# instance fields
.field public completedResults:Ljava/util/List;

.field public errorResults:[Ljava/lang/Throwable;

.field final synthetic this$1:Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager;

# direct methods
.method public constructor <init>(Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager;Ljava/util/List;[Ljava/lang/Throwable;)V
    .locals 1
    .param p2, "completedResults"    # Ljava/util/List;
    .param p3, "errorResults"    # [Ljava/lang/Throwable;

    .prologue
    const/4 v0, 0x0

    .line 1913
    iput-object p1, p0, Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager$ResultsTuple;->this$1:Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 1910
    iput-object v0, p0, Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager$ResultsTuple;->completedResults:Ljava/util/List;

    .line 1911
    iput-object v0, p0, Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager$ResultsTuple;->errorResults:[Ljava/lang/Throwable;

    .line 1914
    iput-object p2, p0, Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager$ResultsTuple;->completedResults:Ljava/util/List;

    .line 1915
    iput-object p3, p0, Lorg/jets3t/service/multi/ThreadedStorageService$ThreadGroupManager$ResultsTuple;->errorResults:[Ljava/lang/Throwable;

    .line 1916
    return-void
.end method


text:
using System.Reflection;

[assembly: AssemblyTitle("OpenCube.IO.Specs")]
[assembly: AssemblyDescription("Tests the specifications of the OpenCube IO API")]


text:
namespace mojo {

// static
mojo_base::mojom::ApplicationState EnumTraits<
    mojo_base::mojom::ApplicationState,
    base::android::ApplicationState>::ToMojom(base::android::ApplicationState
                                                  input) {
  switch (input) {
    case base::android::APPLICATION_STATE_UNKNOWN:
      return mojo_base::mojom::ApplicationState::UNKNOWN;
    case base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES:
      return mojo_base::mojom::ApplicationState::HAS_RUNNING_ACTIVITIES;
    case base::android::APPLICATION_STATE_HAS_PAUSED_ACTIVITIES:
      return mojo_base::mojom::ApplicationState::HAS_PAUSED_ACTIVITIES;
    case base::android::APPLICATION_STATE_HAS_STOPPED_ACTIVITIES:
      return mojo_base::mojom::ApplicationState::HAS_STOPPED_ACTIVITIES;
    case base::android::APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES:
      return mojo_base::mojom::ApplicationState::HAS_DESTROYED_ACTIVITIES;
  }
  NOTREACHED();
  return mojo_base::mojom::ApplicationState::UNKNOWN;
}

// static
bool EnumTraits<mojo_base::mojom::ApplicationState,
                base::android::ApplicationState>::
    FromMojom(mojo_base::mojom::ApplicationState input,
              base::android::ApplicationState* output) {
  switch (input) {
    case mojo_base::mojom::ApplicationState::UNKNOWN:
      *output = base::android::ApplicationState::APPLICATION_STATE_UNKNOWN;
      return true;
    case mojo_base::mojom::ApplicationState::HAS_RUNNING_ACTIVITIES:
      *output = base::android::ApplicationState::
          APPLICATION_STATE_HAS_RUNNING_ACTIVITIES;
      return true;
    case mojo_base::mojom::ApplicationState::HAS_PAUSED_ACTIVITIES:
      *output = base::android::ApplicationState::
          APPLICATION_STATE_HAS_PAUSED_ACTIVITIES;
      return true;
    case mojo_base::mojom::ApplicationState::HAS_STOPPED_ACTIVITIES:
      *output = base::android::ApplicationState::
          APPLICATION_STATE_HAS_STOPPED_ACTIVITIES;
      return true;
    case mojo_base::mojom::ApplicationState::HAS_DESTROYED_ACTIVITIES:
      *output = base::android::ApplicationState::
          APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES;
      return true;
  }
  return false;
}

}  // namespace mojo


text:
var common = require('../common');
var assert = require('assert');
var test = common.fastOrSlow.slow();
var mysql = require(common.dir.lib + '/mysql');
var fs = require('fs');

test.before(function() {
  this.client = common.createClient();
});

test.after(function(done) {
  this.client.end(done);
});

test('Column ordering works properly', {timeout: 15 * 1000}, function(done) {
  var REPEATS = 500;

  this.client.query('CREATE DATABASE ' + common.TEST_DB, function(err) {
    if (err && err.number != mysql.ERROR_DB_CREATE_EXISTS) {
      throw err;
    }
  });
  this.client.query('USE ' + common.TEST_DB);

  this.client.query('DROP TABLE IF EXISTS columnia');
  var fixture = fs.readFileSync(common.dir.fixture + '/columnia.sql', 'utf8');
  this.client.query(fixture);

  var finished = 0;
  var self = this;
  for (var i = 0; i < REPEATS; i++) {
    (function(i) {
      var query = self.client.query("SHOW COLUMNS FROM columnia");

      query.on('row', function(row) {
        if (!row.Type) {
          throw new Error('Column order mixed up after '+i+' queries.');
        }
      });

      query.on('end', function() {
        finished++;
        if (finished === REPEATS) {
          done();
        }
      });
    })(i);
  }
});


text:
Asteroids
=========
Asteroids is an arcade space shooter released in November 1979 by Atari, Inc. and designed by Lyle Rains and Ed Logg. The player controls a spaceship in an asteroid field which is periodically traversed by flying saucers. The object of the game is to shoot and destroy asteroids and saucers while not colliding with either, or being hit by the saucers counter-fire.

Dependecies
===========

* OpenGL
* OpenAL
* DevIL
* SDL2
* Alut
* xercesc
* libxsd

---
* On an **Unix based system**, you need to do your own house keeping and install these dependencies.
* On **Windows**, all the dependecies are included under the deps directory.

Building
===========
To build the game from the source you will need [cmake](http://www.cmake.org/).

    cd Asteroids
    mkdir build
    cd build
    cmake ..
    make

Supported Platforms
===================

* Windows
* GNU/Linux

How the game looks
==================

![ScreenShot1](images/asteroids_screenshot_001.png)
![ScreenShot2](images/asteroids_screenshot_002.png)
![ScreenShot3](images/asteroids_screenshot_003.png)


text:
package com.edgar.module.sys.vo;

import java.util.Set;

public class PermissionVo {
    private int roleId;

    private Set<Integer> permissionIds;

    public int getRoleId() {
        return roleId;
    }

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

    public Set<Integer> getPermissionIds() {
        return permissionIds;
    }

    public void setPermissionIds(Set<Integer> permissionIds) {
        this.permissionIds = permissionIds;
    }
}


text:
/**
 * Creates more descriptive error messages (that may or may not include solutions)
 * based on common query errors.
 *
 * @param errorMessage The errorMessage object from the ErrorBoudary component state
 * @returns A formatted error message string
 */
export declare const formatErrorMessage: (errorMessage: Error) => string;


text:
<!DOCTYPE html>

    link1
    link2

fragment1

fragment2


text:
%{PLUGIN_NAME_CAMELIZE}::Engine.routes.draw do
  get '/' => 'application#index'
end


text:
package net.jokubasdargis.rxbus;

import java.util.Deque;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.TimeUnit;
import rx.Scheduler;
import rx.functions.Action0;
import rx.subscriptions.SerialSubscription;
import rx.subscriptions.Subscriptions;

final class DefaultFlusher implements Flusher {

    private final Scheduler scheduler;
    private final long flushDelayNanos;
    private final Deque<Flushable> flushables = new ConcurrentLinkedDeque<>();
    private final FlushAction flushAction = new FlushAction();
    private final SerialSubscription subscription = new SerialSubscription();

    static Flusher create(Scheduler scheduler, long flushDelay, TimeUnit flushDelayUnit) {
        return new DefaultFlusher(scheduler, flushDelay, flushDelayUnit);
    }

    private DefaultFlusher(Scheduler scheduler, long flushDelay, TimeUnit flushDelayUnit) {
        this.scheduler = scheduler;
        this.flushDelayNanos = flushDelayUnit.toNanos(flushDelay);
        resetSubscription();
    }

    @Override
    public void schedule(Flushable flushable) {
        flushables.add(flushable);
        scheduleFlush();
    }

    private void scheduleFlush() {
        if (subscription.get() == Subscriptions.unsubscribed()) {
            subscription.set(scheduler.createWorker().schedule(
                    flushAction, flushDelayNanos, TimeUnit.NANOSECONDS));
        }
    }

    private void resetSubscription() {
        subscription.set(Subscriptions.unsubscribed());
    }

    private class FlushAction implements Action0 {

        @Override
        public void call() {
            while (!flushables.isEmpty()) {
                Flushable flushable = flushables.remove();
                flushable.flush();
                resetSubscription();
            }
        }
    }
}


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/FloatingPoint.h"

#include "txXPathResultComparator.h"
#include "txExpr.h"
#include "txCore.h"
#include "nsCollationCID.h"
#include "nsILocale.h"
#include "nsILocaleService.h"
#include "nsIServiceManager.h"
#include "nsLocaleCID.h"
#include "prmem.h"

#define kAscending (1<<0)
#define kUpperFirst (1<<1)

txResultStringComparator::txResultStringComparator(bool aAscending,
                                                   bool aUpperFirst,
                                                   const nsAFlatString& aLanguage)
{
    mSorting = 0;
    if (aAscending)
        mSorting |= kAscending;
    if (aUpperFirst)
        mSorting |= kUpperFirst;
    nsresult rv = init(aLanguage);
    if (NS_FAILED(rv))
        NS_ERROR("Failed to initialize txResultStringComparator");
}

nsresult txResultStringComparator::init(const nsAFlatString& aLanguage)
{
    nsresult rv;

    nsCOMPtr<nsILocaleService> localeService =
                    do_GetService(NS_LOCALESERVICE_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsILocale> locale;
    if (!aLanguage.IsEmpty()) {
        rv = localeService->NewLocale(aLanguage,
                                      getter_AddRefs(locale));
    }
    else {
        rv = localeService->GetApplicationLocale(getter_AddRefs(locale));
    }
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsICollationFactory> colFactory =
                    do_CreateInstance(NS_COLLATIONFACTORY_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    rv = colFactory->CreateCollation(locale, getter_AddRefs(mCollation));
    NS_ENSURE_SUCCESS(rv, rv);

    return NS_OK;
}

nsresult
txResultStringComparator::createSortableValue(Expr *aExpr,
                                              txIEvalContext *aContext,
                                              txObject *&aResult)
{
    nsAutoPtr<StringValue> val(new StringValue);
    if (!val) {
        return NS_ERROR_OUT_OF_MEMORY;
    }

    if (!mCollation)
        return NS_ERROR_FAILURE;

    val->mCaseKey = new nsString;
    if (!val->mCaseKey) {
        return NS_ERROR_OUT_OF_MEMORY;
    }

    nsString& nsCaseKey = *(nsString *)val->mCaseKey;
    nsresult rv = aExpr->evaluateToString(aContext, nsCaseKey);
    NS_ENSURE_SUCCESS(rv, rv);

    if (nsCaseKey.IsEmpty()) {
        aResult = val.forget();

        return NS_OK;
    }

    rv = mCollation->AllocateRawSortKey(nsICollation::kCollationCaseInSensitive,
                                        nsCaseKey, &val->mKey, &val->mLength);
    NS_ENSURE_SUCCESS(rv, rv);

    aResult = val.forget();

    return NS_OK;
}

int txResultStringComparator::compareValues(txObject* aVal1, txObject* aVal2)
{
    StringValue* strval1 = (StringValue*)aVal1;
    StringValue* strval2 = (StringValue*)aVal2;

    if (!mCollation)
        return -1;

    if (strval1->mLength == 0) {
        if (strval2->mLength == 0)
            return 0;
        return ((mSorting & kAscending) ? -1 : 1);
    }

    if (strval2->mLength == 0)
        return ((mSorting & kAscending) ? 1 : -1);

    nsresult rv;
    int32_t result = -1;
    rv = mCollation->CompareRawSortKey(strval1->mKey, strval1->mLength,
                                       strval2->mKey, strval2->mLength,
                                       &result);
    if (NS_FAILED(rv)) {
        // XXX ErrorReport
        return -1;
    }

    if (result != 0)
        return ((mSorting & kAscending) ? 1 : -1) * result;

    if ((strval1->mCaseLength == 0) && (strval1->mLength != 0)) {
        nsString* caseString = (nsString *)strval1->mCaseKey;
        rv = mCollation->AllocateRawSortKey(nsICollation::kCollationCaseSensitive,
                                            *caseString,
                                            (uint8_t**)&strval1->mCaseKey,
                                            &strval1->mCaseLength);
        if (NS_FAILED(rv)) {
            // XXX ErrorReport
            strval1->mCaseKey = caseString;
            strval1->mCaseLength = 0;
            return -1;
        }
        delete caseString;
    }
    if ((strval2->mCaseLength == 0) && (strval2->mLength != 0)) {
        nsString* caseString = (nsString *)strval2->mCaseKey;
        rv = mCollation->AllocateRawSortKey(nsICollation::kCollationCaseSensitive,
                                            *caseString,
                                            (uint8_t**)&strval2->mCaseKey,
                                            &strval2->mCaseLength);
        if (NS_FAILED(rv)) {
            // XXX ErrorReport
            strval2->mCaseKey = caseString;
            strval2->mCaseLength = 0;
            return -1;
        }
        delete caseString;
    }
    rv = mCollation->CompareRawSortKey((uint8_t*)strval1->mCaseKey, strval1->mCaseLength,
                                       (uint8_t*)strval2->mCaseKey, strval2->mCaseLength,
                                       &result);
    if (NS_FAILED(rv)) {
        // XXX ErrorReport
        return -1;
    }

    return ((mSorting & kAscending) ? 1 : -1) *
           ((mSorting & kUpperFirst) ? -1 : 1) * result;
}

txResultStringComparator::StringValue::StringValue() : mKey(0),
                                                       mCaseKey(0),
                                                       mLength(0),
                                                       mCaseLength(0)
{
}

txResultStringComparator::StringValue::~StringValue()
{
    PR_Free(mKey);
    if (mCaseLength > 0)
        PR_Free((uint8_t*)mCaseKey);
    else
        delete (nsString*)mCaseKey;
}

txResultNumberComparator::txResultNumberComparator(bool aAscending)
{
    mAscending = aAscending ? 1 : -1;
}

nsresult
txResultNumberComparator::createSortableValue(Expr *aExpr,
                                              txIEvalContext *aContext,
                                              txObject *&aResult)
{
    nsAutoPtr<NumberValue> numval(new NumberValue);
    if (!numval) {
        return NS_ERROR_OUT_OF_MEMORY;
    }

    nsRefPtr<txAExprResult> exprRes;
    nsresult rv = aExpr->evaluate(aContext, getter_AddRefs(exprRes));
    NS_ENSURE_SUCCESS(rv, rv);

    numval->mVal = exprRes->numberValue();

    aResult = numval.forget();

    return NS_OK;
}

int txResultNumberComparator::compareValues(txObject* aVal1, txObject* aVal2)
{
    double dval1 = ((NumberValue*)aVal1)->mVal;
    double dval2 = ((NumberValue*)aVal2)->mVal;

    if (MOZ_DOUBLE_IS_NaN(dval1))
        return MOZ_DOUBLE_IS_NaN(dval2) ? 0 : -mAscending;

    if (MOZ_DOUBLE_IS_NaN(dval2))
        return mAscending;

    if (dval1 == dval2)
        return 0;

    return (dval1 < dval2) ? -mAscending : mAscending;
}


text:
#pragma once

#include <mrpt/maps/CColouredPointsMap.h>
#include <mrpt/maps/CSimplePointsMap.h>

#include <sensor_msgs/msg/point_cloud.hpp>

namespace mrpt::ros2bridge
{
/** \addtogroup mrpt_ros2bridge_grp
 * @{ */

/** @name Point clouds: ROS <-> MRPT
 *  @{ */

/** Convert sensor_msgs/PointCloud -> mrpt::maps::CSimplePointsMap
 *  CSimplePointsMap only contains (x,y,z) data, so
 * sensor_msgs::PointCloud::channels are ignored.
 * \return true on sucessful conversion, false on any error.
 * \sa toROS
 */
bool fromROS(
	const sensor_msgs::msg::PointCloud& msg, mrpt::maps::CSimplePointsMap& obj);

/** Convert mrpt::maps::CSimplePointsMap -> sensor_msgs/PointCloud
 *  The user must supply the "msg_header" field to be copied into the output
 * message object, since that part does not appear in MRPT classes.
 *
 *  Since CSimplePointsMap only contains (x,y,z) data,
 * sensor_msgs::PointCloud::channels will be empty.
 * \return true on sucessful conversion, false on any error.
 * \sa fromROS
 */
bool toROS(
	const mrpt::maps::CSimplePointsMap& obj,
	const std_msgs::msg::Header& msg_header, sensor_msgs::msg::PointCloud& msg);

/** @} @}
 */

}  // namespace mrpt::ros2bridge


text:
<!DOCTYPE html>

    <title>Vigenère Cipher Encoder</title>
    <meta charset="UTF-8">

Vigenère Cipher Encoder

Input code:

      Code
      <input type="text" class="input" placeholder="Enter code here" id="code" autocomplete="on" name="code" autofocus>
      Key
      <input type="text" class="input" placeholder="Enter key here" id="key" autocomplete="on" name="key" autofocus>
      <button class="enter" onclick="submitCode()">Enter!</button>


text:
<html>
<head>
<title>Webgames</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<script type="text/javascript" src="./main.js"></script>
	<script id="shader-fs" type="x-shader/x-fragment">
		precision mediump float;

		varying vec4 vColor;

		void main(void) {
			gl_FragColor = vColor;
		}
	</script>
	<script id="shader-vs" type="x-shader/x-vertex">
		attribute vec3 aVertexPosition;
		attribute vec4 aVertexColor;

		uniform mat4 uMVMatrix;
		uniform mat4 uPMatrix;

		varying vec4 vColor;

		void main(void) {
			gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
			vColor = aVertexColor;
		}
	</script>

	<script src="https://raw.githubusercontent.com/Caligatio/jsSHA/master/src/sha256.js"></script>

	<script>
	// Login

	function login() {
		var username = document.getElementById("name").value;
		var shaObj = new jsSHA("SHA-256", "TEXT");
		shaObj.update(document.getElementById("password").value);
		var password = shaObj.getHash("HEX");

		var loginReq = new XMLHttpRequest;
		loginReq.open("POST", "/login", true);
		loginReq.setRequestHeader("Content-type","application/x-www-form-urlencoded");
		loginReq.send("name=" + username + "&password=" + password);
	}

	</script>
</head>

<body onload="exec();" style="margin:0;padding:0;">
	<input type="text" id="name" placeholder="Username" style="margin-right: 25px; z-index: 99;">
	<input type="password" id="password" placeholder="password" style="z-index: 99;">
	<input type="button" id="submitbtn" value="Login!" style="z-index: 99;" onclick="login()">
    <canvas id="webgames-canvas" style="border: none;width:100%;height:100%;"></canvas>
</body>

</html>


text:
FactoryGirl.define do
  factory :issue do
    subject { generate(:name) }
    priority
    tracker
    project { create(:project_with_tracker, tracker: tracker) }
    author
    status
  end
end


text:
@interface CPImages : CPThemeItem

@end

@interface NSImage (NSConnection)

+ (NSImage *)remoteCopyOfImage:(NSImage *)inImage;

@end


text:
select distinct c1.cohort_definition_id,
  c1.subject_id,
  vo1.visit_occurrence_id,
{@CDM_version == '4'}?{vo1.place_of_service_CONCEPT_ID visit_concept_id,} :
{{@CDM_version == '5'}?{vo1.visit_CONCEPT_ID visit_concept_id,}}
datediff(dd,visit_start_date,visit_end_date) as count_value
INTO #raw_211
from @CDM_schema.visit_occurrence vo1
{@cohort_period_only == 'true'} ? {
join #HERACLES_cohort c1 on vo1.person_id = c1.subject_id
WHERE vo1.visit_start_date>=c1.cohort_start_date and vo1.visit_end_date<=c1.cohort_end_date
} : {
join #HERACLES_cohort_subject c1 on vo1.person_id = c1.subject_id
};

WITH cteRawData as
(
    select cohort_definition_id, visit_concept_id as stratum_1, count_value FROM #raw_211
),
    overallStats as
  (
      select cohort_definition_id,
        stratum_1,
        avg(1.0 * count_value) as avg_value,
        stdev(count_value) as stdev_value,
        min(count_value) as min_value,
        max(count_value) as max_value,
        count_big(*) as total
      from cteRawData
      group by cohort_definition_id, stratum_1
  ),
    valueStats as
  (
      select cohort_definition_id,
        stratum_1,
        count_value,
        total,
        SUM(total) over (partition by cohort_definition_id, stratum_1 order by count_value ROWS UNBOUNDED PRECEDING) as accumulated
      FROM (
             select cohort_definition_id, stratum_1, count_value, count_big(*) as total
             FROM cteRawData
             GROUP BY cohort_definition_id, stratum_1, count_value
           ) D
  )
select o.cohort_definition_id,
  211 as analysis_id,
  CAST(o.stratum_1 as VARCHAR) as stratum_1,
  cast( '' as varchar(1) ) as stratum_2,
  cast( '' as varchar(1) ) as stratum_3,cast( '' as varchar(1) ) as stratum_4, cast( '' as varchar(1) ) as stratum_5,
  o.total as count_value,
  o.min_value,
  o.max_value,
  o.avg_value,
  coalesce(o.stdev_value, 0.0) as stdev_value,
  MIN(case when s.accumulated >= .50 * o.total then count_value else o.max_value end) as median_value,
  MIN(case when s.accumulated >= .10 * o.total then count_value else o.max_value end) as p10_value,
  MIN(case when s.accumulated >= .25 * o.total then count_value else o.max_value end) as p25_value,
  MIN(case when s.accumulated >= .75 * o.total then count_value else o.max_value end) as p75_value,
  MIN(case when s.accumulated >= .90 * o.total then count_value else o.max_value end) as p90_value
into #results_dist_211
from valueStats s
join overallStats o on s.cohort_definition_id = o.cohort_definition_id and s.stratum_1 = o.stratum_1
GROUP BY o.cohort_definition_id, o.stratum_1, o.total, o.min_value, o.max_value, o.avg_value, o.stdev_value
;

TRUNCATE TABLE #raw_211;
DROP TABLE #raw_211;


text:
<?php use_helper('ysJQueryRevolutions')  //  ysJQueryRevolutions Helper ?>
<?php use_helper('ysJQueryUIDialog')     //  ysJQueryUIDialog Helper ?>

<?php echo ui_link_button(array('id' => 'btnDialogListener','value' => 'Listener'))?>

<?php ui_dialog_init('dialogId' , array(
        'listener' => array(
          'selector' => '#btnDialogListener',
          'oneEvent' => 'click'),
        'title' => 'Lorem ipsum',
        'modal' => true,
        'buttons' => array('Close' => like_function(ui_dialog_close('this'))),
        'beforeclose' => like_function("alert('Before Close Dialog');")),
        'style="display:none"')?>

        Lorem ipsum dolor sit amet, consectetur adipisicing elit,
        sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
        nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
        reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
        pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
        culpa qui officia deserunt mollit anim id est laborum

<?php ui_dialog_end() ?>

  Lorem Ipsum is simply dummy text of the printing and typesetting
  industry. Lorem Ipsum has been the industry's standard dummy text
  ever since the 1500s, when an unknown printer took a galley of type
  and scrambled it to make a type specimen book. It has survived not
  only five centuries, but also the leap into electronic typesetting,
  remaining essentially unchanged.
  It was popularised in the 1960s with the release of Letraset
  sheets containing Lorem Ipsum passages, and more recently with
  desktop publishing software like Aldus PageMaker including versions
  of Lorem Ipsum.

<fieldset><legend>Actions buttons for ui.dialog</legend>
  <?php echo ui_button_pane_init(
           $type = 'single',
           array(
            'btnDestroyDialog'   => array('value' => 'Destroy Dialog'),
            'btnBuildDialog'   => array('value' => 'Build Dialog'),
            'btnDisableDialog'   => array('value' => 'Disable Dialog'),
            'btnEnableDialog'   => array('value' => 'Enable Dialog'),
            'btnCloseDialog'   => array('value' => 'Close Dialog'),
            'btnOpenDialog'   => array('value' => 'Open Dialog'),
            'btnMoveToTopDialog'   => array('value' => 'Move to top Dialog'),
            'btnIsOpenDialog' => array('value' => 'Is open')))?>
  <?php echo ui_button_pane_end() ?>

</fieldset>

<?php
  /*
   * Add jQuery support to the buttons above
   * **click event**
   */
  echo add_jquery_support("#btnDestroyDialog",'click',like_function(ui_dialog_destroy('#anotherDialog')));

  echo add_jquery_support(
        "#btnBuildDialog",
        'click',
        like_function(
          ui_dialog_build(
            '#anotherDialog', array('title' => 'What is Lorem ipsum?'))));

  echo add_jquery_support("#btnDisableDialog",'click',like_function(ui_dialog_disable('#anotherDialog')));
  echo add_jquery_support("#btnEnableDialog",'click',like_function(ui_dialog_enable('#anotherDialog')));
  echo add_jquery_support("#btnCloseDialog",'click',like_function(ui_dialog_close('#anotherDialog')));
  echo add_jquery_support("#btnOpenDialog",'click',like_function(ui_dialog_open('#anotherDialog')));
  echo add_jquery_support("#btnMoveToTopDialog",'click',like_function(ui_dialog_move_to_top('#anotherDialog')));
  echo add_jquery_support("#btnIsOpenDialog",'click',like_function('isOpenDialog()'));
?>


text:
import java.util.*;

public class CountOccurrenceOfWords {
  public static void main(String[] args) {
    // Set text in a string
    String text = "Good morning. Have a good class. " +
      "Have a good visit. Have fun!";

    // Create a TreeMap to hold words as key and count as value
    Map<String, Integer> map = new TreeMap<String, Integer>();

    String[] words = text.split("[ \n\t\r.,;:!?(){}]");
    for (int i = 0; i < words.length; i++) {
      String key = words[i].toLowerCase();

      if (key.length() > 0) {
        if (!map.containsKey(key)) {
          map.put(key, 1);
        }
        else {
          int value = map.get(key);
          value++;
          map.put(key, value);
        }
      }
    }

    // Get all entries into a set
    Set<Map.Entry<String, Integer>> entrySet = map.entrySet();

    // Get key and value from each entry
    for (Map.Entry<String, Integer> entry: entrySet)
      System.out.println(entry.getKey() + "\t" + entry.getValue());
  }
}


text:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        int n = Integer.parseInt(br.readLine());
        int in = 0, out = 0;

        for (int i = 0; i < n; i++) {
            int x = Integer.parseInt(br.readLine());
            if (x >= 10 && x <= 20) {
                in++;
            } else {
                out++;
            }
        }
        System.out.println(in + " in\n" + out + " out");
    }
}