text:
const mongoose = require('mongoose');

// ----------------------
// USERS
// ----------------------
const usersSchema = new mongoose.Schema({
  email:     { type: String, required: true },
  password:  { type: String, required: true },
  nickName: {type: String, required:true },
  createdAt: { type: Date, default: Date.now },
  wins: {type: Number,default:0},
  losses: {type: Number,default:0},
  winStreak: {type: Number, default:0},
  winRatio: {type: Number,default:0},
  totalGames: {type: Number,default:0},
  avatarURL: {type: String},
  catchPhrase: {type: String},
  paddleGripStyle: {type: String},
  signatureMove: {type: String},
  homeTown: {type: String},
  claimed: {type:Boolean, default: true}
})

const gameSchema = new mongoose.Schema({
  playerOne: {type: String, required: true},
  playerTwo: {type: String, required: true},
  winner: {type: String, required: true},
  loser: {type: String, required: true},
  playerOneScore: {type: Number, required: true},
  playerTwoScore: {type: Number, required: true}

})

const queueSchema = new mongoose.Schema({
  queueMembers: [{
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User'
  }]
})

module.exports = {
  User: mongoose.model('User', usersSchema),
  Game: mongoose.model('Game', gameSchema),
  Queue: mongoose.model('Queue', queueSchema),
}


text:
package com.pivotal.gemfirexd.internal.impl.sql.execute;

import com.pivotal.gemfirexd.internal.iapi.error.StandardException;
import com.pivotal.gemfirexd.internal.iapi.services.sanity.SanityManager;
import com.pivotal.gemfirexd.internal.iapi.sql.Activation;
import com.pivotal.gemfirexd.internal.iapi.sql.ResultDescription;
import com.pivotal.gemfirexd.internal.iapi.sql.conn.LanguageConnectionContext;
import com.pivotal.gemfirexd.internal.iapi.sql.execute.CursorResultSet;
import com.pivotal.gemfirexd.internal.iapi.sql.execute.ExecRow;
import com.pivotal.gemfirexd.internal.iapi.sql.execute.NoPutResultSet;
import com.pivotal.gemfirexd.internal.iapi.store.access.TransactionController;
import com.pivotal.gemfirexd.internal.iapi.types.SQLInteger;

import java.util.Properties;

/**
 * Delete the rows from the specified
 * base table. This will cause constraints to be checked
 * and triggers to be executed based on the c's and t's
 * compiled into the insert plan.
 */
class DeleteVTIResultSet extends DMLVTIResultSet
{

	private java.sql.ResultSet		rs;
    private TemporaryRowHolderImpl rowHolder;
    /* If the delete is deferred use a row holder to keep the list of IDs of the rows to be deleted.
     * A RowHolder is used instead of a simple list because a RowHolder will spill to disk when it becomes
     * too large. The row will consist of just one column -- an integer.
     */

    /*
     * class interface
     *
     */
    /**
     *
	 * @exception StandardException		Thrown on error
     */
    public DeleteVTIResultSet
	(
		NoPutResultSet		source,
		Activation			activation
	)
		throws StandardException
    {
		super(source, activation);
	}

	/**
		@exception StandardException Standard Derby error policy
	*/
	protected void openCore() throws StandardException
	{
		lcc.getStatementContext().setTopResultSet(this, subqueryTrackingArray);

		ExecRow row = getNextRowCore(sourceResultSet);

		if (row != null)
		{
			rs = activation.getTargetVTI();

			if (SanityManager.DEBUG)
			{
				SanityManager.ASSERT(rs != null,
					"rs expected to be non-null");
			}
		}

		/* The source does not know whether or not we are doing a
		 * deferred mode delete.  If we are, then we must clear the
		 * index scan info from the activation so that the row changer
		 * does not re-use that information (which won't be valid for
		 * a deferred mode delete).
		 */
		if (constants.deferred)
		{
			activation.clearIndexScanInfo();
            if( null == rowHolder)
                rowHolder =
                    new TemporaryRowHolderImpl(activation, new Properties());
		}

        try
        {
            while ( row != null )
            {
                if( !constants.deferred)
                    rs.deleteRow();
                else
                {
                    ExecRow rowId = new ValueRow(1);
                    rowId.setColumn( 1, new SQLInteger( rs.getRow()));
                    rowHolder.insert( rowId);
                }

                rowCount++;

                // No need to do a next on a single row source
                if (constants.singleRowSource)
                {
                    row = null;
                }
                else
                {
                    row = getNextRowCore(sourceResultSet);
                }
			}
		}
        catch (StandardException se)
        {
            throw se;
        }
        catch (Throwable t)
        {
            throw StandardException.unexpectedUserException(t);
        }

		if (constants.deferred)
		{
			CursorResultSet tempRS = rowHolder.getResultSet();
			try
			{
                ExecRow	deferredRowBuffer = null;

				tempRS.open();
				while ((deferredRowBuffer = tempRS.getNextRow()) != null)
				{
                    int rowNumber = deferredRowBuffer.getColumn( 1).getInt();
                    rs.absolute( rowNumber);
					rs.deleteRow();
				}
			}
            catch (Throwable t)
            {
                throw StandardException.unexpectedUserException(t);
            }
            finally
			{
				sourceResultSet.clearCurrentRow();
				tempRS.close(false);
			}
		}

		if (rowHolder != null)
		{
			rowHolder.close();
			// rowHolder kept across opens
		}
    } // end of openCore

  @Override
  public void accept(ResultSetStatisticsVisitor visitor) {
    visitor.visit(this);
  }
}

redpajama_set_name: RedPajamaGithub


text:
#include <aws/quicksight/model/DataSetReference.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace QuickSight
{
namespace Model
{

DataSetReference::DataSetReference() :
    m_dataSetPlaceholderHasBeenSet(false),
    m_dataSetArnHasBeenSet(false)
{
}

DataSetReference::DataSetReference(JsonView jsonValue) :
    m_dataSetPlaceholderHasBeenSet(false),
    m_dataSetArnHasBeenSet(false)
{
  *this = jsonValue;
}

DataSetReference& DataSetReference::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("DataSetPlaceholder"))
  {
    m_dataSetPlaceholder = jsonValue.GetString("DataSetPlaceholder");

    m_dataSetPlaceholderHasBeenSet = true;
  }

  if(jsonValue.ValueExists("DataSetArn"))
  {
    m_dataSetArn = jsonValue.GetString("DataSetArn");

    m_dataSetArnHasBeenSet = true;
  }

  return *this;
}

JsonValue DataSetReference::Jsonize() const
{
  JsonValue payload;

  if(m_dataSetPlaceholderHasBeenSet)
  {
   payload.WithString("DataSetPlaceholder", m_dataSetPlaceholder);

  }

  if(m_dataSetArnHasBeenSet)
  {
   payload.WithString("DataSetArn", m_dataSetArn);

  }

  return payload;
}

} // namespace Model
} // namespace QuickSight
} // namespace Aws


text:
if (typeof window !== 'undefined') {
  EthTx = (typeof window.EthTx !== 'undefined') ? window.EthTx : require('ethereumjs-tx')
}

// Node environment
if (typeof global !== 'undefined') {
  EthTx = (typeof global.EthTx !== 'undefined') ? global.EthTx : require('ethereumjs-tx')
}


text:
MY_PATH=$(readlink -f  $(dirname $0))

# what type of terminal
OPTION_TITLE='--title'
OPTION_WORKING_DIR='working-directory'
OPTION_CORE_GEOMETRY='--geometry=50x10+0+0'
OPTION_RM_GEOMETRY='--geometry=50x10+500+0'
OPTION_COMMAND='--command'

if [ $(which gnome-terminal) ]; then
    TERMINAL=gnome-terminal
elif [ $(which mate-terminal) ]; then
    TERMINAL=mate-terminal
elif [ $(which xfce4-terminal) ]; then
    TERMINAL=xfce4-terminal
elif [ $(which lxterminal) ]; then
    TERMINAL=lxterminal
elif [ $(which konsole) ]; then
    TERMINAL=konsole
    OPTION_WORKING_DIR='workdir'
    OPTION_CORE_GEOMETRY=''
    OPTION_RM_GEOMETRY=''
    OPTION_PM_GEOMETRY=''
    OPTION_COMMAND='-e'
    OPTION_TITLE='-T'
fi

echo "Process Manager"

# boot gzserver
${TERMINAL} ${OPTION_CORE_GEOMETRY} ${OPTION_TITLE}="gzserver" --${OPTION_WORKING_DIR}=${MY_PATH} ${OPTION_COMMAND}="bash -c 'source ./devel/setup.bash; roslaunch catvehicle catvehicle_skidpan.launch'"&
# boot gzclient
${TERMINAL} ${OPTION_RM_GEOMETRY} ${OPTION_TITLE}="gzclient" --${OPTION_WORKING_DIR}=${MY_PATH} ${OPTION_COMMAND}="bash -c 'source ./devel/setup.bash; gzclient'"
# boot catvehicle2autoware
${TERMINAL} ${OPTION_RM_GEOMETRY} ${OPTION_TITLE}="catvehicle2autoware" --${OPTION_WORKING_DIR}=${MY_PATH} ${OPTION_COMMAND}="bash -c 'source ./devel/setup.bash; roslaunch point_cloud_converter point_cloud_converter.launch'"
${TERMINAL} ${OPTION_RM_GEOMETRY} ${OPTION_TITLE}="catvehicle2autoware" --${OPTION_WORKING_DIR}=${MY_PATH} ${OPTION_COMMAND}="bash -c 'source ./devel/setup.bash; roslaunch laser_scan_converter laser_scan_converter.launch'"
${TERMINAL} ${OPTION_RM_GEOMETRY} ${OPTION_TITLE}="catvehicle2autoware" --${OPTION_WORKING_DIR}=${MY_PATH} ${OPTION_COMMAND}="bash -c 'source ./devel/setup.bash; roslaunch twist_cmd_converter twist_cmd_converter.launch'"


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;

// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108

namespace System.Net
{
  public partial class DownloadDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
  {
    #region Methods and constructors
    internal DownloadDataCompletedEventArgs() : base (default(Exception), default(bool), default(Object))
    {
    }
    #endregion

    #region Properties and indexers
    public byte[] Result
    {
      get
      {
        Contract.Ensures(!this.Cancelled);
        Contract.Ensures(this.Error == null);

        return default(byte[]);
      }
    }
    #endregion
  }
}


text:
require 'spec_helper'
require 'barcodes/symbology/code39extended'

describe Barcodes::Symbology::Code39Extended do
  describe "#new" do

  end
end


text:
@interface PodsDummy_TestPodLib2AndSourceTree : NSObject
@end
@implementation PodsDummy_TestPodLib2AndSourceTree
@end


text:
var Flickr = require('flickrapi');
var Photo = require('./photos');
var conf = require('../lib/config');
var base58 = require('../lib/base58');

var FlickrOptions = {
  api_key: conf.get('FLICKR_KEY'),
  secret: conf.get('FLICKR_SECRET'),
  access_token: conf.get('FLICKR_OAUTH_KEY'),
  access_token_secret: conf.get('FLICKR_OAUTH_SECRET'),
  noAPI: true,
  nobrowser: true
};
exports.flickrSearch = function (res, params) {
  Flickr.authenticate(FlickrOptions, function (error, flickr) {

    flickr.photos.search(params, function (err, result) {
      if (err) {
        res.json(500, err);
        return;
      }
      res.json(result);
    });
  });
};
exports.updatePhoto = function(res, id, cb){
  var msg = '';

  Photo.getPhotoByFlickrId(res, id, function(err, photo){
    if(err) {
      msg = 'Error retrieving photo data from database';
      if(!cb) res.status(500).json(msg);
      else cb(msg);
      return;
    }
    // console.log('db photo', photo);
    if(photo == null){
      msg = 'No photo in database associated with this flickr photo id. Nothing to update';
      if(!cb) res.status(500).json(msg);
      else cb(msg);
      return;
    }
    Flickr.authenticate(FlickrOptions, function (error, flickr) {
      var params = {
        photo_id: id
      }
      flickr.photos.getInfo(params, function (err, fPhoto) {
        if (err) {
          msg = 'Error retrieving photo data from flickr. Photo may be deleted. Check http://flickr.com/p/' + base58.encode(parseInt(id));
          if(!cb) res.status(500).json(msg);
          else cb(msg);
          return;
        }
        //console.log('flickr photo', fPhoto);
        if(fPhoto.photo.title && fPhoto.photo.title._content)
          photo.description = fPhoto.photo.title._content;
        if(fPhoto.photo.dates && fPhoto.photo.dates.taken && !isNaN(Date.parse(fPhoto.photo.dates.taken)))
          photo.dateTaken = new Date(fPhoto.photo.dates.taken);
        if(fPhoto.photo.location && fPhoto.photo.location.latitude && fPhoto.photo.location.longitude){
          photo.latitude = fPhoto.photo.location.latitude;
          photo.longitude = fPhoto.photo.location.longitude;
        }
        photo.save(function(err){
          if (err) {
            msg = 'Error saving photo data from flickr';
            if(!cb) res.status(500).json(msg);
            else cb(msg);
            return;
          }
          var msg = 'Photo updated';
          if(cb) cb(null, msg)
          else res.json(msg);
        });
      });
    });
  });
}
exports.undeleteIfExistOnFlickr = function (res, id, cb) {
  var params = {
    photo_id: id
  }
  console.log('undeleteIfExistOnFlickr');
  Flickr.authenticate(FlickrOptions, function (error, flickr) {
    flickr.photos.getInfo(params, function (err, result) {
      if (err) {
        // TODO: is there a better way to check this?
        if(err.message && err.message.match(/not found/) && err.message.match(/invalid ID/))
        {
          console.log('photo doesn\'t exist. cannot undelete', err);
          if(cb) cb('Photo doesn\'t exist on flickr');
          else res.status(500).json('Photo doesn\'t exist on flickr');
        }
        else{
          if(cb) cb('Error retrieving photo from Flickr. Can\'t Undelete');
          else res.status(500).json('Error retrieving photo from Flickr. Can\'t Undelete');
        }
        return;
      }
      Photo.toggleDelete(res, {flickrId: id}, false, cb);
    });
  });
};
exports.deleteIfDoesntExistOnFlickr = function (res, id, cb) {
  var params = {
    photo_id: id
  }
  console.log('deleteIfDoesntExistOnFlickr');
  Flickr.authenticate(FlickrOptions, function (error, flickr) {
    flickr.photos.getInfo(params, function (err, result) {
      if (err) {
        // TODO: is there a better way to check this?
        console.log(err);
        if(err.message && err.message.match(/not found/) && err.message.match(/invalid ID/))
        {
          console.log('photo doesn\'t exist. marking as deleted', err);
          Photo.toggleDelete(res, {flickrId: id}, true, cb);
        }
        else{
          res.status(500).json('Error retrieving photo');
        }
        return;
      }
      var errMsg = 'Photo still exists on Flickr. Not marked as deleted';
      if(cb) cb(errMsg, result);
      else res.status(500).json(errMsg);
    });
  });
};

exports.getPhoto = function (res, id, cb) {
  var params = {
    photo_id: id
  }
  console.log('getphoto');
  Flickr.authenticate(FlickrOptions, function (error, flickr) {
    flickr.photos.getInfo(params, function (err, result) {
      if (err) {
        var msg = 'Error retrieving photo from Flickr. Photo may be deleted';
        if(cb) cb(msg)
        else res.status(500).json(msg);
        return;
      }
      if(cb) cb(null, result);
      else res.json(result);
    });
  });
};

exports.isFlickrAdmin = function(res, users){
  var flickrPage = conf.get('FLICKR_USER_ID').trim();
  var regex = new RegExp('^' + flickrPage + '$', 'gi');
  if(typeof(users) === 'string'){
    users = [users];
  }
  if(typeof(users) === 'object' && typeof(users.length) === 'undefined'){
    users = [];
  }

  var authorized = false;
  if(flickrPage !== ''){
    users.forEach(function(user){
      if(!authorized && regex.test(user.trim())){
        authorized = true;
      }
    });
  }
  if(authorized){
    res.json('Ok');
  }
  else{
    res.status(401).json('Not authorized');
  }
};


text:
using System.Web.Mvc;

namespace PollQuestionnaire.UI.Web.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "*******";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "*******";

            return View();
        }
    }
}


text:
var fs = require('fs')

var configPath = 'data/strava_config'

var token
var clientId
var clientSecret
var redirectUri

var readConfigFile = function () {
  try {
    var config = fs.readFileSync(configPath, { encoding: 'utf-8' })
    config = JSON.parse(config)
    if (config.access_token) token = config.access_token
    if (config.client_id) clientId = config.client_id
    if (config.client_secret) clientSecret = config.client_secret
    if (config.redirect_uri) redirectUri = config.redirect_uri
  } catch (err) {
    // Config file does not exist. This may be a valid case if the config is
    // either passed directly as an argument or via environment variables
  }
}

var readEnvironmentVars = function () {
  if (typeof process.env.STRAVA_ACCESS_TOKEN !== 'undefined') { token = process.env.STRAVA_ACCESS_TOKEN }
  if (typeof process.env.STRAVA_CLIENT_ID !== 'undefined') { clientId = process.env.STRAVA_CLIENT_ID }
  if (typeof process.env.STRAVA_CLIENT_SECRET !== 'undefined') { clientSecret = process.env.STRAVA_CLIENT_SECRET }
  if (typeof process.env.STRAVA_REDIRECT_URI !== 'undefined') { redirectUri = process.env.STRAVA_REDIRECT_URI }
}

var fetchConfig = function (config) {
  if (config) {
    if (config.access_token) token = config.access_token
    if (config.client_id) clientId = config.client_id
    if (config.client_secret) clientSecret = config.client_secret
    if (config.redirect_uri) redirectUri = config.redirect_uri
  } else {
    readConfigFile()
    readEnvironmentVars()
  }
}

module.exports = {
  fetchConfig: fetchConfig,
  getToken: function () {
    if (!token) {
      fetchConfig()
    }

    if (token) {
      return token
    } else {
      return undefined
    }
  },
  getClientId: function () {
    if (!clientId) {
      fetchConfig()
    }

    if (clientId) {
      return clientId
    } else {
      console.log('No client id found')
      return undefined
    }
  },
  getClientSecret: function () {
    if (!clientSecret) {
      fetchConfig()
    }

    if (clientSecret) {
      return clientSecret
    } else {
      console.log('No client secret found')
      return undefined
    }
  },
  getRedirectUri: function () {
    if (!redirectUri) {
      fetchConfig()
    }

    if (redirectUri) {
      return redirectUri
    } else {
      console.log('No redirectUri found')
      return undefined
    }
  },
  purge: function () {
    token = undefined
    clientId = undefined
    clientSecret = undefined
    redirectUri = undefined
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/message"></TextView><EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:inputType="number"></EditText>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/Button01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/change" />

    <Button
        android:id="@+id/Button02"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/clear" />

    <CheckBox
        android:id="@+id/checkBox1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="enable Debug mode" />

</LinearLayout>

<TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Calculate Result DalVik"></TextView>
<TextView android:id="@+id/TextView03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/elapsed"></TextView>
<TextView android:id="@+id/TextView04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Calculate Result Native"></TextView>
<TextView android:id="@+id/TextView05" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/elapsedJni"></TextView>

</LinearLayout>


text:
package org.yanzi.activity;

import org.yanzi.camera.CameraInterface;
import org.yanzi.camera.CameraInterface.CamOpenOverCallback;
import org.yanzi.camera.preview.CameraTextureView;
import org.yanzi.playcamera_v2.R;
import org.yanzi.util.DisplayUtil;

import android.app.Activity;
import android.graphics.Point;
import android.graphics.SurfaceTexture;
import android.os.Bundle;
import android.view.Menu;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageButton;

public class CameraActivity extends Activity implements CamOpenOverCallback {
	private static final String TAG = "yanzi";
	CameraTextureView textureView = null;
	ImageButton shutterBtn;
	float previewRate = -1f;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Thread openThread = new Thread() {
			@Override
			public void run() {
				// TODO Auto-generated method stub
				CameraInterface.getInstance().doOpenCamera(CameraActivity.this);
			}
		};
		openThread.start();
		setContentView(R.layout.activity_camera);
		initUI();
		initViewParams();
		textureView.setAlpha(1.0f);

		shutterBtn.setOnClickListener(new BtnListeners());
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.camera, menu);
		return true;
	}

	private void initUI() {
		textureView = (CameraTextureView) findViewById(R.id.camera_textureview);
		shutterBtn = (ImageButton) findViewById(R.id.btn_shutter);
	}

	private void initViewParams() {
		LayoutParams params = textureView.getLayoutParams();
		Point p = DisplayUtil.getScreenMetrics(this);
		params.width = p.x;
		params.height = p.y;
		previewRate = DisplayUtil.getScreenRate(this); // Ĭ��ȫ���ı���Ԥ��
		textureView.setLayoutParams(params);

		// �ֶ���������ImageButton�Ĵ�СΪ120dip��120dip,ԭͼƬ��С��64��64
		LayoutParams p2 = shutterBtn.getLayoutParams();
		p2.width = DisplayUtil.dip2px(this, 80);
		p2.height = DisplayUtil.dip2px(this, 80);
		;
		shutterBtn.setLayoutParams(p2);

	}

	@Override
	public void cameraHasOpened() {
		// TODO Auto-generated method stub
		SurfaceTexture surface = textureView._getSurfaceTexture();
		CameraInterface.getInstance().doStartPreview(surface, previewRate);
	}

	private class BtnListeners implements OnClickListener {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			switch (v.getId()) {
			case R.id.btn_shutter:
				CameraInterface.getInstance().doTakePicture();
				break;
			default:
				break;
			}
		}

	}

}


text:
<?php

// @codingStandardsIgnoreFile

namespace Magento\Eav\Test\Unit\Model\ResourceModel\Attribute;

/**
 * Class CollectionTest
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class CollectionTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\Eav\Model\ResourceModel\Attribute\Collection|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $model;

    /**
     * @var \Magento\Framework\Data\Collection\EntityFactory|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $entityFactoryMock;

    /**
     * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $loggerMock;

    /**
     * @var \Magento\Framework\Data\Collection\Db\FetchStrategyInterface|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $fetchStrategyMock;

    /**
     * @var \Magento\Framework\Event\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $eventManagerMock;

    /**
     * @var \Magento\Eav\Model\Config|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $eavConfigMock;

    /**
     * @var \Magento\Eav\Model\Entity\Type
     */
    protected $entityTypeMock;

    /**
     * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $storeManagerMock;

    /**
     * @var \Magento\Framework\DB\Adapter\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $connectionMock;

    /**
     * @var \Magento\Framework\Model\ResourceModel\Db\AbstractDb|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $resourceMock;

    /**
     * @var \Magento\Framework\DB\Select|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $select;

    /**
     * @var \PHPUnit_Framework_MockObject_MockObject
     */
    protected $selectRenderer;

    protected function setUp()
    {
        $this->entityFactoryMock = $this->getMock('Magento\Framework\Data\Collection\EntityFactory', [], [], '', false);
        $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface');
        $this->fetchStrategyMock = $this->getMock('Magento\Framework\Data\Collection\Db\FetchStrategyInterface');
        $this->eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface');

        $this->eavConfigMock = $this->getMock('Magento\Eav\Model\Config', [], [], '', false);
        $this->entityTypeMock = $this->getMock('Magento\Eav\Model\Entity\Type', ['__wakeup'], [], '', false);
        $this->entityTypeMock->setAdditionalAttributeTable('some_extra_table');
        $this->eavConfigMock->expects($this->any())
            ->method('getEntityType')
            ->will($this->returnValue($this->entityTypeMock));

        $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface');
        $this->storeManagerMock->expects($this->any())
            ->method('getStore')
            ->will($this->returnSelf());

        $this->connectionMock = $this->getMock(
            'Magento\Framework\DB\Adapter\Pdo\Mysql',
            ['select', 'describeTable', 'quoteIdentifier', '_connect', '_quote'],
            [],
            '',
            false);
        $this->selectRenderer = $this->getMockBuilder('Magento\Framework\DB\Select\SelectRenderer')
            ->disableOriginalConstructor()
            ->getMock();

        $this->select = new \Magento\Framework\DB\Select($this->connectionMock, $this->selectRenderer);

        $this->resourceMock = $this->getMockForAbstractClass(
            'Magento\Framework\Model\ResourceModel\Db\AbstractDb',
            [],
            '',
            false,
            true,
            true,
            ['__wakeup', 'getConnection', 'getMainTable', 'getTable']
        );

        $this->connectionMock->expects($this->any())
            ->method('select')
            ->will($this->returnValue($this->select));
        $this->connectionMock->expects($this->any())
            ->method('quoteIdentifier')
            ->will($this->returnArgument(0));
        $this->connectionMock->expects($this->any())
            ->method('describeTable')
            ->will($this->returnvalueMap(
                [
                    [
                        'some_main_table',
                        null,
                        [
                            'col1' => [],
                            'col2' => [],
                        ],
                    ],
                    [
                        'some_extra_table',
                        null,
                        [
                            'col2' => [],
                            'col3' => [],
                        ]
                    ],
                    [
                        null,
                        null,
                        [
                            'col2' => [],
                            'col3' => [],
                            'col4' => [],
                        ]
                    ],
                ]
            ));
        $this->connectionMock->expects($this->any())
            ->method('_quote')
            ->will($this->returnArgument(0));

        $this->resourceMock->expects($this->any())
            ->method('getConnection')
            ->will($this->returnValue($this->connectionMock));
        $this->resourceMock->expects($this->any())
            ->method('getMainTable')
            ->will($this->returnValue('some_main_table'));
        $this->resourceMock->expects($this->any())
            ->method('getTable')
            ->will(
                $this->returnValue('some_extra_table')
            );
    }

    /**
     * @dataProvider initSelectDataProvider
     */
    public function testInitSelect($column, $value)
    {
        $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
        $this->model = $helper->getObject('Magento\Customer\Model\ResourceModel\Attribute\Collection',
            [
                'entityFactory' => $this->entityFactoryMock,
                'logger' => $this->loggerMock,
                'fetchStrategy' => $this->fetchStrategyMock,
                'eventManager' => $this->eventManagerMock,
                'eavConfig' => $this->eavConfigMock,
                'storeManager' => $this->storeManagerMock,
                'connection' => $this->connectionMock,
                'resource' => $this->resourceMock
            ]
        );

        $this->model->addFieldToFilter($column, $value);
        $this->selectRenderer->expects($this->once())
            ->method('render')
            ->withAnyParameters();
        $this->model->getSelectCountSql()->assemble();
    }

    public function initSelectDataProvider()
    {
        return [
            'main_table_expression' => [
                'col2', '1',
            ],
            'additional_table_expression' => [
                'col3', '2',
            ]
        ];
    }
}


text:
var fs = require('fs-extra'),
    username = require('username'),
    readline = require('readline'),
    config = require(__dirname + '/config/config'),
    checks = require(__dirname + '/checks'),

    rl = readline.createInterface(process.stdin, process.stdout),

    localDirName = '.federico';

'use strict';

/**
 * handles file creation, modification and deletion
 * @module federico/files
 */
var Files = module.exports = {

    /**
     * @property {string} cwd Current working directory
     */
    cwd: process.cwd() + '/',

    /**
     * @property {array} extensions Current supported extensions defined in config
     */
    extensions: config.extensions,

    /**
     * initializes local config creation
     * @param {object} [options] Options defined in cli program call
     * @param {boolean} options.dir True and set if defined in cli
     * @param {boolean} options.force True if defined in cli
     */
    initConfig: function(options) {
        Files.createConfig(options, function() {
            Files.copyTemplateFilesToLocal();
        });
    },

    /**
     * creates federico local config file
     * @param {object} [options] Options defined in cli program call
     * @param {boolean} options.dir True and set if defined in cli
     * @param {boolean} options.force True if defined in cli
     * @param {function} [cb] callback function
     */
    createConfig: function(options, cb) {

        // create path
        var dir = Files.cwd,
            fileName = 'config.json';

        if (options.dir) {
            dir += options.dir + '/';
        }

        if (checks.isProjectRoot(dir, options.force)) {
            var filePath = dir + config.paths.root + localDirName + '/';

            // file already exists?
            if (fs.existsSync(filePath + fileName)) {

                console.log('Config already exists.');

                rl.question("Overwrite? [yes]/no: ", function(answer) {
                    if (answer.match(/^y(es)?$/i)) {
                        fs.outputJson(filePath + fileName, config, function(err) {
                            if (err) {
                                console.error('\nError: writing file: "' + filePath + fileName + '".\n\n');
                                process.exit(1);
                            }
                            console.log('\nCreated config file.\n\n');

                            if (typeof cb === 'function') {
                                cb();
                            } else {
                                process.exit();
                            }
                        });
                    } else {
                        console.log('\nSkipped creating config file.\n\n');
                        if (typeof cb === 'function') {
                            cb();
                        } else {
                            process.exit();
                        }
                    }
                });

            } else {
                // file does not exist, create
                fs.outputJson(filePath + fileName, config, function(err) {
                    if (err) {
                        console.error('\nError: writing file: "' + filePath + fileName + '".\n\n');
                        process.exit(1);
                    }
                    console.log('\nCreated config file.\n\n');
                    if (typeof cb === 'function') {
                        cb();
                    } else {
                        process.exit();
                    }
                });
            }

        } else {
            console.error('\nError: no package.json found. "' + dir + '" is not a project root.\n\n');
            process.exit(1);
        }

    },

    /**
     * copies templates files to local project, to enable customization of components and elements
     * default source code
     */
    copyTemplateFilesToLocal: function() {
        fs.readdir(Files.cwd + config.paths.root + localDirName + '/tpl', function(err, files) {
            if (err) {
                if (err.code === 'ENOENT') {
                    // no such dir; copy
                    fs.copy(__dirname + '/tpl', Files.cwd + config.paths.root + localDirName + '/tpl', function(err) {
                        if (err) {
                            console.log(err.error + '\n\n');
                            process.exit(1);
                        }
                        console.log('\nCreated config templates.\n\n');
                        process.exit();
                    });
                } else {
                    console.log(err.error + '\n\n');
                    process.exit(1);
                }
            } else {
                // dir exists
                console.log('Local templates directory already exists. All changes will be lost!');

                rl.question("Continue? [yes]/no: ", function(answer) {
                    if (answer.match(/^y(es)?$/i)) {
                        fs.copy(__dirname + '/tpl', Files.cwd + config.paths.root + localDirName + '/tpl', function(err) {
                            if (err) {
                                console.log(err.error + '\n\n');
                                process.exit(1);
                            }
                            console.log('\nCreated config templates.\n\n');
                            process.exit();
                        });
                    } else {
                        console.log('\nSkipped creating local templates.\n\n');
                        process.exit();
                    }
                });
            }
        });
    },

    /**
     * gets the file template based on extension
     * @param {string} extension Extension to get template for
     * @returns {string} Template
     */
    getTemplate: function(extension, cb) {

        if (extension === 'sass') {
            extension = 'scss';
        }

        // get tplFile
        var tplFile = __dirname + '/tpl/' + extension + '.tpl';
        if (fs.existsSync(Files.cwd + config.paths.root + localDirName + '/tpl/' + extension + '.tpl')) {
            tplFile = Files.cwd + config.paths.root + localDirName + '/tpl/' + extension + '.tpl';
        } else {
            if (checks.isProjectRoot(Files.cwd)) {
                console.log('No custom templates found. Using default template for .' + extension + ' file.');
            } else {
                console.log('Not running from a project root. Using default template for .' + extension + ' file.');
            }
        }

        fs.readFile(tplFile, 'utf8', function(err, data) {
            if (err) {
                console.error('\nError: cannot read template: "' + tplFile + '".\n\n');
                process.exit(1);
            }
            if (typeof cb === 'function') {
                cb(data);
            }
        });
    },

    /**
     * creates and writes files of requested type
     * @param {string} type Type to create (component/element)
     * @param {string} name Name
     * @param {object} [options] Options defined in cli program call
     * @param {boolean} options.html True if defined in cli
     * @param {boolean} options.js True if defined in cli
     * @param {boolean} options.scss True if defined in cli
     * @param {boolean} options.force True if defined in cli
     */
    createFiles: function(type, name, options) {

        var fileArray = [],
            filePath = config.paths[type] || null,
            fileCount = 0;

        if (checks.isProjectRoot(Files.cwd, options.force)) {

            // filepath should exist, else type is unsupported
            if (filePath !== null) {

                // create filepath and filename for each extension
                Files.extensions.forEach(function(extension, i) {
                    var ext = extension.substr(1, extension.length);
                    if (typeof options[ext] === 'undefined') {

                        var fileName = name;

                        // alter filename for sass partials
                        if (ext === 'scss' || ext === 'sass') {
                            fileName = '_' + name;
                        }

                        fileArray.push({
                            type: type,
                            name: name,
                            ext: ext,
                            file: Files.cwd + filePath + name + '/' + fileName + extension
                        });

                    }
                });

                if (fileArray.length > 0) {

                    // write all files in fileArray
                    Files.getTplAndWriteFile(fileArray, 0, function() {
                        console.log('\n' + type + ' "' + name + '" created.\n\n');
                        process.exit();
                    });

                }

            } else {

                console.error('\nError: unsupported type "' + type + '".\n\n');
                process.exit(1);
            }

        } else {
            console.error('\nError: no package.json found. "' + Files.cwd + '" is not a project root.\n\n');
            process.exit(1);
        }
    },

    /**
     * wrapper to check file existance and prompts user to overwrite or skip file creation
     * calls itself recursive untill all items from fileArray are processed
     * @param {array} fileArray Array of files to check and write
     * @param {integer} i Array index to process
     * @param {function} [cb] Callback function, called when all items of the array are processed
     */
    getTplAndWriteFile: function(fileArray, i, cb) {

        // file already exists?
        if (fs.existsSync(fileArray[i].file)) {

            console.log(fileArray[i].file + ' already exists.');

            rl.question("Overwrite? [yes]/no: ", function(answer) {
                if (answer.match(/^y(es)?$/i)) {

                    // overwrite
                    Files.writeFile(fileArray[i], function(err) {
                        if (err) {
                            console.error('\nError writing file: "' + fileArray[i].file + '".');
                        }

                        i++;

                        if (i < fileArray.length) {
                            Files.getTplAndWriteFile(fileArray, i, cb);
                        }

                        if (i === fileArray.length) {
                            if (typeof cb === 'function') {
                                cb();
                            }
                        }
                    });
                } else {

                    // skip
                    i++;

                    if (i < fileArray.length) {
                        Files.getTplAndWriteFile(fileArray, i, cb);
                    }

                    if (i === fileArray.length) {
                        if (typeof cb === 'function') {
                            cb();
                        }
                    }
                }

            });

        } else {

            // write file
            Files.writeFile(fileArray[i], function(err) {
                if (err) {
                    console.error('\nError writing file: "' + fileArray[i].file + '".');
                }

                i++;

                if (i < fileArray.length) {
                    Files.getTplAndWriteFile(fileArray, i, cb);
                }

                if (i === fileArray.length) {
                    if (typeof cb === 'function') {
                        cb();
                    }
                }
            });
        }
    },

    /**
     * writes files based on fetched templates
     * @param {object} fileData Object containing filedata
     * @param {function} [cb] Callback function, called when all items of the array are processed
     */
    writeFile: function(fileData, cb) {

        var name = fileData.name,
            ext = fileData.ext;

        Files.getTemplate(ext, function(fileTpl) {

            // replace template values
            var d = new Date(),
                months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];

            fileTpl = fileTpl.replace(/{{name}}/gi, name);
            fileTpl = fileTpl.replace(/{{ucfirst_name}}/gi, name.charAt(0).toUpperCase() + name.slice(1));
            fileTpl = fileTpl.replace(/{{author}}/gi, username.sync());
            fileTpl = fileTpl.replace(/{{date}}/gi, months[d.getMonth()] + ' ' + d.getFullYear());

            fileData.tpl = fileTpl;

            // write file
            fs.outputFile(fileData.file, fileData.tpl, function(err) {

                if (typeof cb === 'function') {
                    if (err) {
                        cb(err);
                    } else {
                        // set files to full access
                        fs.chmodSync(fileData.file, '0777');
                        cb();
                    }
                } else {
                    if (err) {
                        console.error('\nError writing file: "' + fileData.file + '".\n\n');
                        process.exit(1);
                    }

                    // set files to full access
                    fs.chmodSync(fileData.file, '0777');
                }
            });
        });
    }
};


text:
package litecart.admin;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import java.util.LinkedList;
import java.util.List;

import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;

/**
 * Created by olenamalishenko on 3/23/17.
 */
public class MenuCheck extends TestBase {

    @Test
    public void MenuCheck(){
//        login();
//        wait.until(titleIs("My Store"));
//        //Get all elements of left menu
//        List<WebElement> leftMenu = driver.findElements(By.cssSelector("li#app-"));
//        //Get string names of the left menu
//        List<String> leftMenuItems = getMenuNames(leftMenu);
//
//        //Iterate through names of left menu
//        for(String itemLevel1: leftMenuItems) {
//            //Get each menu item using its string name
//            driver.findElement(By.xpath("//span[.='" + itemLevel1 + "']")).click();
//            //Get all sub-elements of current menu item
//            List<WebElement> subMenu = driver.findElements(By.cssSelector("li[id^=doc-]"));
//            checkIfHeaderIsPresent();
//
//            //Get string names of sub-menu items for current menu item
//            List<String> leftMenuSubItems = getMenuNames(subMenu);
//            for (String itemLevel2 : leftMenuSubItems) {
//                driver.findElement(By.xpath("//span[.='" + itemLevel2 + "']")).click();
//                checkIfHeaderIsPresent();
//                System.out.println(itemLevel1 + " >> " + itemLevel2);
//            }
//        }
    }

//    private List<String> getMenuNames(List<WebElement> elList){
//        List<String> items = new LinkedList<>();
//        //generating set of first level menu items
//        for(WebElement el:elList){
//            items.add(el.getText());
//        }
//        return items;
//    }
//
//    private void checkIfHeaderIsPresent(){
//        List<WebElement> header = driver.findElements(By.cssSelector("h1"));
//        Assert.assertEquals("Header is absent", header.size(), 1);
//    }

}


text:
from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    url(r'^$', 'remindme.views.home', name='home'),
    url(r'^dashboard$', 'remindme.views.dashboard', name='dashboard'),
    url(r'^create$', 'remindme.views.create', name='create'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^accounts/', include('allauth.urls')),
]


text:
echo -e "\033[32mCreating database/user/passwd on ambari-server\033[0m"
docker exec ambari-server bash -c "mysql -uroot -p'root' -e \"CREATE USER 'hive'@'%' IDENTIFIED BY 'hive'\""
docker exec ambari-server bash -c "mysql -uroot -p'root' -e \"GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' IDENTIFIED BY 'hive'\""
docker exec ambari-server bash -c "mysql -uroot -p'root' -e \"CREATE DATABASE hive\""
docker exec ambari-server bash -c "mysql -uroot -p'root' -e \"FLUSH PRIVILEGES\""

echo -e "\033[32mSetting up jdbc driver on ambari-server\033[0m"
docker exec ambari-server bash -c "ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar"

echo -e "\033[32mRestarting ambari-server\033[0m"
docker exec ambari-server bash -c "ambari-server restart --debug"

echo -e "\033[33m
Please select [Existing MySQL/MariaDB]
# MySQL HOST: ambari-server
# MySQL PORT: 3306
# DATABASE NAME: hive
# DATABASE USER NAME: hive
# DATABASE PASSWORD: hive
\033[0m"

echo -e '\033[32mDone!!!\033[0m'


text:
package com.davidsoergel.conja;

/**
 * @author David Soergel
 * @version $Id$
 */
public class RuntimeExecutionException extends ChainedRuntimeException
	{
	public RuntimeExecutionException()
		{
		}

	public RuntimeExecutionException(final Throwable e)
		{
		super(e);
		}

	public RuntimeExecutionException(final String msg)
		{
		super(msg);
		}

	public RuntimeExecutionException(final Throwable e, final String s)
		{
		super(e, s);
		}
	}


text:
require "terminal-table"

require "sass-prof/config"
require "sass-prof/timer"
require "sass-prof/reporter"
require "sass-prof/formatter"
require "sass-prof/profiler"
require "sass-prof/fundef_profiler"
require "sass-prof/fun_profiler"
require "sass-prof/mixdef_profiler"
require "sass-prof/mix_profiler"
require "sass-prof/ext_profiler"
require "sass-prof/var_profiler"

# Monkey patch Sass to utilize Profiler
module Sass
  class Tree::Visitors::Perform

    #
    # Function definition
    #
    alias_method :__visit_function, :visit_function

    def visit_function(node)
      return __visit_function node if ::SassProf::Config.ignore.include? :fundef

      prof = ::SassProf::FundefProfiler.new(node.dup, :fundef, node.args.dup,
        @environment)
      prof.start

      value = __visit_function node

      prof.stop

      value
    end

    #
    # Mixin definition
    #
    alias_method :__visit_mixindef, :visit_mixindef

    def visit_mixindef(node)
      return __visit_mixindef node if ::SassProf::Config.ignore.include? :mixdef

      prof = ::SassProf::MixdefProfiler.new(node.dup, :mixdef, node.args.dup,
        @environment)
      prof.start

      value = __visit_mixindef node

      prof.stop

      value
    end

    #
    # Mixin perform
    #
    alias_method :__visit_mixin, :visit_mixin

    def visit_mixin(node)
      return __visit_mixin node if ::SassProf::Config.ignore.include? :mix

      prof = ::SassProf::MixProfiler.new(node.dup, :mix, node.args.dup,
        @environment)
      prof.start

      value = __visit_mixin node

      prof.stop

      value
    end
  end

  # class Selector::SimpleSequence
  #
  #   #
  #   # Extend perform
  #   #
  #   alias_method :__do_extend, :do_extend
  #
  #   def do_extend(extends, parent_directives, replace, seen)
  #     return __do_extend extends, parent_directives, replace,
  #       seen if ::SassProf::Config.ignore.include? :ext
  #
  #     prof = ::SassProf::ExtProfiler.new(self, :ext, nil,
  #       self)
  #     prof.start
  #
  #     value = __do_extend extends, parent_directives, replace, seen
  #
  #     prof.stop
  #
  #     value
  #   end
  # end

  class Script::Tree::Funcall

    #
    # Function perform
    #
    alias_method :__perform_sass_fn, :perform_sass_fn

    def perform_sass_fn(function, args, splat, environment)
      return __perform_sass_fn function, args, splat,
        environment if ::SassProf::Config.ignore.include? :fun

      prof = ::SassProf::FunProfiler.new(function.dup, :fun, args.dup,
        environment.dup)
      prof.start

      value = __perform_sass_fn function, args, splat, environment

      prof.stop

      value
    end
  end

  class Environment

    #
    # Variable declare
    #
    alias_method :__set_var, :set_var

    def set_var(name, value)
      return __set_var name,
        value if ::SassProf::Config.ignore.include? :var

      prof = ::SassProf::VarProfiler.new(name.dup, :var, value.dup,
        self)
      prof.start

      value = __set_var name, value

      prof.stop

      value
    end

    #
    # Global variable declare
    #
    alias_method :__set_global_var, :set_global_var

    def set_global_var(name, value)
      return __set_global_var name,
        value if ::SassProf::Config.ignore.include? :var

      prof = ::SassProf::VarProfiler.new(name.dup, :var, value.dup,
        self)
      prof.start

      value = __set_global_var name, value

      prof.stop

      value
    end

    #
    # Local variable declare
    #
    alias_method :__set_local_var, :set_local_var

    def set_local_var(name, value)
      return __set_local_var name,
        value if ::SassProf::Config.ignore.include? :var

      prof = ::SassProf::VarProfiler.new(name.dup, :var, value.dup,
        self)
      prof.start

      value = __set_local_var name, value

      prof.stop

      value
    end
  end

  class Engine
    alias_method :__render, :render

    def render
      __render
    ensure
      ::SassProf::Reporter.print_report
      ::SassProf::Reporter.reset_report
    end
  end
end


text:
/** TODO
  列表搜索条件接口全部放这里
**/
import filterConditionShootStyle from '../cache/db/module/filterCondition/shootStyle.js'
import filterConditionExterior from '../cache/db/module/filterCondition/exterior.js'
import filterConditionHotelType from '../cache/db/module/filterCondition/hotelType.js'
import filterConditionHotelDistrict from '../cache/db/module/filterCondition/hotelDistrict.js'

import filterConditionCarModels from '../cache/db/module/filterCondition/carModels.js'
import filterConditionCarLevel from '../cache/db/module/filterCondition/carLevel.js'
import filterConditionCarBrand from '../cache/db/module/filterCondition/carBrand.js'
import filterConditionSuppliesBrand from '../cache/db/module/filterCondition/suppliesBrand.js'
import filterConditionSuppliesType from '../cache/db/module/filterCondition/suppliesType.js'

import filterConditionDressType from '../cache/db/module/filterCondition/dressType.js'
import filterConditionDressBrand from '../cache/db/module/filterCondition/dressBrand.js'

import _ from 'lodash'
import env from '../cache/db/config.js'
let r = env.Thinky.r

const filterConditionApi = {
  'get+/exterior/all':function*(next){ //外景
    if (this.params.position === 'all') {
      this.model = filterConditionExterior.filter({})
    } else {
      this.model = filterConditionExterior.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionExterior';
    yield next
  },

  'get+/shootStyle/all':function*(next){ //风格
    if (this.params.position === 'all') {
      this.model = filterConditionShootStyle.filter({})
    } else {
      this.model = filterConditionShootStyle.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionShootStyle';
    yield next
  },

  'get+/hotelType/all':function*(next){ //风格
    if (this.params.position === 'all') {
      this.model = filterConditionHotelType.filter({})
    } else {
      this.model = filterConditionHotelType.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionHotelType';
    yield next
  },

  'get+/hotelDistrict/all':function*(next){ //酒店区域
    if (this.params.position === 'all') {
      this.model = filterConditionHotelDistrict.filter({})
    } else {
      this.model = filterConditionHotelDistrict.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionHotelDistrict';
    yield next
  },

  'get+/carModels/all':function*(next){ // 婚礼租车型号
    if (this.params.position === 'all') {
      this.model = filterConditionCarModels.filter({})
    } else {
      this.model = filterConditionCarModels.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionCarModels';
    yield next
  },

  'get+/carLevel/all':function*(next){ // 婚礼租车档次
    if (this.params.position === 'all') {
      this.model = filterConditionCarLevel.filter({})
    } else {
      this.model = filterConditionCarLevel.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionCarLevel';
    yield next
  },

  'get+/carBrand/all':function*(next){ // 婚礼租车品牌
    if (this.params.position === 'all') {
      this.model = filterConditionCarBrand.filter({})
    } else {
      this.model = filterConditionCarBrand.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionCarBrand';
    yield next
  },

  'get+/suppliesBrand/all':function*(next){ // 婚礼用品品牌
    if (this.params.position === 'all') {
      this.model = filterConditionSuppliesBrand.filter({})
    } else {
      this.model = filterConditionSuppliesBrand.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionSuppliesBrand';
    yield next
  },

  'get+/suppliesType/all':function*(next){ // 婚礼用品类型
    if (this.params.position === 'all') {
      this.model = filterConditionSuppliesType.filter({})
    } else {
      this.model = filterConditionSuppliesType.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionSuppliesType';
    yield next
  },

  // 婚纱礼服--类型
  'get+/dressType/all':function*(next){
    if (this.params.position === 'all') {
      this.model = filterConditionDressType.filter({})
    } else {
      this.model = filterConditionDressType.filter({
        position: this.params.position
      })
    }
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
    })

    this.APIKey = 'FilterConditionDressType';
    yield next
  },

  // 婚纱礼服--品牌
  'get+/dressBrand/all':function*(next){
    this.model = filterConditionDressBrand;
    this.model = this.model.orderBy(r.desc('weight'))

    _.each(this.request.query, (v, k) => {
      if (k.indexOf('pageSize') !== -1) {
        let limit = 0
        limit = Number(this.request.query['pageIndex'] || '1') - 1
        if (limit < 0) {
          limit = 0
        }
        this.model = this.model.skip(limit * Number(this.request.query["pageSize"] || '10'));
        this.model = this.model.limit(Number(this.request.query["pageSize"] || '10'));
      }
      else if(k.indexOf('position') !== -1) {
        this.model = this.model.filter({
          position: this.params.position})
      }
      else if(k.indexOf('weddingDressType') !== -1) {
        this.model = filterConditionDressBrand.filter({
          type: parseInt(this.request.query["weddingDressType"])
        })
      }
    })

    this.APIKey = 'FilterConditionDressBrand';
    yield next
  }

}
export default filterConditionApi


text:
<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <title>QPAT</title><meta name="generator" content="MATLAB 8.4"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2017-08-14"><meta name="DC.source" content="QPAT.m">

classdef QPAT < handle
    %QPAT QPAT is class for solving inverse problem in Quantitative
    %Photo-Acoustic Tomography. Instead of reconstructing traditional
    %coefficients like absorption, scattering, Gruneisen, it intends to
    %find out the invariants chi and q introduced in [1].

    % Numerically, the forward problem is solved by finite element method
    % (CG) on 2D unstructured triangle mesh. And the inverse problem is solved
    % by either optimization based method or direct method.

    % In this demo, domain is unit square [1cm x 1cm]. To be consistent, all
    % notations follow the paper [1].

    properties (Access = private)
    end

    properties (Access = public)
        H % cell array for measurements.
        param % struct of parameteres $\chi$ and q.

    end

    methods
        function obj = QPAT()
            % initialization of properties.
            obj.H = {}; obj.
        end
    end

    methods (Static)
        function [interpolate] = v_mapping()
        end

        function [interpolate] = e_mapping()
        end
    end

end

Error using QPAT
Error: File: /home/lurker/Documents/research/femex/example/otpat3/@QPAT/QPAT.m Line: 26 Column: 29
Expression or statement is incomplete or incorrect.

Published with MATLAB® R2014b


text:
#ifndef __NVM_INTERNAL_CTRL_H__
#define __NVM_INTERNAL_CTRL_H__

#include <nvm_types.h>

/* Forward declaration */
struct device;

/*
 * Look up file descriptor from controller handle.
 * Returns a valid file descriptor (positive integer) or -EBADF if the
 * controller memory is not mapped through this library.
 */
int _nvm_fd_from_ctrl(const nvm_ctrl_t* ctrl);

#ifdef _SISCI
/*
 * Look up device reference from controller handle.
 * Returns a device reference if used, or NULL if not used.
 */
const struct device* _nvm_device_from_ctrl(const nvm_ctrl_t* ctrl);
#endif

#endif /* __NVM_INTERNAL_CTRL_H__ */


text:
from pyspark import SparkConf
from pyspark import SparkContext

conf = SparkConf()
conf.setAppName('spark-basic')
sc = SparkContext(conf=conf)

def mod(x):
    return (x, x % 2)

rdd = sc.parallelize(range(1000)).map(mod).take(30)
print rdd


text: Re-enables the call to ofSetupScreen after being disabled with ofDisableSetupScreen


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>ICSSoft.Services.CurrentUserService</name>
    </assembly>
    <members>
        <member name="T:ICSSoft.Services.CurrentUser">
            <summary>
            Текущий пользователь приложения.
            </summary>
        </member>
        <member name="T:ICSSoft.Services.CurrentUserService.IUser">
            <summary>
            Учетные данные пользователя.
            </summary>
        </member>
        <member name="T:ICSSoft.Services.CurrentUserService">
            <summary>
            Сервис для получения текущего пользователя.
            </summary>
            <summary>
            Сервис для получения текущего пользователя.
            </summary>
        </member>
        <member name="F:ICSSoft.Services.CurrentUserService._container">
            <summary>
            Контейнер Unity Framework.
            </summary>
        </member>
        <member name="F:ICSSoft.Services.CurrentUserService._defaultUser">
            <summary>
            Пользователь по умолчанию, используемый в случае, если тип пользователя
            не зарегистрирован в конфигурации unity, либо его не удалось разрешить.
            </summary>
        </member>
        <member name="M:ICSSoft.Services.CurrentUserService.#cctor">
            <summary>
            Инициализация сервиса.
            </summary>
        </member>
        <member name="M:ICSSoft.Services.CurrentUserService.ResolveUser``1">
            <summary>
            Изменить способ получения текущего пользователя.
            </summary>
            <typeparam name="T">Класс, ответственный за работу с текущим пользователем.</typeparam>
        </member>
        <member name="M:ICSSoft.Services.CurrentUserService.Reset">
            <summary>
            Инициализирует настройки сервиса по умолчанию.
            </summary>
        </member>
        <member name="M:ICSSoft.Services.CurrentUserService.GetRegisteredUser">
            <summary>
            Получить пользователя, тип которого зарегистрирован в конфигурации unity.
            </summary>
            <returns>Данные о зарегистрированном пользователе, либо <c>null</c>, если его не удалось разрешить.</returns>
        </member>
        <member name="P:ICSSoft.Services.CurrentUserService.CurrentUser">
            <summary>
            Текущий пользователь.
            </summary>
        </member>
        <member name="T:ICSSoft.Services.CurrentUserService.IUser">
            <summary>
            Учетные данные пользователя.
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentUserService.IUser.Login">
            <summary>
            Логин пользователя ("vpupkin").
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentUserService.IUser.Domain">
            <summary>
            Домен пользователя.
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentUserService.IUser.FriendlyName">
            <summary>
            Имя пользователя ("VASYA Pupkin").
            </summary>
        </member>
        <member name="F:ICSSoft.Services.CurrentUser._webHttpUser">
            <summary>
            Текущий web-пользователь.
            </summary>
        </member>
        <member name="F:ICSSoft.Services.CurrentUser._winUser">
            <summary>
            Текущий windows-пользователь.
            </summary>
        </member>
        <member name="M:ICSSoft.Services.CurrentUser.GetUser">
            <summary>
            Получить пользователя в текущем окружении.
            </summary>
            <returns>
            Если текущее приложение исполняется в веб окружении,
            то вернет учетные данные о текущем web-пользователе, иначе о windows-пользователе.
            </returns>
        </member>
        <member name="P:ICSSoft.Services.CurrentUser.Login">
            <summary>
            Логин пользователя.
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentUser.Domain">
            <summary>
            Домен пользователя.
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentUser.FriendlyName">
            <summary>
            Имя пользователя.
            </summary>
        </member>
        <member name="T:ICSSoft.Services.CurrentWebHttpUser">
            <summary>
            Текущий пользователь в web-приложении.
            </summary>
        </member>
        <member name="F:ICSSoft.Services.CurrentWebHttpUser._login">
            <summary>
            Логин пользователя, заданный вручную.
            </summary>
        </member>
        <member name="F:ICSSoft.Services.CurrentWebHttpUser._domain">
            <summary>
            Домен пользователя, заданный вручную.
            </summary>
        </member>
        <member name="F:ICSSoft.Services.CurrentWebHttpUser._friendlyName">
            <summary>
            Имя пользователя, заданное вручную.
            </summary>
        </member>
        <member name="M:ICSSoft.Services.CurrentWebHttpUser.GetLogin">
            <summary>
            Получить логин пользователя в текущем веб окружении.
            </summary>
            <returns>Логин пользователя, либо <c>null</c>, если пользователь не авторизован.</returns>
        </member>
        <member name="M:ICSSoft.Services.CurrentWebHttpUser.GetDomain">
            <summary>
            Получить домен пользователя в текущем веб окружении.
            </summary>
            <returns>
            Домен пользователя, либо <c>null</c>, если пользователь не авторизован.
            Если домен в учетных данных не указан, то метод возвратит пустую строку.
            </returns>
        </member>
        <member name="M:ICSSoft.Services.CurrentWebHttpUser.GetIdentityName">
            <summary>
            Получить имя текущего пользователя (домен + логин) из текущего HTTP контекста.
            </summary>
            <returns>
            Имя текущего пользователя, включающее домен и логин, разделенные обратным слэшем.
            <para/>Если домен не задан, то метод вернет только логин.
            <para/>Если пользователь не авторизован, метод вернет <c>null</c>.
            </returns>
        </member>
        <member name="P:ICSSoft.Services.CurrentWebHttpUser.Login">
            <summary>
            Логин пользователя.
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentWebHttpUser.Domain">
            <summary>
            Домен пользователя.
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentWebHttpUser.FriendlyName">
            <summary>
            Имя пользователя.
            </summary>
        </member>
        <member name="T:ICSSoft.Services.CurrentWindowsUser">
            <summary>
            Текущий пользователь в windows-приложении.
            </summary>
        </member>
        <member name="F:ICSSoft.Services.CurrentWindowsUser._login">
            <summary>
            Логин пользователя.
            </summary>
        </member>
        <member name="M:ICSSoft.Services.CurrentWindowsUser.#ctor">
            <summary>
            Создать класс текущего пользователя и инициализировать данные из windows-окружения.
            </summary>
        </member>
        <member name="M:ICSSoft.Services.CurrentWindowsUser.GetUserFriendlyName(System.String)">
            <summary>
            Получить полное имя пользователя по его логину в Windows.
            </summary>
            <param name="login">Логин пользователя.</param>
            <returns>Полное имя пользователя, либо <c>null</c>, если его не удалось получить.</returns>
        </member>
        <member name="P:ICSSoft.Services.CurrentWindowsUser.Login">
            <summary>
            Логин пользователя.
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentWindowsUser.Domain">
            <summary>
            Домен пользователя.
            </summary>
        </member>
        <member name="P:ICSSoft.Services.CurrentWindowsUser.FriendlyName">
            <summary>
            Имя пользователя.
            </summary>
        </member>
        <member name="T:ICSSoft.Services.CurrentUserServiceExtensions">
            <summary>
            Class with extension methods for <see cref="T:ICSSoft.Services.CurrentUserService"/>.
            </summary>
        </member>
        <member name="M:ICSSoft.Services.CurrentUserServiceExtensions.GetDownLevelLogonName(ICSSoft.Services.CurrentUserService.IUser)">
            <summary>
            Returns user login in "DOMAIN\login" format (<see href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa380525(v=vs.85).aspx"/>).
            "DOMAIN" - NetBIOS domain name; "login" - user account name.
            </summary>
            <param name="user">User for building login.</param>
            <returns>User login in "DOMAIN\login" format.</returns>
        </member>
    </members>
</doc>


text:
package cs544.exercise9_1.exercise;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cs544.exercise9_1.sample.NoSuchResourceException;

public class BookDao implements IBookDao {
	private static int idCount = 1;
	private Map<Integer, Book> books = new HashMap<>();

	public BookDao() {
		add(new Book("Harry Potter and the Sorcerer's Stone", "978-0590353427", "J.K. Rowling", 8.79));
		add(new Book("The Color of Magic: A Discworld Novel", "978-0060855925", "Terry Pratchett", 11.19));
	}

	@Override
	public List<Book> getAll() {
		return new ArrayList<Book>(books.values());
	}

	@Override
	public void add(Book book) {
		book.setId(idCount);
		books.put(idCount, book);
		idCount++;
	}

	@Override
	public Book get(int id) {
		Book result = books.get(id);

		if (result == null) {
			throw new NoSuchResourceException("Book", id);
		}

		return result;
	}

	@Override
	public void update(int bookId, Book book) {
		books.put(bookId, book);
	}

	@Override
	public void delete(int bookId) {
		Book removed = books.remove(bookId);
		if (removed == null) {
			throw new NoSuchResourceException("Book", bookId);
		}
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>WALActionsListener (HBase 0.98.6-hadoop2 API)</title>
<meta name="date" content="2014-09-03">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.hadoop.hbase.regionserver.wal

Interface WALActionsListener

All Known Implementing Classes:

Replication

@InterfaceAudience.Private
public interface WALActionsListener

Get notification of FSHLog/WAL log events. The invocations are inline
 so make sure your implementation is fast else you'll slow hbase.

Method Summary

Methods

Modifier and Type
Method and Description

void
logCloseRequested()

The WAL is about to close.

void
logRollRequested()

A request was made that the WAL be rolled.

void
postLogArchive(org.apache.hadoop.fs.Path oldPath,
              org.apache.hadoop.fs.Path newPath)

The WAL has been archived.

void
postLogRoll(org.apache.hadoop.fs.Path oldPath,
           org.apache.hadoop.fs.Path newPath)

The WAL has been rolled.

void
preLogArchive(org.apache.hadoop.fs.Path oldPath,
             org.apache.hadoop.fs.Path newPath)

The WAL is going to be archived.

void
preLogRoll(org.apache.hadoop.fs.Path oldPath,
          org.apache.hadoop.fs.Path newPath)

The WAL is going to be rolled.

void
visitLogEntryBeforeWrite(HRegionInfo info,
                        HLogKey logKey,
                        WALEdit logEdit)

Called before each write.

void
visitLogEntryBeforeWrite(HTableDescriptor htd,
                        HLogKey logKey,
                        WALEdit logEdit)

Method Detail

preLogRoll

void preLogRoll(org.apache.hadoop.fs.Path oldPath,
              org.apache.hadoop.fs.Path newPath)
                throws IOException

The WAL is going to be rolled. The oldPath can be null if this is
 the first log file from the regionserver.

Parameters:

oldPath - the path to the old hlog

newPath - the path to the new hlog

Throws:

IOException

postLogRoll

void postLogRoll(org.apache.hadoop.fs.Path oldPath,
               org.apache.hadoop.fs.Path newPath)
                 throws IOException

The WAL has been rolled. The oldPath can be null if this is
 the first log file from the regionserver.

Parameters:

oldPath - the path to the old hlog

newPath - the path to the new hlog

Throws:

IOException

preLogArchive

void preLogArchive(org.apache.hadoop.fs.Path oldPath,
                 org.apache.hadoop.fs.Path newPath)
                   throws IOException

The WAL is going to be archived.

Parameters:

oldPath - the path to the old hlog

newPath - the path to the new hlog

Throws:

IOException

postLogArchive

void postLogArchive(org.apache.hadoop.fs.Path oldPath,
                  org.apache.hadoop.fs.Path newPath)
                    throws IOException

The WAL has been archived.

Parameters:

oldPath - the path to the old hlog

newPath - the path to the new hlog

Throws:

IOException

logRollRequested

void logRollRequested()

A request was made that the WAL be rolled.

logCloseRequested

void logCloseRequested()

The WAL is about to close.

visitLogEntryBeforeWrite

void visitLogEntryBeforeWrite(HRegionInfo info,
                            HLogKey logKey,
                            WALEdit logEdit)

Called before each write.

Parameters:

info -

logKey -

logEdit -

visitLogEntryBeforeWrite

void visitLogEntryBeforeWrite(HTableDescriptor htd,
                            HLogKey logKey,
                            WALEdit logEdit)

Parameters:

htd -

logKey -

logEdit -

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2014 The Apache Software Foundation. All rights reserved.


text:
(function() {
  var __slice = Array.prototype.slice,
    __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

  BeerCan.Ability = (function() {

    function Ability() {}

    Ability.prototype.can = function() {
      var action, args, match, subject;
      action = arguments[0], subject = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
      match = relevantRulesForMatch(action, subject).detect(function(rule) {
        return rule.matchesConditions.apply(rule, [action, subject].concat(__slice.call(args)));
      });
      if (match) {
        return match.baseBehavior;
      } else {
        return false;
      }
    };

    Ability.prototype.cannot = function() {
      var args;
      args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      return !can.apply(null, args);
    };

    Ability.prototype.can = function(action, subject, closure) {
      return rules.concat(BeerCan.Rule["new"](true, action, subject, closure));
    };

    Ability.prototype.cannot = function(action, subject, closure) {
      return rules.concat(BeerCan.Rule["new"](false, action, subject, closure));
    };

    Ability.prototype.defaultAliasActions = function() {
      return {
        'read': ['index', 'show'],
        'create': ['new'],
        'update': ['edit']
      };
    };

    Ability.prototype.aliasedActions = function() {
      var _ref;
      return (_ref = this.aliasedActions) != null ? _ref : this.aliasedActions = defaultAliasActions;
    };

    Ability.prototype.aliasAction = function() {
      var args, target;
      args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      target = args.remove('to');
      if (aliasedActions[target] == null) aliasedActions[target] = [];
      return aliasedActions[target] += args;
    };

    Ability.prototype.clearAliasedActions = function() {
      return this.aliasedActions = {};
    };

    Ability.prototype.aliasesForAction = function(action) {
      var results;
      results = _.flatten([action]);
      _.each(aliasedActions, function(aliasedAction, actions) {
        if (__indexOf.call(actions, action) >= 0) {
          return results += aliasesForAction(aliasedAction);
        }
      });
      return results;
    };

    Ability.prototype.rules = function() {
      var _ref;
      return (_ref = this.rules) != null ? _ref : this.rules = [];
    };

    Ability.prototype.relevantRules = function(action, subject) {
      return _.reverse(rules).select(function(rule) {
        rule.expandedActions = expandActions(rule.actions);
        return rule.relevant(action, subject);
      });
    };

    return Ability;

  })();

  module.exports = BeerCan.Ability;

}).call(this);


text:
.class Lcom/zte/mifavor/widget/TimePickerZTE$3;
.super Ljava/lang/Object;
.source "TimePickerZTE.java"

# interfaces
.implements Lcom/zte/mifavor/widget/NumberPickerZTE$OnValueChangeListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/zte/mifavor/widget/TimePickerZTE;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

# direct methods
.method constructor <init>(Lcom/zte/mifavor/widget/TimePickerZTE;)V
    .locals 0

    .prologue
    .line 214
    iput-object p1, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

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

    return-void
.end method

# virtual methods
.method public onValueChange(Lcom/zte/mifavor/widget/NumberPickerZTE;II)V
    .locals 7
    .param p1, "spinner"    # Lcom/zte/mifavor/widget/NumberPickerZTE;
    .param p2, "oldVal"    # I
    .param p3, "newVal"    # I

    .prologue
    const/4 v3, 0x1

    const/4 v4, 0x0

    .line 217
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # invokes: Lcom/zte/mifavor/widget/TimePickerZTE;->updateInputState()V
    invoke-static {v5}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$000(Lcom/zte/mifavor/widget/TimePickerZTE;)V

    .line 218
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # getter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mMinuteSpinner:Lcom/zte/mifavor/widget/NumberPickerZTE;
    invoke-static {v5}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$400(Lcom/zte/mifavor/widget/TimePickerZTE;)Lcom/zte/mifavor/widget/NumberPickerZTE;

    move-result-object v5

    invoke-virtual {v5}, Lcom/zte/mifavor/widget/NumberPickerZTE;->getMinValue()I

    move-result v1

    .line 219
    .local v1, "minValue":I
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # getter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mMinuteSpinner:Lcom/zte/mifavor/widget/NumberPickerZTE;
    invoke-static {v5}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$400(Lcom/zte/mifavor/widget/TimePickerZTE;)Lcom/zte/mifavor/widget/NumberPickerZTE;

    move-result-object v5

    invoke-virtual {v5}, Lcom/zte/mifavor/widget/NumberPickerZTE;->getMaxValue()I

    move-result v0

    .line 220
    .local v0, "maxValue":I
    if-ne p2, v0, :cond_3

    if-ne p3, v1, :cond_3

    .line 221
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # getter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mHourSpinner:Lcom/zte/mifavor/widget/NumberPickerZTE;
    invoke-static {v5}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$500(Lcom/zte/mifavor/widget/TimePickerZTE;)Lcom/zte/mifavor/widget/NumberPickerZTE;

    move-result-object v5

    invoke-virtual {v5}, Lcom/zte/mifavor/widget/NumberPickerZTE;->getValue()I

    move-result v5

    add-int/lit8 v2, v5, 0x1

    .line 222
    .local v2, "newHour":I
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    invoke-virtual {v5}, Lcom/zte/mifavor/widget/TimePickerZTE;->is24HourView()Z

    move-result v5

    if-nez v5, :cond_0

    const/16 v5, 0xc

    if-ne v2, v5, :cond_0

    .line 223
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    iget-object v6, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # getter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mIsAm:Z
    invoke-static {v6}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$100(Lcom/zte/mifavor/widget/TimePickerZTE;)Z

    move-result v6

    if-nez v6, :cond_2

    :goto_0
    # setter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mIsAm:Z
    invoke-static {v5, v3}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$102(Lcom/zte/mifavor/widget/TimePickerZTE;Z)Z

    .line 224
    iget-object v3, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # invokes: Lcom/zte/mifavor/widget/TimePickerZTE;->updateAmPmControl()V
    invoke-static {v3}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$200(Lcom/zte/mifavor/widget/TimePickerZTE;)V

    .line 226
    :cond_0
    iget-object v3, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # getter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mHourSpinner:Lcom/zte/mifavor/widget/NumberPickerZTE;
    invoke-static {v3}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$500(Lcom/zte/mifavor/widget/TimePickerZTE;)Lcom/zte/mifavor/widget/NumberPickerZTE;

    move-result-object v3

    invoke-virtual {v3, v2}, Lcom/zte/mifavor/widget/NumberPickerZTE;->setValue(I)V

    .line 236
    .end local v2    # "newHour":I
    :cond_1
    :goto_1
    iget-object v3, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # invokes: Lcom/zte/mifavor/widget/TimePickerZTE;->onTimeChanged()V
    invoke-static {v3}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$300(Lcom/zte/mifavor/widget/TimePickerZTE;)V

    .line 237
    return-void

    .restart local v2    # "newHour":I
    :cond_2
    move v3, v4

    .line 223
    goto :goto_0

    .line 227
    .end local v2    # "newHour":I
    :cond_3
    if-ne p2, v1, :cond_1

    if-ne p3, v0, :cond_1

    .line 228
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # getter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mHourSpinner:Lcom/zte/mifavor/widget/NumberPickerZTE;
    invoke-static {v5}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$500(Lcom/zte/mifavor/widget/TimePickerZTE;)Lcom/zte/mifavor/widget/NumberPickerZTE;

    move-result-object v5

    invoke-virtual {v5}, Lcom/zte/mifavor/widget/NumberPickerZTE;->getValue()I

    move-result v5

    add-int/lit8 v2, v5, -0x1

    .line 229
    .restart local v2    # "newHour":I
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    invoke-virtual {v5}, Lcom/zte/mifavor/widget/TimePickerZTE;->is24HourView()Z

    move-result v5

    if-nez v5, :cond_4

    const/16 v5, 0xb

    if-ne v2, v5, :cond_4

    .line 231
    iget-object v5, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    iget-object v6, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # getter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mIsAm:Z
    invoke-static {v6}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$100(Lcom/zte/mifavor/widget/TimePickerZTE;)Z

    move-result v6

    if-nez v6, :cond_5

    :goto_2
    # setter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mIsAm:Z
    invoke-static {v5, v3}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$102(Lcom/zte/mifavor/widget/TimePickerZTE;Z)Z

    .line 232
    iget-object v3, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # invokes: Lcom/zte/mifavor/widget/TimePickerZTE;->updateAmPmControl()V
    invoke-static {v3}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$200(Lcom/zte/mifavor/widget/TimePickerZTE;)V

    .line 234
    :cond_4
    iget-object v3, p0, Lcom/zte/mifavor/widget/TimePickerZTE$3;->this$0:Lcom/zte/mifavor/widget/TimePickerZTE;

    # getter for: Lcom/zte/mifavor/widget/TimePickerZTE;->mHourSpinner:Lcom/zte/mifavor/widget/NumberPickerZTE;
    invoke-static {v3}, Lcom/zte/mifavor/widget/TimePickerZTE;->access$500(Lcom/zte/mifavor/widget/TimePickerZTE;)Lcom/zte/mifavor/widget/NumberPickerZTE;

    move-result-object v3

    invoke-virtual {v3, v2}, Lcom/zte/mifavor/widget/NumberPickerZTE;->setValue(I)V

    goto :goto_1

    :cond_5
    move v3, v4

    .line 231
    goto :goto_2
.end method


text:
package ch.rasc.downloadchart;

public class JpegOptions {
	public Integer quality;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace InvoiceApplication.Entities
{
    [XmlRoot("Comprobante", Namespace = "http://www.sat.gob.mx/cfd/3")]
    public class Invoice
    {
        #region Properties

        [XmlElement("Emisor", typeof(Issuer), Namespace = "http://www.sat.gob.mx/cfd/3")]
        public Issuer Issuer { get; set; }
        public string UUID
        {
            get
            {
                return this.Complement.DigitalTaxStamp.UUID.ToUpper();
            }
        }

        [XmlAttribute("folio")]
        public int Folio {get; set; }

        [XmlAttribute("fecha")]
        public DateTime Date {get; set; }

        [XmlAttribute("Moneda")]
        public string Currency { get; set; }

        [XmlAttribute("subTotal")]
        public double Subtotal { get; set; }
        [XmlAttribute("total")]
        public double Total { get; set; }

        [XmlArray("Conceptos", Namespace = "http://www.sat.gob.mx/cfd/3")]
        [XmlArrayItem("Concepto", typeof(Item), Namespace = "http://www.sat.gob.mx/cfd/3")]
        public List<Item> Items { get; set; }

        [XmlElement("Impuestos", typeof(Taxes), Namespace = "http://www.sat.gob.mx/cfd/3")]
        public Taxes Taxes { get; set; }

        [XmlElement("Complemento", typeof(Complement), Namespace = "http://www.sat.gob.mx/cfd/3")]
        public Complement Complement { get; set; }

        public string FilePath { get; set; }

        #endregion
    }
}


text:
var assert = require("assert")
  , path = require("path")
  , mkdir = require("mkdirp")
  , chownr = require("chownr")
  , pathIsInside = require("path-is-inside")
  , readJson = require("read-package-json")
  , log = require("npmlog")
  , npm = require("../npm.js")
  , tar = require("../utils/tar.js")
  , deprCheck = require("../utils/depr-check.js")
  , getCacheStat = require("./get-stat.js")
  , cachedPackageRoot = require("./cached-package-root.js")
  , addLocalTarball = require("./add-local-tarball.js")
  , sha = require("sha")

module.exports = addLocal

function addLocal (p, pkgData, cb_) {
  assert(typeof p === "object", "must have spec info")
  assert(typeof cb === "function", "must have callback")

  pkgData = pkgData || {}

  function cb (er, data) {
    if (er) {
      log.error("addLocal", "Could not install %s", p.spec)
      return cb_(er)
    }
    if (data && !data._fromGithub) {
      data._from = path.relative(npm.prefix, p.spec) || "."
      var resolved = path.relative(npm.prefix, p.spec)
      if (resolved) data._resolved = "file:"+resolved
    }
    return cb_(er, data)
  }

  if (p.type === "directory") {
    addLocalDirectory(p.spec, pkgData, null, cb)
  }
  else {
    addLocalTarball(p.spec, pkgData, null, cb)
  }
}

// At this point, if shasum is set, it's something that we've already
// read and checked.  Just stashing it in the data at this point.
function addLocalDirectory (p, pkgData, shasum, cb) {
  assert(pkgData, "must pass package data")
  assert(typeof cb === "function", "must have callback")

  // if it's a folder, then read the package.json,
  // tar it to the proper place, and add the cache tar
  if (pathIsInside(p, npm.cache)) return cb(new Error(
    "Adding a cache directory to the cache will make the world implode."))

  readJson(path.join(p, "package.json"), false, function (er, data) {
    if (er) return cb(er)

    if (!data.name) {
      return cb(new Error("No name provided in package.json"))
    }
    else if (pkgData.name && pkgData.name !== data.name) {
      return cb(new Error(
        "Invalid package: expected " + pkgData.name + " but found " + data.name
      ))
    }

    if (!data.version) {
      return cb(new Error("No version provided in package.json"))
    }
    else if (pkgData.version && pkgData.version !== data.version) {
      return cb(new Error(
        "Invalid package: expected " + pkgData.name + "@" + pkgData.version +
          " but found " + data.name + "@" + data.version
      ))
    }

    deprCheck(data)

    // pack to {cache}/name/ver/package.tgz
    var root = cachedPackageRoot(data)
    var tgz = path.resolve(root, "package.tgz")
    var pj = path.resolve(root, "package/package.json")
    getCacheStat(function (er, cs) {
      mkdir(path.dirname(pj), function (er, made) {
        if (er) return cb(er)
        var fancy = !pathIsInside(p, npm.tmp)
        tar.pack(tgz, p, data, fancy, function (er) {
          if (er) {
            log.error( "addLocalDirectory", "Could not pack %j to %j"
                     , p, tgz )
            return cb(er)
          }

          if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) next()

          chownr(made || tgz, cs.uid, cs.gid, next)
        })
      })
    })

    function next (er) {
      if (er) return cb(er)
      // if we have the shasum already, just add it
      if (shasum) {
        return addLocalTarball(tgz, data, shasum, cb)
      } else {
        sha.get(tgz, function (er, shasum) {
          if (er) {
            return cb(er)
          }
          data._shasum = shasum
          return addLocalTarball(tgz, data, shasum, cb)
        })
      }
    }
  })
}


text:
package middleware

import (
	"net/http"

	"github.com/gorilla/context"
	"github.com/spf13/viper"
)

var settings map[string]interface{}

func init() {
	settings = viper.AllSettings()
}

// SettingsContext sets all the app settings on the request context
type SettingsContext struct{}

// NewSettingsContext returns a new instance of AppSettingsContext
func NewSettingsContext() *SettingsContext {
	return &SettingsContext{}
}

func (sc *SettingsContext) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {

	// Set all settings on the context
	for k, v := range settings {
		context.Set(r, k, v)
	}

	next(rw, r)
}


text:
using System;

namespace Abp.AutoMapper
{
    [Flags]
    public enum AutoMapDirection
    {
        From,
        To
    }
}


text:
layout: page
title: Harrison 20th Anniversary
date: 2016-05-24
author: Betty Bates
tags: weekly links, java
status: published
summary: Curabitur eleifend risus in arcu elementum, id.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 09/11/2016
  endDate: 09/14/2016
  ctyhocn: HIBHXHX
  groupCode: H2A
published: true
---
Duis semper orci ante, nec rutrum mauris volutpat non. Quisque id venenatis purus. Cras tristique gravida tristique. Fusce at est nisl. Donec in pretium lectus. Suspendisse ut dignissim magna. Morbi vitae mi neque. Suspendisse in lacus sit amet dolor viverra sagittis. Nam fringilla nisi a turpis hendrerit iaculis. Vestibulum in lobortis urna.
Nullam eget arcu metus. Morbi sagittis augue in gravida eleifend. Cras non venenatis urna. Mauris sed magna varius, hendrerit ligula vitae, mollis quam. Phasellus facilisis vel leo et tincidunt. Duis eu sollicitudin tellus. Quisque vel lacus sit amet nulla suscipit accumsan. Suspendisse fringilla nulla vel metus hendrerit, ac finibus odio tincidunt. Aliquam euismod diam in massa porta, sed viverra erat ullamcorper. Curabitur mollis metus vel ante varius aliquet. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla sit amet facilisis mauris. Aenean tincidunt scelerisque suscipit.

1 Ut eget elit a nunc tristique condimentum ac eget mauris
1 Pellentesque eget orci congue, ornare diam et, eleifend turpis
1 Praesent tempus nulla in dictum interdum
1 Nulla fringilla urna id sagittis pretium.

Nam eu elit vitae sapien posuere ullamcorper id nec leo. Fusce euismod sapien in lobortis tristique. Quisque ut lobortis massa, id molestie tortor. Curabitur eleifend semper massa, eu maximus dui rhoncus at. Phasellus pellentesque neque eget est sollicitudin laoreet. Proin mattis neque ut rhoncus accumsan. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed posuere felis non lorem sagittis finibus. Praesent et rutrum nisl. Mauris sollicitudin accumsan eros a iaculis. Suspendisse potenti. Maecenas sagittis rhoncus interdum. Quisque sollicitudin fermentum nisi eget pretium. Phasellus accumsan mauris nibh, sit amet bibendum nulla scelerisque vel. Sed feugiat tortor ex, sit amet gravida nulla suscipit eget. Nam non mi mi.


text:
import { CMD } from '../../interfaces';
import Config from '../../helpers/config';
import YargsOptions from '../../helpers/yargs-options';
import Jobs from '../../helpers/jobs';
import reply from '../../helpers/reply';

const yargsOptions = new YargsOptions();

export = {
    command: 'recover <cluster-alias> <id>',
    describe: 'Run recovery on cluster for specified job id.\n',
    builder(yargs: any) {
        yargs.options('config-dir', yargsOptions.buildOption('config-dir'));
        yargs.options('output', yargsOptions.buildOption('output'));
        yargs.strict()
            .example('$0 jobs recover cluster1 99999999-9999-9999-9999-999999999999');
        return yargs;
    },
    async handler(argv: any) {
        const cliConfig = new Config(argv);
        const jobs = new Jobs(cliConfig);

        try {
            await jobs.recover();
        } catch (e) {
            reply.fatal(e);
        }
    }
} as CMD;


text:
var app = angular.module('contactsSync', [ 'ngMaterial' ])
    .config(function($mdThemingProvider) {
    $mdThemingProvider.theme('default')
        .primaryPalette('pink')
        .accentPalette('orange');
});